diff --git a/.hgtags-top-repo b/.hgtags-top-repo index ecdc65b6c89..fe0f260a5a3 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -305,3 +305,4 @@ f25ee9f62427a9ba27418e5531a89754791a305b jdk9-b57 9fa2185bee17462d1014538bff60af6e6f0b01e7 jdk9-b60 ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61 105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62 +0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63 diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4 index 210cc455047..1233c168d74 100644 --- a/common/autoconf/basics_windows.m4 +++ b/common/autoconf/basics_windows.m4 @@ -320,8 +320,8 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], 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 + CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.[0-6]'` + if test "x$CYGWIN_VERSION_OLD" != 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 diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index c0f0c07b4c8..a387def6474 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -306,7 +306,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac) BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH, javah) BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar) - BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII, native2ascii) BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner) # Finally, set some other options... diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in index 6e68c3a0b34..5c51176271b 100644 --- a/common/autoconf/bootcycle-spec.gmk.in +++ b/common/autoconf/bootcycle-spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +57,5 @@ JAVA_CMD:=$(BOOT_JDK)/bin/java JAVAC_CMD:=$(BOOT_JDK)/bin/javac JAVAH_CMD:=$(BOOT_JDK)/bin/javah JAR_CMD:=$(BOOT_JDK)/bin/jar -NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 84df8837c7e..307fcfc0e1b 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -65,12 +65,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], fi AC_SUBST(POST_STRIP_CMD) - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # FIXME: break out into MCSFLAGS - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" - fi - AC_SUBST(POST_MCS_CMD) - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then CC_OUT_OPTION=-Fo EXE_OUT_OPTION=-out: diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index bc5063b9662..dbe3f079f9a 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -737,7 +737,6 @@ AR_OUT_OPTION LD_OUT_OPTION EXE_OUT_OPTION CC_OUT_OPTION -POST_MCS_CMD POST_STRIP_CMD ARFLAGS COMPILER_TARGET_BITS_FLAG @@ -759,7 +758,6 @@ ac_ct_OBJCOPY OBJCOPY ac_ct_NM ac_ct_STRIP -MCS GNM NM STRIP @@ -820,7 +818,6 @@ LANGTOOLS_TOPDIR JAVAC_FLAGS BOOT_JDK_SOURCETARGET JARSIGNER -NATIVE2ASCII JAR JAVAH JAVAC @@ -1189,7 +1186,6 @@ JAVA JAVAC JAVAH JAR -NATIVE2ASCII JARSIGNER CC CFLAGS @@ -1207,7 +1203,6 @@ LIPO STRIP NM GNM -MCS OBJCOPY OBJDUMP BUILD_CC @@ -2070,8 +2065,6 @@ Some influential environment variables: JAVAC Override default value for JAVAC JAVAH Override default value for JAVAH JAR Override default value for JAR - NATIVE2ASCII - Override default value for NATIVE2ASCII JARSIGNER Override default value for JARSIGNER CC C compiler command CFLAGS C compiler flags @@ -2090,7 +2083,6 @@ Some influential environment variables: STRIP Override default value for STRIP NM Override default value for NM GNM Override default value for GNM - MCS Override default value for MCS OBJCOPY Override default value for OBJCOPY OBJDUMP Override default value for OBJDUMP BUILD_CC Override default value for BUILD_CC @@ -3599,7 +3591,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # ... then the rest # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4367,7 +4359,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1430331133 +DATE_WHEN_GENERATED=1430918902 ############################################################################### # @@ -14052,8 +14044,8 @@ $as_echo "$CYGWIN_VERSION" >&6; } 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 + CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.0-6'` + if test "x$CYGWIN_VERSION_OLD" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5 $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;} as_fn_error $? "Cannot continue" "$LINENO" 5 @@ -26054,133 +26046,6 @@ $as_echo "$tool_specified" >&6; } - # Use user overridden value if available, otherwise locate tool in the Boot JDK. - - # Publish this variable in the help. - - - if test "x$NATIVE2ASCII" = x; then - # The variable is not set by user, try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5 -$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 "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: 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 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !NATIVE2ASCII! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NATIVE2ASCII!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNATIVE2ASCII" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NATIVE2ASCII from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NATIVE2ASCII from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5 -$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 "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: 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 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if the provided tool contains a complete path. - tool_specified="$NATIVE2ASCII" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NATIVE2ASCII=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NATIVE2ASCII=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; 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_NATIVE2ASCII+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $NATIVE2ASCII in - [\\/]* | ?:[\\/]*) - ac_cv_path_NATIVE2ASCII="$NATIVE2ASCII" # 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_NATIVE2ASCII="$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 -NATIVE2ASCII=$ac_cv_path_NATIVE2ASCII -if test -n "$NATIVE2ASCII"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NATIVE2ASCII" >&5 -$as_echo "$NATIVE2ASCII" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$NATIVE2ASCII" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NATIVE2ASCII=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NATIVE2ASCII=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NATIVE2ASCII" >&5 -$as_echo_n "checking for NATIVE2ASCII... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NATIVE2ASCII=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - - # Use user overridden value if available, otherwise locate tool in the Boot JDK. # Publish this variable in the help. @@ -28232,7 +28097,7 @@ $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run c # For solaris we really need solaris tools, and not the GNU equivalent. # The build tools on Solaris reside in /usr/ccs (C Compilation System), # so add that to path before starting to probe. - # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. + # FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP. if test "x$OPENJDK_BUILD_OS" = xsolaris; then PATH="/usr/ccs/bin:$PATH" fi @@ -36672,479 +36537,6 @@ $as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} fi fi - - - - # Publish this variable in the help. - - - if test "x$MCS" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in mcs -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_MCS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # 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_MCS="$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 -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MCS" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !MCS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MCS!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMCS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in mcs -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_MCS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # 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_MCS="$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 -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$MCS" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if the provided tool contains a complete path. - tool_specified="$MCS" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MCS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MCS=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MCS+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # 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_MCS="$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 -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$MCS" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MCS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MCS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MCS" >&5 -$as_echo_n "checking for MCS... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MCS=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - - - # Only process if variable expands to non-empty - - if test "x$MCS" != x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$MCS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # 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 - new_path=`$CYGPATH -u "$path"` - fi - 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, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # 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 - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $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}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 - fi - 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 presence. - # 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 - # 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" - elif test -f "${new_path}.cmd"; then - 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;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-style (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $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 - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$MCS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - 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 - - - # 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, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - 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 - - - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in MSYS 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 - new_path="$path" - - 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 - - fi - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $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}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $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 \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - 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 - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # 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}") - fi - - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$MCS" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - 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 - 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 -$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;} - fi - fi - elif test "x$OPENJDK_TARGET_OS" != xwindows; then # FIXME: we should unify this with the solaris case above. @@ -41632,12 +41024,6 @@ $as_echo "$tool_specified" >&6; } fi - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # FIXME: break out into MCSFLAGS - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" - fi - - if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then CC_OUT_OPTION=-Fo EXE_OUT_OPTION=-out: diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index d9c172dc964..b603ae89cff 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -391,7 +391,6 @@ ARFLAGS:=@ARFLAGS@ NM:=@NM@ GNM:=@GNM@ STRIP:=@STRIP@ -MCS:=@MCS@ LIPO:=@LIPO@ @@ -440,7 +439,6 @@ EXE_SUFFIX:=@EXE_SUFFIX@ OBJ_SUFFIX:=@OBJ_SUFFIX@ POST_STRIP_CMD:=@POST_STRIP_CMD@ -POST_MCS_CMD:=@POST_MCS_CMD@ JAVA_FLAGS:=@JAVA_FLAGS@ JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@ @@ -455,7 +453,6 @@ JAVA_CMD:=@JAVA@ JAVAC_CMD:=@JAVAC@ JAVAH_CMD:=@JAVAH@ JAR_CMD:=@JAR@ -NATIVE2ASCII_CMD:=@NATIVE2ASCII@ JARSIGNER_CMD:=@JARSIGNER@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@ # These variables are meant to be used. They are defined with = instead of := to make @@ -465,7 +462,6 @@ JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS) JAVAC=@FIXPATH@ $(JAVAC_CMD) JAVAH=@FIXPATH@ $(JAVAH_CMD) JAR=@FIXPATH@ $(JAR_CMD) -NATIVE2ASCII=@FIXPATH@ $(NATIVE2ASCII_CMD) $(JAVA_TOOL_FLAGS_SMALL) JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD) # A specific java binary with specific options can be used to run # the long running background sjavac servers and other long running tasks. @@ -692,10 +688,10 @@ SYMBOLS_IMAGE_SUBDIR:=symbols SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR) # Macosx bundles directory definitions -JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents -JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents -JDK_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_BUNDLE_SUBDIR) -JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR) +JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents +JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents +JDK_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR) +JRE_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR) # This macro is called to allow inclusion of closed source counterparts. # Unless overridden in closed sources, it expands to nothing. diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 4a3c6426273..553db0380d9 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -210,7 +210,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION], # For solaris we really need solaris tools, and not the GNU equivalent. # The build tools on Solaris reside in /usr/ccs (C Compilation System), # so add that to path before starting to probe. - # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. + # FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP. if test "x$OPENJDK_BUILD_OS" = xsolaris; then PATH="/usr/ccs/bin:$PATH" fi @@ -569,9 +569,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA], BASIC_FIXUP_EXECUTABLE(NM) BASIC_PATH_PROGS(GNM, gnm) BASIC_FIXUP_EXECUTABLE(GNM) - - BASIC_PATH_PROGS(MCS, mcs) - BASIC_FIXUP_EXECUTABLE(MCS) elif test "x$OPENJDK_TARGET_OS" != xwindows; then # FIXME: we should unify this with the solaris case above. BASIC_CHECK_TOOLS(STRIP, strip) diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 0553eb826fc..c076cd3aeb7 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1156,7 +1156,6 @@ jdk/src/java.management/share/classes/com/sun/jmx/defaults : jdk/src/share/class jdk/src/java.management/share/classes/com/sun/jmx/interceptor : jdk/src/share/classes/com/sun/jmx/interceptor jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver : jdk/src/share/classes/com/sun/jmx/mbeanserver jdk/src/java.management/share/classes/com/sun/jmx/remote : jdk/src/share/classes/com/sun/jmx/remote -jdk/src/java.management/share/classes/com/sun/management : jdk/src/share/classes/com/sun/management jdk/src/java.management/share/classes/java/lang/management : jdk/src/share/classes/java/lang/management jdk/src/java.management/share/classes/javax/management : jdk/src/share/classes/javax/management jdk/src/java.management/share/classes/mgmt-overview.html : jdk/src/share/classes/com/sun/management/mgmt-overview.html @@ -1429,6 +1428,7 @@ jdk/src/jdk.localedata/share/classes/sun/util/resources/tr : jdk/src/share/class jdk/src/jdk.localedata/share/classes/sun/util/resources/uk : jdk/src/share/classes/sun/util/resources/uk jdk/src/jdk.localedata/share/classes/sun/util/resources/vi : jdk/src/share/classes/sun/util/resources/vi jdk/src/jdk.localedata/share/classes/sun/util/resources/zh : jdk/src/share/classes/sun/util/resources/zh +jdk/src/jdk.management/share/classes/com/sun/management : jdk/src/share/classes/com/sun/management jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns : jdk/src/share/classes/com/sun/jndi/dns jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/url/dns : jdk/src/share/classes/com/sun/jndi/url/dns jdk/src/jdk.naming.dns/share/classes/META-INF/services : jdk/src/share/classes/sun/net/spi/nameservice/dns/META-INF/services diff --git a/corba/.hgtags b/corba/.hgtags index b1d9426e786..ee596409fdf 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -305,3 +305,4 @@ cda6ae062f85fac5555f4e1318885b0ecd998bd1 jdk9-b59 caa330b275f39282793466529f6864766b31d9fd jdk9-b60 d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61 d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62 +0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63 diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java index 0f3428ac029..f4af63423c0 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java @@ -222,7 +222,7 @@ public class AnyImpl extends Any /** * returns the type of the element contained in the Any. * - * @result the TypeCode for the element in the Any + * @return the TypeCode for the element in the Any */ public TypeCode type() { return typeCode; @@ -267,7 +267,7 @@ public class AnyImpl extends Any * checks for equality between Anys. * * @param otherAny the Any to be compared with. - * @result true if the Anys are equal, false otherwise. + * @return true if the Anys are equal, false otherwise. */ public boolean equal(Any otherAny) { @@ -508,7 +508,7 @@ public class AnyImpl extends Any /** * returns an output stream that an Any value can be marshaled into. * - * @result the OutputStream to marshal value of Any into + * @return the OutputStream to marshal value of Any into */ public org.omg.CORBA.portable.OutputStream create_output_stream() { @@ -525,7 +525,7 @@ public class AnyImpl extends Any /** * returns an input stream that an Any value can be marshaled out of. * - * @result the InputStream to marshal value of Any out of. + * @return the InputStream to marshal value of Any out of. */ public org.omg.CORBA.portable.InputStream create_input_stream() { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java index b4769023e30..4c91de2ef23 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CDROutputObject.java @@ -166,7 +166,7 @@ public class CDROutputObject extends CorbaOutputObject * Write the contents of the CDROutputStream to the specified * output stream. Has the side-effect of pushing any current * Message onto the Message list. - * @param s The output stream to write to. + * @param connection The output stream to write to. */ public void writeTo(CorbaConnection connection) throws java.io.IOException diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetConversion.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetConversion.java index 83f41352c71..3247d9fee4b 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetConversion.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/encoding/CodeSetConversion.java @@ -54,8 +54,9 @@ import com.sun.corba.se.spi.logging.CORBALogDomains; * use NIO ByteBuffer and NIO CharBuffer, the interaction * and interface between this class and the CDR streams * should be looked at more closely for optimizations to - * avoid unnecessary copying of data between char[] & - * CharBuffer and byte[] & ByteBuffer, especially + * avoid unnecessary copying of data between + * {@code char[] & CharBuffer} and + * {@code byte[] & ByteBuffer}, especially * DirectByteBuffers. * */ diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java index fdf35018275..9a46afd1b88 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/io/ValueHandlerImpl.java @@ -171,9 +171,9 @@ public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMulti * @param out The stream to write the value to * @param value The value to be written to the stream **/ - public void writeValue(org.omg.CORBA.portable.OutputStream _out, + public void writeValue(org.omg.CORBA.portable.OutputStream out, java.io.Serializable value) { - writeValueWithVersion(_out, value, STREAM_FORMAT_VERSION_1); + writeValueWithVersion(out, value, STREAM_FORMAT_VERSION_1); } private void writeValueWithVersion(org.omg.CORBA.portable.OutputStream _out, @@ -240,25 +240,25 @@ public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMulti * Reads a value from the stream using java semantics. * @param in The stream to read the value from * @param clazz The type of the value to be read in - * @param sender The sending context runtime + * @param rt The sending context runtime **/ - public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream _in, + public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream in, int offset, java.lang.Class clazz, String repositoryID, - org.omg.SendingContext.RunTime _sender) + org.omg.SendingContext.RunTime rt) { // Must use narrow rather than a direct cast to a com.sun // class. Fix for bug 4379539. - CodeBase sender = CodeBaseHelper.narrow(_sender); + CodeBase sender = CodeBaseHelper.narrow(rt); - org.omg.CORBA_2_3.portable.InputStream in = - (org.omg.CORBA_2_3.portable.InputStream) _in; + org.omg.CORBA_2_3.portable.InputStream inStream = + (org.omg.CORBA_2_3.portable.InputStream) in; if (!useHashtables) { if (inputStreamBridge == null) { inputStreamBridge = createInputStream(); - inputStreamBridge.setOrbStream(in); + inputStreamBridge.setOrbStream(inStream); inputStreamBridge.setSender(sender); //d11638 // backward compatability 4365188 inputStreamBridge.setValueHandler(this); @@ -269,7 +269,7 @@ public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMulti try { inputStreamBridge.increaseRecursionDepth(); - result = (java.io.Serializable) readValueInternal(inputStreamBridge, in, offset, clazz, repositoryID, sender); + result = (java.io.Serializable) readValueInternal(inputStreamBridge, inStream, offset, clazz, repositoryID, sender); } finally { @@ -287,16 +287,16 @@ public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMulti if (inputStreamPairs == null) inputStreamPairs = new Hashtable(); - jdkToOrbInputStreamBridge = (IIOPInputStream)inputStreamPairs.get(_in); + jdkToOrbInputStreamBridge = (IIOPInputStream)inputStreamPairs.get(in); if (jdkToOrbInputStreamBridge == null) { jdkToOrbInputStreamBridge = createInputStream(); - jdkToOrbInputStreamBridge.setOrbStream(in); + jdkToOrbInputStreamBridge.setOrbStream(inStream); jdkToOrbInputStreamBridge.setSender(sender); //d11638 // backward compatability 4365188 jdkToOrbInputStreamBridge.setValueHandler(this); - inputStreamPairs.put(_in, jdkToOrbInputStreamBridge); + inputStreamPairs.put(in, jdkToOrbInputStreamBridge); } java.io.Serializable result = null; @@ -304,12 +304,12 @@ public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMulti try { jdkToOrbInputStreamBridge.increaseRecursionDepth(); - result = (java.io.Serializable) readValueInternal(jdkToOrbInputStreamBridge, in, offset, clazz, repositoryID, sender); + result = (java.io.Serializable) readValueInternal(jdkToOrbInputStreamBridge, inStream, offset, clazz, repositoryID, sender); } finally { if (jdkToOrbInputStreamBridge.decreaseRecursionDepth() == 0) { - inputStreamPairs.remove(_in); + inputStreamPairs.remove(in); } } diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericIdentifiable.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericIdentifiable.java index 1715b4fa964..1226d9289fc 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericIdentifiable.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericIdentifiable.java @@ -33,7 +33,6 @@ import org.omg.CORBA_2_3.portable.OutputStream; import com.sun.corba.se.spi.ior.Identifiable ; /** - * @author * This is used for unknown components and profiles. A TAG_MULTICOMPONENT_PROFILE will be represented this way. */ public abstract class GenericIdentifiable implements Identifiable diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedComponent.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedComponent.java index dbb8547810e..b6d946b1d75 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedComponent.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedComponent.java @@ -34,9 +34,6 @@ import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; import com.sun.corba.se.spi.ior.TaggedComponent ; -/** - * @author - */ public class GenericTaggedComponent extends GenericIdentifiable implements TaggedComponent { @@ -52,8 +49,6 @@ public class GenericTaggedComponent extends GenericIdentifiable /** * @return org.omg.IOP.TaggedComponent - * @exception - * @author */ public org.omg.IOP.TaggedComponent getIOPComponent( ORB orb ) { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java index b715dce5a39..20269e901d4 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/GenericTaggedProfile.java @@ -39,9 +39,6 @@ import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; import com.sun.corba.se.impl.encoding.EncapsOutputStream ; -/** - * @author - */ public class GenericTaggedProfile extends GenericIdentifiable implements TaggedProfile { private ORB orb ; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IORTemplateImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IORTemplateImpl.java index 791c1386daa..2b99c887330 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IORTemplateImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/IORTemplateImpl.java @@ -47,7 +47,6 @@ import com.sun.corba.se.spi.orb.ORB ; /** * This class is a container of TaggedProfileTemplates. - * @author */ public class IORTemplateImpl extends IdentifiableContainerBase implements IORTemplate { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java index 6c57923d8a4..4fc98527107 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectAdapterIdNumber.java @@ -31,7 +31,7 @@ import org.omg.CORBA_2_3.portable.OutputStream ; /** ObjectAdapterIdNumber is used to represent pre-JDK 1.4 POA adapter * IDs. The POA ID was simply represented as a single integer, which was * mapped to the actual POA instance. Here, we just represent these - * internally as arrays of the form { "OldRootPOA", "" }, + * internally as arrays of the form {@code { "OldRootPOA", "" }}, * and provide an extra method to get the number back. */ public class ObjectAdapterIdNumber extends ObjectAdapterIdArray { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java index 1c1d3c25fae..200f045063d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectIdImpl.java @@ -29,9 +29,6 @@ import java.util.Arrays ; import com.sun.corba.se.spi.ior.ObjectId ; import org.omg.CORBA_2_3.portable.OutputStream ; -/** - * @author - */ public final class ObjectIdImpl implements ObjectId { private byte[] id; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java index ad2019a9559..ddf84a311e4 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyImpl.java @@ -37,9 +37,6 @@ import com.sun.corba.se.spi.ior.ObjectKeyTemplate ; import com.sun.corba.se.impl.encoding.EncapsOutputStream ; -/** - * @author - */ public class ObjectKeyImpl implements ObjectKey { private ObjectKeyTemplate oktemp; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java index 845de9a4313..6f0cfbe5914 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/ObjectKeyTemplateBase.java @@ -47,9 +47,6 @@ import com.sun.corba.se.impl.encoding.EncapsOutputStream ; import com.sun.corba.se.impl.logging.IORSystemException ; -/** - * @author - */ public abstract class ObjectKeyTemplateBase implements ObjectKeyTemplate { // Fixed constants for Java IDL object key template forms diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java index ddb7d822001..3a8eac05e2b 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/POAObjectKeyTemplate.java @@ -42,9 +42,6 @@ import com.sun.corba.se.spi.ior.ObjectAdapterId ; import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; -/** - * @author - */ public final class POAObjectKeyTemplate extends NewObjectKeyTemplateBase { /** This constructor reads the template ONLY from the stream. diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java index b495436d7de..3c455e3aca8 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/StubIORImpl.java @@ -245,7 +245,7 @@ public class StubIORImpl /** * Returns a string representation of this stub. Returns the same string * for all stubs that represent the same remote object. - * "SimpleIORImpl[,[]data, ...]" + * {@code "SimpleIORImpl[,[]data, ...]"} * @return a string representation of this stub. */ public String toString() diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileFactoryFinderImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileFactoryFinderImpl.java index e234f5af333..da5b1cbf283 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileFactoryFinderImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileFactoryFinderImpl.java @@ -33,9 +33,6 @@ import com.sun.corba.se.impl.ior.IdentifiableFactoryFinderBase ; import org.omg.CORBA_2_3.portable.InputStream ; -/** - * @author - */ public class TaggedProfileFactoryFinderImpl extends IdentifiableFactoryFinderBase { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileTemplateFactoryFinderImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileTemplateFactoryFinderImpl.java index 8dba5d3fabb..ed09d58bf52 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileTemplateFactoryFinderImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/TaggedProfileTemplateFactoryFinderImpl.java @@ -35,9 +35,6 @@ import org.omg.CORBA_2_3.portable.InputStream ; import org.omg.CORBA.INTERNAL ; -/** - * @author - */ public class TaggedProfileTemplateFactoryFinderImpl extends IdentifiableFactoryFinderBase { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java index 12b8401ef84..1bc03c61f92 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/CodeSetsComponentImpl.java @@ -38,9 +38,6 @@ import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ; import com.sun.corba.se.impl.encoding.MarshalOutputStream ; import com.sun.corba.se.impl.encoding.MarshalInputStream ; -/** - * @author - */ public class CodeSetsComponentImpl extends TaggedComponentBase implements CodeSetsComponent { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java index a019defa3b7..cc91839e0ec 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressBase.java @@ -32,9 +32,6 @@ import org.omg.CORBA_2_3.portable.OutputStream ; import com.sun.corba.se.spi.ior.iiop.IIOPAddress ; -/** - * @author - */ abstract class IIOPAddressBase implements IIOPAddress { // Ports are marshalled as shorts on the wire. The IDL diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java index f8e9dfd5263..80ecfac09b9 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressClosureImpl.java @@ -32,9 +32,6 @@ import org.omg.CORBA_2_3.portable.OutputStream ; import com.sun.corba.se.spi.orbutil.closure.Closure ; -/** - * @author - */ public final class IIOPAddressClosureImpl extends IIOPAddressBase { private Closure host; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java index 79c31cffaf3..255f20aff82 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPAddressImpl.java @@ -36,9 +36,6 @@ import com.sun.corba.se.spi.logging.CORBALogDomains ; import com.sun.corba.se.impl.logging.IORSystemException ; -/** - * @author - */ public final class IIOPAddressImpl extends IIOPAddressBase { private ORB orb ; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java index 060dd3f338e..bb30cc86b9d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileImpl.java @@ -76,9 +76,6 @@ import com.sun.corba.se.impl.util.JDKBridge; import com.sun.corba.se.impl.logging.IORSystemException; -/** - * @author - */ public class IIOPProfileImpl extends IdentifiableBase implements IIOPProfile { private ORB orb ; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java index 32a7d66d665..4d3dbe5ee63 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/IIOPProfileTemplateImpl.java @@ -55,7 +55,6 @@ import com.sun.corba.se.spi.ior.iiop.GIOPVersion ; import com.sun.corba.se.spi.orb.ORB ; /** - * @author * If getMinorVersion==0, this does not contain any tagged components */ public class IIOPProfileTemplateImpl extends TaggedProfileTemplateBase diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java index 9fefb015511..f7b17e0107e 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/ior/iiop/JavaCodebaseComponentImpl.java @@ -33,9 +33,6 @@ import com.sun.corba.se.spi.ior.TaggedComponentBase ; import com.sun.corba.se.spi.ior.iiop.JavaCodebaseComponent ; -/** - * @author - */ public class JavaCodebaseComponentImpl extends TaggedComponentBase implements JavaCodebaseComponent { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java index 473cf6487ca..866d22c4370 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java @@ -593,7 +593,7 @@ public class Util implements javax.rmi.CORBA.UtilDelegate * @param className the name of the class. * @param remoteCodebase a space-separated list of URLs at which * the class might be found. May be null. - * @param loadingContext a class whose ClassLoader may be used to + * @param loader a class whose ClassLoader may be used to * load the class if all other methods fail. * @return the Class object representing the loaded class. * @exception ClassNotFoundException if class cannot be loaded. diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java index 956d41bed4f..df8faeb7fa6 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/BindingIteratorImpl.java @@ -92,7 +92,7 @@ public abstract class BindingIteratorImpl extends BindingIteratorPOA * Return the next n bindings. It also returns true or false, indicating * whether there were more bindings. * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. + * @param blh The BindingList as an out parameter. * @return true if there were more bindings. * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA * system exceptions. @@ -114,7 +114,7 @@ public abstract class BindingIteratorImpl extends BindingIteratorPOA * scope, It will be called from NamingContext.list() operation or * this.next_n(). * @param how_many The number of requested bindings in the BindingList. - * @param bl The BindingList as an out parameter. + * @param blh The BindingList as an out parameter. * @return true if there were more bindings. */ public boolean list( int how_many, org.omg.CosNaming.BindingListHolder blh) diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java index b591aad929c..3b2c19f3dd2 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextImpl.java @@ -181,7 +181,7 @@ public abstract class NamingContextImpl * exists. The NamingContext will participate in recursive resolving. * @param n a sequence of NameComponents which is the name under which * the object will be bound. - * @param obj the NamingContect object reference to be bound. + * @param nc the NamingContext object reference to be bound. * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with * multiple components was supplied, but the first component could not be * resolved. @@ -278,7 +278,7 @@ public abstract class NamingContextImpl * resolving. * @param n a sequence of NameComponents which is the name under which * the object will be bound. - * @param obj the object reference to be bound. + * @param nc the object reference to be bound. * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with * multiple components was supplied, but the first component could not be * resolved. @@ -853,10 +853,9 @@ public abstract class NamingContextImpl /** * This operation creates a stringified name from the array of Name * components. - * @param n Name of the object

+ * @param n Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

- * + * Indicates the name does not identify a binding. */ public String to_string(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.InvalidName @@ -882,10 +881,9 @@ public abstract class NamingContextImpl /** * This operation converts a Stringified Name into an equivalent array * of Name Components. - * @param sn Stringified Name of the object

+ * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

- * + * Indicates the name does not identify a binding. */ public org.omg.CosNaming.NameComponent[] to_name(String sn) throws org.omg.CosNaming.NamingContextPackage.InvalidName @@ -920,14 +918,13 @@ public abstract class NamingContextImpl * This operation creates a URL based "iiopname://" format name * from the Stringified Name of the object. * @param addr internet based address of the host machine where - * Name Service is running

- * @param sn Stringified Name of the object

+ * Name Service is running + * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

+ * Indicates the name does not identify a binding. * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress * Indicates the internet based address of the host machine is - * incorrect

- * + * incorrect */ public String to_url(String addr, String sn) @@ -961,15 +958,15 @@ public abstract class NamingContextImpl /** * This operation resolves the Stringified name into the object * reference. - * @param sn Stringified Name of the object

+ * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextPackage.NotFound - * Indicates there is no object reference for the given name.

+ * Indicates there is no object reference for the given name. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the given compound name is incorrect

+ * Indicates that the given compound name is incorrect * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

+ * Indicates the name does not identify a binding. * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound - * Indicates the name is already bound.

+ * Indicates the name is already bound. * */ public org.omg.CORBA.Object resolve_str(String sn) diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java index 4bcc774a882..d141d4d4967 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingUtils.java @@ -90,7 +90,7 @@ public class NamingUtils { /** * Create a error print stream to the supplied file. - * @param logFile the file to which error messages will go. + * @param errFile the file to which error messages will go. * @exception IOException thrown if the file cannot be opened for output. */ public static void makeErrStream(File errFile) diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java index 736b353c56d..468a5339299 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientBindingIterator.java @@ -63,7 +63,6 @@ public class TransientBindingIterator extends BindingIteratorImpl * @param orb a org.omg.CORBA.ORB object. * @param aTable A hashtable containing InternalBindingValues which is * the content of the TransientNamingContext. - * @param java.lang.Exception a Java exception. * @exception Exception a Java exception thrown of the base class cannot * initialize. */ diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameService.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameService.java index 729191631b0..7842dd1f3a6 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameService.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/cosnaming/TransientNameService.java @@ -85,7 +85,7 @@ public class TransientNameService * NamingContext, whose object * reference can be obtained by the initialNamingContext method. * @param orb The ORB object - * @param nameserviceName Stringified key used for INS Service registry + * @param serviceName Stringified key used for INS Service registry * @exception org.omg.CORBA.INITIALIZE Thrown if * the TransientNameService cannot initialize. */ diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java index 569468a3849..1ebae7192ad 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/CorbanameURL.java @@ -33,7 +33,7 @@ import com.sun.corba.se.spi.logging.CORBALogDomains; * will be stored in this object. This object is capable of storing CorbaLoc * profiles as defined in the CorbaName grammer. * - * @Author Hemanth + * @author Hemanth */ public class CorbanameURL extends INSURLBase { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java index f985cf29ba5..3cee5e8042c 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/IIOPEndpointInfo.java @@ -32,7 +32,7 @@ import com.sun.corba.se.impl.orbutil.ORBConstants; * host information used in creating the Service Object reference * from the -ORBInitDef and -ORBDefaultInitDef definitions. * - * @Author Hemanth + * @author Hemanth */ public class IIOPEndpointInfo { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java index bdb68b211f7..a8f54f1b8d8 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURL.java @@ -29,7 +29,7 @@ package com.sun.corba.se.impl.naming.namingutil; * INS URL is a generic interface for two different types of URL's specified * in INS spec. * - * @Author Hemanth + * @author Hemanth */ public interface INSURL { public boolean getRIRFlag( ); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java index 424ed01136f..45b45faf20c 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/INSURLHandler.java @@ -30,7 +30,7 @@ import java.util.StringTokenizer; /** * This class is the entry point to parse different types of INS URL's. * - * @Author Hemanth + * @author Hemanth */ public class INSURLHandler { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java index 02f5c7a75ea..8d692604ebf 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/namingutil/Utility.java @@ -36,7 +36,7 @@ import com.sun.corba.se.spi.logging.CORBALogDomains; /** * Utility methods for Naming. * - * @Author Hemanth + * @author Hemanth */ class Utility { private static NamingSystemException wrapper = diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java index 91106f4aa29..992919b950f 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NameService.java @@ -186,7 +186,7 @@ public class NameService /** * getObjectReferenceFromKey returns the Object reference from the objectkey using POA.create_reference_with_id method * @param Object Key as String - * @returns reference an CORBA.Object. + * @return a CORBA.Object reference. */ org.omg.CORBA.Object getObjectReferenceFromKey( String key ) { @@ -205,7 +205,7 @@ public class NameService /** * getObjectKey gets the Object Key from the reference using POA.reference_to_id method * @param reference an CORBA.Object. - * @returns Object Key as String + * @return Object Key as String */ String getObjectKey( org.omg.CORBA.Object reference ) { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java index 63f191d4bc0..67483e0d35b 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/NamingContextImpl.java @@ -116,8 +116,8 @@ public class NamingContextImpl * Runs the super constructor. * @param orb an ORB object. * @param objKey as String - * @param TheNameService as NameService - * @param TheServantManagerImpl as ServantManagerImpl + * @param theNameService as NameService + * @param theServantManagerImpl as ServantManagerImpl * @exception java.lang.Exception a Java exception. */ @@ -223,7 +223,7 @@ public class NamingContextImpl * exists. The NamingContext will participate in recursive resolving. * @param n a sequence of NameComponents which is the name under which * the object will be bound. - * @param obj the NamingContect object reference to be bound. + * @param nc the NamingContect object reference to be bound. * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple * components was supplied, but the first component could not be * resolved. @@ -301,7 +301,7 @@ public class NamingContextImpl * unbound first. The NamingContext will participate in recursive resolving. * @param n a sequence of NameComponents which is the name under which * the object will be bound. - * @param obj the object reference to be bound. + * @param nc the object reference to be bound. * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with multiple * components was supplied, but the first component could not be * resolved. @@ -907,7 +907,7 @@ public class NamingContextImpl * The doResolve( ) method calls Resolve( ) recursively to resolve n level * Names. * @param n a sequence of NameComponents which is the name to be resolved. - * @param bt Type of binding (as object or as context). + * @param bth Type of binding (as object or as context). * @return the object reference bound under the supplied name. * @exception org.omg.CosNaming.NamingContextPackage.NotFound Neither a NamingContext * or a Corba Object reference not found under this Name @@ -1140,10 +1140,9 @@ public class NamingContextImpl /** * This operation creates a stringified name from the array of Name * components. - * @param n Name of the object

+ * @param n Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

- * + * Indicates the name does not identify a binding. */ public String to_string(org.omg.CosNaming.NameComponent[] n) throws org.omg.CosNaming.NamingContextPackage.InvalidName @@ -1167,10 +1166,9 @@ public class NamingContextImpl /** * This operation converts a Stringified Name into an equivalent array * of Name Components. - * @param sn Stringified Name of the object

+ * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

- * + * Indicates the name does not identify a binding. */ public org.omg.CosNaming.NameComponent[] to_name(String sn) throws org.omg.CosNaming.NamingContextPackage.InvalidName @@ -1204,14 +1202,13 @@ public class NamingContextImpl * This operation creates a URL based "iiopname://" format name * from the Stringified Name of the object. * @param addr internet based address of the host machine where - * Name Service is running

- * @param sn Stringified Name of the object

+ * Name Service is running + * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

+ * Indicates the name does not identify a binding. * @exception org.omg.CosNaming.NamingContextPackage.InvalidAddress * Indicates the internet based address of the host machine is - * incorrect

- * + * incorrect */ public String to_url(String addr, String sn) @@ -1247,14 +1244,13 @@ public class NamingContextImpl /** * This operation resolves the Stringified name into the object * reference. - * @param sn Stringified Name of the object

+ * @param sn Stringified Name of the object * @exception org.omg.CosNaming.NamingContextPackage.NotFound - * Indicates there is no object reference for the given name.

+ * Indicates there is no object reference for the given name. * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed - * Indicates that the given compound name is incorrect

+ * Indicates that the given compound name is incorrect * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName - * Indicates the name does not identify a binding.

- * + * Indicates the name does not identify a binding. */ public org.omg.CORBA.Object resolve_str(String sn) throws org.omg.CosNaming.NamingContextPackage.NotFound, diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java index 621560888d8..7c43e6baea0 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/naming/pcosnaming/PersistentBindingIterator.java @@ -64,7 +64,6 @@ public class PersistentBindingIterator extends BindingIteratorImpl * @param orb a org.omg.CORBA.ORB object. * @param aTable A hashtable containing InternalBindingValues which is * the content of the PersistentNamingContext. - * @param java.lang.Exception a Java exception. * @exception Exception a Java exception thrown of the base class cannot * initialize. */ diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java index 780287b98ee..8290e179f58 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/oa/toa/TOAImpl.java @@ -61,7 +61,7 @@ import com.sun.corba.se.impl.protocol.JIDLLocalCRDImpl ; * Its characteristics include: *

    *
  • There is only one OA instance of the TOA. Its OAId is { "TOA" }
  • -*
  • There is not adapter manager. The TOA manager ID is fixed.
  • +*
  • There is not adapter manager. The TOA manager ID is fixed.
  • *
  • State is the same as ORB state (TBD)
  • *
* Other requirements: @@ -118,7 +118,7 @@ public class TOAImpl extends ObjectAdapterBase implements TOA * This will update thread Current, so that subsequent calls to * returnServant and removeCurrent from the same thread are for the * same request. - * @param request is the request containing the rest of the request + * @param info is the request containing the rest of the request */ public void getInvocationServant( OAInvocationInfo info ) { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java index c619b8a9268..bb67c3cd654 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java @@ -585,7 +585,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB * Create an NVList * * @param count size of list to create - * @result NVList created + * @return NVList created * * @see NVList */ @@ -599,7 +599,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB * Create an NVList corresponding to an OperationDef * * @param oper operation def to use to create list - * @result NVList created + * @return NVList created * * @see NVList */ @@ -612,7 +612,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Create a NamedValue * - * @result NamedValue created + * @return NamedValue created */ public synchronized NamedValue create_named_value(String s, Any any, int flags) { @@ -623,7 +623,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Create an ExceptionList * - * @result ExceptionList created + * @return ExceptionList created */ public synchronized org.omg.CORBA.ExceptionList create_exception_list() { @@ -634,7 +634,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Create a ContextList * - * @result ContextList created + * @return ContextList created */ public synchronized org.omg.CORBA.ContextList create_context_list() { @@ -645,7 +645,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Get the default Context object * - * @result the default Context object + * @return the default Context object */ public synchronized org.omg.CORBA.Context get_default_context() { @@ -656,7 +656,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Create an Environment * - * @result Environment created + * @return Environment created */ public synchronized org.omg.CORBA.Environment create_environment() { @@ -719,7 +719,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB /** * Get the next request that has gotten a response. * - * @result the next request ready with a response. + * @return the next request ready with a response. */ public org.omg.CORBA.Request get_next_response() throws org.omg.CORBA.WrongTransaction diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java index 510c26c974f..95be1654dc0 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java @@ -42,8 +42,9 @@ public class DenseIntMapImpl throw new IllegalArgumentException( "Key must be >= 0." ) ; } - /** If key >= 0, return the value bound to key, or null if none. - * Throws IllegalArgumentException if key <0. + /** + * If {@code key >= 0}, return the value bound to key, or null if none. + * Throws IllegalArgumentException if {@code key < 0}. */ public Object get( int key ) { @@ -56,8 +57,9 @@ public class DenseIntMapImpl return result ; } - /** If key >= 0, bind value to the key. - * Throws IllegalArgumentException if key <0. + /** + * If {@code key >= 0}, bind value to the key. + * Throws IllegalArgumentException if {@code key < 0}. */ public void set( int key, Object value ) { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java index 1ad18e099d2..9cb69d875b7 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/GetPropertyAction.java @@ -35,7 +35,7 @@ package com.sun.corba.se.impl.orbutil ; * AccessController.doPrivileged. * *

The following code retrieves the value of the system - * property named "prop" as a privileged action:

+ * property named "prop" as a privileged action: * *

  * String s = (String) java.security.AccessController.doPrivileged(
@@ -67,7 +67,7 @@ public class GetPropertyAction implements java.security.PrivilegedAction {
      * value of that property.
      *
      * @param theProp the name of the system property.
-     * @param defaulVal the default value.
+     * @param defaultVal the default value.
      */
     public GetPropertyAction(String theProp, String defaultVal) {
         this.theProp = theProp;
diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java
index 73e949b5493..fb605b51650 100644
--- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java
+++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/CondVar.java
@@ -150,8 +150,7 @@ import com.sun.corba.se.impl.orbutil.ORBUtility ;
  *
  * 
* @see Mutex - *

[ Introduction to this package. ] - + * [ Introduction to this package. ] **/ public class CondVar { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java index 3195ad8ad9a..78d66113d6d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Mutex.java @@ -126,7 +126,6 @@ package com.sun.corba.se.impl.orbutil.concurrent; * // ... other similar traversal and update methods ... * } * - *

* @see Semaphore *

[ Introduction to this package. ] **/ diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java index 32b22fdbc96..c696b795083 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java @@ -181,11 +181,11 @@ package com.sun.corba.se.impl.orbutil.concurrent; * } * } * } - * + * *

* Here is an even fancier version, that uses lock re-ordering * upon conflict: - *

+ * 
{@code
  * class Cell {
  *   long value;
  *   Sync lock = ...;
@@ -214,8 +214,8 @@ package com.sun.corba.se.impl.orbutil.concurrent;
  *    }
  *    catch (InterruptedException ex) { return; }
  *  }
- *}
- *
+ * } + * }
*

* Interruptions are in general handled as early as possible. * Normally, InterruptionExceptions are thrown @@ -248,7 +248,7 @@ package com.sun.corba.se.impl.orbutil.concurrent; * it is normally best to just use acquire(), various forms * of busy waits can be implemented. For a simple example * (but one that would probably never be preferable to using acquire()): - *

+ * 
{@code
  * class X {
  *   Sync lock = ...
  *   void spinUntilAcquired() throws InterruptedException {
@@ -269,17 +269,16 @@ package com.sun.corba.se.impl.orbutil.concurrent;
  *     }
  *   }
  * }
- * 
+ * }
*

* In addition pure synchronization control, Syncs * may be useful in any context requiring before/after methods. * For example, you can use an ObservableSync * (perhaps as part of a LayeredSync) in order to obtain callbacks * before and after each method invocation for a given class. - *

- - *

[ Introduction to this package. ] -**/ + * + * [ Introduction to this package. ] + **/ public interface Sync { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java index 0cbce53ffc1..4f8aedafc3d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/impl/transport/CorbaConnectionCacheBase.java @@ -130,13 +130,13 @@ public abstract class CorbaConnectionCacheBase * This method must be synchronized since one WorkerThread could * be reclaming connections inside the synchronized backingStore * block and a second WorkerThread (or a SelectorThread) could have - * already executed the if (numberOfConnections <= .... ). As a + * already executed the if (numberOfConnections {@literal <=} .... ). As a * result the second thread would also attempt to reclaim connections. * * If connection reclamation becomes a performance issue, the connection * reclamation could make its own task and consequently executed in * a separate thread. - * Currently, the accept & reclaim are done in the same thread, WorkerThread + * Currently, the accept {@literal &} reclaim are done in the same thread, WorkerThread * by default. It could be changed such that the SelectorThread would do * it for SocketChannels and WorkerThreads for Sockets by updating the * ParserTable. diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java b/corba/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java index d7f8d8660f9..16e69d09daf 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/pept/transport/Acceptor.java @@ -59,7 +59,7 @@ public interface Acceptor /** * Used to determine if an Acceptor has been initialized. * - * @return trueAcceptor has been + * @return true if the Acceptor has been * initialized. */ public boolean initialized(); @@ -74,7 +74,7 @@ public interface Acceptor /** * Set the - * {@link com.sun.corba.se.pept.transport.Inbound.ConnectionCache InboundConnectionCache} + * {@link com.sun.corba.se.pept.transport.InboundConnectionCache InboundConnectionCache} * to be used by this Acceptor. * * PEPt uses separate caches for each type of Acceptor @@ -88,7 +88,7 @@ public interface Acceptor /** * Get the - * {@link com.sun.corba.se.pept.transport.Inbound.ConnectionCache InboundConnectionCache} + * {@link com.sun.corba.se.pept.transport.InboundConnectionCache InboundConnectionCache} * used by this Acceptor * * PEPt uses separate caches for each type of Acceptor diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java index cf4e6872b82..35f225dd141 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java @@ -44,7 +44,7 @@ import com.sun.corba.se.impl.orbutil.ORBConstants ; *

    *
  1. POA current semantics *
  2. Proper handling of POA destroy. -*
      +*
    * POA current semantics requires maintaining a ThreadLocal stack of * invocation information that is always available for POACurrent operations. * Maintaining this stack is expensive on the timescale of optimized co-located diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html index 2bdbb74e804..e3784dcc4a4 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/ior/package.html @@ -41,8 +41,8 @@ The abstract model of IORs works as follows:
  3. An IIOPProfile isA TaggedProfile.
  4. An IIOPProfile is composed of an IIOPProfileTemplate and an object ID.
  5. An IIOPProfileTemplate has an ObjectKeyTemplate, and contains TaggedComponents.
  6. -
  7. A TaggedComponent has an ID, and can be written to an OuputStream.
  8. -
  9. A TaggedComponentFactory reads a TaggedComponent from an InputStream.
  10. +
  11. A TaggedComponent has an ID, and can be written to an OuputStream.
  12. +
  13. A TaggedComponentFactory reads a TaggedComponent from an InputStream.
  14. In all cases, containment is represented by having the appropriate interface (IOR and diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java index d9e06b1b512..baf4eb7e560 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.java @@ -48,7 +48,7 @@ import com.sun.corba.se.spi.transport.SocketInfo; * * property.

    * - * Example:

    + * Example: *

      *   -Dcom.sun.CORBA.connection.ORBSocketFactoryClass=MySocketFactory
    @@ -145,7 +145,7 @@ public interface ORBSocketFactory
          *
          * property. 

    * - * Example usage:

    + * Example usage: * *

          *    ... \
    @@ -203,7 +203,7 @@ public interface ORBSocketFactory
          * Once you have the port you may add information to references
          * created by the associated adapter by calling
          *
    -     *    IORInfo::add_ior_component

    + * IORInfo::add_ior_component

    * * * Note: if one is using a POA and the lifespan policy of that @@ -247,7 +247,7 @@ public interface ORBSocketFactory * * ORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY

    * - * Example:

    + * Example: * *

          *
    @@ -271,7 +271,7 @@ public interface ORBSocketFactory
          *     SOCKET_FACTORY_CLASS_PROPERTY and
          *     LISTEN_SOCKET_PROPERTY
          *
    -     * as used by other clients and servers in your distributed system. 

    + * as used by other clients and servers in your distributed system. * */ public ServerSocket createServerSocket(String type, int port) @@ -324,7 +324,7 @@ public interface ORBSocketFactory * * The SocketInfo given to getEndPointInfo * is either null or an object obtained - * from GetEndPointInfoAgainException

    + * from GetEndPointInfoAgainException * */ public SocketInfo getEndPointInfo(org.omg.CORBA.ORB orb, @@ -333,7 +333,7 @@ public interface ORBSocketFactory /** - * DEPRECATED. DEPRECATED. DEPRECATED. DEPRECATED.

    * * This method is used by a client side ORB.

    * @@ -346,7 +346,7 @@ public interface ORBSocketFactory * * If this method throws GetEndPointInfoAgainException then the * ORB calls getEndPointInfo again, passing it the - * SocketInfo object contained in the exception.

    + * SocketInfo object contained in the exception. * */ public Socket createSocket(SocketInfo socketInfo) diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java index b6dd89d1fb9..e57f9529a43 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/legacy/interceptor/RequestInfoExt.java @@ -30,8 +30,7 @@ import com.sun.corba.se.spi.legacy.connection.Connection; /** * This interface is implemented by our implementation of * PortableInterceptor.ClientRequestInfo and - * PortableInterceptor.ServerRequestInfo.

    - * + * PortableInterceptor.ServerRequestInfo. */ public interface RequestInfoExt diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java index 226d84fb919..0b3b6b396ee 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/LongMonitoredAttributeBase.java @@ -27,13 +27,9 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * A Cleaner Abstraction to provide a Monitored Attribute of type 'Long' - *

    */ public abstract class LongMonitoredAttributeBase extends MonitoredAttributeBase { @@ -42,20 +38,14 @@ public abstract class LongMonitoredAttributeBase extends MonitoredAttributeBase /** - *

    * Constructs LongMonitoredAttribute, by creating the * MonitoredAttributeInfo with 'Long' as the class type. * Users are expected to extend this class and provide the implementation * for getValue() and if needed clearState() as well. - *

    - *

    * - * @param name of tthe MonitoredAttribute - *

    - *

    + * @param name of the MonitoredAttribute * @param description of the Attribute, Please provid a well thought out * description, so that the admin can make sense of the attribute supplied. - *

    */ public LongMonitoredAttributeBase(String name, String description) { super( name ); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java index 844668ab001..094b33f5337 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttribute.java @@ -28,15 +28,11 @@ import com.sun.corba.se.spi.monitoring.MonitoredAttributeInfo; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * Monitored Attribute is the interface to represent a Monitorable * Attribute. Using this interface, one can get the value of the attribute * and set the value if it is a writeable attribute. - *

    */ public interface MonitoredAttribute { @@ -44,34 +40,25 @@ public interface MonitoredAttribute { // operations /** - *

    * Gets the Monitored Attribute Info for the attribute. - *

    - *

    * - * @param monitoredAttributeInfo for this Monitored Attribute. - *

    + * @return monitoredAttributeInfo for this Monitored Attribute. */ public MonitoredAttributeInfo getAttributeInfo(); /** - *

    * Sets the value for the Monitored Attribute if isWritable() is false, the * method will throw ILLEGAL Operation exception. * * Also, the type of 'value' should be same as specified in the * MonitoredAttributeInfo for a particular instance. - *

    - *

    * * @param value should be any one of the Basic Java Type Objects which are * Long, Double, Float, String, Integer, Short, Character, Byte. - *

    */ public void setValue(Object value); /** - *

    * Gets the value of the Monitored Attribute. The value can be obtained * from different parts of the module. User may choose to delegate the call * to getValue() to other variables. @@ -79,34 +66,21 @@ public interface MonitoredAttribute { * NOTE: It is important to make sure that the type of Object returned in * getvalue is same as the one specified in MonitoredAttributeInfo for this * attribute. - *

    - *

    * - *

    - *

    - * - * @param value is the current value for this MonitoredAttribute - *

    + * @return the current value for this MonitoredAttribute */ public Object getValue(); /** - *

    * Gets the name of the Monitored Attribute. - *

    - *

    * - * @param name of this Attribute - *

    + * @return name of this Attribute */ public String getName(); /** - *

    * If this attribute needs to be cleared, the user needs to implement this * method to reset the state to initial state. If the Monitored Attribute * doesn't change like for example (ConnectionManager High Water Mark), * then clearState() is a No Op. - *

    - * */ public void clearState(); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java index ff779ac796e..b4456e44de2 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeBase.java @@ -27,16 +27,11 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * A Convenient class provided to help users extend and implement only * getValue(), if there is no need to clear the state and the attribute is not * writable. - * - *

    */ public abstract class MonitoredAttributeBase implements MonitoredAttribute { String name; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java index 457006313c5..45f9c4ae239 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfo.java @@ -27,14 +27,10 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * Monitored AttributeInfo contains the meta information of the Monitored * Attribute. - *

    */ public interface MonitoredAttributeInfo { @@ -42,45 +38,38 @@ public interface MonitoredAttributeInfo { // operations /** - *

    * If the Attribute is writable from ASAdmin then isWritable() will return * true. - *

    - *

    * * @return a boolean with true or false - *

    */ public boolean isWritable(); /** - *

    * isStatistic() is true if the attribute is presented as a Statistic. - *

    - *

    * * @return a boolean with true or false - *

    */ public boolean isStatistic(); /** - *

    - * Class Type: We will allow only basic class types: 1)Boolean 2)Integer - * 3)Byte 4)Long 5)Float 6)Double 7)String 8)Character - *

    - *

    + * Class Type: We will allow only basic class types: + *

      + *
    1. Boolean
    2. + *
    3. Integer
    4. + *
    5. Byte
    6. + *
    7. Long
    8. + *
    9. Float
    10. + *
    11. Double
    12. + *
    13. String
    14. + *
    15. Character
    16. + *
    * * @return a Class Type - *

    */ public Class type(); /** - *

    * Get's the description for the Monitored Attribute. - *

    - *

    * * @return a String with description - *

    */ public String getDescription(); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java index 47ad1596959..bac25fa7713 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredAttributeInfoFactory.java @@ -25,17 +25,12 @@ package com.sun.corba.se.spi.monitoring; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * MonitoredAttributeInfoFactory used mostly by internal classes. If the * User needs to define some special MonitoredAttributes like a Character * type Monitored Attribute, they can use this factory to build the meta * information. - * - *

    */ public interface MonitoredAttributeInfoFactory { diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java index 12bed76dfc0..6514a6bbfe4 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObject.java @@ -30,161 +30,101 @@ import java.util.*; import java.util.Collection; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * Monitored Object provides an Hierarchichal view of the ORB Monitoring * System. It can contain multiple children and a single parent. Each * Monitored Object may also contain Multiple Monitored Attributes. - *

    */ public interface MonitoredObject { /////////////////////////////////////// // operations /** - *

    * Gets the name of this MonitoredObject - *

    * * @return a String with name of this Monitored Object - *

    */ public String getName(); /** - *

    * Gets the description of MonitoredObject - *

    * * @return a String with Monitored Object Description. - *

    */ public String getDescription(); /** - *

    * This method will add a child Monitored Object to this Monitored Object. - *

    - *

    - *

    */ public void addChild( MonitoredObject m ); /** - *

    * This method will remove child Monitored Object identified by the given name - *

    - *

    + * * @param name of the ChildMonitored Object - *

    */ public void removeChild( String name ); /** - *

    * Gets the child MonitoredObject associated with this MonitoredObject * instance using name as the key. The name should be fully qualified name * like orb.connectionmanager - *

    - *

    * * @return a MonitoredObject identified by the given name - *

    - *

    * @param name of the ChildMonitored Object - *

    */ public MonitoredObject getChild(String name); /** - *

    * Gets all the Children registered under this instance of Monitored * Object. - *

    - *

    * * @return Collection of immediate Children associated with this MonitoredObject. - *

    */ public Collection getChildren(); /** - *

    * Sets the parent for this Monitored Object. - *

    - *

    - *

    */ public void setParent( MonitoredObject m ); /** - *

    * There will be only one parent for an instance of MontoredObject, this * call gets parent and returns null if the Monitored Object is the root. - *

    - *

    * * @return a MonitoredObject which is a Parent of this Monitored Object instance - *

    */ public MonitoredObject getParent(); /** - *

    * Adds the attribute with the given name. - *

    - *

    * - *

    - *

    * @param value is the MonitoredAttribute which will be set as one of the * attribute of this MonitoredObject. - *

    */ public void addAttribute(MonitoredAttribute value); /** - *

    * Removes the attribute with the given name. - *

    - *

    * - *

    - *

    * @param name is the MonitoredAttribute name - *

    */ public void removeAttribute(String name); /** - *

    * Gets the Monitored Object registered by the given name - *

    * - *

    * @return a MonitoredAttribute identified by the given name - *

    - *

    * @param name of the attribute - *

    */ public MonitoredAttribute getAttribute(String name); /** - *

    * Gets all the Monitored Attributes for this Monitored Objects. It doesn't * include the Child Monitored Object, that needs to be traversed using * getChild() or getChildren() call. - *

    - *

    * * @return Collection of all the Attributes for this MonitoredObject - *

    */ public Collection getAttributes(); /** - *

    * Clears the state of all the Monitored Attributes associated with the * Monitored Object. It will also clear the state on all it's child * Monitored Object. The call to clearState will be initiated from * CORBAMBean.startMonitoring() call. - *

    - * */ public void clearState(); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java index 86feebb55b4..d7b03e7d701 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoredObjectFactory.java @@ -25,14 +25,9 @@ package com.sun.corba.se.spi.monitoring; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    * * MonitoredObject Factory to create Monitored Object. - *

    */ public interface MonitoredObjectFactory { /** diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java index ed59d59d7bd..f34ad375b43 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringFactories.java @@ -29,17 +29,13 @@ import com.sun.corba.se.impl.monitoring.MonitoredAttributeInfoFactoryImpl; import com.sun.corba.se.impl.monitoring.MonitoringManagerFactoryImpl; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * This is used for getting the default factories for * MonitoredObject, MonitoredAttributeInfo and MonitoringManager. We do not * expect users to use the MonitoredAttributeInfo factory most of the time * because the Info is automatically built by StringMonitoredAttributeBase * and LongMonitoredAttributeBase. - *

    */ public class MonitoringFactories { /////////////////////////////////////// @@ -57,20 +53,15 @@ public class MonitoringFactories { // operations /** - *

    * Gets the MonitoredObjectFactory - *

    - *

    * * @return a MonitoredObjectFactory - *

    */ public static MonitoredObjectFactory getMonitoredObjectFactory( ) { return monitoredObjectFactory; } /** - *

    * Gets the MonitoredAttributeInfoFactory. The user is not expected to use this * Factory, since the MonitoredAttributeInfo is internally created by * StringMonitoredAttributeBase, LongMonitoredAttributeBase and @@ -79,11 +70,8 @@ public class MonitoringFactories { * build a DoubleMonitoredAttributeBase like LongMonitoredAttributeBase * and build a MonitoredAttributeInfo required by MonitoredAttributeBase * internally by using this Factory. - *

    - *

    * * @return a MonitoredAttributeInfoFactory - *

    */ public static MonitoredAttributeInfoFactory getMonitoredAttributeInfoFactory( ) @@ -92,18 +80,14 @@ public class MonitoringFactories { } /** - *

    * Gets the MonitoredManagerFactory. The user is not expected to use this * Factory, since the ORB will be automatically initialized with the * MonitoringManager. * * User can get hold of MonitoringManager associated with ORB by calling * orb.getMonitoringManager( ) - *

    - *

    * * @return a MonitoredManagerFactory - *

    */ public static MonitoringManagerFactory getMonitoringManagerFactory( ) { return monitoringManagerFactory; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java index 1a7e6b61f80..5b5082a042a 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManager.java @@ -30,15 +30,11 @@ import com.sun.corba.se.spi.monitoring.MonitoredObject; import java.util.*; /** - *

    * Monitoring Manager will have a 1 to 1 association with the ORB. This * gives access to the top level Monitored Object, using which more * Monitored Objects and Attributes can be added and traversed. - *

    - *

    * * @author Hemanth Puttaswamy - *

    */ public interface MonitoringManager extends Closeable { @@ -46,23 +42,14 @@ public interface MonitoringManager extends Closeable { // operations /** - *

    * Gets the Root Monitored Object which contains a Hierarchy Of Monitored * Objects exposing various Monitorable Attributes of Various modules. - *

    - *

    - * - * @param MonitoredObject ... - *

    */ public MonitoredObject getRootMonitoredObject(); /** - *

    * Initialize is called whenever there is a start monitoring call to CORBA * MBean. This will result in triaging initialize to all the * MonitoredObjects and it's Monitored Attributes. - *

    - * */ public void clearState(); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java index 88b6238ff53..8d117392068 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/MonitoringManagerFactory.java @@ -25,14 +25,10 @@ package com.sun.corba.se.spi.monitoring; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * MonitoringObjectFactory is used internally by the ORB, It is not for * general public use. - *

    */ public interface MonitoringManagerFactory { /** diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java index 54dd14c0076..f28ab0efad7 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticMonitoredAttribute.java @@ -27,15 +27,11 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * StatisticsMonitoredAttribute is provided as a convenience to collect the * Statistics of any entity. The getValue() call will be delegated to the * StatisticsAccumulator set by the user. - *

    */ public class StatisticMonitoredAttribute extends MonitoredAttributeBase { @@ -55,32 +51,19 @@ public class StatisticMonitoredAttribute extends MonitoredAttributeBase { /** - *

    * Constructs the StaisticMonitoredAttribute, builds the required * MonitoredAttributeInfo with Long as the class type and is always * readonly attribute. - *

    - *

    * * @param name Of this attribute - *

    - *

    - * @return a StatisticMonitoredAttribute - *

    - *

    * @param desc should provide a good description on the kind of statistics * collected, a good example is "Connection Response Time Stats will Provide the * detailed stats based on the samples provided from every request completion * time" - *

    - *

    * @param s is the StatisticsAcumulator that user will use to accumulate the * samples and this Attribute Object will get the computed statistics values * from. - *

    - *

    * @param mutex using which clearState() and getValue() calls need to be locked. - *

    */ public StatisticMonitoredAttribute(String name, String desc, StatisticsAccumulator s, Object mutex) diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java index 255196e809b..a172216908c 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StatisticsAccumulator.java @@ -27,11 +27,8 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * StatisticsAccumulator accumulates the samples provided by the user and * computes the value of minimum, maximum, sum and sample square sum. When * the StatisticMonitoredAttribute calls getValue(), it will compute all @@ -42,7 +39,6 @@ import java.util.*; * Users can easily extend this class and provide the implementation of * toString() method to format the stats as desired. By default all the stats * are printed in a single line. - *

    */ public class StatisticsAccumulator { @@ -72,19 +68,12 @@ public class StatisticsAccumulator { /** - *

    * User will use this method to just register a sample with the * StatisticsAccumulator. This is the only method that User will use to * expose the statistics, internally the StatisticMonitoredAttribute will * collect the information when requested from the ASAdmin. - *

    - *

    - * - *

    - *

    * * @param value a double value to make it more precise - *

    */ public void sample(double value) { sampleCount++; @@ -137,19 +126,11 @@ public class StatisticsAccumulator { } /** - *

    * Construct the Statistics Accumulator by providing the unit as a String. - * The examples of units are "Hours", "Minutes", - * "Seconds", "MilliSeconds", "Micro Seconds" - * etc., - *

    - *

    + * The examples of units are "Hours", "Minutes", + * "Seconds", "MilliSeconds", "Micro Seconds" etc. * - * @return a StatisticsAccumulator with ... - *

    - *

    * @param unit a String representing the units for the samples collected - *

    */ public StatisticsAccumulator( String unit ) { this.unit = unit; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java index 9277223af8e..5b11ae61c64 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/monitoring/StringMonitoredAttributeBase.java @@ -27,14 +27,10 @@ package com.sun.corba.se.spi.monitoring; import java.util.*; /** - *

    - * * @author Hemanth Puttaswamy - *

    - *

    + * * A Convenient Abstraction to present String type Monitored Attribute. One * of the examples of StringMonitoredAttribute is the State information. - *

    */ public abstract class StringMonitoredAttributeBase extends MonitoredAttributeBase @@ -45,20 +41,11 @@ public abstract class StringMonitoredAttributeBase /** - *

    * Constructs StringMonitoredAttribute with the MonitoredAttributeInfo * built with the class type of String. - *

    - *

    * * @param name of this attribute - *

    - *

    * @param description of this attribute - *

    - *

    - * @return a StringMonitoredAttributeBase - *

    */ public StringMonitoredAttributeBase(String name, String description) { super( name ); diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java index f5919d3bc1b..dbe1ac9648c 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/oa/ObjectAdapter.java @@ -89,7 +89,7 @@ import com.sun.corba.se.spi.ior.IORTemplate ; *
  15. A local invocation, where the dispatch is handled in the client subcontract.
  16. *
  17. A cached local invocation, where the servant is cached when the IOR is established * for the client subcontract, and the dispatch is handled in the client subcontract -* to the cached subcontract.
  18. +* to the cached subcontract.
  19. *
*

* Each of these 3 cases is handled a bit differently. On each request, assume as known @@ -111,11 +111,11 @@ import com.sun.corba.se.spi.ior.IORTemplate ; *

  • oa.returnServant()
  • *
  • oa.exit()
  • *
  • pop info
  • -*
      +*
    * -* REVISIT: Is this the required order for exit/pop? Cna they be nested instead? +* *
  • The local pattern: *
      *
    1. oa = oaf.find( oaid )
    2. @@ -128,10 +128,10 @@ import com.sun.corba.se.spi.ior.IORTemplate ; *
    3. oa.returnServant()
    4. *
    5. oa.exit()
    6. *
    7. pop info
    8. -*
        +*
      * -* This is the same as the remote case, except that setExecuteReturnServantInResponseConstructor -* is not needed (or possible, since there is no server request). +* *
    9. The fast local pattern: When delegate is constructed, * first extract ObjectKey from IOR in delegate, * then get ObjectId, ObjectAdapterId, and ObjectAdapterFactory (oaf). Then: @@ -143,14 +143,14 @@ import com.sun.corba.se.spi.ior.IORTemplate ; *
    10. pop info *
    * The info instance (which includes the Servant) is cached in the client subcontract. -*

    Then, on each invocation:

    +*

    Then, on each invocation: *

      *
    1. newinfo = copy of info (clone)
    2. *
    3. info.setOperation( operation )
    4. *
    5. push newinfo
    6. *
    7. oa.enter()
    8. *
    9. dispatch to servant
    10. -*
    11. oa.returnServant()
    12. // XXX This is probably wrong: remove it. +*
    13. oa.returnServant()
    14. *
    15. oa.exit()
    16. *
    17. pop info
    18. *
    diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java index 926da503d8f..6f1e8977e16 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/DataCollector.java @@ -58,7 +58,7 @@ public interface DataCollector { * mappings in the resulting properties. Also, -ORBInitialServices * is handled specially in applet mode: they are converted from * relative to absolute URLs. - * @raises IllegalStateException if setPropertyNames has not + * @throws IllegalStateException if setPropertyNames has not * been called. */ Properties getProperties() ; diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Action.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Action.java index 86a1b6f45ab..296602e1e15 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Action.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Action.java @@ -46,8 +46,8 @@ public interface Action * in the state machine, as the state could be corrupted. * Any exception thrown by the Action for the transition * will be propagated to doIt. - * @param FSM fsm is the state machine causing this action. - * @param Input in is the input that caused the transition. + * @param fsm the state machine causing this action. + * @param in the input that caused the transition. */ public void doIt( FSM fsm, Input in ) ; } diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java index 19639992e85..2fd467c6e9d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orbutil/fsm/Guard.java @@ -93,8 +93,8 @@ public interface Guard * input is retried when the thread runs again. * * - * @param FSM fsm is the state machine causing this action. - * @param Input in is the input that caused the transition. + * @param fsm is the state machine causing this action. + * @param in is the input that caused the transition. */ public Result evaluate( FSM fsm, Input in ) ; } diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java index 30994d385c3..c2b07a25384 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/servicecontext/ServiceContext.java @@ -42,9 +42,8 @@ import com.sun.corba.se.impl.orbutil.ORBUtility ; * the service context and provides any needed methods for manipulating * the service context. Each subclass must provide the following * members: -*

    *

      -* a public static final int SERVICE_CONTEXT_ID that gives the OMG +*
    • a public static final int SERVICE_CONTEXT_ID that gives the OMG * (or other) defined id for the service context. This is needed for the * registration mechanism defined in ServiceContexts. OMG defined * service context ids are taken from section 13.6.7 of ptc/98-12-04.
    • diff --git a/corba/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java b/corba/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java index 537b8697f83..b34a0588818 100644 --- a/corba/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java +++ b/corba/src/java.corba/share/classes/com/sun/org/omg/CORBA/portable/ValueHelper.java @@ -32,7 +32,7 @@ import org.omg.CORBA.portable.BoxedValueHelper; * An interface that is implemented by valuetype helper classes. * This interface appeared in CORBA 2.3 drafts but was removed from * the published CORBA 2.3 specification. - *

      + * * @deprecated Deprecated by CORBA 2.3. */ @Deprecated diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java index 90185aec51d..35a03442c70 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Arguments.java @@ -68,9 +68,9 @@ public class Arguments * must check the arguments passed to it for validity and process the * arguments appropriately. If it detects an invalid argument, it should * throw an InvalidArgument exception. Arguments MUST be of the form - * `/ []' or `- []' where - * is optional (for example, -iC:\includes, `C:\includes' is the qualifier - * for the argument `i'). + * {@code '/ []'} or {@code '- []'} where {@code } + * is optional (for example, -iC:\includes, 'C:\includes' is the qualifier + * for the argument 'i'). * @param args The arguments which are unknown by the framework. * @param properties Environment-style properties collected from the * file idl.config. @@ -289,7 +289,7 @@ public class Arguments public Hashtable definedSymbols = new Hashtable (); /** - * True if new module entries are created for each + * (f46082.46.01) True if new module entries are created for each * re-opened module. **/ public boolean cppModule = false; diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java index c2dab551f5e..0ce15c334c0 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/AttributeEntry.java @@ -80,7 +80,7 @@ public class AttributeEntry extends MethodEntry } // generate /** Access the attribute generator. - @returns an object which implements the AttributeGen interface. + @return an object which implements the AttributeGen interface. @see AttributeGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java index b2668b21a1f..a3e04732873 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Compile.java @@ -52,7 +52,7 @@ import com.sun.tools.corba.se.idl.constExpr.DefaultExprFactory; * Compiler usage: *

      * - * java com.sun.tools.corba.se.idl.toJava.compile [options] + * {@code java com.sun.tools.corba.se.idl.toJava.compile [options] } *

      * * where <idl file> is the name of a file containing IDL definitions, @@ -62,17 +62,17 @@ import com.sun.tools.corba.se.idl.constExpr.DefaultExprFactory; * * Options: *

      - *
      -i <include path> + *
      {@code -i } *
      By default, the current directory is scanned for included files. * This option adds another directory. See also Note 1 below. * - *
      -d <symbol> - *
      This is equivalent to the following line in an IDL file: #define <symbol> + *
      {@code -d } + *
      This is equivalent to the following line in an IDL file: {@code #define } * - *
      -emitAll + *
      {@code -emitAll} *
      Emit all types, including those found in #included files. * - *
      -v + *
      {@code -v} *
      Verbose mode. *
      * @@ -81,9 +81,9 @@ import com.sun.tools.corba.se.idl.constExpr.DefaultExprFactory; * time. Instead, these can be placed into a config file called idl.config. * This file must be in the CLASSPATH. The format of the includes line is: * - *
      + * 
      {@code
        * includes=;;...;
      - * 
      + * }
      * * Note that the path separator character, here shown as a semicolon, is * machine dependent. For instance, on Windows 95 this character is a @@ -481,10 +481,10 @@ public class Compile **/ public Arguments arguments = null; /** - * This hashtable contains pairs. It is filled in by + * This hashtable contains {@code } pairs. It is filled in by * extenders in cases where they wish to override an IDL type name with * some other name. For instance, when mapping to Java, there could be - * an overrideNames entry of <"TRUE", "true">. NOTE: Do NOT change this + * an overrideNames entry of {@code <"TRUE", "true">}. NOTE: Do NOT change this * variable to a new Hash table. Just add elements to it. **/ protected Hashtable overrideNames = new Hashtable (); @@ -495,8 +495,8 @@ public class Compile **/ protected Hashtable symbolTable = new Hashtable (); /** - * This is a vector of strings of the form "IDLfile" or . It is - * a list of the files included in the given IDL file. It will be empty + * This is a vector of strings of the form {@code "IDLfile"} or {@code }. + * It is a list of the files included in the given IDL file. It will be empty * until the parse method executes. If errors are encountered, the state * of this vector is undefined. **/ diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java index bd5ab9200fa..5f395be021b 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ConstEntry.java @@ -90,7 +90,7 @@ public class ConstEntry extends SymtabEntry } // generate /** Access the constant generator. - @returns an object which implements the ConstGen interface. + @return an object which implements the ConstGen interface. @see ConstGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java index f929d03f29b..f10d86f8e96 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/DefaultSymtabFactory.java @@ -202,7 +202,7 @@ public class DefaultSymtabFactory implements SymtabFactory 'char', 'octet', 'short', 'long', etc. The reason it is not limited to these is that, as an extender, you may wish to override these names. For instance, when generating Java code, octet translates to byte, so - there is an entry in Compile.overrideNames: <"octet", "byte"> and a + there is an entry in Compile.overrideNames: {@code <"octet", "byte">} and a PrimitiveEntry in the symbol table for "byte". */ public PrimitiveEntry primitiveEntry (String name) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java index 098301c5d88..ef7c048ce9b 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/EnumEntry.java @@ -84,7 +84,7 @@ public class EnumEntry extends SymtabEntry } // generate /** Access the enumerator generator. - @returns an object which implements the EnumGen interface. + @return an object which implements the EnumGen interface. @see EnumGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java index c18902b023f..a669b5d701c 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ExceptionEntry.java @@ -80,7 +80,7 @@ public class ExceptionEntry extends StructEntry } // generate /** Access the exception generator. - @returns an object which implements the ExceptionGen interface. + @return an object which implements the ExceptionGen interface. @see ExceptionGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java index 83a634c592f..a8da7685fd5 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardEntry.java @@ -83,7 +83,7 @@ public class ForwardEntry extends SymtabEntry implements InterfaceType } // generate /** Access the interface generator. - @returns an object which implements the InterfaceGen interface. + @return an object which implements the InterfaceGen interface. @see InterfaceGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java index ce78430d5b3..45c1a9de711 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ForwardValueEntry.java @@ -79,7 +79,7 @@ public class ForwardValueEntry extends ForwardEntry } // generate /** Access the interface generator. - @returns an object which implements the ForwardValueGen interface. + @return an object which implements the ForwardValueGen interface. @see ValueGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java index 42b9de6d846..cfb3529f974 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/IncludeEntry.java @@ -81,7 +81,7 @@ public class IncludeEntry extends SymtabEntry } // generate /** Access the Include type generator. - @returns an object which implements the IncludeGen interface. + @return an object which implements the IncludeGen interface. @see IncludeGen */ public Generator generator () { @@ -97,7 +97,7 @@ public class IncludeEntry extends SymtabEntry //d44810 /** Access the fully-qualified file specification of this include. - @returns a string containing the path of the include file. */ + @return a string containing the path of the include file. */ public String absFilename () { return _absFilename; diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java index 3b325467d7e..a5b303cb743 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/InterfaceEntry.java @@ -111,7 +111,7 @@ public class InterfaceEntry extends SymtabEntry implements InterfaceType } // generate /** Access the interface generator. - @returns an object which implements the InterfaceGen interface. + @return an object which implements the InterfaceGen interface. @see InterfaceGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java index f13d84599e2..f7acfa120c0 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/MethodEntry.java @@ -89,7 +89,7 @@ public class MethodEntry extends SymtabEntry } // generate /** Access the method generator. - @returns an object which implements the MethodGen interface. + @return an object which implements the MethodGen interface. @see MethodGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java index a5b8164020b..1dee7aa981e 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ModuleEntry.java @@ -84,7 +84,7 @@ public class ModuleEntry extends SymtabEntry } // generate /** Access the module generator. - @returns an object which implements the ModuleGen interface. + @return an object which implements the ModuleGen interface. @see ModuleGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java index c9075e54c63..7be0fa324b7 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/NativeEntry.java @@ -73,7 +73,7 @@ public class NativeEntry extends SymtabEntry } // generate /** Access the constant generator. - @returns an object which implements the ConstGen interface. + @return an object which implements the ConstGen interface. @see ConstGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java index d5d18dbd140..0818c11580b 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ParameterEntry.java @@ -88,7 +88,7 @@ public class ParameterEntry extends SymtabEntry } // generate /** Access the parameter generator. - @returns an object which implements the ParameterGen interface. + @return an object which implements the ParameterGen interface. @see ParameterGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java index dc805b87dde..f0f3aa2fca9 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PragmaEntry.java @@ -80,7 +80,7 @@ public class PragmaEntry extends SymtabEntry } // generate /** Access the Include type generator. - @returns an object which implements the IncludeGen interface. + @return an object which implements the IncludeGen interface. @see IncludeGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java index 8fb700b1055..0bbaadc5910 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/PrimitiveEntry.java @@ -81,7 +81,7 @@ public class PrimitiveEntry extends SymtabEntry } // generate /** Access the primitive type generator. - @returns an object which implements the PrimitiveGen interface. + @return an object which implements the PrimitiveGen interface. @see PrimitiveGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java index 8faebf4d226..7282ab02c1a 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/RepositoryID.java @@ -68,8 +68,8 @@ public class RepositoryID /** * Determine is a supplied string meets the minimal format requirement * for a Repository ID. - * @return true iff supplied string has form ':', where - * is any non-empty string not containing ':'. + * @return true if supplied string has form {@code ':'}, where + * {@code } is any non-empty string not containing ':'. **/ public static boolean hasValidForm (String string) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java index 20e2a4cc26d..78b20f3a3dc 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SequenceEntry.java @@ -101,7 +101,7 @@ public class SequenceEntry extends SymtabEntry } // generate /** Access the sequence generator. - @returns an object which implements the SequenceGen interface. + @return an object which implements the SequenceGen interface. @see SequenceGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java index a07f8e15fee..1283be83356 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StringEntry.java @@ -91,7 +91,7 @@ public class StringEntry extends SymtabEntry } // generate /** Access the primitive type generator. - @returns an object which implements the PrimitiveGen interface. + @return an object which implements the PrimitiveGen interface. @see PrimitiveGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java index de20327bd8d..3e500927bd5 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/StructEntry.java @@ -90,7 +90,7 @@ public class StructEntry extends SymtabEntry } // generate /** Access the struct generator. - @returns an object which implements the StructGen interface. + @return an object which implements the StructGen interface. @see StructGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java index 52b8f40157a..ed1772ce228 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabEntry.java @@ -127,7 +127,7 @@ public class SymtabEntry /** Get the name of this entry's module. If there are modules within modules, each module name is separated by '/'. - @returns this entry's module name. */ + @return this entry's module name. */ public String module () { return _module; diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java index 1a2f36d5c4c..e41d9931aef 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/SymtabFactory.java @@ -97,7 +97,7 @@ public interface SymtabFactory char, octet, short, long, etc. The reason it is not limited to these is that, as an extender, you may wish to override these names. For instance, when generating Java code, octet translates to byte, - so there is an entry in Compile.overrideNames: <"octet", "byte"> + so there is an entry in Compile.overrideNames: {@code <"octet", "byte">} and a PrimitiveEntry in the symbol table for "byte". */ PrimitiveEntry primitiveEntry (String name); diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java index 8ec46d0da1d..c758a56ebfc 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/Token.java @@ -332,7 +332,7 @@ class Token * @param boolean[] collidesWithKeyword is an array containing one value: a flag * representing whether this string is an identifier that collides with a keyword. * This is set by this method. - * @returns Token The resulting Token corresponding to string. + * @return Token The resulting Token corresponding to string. */ public static Token makeKeywordToken( String string, float corbaLevel, boolean escapedOK, boolean[] collision ) diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java index 8ed44f5dbd7..9a617b57bdc 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/TypedefEntry.java @@ -110,7 +110,7 @@ public class TypedefEntry extends SymtabEntry } /** Access the typedef generator. - @returns an object which implements the TypedefGen interface. + @return an object which implements the TypedefGen interface. @see TypedefGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java index 8b0df9da391..55a7aa434e1 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionBranch.java @@ -46,29 +46,21 @@ import com.sun.tools.corba.se.idl.TypedefEntry; * of what it may contain: *
      *
      - *
      - * case 1: short x;
      - * 
      - *
      , false> + * {@code case 1: short x;} + *
      {@code , false>} *
      - *
      - * case 0:
      - * case 8:
      - * case 2: long x;
      - * 
      - *
      , false> + * {@code case 0:}
      + * {@code case 8:}
      + * {@code case 2: long x;} + *
      {@code , false>} *
      - *
      - * default: long x;
      - * 
      - *
      , true> + * {@code default: long x;} + *
      {@code , true>} *
      - *
      - * case 0:
      - * case 2:
      - * default: char c;
      - * 
      - *
      , true> + * {@code case 0:}
      + * {@code case 2:}
      + * {@code default: char c;} + *
      {@code , true>} *
      **/ public class UnionBranch diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java index b41b84003aa..0d438a6f9d4 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/UnionEntry.java @@ -93,7 +93,7 @@ public class UnionEntry extends SymtabEntry } // generate /** Access the union generator. - @returns an object which implements the UnionGen interface. + @return an object which implements the UnionGen interface. @see UnionGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java index ebc6704e2eb..9a231e42391 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueBoxEntry.java @@ -77,7 +77,7 @@ public class ValueBoxEntry extends ValueEntry } // generate /** Access the value generator. - @returns an object which implements the ValueGen interface. + @return an object which implements the ValueGen interface. @see ValueGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java index 2d92a9bdbbd..093ee990c43 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ValueEntry.java @@ -86,7 +86,7 @@ public class ValueEntry extends InterfaceEntry } // generate /** Access the value generator. - @returns an object which implements the ValueGen interface. + @return an object which implements the ValueGen interface. @see ValueGen */ public Generator generator () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java index 71c9f29192d..ebe3fd22e62 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/constExpr/Terminal.java @@ -43,11 +43,11 @@ import java.math.BigInteger; /** * This class contains values. Objects of this class are the terminal * nodes of an expression tree. - * + *

      * Note that there is a constructor for Double values, but not Float. * CORBA defines that all floating point expressions are evaluated as * double, and that the result is coerced back to float if necessary. - * + *

      * Note also that there is a constructor for long values, but not for * int or short. CORBA defines that all integral expressions are evaluated * as unsigned long. A CORBA long is a Java int. There is no unsigned int diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java index 8f36cc5ad6a..6620608e8aa 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Arguments.java @@ -260,7 +260,7 @@ public class Arguments extends com.sun.tools.corba.se.idl.Arguments } // packageFromProps /** - * d57482 method added so default emitter check could be overriden. + * d57482 (klr) method added so default emitter check could be overriden. **/ protected void setDefaultEmitter () { // If the flag -fclient was not found, assume it. diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java index bf61f70baad..a06904311e9 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/AttributeGen24.java @@ -64,7 +64,7 @@ public class AttributeGen24 extends MethodGenClone24 } // ctor /** - * Added for 2.4 RTF + * (d62023-klr) Added for 2.4 RTF **/ protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { @@ -83,7 +83,7 @@ public class AttributeGen24 extends MethodGenClone24 } // abstractMethod /** - * Added for 2.4 RTF + * (d62023-klr) Added for 2.4 RTF **/ protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java index c9c9854b8e2..08aecd1dac5 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Compile.java @@ -87,37 +87,37 @@ import com.sun.tools.corba.se.idl.InvalidArgument; * * Options: *

      - *
      -i <include path> + *
      {@code -i } *
      By default, the current directory is scanned for included files. * This option adds another directory. See also the note below. * - *
      -d <symbol> + *
      {@code -d } *
      This is equivalent to the following line in an IDL file: - * #define <symbol> + * {@code #define } * - *
      -f - *
      Defines what bindings to emit. is one of client, server, all, + *
      {@code -f } + *
      Defines what bindings to emit. {@code } is one of client, server, all, * serverTIE, allTIE. serverTIE and allTIE cause delegate model skeletons * to be emitted. If this flag is not used, -fclient is assumed. * allPOA has the same effect as all, except for generation POA type skeletons. * - *
      -keep + *
      {@code -keep} *
      If a file to be generated already exists, do not overwrite it. By * default it is overwritten. * - *
      -sep + *
      {@code -sep } *
      Only valid with -m. Replace the file separator character with - * in the file names listed in the .u file. + * {@code } in the file names listed in the .u file. * - *
      -emitAll + *
      {@code -emitAll} *
      Emit all types, including those found in #included files. * - *
      -v + *
      {@code -v} *
      Verbose mode. * - *
      -pkgPrefix - *
      Whereever is encountered, make sure it resides within - * <package> in all generated files. <type> is a fully + *
      {@code -pkgPrefix } + *
      Whereever {@code } is encountered, make sure it resides within + * {@code } in all generated files. {@code } is a fully * qualified, java-style name. *
      * @@ -127,9 +127,9 @@ import com.sun.tools.corba.se.idl.InvalidArgument; * called idl.config. This file must be in the CLASSPATH. The format of * the includes line is: * - *
      + * 
      {@code
        * includes=;;...;
      - * 
      + * }
      * * Note that the path separator character, here shown as a semicolon, * is machine dependent. For instance, on Windows 95 this character diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java index 4f20f627613..0079b1413e8 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Helper24.java @@ -70,7 +70,7 @@ public class Helper24 extends Helper /** * Generate the heading, including package, imports, class statements, * and open curly. - * - don't implement ValueHelper, make non-boxed helpers abstract + * d62023 - don't implement ValueHelper, make non-boxed helpers abstract **/ protected void writeHeading () { @@ -92,8 +92,10 @@ public class Helper24 extends Helper /** * Generate the instance variables. - * - no helper instance except for boxed valuetypes. - * - move truncatable_ids to mapped class. + *
      +   * d62023 - no helper instance except for boxed valuetypes;
      +   *        - move truncatable_ids to mapped class.
      +   * 
      **/ protected void writeInstVars () { @@ -110,9 +112,9 @@ public class Helper24 extends Helper } // writeInstVars /** - * generate members of BoxedValueHelper interface if boxed + * d62023 - generate members of BoxedValueHelper interface if boxed * - * Hook in here to write factory methods for non-boxed ValueTypes + * d62023 - hook in here to write factory methods for non-boxed ValueTypes * into Helper. **/ protected void writeValueHelperInterface () @@ -143,8 +145,8 @@ public class Helper24 extends Helper } // writeHelperFactories /** - * Generate constructors only for boxed valuetype helpers - * All other helpers are abstract. + * d62023 - generate constructors only for boxed valuetype helpers. + * All other helpers are abstract. **/ protected void writeCtors () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java index 4cd1a31a9bb..2667b9ee63b 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java @@ -190,17 +190,19 @@ public class InterfaceGen implements com.sun.tools.corba.se.idl.InterfaceGen, Ja /** * Generate the interface. Provides general algorithm for binding generation: - * 1.) Initialize members unique to this generator. - init () - * 2.) Open print stream - openStream () - * 3.) Write class heading (package, prologue, class statement, open curly - writeHeading () - * 4.) Write class body (member data and methods) - write*Body () - * 5.) Write class closing (close curly) - writeClosing () - * 6.) Close the print stream - closeStream () + *
        + *
      1. Initialize members unique to this generator - init()
      2. + *
      3. Open print stream - openStream()
      4. + *
      5. Write class heading (package, prologue, class statement, open curly - writeHeading()
      6. + *
      7. Write class body (member data and methods) - write*Body()
      8. + *
      9. Write class closing (close curly) - writeClosing()
      10. + *
      11. Close the print stream - closeStream ()
      12. + *
      * * For CORBA 2.3, interfaces are mapped to Operations and Signature * interfaces. The Operations interface contains the method definitions. * The Signature interface extends the Operations interface and adds - * CORBA::Object. + * CORBA::Object. (klr) **/ protected void generateInterface () { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java index 99c05ecc4f5..ba84c9f1a1a 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGen24.java @@ -96,7 +96,7 @@ public class MethodGen24 extends MethodGen } /** - * Write the methodEntry for a valuetype factory method into + * d62023 - write the methodEntry for a valuetype factory method into * the Value Helper class. Contents from email from Simon, * 4/25/99. **/ @@ -135,7 +135,7 @@ public class MethodGen24 extends MethodGen } // helperFactoryMethod /** - * - write an abstract method definition + * d62023 - write an abstract method definition **/ protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { @@ -152,8 +152,8 @@ public class MethodGen24 extends MethodGen } // abstractMethod /** - * - write a default factory method implementation for the - * DefaultFactory. m is a methodEntry for a factory + * d62023 - write a default factory method implementation for the + * {@code DefaultFactory}. m is a methodEntry for a factory * method contained in a non-abstract ValueEntry. **/ protected void defaultFactoryMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) @@ -176,7 +176,7 @@ public class MethodGen24 extends MethodGen } // defaultFactoryMethod /** - * - remove all valueInitializer junk + * d62023 - remove all valueInitializer junk **/ protected void writeMethodSignature () { @@ -242,7 +242,7 @@ public class MethodGen24 extends MethodGen } // writeMethodSignature /** - * - delete method templates for valuetypes + * d62023 - delete method templates for valuetypes **/ protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java index 49c6bc8b985..5c2e9596b0a 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/MethodGenClone24.java @@ -74,7 +74,7 @@ public class MethodGenClone24 extends AttributeGen } // ctor /** - * - write an abstract method definition + * d62023 - write an abstract method definition **/ protected void abstractMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { @@ -91,7 +91,7 @@ public class MethodGenClone24 extends AttributeGen } // abstractMethod /** - * - delete method templates for valuetypes + * d62023 - delete method templates for valuetypes **/ protected void interfaceMethod (Hashtable symbolTable, MethodEntry m, PrintWriter stream) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java index 7e0d8373dab..7397619f2f2 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java @@ -534,7 +534,7 @@ public class Util extends com.sun.tools.corba.se.idl.Util } // holderName /** - * + * d61056 **/ public static String helperName (SymtabEntry entry, boolean qualifiedName) { @@ -1412,7 +1412,7 @@ public class Util extends com.sun.tools.corba.se.idl.Util // /** * @return true if the current setting of corbaLevel is within delta of - * the range min <= corbaLevel <= max + * the range {@code min <= corbaLevel <= max} **/ public static boolean corbaLevel (float min, float max) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java index 02d87ed09f5..dbb1ced706c 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueBoxGen24.java @@ -69,7 +69,7 @@ public class ValueBoxGen24 extends ValueBoxGen } // ctor /** - * - Move from helper to mapped class + * d62023 - Move from helper to mapped class **/ protected void writeTruncatable () // { @@ -84,7 +84,7 @@ public class ValueBoxGen24 extends ValueBoxGen /** - * + * d62023 **/ public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) { @@ -121,7 +121,7 @@ public class ValueBoxGen24 extends ValueBoxGen } // helperRead /** - * + * d62023 **/ public void helperWrite (SymtabEntry entry, PrintWriter stream) { @@ -144,7 +144,7 @@ public class ValueBoxGen24 extends ValueBoxGen } // helperWrite /** - * + * d62023 **/ public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) { diff --git a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java index 27930c2d59b..93701b01049 100644 --- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java +++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/ValueGen24.java @@ -73,15 +73,17 @@ public class ValueGen24 extends ValueGen } // ctor /** - * - delete constructor; helper is abstract + * d62023 - delete constructor; helper is abstract **/ protected void writeConstructor () { } // writeConstructor /** - * - delete write_value from non-boxed helpers - * - delete _write from non-boxed helpers + *
      +   * d62023 - delete write_value from non-boxed helpers
      +   *        - delete _write from non-boxed helpers
      +   * 
      **/ public void helperWrite (SymtabEntry entry, PrintWriter stream) { @@ -91,7 +93,7 @@ public class ValueGen24 extends ValueGen } // helperWrite /** - * + * d62023 **/ public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) { @@ -101,7 +103,7 @@ public class ValueGen24 extends ValueGen } // helperRead /** - * - suppress initializers from mapped value; now generated in + * d62023 - suppress initializers from mapped value; now generated in * the Helper class and Factory class **/ protected void writeInitializers () @@ -110,7 +112,7 @@ public class ValueGen24 extends ValueGen } // writeInitializers /** - * - Goes in mapped class, not Helper + * d62023 - goes in mapped class, not Helper **/ protected void writeTruncatable () // { @@ -155,7 +157,7 @@ public class ValueGen24 extends ValueGen } /** - * CustomMarshal -> CustomValue for custom valuetypes + * d62023 - CustomMarshal {@literal ->} CustomValue for custom valuetypes * mapped class is abstract **/ protected void writeHeading () @@ -217,7 +219,7 @@ public class ValueGen24 extends ValueGen } // writeHeading /** - * - private state maps to protected, not default + * d62023 - private state maps to protected, not default **/ protected void writeMembers () { @@ -245,8 +247,7 @@ public class ValueGen24 extends ValueGen } // writeMembers /** - * Methods need to be abstract - * writeStreamable + * d62023 - methods need to be abstract writeStreamable **/ protected void writeMethods () { @@ -294,7 +295,7 @@ public class ValueGen24 extends ValueGen } // writeMethods /** - * Call super._read() + * d62023 - call super._read() **/ public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) { @@ -335,7 +336,7 @@ public class ValueGen24 extends ValueGen } // read /** - * Call super._write() + * d62023 - call super._write() **/ public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) { @@ -374,7 +375,7 @@ public class ValueGen24 extends ValueGen } // write /** - * <62023> - generate factory interface and default factory + * d62023 - generate factory interface and default factory **/ public void generate (Hashtable symbolTable, ValueEntry v, PrintWriter str) { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java b/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java index 6aba94ad75d..4dee33450b1 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/LocalObject.java @@ -28,7 +28,7 @@ import org.omg.CORBA.portable.*; /** - *

      Used as a base class for implementation of a local IDL interface in the + * Used as a base class for implementation of a local IDL interface in the * Java language mapping. It is a class which implements all the operations * in the org.omg.CORBA.Object interface. *

      Local interfaces are implemented by using CORBA::LocalObject @@ -49,9 +49,10 @@ import org.omg.CORBA.portable.*; *

      LocalObject is to be used as the base class of locally * constrained objects, such as those in the PortableServer module. * The specification here is based on the CORBA Components - * Volume I - orbos/99-07-01

      + * Volume I - orbos/99-07-01 + * * @see CORBA package - * comments for unimplemented features + * comments for unimplemented features */ public class LocalObject implements org.omg.CORBA.Object @@ -64,7 +65,7 @@ public class LocalObject implements org.omg.CORBA.Object public LocalObject() {} /** - *

      Determines whether the two object references are equivalent, + * Determines whether the two object references are equivalent, * so far as the ORB can easily determine. Two object references are equivalent * if they are identical. Two distinct object references which in fact refer to * the same object are also equivalent. However, ORBs are not required diff --git a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/CompoundType.java b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/CompoundType.java index fcbbaccfd4a..386e3082c36 100644 --- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/CompoundType.java +++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/CompoundType.java @@ -145,15 +145,15 @@ public abstract class CompoundType extends Type { /** * Return true if this type implements - * isIDLEntity() && isException(). + * {@code isIDLEntity() && isException()}. */ public boolean isIDLEntityException () { return isIDLEntity() && isException(); } /** - * Return true if isIDLEntity() && !isValueBase() + * Return true if {@code isIDLEntity() && !isValueBase() * && !isAbstractBase() && !isCORBAObject() - * && !isIDLEntityException(). + * && !isIDLEntityException()}. */ public boolean isBoxed () { return (isIDLEntity() && !isValueBase() && @@ -1984,7 +1984,7 @@ public abstract class CompoundType extends Type { } /** - * Return true if this is NOT a constructor && is not + * Return true if this is NOT a constructor {@code &&} is not * an attribute. */ public boolean isNormalMethod () { diff --git a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/ContextStack.java b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/ContextStack.java index d79bfcbefd3..518d9a4f751 100644 --- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/ContextStack.java +++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/ContextStack.java @@ -95,7 +95,7 @@ public class ContextStack { } /** - * Return true if env.nerrors > 0. + * Return true if {@code env.nerrors > 0}. */ public boolean anyErrors () { return env.nerrors > 0; diff --git a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/IDLGenerator.java b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/IDLGenerator.java index 5b0e56b8387..c29414a52dc 100644 --- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/IDLGenerator.java +++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/IDLGenerator.java @@ -91,8 +91,8 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { /** * Create and return a top-level type. - * @param env The compiler environment. * @param cdef The top-level class definition. + * @param stack The context stack. * @return An RemoteType or null if is non-conforming. */ protected sun.rmi.rmic.iiop.CompoundType getTopType(ClassDefinition cdef, @@ -169,7 +169,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { * Examine and consume command line arguments. * @param argv The command line arguments. Ignore null * and unknown arguments. Set each consumed argument to null. - * @param error Report any errors using the main.error() methods. + * @param main Report any errors using the main.error() methods. * @return true if no errors, false otherwise. */ public boolean parseArgs(String argv[], Main main) { @@ -195,11 +195,11 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { else if ( argv[i].equalsIgnoreCase( "-init" ) ) { factory = false; argv[i] = null; - } + } else if ( argv[i].equalsIgnoreCase( "-factory" ) ) { factory = true; argv[i] = null; - } + } else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) { argv[i] = null; if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) { @@ -210,7 +210,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { argv[i] = null; ifHash.put( idlFrom,idlTo ); continue nextArg; - } + } } main.error("rmic.option.requires.argument", "-idlfile"); result = false; @@ -403,7 +403,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { * Write the output for the given OutputFileName into the output stream. * (The IDL mapping for java.lang.Class is generated from * javax.rmi.CORBA.ClassDesc in the tools workspace) - * @param OutputType ot One of the items returned by getOutputTypesFor(...) + * @param ot One of the items returned by getOutputTypesFor(...) * @param alreadyChecked A set of Types which have already been checked. * Intended to be passed to Type.collectMatching(filter,alreadyChecked). * @param p The output stream. @@ -927,7 +927,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { * Add reference for given type avoiding duplication. * Sort into specials, arrays and regular references. * Filter out types which are not required. - * @param t Given Type + * @param ref Given Type * @param refHash Hashtable for type references * @param spcHash Hashtable for special type references * @param arrHash Hashtable for array references @@ -986,7 +986,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { * Collect and filter thrown exceptions for a given pre-filtered method. * Keep only 'checked' exception classes minus java.rmi.RemoteException * and its subclasses - * @param method The current method + * @param mth The current method * @param excHash Hashtable containing non-duplicate thrown exceptions */ protected void getExceptions( @@ -1077,7 +1077,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { * order. * Non-static, non-transient fields are mapped. * If the type is a custom valuetype, only public fields are mapped. - * @param ct The current CompoundType + * @param t The current CompoundType * @return Vector containing the data fields */ protected Vector getData( @@ -1163,7 +1163,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { /** * Write forward reference for boxed valuetype for single dimension of IDL * sequence. - * If the dimension is <1 and the element is a CompoundType, write a + * If the dimension is {@literal < 1} and the element is a CompoundType, write a * forward declare for the element * @param at ArrayType for forward declare * @param dim The dimension to write @@ -1276,7 +1276,7 @@ public class IDLGenerator extends sun.rmi.rmic.iiop.Generator { /** * Write #includes - * @param incHash Hashtable loaded with Types to include + * @param inhHash Hashtable loaded with Types to include * @param p The output stream. */ protected void writeInheritedIncludes( diff --git a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Type.java b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Type.java index c1723a5aaf9..425e9385d96 100644 --- a/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Type.java +++ b/corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop/Type.java @@ -51,7 +51,7 @@ import sun.rmi.rmic.Names; * conformance checking and name mapping as defined in the "Java to IDL * Mapping" OMG specification. The family is composed of the following * fixed set of types: - *

      + * 
      {@literal
        *
        *                                              +- RemoteType <-- AbstractType
        *                                              |
      @@ -67,7 +67,7 @@ import sun.rmi.rmic.Names;
        *                                              |
        *                                              +- NCClassType
        *
      - * 
      + * }
      * PrimitiveType represents a primitive or a void type. *

      * CompoundType is an abstract base representing any non-special class diff --git a/hotspot/.hgtags b/hotspot/.hgtags index bf3b531730c..c52975971ac 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -465,3 +465,4 @@ ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58 9c916db4bf3bc164a47b5a9cefe5ffd71e111f6a jdk9-b60 715d2da5801c410746e92f08066d53bde1496286 jdk9-b61 1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62 +2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63 diff --git a/hotspot/agent/src/os/bsd/libproc_impl.c b/hotspot/agent/src/os/bsd/libproc_impl.c index 78da80617fa..b8ba361b8a9 100644 --- a/hotspot/agent/src/os/bsd/libproc_impl.c +++ b/hotspot/agent/src/os/bsd/libproc_impl.c @@ -215,7 +215,12 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, return NULL; } - strncpy(newlib->name, libname, sizeof(newlib->name)); + if (strlen(libname) >= sizeof(newlib->name)) { + print_debug("libname %s too long\n", libname); + return NULL; + } + strcpy(newlib->name, libname); + newlib->base = base; if (fd == -1) { diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/agent/src/os/linux/libproc_impl.c index a04bc37d1d7..97d3acf9282 100644 --- a/hotspot/agent/src/os/linux/libproc_impl.c +++ b/hotspot/agent/src/os/linux/libproc_impl.c @@ -159,7 +159,12 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, return NULL; } - strncpy(newlib->name, libname, sizeof(newlib->name)); + if (strlen(libname) >= sizeof(newlib->name)) { + print_debug("libname %s too long\n", libname); + return NULL; + } + strcpy(newlib->name, libname); + newlib->base = base; if (fd == -1) { diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java b/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java index 751d4a63114..7da5b6534ca 100644 --- a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java +++ b/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java @@ -46,6 +46,11 @@ public abstract class ActionManager return manager; } + protected static void setInstance(ActionManager m) + { + manager = m; + } + protected abstract void addActions(); protected void addAction(String cmdname, Action action) @@ -90,6 +95,6 @@ public abstract class ActionManager private HashMap actions; private static ActionUtilities utilities = new ActionUtilities(); - protected static ActionManager manager; + private static ActionManager manager; } diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java b/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java index b4eb95df336..d2d85c3086a 100644 --- a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java +++ b/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java @@ -46,7 +46,7 @@ public abstract class CommonToolBar extends JToolBar { this.manager = manager; statusBar = status; - buttonSize = new Dimension(CommonUI.buttconPrefSize); + buttonSize = new Dimension(CommonUI.getButtconPrefSize()); buttonInsets = new Insets(0, 0, 0, 0); addComponents(); } diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java b/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java index e6adc50201e..a1c8127f475 100644 --- a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java +++ b/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java @@ -373,20 +373,25 @@ public class CommonUI comp.setCursor(Cursor.getPredefinedCursor(0)); } - public static final int BUTTON_WIDTH = 100; - public static final int BUTTON_HEIGHT = 26; - public static final int BUTTCON_WIDTH = 28; - public static final int BUTTCON_HEIGHT = 28; - public static final int SM_BUTTON_WIDTH = 72; - public static final int SM_BUTTON_HEIGHT = 26; - public static final int LABEL_WIDTH = 100; - public static final int LABEL_HEIGHT = 20; - public static final int TEXT_WIDTH = 150; - public static final int TEXT_HEIGHT = 20; - public static Dimension buttonPrefSize = new Dimension(100, 26); - public static Dimension buttconPrefSize = new Dimension(28, 28); - public static Dimension smbuttonPrefSize = new Dimension(72, 26); - public static Dimension labelPrefSize = new Dimension(100, 20); - public static Dimension textPrefSize = new Dimension(150, 20); + public static Dimension getButtconPrefSize() + { + return buttconPrefSize; + } + + private static final int BUTTON_WIDTH = 100; + private static final int BUTTON_HEIGHT = 26; + private static final int BUTTCON_WIDTH = 28; + private static final int BUTTCON_HEIGHT = 28; + private static final int SM_BUTTON_WIDTH = 72; + private static final int SM_BUTTON_HEIGHT = 26; + private static final int LABEL_WIDTH = 100; + private static final int LABEL_HEIGHT = 20; + private static final int TEXT_WIDTH = 150; + private static final int TEXT_HEIGHT = 20; + private static final Dimension buttonPrefSize = new Dimension(100, 26); + private static final Dimension buttconPrefSize = new Dimension(28, 28); + private static final Dimension smbuttonPrefSize = new Dimension(72, 26); + private static final Dimension labelPrefSize = new Dimension(100, 20); + private static final Dimension textPrefSize = new Dimension(150, 20); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java index 13ad04a9d30..83056d060a3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java @@ -148,7 +148,7 @@ public class ciMethodData extends ciMetadata implements MethodDataInterface parametersTypeData() { Address base = getAddress().addOffsetTo(origField.getOffset()); int di = (int)parametersTypeDataDi.getValue(base); - if (di == -1) { + if (di == -1 || di == -2) { return null; } DataLayout dataLayout = new DataLayout(dataField.getValue(getAddress()), di); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java index b0b6d8462f0..815a74bc276 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/G1CollectedHeap.java @@ -29,9 +29,9 @@ import java.util.Observable; import java.util.Observer; import sun.jvm.hotspot.debugger.Address; +import sun.jvm.hotspot.gc_interface.CollectedHeap; import sun.jvm.hotspot.gc_interface.CollectedHeapName; import sun.jvm.hotspot.memory.MemRegion; -import sun.jvm.hotspot.memory.SharedHeap; import sun.jvm.hotspot.memory.SpaceClosure; import sun.jvm.hotspot.runtime.VM; import sun.jvm.hotspot.runtime.VMObjectFactory; @@ -41,7 +41,7 @@ import sun.jvm.hotspot.types.TypeDataBase; // Mirror class for G1CollectedHeap. -public class G1CollectedHeap extends SharedHeap { +public class G1CollectedHeap extends CollectedHeap { // HeapRegionManager _hrm; static private long hrmFieldOffset; // MemRegion _g1_reserved; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeap.java index daf619536ec..c66a791dfd8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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.memory.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; -public class CollectedHeap extends VMObject { +public abstract class CollectedHeap extends VMObject { private static long reservedFieldOffset; static { @@ -73,9 +73,7 @@ public class CollectedHeap extends VMObject { return reservedRegion().contains(a); } - public CollectedHeapName kind() { - return CollectedHeapName.ABSTRACT; - } + public abstract CollectedHeapName kind(); public void print() { printOn(System.out); } public void printOn(PrintStream tty) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeapName.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeapName.java index 2e57740135a..7e18cfa5075 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeapName.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/CollectedHeapName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +31,6 @@ public class CollectedHeapName { private CollectedHeapName(String name) { this.name = name; } - public static final CollectedHeapName ABSTRACT = new CollectedHeapName("abstract"); - public static final CollectedHeapName SHARED_HEAP = new CollectedHeapName("SharedHeap"); public static final CollectedHeapName GEN_COLLECTED_HEAP = new CollectedHeapName("GenCollectedHeap"); public static final CollectedHeapName G1_COLLECTED_HEAP = new CollectedHeapName("G1CollectedHeap"); public static final CollectedHeapName PARALLEL_SCAVENGE_HEAP = new CollectedHeapName("ParallelScavengeHeap"); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java index b39c4602043..074e7fa286e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java @@ -33,8 +33,7 @@ import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; import sun.jvm.hotspot.utilities.*; -public class GenCollectedHeap extends SharedHeap { - private static CIntegerField nGensField; +public class GenCollectedHeap extends CollectedHeap { private static AddressField youngGenField; private static AddressField oldGenField; @@ -54,7 +53,6 @@ public class GenCollectedHeap extends SharedHeap { private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("GenCollectedHeap"); - nGensField = type.getCIntegerField("_n_gens"); youngGenField = type.getAddressField("_young_gen"); oldGenField = type.getAddressField("_old_gen"); @@ -70,7 +68,7 @@ public class GenCollectedHeap extends SharedHeap { } public int nGens() { - return (int) nGensField.getValue(addr); + return 2; // Young + Old } public Generation getGen(int i) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java index a6654340276..ee4fbb06594 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -112,11 +112,7 @@ public class Universe { return ""; } public CollectedHeap heap() { - try { - return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue()); - } catch (WrongTypeException e) { - return new CollectedHeap(collectedHeapField.getValue()); - } + return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue()); } public static long getNarrowOopBase() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualSpace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java similarity index 97% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualSpace.java rename to hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java index 6cc90f1fe23..a4acab2087e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualSpace.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java @@ -22,10 +22,11 @@ * */ -package sun.jvm.hotspot.runtime; +package sun.jvm.hotspot.memory; import java.util.*; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; public class VirtualSpace extends VMObject { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java index a055fe1619c..5cbc25e8ef4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @@ -328,7 +328,7 @@ public class ConstantPool extends Metadata implements ClassConstants { } public Symbol getUnresolvedStringAt(int which) { - return getSymbolAt(which); + return getSlotAt(which).getSymbol(); } // returns null, if not resolved. diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java index 4429754a5fe..920e6af0fb6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java @@ -42,10 +42,10 @@ public class PhaseCFG extends Phase { private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { Type type = db.lookupType("PhaseCFG"); - numBlocksField = new CIntField(type.getCIntegerField("_num_blocks"), 0); + numBlocksField = new CIntField(type.getCIntegerField("_number_of_blocks"), 0); blocksField = type.getAddressField("_blocks"); bbsField = type.getAddressField("_node_to_block_mapping"); - brootField = type.getAddressField("_broot"); + brootField = type.getAddressField("_root_block"); } private static CIntField numBlocksField; 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 ee0b541bdbf..eb15f9f9047 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 @@ -259,8 +259,7 @@ public class VM { saProps = new Properties(); URL url = null; try { - url = VM.class.getClassLoader().getResource("sa.properties"); - saProps.load(new BufferedInputStream(url.openStream())); + saProps.load(VM.class.getResourceAsStream("/sa.properties")); } catch (Exception e) { System.err.println("Unable to load properties " + (url == null ? "null" : url.toString()) + diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java index 0d6d5328967..558aa4a8dbd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java @@ -314,26 +314,17 @@ public class X86Frame extends Frame { //------------------------------------------------------------------------------ // frame::adjust_unextended_sp private void adjustUnextendedSP() { - // If we are returning to a compiled MethodHandle call site, the - // saved_fp will in fact be a saved value of the unextended SP. The - // simplest way to tell whether we are returning to such a call site - // is as follows: + // On x86, sites calling method handle intrinsics and lambda forms are treated + // as any other call site. Therefore, no special action is needed when we are + // returning to any of these call sites. CodeBlob cb = cb(); NMethod senderNm = (cb == null) ? null : cb.asNMethodOrNull(); if (senderNm != null) { - // If the sender PC is a deoptimization point, get the original - // PC. For MethodHandle call site the unextended_sp is stored in - // saved_fp. - if (senderNm.isDeoptMhEntry(getPC())) { - // DEBUG_ONLY(verifyDeoptMhOriginalPc(senderNm, getFP())); - raw_unextendedSP = getFP(); - } - else if (senderNm.isDeoptEntry(getPC())) { - // DEBUG_ONLY(verifyDeoptOriginalPc(senderNm, raw_unextendedSp)); - } - else if (senderNm.isMethodHandleReturn(getPC())) { - raw_unextendedSP = getFP(); + // If the sender PC is a deoptimization point, get the original PC. + if (senderNm.isDeoptEntry(getPC()) || + senderNm.isDeoptMhEntry(getPC())) { + // DEBUG_ONLY(verifyDeoptriginalPc(senderNm, raw_unextendedSp)); } } } 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 afe4d2a50b5..eb090565a9b 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 @@ -81,53 +81,48 @@ public class HeapSummary extends Tool { System.out.println(); System.out.println("Heap Usage:"); - if (heap instanceof SharedHeap) { - SharedHeap sharedHeap = (SharedHeap) heap; - if (sharedHeap instanceof GenCollectedHeap) { - GenCollectedHeap genHeap = (GenCollectedHeap) sharedHeap; - for (int n = 0; n < genHeap.nGens(); n++) { - Generation gen = genHeap.getGen(n); - if (gen instanceof sun.jvm.hotspot.memory.DefNewGeneration) { - System.out.println("New Generation (Eden + 1 Survivor Space):"); - printGen(gen); + if (heap instanceof GenCollectedHeap) { + GenCollectedHeap genHeap = (GenCollectedHeap) heap; + for (int n = 0; n < genHeap.nGens(); n++) { + Generation gen = genHeap.getGen(n); + if (gen instanceof sun.jvm.hotspot.memory.DefNewGeneration) { + System.out.println("New Generation (Eden + 1 Survivor Space):"); + printGen(gen); - ContiguousSpace eden = ((DefNewGeneration)gen).eden(); - System.out.println("Eden Space:"); - printSpace(eden); + ContiguousSpace eden = ((DefNewGeneration)gen).eden(); + System.out.println("Eden Space:"); + printSpace(eden); - ContiguousSpace from = ((DefNewGeneration)gen).from(); - System.out.println("From Space:"); - printSpace(from); + ContiguousSpace from = ((DefNewGeneration)gen).from(); + System.out.println("From Space:"); + printSpace(from); - ContiguousSpace to = ((DefNewGeneration)gen).to(); - System.out.println("To Space:"); - printSpace(to); - } else { - System.out.println(gen.name() + ":"); - printGen(gen); - } + ContiguousSpace to = ((DefNewGeneration)gen).to(); + System.out.println("To Space:"); + printSpace(to); + } else { + System.out.println(gen.name() + ":"); + printGen(gen); } - } else if (sharedHeap instanceof G1CollectedHeap) { - G1CollectedHeap g1h = (G1CollectedHeap) sharedHeap; - G1MonitoringSupport g1mm = g1h.g1mm(); - long edenRegionNum = g1mm.edenRegionNum(); - long survivorRegionNum = g1mm.survivorRegionNum(); - HeapRegionSetBase oldSet = g1h.oldSet(); - HeapRegionSetBase humongousSet = g1h.humongousSet(); - long oldRegionNum = oldSet.count().length() - + humongousSet.count().capacity() / HeapRegion.grainBytes(); - printG1Space("G1 Heap:", g1h.n_regions(), - g1h.used(), g1h.capacity()); - System.out.println("G1 Young Generation:"); - printG1Space("Eden Space:", edenRegionNum, - g1mm.edenUsed(), g1mm.edenCommitted()); - printG1Space("Survivor Space:", survivorRegionNum, - g1mm.survivorUsed(), g1mm.survivorCommitted()); - printG1Space("G1 Old Generation:", oldRegionNum, - g1mm.oldUsed(), g1mm.oldCommitted()); - } else { - throw new RuntimeException("unknown SharedHeap type : " + heap.getClass()); } + } else if (heap instanceof G1CollectedHeap) { + G1CollectedHeap g1h = (G1CollectedHeap) heap; + G1MonitoringSupport g1mm = g1h.g1mm(); + long edenRegionNum = g1mm.edenRegionNum(); + long survivorRegionNum = g1mm.survivorRegionNum(); + HeapRegionSetBase oldSet = g1h.oldSet(); + HeapRegionSetBase humongousSet = g1h.humongousSet(); + long oldRegionNum = oldSet.count().length() + + humongousSet.count().capacity() / HeapRegion.grainBytes(); + printG1Space("G1 Heap:", g1h.n_regions(), + g1h.used(), g1h.capacity()); + System.out.println("G1 Young Generation:"); + printG1Space("Eden Space:", edenRegionNum, + g1mm.edenUsed(), g1mm.edenCommitted()); + printG1Space("Survivor Space:", survivorRegionNum, + g1mm.survivorUsed(), g1mm.survivorCommitted()); + printG1Space("G1 Old Generation:", oldRegionNum, + g1mm.oldUsed(), g1mm.oldCommitted()); } else if (heap instanceof ParallelScavengeHeap) { ParallelScavengeHeap psh = (ParallelScavengeHeap) heap; PSYoungGen youngGen = psh.youngGen(); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java index f234231e363..1ebcb1b3882 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java @@ -32,10 +32,12 @@ import com.sun.java.swing.action.ActionManager; public class HSDBActionManager extends ActionManager { public static ActionManager getInstance() { - if (manager == null) { - manager = new HSDBActionManager(); + ActionManager m = ActionManager.getInstance(); + if (m == null) { + m = new HSDBActionManager(); + ActionManager.setInstance(m); } - return manager; + return m; } protected void addActions() { 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 60df0ffe92b..319aecdaa31 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -799,6 +799,18 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { writeObjectID(klass.getJavaMirror()); ClassData cd = (ClassData) classDataCache.get(klass); + if (cd == null) { + // The class is not present in the system dictionary, probably Lambda. + // Add it to cache here + if (klass instanceof InstanceKlass) { + InstanceKlass ik = (InstanceKlass) klass; + List fields = getInstanceFields(ik); + int instSize = getSizeForFields(fields); + cd = new ClassData(instSize, fields); + classDataCache.put(ik, cd); + } + } + if (Assert.ASSERTS_ENABLED) { Assert.that(cd != null, "can not get class data for " + klass.getName().asString() + klass.getAddress()); } diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index d9c0dcf8125..4c22f27b4bc 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -98,7 +98,7 @@ COMMON_VM_DEBUG_TARGETS=debug debug1 docs export_debug COMMON_VM_OPTIMIZED_TARGETS=optimized optimized1 docs export_optimized # JDK directory list -JDK_DIRS=bin include jre lib demo +JDK_DIRS=bin include lib demo all: all_product all_fastdebug @@ -373,33 +373,33 @@ $(EXPORT_SERVER_DIR)/%.map: $(C2_BUILD_DIR)/%.map $(install-file) $(EXPORT_LIB_DIR)/%.lib: $(C2_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz +$(EXPORT_BIN_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll +$(EXPORT_BIN_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb +$(EXPORT_BIN_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_BUILD_DIR)/%.map +$(EXPORT_BIN_DIR)/%.map: $(C2_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz +$(EXPORT_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 +$(EXPORT_LIB_ARCH_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM $(install-dir) $(EXPORT_SERVER_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM $(install-dir) @@ -423,33 +423,33 @@ $(EXPORT_CLIENT_DIR)/%.map: $(C1_BUILD_DIR)/%.map $(install-file) $(EXPORT_LIB_DIR)/%.lib: $(C1_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz +$(EXPORT_BIN_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll +$(EXPORT_BIN_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb +$(EXPORT_BIN_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_BUILD_DIR)/%.map +$(EXPORT_BIN_DIR)/%.map: $(C1_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz +$(EXPORT_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 +$(EXPORT_LIB_ARCH_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM $(install-dir) $(EXPORT_CLIENT_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM $(install-dir) @@ -473,28 +473,28 @@ $(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map $(install-file) $(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz +$(EXPORT_BIN_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll +$(EXPORT_BIN_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb +$(EXPORT_BIN_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map +$(EXPORT_BIN_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) $(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) $(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz +$(EXPORT_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) @@ -509,11 +509,11 @@ $(EXPORT_LIB_DIR)/%.jar: $(ZERO_BUILD_DIR)/../generated/%.jar $(EXPORT_INCLUDE_DIR)/%: $(ZERO_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz +$(EXPORT_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) @@ -522,7 +522,7 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo $(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz $(install-file) # MacOS X -$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM +$(EXPORT_LIB_ARCH_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM $(install-dir) $(EXPORT_SERVER_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM $(install-dir) @@ -536,11 +536,11 @@ $(EXPORT_LIB_DIR)/%.jar: $(CORE_BUILD_DIR)/../generated/%.jar $(EXPORT_INCLUDE_DIR)/%: $(CORE_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(CORE_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(CORE_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(CORE_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo: $(CORE_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(CORE_BUILD_DIR)/%.diz +$(EXPORT_LIB_ARCH_DIR)/%.diz: $(CORE_BUILD_DIR)/%.diz $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(CORE_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) @@ -558,11 +558,11 @@ $(EXPORT_LIB_DIR)/%.jar: $(SHARK_BUILD_DIR)/../generated/%.jar $(EXPORT_INCLUDE_DIR)/%: $(SHARK_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo +$(EXPORT_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz +$(EXPORT_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) @@ -571,7 +571,7 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo $(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) # MacOS X -$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM +$(EXPORT_LIB_ARCH_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM $(install-dir) $(EXPORT_SERVER_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM $(install-dir) diff --git a/hotspot/make/aix/makefiles/adlc.make b/hotspot/make/aix/makefiles/adlc.make index abdee74f878..63dc981410f 100644 --- a/hotspot/make/aix/makefiles/adlc.make +++ b/hotspot/make/aix/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -140,13 +140,7 @@ ADLCFLAGS += $(SYSDEFS) # Note "+="; it is a hook so flags.make can add more flags, like -g or -DFOO. ADLCFLAGS += -q -T -# Normally, debugging is done directly on the ad_*.cpp files. -# But -g will put #line directives in those files pointing back to .ad. -# Some builds of gcc 3.2 have a bug that gets tickled by the extra #line directives -# so skip it for 3.2 and ealier. -ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" ADLCFLAGS += -g -endif ifdef LP64 ADLCFLAGS += -D_LP64 diff --git a/hotspot/make/aix/makefiles/defs.make b/hotspot/make/aix/makefiles/defs.make index 9bf5793e773..f902830eeb2 100644 --- a/hotspot/make/aix/makefiles/defs.make +++ b/hotspot/make/aix/makefiles/defs.make @@ -184,17 +184,17 @@ LIBRARY_SUFFIX=so 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) +EXPORT_LIST += $(EXPORT_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 +# EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.diz # else -# EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo +# EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.debuginfo # 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 +EXPORT_SERVER_DIR = $(EXPORT_LIB_ARCH_DIR)/server +EXPORT_CLIENT_DIR = $(EXPORT_LIB_ARCH_DIR)/client +EXPORT_MINIMAL_DIR = $(EXPORT_LIB_ARCH_DIR)/minimal ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt diff --git a/hotspot/make/aix/makefiles/mapfile-vers-debug b/hotspot/make/aix/makefiles/mapfile-vers-debug index 81c7c5b7fd2..841585d27d8 100644 --- a/hotspot/make/aix/makefiles/mapfile-vers-debug +++ b/hotspot/make/aix/makefiles/mapfile-vers-debug @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/aix/makefiles/mapfile-vers-product b/hotspot/make/aix/makefiles/mapfile-vers-product index 745901bb4d6..7b0ab9194fe 100644 --- a/hotspot/make/aix/makefiles/mapfile-vers-product +++ b/hotspot/make/aix/makefiles/mapfile-vers-product @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetInheritedAccessControlContext; diff --git a/hotspot/make/aix/makefiles/ppc64.make b/hotspot/make/aix/makefiles/ppc64.make index 2636a4b9742..2634d8adcc3 100644 --- a/hotspot/make/aix/makefiles/ppc64.make +++ b/hotspot/make/aix/makefiles/ppc64.make @@ -1,6 +1,6 @@ # -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012, 2015 SAP AG. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -71,9 +71,6 @@ OPT_CFLAGS += -qstrict OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT) -# xlc 10.01 parameters for ipa compile. -QIPA_COMPILE=$(if $(CXX_IS_V10),-qipa) - # Xlc 10.1 parameters for aggressive optimization: # - qhot=level=1: Most aggressive loop optimizations. # - qignerrno: Assume errno is not modified by system calls. @@ -88,7 +85,7 @@ QV10_OPT_CONSERVATIVE=$(if $(CXX_IS_V10),-qhot=level=1 -qignerrno -qinline) OPT_CFLAGS/synchronizer.o = $(OPT_CFLAGS) -qnoinline # Set all the xlC V10.1 options here. -OPT_CFLAGS += $(QIPA_COMPILE) $(QV10_OPT) $(QV10_OPT_AGGRESSIVE) +OPT_CFLAGS += $(QV10_OPT) $(QV10_OPT_AGGRESSIVE) export OBJECT_MODE=64 diff --git a/hotspot/make/aix/makefiles/vm.make b/hotspot/make/aix/makefiles/vm.make index 4d879365f64..cf10de3e214 100644 --- a/hotspot/make/aix/makefiles/vm.make +++ b/hotspot/make/aix/makefiles/vm.make @@ -122,7 +122,7 @@ LIBS += -lm -ldl -lpthread # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM -JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH) +JDK_LIBDIR = $(JAVA_HOME)/lib/$(LIBARCH) #---------------------------------------------------------------------- # jvm_db & dtrace diff --git a/hotspot/make/aix/makefiles/xlc.make b/hotspot/make/aix/makefiles/xlc.make index 17a71b60124..cf8d085c39a 100644 --- a/hotspot/make/aix/makefiles/xlc.make +++ b/hotspot/make/aix/makefiles/xlc.make @@ -1,6 +1,6 @@ # -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012, 2013 SAP. All rights reserved. +# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015 SAP. All rights reserved. # 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,13 +34,17 @@ HOSTCC = $(CC) AS = $(CC) -c -# get xlc version -CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | sed -n 's/.*Version: \([0-9.]*\)/\1/p') +# get xlc version which comes as VV.RR.MMMM.LLLL where 'VV' is the version, +# 'RR' is the release, 'MMMM' is the modification and 'LLLL' is the level. +# We only use 'VV.RR.LLLL' to avoid integer overflows in bash when comparing +# the version numbers (some shells only support 32-bit integer compares!). +CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | \ + sed -n 's/.*Version: \([0-9]\{2\}\).\([0-9]\{2\}\).[0-9]\{4\}.\([0-9]\{4\}\)/\1\2\3/p') # xlc 08.00.0000.0023 and higher supports -qtune=balanced -CXX_SUPPORTS_BALANCED_TUNING=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 080000000023 ] ; then echo "true" ; fi) +CXX_SUPPORTS_BALANCED_TUNING := $(shell if [ $(CXX_VERSION) -ge 08000023 ] ; then echo "true" ; fi) # xlc 10.01 is used with aggressive optimizations to boost performance -CXX_IS_V10=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 100100000000 ] ; then echo "true" ; fi) +CXX_IS_V10 := $(shell if [ $(CXX_VERSION) -ge 10010000 ] ; then echo "true" ; fi) # check for precompiled headers support diff --git a/hotspot/make/bsd/makefiles/defs.make b/hotspot/make/bsd/makefiles/defs.make index 6e427e8bd5a..74f2fedd8b7 100644 --- a/hotspot/make/bsd/makefiles/defs.make +++ b/hotspot/make/bsd/makefiles/defs.make @@ -265,23 +265,23 @@ endif 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) +EXPORT_LIST += $(EXPORT_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 + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.diz else ifeq ($(OS_VENDOR), Darwin) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM else - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + EXPORT_LIST += $(EXPORT_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 +EXPORT_SERVER_DIR = $(EXPORT_LIB_ARCH_DIR)/server +EXPORT_CLIENT_DIR = $(EXPORT_LIB_ARCH_DIR)/client +EXPORT_MINIMAL_DIR = $(EXPORT_LIB_ARCH_DIR)/minimal ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -324,34 +324,34 @@ endif # Serviceability Binaries # No SA Support for PPC, IA64, ARM or zero -ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ +ADD_SA_BINARIES/x86 = $(EXPORT_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 + ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz else ifeq ($(OS_VENDOR), Darwin) - ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM else - ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo endif endif endif -ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ +ADD_SA_BINARIES/sparc = $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar -ADD_SA_BINARIES/universal = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ +ADD_SA_BINARIES/universal = $(EXPORT_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 + ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz else ifeq ($(OS_VENDOR), Darwin) - ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM + ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM else - ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo endif endif endif @@ -388,25 +388,25 @@ ifeq ($(OS_VENDOR), Darwin) endif # Binaries to 'universalize' if built - UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX) - UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX) - UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX) - UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX) + UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX) + UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX) + UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX) + UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX) # 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 + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/Xusage.txt + UNIVERSAL_COPY_LIST += $(EXPORT_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 + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.diz + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/libjvm.diz + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libjsig.diz + UNIVERSAL_COPY_LIST += $(EXPORT_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 + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM + UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM endif endif diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make index 1877245e435..6844d6169ae 100644 --- a/hotspot/make/bsd/makefiles/gcc.make +++ b/hotspot/make/bsd/makefiles/gcc.make @@ -313,22 +313,13 @@ endif # Work around some compiler bugs. ifeq ($(USE_CLANG), true) - # Clang 4.2 - ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) + # Clang <= 6.1 + ifeq ($(shell expr \ + $(CC_VER_MAJOR) \< 6 \| \ + \( $(CC_VER_MAJOR) = 6 \& $(CC_VER_MINOR) \<= 1 \) \ + ), 1) OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) OPT_CFLAGS/unsafe.o += -O1 - # Clang 5.0 - else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1) - OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) - OPT_CFLAGS/unsafe.o += -O1 - # Clang 5.1 - else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1) - OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) - OPT_CFLAGS/unsafe.o += -O1 - # Clang 6.0 - else ifeq ($(shell expr $(CC_VER_MAJOR) = 6 \& $(CC_VER_MINOR) = 0), 1) - OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) - OPT_CFLAGS/unsafe.o += -O1 else $(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)") endif @@ -336,7 +327,7 @@ else # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) - endif + endif endif # Flags for generating make dependency flags. diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug index 99880a19f4a..d7df2cb7b1d 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug @@ -105,6 +105,7 @@ _JVM_GetClassTypeAnnotations _JVM_GetDeclaredClasses _JVM_GetDeclaringClass + _JVM_GetSimpleBinaryName _JVM_GetEnclosingMethodInfo _JVM_GetFieldIxModifiers _JVM_GetFieldTypeAnnotations diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product index 99880a19f4a..d7df2cb7b1d 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product +++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product @@ -105,6 +105,7 @@ _JVM_GetClassTypeAnnotations _JVM_GetDeclaredClasses _JVM_GetDeclaringClass + _JVM_GetSimpleBinaryName _JVM_GetEnclosingMethodInfo _JVM_GetFieldIxModifiers _JVM_GetFieldTypeAnnotations diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-debug b/hotspot/make/bsd/makefiles/mapfile-vers-debug index 950cf57a64a..af2fe0b90bc 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-product b/hotspot/make/bsd/makefiles/mapfile-vers-product index 950cf57a64a..af2fe0b90bc 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-product +++ b/hotspot/make/bsd/makefiles/mapfile-vers-product @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/bsd/makefiles/universal.gmk b/hotspot/make/bsd/makefiles/universal.gmk index 40868adf849..9fdf3832e11 100644 --- a/hotspot/make/bsd/makefiles/universal.gmk +++ b/hotspot/make/bsd/makefiles/universal.gmk @@ -54,12 +54,12 @@ all_debug_universal: # Consolidate architecture builds into a single Universal binary universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST) - $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} + $(RM) -r $(EXPORT_PATH)/lib/{i386,amd64} # Package built libraries in a universal binary $(UNIVERSAL_LIPO_LIST): - BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`" || test $$? = "1"; \ + BUILT_LIPO_FILES="`find $(EXPORT_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_LIB_DIR)/,,$@) 2>/dev/null`" || test $$? = "1"; \ if [ -n "$${BUILT_LIPO_FILES}" ]; then \ $(MKDIR) -p $(shell dirname $@); \ lipo -create -output $@ $${BUILT_LIPO_FILES}; \ @@ -70,7 +70,7 @@ $(UNIVERSAL_LIPO_LIST): # - 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)/,,$@) -prune 2>/dev/null`" || test $$? = "1"; \ + BUILT_COPY_FILES="`find $(EXPORT_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_LIB_DIR)/,,$@) -prune 2>/dev/null`" || test $$? = "1"; \ if [ -n "$${BUILT_COPY_FILES}" ]; then \ for i in $${BUILT_COPY_FILES}; do \ $(MKDIR) -p $(shell dirname $@); \ @@ -80,21 +80,21 @@ $(UNIVERSAL_COPY_LIST): # Replace arch specific binaries with universal binaries -# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) +# Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) # That symbolic link belongs to the 'jdk' build. export_universal: - $(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64} - $(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64} + $(RM) -r $(EXPORT_PATH)/lib/{i386,amd64} + $(RM) -r $(JDK_IMAGE_DIR)/lib/{i386,amd64} ($(CD) $(EXPORT_PATH) && \ $(TAR) -cf - *) | \ ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -) # Overlay universal binaries -# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) +# Do not touch lib/{client,server}/libjsig.$(LIBRARY_SUFFIX) # That symbolic link belongs to the 'jdk' build. copy_universal: - $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64} + $(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/lib/{i386,amd64} ($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \ $(TAR) -cf - *) | \ ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -) diff --git a/hotspot/make/build.sh b/hotspot/make/build.sh index d05ce4474ac..c6570795011 100644 --- a/hotspot/make/build.sh +++ b/hotspot/make/build.sh @@ -40,7 +40,7 @@ if [ $# -lt 1 ]; then exit 1 fi -if [ "${JAVA_HOME-}" = "" -o ! -d "${JAVA_HOME-}" -o ! -d ${JAVA_HOME-}/jre/lib/ ]; then +if [ "${JAVA_HOME-}" = "" -o ! -d "${JAVA_HOME-}" ]; then echo "JAVA_HOME needs to be set to a valid JDK path" echo "JAVA_HOME: ${JAVA_HOME-}" exit 1 diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index 6f4dd97cd03..a03ada784e9 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -350,15 +350,13 @@ MAKE_ARGS += BOOT_JDK_SOURCETARGET="$(BOOT_JDK_SOURCETARGET)" EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs EXPORT_LIB_DIR = $(EXPORT_PATH)/lib -EXPORT_JRE_DIR = $(EXPORT_PATH)/jre -EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin -EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib -EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) +EXPORT_BIN_DIR = $(EXPORT_PATH)/bin +EXPORT_LIB_ARCH_DIR = $(EXPORT_LIB_DIR)/$(LIBARCH) # non-universal macosx builds need to appear universal ifeq ($(OS_VENDOR), Darwin) ifneq ($(MACOSX_UNIVERSAL), true) - EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR) + EXPORT_LIB_ARCH_DIR = $(EXPORT_LIB_DIR) endif endif @@ -370,4 +368,3 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h .PHONY: $(HS_ALT_MAKE)/defs.make - diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make index c85f1ed5522..472621ffbea 100644 --- a/hotspot/make/linux/makefiles/defs.make +++ b/hotspot/make/linux/makefiles/defs.make @@ -244,17 +244,17 @@ LIBRARY_SUFFIX=so 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) +EXPORT_LIST += $(EXPORT_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 + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.diz else - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.debuginfo 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 +EXPORT_SERVER_DIR = $(EXPORT_LIB_ARCH_DIR)/server +EXPORT_CLIENT_DIR = $(EXPORT_LIB_ARCH_DIR)/client +EXPORT_MINIMAL_DIR = $(EXPORT_LIB_ARCH_DIR)/minimal ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -295,14 +295,14 @@ endif # Serviceability Binaries -ADD_SA_BINARIES/DEFAULT = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ +ADD_SA_BINARIES/DEFAULT = $(EXPORT_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/DEFAULT += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + ADD_SA_BINARIES/DEFAULT += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz else - ADD_SA_BINARIES/DEFAULT += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + ADD_SA_BINARIES/DEFAULT += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo endif endif diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index 950cf57a64a..af2fe0b90bc 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product index 950cf57a64a..af2fe0b90bc 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-product +++ b/hotspot/make/linux/makefiles/mapfile-vers-product @@ -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. -# +# # # Define public interface. @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 25679bffff0..d0737d41c1a 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -127,7 +127,7 @@ LIBS += -lm -ldl -lpthread # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM -JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH) +JDK_LIBDIR = $(JAVA_HOME)/lib/$(LIBARCH) #---------------------------------------------------------------------- # jvm_db & dtrace diff --git a/hotspot/make/solaris/makefiles/defs.make b/hotspot/make/solaris/makefiles/defs.make index 0a0fe381503..8fa75e904d7 100644 --- a/hotspot/make/solaris/makefiles/defs.make +++ b/hotspot/make/solaris/makefiles/defs.make @@ -224,17 +224,17 @@ LIBRARY_SUFFIX=so EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX) -EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) +EXPORT_LIST += $(EXPORT_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 + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.diz else - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.debuginfo endif endif -EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server -EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client +EXPORT_SERVER_DIR = $(EXPORT_LIB_ARCH_DIR)/server +EXPORT_CLIENT_DIR = $(EXPORT_LIB_ARCH_DIR)/client ifeq ($(JVM_VARIANT_SERVER),true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -295,12 +295,12 @@ ifeq ($(JVM_VARIANT_CLIENT),true) endif endif -EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) +EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ifeq ($(ZIP_DEBUGINFO_FILES),1) - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz else - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo + EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo endif endif EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make index 1da02fa01c4..376732d0e6b 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -130,8 +130,9 @@ endif $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo $(LOG_INFO) Making $@ $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ - $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ - $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. $(EXTRA_CFLAGS) \ + $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c \ + $(EXTRA_LDFLAGS) -lc -lthread -ldoor ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not @@ -216,8 +217,9 @@ endif $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo $(LOG_INFO) Making $@ - $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ - $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. $(EXTRA_CFLAGS) \ + $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c \ + $(EXTRA_LDFLAGS) -lc -lthread -ldoor ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ diff --git a/hotspot/make/solaris/makefiles/jsig.make b/hotspot/make/solaris/makefiles/jsig.make index d8acd4ee93a..392f78c1651 100644 --- a/hotspot/make/solaris/makefiles/jsig.make +++ b/hotspot/make/solaris/makefiles/jsig.make @@ -50,7 +50,9 @@ endif $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo $(LOG_INFO) Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ - $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl + $(EXTRA_CFLAGS) \ + $(LFLAGS_JSIG) $(EXTRA_LDFLAGS) \ + -o $@ $(JSIGSRCDIR)/jsig.c -ldl ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ diff --git a/hotspot/make/solaris/makefiles/mapfile-vers b/hotspot/make/solaris/makefiles/mapfile-vers index 1d7838465f2..47e1f535d22 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers +++ b/hotspot/make/solaris/makefiles/mapfile-vers @@ -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. -# +# # # Define public interface. @@ -30,7 +30,7 @@ SUNWprivate_1.1 { JNI_CreateJavaVM; JNI_GetCreatedJavaVMs; JNI_GetDefaultJavaVMInitArgs; - + # JVM JVM_ActiveProcessorCount; JVM_ArrayCopy; @@ -107,6 +107,7 @@ SUNWprivate_1.1 { JVM_GetClassTypeAnnotations; JVM_GetDeclaredClasses; JVM_GetDeclaringClass; + JVM_GetSimpleBinaryName; JVM_GetEnclosingMethodInfo; JVM_GetFieldIxModifiers; JVM_GetFieldTypeAnnotations; diff --git a/hotspot/make/solaris/makefiles/product.make b/hotspot/make/solaris/makefiles/product.make index 1f9224b17f0..7f378b17d95 100644 --- a/hotspot/make/solaris/makefiles/product.make +++ b/hotspot/make/solaris/makefiles/product.make @@ -37,6 +37,11 @@ ifndef USE_GCC OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS) -xinline=no%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_ endif +# Need extra inlining to get oop_ps_push_contents functions to perform well enough. +ifndef USE_GCC +OPT_CFLAGS/psPromotionManager.o = $(OPT_CFLAGS) -W2,-Ainline:inc=1000 +endif + # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) ifeq ("${Platform_compiler}", "sparcWorks") diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make index c5558527121..3daecc4f20c 100644 --- a/hotspot/make/solaris/makefiles/saproc.make +++ b/hotspot/make/solaris/makefiles/saproc.make @@ -89,6 +89,17 @@ $(shell uname -r -v \ # when actually building on Nevada-B158 or earlier: #SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER +$(SADISOBJ): $(SADISSRCFILES) + $(QUIETLY) $(CC) \ + $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ + -I$(SASRCDIR) \ + -I$(GENERATED) \ + -I$(BOOT_JAVA_HOME)/include \ + -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \ + $(SOLARIS_11_B159_OR_LATER) \ + $(EXTRA_CFLAGS) \ + $(SADISSRCFILES) \ + -c -o $(SADISOBJ) $(LIBSAPROC): $(SASRCFILES) $(SADISOBJ) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ @@ -103,23 +114,13 @@ $(LIBSAPROC): $(SASRCFILES) $(SADISOBJ) $(SAMAPFILE) -I$(BOOT_JAVA_HOME)/include \ -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \ $(SOLARIS_11_B159_OR_LATER) \ - $(SASRCFILES) \ + $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS) \ $(SADISOBJ) \ + $(SASRCFILES) \ $(SA_LFLAGS) \ -o $@ \ -ldl -ldemangle -lthread -lc -$(SADISOBJ): $(SADISSRCFILES) - $(QUIETLY) $(CC) \ - $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ - -I$(SASRCDIR) \ - -I$(GENERATED) \ - -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \ - $(SOLARIS_11_B159_OR_LATER) \ - $(SADISSRCFILES) \ - -c -o $(SADISOBJ) - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index ea4ec4c1bf5..04a2b608b35 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -148,7 +148,7 @@ LIBS += -lkstat # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM -JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH) +JDK_LIBDIR = $(JAVA_HOME)/lib/$(LIBARCH) #---------------------------------------------------------------------- # jvm_db & dtrace @@ -288,6 +288,8 @@ else endif endif +LFLAGS_VM += $(EXTRA_LDFLAGS) + ifdef USE_GCC LINK_VM = $(LINK_LIB.CC) else diff --git a/hotspot/make/windows/makefiles/defs.make b/hotspot/make/windows/makefiles/defs.make index d45dae17d82..ca212624d53 100644 --- a/hotspot/make/windows/makefiles/defs.make +++ b/hotspot/make/windows/makefiles/defs.make @@ -249,8 +249,8 @@ ifeq ($(BUILD_WIN_SA), 1) endif endif -EXPORT_SERVER_DIR = $(EXPORT_JRE_BIN_DIR)/server -EXPORT_CLIENT_DIR = $(EXPORT_JRE_BIN_DIR)/client +EXPORT_SERVER_DIR = $(EXPORT_BIN_DIR)/server +EXPORT_CLIENT_DIR = $(EXPORT_BIN_DIR)/client ifeq ($(JVM_VARIANT_SERVER),true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -280,13 +280,13 @@ endif EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib ifeq ($(BUILD_WIN_SA), 1) - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX) + EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX) ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) ifeq ($(ZIP_DEBUGINFO_FILES),1) - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz + EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.diz else - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb - EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map + EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.pdb + EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.map endif endif EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 0f948668646..2e41a022534 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -91,6 +91,9 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES) SAWINDBG=sawindbg.dll +# Resource file containing VERSIONINFO +SA_Res_Files=.\version.sares + checkAndBuildSA:: $(SAWINDBG) # These do not need to be optimized (don't run a lot of code) and it @@ -126,10 +129,13 @@ 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 +# Force resources to be rebuilt every time +$(SA_Res_Files): FORCE + # 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): $(SASRCFILES) +$(SAWINDBG): $(SASRCFILES) $(SA_Res_Files) set INCLUDE=$(SA_INCLUDE)$(INCLUDE) $(CXX) @<< -I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32" @@ -138,7 +144,7 @@ $(SAWINDBG): $(SASRCFILES) -out:$*.obj << set LIB=$(SA_LIB)$(LIB) - $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) + $(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) $(SA_Res_Files) !if "$(MT)" != "" $(MT) -manifest $(@F).manifest -outputresource:$(@F);#2 !endif @@ -150,6 +156,9 @@ $(SAWINDBG): $(SASRCFILES) !endif -@rm -f $*.obj +{$(COMMONSRC)\os\windows\vm}.rc.sares: + @$(RC) $(RC_FLAGS) /D "HS_FNAME=$(SAWINDBG)" /fo"$@" $< + cleanall : rm -rf $(GENERATED)/saclasses rm -rf $(GENERATED)/sa-jdi.jar diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 956a4ac3fd0..074e498936f 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -2614,6 +2614,8 @@ typedef void (MacroAssembler::* mem_float_insn)(FloatRegister Rt, const Address case INDINDEXSCALEDI2L: case INDINDEXSCALEDOFFSETI2LN: case INDINDEXSCALEDI2LN: + case INDINDEXOFFSETI2L: + case INDINDEXOFFSETI2LN: scale = Address::sxtw(size); break; default: @@ -5060,6 +5062,20 @@ operand indIndexScaledOffsetL(iRegP reg, iRegL lreg, immIScale scale, immLU12 of %} %} +operand indIndexOffsetI2L(iRegP reg, iRegI ireg, immLU12 off) +%{ + constraint(ALLOC_IN_RC(ptr_reg)); + match(AddP (AddP reg (ConvI2L ireg)) off); + op_cost(INSN_COST); + format %{ "$reg, $ireg, $off I2L" %} + interface(MEMORY_INTER) %{ + base($reg); + index($ireg); + scale(0x0); + disp($off); + %} +%} + operand indIndexScaledOffsetI2L(iRegP reg, iRegI ireg, immIScale scale, immLU12 off) %{ constraint(ALLOC_IN_RC(ptr_reg)); @@ -5120,7 +5136,7 @@ operand indOffI(iRegP reg, immIOffset off) %{ constraint(ALLOC_IN_RC(ptr_reg)); match(AddP reg off); - op_cost(INSN_COST); + op_cost(0); format %{ "[$reg, $off]" %} interface(MEMORY_INTER) %{ base($reg); @@ -5190,6 +5206,21 @@ operand indIndexScaledOffsetLN(iRegN reg, iRegL lreg, immIScale scale, immLU12 o %} %} +operand indIndexOffsetI2LN(iRegN reg, iRegI ireg, immLU12 off) +%{ + predicate(Universe::narrow_oop_shift() == 0); + constraint(ALLOC_IN_RC(ptr_reg)); + match(AddP (AddP (DecodeN reg) (ConvI2L ireg)) off); + op_cost(INSN_COST); + format %{ "$reg, $ireg, $off I2L\t# narrow" %} + interface(MEMORY_INTER) %{ + base($reg); + index($ireg); + scale(0x0); + disp($off); + %} +%} + operand indIndexScaledOffsetI2LN(iRegN reg, iRegI ireg, immIScale scale, immLU12 off) %{ predicate(Universe::narrow_oop_shift() == 0); @@ -5452,8 +5483,8 @@ operand iRegL2I(iRegL reg) %{ // memory is used to define read/write location for load/store // instruction defs. we can turn a memory op into an Address -opclass memory(indirect, indIndexScaledOffsetI, indIndexScaledOffsetL, indIndexScaledOffsetI2L, indIndexScaled, indIndexScaledI2L, indIndex, indOffI, indOffL, - indirectN, indIndexScaledOffsetIN, indIndexScaledOffsetLN, indIndexScaledOffsetI2LN, indIndexScaledN, indIndexScaledI2LN, indIndexN, indOffIN, indOffLN); +opclass memory(indirect, indIndexScaledOffsetI, indIndexScaledOffsetL, indIndexOffsetI2L, indIndexScaledOffsetI2L, indIndexScaled, indIndexScaledI2L, indIndex, indOffI, indOffL, + indirectN, indIndexScaledOffsetIN, indIndexScaledOffsetLN, indIndexOffsetI2LN, indIndexScaledOffsetI2LN, indIndexScaledN, indIndexScaledI2LN, indIndexN, indOffIN, indOffLN); // iRegIorL2I is used for src inputs in rules for 32 bit int (I) @@ -8346,7 +8377,7 @@ instruct addP_reg_reg(iRegPNoSp dst, iRegP src1, iRegL src2) %{ instruct addP_reg_reg_ext(iRegPNoSp dst, iRegP src1, iRegIorL2I src2) %{ match(Set dst (AddP src1 (ConvI2L src2))); - ins_cost(INSN_COST); + ins_cost(1.9 * INSN_COST); format %{ "add $dst, $src1, $src2, sxtw\t# ptr" %} ins_encode %{ diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp index f06d1108714..56c1df1facf 100644 --- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1469,7 +1469,7 @@ public: f(op, 31, 29); f(0b11010000, 28, 21); f(0b000000, 15, 10); - rf(Rm, 16), rf(Rn, 5), rf(Rd, 0); + zrf(Rm, 16), zrf(Rn, 5), zrf(Rd, 0); } #define INSN(NAME, op) \ diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp index d0baef39889..c073735a7e0 100644 --- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp @@ -68,6 +68,8 @@ define_pd_global(bool, RewriteFrequentPairs, false); define_pd_global(bool, UseMembar, true); +define_pd_global(bool, PreserveFramePointer, false); + // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index 871cc33d279..7d30ee0d16e 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,8 @@ class InterpreterMacroAssembler: public MacroAssembler { using MacroAssembler::call_VM_leaf_base; // Interpreter specific version of call_VM_base + using MacroAssembler::call_VM_leaf_base; + virtual void call_VM_leaf_base(address entry_point, int number_of_arguments); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 5653e44affd..bf307e55932 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2237,6 +2237,341 @@ void MacroAssembler::pop_CPU_state() { pop(0x3fffffff, sp); // integer registers except lr & sp } +/** + * Helpers for multiply_to_len(). + */ +void MacroAssembler::add2_with_carry(Register final_dest_hi, Register dest_hi, Register dest_lo, + Register src1, Register src2) { + adds(dest_lo, dest_lo, src1); + adc(dest_hi, dest_hi, zr); + adds(dest_lo, dest_lo, src2); + adc(final_dest_hi, dest_hi, zr); +} + +// Generate an address from (r + r1 extend offset). "size" is the +// size of the operand. The result may be in rscratch2. +Address MacroAssembler::offsetted_address(Register r, Register r1, + Address::extend ext, int offset, int size) { + if (offset || (ext.shift() % size != 0)) { + lea(rscratch2, Address(r, r1, ext)); + return Address(rscratch2, offset); + } else { + return Address(r, r1, ext); + } +} + +/** + * Multiply 64 bit by 64 bit first loop. + */ +void MacroAssembler::multiply_64_x_64_loop(Register x, Register xstart, Register x_xstart, + Register y, Register y_idx, Register z, + Register carry, Register product, + Register idx, Register kdx) { + // + // jlong carry, x[], y[], z[]; + // for (int idx=ystart, kdx=ystart+1+xstart; idx >= 0; idx-, kdx--) { + // huge_128 product = y[idx] * x[xstart] + carry; + // z[kdx] = (jlong)product; + // carry = (jlong)(product >>> 64); + // } + // z[xstart] = carry; + // + + Label L_first_loop, L_first_loop_exit; + Label L_one_x, L_one_y, L_multiply; + + subsw(xstart, xstart, 1); + br(Assembler::MI, L_one_x); + + lea(rscratch1, Address(x, xstart, Address::lsl(LogBytesPerInt))); + ldr(x_xstart, Address(rscratch1)); + ror(x_xstart, x_xstart, 32); // convert big-endian to little-endian + + bind(L_first_loop); + subsw(idx, idx, 1); + br(Assembler::MI, L_first_loop_exit); + subsw(idx, idx, 1); + br(Assembler::MI, L_one_y); + lea(rscratch1, Address(y, idx, Address::uxtw(LogBytesPerInt))); + ldr(y_idx, Address(rscratch1)); + ror(y_idx, y_idx, 32); // convert big-endian to little-endian + bind(L_multiply); + + // AArch64 has a multiply-accumulate instruction that we can't use + // here because it has no way to process carries, so we have to use + // separate add and adc instructions. Bah. + umulh(rscratch1, x_xstart, y_idx); // x_xstart * y_idx -> rscratch1:product + mul(product, x_xstart, y_idx); + adds(product, product, carry); + adc(carry, rscratch1, zr); // x_xstart * y_idx + carry -> carry:product + + subw(kdx, kdx, 2); + ror(product, product, 32); // back to big-endian + str(product, offsetted_address(z, kdx, Address::uxtw(LogBytesPerInt), 0, BytesPerLong)); + + b(L_first_loop); + + bind(L_one_y); + ldrw(y_idx, Address(y, 0)); + b(L_multiply); + + bind(L_one_x); + ldrw(x_xstart, Address(x, 0)); + b(L_first_loop); + + bind(L_first_loop_exit); +} + +/** + * Multiply 128 bit by 128. Unrolled inner loop. + * + */ +void MacroAssembler::multiply_128_x_128_loop(Register y, Register z, + Register carry, Register carry2, + Register idx, Register jdx, + Register yz_idx1, Register yz_idx2, + Register tmp, Register tmp3, Register tmp4, + Register tmp6, Register product_hi) { + + // jlong carry, x[], y[], z[]; + // int kdx = ystart+1; + // for (int idx=ystart-2; idx >= 0; idx -= 2) { // Third loop + // huge_128 tmp3 = (y[idx+1] * product_hi) + z[kdx+idx+1] + carry; + // jlong carry2 = (jlong)(tmp3 >>> 64); + // huge_128 tmp4 = (y[idx] * product_hi) + z[kdx+idx] + carry2; + // carry = (jlong)(tmp4 >>> 64); + // z[kdx+idx+1] = (jlong)tmp3; + // z[kdx+idx] = (jlong)tmp4; + // } + // idx += 2; + // if (idx > 0) { + // yz_idx1 = (y[idx] * product_hi) + z[kdx+idx] + carry; + // z[kdx+idx] = (jlong)yz_idx1; + // carry = (jlong)(yz_idx1 >>> 64); + // } + // + + Label L_third_loop, L_third_loop_exit, L_post_third_loop_done; + + lsrw(jdx, idx, 2); + + bind(L_third_loop); + + subsw(jdx, jdx, 1); + br(Assembler::MI, L_third_loop_exit); + subw(idx, idx, 4); + + lea(rscratch1, Address(y, idx, Address::uxtw(LogBytesPerInt))); + + ldp(yz_idx2, yz_idx1, Address(rscratch1, 0)); + + lea(tmp6, Address(z, idx, Address::uxtw(LogBytesPerInt))); + + ror(yz_idx1, yz_idx1, 32); // convert big-endian to little-endian + ror(yz_idx2, yz_idx2, 32); + + ldp(rscratch2, rscratch1, Address(tmp6, 0)); + + mul(tmp3, product_hi, yz_idx1); // yz_idx1 * product_hi -> tmp4:tmp3 + umulh(tmp4, product_hi, yz_idx1); + + ror(rscratch1, rscratch1, 32); // convert big-endian to little-endian + ror(rscratch2, rscratch2, 32); + + mul(tmp, product_hi, yz_idx2); // yz_idx2 * product_hi -> carry2:tmp + umulh(carry2, product_hi, yz_idx2); + + // propagate sum of both multiplications into carry:tmp4:tmp3 + adds(tmp3, tmp3, carry); + adc(tmp4, tmp4, zr); + adds(tmp3, tmp3, rscratch1); + adcs(tmp4, tmp4, tmp); + adc(carry, carry2, zr); + adds(tmp4, tmp4, rscratch2); + adc(carry, carry, zr); + + ror(tmp3, tmp3, 32); // convert little-endian to big-endian + ror(tmp4, tmp4, 32); + stp(tmp4, tmp3, Address(tmp6, 0)); + + b(L_third_loop); + bind (L_third_loop_exit); + + andw (idx, idx, 0x3); + cbz(idx, L_post_third_loop_done); + + Label L_check_1; + subsw(idx, idx, 2); + br(Assembler::MI, L_check_1); + + lea(rscratch1, Address(y, idx, Address::uxtw(LogBytesPerInt))); + ldr(yz_idx1, Address(rscratch1, 0)); + ror(yz_idx1, yz_idx1, 32); + mul(tmp3, product_hi, yz_idx1); // yz_idx1 * product_hi -> tmp4:tmp3 + umulh(tmp4, product_hi, yz_idx1); + lea(rscratch1, Address(z, idx, Address::uxtw(LogBytesPerInt))); + ldr(yz_idx2, Address(rscratch1, 0)); + ror(yz_idx2, yz_idx2, 32); + + add2_with_carry(carry, tmp4, tmp3, carry, yz_idx2); + + ror(tmp3, tmp3, 32); + str(tmp3, Address(rscratch1, 0)); + + bind (L_check_1); + + andw (idx, idx, 0x1); + subsw(idx, idx, 1); + br(Assembler::MI, L_post_third_loop_done); + ldrw(tmp4, Address(y, idx, Address::uxtw(LogBytesPerInt))); + mul(tmp3, tmp4, product_hi); // tmp4 * product_hi -> carry2:tmp3 + umulh(carry2, tmp4, product_hi); + ldrw(tmp4, Address(z, idx, Address::uxtw(LogBytesPerInt))); + + add2_with_carry(carry2, tmp3, tmp4, carry); + + strw(tmp3, Address(z, idx, Address::uxtw(LogBytesPerInt))); + extr(carry, carry2, tmp3, 32); + + bind(L_post_third_loop_done); +} + +/** + * Code for BigInteger::multiplyToLen() instrinsic. + * + * r0: x + * r1: xlen + * r2: y + * r3: ylen + * r4: z + * r5: zlen + * r10: tmp1 + * r11: tmp2 + * r12: tmp3 + * r13: tmp4 + * r14: tmp5 + * r15: tmp6 + * r16: tmp7 + * + */ +void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Register ylen, + Register z, Register zlen, + Register tmp1, Register tmp2, Register tmp3, Register tmp4, + Register tmp5, Register tmp6, Register product_hi) { + + assert_different_registers(x, xlen, y, ylen, z, zlen, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6); + + const Register idx = tmp1; + const Register kdx = tmp2; + const Register xstart = tmp3; + + const Register y_idx = tmp4; + const Register carry = tmp5; + const Register product = xlen; + const Register x_xstart = zlen; // reuse register + + // First Loop. + // + // final static long LONG_MASK = 0xffffffffL; + // int xstart = xlen - 1; + // int ystart = ylen - 1; + // long carry = 0; + // for (int idx=ystart, kdx=ystart+1+xstart; idx >= 0; idx-, kdx--) { + // long product = (y[idx] & LONG_MASK) * (x[xstart] & LONG_MASK) + carry; + // z[kdx] = (int)product; + // carry = product >>> 32; + // } + // z[xstart] = (int)carry; + // + + movw(idx, ylen); // idx = ylen; + movw(kdx, zlen); // kdx = xlen+ylen; + mov(carry, zr); // carry = 0; + + Label L_done; + + movw(xstart, xlen); + subsw(xstart, xstart, 1); + br(Assembler::MI, L_done); + + multiply_64_x_64_loop(x, xstart, x_xstart, y, y_idx, z, carry, product, idx, kdx); + + Label L_second_loop; + cbzw(kdx, L_second_loop); + + Label L_carry; + subw(kdx, kdx, 1); + cbzw(kdx, L_carry); + + strw(carry, Address(z, kdx, Address::uxtw(LogBytesPerInt))); + lsr(carry, carry, 32); + subw(kdx, kdx, 1); + + bind(L_carry); + strw(carry, Address(z, kdx, Address::uxtw(LogBytesPerInt))); + + // Second and third (nested) loops. + // + // for (int i = xstart-1; i >= 0; i--) { // Second loop + // carry = 0; + // for (int jdx=ystart, k=ystart+1+i; jdx >= 0; jdx--, k--) { // Third loop + // long product = (y[jdx] & LONG_MASK) * (x[i] & LONG_MASK) + + // (z[k] & LONG_MASK) + carry; + // z[k] = (int)product; + // carry = product >>> 32; + // } + // z[i] = (int)carry; + // } + // + // i = xlen, j = tmp1, k = tmp2, carry = tmp5, x[i] = product_hi + + const Register jdx = tmp1; + + bind(L_second_loop); + mov(carry, zr); // carry = 0; + movw(jdx, ylen); // j = ystart+1 + + subsw(xstart, xstart, 1); // i = xstart-1; + br(Assembler::MI, L_done); + + str(z, Address(pre(sp, -4 * wordSize))); + + Label L_last_x; + lea(z, offsetted_address(z, xstart, Address::uxtw(LogBytesPerInt), 4, BytesPerInt)); // z = z + k - j + subsw(xstart, xstart, 1); // i = xstart-1; + br(Assembler::MI, L_last_x); + + lea(rscratch1, Address(x, xstart, Address::uxtw(LogBytesPerInt))); + ldr(product_hi, Address(rscratch1)); + ror(product_hi, product_hi, 32); // convert big-endian to little-endian + + Label L_third_loop_prologue; + bind(L_third_loop_prologue); + + str(ylen, Address(sp, wordSize)); + stp(x, xstart, Address(sp, 2 * wordSize)); + multiply_128_x_128_loop(y, z, carry, x, jdx, ylen, product, + tmp2, x_xstart, tmp3, tmp4, tmp6, product_hi); + ldp(z, ylen, Address(post(sp, 2 * wordSize))); + ldp(x, xlen, Address(post(sp, 2 * wordSize))); // copy old xstart -> xlen + + addw(tmp3, xlen, 1); + strw(carry, Address(z, tmp3, Address::uxtw(LogBytesPerInt))); + subsw(tmp3, tmp3, 1); + br(Assembler::MI, L_done); + + lsr(carry, carry, 32); + strw(carry, Address(z, tmp3, Address::uxtw(LogBytesPerInt))); + b(L_second_loop); + + // Next infrequent code is moved outside loops. + bind(L_last_x); + ldrw(product_hi, Address(x, 0)); + b(L_third_loop_prologue); + + bind(L_done); +} + /** * Emits code to update CRC-32 with a byte value according to constants in table * diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index b922057f897..21f89fa17c4 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -167,9 +167,8 @@ class MacroAssembler: public Assembler { // aliases defined in AARCH64 spec - template - inline void cmpw(Register Rd, T imm) { subsw(zr, Rd, imm); } + inline void cmpw(Register Rd, T imm) { subsw(zr, Rd, imm); } inline void cmp(Register Rd, unsigned imm) { subs(zr, Rd, imm); } inline void cmnw(Register Rd, unsigned imm) { addsw(zr, Rd, imm); } @@ -1121,9 +1120,34 @@ public: Register tmp1, Register tmp2, Register tmp3, Register tmp4, int int_cnt1, Register result); - +private: + void add2_with_carry(Register final_dest_hi, Register dest_hi, Register dest_lo, + Register src1, Register src2); + void add2_with_carry(Register dest_hi, Register dest_lo, Register src1, Register src2) { + add2_with_carry(dest_hi, dest_hi, dest_lo, src1, src2); + } + void multiply_64_x_64_loop(Register x, Register xstart, Register x_xstart, + Register y, Register y_idx, Register z, + Register carry, Register product, + Register idx, Register kdx); + void multiply_128_x_128_loop(Register y, Register z, + Register carry, Register carry2, + Register idx, Register jdx, + Register yz_idx1, Register yz_idx2, + Register tmp, Register tmp3, Register tmp4, + Register tmp7, Register product_hi); +public: + void multiply_to_len(Register x, Register xlen, Register y, Register ylen, Register z, + Register zlen, Register tmp1, Register tmp2, Register tmp3, + Register tmp4, Register tmp5, Register tmp6, Register tmp7); // ISB may be needed because of a safepoint void maybe_isb() { isb(); } + +private: + // Return the effective address r + (r1 << ext) + offset. + // Uses rscratch2. + Address offsetted_address(Register r, Register r1, Address::extend ext, + int offset, int size); }; // Used by aarch64.ad to control code generation diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 7e70f8d7754..5cf5bd77700 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2356,8 +2356,45 @@ class StubGenerator: public StubCodeGenerator { return start; } -#undef __ -#define __ masm-> + /** + * Arguments: + * + * Input: + * c_rarg0 - x address + * c_rarg1 - x length + * c_rarg2 - y address + * c_rarg3 - y lenth + * c_rarg4 - z address + * c_rarg5 - z length + */ + address generate_multiplyToLen() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "multiplyToLen"); + + address start = __ pc(); + const Register x = r0; + const Register xlen = r1; + const Register y = r2; + const Register ylen = r3; + const Register z = r4; + const Register zlen = r5; + + const Register tmp1 = r10; + const Register tmp2 = r11; + const Register tmp3 = r12; + const Register tmp4 = r13; + const Register tmp5 = r14; + const Register tmp6 = r15; + const Register tmp7 = r16; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ multiply_to_len(x, xlen, y, ylen, z, zlen, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(lr); + + return start; + } // Continuation point for throwing of implicit exceptions that are // not handled in the current activation. Fabricates an exception @@ -2375,6 +2412,9 @@ class StubGenerator: public StubCodeGenerator { // otherwise assume that stack unwinding will be initiated, so // caller saved registers were assumed volatile in the compiler. +#undef __ +#define __ masm-> + address generate_throw_exception(const char* name, address runtime_entry, Register arg1 = noreg, @@ -2518,6 +2558,10 @@ class StubGenerator: public StubCodeGenerator { // arraycopy stubs used by compilers generate_arraycopy_stubs(); + if (UseMultiplyToLenIntrinsic) { + StubRoutines::_multiplyToLen = generate_multiplyToLen(); + } + #ifndef BUILTIN_SIM if (UseAESIntrinsics) { StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp index 19b0b3759aa..0d026e07c6b 100644 --- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp @@ -502,10 +502,17 @@ void TemplateTable::locals_index(Register reg, int offset) __ neg(reg, reg); } -void TemplateTable::iload() -{ +void TemplateTable::iload() { + iload_internal(); +} + +void TemplateTable::nofast_iload() { + iload_internal(may_not_rewrite); +} + +void TemplateTable::iload_internal(RewriteControl rc) { transition(vtos, itos); - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { // TODO : check x86 code for what to do here __ call_Unimplemented(); } else { @@ -759,8 +766,15 @@ void TemplateTable::aload(int n) __ ldr(r0, iaddress(n)); } -void TemplateTable::aload_0() -{ +void TemplateTable::aload_0() { + aload_0_internal(); +} + +void TemplateTable::nofast_aload_0() { + aload_0_internal(may_not_rewrite); +} + +void TemplateTable::aload_0_internal(RewriteControl rc) { // According to bytecode histograms, the pairs: // // _aload_0, _fast_igetfield @@ -782,7 +796,7 @@ void TemplateTable::aload_0() // aload_0, iload_1 // These bytecodes with a small amount of code are most profitable // to rewrite - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { __ call_Unimplemented(); } else { aload(0); @@ -2132,37 +2146,21 @@ void TemplateTable::resolve_cache_and_index(int byte_no, assert_different_registers(Rcache, index, temp); Label resolved; + + Bytecodes::Code code = bytecode(); + switch (code) { + case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break; + case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break; + } + assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size); - __ cmp(temp, (int) bytecode()); // have we resolved this bytecode? + __ cmp(temp, (int) code); // have we resolved this bytecode? __ br(Assembler::EQ, resolved); // resolve first time through - address entry; - switch (bytecode()) { - case Bytecodes::_getstatic: - case Bytecodes::_putstatic: - case Bytecodes::_getfield: - case Bytecodes::_putfield: - entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_get_put); - break; - case Bytecodes::_invokevirtual: - case Bytecodes::_invokespecial: - case Bytecodes::_invokestatic: - case Bytecodes::_invokeinterface: - entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); - break; - case Bytecodes::_invokehandle: - entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokehandle); - break; - case Bytecodes::_invokedynamic: - entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); - break; - default: - fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode()))); - break; - } - __ mov(temp, (int) bytecode()); + address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache); + __ mov(temp, (int) code); __ call_VM(noreg, entry, temp); // Update registers with resolved info @@ -2280,7 +2278,7 @@ void TemplateTable::pop_and_check_object(Register r) __ verify_oop(r); } -void TemplateTable::getfield_or_static(int byte_no, bool is_static) +void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteControl rc) { const Register cache = r2; const Register index = r3; @@ -2310,11 +2308,14 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) assert(btos == 0, "change code, btos != 0"); __ cbnz(flags, notByte); + // Don't rewrite getstatic, only getfield + if (is_static) rc = may_not_rewrite; + // btos __ load_signed_byte(r0, field); __ push(btos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bgetfield, bc, r1); } __ b(Done); @@ -2325,7 +2326,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) // atos __ load_heap_oop(r0, field); __ push(atos); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_agetfield, bc, r1); } __ b(Done); @@ -2337,7 +2338,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ ldrw(r0, field); __ push(itos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_igetfield, bc, r1); } __ b(Done); @@ -2349,7 +2350,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ load_unsigned_short(r0, field); __ push(ctos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cgetfield, bc, r1); } __ b(Done); @@ -2361,7 +2362,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ load_signed_short(r0, field); __ push(stos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sgetfield, bc, r1); } __ b(Done); @@ -2373,7 +2374,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ ldr(r0, field); __ push(ltos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_lgetfield, bc, r1); } __ b(Done); @@ -2385,7 +2386,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ ldrs(v0, field); __ push(ftos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fgetfield, bc, r1); } __ b(Done); @@ -2399,7 +2400,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) __ ldrd(v0, field); __ push(dtos); // Rewrite bytecode to be faster - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dgetfield, bc, r1); } #ifdef ASSERT @@ -2421,6 +2422,10 @@ void TemplateTable::getfield(int byte_no) getfield_or_static(byte_no, false); } +void TemplateTable::nofast_getfield(int byte_no) { + getfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::getstatic(int byte_no) { getfield_or_static(byte_no, true); @@ -2484,7 +2489,7 @@ void TemplateTable::jvmti_post_field_mod(Register cache, Register index, bool is } } -void TemplateTable::putfield_or_static(int byte_no, bool is_static) { +void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); const Register cache = r2; @@ -2521,12 +2526,15 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { assert(btos == 0, "change code, btos != 0"); __ cbnz(flags, notByte); + // Don't rewrite putstatic, only putfield + if (is_static) rc = may_not_rewrite; + // btos { __ pop(btos); if (!is_static) pop_and_check_object(obj); __ strb(r0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2542,7 +2550,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { if (!is_static) pop_and_check_object(obj); // Store into the field do_oop_store(_masm, field, r0, _bs->kind(), false); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_aputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2557,7 +2565,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(itos); if (!is_static) pop_and_check_object(obj); __ strw(r0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_iputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2572,7 +2580,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ctos); if (!is_static) pop_and_check_object(obj); __ strh(r0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2587,7 +2595,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(stos); if (!is_static) pop_and_check_object(obj); __ strh(r0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2602,7 +2610,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ltos); if (!is_static) pop_and_check_object(obj); __ str(r0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_lputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2617,7 +2625,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ftos); if (!is_static) pop_and_check_object(obj); __ strs(v0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fputfield, bc, r1, true, byte_no); } __ b(Done); @@ -2634,7 +2642,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(dtos); if (!is_static) pop_and_check_object(obj); __ strd(v0, field); - if (!is_static) { + if (rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dputfield, bc, r1, true, byte_no); } } @@ -2661,6 +2669,10 @@ void TemplateTable::putfield(int byte_no) putfield_or_static(byte_no, false); } +void TemplateTable::nofast_putfield(int byte_no) { + putfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::putstatic(int byte_no) { putfield_or_static(byte_no, true); } diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index 68c75eb3195..eaee6ccd4f1 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. + * Copyright (c) 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -193,6 +193,15 @@ void VM_Version::get_processor_features() { } } + // This machine allows unaligned memory accesses + if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { + FLAG_SET_DEFAULT(UseUnalignedAccesses, true); + } + + if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { + UseMultiplyToLenIntrinsic = true; + } + #ifdef COMPILER2 if (FLAG_IS_DEFAULT(OptoScheduling)) { OptoScheduling = true; diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp index 6ab0f8a61bd..7b19ddb0018 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,8 +85,7 @@ int Assembler::branch_destination(int inst, int pos) { } // Low-level andi-one-instruction-macro. -void Assembler::andi(Register a, Register s, const int ui16) { - assert(is_uimm(ui16, 16), "must be 16-bit unsigned immediate"); +void Assembler::andi(Register a, Register s, const long ui16) { if (is_power_of_2_long(((jlong) ui16)+1)) { // pow2minus1 clrldi(a, s, 64-log2_long((((jlong) ui16)+1))); @@ -97,6 +96,7 @@ void Assembler::andi(Register a, Register s, const int ui16) { // negpow2 clrrdi(a, s, log2_long((jlong)-ui16)); } else { + assert(is_uimm(ui16, 16), "must be 16-bit unsigned immediate"); andi_(a, s, ui16); } } @@ -356,7 +356,6 @@ void Assembler::load_const(Register d, long x, Register tmp) { // 16 bit immediate offset. int Assembler::load_const_optimized(Register d, long x, Register tmp, bool return_simm16_rest) { // Avoid accidentally trying to use R0 for indexed addressing. - assert(d != R0, "R0 not allowed"); assert_different_registers(d, tmp); short xa, xb, xc, xd; // Four 16-bit chunks of const. @@ -370,6 +369,58 @@ int Assembler::load_const_optimized(Register d, long x, Register tmp, bool retur return 0; } + int retval = 0; + if (return_simm16_rest) { + retval = xd; + x = rem << 16; + xd = 0; + } + + if (d == R0) { // Can't use addi. + if (is_simm(x, 32)) { // opt 2: simm32 + lis(d, x >> 16); + if (xd) ori(d, d, (unsigned short)xd); + } else { + // 64-bit value: x = xa xb xc xd + xa = (x >> 48) & 0xffff; + xb = (x >> 32) & 0xffff; + xc = (x >> 16) & 0xffff; + bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0); + if (tmp == noreg || (xc == 0 && xd == 0)) { + if (xa_loaded) { + lis(d, xa); + if (xb) { ori(d, d, (unsigned short)xb); } + } else { + li(d, xb); + } + sldi(d, d, 32); + if (xc) { oris(d, d, (unsigned short)xc); } + if (xd) { ori( d, d, (unsigned short)xd); } + } else { + // Exploit instruction level parallelism if we have a tmp register. + bool xc_loaded = (xd & 0x8000) ? (xc != -1) : (xc != 0); + if (xa_loaded) { + lis(tmp, xa); + } + if (xc_loaded) { + lis(d, xc); + } + if (xa_loaded) { + if (xb) { ori(tmp, tmp, (unsigned short)xb); } + } else { + li(tmp, xb); + } + if (xc_loaded) { + if (xd) { ori(d, d, (unsigned short)xd); } + } else { + li(d, xd); + } + insrdi(d, tmp, 32, 0); + } + } + return retval; + } + xc = rem & 0xFFFF; // Next 16-bit chunk. rem = (rem >> 16) + ((unsigned short)xc >> 15); // Compensation for sign extend. @@ -377,28 +428,27 @@ int Assembler::load_const_optimized(Register d, long x, Register tmp, bool retur lis(d, xc); } else { // High 32 bits needed. - if (tmp != noreg) { // opt 3: We have a temp reg. + if (tmp != noreg && (int)x != 0) { // opt 3: We have a temp reg. // No carry propagation between xc and higher chunks here (use logical instructions). xa = (x >> 48) & 0xffff; xb = (x >> 32) & 0xffff; // No sign compensation, we use lis+ori or li to allow usage of R0. - bool load_xa = (xa != 0) || (xb < 0); + bool xa_loaded = (xb & 0x8000) ? (xa != -1) : (xa != 0); bool return_xd = false; - if (load_xa) { lis(tmp, xa); } + if (xa_loaded) { lis(tmp, xa); } if (xc) { lis(d, xc); } - if (load_xa) { + if (xa_loaded) { if (xb) { ori(tmp, tmp, (unsigned short)xb); } // No addi, we support tmp == R0. } else { - li(tmp, xb); // non-negative + li(tmp, xb); } if (xc) { - if (return_simm16_rest && xd >= 0) { return_xd = true; } // >= 0 to avoid carry propagation after insrdi/rldimi. - else if (xd) { addi(d, d, xd); } + if (xd) { addi(d, d, xd); } } else { li(d, xd); } insrdi(d, tmp, 32, 0); - return return_xd ? xd : 0; // non-negative + return retval; } xb = rem & 0xFFFF; // Next 16-bit chunk. @@ -417,11 +467,51 @@ int Assembler::load_const_optimized(Register d, long x, Register tmp, bool retur if (xc) { addis(d, d, xc); } } - // opt 5: Return offset to be inserted into following instruction. - if (return_simm16_rest) return xd; - if (xd) { addi(d, d, xd); } - return 0; + return retval; +} + +// We emit only one addition to s to optimize latency. +int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp, bool return_simm16_rest) { + assert(s != R0 && s != tmp, "unsupported"); + long rem = x; + + // Case 1: Can use mr or addi. + short xd = rem & 0xFFFF; // Lowest 16-bit chunk. + rem = (rem >> 16) + ((unsigned short)xd >> 15); + if (rem == 0) { + if (xd == 0) { + if (d != s) { mr(d, s); } + return 0; + } + if (return_simm16_rest) { + return xd; + } + addi(d, s, xd); + return 0; + } + + // Case 2: Can use addis. + if (xd == 0) { + short xc = rem & 0xFFFF; // 2nd 16-bit chunk. + rem = (rem >> 16) + ((unsigned short)xd >> 15); + if (rem == 0) { + addis(d, s, xc); + return 0; + } + } + + // Other cases: load & add. + Register tmp1 = tmp, + tmp2 = noreg; + if ((d != tmp) && (d != s)) { + // Can use d. + tmp1 = d; + tmp2 = tmp; + } + int simm16_rest = load_const_optimized(tmp1, x, tmp2, return_simm16_rest); + add(d, tmp1, s); + return simm16_rest; } #ifndef PRODUCT diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index f1087dbc02c..6c7103aefa4 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -224,10 +224,13 @@ class Assembler : public AbstractAssembler { ADDIS_OPCODE = (15u << OPCODE_SHIFT), ADDIC__OPCODE = (13u << OPCODE_SHIFT), ADDE_OPCODE = (31u << OPCODE_SHIFT | 138u << 1), + ADDME_OPCODE = (31u << OPCODE_SHIFT | 234u << 1), + ADDZE_OPCODE = (31u << OPCODE_SHIFT | 202u << 1), SUBF_OPCODE = (31u << OPCODE_SHIFT | 40u << 1), SUBFC_OPCODE = (31u << OPCODE_SHIFT | 8u << 1), SUBFE_OPCODE = (31u << OPCODE_SHIFT | 136u << 1), SUBFIC_OPCODE = (8u << OPCODE_SHIFT), + SUBFME_OPCODE = (31u << OPCODE_SHIFT | 232u << 1), SUBFZE_OPCODE = (31u << OPCODE_SHIFT | 200u << 1), DIVW_OPCODE = (31u << OPCODE_SHIFT | 491u << 1), MULLW_OPCODE = (31u << OPCODE_SHIFT | 235u << 1), @@ -657,6 +660,9 @@ class Assembler : public AbstractAssembler { SYNC_OPCODE = (31u << OPCODE_SHIFT | 598u << 1), EIEIO_OPCODE = (31u << OPCODE_SHIFT | 854u << 1), + // Wait instructions for polling. + WAIT_OPCODE = (31u << OPCODE_SHIFT | 62u << 1), + // Trap instructions TDI_OPCODE = (2u << OPCODE_SHIFT), TWI_OPCODE = (3u << OPCODE_SHIFT), @@ -666,8 +672,10 @@ class Assembler : public AbstractAssembler { // Atomics. LWARX_OPCODE = (31u << OPCODE_SHIFT | 20u << 1), LDARX_OPCODE = (31u << OPCODE_SHIFT | 84u << 1), + LQARX_OPCODE = (31u << OPCODE_SHIFT | 276u << 1), STWCX_OPCODE = (31u << OPCODE_SHIFT | 150u << 1), - STDCX_OPCODE = (31u << OPCODE_SHIFT | 214u << 1) + STDCX_OPCODE = (31u << OPCODE_SHIFT | 214u << 1), + STQCX_OPCODE = (31u << OPCODE_SHIFT | 182u << 1) }; @@ -1171,6 +1179,14 @@ class Assembler : public AbstractAssembler { inline void adde_( Register d, Register a, Register b); inline void subfe( Register d, Register a, Register b); inline void subfe_( Register d, Register a, Register b); + inline void addme( Register d, Register a); + inline void addme_( Register d, Register a); + inline void subfme( Register d, Register a); + inline void subfme_(Register d, Register a); + inline void addze( Register d, Register a); + inline void addze_( Register d, Register a); + inline void subfze( Register d, Register a); + inline void subfze_(Register d, Register a); inline void neg( Register d, Register a); inline void neg_( Register d, Register a); inline void mulli( Register d, Register a, int si16); @@ -1189,6 +1205,38 @@ class Assembler : public AbstractAssembler { inline void divw( Register d, Register a, Register b); inline void divw_( Register d, Register a, Register b); + // Fixed-Point Arithmetic Instructions with Overflow detection + inline void addo( Register d, Register a, Register b); + inline void addo_( Register d, Register a, Register b); + inline void subfo( Register d, Register a, Register b); + inline void subfo_( Register d, Register a, Register b); + inline void addco( Register d, Register a, Register b); + inline void addco_( Register d, Register a, Register b); + inline void subfco( Register d, Register a, Register b); + inline void subfco_( Register d, Register a, Register b); + inline void addeo( Register d, Register a, Register b); + inline void addeo_( Register d, Register a, Register b); + inline void subfeo( Register d, Register a, Register b); + inline void subfeo_( Register d, Register a, Register b); + inline void addmeo( Register d, Register a); + inline void addmeo_( Register d, Register a); + inline void subfmeo( Register d, Register a); + inline void subfmeo_(Register d, Register a); + inline void addzeo( Register d, Register a); + inline void addzeo_( Register d, Register a); + inline void subfzeo( Register d, Register a); + inline void subfzeo_(Register d, Register a); + inline void nego( Register d, Register a); + inline void nego_( Register d, Register a); + inline void mulldo( Register d, Register a, Register b); + inline void mulldo_( Register d, Register a, Register b); + inline void mullwo( Register d, Register a, Register b); + inline void mullwo_( Register d, Register a, Register b); + inline void divdo( Register d, Register a, Register b); + inline void divdo_( Register d, Register a, Register b); + inline void divwo( Register d, Register a, Register b); + inline void divwo_( Register d, Register a, Register b); + // extended mnemonics inline void li( Register d, int si16); inline void lis( Register d, int si16); @@ -1303,7 +1351,7 @@ class Assembler : public AbstractAssembler { inline void isel_0( Register d, ConditionRegister cr, Condition cc, Register b = noreg); // PPC 1, section 3.3.11, Fixed-Point Logical Instructions - void andi( Register a, Register s, int ui16); // optimized version + void andi( Register a, Register s, long ui16); // optimized version inline void andi_( Register a, Register s, int ui16); inline void andis_( Register a, Register s, int ui16); inline void ori( Register a, Register s, int ui16); @@ -1688,14 +1736,21 @@ class Assembler : public AbstractAssembler { inline void isync(); inline void elemental_membar(int e); // Elemental Memory Barriers (>=Power 8) + // Wait instructions for polling. Attention: May result in SIGILL. + inline void wait(); + inline void waitrsv(); // >=Power7 + // atomics inline void lwarx_unchecked(Register d, Register a, Register b, int eh1 = 0); inline void ldarx_unchecked(Register d, Register a, Register b, int eh1 = 0); + inline void lqarx_unchecked(Register d, Register a, Register b, int eh1 = 0); inline bool lxarx_hint_exclusive_access(); inline void lwarx( Register d, Register a, Register b, bool hint_exclusive_access = false); inline void ldarx( Register d, Register a, Register b, bool hint_exclusive_access = false); + inline void lqarx( Register d, Register a, Register b, bool hint_exclusive_access = false); inline void stwcx_( Register s, Register a, Register b); inline void stdcx_( Register s, Register a, Register b); + inline void stqcx_( Register s, Register a, Register b); // Instructions for adjusting thread priority for simultaneous // multithreading (SMT) on Power5. @@ -2054,10 +2109,13 @@ class Assembler : public AbstractAssembler { // Atomics: use ra0mem to disallow R0 as base. inline void lwarx_unchecked(Register d, Register b, int eh1); inline void ldarx_unchecked(Register d, Register b, int eh1); + inline void lqarx_unchecked(Register d, Register b, int eh1); inline void lwarx( Register d, Register b, bool hint_exclusive_access); inline void ldarx( Register d, Register b, bool hint_exclusive_access); + inline void lqarx( Register d, Register b, bool hint_exclusive_access); inline void stwcx_(Register s, Register b); inline void stdcx_(Register s, Register b); + inline void stqcx_(Register s, Register b); inline void lfs( FloatRegister d, int si16); inline void lfsx( FloatRegister d, Register b); inline void lfd( FloatRegister d, int si16); @@ -2120,6 +2178,20 @@ class Assembler : public AbstractAssembler { return load_const_optimized(d, (long)(unsigned long)a, tmp, return_simm16_rest); } + // If return_simm16_rest, the return value needs to get added afterwards. + int add_const_optimized(Register d, Register s, long x, Register tmp = R0, bool return_simm16_rest = false); + inline int add_const_optimized(Register d, Register s, void* a, Register tmp = R0, bool return_simm16_rest = false) { + return add_const_optimized(d, s, (long)(unsigned long)a, tmp, return_simm16_rest); + } + + // If return_simm16_rest, the return value needs to get added afterwards. + inline int sub_const_optimized(Register d, Register s, long x, Register tmp = R0, bool return_simm16_rest = false) { + return add_const_optimized(d, s, -x, tmp, return_simm16_rest); + } + inline int sub_const_optimized(Register d, Register s, void* a, Register tmp = R0, bool return_simm16_rest = false) { + return sub_const_optimized(d, s, (long)(unsigned long)a, tmp, return_simm16_rest); + } + // Creation Assembler(CodeBuffer* code) : AbstractAssembler(code) { #ifdef CHECK_DELAY diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index 5493f124371..e860dac7d43 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -100,6 +100,14 @@ inline void Assembler::adde( Register d, Register a, Register b) { emit_int32( inline void Assembler::adde_( Register d, Register a, Register b) { emit_int32(ADDE_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } inline void Assembler::subfe( Register d, Register a, Register b) { emit_int32(SUBFE_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(0)); } inline void Assembler::subfe_( Register d, Register a, Register b) { emit_int32(SUBFE_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } +inline void Assembler::addme( Register d, Register a) { emit_int32(ADDME_OPCODE | rt(d) | ra(a) | oe(0) | rc(0)); } +inline void Assembler::addme_( Register d, Register a) { emit_int32(ADDME_OPCODE | rt(d) | ra(a) | oe(0) | rc(1)); } +inline void Assembler::subfme( Register d, Register a) { emit_int32(SUBFME_OPCODE | rt(d) | ra(a) | oe(0) | rc(0)); } +inline void Assembler::subfme_(Register d, Register a) { emit_int32(SUBFME_OPCODE | rt(d) | ra(a) | oe(0) | rc(1)); } +inline void Assembler::addze( Register d, Register a) { emit_int32(ADDZE_OPCODE | rt(d) | ra(a) | oe(0) | rc(0)); } +inline void Assembler::addze_( Register d, Register a) { emit_int32(ADDZE_OPCODE | rt(d) | ra(a) | oe(0) | rc(1)); } +inline void Assembler::subfze( Register d, Register a) { emit_int32(SUBFZE_OPCODE | rt(d) | ra(a) | oe(0) | rc(0)); } +inline void Assembler::subfze_(Register d, Register a) { emit_int32(SUBFZE_OPCODE | rt(d) | ra(a) | oe(0) | rc(1)); } inline void Assembler::neg( Register d, Register a) { emit_int32(NEG_OPCODE | rt(d) | ra(a) | oe(0) | rc(0)); } inline void Assembler::neg_( Register d, Register a) { emit_int32(NEG_OPCODE | rt(d) | ra(a) | oe(0) | rc(1)); } inline void Assembler::mulli( Register d, Register a, int si16) { emit_int32(MULLI_OPCODE | rt(d) | ra(a) | simm(si16, 16)); } @@ -118,6 +126,38 @@ inline void Assembler::divd_( Register d, Register a, Register b) { emit_int32( inline void Assembler::divw( Register d, Register a, Register b) { emit_int32(DIVW_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(0)); } inline void Assembler::divw_( Register d, Register a, Register b) { emit_int32(DIVW_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } +// Fixed-Point Arithmetic Instructions with Overflow detection +inline void Assembler::addo( Register d, Register a, Register b) { emit_int32(ADD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::addo_( Register d, Register a, Register b) { emit_int32(ADD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::subfo( Register d, Register a, Register b) { emit_int32(SUBF_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::subfo_( Register d, Register a, Register b) { emit_int32(SUBF_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::addco( Register d, Register a, Register b) { emit_int32(ADDC_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::addco_( Register d, Register a, Register b) { emit_int32(ADDC_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::subfco( Register d, Register a, Register b) { emit_int32(SUBFC_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::subfco_( Register d, Register a, Register b) { emit_int32(SUBFC_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::addeo( Register d, Register a, Register b) { emit_int32(ADDE_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::addeo_( Register d, Register a, Register b) { emit_int32(ADDE_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::subfeo( Register d, Register a, Register b) { emit_int32(SUBFE_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::subfeo_( Register d, Register a, Register b) { emit_int32(SUBFE_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::addmeo( Register d, Register a) { emit_int32(ADDME_OPCODE | rt(d) | ra(a) | oe(1) | rc(0)); } +inline void Assembler::addmeo_( Register d, Register a) { emit_int32(ADDME_OPCODE | rt(d) | ra(a) | oe(1) | rc(1)); } +inline void Assembler::subfmeo( Register d, Register a) { emit_int32(SUBFME_OPCODE | rt(d) | ra(a) | oe(1) | rc(0)); } +inline void Assembler::subfmeo_(Register d, Register a) { emit_int32(SUBFME_OPCODE | rt(d) | ra(a) | oe(1) | rc(1)); } +inline void Assembler::addzeo( Register d, Register a) { emit_int32(ADDZE_OPCODE | rt(d) | ra(a) | oe(1) | rc(0)); } +inline void Assembler::addzeo_( Register d, Register a) { emit_int32(ADDZE_OPCODE | rt(d) | ra(a) | oe(1) | rc(1)); } +inline void Assembler::subfzeo( Register d, Register a) { emit_int32(SUBFZE_OPCODE | rt(d) | ra(a) | oe(1) | rc(0)); } +inline void Assembler::subfzeo_(Register d, Register a) { emit_int32(SUBFZE_OPCODE | rt(d) | ra(a) | oe(1) | rc(1)); } +inline void Assembler::nego( Register d, Register a) { emit_int32(NEG_OPCODE | rt(d) | ra(a) | oe(1) | rc(0)); } +inline void Assembler::nego_( Register d, Register a) { emit_int32(NEG_OPCODE | rt(d) | ra(a) | oe(1) | rc(1)); } +inline void Assembler::mulldo( Register d, Register a, Register b) { emit_int32(MULLD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::mulldo_( Register d, Register a, Register b) { emit_int32(MULLD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::mullwo( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::mullwo_( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::divdo( Register d, Register a, Register b) { emit_int32(DIVD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::divdo_( Register d, Register a, Register b) { emit_int32(DIVD_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } +inline void Assembler::divwo( Register d, Register a, Register b) { emit_int32(DIVW_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(0)); } +inline void Assembler::divwo_( Register d, Register a, Register b) { emit_int32(DIVW_OPCODE | rt(d) | ra(a) | rb(b) | oe(1) | rc(1)); } + // extended mnemonics inline void Assembler::li( Register d, int si16) { Assembler::addi_r0ok( d, R0, si16); } inline void Assembler::lis( Register d, int si16) { Assembler::addis_r0ok(d, R0, si16); } @@ -540,15 +580,22 @@ inline void Assembler::eieio() { emit_int32( EIEIO_OPCODE); } inline void Assembler::isync() { emit_int32( ISYNC_OPCODE); } inline void Assembler::elemental_membar(int e) { assert(0 < e && e < 16, "invalid encoding"); emit_int32( SYNC_OPCODE | e1215(e)); } +// Wait instructions for polling. +inline void Assembler::wait() { emit_int32( WAIT_OPCODE); } +inline void Assembler::waitrsv() { emit_int32( WAIT_OPCODE | 1<<(31-10)); } // WC=0b01 >=Power7 + // atomics // Use ra0mem to disallow R0 as base. inline void Assembler::lwarx_unchecked(Register d, Register a, Register b, int eh1) { emit_int32( LWARX_OPCODE | rt(d) | ra0mem(a) | rb(b) | eh(eh1)); } inline void Assembler::ldarx_unchecked(Register d, Register a, Register b, int eh1) { emit_int32( LDARX_OPCODE | rt(d) | ra0mem(a) | rb(b) | eh(eh1)); } +inline void Assembler::lqarx_unchecked(Register d, Register a, Register b, int eh1) { emit_int32( LQARX_OPCODE | rt(d) | ra0mem(a) | rb(b) | eh(eh1)); } inline bool Assembler::lxarx_hint_exclusive_access() { return VM_Version::has_lxarxeh(); } inline void Assembler::lwarx( Register d, Register a, Register b, bool hint_exclusive_access) { lwarx_unchecked(d, a, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } inline void Assembler::ldarx( Register d, Register a, Register b, bool hint_exclusive_access) { ldarx_unchecked(d, a, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } +inline void Assembler::lqarx( Register d, Register a, Register b, bool hint_exclusive_access) { lqarx_unchecked(d, a, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } inline void Assembler::stwcx_(Register s, Register a, Register b) { emit_int32( STWCX_OPCODE | rs(s) | ra0mem(a) | rb(b) | rc(1)); } inline void Assembler::stdcx_(Register s, Register a, Register b) { emit_int32( STDCX_OPCODE | rs(s) | ra0mem(a) | rb(b) | rc(1)); } +inline void Assembler::stqcx_(Register s, Register a, Register b) { emit_int32( STQCX_OPCODE | rs(s) | ra0mem(a) | rb(b) | rc(1)); } // Instructions for adjusting thread priority // for simultaneous multithreading (SMT) on POWER5. @@ -873,10 +920,13 @@ inline void Assembler::dcbtstct(Register s2, int ct) { emit_int32( DCBTST_OPCOD // ra0 version inline void Assembler::lwarx_unchecked(Register d, Register b, int eh1) { emit_int32( LWARX_OPCODE | rt(d) | rb(b) | eh(eh1)); } inline void Assembler::ldarx_unchecked(Register d, Register b, int eh1) { emit_int32( LDARX_OPCODE | rt(d) | rb(b) | eh(eh1)); } +inline void Assembler::lqarx_unchecked(Register d, Register b, int eh1) { emit_int32( LQARX_OPCODE | rt(d) | rb(b) | eh(eh1)); } inline void Assembler::lwarx( Register d, Register b, bool hint_exclusive_access){ lwarx_unchecked(d, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } inline void Assembler::ldarx( Register d, Register b, bool hint_exclusive_access){ ldarx_unchecked(d, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } +inline void Assembler::lqarx( Register d, Register b, bool hint_exclusive_access){ lqarx_unchecked(d, b, (hint_exclusive_access && lxarx_hint_exclusive_access() && UseExtendedLoadAndReserveInstructionsPPC64) ? 1 : 0); } inline void Assembler::stwcx_(Register s, Register b) { emit_int32( STWCX_OPCODE | rs(s) | rb(b) | rc(1)); } inline void Assembler::stdcx_(Register s, Register b) { emit_int32( STDCX_OPCODE | rs(s) | rb(b) | rc(1)); } +inline void Assembler::stqcx_(Register s, Register b) { emit_int32( STQCX_OPCODE | rs(s) | rb(b) | rc(1)); } // ra0 version inline void Assembler::lfs( FloatRegister d, int si16) { emit_int32( LFS_OPCODE | frt(d) | simm(si16,16)); } diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp index 3b4b9e3660b..d797ef6eb8c 100644 --- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ define_pd_global(intx, ConditionalMoveLimit, 3); define_pd_global(intx, FLOATPRESSURE, 28); define_pd_global(intx, FreqInlineSize, 175); define_pd_global(intx, MinJumpTableSize, 10); -define_pd_global(intx, INTPRESSURE, 25); +define_pd_global(intx, INTPRESSURE, 26); define_pd_global(intx, InteriorEntryAlignment, 16); define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K)); define_pd_global(intx, RegisterCostAreaRatio, 16000); diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp index f2391d251eb..6c3cf73cb56 100644 --- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,10 +55,12 @@ define_pd_global(bool, RewriteFrequentPairs, true); define_pd_global(bool, UseMembar, false); +define_pd_global(bool, PreserveFramePointer, false); + // GC Ergo Flags define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // Default max size of CMS young gen, per GC worker thread. -define_pd_global(uintx, TypeProfileLevel, 0); +define_pd_global(uintx, TypeProfileLevel, 111); // Platform dependent flag handling: flags only defined on this platform. #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ @@ -71,14 +73,26 @@ define_pd_global(uintx, TypeProfileLevel, 0); \ product(uintx, PowerArchitecturePPC64, 0, \ "CPU Version: x for PowerX. Currently recognizes Power5 to " \ - "Power7. Default is 0. CPUs newer than Power7 will be " \ - "recognized as Power7.") \ + "Power8. Default is 0. Newer CPUs will be recognized as Power8.") \ \ /* Reoptimize code-sequences of calls at runtime, e.g. replace an */ \ /* indirect call by a direct call. */ \ product(bool, ReoptimizeCallSequences, true, \ "Reoptimize code-sequences of calls at runtime.") \ \ + /* Power 8: Configure Data Stream Control Register. */ \ + product(uint64_t,DSCR_PPC64, (uintx)-1, \ + "Power8 or later: Specify encoded value for Data Stream Control " \ + "Register") \ + product(uint64_t,DSCR_DPFD_PPC64, 8, \ + "Power8 or later: DPFD (default prefetch depth) value of the " \ + "Data Stream Control Register." \ + " 0: hardware default, 1: none, 2-7: min-max, 8: don't touch") \ + product(uint64_t,DSCR_URG_PPC64, 8, \ + "Power8 or later: URG (depth attainment urgency) value of the " \ + "Data Stream Control Register." \ + " 0: hardware default, 1: none, 2-7: min-max, 8: don't touch") \ + \ product(bool, UseLoadInstructionsForStackBangingPPC64, false, \ "Use load instructions for stack banging.") \ \ @@ -121,6 +135,41 @@ define_pd_global(uintx, TypeProfileLevel, 0); \ product(bool, ZapMemory, false, "Write 0x0101... to empty memory." \ " Use this to ease debugging.") \ - + \ + /* Use Restricted Transactional Memory for lock eliding */ \ + product(bool, UseRTMLocking, false, \ + "Enable RTM lock eliding for inflated locks in compiled code") \ + \ + experimental(bool, UseRTMForStackLocks, false, \ + "Enable RTM lock eliding for stack locks in compiled code") \ + \ + product(bool, UseRTMDeopt, false, \ + "Perform deopt and recompilation based on RTM abort ratio") \ + \ + product(uintx, RTMRetryCount, 5, \ + "Number of RTM retries on lock abort or busy") \ + \ + experimental(intx, RTMSpinLoopCount, 100, \ + "Spin count for lock to become free before RTM retry") \ + \ + experimental(intx, RTMAbortThreshold, 1000, \ + "Calculate abort ratio after this number of aborts") \ + \ + experimental(intx, RTMLockingThreshold, 10000, \ + "Lock count at which to do RTM lock eliding without " \ + "abort ratio calculation") \ + \ + experimental(intx, RTMAbortRatio, 50, \ + "Lock abort ratio at which to stop use RTM lock eliding") \ + \ + experimental(intx, RTMTotalCountIncrRate, 64, \ + "Increment total RTM attempted lock count once every n times") \ + \ + experimental(intx, RTMLockingCalculationDelay, 0, \ + "Number of milliseconds to wait before start calculating aborts " \ + "for RTM locking") \ + \ + experimental(bool, UseRTMXendForLockBusy, true, \ + "Use RTM Xend instead of Xabort when lock busy") \ #endif // CPU_PPC_VM_GLOBALS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp index b79b1582bb7..00330ef3461 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp @@ -446,7 +446,7 @@ void InterpreterMacroAssembler::get_u4(Register Rdst, Register Rsrc, int offset, } // Load object from cpool->resolved_references(index). -void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result, Register index) { +void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result, Register index, Label *is_null) { assert_different_registers(result, index); get_constant_pool(result); @@ -469,7 +469,7 @@ void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result #endif // Add in the index. add(result, tmp, result); - load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result); + load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result, is_null); } // Generate a subtype check: branch to ok_is_subtype if sub_klass is @@ -876,7 +876,6 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { // If condition is true we are done and hence we can store 0 in the displaced // header indicating it is a recursive lock. bne(CCR0, slow_case); - release(); std(R0/*==0!*/, BasicObjectLock::lock_offset_in_bytes() + BasicLock::displaced_header_offset_in_bytes(), monitor); b(done); @@ -1861,7 +1860,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register const Register mdp = tmp1; add(mdp, tmp1, R28_mdx); - // Pffset of the current profile entry to update. + // Offset of the current profile entry to update. const Register entry_offset = tmp2; // entry_offset = array len in number of cells ld(entry_offset, in_bytes(ArrayData::array_len_offset()), mdp); diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp index 555cc5ee9d8..571f87e45cd 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,7 +85,7 @@ class InterpreterMacroAssembler: public MacroAssembler { Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype); // Load object from cpool->resolved_references(index). - void load_resolved_reference_at_index(Register result, Register index); + void load_resolved_reference_at_index(Register result, Register index, Label *is_null = NULL); void generate_stack_overflow_check_with_compare_and_throw(Register Rmem_frame_size, Register Rscratch1); void load_receiver(Register Rparam_count, Register Rrecv_dst); @@ -137,7 +137,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void field_offset_at(int n, Register tmp, Register dest, Register base); int field_offset_at(Register object, address bcp, int offset); void fast_iaaccess(int n, address bcp); - void fast_iagetfield(address bcp); void fast_iaputfield(address bcp, bool do_store_check); void index_check(Register array, Register index, int index_shift, Register tmp, Register res); diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index be85db68c82..7f301e255b0 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -427,7 +427,6 @@ address AbstractInterpreterGenerator::generate_result_handler_for(BasicType type return entry; } - // Call an accessor method (assuming it is resolved, otherwise drop into // vanilla (slow path) entry. address InterpreterGenerator::generate_jump_to_normal_entry(void) { @@ -473,7 +472,8 @@ address InterpreterGenerator::generate_abstract_entry(void) { // This is not a leaf but we have a JavaFrameAnchor now and we will // check (create) exceptions afterward so this is ok. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), + R16_thread); // Pop the C frame and restore LR. __ pop_frame(); diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp index 48864ae7213..e42e66c6914 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,4 +47,4 @@ } #endif -#endif // CPU_PPC_VM_INTERPRETER_PPC_PP +#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 89973056451..4d0e6df26b5 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1455,7 +1455,7 @@ void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_valu // Several special cases exist to avoid that unnecessary information is generated. // void MacroAssembler::cmpxchgd(ConditionRegister flag, - Register dest_current_value, Register compare_value, Register exchange_value, + Register dest_current_value, RegisterOrConstant compare_value, Register exchange_value, Register addr_base, int semantics, bool cmpxchgx_hint, Register int_flag_success, Label* failed_ext, bool contention_hint) { Label retry; @@ -1465,7 +1465,7 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, // Save one branch if result is returned via register and result register is different from the other ones. bool use_result_reg = (int_flag_success!=noreg); - bool preset_result_reg = (int_flag_success!=dest_current_value && int_flag_success!=compare_value && + bool preset_result_reg = (int_flag_success!=dest_current_value && int_flag_success!=compare_value.register_or_noreg() && int_flag_success!=exchange_value && int_flag_success!=addr_base); assert(int_flag_success == noreg || failed_ext == NULL, "cannot have both"); @@ -1481,7 +1481,7 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, // Add simple guard in order to reduce risk of starving under high contention (recommended by IBM). if (contention_hint) { // Don't try to reserve if cmp fails. ld(dest_current_value, 0, addr_base); - cmpd(flag, dest_current_value, compare_value); + cmpd(flag, compare_value, dest_current_value); bne(flag, failed); } @@ -1489,7 +1489,7 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, bind(retry); ldarx(dest_current_value, addr_base, cmpxchgx_hint); - cmpd(flag, dest_current_value, compare_value); + cmpd(flag, compare_value, dest_current_value); if (UseStaticBranchPredictionInCompareAndSwapPPC64) { bne_predict_not_taken(flag, failed); } else { @@ -1873,7 +1873,6 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); // CmpxchgX sets cr_reg to cmpX(temp2_reg, mark_reg). - fence(); // TODO: replace by MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq ? cmpxchgd(/*flag=*/cr_reg, /*current_value=*/temp2_reg, /*compare_value=*/mark_reg, /*exchange_value=*/temp_reg, /*where=*/obj_reg, @@ -1909,7 +1908,6 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); // CmpxchgX sets cr_reg to cmpX(temp2_reg, mark_reg). - fence(); // TODO: replace by MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq ? cmpxchgd(/*flag=*/cr_reg, /*current_value=*/temp2_reg, /*compare_value=*/mark_reg, /*exchange_value=*/temp_reg, /*where=*/obj_reg, @@ -1946,7 +1944,6 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); // CmpxchgX sets cr_reg to cmpX(temp2_reg, mark_reg). - fence(); // TODO: replace by MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq ? cmpxchgd(/*flag=*/cr_reg, /*current_value=*/temp2_reg, /*compare_value=*/mark_reg, /*exchange_value=*/temp_reg, /*where=*/obj_reg, @@ -1987,9 +1984,371 @@ void MacroAssembler::biased_locking_exit (ConditionRegister cr_reg, Register mar beq(cr_reg, done); } +// TM on PPC64. +void MacroAssembler::atomic_inc_ptr(Register addr, Register result, int simm16) { + Label retry; + bind(retry); + ldarx(result, addr, /*hint*/ false); + addi(result, result, simm16); + stdcx_(result, addr); + if (UseStaticBranchPredictionInCompareAndSwapPPC64) { + bne_predict_not_taken(CCR0, retry); // stXcx_ sets CCR0 + } else { + bne( CCR0, retry); // stXcx_ sets CCR0 + } +} + +void MacroAssembler::atomic_ori_int(Register addr, Register result, int uimm16) { + Label retry; + bind(retry); + lwarx(result, addr, /*hint*/ false); + ori(result, result, uimm16); + stwcx_(result, addr); + if (UseStaticBranchPredictionInCompareAndSwapPPC64) { + bne_predict_not_taken(CCR0, retry); // stXcx_ sets CCR0 + } else { + bne( CCR0, retry); // stXcx_ sets CCR0 + } +} + +#if INCLUDE_RTM_OPT + +// Update rtm_counters based on abort status +// input: abort_status +// rtm_counters (RTMLockingCounters*) +void MacroAssembler::rtm_counters_update(Register abort_status, Register rtm_counters_Reg) { + // Mapping to keep PreciseRTMLockingStatistics similar to x86. + // x86 ppc (! means inverted, ? means not the same) + // 0 31 Set if abort caused by XABORT instruction. + // 1 ! 7 If set, the transaction may succeed on a retry. This bit is always clear if bit 0 is set. + // 2 13 Set if another logical processor conflicted with a memory address that was part of the transaction that aborted. + // 3 10 Set if an internal buffer overflowed. + // 4 ?12 Set if a debug breakpoint was hit. + // 5 ?32 Set if an abort occurred during execution of a nested transaction. + const int tm_failure_bit[] = {Assembler::tm_tabort, // Note: Seems like signal handler sets this, too. + Assembler::tm_failure_persistent, // inverted: transient + Assembler::tm_trans_cf, + Assembler::tm_footprint_of, + Assembler::tm_non_trans_cf, + Assembler::tm_suspended}; + const bool tm_failure_inv[] = {false, true, false, false, false, false}; + assert(sizeof(tm_failure_bit)/sizeof(int) == RTMLockingCounters::ABORT_STATUS_LIMIT, "adapt mapping!"); + + const Register addr_Reg = R0; + // Keep track of offset to where rtm_counters_Reg had pointed to. + int counters_offs = RTMLockingCounters::abort_count_offset(); + addi(addr_Reg, rtm_counters_Reg, counters_offs); + const Register temp_Reg = rtm_counters_Reg; + + //atomic_inc_ptr(addr_Reg, temp_Reg); We don't increment atomically + ldx(temp_Reg, addr_Reg); + addi(temp_Reg, temp_Reg, 1); + stdx(temp_Reg, addr_Reg); + + if (PrintPreciseRTMLockingStatistics) { + int counters_offs_delta = RTMLockingCounters::abortX_count_offset() - counters_offs; + + //mftexasr(abort_status); done by caller + for (int i = 0; i < RTMLockingCounters::ABORT_STATUS_LIMIT; i++) { + counters_offs += counters_offs_delta; + li(temp_Reg, counters_offs_delta); // can't use addi with R0 + add(addr_Reg, addr_Reg, temp_Reg); // point to next counter + counters_offs_delta = sizeof(uintx); + + Label check_abort; + rldicr_(temp_Reg, abort_status, tm_failure_bit[i], 0); + if (tm_failure_inv[i]) { + bne(CCR0, check_abort); + } else { + beq(CCR0, check_abort); + } + //atomic_inc_ptr(addr_Reg, temp_Reg); We don't increment atomically + ldx(temp_Reg, addr_Reg); + addi(temp_Reg, temp_Reg, 1); + stdx(temp_Reg, addr_Reg); + bind(check_abort); + } + } + li(temp_Reg, -counters_offs); // can't use addi with R0 + add(rtm_counters_Reg, addr_Reg, temp_Reg); // restore +} + +// Branch if (random & (count-1) != 0), count is 2^n +// tmp and CR0 are killed +void MacroAssembler::branch_on_random_using_tb(Register tmp, int count, Label& brLabel) { + mftb(tmp); + andi_(tmp, tmp, count-1); + bne(CCR0, brLabel); +} + +// Perform abort ratio calculation, set no_rtm bit if high ratio. +// input: rtm_counters_Reg (RTMLockingCounters* address) - KILLED +void MacroAssembler::rtm_abort_ratio_calculation(Register rtm_counters_Reg, + RTMLockingCounters* rtm_counters, + Metadata* method_data) { + Label L_done, L_check_always_rtm1, L_check_always_rtm2; + + if (RTMLockingCalculationDelay > 0) { + // Delay calculation. + ld(rtm_counters_Reg, (RegisterOrConstant)(intptr_t)RTMLockingCounters::rtm_calculation_flag_addr()); + cmpdi(CCR0, rtm_counters_Reg, 0); + beq(CCR0, L_done); + load_const_optimized(rtm_counters_Reg, (address)rtm_counters, R0); // reload + } + // Abort ratio calculation only if abort_count > RTMAbortThreshold. + // Aborted transactions = abort_count * 100 + // All transactions = total_count * RTMTotalCountIncrRate + // Set no_rtm bit if (Aborted transactions >= All transactions * RTMAbortRatio) + ld(R0, RTMLockingCounters::abort_count_offset(), rtm_counters_Reg); + cmpdi(CCR0, R0, RTMAbortThreshold); + blt(CCR0, L_check_always_rtm2); + mulli(R0, R0, 100); + + const Register tmpReg = rtm_counters_Reg; + ld(tmpReg, RTMLockingCounters::total_count_offset(), rtm_counters_Reg); + mulli(tmpReg, tmpReg, RTMTotalCountIncrRate); + mulli(tmpReg, tmpReg, RTMAbortRatio); + cmpd(CCR0, R0, tmpReg); + blt(CCR0, L_check_always_rtm1); // jump to reload + if (method_data != NULL) { + // Set rtm_state to "no rtm" in MDO. + // Not using a metadata relocation. Method and Class Loader are kept alive anyway. + // (See nmethod::metadata_do and CodeBuffer::finalize_oop_references.) + load_const(R0, (address)method_data + MethodData::rtm_state_offset_in_bytes(), tmpReg); + atomic_ori_int(R0, tmpReg, NoRTM); + } + b(L_done); + + bind(L_check_always_rtm1); + load_const_optimized(rtm_counters_Reg, (address)rtm_counters, R0); // reload + bind(L_check_always_rtm2); + ld(tmpReg, RTMLockingCounters::total_count_offset(), rtm_counters_Reg); + cmpdi(CCR0, tmpReg, RTMLockingThreshold / RTMTotalCountIncrRate); + blt(CCR0, L_done); + if (method_data != NULL) { + // Set rtm_state to "always rtm" in MDO. + // Not using a metadata relocation. See above. + load_const(R0, (address)method_data + MethodData::rtm_state_offset_in_bytes(), tmpReg); + atomic_ori_int(R0, tmpReg, UseRTM); + } + bind(L_done); +} + +// Update counters and perform abort ratio calculation. +// input: abort_status_Reg +void MacroAssembler::rtm_profiling(Register abort_status_Reg, Register temp_Reg, + RTMLockingCounters* rtm_counters, + Metadata* method_data, + bool profile_rtm) { + + assert(rtm_counters != NULL, "should not be NULL when profiling RTM"); + // Update rtm counters based on state at abort. + // Reads abort_status_Reg, updates flags. + assert_different_registers(abort_status_Reg, temp_Reg); + load_const_optimized(temp_Reg, (address)rtm_counters, R0); + rtm_counters_update(abort_status_Reg, temp_Reg); + if (profile_rtm) { + assert(rtm_counters != NULL, "should not be NULL when profiling RTM"); + rtm_abort_ratio_calculation(temp_Reg, rtm_counters, method_data); + } +} + +// Retry on abort if abort's status indicates non-persistent failure. +// inputs: retry_count_Reg +// : abort_status_Reg +// output: retry_count_Reg decremented by 1 +void MacroAssembler::rtm_retry_lock_on_abort(Register retry_count_Reg, Register abort_status_Reg, + Label& retryLabel, Label* checkRetry) { + Label doneRetry; + rldicr_(R0, abort_status_Reg, tm_failure_persistent, 0); + bne(CCR0, doneRetry); + if (checkRetry) { bind(*checkRetry); } + addic_(retry_count_Reg, retry_count_Reg, -1); + blt(CCR0, doneRetry); + smt_yield(); // Can't use wait(). No permission (SIGILL). + b(retryLabel); + bind(doneRetry); +} + +// Spin and retry if lock is busy. +// inputs: box_Reg (monitor address) +// : retry_count_Reg +// output: retry_count_Reg decremented by 1 +// CTR is killed +void MacroAssembler::rtm_retry_lock_on_busy(Register retry_count_Reg, Register owner_addr_Reg, Label& retryLabel) { + Label SpinLoop, doneRetry; + addic_(retry_count_Reg, retry_count_Reg, -1); + blt(CCR0, doneRetry); + li(R0, RTMSpinLoopCount); + mtctr(R0); + + bind(SpinLoop); + smt_yield(); // Can't use waitrsv(). No permission (SIGILL). + bdz(retryLabel); + ld(R0, 0, owner_addr_Reg); + cmpdi(CCR0, R0, 0); + bne(CCR0, SpinLoop); + b(retryLabel); + + bind(doneRetry); +} + +// Use RTM for normal stack locks. +// Input: objReg (object to lock) +void MacroAssembler::rtm_stack_locking(ConditionRegister flag, + Register obj, Register mark_word, Register tmp, + Register retry_on_abort_count_Reg, + RTMLockingCounters* stack_rtm_counters, + Metadata* method_data, bool profile_rtm, + Label& DONE_LABEL, Label& IsInflated) { + assert(UseRTMForStackLocks, "why call this otherwise?"); + assert(!UseBiasedLocking, "Biased locking is not supported with RTM locking"); + Label L_rtm_retry, L_decrement_retry, L_on_abort; + + if (RTMRetryCount > 0) { + load_const_optimized(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort + bind(L_rtm_retry); + } + andi_(R0, mark_word, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased + bne(CCR0, IsInflated); + + if (PrintPreciseRTMLockingStatistics || profile_rtm) { + Label L_noincrement; + if (RTMTotalCountIncrRate > 1) { + branch_on_random_using_tb(tmp, (int)RTMTotalCountIncrRate, L_noincrement); + } + assert(stack_rtm_counters != NULL, "should not be NULL when profiling RTM"); + load_const_optimized(tmp, (address)stack_rtm_counters->total_count_addr(), R0); + //atomic_inc_ptr(tmp, /*temp, will be reloaded*/mark_word); We don't increment atomically + ldx(mark_word, tmp); + addi(mark_word, mark_word, 1); + stdx(mark_word, tmp); + bind(L_noincrement); + } + tbegin_(); + beq(CCR0, L_on_abort); + ld(mark_word, oopDesc::mark_offset_in_bytes(), obj); // Reload in transaction, conflicts need to be tracked. + andi(R0, mark_word, markOopDesc::biased_lock_mask_in_place); // look at 3 lock bits + cmpwi(flag, R0, markOopDesc::unlocked_value); // bits = 001 unlocked + beq(flag, DONE_LABEL); // all done if unlocked + + if (UseRTMXendForLockBusy) { + tend_(); + b(L_decrement_retry); + } else { + tabort_(); + } + bind(L_on_abort); + const Register abort_status_Reg = tmp; + mftexasr(abort_status_Reg); + if (PrintPreciseRTMLockingStatistics || profile_rtm) { + rtm_profiling(abort_status_Reg, /*temp*/mark_word, stack_rtm_counters, method_data, profile_rtm); + } + ld(mark_word, oopDesc::mark_offset_in_bytes(), obj); // reload + if (RTMRetryCount > 0) { + // Retry on lock abort if abort status is not permanent. + rtm_retry_lock_on_abort(retry_on_abort_count_Reg, abort_status_Reg, L_rtm_retry, &L_decrement_retry); + } else { + bind(L_decrement_retry); + } +} + +// Use RTM for inflating locks +// inputs: obj (object to lock) +// mark_word (current header - KILLED) +// boxReg (on-stack box address (displaced header location) - KILLED) +void MacroAssembler::rtm_inflated_locking(ConditionRegister flag, + Register obj, Register mark_word, Register boxReg, + Register retry_on_busy_count_Reg, Register retry_on_abort_count_Reg, + RTMLockingCounters* rtm_counters, + Metadata* method_data, bool profile_rtm, + Label& DONE_LABEL) { + assert(UseRTMLocking, "why call this otherwise?"); + Label L_rtm_retry, L_decrement_retry, L_on_abort; + // Clean monitor_value bit to get valid pointer. + int owner_offset = ObjectMonitor::owner_offset_in_bytes() - markOopDesc::monitor_value; + + // Store non-null, using boxReg instead of (intptr_t)markOopDesc::unused_mark(). + std(boxReg, BasicLock::displaced_header_offset_in_bytes(), boxReg); + const Register tmpReg = boxReg; + const Register owner_addr_Reg = mark_word; + addi(owner_addr_Reg, mark_word, owner_offset); + + if (RTMRetryCount > 0) { + load_const_optimized(retry_on_busy_count_Reg, RTMRetryCount); // Retry on lock busy. + load_const_optimized(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort. + bind(L_rtm_retry); + } + if (PrintPreciseRTMLockingStatistics || profile_rtm) { + Label L_noincrement; + if (RTMTotalCountIncrRate > 1) { + branch_on_random_using_tb(R0, (int)RTMTotalCountIncrRate, L_noincrement); + } + assert(rtm_counters != NULL, "should not be NULL when profiling RTM"); + load_const(R0, (address)rtm_counters->total_count_addr(), tmpReg); + //atomic_inc_ptr(R0, tmpReg); We don't increment atomically + ldx(tmpReg, R0); + addi(tmpReg, tmpReg, 1); + stdx(tmpReg, R0); + bind(L_noincrement); + } + tbegin_(); + beq(CCR0, L_on_abort); + // We don't reload mark word. Will only be reset at safepoint. + ld(R0, 0, owner_addr_Reg); // Load in transaction, conflicts need to be tracked. + cmpdi(flag, R0, 0); + beq(flag, DONE_LABEL); + + if (UseRTMXendForLockBusy) { + tend_(); + b(L_decrement_retry); + } else { + tabort_(); + } + bind(L_on_abort); + const Register abort_status_Reg = tmpReg; + mftexasr(abort_status_Reg); + if (PrintPreciseRTMLockingStatistics || profile_rtm) { + rtm_profiling(abort_status_Reg, /*temp*/ owner_addr_Reg, rtm_counters, method_data, profile_rtm); + // Restore owner_addr_Reg + ld(mark_word, oopDesc::mark_offset_in_bytes(), obj); +#ifdef ASSERT + andi_(R0, mark_word, markOopDesc::monitor_value); + asm_assert_ne("must be inflated", 0xa754); // Deflating only allowed at safepoint. +#endif + addi(owner_addr_Reg, mark_word, owner_offset); + } + if (RTMRetryCount > 0) { + // Retry on lock abort if abort status is not permanent. + rtm_retry_lock_on_abort(retry_on_abort_count_Reg, abort_status_Reg, L_rtm_retry); + } + + // Appears unlocked - try to swing _owner from null to non-null. + cmpxchgd(flag, /*current val*/ R0, (intptr_t)0, /*new val*/ R16_thread, owner_addr_Reg, + MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, + MacroAssembler::cmpxchgx_hint_acquire_lock(), noreg, &L_decrement_retry, true); + + if (RTMRetryCount > 0) { + // success done else retry + b(DONE_LABEL); + bind(L_decrement_retry); + // Spin and retry if lock is busy. + rtm_retry_lock_on_busy(retry_on_busy_count_Reg, owner_addr_Reg, L_rtm_retry); + } else { + bind(L_decrement_retry); + } +} + +#endif // INCLUDE_RTM_OPT + // "The box" is the space on the stack where we copy the object mark. void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register oop, Register box, - Register temp, Register displaced_header, Register current_header) { + Register temp, Register displaced_header, Register current_header, + bool try_bias, + RTMLockingCounters* rtm_counters, + RTMLockingCounters* stack_rtm_counters, + Metadata* method_data, + bool use_rtm, bool profile_rtm) { assert_different_registers(oop, box, temp, displaced_header, current_header); assert(flag != CCR0, "bad condition register"); Label cont; @@ -2006,10 +2365,18 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register return; } - if (UseBiasedLocking) { + if (try_bias) { biased_locking_enter(flag, oop, displaced_header, temp, current_header, cont); } +#if INCLUDE_RTM_OPT + if (UseRTMForStackLocks && use_rtm) { + rtm_stack_locking(flag, oop, displaced_header, temp, /*temp*/ current_header, + stack_rtm_counters, method_data, profile_rtm, + cont, object_has_monitor); + } +#endif // INCLUDE_RTM_OPT + // Handle existing monitor. if ((EmitSync & 0x02) == 0) { // The object has an existing monitor iff (mark & monitor_value) != 0. @@ -2066,14 +2433,22 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register bind(object_has_monitor); // The object's monitor m is unlocked iff m->owner == NULL, // otherwise m->owner may contain a thread or a stack address. - // + +#if INCLUDE_RTM_OPT + // Use the same RTM locking code in 32- and 64-bit VM. + if (use_rtm) { + rtm_inflated_locking(flag, oop, displaced_header, box, temp, /*temp*/ current_header, + rtm_counters, method_data, profile_rtm, cont); + } else { +#endif // INCLUDE_RTM_OPT + // Try to CAS m->owner from NULL to current thread. addi(temp, displaced_header, ObjectMonitor::owner_offset_in_bytes()-markOopDesc::monitor_value); li(displaced_header, 0); // CmpxchgX sets flag to cmpX(current, displaced). cmpxchgd(/*flag=*/flag, /*current_value=*/current_header, - /*compare_value=*/displaced_header, + /*compare_value=*/(intptr_t)0, /*exchange_value=*/R16_thread, /*where=*/temp, MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, @@ -2095,6 +2470,10 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register //asm_assert_mem4_isnot_zero(ObjectMonitor::OwnerIsThread_offset_in_bytes(), temp, // "monitor->OwnerIsThread shouldn't be 0", -1); # endif + +#if INCLUDE_RTM_OPT + } // use_rtm() +#endif } bind(cont); @@ -2103,7 +2482,8 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register } void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, - Register temp, Register displaced_header, Register current_header) { + Register temp, Register displaced_header, Register current_header, + bool try_bias, bool use_rtm) { assert_different_registers(oop, box, temp, displaced_header, current_header); assert(flag != CCR0, "bad condition register"); Label cont; @@ -2115,10 +2495,24 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe return; } - if (UseBiasedLocking) { + if (try_bias) { biased_locking_exit(flag, oop, current_header, cont); } +#if INCLUDE_RTM_OPT + if (UseRTMForStackLocks && use_rtm) { + assert(!UseBiasedLocking, "Biased locking is not supported with RTM locking"); + Label L_regular_unlock; + ld(current_header, oopDesc::mark_offset_in_bytes(), oop); // fetch markword + andi(R0, current_header, markOopDesc::biased_lock_mask_in_place); // look at 3 lock bits + cmpwi(flag, R0, markOopDesc::unlocked_value); // bits = 001 unlocked + bne(flag, L_regular_unlock); // else RegularLock + tend_(); // otherwise end... + b(cont); // ... and we're done + bind(L_regular_unlock); + } +#endif + // Find the lock address and load the displaced header from the stack. ld(displaced_header, BasicLock::displaced_header_offset_in_bytes(), box); @@ -2129,13 +2523,12 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe // Handle existing monitor. if ((EmitSync & 0x02) == 0) { // The object has an existing monitor iff (mark & monitor_value) != 0. + RTM_OPT_ONLY( if (!(UseRTMForStackLocks && use_rtm)) ) // skip load if already done ld(current_header, oopDesc::mark_offset_in_bytes(), oop); - andi(temp, current_header, markOopDesc::monitor_value); - cmpdi(flag, temp, 0); - bne(flag, object_has_monitor); + andi_(R0, current_header, markOopDesc::monitor_value); + bne(CCR0, object_has_monitor); } - // Check if it is still a light weight lock, this is is true if we see // the stack address of the basicLock in the markOop of the object. // Cmpxchg sets flag to cmpd(current_header, box). @@ -2158,6 +2551,20 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe bind(object_has_monitor); addi(current_header, current_header, -markOopDesc::monitor_value); // monitor ld(temp, ObjectMonitor::owner_offset_in_bytes(), current_header); + + // It's inflated. +#if INCLUDE_RTM_OPT + if (use_rtm) { + Label L_regular_inflated_unlock; + // Clean monitor_value bit to get valid pointer + cmpdi(flag, temp, 0); + bne(flag, L_regular_inflated_unlock); + tend_(); + b(cont); + bind(L_regular_inflated_unlock); + } +#endif + ld(displaced_header, ObjectMonitor::recursions_offset_in_bytes(), current_header); xorr(temp, R16_thread, temp); // Will be 0 if we are the owner. orr(temp, temp, displaced_header); // Will be 0 if there are 0 recursions. @@ -2441,6 +2848,8 @@ void MacroAssembler::get_vm_result(Register oop_result) { // oop_result // R16_thread->in_bytes(JavaThread::vm_result_offset()) + verify_thread(); + ld(oop_result, in_bytes(JavaThread::vm_result_offset()), R16_thread); li(R0, 0); std(R0, in_bytes(JavaThread::vm_result_offset()), R16_thread); @@ -2462,26 +2871,24 @@ void MacroAssembler::get_vm_result_2(Register metadata_result) { std(R0, in_bytes(JavaThread::vm_result_2_offset()), R16_thread); } - -void MacroAssembler::encode_klass_not_null(Register dst, Register src) { +Register MacroAssembler::encode_klass_not_null(Register dst, Register src) { Register current = (src != noreg) ? src : dst; // Klass is in dst if no src provided. if (Universe::narrow_klass_base() != 0) { // Use dst as temp if it is free. - load_const(R0, Universe::narrow_klass_base(), (dst != current && dst != R0) ? dst : noreg); - sub(dst, current, R0); + sub_const_optimized(dst, current, Universe::narrow_klass_base(), R0); current = dst; } if (Universe::narrow_klass_shift() != 0) { srdi(dst, current, Universe::narrow_klass_shift()); current = dst; } - mr_if_needed(dst, current); // Move may be required. + return current; } void MacroAssembler::store_klass(Register dst_oop, Register klass, Register ck) { if (UseCompressedClassPointers) { - encode_klass_not_null(ck, klass); - stw(ck, oopDesc::klass_offset_in_bytes(), dst_oop); + Register compressedKlass = encode_klass_not_null(ck, klass); + stw(compressedKlass, oopDesc::klass_offset_in_bytes(), dst_oop); } else { std(klass, oopDesc::klass_offset_in_bytes(), dst_oop); } @@ -2514,8 +2921,7 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src) { sldi(shifted_src, src, Universe::narrow_klass_shift()); } if (Universe::narrow_klass_base() != 0) { - load_const(R0, Universe::narrow_klass_base()); - add(dst, shifted_src, R0); + add_const_optimized(dst, shifted_src, Universe::narrow_klass_base(), R0); } } diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index 46216782c97..2ed004aba44 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #define CPU_PPC_VM_MACROASSEMBLER_PPC_HPP #include "asm/assembler.hpp" +#include "runtime/rtmLocking.hpp" #include "utilities/macros.hpp" // MacroAssembler extends Assembler by a few frequently used macros. @@ -432,8 +433,8 @@ class MacroAssembler: public Assembler { int semantics, bool cmpxchgx_hint = false, Register int_flag_success = noreg, bool contention_hint = false); void cmpxchgd(ConditionRegister flag, - Register dest_current_value, Register compare_value, Register exchange_value, Register addr_base, - int semantics, bool cmpxchgx_hint = false, + Register dest_current_value, RegisterOrConstant compare_value, Register exchange_value, + Register addr_base, int semantics, bool cmpxchgx_hint = false, Register int_flag_success = noreg, Label* failed = NULL, bool contention_hint = false); // interface method calling @@ -506,8 +507,42 @@ class MacroAssembler: public Assembler { // biased locking exit case failed. void biased_locking_exit(ConditionRegister cr_reg, Register mark_addr, Register temp_reg, Label& done); - void compiler_fast_lock_object( ConditionRegister flag, Register oop, Register box, Register tmp1, Register tmp2, Register tmp3); - void compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, Register tmp1, Register tmp2, Register tmp3); + void atomic_inc_ptr(Register addr, Register result, int simm16 = 1); + void atomic_ori_int(Register addr, Register result, int uimm16); + +#if INCLUDE_RTM_OPT + void rtm_counters_update(Register abort_status, Register rtm_counters); + void branch_on_random_using_tb(Register tmp, int count, Label& brLabel); + void rtm_abort_ratio_calculation(Register rtm_counters_reg, RTMLockingCounters* rtm_counters, + Metadata* method_data); + void rtm_profiling(Register abort_status_Reg, Register temp_Reg, + RTMLockingCounters* rtm_counters, Metadata* method_data, bool profile_rtm); + void rtm_retry_lock_on_abort(Register retry_count, Register abort_status, + Label& retryLabel, Label* checkRetry = NULL); + void rtm_retry_lock_on_busy(Register retry_count, Register owner_addr, Label& retryLabel); + void rtm_stack_locking(ConditionRegister flag, Register obj, Register mark_word, Register tmp, + Register retry_on_abort_count, + RTMLockingCounters* stack_rtm_counters, + Metadata* method_data, bool profile_rtm, + Label& DONE_LABEL, Label& IsInflated); + void rtm_inflated_locking(ConditionRegister flag, Register obj, Register mark_word, Register box, + Register retry_on_busy_count, Register retry_on_abort_count, + RTMLockingCounters* rtm_counters, + Metadata* method_data, bool profile_rtm, + Label& DONE_LABEL); +#endif + + void compiler_fast_lock_object(ConditionRegister flag, Register oop, Register box, + Register tmp1, Register tmp2, Register tmp3, + bool try_bias = UseBiasedLocking, + RTMLockingCounters* rtm_counters = NULL, + RTMLockingCounters* stack_rtm_counters = NULL, + Metadata* method_data = NULL, + bool use_rtm = false, bool profile_rtm = false); + + void compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, + Register tmp1, Register tmp2, Register tmp3, + bool try_bias = UseBiasedLocking, bool use_rtm = false); // Support for serializing memory accesses between threads void serialize_memory(Register thread, Register tmp1, Register tmp2); @@ -576,7 +611,7 @@ class MacroAssembler: public Assembler { Register tmp = noreg); // Null allowed. - inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg); + inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg, Label *is_null = NULL); // Encode/decode heap oop. Oop may not be null, else en/decoding goes wrong. // src == d allowed. @@ -593,7 +628,7 @@ class MacroAssembler: public Assembler { void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified. static int instr_size_for_decode_klass_not_null(); void decode_klass_not_null(Register dst, Register src = noreg); - void encode_klass_not_null(Register dst, Register src = noreg); + Register encode_klass_not_null(Register dst, Register src = noreg); // Load common heap base into register. void reinit_heapbase(Register d, Register tmp = noreg); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp index f5d19dff066..a52931d860d 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -333,19 +333,29 @@ inline void MacroAssembler::store_heap_oop_not_null(Register d, RegisterOrConsta } } -inline void MacroAssembler::load_heap_oop(Register d, RegisterOrConstant offs, Register s1) { +inline void MacroAssembler::load_heap_oop(Register d, RegisterOrConstant offs, Register s1, Label *is_null) { if (UseCompressedOops) { lwz(d, offs, s1); - decode_heap_oop(d); + if (is_null != NULL) { + cmpwi(CCR0, d, 0); + beq(CCR0, *is_null); + decode_heap_oop_not_null(d); + } else { + decode_heap_oop(d); + } } else { ld(d, offs, s1); + if (is_null != NULL) { + cmpdi(CCR0, d, 0); + beq(CCR0, *is_null); + } } } inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register src) { Register current = (src != noreg) ? src : d; // Oop to be compressed is in d if no src provided. if (Universe::narrow_oop_base_overlaps()) { - sub(d, current, R30); + sub_const_optimized(d, current, Universe::narrow_oop_base(), R0); current = d; } if (Universe::narrow_oop_shift() != 0) { @@ -358,7 +368,7 @@ inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register sr inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register src) { if (Universe::narrow_oop_base_disjoint() && src != noreg && src != d && Universe::narrow_oop_shift() != 0) { - mr(d, R30); + load_const_optimized(d, Universe::narrow_oop_base(), R0); rldimi(d, src, Universe::narrow_oop_shift(), 32-Universe::narrow_oop_shift()); return d; } @@ -369,7 +379,7 @@ inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register sr current = d; } if (Universe::narrow_oop_base() != NULL) { - add(d, current, R30); + add_const_optimized(d, current, Universe::narrow_oop_base(), R0); current = d; } return current; // Decoded oop is in this register. @@ -377,11 +387,19 @@ inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register sr inline void MacroAssembler::decode_heap_oop(Register d) { Label isNull; + bool use_isel = false; if (Universe::narrow_oop_base() != NULL) { cmpwi(CCR0, d, 0); - beq(CCR0, isNull); + if (VM_Version::has_isel()) { + use_isel = true; + } else { + beq(CCR0, isNull); + } } decode_heap_oop_not_null(d); + if (use_isel) { + isel_0(d, CCR0, Assembler::equal); + } bind(isNull); } diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index 32b5c5c5a5b..1d2dea0cc02 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -466,7 +466,7 @@ void trace_method_handle_stub(const char* adaptername, strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23"; tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT, - adaptername, mh_reg_name, (intptr_t) mh, entry_sp); + adaptername, mh_reg_name, p2i(mh), p2i(entry_sp)); if (Verbose) { tty->print_cr("Registers:"); diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp index 640813e7d3e..63fd6070272 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,6 @@ // These definitions are inlined into class MethodHandles. // Adapters -//static unsigned int adapter_code_size() { -// return 32*K DEBUG_ONLY(+ 16*K) + (TraceMethodHandles ? 16*K : 0) + (VerifyMethodHandles ? 32*K : 0); -//} enum /* platform_dependent_constants */ { adapter_code_size = NOT_LP64(16000 DEBUG_ONLY(+ 25000)) LP64_ONLY(32000 DEBUG_ONLY(+ 150000)) }; @@ -45,7 +42,9 @@ public: static void verify_method_handle(MacroAssembler* _masm, Register mh_reg, Register temp_reg, Register temp2_reg) { - Unimplemented(); + verify_klass(_masm, mh_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_invoke_MethodHandle), + temp_reg, temp2_reg, + "reference is a MH"); } static void verify_ref_kind(MacroAssembler* _masm, int ref_kind, Register member_reg, Register temp) NOT_DEBUG_RETURN; diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 4c64d96a3e4..388b102ee11 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -447,8 +447,8 @@ reg_class bits32_reg_rw( R26, R27, R28, -/*R29*/ // global TOC -/*R30*/ // Narrow Oop Base +/*R29,*/ // global TOC + R30, R31 ); @@ -484,58 +484,11 @@ reg_class bits32_reg_ro( R26, R27, R28, -/*R29*/ -/*R30*/ // Narrow Oop Base +/*R29,*/ + R30, R31 ); -// Complement-required-in-pipeline operands for narrow oops. -reg_class bits32_reg_ro_not_complement ( -/*R0*/ // R0 - R1, // SP - R2, // TOC - R3, - R4, - R5, - R6, - R7, - R8, - R9, - R10, - R11, - R12, -/*R13,*/ // system thread id - R14, - R15, - R16, // R16_thread - R17, - R18, - R19, - R20, - R21, - R22, -/*R23, - R24, - R25, - R26, - R27, - R28,*/ -/*R29,*/ // TODO: let allocator handle TOC!! -/*R30,*/ - R31 -); - -// Complement-required-in-pipeline operands for narrow oops. -// See 64-bit declaration. -reg_class bits32_reg_ro_complement ( - R23, - R24, - R25, - R26, - R27, - R28 -); - reg_class rscratch1_bits32_reg(R11); reg_class rscratch2_bits32_reg(R12); reg_class rarg1_bits32_reg(R3); @@ -591,8 +544,8 @@ reg_class bits64_reg_rw( R26_H, R26, R27_H, R27, R28_H, R28, -/*R29_H, R29*/ -/*R30_H, R30*/ +/*R29_H, R29,*/ + R30_H, R30, R31_H, R31 ); @@ -629,8 +582,8 @@ reg_class bits64_reg_leaf_call( R26_H, R26, R27_H, R27, R28_H, R28, -/*R29_H, R29*/ -/*R30_H, R30*/ +/*R29_H, R29,*/ + R30_H, R30, R31_H, R31 ); @@ -667,8 +620,8 @@ reg_class bits64_constant_table_base( R26_H, R26, R27_H, R27, R28_H, R28, -/*R29_H, R29*/ -/*R30_H, R30*/ +/*R29_H, R29,*/ + R30_H, R30, R31_H, R31 ); @@ -704,64 +657,11 @@ reg_class bits64_reg_ro( R26_H, R26, R27_H, R27, R28_H, R28, -/*R29_H, R29*/ // TODO: let allocator handle TOC!! -/*R30_H, R30,*/ +/*R29_H, R29,*/ // TODO: let allocator handle TOC!! + R30_H, R30, R31_H, R31 ); -// Complement-required-in-pipeline operands. -reg_class bits64_reg_ro_not_complement ( -/*R0_H, R0*/ // R0 - R1_H, R1, // SP - R2_H, R2, // TOC - R3_H, R3, - R4_H, R4, - R5_H, R5, - R6_H, R6, - R7_H, R7, - R8_H, R8, - R9_H, R9, - R10_H, R10, - R11_H, R11, - R12_H, R12, -/*R13_H, R13*/ // system thread id - R14_H, R14, - R15_H, R15, - R16_H, R16, // R16_thread - R17_H, R17, - R18_H, R18, - R19_H, R19, - R20_H, R20, - R21_H, R21, - R22_H, R22, -/*R23_H, R23, - R24_H, R24, - R25_H, R25, - R26_H, R26, - R27_H, R27, - R28_H, R28,*/ -/*R29_H, R29*/ // TODO: let allocator handle TOC!! -/*R30_H, R30,*/ - R31_H, R31 -); - -// Complement-required-in-pipeline operands. -// This register mask is used for the trap instructions that implement -// the null checks on AIX. The trap instruction first computes the -// complement of the value it shall trap on. Because of this, the -// instruction can not be scheduled in the same cycle as an other -// instruction reading the normal value of the same register. So we -// force the value to check into 'bits64_reg_ro_not_complement' -// and then copy it to 'bits64_reg_ro_complement' for the trap. -reg_class bits64_reg_ro_complement ( - R23_H, R23, - R24_H, R24, - R25_H, R25, - R26_H, R26, - R27_H, R27, - R28_H, R28 -); - // ---------------------------- // Special Class for Condition Code Flags Register @@ -777,6 +677,17 @@ reg_class int_flags( CCR7 ); +reg_class int_flags_ro( + CCR0, + CCR1, + CCR2, + CCR3, + CCR4, + CCR5, + CCR6, + CCR7 +); + reg_class int_flags_CR0(CCR0); reg_class int_flags_CR1(CCR1); reg_class int_flags_CR6(CCR6); @@ -2876,7 +2787,7 @@ encode %{ // Use release_store for card-marking to ensure that previous // oop-stores are visible before the card-mark change. - enc_class enc_cms_card_mark(memory mem, iRegLdst releaseFieldAddr) %{ + enc_class enc_cms_card_mark(memory mem, iRegLdst releaseFieldAddr, flagsReg crx) %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); // FIXME: Implement this as a cmove and use a fixed condition code // register which is written on every transition to compiled code, @@ -2897,8 +2808,8 @@ encode %{ // Check CMSCollectorCardTableModRefBSExt::_requires_release and do the // StoreStore barrier conditionally. __ lwz(R0, 0, $releaseFieldAddr$$Register); - __ cmpwi(CCR0, R0, 0); - __ beq_predict_taken(CCR0, skip_storestore); + __ cmpwi($crx$$CondRegister, R0, 0); + __ beq_predict_taken($crx$$CondRegister, skip_storestore); #endif __ li(R0, 0); __ membar(Assembler::StoreStore); @@ -3108,7 +3019,7 @@ encode %{ nodes->push(n2); %} - enc_class enc_cmove_reg(iRegIdst dst, flagsReg crx, iRegIsrc src, cmpOp cmp) %{ + enc_class enc_cmove_reg(iRegIdst dst, flagsRegSrc crx, iRegIsrc src, cmpOp cmp) %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); MacroAssembler _masm(&cbuf); @@ -3123,7 +3034,7 @@ encode %{ __ bind(done); %} - enc_class enc_cmove_imm(iRegIdst dst, flagsReg crx, immI16 src, cmpOp cmp) %{ + enc_class enc_cmove_imm(iRegIdst dst, flagsRegSrc crx, immI16 src, cmpOp cmp) %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); MacroAssembler _masm(&cbuf); @@ -3269,7 +3180,7 @@ encode %{ __ bind(done); %} - enc_class enc_cmove_bso_stackSlotL(iRegLdst dst, flagsReg crx, stackSlotL mem ) %{ + enc_class enc_cmove_bso_stackSlotL(iRegLdst dst, flagsRegSrc crx, stackSlotL mem ) %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmove); MacroAssembler _masm(&cbuf); @@ -3281,7 +3192,7 @@ encode %{ __ bind(done); %} - enc_class enc_bc(flagsReg crx, cmpOp cmp, Label lbl) %{ + enc_class enc_bc(flagsRegSrc crx, cmpOp cmp, Label lbl) %{ // TODO: PPC port $archOpcode(ppc64Opcode_bc); MacroAssembler _masm(&cbuf); @@ -3309,7 +3220,7 @@ encode %{ l); %} - enc_class enc_bc_far(flagsReg crx, cmpOp cmp, Label lbl) %{ + enc_class enc_bc_far(flagsRegSrc crx, cmpOp cmp, Label lbl) %{ // The scheduler doesn't know about branch shortening, so we set the opcode // to ppc64Opcode_bc in order to hide this detail from the scheduler. // TODO: PPC port $archOpcode(ppc64Opcode_bc); @@ -3341,7 +3252,7 @@ encode %{ %} // Branch used with Power6 scheduling (can be shortened without changing the node). - enc_class enc_bc_short_far(flagsReg crx, cmpOp cmp, Label lbl) %{ + enc_class enc_bc_short_far(flagsRegSrc crx, cmpOp cmp, Label lbl) %{ // The scheduler doesn't know about branch shortening, so we set the opcode // to ppc64Opcode_bc in order to hide this detail from the scheduler. // TODO: PPC port $archOpcode(ppc64Opcode_bc); @@ -4700,6 +4611,15 @@ operand flagsReg() %{ interface(REG_INTER); %} +operand flagsRegSrc() %{ + constraint(ALLOC_IN_RC(int_flags_ro)); + match(RegFlags); + match(flagsReg); + match(flagsRegCR0); + format %{ %} + interface(REG_INTER); +%} + // Condition Code Flag Register CR0 operand flagsRegCR0() %{ constraint(ALLOC_IN_RC(int_flags_CR0)); @@ -4783,6 +4703,13 @@ operand iRegN2P(iRegNsrc reg) %{ predicate(false /* TODO: PPC port MatchDecodeNodes*/); constraint(ALLOC_IN_RC(bits32_reg_ro)); match(DecodeN reg); + format %{ "$reg" %} + interface(REG_INTER) +%} + +operand iRegN2P_klass(iRegNsrc reg) %{ + predicate(Universe::narrow_klass_base() == NULL && Universe::narrow_klass_shift() == 0); + constraint(ALLOC_IN_RC(bits32_reg_ro)); match(DecodeNKlass reg); format %{ "$reg" %} interface(REG_INTER) @@ -4839,6 +4766,19 @@ operand indirectNarrow(iRegNsrc reg) %{ predicate(false /* TODO: PPC port MatchDecodeNodes*/); constraint(ALLOC_IN_RC(bits64_reg_ro)); match(DecodeN reg); + op_cost(100); + format %{ "[$reg]" %} + interface(MEMORY_INTER) %{ + base($reg); + index(0x0); + scale(0x0); + disp(0x0); + %} +%} + +operand indirectNarrow_klass(iRegNsrc reg) %{ + predicate(Universe::narrow_klass_base() == NULL && Universe::narrow_klass_shift() == 0); + constraint(ALLOC_IN_RC(bits64_reg_ro)); match(DecodeNKlass reg); op_cost(100); format %{ "[$reg]" %} @@ -4855,6 +4795,19 @@ operand indOffset16Narrow(iRegNsrc reg, immL16 offset) %{ predicate(false /* TODO: PPC port MatchDecodeNodes*/); constraint(ALLOC_IN_RC(bits64_reg_ro)); match(AddP (DecodeN reg) offset); + op_cost(100); + format %{ "[$reg + $offset]" %} + interface(MEMORY_INTER) %{ + base($reg); + index(0x0); + scale(0x0); + disp($offset); + %} +%} + +operand indOffset16Narrow_klass(iRegNsrc reg, immL16 offset) %{ + predicate(Universe::narrow_klass_base() == NULL && Universe::narrow_klass_shift() == 0); + constraint(ALLOC_IN_RC(bits64_reg_ro)); match(AddP (DecodeNKlass reg) offset); op_cost(100); format %{ "[$reg + $offset]" %} @@ -4871,6 +4824,19 @@ operand indOffset16NarrowAlg4(iRegNsrc reg, immL16Alg4 offset) %{ predicate(false /* TODO: PPC port MatchDecodeNodes*/); constraint(ALLOC_IN_RC(bits64_reg_ro)); match(AddP (DecodeN reg) offset); + op_cost(100); + format %{ "[$reg + $offset]" %} + interface(MEMORY_INTER) %{ + base($reg); + index(0x0); + scale(0x0); + disp($offset); + %} +%} + +operand indOffset16NarrowAlg4_klass(iRegNsrc reg, immL16Alg4 offset) %{ + predicate(Universe::narrow_klass_base() == NULL && Universe::narrow_klass_shift() == 0); + constraint(ALLOC_IN_RC(bits64_reg_ro)); match(AddP (DecodeNKlass reg) offset); op_cost(100); format %{ "[$reg + $offset]" %} @@ -4998,9 +4964,9 @@ operand cmpOp() %{ // encoding and format. The classic case of this is memory operands. // Indirect is not included since its use is limited to Compare & Swap. -opclass memory(indirect, indOffset16 /*, indIndex, tlsReference*/, indirectNarrow, indOffset16Narrow); +opclass memory(indirect, indOffset16 /*, indIndex, tlsReference*/, indirectNarrow, indirectNarrow_klass, indOffset16Narrow, indOffset16Narrow_klass); // Memory operand where offsets are 4-aligned. Required for ld, std. -opclass memoryAlg4(indirect, indOffset16Alg4, indirectNarrow, indOffset16NarrowAlg4); +opclass memoryAlg4(indirect, indOffset16Alg4, indirectNarrow, indOffset16NarrowAlg4, indOffset16NarrowAlg4_klass); opclass indirectMemory(indirect, indirectNarrow); // Special opclass for I and ConvL2I. @@ -5009,7 +4975,7 @@ opclass iRegIsrc_iRegL2Isrc(iRegIsrc, iRegL2Isrc); // Operand classes to match encode and decode. iRegN_P2N is only used // for storeN. I have never seen an encode node elsewhere. opclass iRegN_P2N(iRegNsrc, iRegP2N); -opclass iRegP_N2P(iRegPsrc, iRegN2P); +opclass iRegP_N2P(iRegPsrc, iRegN2P, iRegN2P_klass); //----------PIPELINE----------------------------------------------------------- @@ -5593,6 +5559,19 @@ instruct loadN2P_unscaled(iRegPdst dst, memory mem) %{ ins_pipe(pipe_class_memory); %} +instruct loadN2P_klass_unscaled(iRegPdst dst, memory mem) %{ + match(Set dst (DecodeNKlass (LoadNKlass mem))); + // SAPJVM GL 2014-05-21 Differs. + predicate(Universe::narrow_klass_base() == NULL && Universe::narrow_klass_shift() == 0 && + _kids[0]->_leaf->as_Load()->is_unordered()); + ins_cost(MEMORY_REF_COST); + + format %{ "LWZ $dst, $mem \t// DecodeN (unscaled)" %} + size(4); + ins_encode( enc_lwz(dst, mem) ); + ins_pipe(pipe_class_memory); +%} + // Load Pointer instruct loadP(iRegPdst dst, memoryAlg4 mem) %{ match(Set dst (LoadP mem)); @@ -5669,8 +5648,9 @@ instruct loadF(regF dst, memory mem) %{ %} // Load Float acquire. -instruct loadF_ac(regF dst, memory mem) %{ +instruct loadF_ac(regF dst, memory mem, flagsRegCR0 cr0) %{ match(Set dst (LoadF mem)); + effect(TEMP cr0); ins_cost(3*MEMORY_REF_COST); format %{ "LFS $dst, $mem \t// acquire\n\t" @@ -5705,8 +5685,9 @@ instruct loadD(regD dst, memory mem) %{ %} // Load Double - aligned acquire. -instruct loadD_ac(regD dst, memory mem) %{ +instruct loadD_ac(regD dst, memory mem, flagsRegCR0 cr0) %{ match(Set dst (LoadD mem)); + effect(TEMP cr0); ins_cost(3*MEMORY_REF_COST); format %{ "LFD $dst, $mem \t// acquire\n\t" @@ -6034,11 +6015,10 @@ instruct clearMs32b(iRegNdst dst, iRegNsrc src) %{ instruct loadBase(iRegLdst dst) %{ effect(DEF dst); - format %{ "MR $dst, r30_heapbase" %} - size(4); + format %{ "LoadConst $dst, heapbase" %} ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_or); - __ mr($dst$$Register, R30); + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ load_const_optimized($dst$$Register, Universe::narrow_oop_base(), R0); %} ins_pipe(pipe_class_default); %} @@ -6114,7 +6094,7 @@ instruct loadConNKlass_lo(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{ effect(TEMP src2); ins_cost(DEFAULT_COST); - format %{ "ORI $dst, $src1, $src2 \t// narrow klass lo" %} + format %{ "ORI $dst, $src1, $src2 \t// narrow klass lo" %} size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_ori); @@ -6563,8 +6543,9 @@ instruct storeD(memory mem, regD src) %{ // do a releasing store. For this, it gets the address of // CMSCollectorCardTableModRefBSExt::_requires_release as input. // (Using releaseFieldAddr in the match rule is a hack.) -instruct storeCM_CMS(memory mem, iRegLdst releaseFieldAddr) %{ +instruct storeCM_CMS(memory mem, iRegLdst releaseFieldAddr, flagsReg crx) %{ match(Set mem (StoreCM mem releaseFieldAddr)); + effect(TEMP crx); predicate(false); ins_cost(MEMORY_REF_COST); @@ -6572,7 +6553,7 @@ instruct storeCM_CMS(memory mem, iRegLdst releaseFieldAddr) %{ ins_cannot_rematerialize(true); format %{ "STB #0, $mem \t// CMS card-mark byte (must be 0!), checking requires_release in [$releaseFieldAddr]" %} - ins_encode( enc_cms_card_mark(mem, releaseFieldAddr) ); + ins_encode( enc_cms_card_mark(mem, releaseFieldAddr, crx) ); ins_pipe(pipe_class_memory); %} @@ -6589,8 +6570,9 @@ instruct storeCM_CMS_ExEx(memory mem, immI_0 zero) %{ expand %{ immL baseImm %{ 0 /* TODO: PPC port (jlong)CMSCollectorCardTableModRefBSExt::requires_release_address() */ %} iRegLdst releaseFieldAddress; + flagsReg crx; loadConL_Ex(releaseFieldAddress, baseImm); - storeCM_CMS(mem, releaseFieldAddress); + storeCM_CMS(mem, releaseFieldAddress, crx); %} %} @@ -6639,39 +6621,34 @@ instruct encodeP_sub(iRegPdst dst, iRegPdst src) %{ predicate(false); format %{ "SUB $dst, $src, oop_base \t// encode" %} - size(4); ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_subf); - __ subf($dst$$Register, R30, $src$$Register); + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ sub_const_optimized($dst$$Register, $src$$Register, Universe::narrow_oop_base(), R0); %} ins_pipe(pipe_class_default); %} // Conditional sub base. -instruct cond_sub_base(iRegNdst dst, flagsReg crx, iRegPsrc src1) %{ +instruct cond_sub_base(iRegNdst dst, flagsRegSrc crx, iRegPsrc src1) %{ // The match rule is needed to make it a 'MachTypeNode'! match(Set dst (EncodeP (Binary crx src1))); predicate(false); - ins_variable_size_depending_on_alignment(true); - format %{ "BEQ $crx, done\n\t" - "SUB $dst, $src1, R30 \t// encode: subtract base if != NULL\n" + "SUB $dst, $src1, heapbase \t// encode: subtract base if != NULL\n" "done:" %} - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling())*/ ? 12 : 8); ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_cmove); + // TODO: PPC port $archOpcode(ppc64Opcode_compound); Label done; __ beq($crx$$CondRegister, done); - __ subf($dst$$Register, R30, $src1$$Register); - // TODO PPC port __ endgroup_if_needed(_size == 12); + __ sub_const_optimized($dst$$Register, $src1$$Register, Universe::narrow_oop_base(), R0); __ bind(done); %} ins_pipe(pipe_class_default); %} // Power 7 can use isel instruction -instruct cond_set_0_oop(iRegNdst dst, flagsReg crx, iRegPsrc src1) %{ +instruct cond_set_0_oop(iRegNdst dst, flagsRegSrc crx, iRegPsrc src1) %{ // The match rule is needed to make it a 'MachTypeNode'! match(Set dst (EncodeP (Binary crx src1))); predicate(false); @@ -6777,42 +6754,37 @@ instruct decodeN_add(iRegPdst dst, iRegPdst src) %{ match(Set dst (DecodeN src)); predicate(false); - format %{ "ADD $dst, $src, R30 \t// DecodeN, add oop base" %} - size(4); + format %{ "ADD $dst, $src, heapbase \t// DecodeN, add oop base" %} ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_add); - __ add($dst$$Register, $src$$Register, R30); + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ add_const_optimized($dst$$Register, $src$$Register, Universe::narrow_oop_base(), R0); %} ins_pipe(pipe_class_default); %} // conditianal add base for expand -instruct cond_add_base(iRegPdst dst, flagsReg crx, iRegPsrc src1) %{ +instruct cond_add_base(iRegPdst dst, flagsRegSrc crx, iRegPsrc src) %{ // The match rule is needed to make it a 'MachTypeNode'! // NOTICE that the rule is nonsense - we just have to make sure that: // - _matrule->_rChild->_opType == "DecodeN" (see InstructForm::captures_bottom_type() in formssel.cpp) // - we have to match 'crx' to avoid an "illegal USE of non-input: flagsReg crx" error in ADLC. - match(Set dst (DecodeN (Binary crx src1))); + match(Set dst (DecodeN (Binary crx src))); predicate(false); - ins_variable_size_depending_on_alignment(true); - format %{ "BEQ $crx, done\n\t" - "ADD $dst, $src1, R30 \t// DecodeN: add oop base if $src1 != NULL\n" + "ADD $dst, $src, heapbase \t// DecodeN: add oop base if $src != NULL\n" "done:" %} - size(false /* TODO: PPC PORT (InsertEndGroupPPC64 && Compile::current()->do_hb_scheduling()) */? 12 : 8); ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_cmove); + // TODO: PPC port $archOpcode(ppc64Opcode_compound); Label done; __ beq($crx$$CondRegister, done); - __ add($dst$$Register, $src1$$Register, R30); - // TODO PPC port __ endgroup_if_needed(_size == 12); + __ add_const_optimized($dst$$Register, $src$$Register, Universe::narrow_oop_base(), R0); __ bind(done); %} ins_pipe(pipe_class_default); %} -instruct cond_set_0_ptr(iRegPdst dst, flagsReg crx, iRegPsrc src1) %{ +instruct cond_set_0_ptr(iRegPdst dst, flagsRegSrc crx, iRegPsrc src1) %{ // The match rule is needed to make it a 'MachTypeNode'! // NOTICE that the rule is nonsense - we just have to make sure that: // - _matrule->_rChild->_opType == "DecodeN" (see InstructForm::captures_bottom_type() in formssel.cpp) @@ -6888,7 +6860,7 @@ instruct decodeN_Disjoint_notNull_Ex(iRegPdst dst, iRegNsrc src) %{ Universe::narrow_oop_base_disjoint()); ins_cost(DEFAULT_COST); - format %{ "MOV $dst, R30 \t\n" + format %{ "MOV $dst, heapbase \t\n" "RLDIMI $dst, $src, shift, 32-shift \t// decode with disjoint base" %} postalloc_expand %{ loadBaseNode *n1 = new loadBaseNode(); @@ -6946,7 +6918,7 @@ instruct decodeN_Disjoint_isel_Ex(iRegPdst dst, iRegNsrc src, flagsReg crx) %{ assert(ra_->is_oop(this) == true, "A decodeN node must produce an oop!"); ra_->set_oop(n_cond_set, true); - + ra_->set_pair(n1->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx)); ra_->set_pair(n2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); @@ -7303,7 +7275,7 @@ instruct membar_CPUOrder() %{ //----------Conditional Move--------------------------------------------------- // Cmove using isel. -instruct cmovI_reg_isel(cmpOp cmp, flagsReg crx, iRegIdst dst, iRegIsrc src) %{ +instruct cmovI_reg_isel(cmpOp cmp, flagsRegSrc crx, iRegIdst dst, iRegIsrc src) %{ match(Set dst (CMoveI (Binary cmp crx) (Binary dst src))); predicate(VM_Version::has_isel()); ins_cost(DEFAULT_COST); @@ -7321,7 +7293,7 @@ instruct cmovI_reg_isel(cmpOp cmp, flagsReg crx, iRegIdst dst, iRegIsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovI_reg(cmpOp cmp, flagsReg crx, iRegIdst dst, iRegIsrc src) %{ +instruct cmovI_reg(cmpOp cmp, flagsRegSrc crx, iRegIdst dst, iRegIsrc src) %{ match(Set dst (CMoveI (Binary cmp crx) (Binary dst src))); predicate(!VM_Version::has_isel()); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7335,7 +7307,7 @@ instruct cmovI_reg(cmpOp cmp, flagsReg crx, iRegIdst dst, iRegIsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovI_imm(cmpOp cmp, flagsReg crx, iRegIdst dst, immI16 src) %{ +instruct cmovI_imm(cmpOp cmp, flagsRegSrc crx, iRegIdst dst, immI16 src) %{ match(Set dst (CMoveI (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7349,7 +7321,7 @@ instruct cmovI_imm(cmpOp cmp, flagsReg crx, iRegIdst dst, immI16 src) %{ %} // Cmove using isel. -instruct cmovL_reg_isel(cmpOp cmp, flagsReg crx, iRegLdst dst, iRegLsrc src) %{ +instruct cmovL_reg_isel(cmpOp cmp, flagsRegSrc crx, iRegLdst dst, iRegLsrc src) %{ match(Set dst (CMoveL (Binary cmp crx) (Binary dst src))); predicate(VM_Version::has_isel()); ins_cost(DEFAULT_COST); @@ -7367,7 +7339,7 @@ instruct cmovL_reg_isel(cmpOp cmp, flagsReg crx, iRegLdst dst, iRegLsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovL_reg(cmpOp cmp, flagsReg crx, iRegLdst dst, iRegLsrc src) %{ +instruct cmovL_reg(cmpOp cmp, flagsRegSrc crx, iRegLdst dst, iRegLsrc src) %{ match(Set dst (CMoveL (Binary cmp crx) (Binary dst src))); predicate(!VM_Version::has_isel()); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7381,7 +7353,7 @@ instruct cmovL_reg(cmpOp cmp, flagsReg crx, iRegLdst dst, iRegLsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovL_imm(cmpOp cmp, flagsReg crx, iRegLdst dst, immL16 src) %{ +instruct cmovL_imm(cmpOp cmp, flagsRegSrc crx, iRegLdst dst, immL16 src) %{ match(Set dst (CMoveL (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7395,7 +7367,7 @@ instruct cmovL_imm(cmpOp cmp, flagsReg crx, iRegLdst dst, immL16 src) %{ %} // Cmove using isel. -instruct cmovN_reg_isel(cmpOp cmp, flagsReg crx, iRegNdst dst, iRegNsrc src) %{ +instruct cmovN_reg_isel(cmpOp cmp, flagsRegSrc crx, iRegNdst dst, iRegNsrc src) %{ match(Set dst (CMoveN (Binary cmp crx) (Binary dst src))); predicate(VM_Version::has_isel()); ins_cost(DEFAULT_COST); @@ -7414,7 +7386,7 @@ instruct cmovN_reg_isel(cmpOp cmp, flagsReg crx, iRegNdst dst, iRegNsrc src) %{ %} // Conditional move for RegN. Only cmov(reg, reg). -instruct cmovN_reg(cmpOp cmp, flagsReg crx, iRegNdst dst, iRegNsrc src) %{ +instruct cmovN_reg(cmpOp cmp, flagsRegSrc crx, iRegNdst dst, iRegNsrc src) %{ match(Set dst (CMoveN (Binary cmp crx) (Binary dst src))); predicate(!VM_Version::has_isel()); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7428,7 +7400,7 @@ instruct cmovN_reg(cmpOp cmp, flagsReg crx, iRegNdst dst, iRegNsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovN_imm(cmpOp cmp, flagsReg crx, iRegNdst dst, immN_0 src) %{ +instruct cmovN_imm(cmpOp cmp, flagsRegSrc crx, iRegNdst dst, immN_0 src) %{ match(Set dst (CMoveN (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7442,7 +7414,7 @@ instruct cmovN_imm(cmpOp cmp, flagsReg crx, iRegNdst dst, immN_0 src) %{ %} // Cmove using isel. -instruct cmovP_reg_isel(cmpOp cmp, flagsReg crx, iRegPdst dst, iRegPsrc src) %{ +instruct cmovP_reg_isel(cmpOp cmp, flagsRegSrc crx, iRegPdst dst, iRegPsrc src) %{ match(Set dst (CMoveP (Binary cmp crx) (Binary dst src))); predicate(VM_Version::has_isel()); ins_cost(DEFAULT_COST); @@ -7460,7 +7432,7 @@ instruct cmovP_reg_isel(cmpOp cmp, flagsReg crx, iRegPdst dst, iRegPsrc src) %{ ins_pipe(pipe_class_default); %} -instruct cmovP_reg(cmpOp cmp, flagsReg crx, iRegPdst dst, iRegP_N2P src) %{ +instruct cmovP_reg(cmpOp cmp, flagsRegSrc crx, iRegPdst dst, iRegP_N2P src) %{ match(Set dst (CMoveP (Binary cmp crx) (Binary dst src))); predicate(!VM_Version::has_isel()); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7474,7 +7446,7 @@ instruct cmovP_reg(cmpOp cmp, flagsReg crx, iRegPdst dst, iRegP_N2P src) %{ ins_pipe(pipe_class_default); %} -instruct cmovP_imm(cmpOp cmp, flagsReg crx, iRegPdst dst, immP_0 src) %{ +instruct cmovP_imm(cmpOp cmp, flagsRegSrc crx, iRegPdst dst, immP_0 src) %{ match(Set dst (CMoveP (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7487,7 +7459,7 @@ instruct cmovP_imm(cmpOp cmp, flagsReg crx, iRegPdst dst, immP_0 src) %{ ins_pipe(pipe_class_default); %} -instruct cmovF_reg(cmpOp cmp, flagsReg crx, regF dst, regF src) %{ +instruct cmovF_reg(cmpOp cmp, flagsRegSrc crx, regF dst, regF src) %{ match(Set dst (CMoveF (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7509,7 +7481,7 @@ instruct cmovF_reg(cmpOp cmp, flagsReg crx, regF dst, regF src) %{ ins_pipe(pipe_class_default); %} -instruct cmovD_reg(cmpOp cmp, flagsReg crx, regD dst, regD src) %{ +instruct cmovD_reg(cmpOp cmp, flagsRegSrc crx, regD dst, regD src) %{ match(Set dst (CMoveD (Binary cmp crx) (Binary dst src))); ins_cost(DEFAULT_COST+BRANCH_COST); @@ -7542,8 +7514,9 @@ instruct cmovD_reg(cmpOp cmp, flagsReg crx, regD dst, regD src) %{ // Mem_ptr must be a memory operand, else this node does not get // Flag_needs_anti_dependence_check set by adlc. If this is not set this node // can be rematerialized which leads to errors. -instruct storeLConditional_regP_regL_regL(flagsReg crx, indirect mem_ptr, iRegLsrc oldVal, iRegLsrc newVal) %{ +instruct storeLConditional_regP_regL_regL(flagsReg crx, indirect mem_ptr, iRegLsrc oldVal, iRegLsrc newVal, flagsRegCR0 cr0) %{ match(Set crx (StoreLConditional mem_ptr (Binary oldVal newVal))); + effect(TEMP cr0); format %{ "CMPXCHGD if ($crx = ($oldVal == *$mem_ptr)) *mem_ptr = $newVal; as bool" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); @@ -7560,16 +7533,16 @@ instruct storeLConditional_regP_regL_regL(flagsReg crx, indirect mem_ptr, iRegLs // Mem_ptr must be a memory operand, else this node does not get // Flag_needs_anti_dependence_check set by adlc. If this is not set this node // can be rematerialized which leads to errors. -instruct storePConditional_regP_regP_regP(flagsReg crx, indirect mem_ptr, iRegPsrc oldVal, iRegPsrc newVal) %{ - match(Set crx (StorePConditional mem_ptr (Binary oldVal newVal))); - format %{ "CMPXCHGD if ($crx = ($oldVal == *$mem_ptr)) *mem_ptr = $newVal; as bool" %} +instruct storePConditional_regP_regP_regP(flagsRegCR0 cr0, indirect mem_ptr, iRegPsrc oldVal, iRegPsrc newVal) %{ + match(Set cr0 (StorePConditional mem_ptr (Binary oldVal newVal))); + ins_cost(2*MEMORY_REF_COST); + + format %{ "STDCX_ if ($cr0 = ($oldVal == *$mem_ptr)) *mem_ptr = $newVal; as bool" %} ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_compound); - __ cmpxchgd($crx$$CondRegister, R0, $oldVal$$Register, $newVal$$Register, $mem_ptr$$Register, - MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), - noreg, NULL, true); + // TODO: PPC port $archOpcode(ppc64Opcode_stdcx_); + __ stdcx_($newVal$$Register, $mem_ptr$$Register); %} - ins_pipe(pipe_class_default); + ins_pipe(pipe_class_memory); %} // Implement LoadPLocked. Must be ordered against changes of the memory location @@ -7577,13 +7550,14 @@ instruct storePConditional_regP_regP_regP(flagsReg crx, indirect mem_ptr, iRegPs // Don't know whether this is ever used. instruct loadPLocked(iRegPdst dst, memory mem) %{ match(Set dst (LoadPLocked mem)); - ins_cost(MEMORY_REF_COST); + ins_cost(2*MEMORY_REF_COST); - format %{ "LD $dst, $mem \t// loadPLocked\n\t" - "TWI $dst\n\t" - "ISYNC" %} - size(12); - ins_encode( enc_ld_ac(dst, mem) ); + format %{ "LDARX $dst, $mem \t// loadPLocked\n\t" %} + size(4); + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_ldarx); + __ ldarx($dst$$Register, $mem$$Register, MacroAssembler::cmpxchgx_hint_atomic_update()); + %} ins_pipe(pipe_class_memory); %} @@ -7593,8 +7567,9 @@ instruct loadPLocked(iRegPdst dst, memory mem) %{ // (CompareAndSwap ...)" or "If (CmpI (CompareAndSwap ..))" cannot be // matched. -instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src1, iRegIsrc src2) %{ +instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src1, iRegIsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndSwapI mem_ptr (Binary src1 src2))); + effect(TEMP cr0); format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode %{ @@ -7607,8 +7582,9 @@ instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc ins_pipe(pipe_class_default); %} -instruct compareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2) %{ +instruct compareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc src1, iRegNsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndSwapN mem_ptr (Binary src1 src2))); + effect(TEMP cr0); format %{ "CMPXCHGW $res, $mem_ptr, $src1, $src2; as bool" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode %{ @@ -7621,8 +7597,9 @@ instruct compareAndSwapN_regP_regN_regN(iRegIdst res, iRegPdst mem_ptr, iRegNsrc ins_pipe(pipe_class_default); %} -instruct compareAndSwapL_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr, iRegLsrc src1, iRegLsrc src2) %{ +instruct compareAndSwapL_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr, iRegLsrc src1, iRegLsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndSwapL mem_ptr (Binary src1 src2))); + effect(TEMP cr0); format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode %{ @@ -7635,8 +7612,9 @@ instruct compareAndSwapL_regP_regL_regL(iRegIdst res, iRegPdst mem_ptr, iRegLsrc ins_pipe(pipe_class_default); %} -instruct compareAndSwapP_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr, iRegPsrc src1, iRegPsrc src2) %{ +instruct compareAndSwapP_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr, iRegPsrc src1, iRegPsrc src2, flagsRegCR0 cr0) %{ match(Set res (CompareAndSwapP mem_ptr (Binary src1 src2))); + effect(TEMP cr0); format %{ "CMPXCHGD $res, $mem_ptr, $src1, $src2; as bool; ptr" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode %{ @@ -7649,48 +7627,54 @@ instruct compareAndSwapP_regP_regP_regP(iRegIdst res, iRegPdst mem_ptr, iRegPsrc ins_pipe(pipe_class_default); %} -instruct getAndAddI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src) %{ +instruct getAndAddI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndAddI mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndAddI $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndAddI(res, mem_ptr, src) ); ins_pipe(pipe_class_default); %} -instruct getAndAddL(iRegLdst res, iRegPdst mem_ptr, iRegLsrc src) %{ +instruct getAndAddL(iRegLdst res, iRegPdst mem_ptr, iRegLsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndAddL mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndAddL $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndAddL(res, mem_ptr, src) ); ins_pipe(pipe_class_default); %} -instruct getAndSetI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src) %{ +instruct getAndSetI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndSetI mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndSetI $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndSetI(res, mem_ptr, src) ); ins_pipe(pipe_class_default); %} -instruct getAndSetL(iRegLdst res, iRegPdst mem_ptr, iRegLsrc src) %{ +instruct getAndSetL(iRegLdst res, iRegPdst mem_ptr, iRegLsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndSetL mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndSetL $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndSetL(res, mem_ptr, src) ); ins_pipe(pipe_class_default); %} -instruct getAndSetP(iRegPdst res, iRegPdst mem_ptr, iRegPsrc src) %{ +instruct getAndSetP(iRegPdst res, iRegPdst mem_ptr, iRegPsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndSetP mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndSetP $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndSetL(res, mem_ptr, src) ); ins_pipe(pipe_class_default); %} -instruct getAndSetN(iRegNdst res, iRegPdst mem_ptr, iRegNsrc src) %{ +instruct getAndSetN(iRegNdst res, iRegPdst mem_ptr, iRegNsrc src, flagsRegCR0 cr0) %{ match(Set res (GetAndSetN mem_ptr src)); + effect(TEMP cr0); format %{ "GetAndSetN $res, $mem_ptr, $src" %} // Variable size: instruction count smaller if regs are disjoint. ins_encode( enc_GetAndSetI(res, mem_ptr, src) ); @@ -7898,18 +7882,8 @@ instruct subI_reg_reg(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{ %} // Immediate Subtraction -// The compiler converts "x-c0" into "x+ -c0" (see SubINode::Ideal), -// so this rule seems to be unused. -instruct subI_reg_imm16(iRegIdst dst, iRegIsrc src1, immI16 src2) %{ - match(Set dst (SubI src1 src2)); - format %{ "SUBI $dst, $src1, $src2" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_addi); - __ addi($dst$$Register, $src1$$Register, ($src2$$constant) * (-1)); - %} - ins_pipe(pipe_class_default); -%} +// Immediate Subtraction: The compiler converts "x-c0" into "x+ -c0" (see SubLNode::Ideal), +// Don't try to use addi with - $src2$$constant since it can overflow when $src2$$constant == minI16. // SubI from constant (using subfic). instruct subI_imm16_reg(iRegIdst dst, immI16 src1, iRegIsrc src2) %{ @@ -7989,22 +7963,6 @@ instruct subI_regL_regL(iRegIdst dst, iRegLsrc src1, iRegLsrc src2) %{ ins_pipe(pipe_class_default); %} -// Immediate Subtraction -// The compiler converts "x-c0" into "x+ -c0" (see SubLNode::Ideal), -// so this rule seems to be unused. -// No constant pool entries required. -instruct subL_reg_imm16(iRegLdst dst, iRegLsrc src1, immL16 src2) %{ - match(Set dst (SubL src1 src2)); - - format %{ "SUBI $dst, $src1, $src2 \t// long" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_addi); - __ addi($dst$$Register, $src1$$Register, ($src2$$constant) * (-1)); - %} - ins_pipe(pipe_class_default); -%} - // Turn the sign-bit of a long into a 64-bit mask, 0x0...0 for // positive longs and 0xF...F for negative ones. instruct signmask64I_regL(iRegIdst dst, iRegLsrc src) %{ @@ -8165,7 +8123,7 @@ instruct divI_reg_regnotMinus1(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{ ins_pipe(pipe_class_default); %} -instruct cmovI_bne_negI_reg(iRegIdst dst, flagsReg crx, iRegIsrc src1) %{ +instruct cmovI_bne_negI_reg(iRegIdst dst, flagsRegSrc crx, iRegIsrc src1) %{ effect(USE_DEF dst, USE src1, USE crx); predicate(false); @@ -8228,7 +8186,7 @@ instruct divL_reg_regnotMinus1(iRegLdst dst, iRegLsrc src1, iRegLsrc src2) %{ ins_pipe(pipe_class_default); %} -instruct cmovL_bne_negL_reg(iRegLdst dst, flagsReg crx, iRegLsrc src1) %{ +instruct cmovL_bne_negL_reg(iRegLdst dst, flagsRegSrc crx, iRegLsrc src1) %{ effect(USE_DEF dst, USE src1, USE crx); predicate(false); @@ -8281,7 +8239,7 @@ instruct modI_reg_reg_Ex(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{ %} // Long Remainder with registers -instruct modL_reg_reg_Ex(iRegLdst dst, iRegLsrc src1, iRegLsrc src2, flagsRegCR0 cr0) %{ +instruct modL_reg_reg_Ex(iRegLdst dst, iRegLsrc src1, iRegLsrc src2) %{ match(Set dst (ModL src1 src2)); ins_cost(10*DEFAULT_COST); @@ -9011,7 +8969,6 @@ instruct andL_reg_reg(iRegLdst dst, iRegLsrc src1, iRegLsrc src2) %{ instruct andL_reg_uimm16(iRegLdst dst, iRegLsrc src1, uimmL16 src2, flagsRegCR0 cr0) %{ match(Set dst (AndL src1 src2)); effect(KILL cr0); - ins_cost(DEFAULT_COST); format %{ "ANDI $dst, $src1, $src2 \t// long" %} size(4); @@ -9803,7 +9760,7 @@ instruct convD2IRaw_regD(regD dst, regD src) %{ ins_pipe(pipe_class_default); %} -instruct cmovI_bso_stackSlotL(iRegIdst dst, flagsReg crx, stackSlotL src) %{ +instruct cmovI_bso_stackSlotL(iRegIdst dst, flagsRegSrc crx, stackSlotL src) %{ // no match-rule, false predicate effect(DEF dst, USE crx, USE src); predicate(false); @@ -9817,7 +9774,7 @@ instruct cmovI_bso_stackSlotL(iRegIdst dst, flagsReg crx, stackSlotL src) %{ ins_pipe(pipe_class_default); %} -instruct cmovI_bso_stackSlotL_conLvalue0_Ex(iRegIdst dst, flagsReg crx, stackSlotL mem) %{ +instruct cmovI_bso_stackSlotL_conLvalue0_Ex(iRegIdst dst, flagsRegSrc crx, stackSlotL mem) %{ // no match-rule, false predicate effect(DEF dst, USE crx, USE mem); predicate(false); @@ -9972,7 +9929,7 @@ instruct convF2LRaw_regF(regF dst, regF src) %{ ins_pipe(pipe_class_default); %} -instruct cmovL_bso_stackSlotL(iRegLdst dst, flagsReg crx, stackSlotL src) %{ +instruct cmovL_bso_stackSlotL(iRegLdst dst, flagsRegSrc crx, stackSlotL src) %{ // no match-rule, false predicate effect(DEF dst, USE crx, USE src); predicate(false); @@ -9986,7 +9943,7 @@ instruct cmovL_bso_stackSlotL(iRegLdst dst, flagsReg crx, stackSlotL src) %{ ins_pipe(pipe_class_default); %} -instruct cmovL_bso_stackSlotL_conLvalue0_Ex(iRegLdst dst, flagsReg crx, stackSlotL mem) %{ +instruct cmovL_bso_stackSlotL_conLvalue0_Ex(iRegLdst dst, flagsRegSrc crx, stackSlotL mem) %{ // no match-rule, false predicate effect(DEF dst, USE crx, USE mem); predicate(false); @@ -10255,7 +10212,6 @@ instruct testI_reg_imm(flagsRegCR0 cr0, iRegIsrc src1, uimmI16 src2, immI_0 zero size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_andi_); - // FIXME: avoid andi_ ? __ andi_(R0, $src1$$Register, $src2$$constant); %} ins_pipe(pipe_class_compare); @@ -10302,13 +10258,12 @@ instruct testL_reg_imm(flagsRegCR0 cr0, iRegLsrc src1, uimmL16 src2, immL_0 zero size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_andi_); - // FIXME: avoid andi_ ? __ andi_(R0, $src1$$Register, $src2$$constant); %} ins_pipe(pipe_class_compare); %} -instruct cmovI_conIvalueMinus1_conIvalue1(iRegIdst dst, flagsReg crx) %{ +instruct cmovI_conIvalueMinus1_conIvalue1(iRegIdst dst, flagsRegSrc crx) %{ // no match-rule, false predicate effect(DEF dst, USE crx); predicate(false); @@ -10332,7 +10287,7 @@ instruct cmovI_conIvalueMinus1_conIvalue1(iRegIdst dst, flagsReg crx) %{ ins_pipe(pipe_class_compare); %} -instruct cmovI_conIvalueMinus1_conIvalue0_conIvalue1_Ex(iRegIdst dst, flagsReg crx) %{ +instruct cmovI_conIvalueMinus1_conIvalue0_conIvalue1_Ex(iRegIdst dst, flagsRegSrc crx) %{ // no match-rule, false predicate effect(DEF dst, USE crx); predicate(false); @@ -10622,8 +10577,9 @@ instruct cmpP_reg_imm16(flagsReg crx, iRegPsrc src1, immL16 src2) %{ //----------Float Compares---------------------------------------------------- instruct cmpFUnordered_reg_reg(flagsReg crx, regF src1, regF src2) %{ + // Needs matchrule, see cmpDUnordered. + match(Set crx (CmpF src1 src2)); // no match-rule, false predicate - effect(DEF crx, USE src1, USE src2); predicate(false); format %{ "cmpFUrd $crx, $src1, $src2" %} @@ -10731,8 +10687,14 @@ instruct cmpF3_reg_reg_ExEx(iRegIdst dst, regF src1, regF src2) %{ %} instruct cmpDUnordered_reg_reg(flagsReg crx, regD src1, regD src2) %{ - // no match-rule, false predicate - effect(DEF crx, USE src1, USE src2); + // Needs matchrule so that ideal opcode is Cmp. This causes that gcm places the + // node right before the conditional move using it. + // In jck test api/java_awt/geom/QuadCurve2DFloat/index.html#SetCurveTesttestCase7, + // compilation of java.awt.geom.RectangularShape::getBounds()Ljava/awt/Rectangle + // crashed in register allocation where the flags Reg between cmpDUnoredered and a + // conditional move was supposed to be spilled. + match(Set crx (CmpD src1 src2)); + // False predicate, shall not be matched. predicate(false); format %{ "cmpFUrd $crx, $src1, $src2" %} @@ -10830,7 +10792,7 @@ instruct branch(label labl) %{ %} // Conditional Near Branch -instruct branchCon(cmpOp cmp, flagsReg crx, label lbl) %{ +instruct branchCon(cmpOp cmp, flagsRegSrc crx, label lbl) %{ // Same match rule as `branchConFar'. match(If cmp crx); effect(USE lbl); @@ -10853,7 +10815,7 @@ instruct branchCon(cmpOp cmp, flagsReg crx, label lbl) %{ // expensive. // // Conditional Far Branch -instruct branchConFar(cmpOp cmp, flagsReg crx, label lbl) %{ +instruct branchConFar(cmpOp cmp, flagsRegSrc crx, label lbl) %{ // Same match rule as `branchCon'. match(If cmp crx); effect(USE crx, USE lbl); @@ -10871,7 +10833,7 @@ instruct branchConFar(cmpOp cmp, flagsReg crx, label lbl) %{ %} // Conditional Branch used with Power6 scheduler (can be far or short). -instruct branchConSched(cmpOp cmp, flagsReg crx, label lbl) %{ +instruct branchConSched(cmpOp cmp, flagsRegSrc crx, label lbl) %{ // Same match rule as `branchCon'. match(If cmp crx); effect(USE crx, USE lbl); @@ -10890,7 +10852,7 @@ instruct branchConSched(cmpOp cmp, flagsReg crx, label lbl) %{ ins_pipe(pipe_class_default); %} -instruct branchLoopEnd(cmpOp cmp, flagsReg crx, label labl) %{ +instruct branchLoopEnd(cmpOp cmp, flagsRegSrc crx, label labl) %{ match(CountedLoopEnd cmp crx); effect(USE labl); ins_cost(BRANCH_COST); @@ -10904,7 +10866,7 @@ instruct branchLoopEnd(cmpOp cmp, flagsReg crx, label labl) %{ ins_pipe(pipe_class_default); %} -instruct branchLoopEndFar(cmpOp cmp, flagsReg crx, label labl) %{ +instruct branchLoopEndFar(cmpOp cmp, flagsRegSrc crx, label labl) %{ match(CountedLoopEnd cmp crx); effect(USE labl); predicate(!false /* TODO: PPC port HB_Schedule */); @@ -10920,7 +10882,7 @@ instruct branchLoopEndFar(cmpOp cmp, flagsReg crx, label labl) %{ %} // Conditional Branch used with Power6 scheduler (can be far or short). -instruct branchLoopEndSched(cmpOp cmp, flagsReg crx, label labl) %{ +instruct branchLoopEndSched(cmpOp cmp, flagsRegSrc crx, label labl) %{ match(CountedLoopEnd cmp crx); effect(USE labl); predicate(false /* TODO: PPC port HB_Schedule */); @@ -10969,13 +10931,36 @@ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P supe instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ match(Set crx (FastLock oop box)); effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); - // TODO PPC port predicate(!UseNewFastLockPPC64 || UseBiasedLocking); + predicate(/*(!UseNewFastLockPPC64 || UseBiasedLocking) &&*/ !Compile::current()->use_rtm()); format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2, $tmp3" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register); + $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + UseBiasedLocking && !UseOptoBiasInlining); // SAPJVM MD 2014-11-06 UseOptoBiasInlining + // If locking was successfull, crx should indicate 'EQ'. + // The compiler generates a branch to the runtime call to + // _complete_monitor_locking_Java for the case where crx is 'NE'. + %} + ins_pipe(pipe_class_compare); +%} + +// Separate version for TM. Use bound register for box to enable USE_KILL. +instruct cmpFastLock_tm(flagsReg crx, iRegPdst oop, rarg2RegP box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ + match(Set crx (FastLock oop box)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, USE_KILL box); + predicate(Compile::current()->use_rtm()); + + format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2, $tmp3 (TM)" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, + $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + /*Biased Locking*/ false, + _rtm_counters, _stack_rtm_counters, + ((Method*)(ra_->C->method()->constant_encoding()))->method_data(), + /*TM*/ true, ra_->C->profile_rtm()); // If locking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to // _complete_monitor_locking_Java for the case where crx is 'NE'. @@ -10986,12 +10971,33 @@ instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iR instruct cmpFastUnlock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ match(Set crx (FastUnlock oop box)); effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + predicate(!Compile::current()->use_rtm()); format %{ "FASTUNLOCK $oop, $box, $tmp1, $tmp2" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register); + $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + UseBiasedLocking && !UseOptoBiasInlining, + false); + // If unlocking was successfull, crx should indicate 'EQ'. + // The compiler generates a branch to the runtime call to + // _complete_monitor_unlocking_Java for the case where crx is 'NE'. + %} + ins_pipe(pipe_class_compare); +%} + +instruct cmpFastUnlock_tm(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ + match(Set crx (FastUnlock oop box)); + effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + predicate(Compile::current()->use_rtm()); + + format %{ "FASTUNLOCK $oop, $box, $tmp1, $tmp2 (TM)" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, + $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + /*Biased Locking*/ false, /*TM*/ true); // If unlocking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to // _complete_monitor_unlocking_Java for the case where crx is 'NE'. @@ -11658,6 +11664,66 @@ instruct repl2F_immF0(iRegLdst dst, immF_0 zero) %{ ins_pipe(pipe_class_default); %} + +//----------Overflow Math Instructions----------------------------------------- + +// Note that we have to make sure that XER.SO is reset before using overflow instructions. +// Simple Overflow operations can be matched by very few instructions (e.g. addExact: xor, and_, bc). +// Seems like only Long intrinsincs have an advantage. (The only expensive one is OverflowMulL.) + +instruct overflowAddL_reg_reg(flagsRegCR0 cr0, iRegLsrc op1, iRegLsrc op2) %{ + match(Set cr0 (OverflowAddL op1 op2)); + + format %{ "add_ $op1, $op2\t# overflow check long" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ li(R0, 0); + __ mtxer(R0); // clear XER.SO + __ addo_(R0, $op1$$Register, $op2$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct overflowSubL_reg_reg(flagsRegCR0 cr0, iRegLsrc op1, iRegLsrc op2) %{ + match(Set cr0 (OverflowSubL op1 op2)); + + format %{ "subfo_ R0, $op2, $op1\t# overflow check long" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ li(R0, 0); + __ mtxer(R0); // clear XER.SO + __ subfo_(R0, $op2$$Register, $op1$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct overflowNegL_reg(flagsRegCR0 cr0, immL_0 zero, iRegLsrc op2) %{ + match(Set cr0 (OverflowSubL zero op2)); + + format %{ "nego_ R0, $op2\t# overflow check long" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ li(R0, 0); + __ mtxer(R0); // clear XER.SO + __ nego_(R0, $op2$$Register); + %} + ins_pipe(pipe_class_default); +%} + +instruct overflowMulL_reg_reg(flagsRegCR0 cr0, iRegLsrc op1, iRegLsrc op2) %{ + match(Set cr0 (OverflowMulL op1 op2)); + + format %{ "mulldo_ R0, $op1, $op2\t# overflow check long" %} + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_compound); + __ li(R0, 0); + __ mtxer(R0); // clear XER.SO + __ mulldo_(R0, $op1$$Register, $op2$$Register); + %} + ins_pipe(pipe_class_default); +%} + + // ============================================================================ // Safepoint Instruction diff --git a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp index a009ea06f77..6b002d2efd2 100644 --- a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,19 +23,10 @@ * */ -// make sure the defines don't screw up the declarations later on in this file +// Make sure the defines don't screw up the declarations later on in this file. #define DONT_USE_REGISTER_DEFINES -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" #include "asm/register.hpp" -#include "register_ppc.hpp" -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif REGISTER_DEFINITION(Register, noreg); diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp index 4f365a46a05..d163ebac6b9 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,12 @@ #include "precompiled.hpp" #include "asm/assembler.inline.hpp" -#include "assembler_ppc.inline.hpp" #include "code/relocInfo.hpp" #include "nativeInst_ppc.hpp" #include "oops/oop.inline.hpp" #include "runtime/safepoint.hpp" void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { - bool copy_back_to_oop_pool = true; // TODO: PPC port // The following comment is from the declaration of DataRelocation: // // "The "o" (displacement) argument is relevant only to split relocations diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 68dda7d3e2b..5519405dbcd 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "code/debugInfoRec.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" +#include "frame_ppc.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interp_masm.hpp" #include "oops/compiledICHolder.hpp" @@ -194,8 +195,8 @@ static const RegisterSaver::LiveRegType RegisterSaver_LiveRegs[] = { RegisterSaver_LiveIntReg( R27 ), RegisterSaver_LiveIntReg( R28 ), RegisterSaver_LiveIntReg( R29 ), - RegisterSaver_LiveIntReg( R31 ), - RegisterSaver_LiveIntReg( R30 ), // r30 must be the last register + RegisterSaver_LiveIntReg( R30 ), + RegisterSaver_LiveIntReg( R31 ), // must be the last register (see save/restore functions below) }; OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssembler* masm, @@ -229,29 +230,30 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble BLOCK_COMMENT("push_frame_reg_args_and_save_live_registers {"); - // Save r30 in the last slot of the not yet pushed frame so that we + // Save r31 in the last slot of the not yet pushed frame so that we // can use it as scratch reg. - __ std(R30, -reg_size, R1_SP); + __ std(R31, -reg_size, R1_SP); assert(-reg_size == register_save_offset - frame_size_in_bytes + ((regstosave_num-1)*reg_size), "consistency check"); // save the flags // Do the save_LR_CR by hand and adjust the return pc if requested. - __ mfcr(R30); - __ std(R30, _abi(cr), R1_SP); + __ mfcr(R31); + __ std(R31, _abi(cr), R1_SP); switch (return_pc_location) { - case return_pc_is_lr: __ mflr(R30); break; - case return_pc_is_r4: __ mr(R30, R4); break; + case return_pc_is_lr: __ mflr(R31); break; + case return_pc_is_r4: __ mr(R31, R4); break; case return_pc_is_thread_saved_exception_pc: - __ ld(R30, thread_(saved_exception_pc)); break; + __ ld(R31, thread_(saved_exception_pc)); break; default: ShouldNotReachHere(); } - if (return_pc_adjustment != 0) - __ addi(R30, R30, return_pc_adjustment); - __ std(R30, _abi(lr), R1_SP); + if (return_pc_adjustment != 0) { + __ addi(R31, R31, return_pc_adjustment); + } + __ std(R31, _abi(lr), R1_SP); // push a new frame - __ push_frame(frame_size_in_bytes, R30); + __ push_frame(frame_size_in_bytes, R31); // save all registers (ints and floats) offset = register_save_offset; @@ -261,7 +263,7 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble switch (reg_type) { case RegisterSaver::int_reg: { - if (reg_num != 30) { // We spilled R30 right at the beginning. + if (reg_num != 31) { // We spilled R31 right at the beginning. __ std(as_Register(reg_num), offset, R1_SP); } break; @@ -272,8 +274,8 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble } case RegisterSaver::special_reg: { if (reg_num == SR_CTR_SpecialRegisterEnumValue) { - __ mfctr(R30); - __ std(R30, offset, R1_SP); + __ mfctr(R31); + __ std(R31, offset, R1_SP); } else { Unimplemented(); } @@ -321,7 +323,7 @@ void RegisterSaver::restore_live_registers_and_pop_frame(MacroAssembler* masm, switch (reg_type) { case RegisterSaver::int_reg: { - if (reg_num != 30) // R30 restored at the end, it's the tmp reg! + if (reg_num != 31) // R31 restored at the end, it's the tmp reg! __ ld(as_Register(reg_num), offset, R1_SP); break; } @@ -332,8 +334,8 @@ void RegisterSaver::restore_live_registers_and_pop_frame(MacroAssembler* masm, case RegisterSaver::special_reg: { if (reg_num == SR_CTR_SpecialRegisterEnumValue) { if (restore_ctr) { // Nothing to do here if ctr already contains the next address. - __ ld(R30, offset, R1_SP); - __ mtctr(R30); + __ ld(R31, offset, R1_SP); + __ mtctr(R31); } } else { Unimplemented(); @@ -350,10 +352,10 @@ void RegisterSaver::restore_live_registers_and_pop_frame(MacroAssembler* masm, __ pop_frame(); // restore the flags - __ restore_LR_CR(R30); + __ restore_LR_CR(R31); // restore scratch register's value - __ ld(R30, -reg_size, R1_SP); + __ ld(R31, -reg_size, R1_SP); BLOCK_COMMENT("} restore_live_registers_and_pop_frame"); } @@ -2021,6 +2023,8 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, __ push_frame(frame_size_in_bytes, r_temp_1); // Push the c2n adapter's frame. frame_done_pc = (intptr_t)__ pc(); + __ verify_thread(); + // Native nmethod wrappers never take possesion of the oop arguments. // So the caller will gc the arguments. // The only thing we need an oopMap for is if the call is static. @@ -2594,7 +2598,7 @@ int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) } uint SharedRuntime::out_preserve_stack_slots() { -#ifdef COMPILER2 +#if defined(COMPILER1) || defined(COMPILER2) return frame::jit_out_preserve_size / VMRegImpl::stack_slot_size; #else return 0; @@ -2868,11 +2872,6 @@ void SharedRuntime::generate_deopt_blob() { __ std(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread); __ BIND(skip_restore_excp); - // reload narrro_oop_base - if (UseCompressedOops && Universe::narrow_oop_base() != 0) { - __ load_const_optimized(R30, Universe::narrow_oop_base()); - } - __ pop_frame(); // stack: (deoptee, optional i2c, caller of deoptee, ...). diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index c7a9d06627d..4ddf83ba943 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -261,9 +261,6 @@ class StubGenerator: public StubCodeGenerator { // global toc register __ load_const(R29, MacroAssembler::global_toc(), R11_scratch1); - // Load narrow oop base. - __ reinit_heapbase(R30, R11_scratch1); - // Remember the senderSP so we interpreter can pop c2i arguments off of the stack // when called via a c2i. @@ -418,6 +415,23 @@ class StubGenerator: public StubCodeGenerator { // or native call stub. The pending exception in Thread is // converted into a Java-level exception. // + // Read: + // + // LR: The pc the runtime library callee wants to return to. + // Since the exception occurred in the callee, the return pc + // from the point of view of Java is the exception pc. + // thread: Needed for method handles. + // + // Invalidate: + // + // volatile registers (except below). + // + // Update: + // + // R4_ARG2: exception + // + // (LR is unchanged and is live out). + // address generate_forward_exception() { StubCodeMark mark(this, "StubRoutines", "forward_exception"); address start = __ pc(); @@ -1256,9 +1270,9 @@ class StubGenerator: public StubCodeGenerator { Register tmp3 = R8_ARG6; #if defined(ABI_ELFv2) - address nooverlap_target = aligned ? - StubRoutines::arrayof_jbyte_disjoint_arraycopy() : - StubRoutines::jbyte_disjoint_arraycopy(); + address nooverlap_target = aligned ? + StubRoutines::arrayof_jbyte_disjoint_arraycopy() : + StubRoutines::jbyte_disjoint_arraycopy(); #else address nooverlap_target = aligned ? ((FunctionDescriptor*)StubRoutines::arrayof_jbyte_disjoint_arraycopy())->entry() : diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 432a96d8268..2789be2aa55 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -264,11 +264,11 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* __ cmpdi(CCR0, Rmdo, 0); __ beq(CCR0, no_mdo); - // Increment invocation counter in the MDO. - const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); - __ lwz(Rscratch2, mdo_ic_offs, Rmdo); + // Increment backedge counter in the MDO. + const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + __ lwz(Rscratch2, mdo_bc_offs, Rmdo); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mdo_ic_offs, Rmdo); + __ stw(Rscratch2, mdo_bc_offs, Rmdo); __ load_const_optimized(Rscratch1, mask, R0); __ and_(Rscratch1, Rscratch2, Rscratch1); __ bne(CCR0, done); @@ -276,12 +276,12 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* } // Increment counter in MethodCounters*. - const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ bind(no_mdo); __ get_method_counters(R19_method, R3_counters, done); - __ lwz(Rscratch2, mo_ic_offs, R3_counters); + __ lwz(Rscratch2, mo_bc_offs, R3_counters); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mo_ic_offs, R3_counters); + __ stw(Rscratch2, mo_bc_offs, R3_counters); __ load_const_optimized(Rscratch1, mask, R0); __ and_(Rscratch1, Rscratch2, Rscratch1); __ beq(CCR0, *overflow); @@ -611,12 +611,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist // For others we can use a normal (native) entry. inline bool math_entry_available(AbstractInterpreter::MethodKind kind) { - // Provide math entry with debugging on demand. - // Note: Debugging changes which code will get executed: - // Debugging or disabled InlineIntrinsics: java method will get interpreted and performs a native call. - // Not debugging and enabled InlineIntrinics: processor instruction will get used. - // Result might differ slightly due to rounding etc. - if (!InlineIntrinsics && (!FLAG_IS_ERGO(InlineIntrinsics))) return false; // Generate a vanilla entry. + if (!InlineIntrinsics) return false; return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) || (kind==Interpreter::java_lang_math_abs)); @@ -628,15 +623,8 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M return Interpreter::entry_for_kind(Interpreter::zerolocals); } - Label Lslow_path; - const Register Rjvmti_mode = R11_scratch1; address entry = __ pc(); - // Provide math entry with debugging on demand. - __ lwz(Rjvmti_mode, thread_(interp_only_mode)); - __ cmpwi(CCR0, Rjvmti_mode, 0); - __ bne(CCR0, Lslow_path); // jvmti_mode!=0 - __ lfd(F1_RET, Interpreter::stackElementSize, R15_esp); // Pop c2i arguments (if any) off when we return. @@ -659,9 +647,6 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M // And we're done. __ blr(); - // Provide slow path for JVMTI case. - __ bind(Lslow_path); - __ branch_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R12_scratch2); __ flush(); return entry; diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp index eb817b0a256..4450dd71897 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ // Run with +PrintInterpreter to get the VM to print out the size. // Max size with JVMTI - const static int InterpreterCodeSize = 210*K; + const static int InterpreterCodeSize = 230*K; #endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index a6505333fc6..7602d871c70 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2013, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -375,23 +375,22 @@ void TemplateTable::fast_aldc(bool wide) { int index_size = wide ? sizeof(u2) : sizeof(u1); const Register Rscratch = R11_scratch1; - Label resolved; + Label is_null; // We are resolved if the resolved reference cache entry contains a // non-null object (CallSite, etc.) __ get_cache_index_at_bcp(Rscratch, 1, index_size); // Load index. - __ load_resolved_reference_at_index(R17_tos, Rscratch); - __ cmpdi(CCR0, R17_tos, 0); - __ bne(CCR0, resolved); + __ load_resolved_reference_at_index(R17_tos, Rscratch, &is_null); + __ verify_oop(R17_tos); + __ dispatch_epilog(atos, Bytecodes::length_for(bytecode())); + + __ bind(is_null); __ load_const_optimized(R3_ARG1, (int)bytecode()); address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); // First time invocation - must resolve first. __ call_VM(R17_tos, entry, R3_ARG1); - - __ align(32, 12); - __ bind(resolved); __ verify_oop(R17_tos); } @@ -437,6 +436,14 @@ void TemplateTable::locals_index(Register Rdst, int offset) { } void TemplateTable::iload() { + iload_internal(); +} + +void TemplateTable::nofast_iload() { + iload_internal(may_not_rewrite); +} + +void TemplateTable::iload_internal(RewriteControl rc) { transition(vtos, itos); // Get the local value into tos @@ -445,7 +452,7 @@ void TemplateTable::iload() { // Rewrite iload,iload pair into fast_iload2 // iload,caload pair into fast_icaload - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label Lrewrite, Ldone; Register Rnext_byte = R3_ARG1, Rrewrite_to = R6_ARG4, @@ -709,6 +716,14 @@ void TemplateTable::aload(int n) { } void TemplateTable::aload_0() { + aload_0_internal(); +} + +void TemplateTable::nofast_aload_0() { + aload_0_internal(may_not_rewrite); +} + +void TemplateTable::aload_0_internal(RewriteControl rc) { transition(vtos, atos); // According to bytecode histograms, the pairs: // @@ -732,7 +747,7 @@ void TemplateTable::aload_0() { // These bytecodes with a small amount of code are most profitable // to rewrite. - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label Lrewrite, Ldont_rewrite; Register Rnext_byte = R3_ARG1, @@ -2144,6 +2159,12 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist __ get_cache_and_index_at_bcp(Rcache, 1, index_size); Label Lresolved, Ldone; + Bytecodes::Code code = bytecode(); + switch (code) { + case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break; + case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break; + } + assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); // We are resolved if the indices offset contains the current bytecode. #if defined(VM_LITTLE_ENDIAN) @@ -2152,24 +2173,11 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Regist __ lbz(Rscratch, in_bytes(ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::indices_offset()) + 7 - (byte_no + 1), Rcache); #endif // Acquire by cmp-br-isync (see below). - __ cmpdi(CCR0, Rscratch, (int)bytecode()); + __ cmpdi(CCR0, Rscratch, (int)code); __ beq(CCR0, Lresolved); - address entry = NULL; - switch (bytecode()) { - case Bytecodes::_getstatic : // fall through - case Bytecodes::_putstatic : // fall through - case Bytecodes::_getfield : // fall through - case Bytecodes::_putfield : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_get_put); break; - case Bytecodes::_invokevirtual : // fall through - case Bytecodes::_invokespecial : // fall through - case Bytecodes::_invokestatic : // fall through - case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; - case Bytecodes::_invokehandle : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokehandle); break; - case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; - default : ShouldNotReachHere(); break; - } - __ li(R4_ARG2, (int)bytecode()); + address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache); + __ li(R4_ARG2, code); __ call_VM(noreg, entry, R4_ARG2, true); // Update registers with resolved info. @@ -2350,7 +2358,7 @@ void TemplateTable::pop_and_check_object(Register Roop) { } // PPC64: implement volatile loads as fence-store-acquire. -void TemplateTable::getfield_or_static(int byte_no, bool is_static) { +void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); Label Lacquire, Lisync; @@ -2366,7 +2374,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { static address field_branch_table[number_of_states], static_branch_table[number_of_states]; - address* branch_table = is_static ? static_branch_table : field_branch_table; + address* branch_table = (is_static || rc == may_not_rewrite) ? static_branch_table : field_branch_table; // Get field offset. resolve_cache_and_index(byte_no, Rcache, Rscratch, sizeof(u2)); @@ -2417,7 +2425,14 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { #ifdef ASSERT __ bind(LFlagInvalid); __ stop("got invalid flag", 0x654); +#endif + if (!is_static && rc == may_not_rewrite) { + // We reuse the code from is_static. It's jumped to via the table above. + return; + } + +#ifdef ASSERT // __ bind(Lvtos); address pc_before_fence = __ pc(); __ fence(); // Volatile entry point (one instruction before non-volatile_entry point). @@ -2434,7 +2449,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[dtos] = __ pc(); // non-volatile_entry point __ lfdx(F15_ftos, Rclass_or_obj, Roffset); __ push(dtos); - if (!is_static) patch_bytecode(Bytecodes::_fast_dgetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_dgetfield, Rbc, Rscratch); + } { Label acquire_double; __ beq(CCR6, acquire_double); // Volatile? @@ -2453,7 +2470,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[ftos] = __ pc(); // non-volatile_entry point __ lfsx(F15_ftos, Rclass_or_obj, Roffset); __ push(ftos); - if (!is_static) { patch_bytecode(Bytecodes::_fast_fgetfield, Rbc, Rscratch); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_fgetfield, Rbc, Rscratch); + } { Label acquire_float; __ beq(CCR6, acquire_float); // Volatile? @@ -2472,7 +2491,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[itos] = __ pc(); // non-volatile_entry point __ lwax(R17_tos, Rclass_or_obj, Roffset); __ push(itos); - if (!is_static) patch_bytecode(Bytecodes::_fast_igetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_igetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2483,7 +2504,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[ltos] = __ pc(); // non-volatile_entry point __ ldx(R17_tos, Rclass_or_obj, Roffset); __ push(ltos); - if (!is_static) patch_bytecode(Bytecodes::_fast_lgetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_lgetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2495,7 +2518,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ lbzx(R17_tos, Rclass_or_obj, Roffset); __ extsb(R17_tos, R17_tos); __ push(btos); - if (!is_static) patch_bytecode(Bytecodes::_fast_bgetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_bgetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2506,7 +2531,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[ctos] = __ pc(); // non-volatile_entry point __ lhzx(R17_tos, Rclass_or_obj, Roffset); __ push(ctos); - if (!is_static) patch_bytecode(Bytecodes::_fast_cgetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_cgetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2517,7 +2544,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { branch_table[stos] = __ pc(); // non-volatile_entry point __ lhax(R17_tos, Rclass_or_obj, Roffset); __ push(stos); - if (!is_static) patch_bytecode(Bytecodes::_fast_sgetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_sgetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2530,7 +2559,9 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ verify_oop(R17_tos); __ push(atos); //__ dcbt(R17_tos); // prefetch - if (!is_static) patch_bytecode(Bytecodes::_fast_agetfield, Rbc, Rscratch); + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_agetfield, Rbc, Rscratch); + } __ beq(CCR6, Lacquire); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2553,6 +2584,10 @@ void TemplateTable::getfield(int byte_no) { getfield_or_static(byte_no, false); } +void TemplateTable::nofast_getfield(int byte_no) { + getfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::getstatic(int byte_no) { getfield_or_static(byte_no, true); } @@ -2643,7 +2678,7 @@ void TemplateTable::jvmti_post_field_mod(Register Rcache, Register Rscratch, boo } // PPC64: implement volatile stores as release-store (return bytecode contains an additional release). -void TemplateTable::putfield_or_static(int byte_no, bool is_static) { +void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteControl rc) { Label Lvolatile; const Register Rcache = R5_ARG3, // Do not use ARG1/2 (causes trouble in jvmti_post_field_mod). @@ -2657,10 +2692,12 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { Rbc = Rscratch3; const ConditionRegister CR_is_vol = CCR2; // Non-volatile condition register (survives runtime call in do_oop_store). - static address field_branch_table[number_of_states], + static address field_rw_branch_table[number_of_states], + field_norw_branch_table[number_of_states], static_branch_table[number_of_states]; - address* branch_table = is_static ? static_branch_table : field_branch_table; + address* branch_table = is_static ? static_branch_table : + (rc == may_rewrite ? field_rw_branch_table : field_norw_branch_table); // Stack (grows up): // value @@ -2688,7 +2725,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { // Load from branch table and dispatch (volatile case: one instruction ahead). __ sldi(Rflags, Rflags, LogBytesPerWord); - if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ cmpwi(CR_is_vol, Rscratch, 1); } // Volatile? + if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ cmpwi(CR_is_vol, Rscratch, 1); // Volatile? + } __ sldi(Rscratch, Rscratch, exact_log2(BytesPerInstWord)); // Volatile? size of instruction 1 : 0. __ ldx(Rbtable, Rbtable, Rflags); @@ -2715,9 +2754,13 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { assert(branch_table[dtos] == 0, "can't compute twice"); branch_table[dtos] = __ pc(); // non-volatile_entry point __ pop(dtos); - if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. + if (!is_static) { + pop_and_check_object(Rclass_or_obj); // Kills R11_scratch1. + } __ stfdx(F15_ftos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_dputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_dputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2731,7 +2774,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ftos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. __ stfsx(F15_ftos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_fputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_fputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2745,7 +2790,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(itos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. __ stwx(R17_tos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_iputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_iputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2759,7 +2806,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ltos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. __ stdx(R17_tos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_lputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_lputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2773,7 +2822,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(btos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. __ stbx(R17_tos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_bputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_bputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2787,7 +2838,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ctos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1.. __ sthx(R17_tos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_cputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_cputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2801,7 +2854,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(stos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // Kills R11_scratch1. __ sthx(R17_tos, Rclass_or_obj, Roffset); - if (!is_static) { patch_bytecode(Bytecodes::_fast_sputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_sputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? } @@ -2815,7 +2870,9 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(atos); if (!is_static) { pop_and_check_object(Rclass_or_obj); } // kills R11_scratch1 do_oop_store(_masm, Rclass_or_obj, Roffset, R17_tos, Rscratch, Rscratch2, Rscratch3, _bs->kind(), false /* precise */, true /* check null */); - if (!is_static) { patch_bytecode(Bytecodes::_fast_aputfield, Rbc, Rscratch, true, byte_no); } + if (!is_static && rc == may_rewrite) { + patch_bytecode(Bytecodes::_fast_aputfield, Rbc, Rscratch, true, byte_no); + } if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { __ beq(CR_is_vol, Lvolatile); // Volatile? __ dispatch_epilog(vtos, Bytecodes::length_for(bytecode())); @@ -2839,6 +2896,10 @@ void TemplateTable::putfield(int byte_no) { putfield_or_static(byte_no, false); } +void TemplateTable::nofast_putfield(int byte_no) { + putfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::putstatic(int byte_no) { putfield_or_static(byte_no, true); } @@ -3259,7 +3320,9 @@ void TemplateTable::invokevirtual(int byte_no) { __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift); __ bfalse(CCR0, LnotFinal); - patch_bytecode(Bytecodes::_fast_invokevfinal, Rnew_bc, R12_scratch2); + if (RewriteBytecodes && !UseSharedSpaces) { + patch_bytecode(Bytecodes::_fast_invokevfinal, Rnew_bc, R12_scratch2); + } invokevfinal_helper(Rvtableindex_or_method, Rflags, R11_scratch1, R12_scratch2); __ align(32, 12); @@ -3795,9 +3858,9 @@ void TemplateTable::instanceof() { transition(atos, itos); Label Ldone, Lis_null, Lquicked, Lresolved; - Register Roffset = R5_ARG3, + Register Roffset = R6_ARG4, RobjKlass = R4_ARG2, - RspecifiedKlass = R6_ARG4, // Generate_ClassCastException_verbose_handler will expect the value in this register. + RspecifiedKlass = R5_ARG3, Rcpool = R11_scratch1, Rtags = R12_scratch2; diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 60f26c5f1c1..357b3d359bd 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,12 +32,13 @@ #include "runtime/os.hpp" #include "runtime/stubCodeGenerator.hpp" #include "utilities/defaultStream.hpp" +#include "utilities/globalDefinitions.hpp" #include "vm_version_ppc.hpp" # include int VM_Version::_features = VM_Version::unknown_m; -int VM_Version::_measured_cache_line_size = 128; // default value +int VM_Version::_measured_cache_line_size = 32; // pessimistic init value const char* VM_Version::_features_str = ""; bool VM_Version::_is_determine_features_test_running = false; @@ -55,7 +56,9 @@ void VM_Version::initialize() { // If PowerArchitecturePPC64 hasn't been specified explicitly determine from features. if (FLAG_IS_DEFAULT(PowerArchitecturePPC64)) { - if (VM_Version::has_popcntw()) { + if (VM_Version::has_lqarx()) { + FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 8); + } else if (VM_Version::has_popcntw()) { FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 7); } else if (VM_Version::has_cmpb()) { FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 6); @@ -66,8 +69,14 @@ void VM_Version::initialize() { } } guarantee(PowerArchitecturePPC64 == 0 || PowerArchitecturePPC64 == 5 || - PowerArchitecturePPC64 == 6 || PowerArchitecturePPC64 == 7, - "PowerArchitecturePPC64 should be 0, 5, 6 or 7"); + PowerArchitecturePPC64 == 6 || PowerArchitecturePPC64 == 7 || + PowerArchitecturePPC64 == 8, + "PowerArchitecturePPC64 should be 0, 5, 6, 7, or 8"); + + // Power 8: Configure Data Stream Control Register. + if (PowerArchitecturePPC64 >= 8) { + config_dscr(); + } if (!UseSIGTRAP) { MSG(TrapBasedICMissChecks); @@ -97,7 +106,7 @@ void VM_Version::initialize() { // Create and print feature-string. char buf[(num_features+1) * 16]; // Max 16 chars per feature. jio_snprintf(buf, sizeof(buf), - "ppc64%s%s%s%s%s%s%s%s", + "ppc64%s%s%s%s%s%s%s%s%s%s%s%s", (has_fsqrt() ? " fsqrt" : ""), (has_isel() ? " isel" : ""), (has_lxarxeh() ? " lxarxeh" : ""), @@ -106,11 +115,17 @@ void VM_Version::initialize() { (has_popcntb() ? " popcntb" : ""), (has_popcntw() ? " popcntw" : ""), (has_fcfids() ? " fcfids" : ""), - (has_vand() ? " vand" : "") + (has_vand() ? " vand" : ""), + (has_lqarx() ? " lqarx" : ""), + (has_vcipher() ? " vcipher" : ""), + (has_vpmsumb() ? " vpmsumb" : ""), + (has_tcheck() ? " tcheck" : "") // Make sure number of %s matches num_features! ); _features_str = os::strdup(buf); - NOT_PRODUCT(if (Verbose) print_features();); + if (Verbose) { + print_features(); + } // PPC64 supports 8-byte compare-exchange operations (see // Atomic::cmpxchg and StubGenerator::generate_atomic_cmpxchg_ptr) @@ -171,7 +186,86 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); } + // Adjust RTM (Restricted Transactional Memory) flags. + if (!has_tcheck() && UseRTMLocking) { + // Can't continue because UseRTMLocking affects UseBiasedLocking flag + // setting during arguments processing. See use_biased_locking(). + // VM_Version_init() is executed after UseBiasedLocking is used + // in Thread::allocate(). + vm_exit_during_initialization("RTM instructions are not available on this CPU"); + } + if (UseRTMLocking) { +#if INCLUDE_RTM_OPT + if (!UnlockExperimentalVMOptions) { + vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. " + "It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); + } else { + warning("UseRTMLocking is only available as experimental option on this platform."); + } + if (!FLAG_IS_CMDLINE(UseRTMLocking)) { + // RTM locking should be used only for applications with + // high lock contention. For now we do not use it by default. + vm_exit_during_initialization("UseRTMLocking flag should be only set on command line"); + } + if (!is_power_of_2(RTMTotalCountIncrRate)) { + warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64"); + FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64); + } + if (RTMAbortRatio < 0 || RTMAbortRatio > 100) { + warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50"); + FLAG_SET_DEFAULT(RTMAbortRatio, 50); + } + FLAG_SET_ERGO(bool, UseNewFastLockPPC64, false); // Does not implement TM. + guarantee(RTMSpinLoopCount > 0, "unsupported"); +#else + // Only C2 does RTM locking optimization. + // Can't continue because UseRTMLocking affects UseBiasedLocking flag + // setting during arguments processing. See use_biased_locking(). + vm_exit_during_initialization("RTM locking optimization is not supported in this VM"); +#endif + } else { // !UseRTMLocking + if (UseRTMForStackLocks) { + if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) { + warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off"); + } + FLAG_SET_DEFAULT(UseRTMForStackLocks, false); + } + if (UseRTMDeopt) { + FLAG_SET_DEFAULT(UseRTMDeopt, false); + } + if (PrintPreciseRTMLockingStatistics) { + FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false); + } + } + + // This machine does not allow unaligned memory accesses + if (UseUnalignedAccesses) { + if (!FLAG_IS_DEFAULT(UseUnalignedAccesses)) + warning("Unaligned memory access is not available on this CPU"); + FLAG_SET_DEFAULT(UseUnalignedAccesses, false); + } +} + +bool VM_Version::use_biased_locking() { +#if INCLUDE_RTM_OPT + // RTM locking is most useful when there is high lock contention and + // low data contention. With high lock contention the lock is usually + // inflated and biased locking is not suitable for that case. + // RTM locking code requires that biased locking is off. + // Note: we can't switch off UseBiasedLocking in get_processor_features() + // because it is used by Thread::allocate() which is called before + // VM_Version::initialize(). + if (UseRTMLocking && UseBiasedLocking) { + if (FLAG_IS_DEFAULT(UseBiasedLocking)) { + FLAG_SET_DEFAULT(UseBiasedLocking, false); + } else { + warning("Biased locking is not supported with RTM locking; ignoring UseBiasedLocking flag." ); + UseBiasedLocking = false; + } + } +#endif + return UseBiasedLocking; } void VM_Version::print_features() { @@ -437,16 +531,19 @@ void VM_Version::determine_features() { // Don't use R0 in ldarx. // Keep R3_ARG1 unmodified, it contains &field (see below). // Keep R4_ARG2 unmodified, it contains offset = 0 (see below). - a->fsqrt(F3, F4); // code[0] -> fsqrt_m - a->fsqrts(F3, F4); // code[1] -> fsqrts_m - a->isel(R7, R5, R6, 0); // code[2] -> isel_m - a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m - a->cmpb(R7, R5, R6); // code[4] -> bcmp - //a->mftgpr(R7, F3); // code[5] -> mftgpr - a->popcntb(R7, R5); // code[6] -> popcntb - a->popcntw(R7, R5); // code[7] -> popcntw - a->fcfids(F3, F4); // code[8] -> fcfids - a->vand(VR0, VR0, VR0); // code[9] -> vand + a->fsqrt(F3, F4); // code[0] -> fsqrt_m + a->fsqrts(F3, F4); // code[1] -> fsqrts_m + a->isel(R7, R5, R6, 0); // code[2] -> isel_m + a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m + a->cmpb(R7, R5, R6); // code[4] -> cmpb + a->popcntb(R7, R5); // code[5] -> popcntb + a->popcntw(R7, R5); // code[6] -> popcntw + a->fcfids(F3, F4); // code[7] -> fcfids + a->vand(VR0, VR0, VR0); // code[8] -> vand + a->lqarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[9] -> lqarx_m + a->vcipher(VR0, VR1, VR2); // code[10] -> vcipher + a->vpmsumb(VR0, VR1, VR2); // code[11] -> vpmsumb + a->tcheck(0); // code[12] -> tcheck a->blr(); // Emit function to set one cache line to zero. Emit function descriptor and get pointer to it. @@ -485,11 +582,14 @@ void VM_Version::determine_features() { if (code[feature_cntr++]) features |= isel_m; if (code[feature_cntr++]) features |= lxarxeh_m; if (code[feature_cntr++]) features |= cmpb_m; - //if(code[feature_cntr++])features |= mftgpr_m; if (code[feature_cntr++]) features |= popcntb_m; if (code[feature_cntr++]) features |= popcntw_m; if (code[feature_cntr++]) features |= fcfids_m; if (code[feature_cntr++]) features |= vand_m; + if (code[feature_cntr++]) features |= lqarx_m; + if (code[feature_cntr++]) features |= vcipher_m; + if (code[feature_cntr++]) features |= vpmsumb_m; + if (code[feature_cntr++]) features |= tcheck_m; // Print the detection code. if (PrintAssembly) { @@ -501,6 +601,69 @@ void VM_Version::determine_features() { _features = features; } +// Power 8: Configure Data Stream Control Register. +void VM_Version::config_dscr() { + assert(has_tcheck(), "Only execute on Power 8 or later!"); + + // 7 InstWords for each call (function descriptor + blr instruction). + const int code_size = (2+2*7)*BytesPerInstWord; + + // Allocate space for the code. + ResourceMark rm; + CodeBuffer cb("config_dscr", code_size, 0); + MacroAssembler* a = new MacroAssembler(&cb); + + // Emit code. + uint64_t (*get_dscr)() = (uint64_t(*)())(void *)a->emit_fd(); + uint32_t *code = (uint32_t *)a->pc(); + a->mfdscr(R3); + a->blr(); + + void (*set_dscr)(long) = (void(*)(long))(void *)a->emit_fd(); + a->mtdscr(R3); + a->blr(); + + uint32_t *code_end = (uint32_t *)a->pc(); + a->flush(); + + // Print the detection code. + if (PrintAssembly) { + ttyLocker ttyl; + tty->print_cr("Decoding dscr configuration stub at " INTPTR_FORMAT " before execution:", code); + Disassembler::decode((u_char*)code, (u_char*)code_end, tty); + } + + // Apply the configuration if needed. + uint64_t dscr_val = (*get_dscr)(); + if (Verbose) { + tty->print_cr("dscr value was 0x%lx" , dscr_val); + } + bool change_requested = false; + if (DSCR_PPC64 != (uintx)-1) { + dscr_val = DSCR_PPC64; + change_requested = true; + } + if (DSCR_DPFD_PPC64 <= 7) { + uint64_t mask = 0x7; + if ((dscr_val & mask) != DSCR_DPFD_PPC64) { + dscr_val = (dscr_val & ~mask) | (DSCR_DPFD_PPC64); + change_requested = true; + } + } + if (DSCR_URG_PPC64 <= 7) { + uint64_t mask = 0x7 << 6; + if ((dscr_val & mask) != DSCR_DPFD_PPC64 << 6) { + dscr_val = (dscr_val & ~mask) | (DSCR_URG_PPC64 << 6); + change_requested = true; + } + } + if (change_requested) { + (*set_dscr)(dscr_val); + if (Verbose) { + tty->print_cr("dscr was set to 0x%lx" , (*get_dscr)()); + } + } +} static int saved_features = 0; diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 2bbfdddb21f..6fc76e4cd41 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,10 @@ protected: popcntw, fcfids, vand, - dcba, + lqarx, + vcipher, + vpmsumb, + tcheck, num_features // last entry to count features }; enum Feature_Flag_Set { @@ -55,7 +58,10 @@ protected: popcntw_m = (1 << popcntw), fcfids_m = (1 << fcfids ), vand_m = (1 << vand ), - dcba_m = (1 << dcba ), + lqarx_m = (1 << lqarx ), + vcipher_m = (1 << vcipher), + vpmsumb_m = (1 << vpmsumb), + tcheck_m = (1 << tcheck ), all_features_m = -1 }; static int _features; @@ -65,12 +71,16 @@ protected: static void print_features(); static void determine_features(); // also measures cache line size + static void config_dscr(); // Power 8: Configure Data Stream Control Register. static void determine_section_size(); static void power6_micro_bench(); public: // Initialization static void initialize(); + // Override Abstract_VM_Version implementation + static bool use_biased_locking(); + static bool is_determine_features_test_running() { return _is_determine_features_test_running; } // CPU instruction support static bool has_fsqrt() { return (_features & fsqrt_m) != 0; } @@ -82,7 +92,10 @@ public: static bool has_popcntw() { return (_features & popcntw_m) != 0; } static bool has_fcfids() { return (_features & fcfids_m) != 0; } static bool has_vand() { return (_features & vand_m) != 0; } - static bool has_dcba() { return (_features & dcba_m) != 0; } + static bool has_lqarx() { return (_features & lqarx_m) != 0; } + static bool has_vcipher() { return (_features & vcipher_m) != 0; } + static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; } + static bool has_tcheck() { return (_features & tcheck_m) != 0; } static const char* cpu_features() { return _features_str; } diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp index 5931afd5c32..0165fb22e34 100644 --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,6 @@ */ #include "precompiled.hpp" -#include "asm/assembler.hpp" #include "asm/macroAssembler.inline.hpp" #include "code/vtableStubs.hpp" #include "interp_masm_ppc_64.hpp" diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 2873f441f9d..800e6ef5a74 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -74,6 +74,8 @@ define_pd_global(bool, RewriteFrequentPairs, true); define_pd_global(bool, UseMembar, false); +define_pd_global(bool, PreserveFramePointer, false); + // GC Ergo Flags define_pd_global(size_t, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index 862611c4252..042cccd2ec2 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,7 +203,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void field_offset_at(int n, Register tmp, Register dest, Register base); int field_offset_at(Register object, address bcp, int offset); void fast_iaaccess(int n, address bcp); - void fast_iagetfield(address bcp); void fast_iaputfield(address bcp, bool do_store_check ); void index_check(Register array, Register index, int index_shift, Register tmp, Register res); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 3a932ccee55..fa90497fb76 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3019,44 +3019,107 @@ void MacroAssembler::compiler_unlock_object(Register Roop, Register Rmark, // past the store that releases the lock. But TSO is a strong memory model // and that particular flavor of barrier is a noop, so we can safely elide it. // Note that we use 1-0 locking by default for the inflated case. We - // close the resultant (and rare) race by having contented threads in + // close the resultant (and rare) race by having contended threads in // monitorenter periodically poll _owner. - ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rscratch); - ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions), Rbox); - xor3(Rscratch, G2_thread, Rscratch); - orcc(Rbox, Rscratch, Rbox); - brx(Assembler::notZero, false, Assembler::pn, done); - delayed()-> - ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList), Rscratch); - ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq), Rbox); - orcc(Rbox, Rscratch, G0); - if (EmitSync & 65536) { - Label LSucc ; - brx(Assembler::notZero, false, Assembler::pn, LSucc); - delayed()->nop(); - ba(done); - delayed()->st_ptr(G0, Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)); - bind(LSucc); - st_ptr(G0, Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)); - if (os::is_MP()) { membar (StoreLoad); } - ld_ptr(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ), Rscratch); - andcc(Rscratch, Rscratch, G0); - brx(Assembler::notZero, false, Assembler::pt, done); - delayed()->andcc(G0, G0, G0); - add(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rmark); - mov(G2_thread, Rscratch); - cas_ptr(Rmark, G0, Rscratch); - // invert icc.zf and goto done - br_notnull(Rscratch, false, Assembler::pt, done); - delayed()->cmp(G0, G0); - ba(done); - delayed()->cmp(G0, 1); + if (EmitSync & 1024) { + // Emit code to check that _owner == Self + // We could fold the _owner test into subsequent code more efficiently + // than using a stand-alone check, but since _owner checking is off by + // default we don't bother. We also might consider predicating the + // _owner==Self check on Xcheck:jni or running on a debug build. + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), Rscratch); + orcc(Rscratch, G0, G0); + brx(Assembler::notZero, false, Assembler::pn, done); + delayed()->nop(); + } + + if (EmitSync & 512) { + // classic lock release code absent 1-0 locking + // m->Owner = null; + // membar #storeload + // if (m->cxq|m->EntryList) == null goto Success + // if (m->succ != null) goto Success + // if CAS (&m->Owner,0,Self) != 0 goto Success + // goto SlowPath + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), Rbox); + orcc(Rbox, G0, G0); + brx(Assembler::notZero, false, Assembler::pn, done); + delayed()->nop(); + st_ptr(G0, Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + if (os::is_MP()) { membar(StoreLoad); } + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList)), Rscratch); + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq)), Rbox); + orcc(Rbox, Rscratch, G0); + brx(Assembler::zero, false, Assembler::pt, done); + delayed()-> + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), Rscratch); + andcc(Rscratch, Rscratch, G0); + brx(Assembler::notZero, false, Assembler::pt, done); + delayed()->andcc(G0, G0, G0); + add(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rmark); + mov(G2_thread, Rscratch); + cas_ptr(Rmark, G0, Rscratch); + cmp(Rscratch, G0); + // invert icc.zf and goto done + brx(Assembler::notZero, false, Assembler::pt, done); + delayed()->cmp(G0, G0); + br(Assembler::always, false, Assembler::pt, done); + delayed()->cmp(G0, 1); } else { - brx(Assembler::notZero, false, Assembler::pn, done); - delayed()->nop(); - ba(done); - delayed()->st_ptr(G0, Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)); + // 1-0 form : avoids CAS and MEMBAR in the common case + // Do not bother to ratify that m->Owner == Self. + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), Rbox); + orcc(Rbox, G0, G0); + brx(Assembler::notZero, false, Assembler::pn, done); + delayed()-> + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList)), Rscratch); + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq)), Rbox); + orcc(Rbox, Rscratch, G0); + if (EmitSync & 16384) { + // As an optional optimization, if (EntryList|cxq) != null and _succ is null then + // we should transfer control directly to the slow-path. + // This test makes the reacquire operation below very infrequent. + // The logic is equivalent to : + // if (cxq|EntryList) == null : Owner=null; goto Success + // if succ == null : goto SlowPath + // Owner=null; membar #storeload + // if succ != null : goto Success + // if CAS(&Owner,null,Self) != null goto Success + // goto SlowPath + brx(Assembler::zero, true, Assembler::pt, done); + delayed()-> + st_ptr(G0, Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), Rscratch); + andcc(Rscratch, Rscratch, G0) ; + brx(Assembler::zero, false, Assembler::pt, done); + delayed()->orcc(G0, 1, G0); + st_ptr(G0, Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + } else { + brx(Assembler::zero, false, Assembler::pt, done); + delayed()-> + st_ptr(G0, Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + } + if (os::is_MP()) { membar(StoreLoad); } + // Check that _succ is (or remains) non-zero + ld_ptr(Address(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), Rscratch); + andcc(Rscratch, Rscratch, G0); + brx(Assembler::notZero, false, Assembler::pt, done); + delayed()->andcc(G0, G0, G0); + add(Rmark, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), Rmark); + mov(G2_thread, Rscratch); + cas_ptr(Rmark, G0, Rscratch); + cmp(Rscratch, G0); + // invert icc.zf and goto done + // A slightly better v8+/v9 idiom would be the following: + // movrnz Rscratch,1,Rscratch + // ba done + // xorcc Rscratch,1,G0 + // In v8+ mode the idiom would be valid IFF Rscratch was a G or O register + brx(Assembler::notZero, false, Assembler::pt, done); + delayed()->cmp(G0, G0); + br(Assembler::always, false, Assembler::pt, done); + delayed()->cmp(G0, 1); } bind (LStacked); @@ -3632,23 +3695,11 @@ static inline void generate_satb_log_enqueue_if_necessary(bool with_frame) { if (satb_log_enqueue_with_frame == 0) { generate_satb_log_enqueue(with_frame); assert(satb_log_enqueue_with_frame != 0, "postcondition."); - if (G1SATBPrintStubs) { - tty->print_cr("Generated with-frame satb enqueue:"); - Disassembler::decode((u_char*)satb_log_enqueue_with_frame, - satb_log_enqueue_with_frame_end, - tty); - } } } else { if (satb_log_enqueue_frameless == 0) { generate_satb_log_enqueue(with_frame); assert(satb_log_enqueue_frameless != 0, "postcondition."); - if (G1SATBPrintStubs) { - tty->print_cr("Generated frameless satb enqueue:"); - Disassembler::decode((u_char*)satb_log_enqueue_frameless, - satb_log_enqueue_frameless_end, - tty); - } } } } @@ -3841,12 +3892,6 @@ generate_dirty_card_log_enqueue_if_necessary(jbyte* byte_map_base) { if (dirty_card_log_enqueue == 0) { generate_dirty_card_log_enqueue(byte_map_base); assert(dirty_card_log_enqueue != 0, "postcondition."); - if (G1SATBPrintStubs) { - tty->print_cr("Generated dirty_card enqueue:"); - Disassembler::decode((u_char*)dirty_card_log_enqueue, - dirty_card_log_enqueue_end, - tty); - } } } diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index b3dcb8b98c9..2c4e892f467 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2664,6 +2664,9 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // disallows any pending_exception. __ mov(L3_box, O1); + // Pass in current thread pointer + __ mov(G2_thread, O2); + __ call(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C), relocInfo::runtime_call_type); __ delayed()->mov(L4, O0); // Need oop in O0 diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 342f69b49ca..18e492c65e2 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -385,7 +385,6 @@ void TemplateTable::fast_aldc(bool wide) { __ verify_oop(Otos_i); } - void TemplateTable::ldc2_w() { transition(vtos, vtos); Label Long, exit; @@ -430,22 +429,28 @@ void TemplateTable::ldc2_w() { __ bind(exit); } - void TemplateTable::locals_index(Register reg, int offset) { __ ldub( at_bcp(offset), reg ); } - void TemplateTable::locals_index_wide(Register reg) { // offset is 2, not 1, because Lbcp points to wide prefix code __ get_2_byte_integer_at_bcp(2, G4_scratch, reg, InterpreterMacroAssembler::Unsigned); } void TemplateTable::iload() { + iload_internal(); +} + +void TemplateTable::nofast_iload() { + iload_internal(may_not_rewrite); +} + +void TemplateTable::iload_internal(RewriteControl rc) { transition(vtos, itos); // Rewrite iload,iload pair into fast_iload2 // iload,caload pair into fast_icaload - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label rewrite, done; // get next byte @@ -672,8 +677,15 @@ void TemplateTable::aload(int n) { __ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i ); } - void TemplateTable::aload_0() { + aload_0_internal(); +} + +void TemplateTable::nofast_aload_0() { + aload_0_internal(may_not_rewrite); +} + +void TemplateTable::aload_0_internal(RewriteControl rc) { transition(vtos, atos); // According to bytecode histograms, the pairs: @@ -687,7 +699,7 @@ void TemplateTable::aload_0() { // bytecode into a pair bytecode; otherwise it rewrites the current // bytecode into _fast_aload_0 that doesn't do the pair check anymore. // - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label rewrite, done; // get next byte @@ -731,7 +743,6 @@ void TemplateTable::aload_0() { } } - void TemplateTable::istore() { transition(itos, vtos); locals_index(G3_scratch); @@ -2045,30 +2056,21 @@ void TemplateTable::resolve_cache_and_index(int byte_no, Register index, size_t index_size) { // Depends on cpCacheOop layout! + Label resolved; - - assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); - __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, Lbyte_code, byte_no, 1, index_size); - __ cmp(Lbyte_code, (int) bytecode()); // have we resolved this bytecode? - __ br(Assembler::equal, false, Assembler::pt, resolved); - __ delayed()->set((int)bytecode(), O1); - - address entry; - switch (bytecode()) { - case Bytecodes::_getstatic : // fall through - case Bytecodes::_putstatic : // fall through - case Bytecodes::_getfield : // fall through - case Bytecodes::_putfield : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_get_put); break; - case Bytecodes::_invokevirtual : // fall through - case Bytecodes::_invokespecial : // fall through - case Bytecodes::_invokestatic : // fall through - case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; - case Bytecodes::_invokehandle : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokehandle); break; - case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; - default: - fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode()))); - break; + Bytecodes::Code code = bytecode(); + switch (code) { + case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break; + case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break; } + + assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); + __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, Lbyte_code, byte_no, 1, index_size); + __ cmp(Lbyte_code, code); // have we resolved this bytecode? + __ br(Assembler::equal, false, Assembler::pt, resolved); + __ delayed()->set(code, O1); + + address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache); // first time invocation - must resolve first __ call_VM(noreg, entry, O1); // Update registers with resolved info @@ -2183,7 +2185,7 @@ void TemplateTable::jvmti_post_field_access(Register Rcache, } } -void TemplateTable::getfield_or_static(int byte_no, bool is_static) { +void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); Register Rcache = G3_scratch; @@ -2231,7 +2233,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ load_heap_oop(Rclass, Roffset, Otos_i); __ verify_oop(Otos_i); __ push(atos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_agetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2246,7 +2248,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // itos __ ld(Rclass, Roffset, Otos_i); __ push(itos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_igetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2262,7 +2264,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // load must be atomic __ ld_long(Rclass, Roffset, Otos_l); __ push(ltos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_lgetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2277,7 +2279,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // btos __ ldsb(Rclass, Roffset, Otos_i); __ push(itos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bgetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2292,7 +2294,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // ctos __ lduh(Rclass, Roffset, Otos_i); __ push(itos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cgetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2307,7 +2309,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // stos __ ldsh(Rclass, Roffset, Otos_i); __ push(itos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sgetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2323,7 +2325,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // ftos __ ldf(FloatRegisterImpl::S, Rclass, Roffset, Ftos_f); __ push(ftos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fgetfield, G3_scratch, G4_scratch); } __ ba(checkVolatile); @@ -2335,7 +2337,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // dtos __ ldf(FloatRegisterImpl::D, Rclass, Roffset, Ftos_d); __ push(dtos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dgetfield, G3_scratch, G4_scratch); } @@ -2350,16 +2352,18 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ bind(exit); } - void TemplateTable::getfield(int byte_no) { getfield_or_static(byte_no, false); } +void TemplateTable::nofast_getfield(int byte_no) { + getfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::getstatic(int byte_no) { getfield_or_static(byte_no, true); } - void TemplateTable::fast_accessfield(TosState state) { transition(atos, state); Register Rcache = G3_scratch; @@ -2544,7 +2548,7 @@ void TemplateTable::pop_and_check_object(Register r) { __ verify_oop(r); } -void TemplateTable::putfield_or_static(int byte_no, bool is_static) { +void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); Register Rcache = G3_scratch; Register index = G4_scratch; @@ -2620,7 +2624,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_i(); pop_and_check_object(Rclass); __ st(Otos_i, Rclass, Roffset); - patch_bytecode(Bytecodes::_fast_iputfield, G3_scratch, G4_scratch, true, byte_no); + if (rc == may_rewrite) patch_bytecode(Bytecodes::_fast_iputfield, G3_scratch, G4_scratch, true, byte_no); __ ba(checkVolatile); __ delayed()->tst(Lscratch); } @@ -2636,7 +2640,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { pop_and_check_object(Rclass); __ verify_oop(Otos_i); do_oop_store(_masm, Rclass, Roffset, 0, Otos_i, G1_scratch, _bs->kind(), false); - patch_bytecode(Bytecodes::_fast_aputfield, G3_scratch, G4_scratch, true, byte_no); + if (rc == may_rewrite) patch_bytecode(Bytecodes::_fast_aputfield, G3_scratch, G4_scratch, true, byte_no); __ ba(checkVolatile); __ delayed()->tst(Lscratch); } @@ -2653,7 +2657,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_i(); if (!is_static) pop_and_check_object(Rclass); __ stb(Otos_i, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bputfield, G3_scratch, G4_scratch, true, byte_no); } __ ba(checkVolatile); @@ -2670,7 +2674,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_l(); if (!is_static) pop_and_check_object(Rclass); __ st_long(Otos_l, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_lputfield, G3_scratch, G4_scratch, true, byte_no); } __ ba(checkVolatile); @@ -2687,7 +2691,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_i(); if (!is_static) pop_and_check_object(Rclass); __ sth(Otos_i, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cputfield, G3_scratch, G4_scratch, true, byte_no); } __ ba(checkVolatile); @@ -2704,7 +2708,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_i(); if (!is_static) pop_and_check_object(Rclass); __ sth(Otos_i, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sputfield, G3_scratch, G4_scratch, true, byte_no); } __ ba(checkVolatile); @@ -2721,7 +2725,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_f(); if (!is_static) pop_and_check_object(Rclass); __ stf(FloatRegisterImpl::S, Ftos_f, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fputfield, G3_scratch, G4_scratch, true, byte_no); } __ ba(checkVolatile); @@ -2735,7 +2739,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop_d(); if (!is_static) pop_and_check_object(Rclass); __ stf(FloatRegisterImpl::D, Ftos_d, Rclass, Roffset); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dputfield, G3_scratch, G4_scratch, true, byte_no); } } @@ -2809,16 +2813,18 @@ void TemplateTable::fast_storefield(TosState state) { } } - void TemplateTable::putfield(int byte_no) { putfield_or_static(byte_no, false); } +void TemplateTable::nofast_putfield(int byte_no) { + putfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::putstatic(int byte_no) { putfield_or_static(byte_no, true); } - void TemplateTable::fast_xaccess(TosState state) { transition(vtos, state); Register Rcache = G3_scratch; @@ -2971,7 +2977,9 @@ void TemplateTable::invokevirtual(int byte_no) { __ br(Assembler::zero, false, Assembler::pt, notFinal); __ delayed()->and3(Rret, 0xFF, G4_scratch); // gets number of parameters - patch_bytecode(Bytecodes::_fast_invokevfinal, Rscratch, Rtemp); + if (RewriteBytecodes && !UseSharedSpaces) { + patch_bytecode(Bytecodes::_fast_invokevfinal, Rscratch, Rtemp); + } invokevfinal_helper(Rscratch, Rret); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index ee2be7dd76d..bad83d550f4 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ int VM_Version::_features = VM_Version::unknown_m; const char* VM_Version::_features_str = ""; -unsigned int VM_Version::_L2_cache_line_size = 0; +unsigned int VM_Version::_L2_data_cache_line_size = 0; void VM_Version::initialize() { _features = determine_features(); @@ -356,10 +356,17 @@ void VM_Version::initialize() { (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; + // This machine does not allow unaligned memory accesses + if (UseUnalignedAccesses) { + if (!FLAG_IS_DEFAULT(UseUnalignedAccesses)) + warning("Unaligned memory access is not available on this CPU"); + FLAG_SET_DEFAULT(UseUnalignedAccesses, false); + } + #ifndef PRODUCT if (PrintMiscellaneous && Verbose) { tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); - tty->print_cr("L2 cache line size: %u", L2_cache_line_size()); + tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size()); tty->print("Allocation"); if (AllocatePrefetchStyle <= 0) { tty->print_cr(": no prefetching"); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index fa823863bdb..59969ed1089 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -96,8 +96,8 @@ protected: static int _features; static const char* _features_str; - static unsigned int _L2_cache_line_size; - static unsigned int L2_cache_line_size() { return _L2_cache_line_size; } + static unsigned int _L2_data_cache_line_size; + static unsigned int L2_data_cache_line_size() { return _L2_data_cache_line_size; } static void print_features(); static int determine_features(); @@ -171,7 +171,7 @@ public: static const char* cpu_features() { return _features_str; } // default prefetch block size on sparc - static intx prefetch_data_size() { return L2_cache_line_size(); } + static intx prefetch_data_size() { return L2_data_cache_line_size(); } // Prefetch static intx prefetch_copy_interval_in_bytes() { diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index f61e0a0917c..2d06abb0086 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -3359,6 +3359,20 @@ void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, bool vecto // Integer vector arithmetic +void Assembler::vphaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { + assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); + int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); + emit_int8(0x01); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { + assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); + int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); + emit_int8(0x02); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::paddb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); emit_simd_arith(0xFC, dst, src, VEX_SIMD_66); @@ -3379,6 +3393,20 @@ void Assembler::paddq(XMMRegister dst, XMMRegister src) { emit_simd_arith(0xD4, dst, src, VEX_SIMD_66); } +void Assembler::phaddw(XMMRegister dst, XMMRegister src) { + NOT_LP64(assert(VM_Version::supports_sse3(), "")); + int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); + emit_int8(0x01); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::phaddd(XMMRegister dst, XMMRegister src) { + NOT_LP64(assert(VM_Version::supports_sse3(), "")); + int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); + emit_int8(0x02); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); emit_vex_arith(0xFC, dst, nds, src, VEX_SIMD_66, vector256); @@ -3804,6 +3832,17 @@ void Assembler::vinsertf128h(XMMRegister dst, Address src) { emit_int8(0x01); } +void Assembler::vextractf128h(XMMRegister dst, XMMRegister src) { + assert(VM_Version::supports_avx(), ""); + bool vector256 = true; + int encode = vex_prefix_and_encode(src, xnoreg, dst, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); + emit_int8(0x19); + emit_int8((unsigned char)(0xC0 | encode)); + // 0x00 - insert into lower 128 bits + // 0x01 - insert into upper 128 bits + emit_int8(0x01); +} + void Assembler::vextractf128h(Address dst, XMMRegister src) { assert(VM_Version::supports_avx(), ""); InstructionMark im(this); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 3f3fff83d66..742d6c5eed9 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -142,8 +142,10 @@ REGISTER_DECLARATION(Register, r15_thread, r15); // callee-saved #endif // _LP64 -// JSR 292 fixed register usages: -REGISTER_DECLARATION(Register, rbp_mh_SP_save, rbp); +// JSR 292 +// On x86, the SP does not have to be saved when invoking method handle intrinsics +// or compiled lambda forms. We indicate that by setting rbp_mh_SP_save to noreg. +REGISTER_DECLARATION(Register, rbp_mh_SP_save, noreg); // Address is an abstraction used to represent a memory location // using any of the amd64 addressing modes with one object. @@ -1777,6 +1779,12 @@ private: void vxorpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); void vxorps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); + // Add horizontal packed integers + void vphaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); + void vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); + void phaddw(XMMRegister dst, XMMRegister src); + void phaddd(XMMRegister dst, XMMRegister src); + // Add packed integers void paddb(XMMRegister dst, XMMRegister src); void paddw(XMMRegister dst, XMMRegister src); @@ -1869,6 +1877,7 @@ private: // Copy low 128bit into high 128bit of YMM registers. void vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src); void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src); + void vextractf128h(XMMRegister dst, XMMRegister src); // Load/store high 128bit of YMM registers which does not destroy other half. void vinsertf128h(XMMRegister dst, Address src); diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp index f75eca72868..bec7eed65e9 100644 --- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp @@ -343,14 +343,13 @@ LIR_Opr FrameMap::stack_pointer() { return FrameMap::rsp_opr; } - // JSR 292 +// On x86, there is no need to save the SP, because neither +// method handle intrinsics, nor compiled lambda forms modify it. LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() { - assert(rbp == rbp_mh_SP_save, "must be same register"); - return rbp_opr; + return LIR_OprFact::illegalOpr; } - bool FrameMap::validate_frame() { return true; } diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 0c8d0767ed2..cf1a59a30b3 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -360,6 +360,9 @@ void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_by generate_stack_overflow_check(bang_size_in_bytes); push(rbp); + if (PreserveFramePointer) { + mov(rbp, rsp); + } #ifdef TIERED // c2 leaves fpu stack dirty. Clean it on entry if (UseSSE < 2 ) { diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index fa7e8c3dd0f..152ad2e0189 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -754,14 +754,9 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) { // WIN64_ONLY: No need to add frame::arg_reg_save_area_bytes to SP // since we do a leave anyway. - // Pop the return address since we are possibly changing SP (restoring from BP). + // Pop the return address. __ leave(); __ pop(rcx); - - // Restore SP from BP if the exception PC is a method handle call site. - NOT_LP64(__ get_thread(thread);) - __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0); - __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); __ jmp(rcx); // jump to exception handler break; default: ShouldNotReachHere(); @@ -832,11 +827,6 @@ void Runtime1::generate_unwind_exception(StubAssembler *sasm) { // the pop is also necessary to simulate the effect of a ret(0) __ pop(exception_pc); - // Restore SP from BP if the exception PC is a method handle call site. - NOT_LP64(__ get_thread(thread);) - __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0); - __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); - // continue at exception handler (return address removed) // note: do *not* remove arguments when unwinding the // activation since the caller assumes having diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 654f0689ec2..525b13e6844 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -224,7 +224,8 @@ bool frame::safe_for_sender(JavaThread *thread) { if (sender_blob->is_nmethod()) { nmethod* nm = sender_blob->as_nmethod_or_null(); if (nm != NULL) { - if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc)) { + if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) || + nm->method()->is_method_handle_intrinsic()) { return false; } } @@ -391,10 +392,9 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const { // frame::verify_deopt_original_pc // // Verifies the calculated original PC of a deoptimization PC for the -// given unextended SP. The unextended SP might also be the saved SP -// for MethodHandle call sites. +// given unextended SP. #ifdef ASSERT -void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) { +void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) { frame fr; // This is ugly but it's better than to change {get,set}_original_pc @@ -404,33 +404,23 @@ void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool address original_pc = nm->get_original_pc(&fr); assert(nm->insts_contains(original_pc), "original PC must be in nmethod"); - assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be"); } #endif //------------------------------------------------------------------------------ // frame::adjust_unextended_sp void frame::adjust_unextended_sp() { - // If we are returning to a compiled MethodHandle call site, the - // saved_fp will in fact be a saved value of the unextended SP. The - // simplest way to tell whether we are returning to such a call site - // is as follows: + // On x86, sites calling method handle intrinsics and lambda forms are treated + // as any other call site. Therefore, no special action is needed when we are + // returning to any of these call sites. nmethod* sender_nm = (_cb == NULL) ? NULL : _cb->as_nmethod_or_null(); if (sender_nm != NULL) { - // If the sender PC is a deoptimization point, get the original - // PC. For MethodHandle call site the unextended_sp is stored in - // saved_fp. - if (sender_nm->is_deopt_mh_entry(_pc)) { - DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, _fp)); - _unextended_sp = _fp; - } - else if (sender_nm->is_deopt_entry(_pc)) { + // If the sender PC is a deoptimization point, get the original PC. + if (sender_nm->is_deopt_entry(_pc) || + sender_nm->is_deopt_mh_entry(_pc)) { DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp)); } - else if (sender_nm->is_method_handle_return(_pc)) { - _unextended_sp = _fp; - } } } diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 602b8ff186f..3b7cee89f0e 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -76,11 +76,11 @@ // [locals and parameters ] // <- sender sp -// [1] When the c++ interpreter calls a new method it returns to the frame +// [1] When the C++ interpreter calls a new method it returns to the frame // manager which allocates a new frame on the stack. In that case there // is no real callee of this newly allocated frame. The frame manager is -// aware of the additional frame(s) and will pop them as nested calls -// complete. Howevers tTo make it look good in the debugger the frame +// aware of the additional frame(s) and will pop them as nested calls +// complete. However, to make it look good in the debugger the frame // manager actually installs a dummy pc pointing to RecursiveInterpreterActivation // with a fake interpreter_state* parameter to make it easy to debug // nested calls. @@ -88,7 +88,7 @@ // Note that contrary to the layout for the assembly interpreter the // expression stack allocated for the C++ interpreter is full sized. // However this is not as bad as it seems as the interpreter frame_manager -// will truncate the unused space on succesive method calls. +// will truncate the unused space on successive method calls. // // ------------------------------ C++ interpreter ---------------------------------------- @@ -167,10 +167,7 @@ #ifdef ASSERT // Used in frame::sender_for_{interpreter,compiled}_frame - static void verify_deopt_original_pc( nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false); - static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) { - verify_deopt_original_pc(nm, unextended_sp, true); - } + static void verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp); #endif public: diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 0f1839692d5..7f6a99ad2d6 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -94,7 +94,7 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) { // find_blob call. This is also why we can have no asserts on the validity // of the pc we find here. AsyncGetCallTrace -> pd_get_top_frame_for_signal_handler // -> pd_last_frame should use a specialized version of pd_last_frame which could - // call a specilaized frame constructor instead of this one. + // call a specialized frame constructor instead of this one. // Then we could use the assert below. However this assert is of somewhat dubious // value. // assert(_pc != NULL, "no pc?"); diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index c949433210f..758593ab77d 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,4 +58,9 @@ const bool CCallingConventionRequiresIntsAsLongs = false; #endif #endif +#if defined(COMPILER2) && !defined(JAVASE_EMBEDDED) +// Include Restricted Transactional Memory lock eliding optimization +#define INCLUDE_RTM_OPT 1 +#endif + #endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index a6d0fbbb336..372eed721ca 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -82,14 +82,13 @@ define_pd_global(size_t, CMSYoungGenPerWorker, 64*M); // default max size of CM define_pd_global(uintx, TypeProfileLevel, 111); +define_pd_global(bool, PreserveFramePointer, false); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ \ develop(bool, IEEEPrecision, true, \ "Enables IEEE precision (for INTEL only)") \ \ - product(intx, FenceInstruction, 0, \ - "(Unsafe,Unstable) Experimental") \ - \ product(bool, UseStoreImmI16, true, \ "Use store immediate 16-bits value instruction on x86") \ \ diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 32af915065d..ec36f2beaaf 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1958,6 +1958,11 @@ void MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg // Programmer's Guide and Specification" claims that an object locked by jni_monitorenter // should not be unlocked by "normal" java-level locking and vice-versa. The specification // doesn't specify what will occur if a program engages in such mixed-mode locking, however. +// Arguably given that the spec legislates the JNI case as undefined our implementation +// could reasonably *avoid* checking owner in Fast_Unlock(). +// In the interest of performance we elide m->Owner==Self check in unlock. +// A perfectly viable alternative is to elide the owner check except when +// Xcheck:jni is enabled. void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpReg, bool use_rtm) { assert(boxReg == rax, ""); @@ -1966,24 +1971,6 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR if (EmitSync & 4) { // Disable - inhibit all inlining. Force control through the slow-path cmpptr (rsp, 0); - } else - if (EmitSync & 8) { - Label DONE_LABEL; - if (UseBiasedLocking) { - biased_locking_exit(objReg, tmpReg, DONE_LABEL); - } - // Classic stack-locking code ... - // Check whether the displaced header is 0 - //(=> recursive unlock) - movptr(tmpReg, Address(boxReg, 0)); - testptr(tmpReg, tmpReg); - jccb(Assembler::zero, DONE_LABEL); - // If not recursive lock, reset the header to displaced header - if (os::is_MP()) { - lock(); - } - cmpxchgptr(tmpReg, Address(objReg, 0)); // Uses RAX which is box - bind(DONE_LABEL); } else { Label DONE_LABEL, Stacked, CheckSucc; @@ -2060,9 +2047,9 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR // the number of loads below (currently 4) to just 2 or 3. // Refer to the comments in synchronizer.cpp. // In practice the chain of fetches doesn't seem to impact performance, however. + xorptr(boxReg, boxReg); if ((EmitSync & 65536) == 0 && (EmitSync & 256)) { // Attempt to reduce branch density - AMD's branch predictor. - xorptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); @@ -2070,7 +2057,6 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); jmpb (DONE_LABEL); } else { - xorptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); jccb (Assembler::notZero, DONE_LABEL); movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); @@ -2093,10 +2079,8 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR bind (CheckSucc); // Optional pre-test ... it's safe to elide this - if ((EmitSync & 16) == 0) { - cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD); - jccb (Assembler::zero, LGoSlowPath); - } + cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD); + jccb(Assembler::zero, LGoSlowPath); // We have a classic Dekker-style idiom: // ST m->_owner = 0 ; MEMBAR; LD m->_succ @@ -2109,7 +2093,8 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR // In older IA32 processors MFENCE is slower than lock:add or xchg // particularly if the write-buffer is full as might be the case if // if stores closely precede the fence or fence-equivalent instruction. - // In more modern implementations MFENCE appears faster, however. + // See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences + // as the situation has changed with Nehalem and Shanghai. // (3) In lieu of an explicit fence, use lock:addl to the top-of-stack // The $lines underlying the top-of-stack should be in M-state. // The locked add instruction is serializing, of course. @@ -2126,11 +2111,7 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD); if (os::is_MP()) { - if (VM_Version::supports_sse2() && 1 == FenceInstruction) { - mfence(); - } else { - lock (); addptr(Address(rsp, 0), 0); - } + lock(); addptr(Address(rsp, 0), 0); } // Ratify _succ remains non-null cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), 0); @@ -2179,8 +2160,17 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR } #else // _LP64 // It's inflated - movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); - xorptr(boxReg, r15_thread); + if (EmitSync & 1024) { + // Emit code to check that _owner == Self + // We could fold the _owner test into subsequent code more efficiently + // than using a stand-alone check, but since _owner checking is off by + // default we don't bother. We also might consider predicating the + // _owner==Self check on Xcheck:jni or running on a debug build. + movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + xorptr(boxReg, r15_thread); + } else { + xorptr(boxReg, boxReg); + } orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); jccb (Assembler::notZero, DONE_LABEL); movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); @@ -2190,23 +2180,51 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR jmpb (DONE_LABEL); if ((EmitSync & 65536) == 0) { + // Try to avoid passing control into the slow_path ... Label LSuccess, LGoSlowPath ; bind (CheckSucc); + + // The following optional optimization can be elided if necessary + // Effectively: if (succ == null) goto SlowPath + // The code reduces the window for a race, however, + // and thus benefits performance. cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD); jccb (Assembler::zero, LGoSlowPath); - // I'd much rather use lock:andl m->_owner, 0 as it's faster than the - // the explicit ST;MEMBAR combination, but masm doesn't currently support - // "ANDQ M,IMM". Don't use MFENCE here. lock:add to TOS, xchg, etc - // are all faster when the write buffer is populated. - movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t)NULL_WORD); - if (os::is_MP()) { - lock (); addl (Address(rsp, 0), 0); + if ((EmitSync & 16) && os::is_MP()) { + orptr(boxReg, boxReg); + xchgptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); + } else { + movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), (int32_t)NULL_WORD); + if (os::is_MP()) { + // Memory barrier/fence + // Dekker pivot point -- fulcrum : ST Owner; MEMBAR; LD Succ + // Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack. + // This is faster on Nehalem and AMD Shanghai/Barcelona. + // See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences + // We might also restructure (ST Owner=0;barrier;LD _Succ) to + // (mov box,0; xchgq box, &m->Owner; LD _succ) . + lock(); addl(Address(rsp, 0), 0); + } } cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(succ)), (int32_t)NULL_WORD); jccb (Assembler::notZero, LSuccess); - movptr (boxReg, (int32_t)NULL_WORD); // box is really EAX + // Rare inopportune interleaving - race. + // The successor vanished in the small window above. + // The lock is contended -- (cxq|EntryList) != null -- and there's no apparent successor. + // We need to ensure progress and succession. + // Try to reacquire the lock. + // If that fails then the new owner is responsible for succession and this + // thread needs to take no further action and can exit via the fast path (success). + // If the re-acquire succeeds then pass control into the slow path. + // As implemented, this latter mode is horrible because we generated more + // coherence traffic on the lock *and* artifically extended the critical section + // length while by virtue of passing control into the slow path. + + // box is really RAX -- the following CMPXCHG depends on that binding + // cmpxchg R,[M] is equivalent to rax = CAS(M,rax,R) + movptr(boxReg, (int32_t)NULL_WORD); if (os::is_MP()) { lock(); } cmpxchgptr(r15_thread, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner))); jccb (Assembler::notEqual, LSuccess); @@ -2231,10 +2249,6 @@ void MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpR } #endif bind(DONE_LABEL); - // Avoid branch to branch on AMD processors - if (EmitSync & 32768) { - nop(); - } } } #endif // COMPILER2 @@ -6090,6 +6104,10 @@ void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_ // We always push rbp, so that on return to interpreter rbp, will be // restored correctly and we can correct the stack. push(rbp); + // Save caller's stack pointer into RBP if the frame pointer is preserved. + if (PreserveFramePointer) { + mov(rbp, rsp); + } // Remove word for ebp framesize -= wordSize; @@ -6104,6 +6122,11 @@ void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_ // Save RBP register now. framesize -= wordSize; movptr(Address(rsp, framesize), rbp); + // Save caller's stack pointer into RBP if the frame pointer is preserved. + if (PreserveFramePointer) { + movptr(rbp, rsp); + addptr(rbp, framesize + wordSize); + } } if (VerifyStackAtCalls) { // Majik cookie to verify stack depth @@ -6657,7 +6680,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, subl(cnt2, stride2); jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP); // clean upper bits of YMM registers - vzeroupper(); + vpxor(vec1, vec1); // compare wide vectors tail bind(COMPARE_WIDE_TAIL); @@ -6672,7 +6695,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, // Identifies the mismatching (higher or lower)16-bytes in the 32-byte vectors. bind(VECTOR_NOT_EQUAL); // clean upper bits of YMM registers - vzeroupper(); + vpxor(vec1, vec1); lea(str1, Address(str1, result, scale)); lea(str2, Address(str2, result, scale)); jmp(COMPARE_16_CHARS); @@ -6931,7 +6954,8 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist bind(DONE); if (UseAVX >= 2) { // clean upper bits of YMM registers - vzeroupper(); + vpxor(vec1, vec1); + vpxor(vec2, vec2); } } @@ -7065,7 +7089,8 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned, BIND(L_check_fill_8_bytes); // clean upper bits of YMM registers - vzeroupper(); + movdl(xtmp, value); + pshufd(xtmp, xtmp, 0); } else { // Fill 32-byte chunks pshufd(xtmp, xtmp, 0); @@ -7228,7 +7253,11 @@ void MacroAssembler::encode_iso_array(Register src, Register dst, Register len, bind(L_copy_16_chars_exit); if (UseAVX >= 2) { // clean upper bits of YMM registers - vzeroupper(); + vpxor(tmp2Reg, tmp2Reg); + vpxor(tmp3Reg, tmp3Reg); + vpxor(tmp4Reg, tmp4Reg); + movdl(tmp1Reg, tmp5); + pshufd(tmp1Reg, tmp1Reg, 0); } subptr(len, 8); jccb(Assembler::greater, L_copy_8_chars_exit); diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index b3776ed8c3f..65a2f3bf30b 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -374,7 +374,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, // member_reg - MemberName that was the trailing argument // temp1_recv_klass - klass of stacked receiver, if needed // rsi/r13 - interpreter linkage (if interpreted) - // rcx, rdx, rsi, rdi, r8, r8 - compiler arguments (if compiled) + // rcx, rdx, rsi, rdi, r8 - compiler arguments (if compiled) Label L_incompatible_class_change_error; switch (iid) { diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp index 1cc10d76622..36457cb8178 100644 --- a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp @@ -126,10 +126,6 @@ void OptoRuntime::generate_exception_blob() { // rax: exception handler for given - // Restore SP from BP if the exception PC is a MethodHandle call site. - __ cmpl(Address(rcx, JavaThread::is_method_handle_return_offset()), 0); - __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); - // We have a handler in rax, (could be deopt blob) // rdx - throwing pc, deopt blob will need it. diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index a4b8fbc8cfd..a0c39dd4dca 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2343,12 +2343,14 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // should be a peal // +wordSize because of the push above + // args are (oop obj, BasicLock* lock, JavaThread* thread) + __ push(thread); __ lea(rax, Address(rbp, lock_slot_rbp_offset)); __ push(rax); __ push(obj_reg); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C))); - __ addptr(rsp, 2*wordSize); + __ addptr(rsp, 3*wordSize); #ifdef ASSERT { Label L; diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index afc137b69c2..0d27447c49e 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2581,6 +2581,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ lea(c_rarg1, Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size)); __ mov(c_rarg0, obj_reg); + __ mov(c_rarg2, r15_thread); __ mov(r12, rsp); // remember sp __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows __ andptr(rsp, -16); // align stack as required by ABI @@ -2590,6 +2591,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ movptr(rbx, Address(r15_thread, in_bytes(Thread::pending_exception_offset()))); __ movptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD); + // args are (oop obj, BasicLock* lock, JavaThread* thread) __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C))); __ mov(rsp, r12); // restore sp __ reinit_heapbase(); @@ -3393,8 +3395,8 @@ void OptoRuntime::generate_exception_blob() { // Save callee-saved registers. See x86_64.ad. - // rbp is an implicitly saved callee saved register (i.e. the calling - // convention will save restore it in prolog/epilog) Other than that + // rbp is an implicitly saved callee saved register (i.e., the calling + // convention will save/restore it in the prolog/epilog). Other than that // there are no callee save registers now that adapter frames are gone. __ movptr(Address(rsp, SimpleRuntimeFrame::rbp_off << LogBytesPerInt), rbp); @@ -3436,9 +3438,9 @@ void OptoRuntime::generate_exception_blob() { // Restore callee-saved registers - // rbp is an implicitly saved callee saved register (i.e. the calling + // rbp is an implicitly saved callee-saved register (i.e., the calling // convention will save restore it in prolog/epilog) Other than that - // there are no callee save registers no that adapter frames are gone. + // there are no callee save registers now that adapter frames are gone. __ movptr(rbp, Address(rsp, SimpleRuntimeFrame::rbp_off << LogBytesPerInt)); @@ -3447,10 +3449,6 @@ void OptoRuntime::generate_exception_blob() { // rax: exception handler - // Restore SP from BP if the exception PC is a MethodHandle call site. - __ cmpl(Address(r15_thread, JavaThread::is_method_handle_return_offset()), 0); - __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); - // We have a handler in rax (could be deopt blob). __ mov(r8, rax); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 3d8370f2c5e..9cbffb37176 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -835,7 +835,8 @@ class StubGenerator: public StubCodeGenerator { if (UseUnalignedLoadStores && (UseAVX >= 2)) { // clean upper bits of YMM registers - __ vzeroupper(); + __ vpxor(xmm0, xmm0); + __ vpxor(xmm1, xmm1); } __ addl(qword_count, 8); __ jccb(Assembler::zero, L_exit); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 122f94b5d20..5ac6727dce0 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -1352,7 +1352,8 @@ class StubGenerator: public StubCodeGenerator { __ BIND(L_end); if (UseAVX >= 2) { // clean upper bits of YMM registers - __ vzeroupper(); + __ vpxor(xmm0, xmm0); + __ vpxor(xmm1, xmm1); } } else { // Copy 32-bytes per iteration @@ -1429,7 +1430,8 @@ class StubGenerator: public StubCodeGenerator { __ BIND(L_end); if (UseAVX >= 2) { // clean upper bits of YMM registers - __ vzeroupper(); + __ vpxor(xmm0, xmm0); + __ vpxor(xmm1, xmm1); } } else { // Copy 32-bytes per iteration diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp index f43903c7ae4..f9756cc89e7 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp @@ -543,8 +543,16 @@ void TemplateTable::locals_index(Register reg, int offset) { } void TemplateTable::iload() { + iload_internal(); +} + +void TemplateTable::nofast_iload() { + iload_internal(may_not_rewrite); +} + +void TemplateTable::iload_internal(RewriteControl rc) { transition(vtos, itos); - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label rewrite, done; const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); LP64_ONLY(assert(rbx != bc, "register damaged")); @@ -815,6 +823,14 @@ void TemplateTable::aload(int n) { } void TemplateTable::aload_0() { + aload_0_internal(); +} + +void TemplateTable::nofast_aload_0() { + aload_0_internal(may_not_rewrite); +} + +void TemplateTable::aload_0_internal(RewriteControl rc) { transition(vtos, atos); // According to bytecode histograms, the pairs: // @@ -837,7 +853,7 @@ void TemplateTable::aload_0() { // aload_0, iload_1 // These bytecodes with a small amount of code are most profitable // to rewrite - if (RewriteFrequentPairs) { + if (RewriteFrequentPairs && rc == may_rewrite) { Label rewrite, done; const Register bc = LP64_ONLY(c_rarg3) NOT_LP64(rcx); @@ -2491,29 +2507,21 @@ void TemplateTable::resolve_cache_and_index(int byte_no, assert_different_registers(Rcache, index, temp); Label resolved; - assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); - __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size); - __ cmpl(temp, (int) bytecode()); // have we resolved this bytecode? - __ jcc(Assembler::equal, resolved); + + Bytecodes::Code code = bytecode(); + switch (code) { + case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break; + case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break; + } + + assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range"); + __ get_cache_and_index_and_bytecode_at_bcp(Rcache, index, temp, byte_no, 1, index_size); + __ cmpl(temp, code); // have we resolved this bytecode? + __ jcc(Assembler::equal, resolved); // resolve first time through - address entry; - switch (bytecode()) { - case Bytecodes::_getstatic : // fall through - case Bytecodes::_putstatic : // fall through - case Bytecodes::_getfield : // fall through - case Bytecodes::_putfield : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_get_put); break; - case Bytecodes::_invokevirtual : // fall through - case Bytecodes::_invokespecial : // fall through - case Bytecodes::_invokestatic : // fall through - case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; - case Bytecodes::_invokehandle : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokehandle); break; - case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; - default: - fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode()))); - break; - } - __ movl(temp, (int)bytecode()); + address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache); + __ movl(temp, code); __ call_VM(noreg, entry, temp); // Update registers with resolved info __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size); @@ -2628,7 +2636,7 @@ void TemplateTable::pop_and_check_object(Register r) { __ verify_oop(r); } -void TemplateTable::getfield_or_static(int byte_no, bool is_static) { +void TemplateTable::getfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); const Register cache = rcx; @@ -2660,7 +2668,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ load_signed_byte(rax, field); __ push(btos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bgetfield, bc, rbx); } __ jmp(Done); @@ -2671,7 +2679,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { // atos __ load_heap_oop(rax, field); __ push(atos); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_agetfield, bc, rbx); } __ jmp(Done); @@ -2683,7 +2691,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ movl(rax, field); __ push(itos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_igetfield, bc, rbx); } __ jmp(Done); @@ -2695,7 +2703,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ load_unsigned_short(rax, field); __ push(ctos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cgetfield, bc, rbx); } __ jmp(Done); @@ -2707,7 +2715,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ load_signed_short(rax, field); __ push(stos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sgetfield, bc, rbx); } __ jmp(Done); @@ -2731,7 +2739,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { __ push(ltos); // Rewrite bytecode to be faster - LP64_ONLY(if (!is_static) patch_bytecode(Bytecodes::_fast_lgetfield, bc, rbx)); + LP64_ONLY(if (!is_static && rc == may_rewrite) patch_bytecode(Bytecodes::_fast_lgetfield, bc, rbx)); __ jmp(Done); __ bind(notLong); @@ -2743,7 +2751,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { NOT_LP64(__ fld_s(field)); __ push(ftos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fgetfield, bc, rbx); } __ jmp(Done); @@ -2758,7 +2766,7 @@ void TemplateTable::getfield_or_static(int byte_no, bool is_static) { NOT_LP64(__ fld_d(field)); __ push(dtos); // Rewrite bytecode to be faster - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dgetfield, bc, rbx); } #ifdef ASSERT @@ -2779,6 +2787,10 @@ void TemplateTable::getfield(int byte_no) { getfield_or_static(byte_no, false); } +void TemplateTable::nofast_getfield(int byte_no) { + getfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::getstatic(int byte_no) { getfield_or_static(byte_no, true); } @@ -2870,7 +2882,7 @@ void TemplateTable::jvmti_post_field_mod(Register cache, Register index, bool is } } -void TemplateTable::putfield_or_static(int byte_no, bool is_static) { +void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteControl rc) { transition(vtos, vtos); const Register cache = rcx; @@ -2911,7 +2923,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(btos); if (!is_static) pop_and_check_object(obj); __ movb(field, rax); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_bputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -2927,7 +2939,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { if (!is_static) pop_and_check_object(obj); // Store into the field do_oop_store(_masm, field, rax, _bs->kind(), false); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_aputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -2942,7 +2954,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(itos); if (!is_static) pop_and_check_object(obj); __ movl(field, rax); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_iputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -2957,7 +2969,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ctos); if (!is_static) pop_and_check_object(obj); __ movw(field, rax); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_cputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -2972,7 +2984,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(stos); if (!is_static) pop_and_check_object(obj); __ movw(field, rax); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_sputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -2988,7 +3000,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { __ pop(ltos); if (!is_static) pop_and_check_object(obj); __ movq(field, rax); - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_lputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -3035,7 +3047,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { if (!is_static) pop_and_check_object(obj); NOT_LP64( __ fstp_s(field);) LP64_ONLY( __ movflt(field, xmm0);) - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_fputfield, bc, rbx, true, byte_no); } __ jmp(Done); @@ -3053,7 +3065,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static) { if (!is_static) pop_and_check_object(obj); NOT_LP64( __ fstp_d(field);) LP64_ONLY( __ movdbl(field, xmm0);) - if (!is_static) { + if (!is_static && rc == may_rewrite) { patch_bytecode(Bytecodes::_fast_dputfield, bc, rbx, true, byte_no); } } @@ -3079,6 +3091,10 @@ void TemplateTable::putfield(int byte_no) { putfield_or_static(byte_no, false); } +void TemplateTable::nofast_putfield(int byte_no) { + putfield_or_static(byte_no, false, may_not_rewrite); +} + void TemplateTable::putstatic(int byte_no) { putfield_or_static(byte_no, true); } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86.hpp similarity index 89% rename from hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp rename to hotspot/src/cpu/x86/vm/templateTable_x86.hpp index dea3d7f5aaf..f8af9b2ba11 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#ifndef CPU_X86_VM_TEMPLATETABLE_X86_32_HPP -#define CPU_X86_VM_TEMPLATETABLE_X86_32_HPP +#ifndef CPU_X86_VM_TEMPLATETABLE_X86_HPP +#define CPU_X86_VM_TEMPLATETABLE_X86_HPP static void prepare_invoke(int byte_no, Register method, // linked method (or i-klass) @@ -39,4 +39,4 @@ static void index_check(Register array, Register index); static void index_check_without_pop(Register array, Register index); -#endif // CPU_X86_VM_TEMPLATETABLE_X86_32_HPP +#endif // CPU_X86_VM_TEMPLATETABLE_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp deleted file mode 100644 index fa506a094f8..00000000000 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_TEMPLATETABLE_X86_64_HPP -#define CPU_X86_VM_TEMPLATETABLE_X86_64_HPP - - static void prepare_invoke(int byte_no, - Register method, // linked method (or i-klass) - Register index = noreg, // itable index, MethodType, etc. - Register recv = noreg, // if caller wants to see it - Register flags = noreg // if caller wants to test it - ); - static void invokevirtual_helper(Register index, Register recv, - Register flags); - static void volatile_barrier(Assembler::Membar_mask_bits order_constraint); - - // Helpers - static void index_check(Register array, Register index); - static void index_check_without_pop(Register array, Register index); - -#endif // CPU_X86_VM_TEMPLATETABLE_X86_64_HPP diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index e702cf8dd02..61267632209 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -379,15 +379,6 @@ class VM_Version_StubGenerator: public StubCodeGenerator { }; }; - -void VM_Version::get_cpu_info_wrapper() { - get_cpu_info_stub(&_cpuid_info); -} - -#ifndef CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() -#endif - void VM_Version::get_processor_features() { _cpu = 4; // 486 by default @@ -401,9 +392,7 @@ void VM_Version::get_processor_features() { if (!Use486InstrsOnly) { // Get raw processor info - // Some platforms (like Win*) need a wrapper around here - // in order to properly handle SEGV for YMM registers test. - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(get_cpu_info_wrapper); + get_cpu_info_stub(&_cpuid_info); assert_is_initialized(); _cpu = extended_cpu_family(); @@ -980,6 +969,11 @@ void VM_Version::get_processor_features() { (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; + // This machine allows unaligned memory accesses + if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { + FLAG_SET_DEFAULT(UseUnalignedAccesses, true); + } + #ifndef PRODUCT if (PrintMiscellaneous && Verbose) { tty->print_cr("Logical CPUs per core: %u", diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index 42cc708a610..5c99066206e 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -490,7 +490,7 @@ source_hpp %{ class NativeJump; class CallStubImpl { - + //-------------------------------------------------------------- //---< Used for optimization in Compile::shorten_branches >--- //-------------------------------------------------------------- @@ -500,9 +500,9 @@ class CallStubImpl { static uint size_call_trampoline() { return 0; // no call trampolines on this platform } - + // number of relocations needed by a call trampoline stub - static uint reloc_call_trampoline() { + static uint reloc_call_trampoline() { return 0; // no call trampolines on this platform } }; @@ -623,6 +623,22 @@ const bool Matcher::match_rule_supported(int opcode) { if ((UseSSE < 4) && (UseAVX < 1)) // only with SSE4_1 or AVX return false; break; + case Op_AddReductionVL: + if (UseAVX < 3) // only EVEX : vector connectivity becomes an issue here + return false; + case Op_AddReductionVI: + if (UseSSE < 3) // requires at least SSE3 + return false; + case Op_MulReductionVI: + if (UseSSE < 4) // requires at least SSE4 + return false; + case Op_AddReductionVF: + case Op_AddReductionVD: + case Op_MulReductionVF: + case Op_MulReductionVD: + if (UseSSE < 1) // requires at least SSE + return false; + break; case Op_CompareAndSwapL: #ifdef _LP64 case Op_CompareAndSwapP: @@ -914,21 +930,6 @@ static inline jdouble replicate8_imm(int con, int width) { encode %{ - enc_class preserve_SP %{ - debug_only(int off0 = cbuf.insts_size()); - MacroAssembler _masm(&cbuf); - // RBP is preserved across all calls, even compiled calls. - // Use it to preserve RSP in places where the callee might change the SP. - __ movptr(rbp_mh_SP_save, rsp); - debug_only(int off1 = cbuf.insts_size()); - assert(off1 - off0 == preserve_SP_size(), "correct size prediction"); - %} - - enc_class restore_SP %{ - MacroAssembler _masm(&cbuf); - __ movptr(rsp, rbp_mh_SP_save); - %} - enc_class call_epilog %{ if (VerifyStackAtCalls) { // Check that stack depth is unchanged: find majik cookie on stack @@ -2532,6 +2533,574 @@ instruct Repl4D_zero(vecY dst, immD0 zero) %{ ins_pipe( fpu_reg_reg ); %} +// ====================REDUCTION ARITHMETIC======================================= + +instruct rsadd2I_reduction_reg(rRegI dst, rRegI src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseSSE > 2 && UseAVX == 0); + match(Set dst (AddReductionVI src1 src2)); + effect(TEMP tmp2, TEMP tmp); + format %{ "movdqu $tmp2,$src2\n\t" + "phaddd $tmp2,$tmp2\n\t" + "movd $tmp,$src1\n\t" + "paddd $tmp,$tmp2\n\t" + "movd $dst,$tmp\t! add reduction2I" %} + ins_encode %{ + __ movdqu($tmp2$$XMMRegister, $src2$$XMMRegister); + __ phaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister); + __ movdl($tmp$$XMMRegister, $src1$$Register); + __ paddd($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdl($dst$$Register, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd2I_reduction_reg(rRegI dst, rRegI src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vphaddd $tmp,$src2,$src2\n\t" + "movd $tmp2,$src1\n\t" + "vpaddd $tmp2,$tmp2,$tmp\n\t" + "movd $dst,$tmp2\t! add reduction2I" %} + ins_encode %{ + __ vphaddd($tmp$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsadd4I_reduction_reg(rRegI dst, rRegI src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseSSE > 2 && UseAVX == 0); + match(Set dst (AddReductionVI src1 src2)); + effect(TEMP tmp2, TEMP tmp); + format %{ "movdqu $tmp2,$src2\n\t" + "phaddd $tmp2,$tmp2\n\t" + "phaddd $tmp2,$tmp2\n\t" + "movd $tmp,$src1\n\t" + "paddd $tmp,$tmp2\n\t" + "movd $dst,$tmp\t! add reduction4I" %} + ins_encode %{ + __ movdqu($tmp2$$XMMRegister, $src2$$XMMRegister); + __ phaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister); + __ phaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister); + __ movdl($tmp$$XMMRegister, $src1$$Register); + __ paddd($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdl($dst$$Register, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd4I_reduction_reg(rRegI dst, rRegI src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vphaddd $tmp,$src2,$src2\n\t" + "vphaddd $tmp,$tmp,$tmp2\n\t" + "movd $tmp2,$src1\n\t" + "vpaddd $tmp2,$tmp2,$tmp\n\t" + "movd $dst,$tmp2\t! add reduction4I" %} + ins_encode %{ + __ vphaddd($tmp$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, false); + __ vphaddd($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd8I_reduction_reg(rRegI dst, rRegI src1, vecY src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vphaddd $tmp,$src2,$src2\n\t" + "vphaddd $tmp,$tmp,$tmp2\n\t" + "vextractf128 $tmp2,$tmp\n\t" + "vpaddd $tmp,$tmp,$tmp2\n\t" + "movd $tmp2,$src1\n\t" + "vpaddd $tmp2,$tmp2,$tmp\n\t" + "movd $dst,$tmp2\t! add reduction8I" %} + ins_encode %{ + __ vphaddd($tmp$$XMMRegister, $src2$$XMMRegister, $src2$$XMMRegister, true); + __ vphaddd($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, true); + __ vextractf128h($tmp2$$XMMRegister, $tmp$$XMMRegister); + __ vpaddd($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpaddd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsadd2F_reduction_reg(regF dst, regF src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (AddReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "movdqu $tmp,$src1\n\t" + "addss $tmp,$src2\n\t" + "pshufd $tmp2,$src2,0x01\n\t" + "addss $tmp,$tmp2\n\t" + "movdqu $dst,$tmp\t! add reduction2F" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ addss($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x01); + __ addss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdqu($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd2F_reduction_reg(regF dst, regF src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVF src1 src2)); + effect(TEMP tmp2, TEMP tmp); + format %{ "vaddss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vaddss $dst,$tmp2,$tmp\t! add reduction2F" %} + ins_encode %{ + __ vaddss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vaddss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsadd4F_reduction_reg(regF dst, regF src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (AddReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "movdqu $tmp,$src1\n\t" + "addss $tmp,$src2\n\t" + "pshufd $tmp2,$src2,0x01\n\t" + "addss $tmp,$tmp2\n\t" + "pshufd $tmp2,$src2,0x02\n\t" + "addss $tmp,$tmp2\n\t" + "pshufd $tmp2,$src2,0x03\n\t" + "addss $tmp,$tmp2\n\t" + "movdqu $dst,$tmp\t! add reduction4F" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ addss($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x01); + __ addss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x02); + __ addss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x03); + __ addss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdqu($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd4F_reduction_reg(regF dst, regF src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vaddss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x02\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x03\n\t" + "vaddss $dst,$tmp2,$tmp\t! add reduction4F" %} + ins_encode %{ + __ vaddss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03); + __ vaddss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct radd8F_reduction_reg(regF dst, regF src1, vecY src2, regF tmp, regF tmp2, regF tmp3) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2, TEMP tmp3); + format %{ "vaddss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x02\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x03\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "vextractf128 $tmp3,$src2\n\t" + "vaddss $tmp2,$tmp2,$tmp3\n\t" + "pshufd $tmp,$tmp3,0x01\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$tmp3,0x02\n\t" + "vaddss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$tmp3,0x03\n\t" + "vaddss $dst,$tmp2,$tmp\t! add reduction8F" %} + ins_encode %{ + __ vaddss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ vextractf128h($tmp3$$XMMRegister, $src2$$XMMRegister); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x01); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x02); + __ vaddss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x03); + __ vaddss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsadd2D_reduction_reg(regD dst, regD src1, vecX src2, regD tmp) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (AddReductionVD src1 src2)); + effect(TEMP tmp, TEMP dst); + format %{ "movdqu $tmp,$src1\n\t" + "addsd $tmp,$src2\n\t" + "pshufd $dst,$src2,0xE\n\t" + "addsd $dst,$tmp\t! add reduction2D" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ addsd($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($dst$$XMMRegister, $src2$$XMMRegister, 0xE); + __ addsd($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd2D_reduction_reg(regD dst, regD src1, vecX src2, regD tmp, regD tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVD src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vaddsd $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0xE\n\t" + "vaddsd $dst,$tmp2,$tmp\t! add reduction2D" %} + ins_encode %{ + __ vaddsd($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE); + __ vaddsd($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvadd4D_reduction_reg(regD dst, regD src1, vecY src2, regD tmp, regD tmp2, regD tmp3) %{ + predicate(UseAVX > 0); + match(Set dst (AddReductionVD src1 src2)); + effect(TEMP tmp, TEMP tmp2, TEMP tmp3); + format %{ "vaddsd $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0xE\n\t" + "vaddsd $tmp2,$tmp2,$tmp\n\t" + "vextractf128 $tmp3,$src2\n\t" + "vaddsd $tmp2,$tmp2,$tmp3\n\t" + "pshufd $tmp,$tmp3,0xE\n\t" + "vaddsd $dst,$tmp2,$tmp\t! add reduction4D" %} + ins_encode %{ + __ vaddsd($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE); + __ vaddsd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ vextractf128h($tmp3$$XMMRegister, $src2$$XMMRegister); + __ vaddsd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0xE); + __ vaddsd($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsmul2I_reduction_reg(rRegI dst, rRegI src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseSSE > 3 && UseAVX == 0); + match(Set dst (MulReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "pshufd $tmp2,$src2,0x1\n\t" + "pmulld $tmp2,$src2\n\t" + "movd $tmp,$src1\n\t" + "pmulld $tmp2,$tmp\n\t" + "movd $dst,$tmp2\t! mul reduction2I" %} + ins_encode %{ + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1); + __ pmulld($tmp2$$XMMRegister, $src2$$XMMRegister); + __ movdl($tmp$$XMMRegister, $src1$$Register); + __ pmulld($tmp2$$XMMRegister, $tmp$$XMMRegister); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul2I_reduction_reg(rRegI dst, rRegI src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "pshufd $tmp2,$src2,0x1\n\t" + "vpmulld $tmp,$src2,$tmp2\n\t" + "movd $tmp2,$src1\n\t" + "vpmulld $tmp2,$tmp,$tmp2\n\t" + "movd $dst,$tmp2\t! mul reduction2I" %} + ins_encode %{ + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x1); + __ vpmulld($tmp$$XMMRegister, $src2$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpmulld($tmp2$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsmul4I_reduction_reg(rRegI dst, rRegI src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseSSE > 3 && UseAVX == 0); + match(Set dst (MulReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "pshufd $tmp2,$src2,0xE\n\t" + "pmulld $tmp2,$src2\n\t" + "pshufd $tmp,$tmp2,0x1\n\t" + "pmulld $tmp2,$tmp\n\t" + "movd $tmp,$src1\n\t" + "pmulld $tmp2,$tmp\n\t" + "movd $dst,$tmp2\t! mul reduction4I" %} + ins_encode %{ + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0xE); + __ pmulld($tmp2$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp2$$XMMRegister, 0x1); + __ pmulld($tmp2$$XMMRegister, $tmp$$XMMRegister); + __ movdl($tmp$$XMMRegister, $src1$$Register); + __ pmulld($tmp2$$XMMRegister, $tmp$$XMMRegister); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul4I_reduction_reg(rRegI dst, rRegI src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "pshufd $tmp2,$src2,0xE\n\t" + "vpmulld $tmp,$src2,$tmp2\n\t" + "pshufd $tmp2,$tmp,0x1\n\t" + "vpmulld $tmp,$tmp,$tmp2\n\t" + "movd $tmp2,$src1\n\t" + "vpmulld $tmp2,$tmp,$tmp2\n\t" + "movd $dst,$tmp2\t! mul reduction4I" %} + ins_encode %{ + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0xE); + __ vpmulld($tmp$$XMMRegister, $src2$$XMMRegister, $tmp2$$XMMRegister, false); + __ pshufd($tmp2$$XMMRegister, $tmp$$XMMRegister, 0x1); + __ vpmulld($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpmulld($tmp2$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul8I_reduction_reg(rRegI dst, rRegI src1, vecY src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVI src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vextractf128 $tmp,$src2\n\t" + "vpmulld $tmp,$tmp,$src2\n\t" + "pshufd $tmp2,$tmp,0xE\n\t" + "vpmulld $tmp,$tmp,$tmp2\n\t" + "pshufd $tmp2,$tmp,0x1\n\t" + "vpmulld $tmp,$tmp,$tmp2\n\t" + "movd $tmp2,$src1\n\t" + "vpmulld $tmp2,$tmp,$tmp2\n\t" + "movd $dst,$tmp2\t! mul reduction8I" %} + ins_encode %{ + __ vextractf128h($tmp$$XMMRegister, $src2$$XMMRegister); + __ vpmulld($tmp$$XMMRegister, $tmp$$XMMRegister, $src2$$XMMRegister, false); + __ pshufd($tmp2$$XMMRegister, $tmp$$XMMRegister, 0xE); + __ vpmulld($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ pshufd($tmp2$$XMMRegister, $tmp$$XMMRegister, 0x1); + __ vpmulld($tmp$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($tmp2$$XMMRegister, $src1$$Register); + __ vpmulld($tmp2$$XMMRegister, $tmp$$XMMRegister, $tmp2$$XMMRegister, false); + __ movdl($dst$$Register, $tmp2$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsmul2F_reduction_reg(regF dst, regF src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (MulReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "movdqu $tmp,$src1\n\t" + "mulss $tmp,$src2\n\t" + "pshufd $tmp2,$src2,0x01\n\t" + "mulss $tmp,$tmp2\n\t" + "movdqu $dst,$tmp\t! add reduction2F" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ mulss($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x01); + __ mulss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdqu($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul2F_reduction_reg(regF dst, regF src1, vecD src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vmulss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vmulss $dst,$tmp2,$tmp\t! add reduction2F" %} + ins_encode %{ + __ vmulss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vmulss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsmul4F_reduction_reg(regF dst, regF src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (MulReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "movdqu $tmp,$src1\n\t" + "mulss $tmp,$src2\n\t" + "pshufd $tmp2,$src2,0x01\n\t" + "mulss $tmp,$tmp2\n\t" + "pshufd $tmp2,$src2,0x02\n\t" + "mulss $tmp,$tmp2\n\t" + "pshufd $tmp2,$src2,0x03\n\t" + "mulss $tmp,$tmp2\n\t" + "movdqu $dst,$tmp\t! add reduction4F" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ mulss($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x01); + __ mulss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x02); + __ mulss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ pshufd($tmp2$$XMMRegister, $src2$$XMMRegister, 0x03); + __ mulss($tmp$$XMMRegister, $tmp2$$XMMRegister); + __ movdqu($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul4F_reduction_reg(regF dst, regF src1, vecX src2, regF tmp, regF tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vmulss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x02\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x03\n\t" + "vmulss $dst,$tmp2,$tmp\t! add reduction4F" %} + ins_encode %{ + __ vmulss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03); + __ vmulss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul8F_reduction_reg(regF dst, regF src1, vecY src2, regF tmp, regF tmp2, regF tmp3) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVF src1 src2)); + effect(TEMP tmp, TEMP tmp2, TEMP tmp3); + format %{ "vmulss $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0x01\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x02\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$src2,0x03\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "vextractf128 $tmp3,$src2\n\t" + "vmulss $tmp2,$tmp2,$tmp3\n\t" + "pshufd $tmp,$tmp3,0x01\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$tmp3,0x02\n\t" + "vmulss $tmp2,$tmp2,$tmp\n\t" + "pshufd $tmp,$tmp3,0x03\n\t" + "vmulss $dst,$tmp2,$tmp\t! mul reduction8F" %} + ins_encode %{ + __ vmulss($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x01); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x02); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0x03); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ vextractf128h($tmp3$$XMMRegister, $src2$$XMMRegister); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x01); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x02); + __ vmulss($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0x03); + __ vmulss($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rsmul2D_reduction_reg(regD dst, regD src1, vecX src2, regD tmp) %{ + predicate(UseSSE >= 1 && UseAVX == 0); + match(Set dst (MulReductionVD src1 src2)); + effect(TEMP tmp, TEMP dst); + format %{ "movdqu $tmp,$src1\n\t" + "mulsd $tmp,$src2\n\t" + "pshufd $dst,$src2,0xE\n\t" + "mulsd $dst,$tmp\t! add reduction2D" %} + ins_encode %{ + __ movdqu($tmp$$XMMRegister, $src1$$XMMRegister); + __ mulsd($tmp$$XMMRegister, $src2$$XMMRegister); + __ pshufd($dst$$XMMRegister, $src2$$XMMRegister, 0xE); + __ mulsd($dst$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul2D_reduction_reg(regD dst, regD src1, vecX src2, regD tmp, regD tmp2) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVD src1 src2)); + effect(TEMP tmp, TEMP tmp2); + format %{ "vmulsd $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0xE\n\t" + "vmulsd $dst,$tmp2,$tmp\t! mul reduction2D" %} + ins_encode %{ + __ vmulsd($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE); + __ vmulsd($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct rvmul4D_reduction_reg(regD dst, regD src1, vecY src2, regD tmp, regD tmp2, regD tmp3) %{ + predicate(UseAVX > 0); + match(Set dst (MulReductionVD src1 src2)); + effect(TEMP tmp, TEMP tmp2, TEMP tmp3); + format %{ "vmulsd $tmp2,$src1,$src2\n\t" + "pshufd $tmp,$src2,0xE\n\t" + "vmulsd $tmp2,$tmp2,$tmp\n\t" + "vextractf128 $tmp3,$src2\n\t" + "vmulsd $tmp2,$tmp2,$tmp3\n\t" + "pshufd $tmp,$tmp3,0xE\n\t" + "vmulsd $dst,$tmp2,$tmp\t! mul reduction4D" %} + ins_encode %{ + __ vmulsd($tmp2$$XMMRegister, $src1$$XMMRegister, $src2$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $src2$$XMMRegister, 0xE); + __ vmulsd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + __ vextractf128h($tmp3$$XMMRegister, $src2$$XMMRegister); + __ vmulsd($tmp2$$XMMRegister, $tmp2$$XMMRegister, $tmp3$$XMMRegister); + __ pshufd($tmp$$XMMRegister, $tmp3$$XMMRegister, 0xE); + __ vmulsd($dst$$XMMRegister, $tmp2$$XMMRegister, $tmp$$XMMRegister); + %} + ins_pipe( pipe_slow ); +%} + // ====================VECTOR ARITHMETIC======================================= // --------------------------------- ADD -------------------------------------- diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index e8b54389258..709c908c3b4 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -123,50 +123,94 @@ alloc_class chunk0( ECX, EBX, EBP, EDI, EAX, EDX, ESI, ESP, // 2) reg_class interpreter_method_oop_reg ( /* as def'd in frame section */ ) // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ ) // +// Class for no registers (empty set). +reg_class no_reg(); + // Class for all registers -reg_class any_reg(EAX, EDX, EBP, EDI, ESI, ECX, EBX, ESP); +reg_class any_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, ECX, EBX, ESP); +// Class for all registers (excluding EBP) +reg_class any_reg_no_ebp(EAX, EDX, EDI, ESI, ECX, EBX, ESP); +// Dynamic register class that selects at runtime between register classes +// any_reg and any_no_ebp_reg (depending on the value of the flag PreserveFramePointer). +// Equivalent to: return PreserveFramePointer ? any_no_ebp_reg : any_reg; +reg_class_dynamic any_reg(any_reg_no_ebp, any_reg_with_ebp, %{ PreserveFramePointer %}); + // Class for general registers -reg_class int_reg(EAX, EDX, EBP, EDI, ESI, ECX, EBX); -// Class for general registers which may be used for implicit null checks on win95 -// Also safe for use by tailjump. We don't want to allocate in rbp, -reg_class int_reg_no_rbp(EAX, EDX, EDI, ESI, ECX, EBX); +reg_class int_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, ECX, EBX); +// Class for general registers (excluding EBP). +// This register class can be used for implicit null checks on win95. +// It is also safe for use by tailjumps (we don't want to allocate in ebp). +// Used also if the PreserveFramePointer flag is true. +reg_class int_reg_no_ebp(EAX, EDX, EDI, ESI, ECX, EBX); +// Dynamic register class that selects between int_reg and int_reg_no_ebp. +reg_class_dynamic int_reg(int_reg_no_ebp, int_reg_with_ebp, %{ PreserveFramePointer %}); + // Class of "X" registers reg_class int_x_reg(EBX, ECX, EDX, EAX); + // Class of registers that can appear in an address with no offset. // EBP and ESP require an extra instruction byte for zero offset. // Used in fast-unlock reg_class p_reg(EDX, EDI, ESI, EBX); -// Class for general registers not including ECX -reg_class ncx_reg(EAX, EDX, EBP, EDI, ESI, EBX); -// Class for general registers not including EAX + +// Class for general registers excluding ECX +reg_class ncx_reg_with_ebp(EAX, EDX, EBP, EDI, ESI, EBX); +// Class for general registers excluding ECX (and EBP) +reg_class ncx_reg_no_ebp(EAX, EDX, EDI, ESI, EBX); +// Dynamic register class that selects between ncx_reg and ncx_reg_no_ebp. +reg_class_dynamic ncx_reg(ncx_reg_no_ebp, ncx_reg_with_ebp, %{ PreserveFramePointer %}); + +// Class for general registers excluding EAX reg_class nax_reg(EDX, EDI, ESI, ECX, EBX); -// Class for general registers not including EAX or EBX. -reg_class nabx_reg(EDX, EDI, ESI, ECX, EBP); + +// Class for general registers excluding EAX and EBX. +reg_class nabx_reg_with_ebp(EDX, EDI, ESI, ECX, EBP); +// Class for general registers excluding EAX and EBX (and EBP) +reg_class nabx_reg_no_ebp(EDX, EDI, ESI, ECX); +// Dynamic register class that selects between nabx_reg and nabx_reg_no_ebp. +reg_class_dynamic nabx_reg(nabx_reg_no_ebp, nabx_reg_with_ebp, %{ PreserveFramePointer %}); + // Class of EAX (for multiply and divide operations) reg_class eax_reg(EAX); + // Class of EBX (for atomic add) reg_class ebx_reg(EBX); + // Class of ECX (for shift and JCXZ operations and cmpLTMask) reg_class ecx_reg(ECX); + // Class of EDX (for multiply and divide operations) reg_class edx_reg(EDX); + // Class of EDI (for synchronization) reg_class edi_reg(EDI); + // Class of ESI (for synchronization) reg_class esi_reg(ESI); -// Singleton class for interpreter's stack pointer -reg_class ebp_reg(EBP); + // Singleton class for stack pointer reg_class sp_reg(ESP); + // Singleton class for instruction pointer // reg_class ip_reg(EIP); + // Class of integer register pairs -reg_class long_reg( EAX,EDX, ECX,EBX, EBP,EDI ); +reg_class long_reg_with_ebp( EAX,EDX, ECX,EBX, EBP,EDI ); +// Class of integer register pairs (excluding EBP and EDI); +reg_class long_reg_no_ebp( EAX,EDX, ECX,EBX ); +// Dynamic register class that selects between long_reg and long_reg_no_ebp. +reg_class_dynamic long_reg(long_reg_no_ebp, long_reg_with_ebp, %{ PreserveFramePointer %}); + // Class of integer register pairs that aligns with calling convention reg_class eadx_reg( EAX,EDX ); reg_class ebcx_reg( ECX,EBX ); + // Not AX or DX, used in divides -reg_class nadx_reg( EBX,ECX,ESI,EDI,EBP ); +reg_class nadx_reg_with_ebp(EBX, ECX, ESI, EDI, EBP); +// Not AX or DX (and neither EBP), used in divides +reg_class nadx_reg_no_ebp(EBX, ECX, ESI, EDI); +// Dynamic register class that selects between nadx_reg and nadx_reg_no_ebp. +reg_class_dynamic nadx_reg(nadx_reg_no_ebp, nadx_reg_with_ebp, %{ PreserveFramePointer %}); // Floating point registers. Notice FPR0 is not a choice. // FPR0 is not ever allocated; we use clever encodings to fake @@ -240,18 +284,11 @@ static int pre_call_resets_size() { return size; } -static int preserve_SP_size() { - return 2; // op, rm(reg/reg) -} - // !!!!! Special hack to get all type of calls to specify the byte offset // from the start of the call to the point where the return address // will point. int MachCallStaticJavaNode::ret_addr_offset() { - int offset = 5 + pre_call_resets_size(); // 5 bytes from start of call to where return address points - if (_method_handle_invoke) - offset += preserve_SP_size(); - return offset; + return 5 + pre_call_resets_size(); // 5 bytes from start of call to where return address points } int MachCallDynamicJavaNode::ret_addr_offset() { @@ -283,15 +320,6 @@ int CallStaticJavaDirectNode::compute_padding(int current_offset) const { return round_to(current_offset, alignment_required()) - current_offset; } -// The address of the call instruction needs to be 4-byte aligned to -// ensure that it does not span a cache line so that it can be patched. -int CallStaticJavaHandleNode::compute_padding(int current_offset) const { - current_offset += pre_call_resets_size(); // skip fldcw, if any - current_offset += preserve_SP_size(); // skip mov rbp, rsp - current_offset += 1; // skip call opcode byte - return round_to(current_offset, alignment_required()) - current_offset; -} - // The address of the call instruction needs to be 4-byte aligned to // ensure that it does not span a cache line so that it can be patched. int CallDynamicJavaDirectNode::compute_padding(int current_offset) const { @@ -523,6 +551,10 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const { st->print("# stack bang (%d bytes)", bangsize); st->print("\n\t"); st->print("PUSH EBP\t# Save EBP"); + if (PreserveFramePointer) { + st->print("\n\t"); + st->print("MOV EBP, ESP\t# Save the caller's SP into EBP"); + } if (framesize) { st->print("\n\t"); st->print("SUB ESP, #%d\t# Create frame",framesize); @@ -532,6 +564,10 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const { st->print("\n\t"); framesize -= wordSize; st->print("MOV [ESP + #%d], EBP\t# Save EBP",framesize); + if (PreserveFramePointer) { + st->print("\n\t"); + st->print("MOV EBP, [ESP + #%d]\t# Save the caller's SP into EBP", (framesize + wordSize)); + } } if (VerifyStackAtCalls) { @@ -1489,7 +1525,7 @@ RegMask Matcher::modL_proj_mask() { } const RegMask Matcher::method_handle_invoke_SP_save_mask() { - return EBP_REG_mask(); + return NO_REG_mask(); } // Returns true if the high 32 bits of the value is known to be zero. @@ -3735,7 +3771,7 @@ operand eRegP() %{ // On windows95, EBP is not safe to use for implicit null tests. operand eRegP_no_EBP() %{ - constraint(ALLOC_IN_RC(int_reg_no_rbp)); + constraint(ALLOC_IN_RC(int_reg_no_ebp)); match(RegP); match(eAXRegP); match(eBXRegP); @@ -3824,13 +3860,6 @@ operand eDIRegP(eRegP reg) %{ interface(REG_INTER); %} -operand eBPRegP() %{ - constraint(ALLOC_IN_RC(ebp_reg)); - match(RegP); - format %{ "EBP" %} - interface(REG_INTER); -%} - operand eRegL() %{ constraint(ALLOC_IN_RC(long_reg)); match(RegL); @@ -12615,7 +12644,6 @@ instruct cmovFF_reg_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, regF dst, // compute_padding() functions will have to be adjusted. instruct CallStaticJavaDirect(method meth) %{ match(CallStaticJava); - predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke()); effect(USE meth); ins_cost(300); @@ -12629,29 +12657,6 @@ instruct CallStaticJavaDirect(method meth) %{ ins_alignment(4); %} -// Call Java Static Instruction (method handle version) -// Note: If this code changes, the corresponding ret_addr_offset() and -// compute_padding() functions will have to be adjusted. -instruct CallStaticJavaHandle(method meth, eBPRegP ebp_mh_SP_save) %{ - match(CallStaticJava); - predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke()); - effect(USE meth); - // EBP is saved by all callees (for interpreter stack correction). - // We use it here for a similar purpose, in {preserve,restore}_SP. - - ins_cost(300); - format %{ "CALL,static/MethodHandle " %} - opcode(0xE8); /* E8 cd */ - ins_encode( pre_call_resets, - preserve_SP, - Java_Static_Call( meth ), - restore_SP, - call_epilog, - post_call_FPU ); - ins_pipe( pipe_slow ); - ins_alignment(4); -%} - // Call Java Dynamic Instruction // Note: If this code changes, the corresponding ret_addr_offset() and // compute_padding() functions will have to be adjusted. diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 20569256102..9abe58f5371 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -166,42 +166,67 @@ alloc_class chunk0(R10, R10_H, // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ ) // -// Class for all pointer registers (including RSP) -reg_class any_reg(RAX, RAX_H, - RDX, RDX_H, - RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - RBX, RBX_H, - RSP, RSP_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R12, R12_H, - R13, R13_H, - R14, R14_H, - R15, R15_H); +// Empty register class. +reg_class no_reg(); -// Class for all pointer registers except RSP -reg_class ptr_reg(RAX, RAX_H, - RDX, RDX_H, - RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - RBX, RBX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); +// Class for all pointer registers (including RSP and RBP) +reg_class any_reg_with_rbp(RAX, RAX_H, + RDX, RDX_H, + RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + RSP, RSP_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R12, R12_H, + R13, R13_H, + R14, R14_H, + R15, R15_H); -// Class for all pointer registers except RAX and RSP -reg_class ptr_no_rax_reg(RDX, RDX_H, - RBP, RBP_H, +// Class for all pointer registers (including RSP, but excluding RBP) +reg_class any_reg_no_rbp(RAX, RAX_H, + RDX, RDX_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + RSP, RSP_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R12, R12_H, + R13, R13_H, + R14, R14_H, + R15, R15_H); + +// Dynamic register class that selects at runtime between register classes +// any_reg_no_rbp and any_reg_with_rbp (depending on the value of the flag PreserveFramePointer). +// Equivalent to: return PreserveFramePointer ? any_reg_no_rbp : any_reg_with_rbp; +reg_class_dynamic any_reg(any_reg_no_rbp, any_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all pointer registers (excluding RSP) +reg_class ptr_reg_with_rbp(RAX, RAX_H, + RDX, RDX_H, + RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Class for all pointer registers (excluding RSP and RBP) +reg_class ptr_reg_no_rbp(RAX, RAX_H, + RDX, RDX_H, RDI, RDI_H, RSI, RSI_H, RCX, RCX_H, @@ -213,31 +238,66 @@ reg_class ptr_no_rax_reg(RDX, RDX_H, R13, R13_H, R14, R14_H); -reg_class ptr_no_rbp_reg(RDX, RDX_H, - RAX, RAX_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - RBX, RBX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); +// Dynamic register class that selects between ptr_reg_no_rbp and ptr_reg_with_rbp. +reg_class_dynamic ptr_reg(ptr_reg_no_rbp, ptr_reg_with_rbp, %{ PreserveFramePointer %}); -// Class for all pointer registers except RAX, RBX and RSP -reg_class ptr_no_rax_rbx_reg(RDX, RDX_H, - RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); +// Class for all pointer registers (excluding RAX and RSP) +reg_class ptr_no_rax_reg_with_rbp(RDX, RDX_H, + RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Class for all pointer registers (excluding RAX, RSP, and RBP) +reg_class ptr_no_rax_reg_no_rbp(RDX, RDX_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Dynamic register class that selects between ptr_no_rax_reg_no_rbp and ptr_no_rax_reg_with_rbp. +reg_class_dynamic ptr_no_rax_reg(ptr_no_rax_reg_no_rbp, ptr_no_rax_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all pointer registers (excluding RAX, RBX, and RSP) +reg_class ptr_no_rax_rbx_reg_with_rbp(RDX, RDX_H, + RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Class for all pointer registers (excluding RAX, RBX, RSP, and RBP) +reg_class ptr_no_rax_rbx_reg_no_rbp(RDX, RDX_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Dynamic register class that selects between ptr_no_rax_rbx_reg_no_rbp and ptr_no_rax_rbx_reg_with_rbp. +reg_class_dynamic ptr_no_rax_rbx_reg(ptr_no_rax_rbx_reg_no_rbp, ptr_no_rax_rbx_reg_with_rbp, %{ PreserveFramePointer %}); // Singleton class for RAX pointer register reg_class ptr_rax_reg(RAX, RAX_H); @@ -251,59 +311,29 @@ reg_class ptr_rsi_reg(RSI, RSI_H); // Singleton class for RDI pointer register reg_class ptr_rdi_reg(RDI, RDI_H); -// Singleton class for RBP pointer register -reg_class ptr_rbp_reg(RBP, RBP_H); - // Singleton class for stack pointer reg_class ptr_rsp_reg(RSP, RSP_H); // Singleton class for TLS pointer reg_class ptr_r15_reg(R15, R15_H); -// Class for all long registers (except RSP) -reg_class long_reg(RAX, RAX_H, - RDX, RDX_H, - RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - RBX, RBX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); +// Class for all long registers (excluding RSP) +reg_class long_reg_with_rbp(RAX, RAX_H, + RDX, RDX_H, + RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); -// Class for all long registers except RAX, RDX (and RSP) -reg_class long_no_rax_rdx_reg(RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RCX, RCX_H, - RBX, RBX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); - -// Class for all long registers except RCX (and RSP) -reg_class long_no_rcx_reg(RBP, RBP_H, - RDI, RDI_H, - RSI, RSI_H, - RAX, RAX_H, - RDX, RDX_H, - RBX, RBX_H, - R8, R8_H, - R9, R9_H, - R10, R10_H, - R11, R11_H, - R13, R13_H, - R14, R14_H); - -// Class for all long registers except RAX (and RSP) -reg_class long_no_rax_reg(RBP, RBP_H, +// Class for all long registers (excluding RSP and RBP) +reg_class long_reg_no_rbp(RAX, RAX_H, RDX, RDX_H, RDI, RDI_H, RSI, RSI_H, @@ -316,6 +346,67 @@ reg_class long_no_rax_reg(RBP, RBP_H, R13, R13_H, R14, R14_H); +// Dynamic register class that selects between long_reg_no_rbp and long_reg_with_rbp. +reg_class_dynamic long_reg(long_reg_no_rbp, long_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all long registers (excluding RAX, RDX and RSP) +reg_class long_no_rax_rdx_reg_with_rbp(RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Class for all long registers (excluding RAX, RDX, RSP, and RBP) +reg_class long_no_rax_rdx_reg_no_rbp(RDI, RDI_H, + RSI, RSI_H, + RCX, RCX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Dynamic register class that selects between long_no_rax_rdx_reg_no_rbp and long_no_rax_rdx_reg_with_rbp. +reg_class_dynamic long_no_rax_rdx_reg(long_no_rax_rdx_reg_no_rbp, long_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all long registers (excluding RCX and RSP) +reg_class long_no_rcx_reg_with_rbp(RBP, RBP_H, + RDI, RDI_H, + RSI, RSI_H, + RAX, RAX_H, + RDX, RDX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Class for all long registers (excluding RCX, RSP, and RBP) +reg_class long_no_rcx_reg_no_rbp(RDI, RDI_H, + RSI, RSI_H, + RAX, RAX_H, + RDX, RDX_H, + RBX, RBX_H, + R8, R8_H, + R9, R9_H, + R10, R10_H, + R11, R11_H, + R13, R13_H, + R14, R14_H); + +// Dynamic register class that selects between long_no_rcx_reg_no_rbp and long_no_rcx_reg_with_rbp. +reg_class_dynamic long_no_rcx_reg(long_no_rcx_reg_no_rbp, long_no_rcx_reg_with_rbp, %{ PreserveFramePointer %}); + // Singleton class for RAX long register reg_class long_rax_reg(RAX, RAX_H); @@ -325,27 +416,27 @@ reg_class long_rcx_reg(RCX, RCX_H); // Singleton class for RDX long register reg_class long_rdx_reg(RDX, RDX_H); -// Class for all int registers (except RSP) -reg_class int_reg(RAX, - RDX, - RBP, - RDI, - RSI, - RCX, - RBX, - R8, - R9, - R10, - R11, - R13, - R14); +// Class for all int registers (excluding RSP) +reg_class int_reg_with_rbp(RAX, + RDX, + RBP, + RDI, + RSI, + RCX, + RBX, + R8, + R9, + R10, + R11, + R13, + R14); -// Class for all int registers except RCX (and RSP) -reg_class int_no_rcx_reg(RAX, +// Class for all int registers (excluding RSP and RBP) +reg_class int_reg_no_rbp(RAX, RDX, - RBP, RDI, RSI, + RCX, RBX, R8, R9, @@ -354,18 +445,66 @@ reg_class int_no_rcx_reg(RAX, R13, R14); -// Class for all int registers except RAX, RDX (and RSP) -reg_class int_no_rax_rdx_reg(RBP, - RDI, - RSI, - RCX, - RBX, - R8, - R9, - R10, - R11, - R13, - R14); +// Dynamic register class that selects between int_reg_no_rbp and int_reg_with_rbp. +reg_class_dynamic int_reg(int_reg_no_rbp, int_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all int registers (excluding RCX and RSP) +reg_class int_no_rcx_reg_with_rbp(RAX, + RDX, + RBP, + RDI, + RSI, + RBX, + R8, + R9, + R10, + R11, + R13, + R14); + +// Class for all int registers (excluding RCX, RSP, and RBP) +reg_class int_no_rcx_reg_no_rbp(RAX, + RDX, + RDI, + RSI, + RBX, + R8, + R9, + R10, + R11, + R13, + R14); + +// Dynamic register class that selects between int_no_rcx_reg_no_rbp and int_no_rcx_reg_with_rbp. +reg_class_dynamic int_no_rcx_reg(int_no_rcx_reg_no_rbp, int_no_rcx_reg_with_rbp, %{ PreserveFramePointer %}); + +// Class for all int registers (excluding RAX, RDX, and RSP) +reg_class int_no_rax_rdx_reg_with_rbp(RBP, + RDI, + RSI, + RCX, + RBX, + R8, + R9, + R10, + R11, + R13, + R14); + +// Class for all int registers (excluding RAX, RDX, RSP, and RBP) +reg_class int_no_rax_rdx_reg_no_rbp(RDI, + RSI, + RCX, + RBX, + R8, + R9, + R10, + R11, + R13, + R14); + +// Dynamic register class that selects between int_no_rax_rdx_reg_no_rbp and int_no_rax_rdx_reg_with_rbp. +reg_class_dynamic int_no_rax_rdx_reg(int_no_rax_rdx_reg_no_rbp, int_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %}); // Singleton class for RAX int register reg_class int_rax_reg(RAX); @@ -396,9 +535,6 @@ source %{ #define __ _masm. -static int preserve_SP_size() { - return 3; // rex.w, op, rm(reg/reg) -} static int clear_avx_size() { return (Compile::current()->max_vector_size() > 16) ? 3 : 0; // vzeroupper } @@ -409,9 +545,7 @@ static int clear_avx_size() { int MachCallStaticJavaNode::ret_addr_offset() { int offset = 5; // 5 bytes from start of call to where return address points - offset += clear_avx_size(); - if (_method_handle_invoke) - offset += preserve_SP_size(); + offset += clear_avx_size(); return offset; } @@ -448,16 +582,6 @@ int CallStaticJavaDirectNode::compute_padding(int current_offset) const return round_to(current_offset, alignment_required()) - current_offset; } -// The address of the call instruction needs to be 4-byte aligned to -// ensure that it does not span a cache line so that it can be patched. -int CallStaticJavaHandleNode::compute_padding(int current_offset) const -{ - current_offset += preserve_SP_size(); // skip mov rbp, rsp - current_offset += clear_avx_size(); // skip vzeroupper - current_offset += 1; // skip call opcode byte - return round_to(current_offset, alignment_required()) - current_offset; -} - // The address of the call instruction needs to be 4-byte aligned to // ensure that it does not span a cache line so that it can be patched. int CallDynamicJavaDirectNode::compute_padding(int current_offset) const @@ -724,6 +848,10 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const { st->print("# stack bang (%d bytes)", bangsize); st->print("\n\t"); st->print("pushq rbp\t# Save rbp"); + if (PreserveFramePointer) { + st->print("\n\t"); + st->print("movq rbp, rsp\t# Save the caller's SP into rbp"); + } if (framesize) { st->print("\n\t"); st->print("subq rsp, #%d\t# Create frame",framesize); @@ -732,7 +860,11 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const { st->print("subq rsp, #%d\t# Create frame",framesize); st->print("\n\t"); framesize -= wordSize; - st->print("movq [rsp + #%d], rbp\t# Save rbp",framesize); + st->print("movq [rsp + #%d], rbp\t# Save rbp",framesize); + if (PreserveFramePointer) { + st->print("\n\t"); + st->print("movq rbp, [rsp + #%d]\t# Save the caller's SP into rbp", (framesize + wordSize)); + } } if (VerifyStackAtCalls) { @@ -1598,8 +1730,9 @@ RegMask Matcher::modL_proj_mask() { return LONG_RDX_REG_mask(); } +// Register for saving SP into on method handle invokes. Not used on x86_64. const RegMask Matcher::method_handle_invoke_SP_save_mask() { - return PTR_RBP_REG_mask(); + return NO_REG_mask(); } %} @@ -3202,7 +3335,7 @@ operand no_rax_rdx_RegI() // Pointer Register operand any_RegP() %{ - constraint(ALLOC_IN_RC(any_reg)); + constraint(ALLOC_IN_RC(any_reg)); match(RegP); match(rax_RegP); match(rbx_RegP); @@ -3224,8 +3357,8 @@ operand rRegP() match(rbx_RegP); match(rdi_RegP); match(rsi_RegP); - match(rbp_RegP); - match(r15_RegP); // See Q&A below about r15_RegP. + match(rbp_RegP); // See Q&A below about + match(r15_RegP); // r15_RegP and rbp_RegP. format %{ %} interface(REG_INTER); @@ -3241,11 +3374,14 @@ operand rRegN() %{ // Question: Why is r15_RegP (the read-only TLS register) a match for rRegP? // Answer: Operand match rules govern the DFA as it processes instruction inputs. -// It's fine for an instruction input which expects rRegP to match a r15_RegP. +// It's fine for an instruction input that expects rRegP to match a r15_RegP. // The output of an instruction is controlled by the allocator, which respects // register class masks, not match rules. Unless an instruction mentions // r15_RegP or any_RegP explicitly as its output, r15 will not be considered // by the allocator as an input. +// The same logic applies to rbp_RegP being a match for rRegP: If PreserveFramePointer==true, +// the RBP is used as a proper frame pointer and is not included in ptr_reg. As a +// result, RBP is not included in the output of the instruction either. operand no_rax_RegP() %{ @@ -3259,9 +3395,11 @@ operand no_rax_RegP() interface(REG_INTER); %} +// This operand is not allowed to use RBP even if +// RBP is not used to hold the frame pointer. operand no_rbp_RegP() %{ - constraint(ALLOC_IN_RC(ptr_no_rbp_reg)); + constraint(ALLOC_IN_RC(ptr_reg_no_rbp)); match(RegP); match(rbx_RegP); match(rsi_RegP); @@ -3338,16 +3476,6 @@ operand rdi_RegP() interface(REG_INTER); %} -operand rbp_RegP() -%{ - constraint(ALLOC_IN_RC(ptr_rbp_reg)); - match(RegP); - match(rRegP); - - format %{ %} - interface(REG_INTER); -%} - operand r15_RegP() %{ constraint(ALLOC_IN_RC(ptr_r15_reg)); @@ -3604,6 +3732,23 @@ operand indIndexScaleOffset(any_RegP reg, immL32 off, rRegL lreg, immI2 scale) %} %} +// Indirect Memory Plus Positive Index Register Plus Offset Operand +operand indPosIndexOffset(any_RegP reg, immL32 off, rRegI idx) +%{ + constraint(ALLOC_IN_RC(ptr_reg)); + predicate(n->in(2)->in(3)->as_Type()->type()->is_long()->_lo >= 0); + match(AddP (AddP reg (ConvI2L idx)) off); + + op_cost(10); + format %{"[$reg + $off + $idx]" %} + interface(MEMORY_INTER) %{ + base($reg); + index($idx); + scale(0x0); + disp($off); + %} +%} + // Indirect Memory Times Scale Plus Positive Index Register Plus Offset Operand operand indPosIndexScaleOffset(any_RegP reg, immL32 off, rRegI idx, immI2 scale) %{ @@ -3755,6 +3900,23 @@ operand indIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegL lreg, immI2 scale %} %} +// Indirect Memory Times Plus Positive Index Register Plus Offset Operand +operand indPosIndexOffsetNarrow(rRegN reg, immL32 off, rRegI idx) +%{ + constraint(ALLOC_IN_RC(ptr_reg)); + predicate(Universe::narrow_oop_shift() == 0 && n->in(2)->in(3)->as_Type()->type()->is_long()->_lo >= 0); + match(AddP (AddP (DecodeN reg) (ConvI2L idx)) off); + + op_cost(10); + format %{"[$reg + $off + $idx]" %} + interface(MEMORY_INTER) %{ + base($reg); + index($idx); + scale(0x0); + disp($off); + %} +%} + // Indirect Memory Times Scale Plus Positive Index Register Plus Offset Operand operand indPosIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegI idx, immI2 scale) %{ @@ -3946,11 +4108,11 @@ operand cmpOpUCF2() %{ // case of this is memory operands. opclass memory(indirect, indOffset8, indOffset32, indIndexOffset, indIndex, - indIndexScale, indIndexScaleOffset, indPosIndexScaleOffset, + indIndexScale, indIndexScaleOffset, indPosIndexOffset, indPosIndexScaleOffset, indCompressedOopOffset, indirectNarrow, indOffset8Narrow, indOffset32Narrow, indIndexOffsetNarrow, indIndexNarrow, indIndexScaleNarrow, - indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow); + indIndexScaleOffsetNarrow, indPosIndexOffsetNarrow, indPosIndexScaleOffsetNarrow); //----------PIPELINE----------------------------------------------------------- // Rules which define the behavior of the target architectures pipeline. @@ -4984,6 +5146,17 @@ instruct leaPIdxScaleOff(rRegP dst, indIndexScaleOffset mem) ins_pipe(ialu_reg_reg_fat); %} +instruct leaPPosIdxOff(rRegP dst, indPosIndexOffset mem) +%{ + match(Set dst mem); + + ins_cost(110); + format %{ "leaq $dst, $mem\t# ptr posidxoff" %} + opcode(0x8D); + ins_encode(REX_reg_mem_wide(dst, mem), OpcP, reg_mem(dst, mem)); + ins_pipe(ialu_reg_reg_fat); +%} + instruct leaPPosIdxScaleOff(rRegP dst, indPosIndexScaleOffset mem) %{ match(Set dst mem); @@ -5068,6 +5241,18 @@ instruct leaPIdxScaleOffNarrow(rRegP dst, indIndexScaleOffsetNarrow mem) ins_pipe(ialu_reg_reg_fat); %} +instruct leaPPosIdxOffNarrow(rRegP dst, indPosIndexOffsetNarrow mem) +%{ + predicate(Universe::narrow_oop_shift() == 0); + match(Set dst mem); + + ins_cost(110); + format %{ "leaq $dst, $mem\t# ptr posidxoffnarrow" %} + opcode(0x8D); + ins_encode(REX_reg_mem_wide(dst, mem), OpcP, reg_mem(dst, mem)); + ins_pipe(ialu_reg_reg_fat); +%} + instruct leaPPosIdxScaleOffNarrow(rRegP dst, indPosIndexScaleOffsetNarrow mem) %{ predicate(Universe::narrow_oop_shift() == 0); @@ -11353,7 +11538,6 @@ instruct safePoint_poll_far(rFlagsReg cr, rRegP poll) // compute_padding() functions will have to be adjusted. instruct CallStaticJavaDirect(method meth) %{ match(CallStaticJava); - predicate(!((CallStaticJavaNode*) n)->is_method_handle_invoke()); effect(USE meth); ins_cost(300); @@ -11364,27 +11548,6 @@ instruct CallStaticJavaDirect(method meth) %{ ins_alignment(4); %} -// Call Java Static Instruction (method handle version) -// Note: If this code changes, the corresponding ret_addr_offset() and -// compute_padding() functions will have to be adjusted. -instruct CallStaticJavaHandle(method meth, rbp_RegP rbp_mh_SP_save) %{ - match(CallStaticJava); - predicate(((CallStaticJavaNode*) n)->is_method_handle_invoke()); - effect(USE meth); - // RBP is saved by all callees (for interpreter stack correction). - // We use it here for a similar purpose, in {preserve,restore}_SP. - - ins_cost(300); - format %{ "call,static/MethodHandle " %} - opcode(0xE8); /* E8 cd */ - ins_encode(clear_avx, preserve_SP, - Java_Static_Call(meth), - restore_SP, - call_epilog); - ins_pipe(pipe_slow); - ins_alignment(4); -%} - // Call Java Dynamic Instruction // Note: If this code changes, the corresponding ret_addr_offset() and // compute_padding() functions will have to be adjusted. diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 785baf9b272..4875e109538 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -814,9 +814,9 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { } #endif // INCLUDE_ALL_GCS - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return generate_accessor_entry(); + // If G1 is not enabled then attempt to go through the normal entry point + // Reference.get could be instrumented by jvmti + return generate_normal_entry(false); } address InterpreterGenerator::generate_native_entry(bool synchronized) { diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index 84e727dc7ad..fe1ee4f4f95 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -213,7 +213,7 @@ void frame::zero_print_on_error(int frame_index, valuebuf[buflen - 1] = '\0'; // Print the result - st->print_cr(" " PTR_FORMAT ": %-21s = %s", addr, fieldbuf, valuebuf); + st->print_cr(" " PTR_FORMAT ": %-21s = %s", p2i(addr), fieldbuf, valuebuf); } } diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp index ea1bc0eedc1..a9c651c81f8 100644 --- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" void MethodHandles::invoke_target(Method* method, TRAPS) { @@ -144,6 +145,7 @@ int MethodHandles::method_handle_entry_linkToVirtual(Method* method, intptr_t UN oop recv = STACK_OBJECT(-numArgs); Klass* clazz = recv->klass(); Klass* klass_part = InstanceKlass::cast(clazz); + ResourceMark rm(THREAD); klassVtable* vtable = klass_part->vtable(); Method* vmtarget = vtable->method_at(vmindex); diff --git a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp index be7f72b2341..9d999a8c805 100644 --- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2010 Red Hat, Inc. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2010, 2015 Red Hat, Inc. * 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,18 @@ #include "opto/runtime.hpp" #endif +// For SafeFetch we need POSIX tls and setjmp +#include +#include +static pthread_key_t g_jmpbuf_key; + +// return the currently active jump buffer for this thread +// - if there is any, NULL otherwise. Called from +// zero signal handlers. +extern sigjmp_buf* get_jmp_buf_for_continuation() { + return (sigjmp_buf*) pthread_getspecific(g_jmpbuf_key); +} + // Declaration and definition of StubGenerator (no .hpp file). // For a more detailed description of the stub routine structure // see the comment in stubRoutines.hpp @@ -177,17 +189,55 @@ class StubGenerator: public StubCodeGenerator { } static int SafeFetch32(int *adr, int errValue) { + + // set up a jump buffer; anchor the pointer to the jump buffer in tls; then + // do the pointer access. If pointer is invalid, we crash; in signal + // handler, we retrieve pointer to jmp buffer from tls, and jump back. + // + // Note: the jump buffer itself - which can get pretty large depending on + // the architecture - lives on the stack and that is fine, because we will + // not rewind the stack: either we crash, in which case signal handler + // frame is below us, or we don't crash, in which case it does not matter. + sigjmp_buf jb; + if (sigsetjmp(jb, 1)) { + // we crashed. clean up tls and return default value. + pthread_setspecific(g_jmpbuf_key, NULL); + return errValue; + } else { + // preparation phase + pthread_setspecific(g_jmpbuf_key, &jb); + } + int value = errValue; value = *adr; + + // all went well. clean tls. + pthread_setspecific(g_jmpbuf_key, NULL); + return value; } static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) { + + sigjmp_buf jb; + if (sigsetjmp(jb, 1)) { + // we crashed. clean up tls and return default value. + pthread_setspecific(g_jmpbuf_key, NULL); + return errValue; + } else { + // preparation phase + pthread_setspecific(g_jmpbuf_key, &jb); + } + intptr_t value = errValue; value = *adr; - return value; - } + // all went well. clean tls. + pthread_setspecific(g_jmpbuf_key, NULL); + + return value; + + } void generate_initial() { // Generates all stubs and initializes the entry points @@ -241,6 +291,7 @@ class StubGenerator: public StubCodeGenerator { generate_arraycopy_stubs(); // Safefetch stubs. + pthread_key_create(&g_jmpbuf_key, NULL); StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32); StubRoutines::_safefetch32_fault_pc = NULL; StubRoutines::_safefetch32_continuation_pc = NULL; diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp index 31ee8ba84e1..c19a21d879d 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -30,4 +30,11 @@ #include "runtime/stubCodeGenerator.hpp" #include "vm_version_zero.hpp" -// This file is intentionally empty + +void VM_Version::initialize() { + // This machine does not allow unaligned memory accesses + if (! FLAG_IS_DEFAULT(UseUnalignedAccesses)) { + warning("Unaligned memory access is not available on this CPU"); + FLAG_SET_DEFAULT(UseUnalignedAccesses, false); + } +} diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp index 78109b933f4..68a29df3a60 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -34,6 +34,7 @@ class VM_Version : public Abstract_VM_Version { static const char* cpu_features() { return ""; } + static void initialize(); }; #endif // CPU_ZERO_VM_VM_VERSION_ZERO_HPP diff --git a/hotspot/src/os/aix/vm/attachListener_aix.cpp b/hotspot/src/os/aix/vm/attachListener_aix.cpp index 93be23f2db2..b6707aa9cb9 100644 --- a/hotspot/src/os/aix/vm/attachListener_aix.cpp +++ b/hotspot/src/os/aix/vm/attachListener_aix.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,6 +144,10 @@ class ArgumentIterator : public StackObj { } char* next() { if (*_pos == '\0') { + if (_pos < _end) { + _pos += 1; + } + return NULL; } char* res = _pos; @@ -214,6 +218,7 @@ int AixAttachListener::init() { // bind socket struct sockaddr_un addr; + memset((void *)&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strcpy(addr.sun_path, initial_path); ::unlink(initial_path); diff --git a/hotspot/src/os/aix/vm/globals_aix.hpp b/hotspot/src/os/aix/vm/globals_aix.hpp index dc20a6aa95b..4f190f2f136 100644 --- a/hotspot/src/os/aix/vm/globals_aix.hpp +++ b/hotspot/src/os/aix/vm/globals_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ // #define RUNTIME_OS_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \ \ + /* Use 64K pages for virtual memory (shmat). */ \ + product(bool, Use64KPages, true, \ + "Use 64K pages if available.") \ + \ /* If UseLargePages == true allow or deny usage of 16M pages. 16M pages are */ \ /* a scarce resource and there may be situations where we do not want the VM */ \ /* to run with 16M pages. (Will fall back to 64K pages). */ \ @@ -55,7 +59,7 @@ define_pd_global(intx, AttachListenerTimeout, 1000); // Defines Aix-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/aix/vm/interfaceSupport_aix.hpp b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp index 62e75c7eb72..8f32db7b810 100644 --- a/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp +++ b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,8 @@ * */ -#ifndef OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP -#define OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP +#ifndef OS_AIX_VM_INTERFACESUPPORT_AIX_HPP +#define OS_AIX_VM_INTERFACESUPPORT_AIX_HPP // Contains inlined functions for class InterfaceSupport @@ -32,4 +32,4 @@ static inline void serialize_memory(JavaThread *thread) { os::write_memory_serialize_page(thread); } -#endif // OS_LINUX_VM_INTERFACESUPPORT_LINUX_HPP +#endif // OS_AIX_VM_INTERFACESUPPORT_AIX_HPP diff --git a/hotspot/src/os/aix/vm/osThread_aix.cpp b/hotspot/src/os/aix/vm/osThread_aix.cpp index ef6c973e3fe..c5566147f99 100644 --- a/hotspot/src/os/aix/vm/osThread_aix.cpp +++ b/hotspot/src/os/aix/vm/osThread_aix.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ void OSThread::pd_initialize() { _startThread_lock = new Monitor(Mutex::event, "startThread_lock", true, Monitor::_safepoint_check_never); - assert(_startThread_lock !=NULL, "check"); + assert(_startThread_lock != NULL, "check"); } void OSThread::pd_destroy() { diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index d77a26ffa66..eee444ea1fb 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,6 +113,10 @@ #define RUSAGE_THREAD (1) /* only the calling thread */ #endif +// PPC port +static const uintx Use64KPagesThreshold = 1*M; +static const uintx MaxExpectedDataSegmentSize = SIZE_4G*2; + // Add missing declarations (should be in procinfo.h but isn't until AIX 6.1). #if !defined(_AIXVERSION_610) extern "C" { @@ -168,8 +172,8 @@ typedef stackslot_t* stackptr_t; return -1; \ } -// query dimensions of the stack of the calling thread -static void query_stack_dimensions(address* p_stack_base, size_t* p_stack_size); +// Query dimensions of the stack of the calling thread. +static bool query_stack_dimensions(address* p_stack_base, size_t* p_stack_size); // function to check a given stack pointer against given stack limits inline bool is_valid_stackpointer(stackptr_t sp, stackptr_t stack_base, size_t stack_size) { @@ -220,9 +224,6 @@ int os::Aix::_page_size = -1; int os::Aix::_on_pase = -1; int os::Aix::_os_version = -1; int os::Aix::_stack_page_size = -1; -size_t os::Aix::_shm_default_page_size = -1; -int os::Aix::_can_use_64K_pages = -1; -int os::Aix::_can_use_16M_pages = -1; int os::Aix::_xpg_sus_mode = -1; int os::Aix::_extshm = -1; int os::Aix::_logical_cpus = -1; @@ -238,7 +239,63 @@ static bool check_signals = true; static pid_t _initial_pid = 0; static int SR_signum = SIGUSR2; // Signal used to suspend/resume a thread (must be > SIGSEGV, see 4355769) static sigset_t SR_sigset; -static pthread_mutex_t dl_mutex; // Used to protect dlsym() calls. + +// This describes the state of multipage support of the underlying +// OS. Note that this is of no interest to the outsize world and +// therefore should not be defined in AIX class. +// +// AIX supports four different page sizes - 4K, 64K, 16MB, 16GB. The +// latter two (16M "large" resp. 16G "huge" pages) require special +// setup and are normally not available. +// +// AIX supports multiple page sizes per process, for: +// - Stack (of the primordial thread, so not relevant for us) +// - Data - data, bss, heap, for us also pthread stacks +// - Text - text code +// - shared memory +// +// Default page sizes can be set via linker options (-bdatapsize, -bstacksize, ...) +// and via environment variable LDR_CNTRL (DATAPSIZE, STACKPSIZE, ...). +// +// For shared memory, page size can be set dynamically via +// shmctl(). Different shared memory regions can have different page +// sizes. +// +// More information can be found at AIBM info center: +// http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/multiple_page_size_app_support.htm +// +static struct { + size_t pagesize; // sysconf _SC_PAGESIZE (4K) + size_t datapsize; // default data page size (LDR_CNTRL DATAPSIZE) + size_t shmpsize; // default shared memory page size (LDR_CNTRL SHMPSIZE) + size_t pthr_stack_pagesize; // stack page size of pthread threads + size_t textpsize; // default text page size (LDR_CNTRL STACKPSIZE) + bool can_use_64K_pages; // True if we can alloc 64K pages dynamically with Sys V shm. + bool can_use_16M_pages; // True if we can alloc 16M pages dynamically with Sys V shm. + int error; // Error describing if something went wrong at multipage init. +} g_multipage_support = { + (size_t) -1, + (size_t) -1, + (size_t) -1, + (size_t) -1, + (size_t) -1, + false, false, + 0 +}; + +// We must not accidentally allocate memory close to the BRK - even if +// that would work - because then we prevent the BRK segment from +// growing which may result in a malloc OOM even though there is +// enough memory. The problem only arises if we shmat() or mmap() at +// a specific wish address, e.g. to place the heap in a +// compressed-oops-friendly way. +static bool is_close_to_brk(address a) { + address a1 = (address) sbrk(0); + if (a >= a1 && a < (a1 + MaxExpectedDataSegmentSize)) { + return true; + } + return false; +} julong os::available_memory() { return Aix::available_memory(); @@ -257,19 +314,6 @@ julong os::physical_memory() { return Aix::physical_memory(); } -//////////////////////////////////////////////////////////////////////////////// -// environment support - -bool os::getenv(const char* name, char* buf, int len) { - const char* val = ::getenv(name); - if (val != NULL && strlen(val) < (size_t)len) { - strcpy(buf, val); - return true; - } - if (len > 0) buf[0] = 0; // return a null string - return false; -} - // Return true if user is running as root. bool os::have_special_privileges() { @@ -291,7 +335,7 @@ static bool my_disclaim64(char* addr, size_t size) { } // Maximum size 32bit disclaim() accepts. (Theoretically 4GB, but I just do not trust that.) - const unsigned int maxDisclaimSize = 0x80000000; + const unsigned int maxDisclaimSize = 0x40000000; const unsigned int numFullDisclaimsNeeded = (size / maxDisclaimSize); const unsigned int lastDisclaimSize = (size % maxDisclaimSize); @@ -368,138 +412,131 @@ static const char* describe_pagesize(size_t pagesize) { case SIZE_64K: return "64K"; case SIZE_16M: return "16M"; case SIZE_16G: return "16G"; + case -1: return "not set"; default: assert(false, "surprise"); return "??"; } } -// Retrieve information about multipage size support. Will initialize -// Aix::_page_size, Aix::_stack_page_size, Aix::_can_use_64K_pages, -// Aix::_can_use_16M_pages. +// Probe OS for multipage support. +// Will fill the global g_multipage_support structure. // Must be called before calling os::large_page_init(). -void os::Aix::query_multipage_support() { +static void query_multipage_support() { - guarantee(_page_size == -1 && - _stack_page_size == -1 && - _can_use_64K_pages == -1 && - _can_use_16M_pages == -1 && - g_multipage_error == -1, + guarantee(g_multipage_support.pagesize == -1, "do not call twice"); - _page_size = ::sysconf(_SC_PAGESIZE); + g_multipage_support.pagesize = ::sysconf(_SC_PAGESIZE); // This really would surprise me. - assert(_page_size == SIZE_4K, "surprise!"); - + assert(g_multipage_support.pagesize == SIZE_4K, "surprise!"); // Query default data page size (default page size for C-Heap, pthread stacks and .bss). - // Default data page size is influenced either by linker options (-bdatapsize) + // Default data page size is defined either by linker options (-bdatapsize) // or by environment variable LDR_CNTRL (suboption DATAPSIZE). If none is given, // default should be 4K. - size_t data_page_size = SIZE_4K; { - void* p = os::malloc(SIZE_16M, mtInternal); - guarantee(p != NULL, "malloc failed"); - data_page_size = os::Aix::query_pagesize(p); - os::free(p); + void* p = ::malloc(SIZE_16M); + g_multipage_support.datapsize = os::Aix::query_pagesize(p); + ::free(p); } - // query default shm page size (LDR_CNTRL SHMPSIZE) + // Query default shm page size (LDR_CNTRL SHMPSIZE). { const int shmid = ::shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR | S_IWUSR); guarantee(shmid != -1, "shmget failed"); void* p = ::shmat(shmid, NULL, 0); ::shmctl(shmid, IPC_RMID, NULL); guarantee(p != (void*) -1, "shmat failed"); - _shm_default_page_size = os::Aix::query_pagesize(p); + g_multipage_support.shmpsize = os::Aix::query_pagesize(p); ::shmdt(p); } - // before querying the stack page size, make sure we are not running as primordial + // Before querying the stack page size, make sure we are not running as primordial // thread (because primordial thread's stack may have different page size than // pthread thread stacks). Running a VM on the primordial thread won't work for a - // number of reasons so we may just as well guarantee it here - guarantee(!os::Aix::is_primordial_thread(), "Must not be called for primordial thread"); + // number of reasons so we may just as well guarantee it here. + guarantee0(!os::Aix::is_primordial_thread()); - // query stack page size + // Query pthread stack page size. { int dummy = 0; - _stack_page_size = os::Aix::query_pagesize(&dummy); - // everything else would surprise me and should be looked into - guarantee(_stack_page_size == SIZE_4K || _stack_page_size == SIZE_64K, "Wrong page size"); - // also, just for completeness: pthread stacks are allocated from C heap, so - // stack page size should be the same as data page size - guarantee(_stack_page_size == data_page_size, "stack page size should be the same as data page size"); + g_multipage_support.pthr_stack_pagesize = os::Aix::query_pagesize(&dummy); } - // EXTSHM is bad: among other things, it prevents setting pagesize dynamically - // for system V shm. - if (Aix::extshm()) { - if (Verbose) { - fprintf(stderr, "EXTSHM is active - will disable large page support.\n" - "Please make sure EXTSHM is OFF for large page support.\n"); - } - g_multipage_error = ERROR_MP_EXTSHM_ACTIVE; - _can_use_64K_pages = _can_use_16M_pages = 0; + // Query default text page size (LDR_CNTRL TEXTPSIZE). + /* PPC port: so far unused. + { + address any_function = + (address) resolve_function_descriptor_to_code_pointer((address)describe_pagesize); + g_multipage_support.textpsize = os::Aix::query_pagesize(any_function); + } + */ + + // Now probe for support of 64K pages and 16M pages. + + // Before OS/400 V6R1, there is no support for pages other than 4K. + if (os::Aix::on_pase_V5R4_or_older()) { + Unimplemented(); goto query_multipage_support_end; } - // now check which page sizes the OS claims it supports, and of those, which actually can be used. + // Now check which page sizes the OS claims it supports, and of those, which actually can be used. { const int MAX_PAGE_SIZES = 4; psize_t sizes[MAX_PAGE_SIZES]; const int num_psizes = ::vmgetinfo(sizes, VMINFO_GETPSIZES, MAX_PAGE_SIZES); if (num_psizes == -1) { - if (Verbose) { - fprintf(stderr, "vmgetinfo(VMINFO_GETPSIZES) failed (errno: %d)\n", errno); - fprintf(stderr, "disabling multipage support.\n"); - } - g_multipage_error = ERROR_MP_VMGETINFO_FAILED; - _can_use_64K_pages = _can_use_16M_pages = 0; + trc("vmgetinfo(VMINFO_GETPSIZES) failed (errno: %d)\n", errno); + trc("disabling multipage support.\n"); + g_multipage_support.error = ERROR_MP_VMGETINFO_FAILED; goto query_multipage_support_end; } guarantee(num_psizes > 0, "vmgetinfo(.., VMINFO_GETPSIZES, ...) failed."); assert(num_psizes <= MAX_PAGE_SIZES, "Surprise! more than 4 page sizes?"); - if (Verbose) { - fprintf(stderr, "vmgetinfo(.., VMINFO_GETPSIZES, ...) returns %d supported page sizes: ", num_psizes); - for (int i = 0; i < num_psizes; i ++) { - fprintf(stderr, " %s ", describe_pagesize(sizes[i])); - } - fprintf(stderr, " .\n"); + trcVerbose("vmgetinfo(.., VMINFO_GETPSIZES, ...) returns %d supported page sizes: ", num_psizes); + for (int i = 0; i < num_psizes; i ++) { + trcVerbose(" %s ", describe_pagesize(sizes[i])); } // Can we use 64K, 16M pages? - _can_use_64K_pages = 0; - _can_use_16M_pages = 0; for (int i = 0; i < num_psizes; i ++) { - if (sizes[i] == SIZE_64K) { - _can_use_64K_pages = 1; - } else if (sizes[i] == SIZE_16M) { - _can_use_16M_pages = 1; + const size_t pagesize = sizes[i]; + if (pagesize != SIZE_64K && pagesize != SIZE_16M) { + continue; } - } - - if (!_can_use_64K_pages) { - g_multipage_error = ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K; - } - - // Double-check for 16M pages: Even if AIX claims to be able to use 16M pages, - // there must be an actual 16M page pool, and we must run with enough rights. - if (_can_use_16M_pages) { - const int shmid = ::shmget(IPC_PRIVATE, SIZE_16M, IPC_CREAT | S_IRUSR | S_IWUSR); - guarantee(shmid != -1, "shmget failed"); + bool can_use = false; + trcVerbose("Probing support for %s pages...", describe_pagesize(pagesize)); + const int shmid = ::shmget(IPC_PRIVATE, pagesize, + IPC_CREAT | S_IRUSR | S_IWUSR); + guarantee0(shmid != -1); // Should always work. + // Try to set pagesize. struct shmid_ds shm_buf = { 0 }; - shm_buf.shm_pagesize = SIZE_16M; - const bool can_set_pagesize = ::shmctl(shmid, SHM_PAGESIZE, &shm_buf) == 0 ? true : false; - const int en = errno; - ::shmctl(shmid, IPC_RMID, NULL); - if (!can_set_pagesize) { - if (Verbose) { - fprintf(stderr, "Failed to allocate even one misely 16M page. shmctl failed with %d (%s).\n" - "Will deactivate 16M support.\n", en, strerror(en)); + shm_buf.shm_pagesize = pagesize; + if (::shmctl(shmid, SHM_PAGESIZE, &shm_buf) != 0) { + const int en = errno; + ::shmctl(shmid, IPC_RMID, NULL); // As early as possible! + // PPC port trcVerbose("shmctl(SHM_PAGESIZE) failed with %s", + // PPC port MiscUtils::describe_errno(en)); + } else { + // Attach and double check pageisze. + void* p = ::shmat(shmid, NULL, 0); + ::shmctl(shmid, IPC_RMID, NULL); // As early as possible! + guarantee0(p != (void*) -1); // Should always work. + const size_t real_pagesize = os::Aix::query_pagesize(p); + if (real_pagesize != pagesize) { + trcVerbose("real page size (0x%llX) differs.", real_pagesize); + } else { + can_use = true; } - _can_use_16M_pages = 0; + ::shmdt(p); + } + trcVerbose("Can use: %s", (can_use ? "yes" : "no")); + if (pagesize == SIZE_64K) { + g_multipage_support.can_use_64K_pages = can_use; + } else if (pagesize == SIZE_16M) { + g_multipage_support.can_use_16M_pages = can_use; } } @@ -507,23 +544,29 @@ void os::Aix::query_multipage_support() { query_multipage_support_end: - guarantee(_page_size != -1 && - _stack_page_size != -1 && - _can_use_64K_pages != -1 && - _can_use_16M_pages != -1, "Page sizes not properly initialized"); + trcVerbose("base page size (sysconf _SC_PAGESIZE): %s\n", + describe_pagesize(g_multipage_support.pagesize)); + trcVerbose("Data page size (C-Heap, bss, etc): %s\n", + describe_pagesize(g_multipage_support.datapsize)); + trcVerbose("Text page size: %s\n", + describe_pagesize(g_multipage_support.textpsize)); + trcVerbose("Thread stack page size (pthread): %s\n", + describe_pagesize(g_multipage_support.pthr_stack_pagesize)); + trcVerbose("Default shared memory page size: %s\n", + describe_pagesize(g_multipage_support.shmpsize)); + trcVerbose("Can use 64K pages dynamically with shared meory: %s\n", + (g_multipage_support.can_use_64K_pages ? "yes" :"no")); + trcVerbose("Can use 16M pages dynamically with shared memory: %s\n", + (g_multipage_support.can_use_16M_pages ? "yes" :"no")); + trcVerbose("Multipage error details: %d\n", + g_multipage_support.error); - if (_can_use_64K_pages) { - g_multipage_error = 0; - } - - if (Verbose) { - fprintf(stderr, "Data page size (C-Heap, bss, etc): %s\n", describe_pagesize(data_page_size)); - fprintf(stderr, "Thread stack page size (pthread): %s\n", describe_pagesize(_stack_page_size)); - fprintf(stderr, "Default shared memory page size: %s\n", describe_pagesize(_shm_default_page_size)); - fprintf(stderr, "Can use 64K pages dynamically with shared meory: %s\n", (_can_use_64K_pages ? "yes" :"no")); - fprintf(stderr, "Can use 16M pages dynamically with shared memory: %s\n", (_can_use_16M_pages ? "yes" :"no")); - fprintf(stderr, "Multipage error details: %d\n", g_multipage_error); - } + // sanity checks + assert0(g_multipage_support.pagesize == SIZE_4K); + assert0(g_multipage_support.datapsize == SIZE_4K || g_multipage_support.datapsize == SIZE_64K); + // PPC port: so far unused.assert0(g_multipage_support.textpsize == SIZE_4K || g_multipage_support.textpsize == SIZE_64K); + assert0(g_multipage_support.pthr_stack_pagesize == g_multipage_support.datapsize); + assert0(g_multipage_support.shmpsize == SIZE_4K || g_multipage_support.shmpsize == SIZE_64K); } // end os::Aix::query_multipage_support() @@ -1225,6 +1268,10 @@ void os::shutdown() { // called from signal handler. Before adding something to os::abort(), make // sure it is async-safe and can handle partially initialized VM. void os::abort(bool dump_core) { + abort(dump_core, NULL, NULL); +} + +void os::abort(bool dump_core, void* siginfo, void* context) { os::shutdown(); if (dump_core) { #ifndef PRODUCT @@ -1492,13 +1539,8 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { return NULL; } -// Glibc-2.0 libdl is not MT safe. If you are building with any glibc, -// chances are you might want to run the generated bits against glibc-2.0 -// libdl.so, so always use locking for any version of glibc. void* os::dll_lookup(void* handle, const char* name) { - pthread_mutex_lock(&dl_mutex); void* res = dlsym(handle, name); - pthread_mutex_unlock(&dl_mutex); return res; } @@ -1572,9 +1614,12 @@ void os::print_memory_info(outputStream* st) { st->print_cr(" default page size: %s", describe_pagesize(os::vm_page_size())); st->print_cr(" default stack page size: %s", describe_pagesize(os::vm_page_size())); - st->print_cr(" default shm page size: %s", describe_pagesize(os::Aix::shm_default_page_size())); - st->print_cr(" can use 64K pages dynamically: %s", (os::Aix::can_use_64K_pages() ? "yes" :"no")); - st->print_cr(" can use 16M pages dynamically: %s", (os::Aix::can_use_16M_pages() ? "yes" :"no")); + st->print_cr(" Default shared memory page size: %s", + describe_pagesize(g_multipage_support.shmpsize)); + st->print_cr(" Can use 64K pages dynamically with shared meory: %s", + (g_multipage_support.can_use_64K_pages ? "yes" :"no")); + st->print_cr(" Can use 16M pages dynamically with shared memory: %s", + (g_multipage_support.can_use_16M_pages ? "yes" :"no")); if (g_multipage_error != 0) { st->print_cr(" multipage error: %d", g_multipage_error); } @@ -1585,6 +1630,9 @@ void os::print_memory_info(outputStream* st) { const char* const extshm = ::getenv("EXTSHM"); st->print_cr(" EXTSHM=%s.", extshm ? extshm : ""); + if ( (strcmp(extshm, "on") == 0) || (strcmp(extshm, "ON") == 0) ) { + st->print_cr(" *** Unsupported! Please remove EXTSHM from your environment! ***"); + } // Call os::Aix::get_meminfo() to retrieve memory statistics. os::Aix::meminfo_t mi; @@ -1827,315 +1875,386 @@ int os::signal_wait() { //////////////////////////////////////////////////////////////////////////////// // Virtual Memory -// AddrRange describes an immutable address range -// -// This is a helper class for the 'shared memory bookkeeping' below. -class AddrRange { - friend class ShmBkBlock; +// We need to keep small simple bookkeeping for os::reserve_memory and friends. - char* _start; - size_t _size; +#define VMEM_MAPPED 1 +#define VMEM_SHMATED 2 -public: +struct vmembk_t { + int type; // 1 - mmap, 2 - shmat + char* addr; + size_t size; // Real size, may be larger than usersize. + size_t pagesize; // page size of area + vmembk_t* next; - AddrRange(char* start, size_t size) - : _start(start), _size(size) - {} - - AddrRange(const AddrRange& r) - : _start(r.start()), _size(r.size()) - {} - - char* start() const { return _start; } - size_t size() const { return _size; } - char* end() const { return _start + _size; } - bool is_empty() const { return _size == 0 ? true : false; } - - static AddrRange empty_range() { return AddrRange(NULL, 0); } - - bool contains(const char* p) const { - return start() <= p && end() > p; + bool contains_addr(char* p) const { + return p >= addr && p < (addr + size); } - bool contains(const AddrRange& range) const { - return start() <= range.start() && end() >= range.end(); + bool contains_range(char* p, size_t s) const { + return contains_addr(p) && contains_addr(p + s - 1); } - bool intersects(const AddrRange& range) const { - return (range.start() <= start() && range.end() > start()) || - (range.start() < end() && range.end() >= end()) || - contains(range); + void print_on(outputStream* os) const { + os->print("[" PTR_FORMAT " - " PTR_FORMAT "] (" UINTX_FORMAT + " bytes, %d %s pages), %s", + addr, addr + size - 1, size, size / pagesize, describe_pagesize(pagesize), + (type == VMEM_SHMATED ? "shmat" : "mmap") + ); } - bool is_same_range(const AddrRange& range) const { - return start() == range.start() && size() == range.size(); - } - - // return the closest inside range consisting of whole pages - AddrRange find_closest_aligned_range(size_t pagesize) const { - if (pagesize == 0 || is_empty()) { - return empty_range(); + // Check that range is a sub range of memory block (or equal to memory block); + // also check that range is fully page aligned to the page size if the block. + void assert_is_valid_subrange(char* p, size_t s) const { + if (!contains_range(p, s)) { + fprintf(stderr, "[" PTR_FORMAT " - " PTR_FORMAT "] is not a sub " + "range of [" PTR_FORMAT " - " PTR_FORMAT "].\n", + p, p + s - 1, addr, addr + size - 1); + guarantee0(false); } - char* const from = (char*)align_size_up((intptr_t)_start, pagesize); - char* const to = (char*)align_size_down((intptr_t)end(), pagesize); - if (from > to) { - return empty_range(); + if (!is_aligned_to(p, pagesize) || !is_aligned_to(p + s, pagesize)) { + fprintf(stderr, "range [" PTR_FORMAT " - " PTR_FORMAT "] is not" + " aligned to pagesize (%s)\n", p, p + s); + guarantee0(false); } - return AddrRange(from, to - from); } }; -//////////////////////////////////////////////////////////////////////////// -// shared memory bookkeeping -// -// the os::reserve_memory() API and friends hand out different kind of memory, depending -// on need and circumstances. Memory may be allocated with mmap() or with shmget/shmat. -// -// But these memory types have to be treated differently. For example, to uncommit -// mmap-based memory, msync(MS_INVALIDATE) is needed, to uncommit shmat-based memory, -// disclaim64() is needed. -// -// Therefore we need to keep track of the allocated memory segments and their -// properties. - -// ShmBkBlock: base class for all blocks in the shared memory bookkeeping -class ShmBkBlock : public CHeapObj { - - ShmBkBlock* _next; - -protected: - - AddrRange _range; - const size_t _pagesize; - const bool _pinned; - -public: - - ShmBkBlock(AddrRange range, size_t pagesize, bool pinned) - : _range(range), _pagesize(pagesize), _pinned(pinned) , _next(NULL) { - - assert(_pagesize == SIZE_4K || _pagesize == SIZE_64K || _pagesize == SIZE_16M, "invalid page size"); - assert(!_range.is_empty(), "invalid range"); - } - - virtual void print(outputStream* st) const { - st->print("0x%p ... 0x%p (%llu) - %d %s pages - %s", - _range.start(), _range.end(), _range.size(), - _range.size() / _pagesize, describe_pagesize(_pagesize), - _pinned ? "pinned" : ""); - } - - enum Type { MMAP, SHMAT }; - virtual Type getType() = 0; - - char* base() const { return _range.start(); } - size_t size() const { return _range.size(); } - - void setAddrRange(AddrRange range) { - _range = range; - } - - bool containsAddress(const char* p) const { - return _range.contains(p); - } - - bool containsRange(const char* p, size_t size) const { - return _range.contains(AddrRange((char*)p, size)); - } - - bool isSameRange(const char* p, size_t size) const { - return _range.is_same_range(AddrRange((char*)p, size)); - } - - virtual bool disclaim(char* p, size_t size) = 0; - virtual bool release() = 0; - - // blocks live in a list. - ShmBkBlock* next() const { return _next; } - void set_next(ShmBkBlock* blk) { _next = blk; } - -}; // end: ShmBkBlock - - -// ShmBkMappedBlock: describes an block allocated with mmap() -class ShmBkMappedBlock : public ShmBkBlock { -public: - - ShmBkMappedBlock(AddrRange range) - : ShmBkBlock(range, SIZE_4K, false) {} // mmap: always 4K, never pinned - - void print(outputStream* st) const { - ShmBkBlock::print(st); - st->print_cr(" - mmap'ed"); - } - - Type getType() { - return MMAP; - } - - bool disclaim(char* p, size_t size) { - - AddrRange r(p, size); - - guarantee(_range.contains(r), "invalid disclaim"); - - // only disclaim whole ranges. - const AddrRange r2 = r.find_closest_aligned_range(_pagesize); - if (r2.is_empty()) { - return true; - } - - const int rc = ::msync(r2.start(), r2.size(), MS_INVALIDATE); - - if (rc != 0) { - warning("msync(0x%p, %llu, MS_INVALIDATE) failed (%d)\n", r2.start(), r2.size(), errno); - } - - return rc == 0 ? true : false; - } - - bool release() { - // mmap'ed blocks are released using munmap - if (::munmap(_range.start(), _range.size()) != 0) { - warning("munmap(0x%p, %llu) failed (%d)\n", _range.start(), _range.size(), errno); - return false; - } - return true; - } -}; // end: ShmBkMappedBlock - -// ShmBkShmatedBlock: describes an block allocated with shmget/shmat() -class ShmBkShmatedBlock : public ShmBkBlock { -public: - - ShmBkShmatedBlock(AddrRange range, size_t pagesize, bool pinned) - : ShmBkBlock(range, pagesize, pinned) {} - - void print(outputStream* st) const { - ShmBkBlock::print(st); - st->print_cr(" - shmat'ed"); - } - - Type getType() { - return SHMAT; - } - - bool disclaim(char* p, size_t size) { - - AddrRange r(p, size); - - if (_pinned) { - return true; - } - - // shmat'ed blocks are disclaimed using disclaim64 - guarantee(_range.contains(r), "invalid disclaim"); - - // only disclaim whole ranges. - const AddrRange r2 = r.find_closest_aligned_range(_pagesize); - if (r2.is_empty()) { - return true; - } - - const bool rc = my_disclaim64(r2.start(), r2.size()); - - if (Verbose && !rc) { - warning("failed to disclaim shm %p-%p\n", r2.start(), r2.end()); - } - - return rc; - } - - bool release() { - bool rc = false; - if (::shmdt(_range.start()) != 0) { - warning("shmdt(0x%p) failed (%d)\n", _range.start(), errno); - } else { - rc = true; - } - return rc; - } - -}; // end: ShmBkShmatedBlock - -static ShmBkBlock* g_shmbk_list = NULL; -static volatile jint g_shmbk_table_lock = 0; - -// keep some usage statistics static struct { - int nodes; // number of nodes in list - size_t bytes; // reserved - not committed - bytes. - int reserves; // how often reserve was called - int lookups; // how often a lookup was made -} g_shmbk_stats = { 0, 0, 0, 0 }; + vmembk_t* first; + MiscUtils::CritSect cs; +} vmem; -// add information about a shared memory segment to the bookkeeping -static void shmbk_register(ShmBkBlock* p_block) { - guarantee(p_block, "logic error"); - p_block->set_next(g_shmbk_list); - g_shmbk_list = p_block; - g_shmbk_stats.reserves ++; - g_shmbk_stats.bytes += p_block->size(); - g_shmbk_stats.nodes ++; -} - -// remove information about a shared memory segment by its starting address -static void shmbk_unregister(ShmBkBlock* p_block) { - ShmBkBlock* p = g_shmbk_list; - ShmBkBlock* prev = NULL; - while (p) { - if (p == p_block) { - if (prev) { - prev->set_next(p->next()); - } else { - g_shmbk_list = p->next(); - } - g_shmbk_stats.nodes --; - g_shmbk_stats.bytes -= p->size(); - return; - } - prev = p; - p = p->next(); +static void vmembk_add(char* addr, size_t size, size_t pagesize, int type) { + vmembk_t* p = (vmembk_t*) ::malloc(sizeof(vmembk_t)); + assert0(p); + if (p) { + MiscUtils::AutoCritSect lck(&vmem.cs); + p->addr = addr; p->size = size; + p->pagesize = pagesize; + p->type = type; + p->next = vmem.first; + vmem.first = p; } - assert(false, "should not happen"); } -// given a pointer, return shared memory bookkeeping record for the segment it points into -// using the returned block info must happen under lock protection -static ShmBkBlock* shmbk_find_by_containing_address(const char* addr) { - g_shmbk_stats.lookups ++; - ShmBkBlock* p = g_shmbk_list; - while (p) { - if (p->containsAddress(addr)) { +static vmembk_t* vmembk_find(char* addr) { + MiscUtils::AutoCritSect lck(&vmem.cs); + for (vmembk_t* p = vmem.first; p; p = p->next) { + if (p->addr <= addr && (p->addr + p->size) > addr) { return p; } - p = p->next(); } return NULL; } -// dump all information about all memory segments allocated with os::reserve_memory() -void shmbk_dump_info() { - tty->print_cr("-- shared mem bookkeeping (alive: %d segments, %llu bytes, " - "total reserves: %d total lookups: %d)", - g_shmbk_stats.nodes, g_shmbk_stats.bytes, g_shmbk_stats.reserves, g_shmbk_stats.lookups); - const ShmBkBlock* p = g_shmbk_list; - int i = 0; - while (p) { - p->print(tty); - p = p->next(); - i ++; +static void vmembk_remove(vmembk_t* p0) { + MiscUtils::AutoCritSect lck(&vmem.cs); + assert0(p0); + assert0(vmem.first); // List should not be empty. + for (vmembk_t** pp = &(vmem.first); *pp; pp = &((*pp)->next)) { + if (*pp == p0) { + *pp = p0->next; + ::free(p0); + return; + } + } + assert0(false); // Not found? +} + +static void vmembk_print_on(outputStream* os) { + MiscUtils::AutoCritSect lck(&vmem.cs); + for (vmembk_t* vmi = vmem.first; vmi; vmi = vmi->next) { + vmi->print_on(os); + os->cr(); } } -#define LOCK_SHMBK { ThreadCritical _LOCK_SHMBK; -#define UNLOCK_SHMBK } +// Reserve and attach a section of System V memory. +// If is not NULL, function will attempt to attach the memory at the given +// address. Failing that, it will attach the memory anywhere. +// If is NULL, function will attach the memory anywhere. +// +// is being ignored by this function. It is very probable however that the +// alignment requirements are met anyway, because shmat() attaches at 256M boundaries. +// Should this be not enogh, we can put more work into it. +static char* reserve_shmated_memory ( + size_t bytes, + char* requested_addr, + size_t alignment_hint) { + + trcVerbose("reserve_shmated_memory " UINTX_FORMAT " bytes, wishaddress " + PTR_FORMAT ", alignment_hint " UINTX_FORMAT "...", + bytes, requested_addr, alignment_hint); + + // Either give me wish address or wish alignment but not both. + assert0(!(requested_addr != NULL && alignment_hint != 0)); + + // We must prevent anyone from attaching too close to the + // BRK because that may cause malloc OOM. + if (requested_addr != NULL && is_close_to_brk((address)requested_addr)) { + trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment. " + "Will attach anywhere.", requested_addr); + // Act like the OS refused to attach there. + requested_addr = NULL; + } + + // For old AS/400's (V5R4 and older) we should not even be here - System V shared memory is not + // really supported (max size 4GB), so reserve_mmapped_memory should have been used instead. + if (os::Aix::on_pase_V5R4_or_older()) { + ShouldNotReachHere(); + } + + // Align size of shm up to 64K to avoid errors if we later try to change the page size. + const size_t size = align_size_up(bytes, SIZE_64K); + + // Reserve the shared segment. + int shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | S_IRUSR | S_IWUSR); + if (shmid == -1) { + trc("shmget(.., " UINTX_FORMAT ", ..) failed (errno: %d).", size, errno); + return NULL; + } + + // Important note: + // It is very important that we, upon leaving this function, do not leave a shm segment alive. + // We must right after attaching it remove it from the system. System V shm segments are global and + // survive the process. + // So, from here on: Do not assert, do not return, until we have called shmctl(IPC_RMID) (A). + + struct shmid_ds shmbuf; + memset(&shmbuf, 0, sizeof(shmbuf)); + shmbuf.shm_pagesize = SIZE_64K; + if (shmctl(shmid, SHM_PAGESIZE, &shmbuf) != 0) { + trcVerbose("Failed to set page size (need " UINTX_FORMAT " 64K pages) - shmctl failed with %d.", + size / SIZE_64K, errno); + // I want to know if this ever happens. + assert(false, "failed to set page size for shmat"); + } + + // Now attach the shared segment. + // Note that I attach with SHM_RND - which means that the requested address is rounded down, if + // needed, to the next lowest segment boundary. Otherwise the attach would fail if the address + // were not a segment boundary. + char* const addr = (char*) shmat(shmid, requested_addr, SHM_RND); + const int errno_shmat = errno; + + // (A) Right after shmat and before handing shmat errors delete the shm segment. + if (::shmctl(shmid, IPC_RMID, NULL) == -1) { + trc("shmctl(%u, IPC_RMID) failed (%d)\n", shmid, errno); + assert(false, "failed to remove shared memory segment!"); + } + + // Handle shmat error. If we failed to attach, just return. + if (addr == (char*)-1) { + trcVerbose("Failed to attach segment at " PTR_FORMAT " (%d).", requested_addr, errno_shmat); + return NULL; + } + + // Just for info: query the real page size. In case setting the page size did not + // work (see above), the system may have given us something other then 4K (LDR_CNTRL). + const size_t real_pagesize = os::Aix::query_pagesize(addr); + if (real_pagesize != shmbuf.shm_pagesize) { + trcVerbose("pagesize is, surprisingly, %h.", real_pagesize); + } + + if (addr) { + trcVerbose("shm-allocated " PTR_FORMAT " .. " PTR_FORMAT " (" UINTX_FORMAT " bytes, " UINTX_FORMAT " %s pages)", + addr, addr + size - 1, size, size/real_pagesize, describe_pagesize(real_pagesize)); + } else { + if (requested_addr != NULL) { + trcVerbose("failed to shm-allocate " UINTX_FORMAT " bytes at with address " PTR_FORMAT ".", size, requested_addr); + } else { + trcVerbose("failed to shm-allocate " UINTX_FORMAT " bytes at any address.", size); + } + } + + // book-keeping + vmembk_add(addr, size, real_pagesize, VMEM_SHMATED); + assert0(is_aligned_to(addr, os::vm_page_size())); + + return addr; +} + +static bool release_shmated_memory(char* addr, size_t size) { + + trcVerbose("release_shmated_memory [" PTR_FORMAT " - " PTR_FORMAT "].", + addr, addr + size - 1); + + bool rc = false; + + // TODO: is there a way to verify shm size without doing bookkeeping? + if (::shmdt(addr) != 0) { + trcVerbose("error (%d).", errno); + } else { + trcVerbose("ok."); + rc = true; + } + return rc; +} + +static bool uncommit_shmated_memory(char* addr, size_t size) { + trcVerbose("uncommit_shmated_memory [" PTR_FORMAT " - " PTR_FORMAT "].", + addr, addr + size - 1); + + const bool rc = my_disclaim64(addr, size); + + if (!rc) { + trcVerbose("my_disclaim64(" PTR_FORMAT ", " UINTX_FORMAT ") failed.\n", addr, size); + return false; + } + return true; +} + +// Reserve memory via mmap. +// If is given, an attempt is made to attach at the given address. +// Failing that, memory is allocated at any address. +// If is given and is NULL, an attempt is made to +// allocate at an address aligned with the given alignment. Failing that, memory +// is aligned anywhere. +static char* reserve_mmaped_memory(size_t bytes, char* requested_addr, size_t alignment_hint) { + trcVerbose("reserve_mmaped_memory " UINTX_FORMAT " bytes, wishaddress " PTR_FORMAT ", " + "alignment_hint " UINTX_FORMAT "...", + bytes, requested_addr, alignment_hint); + + // If a wish address is given, but not aligned to 4K page boundary, mmap will fail. + if (requested_addr && !is_aligned_to(requested_addr, os::vm_page_size()) != 0) { + trcVerbose("Wish address " PTR_FORMAT " not aligned to page boundary.", requested_addr); + return NULL; + } + + // We must prevent anyone from attaching too close to the + // BRK because that may cause malloc OOM. + if (requested_addr != NULL && is_close_to_brk((address)requested_addr)) { + trcVerbose("Wish address " PTR_FORMAT " is too close to the BRK segment. " + "Will attach anywhere.", requested_addr); + // Act like the OS refused to attach there. + requested_addr = NULL; + } + + // Specify one or the other but not both. + assert0(!(requested_addr != NULL && alignment_hint > 0)); + + // In 64K mode, we claim the global page size (os::vm_page_size()) + // is 64K. This is one of the few points where that illusion may + // break, because mmap() will always return memory aligned to 4K. So + // we must ensure we only ever return memory aligned to 64k. + if (alignment_hint) { + alignment_hint = lcm(alignment_hint, os::vm_page_size()); + } else { + alignment_hint = os::vm_page_size(); + } + + // Size shall always be a multiple of os::vm_page_size (esp. in 64K mode). + const size_t size = align_size_up(bytes, os::vm_page_size()); + + // alignment: Allocate memory large enough to include an aligned range of the right size and + // cut off the leading and trailing waste pages. + assert0(alignment_hint != 0 && is_aligned_to(alignment_hint, os::vm_page_size())); // see above + const size_t extra_size = size + alignment_hint; + + // Note: MAP_SHARED (instead of MAP_PRIVATE) needed to be able to + // later use msync(MS_INVALIDATE) (see os::uncommit_memory). + int flags = MAP_ANONYMOUS | MAP_SHARED; + + // MAP_FIXED is needed to enforce requested_addr - manpage is vague about what + // it means if wishaddress is given but MAP_FIXED is not set. + // + // Important! Behaviour differs depending on whether SPEC1170 mode is active or not. + // SPEC1170 mode active: behaviour like POSIX, MAP_FIXED will clobber existing mappings. + // SPEC1170 mode not active: behaviour, unlike POSIX, is that no existing mappings will + // get clobbered. + if (requested_addr != NULL) { + if (!os::Aix::xpg_sus_mode()) { // not SPEC1170 Behaviour + flags |= MAP_FIXED; + } + } + + char* addr = (char*)::mmap(requested_addr, extra_size, + PROT_READ|PROT_WRITE|PROT_EXEC, flags, -1, 0); + + if (addr == MAP_FAILED) { + trcVerbose("mmap(" PTR_FORMAT ", " UINTX_FORMAT ", ..) failed (%d)", requested_addr, size, errno); + return NULL; + } + + // Handle alignment. + char* const addr_aligned = (char *)align_ptr_up(addr, alignment_hint); + const size_t waste_pre = addr_aligned - addr; + char* const addr_aligned_end = addr_aligned + size; + const size_t waste_post = extra_size - waste_pre - size; + if (waste_pre > 0) { + ::munmap(addr, waste_pre); + } + if (waste_post > 0) { + ::munmap(addr_aligned_end, waste_post); + } + addr = addr_aligned; + + if (addr) { + trcVerbose("mmap-allocated " PTR_FORMAT " .. " PTR_FORMAT " (" UINTX_FORMAT " bytes)", + addr, addr + bytes, bytes); + } else { + if (requested_addr != NULL) { + trcVerbose("failed to mmap-allocate " UINTX_FORMAT " bytes at wish address " PTR_FORMAT ".", bytes, requested_addr); + } else { + trcVerbose("failed to mmap-allocate " UINTX_FORMAT " bytes at any address.", bytes); + } + } + + // bookkeeping + vmembk_add(addr, size, SIZE_4K, VMEM_MAPPED); + + // Test alignment, see above. + assert0(is_aligned_to(addr, os::vm_page_size())); + + return addr; +} + +static bool release_mmaped_memory(char* addr, size_t size) { + assert0(is_aligned_to(addr, os::vm_page_size())); + assert0(is_aligned_to(size, os::vm_page_size())); + + trcVerbose("release_mmaped_memory [" PTR_FORMAT " - " PTR_FORMAT "].", + addr, addr + size - 1); + bool rc = false; + + if (::munmap(addr, size) != 0) { + trcVerbose("failed (%d)\n", errno); + rc = false; + } else { + trcVerbose("ok."); + rc = true; + } + + return rc; +} + +static bool uncommit_mmaped_memory(char* addr, size_t size) { + + assert0(is_aligned_to(addr, os::vm_page_size())); + assert0(is_aligned_to(size, os::vm_page_size())); + + trcVerbose("uncommit_mmaped_memory [" PTR_FORMAT " - " PTR_FORMAT "].", + addr, addr + size - 1); + bool rc = false; + + // Uncommit mmap memory with msync MS_INVALIDATE. + if (::msync(addr, size, MS_INVALIDATE) != 0) { + trcVerbose("failed (%d)\n", errno); + rc = false; + } else { + trcVerbose("ok."); + rc = true; + } + + return rc; +} // End: shared memory bookkeeping //////////////////////////////////////////////////////////////////////////////////////////////////// int os::vm_page_size() { - // Seems redundant as all get out + // Seems redundant as all get out. assert(os::Aix::page_size() != -1, "must call os::init"); return os::Aix::page_size(); } @@ -2146,91 +2265,76 @@ int os::vm_allocation_granularity() { return os::Aix::page_size(); } -int os::Aix::commit_memory_impl(char* addr, size_t size, bool exec) { - - // Commit is a noop. There is no explicit commit - // needed on AIX. Memory is committed when touched. - // - // Debug : check address range for validity -#ifdef ASSERT - LOCK_SHMBK - ShmBkBlock* const block = shmbk_find_by_containing_address(addr); - if (!block) { - fprintf(stderr, "invalid pointer: " INTPTR_FORMAT "\n", addr); - shmbk_dump_info(); - assert(false, "invalid pointer"); - return false; - } else if (!block->containsRange(addr, size)) { - fprintf(stderr, "invalid range: " INTPTR_FORMAT " .. " INTPTR_FORMAT "\n", addr, addr + size); - shmbk_dump_info(); - assert(false, "invalid range"); - return false; - } - UNLOCK_SHMBK -#endif // ASSERT - - return 0; -} - -bool os::pd_commit_memory(char* addr, size_t size, bool exec) { - return os::Aix::commit_memory_impl(addr, size, exec) == 0; +#ifdef PRODUCT +static void warn_fail_commit_memory(char* addr, size_t size, bool exec, + int err) { + warning("INFO: os::commit_memory(" PTR_FORMAT ", " SIZE_FORMAT + ", %d) failed; error='%s' (errno=%d)", addr, size, exec, + strerror(err), err); } +#endif void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec, const char* mesg) { assert(mesg != NULL, "mesg must be specified"); - os::Aix::commit_memory_impl(addr, size, exec); + if (!pd_commit_memory(addr, size, exec)) { + // Add extra info in product mode for vm_exit_out_of_memory(): + PRODUCT_ONLY(warn_fail_commit_memory(addr, size, exec, errno);) + vm_exit_out_of_memory(size, OOM_MMAP_ERROR, mesg); + } } -int os::Aix::commit_memory_impl(char* addr, size_t size, - size_t alignment_hint, bool exec) { - return os::Aix::commit_memory_impl(addr, size, exec); +bool os::pd_commit_memory(char* addr, size_t size, bool exec) { + + assert0(is_aligned_to(addr, os::vm_page_size())); + assert0(is_aligned_to(size, os::vm_page_size())); + + vmembk_t* const vmi = vmembk_find(addr); + assert0(vmi); + vmi->assert_is_valid_subrange(addr, size); + + trcVerbose("commit_memory [" PTR_FORMAT " - " PTR_FORMAT "].", addr, addr + size - 1); + + return true; } -bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, - bool exec) { - return os::Aix::commit_memory_impl(addr, size, alignment_hint, exec) == 0; +bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint, bool exec) { + return pd_commit_memory(addr, size, exec); } void os::pd_commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, bool exec, const char* mesg) { - os::Aix::commit_memory_impl(addr, size, alignment_hint, exec); + // Alignment_hint is ignored on this OS. + pd_commit_memory_or_exit(addr, size, exec, mesg); } bool os::pd_uncommit_memory(char* addr, size_t size) { + assert0(is_aligned_to(addr, os::vm_page_size())); + assert0(is_aligned_to(size, os::vm_page_size())); - // Delegate to ShmBkBlock class which knows how to uncommit its memory. + // Dynamically do different things for mmap/shmat. + const vmembk_t* const vmi = vmembk_find(addr); + assert0(vmi); + vmi->assert_is_valid_subrange(addr, size); - bool rc = false; - LOCK_SHMBK - ShmBkBlock* const block = shmbk_find_by_containing_address(addr); - if (!block) { - fprintf(stderr, "invalid pointer: 0x%p.\n", addr); - shmbk_dump_info(); - assert(false, "invalid pointer"); - return false; - } else if (!block->containsRange(addr, size)) { - fprintf(stderr, "invalid range: 0x%p .. 0x%p.\n", addr, addr + size); - shmbk_dump_info(); - assert(false, "invalid range"); - return false; - } - rc = block->disclaim(addr, size); - UNLOCK_SHMBK - - if (Verbose && !rc) { - warning("failed to disclaim 0x%p .. 0x%p (0x%llX bytes).", addr, addr + size, size); + if (vmi->type == VMEM_SHMATED) { + return uncommit_shmated_memory(addr, size); + } else { + return uncommit_mmaped_memory(addr, size); } - return rc; } bool os::pd_create_stack_guard_pages(char* addr, size_t size) { - return os::guard_memory(addr, size); + // Do not call this; no need to commit stack pages on AIX. + ShouldNotReachHere(); + return true; } bool os::remove_stack_guard_pages(char* addr, size_t size) { - return os::unguard_memory(addr, size); + // Do not call this; no need to commit stack pages on AIX. + ShouldNotReachHere(); + return true; } void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { @@ -2273,355 +2377,75 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info return end; } -// Flags for reserve_shmatted_memory: -#define RESSHM_WISHADDR_OR_FAIL 1 -#define RESSHM_TRY_16M_PAGES 2 -#define RESSHM_16M_PAGES_OR_FAIL 4 - -// Result of reserve_shmatted_memory: -struct shmatted_memory_info_t { - char* addr; - size_t pagesize; - bool pinned; -}; - -// Reserve a section of shmatted memory. -// params: -// bytes [in]: size of memory, in bytes -// requested_addr [in]: wish address. -// NULL = no wish. -// If RESSHM_WISHADDR_OR_FAIL is set in flags and wish address cannot -// be obtained, function will fail. Otherwise wish address is treated as hint and -// another pointer is returned. -// flags [in]: some flags. Valid flags are: -// RESSHM_WISHADDR_OR_FAIL - fail if wish address is given and cannot be obtained. -// RESSHM_TRY_16M_PAGES - try to allocate from 16M page pool -// (requires UseLargePages and Use16MPages) -// RESSHM_16M_PAGES_OR_FAIL - if you cannot allocate from 16M page pool, fail. -// Otherwise any other page size will do. -// p_info [out] : holds information about the created shared memory segment. -static bool reserve_shmatted_memory(size_t bytes, char* requested_addr, int flags, shmatted_memory_info_t* p_info) { - - assert(p_info, "parameter error"); - - // init output struct. - p_info->addr = NULL; - - // neither should we be here for EXTSHM=ON. - if (os::Aix::extshm()) { - ShouldNotReachHere(); - } - - // extract flags. sanity checks. - const bool wishaddr_or_fail = - flags & RESSHM_WISHADDR_OR_FAIL; - const bool try_16M_pages = - flags & RESSHM_TRY_16M_PAGES; - const bool f16M_pages_or_fail = - flags & RESSHM_16M_PAGES_OR_FAIL; - - // first check: if a wish address is given and it is mandatory, but not aligned to segment boundary, - // shmat will fail anyway, so save some cycles by failing right away - if (requested_addr && ((uintptr_t)requested_addr % SIZE_256M == 0)) { - if (wishaddr_or_fail) { - return false; - } else { - requested_addr = NULL; - } - } - - char* addr = NULL; - - // Align size of shm up to the largest possible page size, to avoid errors later on when we try to change - // pagesize dynamically. - const size_t size = align_size_up(bytes, SIZE_16M); - - // reserve the shared segment - int shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | S_IRUSR | S_IWUSR); - if (shmid == -1) { - warning("shmget(.., %lld, ..) failed (errno: %d).", size, errno); - return false; - } - - // Important note: - // It is very important that we, upon leaving this function, do not leave a shm segment alive. - // We must right after attaching it remove it from the system. System V shm segments are global and - // survive the process. - // So, from here on: Do not assert. Do not return. Always do a "goto cleanup_shm". - - // try forcing the page size - size_t pagesize = -1; // unknown so far - - if (UseLargePages) { - - struct shmid_ds shmbuf; - memset(&shmbuf, 0, sizeof(shmbuf)); - - // First, try to take from 16M page pool if... - if (os::Aix::can_use_16M_pages() // we can ... - && Use16MPages // we are not explicitly forbidden to do so (-XX:-Use16MPages).. - && try_16M_pages) { // caller wants us to. - shmbuf.shm_pagesize = SIZE_16M; - if (shmctl(shmid, SHM_PAGESIZE, &shmbuf) == 0) { - pagesize = SIZE_16M; - } else { - warning("Failed to allocate %d 16M pages. 16M page pool might be exhausted. (shmctl failed with %d)", - size / SIZE_16M, errno); - if (f16M_pages_or_fail) { - goto cleanup_shm; - } - } - } - - // Nothing yet? Try setting 64K pages. Note that I never saw this fail, but in theory it might, - // because the 64K page pool may also be exhausted. - if (pagesize == -1) { - shmbuf.shm_pagesize = SIZE_64K; - if (shmctl(shmid, SHM_PAGESIZE, &shmbuf) == 0) { - pagesize = SIZE_64K; - } else { - warning("Failed to allocate %d 64K pages. (shmctl failed with %d)", - size / SIZE_64K, errno); - // here I give up. leave page_size -1 - later, after attaching, we will query the - // real page size of the attached memory. (in theory, it may be something different - // from 4K if LDR_CNTRL SHM_PSIZE is set) - } - } - } - - // sanity point - assert(pagesize == -1 || pagesize == SIZE_16M || pagesize == SIZE_64K, "wrong page size"); - - // Now attach the shared segment. - addr = (char*) shmat(shmid, requested_addr, 0); - if (addr == (char*)-1) { - // How to handle attach failure: - // If it failed for a specific wish address, tolerate this: in that case, if wish address was - // mandatory, fail, if not, retry anywhere. - // If it failed for any other reason, treat that as fatal error. - addr = NULL; - if (requested_addr) { - if (wishaddr_or_fail) { - goto cleanup_shm; - } else { - addr = (char*) shmat(shmid, NULL, 0); - if (addr == (char*)-1) { // fatal - addr = NULL; - warning("shmat failed (errno: %d)", errno); - goto cleanup_shm; - } - } - } else { // fatal - addr = NULL; - warning("shmat failed (errno: %d)", errno); - goto cleanup_shm; - } - } - - // sanity point - assert(addr && addr != (char*) -1, "wrong address"); - - // after successful Attach remove the segment - right away. - if (::shmctl(shmid, IPC_RMID, NULL) == -1) { - warning("shmctl(%u, IPC_RMID) failed (%d)\n", shmid, errno); - guarantee(false, "failed to remove shared memory segment!"); - } - shmid = -1; - - // query the real page size. In case setting the page size did not work (see above), the system - // may have given us something other then 4K (LDR_CNTRL) - { - const size_t real_pagesize = os::Aix::query_pagesize(addr); - if (pagesize != -1) { - assert(pagesize == real_pagesize, "unexpected pagesize after shmat"); - } else { - pagesize = real_pagesize; - } - } - - // Now register the reserved block with internal book keeping. - LOCK_SHMBK - const bool pinned = pagesize >= SIZE_16M ? true : false; - ShmBkShmatedBlock* const p_block = new ShmBkShmatedBlock(AddrRange(addr, size), pagesize, pinned); - assert(p_block, ""); - shmbk_register(p_block); - UNLOCK_SHMBK - -cleanup_shm: - - // if we have not done so yet, remove the shared memory segment. This is very important. - if (shmid != -1) { - if (::shmctl(shmid, IPC_RMID, NULL) == -1) { - warning("shmctl(%u, IPC_RMID) failed (%d)\n", shmid, errno); - guarantee(false, "failed to remove shared memory segment!"); - } - shmid = -1; - } - - // trace - if (Verbose && !addr) { - if (requested_addr != NULL) { - warning("failed to shm-allocate 0x%llX bytes at wish address 0x%p.", size, requested_addr); - } else { - warning("failed to shm-allocate 0x%llX bytes at any address.", size); - } - } - - // hand info to caller - if (addr) { - p_info->addr = addr; - p_info->pagesize = pagesize; - p_info->pinned = pagesize == SIZE_16M ? true : false; - } - - // sanity test: - if (requested_addr && addr && wishaddr_or_fail) { - guarantee(addr == requested_addr, "shmat error"); - } - - // just one more test to really make sure we have no dangling shm segments. - guarantee(shmid == -1, "dangling shm segments"); - - return addr ? true : false; - -} // end: reserve_shmatted_memory - -// Reserve memory using mmap. Behaves the same as reserve_shmatted_memory(): -// will return NULL in case of an error. -static char* reserve_mmaped_memory(size_t bytes, char* requested_addr) { - - // if a wish address is given, but not aligned to 4K page boundary, mmap will fail. - if (requested_addr && ((uintptr_t)requested_addr % os::vm_page_size() != 0)) { - warning("Wish address 0x%p not aligned to page boundary.", requested_addr); - return NULL; - } - - const size_t size = align_size_up(bytes, SIZE_4K); - - // Note: MAP_SHARED (instead of MAP_PRIVATE) needed to be able to - // msync(MS_INVALIDATE) (see os::uncommit_memory) - int flags = MAP_ANONYMOUS | MAP_SHARED; - - // MAP_FIXED is needed to enforce requested_addr - manpage is vague about what - // it means if wishaddress is given but MAP_FIXED is not set. - // - // Note however that this changes semantics in SPEC1170 mode insofar as MAP_FIXED - // clobbers the address range, which is probably not what the caller wants. That's - // why I assert here (again) that the SPEC1170 compat mode is off. - // If we want to be able to run under SPEC1170, we have to do some porting and - // testing. - if (requested_addr != NULL) { - assert(!os::Aix::xpg_sus_mode(), "SPEC1170 mode not allowed."); - flags |= MAP_FIXED; - } - - char* addr = (char*)::mmap(requested_addr, size, PROT_READ|PROT_WRITE|PROT_EXEC, flags, -1, 0); - - if (addr == MAP_FAILED) { - // attach failed: tolerate for specific wish addresses. Not being able to attach - // anywhere is a fatal error. - if (requested_addr == NULL) { - // It's ok to fail here if the machine has not enough memory. - warning("mmap(NULL, 0x%llX, ..) failed (%d)", size, errno); - } - addr = NULL; - goto cleanup_mmap; - } - - // If we did request a specific address and that address was not available, fail. - if (addr && requested_addr) { - guarantee(addr == requested_addr, "unexpected"); - } - - // register this mmap'ed segment with book keeping - LOCK_SHMBK - ShmBkMappedBlock* const p_block = new ShmBkMappedBlock(AddrRange(addr, size)); - assert(p_block, ""); - shmbk_register(p_block); - UNLOCK_SHMBK - -cleanup_mmap: - - // trace - if (Verbose) { - if (addr) { - fprintf(stderr, "mmap-allocated 0x%p .. 0x%p (0x%llX bytes)\n", addr, addr + bytes, bytes); - } - else { - if (requested_addr != NULL) { - warning("failed to mmap-allocate 0x%llX bytes at wish address 0x%p.", bytes, requested_addr); - } else { - warning("failed to mmap-allocate 0x%llX bytes at any address.", bytes); - } - } - } - - return addr; - -} // end: reserve_mmaped_memory - // Reserves and attaches a shared memory segment. // Will assert if a wish address is given and could not be obtained. char* os::pd_reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) { - return os::attempt_reserve_memory_at(bytes, requested_addr); + + // All other Unices do a mmap(MAP_FIXED) if the addr is given, + // thereby clobbering old mappings at that place. That is probably + // not intended, never used and almost certainly an error were it + // ever be used this way (to try attaching at a specified address + // without clobbering old mappings an alternate API exists, + // os::attempt_reserve_memory_at()). + // Instead of mimicking the dangerous coding of the other platforms, here I + // just ignore the request address (release) or assert(debug). + assert0(requested_addr == NULL); + + // Always round to os::vm_page_size(), which may be larger than 4K. + bytes = align_size_up(bytes, os::vm_page_size()); + const size_t alignment_hint0 = + alignment_hint ? align_size_up(alignment_hint, os::vm_page_size()) : 0; + + // In 4K mode always use mmap. + // In 64K mode allocate small sizes with mmap, large ones with 64K shmatted. + if (os::vm_page_size() == SIZE_4K) { + return reserve_mmaped_memory(bytes, requested_addr, alignment_hint); + } else { + if (bytes >= Use64KPagesThreshold) { + return reserve_shmated_memory(bytes, requested_addr, alignment_hint); + } else { + return reserve_mmaped_memory(bytes, requested_addr, alignment_hint); + } + } } bool os::pd_release_memory(char* addr, size_t size) { - // delegate to ShmBkBlock class which knows how to uncommit its memory. + // Dynamically do different things for mmap/shmat. + vmembk_t* const vmi = vmembk_find(addr); + assert0(vmi); + + // Always round to os::vm_page_size(), which may be larger than 4K. + size = align_size_up(size, os::vm_page_size()); + addr = (char *)align_ptr_up(addr, os::vm_page_size()); bool rc = false; - LOCK_SHMBK - ShmBkBlock* const block = shmbk_find_by_containing_address(addr); - if (!block) { - fprintf(stderr, "invalid pointer: 0x%p.\n", addr); - shmbk_dump_info(); - assert(false, "invalid pointer"); - return false; + bool remove_bookkeeping = false; + if (vmi->type == VMEM_SHMATED) { + // For shmatted memory, we do: + // - If user wants to release the whole range, release the memory (shmdt). + // - If user only wants to release a partial range, uncommit (disclaim) that + // range. That way, at least, we do not use memory anymore (bust still page + // table space). + vmi->assert_is_valid_subrange(addr, size); + if (addr == vmi->addr && size == vmi->size) { + rc = release_shmated_memory(addr, size); + remove_bookkeeping = true; + } else { + rc = uncommit_shmated_memory(addr, size); } - else if (!block->isSameRange(addr, size)) { - if (block->getType() == ShmBkBlock::MMAP) { - // Release only the same range or a the beginning or the end of a range. - if (block->base() == addr && size < block->size()) { - ShmBkMappedBlock* const b = new ShmBkMappedBlock(AddrRange(block->base() + size, block->size() - size)); - assert(b, ""); - shmbk_register(b); - block->setAddrRange(AddrRange(addr, size)); - } - else if (addr > block->base() && addr + size == block->base() + block->size()) { - ShmBkMappedBlock* const b = new ShmBkMappedBlock(AddrRange(block->base(), block->size() - size)); - assert(b, ""); - shmbk_register(b); - block->setAddrRange(AddrRange(addr, size)); - } - else { - fprintf(stderr, "invalid mmap range: 0x%p .. 0x%p.\n", addr, addr + size); - shmbk_dump_info(); - assert(false, "invalid mmap range"); - return false; - } - } - else { - // Release only the same range. No partial release allowed. - // Soften the requirement a bit, because the user may think he owns a smaller size - // than the block is due to alignment etc. - if (block->base() != addr || block->size() < size) { - fprintf(stderr, "invalid shmget range: 0x%p .. 0x%p.\n", addr, addr + size); - shmbk_dump_info(); - assert(false, "invalid shmget range"); - return false; - } - } - } - rc = block->release(); - assert(rc, "release failed"); - // remove block from bookkeeping - shmbk_unregister(block); - delete block; - UNLOCK_SHMBK + } else { + // User may unmap partial regions but region has to be fully contained. +#ifdef ASSERT + vmi->assert_is_valid_subrange(addr, size); +#endif + rc = release_mmaped_memory(addr, size); + remove_bookkeeping = true; + } - if (!rc) { - warning("failed to released %lu bytes at 0x%p", size, addr); + // update bookkeeping + if (rc && remove_bookkeeping) { + vmembk_remove(vmi); } return rc; @@ -2654,7 +2478,7 @@ static bool checked_mprotect(char* addr, size_t size, int prot) { // if (!os::Aix::xpg_sus_mode()) { - if (StubRoutines::SafeFetch32_stub()) { + if (CanUseSafeFetch32()) { const bool read_protected = (SafeFetch32((int*)addr, 0x12345678) == 0x12345678 && @@ -2702,46 +2526,8 @@ static size_t _large_page_size = 0; // Enable large page support if OS allows that. void os::large_page_init() { - - // Note: os::Aix::query_multipage_support must run first. - - if (!UseLargePages) { - return; - } - - if (!Aix::can_use_64K_pages()) { - assert(!Aix::can_use_16M_pages(), "64K is a precondition for 16M."); - UseLargePages = false; - return; - } - - if (!Aix::can_use_16M_pages() && Use16MPages) { - fprintf(stderr, "Cannot use 16M pages. Please ensure that there is a 16M page pool " - " and that the VM runs with CAP_BYPASS_RAC_VMM and CAP_PROPAGATE capabilities.\n"); - } - - // Do not report 16M page alignment as part of os::_page_sizes if we are - // explicitly forbidden from using 16M pages. Doing so would increase the - // alignment the garbage collector calculates with, slightly increasing - // heap usage. We should only pay for 16M alignment if we really want to - // use 16M pages. - if (Use16MPages && Aix::can_use_16M_pages()) { - _large_page_size = SIZE_16M; - _page_sizes[0] = SIZE_16M; - _page_sizes[1] = SIZE_64K; - _page_sizes[2] = SIZE_4K; - _page_sizes[3] = 0; - } else if (Aix::can_use_64K_pages()) { - _large_page_size = SIZE_64K; - _page_sizes[0] = SIZE_64K; - _page_sizes[1] = SIZE_4K; - _page_sizes[2] = 0; - } - - if (Verbose) { - ("Default large page size is 0x%llX.", _large_page_size); - } -} // end: os::large_page_init() + return; // Nothing to do. See query_multipage_support and friends. +} char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr, bool exec) { // "exec" is passed in but not used. Creating the shared image for @@ -2751,7 +2537,7 @@ char* os::reserve_memory_special(size_t bytes, size_t alignment, char* req_addr, } bool os::release_memory_special(char* base, size_t bytes) { - // detaching the SHM segment will also delete it, see reserve_memory_special() + // Detaching the SHM segment will also delete it, see reserve_memory_special(). Unimplemented(); return false; } @@ -2761,40 +2547,32 @@ size_t os::large_page_size() { } bool os::can_commit_large_page_memory() { - // Well, sadly we cannot commit anything at all (see comment in - // os::commit_memory) but we claim to so we can make use of large pages - return true; + // Does not matter, we do not support huge pages. + return false; } bool os::can_execute_large_page_memory() { - // We can do that - return true; + // Does not matter, we do not support huge pages. + return false; } // Reserve memory at an arbitrary address, only if that area is // available (and not reserved for something else). char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { - - bool use_mmap = false; - - // mmap: smaller graining, no large page support - // shm: large graining (256M), large page support, limited number of shm segments - // - // Prefer mmap wherever we either do not need large page support or have OS limits - - if (!UseLargePages || bytes < SIZE_16M) { - use_mmap = true; - } - char* addr = NULL; - if (use_mmap) { - addr = reserve_mmaped_memory(bytes, requested_addr); + + // Always round to os::vm_page_size(), which may be larger than 4K. + bytes = align_size_up(bytes, os::vm_page_size()); + + // In 4K mode always use mmap. + // In 64K mode allocate small sizes with mmap, large ones with 64K shmatted. + if (os::vm_page_size() == SIZE_4K) { + return reserve_mmaped_memory(bytes, requested_addr, 0); } else { - // shmat: wish address is mandatory, and do not try 16M pages here. - shmatted_memory_info_t info; - const int flags = RESSHM_WISHADDR_OR_FAIL; - if (reserve_shmatted_memory(bytes, requested_addr, flags, &info)) { - addr = info.addr; + if (bytes >= Use64KPagesThreshold) { + return reserve_shmated_memory(bytes, requested_addr, 0); + } else { + return reserve_mmaped_memory(bytes, requested_addr, 0); } } @@ -3629,18 +3407,89 @@ extern "C" { // This is called _before_ the most of global arguments have been parsed. void os::init(void) { // This is basic, we want to know if that ever changes. - // (shared memory boundary is supposed to be a 256M aligned) + // (Shared memory boundary is supposed to be a 256M aligned.) assert(SHMLBA == ((uint64_t)0x10000000ULL)/*256M*/, "unexpected"); // First off, we need to know whether we run on AIX or PASE, and // the OS level we run on. os::Aix::initialize_os_info(); - // Scan environment (SPEC1170 behaviour, etc) + // Scan environment (SPEC1170 behaviour, etc). os::Aix::scan_environment(); // Check which pages are supported by AIX. - os::Aix::query_multipage_support(); + query_multipage_support(); + + // Act like we only have one page size by eliminating corner cases which + // we did not support very well anyway. + // We have two input conditions: + // 1) Data segment page size. This is controlled by linker setting (datapsize) on the + // launcher, and/or by LDR_CNTRL environment variable. The latter overrules the linker + // setting. + // Data segment page size is important for us because it defines the thread stack page + // size, which is needed for guard page handling, stack banging etc. + // 2) The ability to allocate 64k pages dynamically. If this is a given, java heap can + // and should be allocated with 64k pages. + // + // So, we do the following: + // LDR_CNTRL can_use_64K_pages_dynamically what we do remarks + // 4K no 4K old systems (aix 5.2, as/400 v5r4) or new systems with AME activated + // 4k yes 64k (treat 4k stacks as 64k) different loader than java and standard settings + // 64k no --- AIX 5.2 ? --- + // 64k yes 64k new systems and standard java loader (we set datapsize=64k when linking) + + // We explicitly leave no option to change page size, because only upgrading would work, + // not downgrading (if stack page size is 64k you cannot pretend its 4k). + + if (g_multipage_support.datapsize == SIZE_4K) { + // datapsize = 4K. Data segment, thread stacks are 4K paged. + if (g_multipage_support.can_use_64K_pages) { + // .. but we are able to use 64K pages dynamically. + // This would be typical for java launchers which are not linked + // with datapsize=64K (like, any other launcher but our own). + // + // In this case it would be smart to allocate the java heap with 64K + // to get the performance benefit, and to fake 64k pages for the + // data segment (when dealing with thread stacks). + // + // However, leave a possibility to downgrade to 4K, using + // -XX:-Use64KPages. + if (Use64KPages) { + trcVerbose("64K page mode (faked for data segment)"); + Aix::_page_size = SIZE_64K; + } else { + trcVerbose("4K page mode (Use64KPages=off)"); + Aix::_page_size = SIZE_4K; + } + } else { + // .. and not able to allocate 64k pages dynamically. Here, just + // fall back to 4K paged mode and use mmap for everything. + trcVerbose("4K page mode"); + Aix::_page_size = SIZE_4K; + FLAG_SET_ERGO(bool, Use64KPages, false); + } + } else { + // datapsize = 64k. Data segment, thread stacks are 64k paged. + // This normally means that we can allocate 64k pages dynamically. + // (There is one special case where this may be false: EXTSHM=on. + // but we decided to not support that mode). + assert0(g_multipage_support.can_use_64K_pages); + Aix::_page_size = SIZE_64K; + trcVerbose("64K page mode"); + FLAG_SET_ERGO(bool, Use64KPages, true); + } + + // Short-wire stack page size to base page size; if that works, we just remove + // that stack page size altogether. + Aix::_stack_page_size = Aix::_page_size; + + // For now UseLargePages is just ignored. + FLAG_SET_ERGO(bool, UseLargePages, false); + _page_sizes[0] = 0; + _large_page_size = -1; + + // debug trace + trcVerbose("os::vm_page_size %s\n", describe_pagesize(os::vm_page_size())); // Next, we need to initialize libo4 and libperfstat libraries. if (os::Aix::on_pase()) { @@ -3658,34 +3507,6 @@ void os::init(void) { // need libperfstat etc. os::Aix::initialize_system_info(); - // Initialize large page support. - if (UseLargePages) { - os::large_page_init(); - if (!UseLargePages) { - // initialize os::_page_sizes - _page_sizes[0] = Aix::page_size(); - _page_sizes[1] = 0; - if (Verbose) { - fprintf(stderr, "Large Page initialization failed: setting UseLargePages=0.\n"); - } - } - } else { - // initialize os::_page_sizes - _page_sizes[0] = Aix::page_size(); - _page_sizes[1] = 0; - } - - // debug trace - if (Verbose) { - fprintf(stderr, "os::vm_page_size 0x%llX\n", os::vm_page_size()); - fprintf(stderr, "os::large_page_size 0x%llX\n", os::large_page_size()); - fprintf(stderr, "os::_page_sizes = ( "); - for (int i = 0; _page_sizes[i]; i ++) { - fprintf(stderr, " %s ", describe_pagesize(_page_sizes[i])); - } - fprintf(stderr, ")\n"); - } - _initial_pid = getpid(); clock_tics_per_sec = sysconf(_SC_CLK_TCK); @@ -3698,7 +3519,15 @@ void os::init(void) { Aix::_main_thread = pthread_self(); initial_time_count = os::elapsed_counter(); - pthread_mutex_init(&dl_mutex, NULL); + + // If the pagesize of the VM is greater than 8K determine the appropriate + // number of initial guard pages. The user can change this with the + // command line arguments, if needed. + if (vm_page_size() > (int)Aix::vm_default_page_size()) { + StackYellowPages = 1; + StackRedPages = 1; + StackShadowPages = round_to((StackShadowPages*Aix::vm_default_page_size()), vm_page_size()) / vm_page_size(); + } } // This is called _after_ the global arguments have been parsed. @@ -3717,7 +3546,7 @@ jint os::init_2(void) { const int prot = PROT_READ; const int flags = MAP_PRIVATE|MAP_ANONYMOUS; - // use optimized addresses for the polling page, + // Use optimized addresses for the polling page, // e.g. map it to a special 32-bit address. if (OptimizePollingPageLocation) { // architecture-specific list of address wishes: @@ -3739,7 +3568,7 @@ jint os::init_2(void) { // iterate over the list of address wishes: for (int i=0; iprint("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); + } #endif } @@ -3797,16 +3627,18 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Aix::min_stack_allowed = MAX2(os::Aix::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages + - 2*BytesPerWord COMPILER2_PRESENT(+1)) * Aix::page_size()); + (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Aix::page_size() + + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Aix::vm_default_page_size()); + + os::Aix::min_stack_allowed = align_size_up(os::Aix::min_stack_allowed, os::Aix::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && threadStackSizeInBytes < os::Aix::min_stack_allowed) { - tty->print_cr("\nThe stack size specified is too small, " - "Specify at least %dk", - os::Aix::min_stack_allowed / K); - return JNI_ERR; + tty->print_cr("\nThe stack size specified is too small, " + "Specify at least %dk", + os::Aix::min_stack_allowed / K); + return JNI_ERR; } // Make the stack size a multiple of the page size so that @@ -3817,7 +3649,7 @@ jint os::init_2(void) { Aix::libpthread_init(); if (MaxFDLimit) { - // set the number of file descriptors to max. print out error + // Set the number of file descriptors to max. print out error // if getrlimit/setrlimit fails but continue regardless. struct rlimit nbr_files; int status = getrlimit(RLIMIT_NOFILE, &nbr_files); @@ -3835,12 +3667,12 @@ jint os::init_2(void) { } if (PerfAllowAtExitRegistration) { - // only register atexit functions if PerfAllowAtExitRegistration is set. - // atexit functions can be delayed until process exit time, which + // Only register atexit functions if PerfAllowAtExitRegistration is set. + // Atexit functions can be delayed until process exit time, which // can be problematic for embedded VM situations. Embedded VMs should // call DestroyJavaVM() to assure that VM resources are released. - // note: perfMemory_exit_helper atexit function may be removed in + // Note: perfMemory_exit_helper atexit function may be removed in // the future if the appropriate cleanup code can be added to the // VM_Exit VMOperation's doit method. if (atexit(perfMemory_exit_helper) != 0) { @@ -4162,8 +3994,10 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset, if (read_only) { prot = PROT_READ; + flags = MAP_SHARED; } else { prot = PROT_READ | PROT_WRITE; + flags = MAP_PRIVATE; } if (allow_exec) { @@ -4174,7 +4008,12 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset, flags |= MAP_FIXED; } - char* mapped_address = (char*)mmap(addr, (size_t)bytes, prot, flags, + // Allow anonymous mappings if 'fd' is -1. + if (fd == -1) { + flags |= MAP_ANONYMOUS; + } + + char* mapped_address = (char*)::mmap(addr, (size_t)bytes, prot, flags, fd, file_offset); if (mapped_address == MAP_FAILED) { return NULL; @@ -4432,7 +4271,7 @@ void os::Aix::scan_environment() { if (Verbose) { fprintf(stderr, "EXTSHM=%s.\n", p ? p : ""); } - if (p && strcmp(p, "ON") == 0) { + if (p && strcasecmp(p, "ON") == 0) { fprintf(stderr, "Unsupported setting: EXTSHM=ON. Large Page support will be disabled.\n"); _extshm = 1; } else { @@ -4493,16 +4332,13 @@ void os::Aix::initialize_libperfstat() { ///////////////////////////////////////////////////////////////////////////// // thread stack -// function to query the current stack size using pthread_getthrds_np -// -// ! do not change anything here unless you know what you are doing ! -static void query_stack_dimensions(address* p_stack_base, size_t* p_stack_size) { - +// Function to query the current stack size using pthread_getthrds_np. +static bool query_stack_dimensions(address* p_stack_base, size_t* p_stack_size) { // This only works when invoked on a pthread. As we agreed not to use - // primordial threads anyway, I assert here + // primordial threads anyway, I assert here. guarantee(!os::Aix::is_primordial_thread(), "not allowed on the primordial thread"); - // information about this api can be found (a) in the pthread.h header and + // Information about this api can be found (a) in the pthread.h header and // (b) in http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/pthread_getthrds_np.htm // // The use of this API to find out the current stack is kind of undefined. @@ -4513,57 +4349,72 @@ static void query_stack_dimensions(address* p_stack_base, size_t* p_stack_size) pthread_t tid = pthread_self(); struct __pthrdsinfo pinfo; - char dummy[1]; // we only need this to satisfy the api and to not get E + char dummy[1]; // We only need this to satisfy the api and to not get E. int dummy_size = sizeof(dummy); memset(&pinfo, 0, sizeof(pinfo)); - const int rc = pthread_getthrds_np (&tid, PTHRDSINFO_QUERY_ALL, &pinfo, - sizeof(pinfo), dummy, &dummy_size); + const int rc = pthread_getthrds_np(&tid, PTHRDSINFO_QUERY_ALL, &pinfo, + sizeof(pinfo), dummy, &dummy_size); if (rc != 0) { - fprintf(stderr, "pthread_getthrds_np failed (%d)\n", rc); - guarantee(0, "pthread_getthrds_np failed"); + assert0(false); + trcVerbose("pthread_getthrds_np failed (%d)", rc); + return false; } + guarantee0(pinfo.__pi_stackend); - guarantee(pinfo.__pi_stackend, "returned stack base invalid"); - - // the following can happen when invoking pthread_getthrds_np on a pthread running on a user provided stack - // (when handing down a stack to pthread create, see pthread_attr_setstackaddr). + // The following can happen when invoking pthread_getthrds_np on a pthread running + // on a user provided stack (when handing down a stack to pthread create, see + // pthread_attr_setstackaddr). // Not sure what to do here - I feel inclined to forbid this use case completely. - guarantee(pinfo.__pi_stacksize, "returned stack size invalid"); + guarantee0(pinfo.__pi_stacksize); + + // Note: the pthread stack on AIX seems to look like this: + // + // --------------------- real base ? at page border ? + // + // pthread internal data, like ~2K, see also + // http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/thread_supp_tun_params.htm + // + // --------------------- __pi_stackend - not page aligned, (xxxxF890) + // + // stack + // .... + // + // stack + // + // --------------------- __pi_stackend - __pi_stacksize + // + // padding due to AIX guard pages (?) see AIXTHREAD_GUARDPAGES + // --------------------- __pi_stackaddr (page aligned if AIXTHREAD_GUARDPAGES > 0) + // + // AIX guard pages (?) + // + + // So, the safe thing to do is to use the area from __pi_stackend to __pi_stackaddr; + // __pi_stackend however is almost never page aligned. + // - // On AIX, stacks are not necessarily page aligned so round the base and size accordingly if (p_stack_base) { - (*p_stack_base) = (address) align_size_up((intptr_t)pinfo.__pi_stackend, os::Aix::stack_page_size()); + (*p_stack_base) = (address) (pinfo.__pi_stackend); } if (p_stack_size) { - (*p_stack_size) = pinfo.__pi_stacksize - os::Aix::stack_page_size(); + (*p_stack_size) = pinfo.__pi_stackend - pinfo.__pi_stackaddr; } -#ifndef PRODUCT - if (Verbose) { - fprintf(stderr, - "query_stack_dimensions() -> real stack_base=" INTPTR_FORMAT ", real stack_addr=" INTPTR_FORMAT - ", real stack_size=" INTPTR_FORMAT - ", stack_base=" INTPTR_FORMAT ", stack_size=" INTPTR_FORMAT "\n", - (intptr_t)pinfo.__pi_stackend, (intptr_t)pinfo.__pi_stackaddr, pinfo.__pi_stacksize, - (intptr_t)align_size_up((intptr_t)pinfo.__pi_stackend, os::Aix::stack_page_size()), - pinfo.__pi_stacksize - os::Aix::stack_page_size()); - } -#endif + return true; +} -} // end query_stack_dimensions - -// get the current stack base from the OS (actually, the pthread library) +// Get the current stack base from the OS (actually, the pthread library). address os::current_stack_base() { address p; query_stack_dimensions(&p, 0); return p; } -// get the current stack size from the OS (actually, the pthread library) +// Get the current stack size from the OS (actually, the pthread library). size_t os::current_stack_size() { size_t s; query_stack_dimensions(0, &s); diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp index 01831fb7cbc..faba5c2b45e 100644 --- a/hotspot/src/os/aix/vm/os_aix.hpp +++ b/hotspot/src/os/aix/vm/os_aix.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,9 +35,9 @@ class Aix { friend class os; // For signal-chaining - // highest so far (AIX 5.2) is SIGSAK (63) + // highest so far (AIX 5.2 - 6.1) is SIGSAK (63) #define MAXSIGNUM 63 - // length of strings included in the libperfstat structures + // Length of strings included in the libperfstat structures. #define IDENTIFIER_LENGTH 64 static struct sigaction sigact[MAXSIGNUM]; // saved preinstalled sigactions @@ -111,22 +111,6 @@ class Aix { // (should be LDR_CNTRL DATAPSIZE because stack is allocated on heap by pthread lib) static int _stack_page_size; - // Default shm page size. Read: what page size shared memory will be backed - // with if no page size was set explicitly using shmctl(SHM_PAGESIZE). - // Should be LDR_CNTRL SHMPSIZE. - static size_t _shm_default_page_size; - - // True if sys V shm can be used with 64K pages dynamically. - // (via shmctl(.. SHM_PAGESIZE..). Should be true for AIX 53 and - // newer / PASE V6R1 and newer. (0 or 1, -1 if not initialized) - static int _can_use_64K_pages; - - // True if sys V shm can be used with 16M pages dynamically. - // (via shmctl(.. SHM_PAGESIZE..). Only true on AIX 5.3 and - // newer, if the system was set up to use 16M pages and the - // jvm has enough user rights. (0 or 1, -1 if not initialized) - static int _can_use_16M_pages; - static julong available_memory(); static julong physical_memory() { return _physical_memory; } static void initialize_system_info(); @@ -135,10 +119,6 @@ class Aix { // one of Aix::on_pase(), Aix::os_version(). static void initialize_os_info(); - static int commit_memory_impl(char* addr, size_t bytes, bool exec); - static int commit_memory_impl(char* addr, size_t bytes, - size_t alignment_hint, bool exec); - // Scan environment for important settings which might effect the // VM. Trace out settings. Warn about invalid settings and/or // correct them. @@ -146,10 +126,6 @@ class Aix { // Must run after os::Aix::initialue_os_info(). static void scan_environment(); - // Retrieve information about multipage size support. Will initialize - // _page_size, _stack_page_size, _can_use_64K_pages/_can_use_16M_pages - static void query_multipage_support(); - // Initialize libo4 (on PASE) and libperfstat (on AIX). Call this // before relying on functions from either lib, e.g. Aix::get_meminfo(). static void initialize_libo4(); @@ -187,27 +163,8 @@ class Aix { return _stack_page_size; } - // default shm page size. Read: what page size shared memory - // will be backed with if no page size was set explicitly using shmctl(SHM_PAGESIZE). - // Should be LDR_CNTRL SHMPSIZE. - static int shm_default_page_size(void) { - assert(_shm_default_page_size != -1, "not initialized"); - return _shm_default_page_size; - } - - // Return true if sys V shm can be used with 64K pages dynamically - // (via shmctl(.. SHM_PAGESIZE..). - static bool can_use_64K_pages () { - assert(_can_use_64K_pages != -1, "not initialized"); - return _can_use_64K_pages == 1 ? true : false; - } - - // Return true if sys V shm can be used with 16M pages dynamically. - // (via shmctl(.. SHM_PAGESIZE..). - static bool can_use_16M_pages () { - assert(_can_use_16M_pages != -1, "not initialized"); - return _can_use_16M_pages == 1 ? true : false; - } + // This is used to scale stack space (guard pages etc.). The name is somehow misleading. + static int vm_default_page_size(void ) { return 8*K; } static address ucontext_get_pc(const ucontext_t* uc); static intptr_t* ucontext_get_sp(ucontext_t* uc); @@ -269,6 +226,11 @@ class Aix { return _os_version; } + // Convenience method: returns true if running on PASE V5R4 or older. + static bool on_pase_V5R4_or_older() { + return on_pase() && os_version() <= 0x0504; + } + // Convenience method: returns true if running on AIX 5.3 or older. static bool on_aix_53_or_older() { return on_aix() && os_version() <= 0x0503; diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 5602342b4ff..7de0626dae6 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); } -// File names are case-sensitive on windows only +// File names are case-sensitive on windows only. inline int os::file_name_strcmp(const char* s1, const char* s2) { return strcmp(s1, s2); } @@ -53,18 +53,19 @@ inline bool os::uses_stack_guard_pages() { return true; } +// Whether or not calling code should/can commit/uncommit stack pages +// before guarding them. Answer for AIX is definitly no, because memory +// is automatically committed on touch. inline bool os::allocate_stack_guard_pages() { assert(uses_stack_guard_pages(), "sanity check"); - return true; + return false; } - // On Aix, reservations are made on a page by page basis, nothing to do. inline void os::pd_split_reserved_memory(char *base, size_t size, size_t split, bool realloc) { } - // Bang the shadow pages if they need to be touched to be mapped. inline void os::bang_stack_shadow_pages() { } @@ -75,15 +76,13 @@ inline void os::dll_unload(void *lib) { inline const int os::default_file_open_flags() { return 0;} -inline DIR* os::opendir(const char* dirname) -{ +inline DIR* os::opendir(const char* dirname) { assert(dirname != NULL, "just checking"); return ::opendir(dirname); } -inline int os::readdir_buf_size(const char *path) -{ - // according to aix sys/limits, NAME_MAX must be retrieved at runtime. */ +inline int os::readdir_buf_size(const char *path) { + // According to aix sys/limits, NAME_MAX must be retrieved at runtime. const long my_NAME_MAX = pathconf(path, _PC_NAME_MAX); return my_NAME_MAX + sizeof(dirent) + 1; } @@ -104,8 +103,7 @@ inline int os::ftruncate(int fd, jlong length) { return ::ftruncate64(fd, length); } -inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) -{ +inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) { dirent* p; int status; assert(dirp != NULL, "just checking"); @@ -174,11 +172,11 @@ inline int os::send(int fd, char* buf, size_t nBytes, uint flags) { RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); } -inline int os::raw_send(int fd, char* buf, size_t nBytes, uint flags) { +inline int os::raw_send(int fd, char *buf, size_t nBytes, uint flags) { return os::send(fd, buf, nBytes, flags); } -inline int os::connect(int fd, struct sockaddr* him, socklen_t len) { +inline int os::connect(int fd, struct sockaddr *him, socklen_t len) { RESTARTABLE_RETURN_INT(::connect(fd, him, len)); } diff --git a/hotspot/src/os/aix/vm/perfMemory_aix.cpp b/hotspot/src/os/aix/vm/perfMemory_aix.cpp index c9dd76b7881..c9d6e41e6bb 100644 --- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp +++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp @@ -797,7 +797,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { // Close the directory and reset the current working directory. close_directory_secure_cwd(dirp, saved_cwd_fd); - FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); + FREE_C_HEAP_ARRAY(char, dbuf); } // Make the user specific temporary directory. Returns true if @@ -1164,9 +1164,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // store file, we don't follow them when attaching either. // if (!is_directory_secure(dirname)) { - FREE_C_HEAP_ARRAY(char, dirname, mtInternal); + FREE_C_HEAP_ARRAY(char, dirname); if (luser != user) { - FREE_C_HEAP_ARRAY(char, luser, mtInternal); + FREE_C_HEAP_ARRAY(char, luser); } THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Process not found"); diff --git a/hotspot/src/os/aix/vm/porting_aix.hpp b/hotspot/src/os/aix/vm/porting_aix.hpp index 53f9939937f..2b467ccd858 100644 --- a/hotspot/src/os/aix/vm/porting_aix.hpp +++ b/hotspot/src/os/aix/vm/porting_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,8 +22,18 @@ * */ +#ifndef OS_AIX_VM_PORTING_AIX_HPP +#define OS_AIX_VM_PORTING_AIX_HPP + #include +// PPC port only: +#define assert0(b) assert( (b), "" ) +#define guarantee0(b) assert( (b), "" ) +template bool is_aligned_to(T1 what, T2 alignment) { + return ( ((uintx)(what)) & (((uintx)(alignment)) - 1) ) == 0 ? true : false; +} + // Header file to contain porting-relevant code which does not have a // home anywhere else and which can not go into os_.h because // that header is included inside the os class definition, hence all @@ -79,3 +89,62 @@ int getFuncName( const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further information char* p_errmsg, size_t errmsglen // [out] optional: user provided buffer for error messages ); + +// ------------------------------------------------------------------------- + +// A simple critical section which shall be based upon OS critical +// sections (CRITICAL_SECTION resp. Posix Mutex) and nothing else. + +#include + +namespace MiscUtils { + typedef pthread_mutex_t critsect_t; + + inline void init_critsect(MiscUtils::critsect_t* cs) { + pthread_mutex_init(cs, NULL); + } + inline void free_critsect(MiscUtils::critsect_t* cs) { + pthread_mutex_destroy(cs); + } + inline void enter_critsect(MiscUtils::critsect_t* cs) { + pthread_mutex_lock(cs); + } + inline void leave_critsect(MiscUtils::critsect_t* cs) { + pthread_mutex_unlock(cs); + } + + // Need to wrap this in an object because we need to dynamically initialize + // critical section (because of windows, where there is no way to initialize + // a CRITICAL_SECTION statically. On Unix, we could use + // PTHREAD_MUTEX_INITIALIZER) + + // Note: The critical section does NOT get cleaned up in the destructor. That is + // by design: the CritSect class is only ever used as global objects whose + // lifetime spans the whole VM life; in that context we don't want the lock to + // be cleaned up when global C++ objects are destroyed, but to continue to work + // correctly right to the very end of the process life. + class CritSect { + critsect_t _cs; + public: + CritSect() { init_critsect(&_cs); } + //~CritSect() { free_critsect(&_cs); } + void enter() { enter_critsect(&_cs); } + void leave() { leave_critsect(&_cs); } + }; + + class AutoCritSect { + CritSect* const _pcsobj; + public: + AutoCritSect(CritSect* pcsobj) + : _pcsobj(pcsobj) + { + _pcsobj->enter(); + } + ~AutoCritSect() { + _pcsobj->leave(); + } + }; + +} + +#endif // OS_AIX_VM_PORTING_AIX_HPP diff --git a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp index 598fe5e5096..a4fa0d560c7 100644 --- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,12 +45,12 @@ #include "memory/heap.hpp" #include "memory/memRegion.hpp" #include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "oops/constMethod.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" #include "oops/oop.hpp" #include "oops/symbol.hpp" -#include "runtime/virtualspace.hpp" #include "runtime/vmStructs.hpp" #include "utilities/accessFlags.hpp" #include "utilities/globalDefinitions.hpp" diff --git a/hotspot/src/os/bsd/dtrace/libjvm_db.c b/hotspot/src/os/bsd/dtrace/libjvm_db.c index a0b5413cf49..b483733f9ef 100644 --- a/hotspot/src/os/bsd/dtrace/libjvm_db.c +++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c @@ -582,13 +582,14 @@ name_for_methodPtr(jvm_agent_t* J, uint64_t methodPtr, char * result, size_t siz CHECK_FAIL(err); result[0] = '\0'; - strncat(result, klassString, size); - size -= strlen(klassString); - strncat(result, ".", size); - size -= 1; - strncat(result, nameString, size); - size -= strlen(nameString); - strncat(result, signatureString, size); + if (snprintf(result, size, + "%s.%s%s", + klassString, + nameString, + signatureString) >= size) { + // truncation + goto fail; + } if (nameString != NULL) free(nameString); if (klassString != NULL) free(klassString); @@ -1095,9 +1096,9 @@ name_for_nmethod(jvm_agent_t* J, CHECK_FAIL(err); } if (deoptimized) { - strncat(result + 1, " [deoptimized frame]; ", size-1); + strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1); } else { - strncat(result + 1, " [compiled] ", size-1); + strncat(result, " [compiled] ", size - strlen(result) - 1); } if (debug) fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n", diff --git a/hotspot/src/os/bsd/vm/decoder_machO.cpp b/hotspot/src/os/bsd/vm/decoder_machO.cpp index 6ef6314a1d1..5026ea83471 100644 --- a/hotspot/src/os/bsd/vm/decoder_machO.cpp +++ b/hotspot/src/os/bsd/vm/decoder_machO.cpp @@ -97,6 +97,7 @@ bool MachODecoder::decode(address addr, char *buf, char * symname = mach_find_in_stringtable((char*) ((uintptr_t)mach_base + stroff), strsize, found_strx); if (symname) { strncpy(buf, symname, buflen); + buf[buflen - 1] = '\0'; return true; } DEBUG_ONLY(tty->print_cr("no string or null string found.")); diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 445ff225f8e..d725b35350b 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -190,20 +190,6 @@ julong os::physical_memory() { return Bsd::physical_memory(); } -//////////////////////////////////////////////////////////////////////////////// -// environment support - -bool os::getenv(const char* name, char* buf, int len) { - const char* val = ::getenv(name); - if (val != NULL && strlen(val) < (size_t)len) { - strcpy(buf, val); - return true; - } - if (len > 0) buf[0] = 0; // return a null string - return false; -} - - // Return true if user is running as root. bool os::have_special_privileges() { @@ -1146,6 +1132,10 @@ void os::shutdown() { // called from signal handler. Before adding something to os::abort(), make // sure it is async-safe and can handle partially initialized VM. void os::abort(bool dump_core) { + abort(dump_core, NULL, NULL); +} + +void os::abort(bool dump_core, void* siginfo, void* context) { os::shutdown(); if (dump_core) { #ifndef PRODUCT @@ -1195,12 +1185,18 @@ pid_t os::Bsd::gettid() { guarantee(retval != 0, "just checking"); return retval; -#elif __FreeBSD__ +#else + #ifdef __FreeBSD__ retval = syscall(SYS_thr_self); -#elif __OpenBSD__ + #else + #ifdef __OpenBSD__ retval = syscall(SYS_getthrid); -#elif __NetBSD__ + #else + #ifdef __NetBSD__ retval = (pid_t) syscall(SYS__lwp_self); + #endif + #endif + #endif #endif if (retval == -1) { diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index c3403d49e4d..8270f6e3659 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -158,9 +158,6 @@ static pid_t _initial_pid = 0; static int SR_signum = SIGUSR2; sigset_t SR_sigset; -// Used to protect dlsym() calls -static pthread_mutex_t dl_mutex; - // Declarations static void unpackTime(timespec* absTime, bool isAbsolute, jlong time); @@ -184,20 +181,6 @@ julong os::physical_memory() { return Linux::physical_memory(); } -//////////////////////////////////////////////////////////////////////////////// -// environment support - -bool os::getenv(const char* name, char* buf, int len) { - const char* val = ::getenv(name); - if (val != NULL && strlen(val) < (size_t)len) { - strcpy(buf, val); - return true; - } - if (len > 0) buf[0] = 0; // return a null string - return false; -} - - // Return true if user is running as root. bool os::have_special_privileges() { @@ -215,14 +198,20 @@ bool os::have_special_privileges() { // i386: 224, ia64: 1105, amd64: 186, sparc 143 #ifdef __ia64__ #define SYS_gettid 1105 - #elif __i386__ - #define SYS_gettid 224 - #elif __amd64__ - #define SYS_gettid 186 - #elif __sparc__ - #define SYS_gettid 143 #else - #error define gettid for the arch + #ifdef __i386__ + #define SYS_gettid 224 + #else + #ifdef __amd64__ + #define SYS_gettid 186 + #else + #ifdef __sparc__ + #define SYS_gettid 143 + #else + #error define gettid for the arch + #endif + #endif + #endif #endif #endif @@ -1490,6 +1479,10 @@ void os::shutdown() { // called from signal handler. Before adding something to os::abort(), make // sure it is async-safe and can handle partially initialized VM. void os::abort(bool dump_core) { + abort(dump_core, NULL, NULL); +} + +void os::abort(bool dump_core, void* siginfo, void* context) { os::shutdown(); if (dump_core) { #ifndef PRODUCT @@ -2039,14 +2032,8 @@ void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, return result; } -// glibc-2.0 libdl is not MT safe. If you are building with any glibc, -// chances are you might want to run the generated bits against glibc-2.0 -// libdl.so, so always use locking for any version of glibc. -// void* os::dll_lookup(void* handle, const char* name) { - pthread_mutex_lock(&dl_mutex); void* res = dlsym(handle, name); - pthread_mutex_unlock(&dl_mutex); return res; } @@ -4655,8 +4642,6 @@ void os::init(void) { } // else it defaults to CLOCK_REALTIME - pthread_mutex_init(&dl_mutex, NULL); - // If the pagesize of the VM is greater than 8K determine the appropriate // number of initial guard pages. The user can change this with the // command line arguments, if needed. diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index d64aa0ae156..8a7cc2945ae 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC #define IS_VALID_PID(p) (p > 0 && p < MAX_PID) // Check core dump limit and report possible place where core can be found -void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { +void os::check_dump_limit(char* buffer, size_t bufferSize) { int n; struct rlimit rlim; bool success; @@ -82,7 +82,7 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* } } - VMError::report_coredump_status(buffer, success); + VMError::record_coredump_status(buffer, success); } int os::get_native_stack(address* stack, int frames, int toSkip) { diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index 36bfff1a82f..c23810915e1 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,12 +45,12 @@ #include "memory/heap.hpp" #include "memory/memRegion.hpp" #include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "oops/constMethod.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" #include "oops/oop.hpp" #include "oops/symbol.hpp" -#include "runtime/virtualspace.hpp" #include "runtime/vmStructs.hpp" #include "utilities/accessFlags.hpp" #include "utilities/globalDefinitions.hpp" diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index 67ece5e21e6..1f24b8719ad 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -582,13 +582,14 @@ name_for_methodPtr(jvm_agent_t* J, uint64_t methodPtr, char * result, size_t siz CHECK_FAIL(err); result[0] = '\0'; - strncat(result, klassString, size); - size -= strlen(klassString); - strncat(result, ".", size); - size -= 1; - strncat(result, nameString, size); - size -= strlen(nameString); - strncat(result, signatureString, size); + if (snprintf(result, size, + "%s.%s%s", + klassString, + nameString, + signatureString) >= size) { + // truncation + goto fail; + } if (nameString != NULL) free(nameString); if (klassString != NULL) free(klassString); @@ -1095,9 +1096,9 @@ name_for_nmethod(jvm_agent_t* J, CHECK_FAIL(err); } if (deoptimized) { - strncat(result + 1, " [deoptimized frame]; ", size-1); + strncat(result, " [deoptimized frame]; ", size - strlen(result) - 1); } else { - strncat(result + 1, " [compiled] ", size-1); + strncat(result, " [compiled] ", size - strlen(result) - 1); } if (debug) fprintf(stderr, "name_for_nmethod: END: method name: %s, vf_cnt: %d\n\n", diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 47c0f8a9253..befdb29b5cc 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -555,17 +555,6 @@ bool os::bind_to_processor(uint processor_id) { return (bind_result == 0); } -bool os::getenv(const char* name, char* buffer, int len) { - char* val = ::getenv(name); - if (val == NULL || strlen(val) + 1 > len) { - if (len > 0) buffer[0] = 0; // return a null string - return false; - } - strcpy(buffer, val); - return true; -} - - // Return true if user is running as root. bool os::have_special_privileges() { @@ -1532,6 +1521,10 @@ void os::shutdown() { // called from signal handler. Before adding something to os::abort(), make // sure it is async-safe and can handle partially initialized VM. void os::abort(bool dump_core) { + abort(dump_core, NULL, NULL); +} + +void os::abort(bool dump_core, void* siginfo, void* context) { os::shutdown(); if (dump_core) { #ifndef PRODUCT diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 76f6384b7b9..97c73ac471c 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -114,10 +114,12 @@ static FILETIME process_kernel_time; #ifdef _M_IA64 #define __CPU__ ia64 -#elif _M_AMD64 - #define __CPU__ amd64 #else - #define __CPU__ i486 + #ifdef _M_AMD64 + #define __CPU__ amd64 + #else + #define __CPU__ i486 + #endif #endif // save DLL module handle, used by GetModuleFileName @@ -153,11 +155,6 @@ static inline double fileTimeAsDouble(FILETIME* time) { // Implementation of os -bool os::getenv(const char* name, char* buffer, int len) { - int result = GetEnvironmentVariable(name, buffer, len); - return result > 0 && result < len; -} - bool os::unsetenv(const char* name) { assert(name != NULL, "Null pointer"); return (SetEnvironmentVariable(name, NULL) == TRUE); @@ -188,9 +185,13 @@ void os::init_system_properties_values() { char *dll_path; char *pslash; char *bin = "\\bin"; - char home_dir[MAX_PATH]; + char home_dir[MAX_PATH + 1]; + char *alt_home_dir = ::getenv("_ALT_JAVA_HOME_DIR"); - if (!getenv("_ALT_JAVA_HOME_DIR", home_dir, MAX_PATH)) { + if (alt_home_dir != NULL) { + strncpy(home_dir, alt_home_dir, MAX_PATH + 1); + home_dir[MAX_PATH] = '\0'; + } else { os::jvm_path(home_dir, sizeof(home_dir)); // Found the full path to jvm.dll. // Now cut the path to /jre if we can. @@ -988,7 +989,34 @@ static BOOL (WINAPI *_MiniDumpWriteDump)(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION); -void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { +static HANDLE dumpFile = NULL; + +// Check if dump file can be created. +void os::check_dump_limit(char* buffer, size_t buffsz) { + bool status = true; + if (!FLAG_IS_DEFAULT(CreateCoredumpOnCrash) && !CreateCoredumpOnCrash) { + jio_snprintf(buffer, buffsz, "CreateCoredumpOnCrash is disabled from command line"); + status = false; + } else { + const char* cwd = get_current_directory(NULL, 0); + int pid = current_process_id(); + if (cwd != NULL) { + jio_snprintf(buffer, buffsz, "%s\\hs_err_pid%u.mdmp", cwd, pid); + } else { + jio_snprintf(buffer, buffsz, ".\\hs_err_pid%u.mdmp", pid); + } + + if (dumpFile == NULL && + (dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) + == INVALID_HANDLE_VALUE) { + jio_snprintf(buffer, buffsz, "Failed to create minidump file (0x%x).", GetLastError()); + status = false; + } + } + VMError::record_coredump_status(buffer, status); +} + +void os::abort(bool dump_core, void* siginfo, void* context) { HINSTANCE dbghelp; EXCEPTION_POINTERS ep; MINIDUMP_EXCEPTION_INFORMATION mei; @@ -996,33 +1024,22 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* HANDLE hProcess = GetCurrentProcess(); DWORD processId = GetCurrentProcessId(); - HANDLE dumpFile; MINIDUMP_TYPE dumpType; - static const char* cwd; -// Default is to always create dump for debug builds, on product builds only dump on server versions of Windows. -#ifndef ASSERT - // If running on a client version of Windows and user has not explicitly enabled dumping - if (!os::win32::is_windows_server() && !CreateMinidumpOnCrash) { - VMError::report_coredump_status("Minidumps are not enabled by default on client versions of Windows", false); - return; - // If running on a server version of Windows and user has explictly disabled dumping - } else if (os::win32::is_windows_server() && !FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) { - VMError::report_coredump_status("Minidump has been disabled from the command line", false); - return; + shutdown(); + if (!dump_core || dumpFile == NULL) { + if (dumpFile != NULL) { + CloseHandle(dumpFile); + } + win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } -#else - if (!FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) { - VMError::report_coredump_status("Minidump has been disabled from the command line", false); - return; - } -#endif dbghelp = os::win32::load_Windows_dll("DBGHELP.DLL", NULL, 0); if (dbghelp == NULL) { - VMError::report_coredump_status("Failed to load dbghelp.dll", false); - return; + jio_fprintf(stderr, "Failed to load dbghelp.dll\n"); + CloseHandle(dumpFile); + win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } _MiniDumpWriteDump = @@ -1034,30 +1051,23 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* "MiniDumpWriteDump")); if (_MiniDumpWriteDump == NULL) { - VMError::report_coredump_status("Failed to find MiniDumpWriteDump() in module dbghelp.dll", false); - return; + jio_fprintf(stderr, "Failed to find MiniDumpWriteDump() in module dbghelp.dll.\n"); + CloseHandle(dumpFile); + win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData); -// Older versions of dbghelp.h doesn't contain all the dumptypes we want, dbghelp.h with -// API_VERSION_NUMBER 11 or higher contains the ones we want though + // Older versions of dbghelp.h do not contain all the dumptypes we want, dbghelp.h with + // API_VERSION_NUMBER 11 or higher contains the ones we want though #if API_VERSION_NUMBER >= 11 dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules); #endif - cwd = get_current_directory(NULL, 0); - jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp", cwd, current_process_id()); - dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - - if (dumpFile == INVALID_HANDLE_VALUE) { - VMError::report_coredump_status("Failed to create file for dumping", false); - return; - } - if (exceptionRecord != NULL && contextRecord != NULL) { - ep.ContextRecord = (PCONTEXT) contextRecord; - ep.ExceptionRecord = (PEXCEPTION_RECORD) exceptionRecord; + if (siginfo != NULL && context != NULL) { + ep.ContextRecord = (PCONTEXT) context; + ep.ExceptionRecord = (PEXCEPTION_RECORD) siginfo; mei.ThreadId = GetCurrentThreadId(); mei.ExceptionPointers = &ep; @@ -1066,38 +1076,18 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* pmei = NULL; } - // Older versions of dbghelp.dll (the one shipped with Win2003 for example) may not support all // the dump types we really want. If first call fails, lets fall back to just use MiniDumpWithFullMemory then. if (_MiniDumpWriteDump(hProcess, processId, dumpFile, dumpType, pmei, NULL, NULL) == false && _MiniDumpWriteDump(hProcess, processId, dumpFile, (MINIDUMP_TYPE)MiniDumpWithFullMemory, pmei, NULL, NULL) == false) { - DWORD error = GetLastError(); - LPTSTR msgbuf = NULL; - - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, error, 0, (LPTSTR)&msgbuf, 0, NULL) != 0) { - - jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x: %s)", error, msgbuf); - LocalFree(msgbuf); - } else { - // Call to FormatMessage failed, just include the result from GetLastError - jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x)", error); - } - VMError::report_coredump_status(buffer, false); - } else { - VMError::report_coredump_status(buffer, true); + jio_fprintf(stderr, "Call to MiniDumpWriteDump() failed (Error 0x%x)\n", GetLastError()); } - CloseHandle(dumpFile); + win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } - void os::abort(bool dump_core) { - os::shutdown(); - // no core dump on Windows - win32::exit_process_or_thread(win32::EPT_PROCESS, 1); + abort(dump_core, NULL, NULL); } // Die immediately, no exit hook, no abort hook, no cleanup. @@ -2102,20 +2092,22 @@ LONG Handle_Exception(struct _EXCEPTION_POINTERS* exceptionInfo, // at the beginning of the target bundle. exceptionInfo->ContextRecord->StIPSR &= 0xFFFFF9FFFFFFFFFF; assert(((DWORD64)handler & 0xF) == 0, "Target address must point to the beginning of a bundle!"); -#elif _M_AMD64 +#else + #ifdef _M_AMD64 // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip); } // Set pc to handler exceptionInfo->ContextRecord->Rip = (DWORD64)handler; -#else + #else // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip); } // Set pc to handler exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler; + #endif #endif // Continue the execution @@ -2214,7 +2206,8 @@ LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { // (division by zero is handled explicitly) #ifdef _M_IA64 assert(0, "Fix Handle_IDiv_Exception"); -#elif _M_AMD64 +#else + #ifdef _M_AMD64 PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Rip; assert(pc[0] == 0xF7, "not an idiv opcode"); @@ -2225,7 +2218,7 @@ LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { ctx->Rax = (DWORD)min_jint; // result ctx->Rdx = (DWORD)0; // remainder // Continue the execution -#else + #else PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Eip; assert(pc[0] == 0xF7, "not an idiv opcode"); @@ -2236,6 +2229,7 @@ LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { ctx->Eax = (DWORD)min_jint; // result ctx->Edx = (DWORD)0; // remainder // Continue the execution + #endif #endif return EXCEPTION_CONTINUE_EXECUTION; } @@ -2308,10 +2302,12 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // This is needed for IA64 because "relocation" / "implicit null check" / "poll instruction" // information is saved in the Unix format. address pc_unix_format = (address) ((((uint64_t)pc) & 0xFFFFFFFFFFFFFFF0) | ((((uint64_t)pc) & 0xF) >> 2)); -#elif _M_AMD64 - address pc = (address) exceptionInfo->ContextRecord->Rip; #else + #ifdef _M_AMD64 + address pc = (address) exceptionInfo->ContextRecord->Rip; + #else address pc = (address) exceptionInfo->ContextRecord->Eip; + #endif #endif Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady @@ -2696,17 +2692,6 @@ address os::win32::fast_jni_accessor_wrapper(BasicType type) { } #endif -void os::win32::call_test_func_with_wrapper(void (*funcPtr)(void)) { - // Install a win32 structured exception handler around the test - // function call so the VM can generate an error dump if needed. - __try { - (*funcPtr)(); - } __except(topLevelExceptionFilter( - (_EXCEPTION_POINTERS*)_exception_info())) { - // Nothing to do. - } -} - // Virtual Memory int os::vm_page_size() { return os::win32::vm_page_size(); } @@ -5930,4 +5915,3 @@ void TestReserveMemorySpecial_test() { UseNUMAInterleaving = old_use_numa_interleaving; } #endif // PRODUCT - diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 9ef4d1d50b4..08be4d06f70 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +115,6 @@ class win32 { static address fast_jni_accessor_wrapper(BasicType); #endif - static void call_test_func_with_wrapper(void (*funcPtr)(void)); - // filter function to ignore faults on serializations page static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); }; diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index deb8821ac70..3227e069c38 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * 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,4 @@ inline void os::exit(int num) { win32::exit_process_or_thread(win32::EPT_PROCESS, num); } -#define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \ - os::win32::call_test_func_with_wrapper(f) - #endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP diff --git a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp index 4e9309955bd..0ed05eb9a76 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp @@ -59,6 +59,10 @@ #include "utilities/events.hpp" #include "utilities/vmError.hpp" +// See stubGenerator_zero.cpp +#include +extern sigjmp_buf* get_jmp_buf_for_continuation(); + address os::current_stack_pointer() { address dummy = (address) &dummy; return dummy; @@ -134,6 +138,14 @@ JVM_handle_bsd_signal(int sig, SignalHandlerMark shm(t); + // handle SafeFetch faults + if (sig == SIGSEGV || sig == SIGBUS) { + sigjmp_buf* const pjb = get_jmp_buf_for_continuation(); + if (pjb) { + siglongjmp(*pjb, 1); + } + } + // Note: it's not uncommon that JNI code uses signal/sigset to // install then restore certain signal handler (e.g. to temporarily // block SIGPIPE, or have a SIGILL handler when detecting CPU diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp index c742b8a0074..326fd326de4 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -298,6 +298,7 @@ JVM_handle_linux_signal(int sig, goto report_and_die; } + CodeBlob *cb = NULL; // Handle signal from NativeJump::patch_verified_entry(). if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) || (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) { @@ -313,7 +314,10 @@ JVM_handle_linux_signal(int sig, // especially when we try to read from the safepoint polling page. So the check // (address)info->si_addr == os::get_standard_polling_page() // doesn't work for us. We use: - ((NativeInstruction*)pc)->is_safepoint_poll()) { + ((NativeInstruction*)pc)->is_safepoint_poll() && + CodeCache::contains((void*) pc) && + ((cb = CodeCache::find_blob(pc)) != NULL) && + cb->is_nmethod()) { if (TraceTraps) { tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc)); } diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index a518ab88d44..3e388568342 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -54,6 +54,10 @@ #include "utilities/events.hpp" #include "utilities/vmError.hpp" +// See stubGenerator_zero.cpp +#include +extern sigjmp_buf* get_jmp_buf_for_continuation(); + address os::current_stack_pointer() { address dummy = (address) &dummy; return dummy; @@ -125,6 +129,14 @@ JVM_handle_linux_signal(int sig, SignalHandlerMark shm(t); + // handle SafeFetch faults + if (sig == SIGSEGV || sig == SIGBUS) { + sigjmp_buf* const pjb = get_jmp_buf_for_continuation(); + if (pjb) { + siglongjmp(*pjb, 1); + } + } + // Note: it's not uncommon that JNI code uses signal/sigset to // install then restore certain signal handler (e.g. to temporarily // block SIGPIPE, or have a SIGILL handler when detecting CPU diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp index 2b1033496d7..03b2d4b1b29 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp @@ -129,7 +129,7 @@ class PICL { bool is_inconsistent() { return _state == INCONSISTENT; } void set_inconsistent() { _state = INCONSISTENT; } - void visit(picl_nodehdl_t nodeh, const char* name) { + bool visit(picl_nodehdl_t nodeh, const char* name) { assert(!is_inconsistent(), "Precondition"); int curr; if (_picl->get_int_property(nodeh, name, &curr) == PICL_SUCCESS) { @@ -138,7 +138,9 @@ class PICL { } else if (curr != value()) { // following iterations set_inconsistent(); } + return true; } + return false; } }; @@ -155,8 +157,19 @@ class PICL { if (!l1_visitor->is_inconsistent()) { l1_visitor->visit(nodeh, "l1-dcache-line-size"); } - if (!l2_visitor->is_inconsistent()) { - l2_visitor->visit(nodeh, "l2-cache-line-size"); + static const char* l2_data_cache_line_property_name = NULL; + // On the first visit determine the name of the l2 cache line size property and memoize it. + if (l2_data_cache_line_property_name == NULL) { + assert(!l2_visitor->is_inconsistent(), "First iteration cannot be inconsistent"); + l2_data_cache_line_property_name = "l2-cache-line-size"; + if (!l2_visitor->visit(nodeh, l2_data_cache_line_property_name)) { + l2_data_cache_line_property_name = "l2-dcache-line-size"; + l2_visitor->visit(nodeh, l2_data_cache_line_property_name); + } + } else { + if (!l2_visitor->is_inconsistent()) { + l2_visitor->visit(nodeh, l2_data_cache_line_property_name); + } } if (l1_visitor->is_inconsistent() && l2_visitor->is_inconsistent()) { @@ -172,13 +185,13 @@ class PICL { UniqueValueVisitor* l2_visitor() { return &_l2_visitor; } }; int _L1_data_cache_line_size; - int _L2_cache_line_size; + int _L2_data_cache_line_size; public: static int visit_cpu(picl_nodehdl_t nodeh, void *state) { return CPUVisitor::visit(nodeh, state); } - PICL(bool is_fujitsu) : _L1_data_cache_line_size(0), _L2_cache_line_size(0), _dl_handle(NULL) { + PICL(bool is_fujitsu) : _L1_data_cache_line_size(0), _L2_data_cache_line_size(0), _dl_handle(NULL) { if (!open_library()) { return; } @@ -196,7 +209,7 @@ public: _L1_data_cache_line_size = cpu_visitor.l1_visitor()->value(); } if (cpu_visitor.l2_visitor()->is_assigned()) { - _L2_cache_line_size = cpu_visitor.l2_visitor()->value(); + _L2_data_cache_line_size = cpu_visitor.l2_visitor()->value(); } } _picl_shutdown(); @@ -205,7 +218,7 @@ public: } unsigned int L1_data_cache_line_size() const { return _L1_data_cache_line_size; } - unsigned int L2_cache_line_size() const { return _L2_cache_line_size; } + unsigned int L2_data_cache_line_size() const { return _L2_data_cache_line_size; } }; @@ -431,7 +444,7 @@ int VM_Version::platform_features(int features) { // Figure out cache line sizes using PICL PICL picl((features & sparc64_family_m) != 0); _L1_data_cache_line_size = picl.L1_data_cache_line_size(); - _L2_cache_line_size = picl.L2_cache_line_size(); + _L2_data_cache_line_size = picl.L2_data_cache_line_size(); return features; } diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index acc90f88366..e18a94492d2 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -410,6 +410,7 @@ static void parse_caller_options(struct hsdis_app_data* app_data, const char* ca } p = q; } + *iop = '\0'; } static void print_help(struct hsdis_app_data* app_data, diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp index 9e3091cff61..54bff63ad6d 100644 --- a/hotspot/src/share/vm/adlc/adlparse.cpp +++ b/hotspot/src/share/vm/adlc/adlparse.cpp @@ -800,6 +800,7 @@ void ADLParser::reg_parse(void) { } if (strcmp(token,"reg_def")==0) { reg_def_parse(); } else if (strcmp(token,"reg_class")==0) { reg_class_parse(); } + else if (strcmp(token, "reg_class_dynamic") == 0) { reg_class_dynamic_parse(); } else if (strcmp(token,"alloc_class")==0) { alloc_class_parse(); } else if (strcmp(token,"#define")==0) { preproc_define(); } else { parse_err(SYNERR, "bad token %s inside register block.\n", token); break; } @@ -2323,11 +2324,12 @@ void ADLParser::reg_class_parse(void) { // Debug Stuff if (_AD._adl_debug >1) fprintf(stderr,"Register Class: %s\n", cname); - RegClass *reg_class = _AD._register->addRegClass(cname); - - // Collect registers in class skipws(); if (_curchar == '(') { + // A register list is defined for the register class. + // Collect registers into a generic RegClass register class. + RegClass* reg_class = _AD._register->addRegClass(cname); + next_char(); // Skip '(' skipws(); while (_curchar != ')') { @@ -2352,12 +2354,15 @@ void ADLParser::reg_class_parse(void) { } next_char(); // Skip closing ')' } else if (_curchar == '%') { + // A code snippet is defined for the register class. + // Collect the code snippet into a CodeSnippetRegClass register class. + CodeSnippetRegClass* reg_class = _AD._register->addRegClass(cname); char *code = find_cpp_block("reg class"); if (code == NULL) { parse_err(SYNERR, "missing code declaration for reg class.\n"); return; } - reg_class->_user_defined = code; + reg_class->set_code_snippet(code); return; } @@ -2374,6 +2379,87 @@ void ADLParser::reg_class_parse(void) { return; } +//------------------------------reg_class_dynamic_parse------------------------ +void ADLParser::reg_class_dynamic_parse(void) { + char *cname; // Name of dynamic register class being defined + + // Get register class name + skipws(); + cname = get_ident(); + if (cname == NULL) { + parse_err(SYNERR, "missing dynamic register class name after 'reg_class_dynamic'\n"); + return; + } + + if (_AD._adl_debug > 1) { + fprintf(stdout, "Dynamic Register Class: %s\n", cname); + } + + skipws(); + if (_curchar != '(') { + parse_err(SYNERR, "missing '(' at the beginning of reg_class_dynamic definition\n"); + return; + } + next_char(); + skipws(); + + // Collect two register classes and the C++ code representing the condition code used to + // select between the two classes into a ConditionalRegClass register class. + ConditionalRegClass* reg_class = _AD._register->addRegClass(cname); + int i; + for (i = 0; i < 2; i++) { + char* name = get_ident(); + if (name == NULL) { + parse_err(SYNERR, "missing class identifier inside reg_class_dynamic list.\n"); + return; + } + RegClass* rc = _AD._register->getRegClass(name); + if (rc == NULL) { + parse_err(SEMERR, "unknown identifier %s inside reg_class_dynamic list.\n", name); + } else { + reg_class->set_rclass_at_index(i, rc); + } + + skipws(); + if (_curchar == ',') { + next_char(); + skipws(); + } else { + parse_err(SYNERR, "missing separator ',' inside reg_class_dynamic list.\n"); + } + } + + // Collect the condition code. + skipws(); + if (_curchar == '%') { + char* code = find_cpp_block("reg class dynamic"); + if (code == NULL) { + parse_err(SYNERR, "missing code declaration for reg_class_dynamic.\n"); + return; + } + reg_class->set_condition_code(code); + } else { + parse_err(SYNERR, "missing %% at the beginning of code block in reg_class_dynamic definition\n"); + return; + } + + skipws(); + if (_curchar != ')') { + parse_err(SYNERR, "missing ')' at the end of reg_class_dynamic definition\n"); + return; + } + next_char(); + + skipws(); + if (_curchar != ';') { + parse_err(SYNERR, "missing ';' at the end of reg_class_dynamic definition.\n"); + return; + } + next_char(); // Skip trailing ';' + + return; +} + //------------------------------alloc_class_parse------------------------------ void ADLParser::alloc_class_parse(void) { char *name; // Name of allocation class being defined diff --git a/hotspot/src/share/vm/adlc/adlparse.hpp b/hotspot/src/share/vm/adlc/adlparse.hpp index 8907cf1754d..8c5442b4c95 100644 --- a/hotspot/src/share/vm/adlc/adlparse.hpp +++ b/hotspot/src/share/vm/adlc/adlparse.hpp @@ -53,6 +53,8 @@ class ConstructRule; // ***** Register Section ***** class RegDef; class RegClass; +class CodeSnippetRegClass; +class ConditionalRegClass; class AllocClass; class ResourceForm; // ***** Pipeline Section ***** @@ -125,6 +127,7 @@ protected: // Parse components of the register section void reg_def_parse(void); // Parse register definition void reg_class_parse(void); // Parse register class definition + void reg_class_dynamic_parse(void); // Parse dynamic register class definition void alloc_class_parse(void); // Parse allocation class definition // Parse components of the definition section diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp index af3e0ffaf2a..7ff04fee3fd 100644 --- a/hotspot/src/share/vm/adlc/archDesc.cpp +++ b/hotspot/src/share/vm/adlc/archDesc.cpp @@ -908,7 +908,7 @@ char *ArchDesc::stack_or_reg_mask(OperandForm &opForm) { void ArchDesc::set_stack_or_reg(const char *reg_class_name) { if( _register ) { RegClass *reg_class = _register->getRegClass(reg_class_name); - reg_class->_stack_or_reg = true; + reg_class->set_stack_version(true); } } diff --git a/hotspot/src/share/vm/adlc/forms.hpp b/hotspot/src/share/vm/adlc/forms.hpp index 63e367dd730..073ca4c810d 100644 --- a/hotspot/src/share/vm/adlc/forms.hpp +++ b/hotspot/src/share/vm/adlc/forms.hpp @@ -68,6 +68,8 @@ class Opcode; class InsEncode; class RegDef; class RegClass; +class CodeSnippetRegClass; +class ConditionalRegClass; class AllocClass; class ResourceForm; class PipeClassForm; diff --git a/hotspot/src/share/vm/adlc/formsopt.cpp b/hotspot/src/share/vm/adlc/formsopt.cpp index 07d70fc6c6e..ac8ffff2960 100644 --- a/hotspot/src/share/vm/adlc/formsopt.cpp +++ b/hotspot/src/share/vm/adlc/formsopt.cpp @@ -47,13 +47,19 @@ void RegisterForm::addRegDef(char *name, char *callingConv, char *c_conv, } // record a new register class -RegClass *RegisterForm::addRegClass(const char *className) { - RegClass *regClass = new RegClass(className); +template +T* RegisterForm::addRegClass(const char* className) { + T* regClass = new T(className); _rclasses.addName(className); - _regClass.Insert(className,regClass); + _regClass.Insert(className, regClass); return regClass; } +// Explicit instantiation for all supported register classes. +template RegClass* RegisterForm::addRegClass(const char* className); +template CodeSnippetRegClass* RegisterForm::addRegClass(const char* className); +template ConditionalRegClass* RegisterForm::addRegClass(const char* className); + // record a new register class AllocClass *RegisterForm::addAllocClass(char *className) { AllocClass *allocClass = new AllocClass(className); @@ -67,9 +73,9 @@ AllocClass *RegisterForm::addAllocClass(char *className) { void RegisterForm::addSpillRegClass() { // Stack slots start at the next available even register number. _reg_ctr = (_reg_ctr+7) & ~7; - const char *rc_name = "stack_slots"; - RegClass *reg_class = new RegClass(rc_name); - reg_class->_stack_or_reg = true; + const char *rc_name = "stack_slots"; + RegClass* reg_class = new RegClass(rc_name); + reg_class->set_stack_version(true); _rclasses.addName(rc_name); _regClass.Insert(rc_name,reg_class); } @@ -224,9 +230,11 @@ void RegDef::output(FILE *fp) { // Write info to output files //------------------------------RegClass--------------------------------------- // Construct a register class into which registers will be inserted -RegClass::RegClass(const char *classid) : _stack_or_reg(false), _classid(classid), _regDef(cmpstr,hashstr, Form::arena), - _user_defined(NULL) -{ +RegClass::RegClass(const char* classid) : _stack_or_reg(false), _classid(classid), _regDef(cmpstr, hashstr, Form::arena) { +} + +RegClass::~RegClass() { + delete _classid; } // record a register in this class @@ -305,6 +313,91 @@ void RegClass::output(FILE *fp) { // Write info to output files fprintf(fp,"--- done with entries for reg_class %s\n\n",_classid); } +void RegClass::declare_register_masks(FILE* fp) { + const char* prefix = ""; + const char* rc_name_to_upper = toUpper(_classid); + fprintf(fp, "extern const RegMask _%s%s_mask;\n", prefix, rc_name_to_upper); + fprintf(fp, "inline const RegMask &%s%s_mask() { return _%s%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper); + if (_stack_or_reg) { + fprintf(fp, "extern const RegMask _%sSTACK_OR_%s_mask;\n", prefix, rc_name_to_upper); + fprintf(fp, "inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper); + } + delete[] rc_name_to_upper; +} + +void RegClass::build_register_masks(FILE* fp) { + int len = RegisterForm::RegMask_Size(); + const char *prefix = ""; + const char* rc_name_to_upper = toUpper(_classid); + fprintf(fp, "const RegMask _%s%s_mask(", prefix, rc_name_to_upper); + + int i; + for(i = 0; i < len - 1; i++) { + fprintf(fp," 0x%x,", regs_in_word(i, false)); + } + fprintf(fp," 0x%x );\n", regs_in_word(i, false)); + + if (_stack_or_reg) { + fprintf(fp, "const RegMask _%sSTACK_OR_%s_mask(", prefix, rc_name_to_upper); + for(i = 0; i < len - 1; i++) { + fprintf(fp," 0x%x,", regs_in_word(i, true)); + } + fprintf(fp," 0x%x );\n", regs_in_word(i, true)); + } + delete[] rc_name_to_upper; +} + +//------------------------------CodeSnippetRegClass--------------------------- +CodeSnippetRegClass::CodeSnippetRegClass(const char* classid) : RegClass(classid), _code_snippet(NULL) { +} + +CodeSnippetRegClass::~CodeSnippetRegClass() { + delete _code_snippet; +} + +void CodeSnippetRegClass::declare_register_masks(FILE* fp) { + const char* prefix = ""; + const char* rc_name_to_upper = toUpper(_classid); + fprintf(fp, "inline const RegMask &%s%s_mask() { %s }\n", prefix, rc_name_to_upper, _code_snippet); + delete[] rc_name_to_upper; +} + +//------------------------------ConditionalRegClass--------------------------- +ConditionalRegClass::ConditionalRegClass(const char *classid) : RegClass(classid), _condition_code(NULL) { +} + +ConditionalRegClass::~ConditionalRegClass() { + delete _condition_code; +} + +void ConditionalRegClass::declare_register_masks(FILE* fp) { + const char* prefix = ""; + const char* rc_name_to_upper = toUpper(_classid); + const char* rclass_0_to_upper = toUpper(_rclasses[0]->_classid); + const char* rclass_1_to_upper = toUpper(_rclasses[1]->_classid); + fprintf(fp, "inline const RegMask &%s%s_mask() {" + " return (%s) ?" + " %s%s_mask() :" + " %s%s_mask(); }\n", + prefix, rc_name_to_upper, + _condition_code, + prefix, rclass_0_to_upper, + prefix, rclass_1_to_upper); + if (_stack_or_reg) { + fprintf(fp, "inline const RegMask &%sSTACK_OR_%s_mask() {" + " return (%s) ?" + " %sSTACK_OR_%s_mask() :" + " %sSTACK_OR_%s_mask(); }\n", + prefix, rc_name_to_upper, + _condition_code, + prefix, rclass_0_to_upper, + prefix, rclass_1_to_upper); + } + delete[] rc_name_to_upper; + delete[] rclass_0_to_upper; + delete[] rclass_1_to_upper; + return; +} //------------------------------AllocClass------------------------------------- AllocClass::AllocClass(char *classid) : _classid(classid), _regDef(cmpstr,hashstr, Form::arena) { diff --git a/hotspot/src/share/vm/adlc/formsopt.hpp b/hotspot/src/share/vm/adlc/formsopt.hpp index b6108d48843..8ba8e64d99c 100644 --- a/hotspot/src/share/vm/adlc/formsopt.hpp +++ b/hotspot/src/share/vm/adlc/formsopt.hpp @@ -60,6 +60,8 @@ class Opcode; class InsEncode; class RegDef; class RegClass; +class CodeSnippetRegClass; +class ConditionalRegClass; class AllocClass; class ResourceForm; class PipeClassForm; @@ -98,7 +100,8 @@ public: void addRegDef(char *regName, char *callingConv, char *c_conv, char * idealtype, char *encoding, char* concreteName); - RegClass *addRegClass(const char *className); + template T* addRegClass(const char* className); + AllocClass *addAllocClass(char *allocName); void addSpillRegClass(); @@ -154,17 +157,28 @@ public: }; //------------------------------RegClass--------------------------------------- +// Generic register class. This register class is the internal representation +// for the following .ad file format: +// +// reg_class ptr(RAX, RBX, ...); +// +// where ptr is the name of the register class, RAX and RBX are registers. +// +// This register class allows registers to be spilled onto the stack. Spilling +// is allowed is field _stack_or_reg is true. class RegClass : public Form { public: // Public Data const char *_classid; // Name of class NameList _regDefs; // List of registers in class Dict _regDef; // Dictionary of registers in class +protected: bool _stack_or_reg; // Allowed on any stack slot - char* _user_defined; +public: // Public Methods RegClass(const char *classid);// Constructor + virtual ~RegClass(); void addReg(RegDef *regDef); // Add a register to this class @@ -183,6 +197,115 @@ public: void dump(); // Debug printer void output(FILE *fp); // Write info to output files + + virtual bool has_stack_version() { + return _stack_or_reg; + } + virtual void set_stack_version(bool flag) { + _stack_or_reg = flag; + } + + virtual void declare_register_masks(FILE* fp); + virtual void build_register_masks(FILE* fp); +}; + +//------------------------------CodeSnippetRegClass---------------------------- +// Register class that has an user-defined C++ code snippet attached to it +// to determine at runtime which register class to use. This register class is +// the internal representation for the following .ad file format: +// +// reg_class actual_dflt_reg %{ +// if (VM_Version::has_vfp3_32()) { +// return DFLT_REG_mask(); +// } else { +// return DFLT_LOW_REG_mask(); +// } +// %} +// +// where DFLT_REG_mask() and DFLT_LOW_REG_mask() are the internal names of the +// masks of register classes dflt_reg and dflt_low_reg. +// +// The attached code snippet can select also between more than two register classes. +// This register class can be, however, used only if the register class is not +// cisc-spillable (i.e., the registers of this class are not allowed on the stack, +// which is equivalent with _stack_or_reg being false). +class CodeSnippetRegClass : public RegClass { +protected: + char* _code_snippet; +public: + CodeSnippetRegClass(const char* classid);// Constructor + ~CodeSnippetRegClass(); + + void set_code_snippet(char* code) { + _code_snippet = code; + } + char* code_snippet() { + return _code_snippet; + } + void set_stack_version(bool flag) { + assert(false, "User defined register classes are not allowed to spill to the stack."); + } + void declare_register_masks(FILE* fp); + void build_register_masks(FILE* fp) { + // We do not need to generate register masks because we select at runtime + // between register masks generated for other register classes. + return; + } +}; + +//------------------------------ConditionalRegClass---------------------------- +// Register class that has two register classes and a runtime condition attached +// to it. The condition is evaluated at runtime and either one of the register +// attached register classes is selected. This register class is the internal +// representation for the following .ad format: +// +// reg_class_dynamic actual_dflt_reg(dflt_reg, low_reg, +// %{ VM_Version::has_vfp3_32() }% +// ); +// +// This example is equivalent to the example used with the CodeSnippetRegClass +// register class. A ConditionalRegClass works also if a register class is cisc-spillable +// (i.e., _stack_or_reg is true), but if can select only between two register classes. +class ConditionalRegClass : public RegClass { +protected: + // reference to condition code + char* _condition_code; // C++ condition code to dynamically determine which register class to use. + + // Example syntax (equivalent to previous example): + // + // reg_class actual_dflt_reg(dflt_reg, low_reg, + // %{ VM_Version::has_vfp3_32() }% + // ); + // reference to conditional register classes + RegClass* _rclasses[2]; // 0 is the register class selected if the condition code returns true + // 1 is the register class selected if the condition code returns false +public: + ConditionalRegClass(const char* classid);// Constructor + ~ConditionalRegClass(); + + virtual void set_stack_version(bool flag) { + RegClass::set_stack_version(flag); + assert((_rclasses[0] != NULL), "Register class NULL for condition code == true"); + assert((_rclasses[1] != NULL), "Register class NULL for condition code == false"); + _rclasses[0]->set_stack_version(flag); + _rclasses[1]->set_stack_version(flag); + } + void declare_register_masks(FILE* fp); + void build_register_masks(FILE* fp) { + // We do not need to generate register masks because we select at runtime + // between register masks generated for other register classes. + return; + } + void set_rclass_at_index(int index, RegClass* rclass) { + assert((0 <= index && index < 2), "Condition code can select only between two register classes"); + _rclasses[index] = rclass; + } + void set_condition_code(char* code) { + _condition_code = code; + } + char* condition_code() { + return _condition_code; + } }; //------------------------------AllocClass------------------------------------- diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 4a68da6cd1c..92ccb3b2620 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -3392,7 +3392,7 @@ const char *MatchNode::reduce_left(FormDict &globals) const { // Count occurrences of operands names in the leaves of the instruction // match rule. void MatchNode::count_instr_names( Dict &names ) { - if( !this ) return; + if( this == NULL ) return; if( _lChild ) _lChild->count_instr_names(names); if( _rChild ) _rChild->count_instr_names(names); if( !_lChild && !_rChild ) { @@ -4043,6 +4043,13 @@ int MatchRule::is_expensive() const { strcmp(opType,"ReplicateL")==0 || strcmp(opType,"ReplicateF")==0 || strcmp(opType,"ReplicateD")==0 || + strcmp(opType,"AddReductionVI")==0 || + strcmp(opType,"AddReductionVL")==0 || + strcmp(opType,"AddReductionVF")==0 || + strcmp(opType,"AddReductionVD")==0 || + strcmp(opType,"MulReductionVI")==0 || + strcmp(opType,"MulReductionVF")==0 || + strcmp(opType,"MulReductionVD")==0 || 0 /* 0 to line up columns nicely */ ) return 1; } @@ -4135,6 +4142,10 @@ bool MatchRule::is_vector() const { "MulVS","MulVI","MulVF","MulVD", "DivVF","DivVD", "AndV" ,"XorV" ,"OrV", + "AddReductionVI", "AddReductionVL", + "AddReductionVF", "AddReductionVD", + "MulReductionVI", + "MulReductionVF", "MulReductionVD", "LShiftCntV","RShiftCntV", "LShiftVB","LShiftVS","LShiftVI","LShiftVL", "RShiftVB","RShiftVS","RShiftVI","RShiftVL", diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index 46366f12197..1ed9157a480 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -59,6 +59,8 @@ class Opcode; class InsEncode; class RegDef; class RegClass; +class CodeSnippetRegClass; +class ConditionalRegClass; class AllocClass; class ResourceForm; class PipeDesc; diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp index 79a12a003ce..cc98ef59af4 100644 --- a/hotspot/src/share/vm/adlc/output_c.cpp +++ b/hotspot/src/share/vm/adlc/output_c.cpp @@ -138,26 +138,9 @@ void ArchDesc::declare_register_masks(FILE *fp_hpp) { fprintf(fp_hpp,"// Register masks, one for each register class.\n"); _register->_rclasses.reset(); for (rc_name = NULL; (rc_name = _register->_rclasses.iter()) != NULL;) { - const char *prefix = ""; RegClass *reg_class = _register->getRegClass(rc_name); assert(reg_class, "Using an undefined register class"); - - const char* rc_name_to_upper = toUpper(rc_name); - - if (reg_class->_user_defined == NULL) { - fprintf(fp_hpp, "extern const RegMask _%s%s_mask;\n", prefix, rc_name_to_upper); - fprintf(fp_hpp, "inline const RegMask &%s%s_mask() { return _%s%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper); - } else { - fprintf(fp_hpp, "inline const RegMask &%s%s_mask() { %s }\n", prefix, rc_name_to_upper, reg_class->_user_defined); - } - - if (reg_class->_stack_or_reg) { - assert(reg_class->_user_defined == NULL, "no user defined reg class here"); - fprintf(fp_hpp, "extern const RegMask _%sSTACK_OR_%s_mask;\n", prefix, rc_name_to_upper); - fprintf(fp_hpp, "inline const RegMask &%sSTACK_OR_%s_mask() { return _%sSTACK_OR_%s_mask; }\n", prefix, rc_name_to_upper, prefix, rc_name_to_upper); - } - delete[] rc_name_to_upper; - + reg_class->declare_register_masks(fp_hpp); } } } @@ -173,35 +156,9 @@ void ArchDesc::build_register_masks(FILE *fp_cpp) { fprintf(fp_cpp,"// Register masks, one for each register class.\n"); _register->_rclasses.reset(); for (rc_name = NULL; (rc_name = _register->_rclasses.iter()) != NULL;) { - const char *prefix = ""; RegClass *reg_class = _register->getRegClass(rc_name); assert(reg_class, "Using an undefined register class"); - - if (reg_class->_user_defined != NULL) { - continue; - } - - int len = RegisterForm::RegMask_Size(); - const char* rc_name_to_upper = toUpper(rc_name); - fprintf(fp_cpp, "const RegMask _%s%s_mask(", prefix, rc_name_to_upper); - - { - int i; - for(i = 0; i < len - 1; i++) { - fprintf(fp_cpp," 0x%x,", reg_class->regs_in_word(i, false)); - } - fprintf(fp_cpp," 0x%x );\n", reg_class->regs_in_word(i, false)); - } - - if (reg_class->_stack_or_reg) { - int i; - fprintf(fp_cpp, "const RegMask _%sSTACK_OR_%s_mask(", prefix, rc_name_to_upper); - for(i = 0; i < len - 1; i++) { - fprintf(fp_cpp," 0x%x,",reg_class->regs_in_word(i, true)); - } - fprintf(fp_cpp," 0x%x );\n",reg_class->regs_in_word(i, true)); - } - delete[] rc_name_to_upper; + reg_class->build_register_masks(fp_cpp); } } } @@ -1548,8 +1505,8 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { // Iterate over the instructions 'node' expands into ExpandRule *expand = node->_exprule; NameAndList *expand_instr = NULL; - for(expand->reset_instructions(); - (expand_instr = expand->iter_instructions()) != NULL; cnt++) { + for (expand->reset_instructions(); + (expand_instr = expand->iter_instructions()) != NULL; cnt++) { new_id = expand_instr->name(); InstructForm* expand_instruction = (InstructForm*)globalAD->globalNames()[new_id]; @@ -1560,30 +1517,25 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { continue; } - if (expand_instruction->has_temps()) { - globalAD->syntax_err(node->_linenum, "In %s: expand rules using instructs with TEMPs aren't supported: %s", - node->_ident, new_id); - } - // Build the node for the instruction fprintf(fp,"\n %sNode *n%d = new %sNode();\n", new_id, cnt, new_id); // Add control edge for this node fprintf(fp," n%d->add_req(_in[0]);\n", cnt); // Build the operand for the value this node defines. Form *form = (Form*)_globalNames[new_id]; - assert( form, "'new_id' must be a defined form name"); + assert(form, "'new_id' must be a defined form name"); // Grab the InstructForm for the new instruction new_inst = form->is_instruction(); - assert( new_inst, "'new_id' must be an instruction name"); - if( node->is_ideal_if() && new_inst->is_ideal_if() ) { - fprintf(fp, " ((MachIfNode*)n%d)->_prob = _prob;\n",cnt); - fprintf(fp, " ((MachIfNode*)n%d)->_fcnt = _fcnt;\n",cnt); + assert(new_inst, "'new_id' must be an instruction name"); + if (node->is_ideal_if() && new_inst->is_ideal_if()) { + fprintf(fp, " ((MachIfNode*)n%d)->_prob = _prob;\n", cnt); + fprintf(fp, " ((MachIfNode*)n%d)->_fcnt = _fcnt;\n", cnt); } - if( node->is_ideal_fastlock() && new_inst->is_ideal_fastlock() ) { - fprintf(fp, " ((MachFastLockNode*)n%d)->_counters = _counters;\n",cnt); - fprintf(fp, " ((MachFastLockNode*)n%d)->_rtm_counters = _rtm_counters;\n",cnt); - fprintf(fp, " ((MachFastLockNode*)n%d)->_stack_rtm_counters = _stack_rtm_counters;\n",cnt); + if (node->is_ideal_fastlock() && new_inst->is_ideal_fastlock()) { + fprintf(fp, " ((MachFastLockNode*)n%d)->_counters = _counters;\n", cnt); + fprintf(fp, " ((MachFastLockNode*)n%d)->_rtm_counters = _rtm_counters;\n", cnt); + fprintf(fp, " ((MachFastLockNode*)n%d)->_stack_rtm_counters = _stack_rtm_counters;\n", cnt); } // Fill in the bottom_type where requested diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 328919cd13f..9a7c291b886 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -3462,6 +3462,24 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { case vmIntrinsics::_putFloat : return append_unsafe_put_obj(callee, T_FLOAT, false); case vmIntrinsics::_putDouble : return append_unsafe_put_obj(callee, T_DOUBLE, false); + case vmIntrinsics::_getShortUnaligned : + return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_SHORT, false) : false; + case vmIntrinsics::_getCharUnaligned : + return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_CHAR, false) : false; + case vmIntrinsics::_getIntUnaligned : + return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_INT, false) : false; + case vmIntrinsics::_getLongUnaligned : + return UseUnalignedAccesses ? append_unsafe_get_obj(callee, T_LONG, false) : false; + + case vmIntrinsics::_putShortUnaligned : + return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_SHORT, false) : false; + case vmIntrinsics::_putCharUnaligned : + return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_CHAR, false) : false; + case vmIntrinsics::_putIntUnaligned : + return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_INT, false) : false; + case vmIntrinsics::_putLongUnaligned : + return UseUnalignedAccesses ? append_unsafe_put_obj(callee, T_LONG, false) : false; + case vmIntrinsics::_getObjectVolatile : return append_unsafe_get_obj(callee, T_OBJECT, true); case vmIntrinsics::_getBooleanVolatile: return append_unsafe_get_obj(callee, T_BOOLEAN, true); case vmIntrinsics::_getByteVolatile : return append_unsafe_get_obj(callee, T_BYTE, true); @@ -4065,7 +4083,7 @@ bool GraphBuilder::try_method_handle_inline(ciMethod* callee) { ValueType* type = apop()->type(); if (type->is_constant()) { ciMethod* target = type->as_ObjectType()->constant_value()->as_member_name()->get_vmtarget(); - // If the target is another method handle invoke try recursivly to get + // If the target is another method handle invoke, try to recursively get // a better target. if (target->is_method_handle_intrinsic()) { if (try_method_handle_inline(target)) { diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index d58e3c85b42..7d2b4f3e883 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -458,7 +458,7 @@ void LIR_OpRTCall::verify() const { //-------------------visits-------------------------- // complete rework of LIR instruction visitor. -// The virtual calls for each instruction type is replaced by a big +// The virtual call for each instruction type is replaced by a big // switch that adds the operands for each instruction void LIR_OpVisitState::visit(LIR_Op* op) { @@ -825,7 +825,8 @@ void LIR_OpVisitState::visit(LIR_Op* op) { } if (opJavaCall->_info) do_info(opJavaCall->_info); - if (opJavaCall->is_method_handle_invoke()) { + if (FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr && + opJavaCall->is_method_handle_invoke()) { opJavaCall->_method_handle_invoke_SP_save_opr = FrameMap::method_handle_invoke_SP_save_opr(); do_temp(opJavaCall->_method_handle_invoke_SP_save_opr); } diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index 90a47c8b47e..4affbfb0826 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -1219,10 +1219,8 @@ class LIR_OpJavaCall: public LIR_OpCall { // JSR 292 support. bool is_invokedynamic() const { return code() == lir_dynamic_call; } bool is_method_handle_invoke() const { - return - method()->is_compiled_lambda_form() // Java-generated adapter - || - method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic + return method()->is_compiled_lambda_form() || // Java-generated lambda form + method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic } intptr_t vtable_offset() const { diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index d040ccadd6b..cc35fc3ae30 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1606,13 +1606,26 @@ void LIRGenerator::CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* } else { __ unsigned_shift_right(addr, CardTableModRefBS::card_shift, tmp); } + + LIR_Address* card_addr; if (can_inline_as_constant(card_table_base)) { - __ move(LIR_OprFact::intConst(0), - new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE)); + card_addr = new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE); } else { - __ move(LIR_OprFact::intConst(0), - new LIR_Address(tmp, load_constant(card_table_base), - T_BYTE)); + card_addr = new LIR_Address(tmp, load_constant(card_table_base), T_BYTE); + } + + LIR_Opr dirty = LIR_OprFact::intConst(CardTableModRefBS::dirty_card_val()); + if (UseCondCardMark) { + LIR_Opr cur_value = new_register(T_INT); + __ move(card_addr, cur_value); + + LabelObj* L_already_dirty = new LabelObj(); + __ cmp(lir_cond_equal, cur_value, dirty); + __ branch(lir_cond_equal, T_BYTE, L_already_dirty->label()); + __ move(dirty, card_addr); + __ branch_destination(L_already_dirty->label()); + } else { + __ move(dirty, card_addr); } #endif } @@ -2862,7 +2875,7 @@ LIRItemList* LIRGenerator::invoke_visit_arguments(Invoke* x) { // g) lock result registers and emit call operation // // Before issuing a call, we must spill-save all values on stack -// that are in caller-save register. "spill-save" moves thos registers +// that are in caller-save register. "spill-save" moves those registers // either in a free callee-save register or spills them if no free // callee save register is available. // @@ -2870,7 +2883,7 @@ LIRItemList* LIRGenerator::invoke_visit_arguments(Invoke* x) { // - if invoked between e) and f), we may lock callee save // register in "spill-save" that destroys the receiver register // before f) is executed -// - if we rearange the f) to be earlier, by loading %o0, it +// - if we rearrange f) to be earlier (by loading %o0) it // may destroy a value on the stack that is currently in %o0 // and is waiting to be spilled // - if we keep the receiver locked while doing spill-save, @@ -2903,14 +2916,16 @@ void LIRGenerator::do_Invoke(Invoke* x) { assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); // JSR 292 - // Preserve the SP over MethodHandle call sites. + // Preserve the SP over MethodHandle call sites, if needed. ciMethod* target = x->target(); bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant? target->is_method_handle_intrinsic() || target->is_compiled_lambda_form()); if (is_method_handle_invoke) { info->set_is_method_handle_invoke(true); - __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); + if(FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) { + __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); + } } switch (x->code()) { @@ -2950,8 +2965,9 @@ void LIRGenerator::do_Invoke(Invoke* x) { } // JSR 292 - // Restore the SP after MethodHandle call sites. - if (is_method_handle_invoke) { + // Restore the SP after MethodHandle call sites, if needed. + if (is_method_handle_invoke + && FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) { __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); } diff --git a/hotspot/src/share/vm/ci/ciCallSite.cpp b/hotspot/src/share/vm/ci/ciCallSite.cpp index fb222fe3f5a..028a4ed724f 100644 --- a/hotspot/src/share/vm/ci/ciCallSite.cpp +++ b/hotspot/src/share/vm/ci/ciCallSite.cpp @@ -49,6 +49,25 @@ ciMethodHandle* ciCallSite::get_target() const { return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle(); } +// ------------------------------------------------------------------ +// ciCallSite::get_context +// +// Return the target MethodHandle of this CallSite. +ciKlass* ciCallSite::get_context() { + assert(!is_constant_call_site(), ""); + + VM_ENTRY_MARK; + oop call_site_oop = get_oop(); + InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site_oop); + if (ctxk == NULL) { + // The call site doesn't have a context associated. Set it to the default context. + oop def_context_oop = java_lang_invoke_CallSite::default_context(); + java_lang_invoke_CallSite::set_context_cas(call_site_oop, def_context_oop, /*expected=*/NULL); + ctxk = MethodHandles::get_call_site_context(call_site_oop); + } + return (CURRENT_ENV->get_metadata(ctxk))->as_klass(); +} + // ------------------------------------------------------------------ // ciCallSite::print // diff --git a/hotspot/src/share/vm/ci/ciCallSite.hpp b/hotspot/src/share/vm/ci/ciCallSite.hpp index 063f1e3a5fe..040e894d0df 100644 --- a/hotspot/src/share/vm/ci/ciCallSite.hpp +++ b/hotspot/src/share/vm/ci/ciCallSite.hpp @@ -43,6 +43,7 @@ public: // Return the target MethodHandle of this CallSite. ciMethodHandle* get_target() const; + ciKlass* get_context(); void print(); }; diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index f06a6e654d2..859bd3eef4c 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -688,7 +688,8 @@ bool ciMethod::parameter_profiled_type(int i, ciKlass*& type, bool& maybe_null) // via assert_unique_concrete_method or assert_leaf_type. ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller, ciInstanceKlass* callee_holder, - ciInstanceKlass* actual_recv) { + ciInstanceKlass* actual_recv, + bool check_access) { check_is_loaded(); if (actual_recv->is_interface()) { @@ -696,7 +697,7 @@ ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller, return NULL; } - ciMethod* root_m = resolve_invoke(caller, actual_recv); + ciMethod* root_m = resolve_invoke(caller, actual_recv, check_access); if (root_m == NULL) { // Something went wrong looking up the actual receiver method. return NULL; @@ -775,7 +776,7 @@ ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller, // // Given a known receiver klass, find the target for the call. // Return NULL if the call has no target or the target is abstract. -ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver) { +ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, bool check_access) { check_is_loaded(); VM_ENTRY_MARK; @@ -792,9 +793,9 @@ ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver) { || InstanceKlass::cast(h_recv())->is_linked() && !exact_receiver->is_interface()) { if (holder()->is_interface()) { - m = LinkResolver::resolve_interface_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass); + m = LinkResolver::resolve_interface_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass, check_access); } else { - m = LinkResolver::resolve_virtual_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass); + m = LinkResolver::resolve_virtual_call_or_null(h_recv, h_resolved, h_name, h_signature, caller_klass, check_access); } } diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index d0c664d6142..ead6a962589 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -255,11 +255,12 @@ class ciMethod : public ciMetadata { // its calling environment. ciMethod* find_monomorphic_target(ciInstanceKlass* caller, ciInstanceKlass* callee_holder, - ciInstanceKlass* actual_receiver); + ciInstanceKlass* actual_receiver, + bool check_access = true); // Given a known receiver klass, find the target for the call. // Return NULL if the call has no target or is abstract. - ciMethod* resolve_invoke(ciKlass* caller, ciKlass* exact_receiver); + ciMethod* resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, bool check_access = true); // Find the proper vtable index to invoke this method. int resolve_vtable_index(ciKlass* caller, ciKlass* receiver); diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 748e76da495..52532918aeb 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -4838,20 +4838,21 @@ void ClassFileParser::verify_legal_method_modifiers( } } } else { // not interface - if (is_initializer) { - if (is_static || is_final || is_synchronized || is_native || - is_abstract || (major_gte_15 && is_bridge)) { - is_illegal = true; - } - } else { // not initializer - if (is_abstract) { - if ((is_final || is_native || is_private || is_static || - (major_gte_15 && (is_synchronized || is_strict)))) { + if (has_illegal_visibility(flags)) { + is_illegal = true; + } else { + if (is_initializer) { + if (is_static || is_final || is_synchronized || is_native || + is_abstract || (major_gte_15 && is_bridge)) { is_illegal = true; } - } - if (has_illegal_visibility(flags)) { - is_illegal = true; + } else { // not initializer + if (is_abstract) { + if ((is_final || is_native || is_private || is_static || + (major_gte_15 && (is_synchronized || is_strict)))) { + is_illegal = true; + } + } } } } diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 42ea9b8230f..9ac84cc631f 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -102,21 +102,22 @@ InjectedField* JavaClasses::get_injected(Symbol* class_name, int* field_count) { static bool find_field(InstanceKlass* ik, Symbol* name_symbol, Symbol* signature_symbol, fieldDescriptor* fd, - bool allow_super = false) { - if (allow_super) - return ik->find_field(name_symbol, signature_symbol, fd) != NULL; - else + bool is_static = false, bool allow_super = false) { + if (allow_super || is_static) { + return ik->find_field(name_symbol, signature_symbol, is_static, fd) != NULL; + } else { return ik->find_local_field(name_symbol, signature_symbol, fd); + } } // Helpful routine for computing field offsets at run time rather than hardcoding them static void compute_offset(int &dest_offset, Klass* klass_oop, Symbol* name_symbol, Symbol* signature_symbol, - bool allow_super = false) { + bool is_static = false, bool allow_super = false) { fieldDescriptor fd; InstanceKlass* ik = InstanceKlass::cast(klass_oop); - if (!find_field(ik, name_symbol, signature_symbol, &fd, allow_super)) { + if (!find_field(ik, name_symbol, signature_symbol, &fd, is_static, allow_super)) { ResourceMark rm; tty->print_cr("Invalid layout of %s at %s", ik->external_name(), name_symbol->as_C_string()); #ifndef PRODUCT @@ -126,7 +127,7 @@ compute_offset(int &dest_offset, tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int()); } #endif //PRODUCT - fatal("Invalid layout of preloaded class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); } dest_offset = fd.offset(); } @@ -1313,7 +1314,8 @@ static inline int version_at(unsigned int merged) { } static inline bool version_matches(Method* method, int version) { - return (method->constants()->version() == version && version < MAX_VERSION); + assert(version < MAX_VERSION, "version is too big"); + return method != NULL && (method->constants()->version() == version); } static inline int get_line_number(Method* method, int bci) { @@ -1343,6 +1345,7 @@ class BacktraceBuilder: public StackObj { typeArrayOop _methods; typeArrayOop _bcis; objArrayOop _mirrors; + typeArrayOop _cprefs; // needed to insulate method name against redefinition int _index; No_Safepoint_Verifier _nsv; @@ -1350,8 +1353,9 @@ class BacktraceBuilder: public StackObj { enum { trace_methods_offset = java_lang_Throwable::trace_methods_offset, - trace_bcis_offset = java_lang_Throwable::trace_bcis_offset, + trace_bcis_offset = java_lang_Throwable::trace_bcis_offset, trace_mirrors_offset = java_lang_Throwable::trace_mirrors_offset, + trace_cprefs_offset = java_lang_Throwable::trace_cprefs_offset, trace_next_offset = java_lang_Throwable::trace_next_offset, trace_size = java_lang_Throwable::trace_size, trace_chunk_size = java_lang_Throwable::trace_chunk_size @@ -1373,9 +1377,14 @@ class BacktraceBuilder: public StackObj { assert(mirrors != NULL, "mirror array should be initialized in backtrace"); return mirrors; } + static typeArrayOop get_cprefs(objArrayHandle chunk) { + typeArrayOop cprefs = typeArrayOop(chunk->obj_at(trace_cprefs_offset)); + assert(cprefs != NULL, "cprefs array should be initialized in backtrace"); + return cprefs; + } // constructor for new backtrace - BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL) { + BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _mirrors(NULL), _cprefs(NULL) { expand(CHECK); _backtrace = _head; _index = 0; @@ -1385,6 +1394,7 @@ class BacktraceBuilder: public StackObj { _methods = get_methods(backtrace); _bcis = get_bcis(backtrace); _mirrors = get_mirrors(backtrace); + _cprefs = get_cprefs(backtrace); assert(_methods->length() == _bcis->length() && _methods->length() == _mirrors->length(), "method and source information arrays should match"); @@ -1410,17 +1420,22 @@ class BacktraceBuilder: public StackObj { objArrayOop mirrors = oopFactory::new_objectArray(trace_chunk_size, CHECK); objArrayHandle new_mirrors(THREAD, mirrors); + typeArrayOop cprefs = oopFactory::new_shortArray(trace_chunk_size, CHECK); + typeArrayHandle new_cprefs(THREAD, cprefs); + if (!old_head.is_null()) { old_head->obj_at_put(trace_next_offset, new_head()); } new_head->obj_at_put(trace_methods_offset, new_methods()); new_head->obj_at_put(trace_bcis_offset, new_bcis()); new_head->obj_at_put(trace_mirrors_offset, new_mirrors()); + new_head->obj_at_put(trace_cprefs_offset, new_cprefs()); _head = new_head(); _methods = new_methods(); _bcis = new_bcis(); _mirrors = new_mirrors(); + _cprefs = new_cprefs(); _index = 0; } @@ -1440,8 +1455,9 @@ class BacktraceBuilder: public StackObj { method = mhandle(); } - _methods->short_at_put(_index, method->method_idnum()); + _methods->short_at_put(_index, method->orig_method_idnum()); _bcis->int_at_put(_index, merge_bci_and_version(bci, method->constants()->version())); + _cprefs->short_at_put(_index, method->name_index()); // We need to save the mirrors in the backtrace to keep the class // from being unloaded while we still have this stack trace. @@ -1454,27 +1470,26 @@ class BacktraceBuilder: public StackObj { // Print stack trace element to resource allocated buffer char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror, - int method_id, int version, int bci) { + int method_id, int version, int bci, int cpref) { // Get strings and string lengths InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(mirror())); const char* klass_name = holder->external_name(); int buf_len = (int)strlen(klass_name); - // 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; - } + Method* method = holder->method_with_orig_idnum(method_id, version); - char* method_name = method->name()->as_C_string(); + // The method can be NULL if the requested class version is gone + Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref); + char* method_name = sym->as_C_string(); buf_len += (int)strlen(method_name); + // Use specific ik version as a holder since the mirror might + // refer to version that is now obsolete and no longer accessible + // via the previous versions list. + holder = holder->get_klass_version(version); char* source_file_name = NULL; - if (version_matches(method, version)) { + if (holder != NULL) { Symbol* source = holder->source_file_name(); if (source != NULL) { source_file_name = source->as_C_string(); @@ -1516,17 +1531,18 @@ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror, } void java_lang_Throwable::print_stack_element(outputStream *st, Handle mirror, - int method_id, int version, int bci) { + int method_id, int version, int bci, int cpref) { ResourceMark rm; - char* buf = print_stack_element_to_buffer(mirror, method_id, version, bci); + char* buf = print_stack_element_to_buffer(mirror, method_id, version, bci, cpref); st->print_cr("%s", buf); } void java_lang_Throwable::print_stack_element(outputStream *st, methodHandle method, int bci) { Handle mirror = method->method_holder()->java_mirror(); - int method_id = method->method_idnum(); + int method_id = method->orig_method_idnum(); int version = method->constants()->version(); - print_stack_element(st, mirror, method_id, version, bci); + int cpref = method->name_index(); + print_stack_element(st, mirror, method_id, version, bci, cpref); } const char* java_lang_Throwable::no_stack_trace_message() { @@ -1551,6 +1567,7 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { typeArrayHandle methods (THREAD, BacktraceBuilder::get_methods(result)); typeArrayHandle bcis (THREAD, BacktraceBuilder::get_bcis(result)); objArrayHandle mirrors (THREAD, BacktraceBuilder::get_mirrors(result)); + typeArrayHandle cprefs (THREAD, BacktraceBuilder::get_cprefs(result)); int length = methods()->length(); for (int index = 0; index < length; index++) { @@ -1560,7 +1577,8 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { int method = methods->short_at(index); int version = version_at(bcis->int_at(index)); int bci = bci_at(bcis->int_at(index)); - print_stack_element(st, mirror, method, version, bci); + int cpref = cprefs->short_at(index); + print_stack_element(st, mirror, method, version, bci, cpref); } result = objArrayHandle(THREAD, objArrayOop(result->obj_at(trace_next_offset))); } @@ -1837,29 +1855,30 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS if (chunk == NULL) { THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL); } - // Get method id, bci, version and mirror from chunk + // Get method id, bci, version, mirror and cpref from chunk typeArrayOop methods = BacktraceBuilder::get_methods(chunk); typeArrayOop bcis = BacktraceBuilder::get_bcis(chunk); objArrayOop mirrors = BacktraceBuilder::get_mirrors(chunk); + typeArrayOop cprefs = BacktraceBuilder::get_cprefs(chunk); assert(methods != NULL && bcis != NULL && mirrors != NULL, "sanity check"); int method = methods->short_at(chunk_index); int version = version_at(bcis->int_at(chunk_index)); int bci = bci_at(bcis->int_at(chunk_index)); + int cpref = cprefs->short_at(chunk_index); Handle mirror(THREAD, mirrors->obj_at(chunk_index)); // Chunk can be partial full if (mirror.is_null()) { THROW_(vmSymbols::java_lang_IndexOutOfBoundsException(), NULL); } - - oop element = java_lang_StackTraceElement::create(mirror, method, version, bci, CHECK_0); + oop element = java_lang_StackTraceElement::create(mirror, method, version, bci, cpref, CHECK_0); return element; } oop java_lang_StackTraceElement::create(Handle mirror, int method_id, - int version, int bci, TRAPS) { + int version, int bci, int cpref, TRAPS) { // Allocate java.lang.StackTraceElement instance Klass* k = SystemDictionary::StackTraceElement_klass(); assert(k != NULL, "must be loaded in 1.4+"); @@ -1876,17 +1895,13 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id, oop classname = StringTable::intern((char*) str, CHECK_0); java_lang_StackTraceElement::set_declaringClass(element(), classname); - 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(); - } + Method* method = holder->method_with_orig_idnum(method_id, version); + + // The method can be NULL if the requested class version is gone + Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref); // Fill in method name - oop methodname = StringTable::intern(method->name(), CHECK_0); + oop methodname = StringTable::intern(sym, CHECK_0); java_lang_StackTraceElement::set_methodName(element(), methodname); if (!version_matches(method, version)) { @@ -1895,6 +1910,11 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id, java_lang_StackTraceElement::set_lineNumber(element(), -1); } else { // Fill in source file name and line number. + // Use specific ik version as a holder since the mirror might + // refer to version that is now obsolete and no longer accessible + // via the previous versions list. + holder = holder->get_klass_version(version); + assert(holder != NULL, "sanity check"); Symbol* source = holder->source_file_name(); if (ShowHiddenFrames && source == NULL) source = vmSymbols::unknown_class_name(); @@ -1909,8 +1929,9 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id, oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) { Handle mirror (THREAD, method->method_holder()->java_mirror()); - int method_id = method->method_idnum(); - return create(mirror, method_id, method->constants()->version(), bci, THREAD); + int method_id = method->orig_method_idnum(); + int cpref = method->name_index(); + return create(mirror, method_id, method->constants()->version(), bci, cpref, THREAD); } void java_lang_reflect_AccessibleObject::compute_offsets() { @@ -2811,33 +2832,6 @@ bool java_lang_invoke_MemberName::is_method(oop mname) { return (flags(mname) & (MN_IS_METHOD | MN_IS_CONSTRUCTOR)) > 0; } -#if INCLUDE_JVMTI -// Can be executed on VM thread only -void java_lang_invoke_MemberName::adjust_vmtarget(oop mname, Method* old_method, - Method* new_method, bool* trace_name_printed) { - assert(is_method(mname), "wrong type"); - assert(Thread::current()->is_VM_thread(), "not VM thread"); - - Method* target = (Method*)mname->address_field(_vmtarget_offset); - if (target == old_method) { - mname->address_field_put(_vmtarget_offset, (address)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", - old_method->method_holder()->external_name())); - *trace_name_printed = true; - } - // RC_TRACE macro has an embedded ResourceMark - RC_TRACE(0x00400000, ("MemberName method update: %s(%s)", - new_method->name()->as_C_string(), - new_method->signature()->as_C_string())); - } - } -} -#endif // INCLUDE_JVMTI - void java_lang_invoke_MemberName::set_vmtarget(oop mname, Metadata* ref) { assert(is_instance(mname), "wrong type"); // check the type of the vmtarget @@ -2972,14 +2966,49 @@ int java_lang_invoke_MethodType::rtype_slot_count(oop mt) { // Support for java_lang_invoke_CallSite int java_lang_invoke_CallSite::_target_offset; +int java_lang_invoke_CallSite::_context_offset; +int java_lang_invoke_CallSite::_default_context_offset; void java_lang_invoke_CallSite::compute_offsets() { Klass* k = SystemDictionary::CallSite_klass(); if (k != NULL) { compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature()); + compute_offset(_context_offset, k, vmSymbols::context_name(), vmSymbols::sun_misc_Cleaner_signature()); + compute_offset(_default_context_offset, k, + vmSymbols::DEFAULT_CONTEXT_name(), vmSymbols::sun_misc_Cleaner_signature(), + /*is_static=*/true, /*allow_super=*/false); } } +oop java_lang_invoke_CallSite::context_volatile(oop call_site) { + assert(java_lang_invoke_CallSite::is_instance(call_site), ""); + + oop dep_oop = call_site->obj_field_volatile(_context_offset); + return dep_oop; +} + +void java_lang_invoke_CallSite::set_context_volatile(oop call_site, oop context) { + assert(java_lang_invoke_CallSite::is_instance(call_site), ""); + call_site->obj_field_put_volatile(_context_offset, context); +} + +bool java_lang_invoke_CallSite::set_context_cas(oop call_site, oop context, oop expected) { + assert(java_lang_invoke_CallSite::is_instance(call_site), ""); + HeapWord* context_addr = call_site->obj_field_addr(_context_offset); + oop res = oopDesc::atomic_compare_exchange_oop(context, context_addr, expected, true); + bool success = (res == expected); + if (success) { + update_barrier_set((void*)context_addr, context); + } + return success; +} + +oop java_lang_invoke_CallSite::default_context() { + InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::CallSite_klass()); + oop def_context_oop = ik->java_mirror()->obj_field(_default_context_offset); + assert(!oopDesc::is_null(def_context_oop), ""); + return def_context_oop; +} // Support for java_security_AccessControlContext @@ -3606,7 +3635,7 @@ int InjectedField::compute_offset() { tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int()); } #endif //PRODUCT - fatal("Invalid layout of preloaded class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); return -1; } diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 4c2759466f8..700cf4afab5 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -485,8 +485,9 @@ class java_lang_Throwable: AllStatic { trace_methods_offset = 0, trace_bcis_offset = 1, trace_mirrors_offset = 2, - trace_next_offset = 3, - trace_size = 4, + trace_cprefs_offset = 3, + trace_next_offset = 4, + trace_size = 5, trace_chunk_size = 32 }; @@ -497,7 +498,7 @@ class java_lang_Throwable: AllStatic { static int static_unassigned_stacktrace_offset; // Printing - static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci); + static char* print_stack_element_to_buffer(Handle mirror, int method, int version, int bci, int cpref); // StackTrace (programmatic access, new since 1.4) static void clear_stacktrace(oop throwable); // No stack trace available @@ -519,7 +520,7 @@ class java_lang_Throwable: AllStatic { static void set_message(oop throwable, oop value); static Symbol* detail_message(oop throwable); static void print_stack_element(outputStream *st, Handle mirror, int method, - int version, int bci); + int version, int bci, int cpref); static void print_stack_element(outputStream *st, methodHandle method, int bci); static void print_stack_usage(Handle stream); @@ -961,7 +962,6 @@ class java_lang_ref_SoftReference: public java_lang_ref_Reference { static void set_clock(jlong value); }; - // Interface to java.lang.invoke.MethodHandle objects class MethodHandleEntry; @@ -1091,10 +1091,6 @@ class java_lang_invoke_MemberName: AllStatic { static Metadata* vmtarget(oop mname); static void set_vmtarget(oop mname, Metadata* target); -#if INCLUDE_JVMTI - static void adjust_vmtarget(oop mname, Method* old_method, Method* new_method, - bool* trace_name_printed); -#endif // INCLUDE_JVMTI static intptr_t vmindex(oop mname); static void set_vmindex(oop mname, intptr_t index); @@ -1173,16 +1169,23 @@ class java_lang_invoke_CallSite: AllStatic { private: static int _target_offset; + static int _context_offset; + static int _default_context_offset; + static void compute_offsets(); public: // Accessors - static oop target( oop site); - static void set_target( oop site, oop target); + static oop target( oop site); + static void set_target( oop site, oop target); + static void set_target_volatile( oop site, oop target); - static volatile oop target_volatile(oop site); - static void set_target_volatile(oop site, oop target); + static oop context_volatile(oop site); + static void set_context_volatile(oop site, oop context); + static bool set_context_cas (oop site, oop context, oop expected); + + static oop default_context(); // Testers static bool is_subclass(Klass* klass) { @@ -1194,7 +1197,6 @@ public: static int target_offset_in_bytes() { return _target_offset; } }; - // Interface to java.security.AccessControlContext objects class java_security_AccessControlContext: AllStatic { @@ -1314,7 +1316,7 @@ class java_lang_StackTraceElement: AllStatic { static void set_lineNumber(oop element, int value); // Create an instance of StackTraceElement - static oop create(Handle mirror, int method, int version, int bci, TRAPS); + static oop create(Handle mirror, int method, int version, int bci, int cpref, TRAPS); static oop create(methodHandle method, int bci, TRAPS); // Debugging diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp index 961d6efdd83..c5b2f32066d 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp @@ -29,10 +29,6 @@ #include "oops/oop.inline.hpp" #include "oops/oopsHierarchy.hpp" -inline volatile oop java_lang_invoke_CallSite::target_volatile(oop site) { - return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); -} - inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); } diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index aaf33d55079..2283ff921ca 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -657,6 +657,7 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { bool this_uninit = false; // Set to true when invokespecial initialized 'this' + bool verified_exc_handlers = false; // Merge with the next instruction { @@ -688,6 +689,18 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { } } + // Look for possible jump target in exception handlers and see if it + // matches current_frame. Do this check here for astore*, dstore*, + // fstore*, istore*, and lstore* opcodes because they can change the type + // state by adding a local. JVM Spec says that the incoming type state + // should be used for this check. So, do the check here before a possible + // local is added to the type state. + if (Bytecodes::is_store_into_local(opcode) && bci >= ex_min && bci < ex_max) { + verify_exception_handler_targets( + bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this)); + verified_exc_handlers = true; + } + switch (opcode) { case Bytecodes::_nop : no_control_flow = false; break; @@ -1669,9 +1682,13 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { } // end switch } // end Merge with the next instruction - // Look for possible jump target in exception handlers and see if it - // matches current_frame - if (bci >= ex_min && bci < ex_max) { + // Look for possible jump target in exception handlers and see if it matches + // current_frame. Don't do this check if it has already been done (for + // ([a,d,f,i,l]store* opcodes). This check cannot be done earlier because + // opcodes, such as invokespecial, may set the this_uninit flag. + assert(!(verified_exc_handlers && this_uninit), + "Exception handler targets got verified before this_uninit got set"); + if (!verified_exc_handlers && bci >= ex_min && bci < ex_max) { verify_exception_handler_targets( bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this)); } @@ -2236,14 +2253,20 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs, } // Look at the method's handlers. If the bci is in the handler's try block -// then check if the handler_pc is already on the stack. If not, push it. +// then check if the handler_pc is already on the stack. If not, push it +// unless the handler has already been scanned. void ClassVerifier::push_handlers(ExceptionTable* exhandlers, + GrowableArray* handler_list, GrowableArray* handler_stack, u4 bci) { int exlength = exhandlers->length(); for(int x = 0; x < exlength; x++) { if (bci >= exhandlers->start_pc(x) && bci < exhandlers->end_pc(x)) { - handler_stack->append_if_missing(exhandlers->handler_pc(x)); + u4 exhandler_pc = exhandlers->handler_pc(x); + if (!handler_list->contains(exhandler_pc)) { + handler_stack->append_if_missing(exhandler_pc); + handler_list->append(exhandler_pc); + } } } } @@ -2261,6 +2284,10 @@ bool ClassVerifier::ends_in_athrow(u4 start_bc_offset) { GrowableArray* bci_stack = new GrowableArray(30); // Create stack for handlers for try blocks containing this handler. GrowableArray* handler_stack = new GrowableArray(30); + // Create list of handlers that have been pushed onto the handler_stack + // so that handlers embedded inside of their own TRY blocks only get + // scanned once. + GrowableArray* handler_list = new GrowableArray(30); // Create list of visited branch opcodes (goto* and if*). GrowableArray* visited_branches = new GrowableArray(30); ExceptionTable exhandlers(_method()); @@ -2279,7 +2306,7 @@ bool ClassVerifier::ends_in_athrow(u4 start_bc_offset) { // If the bytecode is in a TRY block, push its handlers so they // will get parsed. - push_handlers(&exhandlers, handler_stack, bci); + push_handlers(&exhandlers, handler_list, handler_stack, bci); switch (opcode) { case Bytecodes::_if_icmpeq: diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index 113e404e42e..012418abe0f 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -305,9 +305,10 @@ class ClassVerifier : public StackObj { bool* this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS); - // Used by ends_in_athrow() to push all handlers that contain bci onto - // the handler_stack, if the handler is not already on the stack. + // Used by ends_in_athrow() to push all handlers that contain bci onto the + // handler_stack, if the handler has not already been pushed on the stack. void push_handlers(ExceptionTable* exhandlers, + GrowableArray* handler_list, GrowableArray* handler_stack, u4 bci); diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 64e717bbc10..85cec9601cf 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -292,6 +292,7 @@ template(setTargetNormal_name, "setTargetNormal") \ template(setTargetVolatile_name, "setTargetVolatile") \ template(setTarget_signature, "(Ljava/lang/invoke/MethodHandle;)V") \ + template(DEFAULT_CONTEXT_name, "DEFAULT_CONTEXT") \ NOT_LP64( do_alias(intptr_signature, int_signature) ) \ LP64_ONLY( do_alias(intptr_signature, long_signature) ) \ \ @@ -501,6 +502,7 @@ template(class_signature, "Ljava/lang/Class;") \ template(string_signature, "Ljava/lang/String;") \ template(reference_signature, "Ljava/lang/ref/Reference;") \ + template(sun_misc_Cleaner_signature, "Lsun/misc/Cleaner;") \ template(executable_signature, "Ljava/lang/reflect/Executable;") \ template(concurrenthashmap_signature, "Ljava/util/concurrent/ConcurrentHashMap;") \ template(String_StringBuilder_signature, "(Ljava/lang/String;)Ljava/lang/StringBuilder;") \ @@ -531,18 +533,17 @@ template(java_lang_management_ThreadState, "java/lang/management/ThreadState") \ template(java_lang_management_MemoryUsage, "java/lang/management/MemoryUsage") \ template(java_lang_management_ThreadInfo, "java/lang/management/ThreadInfo") \ - template(sun_management_ManagementFactory, "sun/management/ManagementFactory") \ template(sun_management_Sensor, "sun/management/Sensor") \ template(sun_management_Agent, "sun/management/Agent") \ - template(sun_management_DiagnosticCommandImpl, "sun/management/DiagnosticCommandImpl") \ - template(sun_management_GarbageCollectorImpl, "sun/management/GarbageCollectorImpl") \ + template(com_sun_management_internal_DiagnosticCommandImpl, "com/sun/management/internal/DiagnosticCommandImpl") \ + template(com_sun_management_internal_GarbageCollectorExtImpl,"com/sun/management/internal/GarbageCollectorExtImpl") \ template(sun_management_ManagementFactoryHelper, "sun/management/ManagementFactoryHelper") \ template(getDiagnosticCommandMBean_name, "getDiagnosticCommandMBean") \ template(getDiagnosticCommandMBean_signature, "()Lcom/sun/management/DiagnosticCommandMBean;") \ template(getGcInfoBuilder_name, "getGcInfoBuilder") \ - template(getGcInfoBuilder_signature, "()Lsun/management/GcInfoBuilder;") \ + template(getGcInfoBuilder_signature, "()Lcom/sun/management/internal/GcInfoBuilder;") \ template(com_sun_management_GcInfo, "com/sun/management/GcInfo") \ - template(com_sun_management_GcInfo_constructor_signature, "(Lsun/management/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V") \ + template(com_sun_management_GcInfo_constructor_signature, "(Lcom/sun/management/internal/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V") \ template(createGCNotification_name, "createGCNotification") \ template(createGCNotification_signature, "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/sun/management/GcInfo;)V") \ template(createDiagnosticFrameworkNotification_name, "createDiagnosticFrameworkNotification") \ @@ -554,11 +555,12 @@ template(createGarbageCollectorMBean_signature, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/management/GarbageCollectorMBean;") \ template(trigger_name, "trigger") \ template(clear_name, "clear") \ - template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \ + template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \ template(startAgent_name, "startAgent") \ template(startRemoteAgent_name, "startRemoteManagementAgent") \ template(startLocalAgent_name, "startLocalManagementAgent") \ template(stopRemoteAgent_name, "stopRemoteManagementAgent") \ + template(getAgentStatus_name, "getManagementAgentStatus") \ template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \ template(java_lang_management_ThreadInfo_with_locks_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;[Ljava/lang/Object;[I[Ljava/lang/Object;)V") \ template(long_long_long_long_void_signature, "(JJJJ)V") \ @@ -868,9 +870,12 @@ \ /* Custom branch frequencies profiling support for JSR292 */ \ do_class(java_lang_invoke_MethodHandleImpl, "java/lang/invoke/MethodHandleImpl") \ - do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S) \ - do_name( profileBoolean_name, "profileBoolean") \ - do_signature(profileBoolean_signature, "(Z[I)Z") \ + do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S) \ + do_name( profileBoolean_name, "profileBoolean") \ + do_signature(profileBoolean_signature, "(Z[I)Z") \ + do_intrinsic(_isCompileConstant, java_lang_invoke_MethodHandleImpl, isCompileConstant_name, isCompileConstant_signature, F_S) \ + do_name( isCompileConstant_name, "isCompileConstant") \ + do_alias( isCompileConstant_signature, object_boolean_signature) \ \ /* unsafe memory references (there are a lot of them...) */ \ do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \ @@ -950,6 +955,20 @@ do_intrinsic(_putFloatVolatile, sun_misc_Unsafe, putFloatVolatile_name, putFloat_signature, F_RN) \ do_intrinsic(_putDoubleVolatile, sun_misc_Unsafe, putDoubleVolatile_name, putDouble_signature, F_RN) \ \ + do_name(getShortUnaligned_name,"getShortUnaligned") do_name(putShortUnaligned_name,"putShortUnaligned") \ + do_name(getCharUnaligned_name,"getCharUnaligned") do_name(putCharUnaligned_name,"putCharUnaligned") \ + do_name(getIntUnaligned_name,"getIntUnaligned") do_name(putIntUnaligned_name,"putIntUnaligned") \ + do_name(getLongUnaligned_name,"getLongUnaligned") do_name(putLongUnaligned_name,"putLongUnaligned") \ + \ + do_intrinsic(_getShortUnaligned, sun_misc_Unsafe, getShortUnaligned_name, getShort_signature, F_R) \ + do_intrinsic(_getCharUnaligned, sun_misc_Unsafe, getCharUnaligned_name, getChar_signature, F_R) \ + do_intrinsic(_getIntUnaligned, sun_misc_Unsafe, getIntUnaligned_name, getInt_signature, F_R) \ + do_intrinsic(_getLongUnaligned, sun_misc_Unsafe, getLongUnaligned_name, getLong_signature, F_R) \ + do_intrinsic(_putShortUnaligned, sun_misc_Unsafe, putShortUnaligned_name, putShort_signature, F_R) \ + do_intrinsic(_putCharUnaligned, sun_misc_Unsafe, putCharUnaligned_name, putChar_signature, F_R) \ + do_intrinsic(_putIntUnaligned, sun_misc_Unsafe, putIntUnaligned_name, putInt_signature, F_R) \ + do_intrinsic(_putLongUnaligned, sun_misc_Unsafe, putLongUnaligned_name, putLong_signature, F_R) \ + \ /* %%% these are redundant except perhaps for getAddress, but Unsafe has native methods for them */ \ do_signature(getByte_raw_signature, "(J)B") \ do_signature(putByte_raw_signature, "(JB)V") \ diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index 25323c595f6..7e831bf3249 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -1067,8 +1067,11 @@ void CodeCache::flush_dependents_on(Handle call_site, Handle method_handle) { int marked = 0; { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - InstanceKlass* call_site_klass = InstanceKlass::cast(call_site->klass()); - marked = call_site_klass->mark_dependent_nmethods(changes); + InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site()); + if (ctxk == NULL) { + return; // No dependencies to invalidate yet. + } + marked = ctxk->mark_dependent_nmethods(changes); } if (marked > 0) { // At least one nmethod has been marked for deoptimization diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index c9b0cb63b28..1f56103be5b 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -117,8 +117,9 @@ void Dependencies::assert_has_no_finalizable_subclasses(ciKlass* ctxk) { } void Dependencies::assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle) { - check_ctxk(call_site->klass()); - assert_common_2(call_site_target_value, call_site, method_handle); + ciKlass* ctxk = call_site->get_context(); + check_ctxk(ctxk); + assert_common_3(call_site_target_value, ctxk, call_site, method_handle); } // Helper function. If we are adding a new dep. under ctxk2, @@ -388,7 +389,7 @@ int Dependencies::_dep_args[TYPE_LIMIT] = { 3, // unique_concrete_subtypes_2 ctxk, k1, k2 3, // unique_concrete_methods_2 ctxk, m1, m2 1, // no_finalizable_subclasses ctxk - 2 // call_site_target_value call_site, method_handle + 3 // call_site_target_value ctxk, call_site, method_handle }; const char* Dependencies::dep_name(Dependencies::DepType dept) { @@ -594,7 +595,7 @@ void Dependencies::DepStream::log_dependency(Klass* witness) { const int nargs = argument_count(); GrowableArray* args = new GrowableArray(nargs); for (int j = 0; j < nargs; j++) { - if (type() == call_site_target_value) { + if (is_oop_argument(j)) { args->push(argument_oop(j)); } else { args->push(argument(j)); @@ -614,7 +615,7 @@ void Dependencies::DepStream::print_dependency(Klass* witness, bool verbose) { int nargs = argument_count(); GrowableArray* args = new GrowableArray(nargs); for (int j = 0; j < nargs; j++) { - if (type() == call_site_target_value) { + if (is_oop_argument(j)) { args->push(argument_oop(j)); } else { args->push(argument(j)); @@ -710,7 +711,7 @@ Metadata* Dependencies::DepStream::argument(int i) { * Returns a unique identifier for each dependency argument. */ uintptr_t Dependencies::DepStream::get_identifier(int i) { - if (has_oop_argument()) { + if (is_oop_argument(i)) { return (uintptr_t)(oopDesc*)argument_oop(i); } else { return (uintptr_t)argument(i); @@ -737,7 +738,7 @@ Klass* Dependencies::DepStream::context_type() { } // Some dependencies are using the klass of the first object - // argument as implicit context type (e.g. call_site_target_value). + // argument as implicit context type. { int ctxkj = dep_implicit_context_arg(type()); if (ctxkj >= 0) { @@ -845,7 +846,13 @@ class ClassHierarchyWalker { assert((uint)n <= (uint)_num_participants, "oob"); Method* fm = _found_methods[n]; assert(n == _num_participants || fm != NULL, "proper usage"); - assert(fm == NULL || fm->method_holder() == _participants[n], "sanity"); + if (fm != NULL && fm->method_holder() != _participants[n]) { + // Default methods from interfaces can be added to classes. In + // that case the holder of the method is not the class but the + // interface where it's defined. + assert(fm->is_default_method(), "sanity"); + return NULL; + } return fm; } @@ -1508,9 +1515,16 @@ Klass* Dependencies::check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepCh return find_finalizable_subclass(search_at); } -Klass* Dependencies::check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes) { - assert(call_site ->is_a(SystemDictionary::CallSite_klass()), "sanity"); - assert(method_handle->is_a(SystemDictionary::MethodHandle_klass()), "sanity"); +Klass* Dependencies::check_call_site_target_value(Klass* recorded_ctxk, oop call_site, oop method_handle, CallSiteDepChange* changes) { + assert(call_site->is_a(SystemDictionary::CallSite_klass()), "sanity"); + assert(!oopDesc::is_null(method_handle), "sanity"); + + Klass* call_site_ctxk = MethodHandles::get_call_site_context(call_site); + assert(!Klass::is_null(call_site_ctxk), "call site context should be initialized already"); + if (recorded_ctxk != call_site_ctxk) { + // Stale context + return recorded_ctxk; + } if (changes == NULL) { // Validate all CallSites if (java_lang_invoke_CallSite::target(call_site) != method_handle) @@ -1525,7 +1539,6 @@ Klass* Dependencies::check_call_site_target_value(oop call_site, oop method_hand return NULL; // assertion still valid } - void Dependencies::DepStream::trace_and_log_witness(Klass* witness) { if (witness != NULL) { if (TraceDependencies) { @@ -1586,7 +1599,7 @@ Klass* Dependencies::DepStream::check_call_site_dependency(CallSiteDepChange* ch Klass* witness = NULL; switch (type()) { case call_site_target_value: - witness = check_call_site_target_value(argument_oop(0), argument_oop(1), changes); + witness = check_call_site_target_value(context_type(), argument_oop(1), argument_oop(2), changes); break; default: witness = NULL; diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index 421ecc767d1..cacc5cac095 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -174,7 +174,7 @@ class Dependencies: public ResourceObj { klass_types = all_types & ~non_klass_types, non_ctxk_types = (1 << evol_method), - implicit_ctxk_types = (1 << call_site_target_value), + implicit_ctxk_types = 0, explicit_ctxk_types = all_types & ~(non_ctxk_types | implicit_ctxk_types), max_arg_count = 3, // current maximum number of arguments (incl. ctxk) @@ -330,7 +330,7 @@ class Dependencies: public ResourceObj { static Klass* check_exclusive_concrete_methods(Klass* ctxk, Method* m1, Method* m2, KlassDepChange* changes = NULL); static Klass* check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepChange* changes = NULL); - static Klass* check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes = NULL); + static Klass* check_call_site_target_value(Klass* recorded_ctxk, oop call_site, oop method_handle, CallSiteDepChange* changes = NULL); // A returned Klass* is NULL if the dependency assertion is still // valid. A non-NULL Klass* is a 'witness' to the assertion // failure, a point in the class hierarchy where the assertion has @@ -496,7 +496,7 @@ class Dependencies: public ResourceObj { bool next(); DepType type() { return _type; } - bool has_oop_argument() { return type() == call_site_target_value; } + bool is_oop_argument(int i) { return type() == call_site_target_value && i > 0; } uintptr_t get_identifier(int i); int argument_count() { return dep_args(type()); } @@ -682,7 +682,7 @@ class CallSiteDepChange : public DepChange { _method_handle(method_handle) { assert(_call_site() ->is_a(SystemDictionary::CallSite_klass()), "must be"); - assert(_method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); + assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); } // What kind of DepChange is this? diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index a8f6ad18940..03868e2d603 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -504,7 +504,7 @@ nmethod* nmethod::new_native_nmethod(methodHandle method, basic_lock_owner_sp_offset, basic_lock_sp_offset, oop_maps); NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); - if (PrintAssembly && nm != NULL) { + if ((PrintAssembly || CompilerOracle::should_print(method)) && nm != NULL) { Disassembler::decode(nm); } } @@ -2325,6 +2325,7 @@ void nmethod::check_all_dependencies(DepChange& changes) { // Dependency checking failed. Print out information about the failed // dependency and finally fail with an assert. We can fail here, since // dependency checking is never done in a product build. + tty->print_cr("Failed dependency:"); changes.print(); nm->print(); nm->print_dependencies(); @@ -2837,11 +2838,21 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) { st.print(")"); return st.as_string(); } + case relocInfo::runtime_call_type: { + stringStream st; + st.print("runtime_call"); + runtime_call_Relocation* r = iter.runtime_call_reloc(); + address dest = r->destination(); + CodeBlob* cb = CodeCache::find_blob(dest); + if (cb != NULL) { + st.print(" %s", cb->name()); + } + return st.as_string(); + } case relocInfo::virtual_call_type: return "virtual_call"; case relocInfo::opt_virtual_call_type: return "optimized virtual_call"; case relocInfo::static_call_type: return "static_call"; case relocInfo::static_stub_type: return "static_stub"; - case relocInfo::runtime_call_type: return "runtime_call"; case relocInfo::external_word_type: return "external_word"; case relocInfo::internal_word_type: return "internal_word"; case relocInfo::section_word_type: return "section_word"; diff --git a/hotspot/src/share/vm/code/pcDesc.cpp b/hotspot/src/share/vm/code/pcDesc.cpp index 7f27cc0c08c..5f7ba80f07c 100644 --- a/hotspot/src/share/vm/code/pcDesc.cpp +++ b/hotspot/src/share/vm/code/pcDesc.cpp @@ -54,12 +54,7 @@ void PcDesc::print(nmethod* code) { for (ScopeDesc* sd = code->scope_desc_at(real_pc(code)); sd != NULL; sd = sd->sender()) { - tty->print(" "); - sd->method()->print_short_name(tty); - tty->print(" @%d", sd->bci()); - if (sd->should_reexecute()) - tty->print(" reexecute=true"); - tty->cr(); + sd->print_on(tty); } #endif } diff --git a/hotspot/src/share/vm/code/scopeDesc.cpp b/hotspot/src/share/vm/code/scopeDesc.cpp index 7e557afcd35..6f19c3ab869 100644 --- a/hotspot/src/share/vm/code/scopeDesc.cpp +++ b/hotspot/src/share/vm/code/scopeDesc.cpp @@ -157,14 +157,18 @@ ScopeDesc* ScopeDesc::sender() const { #ifndef PRODUCT void ScopeDesc::print_value_on(outputStream* st) const { - tty->print(" "); + st->print(" "); method()->print_short_name(st); int lineno = method()->line_number_from_bci(bci()); if (lineno != -1) { - st->print_cr("@%d (line %d)", bci(), lineno); + st->print("@%d (line %d)", bci(), lineno); } else { - st->print_cr("@%d", bci()); + st->print("@%d", bci()); } + if (should_reexecute()) { + st->print(" reexecute=true"); + } + st->cr(); } void ScopeDesc::print_on(outputStream* st) const { @@ -174,7 +178,7 @@ void ScopeDesc::print_on(outputStream* st) const { void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const { // header if (pd != NULL) { - tty->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset()); + st->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset()); } print_value_on(st); @@ -192,7 +196,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const { // locals { GrowableArray* l = ((ScopeDesc*) this)->locals(); if (l != NULL) { - tty->print_cr(" Locals"); + st->print_cr(" Locals"); for (int index = 0; index < l->length(); index++) { st->print(" - l%d: ", index); l->at(index)->print_on(st); @@ -205,7 +209,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const { if (l != NULL) { st->print_cr(" Expression stack"); for (int index = 0; index < l->length(); index++) { - st->print(" - @%d: ", index); + st->print(" - @%d: ", index); l->at(index)->print_on(st); st->cr(); } @@ -225,12 +229,12 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const { #ifdef COMPILER2 if (DoEscapeAnalysis && is_top() && _objects != NULL) { - tty->print_cr("Objects"); + st->print_cr(" Objects"); for (int i = 0; i < _objects->length(); i++) { ObjectValue* sv = (ObjectValue*) _objects->at(i); - tty->print(" - %d: ", sv->id()); - sv->print_fields_on(tty); - tty->cr(); + st->print(" - %d: ", sv->id()); + sv->print_fields_on(st); + st->cr(); } } #endif // COMPILER2 diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index b35d3766d5f..d7cb49bae0d 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -172,7 +172,8 @@ class CompilerCounters : public CHeapObj { // these methods should be called in a thread safe context void set_current_method(const char* method) { - strncpy(_current_method, method, (size_t)cmname_buffer_length); + strncpy(_current_method, method, (size_t)cmname_buffer_length-1); + _current_method[cmname_buffer_length-1] = '\0'; if (UsePerfData) _perf_current_method->set_value(method); } diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 8299da22f0f..21586cdc998 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -673,9 +673,7 @@ static MethodMatcher* scan_flag_and_value(const char* type, const char* line, in // so read integer and fraction part of double value separately. if (sscanf(line, "%*[ \t]%255[0-9]%*[ /\t]%255[0-9]%n", buffer[0], buffer[1], &bytes_read) == 2) { char value[512] = ""; - strncat(value, buffer[0], 255); - strcat(value, "."); - strncat(value, buffer[1], 255); + jio_snprintf(value, sizeof(value), "%s.%s", buffer[0], buffer[1]); total_bytes_read += bytes_read; return add_option_string(c_name, c_match, m_name, m_match, signature, flag, atof(value)); } else { diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 46cd7fb1f25..fc8758a3b00 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -300,6 +300,7 @@ address decode_env::handle_event(const char* event, address arg) { strlen((const char*)arg) > sizeof(buffer) - 1) { // Only print this when the mach changes strncpy(buffer, (const char*)arg, sizeof(buffer) - 1); + buffer[sizeof(buffer) - 1] = '\0'; output()->print_cr("[Disassembling for mach='%s']", arg); } } else if (match(event, "format bytes-per-line")) { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp index bb2cb5a639f..47b90ff5a40 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/adaptiveFreeList.cpp @@ -25,8 +25,8 @@ #include "precompiled.hpp" #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp" #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/freeBlockDictionary.hpp" -#include "memory/sharedHeap.hpp" #include "runtime/globals.hpp" #include "runtime/mutex.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.cpp new file mode 100644 index 00000000000..7cacb77aaf1 --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsOopClosures.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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/concurrentMarkSweep/cmsOopClosures.inline.hpp" +#include "memory/iterator.inline.hpp" +#include "memory/specialized_oop_closures.hpp" + +// Generate CMS specialized oop_oop_iterate functions. +SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index a64ca88cd7b..a0df138f804 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -32,6 +32,7 @@ #include "gc_interface/collectedHeap.inline.hpp" #include "memory/allocation.inline.hpp" #include "memory/blockOffsetTable.inline.hpp" +#include "memory/genCollectedHeap.hpp" #include "memory/resourceArea.hpp" #include "memory/space.inline.hpp" #include "memory/universe.inline.hpp" @@ -673,10 +674,10 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, HeapWord* bottom, \ HeapWord* top, \ ClosureType* cl) { \ - bool is_par = SharedHeap::heap()->n_par_threads() > 0; \ + bool is_par = GenCollectedHeap::heap()->n_par_threads() > 0; \ if (is_par) { \ - assert(SharedHeap::heap()->n_par_threads() == \ - SharedHeap::heap()->workers()->active_workers(), "Mismatch"); \ + assert(GenCollectedHeap::heap()->n_par_threads() == \ + GenCollectedHeap::heap()->workers()->active_workers(), "Mismatch"); \ walk_mem_region_with_cl_par(mr, bottom, top, cl); \ } else { \ walk_mem_region_with_cl_nopar(mr, bottom, top, cl); \ @@ -1907,11 +1908,11 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk, assert(chunk->is_free() && ffc->is_free(), "Error"); _bt.split_block((HeapWord*)chunk, chunk->size(), new_size); if (rem_sz < SmallForDictionary) { - bool is_par = (SharedHeap::heap()->n_par_threads() > 0); + bool is_par = (GenCollectedHeap::heap()->n_par_threads() > 0); if (is_par) _indexedFreeListParLocks[rem_sz]->lock(); assert(!is_par || - (SharedHeap::heap()->n_par_threads() == - SharedHeap::heap()->workers()->active_workers()), "Mismatch"); + (GenCollectedHeap::heap()->n_par_threads() == + GenCollectedHeap::heap()->workers()->active_workers()), "Mismatch"); returnChunkToFreeList(ffc); split(size, rem_sz); if (is_par) _indexedFreeListParLocks[rem_sz]->unlock(); @@ -1982,7 +1983,7 @@ void CompactibleFreeListSpace::save_marks() { bool CompactibleFreeListSpace::no_allocs_since_save_marks() { assert(_promoInfo.tracking(), "No preceding save_marks?"); - assert(SharedHeap::heap()->n_par_threads() == 0, + assert(GenCollectedHeap::heap()->n_par_threads() == 0, "Shouldn't be called if using parallel gc."); return _promoInfo.noPromotions(); } @@ -1991,7 +1992,7 @@ bool CompactibleFreeListSpace::no_allocs_since_save_marks() { \ void CompactibleFreeListSpace:: \ oop_since_save_marks_iterate##nv_suffix(OopClosureType* blk) { \ - assert(SharedHeap::heap()->n_par_threads() == 0, \ + assert(GenCollectedHeap::heap()->n_par_threads() == 0, \ "Shouldn't be called (yet) during parallel part of gc."); \ _promoInfo.promoted_oops_iterate##nv_suffix(blk); \ /* \ @@ -2442,11 +2443,10 @@ void CompactibleFreeListSpace::verify() const { { VerifyAllOopsClosure cl(_collector, this, span, past_remark, _collector->markBitMap()); - CollectedHeap* ch = Universe::heap(); // Iterate over all oops in the heap. Uses the _no_header version // since we are not interested in following the klass pointers. - ch->oop_iterate_no_header(&cl); + GenCollectedHeap::heap()->oop_iterate_no_header(&cl); } if (VerifyObjectStartArray) { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp index 4c6fb3c5b1b..72b0e9e8564 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @@ -28,7 +28,7 @@ #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp" #include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" #include "memory/binaryTreeDictionary.hpp" -#include "memory/blockOffsetTable.inline.hpp" +#include "memory/blockOffsetTable.hpp" #include "memory/freeList.hpp" #include "memory/space.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 037abd9ffa6..6729f0b23c2 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -53,6 +53,7 @@ #include "memory/padded.hpp" #include "memory/referencePolicy.hpp" #include "memory/resourceArea.hpp" +#include "memory/strongRootsScope.hpp" #include "memory/tenuredGeneration.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" @@ -64,6 +65,7 @@ #include "runtime/vmThread.hpp" #include "services/memoryService.hpp" #include "services/runtimeService.hpp" +#include "utilities/stack.inline.hpp" // statics CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; @@ -208,10 +210,6 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration( use_adaptive_freelists, dictionaryChoice); NOT_PRODUCT(debug_cms_space = _cmsSpace;) - if (_cmsSpace == NULL) { - vm_exit_during_initialization( - "CompactibleFreeListSpace allocation failure"); - } _cmsSpace->_gen = this; _gc_stats = new CMSGCStats(); @@ -230,14 +228,8 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration( typedef CMSParGCThreadState* CMSParGCThreadStatePtr; _par_gc_thread_states = NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads, mtGC); - if (_par_gc_thread_states == NULL) { - vm_exit_during_initialization("Could not allocate par gc structs"); - } for (uint i = 0; i < ParallelGCThreads; i++) { _par_gc_thread_states[i] = new CMSParGCThreadState(cmsSpace()); - if (_par_gc_thread_states[i] == NULL) { - vm_exit_during_initialization("Could not allocate par gc structs"); - } } } else { _par_gc_thread_states = NULL; @@ -308,8 +300,6 @@ void CMSCollector::ref_processor_init() { AdaptiveSizePolicy* CMSCollector::size_policy() { GenCollectedHeap* gch = GenCollectedHeap::heap(); - assert(gch->kind() == CollectedHeap::GenCollectedHeap, - "Wrong type of heap"); return gch->gen_policy()->size_policy(); } @@ -586,11 +576,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, return; } _hash_seed = NEW_C_HEAP_ARRAY(int, num_queues, mtGC); - if (_hash_seed == NULL) { - warning("_hash_seed array allocation failure"); - return; - } - typedef Padded PaddedOopTaskQueue; for (i = 0; i < num_queues; i++) { PaddedOopTaskQueue *q = new PaddedOopTaskQueue(); @@ -633,12 +618,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, _eden_chunk_index = 0; _eden_chunk_capacity = (_young_gen->max_capacity()+CMSSamplingGrain)/CMSSamplingGrain; _eden_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, _eden_chunk_capacity, mtGC); - if (_eden_chunk_array == NULL) { - _eden_chunk_capacity = 0; - warning("GC/CMS: _eden_chunk_array allocation failure"); - } } - assert(_eden_chunk_array != NULL || _eden_chunk_capacity == 0, "Error"); // Support for parallelizing survivor space rescan if ((CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) || CMSParallelInitialMarkEnabled) { @@ -648,52 +628,15 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC); _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC); _cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads, mtGC); - if (_survivor_plab_array == NULL || _survivor_chunk_array == NULL - || _cursor == NULL) { - warning("Failed to allocate survivor plab/chunk array"); - if (_survivor_plab_array != NULL) { - FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array); - _survivor_plab_array = NULL; - } - if (_survivor_chunk_array != NULL) { - FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array); - _survivor_chunk_array = NULL; - } - if (_cursor != NULL) { - FREE_C_HEAP_ARRAY(size_t, _cursor); - _cursor = NULL; - } - } else { - _survivor_chunk_capacity = 2*max_plab_samples; - for (uint i = 0; i < ParallelGCThreads; i++) { - HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC); - if (vec == NULL) { - warning("Failed to allocate survivor plab array"); - for (int j = i; j > 0; j--) { - FREE_C_HEAP_ARRAY(HeapWord*, _survivor_plab_array[j-1].array()); - } - FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array); - FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array); - _survivor_plab_array = NULL; - _survivor_chunk_array = NULL; - _survivor_chunk_capacity = 0; - break; - } else { - ChunkArray* cur = - ::new (&_survivor_plab_array[i]) ChunkArray(vec, - max_plab_samples); - assert(cur->end() == 0, "Should be 0"); - assert(cur->array() == vec, "Should be vec"); - assert(cur->capacity() == max_plab_samples, "Error"); - } - } + _survivor_chunk_capacity = 2*max_plab_samples; + for (uint i = 0; i < ParallelGCThreads; i++) { + HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC); + ChunkArray* cur = ::new (&_survivor_plab_array[i]) ChunkArray(vec, max_plab_samples); + assert(cur->end() == 0, "Should be 0"); + assert(cur->array() == vec, "Should be vec"); + assert(cur->capacity() == max_plab_samples, "Error"); } } - assert( ( _survivor_plab_array != NULL - && _survivor_chunk_array != NULL) - || ( _survivor_chunk_capacity == 0 - && _survivor_chunk_index == 0), - "Error"); NOT_PRODUCT(_overflow_counter = CMSMarkStackOverflowInterval;) _gc_counters = new CollectorCounters("CMS", 1); @@ -1037,7 +980,7 @@ oop ConcurrentMarkSweepGeneration::promote(oop obj, size_t obj_size) { assert_lock_strong(freelistLock()); #ifndef PRODUCT - if (Universe::heap()->promotion_should_fail()) { + if (GenCollectedHeap::heap()->promotion_should_fail()) { return NULL; } #endif // #ifndef PRODUCT @@ -1114,7 +1057,7 @@ ConcurrentMarkSweepGeneration::par_promote(int thread_num, oop old, markOop m, size_t word_sz) { #ifndef PRODUCT - if (Universe::heap()->promotion_should_fail()) { + if (GenCollectedHeap::heap()->promotion_should_fail()) { return NULL; } #endif // #ifndef PRODUCT @@ -2524,7 +2467,7 @@ void CMSCollector::verify_after_remark_work_1() { verification_mark_bm()->iterate(&vcl); if (vcl.failed()) { gclog_or_tty->print("Verification failed"); - Universe::heap()->print_on(gclog_or_tty); + gch->print_on(gclog_or_tty); fatal("CMS: failed marking verification after remark"); } } @@ -3071,10 +3014,10 @@ void CMSCollector::checkpointRootsInitialWork() { gch->set_par_threads(n_workers); initialize_sequential_subtasks_for_young_gen_rescan(n_workers); if (n_workers > 1) { - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; workers->run_task(&tsk); } else { - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; tsk.work(0); } gch->set_par_threads(0); @@ -5169,11 +5112,11 @@ void CMSCollector::do_remark_parallel() { // necessarily be so, since it's possible that we are doing // ST marking. ReferenceProcessorMTDiscoveryMutator mt(ref_processor(), true); - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; workers->run_task(&tsk); } else { ReferenceProcessorMTDiscoveryMutator mt(ref_processor(), false); - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; tsk.work(0); } @@ -5241,7 +5184,7 @@ void CMSCollector::do_remark_non_parallel() { verify_work_stacks_empty(); gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel. - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; gch->gen_process_roots(_cmsGen->level(), true, // younger gens as roots diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp index c316db870e3..ab8be960f74 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp @@ -35,11 +35,11 @@ #include "memory/freeBlockDictionary.hpp" #include "memory/iterator.hpp" #include "memory/space.hpp" +#include "memory/virtualspace.hpp" #include "runtime/mutexLocker.hpp" -#include "runtime/virtualspace.hpp" #include "services/memoryService.hpp" -#include "utilities/bitMap.inline.hpp" -#include "utilities/stack.inline.hpp" +#include "utilities/bitMap.hpp" +#include "utilities/stack.hpp" #include "utilities/taskqueue.hpp" #include "utilities/yieldingWorkgroup.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp index f3e40f61d48..2c41ffeba7f 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp @@ -27,7 +27,7 @@ #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" #include "gc_implementation/shared/concurrentGCThread.hpp" -#include "runtime/thread.inline.hpp" +#include "runtime/thread.hpp" class ConcurrentMarkSweepGeneration; class CMSCollector; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp index dfddda7cf2f..5c1d2650a19 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "memory/genOopClosures.hpp" #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" #include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" #include "oops/markOop.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp index 39d86cd475a..423c21ca1ff 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ void VM_CMS_Operation::verify_before_gc() { HandleMark hm; FreelistLocker x(_collector); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); - Universe::heap()->prepare_for_verify(); + GenCollectedHeap::heap()->prepare_for_verify(); Universe::verify(); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 60ae0b4cd91..efae52e60b2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -34,6 +34,7 @@ #include "gc_implementation/g1/g1Log.hpp" #include "gc_implementation/g1/g1OopClosures.inline.hpp" #include "gc_implementation/g1/g1RemSet.hpp" +#include "gc_implementation/g1/g1StringDedup.hpp" #include "gc_implementation/g1/heapRegion.inline.hpp" #include "gc_implementation/g1/heapRegionManager.inline.hpp" #include "gc_implementation/g1/heapRegionRemSet.hpp" @@ -46,6 +47,7 @@ #include "memory/genOopClosures.inline.hpp" #include "memory/referencePolicy.hpp" #include "memory/resourceArea.hpp" +#include "memory/strongRootsScope.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" @@ -115,7 +117,7 @@ void CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const { } size_t CMBitMap::compute_size(size_t heap_size) { - return heap_size / mark_distance(); + return ReservedSpace::allocation_align_size_up(heap_size / mark_distance()); } size_t CMBitMap::mark_distance() { @@ -941,13 +943,6 @@ void ConcurrentMark::checkpointRootsInitialPre() { _has_aborted = false; -#ifndef PRODUCT - if (G1PrintReachableAtInitialMark) { - print_reachable("at-cycle-start", - VerifyOption_G1UsePrevMarking, true /* all */); - } -#endif - // Initialize marking structures. This has to be done in a STW phase. reset(); @@ -1325,7 +1320,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, " VerifyDuringGC:(before)"); } @@ -1352,7 +1347,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { // Verify the heap w.r.t. the previous marking bitmap. if (VerifyDuringGC) { HandleMark hm; // handle scope - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, " VerifyDuringGC:(overflow)"); } @@ -1378,7 +1373,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UseNextMarking, " VerifyDuringGC:(after)"); } @@ -1986,13 +1981,13 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, " VerifyDuringGC:(before)"); } g1h->check_bitmaps("Cleanup Start"); - G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy(); + G1CollectorPolicy* g1p = g1h->g1_policy(); g1p->record_concurrent_mark_cleanup_start(); double start = os::elapsedTime(); @@ -2097,7 +2092,7 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, " VerifyDuringGC:(after)"); } @@ -2650,7 +2645,7 @@ void ConcurrentMark::checkpointRootsFinalWork() { g1h->ensure_parsability(false); - G1CollectedHeap::StrongRootsScope srs(g1h); + StrongRootsScope srs; // this is remark, so we'll use up all active threads uint active_workers = g1h->workers()->active_workers(); if (active_workers == 0) { @@ -2682,166 +2677,6 @@ void ConcurrentMark::checkpointRootsFinalWork() { print_stats(); } -#ifndef PRODUCT - -class PrintReachableOopClosure: public OopClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - -public: - PrintReachableOopClosure(outputStream* out, - VerifyOption vo, - bool all) : - _g1h(G1CollectedHeap::heap()), - _out(out), _vo(vo), _all(all) { } - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop( oop* p) { do_oop_work(p); } - - template void do_oop_work(T* p) { - oop obj = oopDesc::load_decode_heap_oop(p); - const char* str = NULL; - const char* str2 = ""; - - if (obj == NULL) { - str = ""; - } else if (!_g1h->is_in_g1_reserved(obj)) { - str = " O"; - } else { - HeapRegion* hr = _g1h->heap_region_containing(obj); - bool over_tams = _g1h->allocated_since_marking(obj, hr, _vo); - bool marked = _g1h->is_marked(obj, _vo); - - if (over_tams) { - str = " >"; - if (marked) { - str2 = " AND MARKED"; - } - } else if (marked) { - str = " M"; - } else { - str = " NOT"; - } - } - - _out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s", - p2i(p), p2i((void*) obj), str, str2); - } -}; - -class PrintReachableObjectClosure : public ObjectClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - HeapRegion* _hr; - -public: - PrintReachableObjectClosure(outputStream* out, - VerifyOption vo, - bool all, - HeapRegion* hr) : - _g1h(G1CollectedHeap::heap()), - _out(out), _vo(vo), _all(all), _hr(hr) { } - - void do_object(oop o) { - bool over_tams = _g1h->allocated_since_marking(o, _hr, _vo); - bool marked = _g1h->is_marked(o, _vo); - bool print_it = _all || over_tams || marked; - - if (print_it) { - _out->print_cr(" "PTR_FORMAT"%s", - p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : ""); - PrintReachableOopClosure oopCl(_out, _vo, _all); - o->oop_iterate_no_header(&oopCl); - } - } -}; - -class PrintReachableRegionClosure : public HeapRegionClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - -public: - bool doHeapRegion(HeapRegion* hr) { - HeapWord* b = hr->bottom(); - HeapWord* e = hr->end(); - HeapWord* t = hr->top(); - HeapWord* p = _g1h->top_at_mark_start(hr, _vo); - _out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" " - "TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p)); - _out->cr(); - - HeapWord* from = b; - HeapWord* to = t; - - if (to > from) { - _out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to)); - _out->cr(); - PrintReachableObjectClosure ocl(_out, _vo, _all, hr); - hr->object_iterate_mem_careful(MemRegion(from, to), &ocl); - _out->cr(); - } - - return false; - } - - PrintReachableRegionClosure(outputStream* out, - VerifyOption vo, - bool all) : - _g1h(G1CollectedHeap::heap()), _out(out), _vo(vo), _all(all) { } -}; - -void ConcurrentMark::print_reachable(const char* str, - VerifyOption vo, - bool all) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("== Doing heap dump... "); - - if (G1PrintReachableBaseFile == NULL) { - gclog_or_tty->print_cr(" #### error: no base file defined"); - return; - } - - if (strlen(G1PrintReachableBaseFile) + 1 + strlen(str) > - (JVM_MAXPATHLEN - 1)) { - gclog_or_tty->print_cr(" #### error: file name too long"); - return; - } - - char file_name[JVM_MAXPATHLEN]; - sprintf(file_name, "%s.%s", G1PrintReachableBaseFile, str); - gclog_or_tty->print_cr(" dumping to file %s", file_name); - - fileStream fout(file_name); - if (!fout.is_open()) { - gclog_or_tty->print_cr(" #### error: could not open file"); - return; - } - - outputStream* out = &fout; - out->print_cr("-- USING %s", _g1h->top_at_mark_start_str(vo)); - out->cr(); - - out->print_cr("--- ITERATING OVER REGIONS"); - out->cr(); - PrintReachableRegionClosure rcl(out, vo, all); - _g1h->heap_region_iterate(&rcl); - out->cr(); - - gclog_or_tty->print_cr(" done"); - gclog_or_tty->flush(); -} - -#endif // PRODUCT - void ConcurrentMark::clearRangePrevBitmap(MemRegion mr) { // Note we are overriding the read-only view of the prev map here, via // the cast. @@ -2958,9 +2793,7 @@ ConcurrentMark::claim_region(uint worker_id) { #ifndef PRODUCT enum VerifyNoCSetOopsPhase { VerifyNoCSetOopsStack, - VerifyNoCSetOopsQueues, - VerifyNoCSetOopsSATBCompleted, - VerifyNoCSetOopsSATBThread + VerifyNoCSetOopsQueues }; class VerifyNoCSetOopsClosure : public OopClosure, public ObjectClosure { @@ -2973,8 +2806,6 @@ private: switch (_phase) { case VerifyNoCSetOopsStack: return "Stack"; case VerifyNoCSetOopsQueues: return "Queue"; - case VerifyNoCSetOopsSATBCompleted: return "Completed SATB Buffers"; - case VerifyNoCSetOopsSATBThread: return "Thread SATB Buffers"; default: ShouldNotReachHere(); } return NULL; @@ -3001,7 +2832,7 @@ public: virtual void do_oop(narrowOop* p) { // We should not come across narrow oops while scanning marking - // stacks and SATB buffers. + // stacks ShouldNotReachHere(); } @@ -3010,10 +2841,7 @@ public: } }; -void ConcurrentMark::verify_no_cset_oops(bool verify_stacks, - bool verify_enqueued_buffers, - bool verify_thread_buffers, - bool verify_fingers) { +void ConcurrentMark::verify_no_cset_oops() { assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint"); if (!G1CollectedHeap::heap()->mark_in_progress()) { return; @@ -3021,65 +2849,47 @@ void ConcurrentMark::verify_no_cset_oops(bool verify_stacks, VerifyNoCSetOopsClosure cl; - if (verify_stacks) { - // Verify entries on the global mark stack - cl.set_phase(VerifyNoCSetOopsStack); - _markStack.oops_do(&cl); + // Verify entries on the global mark stack + cl.set_phase(VerifyNoCSetOopsStack); + _markStack.oops_do(&cl); - // Verify entries on the task queues - for (uint i = 0; i < _max_worker_id; i += 1) { - cl.set_phase(VerifyNoCSetOopsQueues, i); - CMTaskQueue* queue = _task_queues->queue(i); - queue->oops_do(&cl); - } + // Verify entries on the task queues + for (uint i = 0; i < _max_worker_id; i += 1) { + cl.set_phase(VerifyNoCSetOopsQueues, i); + CMTaskQueue* queue = _task_queues->queue(i); + queue->oops_do(&cl); } - SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set(); - - // Verify entries on the enqueued SATB buffers - if (verify_enqueued_buffers) { - cl.set_phase(VerifyNoCSetOopsSATBCompleted); - satb_qs.iterate_completed_buffers_read_only(&cl); + // Verify the global finger + HeapWord* global_finger = finger(); + if (global_finger != NULL && global_finger < _heap_end) { + // The global finger always points to a heap region boundary. We + // use heap_region_containing_raw() to get the containing region + // given that the global finger could be pointing to a free region + // which subsequently becomes continues humongous. If that + // happens, heap_region_containing() will return the bottom of the + // corresponding starts humongous region and the check below will + // not hold any more. + // Since we always iterate over all regions, we might get a NULL HeapRegion + // here. + HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger); + guarantee(global_hr == NULL || global_finger == global_hr->bottom(), + err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT, + p2i(global_finger), HR_FORMAT_PARAMS(global_hr))); } - // Verify entries on the per-thread SATB buffers - if (verify_thread_buffers) { - cl.set_phase(VerifyNoCSetOopsSATBThread); - satb_qs.iterate_thread_buffers_read_only(&cl); - } - - if (verify_fingers) { - // Verify the global finger - HeapWord* global_finger = finger(); - if (global_finger != NULL && global_finger < _heap_end) { - // The global finger always points to a heap region boundary. We - // use heap_region_containing_raw() to get the containing region - // given that the global finger could be pointing to a free region - // which subsequently becomes continues humongous. If that - // happens, heap_region_containing() will return the bottom of the - // corresponding starts humongous region and the check below will - // not hold any more. - // Since we always iterate over all regions, we might get a NULL HeapRegion - // here. - HeapRegion* global_hr = _g1h->heap_region_containing_raw(global_finger); - guarantee(global_hr == NULL || global_finger == global_hr->bottom(), - err_msg("global finger: "PTR_FORMAT" region: "HR_FORMAT, - p2i(global_finger), HR_FORMAT_PARAMS(global_hr))); - } - - // Verify the task fingers - assert(parallel_marking_threads() <= _max_worker_id, "sanity"); - for (int i = 0; i < (int) parallel_marking_threads(); i += 1) { - CMTask* task = _tasks[i]; - HeapWord* task_finger = task->finger(); - if (task_finger != NULL && task_finger < _heap_end) { - // See above note on the global finger verification. - HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger); - guarantee(task_hr == NULL || task_finger == task_hr->bottom() || - !task_hr->in_collection_set(), - err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT, - p2i(task_finger), HR_FORMAT_PARAMS(task_hr))); - } + // Verify the task fingers + assert(parallel_marking_threads() <= _max_worker_id, "sanity"); + for (int i = 0; i < (int) parallel_marking_threads(); i += 1) { + CMTask* task = _tasks[i]; + HeapWord* task_finger = task->finger(); + if (task_finger != NULL && task_finger < _heap_end) { + // See above note on the global finger verification. + HeapRegion* task_hr = _g1h->heap_region_containing_raw(task_finger); + guarantee(task_hr == NULL || task_finger == task_hr->bottom() || + !task_hr->in_collection_set(), + err_msg("task finger: "PTR_FORMAT" region: "HR_FORMAT, + p2i(task_finger), HR_FORMAT_PARAMS(task_hr))); } } } @@ -3392,22 +3202,29 @@ void ConcurrentMark::print_finger() { } #endif -void CMTask::scan_object(oop obj) { +template +inline void CMTask::process_grey_object(oop obj) { + assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray"); assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant"); if (_cm->verbose_high()) { - gclog_or_tty->print_cr("[%u] we're scanning object "PTR_FORMAT, + gclog_or_tty->print_cr("[%u] processing grey object " PTR_FORMAT, _worker_id, p2i((void*) obj)); } size_t obj_size = obj->size(); _words_scanned += obj_size; - obj->oop_iterate(_cm_oop_closure); + if (scan) { + obj->oop_iterate(_cm_oop_closure); + } statsOnly( ++_objs_scanned ); check_limits(); } +template void CMTask::process_grey_object(oop); +template void CMTask::process_grey_object(oop); + // Closure for iteration over bitmaps class CMBitMapClosure : public BitMapClosure { private: @@ -3878,12 +3695,11 @@ void CMTask::drain_satb_buffers() { CMObjectClosure oc(this); SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); - satb_mq_set.set_closure(_worker_id, &oc); // This keeps claiming and applying the closure to completed buffers // until we run out of buffers or we need to abort. while (!has_aborted() && - satb_mq_set.apply_closure_to_completed_buffer(_worker_id)) { + satb_mq_set.apply_closure_to_completed_buffer(&oc)) { if (_cm->verbose_medium()) { gclog_or_tty->print_cr("[%u] processed an SATB buffer", _worker_id); } @@ -3897,8 +3713,6 @@ void CMTask::drain_satb_buffers() { concurrent() || satb_mq_set.completed_buffers_num() == 0, "invariant"); - satb_mq_set.set_closure(_worker_id, NULL); - // again, this was a potentially expensive operation, decrease the // limits to get the regular clock call early decrease_limits(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp index be9773b7991..3702273c959 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -785,14 +785,9 @@ public: } // Verify that there are no CSet oops on the stacks (taskqueues / - // global mark stack), enqueued SATB buffers, per-thread SATB - // buffers, and fingers (global / per-task). The boolean parameters - // decide which of the above data structures to verify. If marking - // is not in progress, it's a no-op. - void verify_no_cset_oops(bool verify_stacks, - bool verify_enqueued_buffers, - bool verify_thread_buffers, - bool verify_fingers) PRODUCT_RETURN; + // global mark stack) and fingers (global / per-task). + // If marking is not in progress, it's a no-op. + void verify_no_cset_oops() PRODUCT_RETURN; bool isPrevMarked(oop p) const { assert(p != NULL && p->is_oop(), "expected an oop"); @@ -1100,6 +1095,12 @@ private: void regular_clock_call(); bool concurrent() { return _concurrent; } + // Test whether objAddr might have already been passed over by the + // mark bitmap scan, and so needs to be pushed onto the mark stack. + bool is_below_finger(HeapWord* objAddr, HeapWord* global_finger) const; + + template void process_grey_object(oop obj); + public: // It resets the task; it should be called right at the beginning of // a marking phase. @@ -1152,7 +1153,7 @@ public: inline void deal_with_reference(oop obj); // It scans an object and visits its children. - void scan_object(oop obj); + void scan_object(oop obj) { process_grey_object(obj); } // It pushes an object on the local queue. inline void push(oop obj); 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 0b32d13a167..a96c2dc584a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp @@ -259,14 +259,35 @@ inline void CMTask::push(oop obj) { ++_local_pushes ); } -// This determines whether the method below will check both the local -// and global fingers when determining whether to push on the stack a -// gray object (value 1) or whether it will only check the global one -// (value 0). The tradeoffs are that the former will be a bit more -// accurate and possibly push less on the stack, but it might also be -// a little bit slower. +inline bool CMTask::is_below_finger(HeapWord* objAddr, + HeapWord* global_finger) const { + // If objAddr is above the global finger, then the mark bitmap scan + // will find it later, and no push is needed. Similarly, if we have + // a current region and objAddr is between the local finger and the + // end of the current region, then no push is needed. The tradeoff + // of checking both vs only checking the global finger is that the + // local check will be more accurate and so result in fewer pushes, + // but may also be a little slower. + if (_finger != NULL) { + // We have a current region. -#define _CHECK_BOTH_FINGERS_ 1 + // Finger and region values are all NULL or all non-NULL. We + // use _finger to check since we immediately use its value. + assert(_curr_region != NULL, "invariant"); + assert(_region_limit != NULL, "invariant"); + assert(_region_limit <= global_finger, "invariant"); + + // True if objAddr is less than the local finger, or is between + // the region limit and the global finger. + if (objAddr < _finger) { + return true; + } else if (objAddr < _region_limit) { + return false; + } // Else check global finger. + } + // Check global finger. + return objAddr < global_finger; +} inline void CMTask::deal_with_reference(oop obj) { if (_cm->verbose_high()) { @@ -297,50 +318,43 @@ inline void CMTask::deal_with_reference(oop obj) { // CAS done in CMBitMap::parMark() call in the routine above. HeapWord* global_finger = _cm->finger(); -#if _CHECK_BOTH_FINGERS_ - // we will check both the local and global fingers - - if (_finger != NULL && objAddr < _finger) { - if (_cm->verbose_high()) { - gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), " - "pushing it", _worker_id, p2i(_finger)); + // We only need to push a newly grey object on the mark + // stack if it is in a section of memory the mark bitmap + // scan has already examined. Mark bitmap scanning + // maintains progress "fingers" for determining that. + // + // Notice that the global finger might be moving forward + // concurrently. This is not a problem. In the worst case, we + // mark the object while it is above the global finger and, by + // the time we read the global finger, it has moved forward + // past this object. In this case, the object will probably + // be visited when a task is scanning the region and will also + // be pushed on the stack. So, some duplicate work, but no + // correctness problems. + if (is_below_finger(objAddr, global_finger)) { + if (obj->is_typeArray()) { + // Immediately process arrays of primitive types, rather + // than pushing on the mark stack. This keeps us from + // adding humongous objects to the mark stack that might + // be reclaimed before the entry is processed - see + // selection of candidates for eager reclaim of humongous + // objects. The cost of the additional type test is + // mitigated by avoiding a trip through the mark stack, + // by only doing a bookkeeping update and avoiding the + // actual scan of the object - a typeArray contains no + // references, and the metadata is built-in. + process_grey_object(obj); + } else { + if (_cm->verbose_high()) { + gclog_or_tty->print_cr("[%u] below a finger (local: " PTR_FORMAT + ", global: " PTR_FORMAT ") pushing " + PTR_FORMAT " on mark stack", + _worker_id, p2i(_finger), + p2i(global_finger), p2i(objAddr)); + } + push(obj); } - push(obj); - } else if (_curr_region != NULL && objAddr < _region_limit) { - // do nothing - } else if (objAddr < global_finger) { - // Notice that the global finger might be moving forward - // concurrently. This is not a problem. In the worst case, we - // mark the object while it is above the global finger and, by - // the time we read the global finger, it has moved forward - // passed this object. In this case, the object will probably - // be visited when a task is scanning the region and will also - // be pushed on the stack. So, some duplicate work, but no - // correctness problems. - - if (_cm->verbose_high()) { - gclog_or_tty->print_cr("[%u] below the global finger " - "("PTR_FORMAT"), pushing it", - _worker_id, p2i(global_finger)); - } - push(obj); - } else { - // do nothing } -#else // _CHECK_BOTH_FINGERS_ - // we will only check the global finger - - if (objAddr < global_finger) { - // see long comment above - - if (_cm->verbose_high()) { - gclog_or_tty->print_cr("[%u] below the global finger " - "("PTR_FORMAT"), pushing it", - _worker_id, p2i(global_finger)); - } - push(obj); - } -#endif // _CHECK_BOTH_FINGERS_ } } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp index 4e199a6c28e..d4f2f190690 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.cpp @@ -110,15 +110,15 @@ void G1DefaultAllocator::abandon_gc_alloc_regions() { _retained_old_gc_alloc_region = NULL; } -G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) : - ParGCAllocBuffer(gclab_word_size), _retired(true) { } +G1PLAB::G1PLAB(size_t gclab_word_size) : + PLAB(gclab_word_size), _retired(true) { } HeapWord* G1ParGCAllocator::allocate_direct_or_new_plab(InCSetState dest, size_t word_sz, AllocationContext_t context) { size_t gclab_word_size = _g1h->desired_plab_sz(dest); if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) { - G1ParGCAllocBuffer* alloc_buf = alloc_buffer(dest, context); + G1PLAB* alloc_buf = alloc_buffer(dest, context); add_to_alloc_buffer_waste(alloc_buf->words_remaining()); alloc_buf->retire(); @@ -151,7 +151,7 @@ G1DefaultParGCAllocator::G1DefaultParGCAllocator(G1CollectedHeap* g1h) : void G1DefaultParGCAllocator::retire_alloc_buffers() { for (uint state = 0; state < InCSetState::Num; state++) { - G1ParGCAllocBuffer* const buf = _alloc_buffers[state]; + G1PLAB* const buf = _alloc_buffers[state]; if (buf != NULL) { add_to_alloc_buffer_waste(buf->words_remaining()); buf->flush_and_retire_stats(_g1h->alloc_buffer_stats(state)); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp index f14b1df4d8c..78741e33a1e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1Allocator.hpp @@ -28,7 +28,10 @@ #include "gc_implementation/g1/g1AllocationContext.hpp" #include "gc_implementation/g1/g1AllocRegion.hpp" #include "gc_implementation/g1/g1InCSetState.hpp" -#include "gc_implementation/shared/parGCAllocBuffer.hpp" +#include "gc_implementation/shared/plab.hpp" +#include "gc_interface/collectedHeap.hpp" + +class EvacuationInfo; // Base class for G1 allocators. class G1Allocator : public CHeapObj { @@ -144,18 +147,18 @@ public: } }; -class G1ParGCAllocBuffer: public ParGCAllocBuffer { +class G1PLAB: public PLAB { private: bool _retired; public: - G1ParGCAllocBuffer(size_t gclab_word_size); - virtual ~G1ParGCAllocBuffer() { + G1PLAB(size_t gclab_word_size); + virtual ~G1PLAB() { guarantee(_retired, "Allocation buffer has not been retired"); } virtual void set_buf(HeapWord* buf) { - ParGCAllocBuffer::set_buf(buf); + PLAB::set_buf(buf); _retired = false; } @@ -163,7 +166,12 @@ public: if (_retired) { return; } - ParGCAllocBuffer::retire(); + PLAB::retire(); + _retired = true; + } + + virtual void flush_and_retire_stats(PLABStats* stats) { + PLAB::flush_and_retire_stats(stats); _retired = true; } }; @@ -187,7 +195,7 @@ protected: void add_to_undo_waste(size_t waste) { _undo_waste += waste; } virtual void retire_alloc_buffers() = 0; - virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0; + virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) = 0; // Calculate the survivor space object alignment in bytes. Returns that or 0 if // there are no restrictions on survivor alignment. @@ -208,6 +216,7 @@ public: _g1h(g1h), _survivor_alignment_bytes(calc_survivor_alignment_bytes()), _alloc_buffer_waste(0), _undo_waste(0) { } + virtual ~G1ParGCAllocator() { } static G1ParGCAllocator* create_allocator(G1CollectedHeap* g1h); @@ -226,7 +235,7 @@ public: HeapWord* plab_allocate(InCSetState dest, size_t word_sz, AllocationContext_t context) { - G1ParGCAllocBuffer* buffer = alloc_buffer(dest, context); + G1PLAB* buffer = alloc_buffer(dest, context); if (_survivor_alignment_bytes == 0) { return buffer->allocate(word_sz); } else { @@ -256,14 +265,14 @@ public: }; class G1DefaultParGCAllocator : public G1ParGCAllocator { - G1ParGCAllocBuffer _surviving_alloc_buffer; - G1ParGCAllocBuffer _tenured_alloc_buffer; - G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num]; + G1PLAB _surviving_alloc_buffer; + G1PLAB _tenured_alloc_buffer; + G1PLAB* _alloc_buffers[InCSetState::Num]; public: G1DefaultParGCAllocator(G1CollectedHeap* g1h); - virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) { + virtual G1PLAB* alloc_buffer(InCSetState dest, AllocationContext_t context) { assert(dest.is_valid(), err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value())); assert(_alloc_buffers[dest.value()] != NULL, diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp index 7f728cd78bb..50a8782a286 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +23,7 @@ */ #include "precompiled.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" #include "gc_implementation/g1/heapRegion.hpp" #include "memory/space.hpp" @@ -303,9 +304,9 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ assert(blk_start <= threshold, "blk_start should be at or before threshold"); assert(pointer_delta(threshold, blk_start) <= N_words, "offset should be <= BlockOffsetSharedArray::N"); - assert(Universe::heap()->is_in_reserved(blk_start), + assert(G1CollectedHeap::heap()->is_in_reserved(blk_start), "reference must be into the heap"); - assert(Universe::heap()->is_in_reserved(blk_end-1), + assert(G1CollectedHeap::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); assert(threshold == _array->_reserved.start() + index*N_words, "index must agree with threshold"); @@ -458,7 +459,7 @@ G1BlockOffsetArrayContigSpace(G1BlockOffsetSharedArray* array, } HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold_raw() { - assert(!Universe::heap()->is_in_reserved(_array->_offset_array), + assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), "just checking"); _next_offset_index = _array->index_for_raw(_bottom); _next_offset_index++; @@ -468,7 +469,7 @@ HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold_raw() { } void G1BlockOffsetArrayContigSpace::zero_bottom_entry_raw() { - assert(!Universe::heap()->is_in_reserved(_array->_offset_array), + assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), "just checking"); size_t bottom_index = _array->index_for_raw(_bottom); assert(_array->address_for_index_raw(bottom_index) == _bottom, @@ -477,7 +478,7 @@ void G1BlockOffsetArrayContigSpace::zero_bottom_entry_raw() { } HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold() { - assert(!Universe::heap()->is_in_reserved(_array->_offset_array), + assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), "just checking"); _next_offset_index = _array->index_for(_bottom); _next_offset_index++; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp index 3b81b08894a..9b2a2442dfb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +27,7 @@ #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "memory/memRegion.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" // The CollectedHeap type requires subtypes to implement a method diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp index 6922818a790..cfcb084637a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CardCounts.hpp @@ -27,7 +27,7 @@ #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "memory/allocation.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" class CardTableModRefBS; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 8733e4714a9..68e4815d732 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -22,11 +22,6 @@ * */ -#if !defined(__clang_major__) && defined(__GNUC__) -// FIXME, formats have issues. Disable this macro definition, compile, and study warnings for more information. -#define ATTRIBUTE_PRINTF(x,y) -#endif - #include "precompiled.hpp" #include "classfile/metadataOnStackMark.hpp" #include "classfile/stringTable.hpp" @@ -70,6 +65,7 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/vmThread.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/stack.inline.hpp" size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; @@ -200,7 +196,7 @@ bool YoungList::check_list_well_formed() { if (!curr->is_young()) { gclog_or_tty->print_cr("### YOUNG REGION "PTR_FORMAT"-"PTR_FORMAT" " "incorrectly tagged (y: %d, surv: %d)", - curr->bottom(), curr->end(), + p2i(curr->bottom()), p2i(curr->end()), curr->is_young(), curr->is_survivor()); ret = false; } @@ -329,8 +325,8 @@ void YoungList::print() { while (curr != NULL) { gclog_or_tty->print_cr(" "HR_FORMAT", P: "PTR_FORMAT ", N: "PTR_FORMAT", age: %4d", HR_FORMAT_PARAMS(curr), - curr->prev_top_at_mark_start(), - curr->next_top_at_mark_start(), + p2i(curr->prev_top_at_mark_start()), + p2i(curr->next_top_at_mark_start()), curr->age_in_surv_rate_group_cond()); curr = curr->get_next_young_region(); } @@ -409,10 +405,6 @@ bool G1CollectedHeap::is_scavengable(const void* p) { return !hr->is_humongous(); } -// Private class members. - -G1CollectedHeap* G1CollectedHeap::_g1h; - // Private methods. HeapRegion* @@ -1728,7 +1720,7 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) { G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : - SharedHeap(), + CollectedHeap(), _g1_policy(policy_), _dirty_card_queue_set(false), _into_cset_dirty_card_queue_set(false), @@ -1746,7 +1738,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : _secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()), _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()), _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()), - _humongous_is_live(), + _humongous_reclaim_candidates(), _has_humongous_reclaim_candidates(false), _free_regions_coming(false), _young_list(new YoungList(this)), @@ -1768,9 +1760,12 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()), _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) { - _g1h = this; + _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads, + /* are_GC_task_threads */true, + /* are_ConcurrentGC_threads */false); + _workers->initialize_workers(); - _allocator = G1Allocator::create_allocator(_g1h); + _allocator = G1Allocator::create_allocator(this); _humongous_object_threshold_in_words = HeapRegion::GrainWords / 2; int n_queues = MAX2((int)ParallelGCThreads, 1); @@ -1797,6 +1792,26 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : guarantee(_task_queues != NULL, "task_queues allocation failure."); } +G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description, + size_t size, + size_t translation_factor) { + size_t preferred_page_size = os::page_size_for_region_unaligned(size, 1); + // Allocate a new reserved space, preferring to use large pages. + ReservedSpace rs(size, preferred_page_size); + G1RegionToSpaceMapper* result = + G1RegionToSpaceMapper::create_mapper(rs, + size, + rs.alignment(), + HeapRegion::GrainBytes, + translation_factor, + mtGC); + if (TracePageSizes) { + gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT, + description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size); + } + return result; +} + jint G1CollectedHeap::initialize() { CollectedHeap::pre_initialize(); os::enable_vtime(); @@ -1864,57 +1879,35 @@ jint G1CollectedHeap::initialize() { ReservedSpace g1_rs = heap_rs.first_part(max_byte_size); G1RegionToSpaceMapper* heap_storage = G1RegionToSpaceMapper::create_mapper(g1_rs, + g1_rs.size(), UseLargePages ? os::large_page_size() : os::vm_page_size(), HeapRegion::GrainBytes, 1, mtJavaHeap); heap_storage->set_mapping_changed_listener(&_listener); - // Reserve space for the block offset table. We do not support automatic uncommit - // for the card table at this time. BOT only. - ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize)); + // Create storage for the BOT, card table, card counts table (hot card cache) and the bitmaps. G1RegionToSpaceMapper* bot_storage = - G1RegionToSpaceMapper::create_mapper(bot_rs, - os::vm_page_size(), - HeapRegion::GrainBytes, - G1BlockOffsetSharedArray::N_bytes, - mtGC); + create_aux_memory_mapper("Block offset table", + G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), + G1BlockOffsetSharedArray::N_bytes); ReservedSpace cardtable_rs(G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize)); G1RegionToSpaceMapper* cardtable_storage = - G1RegionToSpaceMapper::create_mapper(cardtable_rs, - os::vm_page_size(), - HeapRegion::GrainBytes, - G1BlockOffsetSharedArray::N_bytes, - mtGC); + create_aux_memory_mapper("Card table", + G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize), + G1BlockOffsetSharedArray::N_bytes); - // Reserve space for the card counts table. - ReservedSpace card_counts_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize)); G1RegionToSpaceMapper* card_counts_storage = - G1RegionToSpaceMapper::create_mapper(card_counts_rs, - os::vm_page_size(), - HeapRegion::GrainBytes, - G1BlockOffsetSharedArray::N_bytes, - mtGC); + create_aux_memory_mapper("Card counts table", + G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), + G1BlockOffsetSharedArray::N_bytes); - // Reserve space for prev and next bitmap. size_t bitmap_size = CMBitMap::compute_size(g1_rs.size()); - - ReservedSpace prev_bitmap_rs(ReservedSpace::allocation_align_size_up(bitmap_size)); G1RegionToSpaceMapper* prev_bitmap_storage = - G1RegionToSpaceMapper::create_mapper(prev_bitmap_rs, - os::vm_page_size(), - HeapRegion::GrainBytes, - CMBitMap::mark_distance(), - mtGC); - - ReservedSpace next_bitmap_rs(ReservedSpace::allocation_align_size_up(bitmap_size)); + create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::mark_distance()); G1RegionToSpaceMapper* next_bitmap_storage = - G1RegionToSpaceMapper::create_mapper(next_bitmap_rs, - os::vm_page_size(), - HeapRegion::GrainBytes, - CMBitMap::mark_distance(), - mtGC); + create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::mark_distance()); _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); g1_barrier_set()->initialize(cardtable_storage); @@ -1935,10 +1928,14 @@ jint G1CollectedHeap::initialize() { _bot_shared = new G1BlockOffsetSharedArray(reserved_region(), bot_storage); - _g1h = this; + { + HeapWord* start = _hrm.reserved().start(); + HeapWord* end = _hrm.reserved().end(); + size_t granularity = HeapRegion::GrainBytes; - _in_cset_fast_test.initialize(_hrm.reserved().start(), _hrm.reserved().end(), HeapRegion::GrainBytes); - _humongous_is_live.initialize(_hrm.reserved().start(), _hrm.reserved().end(), HeapRegion::GrainBytes); + _in_cset_fast_test.initialize(start, end, granularity); + _humongous_reclaim_candidates.initialize(start, end, granularity); + } // Create the ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) @@ -2026,15 +2023,15 @@ void G1CollectedHeap::stop() { } } -void G1CollectedHeap::clear_humongous_is_live_table() { - guarantee(G1EagerReclaimHumongousObjects, "Should only be called if true"); - _humongous_is_live.clear(); -} - size_t G1CollectedHeap::conservative_max_heap_alignment() { return HeapRegion::max_region_size(); } +void G1CollectedHeap::post_initialize() { + CollectedHeap::post_initialize(); + ref_processing_init(); +} + void G1CollectedHeap::ref_processing_init() { // Reference processing in G1 currently works as follows: // @@ -2071,7 +2068,6 @@ void G1CollectedHeap::ref_processing_init() { // * Discovery is atomic - i.e. not concurrent. // * Reference discovery will not need a barrier. - SharedHeap::ref_processing_init(); MemRegion mr = reserved_region(); // Concurrent Mark ref processor @@ -2128,6 +2124,7 @@ void G1CollectedHeap::reset_gc_time_stamps(HeapRegion* hr) { } #ifndef PRODUCT + class CheckGCTimeStampsHRClosure : public HeapRegionClosure { private: unsigned _gc_time_stamp; @@ -2462,11 +2459,6 @@ public: } }; -void G1CollectedHeap::oop_iterate(ExtendedOopClosure* cl) { - IterateOopClosureRegionClosure blk(cl); - heap_region_iterate(&blk); -} - // Iterates an ObjectClosure over all objects within a HeapRegion. class IterateObjectClosureRegionClosure: public HeapRegionClosure { @@ -2486,23 +2478,6 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) { heap_region_iterate(&blk); } -// Calls a SpaceClosure on a HeapRegion. - -class SpaceClosureRegionClosure: public HeapRegionClosure { - SpaceClosure* _cl; -public: - SpaceClosureRegionClosure(SpaceClosure* cl) : _cl(cl) {} - bool doHeapRegion(HeapRegion* r) { - _cl->do_space(r); - return false; - } -}; - -void G1CollectedHeap::space_iterate(SpaceClosure* cl) { - SpaceClosureRegionClosure blk(cl); - heap_region_iterate(&blk); -} - void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const { _hrm.iterate(cl); } @@ -2639,23 +2614,19 @@ HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) cons return result; } -Space* G1CollectedHeap::space_containing(const void* addr) const { - return heap_region_containing(addr); -} - HeapWord* G1CollectedHeap::block_start(const void* addr) const { - Space* sp = space_containing(addr); - return sp->block_start(addr); + HeapRegion* hr = heap_region_containing(addr); + return hr->block_start(addr); } size_t G1CollectedHeap::block_size(const HeapWord* addr) const { - Space* sp = space_containing(addr); - return sp->block_size(addr); + HeapRegion* hr = heap_region_containing(addr); + return hr->block_size(addr); } bool G1CollectedHeap::block_is_obj(const HeapWord* addr) const { - Space* sp = space_containing(addr); - return sp->block_is_obj(addr); + HeapRegion* hr = heap_region_containing(addr); + return hr->block_is_obj(addr); } bool G1CollectedHeap::supports_tlab_allocation() const { @@ -2776,9 +2747,9 @@ public: oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (_g1h->is_obj_dead_cond(obj, _vo)) { gclog_or_tty->print_cr("Root location "PTR_FORMAT" " - "points to dead obj "PTR_FORMAT, p, (void*) obj); + "points to dead obj "PTR_FORMAT, p2i(p), p2i(obj)); if (_vo == VerifyOption_G1UseMarkWord) { - gclog_or_tty->print_cr(" Mark word: "PTR_FORMAT, (void*)(obj->mark())); + gclog_or_tty->print_cr(" Mark word: "INTPTR_FORMAT, (intptr_t)obj->mark()); } obj->print_on(gclog_or_tty); _failures = true; @@ -2826,9 +2797,9 @@ class G1VerifyCodeRootOopClosure: public OopClosure { // contains the nmethod if (!hrrs->strong_code_roots_list_contains(_nm)) { gclog_or_tty->print_cr("Code root location "PTR_FORMAT" " - "from nmethod "PTR_FORMAT" not in strong " - "code roots for region ["PTR_FORMAT","PTR_FORMAT")", - p, _nm, hr->bottom(), hr->end()); + "from nmethod "PTR_FORMAT" not in strong " + "code roots for region ["PTR_FORMAT","PTR_FORMAT")", + p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); _failures = true; } } @@ -2884,7 +2855,7 @@ class VerifyKlassClosure: public KlassClosure { _young_ref_counter_closure.reset_count(); k->oops_do(&_young_ref_counter_closure); if (_young_ref_counter_closure.count() > 0) { - guarantee(k->has_modified_oops(), err_msg("Klass " PTR_FORMAT ", has young refs but is not dirty.", k)); + guarantee(k->has_modified_oops(), err_msg("Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k))); } } }; @@ -2945,35 +2916,6 @@ public: size_t live_bytes() { return _live_bytes; } }; -class PrintObjsInRegionClosure : public ObjectClosure { - HeapRegion *_hr; - G1CollectedHeap *_g1; -public: - PrintObjsInRegionClosure(HeapRegion *hr) : _hr(hr) { - _g1 = G1CollectedHeap::heap(); - }; - - void do_object(oop o) { - if (o != NULL) { - HeapWord *start = (HeapWord *) o; - size_t word_sz = o->size(); - gclog_or_tty->print("\nPrinting obj "PTR_FORMAT" of size " SIZE_FORMAT - " isMarkedPrev %d isMarkedNext %d isAllocSince %d\n", - (void*) o, word_sz, - _g1->isMarkedPrev(o), - _g1->isMarkedNext(o), - _hr->obj_allocated_since_prev_marking(o)); - HeapWord *end = start + word_sz; - HeapWord *cur; - int *val; - for (cur = start; cur < end; cur++) { - val = (int *) cur; - gclog_or_tty->print("\t "PTR_FORMAT":%d\n", val, *val); - } - } - } -}; - class VerifyRegionClosure: public HeapRegionClosure { private: bool _par; @@ -3006,7 +2948,7 @@ public: gclog_or_tty->print_cr("["PTR_FORMAT","PTR_FORMAT"] " "max_live_bytes "SIZE_FORMAT" " "< calculated "SIZE_FORMAT, - r->bottom(), r->end(), + p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes()); _failures = true; @@ -3125,12 +3067,6 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) { // print_extended_on() instead of print_on(). print_extended_on(gclog_or_tty); gclog_or_tty->cr(); -#ifndef PRODUCT - if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) { - concurrent_mark()->print_reachable("at-verification-failure", - vo, false /* all */); - } -#endif gclog_or_tty->flush(); } guarantee(!failures, "there should not have been any failures"); @@ -3210,10 +3146,10 @@ void G1CollectedHeap::print_on(outputStream* st) const { st->print(" %-20s", "garbage-first heap"); st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", capacity()/K, used_unlocked()/K); - st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", - _hrm.reserved().start(), - _hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords, - _hrm.reserved().end()); + st->print(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", + p2i(_hrm.reserved().start()), + p2i(_hrm.reserved().start() + _hrm.length() + HeapRegion::GrainWords), + p2i(_hrm.reserved().end())); st->cr(); st->print(" region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K); uint young_regions = _young_list->length(); @@ -3336,9 +3272,10 @@ void G1CollectedHeap::print_all_rsets() { #endif // PRODUCT G1CollectedHeap* G1CollectedHeap::heap() { - assert(_sh->kind() == CollectedHeap::G1CollectedHeap, - "not a garbage-first heap"); - return _g1h; + CollectedHeap* heap = Universe::heap(); + assert(heap != NULL, "Uninitialized access to G1CollectedHeap::heap()"); + assert(heap->kind() == CollectedHeap::G1CollectedHeap, "Not a G1CollectedHeap"); + return (G1CollectedHeap*)heap; } void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { @@ -3434,12 +3371,6 @@ size_t G1CollectedHeap::cards_scanned() { return g1_rem_set()->cardsScanned(); } -bool G1CollectedHeap::humongous_region_is_always_live(uint index) { - HeapRegion* region = region_at(index); - assert(region->is_starts_humongous(), "Must start a humongous object"); - return oop(region->bottom())->is_objArray() || !region->rem_set()->is_empty(); -} - class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure { private: size_t _total_humongous; @@ -3447,14 +3378,59 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure { DirtyCardQueue _dcq; - bool humongous_region_is_candidate(uint index) { - HeapRegion* region = G1CollectedHeap::heap()->region_at(index); - assert(region->is_starts_humongous(), "Must start a humongous object"); + // We don't nominate objects with many remembered set entries, on + // the assumption that such objects are likely still live. + bool is_remset_small(HeapRegion* region) const { HeapRegionRemSet* const rset = region->rem_set(); - bool const allow_stale_refs = G1EagerReclaimHumongousObjectsWithStaleRefs; - return !oop(region->bottom())->is_objArray() && - ((allow_stale_refs && rset->occupancy_less_or_equal_than(G1RSetSparseRegionEntries)) || - (!allow_stale_refs && rset->is_empty())); + return G1EagerReclaimHumongousObjectsWithStaleRefs + ? rset->occupancy_less_or_equal_than(G1RSetSparseRegionEntries) + : rset->is_empty(); + } + + bool is_typeArray_region(HeapRegion* region) const { + return oop(region->bottom())->is_typeArray(); + } + + bool humongous_region_is_candidate(G1CollectedHeap* heap, HeapRegion* region) const { + assert(region->is_starts_humongous(), "Must start a humongous object"); + + // Candidate selection must satisfy the following constraints + // while concurrent marking is in progress: + // + // * In order to maintain SATB invariants, an object must not be + // reclaimed if it was allocated before the start of marking and + // has not had its references scanned. Such an object must have + // its references (including type metadata) scanned to ensure no + // live objects are missed by the marking process. Objects + // allocated after the start of concurrent marking don't need to + // be scanned. + // + // * An object must not be reclaimed if it is on the concurrent + // mark stack. Objects allocated after the start of concurrent + // marking are never pushed on the mark stack. + // + // Nominating only objects allocated after the start of concurrent + // marking is sufficient to meet both constraints. This may miss + // some objects that satisfy the constraints, but the marking data + // structures don't support efficiently performing the needed + // additional tests or scrubbing of the mark stack. + // + // However, we presently only nominate is_typeArray() objects. + // A humongous object containing references induces remembered + // set entries on other regions. In order to reclaim such an + // object, those remembered sets would need to be cleaned up. + // + // We also treat is_typeArray() objects specially, allowing them + // to be reclaimed even if allocated before the start of + // concurrent mark. For this we rely on mark stack insertion to + // exclude is_typeArray() objects, preventing reclaiming an object + // that is in the mark stack. We also rely on the metadata for + // such objects to be built-in and so ensured to be kept live. + // Frequent allocation and drop of large binary blobs is an + // important use case for eager reclaim, and this special handling + // may reduce needed headroom. + + return is_typeArray_region(region) && is_remset_small(region); } public: @@ -3470,14 +3446,17 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure { } G1CollectedHeap* g1h = G1CollectedHeap::heap(); - uint region_idx = r->hrm_index(); - bool is_candidate = humongous_region_is_candidate(region_idx); - // Is_candidate already filters out humongous object with large remembered sets. - // If we have a humongous object with a few remembered sets, we simply flush these - // remembered set entries into the DCQS. That will result in automatic - // re-evaluation of their remembered set entries during the following evacuation - // phase. + bool is_candidate = humongous_region_is_candidate(g1h, r); + uint rindex = r->hrm_index(); + g1h->set_humongous_reclaim_candidate(rindex, is_candidate); if (is_candidate) { + _candidate_humongous++; + g1h->register_humongous_region_with_cset(rindex); + // Is_candidate already filters out humongous object with large remembered sets. + // If we have a humongous object with a few remembered sets, we simply flush these + // remembered set entries into the DCQS. That will result in automatic + // re-evaluation of their remembered set entries during the following evacuation + // phase. if (!r->rem_set()->is_empty()) { guarantee(r->rem_set()->occupancy_less_or_equal_than(G1RSetSparseRegionEntries), "Found a not-small remembered set here. This is inconsistent with previous assumptions."); @@ -3499,8 +3478,6 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure { r->rem_set()->clear_locked(); } assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty."); - g1h->register_humongous_region_with_cset(region_idx); - _candidate_humongous++; } _total_humongous++; @@ -3520,6 +3497,7 @@ void G1CollectedHeap::register_humongous_regions_with_cset() { } double time = os::elapsed_counter(); + // Collect reclaim candidate information and register candidates with cset. RegisterHumongousWithInCSetFastTestClosure cl; heap_region_iterate(&cl); @@ -3529,10 +3507,6 @@ void G1CollectedHeap::register_humongous_regions_with_cset() { cl.candidate_humongous()); _has_humongous_reclaim_candidates = cl.candidate_humongous() > 0; - if (_has_humongous_reclaim_candidates || G1TraceEagerReclaimHumongousObjects) { - clear_humongous_is_live_table(); - } - // Finally flush all remembered set entries to re-check into the global DCQS. cl.flush_rem_set_entries(); } @@ -3832,14 +3806,9 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { assert(check_cset_fast_test(), "Inconsistency in the InCSetState table."); _cm->note_start_of_gc(); - // We should not verify the per-thread SATB buffers given that - // we have not filtered them yet (we'll do so during the - // GC). We also call this after finalize_cset() to + // We call this after finalize_cset() to // ensure that the CSet has been finalized. - _cm->verify_no_cset_oops(true /* verify_stacks */, - true /* verify_enqueued_buffers */, - false /* verify_thread_buffers */, - true /* verify_fingers */); + _cm->verify_no_cset_oops(); if (_hr_printer.is_active()) { HeapRegion* hr = g1_policy()->collection_set(); @@ -3862,16 +3831,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // Actually do the work... evacuate_collection_set(evacuation_info); - // We do this to mainly verify the per-thread SATB buffers - // (which have been filtered by now) since we didn't verify - // them earlier. No point in re-checking the stacks / enqueued - // buffers given that the CSet has not changed since last time - // we checked. - _cm->verify_no_cset_oops(false /* verify_stacks */, - false /* verify_enqueued_buffers */, - true /* verify_thread_buffers */, - true /* verify_fingers */); - free_collection_set(g1_policy()->collection_set(), evacuation_info); eagerly_reclaim_humongous_regions(); @@ -3954,10 +3913,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // We redo the verification but now wrt to the new CSet which // has just got initialized after the previous CSet was freed. - _cm->verify_no_cset_oops(true /* verify_stacks */, - true /* verify_enqueued_buffers */, - true /* verify_thread_buffers */, - true /* verify_fingers */); + _cm->verify_no_cset_oops(); _cm->note_end_of_gc(); // This timing is only used by the ergonomics to handle our pause target. @@ -4116,7 +4072,7 @@ G1CollectedHeap::handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_s oop old) { assert(obj_in_cs(old), err_msg("obj: "PTR_FORMAT" should still be in the CSet", - (HeapWord*) old)); + p2i(old))); markOop m = old->mark(); oop forward_ptr = old->forward_to_atomic(old); if (forward_ptr == NULL) { @@ -4151,7 +4107,7 @@ G1CollectedHeap::handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_s assert(old == forward_ptr || !obj_in_cs(forward_ptr), err_msg("obj: "PTR_FORMAT" forwarded to: "PTR_FORMAT" " "should not be in the CSet", - (HeapWord*) old, (HeapWord*) forward_ptr)); + p2i(old), p2i(forward_ptr))); return forward_ptr; } } @@ -4856,7 +4812,7 @@ void G1CollectedHeap::parallel_cleaning(BoolObjectClosure* is_alive, void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) { { - uint n_workers = _g1h->workers()->active_workers(); + uint n_workers = workers()->active_workers(); G1StringSymbolTableUnlinkTask g1_unlink_task(is_alive, process_strings, process_symbols); set_par_threads(n_workers); workers()->run_task(&g1_unlink_task); @@ -4888,7 +4844,7 @@ class G1RedirtyLoggedCardsTask : public AbstractGangTask { void G1CollectedHeap::redirty_logged_cards() { double redirty_logged_cards_start = os::elapsedTime(); - uint n_workers = _g1h->workers()->active_workers(); + uint n_workers = workers()->active_workers(); G1RedirtyLoggedCardsTask redirty_task(&dirty_card_queue_set()); dirty_card_queue_set().reset_for_par_iteration(); @@ -5001,8 +4957,7 @@ public: _par_scan_state->push_on_queue(p); } else { assert(!Metaspace::contains((const void*)p), - err_msg("Unexpectedly found a pointer from metadata: " - PTR_FORMAT, p)); + err_msg("Unexpectedly found a pointer from metadata: " PTR_FORMAT, p2i(p))); _copy_non_heap_obj_cl->do_oop(p); } } @@ -5321,7 +5276,7 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) { OopClosure* copy_non_heap_cl = &only_copy_non_heap_cl; - if (_g1h->g1_policy()->during_initial_mark_pause()) { + if (g1_policy()->during_initial_mark_pause()) { // We also need to mark copied objects. copy_non_heap_cl = ©_mark_non_heap_cl; } @@ -5667,14 +5622,14 @@ void G1CollectedHeap::verify_dirty_young_regions() { bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap, HeapWord* tams, HeapWord* end) { guarantee(tams <= end, - err_msg("tams: "PTR_FORMAT" end: "PTR_FORMAT, tams, end)); + err_msg("tams: "PTR_FORMAT" end: "PTR_FORMAT, p2i(tams), p2i(end))); HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); if (result < end) { gclog_or_tty->cr(); gclog_or_tty->print_cr("## wrong marked address on %s bitmap: "PTR_FORMAT, - bitmap_name, result); + bitmap_name, p2i(result)); gclog_or_tty->print_cr("## %s tams: "PTR_FORMAT" end: "PTR_FORMAT, - bitmap_name, tams, end); + bitmap_name, p2i(tams), p2i(end)); return false; } return true; @@ -5994,41 +5949,42 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { // required because stale remembered sets might reference locations that // are currently allocated into. uint region_idx = r->hrm_index(); - if (g1h->humongous_is_live(region_idx) || - g1h->humongous_region_is_always_live(region_idx)) { + if (!g1h->is_humongous_reclaim_candidate(region_idx) || + !r->rem_set()->is_empty()) { if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Live humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d", + gclog_or_tty->print_cr("Live humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length %u with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d reclaim candidate %d type array %d", region_idx, - obj->size()*HeapWordSize, - r->bottom(), + (size_t)obj->size() * HeapWordSize, + p2i(r->bottom()), r->region_num(), r->rem_set()->occupied(), r->rem_set()->strong_code_roots_list_length(), next_bitmap->isMarked(r->bottom()), - g1h->humongous_is_live(region_idx), - obj->is_objArray() + g1h->is_humongous_reclaim_candidate(region_idx), + obj->is_typeArray() ); } return false; } - guarantee(!obj->is_objArray(), - err_msg("Eagerly reclaiming object arrays is not supported, but the object "PTR_FORMAT" is.", - r->bottom())); + guarantee(obj->is_typeArray(), + err_msg("Only eagerly reclaiming type arrays is supported, but the object " + PTR_FORMAT " is not.", + p2i(r->bottom()))); if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Dead humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length "UINT32_FORMAT" with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d live-other %d obj array %d", + gclog_or_tty->print_cr("Dead humongous region %u size "SIZE_FORMAT" start "PTR_FORMAT" length %u with remset "SIZE_FORMAT" code roots "SIZE_FORMAT" is marked %d reclaim candidate %d type array %d", region_idx, - obj->size()*HeapWordSize, - r->bottom(), + (size_t)obj->size() * HeapWordSize, + p2i(r->bottom()), r->region_num(), r->rem_set()->occupied(), r->rem_set()->strong_code_roots_list_length(), next_bitmap->isMarked(r->bottom()), - g1h->humongous_is_live(region_idx), - obj->is_objArray() + g1h->is_humongous_reclaim_candidate(region_idx), + obj->is_typeArray() ); } // Need to clear mark bit of the humongous object if already set. @@ -6075,12 +6031,12 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { HeapRegionSetCount empty_set; remove_from_old_sets(empty_set, cl.humongous_free_count()); - G1HRPrinter* hr_printer = _g1h->hr_printer(); - if (hr_printer->is_active()) { + G1HRPrinter* hrp = hr_printer(); + if (hrp->is_active()) { FreeRegionListIterator iter(&local_cleanup_list); while (iter.more_available()) { HeapRegion* hr = iter.get_next(); - hr_printer->cleanup(hr); + hrp->cleanup(hr); } } @@ -6163,8 +6119,6 @@ void G1CollectedHeap::wait_while_free_regions_coming() { } void G1CollectedHeap::set_region_short_lived_locked(HeapRegion* hr) { - assert(heap_lock_held_for_gc(), - "the heap lock should already be held by or for this thread"); _young_list->push_region(hr); } @@ -6176,7 +6130,7 @@ public: bool doHeapRegion(HeapRegion* r) { if (r->is_young()) { gclog_or_tty->print_cr("Region ["PTR_FORMAT", "PTR_FORMAT") tagged as young", - r->bottom(), r->end()); + p2i(r->bottom()), p2i(r->end())); _success = false; } return false; @@ -6526,7 +6480,7 @@ class RegisterNMethodOopClosure: public OopClosure { assert(!hr->is_continues_humongous(), err_msg("trying to add code root "PTR_FORMAT" in continuation of humongous region "HR_FORMAT " starting at "HR_FORMAT, - _nm, HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); + p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); // HeapRegion::add_strong_code_root_locked() avoids adding duplicate entries. hr->add_strong_code_root_locked(_nm); @@ -6553,7 +6507,7 @@ class UnregisterNMethodOopClosure: public OopClosure { assert(!hr->is_continues_humongous(), err_msg("trying to remove code root "PTR_FORMAT" in continuation of humongous region "HR_FORMAT " starting at "HR_FORMAT, - _nm, HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); + p2i(_nm), HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()))); hr->remove_strong_code_root(_nm); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 1a3be8c2a9a..f3f0338a087 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -39,10 +39,9 @@ #include "gc_implementation/g1/heapRegionManager.hpp" #include "gc_implementation/g1/heapRegionSet.hpp" #include "gc_implementation/shared/hSpaceCounters.hpp" -#include "gc_implementation/shared/parGCAllocBuffer.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/barrierSet.hpp" #include "memory/memRegion.hpp" -#include "memory/sharedHeap.hpp" #include "utilities/stack.hpp" // A "G1CollectedHeap" is an implementation of a java heap for HotSpot. @@ -76,6 +75,7 @@ class G1OldTracer; class EvacuationFailedInfo; class nmethod; class Ticks; +class FlexibleWorkGang; typedef OverflowTaskQueue RefToScanQueue; typedef GenericTaskQueueSet RefToScanQueueSet; @@ -177,7 +177,7 @@ class G1RegionMappingChangedListener : public G1MappingChangedListener { virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled); }; -class G1CollectedHeap : public SharedHeap { +class G1CollectedHeap : public CollectedHeap { friend class VM_CollectForMetadataAllocation; friend class VM_G1CollectForAllocation; friend class VM_G1CollectFull; @@ -201,8 +201,7 @@ class G1CollectedHeap : public SharedHeap { friend class G1CheckCSetFastTableClosure; private: - // The one and only G1CollectedHeap, so static functions can find it. - static G1CollectedHeap* _g1h; + FlexibleWorkGang* _workers; static size_t _humongous_object_threshold_in_words; @@ -217,7 +216,6 @@ private: // It keeps track of the humongous regions. HeapRegionSet _humongous_set; - void clear_humongous_is_live_table(); void eagerly_reclaim_humongous_regions(); // The number of regions we could create by expansion. @@ -287,22 +285,26 @@ private: // Helper for monitoring and management support. G1MonitoringSupport* _g1mm; - // Records whether the region at the given index is kept live by roots or - // references from the young generation. - class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray { + // Records whether the region at the given index is (still) a + // candidate for eager reclaim. Only valid for humongous start + // regions; other regions have unspecified values. Humongous start + // regions are initialized at start of collection pause, with + // candidates removed from the set as they are found reachable from + // roots or the young generation. + class HumongousReclaimCandidates : public G1BiasedMappedArray { protected: bool default_value() const { return false; } public: void clear() { G1BiasedMappedArray::clear(); } - void set_live(uint region) { - set_by_index(region, true); + void set_candidate(uint region, bool value) { + set_by_index(region, value); } - bool is_live(uint region) { + bool is_candidate(uint region) { return get_by_index(region); } }; - HumongousIsLiveBiasedMappedArray _humongous_is_live; + HumongousReclaimCandidates _humongous_reclaim_candidates; // Stores whether during humongous object registration we found candidate regions. // If not, we can skip a few steps. bool _has_humongous_reclaim_candidates; @@ -351,6 +353,12 @@ private: // heap after a compaction. void print_hrm_post_compaction(); + // Create a memory mapper for auxiliary data structures of the given size and + // translation factor. + static G1RegionToSpaceMapper* create_aux_memory_mapper(const char* description, + size_t size, + size_t translation_factor); + double verify(bool guard, const char* msg); void verify_before_gc(); void verify_after_gc(); @@ -605,6 +613,7 @@ protected: void enqueue_discovered_references(uint no_of_gc_workers); public: + FlexibleWorkGang* workers() const { return _workers; } G1Allocator* allocator() { return _allocator; @@ -630,21 +639,18 @@ public: inline AllocationContextStats& allocation_context_stats(); // Do anything common to GC's. - virtual void gc_prologue(bool full); - virtual void gc_epilogue(bool full); + void gc_prologue(bool full); + void gc_epilogue(bool full); + // Modify the reclaim candidate set and test for presence. + // These are only valid for starts_humongous regions. + inline void set_humongous_reclaim_candidate(uint region, bool value); + inline bool is_humongous_reclaim_candidate(uint region); + + // Remove from the reclaim candidate set. Also remove from the + // collection set so that later encounters avoid the slow path. inline void set_humongous_is_live(oop obj); - bool humongous_is_live(uint region) { - return _humongous_is_live.is_live(region); - } - - // Returns whether the given region (which must be a humongous (start) region) - // is to be considered conservatively live regardless of any other conditions. - bool humongous_region_is_always_live(uint index); - // Returns whether the given region (which must be a humongous (start) region) - // is considered a candidate for eager reclamation. - bool humongous_region_is_candidate(uint index); // Register the given region to be part of the collection set. inline void register_humongous_region_with_cset(uint index); // Register regions with humongous objects (actually on the start region) in @@ -1000,11 +1006,14 @@ public: // Return the (conservative) maximum heap alignment for any G1 heap static size_t conservative_max_heap_alignment(); + // Does operations required after initialization has been done. + void post_initialize(); + // Initialize weak reference processing. - virtual void ref_processing_init(); + void ref_processing_init(); // Explicitly import set_par_threads into this scope - using SharedHeap::set_par_threads; + using CollectedHeap::set_par_threads; // Set _n_par_threads according to a policy TBD. void set_par_threads(); @@ -1251,10 +1260,6 @@ public: // Iteration functions. - // Iterate over all the ref-containing fields of all objects, calling - // "cl.do_oop" on each. - virtual void oop_iterate(ExtendedOopClosure* cl); - // Iterate over all objects, calling "cl.do_object" on each. virtual void object_iterate(ObjectClosure* cl); @@ -1262,9 +1267,6 @@ public: object_iterate(cl); } - // Iterate over all spaces in use in the heap, in ascending address order. - virtual void space_iterate(SpaceClosure* cl); - // Iterate over heap regions, in address order, terminating the // iteration early if the "doHeapRegion" method returns "true". void heap_region_iterate(HeapRegionClosure* blk) const; @@ -1307,10 +1309,6 @@ public: HeapRegion* next_compaction_region(const HeapRegion* from) const; - // A CollectedHeap will contain some number of spaces. This finds the - // space containing a given address, or else returns NULL. - virtual Space* space_containing(const void* addr) const; - // Returns the HeapRegion that contains addr. addr must not be NULL. template inline HeapRegion* heap_region_containing_raw(const T addr) const; @@ -1344,9 +1342,6 @@ public: // the block is an object. virtual bool block_is_obj(const HeapWord* addr) const; - // Does this heap support heap inspection? (+PrintClassHistogram) - virtual bool supports_heap_inspection() const { return true; } - // Section on thread-local allocation buffers (TLABs) // See CollectedHeap for semantics. 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 d029e08a854..fd4f138fbcb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @@ -352,20 +352,30 @@ inline bool G1CollectedHeap::is_obj_ill(const oop obj) const { return is_obj_ill(obj, heap_region_containing(obj)); } +inline void G1CollectedHeap::set_humongous_reclaim_candidate(uint region, bool value) { + assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object"); + _humongous_reclaim_candidates.set_candidate(region, value); +} + +inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) { + assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object"); + return _humongous_reclaim_candidates.is_candidate(region); +} + inline void G1CollectedHeap::set_humongous_is_live(oop obj) { uint region = addr_to_region((HeapWord*)obj); - // We not only set the "live" flag in the humongous_is_live table, but also + // Clear the flag in the humongous_reclaim_candidates table. Also // reset the entry in the _in_cset_fast_test table so that subsequent references // to the same humongous object do not go into the slow path again. // This is racy, as multiple threads may at the same time enter here, but this // is benign. - // During collection we only ever set the "live" flag, and only ever clear the + // During collection we only ever clear the "candidate" flag, and only ever clear the // entry in the in_cset_fast_table. // We only ever evaluate the contents of these tables (in the VM thread) after // having synchronized the worker threads with the VM thread, or in the same // thread (i.e. within the VM thread). - if (!_humongous_is_live.is_live(region)) { - _humongous_is_live.set_live(region); + if (is_humongous_reclaim_candidate(region)) { + set_humongous_reclaim_candidate(region, false); _in_cset_fast_test.clear_humongous(region); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 0be44bd25c5..41943dd1ca0 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -22,11 +22,6 @@ * */ -#ifndef __clang_major__ -// FIXME, formats have issues. Disable this macro definition, compile, and study warnings for more information. -#define ATTRIBUTE_PRINTF(x,y) -#endif - #include "precompiled.hpp" #include "gc_implementation/g1/concurrentG1Refine.hpp" #include "gc_implementation/g1/concurrentMark.hpp" @@ -302,7 +297,7 @@ G1CollectorPolicy::G1CollectorPolicy() : if (reserve_perc > 50) { reserve_perc = 50; warning("G1ReservePercent is set to a value that is too large, " - "it's been updated to %u", reserve_perc); + "it's been updated to " UINTX_FORMAT, reserve_perc); } _reserve_factor = (double) reserve_perc / 100.0; // This will be set when the heap is expanded @@ -1460,7 +1455,7 @@ void G1CollectorPolicy::update_survivors_policy() { _max_survivor_regions = (uint) ceil(max_survivor_regions_d); _tenuring_threshold = _survivors_age_table.compute_tenuring_threshold( - HeapRegion::GrainWords * _max_survivor_regions); + HeapRegion::GrainWords * _max_survivor_regions, counters()); } bool G1CollectorPolicy::force_initial_mark_if_outside_cycle( @@ -1800,7 +1795,7 @@ void G1CollectorPolicy::print_collection_set(HeapRegion* list_head, outputStream assert(csr->in_collection_set(), "bad CS"); st->print_cr(" "HR_FORMAT", P: "PTR_FORMAT "N: "PTR_FORMAT", age: %4d", HR_FORMAT_PARAMS(csr), - csr->prev_top_at_mark_start(), csr->next_top_at_mark_start(), + p2i(csr->prev_top_at_mark_start()), p2i(csr->next_top_at_mark_start()), csr->age_in_surv_rate_group_cond()); csr = next; } @@ -2166,7 +2161,7 @@ void TraceYoungGenTimeData::print_summary(const char* str, void TraceYoungGenTimeData::print_summary_sd(const char* str, const NumberSeq* seq) const { print_summary(str, seq); - gclog_or_tty->print_cr("%+45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", + gclog_or_tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", "(num", seq->num(), seq->sd(), seq->maximum()); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp index eff119625be..92df3a0d291 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1ErgoVerbose.hpp @@ -160,40 +160,43 @@ public: } while (0) -#define ergo_verbose(_tag_, _action_) \ - ergo_verbose_common(_tag_, _action_, "", 0, 0, 0, 0, 0, 0) - -#define ergo_verbose0(_tag_, _action_, _extra_format_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, 0, 0, 0, 0, 0, 0) - -#define ergo_verbose1(_tag_, _action_, _extra_format_, \ - _arg0_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, 0, 0, 0, 0, 0) - -#define ergo_verbose2(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, 0, 0, 0, 0) - -#define ergo_verbose3(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, 0, 0, 0) - -#define ergo_verbose4(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, 0, 0) - -#define ergo_verbose5(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, 0) - #define ergo_verbose6(_tag_, _action_, _extra_format_, \ _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) \ ergo_verbose_common(_tag_, _action_, _extra_format_, \ _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) +#define ergo_verbose5(_tag_, _action_, _extra_format_, \ + _arg0_, _arg1_, _arg2_, _arg3_, _arg4_) \ + ergo_verbose6(_tag_, _action_, _extra_format_ "%s", \ + _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, "") + +#define ergo_verbose4(_tag_, _action_, _extra_format_, \ + _arg0_, _arg1_, _arg2_, _arg3_) \ + ergo_verbose5(_tag_, _action_, _extra_format_ "%s", \ + _arg0_, _arg1_, _arg2_, _arg3_, "") + +#define ergo_verbose3(_tag_, _action_, _extra_format_, \ + _arg0_, _arg1_, _arg2_) \ + ergo_verbose4(_tag_, _action_, _extra_format_ "%s", \ + _arg0_, _arg1_, _arg2_, "") + +#define ergo_verbose2(_tag_, _action_, _extra_format_, \ + _arg0_, _arg1_) \ + ergo_verbose3(_tag_, _action_, _extra_format_ "%s", \ + _arg0_, _arg1_, "") + +#define ergo_verbose1(_tag_, _action_, _extra_format_, \ + _arg0_) \ + ergo_verbose2(_tag_, _action_, _extra_format_ "%s", \ + _arg0_, "") + + +#define ergo_verbose0(_tag_, _action_, _extra_format_) \ + ergo_verbose1(_tag_, _action_, _extra_format_ "%s", \ + "") + +#define ergo_verbose(_tag_, _action_) \ + ergo_verbose0(_tag_, _action_, "") + + #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ERGOVERBOSE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp index 3b7a12b320b..8f51050a7e8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -263,7 +263,6 @@ G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) : _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3); _gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3); _gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[CodeCacheRoots] = new WorkerDataArray(max_gc_threads, "CodeCache Roots (ms)", true, G1Log::LevelFinest, 3); _gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3); _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3); _gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp index 54165cafd3b..323ecf691d3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * 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,6 @@ class G1GCPhaseTimes : public CHeapObj { SystemDictionaryRoots, CLDGRoots, JVMTIRoots, - CodeCacheRoots, CMRefRoots, WaitForStrongCLD, WeakCLDRoots, diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp index e588988cc7c..ee329a77ef1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp @@ -29,7 +29,7 @@ #include "gc_implementation/g1/g1CardCounts.hpp" #include "memory/allocation.hpp" #include "runtime/safepoint.hpp" -#include "runtime/thread.inline.hpp" +#include "runtime/thread.hpp" #include "utilities/globalDefinitions.hpp" class DirtyCardQueue; @@ -123,7 +123,7 @@ class G1HotCardCache: public CHeapObj { // Resets the hot card cache and discards the entries. void reset_hot_cache() { assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint"); - assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread"); + assert(Thread::current_noinline()->is_VM_thread(), "Current thread should be the VMthread"); if (default_use_cache()) { reset_hot_cache_internal(); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 38ec4a96c7e..64af265d3ec 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -61,9 +61,8 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_softrefs) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); - SharedHeap* sh = SharedHeap::heap(); #ifdef ASSERT - if (sh->collector_policy()->should_clear_all_soft_refs()) { + if (G1CollectedHeap::heap()->collector_policy()->should_clear_all_soft_refs()) { assert(clear_all_softrefs, "Policy should have been checked earler"); } #endif @@ -102,11 +101,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, BiasedLocking::restore_marks(); GenMarkSweep::deallocate_stacks(); - // "free at last gc" is calculated from these. - // CHF: cheating for now!!! - // Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity()); - // Universe::set_heap_used_at_last_gc(Universe::heap()->used()); - CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); @@ -125,7 +119,6 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, bool clear_all_softrefs) { // Recursively traverse all live objects and mark them GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); - GenMarkSweep::trace(" 1"); G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -168,12 +161,12 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); // Delete entries for dead interned string and clean up unreferenced symbols in symbol table. - G1CollectedHeap::heap()->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); + g1h->unlink_string_and_symbol_table(&GenMarkSweep::is_alive); if (VerifyDuringGC) { HandleMark hm; // handle scope COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact); - Universe::heap()->prepare_for_verify(); + g1h->prepare_for_verify(); // Note: we can verify only the heap here. When an object is // marked, the previous value of the mark word (including // identity hash values, ages, etc) is preserved, and the mark @@ -187,7 +180,7 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, if (!VerifySilently) { gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying "); } - Universe::heap()->verify(VerifySilently, VerifyOption_G1UseMarkWord); + g1h->verify(VerifySilently, VerifyOption_G1UseMarkWord); if (!VerifySilently) { gclog_or_tty->print_cr("]"); } @@ -205,7 +198,6 @@ void G1MarkSweep::mark_sweep_phase2() { // tracking expects us to do so. See comment under phase4. GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); - GenMarkSweep::trace("2"); prepare_compaction(); } @@ -239,7 +231,6 @@ void G1MarkSweep::mark_sweep_phase3() { // Adjust the pointers to reflect the new locations GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); - GenMarkSweep::trace("3"); // Need cleared claim bits for the roots processing ClassLoaderDataGraph::clear_claimed_marks(); @@ -301,7 +292,6 @@ void G1MarkSweep::mark_sweep_phase4() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); - GenMarkSweep::trace("4"); G1SpaceCompactClosure blk; g1h->heap_region_iterate(&blk); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp index e8d8c307676..58a84ce49a2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp @@ -25,7 +25,7 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP #define SHARE_VM_GC_IMPLEMENTATION_G1_G1MARKSWEEP_HPP -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/heapRegion.hpp" #include "memory/genMarkSweep.hpp" #include "memory/generation.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp index 2bdbca58686..e2b22d5a142 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp @@ -23,9 +23,12 @@ */ #include "precompiled.hpp" +#include "gc_implementation/g1/g1_specialized_oop_closures.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1OopClosures.inline.hpp" #include "gc_implementation/g1/g1ParScanThreadState.hpp" +#include "memory/iterator.inline.hpp" +#include "utilities/stack.inline.hpp" G1ParCopyHelper::G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : G1ParClosureSuper(g1, par_scan_state), _scanned_klass(NULL), @@ -50,3 +53,6 @@ void G1ParClosureSuper::set_par_scan_thread_state(G1ParScanThreadState* par_scan assert(_worker_id < MAX2((uint)ParallelGCThreads, 1u), err_msg("The given worker id %u must be less than the number of threads %u", _worker_id, MAX2((uint)ParallelGCThreads, 1u))); } + +// Generate G1 specialized oop_oop_iterate functions. +SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp index 6afda16da20..11c22ca004b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -172,7 +172,7 @@ inline void G1UpdateRSOrPushRefOopClosure::do_oop_nv(T* p) { oopDesc* o = obj; #endif // CHECK_UNHANDLED_OOPS assert((intptr_t)o % MinObjAlignmentInBytes == 0, "not oop aligned"); - assert(Universe::heap()->is_in_reserved(obj), "must be in heap"); + assert(_g1->is_in_reserved(obj), "must be in heap"); #endif // ASSERT assert(_from != NULL, "from region must be non-NULL"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp index 008002566da..9144d3c7246 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,37 +44,45 @@ #endif #include "utilities/bitMap.inline.hpp" -G1PageBasedVirtualSpace::G1PageBasedVirtualSpace() : _low_boundary(NULL), - _high_boundary(NULL), _committed(), _page_size(0), _special(false), +G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) : + _low_boundary(NULL), _high_boundary(NULL), _committed(), _page_size(0), _special(false), _dirty(), _executable(false) { + initialize_with_page_size(rs, used_size, page_size); } -bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size_t page_size) { - if (!rs.is_reserved()) { - return false; // Allocation failed. - } - assert(_low_boundary == NULL, "VirtualSpace already initialized"); - assert(page_size > 0, "Granularity must be non-zero."); +void G1PageBasedVirtualSpace::initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size) { + guarantee(rs.is_reserved(), "Given reserved space must have been reserved already."); + + vmassert(_low_boundary == NULL, "VirtualSpace already initialized"); + vmassert(page_size > 0, "Page size must be non-zero."); + + guarantee(is_ptr_aligned(rs.base(), page_size), + err_msg("Reserved space base " PTR_FORMAT " is not aligned to requested page size " SIZE_FORMAT, p2i(rs.base()), page_size)); + guarantee(is_size_aligned(used_size, os::vm_page_size()), + err_msg("Given used reserved space size needs to be OS page size aligned (%d bytes) but is " SIZE_FORMAT, os::vm_page_size(), used_size)); + guarantee(used_size <= rs.size(), + err_msg("Used size of reserved space " SIZE_FORMAT " bytes is smaller than reservation at " SIZE_FORMAT " bytes", used_size, rs.size())); + guarantee(is_size_aligned(rs.size(), page_size), + err_msg("Expected that the virtual space is size aligned, but " SIZE_FORMAT " is not aligned to page size " SIZE_FORMAT, rs.size(), page_size)); _low_boundary = rs.base(); - _high_boundary = _low_boundary + rs.size(); + _high_boundary = _low_boundary + used_size; _special = rs.special(); _executable = rs.executable(); _page_size = page_size; - assert(_committed.size() == 0, "virtual space initialized more than once"); - uintx size_in_bits = rs.size() / page_size; - _committed.resize(size_in_bits, /* in_resource_area */ false); + vmassert(_committed.size() == 0, "virtual space initialized more than once"); + BitMap::idx_t size_in_pages = rs.size() / page_size; + _committed.resize(size_in_pages, /* in_resource_area */ false); if (_special) { - _dirty.resize(size_in_bits, /* in_resource_area */ false); + _dirty.resize(size_in_pages, /* in_resource_area */ false); } - return true; + _tail_size = used_size % _page_size; } - G1PageBasedVirtualSpace::~G1PageBasedVirtualSpace() { release(); } @@ -87,12 +95,18 @@ void G1PageBasedVirtualSpace::release() { _special = false; _executable = false; _page_size = 0; + _tail_size = 0; _committed.resize(0, false); _dirty.resize(0, false); } size_t G1PageBasedVirtualSpace::committed_size() const { - return _committed.count_one_bits() * _page_size; + size_t result = _committed.count_one_bits() * _page_size; + // The last page might not be in full. + if (is_last_page_partial() && _committed.at(_committed.size() - 1)) { + result -= _page_size - _tail_size; + } + return result; } size_t G1PageBasedVirtualSpace::reserved_size() const { @@ -103,65 +117,134 @@ size_t G1PageBasedVirtualSpace::uncommitted_size() const { return reserved_size() - committed_size(); } -uintptr_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const { +size_t G1PageBasedVirtualSpace::addr_to_page_index(char* addr) const { return (addr - _low_boundary) / _page_size; } -bool G1PageBasedVirtualSpace::is_area_committed(uintptr_t start, size_t size_in_pages) const { - uintptr_t end = start + size_in_pages; - return _committed.get_next_zero_offset(start, end) >= end; +bool G1PageBasedVirtualSpace::is_area_committed(size_t start_page, size_t size_in_pages) const { + size_t end_page = start_page + size_in_pages; + return _committed.get_next_zero_offset(start_page, end_page) >= end_page; } -bool G1PageBasedVirtualSpace::is_area_uncommitted(uintptr_t start, size_t size_in_pages) const { - uintptr_t end = start + size_in_pages; - return _committed.get_next_one_offset(start, end) >= end; +bool G1PageBasedVirtualSpace::is_area_uncommitted(size_t start_page, size_t size_in_pages) const { + size_t end_page = start_page + size_in_pages; + return _committed.get_next_one_offset(start_page, end_page) >= end_page; } -char* G1PageBasedVirtualSpace::page_start(uintptr_t index) { +char* G1PageBasedVirtualSpace::page_start(size_t index) const { return _low_boundary + index * _page_size; } -size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) { - return num * _page_size; +bool G1PageBasedVirtualSpace::is_after_last_page(size_t index) const { + guarantee(index <= _committed.size(), + err_msg("Given boundary page " SIZE_FORMAT " is beyond managed page count " SIZE_FORMAT, index, _committed.size())); + return index == _committed.size(); } -bool G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) { +void G1PageBasedVirtualSpace::commit_preferred_pages(size_t start, size_t num_pages) { + vmassert(num_pages > 0, "No full pages to commit"); + vmassert(start + num_pages <= _committed.size(), + err_msg("Tried to commit area from page " SIZE_FORMAT " to page " SIZE_FORMAT " " + "that is outside of managed space of " SIZE_FORMAT " pages", + start, start + num_pages, _committed.size())); + + char* start_addr = page_start(start); + size_t size = num_pages * _page_size; + + os::commit_memory_or_exit(start_addr, size, _page_size, _executable, + err_msg("Failed to commit area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".", + p2i(start_addr), p2i(start_addr + size), size)); +} + +void G1PageBasedVirtualSpace::commit_tail() { + vmassert(_tail_size > 0, "The size of the tail area must be > 0 when reaching here"); + + char* const aligned_end_address = (char*)align_ptr_down(_high_boundary, _page_size); + os::commit_memory_or_exit(aligned_end_address, _tail_size, os::vm_page_size(), _executable, + err_msg("Failed to commit tail area from " PTR_FORMAT " to " PTR_FORMAT " of length " SIZE_FORMAT ".", + p2i(aligned_end_address), p2i(_high_boundary), _tail_size)); +} + +void G1PageBasedVirtualSpace::commit_internal(size_t start_page, size_t end_page) { + guarantee(start_page < end_page, + err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page)); + guarantee(end_page <= _committed.size(), + err_msg("Given end page " SIZE_FORMAT " is beyond end of managed page amount of " SIZE_FORMAT, end_page, _committed.size())); + + size_t pages = end_page - start_page; + bool need_to_commit_tail = is_after_last_page(end_page) && is_last_page_partial(); + + // If we have to commit some (partial) tail area, decrease the amount of pages to avoid + // committing that in the full-page commit code. + if (need_to_commit_tail) { + pages--; + } + + if (pages > 0) { + commit_preferred_pages(start_page, pages); + } + + if (need_to_commit_tail) { + commit_tail(); + } +} + +char* G1PageBasedVirtualSpace::bounded_end_addr(size_t end_page) const { + return MIN2(_high_boundary, page_start(end_page)); +} + +void G1PageBasedVirtualSpace::pretouch_internal(size_t start_page, size_t end_page) { + guarantee(start_page < end_page, + err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page)); + + os::pretouch_memory(page_start(start_page), bounded_end_addr(end_page)); +} + +bool G1PageBasedVirtualSpace::commit(size_t start_page, size_t size_in_pages) { // We need to make sure to commit all pages covered by the given area. - guarantee(is_area_uncommitted(start, size_in_pages), "Specified area is not uncommitted"); + guarantee(is_area_uncommitted(start_page, size_in_pages), "Specified area is not uncommitted"); bool zero_filled = true; - uintptr_t end = start + size_in_pages; + size_t end_page = start_page + size_in_pages; if (_special) { // Check for dirty pages and update zero_filled if any found. - if (_dirty.get_next_one_offset(start,end) < end) { + if (_dirty.get_next_one_offset(start_page, end_page) < end_page) { zero_filled = false; - _dirty.clear_range(start, end); + _dirty.clear_range(start_page, end_page); } } else { - os::commit_memory_or_exit(page_start(start), byte_size_for_pages(size_in_pages), _executable, - err_msg("Failed to commit pages from "SIZE_FORMAT" of length "SIZE_FORMAT, start, size_in_pages)); + commit_internal(start_page, end_page); } - _committed.set_range(start, end); + _committed.set_range(start_page, end_page); if (AlwaysPreTouch) { - os::pretouch_memory(page_start(start), page_start(end)); + pretouch_internal(start_page, end_page); } return zero_filled; } -void G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) { - guarantee(is_area_committed(start, size_in_pages), "checking"); +void G1PageBasedVirtualSpace::uncommit_internal(size_t start_page, size_t end_page) { + guarantee(start_page < end_page, + err_msg("Given start page " SIZE_FORMAT " is larger or equal to end page " SIZE_FORMAT, start_page, end_page)); + char* start_addr = page_start(start_page); + os::uncommit_memory(start_addr, pointer_delta(bounded_end_addr(end_page), start_addr, sizeof(char))); +} + +void G1PageBasedVirtualSpace::uncommit(size_t start_page, size_t size_in_pages) { + guarantee(is_area_committed(start_page, size_in_pages), "checking"); + + size_t end_page = start_page + size_in_pages; if (_special) { // Mark that memory is dirty. If committed again the memory might // need to be cleared explicitly. - _dirty.set_range(start, start + size_in_pages); + _dirty.set_range(start_page, end_page); } else { - os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages)); + uncommit_internal(start_page, end_page); } - _committed.clear_range(start, start + size_in_pages); + _committed.clear_range(start_page, end_page); } bool G1PageBasedVirtualSpace::contains(const void* p) const { @@ -175,7 +258,8 @@ void G1PageBasedVirtualSpace::print_on(outputStream* out) { out->cr(); out->print_cr(" - committed: " SIZE_FORMAT, committed_size()); out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size()); - out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary)); + out->print_cr(" - preferred page size: " SIZE_FORMAT, _page_size); + out->print_cr(" - [low_b, high_b]: [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(_low_boundary), p2i(_high_boundary)); } void G1PageBasedVirtualSpace::print() { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp index fb2c78415f9..edf4d6972a8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,19 @@ #include "memory/allocation.hpp" #include "memory/memRegion.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/bitMap.hpp" // Virtual space management helper for a virtual space with an OS page allocation // granularity. // (De-)Allocation requests are always OS page aligned by passing a page index // and multiples of pages. +// For systems that only commits of memory in a given size (always greater than +// page size) the base address is required to be aligned to that page size. +// The actual size requested need not be aligned to that page size, but the size +// of the reservation passed may be rounded up to this page size. Any fragment +// (less than the page size) of the actual size at the tail of the request will +// be committed using OS small pages. // The implementation gives an error when trying to commit or uncommit pages that // have already been committed or uncommitted. class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC { @@ -43,7 +49,11 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC { char* _low_boundary; char* _high_boundary; - // The commit/uncommit granularity in bytes. + // The size of the tail in bytes of the handled space that needs to be committed + // using small pages. + size_t _tail_size; + + // The preferred page size used for commit/uncommit in bytes. size_t _page_size; // Bitmap used for verification of commit/uncommit operations. @@ -62,30 +72,55 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC { // Indicates whether the committed space should be executable. bool _executable; + // Helper function for committing memory. Commit the given memory range by using + // _page_size pages as much as possible and the remainder with small sized pages. + void commit_internal(size_t start_page, size_t end_page); + // Commit num_pages pages of _page_size size starting from start. All argument + // checking has been performed. + void commit_preferred_pages(size_t start_page, size_t end_page); + // Commit space at the high end of the space that needs to be committed with small + // sized pages. + void commit_tail(); + + // Uncommit the given memory range. + void uncommit_internal(size_t start_page, size_t end_page); + + // Pretouch the given memory range. + void pretouch_internal(size_t start_page, size_t end_page); + // Returns the index of the page which contains the given address. uintptr_t addr_to_page_index(char* addr) const; // Returns the address of the given page index. - char* page_start(uintptr_t index); - // Returns the byte size of the given number of pages. - size_t byte_size_for_pages(size_t num); + char* page_start(size_t index) const; + + // Is the given page index the last page? + bool is_last_page(size_t index) const { return index == (_committed.size() - 1); } + // Is the given page index the first after last page? + bool is_after_last_page(size_t index) const; + // Is the last page only partially covered by this space? + bool is_last_page_partial() const { return !is_ptr_aligned(_high_boundary, _page_size); } + // Returns the end address of the given page bounded by the reserved space. + char* bounded_end_addr(size_t end_page) const; // Returns true if the entire area is backed by committed memory. - bool is_area_committed(uintptr_t start, size_t size_in_pages) const; + bool is_area_committed(size_t start_page, size_t size_in_pages) const; // Returns true if the entire area is not backed by committed memory. - bool is_area_uncommitted(uintptr_t start, size_t size_in_pages) const; + bool is_area_uncommitted(size_t start_page, size_t size_in_pages) const; + void initialize_with_page_size(ReservedSpace rs, size_t used_size, size_t page_size); public: // Commit the given area of pages starting at start being size_in_pages large. // Returns true if the given area is zero filled upon completion. - bool commit(uintptr_t start, size_t size_in_pages); + bool commit(size_t start_page, size_t size_in_pages); // Uncommit the given area of pages starting at start being size_in_pages large. - void uncommit(uintptr_t start, size_t size_in_pages); + void uncommit(size_t start_page, size_t size_in_pages); - // Initialization - G1PageBasedVirtualSpace(); - bool initialize_with_granularity(ReservedSpace rs, size_t page_size); + // Initialize the given reserved space with the given base address and the size + // actually used. + // Prefer to commit in page_size chunks. + G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size); // Destruction ~G1PageBasedVirtualSpace(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp index 6ffb5fe5902..e7f6e18c4da 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp @@ -26,8 +26,10 @@ #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1OopClosures.inline.hpp" #include "gc_implementation/g1/g1ParScanThreadState.inline.hpp" +#include "gc_implementation/g1/g1StringDedup.hpp" #include "oops/oop.inline.hpp" #include "runtime/prefetch.inline.hpp" +#include "utilities/stack.inline.hpp" G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp) : _g1h(g1h), diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp index 1b03f8caae2..81c79806a1a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +63,7 @@ inline void G1ParScanThreadState::do_oop_partial_array(oop* p) { assert(has_partial_array_mask(p), "invariant"); oop from_obj = clear_partial_array_mask(p); - assert(Universe::heap()->is_in_reserved(from_obj), "must be in heap."); + assert(_g1h->is_in_reserved(from_obj), "must be in heap."); assert(from_obj->is_objArray(), "must be obj array"); objArrayOop from_obj_array = objArrayOop(from_obj); // The from-space object contains the real length. diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp index 68d967c764a..b78f37d8cc9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,22 +26,21 @@ #include "gc_implementation/g1/g1BiasedArray.hpp" #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "services/memTracker.hpp" #include "utilities/bitMap.inline.hpp" G1RegionToSpaceMapper::G1RegionToSpaceMapper(ReservedSpace rs, - size_t commit_granularity, + size_t used_size, + size_t page_size, size_t region_granularity, MemoryType type) : - _storage(), - _commit_granularity(commit_granularity), + _storage(rs, used_size, page_size), _region_granularity(region_granularity), _listener(NULL), _commit_map() { - guarantee(is_power_of_2(commit_granularity), "must be"); + guarantee(is_power_of_2(page_size), "must be"); guarantee(is_power_of_2(region_granularity), "must be"); - _storage.initialize_with_granularity(rs, commit_granularity); MemTracker::record_virtual_memory_type((address)rs.base(), type); } @@ -55,25 +54,26 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper { public: G1RegionsLargerThanCommitSizeMapper(ReservedSpace rs, - size_t os_commit_granularity, + size_t actual_size, + size_t page_size, size_t alloc_granularity, size_t commit_factor, MemoryType type) : - G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type), - _pages_per_region(alloc_granularity / (os_commit_granularity * commit_factor)) { + G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, type), + _pages_per_region(alloc_granularity / (page_size * commit_factor)) { - guarantee(alloc_granularity >= os_commit_granularity, "allocation granularity smaller than commit granularity"); + guarantee(alloc_granularity >= page_size, "allocation granularity smaller than commit granularity"); _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false); } - virtual void commit_regions(uintptr_t start_idx, size_t num_regions) { - bool zero_filled = _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region); + virtual void commit_regions(uint start_idx, size_t num_regions) { + bool zero_filled = _storage.commit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.set_range(start_idx, start_idx + num_regions); fire_on_commit(start_idx, num_regions, zero_filled); } - virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) { - _storage.uncommit(start_idx * _pages_per_region, num_regions * _pages_per_region); + virtual void uncommit_regions(uint start_idx, size_t num_regions) { + _storage.uncommit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region); _commit_map.clear_range(start_idx, start_idx + num_regions); } }; @@ -98,22 +98,23 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper { public: G1RegionsSmallerThanCommitSizeMapper(ReservedSpace rs, - size_t os_commit_granularity, + size_t actual_size, + size_t page_size, size_t alloc_granularity, size_t commit_factor, MemoryType type) : - G1RegionToSpaceMapper(rs, os_commit_granularity, alloc_granularity, type), - _regions_per_page((os_commit_granularity * commit_factor) / alloc_granularity), _refcounts() { + G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, type), + _regions_per_page((page_size * commit_factor) / alloc_granularity), _refcounts() { - guarantee((os_commit_granularity * commit_factor) >= alloc_granularity, "allocation granularity smaller than commit granularity"); - _refcounts.initialize((HeapWord*)rs.base(), (HeapWord*)(rs.base() + rs.size()), os_commit_granularity); + guarantee((page_size * commit_factor) >= alloc_granularity, "allocation granularity smaller than commit granularity"); + _refcounts.initialize((HeapWord*)rs.base(), (HeapWord*)(rs.base() + align_size_up(rs.size(), page_size)), page_size); _commit_map.resize(rs.size() * commit_factor / alloc_granularity, /* in_resource_area */ false); } - virtual void commit_regions(uintptr_t start_idx, size_t num_regions) { - for (uintptr_t i = start_idx; i < start_idx + num_regions; i++) { - assert(!_commit_map.at(i), err_msg("Trying to commit storage at region "INTPTR_FORMAT" that is already committed", i)); - uintptr_t idx = region_idx_to_page_idx(i); + virtual void commit_regions(uint start_idx, size_t num_regions) { + for (uint i = start_idx; i < start_idx + num_regions; i++) { + assert(!_commit_map.at(i), err_msg("Trying to commit storage at region %u that is already committed", i)); + size_t idx = region_idx_to_page_idx(i); uint old_refcount = _refcounts.get_by_index(idx); bool zero_filled = false; if (old_refcount == 0) { @@ -125,10 +126,10 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper { } } - virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) { - for (uintptr_t i = start_idx; i < start_idx + num_regions; i++) { - assert(_commit_map.at(i), err_msg("Trying to uncommit storage at region "INTPTR_FORMAT" that is not committed", i)); - uintptr_t idx = region_idx_to_page_idx(i); + virtual void uncommit_regions(uint start_idx, size_t num_regions) { + for (uint i = start_idx; i < start_idx + num_regions; i++) { + assert(_commit_map.at(i), err_msg("Trying to uncommit storage at region %u that is not committed", i)); + size_t idx = region_idx_to_page_idx(i); uint old_refcount = _refcounts.get_by_index(idx); assert(old_refcount > 0, "must be"); if (old_refcount == 1) { @@ -147,14 +148,15 @@ void G1RegionToSpaceMapper::fire_on_commit(uint start_idx, size_t num_regions, b } G1RegionToSpaceMapper* G1RegionToSpaceMapper::create_mapper(ReservedSpace rs, - size_t os_commit_granularity, + size_t actual_size, + size_t page_size, size_t region_granularity, size_t commit_factor, MemoryType type) { - if (region_granularity >= (os_commit_granularity * commit_factor)) { - return new G1RegionsLargerThanCommitSizeMapper(rs, os_commit_granularity, region_granularity, commit_factor, type); + if (region_granularity >= (page_size * commit_factor)) { + return new G1RegionsLargerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type); } else { - return new G1RegionsSmallerThanCommitSizeMapper(rs, os_commit_granularity, region_granularity, commit_factor, type); + return new G1RegionsSmallerThanCommitSizeMapper(rs, actual_size, page_size, region_granularity, commit_factor, type); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp index e46877785d7..6623a37f9d0 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.hpp @@ -46,12 +46,12 @@ class G1RegionToSpaceMapper : public CHeapObj { protected: // Backing storage. G1PageBasedVirtualSpace _storage; - size_t _commit_granularity; + size_t _region_granularity; // Mapping management BitMap _commit_map; - G1RegionToSpaceMapper(ReservedSpace rs, size_t commit_granularity, size_t region_granularity, MemoryType type); + G1RegionToSpaceMapper(ReservedSpace rs, size_t used_size, size_t page_size, size_t region_granularity, MemoryType type); void fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled); public: @@ -70,16 +70,20 @@ class G1RegionToSpaceMapper : public CHeapObj { return _commit_map.at(idx); } - virtual void commit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0; - virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions = 1) = 0; + virtual void commit_regions(uint start_idx, size_t num_regions = 1) = 0; + virtual void uncommit_regions(uint start_idx, size_t num_regions = 1) = 0; // Creates an appropriate G1RegionToSpaceMapper for the given parameters. + // The actual space to be used within the given reservation is given by actual_size. + // This is because some OSes need to round up the reservation size to guarantee + // alignment of page_size. // The byte_translation_factor defines how many bytes in a region correspond to // a single byte in the data structure this mapper is for. // Eg. in the card table, this value corresponds to the size a single card - // table entry corresponds to. + // table entry corresponds to in the heap. static G1RegionToSpaceMapper* create_mapper(ReservedSpace rs, - size_t os_commit_granularity, + size_t actual_size, + size_t page_size, size_t region_granularity, size_t byte_translation_factor, MemoryType type); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index b452f9adca2..1bc162f328d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -38,6 +38,7 @@ #include "oops/oop.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/intHisto.hpp" +#include "utilities/stack.inline.hpp" #define CARD_REPEAT_HISTO 0 diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp index 523817d4994..ee32c64a426 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ inline void G1RemSet::par_write_ref(HeapRegion* from, T* p, uint tid) { oopDesc* o = obj; #endif // CHECK_UNHANDLED_OOPS assert((intptr_t)o % MinObjAlignmentInBytes == 0, "not oop aligned"); - assert(Universe::heap()->is_in_reserved(obj), "must be in heap"); + assert(_g1->is_in_reserved(obj), "must be in heap"); #endif // ASSERT assert(from == NULL || from->is_in_reserved(p), "p is not in from"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp index 0a31dc72111..84d57271000 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.cpp @@ -116,7 +116,7 @@ void G1RootProcessor::wait_until_all_strong_classes_discovered() { G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h) : _g1h(g1h), _process_strong_tasks(new SubTasksDone(G1RP_PS_NumElements)), - _srs(g1h), + _srs(), _lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never), _n_workers_discovered_strong_classes(0) {} @@ -253,7 +253,8 @@ void G1RootProcessor::process_java_roots(OopClosure* strong_roots, { G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i); - Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code); + bool is_par = _g1h->n_par_threads() > 0; + Threads::possibly_parallel_oops_do(is_par, strong_roots, thread_stack_clds, strong_code); } } @@ -323,10 +324,6 @@ void G1RootProcessor::process_vm_roots(OopClosure* strong_roots, void G1RootProcessor::scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs, OopClosure* scan_non_heap_weak_roots, uint worker_i) { - G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times(); - G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CodeCacheRoots, worker_i); - - // Now scan the complement of the collection set. G1CodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots); _g1h->g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp index ee7b00f22ae..38287e784ba 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RootProcessor.hpp @@ -26,7 +26,7 @@ #define SHARE_VM_GC_IMPLEMENTATION_G1_ROOTPROCESSOR_HPP #include "memory/allocation.hpp" -#include "memory/sharedHeap.hpp" +#include "memory/strongRootsScope.hpp" #include "runtime/mutex.hpp" class CLDClosure; @@ -46,7 +46,7 @@ class SubTasksDone; class G1RootProcessor : public StackObj { G1CollectedHeap* _g1h; SubTasksDone* _process_strong_tasks; - SharedHeap::StrongRootsScope _srs; + StrongRootsScope _srs; // Used to implement the Thread work barrier. Monitor _lock; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index 829faeb4f87..1778abd10a7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -206,7 +206,7 @@ G1SATBCardTableLoggingModRefBS::write_ref_field_static(void* field, if (new_val == NULL) return; // Otherwise, log it. G1SATBCardTableLoggingModRefBS* g1_bs = - barrier_set_cast(Universe::heap()->barrier_set()); + barrier_set_cast(G1CollectedHeap::heap()->barrier_set()); g1_bs->write_ref_field_work(field, new_val); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp index 80ad7983939..1e2c5e4970f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/javaClasses.inline.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/g1StringDedup.hpp" #include "gc_implementation/g1/g1StringDedupQueue.hpp" #include "memory/gcLocker.hpp" @@ -163,7 +164,7 @@ void G1StringDedupQueue::verify() { while (!iter.is_empty()) { oop obj = iter.next(); if (obj != NULL) { - guarantee(Universe::heap()->is_in_reserved(obj), "Object must be on the heap"); + guarantee(G1CollectedHeap::heap()->is_in_reserved(obj), "Object must be on the heap"); guarantee(!obj->is_forwarded(), "Object must not be forwarded"); guarantee(java_lang_String::is_instance(obj), "Object must be a String"); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp index a9d2d790e32..7c998fa51e8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.inline.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" +#include "gc_implementation/g1/g1StringDedup.hpp" #include "gc_implementation/g1/g1StringDedupTable.hpp" #include "memory/gcLocker.hpp" #include "memory/padded.inline.hpp" @@ -519,7 +520,7 @@ void G1StringDedupTable::verify() { while (*entry != NULL) { typeArrayOop value = (*entry)->obj(); guarantee(value != NULL, "Object must not be NULL"); - guarantee(Universe::heap()->is_in_reserved(value), "Object must be on the heap"); + guarantee(G1CollectedHeap::heap()->is_in_reserved(value), "Object must be on the heap"); guarantee(!value->is_forwarded(), "Object must not be forwarded"); guarantee(value->is_typeArray(), "Object must be a typeArrayOop"); unsigned int hash = hash_code(value); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.hpp index f357523c513..75f25f3db0c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.hpp @@ -29,6 +29,7 @@ #include "runtime/mutexLocker.hpp" class G1StringDedupEntryCache; +class G1StringDedupUnlinkOrOopsDoClosure; // // Table entry in the deduplication hashtable. Points weakly to the diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index d1da538bacc..859cfc2fdbe 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -41,15 +41,6 @@ develop(intx, G1MarkingVerboseLevel, 0, \ "Level (0-4) of verboseness of the marking code") \ \ - develop(bool, G1PrintReachableAtInitialMark, false, \ - "Reachable object dump at the initial mark pause") \ - \ - develop(bool, G1VerifyDuringGCPrintReachable, false, \ - "If conc mark verification fails, dump reachable objects") \ - \ - develop(ccstr, G1PrintReachableBaseFile, NULL, \ - "The base file name for the reachable object dumps") \ - \ develop(bool, G1TraceMarkStackOverflow, false, \ "If true, extra debugging code for CM restart for ovflw.") \ \ @@ -99,9 +90,6 @@ "the buffer will be enqueued for processing. A value of 0 " \ "specifies that mutator threads should not do such filtering.") \ \ - develop(bool, G1SATBPrintStubs, false, \ - "If true, print generated stubs for the SATB barrier") \ - \ experimental(intx, G1ExpandByPercentOfAvailable, 20, \ "When expanding, % of uncommitted space to claim.") \ \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp index ec5fb14e116..2e971906650 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp @@ -31,7 +31,6 @@ #include "gc_implementation/g1/survRateGroup.hpp" #include "gc_implementation/shared/ageTable.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" -#include "memory/space.inline.hpp" #include "memory/watermark.hpp" #include "utilities/macros.hpp" @@ -45,6 +44,7 @@ // The solution is to remove this method from the definition // of a Space. +class G1CollectedHeap; class HeapRegionRemSet; class HeapRegionRemSetIterator; class HeapRegion; diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp index a6c70ef1613..1c28a8e1f5d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionManager.cpp @@ -330,8 +330,12 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, Heap assert(!hrclaimer->is_region_claimed(ch_index), "Must not have been claimed yet because claiming of humongous continuation first claims the start region"); - // There's no need to actually claim the continues humongous region, but we can do it in an assert as an extra precaution. - assert(hrclaimer->claim_region(ch_index), "We should always be able to claim the continuesHumongous part of the humongous object"); + // Claim the region so no other worker tries to process the region. When a worker processes a + // starts_humongous region it may also process the associated continues_humongous regions. + // The continues_humongous regions can be changed to free regions. Unless this worker claims + // all of these regions, other workers might try claim and process these newly free regions. + bool claim_result = hrclaimer->claim_region(ch_index); + guarantee(claim_result, "We should always be able to claim the continuesHumongous part of the humongous object"); bool res2 = blk->doHeapRegion(chr); if (res2) { diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp index 9657356c3bb..7f55ac0540d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp @@ -419,6 +419,7 @@ void FreeRegionList_test() { ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size())); G1RegionToSpaceMapper* bot_storage = G1RegionToSpaceMapper::create_mapper(bot_rs, + bot_rs.size(), os::vm_page_size(), HeapRegion::GrainBytes, G1BlockOffsetSharedArray::N_bytes, diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp index 4da322feb7a..b3bbf570cbe 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,38 +25,75 @@ #include "precompiled.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/satbQueue.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/allocation.inline.hpp" -#include "memory/sharedHeap.hpp" #include "oops/oop.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/thread.hpp" #include "runtime/vmThread.hpp" void ObjPtrQueue::flush() { - // The buffer might contain refs into the CSet. We have to filter it - // first before we flush it, otherwise we might end up with an - // enqueued buffer with refs into the CSet which breaks our invariants. + // Filter now to possibly save work later. If filtering empties the + // buffer then flush_impl can deallocate the buffer. filter(); flush_impl(); } -// This method removes entries from an SATB buffer that will not be -// useful to the concurrent marking threads. An entry is removed if it -// satisfies one of the following conditions: +// Return true if a SATB buffer entry refers to an object that +// requires marking. // -// * it points to an object outside the G1 heap (G1's concurrent -// marking only visits objects inside the G1 heap), -// * it points to an object that has been allocated since marking -// started (according to SATB those objects do not need to be -// visited during marking), or -// * it points to an object that has already been marked (no need to -// process it again). +// The entry must point into the G1 heap. In particular, it must not +// be a NULL pointer. NULL pointers are pre-filtered and never +// inserted into a SATB buffer. // -// The rest of the entries will be retained and are compacted towards -// the top of the buffer. Note that, because we do not allow old -// regions in the CSet during marking, all objects on the CSet regions -// are young (eden or survivors) and therefore implicitly live. So any -// references into the CSet will be removed during filtering. +// An entry that is below the NTAMS pointer for the containing heap +// region requires marking. Such an entry must point to a valid object. +// +// An entry that is at least the NTAMS pointer for the containing heap +// region might be any of the following, none of which should be marked. +// +// * A reference to an object allocated since marking started. +// According to SATB, such objects are implicitly kept live and do +// not need to be dealt with via SATB buffer processing. +// +// * A reference to a young generation object. Young objects are +// handled separately and are not marked by concurrent marking. +// +// * A stale reference to a young generation object. If a young +// generation object reference is recorded and not filtered out +// before being moved by a young collection, the reference becomes +// stale. +// +// * A stale reference to an eagerly reclaimed humongous object. If a +// humongous object is recorded and then reclaimed, the reference +// becomes stale. +// +// The stale reference cases are implicitly handled by the NTAMS +// comparison. Because of the possibility of stale references, buffer +// processing must be somewhat circumspect and not assume entries +// in an unfiltered buffer refer to valid objects. + +inline bool requires_marking(const void* entry, G1CollectedHeap* heap) { + // Includes rejection of NULL pointers. + assert(heap->is_in_reserved(entry), + err_msg("Non-heap pointer in SATB buffer: " PTR_FORMAT, p2i(entry))); + + HeapRegion* region = heap->heap_region_containing_raw(entry); + assert(region != NULL, err_msg("No region for " PTR_FORMAT, p2i(entry))); + if (entry >= region->next_top_at_mark_start()) { + return false; + } + + assert(((oop)entry)->is_oop(true /* ignore mark word */), + err_msg("Invalid oop in SATB buffer: " PTR_FORMAT, p2i(entry))); + + return true; +} + +// This method removes entries from a SATB buffer that will not be +// useful to the concurrent marking threads. Entries are retained if +// they require marking and are not already marked. Retained entries +// are compacted toward the top of the buffer. void ObjPtrQueue::filter() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -78,26 +115,25 @@ void ObjPtrQueue::filter() { assert(i > 0, "we should have at least one more entry to process"); i -= oopSize; debug_only(entries += 1;) - oop* p = (oop*) &buf[byte_index_to_index((int) i)]; - oop obj = *p; + void** p = &buf[byte_index_to_index((int) i)]; + void* entry = *p; // NULL the entry so that unused parts of the buffer contain NULLs // at the end. If we are going to retain it we will copy it to its // final place. If we have retained all entries we have visited so // far, we'll just end up copying it to the same place. *p = NULL; - bool retain = g1h->is_obj_ill(obj); - if (retain) { + if (requires_marking(entry, g1h) && !g1h->isMarkedNext((oop)entry)) { assert(new_index > 0, "we should not have already filled up the buffer"); new_index -= oopSize; assert(new_index >= i, "new_index should never be below i, as we always compact 'up'"); - oop* new_p = (oop*) &buf[byte_index_to_index((int) new_index)]; + void** new_p = &buf[byte_index_to_index((int) new_index)]; assert(new_p >= p, "the destination location should never be below " "the source as we always compact 'up'"); assert(*new_p == NULL, "we should have already cleared the destination location"); - *new_p = obj; + *new_p = entry; debug_only(retained += 1;) } } @@ -144,12 +180,6 @@ bool ObjPtrQueue::should_enqueue_buffer() { return should_enqueue; } -void ObjPtrQueue::apply_closure(ObjectClosure* cl) { - if (_buf != NULL) { - apply_closure_to_buffer(cl, _buf, _index, _sz); - } -} - void ObjPtrQueue::apply_closure_and_empty(ObjectClosure* cl) { if (_buf != NULL) { apply_closure_to_buffer(cl, _buf, _index, _sz); @@ -184,23 +214,12 @@ void ObjPtrQueue::print(const char* name, } #endif // PRODUCT -#ifdef ASSERT -void ObjPtrQueue::verify_oops_in_buffer() { - if (_buf == NULL) return; - for (size_t i = _index; i < _sz; i += oopSize) { - oop obj = (oop)_buf[byte_index_to_index((int)i)]; - assert(obj != NULL && obj->is_oop(true /* ignore mark word */), - "Not an oop"); - } -} -#endif - #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away #pragma warning( disable:4355 ) // 'this' : used in base member initializer list #endif // _MSC_VER SATBMarkQueueSet::SATBMarkQueueSet() : - PtrQueueSet(), _closures(NULL), + PtrQueueSet(), _shared_satb_queue(this, true /*perm*/) { } void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, @@ -208,11 +227,9 @@ void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, Mutex* lock) { PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); _shared_satb_queue.set_lock(lock); - _closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads, mtGC); } void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { - DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();) t->satb_mark_queue().handle_zero_index(); } @@ -272,13 +289,7 @@ void SATBMarkQueueSet::filter_thread_buffers() { shared_satb_queue()->filter(); } -void SATBMarkQueueSet::set_closure(uint worker, ObjectClosure* closure) { - assert(_closures != NULL, "Precondition"); - assert(worker < ParallelGCThreads, "Worker index must be in range [0...ParallelGCThreads)"); - _closures[worker] = closure; -} - -bool SATBMarkQueueSet::apply_closure_to_completed_buffer(uint worker) { +bool SATBMarkQueueSet::apply_closure_to_completed_buffer(ObjectClosure* cl) { BufferNode* nd = NULL; { MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); @@ -290,7 +301,6 @@ bool SATBMarkQueueSet::apply_closure_to_completed_buffer(uint worker) { if (_n_completed_buffers == 0) _process_completed = false; } } - ObjectClosure* cl = _closures[worker]; if (nd != NULL) { void **buf = BufferNode::make_buffer_from_node(nd); ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz); @@ -301,28 +311,6 @@ bool SATBMarkQueueSet::apply_closure_to_completed_buffer(uint worker) { } } -void SATBMarkQueueSet::iterate_completed_buffers_read_only(ObjectClosure* cl) { - assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - assert(cl != NULL, "pre-condition"); - - BufferNode* nd = _completed_buffers_head; - while (nd != NULL) { - void** buf = BufferNode::make_buffer_from_node(nd); - ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz); - nd = nd->next(); - } -} - -void SATBMarkQueueSet::iterate_thread_buffers_read_only(ObjectClosure* cl) { - assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - assert(cl != NULL, "pre-condition"); - - for (JavaThread* t = Threads::first(); t; t = t->next()) { - t->satb_mark_queue().apply_closure(cl); - } - shared_satb_queue()->apply_closure(cl); -} - #ifndef PRODUCT // Helpful for debugging diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp index 89c42c8947e..596904d06df 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,9 +41,6 @@ private: // Filter out unwanted entries from the buffer. void filter(); - // Apply the closure to all elements. - void apply_closure(ObjectClosure* cl); - // Apply the closure to all elements and empty the buffer; void apply_closure_and_empty(ObjectClosure* cl); @@ -72,13 +69,9 @@ public: void print(const char* name); static void print(const char* name, void** buf, size_t index, size_t sz); #endif // PRODUCT - - void verify_oops_in_buffer() NOT_DEBUG_RETURN; }; class SATBMarkQueueSet: public PtrQueueSet { - ObjectClosure** _closures; // One per ParGCThread. - ObjPtrQueue _shared_satb_queue; #ifdef ASSERT @@ -104,22 +97,10 @@ public: // Filter all the currently-active SATB buffers. void filter_thread_buffers(); - // Register closure for the given worker thread. The "apply_closure_to_completed_buffer" - // method will apply this closure to a completed buffer, and "iterate_closure_all_threads" - // applies it to partially-filled buffers (the latter should only be done - // with the world stopped). - void set_closure(uint worker, ObjectClosure* closure); - // If there exists some completed buffer, pop it, then apply the - // registered closure to all its elements, and return true. If no + // closure to all its elements, and return true. If no // completed buffers exist, return false. - bool apply_closure_to_completed_buffer(uint worker); - - // Apply the given closure on enqueued and currently-active buffers - // respectively. Both methods are read-only, i.e., they do not - // modify any of the buffers. - void iterate_completed_buffers_read_only(ObjectClosure* cl); - void iterate_thread_buffers_read_only(ObjectClosure* cl); + bool apply_closure_to_completed_buffer(ObjectClosure* closure); #ifndef PRODUCT // Helpful for debugging 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 00238e177f9..58f70a363bd 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp @@ -26,8 +26,8 @@ #define SHARE_VM_GC_IMPLEMENTATION_G1_VMSTRUCTS_G1_HPP #include "gc_implementation/g1/heapRegion.hpp" -#include "gc_implementation/g1/heapRegionManager.inline.hpp" -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/heapRegionManager.hpp" +#include "gc_implementation/g1/g1CollectedHeap.hpp" #define VM_STRUCTS_G1(nonstatic_field, static_field) \ \ @@ -70,7 +70,7 @@ \ declare_toplevel_type(G1HeapRegionTable) \ \ - declare_type(G1CollectedHeap, SharedHeap) \ + declare_type(G1CollectedHeap, CollectedHeap) \ \ declare_type(G1OffsetTableContigSpace, CompactibleSpace) \ declare_type(HeapRegion, G1OffsetTableContigSpace) \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index 47267f21d53..c4ffabc3f7e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -225,15 +225,10 @@ void VM_CGC_Operation::release_and_notify_pending_list_lock() { void VM_CGC_Operation::doit() { TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); - GCTraceTime t(_printGCMessage, G1Log::fine(), true, G1CollectedHeap::heap()->gc_timer_cm(), G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()); - SharedHeap* sh = SharedHeap::heap(); - // This could go away if CollectedHeap gave access to _gc_is_active... - if (sh != NULL) { - IsGCActiveMark x; - _cl->do_void(); - } else { - _cl->do_void(); - } + G1CollectedHeap* g1h = G1CollectedHeap::heap(); + GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm(), g1h->concurrent_mark()->concurrent_gc_id()); + IsGCActiveMark x; + _cl->do_void(); } bool VM_CGC_Operation::doit_prologue() { @@ -244,14 +239,12 @@ bool VM_CGC_Operation::doit_prologue() { } Heap_lock->lock(); - SharedHeap::heap()->_thread_holds_heap_lock_for_gc = true; return true; } void VM_CGC_Operation::doit_epilogue() { // Note the relative order of the unlocks must match that in // VM_GC_Operation::doit_epilogue() - SharedHeap::heap()->_thread_holds_heap_lock_for_gc = false; Heap_lock->unlock(); if (_needs_pll) { release_and_notify_pending_list_lock(); diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp index 9ab76383957..24e7564d941 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp @@ -23,17 +23,17 @@ */ #include "precompiled.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/allocation.inline.hpp" #include "memory/cardTableModRefBS.hpp" #include "memory/cardTableRS.hpp" -#include "memory/sharedHeap.hpp" +#include "memory/genCollectedHeap.hpp" #include "memory/space.inline.hpp" -#include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.inline.hpp" -#include "runtime/virtualspace.hpp" #include "runtime/vmThread.hpp" void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr, @@ -449,7 +449,7 @@ get_LNC_array_for_space(Space* sp, // Do a dirty read here. If we pass the conditional then take the rare // event lock and do the read again in case some other thread had already // succeeded and done the resize. - int cur_collection = Universe::heap()->total_collections(); + int cur_collection = GenCollectedHeap::heap()->total_collections(); if (_last_LNC_resizing_collection[i] != cur_collection) { MutexLocker x(ParGCRareEvent_lock); if (_last_LNC_resizing_collection[i] != cur_collection) { diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index 775a6a513c6..68b04be6b79 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -34,7 +34,7 @@ #include "gc_implementation/shared/gcTimer.hpp" #include "gc_implementation/shared/gcTrace.hpp" #include "gc_implementation/shared/gcTraceTime.hpp" -#include "gc_implementation/shared/parGCAllocBuffer.inline.hpp" +#include "gc_implementation/shared/plab.inline.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" #include "memory/defNewGeneration.inline.hpp" #include "memory/genCollectedHeap.hpp" @@ -42,7 +42,7 @@ #include "memory/generation.hpp" #include "memory/referencePolicy.hpp" #include "memory/resourceArea.hpp" -#include "memory/sharedHeap.hpp" +#include "memory/strongRootsScope.hpp" #include "memory/space.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" @@ -53,6 +53,7 @@ #include "runtime/thread.inline.hpp" #include "utilities/copy.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/stack.inline.hpp" #include "utilities/workgroup.hpp" #ifdef _MSC_VER @@ -117,7 +118,7 @@ bool ParScanThreadState::should_be_partially_scanned(oop new_obj, oop old_obj) c void ParScanThreadState::scan_partial_array_and_push_remainder(oop old) { assert(old->is_objArray(), "must be obj array"); assert(old->is_forwarded(), "must be forwarded"); - assert(Universe::heap()->is_in_reserved(old), "must be in heap."); + assert(GenCollectedHeap::heap()->is_in_reserved(old), "must be in heap."); assert(!old_gen()->is_in(old), "must be in young generation."); objArrayOop obj = objArrayOop(old->forwardee()); @@ -199,9 +200,9 @@ bool ParScanThreadState::take_from_overflow_stack() { for (size_t i = 0; i != num_take_elems; i++) { oop cur = of_stack->pop(); oop obj_to_push = cur->forwardee(); - assert(Universe::heap()->is_in_reserved(cur), "Should be in heap"); + assert(GenCollectedHeap::heap()->is_in_reserved(cur), "Should be in heap"); assert(!old_gen()->is_in_reserved(cur), "Should be in young gen"); - assert(Universe::heap()->is_in_reserved(obj_to_push), "Should be in heap"); + assert(GenCollectedHeap::heap()->is_in_reserved(obj_to_push), "Should be in heap"); if (should_be_partially_scanned(obj_to_push, cur)) { assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned"); obj_to_push = cur; @@ -225,7 +226,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) { // buffer. HeapWord* obj = NULL; if (!_to_space_full) { - ParGCAllocBuffer* const plab = to_space_alloc_buffer(); + PLAB* const plab = to_space_alloc_buffer(); Space* const sp = to_space(); if (word_sz * 100 < ParallelGCBufferWastePct * plab->word_sz()) { @@ -235,7 +236,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) { HeapWord* buf_space = sp->par_allocate(buf_size); if (buf_space == NULL) { const size_t min_bytes = - ParGCAllocBuffer::min_size() << LogHeapWordSize; + PLAB::min_size() << LogHeapWordSize; size_t free_bytes = sp->free(); while(buf_space == NULL && free_bytes >= min_bytes) { buf_size = free_bytes >> LogHeapWordSize; @@ -251,7 +252,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) { record_survivor_plab(buf_space, buf_size); obj = plab->allocate_aligned(word_sz, SurvivorAlignmentInBytes); // Note that we cannot compare buf_size < word_sz below - // because of AlignmentReserve (see ParGCAllocBuffer::allocate()). + // because of AlignmentReserve (see PLAB::allocate()). assert(obj != NULL || plab->words_remaining() < word_sz, "Else should have been able to allocate"); // It's conceivable that we may be able to use the @@ -596,8 +597,6 @@ void ParNewGenTask::work(uint worker_id) { // and handle marks. ResourceMark rm; HandleMark hm; - // We would need multiple old-gen queues otherwise. - assert(gch->n_gens() == 2, "Par young collection currently only works with one older gen."); ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id); assert(_state_set->is_valid(worker_id), "Should not have been called"); @@ -697,7 +696,7 @@ void /*ParNewGeneration::*/ParKeepAliveClosure::do_oop_work(T* p) { _par_cl->do_oop_nv(p); - if (Universe::heap()->is_in_reserved(p)) { + if (GenCollectedHeap::heap()->is_in_reserved(p)) { oop obj = oopDesc::load_decode_heap_oop_not_null(p); _rs->write_ref_field_gc_par(p, obj); } @@ -724,7 +723,7 @@ void /*ParNewGeneration::*/KeepAliveClosure::do_oop_work(T* p) { _cl->do_oop_nv(p); - if (Universe::heap()->is_in_reserved(p)) { + if (GenCollectedHeap::heap()->is_in_reserved(p)) { oop obj = oopDesc::load_decode_heap_oop_not_null(p); _rs->write_ref_field_gc_par(p, obj); } @@ -823,8 +822,6 @@ public: void ParNewRefProcTaskExecutor::execute(ProcessTask& task) { GenCollectedHeap* gch = GenCollectedHeap::heap(); - assert(gch->kind() == CollectedHeap::GenCollectedHeap, - "not a generational heap"); FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need parallel worker threads."); _state_set.reset(workers->active_workers(), _generation.promotion_failed()); @@ -899,7 +896,7 @@ void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThr _gc_tracer.report_promotion_failed(_promotion_failed_info); } // Reset the PromotionFailureALot counters. - NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) + NOT_PRODUCT(gch->reset_promotion_should_fail();) } void ParNewGeneration::collect(bool full, @@ -912,8 +909,6 @@ void ParNewGeneration::collect(bool full, _gc_timer->register_gc_start(); - assert(gch->kind() == CollectedHeap::GenCollectedHeap, - "not a CMS generational heap"); AdaptiveSizePolicy* size_policy = gch->gen_policy()->size_policy(); FlexibleWorkGang* workers = gch->workers(); assert(workers != NULL, "Need workgang for parallel work"); @@ -922,8 +917,6 @@ void ParNewGeneration::collect(bool full, workers->active_workers(), Threads::number_of_non_daemon_threads()); workers->set_active_workers(active_workers); - assert(gch->n_gens() == 2, - "Par collection currently only works with single older gen."); _old_gen = gch->old_gen(); // If the next generation is too full to accommodate worst-case promotion @@ -974,10 +967,10 @@ void ParNewGeneration::collect(bool full, // in the multi-threaded case, but we special-case n=1 here to get // repeatable measurements of the 1-thread overhead of the parallel code. if (n_workers > 1) { - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; workers->run_task(&tsk); } else { - GenCollectedHeap::StrongRootsScope srs(gch); + StrongRootsScope srs; tsk.work(0); } thread_state_set.reset(0 /* Bad value in debug if not reset */, @@ -1194,7 +1187,7 @@ oop ParNewGeneration::copy_to_survivor_space( } else { // Is in to-space; do copying ourselves. Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz); - assert(Universe::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value."); + assert(GenCollectedHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value."); forward_ptr = old->forward_to_atomic(new_obj); // Restore the mark word copied above. new_obj->set_mark(m); diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp index 8e81515ed69..cf6ca9a82e8 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp @@ -27,7 +27,7 @@ #include "gc_implementation/parNew/parOopClosures.hpp" #include "gc_implementation/shared/gcTrace.hpp" -#include "gc_implementation/shared/parGCAllocBuffer.hpp" +#include "gc_implementation/shared/plab.hpp" #include "gc_implementation/shared/copyFailedInfo.hpp" #include "memory/defNewGeneration.hpp" #include "memory/padded.hpp" @@ -65,7 +65,7 @@ class ParScanThreadState { ObjToScanQueue *_work_queue; Stack* const _overflow_stack; - ParGCAllocBuffer _to_space_alloc_buffer; + PLAB _to_space_alloc_buffer; ParScanWithoutBarrierClosure _to_space_closure; // scan_without_gc_barrier ParScanWithBarrierClosure _old_gen_closure; // scan_with_gc_barrier @@ -140,7 +140,7 @@ class ParScanThreadState { ObjToScanQueue* work_queue() { return _work_queue; } - ParGCAllocBuffer* to_space_alloc_buffer() { + PLAB* to_space_alloc_buffer() { return &_to_space_alloc_buffer; } diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.cpp new file mode 100644 index 00000000000..4b3f3f26adb --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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/iterator.inline.hpp" +#include "memory/specialized_oop_closures.hpp" +#include "gc_implementation/parNew/parOopClosures.inline.hpp" + +// Generate ParNew specialized oop_oop_iterate functions. +SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(ALL_KLASS_OOP_OOP_ITERATE_DEFN); 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 93000ce2f84..1c5d8f6e33f 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.inline.hpp @@ -70,7 +70,7 @@ template inline void ParScanClosure::do_oop_work(T* p, bool gc_barrier, bool root_scan) { - assert((!Universe::heap()->is_in_reserved(p) || + assert((!GenCollectedHeap::heap()->is_in_reserved(p) || generation()->is_in_reserved(p)) && (generation()->level() == 0 || gc_barrier), "The gen must be right, and we must be doing the barrier " @@ -82,7 +82,7 @@ inline void ParScanClosure::do_oop_work(T* p, #ifndef PRODUCT if (_g->to()->is_in_reserved(obj)) { tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p)); - GenCollectedHeap* gch = (GenCollectedHeap*)Universe::heap(); + GenCollectedHeap* gch = GenCollectedHeap::heap(); Space* sp = gch->space_containing(p); oop obj = oop(sp->block_start(p)); assert((HeapWord*)obj < (HeapWord*)p, "Error"); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp index d1a169b89b3..918720df89a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,7 @@ size_t ASPSOldGen::available_for_expansion() { assert(virtual_space()->is_aligned(gen_size_limit()), "not aligned"); assert(gen_size_limit() >= virtual_space()->committed_size(), "bad gen size"); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); size_t result = gen_size_limit() - virtual_space()->committed_size(); size_t result_aligned = align_size_down(result, heap->generation_alignment()); return result_aligned; @@ -101,7 +101,7 @@ size_t ASPSOldGen::available_for_contraction() { return uncommitted_bytes; } - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t gen_alignment = heap->generation_alignment(); PSAdaptiveSizePolicy* policy = heap->size_policy(); const size_t working_size = diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp index d711104e459..4395ce6f626 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,7 +73,7 @@ size_t ASPSYoungGen::available_for_expansion() { size_t current_committed_size = virtual_space()->committed_size(); assert((gen_size_limit() >= current_committed_size), "generation size limit is wrong"); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); size_t result = gen_size_limit() - current_committed_size; size_t result_aligned = align_size_down(result, heap->generation_alignment()); return result_aligned; @@ -91,7 +91,7 @@ size_t ASPSYoungGen::available_for_contraction() { if (eden_space()->is_empty()) { // Respect the minimum size for eden and for the young gen as a whole. - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t eden_alignment = heap->space_alignment(); const size_t gen_alignment = heap->generation_alignment(); @@ -128,7 +128,7 @@ size_t ASPSYoungGen::available_for_contraction() { // If to_space is below from_space, to_space is not considered. // to_space can be. size_t ASPSYoungGen::available_to_live() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t alignment = heap->space_alignment(); // Include any space that is committed but is not in eden. @@ -292,7 +292,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, assert(eden_start < from_start, "Cannot push into from_space"); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t alignment = heap->space_alignment(); const bool maintain_minimum = (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); @@ -345,8 +345,6 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, // Does the optimal to-space overlap from-space? if (to_start < (char*)from_space()->end()) { - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - // Calculate the minimum offset possible for from_end size_t from_size = pointer_delta(from_space()->top(), from_start, sizeof(char)); @@ -509,9 +507,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " "collection: %d " "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " @@ -542,7 +538,7 @@ void ASPSYoungGen::reset_after_change() { } MemRegion cmr((HeapWord*)virtual_space()->low(), (HeapWord*)virtual_space()->high()); - Universe::heap()->barrier_set()->resize_covered_region(cmr); + ParallelScavengeHeap::heap()->barrier_set()->resize_covered_region(cmr); space_invariants(); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp index 3523ff514d8..2ad1128edba 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @@ -76,9 +76,7 @@ class CheckForUnmarkedObjects : public ObjectClosure { public: CheckForUnmarkedObjects() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _young_gen = heap->young_gen(); _card_table = barrier_set_cast(heap->barrier_set()); // No point in asserting barrier set type here. Need to make CardTableExtension @@ -325,9 +323,7 @@ void CardTableExtension::scavenge_contents_parallel(ObjectStartArray* start_arra void CardTableExtension::verify_all_young_refs_imprecise() { CheckForUnmarkedObjects check; - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); old_gen->object_iterate(&check); @@ -335,9 +331,7 @@ void CardTableExtension::verify_all_young_refs_imprecise() { // This should be called immediately after a scavenge, before mutators resume. void CardTableExtension::verify_all_young_refs_precise() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); CheckForPreciseMarks check( @@ -351,7 +345,7 @@ void CardTableExtension::verify_all_young_refs_precise() { void CardTableExtension::verify_all_young_refs_precise_helper(MemRegion mr) { CardTableExtension* card_table = - barrier_set_cast(Universe::heap()->barrier_set()); + barrier_set_cast(ParallelScavengeHeap::heap()->barrier_set()); jbyte* bot = card_table->byte_for(mr.start()); jbyte* top = card_table->byte_for(mr.end()); @@ -523,7 +517,7 @@ bool CardTableExtension::resize_commit_uncommit(int changed_region, cur_committed = new_committed; } #ifdef ASSERT - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); assert(cur_committed.start() == (HeapWord*) align_size_up((uintptr_t) cur_committed.start(), os::vm_page_size()), diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index a50328680bc..6f35768cfea 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -49,42 +49,25 @@ PSYoungGen* ParallelScavengeHeap::_young_gen = NULL; PSOldGen* ParallelScavengeHeap::_old_gen = NULL; PSAdaptiveSizePolicy* ParallelScavengeHeap::_size_policy = NULL; PSGCAdaptivePolicyCounters* ParallelScavengeHeap::_gc_policy_counters = NULL; -ParallelScavengeHeap* ParallelScavengeHeap::_psh = NULL; GCTaskManager* ParallelScavengeHeap::_gc_task_manager = NULL; jint ParallelScavengeHeap::initialize() { CollectedHeap::pre_initialize(); - // Initialize collector policy - _collector_policy = new GenerationSizer(); - _collector_policy->initialize_all(); - const size_t heap_size = _collector_policy->max_heap_byte_size(); ReservedSpace heap_rs = Universe::reserve_heap(heap_size, _collector_policy->heap_alignment()); - MemTracker::record_virtual_memory_type((address)heap_rs.base(), mtJavaHeap); os::trace_page_sizes("ps main", _collector_policy->min_heap_byte_size(), heap_size, generation_alignment(), heap_rs.base(), heap_rs.size()); - if (!heap_rs.is_reserved()) { - vm_shutdown_during_initialization( - "Could not reserve enough space for object heap"); - return JNI_ENOMEM; - } initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size())); CardTableExtension* const barrier_set = new CardTableExtension(reserved_region()); barrier_set->initialize(); - _barrier_set = barrier_set; - oopDesc::set_bs(_barrier_set); - if (_barrier_set == NULL) { - vm_shutdown_during_initialization( - "Could not reserve enough space for barrier set"); - return JNI_ENOMEM; - } + set_barrier_set(barrier_set); // Make up the generations // Calculate the maximum size that a generation can grow. This @@ -120,7 +103,6 @@ jint ParallelScavengeHeap::initialize() { // initialize the policy counters - 2 collectors, 3 generations _gc_policy_counters = new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 3, _size_policy); - _psh = this; // Set up the GCTaskManager _gc_task_manager = GCTaskManager::create(ParallelGCThreads); @@ -176,27 +158,11 @@ size_t ParallelScavengeHeap::max_capacity() const { } bool ParallelScavengeHeap::is_in(const void* p) const { - if (young_gen()->is_in(p)) { - return true; - } - - if (old_gen()->is_in(p)) { - return true; - } - - return false; + return young_gen()->is_in(p) || old_gen()->is_in(p); } bool ParallelScavengeHeap::is_in_reserved(const void* p) const { - if (young_gen()->is_in_reserved(p)) { - return true; - } - - if (old_gen()->is_in_reserved(p)) { - return true; - } - - return false; + return young_gen()->is_in_reserved(p) || old_gen()->is_in_reserved(p); } bool ParallelScavengeHeap::is_scavengable(const void* addr) { @@ -265,7 +231,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( // total_collections() value! { MutexLocker ml(Heap_lock); - gc_count = Universe::heap()->total_collections(); + gc_count = total_collections(); result = young_gen()->allocate(size); if (result != NULL) { @@ -315,8 +281,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( // This prevents us from looping until time out on requests that can // not be satisfied. if (op.prologue_succeeded()) { - assert(Universe::heap()->is_in_or_null(op.result()), - "result not in heap"); + assert(is_in_or_null(op.result()), "result not in heap"); // If GC was locked out during VM operation then retry allocation // and/or stall as necessary. @@ -426,7 +391,7 @@ void ParallelScavengeHeap::do_full_collection(bool clear_all_soft_refs) { HeapWord* ParallelScavengeHeap::failed_mem_allocate(size_t size) { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); - assert(!Universe::heap()->is_gc_active(), "not reentrant"); + assert(!is_gc_active(), "not reentrant"); assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); // We assume that allocation in eden will fail unless we collect. @@ -514,18 +479,14 @@ void ParallelScavengeHeap::collect(GCCause::Cause cause) { { MutexLocker ml(Heap_lock); // This value is guarded by the Heap_lock - gc_count = Universe::heap()->total_collections(); - full_gc_count = Universe::heap()->total_full_collections(); + gc_count = total_collections(); + full_gc_count = total_full_collections(); } VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause); VMThread::execute(&op); } -void ParallelScavengeHeap::oop_iterate(ExtendedOopClosure* cl) { - Unimplemented(); -} - void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) { young_gen()->object_iterate(cl); old_gen()->object_iterate(cl); @@ -661,9 +622,10 @@ void ParallelScavengeHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_trac } ParallelScavengeHeap* ParallelScavengeHeap::heap() { - assert(_psh != NULL, "Uninitialized access to ParallelScavengeHeap::heap()"); - assert(_psh->kind() == CollectedHeap::ParallelScavengeHeap, "not a parallel scavenge heap"); - return _psh; + CollectedHeap* heap = Universe::heap(); + assert(heap != NULL, "Uninitialized access to ParallelScavengeHeap::heap()"); + assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Not a ParallelScavengeHeap"); + return (ParallelScavengeHeap*)heap; } // Before delegating the resize to the young generation, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index 867bdbf55ee..d8bb56ae0a1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -32,8 +32,9 @@ #include "gc_implementation/parallelScavenge/psYoungGen.hpp" #include "gc_implementation/shared/gcPolicyCounters.hpp" #include "gc_implementation/shared/gcWhen.hpp" -#include "gc_interface/collectedHeap.inline.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/collectorPolicy.hpp" +#include "memory/strongRootsScope.hpp" #include "utilities/ostream.hpp" class AdjoiningGenerations; @@ -52,8 +53,6 @@ class ParallelScavengeHeap : public CollectedHeap { static PSAdaptiveSizePolicy* _size_policy; static PSGCAdaptivePolicyCounters* _gc_policy_counters; - static ParallelScavengeHeap* _psh; - GenerationSizer* _collector_policy; // Collection of generations that are adjacent in the @@ -75,7 +74,8 @@ class ParallelScavengeHeap : public CollectedHeap { HeapWord* mem_allocate_old_gen(size_t size); public: - ParallelScavengeHeap() : CollectedHeap(), _death_march_count(0) { } + ParallelScavengeHeap(GenerationSizer* policy) : + CollectedHeap(), _collector_policy(policy), _death_march_count(0) { } // For use by VM operations enum CollectionType { @@ -131,9 +131,6 @@ class ParallelScavengeHeap : public CollectedHeap { // the young gen. virtual bool is_scavengable(const void* addr); - // Does this heap support heap inspection? (+PrintClassHistogram) - bool supports_heap_inspection() const { return true; } - size_t max_capacity() const; // Whether p is in the allocated part of the heap @@ -201,7 +198,6 @@ class ParallelScavengeHeap : public CollectedHeap { // initializing stores to an object at this address. virtual bool can_elide_initializing_store_barrier(oop new_obj); - void oop_iterate(ExtendedOopClosure* cl); void object_iterate(ObjectClosure* cl); void safe_object_iterate(ObjectClosure* cl) { object_iterate(cl); } @@ -238,7 +234,7 @@ class ParallelScavengeHeap : public CollectedHeap { void gen_mangle_unused_area() PRODUCT_RETURN; // Call these in sequential code around the processing of strong roots. - class ParStrongRootsScope : public MarkingCodeBlobClosure::MarkScope { + class ParStrongRootsScope : public MarkScope { public: ParStrongRootsScope(); ~ParStrongRootsScope(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp index fc2cd8c6bea..b220c12aa82 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp @@ -41,13 +41,14 @@ #include "runtime/thread.hpp" #include "runtime/vmThread.hpp" #include "services/management.hpp" +#include "utilities/stack.inline.hpp" // // ThreadRootsMarkingTask // void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); ResourceMark rm; @@ -78,7 +79,7 @@ void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) { void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); NOT_PRODUCT(GCTraceTime tm("MarkFromRootsTask", PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id())); @@ -149,7 +150,7 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) { void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); NOT_PRODUCT(GCTraceTime tm("RefProcTask", PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id())); @@ -167,7 +168,7 @@ void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which) void RefProcTaskExecutor::execute(ProcessTask& task) { - ParallelScavengeHeap* heap = PSParallelCompact::gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); uint active_gc_threads = heap->gc_task_manager()->active_workers(); RegionTaskQueueSet* qset = ParCompactionManager::region_array(); @@ -188,7 +189,7 @@ void RefProcTaskExecutor::execute(ProcessTask& task) void RefProcTaskExecutor::execute(EnqueueTask& task) { - ParallelScavengeHeap* heap = PSParallelCompact::gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); GCTaskQueue* q = GCTaskQueue::create(); for(uint i=0; iis_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); NOT_PRODUCT(GCTraceTime tm("StealMarkingTask", PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id())); @@ -237,7 +238,7 @@ StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t): _terminator(t) {} void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask", PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id())); @@ -319,7 +320,7 @@ void UpdateDensePrefixTask::do_it(GCTaskManager* manager, uint which) { } void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); NOT_PRODUCT(GCTraceTime tm("DrainStacksCompactionTask", PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id())); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp index 70b619f813d..d56c4f777cd 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp @@ -30,7 +30,10 @@ #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.inline.hpp" +#include "memory/iterator.inline.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -57,8 +60,7 @@ ParCompactionManager::ParCompactionManager() : _region_stack(NULL), _region_stack_index((uint)max_uintx) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _old_gen = heap->old_gen(); _start_array = old_gen()->start_array(); @@ -174,6 +176,142 @@ ParCompactionManager::gc_thread_compaction_manager(int index) { return _manager_array[index]; } +void InstanceKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + assert(obj != NULL, "can't follow the content of NULL object"); + + PSParallelCompact::follow_klass(cm, this); + // Only mark the header and let the scan of the meta-data mark + // everything else. + + PSParallelCompact::MarkAndPushClosure cl(cm); + InstanceKlass::oop_oop_iterate_oop_maps(obj, &cl); +} + +void InstanceMirrorKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + InstanceKlass::oop_pc_follow_contents(obj, cm); + + // Follow the klass field in the mirror. + Klass* klass = java_lang_Class::as_Klass(obj); + if (klass != NULL) { + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. + if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { + PSParallelCompact::follow_class_loader(cm, klass->class_loader_data()); + } else { + PSParallelCompact::follow_klass(cm, klass); + } + } else { + // If klass is NULL then this a mirror for a primitive type. + // We don't have to follow them, since they are handled as strong + // roots in Universe::oops_do. + assert(java_lang_Class::is_primitive(obj), "Sanity check"); + } + + PSParallelCompact::MarkAndPushClosure cl(cm); + oop_oop_iterate_statics(obj, &cl); +} + +void InstanceClassLoaderKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + InstanceKlass::oop_pc_follow_contents(obj, cm); + + ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); + if (loader_data != NULL) { + PSParallelCompact::follow_class_loader(cm, loader_data); + } +} + +template +static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, ParCompactionManager* cm) { + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + T heap_oop = oopDesc::load_heap_oop(referent_addr); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj)); + } + ) + if (!oopDesc::is_null(heap_oop)) { + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); + if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) && + PSParallelCompact::ref_processor()->discover_reference(obj, klass->reference_type())) { + // reference already enqueued, referent will be traversed later + klass->InstanceKlass::oop_pc_follow_contents(obj, cm); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); + } + ) + return; + } else { + // treat referent as normal oop + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Non NULL normal " PTR_FORMAT, p2i(obj)); + } + ) + PSParallelCompact::mark_and_push(cm, referent_addr); + } + } + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + if (ReferenceProcessor::pending_list_uses_discovered_field()) { + // Treat discovered as normal oop, if ref is not "active", + // i.e. if next is non-NULL. + T next_oop = oopDesc::load_heap_oop(next_addr); + if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" + T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Process discovered as normal " + PTR_FORMAT, p2i(discovered_addr)); + } + ) + PSParallelCompact::mark_and_push(cm, discovered_addr); + } + } else { +#ifdef ASSERT + // In the case of older JDKs which do not use the discovered + // field for the pending list, an inactive ref (next != NULL) + // must always have a NULL discovered field. + T next = oopDesc::load_heap_oop(next_addr); + oop discovered = java_lang_ref_Reference::discovered(obj); + assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), + err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", + p2i(obj))); +#endif + } + PSParallelCompact::mark_and_push(cm, next_addr); + klass->InstanceKlass::oop_pc_follow_contents(obj, cm); +} + + +void InstanceRefKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + if (UseCompressedOops) { + oop_pc_follow_contents_specialized(this, obj, cm); + } else { + oop_pc_follow_contents_specialized(this, obj, cm); + } +} + +void ObjArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + PSParallelCompact::follow_klass(cm, this); + + if (UseCompressedOops) { + oop_pc_follow_contents_specialized(objArrayOop(obj), 0, cm); + } else { + oop_pc_follow_contents_specialized(objArrayOop(obj), 0, cm); + } +} + +void TypeArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { + assert(obj->is_typeArray(),"must be a type array"); + // Performance tweak: We skip iterating over the klass pointer since we + // know that Universe::TypeArrayKlass never moves. +} + void ParCompactionManager::follow_marking_stacks() { do { // Drain the overflow stack first, to allow stealing from the marking stack. diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp index 90c22306e7d..fb700318b9c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp @@ -26,9 +26,11 @@ #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP #include "gc_implementation/parallelScavenge/psCompactionManager.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" -#include "oops/objArrayKlass.inline.hpp" -#include "oops/oop.pcgc.inline.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.inline.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" void ParCompactionManager::push_objarray(oop obj, size_t index) { @@ -49,16 +51,42 @@ void ParCompactionManager::push_region(size_t index) } inline void ParCompactionManager::follow_contents(oop obj) { - obj->follow_contents(this); + assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked"); + obj->pc_follow_contents(this); +} + +template +inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) { + const size_t len = size_t(obj->length()); + const size_t beg_index = size_t(index); + assert(beg_index < len || len == 0, "index too large"); + + const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); + const size_t end_index = beg_index + stride; + T* const base = (T*)obj->base(); + T* const beg = base + beg_index; + T* const end = base + end_index; + + // Push the non-NULL elements of the next stride on the marking stack. + for (T* e = beg; e < end; e++) { + PSParallelCompact::mark_and_push(cm, e); + } + + if (end_index < len) { + cm->push_objarray(obj, end_index); // Push the continuation. + } } inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) { - ObjArrayKlass* k = (ObjArrayKlass*)obj->klass(); - k->oop_follow_contents(this, obj, index); + if (UseCompressedOops) { + oop_pc_follow_contents_specialized(obj, index, this); + } else { + oop_pc_follow_contents_specialized(obj, index, this); + } } inline void ParCompactionManager::update_contents(oop obj) { - obj->update_contents(this); + obj->pc_update_contents(); } #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp index 171f4643920..d676ddec86e 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @@ -59,7 +59,7 @@ jlong PSMarkSweep::_time_of_last_gc = 0; CollectorCounters* PSMarkSweep::_counters = NULL; void PSMarkSweep::initialize() { - MemRegion mr = Universe::heap()->reserved_region(); + MemRegion mr = ParallelScavengeHeap::heap()->reserved_region(); _ref_processor = new ReferenceProcessor(mr); // a vanilla ref proc _counters = new CollectorCounters("PSMarkSweep", 1); } @@ -81,9 +81,9 @@ void PSMarkSweep::initialize() { void PSMarkSweep::invoke(bool maximum_heap_compaction) { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); - assert(!Universe::heap()->is_gc_active(), "not reentrant"); + assert(!ParallelScavengeHeap::heap()->is_gc_active(), "not reentrant"); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCause::Cause gc_cause = heap->gc_cause(); PSAdaptiveSizePolicy* policy = heap->size_policy(); IsGCActiveMark mark; @@ -110,8 +110,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { return false; } - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCause::Cause gc_cause = heap->gc_cause(); _gc_timer->register_gc_start(); @@ -487,9 +486,7 @@ bool PSMarkSweep::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy, } void PSMarkSweep::allocate_stacks() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); MutableSpace* to_space = young_gen->to_space(); @@ -513,10 +510,8 @@ void PSMarkSweep::deallocate_stacks() { void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Recursively traverse all live objects and mark them GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace(" 1"); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); // Need to clear claim bits before the tracing starts. ClassLoaderDataGraph::clear_claimed_marks(); @@ -574,7 +569,6 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { void PSMarkSweep::mark_sweep_phase2() { GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("2"); // Now all live objects are marked, compute the new object addresses. @@ -582,9 +576,7 @@ void PSMarkSweep::mark_sweep_phase2() { // phase2, phase3 and phase4, but the ValidateMarkSweep live oops // tracking expects us to do so. See comment under phase4. - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); // Begin compacting into the old gen @@ -604,11 +596,8 @@ static PSAlwaysTrueClosure always_true; void PSMarkSweep::mark_sweep_phase3() { // Adjust the pointers to reflect the new locations GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("3"); - - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); PSOldGen* old_gen = heap->old_gen(); @@ -647,13 +636,10 @@ void PSMarkSweep::mark_sweep_phase3() { void PSMarkSweep::mark_sweep_phase4() { EventMark m("4 compact heap"); GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("4"); // All pointers are now adjusted, move objects accordingly - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); PSOldGen* old_gen = heap->old_gen(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp index 2cf025452b1..e1231c2999a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @@ -38,15 +38,12 @@ PSMarkSweepDecorator* PSMarkSweepDecorator::_destination_decorator = NULL; void PSMarkSweepDecorator::set_destination_decorator_tenured() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _destination_decorator = heap->old_gen()->object_mark_sweep(); } void PSMarkSweepDecorator::advance_destination_decorator() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); assert(_destination_decorator != NULL, "Sanity"); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp index 61c6caf5364..35c2ff91848 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp @@ -107,20 +107,22 @@ void PSOldGen::initialize_work(const char* perf_data_name, int level) { SpaceMangler::mangle_region(cmr); } - Universe::heap()->barrier_set()->resize_covered_region(cmr); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); + BarrierSet* bs = heap->barrier_set(); - CardTableModRefBS* _ct = - barrier_set_cast(Universe::heap()->barrier_set()); + bs->resize_covered_region(cmr); + + CardTableModRefBS* ct = barrier_set_cast(bs); // Verify that the start and end of this generation is the start of a card. // If this wasn't true, a single card could span more than one generation, // which would cause problems when we commit/uncommit memory, and when we // clear and dirty cards. - guarantee(_ct->is_card_aligned(_reserved.start()), "generation must be card aligned"); - if (_reserved.end() != Universe::heap()->reserved_region().end()) { + guarantee(ct->is_card_aligned(_reserved.start()), "generation must be card aligned"); + if (_reserved.end() != heap->reserved_region().end()) { // Don't check at the very end of the heap as we'll assert that we're probing off // the end if we try. - guarantee(_ct->is_card_aligned(_reserved.end()), "generation must be card aligned"); + guarantee(ct->is_card_aligned(_reserved.end()), "generation must be card aligned"); } // @@ -161,8 +163,7 @@ bool PSOldGen::is_allocated() { } void PSOldGen::precompact() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); // Reset start array first. start_array()->reset(); @@ -197,7 +198,7 @@ HeapWord* PSOldGen::allocate(size_t word_size) { // Allocations in the old generation need to be reported if (res != NULL) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); heap->size_policy()->tenured_allocation(word_size); } @@ -376,8 +377,7 @@ void PSOldGen::resize(size_t desired_free_space) { } if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); gclog_or_tty->print_cr("AdaptiveSizePolicy::old generation size: " "collection: %d " "(" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ", @@ -397,7 +397,7 @@ void PSOldGen::post_resize() { size_t new_word_size = new_memregion.word_size(); start_array()->set_covered_region(new_memregion); - Universe::heap()->barrier_set()->resize_covered_region(new_memregion); + ParallelScavengeHeap::heap()->barrier_set()->resize_covered_region(new_memregion); // ALWAYS do this last!! object_space()->initialize(new_memregion, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp index 0dbd4732f72..9322672680d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,11 +60,29 @@ class PSOldGen : public CHeapObj { // Used when initializing the _name field. static inline const char* select_name(); +#ifdef ASSERT + void assert_block_in_covered_region(MemRegion new_memregion) { + // Explictly capture current covered_region in a local + MemRegion covered_region = this->start_array()->covered_region(); + assert(covered_region.contains(new_memregion), + err_msg("new region is not in covered_region [ "PTR_FORMAT", "PTR_FORMAT" ], " + "new region [ "PTR_FORMAT", "PTR_FORMAT" ], " + "object space [ "PTR_FORMAT", "PTR_FORMAT" ]", + p2i(covered_region.start()), + p2i(covered_region.end()), + p2i(new_memregion.start()), + p2i(new_memregion.end()), + p2i(this->object_space()->used_region().start()), + p2i(this->object_space()->used_region().end()))); + } +#endif + HeapWord* allocate_noexpand(size_t word_size) { // We assume the heap lock is held here. assert_locked_or_safepoint(Heap_lock); HeapWord* res = object_space()->allocate(word_size); if (res != NULL) { + DEBUG_ONLY(assert_block_in_covered_region(MemRegion(res, word_size))); _start_array.allocate_block(res); } return res; @@ -77,6 +95,7 @@ class PSOldGen : public CHeapObj { assert(SafepointSynchronize::is_at_safepoint(), "Must only be called at safepoint"); HeapWord* res = object_space()->cas_allocate(word_size); if (res != NULL) { + DEBUG_ONLY(assert_block_in_covered_region(MemRegion(res, word_size))); _start_array.allocate_block(res); } return res; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index b8f60ffdadc..7ef05d16a62 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -34,7 +34,7 @@ #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" #include "gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" #include "gc_implementation/parallelScavenge/psYoungGen.hpp" @@ -48,7 +48,10 @@ #include "memory/gcLocker.inline.hpp" #include "memory/referencePolicy.hpp" #include "memory/referenceProcessor.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" #include "oops/methodData.hpp" +#include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/fprofiler.hpp" @@ -745,7 +748,7 @@ bool ParallelCompactData::summarize(SplitInfo& split_info, HeapWord* ParallelCompactData::calc_new_pointer(HeapWord* addr) { assert(addr != NULL, "Should detect NULL oop earlier"); - assert(PSParallelCompact::gc_heap()->is_in(addr), "not in heap"); + assert(ParallelScavengeHeap::heap()->is_in(addr), "not in heap"); assert(PSParallelCompact::mark_bitmap()->is_marked(addr), "not marked"); // Region covering the object. @@ -823,16 +826,8 @@ void PSParallelCompact::KeepAliveClosure::do_oop(narrowOop* p) { PSParallelCompa PSParallelCompact::AdjustPointerClosure PSParallelCompact::_adjust_pointer_closure; PSParallelCompact::AdjustKlassClosure PSParallelCompact::_adjust_klass_closure; -void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { adjust_pointer(p); } -void PSParallelCompact::AdjustPointerClosure::do_oop(narrowOop* p) { adjust_pointer(p); } - void PSParallelCompact::FollowStackClosure::do_void() { _compaction_manager->follow_marking_stacks(); } -void PSParallelCompact::MarkAndPushClosure::do_oop(oop* p) { - mark_and_push(_compaction_manager, p); -} -void PSParallelCompact::MarkAndPushClosure::do_oop(narrowOop* p) { mark_and_push(_compaction_manager, p); } - void PSParallelCompact::FollowKlassClosure::do_klass(Klass* klass) { klass->oops_do(_mark_and_push_closure); } @@ -841,9 +836,7 @@ void PSParallelCompact::AdjustKlassClosure::do_klass(Klass* klass) { } void PSParallelCompact::post_initialize() { - ParallelScavengeHeap* heap = gc_heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); MemRegion mr = heap->reserved_region(); _ref_processor = new ReferenceProcessor(mr, // span @@ -860,8 +853,7 @@ void PSParallelCompact::post_initialize() { } bool PSParallelCompact::initialize() { - ParallelScavengeHeap* heap = gc_heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); MemRegion mr = heap->reserved_region(); // Was the old gen get allocated successfully? @@ -895,7 +887,7 @@ void PSParallelCompact::initialize_space_info() { memset(&_space_info, 0, sizeof(_space_info)); - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); _space_info[old_space_id].set_space(heap->old_gen()->object_space()); @@ -978,7 +970,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) // promotion failure does not swap spaces) because an unknown number of minor // collections will have swapped the spaces an unknown number of times. GCTraceTime tm("pre compact", print_phases(), true, &_gc_timer, _gc_tracer.gc_id()); - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _space_info[from_space_id].set_space(heap->young_gen()->from_space()); _space_info[to_space_id].set_space(heap->young_gen()->to_space()); @@ -1033,7 +1025,7 @@ void PSParallelCompact::post_compact() MutableSpace* const from_space = _space_info[from_space_id].space(); MutableSpace* const to_space = _space_info[to_space_id].space(); - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); bool eden_empty = eden_space->is_empty(); if (!eden_empty) { eden_empty = absorb_live_data_from_eden(heap->size_policy(), @@ -1971,7 +1963,7 @@ void PSParallelCompact::invoke(bool maximum_heap_compaction) { assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCause::Cause gc_cause = heap->gc_cause(); assert(!heap->is_gc_active(), "not reentrant"); @@ -1999,7 +1991,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { return false; } - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _gc_timer.register_gc_start(); _gc_tracer.report_gc_start(heap->gc_cause(), _gc_timer.gc_start()); @@ -2352,7 +2344,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, // Recursively traverse all live objects and mark them GCTraceTime tm("marking phase", print_phases(), true, &_gc_timer, _gc_tracer.gc_id()); - ParallelScavengeHeap* heap = gc_heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); uint active_gc_threads = heap->gc_task_manager()->active_workers(); TaskQueueSetSuper* qset = ParCompactionManager::region_array(); @@ -2692,8 +2684,7 @@ void PSParallelCompact::compact() { // trace("5"); GCTraceTime tm("compaction phase", print_phases(), true, &_gc_timer, _gc_tracer.gc_id()); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); old_gen->start_array()->reset(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); @@ -2844,7 +2835,7 @@ PSParallelCompact::update_and_deadwood_in_dense_prefix(ParCompactionManager* cm, // heap, last_space_id is returned. In debug mode it expects the address to be // in the heap and asserts such. PSParallelCompact::SpaceId PSParallelCompact::space_id(HeapWord* addr) { - assert(Universe::heap()->is_in_reserved(addr), "addr not in the heap"); + assert(ParallelScavengeHeap::heap()->is_in_reserved(addr), "addr not in the heap"); for (unsigned int id = old_space_id; id < last_space_id; ++id) { if (_space_info[id].space()->contains(addr)) { @@ -3338,6 +3329,71 @@ void MoveAndUpdateClosure::copy_partial_obj() update_state(words); } +void InstanceKlass::oop_pc_update_pointers(oop obj) { + oop_oop_iterate_oop_maps(obj, PSParallelCompact::adjust_pointer_closure()); +} + +void InstanceMirrorKlass::oop_pc_update_pointers(oop obj) { + InstanceKlass::oop_pc_update_pointers(obj); + + oop_oop_iterate_statics(obj, PSParallelCompact::adjust_pointer_closure()); +} + +void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj) { + InstanceKlass::oop_pc_update_pointers(obj); +} + +#ifdef ASSERT +template static void trace_reference_gc(const char *s, oop obj, + T* referent_addr, + T* next_addr, + T* discovered_addr) { + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); + gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(referent_addr), + referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL); + gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(next_addr), + next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL); + gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(discovered_addr), + discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL); + } +} +#endif + +template +static void oop_pc_update_pointers_specialized(oop obj) { + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + PSParallelCompact::adjust_pointer(referent_addr); + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + PSParallelCompact::adjust_pointer(next_addr); + T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + PSParallelCompact::adjust_pointer(discovered_addr); + debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj, + referent_addr, next_addr, discovered_addr);) +} + +void InstanceRefKlass::oop_pc_update_pointers(oop obj) { + InstanceKlass::oop_pc_update_pointers(obj); + + if (UseCompressedOops) { + oop_pc_update_pointers_specialized(obj); + } else { + oop_pc_update_pointers_specialized(obj); + } +} + +void ObjArrayKlass::oop_pc_update_pointers(oop obj) { + assert(obj->is_objArray(), "obj must be obj array"); + oop_oop_iterate_elements(objArrayOop(obj), PSParallelCompact::adjust_pointer_closure()); +} + +void TypeArrayKlass::oop_pc_update_pointers(oop obj) { + assert(obj->is_typeArray(),"must be a type array"); +} + ParMarkBitMapClosure::IterationStatus MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) { assert(destination() != NULL, "sanity"); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp index 3e1f9198c57..1daa065e92e 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp @@ -26,11 +26,12 @@ #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP #include "gc_implementation/parallelScavenge/objectStartArray.hpp" +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp" #include "gc_implementation/parallelScavenge/psCompactionManager.hpp" #include "gc_implementation/shared/collectorCounters.hpp" #include "gc_implementation/shared/mutableSpace.hpp" -#include "memory/sharedHeap.hpp" +#include "gc_interface/collectedHeap.hpp" #include "oops/oop.hpp" class ParallelScavengeHeap; @@ -951,12 +952,14 @@ class PSParallelCompact : AllStatic { virtual void do_void(); }; - class AdjustPointerClosure: public OopClosure { + class AdjustPointerClosure: public ExtendedOopClosure { public: + template void do_oop_nv(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - // do not walk from thread stacks to the code cache on this phase - virtual void do_code_blob(CodeBlob* cb) const { } + + // This closure provides its own oop verification code. + debug_only(virtual bool should_verify_oops() { return false; }) }; class AdjustKlassClosure : public KlassClosure { @@ -1139,13 +1142,18 @@ class PSParallelCompact : AllStatic { static void reset_millis_since_last_gc(); public: - class MarkAndPushClosure: public OopClosure { + class MarkAndPushClosure: public ExtendedOopClosure { private: ParCompactionManager* _compaction_manager; public: MarkAndPushClosure(ParCompactionManager* cm) : _compaction_manager(cm) { } + + template void do_oop_nv(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); + + // This closure provides its own oop verification code. + debug_only(virtual bool should_verify_oops() { return false; }) }; // The one and only place to start following the classes. @@ -1161,11 +1169,6 @@ class PSParallelCompact : AllStatic { PSParallelCompact(); - // Convenient accessor for Universe::heap(). - static ParallelScavengeHeap* gc_heap() { - return (ParallelScavengeHeap*)Universe::heap(); - } - static void invoke(bool maximum_heap_compaction); static bool invoke_no_policy(bool maximum_heap_compaction); @@ -1177,7 +1180,9 @@ class PSParallelCompact : AllStatic { static bool initialize(); // Closure accessors - static OopClosure* adjust_pointer_closure() { return (OopClosure*)&_adjust_pointer_closure; } + static PSParallelCompact::AdjustPointerClosure* adjust_pointer_closure() { + return &_adjust_pointer_closure; + } static KlassClosure* adjust_klass_closure() { return (KlassClosure*)&_adjust_klass_closure; } static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&_is_alive_closure; } @@ -1332,39 +1337,6 @@ inline bool PSParallelCompact::is_marked(oop obj) { return mark_bitmap()->is_marked(obj); } -template -inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - if (mark_bitmap()->is_unmarked(obj) && mark_obj(obj)) { - cm->push(obj); - } - } -} - -template -inline void PSParallelCompact::adjust_pointer(T* p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - oop new_obj = (oop)summary_data().calc_new_pointer(obj); - assert(new_obj != NULL, // is forwarding ptr? - "should be forwarded"); - // Just always do the update unconditionally? - if (new_obj != NULL) { - assert(Universe::heap()->is_in_reserved(new_obj), - "should be in object space"); - oopDesc::encode_store_heap_oop_not_null(p, new_obj); - } - } -} - -inline void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { - oop holder = klass->klass_holder(); - PSParallelCompact::mark_and_push(cm, &holder); -} - template inline void PSParallelCompact::KeepAliveClosure::do_oop_work(T* p) { mark_and_push(_compaction_manager, p); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.inline.hpp new file mode 100644 index 00000000000..a817bd00051 --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.inline.hpp @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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_PARALLELSCAVENGE_PSPARALLELCOMPACT_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_INLINE_HPP + +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" +#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" +#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" +#include "gc_interface/collectedHeap.hpp" +#include "oops/klass.hpp" +#include "oops/oop.inline.hpp" + +template +inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(ParallelScavengeHeap::heap()->is_in(obj), "should be in heap"); + + if (mark_bitmap()->is_unmarked(obj) && mark_obj(obj)) { + cm->push(obj); + } + } +} + +template +inline void PSParallelCompact::MarkAndPushClosure::do_oop_nv(T* p) { + mark_and_push(_compaction_manager, p); +} + +inline void PSParallelCompact::MarkAndPushClosure::do_oop(oop* p) { do_oop_nv(p); } +inline void PSParallelCompact::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_nv(p); } + +inline void PSParallelCompact::follow_klass(ParCompactionManager* cm, Klass* klass) { + oop holder = klass->klass_holder(); + mark_and_push(cm, &holder); +} + +template +inline void PSParallelCompact::adjust_pointer(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(ParallelScavengeHeap::heap()->is_in(obj), "should be in heap"); + + oop new_obj = (oop)summary_data().calc_new_pointer(obj); + assert(new_obj != NULL, // is forwarding ptr? + "should be forwarded"); + // Just always do the update unconditionally? + if (new_obj != NULL) { + assert(ParallelScavengeHeap::heap()->is_in_reserved(new_obj), + "should be in object space"); + oopDesc::encode_store_heap_oop_not_null(p, new_obj); + } + } +} + +template +void PSParallelCompact::AdjustPointerClosure::do_oop_nv(T* p) { + adjust_pointer(p); +} + +inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); } +inline void PSParallelCompact::AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_nv(p); } + +#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp index fc05b2e95d8..6786be2146a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ void PSPromotionLAB::flush() { } bool PSPromotionLAB::unallocate_object(HeapWord* obj, size_t obj_size) { - assert(Universe::heap()->is_in(obj), "Object outside heap"); + assert(ParallelScavengeHeap::heap()->is_in(obj), "Object outside heap"); if (contains(obj)) { HeapWord* object_end = obj + obj_size; @@ -137,9 +137,7 @@ void PSOldPromotionLAB::flush() { #ifdef ASSERT bool PSYoungPromotionLAB::lab_is_valid(MemRegion lab) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); MutableSpace* to_space = heap->young_gen()->to_space(); MemRegion used = to_space->used_region(); if (used.contains(lab)) { @@ -150,10 +148,9 @@ bool PSYoungPromotionLAB::lab_is_valid(MemRegion lab) { } bool PSOldPromotionLAB::lab_is_valid(MemRegion lab) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); assert(_start_array->covered_region().contains(lab), "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); MemRegion used = old_gen->object_space()->used_region(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp index 05c27a3f3da..c214a13a0dd 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP #include "gc_implementation/parallelScavenge/objectStartArray.hpp" -#include "gc_interface/collectedHeap.inline.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/allocation.hpp" // @@ -59,7 +59,7 @@ class PSPromotionLAB : public CHeapObj { // The shared initialize code invokes this. debug_only(virtual bool lab_is_valid(MemRegion lab) { return false; }); - PSPromotionLAB() : _top(NULL), _bottom(NULL), _end(NULL) { } + PSPromotionLAB() : _top(NULL), _bottom(NULL), _end(NULL), _state(zero_size) { } public: // Filling and flushing. diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp index be4a9ed11d7..29076516b47 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp @@ -32,6 +32,9 @@ #include "memory/allocation.inline.hpp" #include "memory/memRegion.hpp" #include "memory/padded.inline.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" +#include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/stack.inline.hpp" @@ -41,8 +44,7 @@ PSOldGen* PSPromotionManager::_old_gen = NULL; MutableSpace* PSPromotionManager::_young_space = NULL; void PSPromotionManager::initialize() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _old_gen = heap->old_gen(); _young_space = heap->young_gen()->to_space(); @@ -85,8 +87,7 @@ PSPromotionManager* PSPromotionManager::vm_thread_promotion_manager() { } void PSPromotionManager::pre_scavenge() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _young_space = heap->young_gen()->to_space(); @@ -129,7 +130,7 @@ static const char* const pm_stats_hdr[] = { void PSPromotionManager::print_taskqueue_stats(outputStream* const out) { out->print_cr("== GC Tasks Stats, GC %3d", - Universe::heap()->total_collections()); + ParallelScavengeHeap::heap()->total_collections()); TaskQueueStats totals; out->print("thr "); TaskQueueStats::print_header(1, out); out->cr(); @@ -157,8 +158,7 @@ PSPromotionManager::reset_stats() { #endif // TASKQUEUE_STATS PSPromotionManager::PSPromotionManager() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); // We set the old lab's start array. _old_lab.set_start_array(old_gen()->start_array()); @@ -188,8 +188,7 @@ void PSPromotionManager::reset() { // We need to get an assert in here to make sure the labs are always flushed. - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); // Do not prefill the LAB's, save heap wastage! HeapWord* lab_base = young_space()->top(); @@ -210,8 +209,7 @@ void PSPromotionManager::drain_stacks_depth(bool totally_drain) { totally_drain = totally_drain || _totally_drain; #ifdef ASSERT - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); MutableSpace* to_space = heap->young_gen()->to_space(); MutableSpace* old_space = heap->old_gen()->object_space(); #endif /* ASSERT */ @@ -308,6 +306,118 @@ void PSPromotionManager::process_array_chunk(oop old) { } } +class PushContentsClosure : public ExtendedOopClosure { + PSPromotionManager* _pm; + public: + PushContentsClosure(PSPromotionManager* pm) : _pm(pm) {} + + template void do_oop_nv(T* p) { + if (PSScavenge::should_scavenge(p)) { + _pm->claim_or_forward_depth(p); + } + } + + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + + // Don't use the oop verification code in the oop_oop_iterate framework. + debug_only(virtual bool should_verify_oops() { return false; }) +}; + +void InstanceKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + PushContentsClosure cl(pm); + oop_oop_iterate_oop_maps_reverse(obj, &cl); +} + +void InstanceMirrorKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + // Note that we don't have to follow the mirror -> klass pointer, since all + // klasses that are dirty will be scavenged when we iterate over the + // ClassLoaderData objects. + + InstanceKlass::oop_ps_push_contents(obj, pm); + + PushContentsClosure cl(pm); + oop_oop_iterate_statics(obj, &cl); +} + +void InstanceClassLoaderKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + InstanceKlass::oop_ps_push_contents(obj, pm); + + // This is called by the young collector. It will already have taken care of + // all class loader data. So, we don't have to follow the class loader -> + // class loader data link. +} + +template +static void oop_ps_push_contents_specialized(oop obj, InstanceRefKlass *klass, PSPromotionManager* pm) { + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + if (PSScavenge::should_scavenge(referent_addr)) { + ReferenceProcessor* rp = PSScavenge::reference_processor(); + if (rp->discover_reference(obj, klass->reference_type())) { + // reference already enqueued, referent and next will be traversed later + klass->InstanceKlass::oop_ps_push_contents(obj, pm); + return; + } else { + // treat referent as normal oop + pm->claim_or_forward_depth(referent_addr); + } + } + // Treat discovered as normal oop, if ref is not "active", + // i.e. if next is non-NULL. + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + if (ReferenceProcessor::pending_list_uses_discovered_field()) { + T next_oop = oopDesc::load_heap_oop(next_addr); + if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" + T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Process discovered as normal " + PTR_FORMAT, p2i(discovered_addr)); + } + ) + if (PSScavenge::should_scavenge(discovered_addr)) { + pm->claim_or_forward_depth(discovered_addr); + } + } + } else { +#ifdef ASSERT + // In the case of older JDKs which do not use the discovered + // field for the pending list, an inactive ref (next != NULL) + // must always have a NULL discovered field. + oop next = oopDesc::load_decode_heap_oop(next_addr); + oop discovered = java_lang_ref_Reference::discovered(obj); + assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), + err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", + p2i(obj))); +#endif + } + + // Treat next as normal oop; next is a link in the reference queue. + if (PSScavenge::should_scavenge(next_addr)) { + pm->claim_or_forward_depth(next_addr); + } + klass->InstanceKlass::oop_ps_push_contents(obj, pm); +} + +void InstanceRefKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + if (UseCompressedOops) { + oop_ps_push_contents_specialized(obj, this, pm); + } else { + oop_ps_push_contents_specialized(obj, this, pm); + } +} + +void ObjArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + assert(obj->is_objArray(), "obj must be obj array"); + PushContentsClosure cl(pm); + oop_oop_iterate_elements(objArrayOop(obj), &cl); +} + +void TypeArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { + assert(obj->is_typeArray(),"must be a type array"); + ShouldNotReachHere(); +} + oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) { assert(_old_gen_is_full || PromotionFailureALot, "Sanity"); 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 cb6445fe13f..301136fc986 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -25,11 +25,12 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP +#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" -#include "oops/oop.psgc.inline.hpp" +#include "oops/oop.inline.hpp" inline PSPromotionManager* PSPromotionManager::manager_array(int index) { assert(_manager_array != NULL, "access of NULL manager_array"); @@ -57,9 +58,7 @@ inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { template inline void PSPromotionManager::claim_or_forward_depth(T* p) { assert(should_scavenge(p, true), "revisiting object?"); - assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, - "Sanity"); - assert(Universe::heap()->is_in(p), "pointer outside heap"); + assert(ParallelScavengeHeap::heap()->is_in(p), "pointer outside heap"); claim_or_forward_internal_depth(p); } @@ -92,7 +91,7 @@ inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj, } inline void PSPromotionManager::push_contents(oop obj) { - obj->push_contents(this); + obj->ps_push_contents(this); } // // This method is pretty bulky. It would be nice to split it up @@ -150,7 +149,7 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { // Otherwise try allocating obj tenured if (new_obj == NULL) { #ifndef PRODUCT - if (Universe::heap()->promotion_should_fail()) { + if (ParallelScavengeHeap::heap()->promotion_should_fail()) { return oop_promotion_failed(o, test_mark); } #endif // #ifndef PRODUCT @@ -296,7 +295,7 @@ inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { // that are outside the heap. These pointers are either from roots // or from metadata. if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) && - Universe::heap()->is_in_reserved(p)) { + ParallelScavengeHeap::heap()->is_in_reserved(p)) { if (PSScavenge::is_obj_in_young(new_obj)) { PSScavenge::card_table()->inline_write_ref_field_gc(p, new_obj); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp index 04ff184ea0c..10585b53024 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @@ -87,8 +87,7 @@ protected: public: PSKeepAliveClosure(PSPromotionManager* pm) : _promotion_manager(pm) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _to_space = heap->young_gen()->to_space(); assert(_promotion_manager != NULL, "Sanity"); @@ -218,11 +217,9 @@ void PSRefProcTaskExecutor::execute(EnqueueTask& task) bool PSScavenge::invoke() { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread"); - assert(!Universe::heap()->is_gc_active(), "not reentrant"); - - ParallelScavengeHeap* const heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + assert(!ParallelScavengeHeap::heap()->is_gc_active(), "not reentrant"); + ParallelScavengeHeap* const heap = ParallelScavengeHeap::heap(); PSAdaptiveSizePolicy* policy = heap->size_policy(); IsGCActiveMark mark; @@ -273,9 +270,8 @@ bool PSScavenge::invoke_no_policy() { return false; } - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCause::Cause gc_cause = heap->gc_cause(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); // Check for potential problems. if (!should_attempt_scavenge()) { @@ -713,9 +709,7 @@ bool PSScavenge::invoke_no_policy() { // unforwarding markOops. It then restores any preserved mark oops, // and clears the _preserved_mark_stack. void PSScavenge::clean_up_failed_promotion() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); { @@ -742,7 +736,7 @@ void PSScavenge::clean_up_failed_promotion() { } // Reset the PromotionFailureALot counters. - NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) + NOT_PRODUCT(heap->reset_promotion_should_fail();) } // This method is called whenever an attempt to promote an object @@ -761,8 +755,7 @@ void PSScavenge::oop_promotion_failed(oop obj, markOop obj_mark) { } bool PSScavenge::should_attempt_scavenge() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); if (UsePerfData) { @@ -838,9 +831,7 @@ void PSScavenge::initialize() { MaxTenuringThreshold; } - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); PSOldGen* old_gen = heap->old_gen(); 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 a6c40edfe7c..e995a618208 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, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ #include "utilities/globalDefinitions.hpp" inline void PSScavenge::save_to_space_top_before_gc() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _to_space_top_before_gc = heap->young_gen()->to_space()->top(); } @@ -56,7 +56,7 @@ inline bool PSScavenge::should_scavenge(T* p, MutableSpace* to_space) { template inline bool PSScavenge::should_scavenge(T* p, bool check_to_space) { if (check_to_space) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); return should_scavenge(p, heap->young_gen()->to_space()); } return should_scavenge(p); @@ -97,7 +97,6 @@ class PSScavengeFromKlassClosure: public OopClosure { ParallelScavengeHeap* psh = ParallelScavengeHeap::heap(); assert(!psh->is_in_reserved(p), "GC barrier needed"); if (PSScavenge::should_scavenge(p)) { - assert(!Universe::heap()->is_in_reserved(p), "Not from meta-data?"); assert(PSScavenge::should_scavenge(p, true), "revisiting object?"); oop o = *p; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp index 5739331ab6a..c9e7ee7171a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @@ -47,7 +47,7 @@ // void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); PSScavengeRootsClosure roots_closure(pm); @@ -118,7 +118,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { // void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); PSScavengeRootsClosure roots_closure(pm); @@ -143,7 +143,7 @@ StealTask::StealTask(ParallelTaskTerminator* t) : _terminator(t) {} void StealTask::do_it(GCTaskManager* manager, uint which) { - assert(Universe::heap()->is_gc_active(), "called outside gc"); + assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc"); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); @@ -181,10 +181,8 @@ void OldToYoungRootsTask::do_it(GCTaskManager* manager, uint which) { { PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); - - assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); CardTableExtension* card_table = - barrier_set_cast(Universe::heap()->barrier_set()); + barrier_set_cast(ParallelScavengeHeap::heap()->barrier_set()); card_table->scavenge_contents_parallel(_gen->start_array(), _gen->object_space(), diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp index 867422eaf21..baf8e2dd661 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +24,8 @@ #include "precompiled.hpp" #include "gc_implementation/parallelScavenge/psVirtualspace.hpp" +#include "memory/virtualspace.hpp" #include "runtime/os.hpp" -#include "runtime/virtualspace.hpp" // PSVirtualSpace diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp index a8530f0a6a7..52d77402df1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSVIRTUALSPACE_HPP -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" // VirtualSpace for the parallel scavenge collector. // diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp index 286fbaa88fa..08bdea7bf4c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ void PSYoungGen::initialize_work() { MemRegion cmr((HeapWord*)virtual_space()->low(), (HeapWord*)virtual_space()->high()); - Universe::heap()->barrier_set()->resize_covered_region(cmr); + ParallelScavengeHeap::heap()->barrier_set()->resize_covered_region(cmr); if (ZapUnusedHeapArea) { // Mangle newly committed space immediately because it @@ -103,7 +103,7 @@ void PSYoungGen::initialize_work() { _max_gen_size, _virtual_space); // Compute maximum space sizes for performance counters - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); size_t alignment = heap->space_alignment(); size_t size = virtual_space()->reserved_size(); @@ -153,8 +153,7 @@ void PSYoungGen::initialize_work() { } void PSYoungGen::compute_initial_space_boundaries() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); // Compute sizes size_t alignment = heap->space_alignment(); @@ -208,7 +207,7 @@ void PSYoungGen::set_space_boundaries(size_t eden_size, size_t survivor_size) { #ifndef PRODUCT void PSYoungGen::space_invariants() { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t alignment = heap->space_alignment(); // Currently, our eden size cannot shrink to zero @@ -494,7 +493,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, char* to_start = (char*)to_space()->bottom(); char* to_end = (char*)to_space()->end(); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t alignment = heap->space_alignment(); const bool maintain_minimum = (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size(); @@ -546,8 +545,6 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, // Does the optimal to-space overlap from-space? if (to_start < (char*)from_space()->end()) { - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - // Calculate the minimum offset possible for from_end size_t from_size = pointer_delta(from_space()->top(), from_start, sizeof(char)); @@ -708,9 +705,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); - + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " "collection: %d " "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " @@ -843,7 +838,7 @@ size_t PSYoungGen::available_to_min_gen() { // from-space. size_t PSYoungGen::available_to_live() { size_t delta_in_survivor = 0; - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); const size_t space_alignment = heap->space_alignment(); const size_t gen_alignment = heap->generation_alignment(); @@ -927,7 +922,7 @@ void PSYoungGen::post_resize() { MemRegion cmr((HeapWord*)virtual_space()->low(), (HeapWord*)virtual_space()->high()); - Universe::heap()->barrier_set()->resize_covered_region(cmr); + ParallelScavengeHeap::heap()->barrier_set()->resize_covered_region(cmr); space_invariants(); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp index 9148bb4ffc0..cc5e1226344 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp @@ -26,7 +26,6 @@ #include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" #include "gc_implementation/parallelScavenge/psMarkSweep.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/vmPSOperations.hpp" #include "memory/gcLocker.inline.hpp" #include "utilities/dtrace.hpp" @@ -41,8 +40,7 @@ VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size, void VM_ParallelGCFailedAllocation::doit() { SvcGCMarker sgcm(SvcGCMarker::MINOR); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCauseSetter gccs(heap, _gc_cause); _result = heap->failed_mem_allocate(_word_size); @@ -63,9 +61,7 @@ VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count, void VM_ParallelGCSystemGC::doit() { SvcGCMarker sgcm(SvcGCMarker::FULL); - ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); - assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, - "must be a ParallelScavengeHeap"); + ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); GCCauseSetter gccs(heap, _gc_cause); if (_gc_cause == GCCause::_gc_locker || _gc_cause == GCCause::_wb_young_gc diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp index 3c1a20284ed..fa79b31a13e 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,6 @@ \ static_field(ParallelScavengeHeap, _young_gen, PSYoungGen*) \ static_field(ParallelScavengeHeap, _old_gen, PSOldGen*) \ - static_field(ParallelScavengeHeap, _psh, ParallelScavengeHeap*) \ \ #define VM_TYPES_PARALLELGC(declare_type, \ diff --git a/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp b/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp index d69035625ad..709d3e18b27 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/ageTable.cpp @@ -25,9 +25,9 @@ #include "precompiled.hpp" #include "gc_implementation/shared/ageTable.hpp" #include "gc_implementation/shared/gcPolicyCounters.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/collectorPolicy.hpp" #include "memory/resourceArea.hpp" -#include "memory/sharedHeap.hpp" #include "runtime/atomic.inline.hpp" #include "utilities/copy.hpp" @@ -79,7 +79,7 @@ void ageTable::merge_par(ageTable* subTable) { } } -uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) { +uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100); uint result; @@ -126,9 +126,6 @@ uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) { age++; } if (UsePerfData) { - SharedHeap* sh = SharedHeap::heap(); - CollectorPolicy* policy = sh->collector_policy(); - GCPolicyCounters* gc_counters = policy->counters(); gc_counters->tenuring_threshold()->set_value(result); gc_counters->desired_survivor_size()->set_value( desired_survivor_size*oopSize); diff --git a/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp b/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp index 44d8e0ace7f..44587d99d62 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/ageTable.hpp @@ -29,6 +29,8 @@ #include "oops/oop.hpp" #include "runtime/perfData.hpp" +class GCPolicyCounters; + /* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ @@ -69,7 +71,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC { void merge_par(ageTable* subTable); // calculate new tenuring threshold based on age information - uint compute_tenuring_threshold(size_t survivor_capacity); + uint compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters); private: PerfVariable* _perf_sizes[table_size]; diff --git a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp index 4a74a3fd4a0..6e92cd50638 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GENERATIONCOUNTERS_HPP +#include "memory/virtualspace.hpp" #include "runtime/perfData.hpp" -#include "runtime/virtualspace.hpp" // A GenerationCounter is a holder class for performance counters // that track a generation diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp index bcf4fef7184..e459341ba03 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp @@ -28,6 +28,8 @@ #include "gc_implementation/shared/gcTrace.hpp" #include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" #include "oops/methodData.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" @@ -55,16 +57,183 @@ MarkSweep::MarkAndPushClosure MarkSweep::mark_and_push_closure; CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure); CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure); -void MarkSweep::MarkAndPushClosure::do_oop(oop* p) { mark_and_push(p); } -void MarkSweep::MarkAndPushClosure::do_oop(narrowOop* p) { mark_and_push(p); } +template +void MarkSweep::MarkAndPushClosure::do_oop_nv(T* p) { mark_and_push(p); } +void MarkSweep::MarkAndPushClosure::do_oop(oop* p) { do_oop_nv(p); } +void MarkSweep::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_nv(p); } void MarkSweep::follow_class_loader(ClassLoaderData* cld) { MarkSweep::follow_cld_closure.do_cld(cld); } +void InstanceKlass::oop_ms_follow_contents(oop obj) { + assert(obj != NULL, "can't follow the content of NULL object"); + MarkSweep::follow_klass(this); + + oop_oop_iterate_oop_maps(obj, &MarkSweep::mark_and_push_closure); +} + +void InstanceMirrorKlass::oop_ms_follow_contents(oop obj) { + InstanceKlass::oop_ms_follow_contents(obj); + + // Follow the klass field in the mirror + Klass* klass = java_lang_Class::as_Klass(obj); + if (klass != NULL) { + // An anonymous class doesn't have its own class loader, so the call + // to follow_klass will mark and push its java mirror instead of the + // class loader. When handling the java mirror for an anonymous class + // we need to make sure its class loader data is claimed, this is done + // by calling follow_class_loader explicitly. For non-anonymous classes + // the call to follow_class_loader is made when the class loader itself + // is handled. + if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { + MarkSweep::follow_class_loader(klass->class_loader_data()); + } else { + MarkSweep::follow_klass(klass); + } + } else { + // If klass is NULL then this a mirror for a primitive type. + // We don't have to follow them, since they are handled as strong + // roots in Universe::oops_do. + assert(java_lang_Class::is_primitive(obj), "Sanity check"); + } + + oop_oop_iterate_statics(obj, &MarkSweep::mark_and_push_closure); +} + +void InstanceClassLoaderKlass::oop_ms_follow_contents(oop obj) { + InstanceKlass::oop_ms_follow_contents(obj); + + ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); + + // We must NULL check here, since the class loader + // can be found before the loader data has been set up. + if(loader_data != NULL) { + MarkSweep::follow_class_loader(loader_data); + } +} + +template +static void oop_ms_follow_contents_specialized(InstanceRefKlass* klass, oop obj) { + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + T heap_oop = oopDesc::load_heap_oop(referent_addr); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr("InstanceRefKlass::oop_ms_follow_contents_specialized " PTR_FORMAT, p2i(obj)); + } + ) + if (!oopDesc::is_null(heap_oop)) { + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); + if (!referent->is_gc_marked() && + MarkSweep::ref_processor()->discover_reference(obj, klass->reference_type())) { + // reference was discovered, referent will be traversed later + klass->InstanceKlass::oop_ms_follow_contents(obj); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); + } + ) + return; + } else { + // treat referent as normal oop + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Non NULL normal " PTR_FORMAT, p2i(obj)); + } + ) + MarkSweep::mark_and_push(referent_addr); + } + } + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + if (ReferenceProcessor::pending_list_uses_discovered_field()) { + // Treat discovered as normal oop, if ref is not "active", + // i.e. if next is non-NULL. + T next_oop = oopDesc::load_heap_oop(next_addr); + if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" + T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Process discovered as normal " + PTR_FORMAT, p2i(discovered_addr)); + } + ) + MarkSweep::mark_and_push(discovered_addr); + } + } else { +#ifdef ASSERT + // In the case of older JDKs which do not use the discovered + // field for the pending list, an inactive ref (next != NULL) + // must always have a NULL discovered field. + oop next = oopDesc::load_decode_heap_oop(next_addr); + oop discovered = java_lang_ref_Reference::discovered(obj); + assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), + err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", + p2i(obj))); +#endif + } + // treat next as normal oop. next is a link in the reference queue. + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Process next as normal " PTR_FORMAT, p2i(next_addr)); + } + ) + MarkSweep::mark_and_push(next_addr); + klass->InstanceKlass::oop_ms_follow_contents(obj); +} + +void InstanceRefKlass::oop_ms_follow_contents(oop obj) { + if (UseCompressedOops) { + oop_ms_follow_contents_specialized(this, obj); + } else { + oop_ms_follow_contents_specialized(this, obj); + } +} + +template +static void oop_ms_follow_contents_specialized(oop obj, int index) { + objArrayOop a = objArrayOop(obj); + const size_t len = size_t(a->length()); + const size_t beg_index = size_t(index); + assert(beg_index < len || len == 0, "index too large"); + + const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); + const size_t end_index = beg_index + stride; + T* const base = (T*)a->base(); + T* const beg = base + beg_index; + T* const end = base + end_index; + + // Push the non-NULL elements of the next stride on the marking stack. + for (T* e = beg; e < end; e++) { + MarkSweep::mark_and_push(e); + } + + if (end_index < len) { + MarkSweep::push_objarray(a, end_index); // Push the continuation. + } +} + +void ObjArrayKlass::oop_ms_follow_contents(oop obj) { + assert (obj->is_array(), "obj must be array"); + MarkSweep::follow_klass(this); + if (UseCompressedOops) { + oop_ms_follow_contents_specialized(obj, 0); + } else { + oop_ms_follow_contents_specialized(obj, 0); + } +} + +void TypeArrayKlass::oop_ms_follow_contents(oop obj) { + assert(obj->is_typeArray(),"must be a type array"); + // Performance tweak: We skip iterating over the klass pointer since we + // know that Universe::TypeArrayKlass never moves. +} + void MarkSweep::follow_array(objArrayOop array, int index) { - ObjArrayKlass* k = (ObjArrayKlass*)array->klass(); - k->oop_follow_contents(array, index); + if (UseCompressedOops) { + oop_ms_follow_contents_specialized(array, index); + } else { + oop_ms_follow_contents_specialized(array, index); + } } void MarkSweep::follow_stack() { @@ -112,8 +281,10 @@ void MarkSweep::preserve_mark(oop obj, markOop mark) { MarkSweep::AdjustPointerClosure MarkSweep::adjust_pointer_closure; -void MarkSweep::AdjustPointerClosure::do_oop(oop* p) { adjust_pointer(p); } -void MarkSweep::AdjustPointerClosure::do_oop(narrowOop* p) { adjust_pointer(p); } +template +void MarkSweep::AdjustPointerClosure::do_oop_nv(T* p) { adjust_pointer(p); } +void MarkSweep::AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); } +void MarkSweep::AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_nv(p); } void MarkSweep::adjust_marks() { assert( _preserved_oop_stack.size() == _preserved_mark_stack.size(), @@ -167,11 +338,83 @@ void marksweep_init() { MarkSweep::_gc_tracer = new (ResourceObj::C_HEAP, mtGC) SerialOldTracer(); } -#ifndef PRODUCT - -void MarkSweep::trace(const char* msg) { - if (TraceMarkSweep) - gclog_or_tty->print("%s", msg); +int InstanceKlass::oop_ms_adjust_pointers(oop obj) { + int size = size_helper(); + oop_oop_iterate_oop_maps(obj, &MarkSweep::adjust_pointer_closure); + return size; } +int InstanceMirrorKlass::oop_ms_adjust_pointers(oop obj) { + int size = oop_size(obj); + InstanceKlass::oop_ms_adjust_pointers(obj); + + oop_oop_iterate_statics(obj, &MarkSweep::adjust_pointer_closure); + return size; +} + +int InstanceClassLoaderKlass::oop_ms_adjust_pointers(oop obj) { + return InstanceKlass::oop_ms_adjust_pointers(obj); +} + +#ifdef ASSERT +template static void trace_reference_gc(const char *s, oop obj, + T* referent_addr, + T* next_addr, + T* discovered_addr) { + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); + gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(referent_addr), + p2i(referent_addr ? + (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL)); + gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(next_addr), + p2i(next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL)); + gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " + PTR_FORMAT, p2i(discovered_addr), + p2i(discovered_addr ? + (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL)); + } +} #endif + +template void static adjust_object_specialized(oop obj) { + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + MarkSweep::adjust_pointer(referent_addr); + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + MarkSweep::adjust_pointer(next_addr); + T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + MarkSweep::adjust_pointer(discovered_addr); + debug_only(trace_reference_gc("InstanceRefKlass::oop_ms_adjust_pointers", obj, + referent_addr, next_addr, discovered_addr);) +} + +int InstanceRefKlass::oop_ms_adjust_pointers(oop obj) { + int size = size_helper(); + InstanceKlass::oop_ms_adjust_pointers(obj); + + if (UseCompressedOops) { + adjust_object_specialized(obj); + } else { + adjust_object_specialized(obj); + } + return size; +} + +int ObjArrayKlass::oop_ms_adjust_pointers(oop obj) { + assert(obj->is_objArray(), "obj must be obj array"); + objArrayOop a = objArrayOop(obj); + // Get size before changing pointers. + // Don't call size() or oop_size() since that is a virtual call. + int size = a->object_size(); + oop_oop_iterate_elements(a, &MarkSweep::adjust_pointer_closure); + return size; +} + +int TypeArrayKlass::oop_ms_adjust_pointers(oop obj) { + assert(obj->is_typeArray(), "must be a type array"); + typeArrayOop t = typeArrayOop(obj); + // Performance tweak: We skip iterating over the klass pointer since we + // know that Universe::TypeArrayKlass never moves. + return t->object_size(); +} diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp index 724d212940c..6ffd76af54d 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp @@ -60,8 +60,9 @@ class MarkSweep : AllStatic { virtual void do_oop(narrowOop* p); }; - class MarkAndPushClosure: public OopClosure { + class MarkAndPushClosure: public ExtendedOopClosure { public: + template void do_oop_nv(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); }; @@ -73,8 +74,12 @@ class MarkSweep : AllStatic { class AdjustPointerClosure: public OopsInGenClosure { public: + template void do_oop_nv(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); + + // This closure provides its own oop verification code. + debug_only(virtual bool should_verify_oops() { return false; }) }; // Used for java/lang/ref handling @@ -126,9 +131,6 @@ class MarkSweep : AllStatic { // Non public closures static KeepAliveClosure keep_alive; - // Debugging - static void trace(const char* msg) PRODUCT_RETURN; - public: // Public closures static IsAliveClosure is_alive; diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp index 196dcad7a7f..39201f76440 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp @@ -28,11 +28,15 @@ #include "gc_implementation/shared/markSweep.hpp" #include "gc_interface/collectedHeap.hpp" #include "oops/markOop.inline.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceClassLoaderKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" +#include "oops/instanceRefKlass.inline.hpp" +#include "oops/objArrayKlass.inline.hpp" #include "utilities/stack.inline.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS #include "gc_implementation/g1/g1StringDedup.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" #endif // INCLUDE_ALL_GCS inline void MarkSweep::mark_object(oop obj) { @@ -59,7 +63,9 @@ inline void MarkSweep::follow_klass(Klass* klass) { } inline void MarkSweep::follow_object(oop obj) { - obj->follow_contents(); + assert(obj->is_gc_marked(), "should be marked"); + + obj->ms_follow_contents(); } template inline void MarkSweep::follow_root(T* p) { @@ -95,13 +101,15 @@ void MarkSweep::push_objarray(oop obj, size_t index) { } inline int MarkSweep::adjust_pointers(oop obj) { - return obj->adjust_pointers(); + return obj->ms_adjust_pointers(); } template inline void MarkSweep::adjust_pointer(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(Universe::heap()->is_in(obj), "should be in heap"); + oop new_obj = oop(obj->mark()->decode_pointer()); assert(new_obj != NULL || // is forwarding ptr? obj->mark() == markOopDesc::prototype() || // not gc marked? diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp index 1d4564160a0..b6c68fd4808 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @@ -26,7 +26,7 @@ #include "precompiled.hpp" #include "gc_implementation/shared/mutableNUMASpace.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" -#include "memory/sharedHeap.hpp" +#include "gc_interface/collectedHeap.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp b/hotspot/src/share/vm/gc_implementation/shared/plab.cpp similarity index 90% rename from hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp rename to hotspot/src/share/vm/gc_implementation/shared/plab.cpp index fe21e584cf7..3ecc205df31 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/plab.cpp @@ -23,21 +23,21 @@ */ #include "precompiled.hpp" -#include "gc_implementation/shared/parGCAllocBuffer.hpp" +#include "gc_implementation/shared/plab.hpp" #include "memory/threadLocalAllocBuffer.hpp" #include "oops/arrayOop.hpp" #include "oops/oop.inline.hpp" -size_t ParGCAllocBuffer::min_size() { +size_t PLAB::min_size() { // Make sure that we return something that is larger than AlignmentReserve return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve; } -size_t ParGCAllocBuffer::max_size() { +size_t PLAB::max_size() { return ThreadLocalAllocBuffer::max_size(); } -ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) : +PLAB::PLAB(size_t desired_plab_sz_) : _word_sz(desired_plab_sz_), _bottom(NULL), _top(NULL), _end(NULL), _hard_end(NULL), _allocated(0), _wasted(0) { @@ -53,9 +53,9 @@ ParGCAllocBuffer::ParGCAllocBuffer(size_t desired_plab_sz_) : // the smallest object. We can't allow that because the buffer must // look like it's full of objects when we retire it, so we make // sure we have enough space for a filler int array object. -size_t ParGCAllocBuffer::AlignmentReserve; +size_t PLAB::AlignmentReserve; -void ParGCAllocBuffer::flush_and_retire_stats(PLABStats* stats) { +void PLAB::flush_and_retire_stats(PLABStats* stats) { // Retire the last allocation buffer. size_t unused = retire_internal(); @@ -71,11 +71,11 @@ void ParGCAllocBuffer::flush_and_retire_stats(PLABStats* stats) { _wasted = 0; } -void ParGCAllocBuffer::retire() { +void PLAB::retire() { _wasted += retire_internal(); } -size_t ParGCAllocBuffer::retire_internal() { +size_t PLAB::retire_internal() { size_t result = 0; if (_top < _hard_end) { CollectedHeap::fill_with_object(_top, _hard_end); @@ -126,8 +126,8 @@ void PLABStats::adjust_desired_plab_sz(uint no_of_gc_workers) { } #ifndef PRODUCT -void ParGCAllocBuffer::print() { - gclog_or_tty->print_cr("parGCAllocBuffer: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT +void PLAB::print() { + gclog_or_tty->print_cr("PLAB: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT " _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT ")", p2i(_bottom), p2i(_top), p2i(_end), p2i(_hard_end)); } diff --git a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp b/hotspot/src/share/vm/gc_implementation/shared/plab.hpp similarity index 93% rename from hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp rename to hotspot/src/share/vm/gc_implementation/shared/plab.hpp index a8991a0816b..324adfcd8a9 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/plab.hpp @@ -22,8 +22,8 @@ * */ -#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP -#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP #include "gc_implementation/shared/gcUtil.hpp" #include "memory/allocation.hpp" @@ -34,7 +34,7 @@ class PLABStats; // A per-thread allocation buffer used during GC. -class ParGCAllocBuffer: public CHeapObj { +class PLAB: public CHeapObj { protected: char head[32]; size_t _word_sz; // In HeapWord units @@ -65,8 +65,8 @@ protected: public: // Initializes the buffer to be empty, but with the given "word_sz". // Must get initialized with "set_buf" for an allocation to succeed. - ParGCAllocBuffer(size_t word_sz); - virtual ~ParGCAllocBuffer() {} + PLAB(size_t word_sz); + virtual ~PLAB() {} // Minimum PLAB size. static size_t min_size(); @@ -133,7 +133,7 @@ public: // Flush allocation statistics into the given PLABStats supporting ergonomic // sizing of PLAB's and retire the current buffer. To be called at the end of // GC. - void flush_and_retire_stats(PLABStats* stats); + virtual void flush_and_retire_stats(PLABStats* stats); // Fills in the unallocated portion of the buffer with a garbage object and updates // statistics. To be called during GC. @@ -166,11 +166,11 @@ class PLABStats VALUE_OBJ_CLASS_SPEC { { } static const size_t min_size() { - return ParGCAllocBuffer::min_size(); + return PLAB::min_size(); } static const size_t max_size() { - return ParGCAllocBuffer::max_size(); + return PLAB::max_size(); } size_t desired_plab_sz() { @@ -194,4 +194,4 @@ class PLABStats VALUE_OBJ_CLASS_SPEC { } }; -#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PARGCALLOCBUFFER_HPP +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp b/hotspot/src/share/vm/gc_implementation/shared/plab.inline.hpp similarity index 74% rename from hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp rename to hotspot/src/share/vm/gc_implementation/shared/plab.inline.hpp index 352ce05a3e5..5c9fe845b1c 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/plab.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,13 +22,13 @@ * */ -#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP -#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP +#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP +#define SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP -#include "gc_implementation/shared/parGCAllocBuffer.hpp" +#include "gc_implementation/shared/plab.hpp" #include "gc_interface/collectedHeap.inline.hpp" -HeapWord* ParGCAllocBuffer::allocate_aligned(size_t word_sz, unsigned short alignment_in_bytes) { +HeapWord* PLAB::allocate_aligned(size_t word_sz, unsigned short alignment_in_bytes) { HeapWord* res = CollectedHeap::align_allocation_or_fail(_top, _end, alignment_in_bytes); if (res == NULL) { @@ -41,4 +41,4 @@ HeapWord* ParGCAllocBuffer::allocate_aligned(size_t word_sz, unsigned short alig return allocate(word_sz); } -#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PARGCALLOCBUFFER_INLINE_HPP +#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_PLAB_INLINE_HPP diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index dbfbb08cdfc..dcfcbfb82ed 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp @@ -116,8 +116,6 @@ bool VM_GC_Operation::doit_prologue() { _prologue_succeeded = false; } else { _prologue_succeeded = true; - SharedHeap* sh = SharedHeap::heap(); - if (sh != NULL) sh->_thread_holds_heap_lock_for_gc = true; } return _prologue_succeeded; } @@ -126,22 +124,11 @@ bool VM_GC_Operation::doit_prologue() { void VM_GC_Operation::doit_epilogue() { assert(Thread::current()->is_Java_thread(), "just checking"); // Release the Heap_lock first. - SharedHeap* sh = SharedHeap::heap(); - if (sh != NULL) sh->_thread_holds_heap_lock_for_gc = false; Heap_lock->unlock(); release_and_notify_pending_list_lock(); } -bool VM_GC_HeapInspection::doit_prologue() { - if (Universe::heap()->supports_heap_inspection()) { - return VM_GC_Operation::doit_prologue(); - } else { - return false; - } -} - bool VM_GC_HeapInspection::skip_operation() const { - assert(Universe::heap()->supports_heap_inspection(), "huh?"); return false; } diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 5885638cd43..284d2d13822 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -150,7 +150,6 @@ class VM_GC_HeapInspection: public VM_GC_Operation { ~VM_GC_HeapInspection() {} virtual VMOp_Type type() const { return VMOp_GC_HeapInspection; } virtual bool skip_operation() const; - virtual bool doit_prologue(); virtual void doit(); void set_csv_format(bool value) {_csv_format = value;} void set_print_help(bool value) {_print_help = value;} diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index 649bce23c1e..2698adcd9f6 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -220,6 +220,11 @@ void CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { } } +void CollectedHeap::set_barrier_set(BarrierSet* barrier_set) { + _barrier_set = barrier_set; + oopDesc::set_bs(_barrier_set); +} + void CollectedHeap::pre_initialize() { // Used for ReduceInitialCardMarks (when COMPILER2 is used); // otherwise remains unused. diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index 5dec0eca8ab..ce3d07f1460 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -75,9 +75,8 @@ class GCHeapLog : public EventLogBase { // // CollectedHeap -// SharedHeap -// GenCollectedHeap -// G1CollectedHeap +// GenCollectedHeap +// G1CollectedHeap // ParallelScavengeHeap // class CollectedHeap : public CHeapObj { @@ -205,7 +204,7 @@ class CollectedHeap : public CHeapObj { // In many heaps, there will be a need to perform some initialization activities // after the Universe is fully formed, but before general heap allocation is allowed. // This is the correct place to place such initialization methods. - virtual void post_initialize() = 0; + virtual void post_initialize(); // Stop any onging concurrent work and prepare for exit. virtual void stop() {} @@ -240,22 +239,11 @@ class CollectedHeap : public CHeapObj { } // Returns "TRUE" iff "p" points into the committed areas of the heap. - // Since this method can be expensive in general, we restrict its - // use to assertion checking only. + // This method can be expensive so avoid using it in performance critical + // code. virtual bool is_in(const void* p) const = 0; - bool is_in_or_null(const void* p) const { - return p == NULL || is_in(p); - } - - bool is_in_place(Metadata** p) { - return !Universe::heap()->is_in(p); - } - bool is_in_place(oop* p) { return Universe::heap()->is_in(p); } - bool is_in_place(narrowOop* p) { - oop o = oopDesc::load_decode_heap_oop_not_null(p); - return Universe::heap()->is_in((const void*)o); - } + DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); }) // Let's define some terms: a "closed" subset of a heap is one that // @@ -451,9 +439,6 @@ class CollectedHeap : public CHeapObj { // remembered set. virtual void flush_deferred_store_barrier(JavaThread* thread); - // Does this heap support heap inspection (+PrintClassHistogram?) - virtual bool supports_heap_inspection() const = 0; - // Perform a collection of the heap; intended for use in implementing // "System.gc". This probably implies as full a collection as the // "CollectedHeap" supports. @@ -470,6 +455,7 @@ class CollectedHeap : public CHeapObj { // Returns the barrier set for this heap BarrierSet* barrier_set() { return _barrier_set; } + void set_barrier_set(BarrierSet* barrier_set); // Returns "true" iff there is a stop-world GC in progress. (I assume // that it should answer "false" for the concurrent part of a concurrent @@ -497,12 +483,6 @@ class CollectedHeap : public CHeapObj { // Return the CollectorPolicy for the heap virtual CollectorPolicy* collector_policy() const = 0; - void oop_iterate_no_header(OopClosure* cl); - - // Iterate over all the ref-containing fields of all objects, calling - // "cl.do_oop" on each. - virtual void oop_iterate(ExtendedOopClosure* cl) = 0; - // Iterate over all objects, calling "cl.do_object" on each. virtual void object_iterate(ObjectClosure* cl) = 0; diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp index 302d0c7cb3a..2b938a1d194 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp @@ -236,12 +236,6 @@ oop CollectedHeap::array_allocate_nozero(KlassHandle klass, return (oop)obj; } -inline void CollectedHeap::oop_iterate_no_header(OopClosure* cl) { - NoHeaderExtendedOopClosure no_header_cl(cl); - oop_iterate(&no_header_cl); -} - - inline HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr, HeapWord* end, unsigned short alignment_in_bytes) { diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 991aca1a357..802879268ab 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -576,10 +576,10 @@ BytecodeInterpreter::run(interpreterState istate) { /* 0xD8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xE4 */ &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, &&opc_return_register_finalizer, -/* 0xE8 */ &&opc_invokehandle,&&opc_default, &&opc_default, &&opc_default, -/* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xE4 */ &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, &&opc_return_register_finalizer, +/* 0xE8 */ &&opc_invokehandle,&&opc_default, &&opc_default, &&opc_default, +/* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xF4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, @@ -1942,7 +1942,7 @@ run: cache = cp->entry_at(index); if (!cache->is_resolved((Bytecodes::Code)opcode)) { - CALL_VM(InterpreterRuntime::resolve_get_put(THREAD, (Bytecodes::Code)opcode), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->entry_at(index); } @@ -2040,7 +2040,7 @@ run: u2 index = Bytes::get_native_u2(pc+1); ConstantPoolCacheEntry* cache = cp->entry_at(index); if (!cache->is_resolved((Bytecodes::Code)opcode)) { - CALL_VM(InterpreterRuntime::resolve_get_put(THREAD, (Bytecodes::Code)opcode), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->entry_at(index); } @@ -2416,7 +2416,7 @@ run: // This kind of CP cache entry does not need to match the flags byte, because // there is a 1-1 relation between bytecode type and CP entry type. if (! cache->is_resolved((Bytecodes::Code) opcode)) { - CALL_VM(InterpreterRuntime::resolve_invokedynamic(THREAD), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->constant_pool()->invokedynamic_cp_cache_entry_at(index); } @@ -2447,7 +2447,7 @@ run: ConstantPoolCacheEntry* cache = cp->entry_at(index); if (! cache->is_resolved((Bytecodes::Code) opcode)) { - CALL_VM(InterpreterRuntime::resolve_invokehandle(THREAD), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->entry_at(index); } @@ -2480,7 +2480,7 @@ run: ConstantPoolCacheEntry* cache = cp->entry_at(index); if (!cache->is_resolved((Bytecodes::Code)opcode)) { - CALL_VM(InterpreterRuntime::resolve_invoke(THREAD, (Bytecodes::Code)opcode), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->entry_at(index); } @@ -2571,7 +2571,7 @@ run: // out so c++ compiler has a chance for constant prop to fold everything possible away. if (!cache->is_resolved((Bytecodes::Code)opcode)) { - CALL_VM(InterpreterRuntime::resolve_invoke(THREAD, (Bytecodes::Code)opcode), + CALL_VM(InterpreterRuntime::resolve_from_cache(THREAD, (Bytecodes::Code)opcode), handle_exception); cache = cp->entry_at(index); } diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 7fcd6543984..a5b53ad3529 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -525,6 +525,12 @@ void Bytecodes::initialize() { def(_fast_aldc , "fast_aldc" , "bj" , NULL , T_OBJECT, 1, true, _ldc ); def(_fast_aldc_w , "fast_aldc_w" , "bJJ" , NULL , T_OBJECT, 1, true, _ldc_w ); + def(_nofast_getfield , "nofast_getfield" , "bJJ" , NULL , T_ILLEGAL, 0, true, _getfield ); + def(_nofast_putfield , "nofast_putfield" , "bJJ" , NULL , T_ILLEGAL, -2, true , _putfield ); + + def(_nofast_aload_0 , "nofast_aload_0" , "b" , NULL , T_ILLEGAL, 1, true , _aload_0 ); + def(_nofast_iload , "nofast_iload" , "bi" , NULL , T_ILLEGAL, 1, false, _iload ); + def(_shouldnotreachhere , "_shouldnotreachhere" , "b" , NULL , T_VOID , 0, false); // compare can_trap information for each bytecode with the diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp index d66ceb46033..78f6c48f595 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -285,7 +285,20 @@ class Bytecodes: AllStatic { // special handling of signature-polymorphic methods: _invokehandle , - _shouldnotreachhere, // For debugging + // These bytecodes are rewritten at CDS dump time, so that we can prevent them from being + // rewritten at run time. This way, the ConstMethods can be placed in the CDS ReadOnly + // section, and RewriteByteCodes/RewriteFrequentPairs can rewrite non-CDS bytecodes + // at run time. + // + // Rewritten at CDS dump time to | Original bytecode + // _invoke_virtual rewritten on sparc, will be disabled if UseSharedSpaces turned on. + // ------------------------------+------------------ + _nofast_getfield , // <- _getfield + _nofast_putfield , // <- _putfield + _nofast_aload_0 , // <- _aload_0 + _nofast_iload , // <- _iload + + _shouldnotreachhere , // For debugging number_of_codes @@ -401,6 +414,7 @@ class Bytecodes: AllStatic { static bool is_astore (Code code) { return (code == _astore || code == _astore_0 || code == _astore_1 || code == _astore_2 || code == _astore_3); } + static bool is_store_into_local(Code code){ return (_istore <= code && code <= _astore_3); } static bool is_const (Code code) { return (_aconst_null <= code && code <= _ldc2_w); } static bool is_zero_const (Code code) { return (code == _aconst_null || code == _iconst_0 || code == _fconst_0 || code == _dconst_0); } diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index e59c49ba4e6..66f28341c23 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -537,11 +537,13 @@ IRT_END // Fields // -IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode)) +void InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode) { + Thread* THREAD = thread; // resolve field fieldDescriptor info; constantPoolHandle pool(thread, method(thread)->constants()); - bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_putstatic); + bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_nofast_putfield || + bytecode == Bytecodes::_putstatic); bool is_static = (bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic); { @@ -551,7 +553,8 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecode } // end JvmtiHideSingleStepping // check if link resolution caused cpCache to be updated - if (already_resolved(thread)) return; + ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); + if (cp_cache_entry->is_resolved(bytecode)) return; // compute auxiliary field attributes TosState state = as_TosState(info.field_type()); @@ -579,7 +582,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecode } } - cache_entry(thread)->set_field( + cp_cache_entry->set_field( get_code, put_code, info.field_holder(), @@ -590,7 +593,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecode info.access_flags().is_volatile(), pool->pool_holder() ); -IRT_END +} //------------------------------------------------------------------------------------------------------------------------ @@ -685,7 +688,8 @@ IRT_ENTRY(void, InterpreterRuntime::_breakpoint(JavaThread* thread, Method* meth JvmtiExport::post_raw_breakpoint(thread, method, bcp); IRT_END -IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code bytecode)) { +void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code bytecode) { + Thread* THREAD = thread; // extract receiver from the outgoing argument list if necessary Handle receiver(thread, NULL); if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface) { @@ -709,7 +713,8 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes { JvmtiHideSingleStepping jhss(thread); LinkResolver::resolve_invoke(info, receiver, pool, - get_index_u2_cpcache(thread, bytecode), bytecode, CHECK); + get_index_u2_cpcache(thread, bytecode), bytecode, + CHECK); if (JvmtiExport::can_hotswap_or_post_breakpoint()) { int retry_count = 0; while (info.resolved_method()->is_old()) { @@ -720,13 +725,15 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes "Could not resolve to latest version of redefined method"); // method is redefined in the middle of resolve so re-try. LinkResolver::resolve_invoke(info, receiver, pool, - get_index_u2_cpcache(thread, bytecode), bytecode, CHECK); + get_index_u2_cpcache(thread, bytecode), bytecode, + CHECK); } } } // end JvmtiHideSingleStepping // check if link resolution caused cpCache to be updated - if (already_resolved(thread)) return; + ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); + if (cp_cache_entry->is_resolved(bytecode)) return; if (bytecode == Bytecodes::_invokeinterface) { if (TraceItables && Verbose) { @@ -761,18 +768,18 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes #endif switch (info.call_kind()) { case CallInfo::direct_call: - cache_entry(thread)->set_direct_call( + cp_cache_entry->set_direct_call( bytecode, info.resolved_method()); break; case CallInfo::vtable_call: - cache_entry(thread)->set_vtable_call( + cp_cache_entry->set_vtable_call( bytecode, info.resolved_method(), info.vtable_index()); break; case CallInfo::itable_call: - cache_entry(thread)->set_itable_call( + cp_cache_entry->set_itable_call( bytecode, info.resolved_method(), info.itable_index()); @@ -780,30 +787,30 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes default: ShouldNotReachHere(); } } -IRT_END // First time execution: Resolve symbols, create a permanent MethodType object. -IRT_ENTRY(void, InterpreterRuntime::resolve_invokehandle(JavaThread* thread)) { +void InterpreterRuntime::resolve_invokehandle(JavaThread* thread) { + Thread* THREAD = thread; const Bytecodes::Code bytecode = Bytecodes::_invokehandle; // resolve method CallInfo info; constantPoolHandle pool(thread, method(thread)->constants()); - { JvmtiHideSingleStepping jhss(thread); LinkResolver::resolve_invoke(info, Handle(), pool, - get_index_u2_cpcache(thread, bytecode), bytecode, CHECK); + get_index_u2_cpcache(thread, bytecode), bytecode, + CHECK); } // end JvmtiHideSingleStepping - cache_entry(thread)->set_method_handle(pool, info); + ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); + cp_cache_entry->set_method_handle(pool, info); } -IRT_END - // First time execution: Resolve symbols, create a permanent CallSite object. -IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { +void InterpreterRuntime::resolve_invokedynamic(JavaThread* thread) { + Thread* THREAD = thread; const Bytecodes::Code bytecode = Bytecodes::_invokedynamic; //TO DO: consider passing BCI to Java. @@ -822,8 +829,36 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { ConstantPoolCacheEntry* cp_cache_entry = pool->invokedynamic_cp_cache_entry_at(index); cp_cache_entry->set_dynamic_call(pool, info); } -IRT_END +// This function is the interface to the assembly code. It returns the resolved +// cpCache entry. This doesn't safepoint, but the helper routines safepoint. +// This function will check for redefinition! +IRT_ENTRY(void, InterpreterRuntime::resolve_from_cache(JavaThread* thread, Bytecodes::Code bytecode)) { + switch (bytecode) { + case Bytecodes::_getstatic: + case Bytecodes::_putstatic: + case Bytecodes::_getfield: + case Bytecodes::_putfield: + resolve_get_put(thread, bytecode); + break; + case Bytecodes::_invokevirtual: + case Bytecodes::_invokespecial: + case Bytecodes::_invokestatic: + case Bytecodes::_invokeinterface: + resolve_invoke(thread, bytecode); + break; + case Bytecodes::_invokehandle: + resolve_invokehandle(thread); + break; + case Bytecodes::_invokedynamic: + resolve_invokedynamic(thread); + break; + default: + fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(bytecode))); + break; + } +} +IRT_END //------------------------------------------------------------------------------------------------------------------------ // Miscellaneous diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 54cb71d333a..bd604215f89 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ class InterpreterRuntime: AllStatic { // pass method to avoid calling unsafe bcp_to_method (partial fix 4926272) return Bytecodes::code_at(method(thread), bcp(thread)); } - static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); } static Bytecode bytecode(JavaThread *thread) { return Bytecode(method(thread), bcp(thread)); } static int get_index_u1(JavaThread *thread, Bytecodes::Code bc) { return bytecode(thread).get_index_u1(bc); } @@ -117,9 +116,17 @@ class InterpreterRuntime: AllStatic { static void note_no_trap(JavaThread* thread, Method *method, int trap_bci) {} #endif // CC_INTERP + static void resolve_from_cache(JavaThread* thread, Bytecodes::Code bytecode); + private: // Statics & fields - static void resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode); + static void resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode); + // Calls + static void resolve_invoke(JavaThread* thread, Bytecodes::Code bytecode); + static void resolve_invokehandle (JavaThread* thread); + static void resolve_invokedynamic(JavaThread* thread); + + public: // Synchronization static void monitorenter(JavaThread* thread, BasicObjectLock* elem); static void monitorexit (JavaThread* thread, BasicObjectLock* elem); @@ -127,11 +134,6 @@ class InterpreterRuntime: AllStatic { static void throw_illegal_monitor_state_exception(JavaThread* thread); static void new_illegal_monitor_state_exception(JavaThread* thread); - // Calls - static void resolve_invoke (JavaThread* thread, Bytecodes::Code bytecode); - static void resolve_invokehandle (JavaThread* thread); - static void resolve_invokedynamic(JavaThread* thread); - // Breakpoints static void _breakpoint(JavaThread* thread, Method* method, address bcp); static Bytecodes::Code get_original_bytecode_at(JavaThread* thread, Method* method, address bcp); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 9a62cd62807..49b5a51d026 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -777,11 +777,11 @@ void LinkResolver::resolve_field(fieldDescriptor& fd, KlassHandle resolved_klass TRAPS) { assert(byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic || byte == Bytecodes::_getfield || byte == Bytecodes::_putfield || + byte == Bytecodes::_nofast_getfield || byte == Bytecodes::_nofast_putfield || (byte == Bytecodes::_nop && !check_access), "bad field access bytecode"); bool is_static = (byte == Bytecodes::_getstatic || byte == Bytecodes::_putstatic); - bool is_put = (byte == Bytecodes::_putfield || byte == Bytecodes::_putstatic); - + bool is_put = (byte == Bytecodes::_putfield || byte == Bytecodes::_putstatic || byte == Bytecodes::_nofast_putfield); // Check if there's a resolved klass containing the field if (resolved_klass.is_null()) { ResourceMark rm(THREAD); @@ -1406,10 +1406,11 @@ methodHandle LinkResolver::resolve_virtual_call_or_null( KlassHandle resolved_klass, Symbol* name, Symbol* signature, - KlassHandle current_klass) { + KlassHandle current_klass, + bool check_access) { EXCEPTION_MARK; CallInfo info; - resolve_virtual_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, true, false, THREAD); + resolve_virtual_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, check_access, false, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return methodHandle(); @@ -1422,10 +1423,11 @@ methodHandle LinkResolver::resolve_interface_call_or_null( KlassHandle resolved_klass, Symbol* name, Symbol* signature, - KlassHandle current_klass) { + KlassHandle current_klass, + bool check_access) { EXCEPTION_MARK; CallInfo info; - resolve_interface_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, true, false, THREAD); + resolve_interface_call(info, Handle(), receiver_klass, resolved_klass, name, signature, current_klass, check_access, false, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return methodHandle(); @@ -1453,10 +1455,11 @@ methodHandle LinkResolver::resolve_static_call_or_null( KlassHandle resolved_klass, Symbol* name, Symbol* signature, - KlassHandle current_klass) { + KlassHandle current_klass, + bool check_access) { EXCEPTION_MARK; CallInfo info; - resolve_static_call(info, resolved_klass, name, signature, current_klass, true, false, THREAD); + resolve_static_call(info, resolved_klass, name, signature, current_klass, check_access, false, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return methodHandle(); @@ -1464,11 +1467,15 @@ methodHandle LinkResolver::resolve_static_call_or_null( return info.selected_method(); } -methodHandle LinkResolver::resolve_special_call_or_null(KlassHandle resolved_klass, Symbol* name, Symbol* signature, - KlassHandle current_klass) { +methodHandle LinkResolver::resolve_special_call_or_null( + KlassHandle resolved_klass, + Symbol* name, + Symbol* signature, + KlassHandle current_klass, + bool check_access) { EXCEPTION_MARK; CallInfo info; - resolve_special_call(info, resolved_klass, name, signature, current_klass, true, THREAD); + resolve_special_call(info, resolved_klass, name, signature, current_klass, check_access, THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return methodHandle(); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index f598380591b..5fa536491c9 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -181,10 +181,10 @@ class LinkResolver: AllStatic { // same as above for compile-time resolution; but returns null handle instead of throwing an exception on error // also, does not initialize klass (i.e., no side effects) - static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); - static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); - static methodHandle resolve_static_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); - static methodHandle resolve_special_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); + static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true); + static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true); + static methodHandle resolve_static_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true); + static methodHandle resolve_special_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access = true); static int vtable_index_of_interface_method(KlassHandle klass, methodHandle resolved_method); // same as above for compile-time resolution; returns vtable_index if current_klass if linked diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index 2474ae758ba..2dc51f345d6 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -26,6 +26,7 @@ #include "interpreter/bytecodes.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/rewriter.hpp" +#include "memory/metaspaceShared.hpp" #include "memory/gcLocker.hpp" #include "memory/resourceArea.hpp" #include "oops/generateOopMap.hpp" @@ -167,12 +168,12 @@ void Rewriter::rewrite_invokespecial(address bcp, int offset, bool reverse, bool if (!reverse) { int cp_index = Bytes::get_Java_u2(p); if (_pool->tag_at(cp_index).is_interface_method()) { - int cache_index = add_invokespecial_cp_cache_entry(cp_index); - if (cache_index != (int)(jushort) cache_index) { - *invokespecial_error = true; - } - Bytes::put_native_u2(p, cache_index); - } else { + int cache_index = add_invokespecial_cp_cache_entry(cp_index); + if (cache_index != (int)(jushort) cache_index) { + *invokespecial_error = true; + } + Bytes::put_native_u2(p, cache_index); + } else { rewrite_member_reference(bcp, offset, reverse); } } else { @@ -500,12 +501,14 @@ void Rewriter::rewrite_bytecodes(TRAPS) { } void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) { + if (!DumpSharedSpaces) { + assert(!MetaspaceShared::is_in_shared_space(klass()), "archive methods must not be rewritten at run time"); + } ResourceMark rm(THREAD); Rewriter rw(klass, klass->constants(), klass->methods(), CHECK); // (That's all, folks.) } - Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array* methods, TRAPS) : _klass(klass), _pool(cpool), diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp index 8449321d9f3..3450dbd825f 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.cpp +++ b/hotspot/src/share/vm/interpreter/templateTable.cpp @@ -517,6 +517,12 @@ void TemplateTable::initialize() { def(Bytecodes::_invokehandle , ubcp|disp|clvm|____, vtos, vtos, invokehandle , f1_byte ); + def(Bytecodes::_nofast_getfield , ubcp|____|clvm|____, vtos, vtos, nofast_getfield , f1_byte ); + def(Bytecodes::_nofast_putfield , ubcp|____|clvm|____, vtos, vtos, nofast_putfield , f2_byte ); + + def(Bytecodes::_nofast_aload_0 , ____|____|clvm|____, vtos, atos, nofast_aload_0 , _ ); + def(Bytecodes::_nofast_iload , ubcp|____|clvm|____, vtos, itos, nofast_iload , _ ); + def(Bytecodes::_shouldnotreachhere , ____|____|____|____, vtos, vtos, shouldnotreachhere , _ ); // platform specific bytecodes pd_initialize(); diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index 6ead5074082..bd4a76493d9 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -82,6 +82,7 @@ class TemplateTable: AllStatic { enum Operation { add, sub, mul, div, rem, _and, _or, _xor, shl, shr, ushr }; enum Condition { equal, not_equal, less, less_equal, greater, greater_equal }; enum CacheByte { f1_byte = 1, f2_byte = 2 }; // byte_no codes + enum RewriteControl { may_rewrite, may_not_rewrite }; // control for fast code under CDS private: static bool _is_initialized; // true if TemplateTable has been initialized @@ -165,6 +166,10 @@ class TemplateTable: AllStatic { static void dload(int n); static void aload(int n); static void aload_0(); + static void nofast_aload_0(); + static void nofast_iload(); + static void iload_internal(RewriteControl rc = may_rewrite); + static void aload_0_internal(RewriteControl rc = may_rewrite); static void istore(); static void lstore(); @@ -279,10 +284,13 @@ class TemplateTable: AllStatic { static void invokehandle(int byte_no); static void fast_invokevfinal(int byte_no); - static void getfield_or_static(int byte_no, bool is_static); - static void putfield_or_static(int byte_no, bool is_static); + static void getfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite); + static void putfield_or_static(int byte_no, bool is_static, RewriteControl rc = may_rewrite); + static void getfield(int byte_no); static void putfield(int byte_no); + static void nofast_getfield(int byte_no); + static void nofast_putfield(int byte_no); static void getstatic(int byte_no); static void putstatic(int byte_no); static void pop_and_check_object(Register obj); @@ -343,10 +351,8 @@ class TemplateTable: AllStatic { // Platform specifics #if defined TEMPLATETABLE_MD_HPP # include TEMPLATETABLE_MD_HPP -#elif defined TARGET_ARCH_MODEL_x86_32 -# include "templateTable_x86_32.hpp" -#elif defined TARGET_ARCH_MODEL_x86_64 -# include "templateTable_x86_64.hpp" +#elif defined (TARGET_ARCH_MODEL_x86_32) || defined (TARGET_ARCH_MODEL_x86_64) +# include "templateTable_x86.hpp" #elif defined TARGET_ARCH_MODEL_sparc # include "templateTable_sparc.hpp" #elif defined TARGET_ARCH_MODEL_zero diff --git a/hotspot/src/share/vm/libadt/set.cpp b/hotspot/src/share/vm/libadt/set.cpp index d2e1a68a03b..caeed325151 100644 --- a/hotspot/src/share/vm/libadt/set.cpp +++ b/hotspot/src/share/vm/libadt/set.cpp @@ -57,7 +57,7 @@ const CoSet *Set::asCoSet() const { assert(0); return NULL; } // The caller must deallocate the string. char *Set::setstr() const { - if( !this ) return os::strdup("{no set}"); + if( this == NULL ) return os::strdup("{no set}"); Set &set = clone(); // Virtually copy the basic set. set.Sort(); // Sort elements for in-order retrieval diff --git a/hotspot/src/share/vm/memory/allocation.inline.hpp b/hotspot/src/share/vm/memory/allocation.inline.hpp index 7d012f328bb..961f510b14e 100644 --- a/hotspot/src/share/vm/memory/allocation.inline.hpp +++ b/hotspot/src/share/vm/memory/allocation.inline.hpp @@ -62,11 +62,18 @@ inline char* AllocateHeap(size_t size, MEMFLAGS flags, } return p; } + +#ifdef __GNUC__ +__attribute__((always_inline)) +#endif inline char* AllocateHeap(size_t size, MEMFLAGS flags, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) { return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode); } +#ifdef __GNUC__ +__attribute__((always_inline)) +#endif inline char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) { char* p = (char*) os::realloc(old, size, flag, CURRENT_PC); diff --git a/hotspot/src/share/vm/memory/blockOffsetTable.hpp b/hotspot/src/share/vm/memory/blockOffsetTable.hpp index 53343e4ee09..8f0372941d9 100644 --- a/hotspot/src/share/vm/memory/blockOffsetTable.hpp +++ b/hotspot/src/share/vm/memory/blockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ #define SHARE_VM_MEMORY_BLOCKOFFSETTABLE_HPP #include "memory/memRegion.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" // The CollectedHeap type requires subtypes to implement a method diff --git a/hotspot/src/share/vm/memory/cardGeneration.cpp b/hotspot/src/share/vm/memory/cardGeneration.cpp index 21e8d9e51a7..25f317c49bc 100644 --- a/hotspot/src/share/vm/memory/cardGeneration.cpp +++ b/hotspot/src/share/vm/memory/cardGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +60,7 @@ CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size, // which would cause problems when we commit/uncommit memory, and when we // clear and dirty cards. guarantee(_rs->is_aligned(reserved_mr.start()), "generation must be card aligned"); - if (reserved_mr.end() != Universe::heap()->reserved_region().end()) { + if (reserved_mr.end() != GenCollectedHeap::heap()->reserved_region().end()) { // Don't check at the very end of the heap as we'll assert that we're probing off // the end if we try. guarantee(_rs->is_aligned(reserved_mr.end()), "generation must be card aligned"); @@ -78,7 +78,7 @@ bool CardGeneration::grow_by(size_t bytes) { heap_word_size(_virtual_space.committed_size()); MemRegion mr(space()->bottom(), new_word_size); // Expand card table - Universe::heap()->barrier_set()->resize_covered_region(mr); + GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr); // Expand shared block offset array _bts->resize(new_word_size); @@ -170,7 +170,7 @@ void CardGeneration::shrink(size_t bytes) { _bts->resize(new_word_size); MemRegion mr(space()->bottom(), new_word_size); // Shrink the card table - Universe::heap()->barrier_set()->resize_covered_region(mr); + GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr); if (Verbose && PrintGC) { size_t new_mem_size = _virtual_space.committed_size(); diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index ac8c7484f98..903b0a0eee3 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -23,16 +23,17 @@ */ #include "precompiled.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/allocation.inline.hpp" #include "memory/cardTableModRefBS.inline.hpp" #include "memory/cardTableRS.hpp" -#include "memory/sharedHeap.hpp" +#include "memory/genCollectedHeap.hpp" #include "memory/space.hpp" #include "memory/space.inline.hpp" #include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "runtime/java.hpp" #include "runtime/mutexLocker.hpp" -#include "runtime/virtualspace.hpp" #include "services/memTracker.hpp" #include "utilities/macros.hpp" #ifdef COMPILER1 @@ -450,21 +451,20 @@ void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp, // This is an example of where n_par_threads() is used instead // of workers()->active_workers(). n_par_threads can be set to 0 to // turn off parallelism. For example when this code is called as - // part of verification and SharedHeap::process_roots() is being - // used, then n_par_threads() may have been set to 0. active_workers - // is not overloaded with the meaning that it is a switch to disable - // parallelism and so keeps the meaning of the number of - // active gc workers. If parallelism has not been shut off by - // setting n_par_threads to 0, then n_par_threads should be - // equal to active_workers. When a different mechanism for shutting - // off parallelism is used, then active_workers can be used in + // part of verification during root processing then n_par_threads() + // may have been set to 0. active_workers is not overloaded with + // the meaning that it is a switch to disable parallelism and so keeps + // the meaning of the number of active gc workers. If parallelism has + // not been shut off by setting n_par_threads to 0, then n_par_threads + // should be equal to active_workers. When a different mechanism for + // shutting off parallelism is used, then active_workers can be used in // place of n_par_threads. - int n_threads = SharedHeap::heap()->n_par_threads(); + int n_threads = GenCollectedHeap::heap()->n_par_threads(); bool is_par = n_threads > 0; if (is_par) { #if INCLUDE_ALL_GCS - assert(SharedHeap::heap()->n_par_threads() == - SharedHeap::heap()->workers()->active_workers(), "Mismatch"); + assert(GenCollectedHeap::heap()->n_par_threads() == + GenCollectedHeap::heap()->workers()->active_workers(), "Mismatch"); non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads); #else // INCLUDE_ALL_GCS fatal("Parallel gc not supported here."); diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp index be98f7a70a7..bd3604916d8 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.cpp +++ b/hotspot/src/share/vm/memory/cardTableRS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,16 +38,18 @@ CardTableRS::CardTableRS(MemRegion whole_heap) : GenRemSet(), _cur_youngergen_card_val(youngergenP1_card) { - guarantee(Universe::heap()->kind() == CollectedHeap::GenCollectedHeap, "sanity"); _ct_bs = new CardTableModRefBSForCTRS(whole_heap); _ct_bs->initialize(); set_bs(_ct_bs); - _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1, + // max_gens is really GenCollectedHeap::heap()->gen_policy()->number_of_generations() + // (which is always 2, young & old), but GenCollectedHeap has not been initialized yet. + uint max_gens = 2; + _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, max_gens + 1, mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL); if (_last_cur_val_in_gen == NULL) { vm_exit_during_initialization("Could not create last_cur_val_in_gen array."); } - for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) { + for (uint i = 0; i < max_gens + 1; i++) { _last_cur_val_in_gen[i] = clean_card_val(); } _ct_bs->set_CTRS(this); @@ -167,16 +169,20 @@ ClearNoncleanCardWrapper::ClearNoncleanCardWrapper( // Cannot yet substitute active_workers for n_par_threads // in the case where parallelism is being turned off by // setting n_par_threads to 0. - _is_par = (SharedHeap::heap()->n_par_threads() > 0); + _is_par = (GenCollectedHeap::heap()->n_par_threads() > 0); assert(!_is_par || - (SharedHeap::heap()->n_par_threads() == - SharedHeap::heap()->workers()->active_workers()), "Mismatch"); + (GenCollectedHeap::heap()->n_par_threads() == + GenCollectedHeap::heap()->workers()->active_workers()), "Mismatch"); } bool ClearNoncleanCardWrapper::is_word_aligned(jbyte* entry) { return (((intptr_t)entry) & (BytesPerWord-1)) == 0; } +// The regions are visited in *decreasing* address order. +// This order aids with imprecise card marking, where a dirty +// card may cause scanning, and summarization marking, of objects +// that extend onto subsequent cards. void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) { assert(mr.word_size() > 0, "Error"); assert(_ct->is_aligned(mr.start()), "mr.start() should be card aligned"); @@ -591,10 +597,6 @@ void CardTableRS::verify() { // At present, we only know how to verify the card table RS for // generational heaps. VerifyCTGenClosure blk(this); - CollectedHeap* ch = Universe::heap(); - - if (ch->kind() == CollectedHeap::GenCollectedHeap) { - GenCollectedHeap::heap()->generation_iterate(&blk, false); - _ct_bs->verify(); - } - } + GenCollectedHeap::heap()->generation_iterate(&blk, false); + _ct_bs->verify(); +} diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index 094e3c3e28e..08464c513eb 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -669,7 +669,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, } // Read the gc count while the heap lock is held. - gc_count_before = Universe::heap()->total_collections(); + gc_count_before = gch->total_collections(); } VM_GenCollectForAllocation op(size, is_tlab, gc_count_before); diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp index e306632374c..b414621db29 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp @@ -48,6 +48,9 @@ #include "utilities/copy.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/stack.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc_implementation/parNew/parOopClosures.hpp" +#endif // // DefNewGeneration functions. @@ -190,7 +193,9 @@ DefNewGeneration::DefNewGeneration(ReservedSpace rs, { MemRegion cmr((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); - Universe::heap()->barrier_set()->resize_covered_region(cmr); + GenCollectedHeap* gch = GenCollectedHeap::heap(); + + gch->barrier_set()->resize_covered_region(cmr); _eden_space = new ContiguousSpace(); _from_space = new ContiguousSpace(); @@ -202,13 +207,13 @@ DefNewGeneration::DefNewGeneration(ReservedSpace rs, // Compute the maximum eden and survivor space sizes. These sizes // are computed assuming the entire reserved space is committed. // These values are exported as performance counters. - uintx alignment = GenCollectedHeap::heap()->collector_policy()->space_alignment(); + uintx alignment = gch->collector_policy()->space_alignment(); uintx size = _virtual_space.reserved_size(); _max_survivor_size = compute_survivor_size(size, alignment); _max_eden_size = size - (2*_max_survivor_size); // allocate the performance counters - GenCollectorPolicy* gcp = (GenCollectorPolicy*) GenCollectedHeap::heap()->collector_policy(); + GenCollectorPolicy* gcp = (GenCollectorPolicy*)gch->collector_policy(); // Generation counters -- generation 0, 3 subspaces _gen_counters = new GenerationCounters("new", 0, 3, @@ -378,8 +383,7 @@ void DefNewGeneration::compute_new_size() { int next_level = level() + 1; GenCollectedHeap* gch = GenCollectedHeap::heap(); - assert(next_level < gch->n_gens(), - "DefNewGeneration cannot be an oldest gen"); + assert(next_level == 1, "DefNewGeneration must be a young gen"); Generation* old_gen = gch->old_gen(); size_t old_size = old_gen->capacity(); @@ -431,7 +435,7 @@ void DefNewGeneration::compute_new_size() { SpaceDecorator::DontMangle); MemRegion cmr((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); - Universe::heap()->barrier_set()->resize_covered_region(cmr); + gch->barrier_set()->resize_covered_region(cmr); if (Verbose && PrintGC) { size_t new_size_after = _virtual_space.committed_size(); size_t eden_size_after = eden()->capacity(); @@ -550,8 +554,9 @@ HeapWord* DefNewGeneration::expand_and_allocate(size_t size, void DefNewGeneration::adjust_desired_tenuring_threshold() { // Set the desired survivor size to half the real survivor space + GCPolicyCounters* gc_counters = GenCollectedHeap::heap()->collector_policy()->counters(); _tenuring_threshold = - age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize); + age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize, gc_counters); } void DefNewGeneration::collect(bool full, @@ -688,7 +693,7 @@ void DefNewGeneration::collect(bool full, gc_tracer.report_promotion_failed(_promotion_failed_info); // Reset the PromotionFailureALot counters. - NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) + NOT_PRODUCT(gch->reset_promotion_should_fail();) } if (PrintGC && !PrintGCDetails) { gch->print_heap_change(gch_prev_used); diff --git a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp index 111db332bab..b10d6d9e783 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp @@ -25,9 +25,9 @@ #ifndef SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP #define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP -#include "gc_interface/collectedHeap.hpp" #include "memory/cardTableRS.hpp" #include "memory/defNewGeneration.hpp" +#include "memory/genCollectedHeap.hpp" #include "memory/genOopClosures.inline.hpp" #include "memory/space.hpp" @@ -60,7 +60,7 @@ inline void DefNewGeneration::KeepAliveClosure::do_oop_work(T* p) { // We could check that p is also in an older generation, but // dirty cards in the youngest gen are never scanned, so the // extra check probably isn't worthwhile. - if (Universe::heap()->is_in_reserved(p)) { + if (GenCollectedHeap::heap()->is_in_reserved(p)) { oop obj = oopDesc::load_decode_heap_oop_not_null(p); _rs->inline_write_ref_field_gc(p, obj); } @@ -84,7 +84,7 @@ inline void DefNewGeneration::FastKeepAliveClosure::do_oop_work(T* p) { // we set a younger_gen card if we have an older->youngest // generation pointer. oop obj = oopDesc::load_decode_heap_oop_not_null(p); - if (((HeapWord*)obj < _boundary) && Universe::heap()->is_in_reserved(p)) { + if (((HeapWord*)obj < _boundary) && GenCollectedHeap::heap()->is_in_reserved(p)) { _rs->inline_write_ref_field_gc(p, obj); } } diff --git a/hotspot/src/share/vm/memory/freeList.cpp b/hotspot/src/share/vm/memory/freeList.cpp index 2eb74992b89..6cddc6aed41 100644 --- a/hotspot/src/share/vm/memory/freeList.cpp +++ b/hotspot/src/share/vm/memory/freeList.cpp @@ -23,10 +23,10 @@ */ #include "precompiled.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/freeBlockDictionary.hpp" #include "memory/freeList.hpp" #include "memory/metachunk.hpp" -#include "memory/sharedHeap.hpp" #include "runtime/globals.hpp" #include "runtime/mutex.hpp" #include "runtime/vmThread.hpp" diff --git a/hotspot/src/share/vm/memory/gcLocker.cpp b/hotspot/src/share/vm/memory/gcLocker.cpp index fae40920a87..6c82777628c 100644 --- a/hotspot/src/share/vm/memory/gcLocker.cpp +++ b/hotspot/src/share/vm/memory/gcLocker.cpp @@ -23,9 +23,9 @@ */ #include "precompiled.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/gcLocker.inline.hpp" #include "memory/resourceArea.hpp" -#include "memory/sharedHeap.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index 8b8114cb498..85dacb7cd81 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -39,7 +39,7 @@ #include "memory/genOopClosures.inline.hpp" #include "memory/generationSpec.hpp" #include "memory/resourceArea.hpp" -#include "memory/sharedHeap.hpp" +#include "memory/strongRootsScope.hpp" #include "memory/space.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" @@ -50,15 +50,15 @@ #include "runtime/vmThread.hpp" #include "services/management.hpp" #include "services/memoryService.hpp" +#include "utilities/macros.hpp" +#include "utilities/stack.inline.hpp" #include "utilities/vmError.hpp" #include "utilities/workgroup.hpp" -#include "utilities/macros.hpp" #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp" #endif // INCLUDE_ALL_GCS -GenCollectedHeap* GenCollectedHeap::_gch; NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;) // The set of potentially parallel tasks in root scanning. @@ -78,21 +78,27 @@ enum GCH_strong_roots_tasks { }; GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) : - SharedHeap(), + CollectedHeap(), _rem_set(NULL), _gen_policy(policy), _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)), _full_collections_completed(0) { assert(policy != NULL, "Sanity check"); + if (UseConcMarkSweepGC) { + _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads, + /* are_GC_task_threads */true, + /* are_ConcurrentGC_threads */false); + _workers->initialize_workers(); + } else { + // Serial GC does not use workers. + _workers = NULL; + } } jint GenCollectedHeap::initialize() { CollectedHeap::pre_initialize(); - _n_gens = gen_policy()->number_of_generations(); - assert(_n_gens == 2, "There is no support for more than two generations"); - // While there are no constraints in the GC code that HeapWordSize // be any particular value, there are multiple other areas in the // system which believe this to be true (e.g. oop->object_size in some @@ -120,8 +126,6 @@ jint GenCollectedHeap::initialize() { _rem_set = collector_policy()->create_rem_set(reserved_region()); set_barrier_set(rem_set()->bs()); - _gch = this; - ReservedSpace young_rs = heap_rs.first_part(gen_policy()->young_gen_spec()->max_size(), false, false); _young_gen = gen_policy()->young_gen_spec()->init(young_rs, 0, rem_set()); heap_rs = heap_rs.last_part(gen_policy()->young_gen_spec()->max_size()); @@ -166,7 +170,8 @@ char* GenCollectedHeap::allocate(size_t alignment, } void GenCollectedHeap::post_initialize() { - SharedHeap::post_initialize(); + CollectedHeap::post_initialize(); + ref_processing_init(); GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy(); guarantee(policy->is_generation_policy(), "Illegal policy type"); assert((_young_gen->kind() == Generation::DefNew) || @@ -185,7 +190,6 @@ void GenCollectedHeap::post_initialize() { } void GenCollectedHeap::ref_processing_init() { - SharedHeap::ref_processing_init(); _young_gen->ref_processor_init(); _old_gen->ref_processor_init(); } @@ -200,8 +204,7 @@ size_t GenCollectedHeap::used() const { // Save the "used_region" for generations level and lower. void GenCollectedHeap::save_used_regions(int level) { - assert(level >= 0, "Illegal level parameter"); - assert(level < _n_gens, "Illegal level parameter"); + assert(level == 0 || level == 1, "Illegal level parameter"); if (level == 1) { _old_gen->save_used_region(); } @@ -417,7 +420,6 @@ void GenCollectedHeap::do_collection(bool full, assert(Heap_lock->is_locked(), "the requesting thread should have the Heap_lock"); guarantee(!is_gc_active(), "collection is not reentrant"); - assert(max_level < n_gens(), "sanity check"); if (GC_locker::check_active_before_gc()) { return; // GC is disabled (e.g. JNI GetXXXCritical operation) @@ -435,7 +437,7 @@ void GenCollectedHeap::do_collection(bool full, { FlagSetting fl(_is_gc_active, true); - bool complete = full && (max_level == (n_gens()-1)); + bool complete = full && (max_level == 1 /* old */); const char* gc_cause_prefix = complete ? "Full GC" : "GC"; TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); // The PrintGCDetails logging starts before we have incremented the GC id. We will do that later @@ -507,7 +509,7 @@ void GenCollectedHeap::do_collection(bool full, // Update "complete" boolean wrt what actually transpired -- // for instance, a promotion failure could have led to // a whole heap collection. - complete = complete || (max_level_collected == n_gens() - 1); + complete = complete || (max_level_collected == 1 /* old */); if (complete) { // We did a "major" collection // FIXME: See comment at pre_full_gc_dump call @@ -524,7 +526,7 @@ void GenCollectedHeap::do_collection(bool full, } // Adjust generation sizes. - if (max_level_collected == 1) { + if (max_level_collected == 1 /* old */) { _old_gen->compute_new_size(); } _young_gen->compute_new_size(); @@ -560,7 +562,8 @@ HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) } void GenCollectedHeap::set_par_threads(uint t) { - SharedHeap::set_par_threads(t); + assert(t == 0 || !UseSerialGC, "Cannot have parallel threads"); + CollectedHeap::set_par_threads(t); set_n_termination(t); } @@ -586,7 +589,7 @@ void GenCollectedHeap::process_roots(bool activate_scope, CLDClosure* strong_cld_closure, CLDClosure* weak_cld_closure, CodeBlobClosure* code_roots) { - StrongRootsScope srs(this, activate_scope); + StrongRootsScope srs(activate_scope); // General roots. assert(Threads::thread_claim_parity() != 0, "must have called prologue code"); @@ -606,7 +609,8 @@ void GenCollectedHeap::process_roots(bool activate_scope, // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots; - Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p); + bool is_par = n_par_threads() > 0; + Threads::possibly_parallel_oops_do(is_par, strong_roots, roots_from_clds_p, roots_from_code_p); if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) { Universe::oops_do(strong_roots); @@ -771,19 +775,19 @@ void GenCollectedHeap::collect(GCCause::Cause cause) { #endif // INCLUDE_ALL_GCS } else if (cause == GCCause::_wb_young_gc) { // minor collection for WhiteBox API - collect(cause, 0); + collect(cause, 0 /* young */); } else { #ifdef ASSERT if (cause == GCCause::_scavenge_alot) { // minor collection only - collect(cause, 0); + collect(cause, 0 /* young */); } else { // Stop-the-world full collection - collect(cause, n_gens() - 1); + collect(cause, 1 /* old */); } #else // Stop-the-world full collection - collect(cause, n_gens() - 1); + collect(cause, 1 /* old */); #endif } } @@ -798,7 +802,7 @@ void GenCollectedHeap::collect(GCCause::Cause cause, int max_level) { void GenCollectedHeap::collect_locked(GCCause::Cause cause) { // The caller has the Heap_lock assert(Heap_lock->owned_by_self(), "this thread should own the Heap_lock"); - collect_locked(cause, n_gens() - 1); + collect_locked(cause, 1 /* old */); } // this is the private collection interface @@ -854,7 +858,7 @@ void GenCollectedHeap::collect_mostly_concurrent(GCCause::Cause cause) { #endif // INCLUDE_ALL_GCS void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs) { - do_full_collection(clear_all_soft_refs, _n_gens - 1); + do_full_collection(clear_all_soft_refs, 1 /* old */); } void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs, @@ -886,7 +890,7 @@ void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs, clear_all_soft_refs /* clear_all_soft_refs */, 0 /* size */, false /* is_tlab */, - n_gens() - 1 /* max_level */); + 1 /* old */ /* max_level */); } } @@ -899,17 +903,6 @@ bool GenCollectedHeap::is_in_young(oop p) { // Returns "TRUE" iff "p" points into the committed areas of the heap. bool GenCollectedHeap::is_in(const void* p) const { - #ifndef ASSERT - guarantee(VerifyBeforeGC || - VerifyDuringGC || - VerifyBeforeExit || - VerifyDuringStartup || - PrintAssembly || - tty->count() != 0 || // already printing - VerifyAfterGC || - VMError::fatal_error_in_progress(), "too expensive"); - - #endif return _young_gen->is_in(p) || _old_gen->is_in(p); } @@ -923,6 +916,11 @@ bool GenCollectedHeap::is_in_partial_collection(const void* p) { } #endif +void GenCollectedHeap::oop_iterate_no_header(OopClosure* cl) { + NoHeaderExtendedOopClosure no_header_cl(cl); + oop_iterate(&no_header_cl); +} + void GenCollectedHeap::oop_iterate(ExtendedOopClosure* cl) { _young_gen->oop_iterate(cl); _old_gen->oop_iterate(cl); @@ -1092,11 +1090,6 @@ void GenCollectedHeap::generation_iterate(GenClosure* cl, } } -void GenCollectedHeap::space_iterate(SpaceClosure* cl) { - _young_gen->space_iterate(cl, true); - _old_gen->space_iterate(cl, true); -} - bool GenCollectedHeap::is_maximal_no_gc() const { return _young_gen->is_maximal_no_gc() && _old_gen->is_maximal_no_gc(); } @@ -1107,14 +1100,13 @@ void GenCollectedHeap::save_marks() { } GenCollectedHeap* GenCollectedHeap::heap() { - assert(_gch != NULL, "Uninitialized access to GenCollectedHeap::heap()"); - assert(_gch->kind() == CollectedHeap::GenCollectedHeap, "not a generational heap"); - return _gch; + CollectedHeap* heap = Universe::heap(); + assert(heap != NULL, "Uninitialized access to GenCollectedHeap::heap()"); + assert(heap->kind() == CollectedHeap::GenCollectedHeap, "Not a GenCollectedHeap"); + return (GenCollectedHeap*)heap; } - void GenCollectedHeap::prepare_for_compaction() { - guarantee(_n_gens = 2, "Wrong number of generations"); // Start by compacting into same gen. CompactPoint cp(_old_gen); _old_gen->prepare_for_compaction(&cp); diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp index a91432748a0..80ba8c18827 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp @@ -26,15 +26,16 @@ #define SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP #include "gc_implementation/shared/adaptiveSizePolicy.hpp" +#include "gc_interface/collectedHeap.hpp" #include "memory/collectorPolicy.hpp" #include "memory/generation.hpp" -#include "memory/sharedHeap.hpp" class SubTasksDone; +class FlexibleWorkGang; -// A "GenCollectedHeap" is a SharedHeap that uses generational +// A "GenCollectedHeap" is a CollectedHeap that uses generational // collection. It has two generations, young and old. -class GenCollectedHeap : public SharedHeap { +class GenCollectedHeap : public CollectedHeap { friend class GenCollectorPolicy; friend class Generation; friend class DefNewGeneration; @@ -51,19 +52,9 @@ class GenCollectedHeap : public SharedHeap { friend class GCCauseSetter; friend class VMStructs; public: - enum SomeConstants { - max_gens = 10 - }; - friend class VM_PopulateDumpSharedSpace; - protected: - // Fields: - static GenCollectedHeap* _gch; - - private: - int _n_gens; - +private: Generation* _young_gen; Generation* _old_gen; @@ -93,6 +84,8 @@ public: // In block contents verification, the number of header words to skip NOT_PRODUCT(static size_t _skip_header_HeapWords;) + FlexibleWorkGang* _workers; + protected: // Helper functions for allocation HeapWord* attempt_allocation(size_t size, @@ -125,6 +118,8 @@ protected: public: GenCollectedHeap(GenCollectorPolicy *policy); + FlexibleWorkGang* workers() const { return _workers; } + GCStats* gc_stats(int level) const; // Returns JNI_OK on success @@ -178,9 +173,6 @@ public: HeapWord** top_addr() const; HeapWord** end_addr() const; - // Does this heap support heap inspection? (+PrintClassHistogram) - virtual bool supports_heap_inspection() const { return true; } - // Perform a full collection of the heap; intended for use in implementing // "System.gc". This implies as full a collection as the CollectedHeap // supports. Caller does not hold the Heap_lock on entry. @@ -223,6 +215,7 @@ public: } // Iteration functions. + void oop_iterate_no_header(OopClosure* cl); void oop_iterate(ExtendedOopClosure* cl); void object_iterate(ObjectClosure* cl); void safe_object_iterate(ObjectClosure* cl); @@ -280,11 +273,6 @@ public: // only and may need to be re-examined in case other // kinds of collectors are implemented in the future. virtual bool can_elide_initializing_store_barrier(oop new_obj) { - // We wanted to assert that:- - // assert(UseSerialGC || UseConcMarkSweepGC, - // "Check can_elide_initializing_store_barrier() for this collector"); - // but unfortunately the flag UseSerialGC need not necessarily always - // be set when DefNew+Tenured are being used. return is_in_young(new_obj); } @@ -331,7 +319,6 @@ public: _old_gen->update_gc_stats(current_level, full); } - // Override. bool no_gc_in_progress() { return !is_gc_active(); } // Override. @@ -363,18 +350,11 @@ public: // If "old_to_young" determines the order. void generation_iterate(GenClosure* cl, bool old_to_young); - void space_iterate(SpaceClosure* cl); - // Return "true" if all generations have reached the // maximal committed limit that they can reach, without a garbage // collection. virtual bool is_maximal_no_gc() const; - int n_gens() const { - assert(_n_gens == gen_policy()->number_of_generations(), "Sanity"); - return _n_gens; - } - // This function returns the "GenRemSet" object that allows us to scan // generations in a fully generational heap. GenRemSet* rem_set() { return _rem_set; } @@ -531,8 +511,8 @@ private: void record_gen_tops_before_GC() PRODUCT_RETURN; protected: - virtual void gc_prologue(bool full); - virtual void gc_epilogue(bool full); + void gc_prologue(bool full); + void gc_epilogue(bool full); }; #endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp index ef2707999f2..94100be74d4 100644 --- a/hotspot/src/share/vm/memory/genMarkSweep.cpp +++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp @@ -187,7 +187,6 @@ void GenMarkSweep::mark_sweep_phase1(int level, bool clear_all_softrefs) { // Recursively traverse all live objects and mark them GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace(" 1"); GenCollectedHeap* gch = GenCollectedHeap::heap(); @@ -258,7 +257,6 @@ void GenMarkSweep::mark_sweep_phase2() { GenCollectedHeap* gch = GenCollectedHeap::heap(); GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("2"); gch->prepare_for_compaction(); } @@ -275,7 +273,6 @@ void GenMarkSweep::mark_sweep_phase3(int level) { // Adjust the pointers to reflect the new locations GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("3"); // Need new claim bits for the pointer adjustment tracing. ClassLoaderDataGraph::clear_claimed_marks(); @@ -325,7 +322,6 @@ void GenMarkSweep::mark_sweep_phase4() { GenCollectedHeap* gch = GenCollectedHeap::heap(); GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer, _gc_tracer->gc_id()); - trace("4"); GenCompactClosure blk; gch->generation_iterate(&blk, true); diff --git a/hotspot/src/share/vm/memory/genOopClosures.cpp b/hotspot/src/share/vm/memory/genOopClosures.cpp new file mode 100644 index 00000000000..d076f5ef90f --- /dev/null +++ b/hotspot/src/share/vm/memory/genOopClosures.cpp @@ -0,0 +1,30 @@ +/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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/genOopClosures.inline.hpp" +#include "memory/iterator.inline.hpp" +#include "memory/specialized_oop_closures.hpp" + +// Generate Serial GC specialized oop_oop_iterate functions. +SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff --git a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp index 3b2b83dfa0c..6842d88cb7f 100644 --- a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp +++ b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp @@ -31,7 +31,6 @@ #include "memory/genOopClosures.hpp" #include "memory/genRemSet.hpp" #include "memory/generation.hpp" -#include "memory/sharedHeap.hpp" #include "memory/space.hpp" inline OopsInGenClosure::OopsInGenClosure(Generation* gen) : diff --git a/hotspot/src/share/vm/memory/generation.cpp b/hotspot/src/share/vm/memory/generation.cpp index e27cb603291..2518f2c53a6 100644 --- a/hotspot/src/share/vm/memory/generation.cpp +++ b/hotspot/src/share/vm/memory/generation.cpp @@ -187,7 +187,7 @@ oop Generation::promote(oop obj, size_t obj_size) { assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); #ifndef PRODUCT - if (Universe::heap()->promotion_should_fail()) { + if (GenCollectedHeap::heap()->promotion_should_fail()) { return NULL; } #endif // #ifndef PRODUCT diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp index 650f54b72f8..00a7efaca23 100644 --- a/hotspot/src/share/vm/memory/generation.hpp +++ b/hotspot/src/share/vm/memory/generation.hpp @@ -30,10 +30,10 @@ #include "memory/memRegion.hpp" #include "memory/referenceProcessor.hpp" #include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "memory/watermark.hpp" #include "runtime/mutex.hpp" #include "runtime/perfData.hpp" -#include "runtime/virtualspace.hpp" // A Generation models a heap area for similarly-aged objects. // It will contain one ore more spaces holding the actual objects. diff --git a/hotspot/src/share/vm/memory/heap.hpp b/hotspot/src/share/vm/memory/heap.hpp index 45b43ce06c1..f623e45fa32 100644 --- a/hotspot/src/share/vm/memory/heap.hpp +++ b/hotspot/src/share/vm/memory/heap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +27,7 @@ #include "code/codeBlob.hpp" #include "memory/allocation.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" // Blocks diff --git a/hotspot/src/share/vm/memory/iterator.cpp b/hotspot/src/share/vm/memory/iterator.cpp index 1022ece4617..83288217c62 100644 --- a/hotspot/src/share/vm/memory/iterator.cpp +++ b/hotspot/src/share/vm/memory/iterator.cpp @@ -23,8 +23,11 @@ */ #include "precompiled.hpp" -#include "memory/iterator.hpp" +#include "memory/iterator.inline.hpp" +#include "memory/universe.hpp" #include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" void KlassToOopClosure::do_klass(Klass* k) { assert(_oop_closure != NULL, "Not initialized?"); @@ -61,19 +64,18 @@ void CodeBlobToOopClosure::do_code_blob(CodeBlob* cb) { } } -MarkingCodeBlobClosure::MarkScope::MarkScope(bool activate) - : _active(activate) -{ - if (_active) nmethod::oops_do_marking_prologue(); -} - -MarkingCodeBlobClosure::MarkScope::~MarkScope() { - if (_active) nmethod::oops_do_marking_epilogue(); -} - void MarkingCodeBlobClosure::do_code_blob(CodeBlob* cb) { nmethod* nm = cb->as_nmethod_or_null(); if (nm != NULL && !nm->test_set_oops_do_mark()) { do_nmethod(nm); } } + +// Generate the *Klass::oop_oop_iterate functions for the base class +// of the oop closures. These versions use the virtual do_oop calls, +// instead of the devirtualized do_oop_nv version. +ALL_KLASS_OOP_OOP_ITERATE_DEFN(ExtendedOopClosure, _v) + +// Generate the *Klass::oop_oop_iterate functions +// for the NoHeaderExtendedOopClosure helper class. +ALL_KLASS_OOP_OOP_ITERATE_DEFN(NoHeaderExtendedOopClosure, _nv) diff --git a/hotspot/src/share/vm/memory/iterator.hpp b/hotspot/src/share/vm/memory/iterator.hpp index 12684527023..53335b8d5f1 100644 --- a/hotspot/src/share/vm/memory/iterator.hpp +++ b/hotspot/src/share/vm/memory/iterator.hpp @@ -44,9 +44,7 @@ class Closure : public StackObj { }; class OopClosure : public Closure { public: virtual void do_oop(oop* o) = 0; - virtual void do_oop_v(oop* o) { do_oop(o); } virtual void do_oop(narrowOop* o) = 0; - virtual void do_oop_v(narrowOop* o) { do_oop(o); } }; // ExtendedOopClosure adds extra code to be run during oop iterations. @@ -74,11 +72,9 @@ class ExtendedOopClosure : public OopClosure { // Currently, only CMS and G1 need these. virtual bool do_metadata() { return do_metadata_nv(); } - bool do_metadata_v() { return do_metadata(); } bool do_metadata_nv() { return false; } virtual void do_klass(Klass* k) { do_klass_nv(k); } - void do_klass_v(Klass* k) { do_klass(k); } void do_klass_nv(Klass* k) { ShouldNotReachHere(); } virtual void do_class_loader_data(ClassLoaderData* cld) { ShouldNotReachHere(); } @@ -87,6 +83,14 @@ class ExtendedOopClosure : public OopClosure { // location without an intervening "major reset" (like the end of a GC). virtual bool idempotent() { return false; } virtual bool apply_to_weak_ref_discovered_field() { return false; } + +#ifdef ASSERT + // Default verification of each visited oop field. + template void verify(T* p); + + // Can be used by subclasses to turn off the default verification of oop fields. + virtual bool should_verify_oops() { return true; } +#endif }; // Wrapper closure only used to implement oop_iterate_no_header(). @@ -147,7 +151,6 @@ class CLDToOopClosure : public CLDClosure { }; class CLDToKlassAndOopClosure : public CLDClosure { - friend class SharedHeap; friend class G1CollectedHeap; protected: OopClosure* _oop_closure; @@ -284,16 +287,6 @@ class MarkingCodeBlobClosure : public CodeBlobToOopClosure { // Called for each code blob, but at most once per unique blob. virtual void do_code_blob(CodeBlob* cb); - - class MarkScope : public StackObj { - protected: - bool _active; - public: - MarkScope(bool activate = true); - // = { if (active) nmethod::oops_do_marking_prologue(); } - ~MarkScope(); - // = { if (active) nmethod::oops_do_marking_epilogue(); } - }; }; // MonitorClosure is used for iterating over monitors in the monitors cache @@ -364,16 +357,33 @@ class SymbolClosure : public StackObj { } }; +// The two class template specializations are used to dispatch calls +// to the ExtendedOopClosure functions. If use_non_virtual_call is true, +// the non-virtual versions are called (E.g. do_oop_nv), otherwise the +// virtual versions are called (E.g. do_oop). -// Helper defines for ExtendOopClosure +template +class Devirtualizer {}; -#define if_do_metadata_checked(closure, nv_suffix) \ - /* Make sure the non-virtual and the virtual versions match. */ \ - assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \ - "Inconsistency in do_metadata"); \ - if (closure->do_metadata##nv_suffix()) +// Dispatches to the non-virtual functions. +template <> class Devirtualizer { + public: + template static void do_oop(OopClosureType* closure, T* p); + template static void do_klass(OopClosureType* closure, Klass* k); + template static bool do_metadata(OopClosureType* closure); +}; -#define assert_should_ignore_metadata(closure, nv_suffix) \ - assert(!closure->do_metadata##nv_suffix(), "Code to handle metadata is not implemented") +// Dispatches to the virtual functions. +template <> class Devirtualizer { + public: + template static void do_oop(OopClosureType* closure, T* p); + template static void do_klass(OopClosureType* closure, Klass* k); + template static bool do_metadata(OopClosureType* closure); +}; + +// Helper to convert the oop iterate macro suffixes into bool values that can be used by template functions. +#define nvs_nv_to_bool true +#define nvs_v_to_bool false +#define nvs_to_bool(nv_suffix) nvs##nv_suffix##_to_bool #endif // SHARE_VM_MEMORY_ITERATOR_HPP diff --git a/hotspot/src/share/vm/memory/iterator.inline.hpp b/hotspot/src/share/vm/memory/iterator.inline.hpp index cef12666012..e1d30becc7e 100644 --- a/hotspot/src/share/vm/memory/iterator.inline.hpp +++ b/hotspot/src/share/vm/memory/iterator.inline.hpp @@ -28,6 +28,12 @@ #include "classfile/classLoaderData.hpp" #include "memory/iterator.hpp" #include "oops/klass.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.inline.hpp" +#include "oops/instanceClassLoaderKlass.inline.hpp" +#include "oops/instanceRefKlass.inline.hpp" +#include "oops/objArrayKlass.inline.hpp" +#include "oops/typeArrayKlass.inline.hpp" #include "utilities/debug.hpp" inline void MetadataAwareOopClosure::do_class_loader_data(ClassLoaderData* cld) { @@ -44,4 +50,63 @@ inline void MetadataAwareOopClosure::do_klass_nv(Klass* k) { inline void MetadataAwareOopClosure::do_klass(Klass* k) { do_klass_nv(k); } +#ifdef ASSERT +// This verification is applied to all visited oops. +// The closures can turn is off by overriding should_verify_oops(). +template +void ExtendedOopClosure::verify(T* p) { + if (should_verify_oops()) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop o = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(Universe::heap()->is_in_closed_subset(o), + err_msg("should be in closed *p " PTR_FORMAT " " PTR_FORMAT, p2i(p), p2i(o))); + } + } +} +#endif + +// Implementation of the non-virtual do_oop dispatch. + +template +inline void Devirtualizer::do_oop(OopClosureType* closure, T* p) { + debug_only(closure->verify(p)); + closure->do_oop_nv(p); +} +template +inline void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) { + closure->do_klass_nv(k); +} +template +inline bool Devirtualizer::do_metadata(OopClosureType* closure) { + // Make sure the non-virtual and the virtual versions match. + assert(closure->do_metadata_nv() == closure->do_metadata(), "Inconsistency in do_metadata"); + return closure->do_metadata_nv(); +} + +// Implementation of the virtual do_oop dispatch. + +template +void Devirtualizer::do_oop(OopClosureType* closure, T* p) { + debug_only(closure->verify(p)); + closure->do_oop(p); +} +template +void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) { + closure->do_klass(k); +} +template +bool Devirtualizer::do_metadata(OopClosureType* closure) { + return closure->do_metadata(); +} + +// The list of all "specializable" oop_oop_iterate function definitions. +#define ALL_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + ALL_INSTANCE_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + ALL_INSTANCE_REF_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + ALL_INSTANCE_MIRROR_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + ALL_INSTANCE_CLASS_LOADER_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + ALL_OBJ_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + ALL_TYPE_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) + #endif // SHARE_VM_MEMORY_ITERATOR_INLINE_HPP diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index f85b6c44dd8..ef88f8d0ae3 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +27,7 @@ #include "memory/allocation.hpp" #include "memory/memRegion.hpp" #include "memory/metaspaceChunkFreeListSummary.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/exceptions.hpp" // Metaspace diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp index ecfa27fa3f4..613907d8420 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp @@ -30,6 +30,8 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" +#include "interpreter/bytecodes.hpp" +#include "interpreter/bytecodeStream.hpp" #include "memory/filemap.hpp" #include "memory/gcLocker.hpp" #include "memory/metaspace.hpp" @@ -104,15 +106,33 @@ static void remove_unshareable_in_classes() { } } -// Walk all methods in the class list and assign a fingerprint. -// so that this part of the ConstMethod* is read only. -static void calculate_fingerprints() { +static void rewrite_nofast_bytecode(Method* method) { + RawBytecodeStream bcs(method); + while (!bcs.is_last_bytecode()) { + Bytecodes::Code opcode = bcs.raw_next(); + switch (opcode) { + case Bytecodes::_getfield: *bcs.bcp() = Bytecodes::_nofast_getfield; break; + case Bytecodes::_putfield: *bcs.bcp() = Bytecodes::_nofast_putfield; break; + case Bytecodes::_aload_0: *bcs.bcp() = Bytecodes::_nofast_aload_0; break; + case Bytecodes::_iload: *bcs.bcp() = Bytecodes::_nofast_iload; break; + default: break; + } + } +} + +// Walk all methods in the class list to ensure that they won't be modified at +// run time. This includes: +// [1] Rewrite all bytecodes as needed, so that the ConstMethod* will not be modified +// at run time by RewriteBytecodes/RewriteFrequentPairs +// [2] Assign a fingerprint, so one doesn't need to be assigned at run-time. +static void rewrite_nofast_bytecodes_and_calculate_fingerprints() { for (int i = 0; i < _global_klass_objects->length(); i++) { Klass* k = _global_klass_objects->at(i); if (k->oop_is_instance()) { InstanceKlass* ik = InstanceKlass::cast(k); for (int i = 0; i < ik->methods()->length(); i++) { Method* m = ik->methods()->at(i); + rewrite_nofast_bytecode(m); Fingerprinter fp(m); // The side effect of this call sets method's fingerprint field. fp.fingerprint(); @@ -476,9 +496,10 @@ void VM_PopulateDumpSharedSpace::doit() { tty->print_cr(" type array classes = %5d", num_type_array); } - // Update all the fingerprints in the shared methods. - tty->print("Calculating fingerprints ... "); - calculate_fingerprints(); + + // Ensure the ConstMethods won't be modified at run-time + tty->print("Updating ConstMethods ... "); + rewrite_nofast_bytecodes_and_calculate_fingerprints(); tty->print_cr("done. "); // Remove all references outside the metadata diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp index 85bf0e4a303..97094252ced 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +27,7 @@ #include "classfile/compactHashtable.hpp" #include "memory/allocation.hpp" #include "memory/memRegion.hpp" -#include "runtime/virtualspace.hpp" +#include "memory/virtualspace.hpp" #include "utilities/exceptions.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/memory/sharedHeap.cpp b/hotspot/src/share/vm/memory/sharedHeap.cpp deleted file mode 100644 index 34424a66c33..00000000000 --- a/hotspot/src/share/vm/memory/sharedHeap.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * 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 "classfile/stringTable.hpp" -#include "classfile/systemDictionary.hpp" -#include "code/codeCache.hpp" -#include "gc_interface/collectedHeap.inline.hpp" -#include "memory/sharedHeap.hpp" -#include "oops/oop.inline.hpp" -#include "runtime/atomic.inline.hpp" -#include "runtime/fprofiler.hpp" -#include "runtime/java.hpp" -#include "utilities/copy.hpp" -#include "utilities/workgroup.hpp" - -SharedHeap* SharedHeap::_sh; - -SharedHeap::SharedHeap() : - CollectedHeap(), - _workers(NULL) -{ - _sh = this; // ch is static, should be set only once. - if (UseConcMarkSweepGC || UseG1GC) { - _workers = new FlexibleWorkGang("GC Thread", ParallelGCThreads, - /* are_GC_task_threads */true, - /* are_ConcurrentGC_threads */false); - if (_workers == NULL) { - vm_exit_during_initialization("Failed necessary allocation."); - } else { - _workers->initialize_workers(); - } - } -} - -bool SharedHeap::heap_lock_held_for_gc() { - Thread* t = Thread::current(); - return Heap_lock->owned_by_self() - || ( (t->is_GC_task_thread() || t->is_VM_thread()) - && _thread_holds_heap_lock_for_gc); -} - -void SharedHeap::set_par_threads(uint t) { - assert(t == 0 || !UseSerialGC, "Cannot have parallel threads"); - _n_par_threads = t; -} - -SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate) - : MarkScope(activate), _sh(heap) -{ - if (_active) { - Threads::change_thread_claim_parity(); - // Zero the claimed high water mark in the StringTable - StringTable::clear_parallel_claimed_index(); - } -} - -SharedHeap::StrongRootsScope::~StrongRootsScope() { - Threads::assert_all_threads_claimed(); -} - -void SharedHeap::set_barrier_set(BarrierSet* bs) { - _barrier_set = bs; - // Cached barrier set for fast access in oops - oopDesc::set_bs(bs); -} - -void SharedHeap::post_initialize() { - CollectedHeap::post_initialize(); - ref_processing_init(); -} - -void SharedHeap::ref_processing_init() {} diff --git a/hotspot/src/share/vm/memory/sharedHeap.hpp b/hotspot/src/share/vm/memory/sharedHeap.hpp deleted file mode 100644 index e65ca85fcbf..00000000000 --- a/hotspot/src/share/vm/memory/sharedHeap.hpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * 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_SHAREDHEAP_HPP -#define SHARE_VM_MEMORY_SHAREDHEAP_HPP - -#include "gc_interface/collectedHeap.hpp" -#include "memory/generation.hpp" - -// A "SharedHeap" is an implementation of a java heap for HotSpot. This -// is an abstract class: there may be many different kinds of heaps. This -// class defines the functions that a heap must implement, and contains -// infrastructure common to all heaps. - -class Generation; -class BarrierSet; -class GenRemSet; -class Space; -class SpaceClosure; -class OopClosure; -class OopsInGenClosure; -class ObjectClosure; -class SubTasksDone; -class WorkGang; -class FlexibleWorkGang; -class CollectorPolicy; -class KlassClosure; - -// Note on use of FlexibleWorkGang's for GC. -// There are three places where task completion is determined. -// In -// 1) ParallelTaskTerminator::offer_termination() where _n_threads -// must be set to the correct value so that count of workers that -// have offered termination will exactly match the number -// working on the task. Tasks such as those derived from GCTask -// use ParallelTaskTerminator's. Tasks that want load balancing -// by work stealing use this method to gauge completion. -// 2) SubTasksDone has a variable _n_threads that is used in -// all_tasks_completed() to determine completion. all_tasks_complete() -// counts the number of tasks that have been done and then reset -// the SubTasksDone so that it can be used again. When the number of -// tasks is set to the number of GC workers, then _n_threads must -// be set to the number of active GC workers. G1RootProcessor and -// GenCollectedHeap have SubTasksDone. -// 3) SequentialSubTasksDone has an _n_threads that is used in -// a way similar to SubTasksDone and has the same dependency on the -// number of active GC workers. CompactibleFreeListSpace and Space -// have SequentialSubTasksDone's. -// -// Examples of using SubTasksDone and SequentialSubTasksDone: -// G1RootProcessor and GenCollectedHeap::process_roots() use -// SubTasksDone* _process_strong_tasks to claim tasks for workers -// -// GenCollectedHeap::gen_process_roots() calls -// rem_set()->younger_refs_iterate() -// to scan the card table and which eventually calls down into -// CardTableModRefBS::par_non_clean_card_iterate_work(). This method -// uses SequentialSubTasksDone* _pst to claim tasks. -// Both SubTasksDone and SequentialSubTasksDone call their method -// all_tasks_completed() to count the number of GC workers that have -// finished their work. That logic is "when all the workers are -// finished the tasks are finished". -// -// The pattern that appears in the code is to set _n_threads -// to a value > 1 before a task that you would like executed in parallel -// and then to set it to 0 after that task has completed. A value of -// 0 is a "special" value in set_n_threads() which translates to -// setting _n_threads to 1. -// -// Some code uses _n_termination to decide if work should be done in -// parallel. The notorious possibly_parallel_oops_do() in threads.cpp -// is an example of such code. Look for variable "is_par" for other -// examples. -// -// The active_workers is not reset to 0 after a parallel phase. It's -// value may be used in later phases and in one instance at least -// (the parallel remark) it has to be used (the parallel remark depends -// on the partitioning done in the previous parallel scavenge). - -class SharedHeap : public CollectedHeap { - friend class VMStructs; - - friend class VM_GC_Operation; - friend class VM_CGC_Operation; - -protected: - // There should be only a single instance of "SharedHeap" in a program. - // This is enforced with the protected constructor below, which will also - // set the static pointer "_sh" to that instance. - static SharedHeap* _sh; - - // If we're doing parallel GC, use this gang of threads. - FlexibleWorkGang* _workers; - - // Full initialization is done in a concrete subtype's "initialize" - // function. - SharedHeap(); - - // Returns true if the calling thread holds the heap lock, - // or the calling thread is a par gc thread and the heap_lock is held - // by the vm thread doing a gc operation. - bool heap_lock_held_for_gc(); - // True if the heap_lock is held by the a non-gc thread invoking a gc - // operation. - bool _thread_holds_heap_lock_for_gc; - -public: - static SharedHeap* heap() { return _sh; } - - void set_barrier_set(BarrierSet* bs); - - // Does operations required after initialization has been done. - virtual void post_initialize(); - - // Initialization of ("weak") reference processing support - virtual void ref_processing_init(); - - // Iteration functions. - void oop_iterate(ExtendedOopClosure* cl) = 0; - - // Iterate over all spaces in use in the heap, in an undefined order. - virtual void space_iterate(SpaceClosure* cl) = 0; - - // A SharedHeap will contain some number of spaces. This finds the - // space whose reserved area contains the given address, or else returns - // NULL. - virtual Space* space_containing(const void* addr) const = 0; - - bool no_gc_in_progress() { return !is_gc_active(); } - - // Note, the below comment needs to be updated to reflect the changes - // introduced by JDK-8076225. This should be done as part of JDK-8076289. - // - //Some collectors will perform "process_strong_roots" in parallel. - // Such a call will involve claiming some fine-grained tasks, such as - // scanning of threads. To make this process simpler, we provide the - // "strong_roots_parity()" method. Collectors that start parallel tasks - // whose threads invoke "process_strong_roots" must - // call "change_strong_roots_parity" in sequential code starting such a - // task. (This also means that a parallel thread may only call - // process_strong_roots once.) - // - // For calls to process_roots by sequential code, the parity is - // updated automatically. - // - // The idea is that objects representing fine-grained tasks, such as - // threads, will contain a "parity" field. A task will is claimed in the - // current "process_roots" call only if its parity field is the - // same as the "strong_roots_parity"; task claiming is accomplished by - // updating the parity field to the strong_roots_parity with a CAS. - // - // If the client meats this spec, then strong_roots_parity() will have - // the following properties: - // a) to return a different value than was returned before the last - // call to change_strong_roots_parity, and - // c) to never return a distinguished value (zero) with which such - // task-claiming variables may be initialized, to indicate "never - // claimed". - public: - - // Call these in sequential code around process_roots. - // strong_roots_prologue calls change_strong_roots_parity, if - // parallel tasks are enabled. - class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope { - SharedHeap* _sh; - - public: - StrongRootsScope(SharedHeap* heap, bool activate = true); - ~StrongRootsScope(); - }; - - private: - - public: - FlexibleWorkGang* workers() const { return _workers; } - - // The functions below are helper functions that a subclass of - // "SharedHeap" can use in the implementation of its virtual - // functions. - -public: - - // Do anything common to GC's. - virtual void gc_prologue(bool full) = 0; - virtual void gc_epilogue(bool full) = 0; - - // Sets the number of parallel threads that will be doing tasks - // (such as process roots) subsequently. - virtual void set_par_threads(uint t); -}; - -#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp index d0fdd3c615e..681c8e84201 100644 --- a/hotspot/src/share/vm/memory/space.cpp +++ b/hotspot/src/share/vm/memory/space.cpp @@ -31,6 +31,7 @@ #include "memory/blockOffsetTable.inline.hpp" #include "memory/defNewGeneration.hpp" #include "memory/genCollectedHeap.hpp" +#include "memory/genOopClosures.inline.hpp" #include "memory/space.hpp" #include "memory/space.inline.hpp" #include "memory/universe.inline.hpp" diff --git a/hotspot/src/share/vm/memory/strongRootsScope.cpp b/hotspot/src/share/vm/memory/strongRootsScope.cpp new file mode 100644 index 00000000000..9b28475d485 --- /dev/null +++ b/hotspot/src/share/vm/memory/strongRootsScope.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 "classfile/stringTable.hpp" +#include "code/nmethod.hpp" +#include "memory/strongRootsScope.hpp" +#include "runtime/thread.hpp" + +MarkScope::MarkScope(bool activate) : _active(activate) { + if (_active) { + nmethod::oops_do_marking_prologue(); + } +} + +MarkScope::~MarkScope() { + if (_active) { + nmethod::oops_do_marking_epilogue(); + } +} + +StrongRootsScope::StrongRootsScope(bool activate) : MarkScope(activate) { + if (_active) { + Threads::change_thread_claim_parity(); + // Zero the claimed high water mark in the StringTable + StringTable::clear_parallel_claimed_index(); + } +} + +StrongRootsScope::~StrongRootsScope() { + Threads::assert_all_threads_claimed(); +} diff --git a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp b/hotspot/src/share/vm/memory/strongRootsScope.hpp similarity index 56% rename from hotspot/src/share/vm/oops/oop.psgc.inline.hpp rename to hotspot/src/share/vm/memory/strongRootsScope.hpp index 63081244495..3f8c7138dbe 100644 --- a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp +++ b/hotspot/src/share/vm/memory/strongRootsScope.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * 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,24 +22,25 @@ * */ -#ifndef SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP -#define SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP +#ifndef SHARE_VM_MEMORY_STRONGROOTSSCOPE_HPP +#define SHARE_VM_MEMORY_STRONGROOTSSCOPE_HPP -#include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.hpp" -#endif // INCLUDE_ALL_GCS +#include "memory/allocation.hpp" -// ParallelScavengeHeap methods +class MarkScope : public StackObj { + protected: + bool _active; + public: + MarkScope(bool activate = true); + ~MarkScope(); +}; -inline void oopDesc::push_contents(PSPromotionManager* pm) { - Klass* k = klass(); - if (!k->oop_is_typeArray()) { - // It might contain oops beyond the header, so take the virtual call. - k->oop_push_contents(pm, this); - } - // Else skip it. The TypeArrayKlass in the header never needs scavenging. -} +// Sets up and tears down the required state for parallel root processing. -#endif // SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP +class StrongRootsScope : public MarkScope { + public: + StrongRootsScope(bool activate = true); + ~StrongRootsScope(); +}; + +#endif // SHARE_VM_MEMORY_STRONGROOTSSCOPE_HPP diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.cpp b/hotspot/src/share/vm/memory/tenuredGeneration.cpp index e300ee43eea..63026205c1a 100644 --- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp @@ -36,6 +36,9 @@ #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "utilities/macros.hpp" +#if INCLUDE_ALL_GCS +#include "gc_implementation/parNew/parOopClosures.hpp" +#endif TenuredGeneration::TenuredGeneration(ReservedSpace rs, size_t initial_byte_size, int level, diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 75f4f96e23a..1cd4d909b0a 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -687,6 +687,15 @@ jint universe_init() { return JNI_OK; } +template +jint Universe::create_heap() { + assert(_collectedHeap == NULL, "Heap already created"); + Policy* policy = new Policy(); + policy->initialize_all(); + _collectedHeap = new Heap(policy); + return _collectedHeap->initialize(); +} + // Choose the heap base address and oop encoding mode // when compressed oops are used: // Unscaled - Use 32-bits oops without encoding when @@ -696,50 +705,35 @@ jint universe_init() { // HeapBased - Use compressed oops with heap base + encoding. jint Universe::initialize_heap() { + jint status = JNI_ERR; +#if !INCLUDE_ALL_GCS if (UseParallelGC) { -#if INCLUDE_ALL_GCS - Universe::_collectedHeap = new ParallelScavengeHeap(); -#else // INCLUDE_ALL_GCS fatal("UseParallelGC not supported in this VM."); -#endif // INCLUDE_ALL_GCS - } else if (UseG1GC) { -#if INCLUDE_ALL_GCS - G1CollectorPolicyExt* g1p = new G1CollectorPolicyExt(); - g1p->initialize_all(); - G1CollectedHeap* g1h = new G1CollectedHeap(g1p); - Universe::_collectedHeap = g1h; -#else // INCLUDE_ALL_GCS - fatal("UseG1GC not supported in java kernel vm."); -#endif // INCLUDE_ALL_GCS - + fatal("UseG1GC not supported in this VM."); + } else if (UseConcMarkSweepGC) { + fatal("UseConcMarkSweepGC not supported in this VM."); +#else + if (UseParallelGC) { + status = Universe::create_heap(); + } else if (UseG1GC) { + status = Universe::create_heap(); + } else if (UseConcMarkSweepGC) { + status = Universe::create_heap(); +#endif + } else if (UseSerialGC) { + status = Universe::create_heap(); } else { - GenCollectorPolicy *gc_policy; - - if (UseSerialGC) { - gc_policy = new MarkSweepPolicy(); - } else if (UseConcMarkSweepGC) { -#if INCLUDE_ALL_GCS - gc_policy = new ConcurrentMarkSweepPolicy(); -#else // INCLUDE_ALL_GCS - fatal("UseConcMarkSweepGC not supported in this VM."); -#endif // INCLUDE_ALL_GCS - } else { // default old generation - gc_policy = new MarkSweepPolicy(); - } - gc_policy->initialize_all(); - - Universe::_collectedHeap = new GenCollectedHeap(gc_policy); + ShouldNotReachHere(); } - ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size()); - - jint status = Universe::heap()->initialize(); if (status != JNI_OK) { return status; } + ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size()); + #ifdef _LP64 if (UseCompressedOops) { // Subtract a page because something can get allocated at heap base. @@ -1063,7 +1057,7 @@ bool universe_post_init() { MemoryService::add_metaspace_memory_pools(); - MemoryService::set_universe_heap(Universe::_collectedHeap); + MemoryService::set_universe_heap(Universe::heap()); #if INCLUDE_CDS SharedClassUtil::initialize(CHECK_false); #endif diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 04074bbfcdc..460f934afe7 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -214,6 +214,7 @@ class Universe: AllStatic { static size_t _heap_capacity_at_last_gc; static size_t _heap_used_at_last_gc; + template static jint create_heap(); static jint initialize_heap(); static void initialize_basic_type_mirrors(TRAPS); static void fixup_mirrors(TRAPS); diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/memory/virtualspace.cpp similarity index 98% rename from hotspot/src/share/vm/runtime/virtualspace.cpp rename to hotspot/src/share/vm/memory/virtualspace.cpp index d8d09df2715..1169d19fa7c 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/memory/virtualspace.cpp @@ -23,9 +23,9 @@ */ #include "precompiled.hpp" +#include "memory/virtualspace.hpp" #include "oops/markOop.hpp" #include "oops/oop.inline.hpp" -#include "runtime/virtualspace.hpp" #include "services/memTracker.hpp" PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC @@ -37,13 +37,22 @@ ReservedSpace::ReservedSpace() : _base(NULL), _size(0), _noaccess_prefix(0), _alignment(0), _special(false), _executable(false) { } -ReservedSpace::ReservedSpace(size_t size) { +ReservedSpace::ReservedSpace(size_t size, size_t preferred_page_size) { + bool has_preferred_page_size = preferred_page_size != 0; // Want to use large pages where possible and pad with small pages. - size_t page_size = os::page_size_for_region_unaligned(size, 1); + size_t page_size = has_preferred_page_size ? preferred_page_size : os::page_size_for_region_unaligned(size, 1); bool large_pages = page_size != (size_t)os::vm_page_size(); - // Don't force the alignment to be large page aligned, - // since that will waste memory. - size_t alignment = os::vm_allocation_granularity(); + size_t alignment; + if (large_pages && has_preferred_page_size) { + alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity()); + // ReservedSpace initialization requires size to be aligned to the given + // alignment. Align the size up. + size = align_size_up(size, alignment); + } else { + // Don't force the alignment to be large page aligned, + // since that will waste memory. + alignment = os::vm_allocation_granularity(); + } initialize(size, alignment, large_pages, NULL, false); } diff --git a/hotspot/src/share/vm/runtime/virtualspace.hpp b/hotspot/src/share/vm/memory/virtualspace.hpp similarity index 95% rename from hotspot/src/share/vm/runtime/virtualspace.hpp rename to hotspot/src/share/vm/memory/virtualspace.hpp index 8c2b4ac6d10..84c5b7f9f89 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.hpp +++ b/hotspot/src/share/vm/memory/virtualspace.hpp @@ -51,7 +51,11 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC { public: // Constructor ReservedSpace(); - ReservedSpace(size_t size); + // Initialize the reserved space with the given size. If preferred_page_size + // is set, use this as minimum page size/alignment. This may waste some space + // if the given size is not aligned to that value, as the reservation will be + // aligned up to the final alignment in this case. + ReservedSpace(size_t size, size_t preferred_page_size = 0); ReservedSpace(size_t size, size_t alignment, bool large, char* requested_address = NULL); ReservedSpace(size_t size, size_t alignment, bool large, bool executable); diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp index f5b19fe7758..b5360571cdb 100644 --- a/hotspot/src/share/vm/oops/constMethod.hpp +++ b/hotspot/src/share/vm/oops/constMethod.hpp @@ -32,7 +32,6 @@ // processes in a read-only section with Class Data Sharing (CDS). It's important // that this class doesn't have virtual functions because the vptr cannot be shared // with CDS. -// (*)RewriteByteCodes and RewriteFrequentPairs is an exception but turned off in CDS // // Note that most applications load thousands of methods, so keeping the size of this // structure small has a big impact on footprint. diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 90416b468fc..04cb3d9d644 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -604,44 +604,6 @@ void ConstantPoolCache::initialize(const intArray& inverse_index_map, #if INCLUDE_JVMTI // RedefineClasses() API support: -// If any entry of this ConstantPoolCache points to any of -// old_methods, replace it with the corresponding new_method. -void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new_methods, - int methods_length, bool * trace_name_printed) { - - if (methods_length == 0) { - // nothing to do if there are no methods - return; - } - - // get shorthand for the interesting class - Klass* old_holder = old_methods[0]->method_holder(); - - for (int i = 0; i < length(); i++) { - if (entry_at(i)->get_interesting_method_entry(old_holder) == NULL) { - // skip uninteresting methods - continue; - } - - // The ConstantPoolCache contains entries for several different - // things, but we only care about methods. In fact, we only care - // about methods in the same class as the one that contains the - // old_methods. At this point, we have an interesting entry. - - for (int j = 0; j < methods_length; j++) { - Method* old_method = old_methods[j]; - Method* new_method = new_methods[j]; - - if (entry_at(i)->adjust_method_entry(old_method, new_method, - trace_name_printed)) { - // current old_method matched this entry and we updated it so - // break out and get to the next interesting entry if there one - break; - } - } - } -} - // If any entry of this ConstantPoolCache points to any of // old_methods, replace it with the corresponding new_method. void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) { diff --git a/hotspot/src/share/vm/oops/cpCache.hpp b/hotspot/src/share/vm/oops/cpCache.hpp index eeef44f653c..435a1d6c4a7 100644 --- a/hotspot/src/share/vm/oops/cpCache.hpp +++ b/hotspot/src/share/vm/oops/cpCache.hpp @@ -477,8 +477,6 @@ class ConstantPoolCache: public MetaspaceObj { // 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. - void adjust_method_entries(Method** old_methods, Method** new_methods, - int methods_length, bool* trace_name_printed); void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed); bool check_no_old_or_obsolete_entries(); void dump_cache(); diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp deleted file mode 100644 index cf2eec97ee9..00000000000 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * 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 "classfile/javaClasses.hpp" -#include "classfile/systemDictionary.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" -#include "gc_interface/collectedHeap.inline.hpp" -#include "memory/genOopClosures.inline.hpp" -#include "memory/iterator.inline.hpp" -#include "memory/oopFactory.hpp" -#include "memory/specialized_oop_closures.hpp" -#include "oops/instanceKlass.hpp" -#include "oops/instanceClassLoaderKlass.hpp" -#include "oops/instanceMirrorKlass.hpp" -#include "oops/instanceOop.hpp" -#include "oops/oop.inline.hpp" -#include "oops/symbol.hpp" -#include "runtime/handles.inline.hpp" -#include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/parNew/parOopClosures.inline.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" -#endif // INCLUDE_ALL_GCS - -// Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for -// all closures. Macros calling macros above for each oop size. -// Since ClassLoader objects have only a pointer to the loader_data, they are not -// compressed nor does the pointer move. - -#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)\ - \ -int InstanceClassLoaderKlass:: \ -oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ - \ - if_do_metadata_checked(closure, nv_suffix) { \ - ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); \ - /* cld can be null if we have a non-registered class loader. */ \ - if (cld != NULL) { \ - closure->do_class_loader_data(cld); \ - } \ - } \ - \ - return size; \ -} - -#if INCLUDE_ALL_GCS -#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceClassLoaderKlass:: \ -oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \ - return size; \ -} -#endif // INCLUDE_ALL_GCS - - -#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ - \ -int InstanceClassLoaderKlass:: \ -oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* closure, \ - MemRegion mr) { \ - int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr); \ - \ - if_do_metadata_checked(closure, nv_suffix) { \ - if (mr.contains(obj)) { \ - ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); \ - /* cld can be null if we have a non-registered class loader. */ \ - if (cld != NULL) { \ - closure->do_class_loader_data(cld); \ - } \ - } \ - } \ - \ - return size; \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN) -#if INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -#endif // INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m) - -void InstanceClassLoaderKlass::oop_follow_contents(oop obj) { - InstanceKlass::oop_follow_contents(obj); - ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); - - // We must NULL check here, since the class loader - // can be found before the loader data has been set up. - if(loader_data != NULL) { - MarkSweep::follow_class_loader(loader_data); - } -} - -#if INCLUDE_ALL_GCS -void InstanceClassLoaderKlass::oop_follow_contents(ParCompactionManager* cm, - oop obj) { - InstanceKlass::oop_follow_contents(cm, obj); - ClassLoaderData * const loader_data = java_lang_ClassLoader::loader_data(obj); - if (loader_data != NULL) { - PSParallelCompact::follow_class_loader(cm, loader_data); - } -} - -void InstanceClassLoaderKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - InstanceKlass::oop_push_contents(pm, obj); - - // This is called by the young collector. It will already have taken care of - // all class loader data. So, we don't have to follow the class loader -> - // class loader data link. -} - -int InstanceClassLoaderKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - InstanceKlass::oop_update_pointers(cm, obj); - return size_helper(); -} -#endif // INCLUDE_ALL_GCS - diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp index 2cec4827ddf..2585a901261 100644 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp @@ -48,34 +48,60 @@ public: InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } - // Iterators - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_v_m(obj, blk, mr); - } + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); +#if INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif -#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ + // Oop fields (and metadata) iterators + // [nv = true] Use non-virtual calls to do_oop_nv. + // [nv = false] Use virtual calls to do_oop. + // + // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.) + + private: + // Forward iteration + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate(oop obj, OopClosureType* closure); + +#if INCLUDE_ALL_GCS + // Reverse iteration + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); +#endif + + // Bounded range iteration + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + public: + +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, MemRegion mr); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_DECL) #if INCLUDE_ALL_GCS -#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) #endif // INCLUDE_ALL_GCS - // Garbage collection - void oop_follow_contents(oop obj); - - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS }; #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.inline.hpp new file mode 100644 index 00000000000..f54bde1ca2a --- /dev/null +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.inline.hpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP +#define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP + +#include "classfile/javaClasses.hpp" +#include "oops/instanceClassLoaderKlass.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +template +inline int InstanceClassLoaderKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { + int size = InstanceKlass::oop_oop_iterate(obj, closure); + + if (Devirtualizer::do_metadata(closure)) { + ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); + // cld can be null if we have a non-registered class loader. + if (cld != NULL) { + closure->do_class_loader_data(cld); + } + } + + return size; +} + +#if INCLUDE_ALL_GCS +template +inline int InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + int size = InstanceKlass::oop_oop_iterate_reverse(obj, closure); + + assert(!Devirtualizer::do_metadata(closure), + "Code to handle metadata is not implemented"); + + return size; +} +#endif // INCLUDE_ALL_GCS + + +template +inline int InstanceClassLoaderKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + int size = InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + + if (Devirtualizer::do_metadata(closure)) { + if (mr.contains(obj)) { + ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); + // cld can be null if we have a non-registered class loader. + if (cld != NULL) { + closure->do_class_loader_data(cld); + } + } + } + + return size; +} + + +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceClassLoaderKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate(obj, closure); \ +} + +#if INCLUDE_ALL_GCS +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceClassLoaderKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_reverse(obj, closure); \ +} +#else +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + + +#define InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ + \ +int InstanceClassLoaderKlass::oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_bounded(obj, closure, mr); \ +} + +#define ALL_INSTANCE_CLASS_LOADER_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + InstanceClassLoaderKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + InstanceClassLoaderKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + +#endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index f7ac70e3f45..4aa435bd4c5 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -28,12 +28,10 @@ #include "classfile/verifier.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/oopMapCache.hpp" #include "interpreter/rewriter.hpp" #include "jvmtifiles/jvmti.h" -#include "memory/genOopClosures.inline.hpp" #include "memory/heapInspection.hpp" #include "memory/iterator.inline.hpp" #include "memory/metadataFactory.hpp" @@ -41,7 +39,7 @@ #include "memory/specialized_oop_closures.hpp" #include "oops/fieldStreams.hpp" #include "oops/instanceClassLoaderKlass.hpp" -#include "oops/instanceKlass.hpp" +#include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/instanceOop.hpp" #include "oops/klass.inline.hpp" @@ -64,17 +62,6 @@ #include "services/threadService.hpp" #include "utilities/dtrace.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" -#include "gc_implementation/g1/g1OopClosures.inline.hpp" -#include "gc_implementation/g1/g1RemSet.inline.hpp" -#include "gc_implementation/g1/heapRegionManager.inline.hpp" -#include "gc_implementation/parNew/parOopClosures.inline.hpp" -#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" -#endif // INCLUDE_ALL_GCS #ifdef COMPILER1 #include "c1/c1_Compiler.hpp" #endif @@ -716,23 +703,6 @@ void InstanceKlass::link_methods(TRAPS) { // Set up method entry points for compiler and interpreter . m->link_method(m, CHECK); - - // This is for JVMTI and unrelated to relocator but the last thing we do -#ifdef ASSERT - if (StressMethodComparator) { - ResourceMark rm(THREAD); - static int nmc = 0; - for (int j = i; j >= 0 && j >= i-4; j--) { - if ((++nmc % 1000) == 0) tty->print_cr("Have run MethodComparator %d times...", nmc); - bool z = MethodComparator::methods_EMCP(m(), - methods()->at(j)); - if (j == i && !z) { - tty->print("MethodComparator FAIL: "); m->print(); m->print_codes(); - assert(z, "method must compare equal to itself"); - } - } - } -#endif //ASSERT } } @@ -2010,288 +1980,6 @@ bool InstanceKlass::is_dependent_nmethod(nmethod* nm) { } #endif //PRODUCT - -// Garbage collection - -#ifdef ASSERT -template void assert_is_in(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in(o), "should be in heap"); - } -} -template void assert_is_in_closed_subset(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in_closed_subset(o), - err_msg("should be in closed *p " INTPTR_FORMAT " " INTPTR_FORMAT, (address)p, (address)o)); - } -} -template void assert_is_in_reserved(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in_reserved(o), "should be in reserved"); - } -} -template void assert_nothing(T *p) {} - -#else -template void assert_is_in(T *p) {} -template void assert_is_in_closed_subset(T *p) {} -template void assert_is_in_reserved(T *p) {} -template void assert_nothing(T *p) {} -#endif // ASSERT - -// -// Macros that iterate over areas of oops which are specialized on type of -// oop pointer either narrow or wide, depending on UseCompressedOops -// -// Parameters are: -// T - type of oop to point to (either oop or narrowOop) -// start_p - starting pointer for region to iterate over -// count - number of oops or narrowOops to iterate over -// do_oop - action to perform on each oop (it's arbitrary C code which -// makes it more efficient to put in a macro rather than making -// it a template function) -// assert_fn - assert function which is template function because performance -// doesn't matter when enabled. -#define InstanceKlass_SPECIALIZED_OOP_ITERATE( \ - T, start_p, count, do_oop, \ - assert_fn) \ -{ \ - T* p = (T*)(start_p); \ - T* const end = p + (count); \ - while (p < end) { \ - (assert_fn)(p); \ - do_oop; \ - ++p; \ - } \ -} - -#define InstanceKlass_SPECIALIZED_OOP_REVERSE_ITERATE( \ - T, start_p, count, do_oop, \ - assert_fn) \ -{ \ - T* const start = (T*)(start_p); \ - T* p = start + (count); \ - while (start < p) { \ - --p; \ - (assert_fn)(p); \ - do_oop; \ - } \ -} - -#define InstanceKlass_SPECIALIZED_BOUNDED_OOP_ITERATE( \ - T, start_p, count, low, high, \ - do_oop, assert_fn) \ -{ \ - T* const l = (T*)(low); \ - T* const h = (T*)(high); \ - assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && \ - mask_bits((intptr_t)h, sizeof(T)-1) == 0, \ - "bounded region must be properly aligned"); \ - T* p = (T*)(start_p); \ - T* end = p + (count); \ - if (p < l) p = l; \ - if (end > h) end = h; \ - while (p < end) { \ - (assert_fn)(p); \ - do_oop; \ - ++p; \ - } \ -} - - -// The following macros call specialized macros, passing either oop or -// narrowOop as the specialization type. These test the UseCompressedOops -// flag. -#define InstanceKlass_OOP_MAP_ITERATE(obj, do_oop, assert_fn) \ -{ \ - /* Compute oopmap block range. The common case \ - is nonstatic_oop_map_size == 1. */ \ - OopMapBlock* map = start_of_nonstatic_oop_maps(); \ - OopMapBlock* const end_map = map + nonstatic_oop_map_count(); \ - if (UseCompressedOops) { \ - while (map < end_map) { \ - InstanceKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - do_oop, assert_fn) \ - ++map; \ - } \ - } else { \ - while (map < end_map) { \ - InstanceKlass_SPECIALIZED_OOP_ITERATE(oop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - do_oop, assert_fn) \ - ++map; \ - } \ - } \ -} - -#define InstanceKlass_OOP_MAP_REVERSE_ITERATE(obj, do_oop, assert_fn) \ -{ \ - OopMapBlock* const start_map = start_of_nonstatic_oop_maps(); \ - OopMapBlock* map = start_map + nonstatic_oop_map_count(); \ - if (UseCompressedOops) { \ - while (start_map < map) { \ - --map; \ - InstanceKlass_SPECIALIZED_OOP_REVERSE_ITERATE(narrowOop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - do_oop, assert_fn) \ - } \ - } else { \ - while (start_map < map) { \ - --map; \ - InstanceKlass_SPECIALIZED_OOP_REVERSE_ITERATE(oop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - do_oop, assert_fn) \ - } \ - } \ -} - -#define InstanceKlass_BOUNDED_OOP_MAP_ITERATE(obj, low, high, do_oop, \ - assert_fn) \ -{ \ - /* Compute oopmap block range. The common case is \ - nonstatic_oop_map_size == 1, so we accept the \ - usually non-existent extra overhead of examining \ - all the maps. */ \ - OopMapBlock* map = start_of_nonstatic_oop_maps(); \ - OopMapBlock* const end_map = map + nonstatic_oop_map_count(); \ - if (UseCompressedOops) { \ - while (map < end_map) { \ - InstanceKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - low, high, \ - do_oop, assert_fn) \ - ++map; \ - } \ - } else { \ - while (map < end_map) { \ - InstanceKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ - obj->obj_field_addr(map->offset()), map->count(), \ - low, high, \ - do_oop, assert_fn) \ - ++map; \ - } \ - } \ -} - -void InstanceKlass::oop_follow_contents(oop obj) { - assert(obj != NULL, "can't follow the content of NULL object"); - MarkSweep::follow_klass(obj->klass()); - InstanceKlass_OOP_MAP_ITERATE( \ - obj, \ - MarkSweep::mark_and_push(p), \ - assert_is_in_closed_subset) -} - -#if INCLUDE_ALL_GCS -void InstanceKlass::oop_follow_contents(ParCompactionManager* cm, - oop obj) { - assert(obj != NULL, "can't follow the content of NULL object"); - PSParallelCompact::follow_klass(cm, obj->klass()); - // Only mark the header and let the scan of the meta-data mark - // everything else. - InstanceKlass_OOP_MAP_ITERATE( \ - obj, \ - PSParallelCompact::mark_and_push(cm, p), \ - assert_is_in) -} -#endif // INCLUDE_ALL_GCS - -// closure's do_metadata() method dictates whether the given closure should be -// applied to the klass ptr in the object header. - -#define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ - /* header */ \ - if_do_metadata_checked(closure, nv_suffix) { \ - closure->do_klass##nv_suffix(obj->klass()); \ - } \ - InstanceKlass_OOP_MAP_ITERATE( \ - obj, \ - (closure)->do_oop##nv_suffix(p), \ - assert_is_in_closed_subset) \ - return size_helper(); \ -} - -#if INCLUDE_ALL_GCS -#define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, \ - OopClosureType* closure) { \ - assert_should_ignore_metadata(closure, nv_suffix); \ - \ - /* instance variables */ \ - InstanceKlass_OOP_MAP_REVERSE_ITERATE( \ - obj, \ - (closure)->do_oop##nv_suffix(p), \ - assert_is_in_closed_subset) \ - return size_helper(); \ -} -#endif // INCLUDE_ALL_GCS - -#define InstanceKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ - \ -int InstanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* closure, \ - MemRegion mr) { \ - if_do_metadata_checked(closure, nv_suffix) { \ - if (mr.contains(obj)) { \ - closure->do_klass##nv_suffix(obj->klass()); \ - } \ - } \ - InstanceKlass_BOUNDED_OOP_MAP_ITERATE( \ - obj, mr.start(), mr.end(), \ - (closure)->do_oop##nv_suffix(p), \ - assert_is_in_closed_subset) \ - return size_helper(); \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DEFN_m) -#if INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -#endif // INCLUDE_ALL_GCS - -int InstanceKlass::oop_adjust_pointers(oop obj) { - int size = size_helper(); - InstanceKlass_OOP_MAP_ITERATE( \ - obj, \ - MarkSweep::adjust_pointer(p), \ - assert_is_in) - return size; -} - -#if INCLUDE_ALL_GCS -void InstanceKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - InstanceKlass_OOP_MAP_REVERSE_ITERATE( \ - obj, \ - if (PSScavenge::should_scavenge(p)) { \ - pm->claim_or_forward_depth(p); \ - }, \ - assert_nothing ) -} - -int InstanceKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - int size = size_helper(); - InstanceKlass_OOP_MAP_ITERATE( \ - obj, \ - PSParallelCompact::adjust_pointer(p), \ - assert_is_in) - return size; -} - -#endif // INCLUDE_ALL_GCS - void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) { assert(class_loader_data()->is_alive(is_alive), "this klass should be live"); if (is_interface()) { @@ -2712,6 +2400,57 @@ bool InstanceKlass::is_same_package_member_impl(instanceKlassHandle class1, return false; } +bool InstanceKlass::find_inner_classes_attr(instanceKlassHandle k, int* ooff, int* noff, TRAPS) { + constantPoolHandle i_cp(THREAD, k->constants()); + for (InnerClassesIterator iter(k); !iter.done(); iter.next()) { + int ioff = iter.inner_class_info_index(); + if (ioff != 0) { + // Check to see if the name matches the class we're looking for + // before attempting to find the class. + if (i_cp->klass_name_at_matches(k, ioff)) { + Klass* inner_klass = i_cp->klass_at(ioff, CHECK_false); + if (k() == inner_klass) { + *ooff = iter.outer_class_info_index(); + *noff = iter.inner_name_index(); + return true; + } + } + } + } + return false; +} + +Klass* InstanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, bool* inner_is_member, TRAPS) { + instanceKlassHandle outer_klass; + *inner_is_member = false; + int ooff = 0, noff = 0; + if (find_inner_classes_attr(k, &ooff, &noff, THREAD)) { + constantPoolHandle i_cp(THREAD, k->constants()); + if (ooff != 0) { + Klass* ok = i_cp->klass_at(ooff, CHECK_NULL); + outer_klass = instanceKlassHandle(THREAD, ok); + *inner_is_member = true; + } + if (outer_klass.is_null()) { + // It may be anonymous; try for that. + int encl_method_class_idx = k->enclosing_method_class_index(); + if (encl_method_class_idx != 0) { + Klass* ok = i_cp->klass_at(encl_method_class_idx, CHECK_NULL); + outer_klass = instanceKlassHandle(THREAD, ok); + *inner_is_member = false; + } + } + } + + // If no inner class attribute found for this class. + if (outer_klass.is_null()) return NULL; + + // Throws an exception if outer klass has not declared k as an inner klass + // We need evidence that each klass knows about the other, or else + // the system could allow a spoof of an inner class to gain access rights. + Reflection::check_for_inner_class(outer_klass, k, *inner_is_member, CHECK_NULL); + return outer_klass(); +} jint InstanceKlass::compute_modifier_flags(TRAPS) const { jint access = access_flags().as_int(); @@ -3718,6 +3457,37 @@ Method* InstanceKlass::method_with_idnum(int idnum) { return m; } + +Method* InstanceKlass::method_with_orig_idnum(int idnum) { + if (idnum >= methods()->length()) { + return NULL; + } + Method* m = methods()->at(idnum); + if (m != NULL && m->orig_method_idnum() == idnum) { + return m; + } + // Obsolete method idnum does not match the original idnum + for (int index = 0; index < methods()->length(); ++index) { + m = methods()->at(index); + if (m->orig_method_idnum() == idnum) { + return m; + } + } + // None found, return null for the caller to handle. + return NULL; +} + + +Method* InstanceKlass::method_with_orig_idnum(int idnum, int version) { + InstanceKlass* holder = get_klass_version(version); + if (holder == NULL) { + return NULL; // The version of klass is gone, no method is found + } + Method* method = holder->method_with_orig_idnum(idnum); + return method; +} + + jint InstanceKlass::get_cached_class_file_len() { return VM_RedefineClasses::get_cached_class_file_len(_cached_class_file); } diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 6e216f9874f..4219a800aa0 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -330,6 +330,8 @@ class InstanceKlass: public Klass { Array* methods() const { return _methods; } void set_methods(Array* a) { _methods = a; } Method* method_with_idnum(int idnum); + Method* method_with_orig_idnum(int idnum); + Method* method_with_orig_idnum(int idnum, int version); // method ordering Array* method_ordering() const { return _method_ordering; } @@ -404,13 +406,17 @@ class InstanceKlass: public Klass { bool is_same_class_package(oop classloader2, Symbol* classname2); static bool is_same_class_package(oop class_loader1, Symbol* class_name1, oop class_loader2, Symbol* class_name2); - // find an enclosing class (defined where original code was, in jvm.cpp!) + // find an enclosing class Klass* compute_enclosing_class(bool* inner_is_member, TRAPS) { instanceKlassHandle self(THREAD, this); return compute_enclosing_class_impl(self, inner_is_member, THREAD); } static Klass* compute_enclosing_class_impl(instanceKlassHandle self, - bool* inner_is_member, TRAPS); + bool* inner_is_member, TRAPS); + + // Find InnerClasses attribute for k and return outer_class_info_index & inner_name_index. + static bool find_inner_classes_attr(instanceKlassHandle k, + int* ooff, int* noff, TRAPS); // tell if two classes have the same enclosing class (at package level) bool is_same_package_member(Klass* class2, TRAPS) { @@ -621,6 +627,15 @@ class InstanceKlass: public Klass { InstanceKlass* previous_versions() const { return _previous_versions; } + InstanceKlass* get_klass_version(int version) { + for (InstanceKlass* ik = this; ik != NULL; ik = ik->previous_versions()) { + if (ik->constants()->version() == version) { + return ik; + } + } + return NULL; + } + bool has_been_redefined() const { return (_misc_flags & _misc_has_been_redefined) != 0; } @@ -954,10 +969,6 @@ class InstanceKlass: public Klass { void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed); #endif // INCLUDE_JVMTI - // Garbage collection - void oop_follow_contents(oop obj); - int oop_adjust_pointers(oop obj); - void clean_implementors_list(BoolObjectClosure* is_alive); void clean_method_data(BoolObjectClosure* is_alive); void clean_dependent_nmethods(); @@ -981,32 +992,108 @@ class InstanceKlass: public Klass { static void notify_unload_class(InstanceKlass* ik); static void release_C_heap_structures(InstanceKlass* ik); - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS - // Naming const char* signature_name() const; - // Iterators - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); +#if INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_v_m(obj, blk, mr); - } + // Oop fields (and metadata) iterators + // [nv = true] Use non-virtual calls to do_oop_nv. + // [nv = false] Use virtual calls to do_oop. + // + // The InstanceKlass iterators also visits the Object's klass. -#define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ - int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \ - MemRegion mr); + // Forward iteration + public: + // Iterate over all oop fields in the oop maps. + template + inline void oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure); + + protected: + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate(oop obj, OopClosureType* closure); + + private: + // Iterate over all oop fields in the oop maps. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure); + + // Iterate over all oop fields in one oop map. + template + inline void oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure); + + + // Reverse iteration +#if INCLUDE_ALL_GCS + public: + // Iterate over all oop fields in the oop maps. + template + inline void oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure); + + protected: + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); + + private: + // Iterate over all oop fields in the oop maps. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure); + + // Iterate over all oop fields in one oop map. + template + inline void oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure); +#endif + + + // Bounded range iteration + public: + // Iterate over all oop fields in the oop maps. + template + inline void oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + protected: + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + private: + // Iterate over all oop fields in the oop maps. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Iterate over all oop fields in one oop map. + template + inline void oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr); + + + public: + +#define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \ + int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DECL) #if INCLUDE_ALL_GCS -#define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); +#define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) diff --git a/hotspot/src/share/vm/oops/instanceKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceKlass.inline.hpp new file mode 100644 index 00000000000..5142c6d2e05 --- /dev/null +++ b/hotspot/src/share/vm/oops/instanceKlass.inline.hpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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_OOPS_INSTANCEKLASS_INLINE_HPP +#define SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP + +#include "memory/iterator.hpp" +#include "oops/instanceKlass.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +// The iteration over the oops in objects is a hot path in the GC code. +// By force inlining the following functions, we get similar GC performance +// as the previous macro based implementation. +#ifdef TARGET_COMPILER_visCPP +#define INLINE __forceinline +#else +#define INLINE inline +#endif + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure) { + T* p = (T*)obj->obj_field_addr(map->offset()); + T* const end = p + map->count(); + + for (; p < end; ++p) { + Devirtualizer::do_oop(closure, p); + } +} + +#if INCLUDE_ALL_GCS +template +INLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) { + T* const start = (T*)obj->obj_field_addr(map->offset()); + T* p = start + map->count(); + + while (start < p) { + --p; + Devirtualizer::do_oop(closure, p); + } +} +#endif + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr) { + T* p = (T*)obj->obj_field_addr(map->offset()); + T* end = p + map->count(); + + T* const l = (T*)mr.start(); + T* const h = (T*)mr.end(); + assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && + mask_bits((intptr_t)h, sizeof(T)-1) == 0, + "bounded region must be properly aligned"); + + if (p < l) { + p = l; + } + if (end > h) { + end = h; + } + + for (;p < end; ++p) { + Devirtualizer::do_oop(closure, p); + } +} + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure) { + OopMapBlock* map = start_of_nonstatic_oop_maps(); + OopMapBlock* const end_map = map + nonstatic_oop_map_count(); + + for (; map < end_map; ++map) { + oop_oop_iterate_oop_map(map, obj, closure); + } +} + +#if INCLUDE_ALL_GCS +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure) { + OopMapBlock* const start_map = start_of_nonstatic_oop_maps(); + OopMapBlock* map = start_map + nonstatic_oop_map_count(); + + while (start_map < map) { + --map; + oop_oop_iterate_oop_map_reverse(map, obj, closure); + } +} +#endif + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + OopMapBlock* map = start_of_nonstatic_oop_maps(); + OopMapBlock* const end_map = map + nonstatic_oop_map_count(); + + for (;map < end_map; ++map) { + oop_oop_iterate_oop_map_bounded(map, obj, closure, mr); + } +} + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure) { + if (UseCompressedOops) { + oop_oop_iterate_oop_maps_specialized(obj, closure); + } else { + oop_oop_iterate_oop_maps_specialized(obj, closure); + } +} + +#if INCLUDE_ALL_GCS +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) { + if (UseCompressedOops) { + oop_oop_iterate_oop_maps_specialized_reverse(obj, closure); + } else { + oop_oop_iterate_oop_maps_specialized_reverse(obj, closure); + } +} +#endif + +template +INLINE void InstanceKlass::oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + if (UseCompressedOops) { + oop_oop_iterate_oop_maps_specialized_bounded(obj, closure, mr); + } else { + oop_oop_iterate_oop_maps_specialized_bounded(obj, closure, mr); + } +} + +template +INLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, this); + } + + oop_oop_iterate_oop_maps(obj, closure); + + return size_helper(); +} + +#if INCLUDE_ALL_GCS +template +INLINE int InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + assert(!Devirtualizer::do_metadata(closure), + "Code to handle metadata is not implemented"); + + oop_oop_iterate_oop_maps_reverse(obj, closure); + + return size_helper(); +} +#endif + +template +INLINE int InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + if (Devirtualizer::do_metadata(closure)) { + if (mr.contains(obj)) { + Devirtualizer::do_klass(closure, this); + } + } + + oop_oop_iterate_oop_maps_bounded(obj, closure, mr); + + return size_helper(); +} + +#undef INLINE + + +#define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ +int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate(obj, closure); \ +} + +#if INCLUDE_ALL_GCS +#define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ +int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_reverse(obj, closure); \ +} +#else +#define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + +#define InstanceKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ +int InstanceKlass::oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_bounded(obj, closure, mr); \ +} + +#define ALL_INSTANCE_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + InstanceKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + InstanceKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + +#endif // SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp index 191f1b85383..7ace33c8ba3 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.cpp @@ -25,9 +25,7 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" -#include "memory/genOopClosures.inline.hpp" #include "memory/iterator.inline.hpp" #include "memory/oopFactory.hpp" #include "memory/specialized_oop_closures.hpp" @@ -38,313 +36,9 @@ #include "oops/symbol.hpp" #include "runtime/handles.inline.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" -#include "gc_implementation/g1/g1OopClosures.inline.hpp" -#include "gc_implementation/g1/g1RemSet.inline.hpp" -#include "gc_implementation/g1/heapRegionManager.inline.hpp" -#include "gc_implementation/parNew/parOopClosures.inline.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" -#endif // INCLUDE_ALL_GCS int InstanceMirrorKlass::_offset_of_static_fields = 0; -#ifdef ASSERT -template void assert_is_in(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in(o), "should be in heap"); - } -} -template void assert_is_in_closed_subset(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in_closed_subset(o), "should be in closed"); - } -} -template void assert_is_in_reserved(T *p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop o = oopDesc::decode_heap_oop_not_null(heap_oop); - assert(Universe::heap()->is_in_reserved(o), "should be in reserved"); - } -} -template void assert_nothing(T *p) {} - -#else -template void assert_is_in(T *p) {} -template void assert_is_in_closed_subset(T *p) {} -template void assert_is_in_reserved(T *p) {} -template void assert_nothing(T *p) {} -#endif // ASSERT - -#define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE( \ - T, start_p, count, do_oop, \ - assert_fn) \ -{ \ - T* p = (T*)(start_p); \ - T* const end = p + (count); \ - while (p < end) { \ - (assert_fn)(p); \ - do_oop; \ - ++p; \ - } \ -} - -#define InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE( \ - T, start_p, count, low, high, \ - do_oop, assert_fn) \ -{ \ - T* const l = (T*)(low); \ - T* const h = (T*)(high); \ - assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && \ - mask_bits((intptr_t)h, sizeof(T)-1) == 0, \ - "bounded region must be properly aligned"); \ - T* p = (T*)(start_p); \ - T* end = p + (count); \ - if (p < l) p = l; \ - if (end > h) end = h; \ - while (p < end) { \ - (assert_fn)(p); \ - do_oop; \ - ++p; \ - } \ -} - - -#define InstanceMirrorKlass_OOP_ITERATE(start_p, count, \ - do_oop, assert_fn) \ -{ \ - if (UseCompressedOops) { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ - start_p, count, \ - do_oop, assert_fn) \ - } else { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(oop, \ - start_p, count, \ - do_oop, assert_fn) \ - } \ -} - -// The following macros call specialized macros, passing either oop or -// narrowOop as the specialization type. These test the UseCompressedOops -// flag. -#define InstanceMirrorKlass_BOUNDED_OOP_ITERATE(start_p, count, low, high, \ - do_oop, assert_fn) \ -{ \ - if (UseCompressedOops) { \ - InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ - start_p, count, \ - low, high, \ - do_oop, assert_fn) \ - } else { \ - InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ - start_p, count, \ - low, high, \ - do_oop, assert_fn) \ - } \ -} - - -void InstanceMirrorKlass::oop_follow_contents(oop obj) { - InstanceKlass::oop_follow_contents(obj); - - // Follow the klass field in the mirror. - Klass* klass = java_lang_Class::as_Klass(obj); - if (klass != NULL) { - // An anonymous class doesn't have its own class loader, so the call - // to follow_klass will mark and push its java mirror instead of the - // class loader. When handling the java mirror for an anonymous class - // we need to make sure its class loader data is claimed, this is done - // by calling follow_class_loader explicitly. For non-anonymous classes - // the call to follow_class_loader is made when the class loader itself - // is handled. - if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { - MarkSweep::follow_class_loader(klass->class_loader_data()); - } else { - MarkSweep::follow_klass(klass); - } - } else { - // If klass is NULL then this a mirror for a primitive type. - // We don't have to follow them, since they are handled as strong - // roots in Universe::oops_do. - assert(java_lang_Class::is_primitive(obj), "Sanity check"); - } - - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ - MarkSweep::mark_and_push(p), \ - assert_is_in_closed_subset) -} - -#if INCLUDE_ALL_GCS -void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, - oop obj) { - InstanceKlass::oop_follow_contents(cm, obj); - - // Follow the klass field in the mirror. - Klass* klass = java_lang_Class::as_Klass(obj); - if (klass != NULL) { - // An anonymous class doesn't have its own class loader, so the call - // to follow_klass will mark and push its java mirror instead of the - // class loader. When handling the java mirror for an anonymous class - // we need to make sure its class loader data is claimed, this is done - // by calling follow_class_loader explicitly. For non-anonymous classes - // the call to follow_class_loader is made when the class loader itself - // is handled. - if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { - PSParallelCompact::follow_class_loader(cm, klass->class_loader_data()); - } else { - PSParallelCompact::follow_klass(cm, klass); - } - } else { - // If klass is NULL then this a mirror for a primitive type. - // We don't have to follow them, since they are handled as strong - // roots in Universe::oops_do. - assert(java_lang_Class::is_primitive(obj), "Sanity check"); - } - - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ - PSParallelCompact::mark_and_push(cm, p), \ - assert_is_in) -} -#endif // INCLUDE_ALL_GCS - -int InstanceMirrorKlass::oop_adjust_pointers(oop obj) { - int size = oop_size(obj); - InstanceKlass::oop_adjust_pointers(obj); - - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ - MarkSweep::adjust_pointer(p), \ - assert_nothing) - return size; -} - -#define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(T, nv_suffix) \ - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ - (closure)->do_oop##nv_suffix(p), \ - assert_is_in_closed_subset) \ - return oop_size(obj); \ - -#define InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(T, nv_suffix, mr) \ - InstanceMirrorKlass_BOUNDED_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ - mr.start(), mr.end(), \ - (closure)->do_oop##nv_suffix(p), \ - assert_is_in_closed_subset) \ - return oop_size(obj); \ - - -// Macro to define InstanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for -// all closures. Macros calling macros above for each oop size. - -#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceMirrorKlass:: \ -oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ - \ - if_do_metadata_checked(closure, nv_suffix) { \ - Klass* klass = java_lang_Class::as_Klass(obj); \ - /* We'll get NULL for primitive mirrors. */ \ - if (klass != NULL) { \ - closure->do_klass##nv_suffix(klass); \ - } \ - } \ - \ - if (UseCompressedOops) { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ - } else { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ - } \ -} - -#if INCLUDE_ALL_GCS -#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceMirrorKlass:: \ -oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \ - \ - if (UseCompressedOops) { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ - } else { \ - InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ - } \ -} -#endif // INCLUDE_ALL_GCS - - -#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ - \ -int InstanceMirrorKlass:: \ -oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* closure, \ - MemRegion mr) { \ - InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr); \ - \ - if_do_metadata_checked(closure, nv_suffix) { \ - if (mr.contains(obj)) { \ - Klass* klass = java_lang_Class::as_Klass(obj); \ - /* We'll get NULL for primitive mirrors. */ \ - if (klass != NULL) { \ - closure->do_klass##nv_suffix(klass); \ - } \ - } \ - } \ - \ - if (UseCompressedOops) { \ - InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, mr); \ - } else { \ - InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(oop, nv_suffix, mr); \ - } \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) -#if INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -#endif // INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) - -#if INCLUDE_ALL_GCS -void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - // Note that we don't have to follow the mirror -> klass pointer, since all - // klasses that are dirty will be scavenged when we iterate over the - // ClassLoaderData objects. - - InstanceKlass::oop_push_contents(pm, obj); - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ - if (PSScavenge::should_scavenge(p)) { \ - pm->claim_or_forward_depth(p); \ - }, \ - assert_nothing ) -} - -int InstanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - int size = oop_size(obj); - InstanceKlass::oop_update_pointers(cm, obj); - - InstanceMirrorKlass_OOP_ITERATE( \ - start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ - PSParallelCompact::adjust_pointer(p), \ - assert_nothing) - return size; -} -#endif // INCLUDE_ALL_GCS - int InstanceMirrorKlass::instance_size(KlassHandle k) { if (k() != NULL && k->oop_is_instance()) { return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size()); diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp index 368b41de9b4..888814f0b40 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp @@ -88,19 +88,66 @@ class InstanceMirrorKlass: public InstanceKlass { // allocation instanceOop allocate_instance(KlassHandle k, TRAPS); - // Garbage collection - int oop_adjust_pointers(oop obj); - void oop_follow_contents(oop obj); + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); +#if INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS + // Oop fields (and metadata) iterators + // [nv = true] Use non-virtual calls to do_oop_nv. + // [nv = false] Use virtual calls to do_oop. + // + // The InstanceMirrorKlass iterators also visit the hidden Klass pointer. - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_v_m(obj, blk, mr); - } + public: + // Iterate over the static fields. + template + inline void oop_oop_iterate_statics(oop obj, OopClosureType* closure); + + private: + // Iterate over the static fields. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_statics_specialized(oop obj, OopClosureType* closure); + + // Forward iteration + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate(oop obj, OopClosureType* closure); + + + // Reverse iteration +#if INCLUDE_ALL_GCS + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); +#endif + + + // Bounded range iteration + // Iterate over the oop fields and metadata. + template + inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Iterate over the static fields. + template + inline void oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Iterate over the static fields. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_statics_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + + public: #define InstanceMirrorKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.inline.hpp new file mode 100644 index 00000000000..c4c2d6c0a70 --- /dev/null +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.inline.hpp @@ -0,0 +1,164 @@ +/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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_OOPS_INSTANCEMIRRORKLASS_INLINE_HPP +#define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_INLINE_HPP + +#include "classfile/javaClasses.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/instanceMirrorKlass.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +template +void InstanceMirrorKlass::oop_oop_iterate_statics_specialized(oop obj, OopClosureType* closure) { + T* p = (T*)start_of_static_fields(obj); + T* const end = p + java_lang_Class::static_oop_field_count(obj); + + for (; p < end; ++p) { + Devirtualizer::do_oop(closure, p); + } +} + +template +void InstanceMirrorKlass::oop_oop_iterate_statics(oop obj, OopClosureType* closure) { + if (UseCompressedOops) { + oop_oop_iterate_statics_specialized(obj, closure); + } else { + oop_oop_iterate_statics_specialized(obj, closure); + } +} + +template +int InstanceMirrorKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { + InstanceKlass::oop_oop_iterate(obj, closure); + + if (Devirtualizer::do_metadata(closure)) { + Klass* klass = java_lang_Class::as_Klass(obj); + // We'll get NULL for primitive mirrors. + if (klass != NULL) { + Devirtualizer::do_klass(closure, klass); + } + } + + oop_oop_iterate_statics(obj, closure); + + return oop_size(obj); +} + +#if INCLUDE_ALL_GCS +template +int InstanceMirrorKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + InstanceKlass::oop_oop_iterate_reverse(obj, closure); + + InstanceMirrorKlass::oop_oop_iterate_statics(obj, closure); + + return oop_size(obj); +} +#endif + +template +void InstanceMirrorKlass::oop_oop_iterate_statics_specialized_bounded(oop obj, + OopClosureType* closure, + MemRegion mr) { + T* p = (T*)start_of_static_fields(obj); + T* end = p + java_lang_Class::static_oop_field_count(obj); + + T* const l = (T*)mr.start(); + T* const h = (T*)mr.end(); + assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && + mask_bits((intptr_t)h, sizeof(T)-1) == 0, + "bounded region must be properly aligned"); + + if (p < l) { + p = l; + } + if (end > h) { + end = h; + } + + for (;p < end; ++p) { + Devirtualizer::do_oop(closure, p); + } +} + +template +void InstanceMirrorKlass::oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + if (UseCompressedOops) { + oop_oop_iterate_statics_specialized_bounded(obj, closure, mr); + } else { + oop_oop_iterate_statics_specialized_bounded(obj, closure, mr); + } +} + +template +int InstanceMirrorKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + + if (Devirtualizer::do_metadata(closure)) { + if (mr.contains(obj)) { + Klass* klass = java_lang_Class::as_Klass(obj); + // We'll get NULL for primitive mirrors. + if (klass != NULL) { + Devirtualizer::do_klass(closure, klass); + } + } + } + + oop_oop_iterate_statics_bounded(obj, closure, mr); + + return oop_size(obj); +} + + +#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceMirrorKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate(obj, closure); \ +} + +#if INCLUDE_ALL_GCS +#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceMirrorKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_reverse(obj, closure); \ +} +#else +#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + + +#define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ + \ +int InstanceMirrorKlass::oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_bounded(obj, closure, mr); \ +} + +#define ALL_INSTANCE_MIRROR_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + +#endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp index bf3cfa3dc8a..bf932f83305 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp @@ -25,421 +25,16 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" -#include "gc_interface/collectedHeap.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "memory/genCollectedHeap.hpp" -#include "memory/genOopClosures.inline.hpp" #include "memory/specialized_oop_closures.hpp" -#include "oops/instanceRefKlass.hpp" +#include "oops/instanceRefKlass.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/preserveException.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" -#include "gc_implementation/g1/g1OopClosures.inline.hpp" -#include "gc_implementation/g1/g1RemSet.inline.hpp" -#include "gc_implementation/g1/heapRegionManager.inline.hpp" -#include "gc_implementation/parNew/parOopClosures.inline.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" -#endif // INCLUDE_ALL_GCS PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -template -void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(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, (void *)obj); - } - ) - if (!oopDesc::is_null(heap_oop)) { - oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); - if (!referent->is_gc_marked() && - MarkSweep::ref_processor()->discover_reference(obj, ref->reference_type())) { - // reference was discovered, referent will be traversed later - ref->InstanceKlass::oop_follow_contents(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj); - } - ) - return; - } else { - // treat referent as normal oop - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj); - } - ) - MarkSweep::mark_and_push(referent_addr); - } - } - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - if (ReferenceProcessor::pending_list_uses_discovered_field()) { - // Treat discovered as normal oop, if ref is not "active", - // i.e. if next is non-NULL. - T next_oop = oopDesc::load_heap_oop(next_addr); - if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - INTPTR_FORMAT, discovered_addr); - } - ) - MarkSweep::mark_and_push(discovered_addr); - } - } else { -#ifdef ASSERT - // In the case of older JDKs which do not use the discovered - // field for the pending list, an inactive ref (next != NULL) - // must always have a NULL discovered field. - oop next = oopDesc::load_decode_heap_oop(next_addr); - oop discovered = java_lang_ref_Reference::discovered(obj); - assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), - err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", - (oopDesc*)obj)); -#endif - } - // treat next as normal oop. next is a link in the reference queue. - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process next as normal " INTPTR_FORMAT, next_addr); - } - ) - MarkSweep::mark_and_push(next_addr); - ref->InstanceKlass::oop_follow_contents(obj); -} - -void InstanceRefKlass::oop_follow_contents(oop obj) { - if (UseCompressedOops) { - specialized_oop_follow_contents(this, obj); - } else { - specialized_oop_follow_contents(this, obj); - } -} - -#if INCLUDE_ALL_GCS -template -void specialized_oop_follow_contents(InstanceRefKlass* ref, - ParCompactionManager* cm, - oop obj) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(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, (void *)obj); - } - ) - if (!oopDesc::is_null(heap_oop)) { - oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); - if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) && - PSParallelCompact::ref_processor()-> - discover_reference(obj, ref->reference_type())) { - // reference already enqueued, referent will be traversed later - ref->InstanceKlass::oop_follow_contents(cm, obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " INTPTR_FORMAT, (void *)obj); - } - ) - return; - } else { - // treat referent as normal oop - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " INTPTR_FORMAT, (void *)obj); - } - ) - PSParallelCompact::mark_and_push(cm, referent_addr); - } - } - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - if (ReferenceProcessor::pending_list_uses_discovered_field()) { - // Treat discovered as normal oop, if ref is not "active", - // i.e. if next is non-NULL. - T next_oop = oopDesc::load_heap_oop(next_addr); - if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - INTPTR_FORMAT, discovered_addr); - } - ) - PSParallelCompact::mark_and_push(cm, discovered_addr); - } - } else { -#ifdef ASSERT - // In the case of older JDKs which do not use the discovered - // field for the pending list, an inactive ref (next != NULL) - // must always have a NULL discovered field. - T next = oopDesc::load_heap_oop(next_addr); - oop discovered = java_lang_ref_Reference::discovered(obj); - assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), - err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", - (oopDesc*)obj)); -#endif - } - PSParallelCompact::mark_and_push(cm, next_addr); - ref->InstanceKlass::oop_follow_contents(cm, obj); -} - -void InstanceRefKlass::oop_follow_contents(ParCompactionManager* cm, - oop obj) { - if (UseCompressedOops) { - specialized_oop_follow_contents(this, cm, obj); - } else { - specialized_oop_follow_contents(this, cm, obj); - } -} -#endif // INCLUDE_ALL_GCS - -#ifdef ASSERT -template void trace_reference_gc(const char *s, oop obj, - T* referent_addr, - T* next_addr, - T* discovered_addr) { - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("%s obj " INTPTR_FORMAT, s, (address)obj); - gclog_or_tty->print_cr(" referent_addr/* " INTPTR_FORMAT " / " - INTPTR_FORMAT, referent_addr, - referent_addr ? - (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL); - gclog_or_tty->print_cr(" next_addr/* " INTPTR_FORMAT " / " - INTPTR_FORMAT, next_addr, - next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL); - gclog_or_tty->print_cr(" discovered_addr/* " INTPTR_FORMAT " / " - INTPTR_FORMAT, discovered_addr, - discovered_addr ? - (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL); - } -} -#endif - -template void specialized_oop_adjust_pointers(InstanceRefKlass *ref, oop obj) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - MarkSweep::adjust_pointer(referent_addr); - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - MarkSweep::adjust_pointer(next_addr); - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - MarkSweep::adjust_pointer(discovered_addr); - debug_only(trace_reference_gc("InstanceRefKlass::oop_adjust_pointers", obj, - referent_addr, next_addr, discovered_addr);) -} - -int InstanceRefKlass::oop_adjust_pointers(oop obj) { - int size = size_helper(); - InstanceKlass::oop_adjust_pointers(obj); - - if (UseCompressedOops) { - specialized_oop_adjust_pointers(this, obj); - } else { - specialized_oop_adjust_pointers(this, obj); - } - return size; -} - -#define InstanceRefKlass_SPECIALIZED_OOP_ITERATE(T, nv_suffix, contains) \ - T* disc_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); \ - if (closure->apply_to_weak_ref_discovered_field()) { \ - closure->do_oop##nv_suffix(disc_addr); \ - } \ - \ - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); \ - T heap_oop = oopDesc::load_heap_oop(referent_addr); \ - ReferenceProcessor* rp = closure->_ref_processor; \ - if (!oopDesc::is_null(heap_oop)) { \ - oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); \ - if (!referent->is_gc_marked() && (rp != NULL) && \ - rp->discover_reference(obj, reference_type())) { \ - return size; \ - } else if (contains(referent_addr)) { \ - /* treat referent as normal oop */ \ - closure->do_oop##nv_suffix(referent_addr); \ - } \ - } \ - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); \ - if (ReferenceProcessor::pending_list_uses_discovered_field()) { \ - T next_oop = oopDesc::load_heap_oop(next_addr); \ - /* Treat discovered as normal oop, if ref is not "active" (next non-NULL) */\ - if (!oopDesc::is_null(next_oop) && contains(disc_addr)) { \ - /* i.e. ref is not "active" */ \ - debug_only( \ - if(TraceReferenceGC && PrintGCDetails) { \ - gclog_or_tty->print_cr(" Process discovered as normal " \ - INTPTR_FORMAT, disc_addr); \ - } \ - ) \ - closure->do_oop##nv_suffix(disc_addr); \ - } \ - } else { \ - /* In the case of older JDKs which do not use the discovered field for */ \ - /* the pending list, an inactive ref (next != NULL) must always have a */ \ - /* NULL discovered field. */ \ - debug_only( \ - T next_oop = oopDesc::load_heap_oop(next_addr); \ - T disc_oop = oopDesc::load_heap_oop(disc_addr); \ - assert(oopDesc::is_null(next_oop) || oopDesc::is_null(disc_oop), \ - err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL" \ - "discovered field", (oopDesc*)obj)); \ - ) \ - } \ - /* treat next as normal oop */ \ - if (contains(next_addr)) { \ - closure->do_oop##nv_suffix(next_addr); \ - } \ - return size; \ - - -template bool contains(T *t) { return true; } - -// Macro to define InstanceRefKlass::oop_oop_iterate for virtual/nonvirtual for -// all closures. Macros calling macros above for each oop size. - -#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceRefKlass:: \ -oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - int size = InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ - \ - if (UseCompressedOops) { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, contains); \ - } else { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(oop, nv_suffix, contains); \ - } \ -} - -#if INCLUDE_ALL_GCS -#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -int InstanceRefKlass:: \ -oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ - /* Get size before changing pointers */ \ - int size = InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \ - \ - if (UseCompressedOops) { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, contains); \ - } else { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(oop, nv_suffix, contains); \ - } \ -} -#endif // INCLUDE_ALL_GCS - - -#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ - \ -int InstanceRefKlass:: \ -oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* closure, \ - MemRegion mr) { \ - int size = InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr); \ - if (UseCompressedOops) { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, mr.contains); \ - } else { \ - InstanceRefKlass_SPECIALIZED_OOP_ITERATE(oop, nv_suffix, mr.contains); \ - } \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceRefKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_DEFN) -#if INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) -#endif // INCLUDE_ALL_GCS -ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m) - -#if INCLUDE_ALL_GCS -template -void specialized_oop_push_contents(InstanceRefKlass *ref, - PSPromotionManager* pm, oop obj) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - if (PSScavenge::should_scavenge(referent_addr)) { - ReferenceProcessor* rp = PSScavenge::reference_processor(); - if (rp->discover_reference(obj, ref->reference_type())) { - // reference already enqueued, referent and next will be traversed later - ref->InstanceKlass::oop_push_contents(pm, obj); - return; - } else { - // treat referent as normal oop - pm->claim_or_forward_depth(referent_addr); - } - } - // Treat discovered as normal oop, if ref is not "active", - // i.e. if next is non-NULL. - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - if (ReferenceProcessor::pending_list_uses_discovered_field()) { - T next_oop = oopDesc::load_heap_oop(next_addr); - if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - INTPTR_FORMAT, discovered_addr); - } - ) - if (PSScavenge::should_scavenge(discovered_addr)) { - pm->claim_or_forward_depth(discovered_addr); - } - } - } else { -#ifdef ASSERT - // In the case of older JDKs which do not use the discovered - // field for the pending list, an inactive ref (next != NULL) - // must always have a NULL discovered field. - oop next = oopDesc::load_decode_heap_oop(next_addr); - oop discovered = java_lang_ref_Reference::discovered(obj); - assert(oopDesc::is_null(next) || oopDesc::is_null(discovered), - err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field", - (oopDesc*)obj)); -#endif - } - - // Treat next as normal oop; next is a link in the reference queue. - if (PSScavenge::should_scavenge(next_addr)) { - pm->claim_or_forward_depth(next_addr); - } - ref->InstanceKlass::oop_push_contents(pm, obj); -} - -void InstanceRefKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - if (UseCompressedOops) { - specialized_oop_push_contents(this, pm, obj); - } else { - specialized_oop_push_contents(this, pm, obj); - } -} - -template -void specialized_oop_update_pointers(InstanceRefKlass *ref, - ParCompactionManager* cm, oop obj) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - PSParallelCompact::adjust_pointer(referent_addr); - T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - PSParallelCompact::adjust_pointer(next_addr); - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - PSParallelCompact::adjust_pointer(discovered_addr); - debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj, - referent_addr, next_addr, discovered_addr);) -} - -int InstanceRefKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - InstanceKlass::oop_update_pointers(cm, obj); - if (UseCompressedOops) { - specialized_oop_update_pointers(this, cm, obj); - } else { - specialized_oop_update_pointers(this, cm, obj); - } - return size_helper(); -} -#endif // INCLUDE_ALL_GCS - void InstanceRefKlass::update_nonstatic_oop_maps(Klass* k) { // Clear the nonstatic oop-map entries corresponding to referent // and nextPending field. They are treated specially by the @@ -483,12 +78,6 @@ void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) { InstanceKlass::oop_verify_on(obj, st); // Verify referent field oop referent = java_lang_ref_Reference::referent(obj); - - // We should make this general to all heaps - GenCollectedHeap* gch = NULL; - if (Universe::heap()->kind() == CollectedHeap::GenCollectedHeap) - gch = GenCollectedHeap::heap(); - if (referent != NULL) { guarantee(referent->is_oop(), "referent field heap failed"); } diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.hpp index 2f5b459d800..854c4aaea18 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp @@ -64,30 +64,71 @@ class InstanceRefKlass: public InstanceKlass { return (InstanceRefKlass*) k; } - // Garbage collection - int oop_adjust_pointers(oop obj); - void oop_follow_contents(oop obj); + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); +#if INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS + // Oop fields (and metadata) iterators + // [nv = true] Use non-virtual calls to do_oop_nv. + // [nv = false] Use virtual calls to do_oop. + // + // The InstanceRefKlass iterators also support reference processing. - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_v_m(obj, blk, mr); - } -#define InstanceRefKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ - int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, MemRegion mr); + // Forward iteration +private: + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate(oop obj, OopClosureType* closure); + + // Reverse iteration +#if INCLUDE_ALL_GCS + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); +#endif // INCLUDE_ALL_GCS + + // Bounded range iteration + // Iterate over all oop fields and metadata. + template + inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Reference processing part of the iterators. + + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains); + + // Only perform reference processing if the referent object is within mr. + template + inline void oop_oop_iterate_ref_processing_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Reference processing + template + inline void oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure); + + + public: + +#define InstanceRefKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \ + int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceRefKlass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_DECL) #if INCLUDE_ALL_GCS -#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); +#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp new file mode 100644 index 00000000000..95d1b385f36 --- /dev/null +++ b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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_OOPS_INSTANCEREFKLASS_INLINE_HPP +#define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP + +#include "classfile/javaClasses.hpp" +#include "memory/referenceProcessor.hpp" +#include "oops/instanceRefKlass.hpp" +#include "oops/instanceKlass.inline.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +template +void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains) { + T* disc_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); + if (closure->apply_to_weak_ref_discovered_field()) { + Devirtualizer::do_oop(closure, disc_addr); + } + + T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); + T heap_oop = oopDesc::load_heap_oop(referent_addr); + ReferenceProcessor* rp = closure->_ref_processor; + if (!oopDesc::is_null(heap_oop)) { + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); + if (!referent->is_gc_marked() && (rp != NULL) && + rp->discover_reference(obj, reference_type())) { + return; + } else if (contains(referent_addr)) { + // treat referent as normal oop + Devirtualizer::do_oop(closure, referent_addr); + } + } + T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); + if (ReferenceProcessor::pending_list_uses_discovered_field()) { + T next_oop = oopDesc::load_heap_oop(next_addr); + // Treat discovered as normal oop, if ref is not "active" (next non-NULL) + if (!oopDesc::is_null(next_oop) && contains(disc_addr)) { + // i.e. ref is not "active" + debug_only( + if(TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print_cr(" Process discovered as normal " + PTR_FORMAT, p2i(disc_addr)); + } + ) + Devirtualizer::do_oop(closure, disc_addr); + } + } else { + // In the case of older JDKs which do not use the discovered field for + // the pending list, an inactive ref (next != NULL) must always have a + // NULL discovered field. + debug_only( + T next_oop = oopDesc::load_heap_oop(next_addr); + T disc_oop = oopDesc::load_heap_oop(disc_addr); + assert(oopDesc::is_null(next_oop) || oopDesc::is_null(disc_oop), + err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL" + "discovered field", p2i(obj))); + ) + } + // treat next as normal oop + if (contains(next_addr)) { + Devirtualizer::do_oop(closure, next_addr); + } +} + +class AlwaysContains { + public: + template bool operator()(T* p) const { return true; } +}; + +template +void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure) { + AlwaysContains always_contains; + if (UseCompressedOops) { + oop_oop_iterate_ref_processing_specialized(obj, closure, always_contains); + } else { + oop_oop_iterate_ref_processing_specialized(obj, closure, always_contains); + } +} + +class MrContains { + const MemRegion _mr; + public: + MrContains(MemRegion mr) : _mr(mr) {} + template bool operator()(T* p) const { return _mr.contains(p); } +}; + +template +void InstanceRefKlass::oop_oop_iterate_ref_processing_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + const MrContains contains(mr); + if (UseCompressedOops) { + oop_oop_iterate_ref_processing_specialized(obj, closure, contains); + } else { + oop_oop_iterate_ref_processing_specialized(obj, closure, contains); + } +} + +template +int InstanceRefKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { + // Get size before changing pointers + int size = InstanceKlass::oop_oop_iterate(obj, closure); + + oop_oop_iterate_ref_processing(obj, closure); + + return size; +} + +#if INCLUDE_ALL_GCS +template +int InstanceRefKlass:: +oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + // Get size before changing pointers + int size = InstanceKlass::oop_oop_iterate_reverse(obj, closure); + + oop_oop_iterate_ref_processing(obj, closure); + + return size; +} +#endif // INCLUDE_ALL_GCS + + +template +int InstanceRefKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + // Get size before changing pointers + int size = InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + + oop_oop_iterate_ref_processing_bounded(obj, closure, mr); + + return size; +} + +// Macro to define InstanceRefKlass::oop_oop_iterate for virtual/nonvirtual for +// all closures. Macros calling macros above for each oop size. + +#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceRefKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate(obj, closure); \ +} + +#if INCLUDE_ALL_GCS +#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + \ +int InstanceRefKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_reverse(obj, closure); \ +} +#else +#define InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + + +#define InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ + \ +int InstanceRefKlass::oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_bounded(obj, closure, mr); \ +} + +#define ALL_INSTANCE_REF_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + InstanceRefKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + InstanceRefKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + InstanceRefKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + + +#endif // SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 09256c71971..cc193fd415a 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -27,7 +27,6 @@ #include "classfile/dictionary.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "memory/heapInspection.hpp" #include "memory/metadataFactory.hpp" @@ -43,9 +42,6 @@ #include "utilities/stack.inline.hpp" #if INCLUDE_ALL_GCS #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.hpp" #endif // INCLUDE_ALL_GCS void Klass::set_name(Symbol* n) { diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index f1b6a72ad7d..3e19e7ebe10 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -25,21 +25,14 @@ #ifndef SHARE_VM_OOPS_KLASS_HPP #define SHARE_VM_OOPS_KLASS_HPP -#include "memory/genOopClosures.hpp" #include "memory/iterator.hpp" #include "memory/memRegion.hpp" #include "memory/specialized_oop_closures.hpp" -#include "oops/klassPS.hpp" #include "oops/metadata.hpp" #include "oops/oop.hpp" #include "trace/traceMacros.hpp" #include "utilities/accessFlags.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" -#include "gc_implementation/g1/g1OopClosures.hpp" -#include "gc_implementation/parNew/parOopClosures.hpp" -#endif // INCLUDE_ALL_GCS // // A Klass provides: @@ -61,6 +54,7 @@ template class GrowableArray; class ClassLoaderData; class klassVtable; class ParCompactionManager; +class PSPromotionManager; class KlassSizeStats; class fieldDescriptor; @@ -478,13 +472,6 @@ protected: // and the package separators as '/'. virtual const char* signature_name() const; - // garbage collection support - virtual void oop_follow_contents(oop obj) = 0; - virtual int oop_adjust_pointers(oop obj) = 0; - - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS_PV - // type testing operations protected: virtual bool oop_is_instance_slow() const { return false; } @@ -581,60 +568,35 @@ protected: clean_weak_klass_links(is_alive, false /* clean_alive_klasses */); } - // iterators - virtual int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) = 0; - virtual int oop_oop_iterate_v(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate(obj, blk); - } + // GC specific object visitors + // + // Mark Sweep + virtual void oop_ms_follow_contents(oop obj) = 0; + virtual int oop_ms_adjust_pointers(oop obj) = 0; +#if INCLUDE_ALL_GCS + // Parallel Scavenge + virtual void oop_ps_push_contents( oop obj, PSPromotionManager* pm) = 0; + // Parallel Compact + virtual void oop_pc_follow_contents(oop obj, ParCompactionManager* cm) = 0; + virtual void oop_pc_update_pointers(oop obj) = 0; +#endif + + // Iterators specialized to particular subtypes + // of ExtendedOopClosure, to avoid closure virtual calls. +#define Klass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + virtual int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) = 0; \ + /* Iterates "closure" over all the oops in "obj" (of type "this") within "mr". */ \ + virtual int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) = 0; + + ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL) #if INCLUDE_ALL_GCS - // In case we don't have a specialized backward scanner use forward - // iteration. - virtual int oop_oop_iterate_backwards_v(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } -#endif // INCLUDE_ALL_GCS +#define Klass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ + virtual int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) = 0; - // Iterates "blk" over all the oops in "obj" (of type "this") within "mr". - // (I don't see why the _m should be required, but without it the Solaris - // C++ gives warning messages about overridings of the "oop_oop_iterate" - // defined above "hiding" this virtual function. (DLD, 6/20/00)) */ - virtual int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) = 0; - virtual int oop_oop_iterate_v_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_m(obj, blk, mr); - } - - // Versions of the above iterators specialized to particular subtypes - // of OopClosure, to avoid closure virtual calls. -#define Klass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - virtual int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk) { \ - /* Default implementation reverts to general version. */ \ - return oop_oop_iterate(obj, blk); \ - } \ - \ - /* Iterates "blk" over all the oops in "obj" (of type "this") within "mr". \ - (I don't see why the _m should be required, but without it the Solaris \ - C++ gives warning messages about overridings of the "oop_oop_iterate" \ - defined above "hiding" this virtual function. (DLD, 6/20/00)) */ \ - virtual int oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* blk, \ - MemRegion mr) { \ - return oop_oop_iterate_m(obj, blk, mr); \ - } - - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL) - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL) - -#if INCLUDE_ALL_GCS -#define Klass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - virtual int oop_oop_iterate_backwards##nv_suffix(oop obj, \ - OopClosureType* blk) { \ - /* Default implementation reverts to general version. */ \ - return oop_oop_iterate_backwards_v(obj, blk); \ - } - - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_BACKWARDS_DECL) - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_BACKWARDS_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_BACKWARDS_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_BACKWARDS_DECL) #endif // INCLUDE_ALL_GCS virtual void array_klasses_do(void f(Klass* k)) {} diff --git a/hotspot/src/share/vm/oops/klassPS.hpp b/hotspot/src/share/vm/oops/klassPS.hpp deleted file mode 100644 index a92f8738a78..00000000000 --- a/hotspot/src/share/vm/oops/klassPS.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * 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_OOPS_KLASSPS_HPP -#define SHARE_VM_OOPS_KLASSPS_HPP - - // Expands to Parallel Scavenge and Parallel Old declarations - -#include "utilities/macros.hpp" - -#if INCLUDE_ALL_GCS -#define PARALLEL_GC_DECLS \ - virtual void oop_push_contents(PSPromotionManager* pm, oop obj); \ - /* Parallel Old GC support \ - \ - The 2-arg version of oop_update_pointers is for objects that are \ - known not to cross chunk boundaries. The 4-arg version is for \ - objects that do (or may) cross chunk boundaries; it updates only those \ - oops that are in the region [beg_addr, end_addr). */ \ - virtual void oop_follow_contents(ParCompactionManager* cm, oop obj); \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj); - -// Pure virtual version for klass.hpp -#define PARALLEL_GC_DECLS_PV \ - virtual void oop_push_contents(PSPromotionManager* pm, oop obj) = 0; \ - virtual void oop_follow_contents(ParCompactionManager* cm, oop obj) = 0; \ - virtual int oop_update_pointers(ParCompactionManager* cm, oop obj) = 0; -#else // INCLUDE_ALL_GCS -#define PARALLEL_GC_DECLS -#define PARALLEL_GC_DECLS_PV -#endif // INCLUDE_ALL_GCS - -#endif // SHARE_VM_OOPS_KLASSPS_HPP diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index 27a1ba4cd04..0700c51040b 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -152,6 +152,7 @@ void ProfileData::tab(outputStream* st, bool first) const { void BitData::print_data_on(outputStream* st, const char* extra) const { print_shared(st, "BitData", extra); + st->cr(); } // ================================================================== diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index d06974672ee..b80ac6b1d80 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -2056,7 +2056,7 @@ public: // Whole-method sticky bits and flags enum { - _trap_hist_limit = 21, // decoupled from Deoptimization::Reason_LIMIT + _trap_hist_limit = 22, // decoupled from Deoptimization::Reason_LIMIT _trap_hist_mask = max_jubyte, _extra_data_count = 4 // extra DataLayout headers, for trap history }; // Public flag values diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index ceaabf9d9b5..fb59a969cd1 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -26,9 +26,7 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" -#include "memory/genOopClosures.inline.hpp" #include "memory/iterator.inline.hpp" #include "memory/metadataFactory.hpp" #include "memory/resourceArea.hpp" @@ -45,17 +43,6 @@ #include "runtime/orderAccess.inline.hpp" #include "utilities/copy.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" -#include "gc_implementation/g1/g1OopClosures.inline.hpp" -#include "gc_implementation/g1/g1RemSet.inline.hpp" -#include "gc_implementation/g1/heapRegionManager.inline.hpp" -#include "gc_implementation/parNew/parOopClosures.inline.hpp" -#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" -#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" -#endif // INCLUDE_ALL_GCS ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) { assert(ObjArrayKlass::header_size() <= InstanceKlass::header_size(), @@ -410,179 +397,6 @@ void ObjArrayKlass::initialize(TRAPS) { bottom_klass()->initialize(THREAD); // dispatches to either InstanceKlass or TypeArrayKlass } -#define ObjArrayKlass_SPECIALIZED_OOP_ITERATE(T, a, p, do_oop) \ -{ \ - T* p = (T*)(a)->base(); \ - T* const end = p + (a)->length(); \ - while (p < end) { \ - do_oop; \ - p++; \ - } \ -} - -#define ObjArrayKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(T, a, p, low, high, do_oop) \ -{ \ - T* const l = (T*)(low); \ - T* const h = (T*)(high); \ - T* p = (T*)(a)->base(); \ - T* end = p + (a)->length(); \ - if (p < l) p = l; \ - if (end > h) end = h; \ - while (p < end) { \ - do_oop; \ - ++p; \ - } \ -} - -#define ObjArrayKlass_OOP_ITERATE(a, p, do_oop) \ - if (UseCompressedOops) { \ - ObjArrayKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ - a, p, do_oop) \ - } else { \ - ObjArrayKlass_SPECIALIZED_OOP_ITERATE(oop, \ - a, p, do_oop) \ - } - -#define ObjArrayKlass_BOUNDED_OOP_ITERATE(a, p, low, high, do_oop) \ - if (UseCompressedOops) { \ - ObjArrayKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ - a, p, low, high, do_oop) \ - } else { \ - ObjArrayKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ - a, p, low, high, do_oop) \ - } - -void ObjArrayKlass::oop_follow_contents(oop obj) { - assert (obj->is_array(), "obj must be array"); - MarkSweep::follow_klass(obj->klass()); - if (UseCompressedOops) { - objarray_follow_contents(obj, 0); - } else { - objarray_follow_contents(obj, 0); - } -} - -#if INCLUDE_ALL_GCS -void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, - oop obj) { - assert(obj->is_array(), "obj must be array"); - PSParallelCompact::follow_klass(cm, obj->klass()); - if (UseCompressedOops) { - objarray_follow_contents(cm, obj, 0); - } else { - objarray_follow_contents(cm, obj, 0); - } -} -#endif // INCLUDE_ALL_GCS - -#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj, \ - OopClosureType* closure) { \ - assert (obj->is_array(), "obj must be array"); \ - objArrayOop a = objArrayOop(obj); \ - /* Get size before changing pointers. */ \ - /* Don't call size() or oop_size() since that is a virtual call. */ \ - int size = a->object_size(); \ - if_do_metadata_checked(closure, nv_suffix) { \ - closure->do_klass##nv_suffix(obj->klass()); \ - } \ - ObjArrayKlass_OOP_ITERATE(a, p, (closure)->do_oop##nv_suffix(p)) \ - return size; \ -} - -#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ - \ -int ObjArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \ - OopClosureType* closure, \ - MemRegion mr) { \ - assert(obj->is_array(), "obj must be array"); \ - objArrayOop a = objArrayOop(obj); \ - /* Get size before changing pointers. */ \ - /* Don't call size() or oop_size() since that is a virtual call */ \ - int size = a->object_size(); \ - if_do_metadata_checked(closure, nv_suffix) { \ - /* SSS: Do we need to pass down mr here? */ \ - closure->do_klass##nv_suffix(a->klass()); \ - } \ - ObjArrayKlass_BOUNDED_OOP_ITERATE( \ - a, p, mr.start(), mr.end(), (closure)->do_oop##nv_suffix(p)) \ - return size; \ -} - -// Like oop_oop_iterate but only iterates over a specified range and only used -// for objArrayOops. -#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r(OopClosureType, nv_suffix) \ - \ -int ObjArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj, \ - OopClosureType* closure, \ - int start, int end) { \ - assert(obj->is_array(), "obj must be array"); \ - objArrayOop a = objArrayOop(obj); \ - /* Get size before changing pointers. */ \ - /* Don't call size() or oop_size() since that is a virtual call */ \ - int size = a->object_size(); \ - if (UseCompressedOops) { \ - HeapWord* low = start == 0 ? (HeapWord*)a : (HeapWord*)a->obj_at_addr(start);\ - /* this might be wierd if end needs to be aligned on HeapWord boundary */ \ - HeapWord* high = (HeapWord*)((narrowOop*)a->base() + end); \ - MemRegion mr(low, high); \ - if_do_metadata_checked(closure, nv_suffix) { \ - /* SSS: Do we need to pass down mr here? */ \ - closure->do_klass##nv_suffix(a->klass()); \ - } \ - ObjArrayKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ - a, p, low, high, (closure)->do_oop##nv_suffix(p)) \ - } else { \ - HeapWord* low = start == 0 ? (HeapWord*)a : (HeapWord*)a->obj_at_addr(start); \ - HeapWord* high = (HeapWord*)((oop*)a->base() + end); \ - MemRegion mr(low, high); \ - if_do_metadata_checked(closure, nv_suffix) { \ - /* SSS: Do we need to pass down mr here? */ \ - closure->do_klass##nv_suffix(a->klass()); \ - } \ - ObjArrayKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ - a, p, low, high, (closure)->do_oop##nv_suffix(p)) \ - } \ - return size; \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m) -ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r) -ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r) - -int ObjArrayKlass::oop_adjust_pointers(oop obj) { - assert(obj->is_objArray(), "obj must be obj array"); - objArrayOop a = objArrayOop(obj); - // Get size before changing pointers. - // Don't call size() or oop_size() since that is a virtual call. - int size = a->object_size(); - ObjArrayKlass_OOP_ITERATE(a, p, MarkSweep::adjust_pointer(p)) - return size; -} - -#if INCLUDE_ALL_GCS -void ObjArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - assert(obj->is_objArray(), "obj must be obj array"); - ObjArrayKlass_OOP_ITERATE( \ - objArrayOop(obj), p, \ - if (PSScavenge::should_scavenge(p)) { \ - pm->claim_or_forward_depth(p); \ - }) -} - -int ObjArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - assert (obj->is_objArray(), "obj must be obj array"); - objArrayOop a = objArrayOop(obj); - int size = a->object_size(); - ObjArrayKlass_OOP_ITERATE(a, p, PSParallelCompact::adjust_pointer(p)) - return size; -} -#endif // INCLUDE_ALL_GCS - // JVM support jint ObjArrayKlass::compute_modifier_flags(TRAPS) const { diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index cfe31e86e61..5c167cb493c 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -26,7 +26,6 @@ #define SHARE_VM_OOPS_OBJARRAYKLASS_HPP #include "classfile/classLoaderData.hpp" -#include "memory/specialized_oop_closures.hpp" #include "oops/arrayKlass.hpp" #include "utilities/macros.hpp" @@ -103,28 +102,67 @@ class ObjArrayKlass : public ArrayKlass { // Initialization (virtual from Klass) void initialize(TRAPS); - // Garbage collection - void oop_follow_contents(oop obj); - inline void oop_follow_contents(oop obj, int index); - template inline void objarray_follow_contents(oop obj, int index); - - int oop_adjust_pointers(oop obj); - - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); #if INCLUDE_ALL_GCS - inline void oop_follow_contents(ParCompactionManager* cm, oop obj, int index); - template inline void - objarray_follow_contents(ParCompactionManager* cm, oop obj, int index); -#endif // INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif + + // Oop fields (and metadata) iterators + // [nv = true] Use non-virtual calls to do_oop_nv. + // [nv = false] Use virtual calls to do_oop. + // + // The ObjArrayKlass iterators also visits the Object's klass. + + private: + + // Iterate over oop elements and metadata. + template + inline int oop_oop_iterate(oop obj, OopClosureType* closure); + + // Iterate over oop elements within mr, and metadata. + template + inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + + // Iterate over oop elements with indices within [start, end), and metadata. + template + inline int oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end); + + // Iterate over oop elements within [start, end), and metadata. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end); + + public: + // Iterate over all oop elements. + template + inline void oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure); + + private: + // Iterate over all oop elements. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure); + + // Iterate over all oop elements with indices within mr. + template + inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr); + + // Iterate over oop elements within [low, high).. + // Specialized for [T = oop] or [T = narrowOop]. + template + inline void oop_oop_iterate_elements_specialized_bounded(objArrayOop a, OopClosureType* closure, void* low, void* high); + + + public: - // Iterators - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - return oop_oop_iterate_v(obj, blk); - } - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - return oop_oop_iterate_v_m(obj, blk, mr); - } #define ObjArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \ @@ -135,6 +173,14 @@ class ObjArrayKlass : public ArrayKlass { ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DECL) +#if INCLUDE_ALL_GCS +#define ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); + + ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) +#endif // INCLUDE_ALL_GCS + // JVM support jint compute_modifier_flags(TRAPS) const; diff --git a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp index e082df55ab4..d7867ab8ea8 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * 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,78 +25,165 @@ #ifndef SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP #define SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP -#include "gc_implementation/shared/markSweep.inline.hpp" +#include "memory/memRegion.hpp" +#include "memory/iterator.inline.hpp" #include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.inline.hpp" +#include "oops/oop.inline.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" -#endif // INCLUDE_ALL_GCS -void ObjArrayKlass::oop_follow_contents(oop obj, int index) { - if (UseCompressedOops) { - objarray_follow_contents(obj, index); - } else { - objarray_follow_contents(obj, index); +template +void ObjArrayKlass::oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure) { + T* p = (T*)a->base(); + T* const end = p + a->length(); + + for (;p < end; p++) { + Devirtualizer::do_oop(closure, p); } } -template -void ObjArrayKlass::objarray_follow_contents(oop obj, int index) { +template +void ObjArrayKlass::oop_oop_iterate_elements_specialized_bounded( + objArrayOop a, OopClosureType* closure, void* low, void* high) { + + T* const l = (T*)low; + T* const h = (T*)high; + + T* p = (T*)a->base(); + T* end = p + a->length(); + + if (p < l) { + p = l; + } + if (end > h) { + end = h; + } + + for (;p < end; ++p) { + Devirtualizer::do_oop(closure, p); + } +} + +template +void ObjArrayKlass::oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure) { + if (UseCompressedOops) { + oop_oop_iterate_elements_specialized(a, closure); + } else { + oop_oop_iterate_elements_specialized(a, closure); + } +} + +template +void ObjArrayKlass::oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr) { + if (UseCompressedOops) { + oop_oop_iterate_elements_specialized_bounded(a, closure, mr.start(), mr.end()); + } else { + oop_oop_iterate_elements_specialized_bounded(a, closure, mr.start(), mr.end()); + } +} + +template +int ObjArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { + assert (obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); - const size_t len = size_t(a->length()); - const size_t beg_index = size_t(index); - assert(beg_index < len || len == 0, "index too large"); - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); - const size_t end_index = beg_index + stride; - T* const base = (T*)a->base(); - T* const beg = base + beg_index; - T* const end = base + end_index; - - // Push the non-NULL elements of the next stride on the marking stack. - for (T* e = beg; e < end; e++) { - MarkSweep::mark_and_push(e); + // Get size before changing pointers. + // Don't call size() or oop_size() since that is a virtual call. + int size = a->object_size(); + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, obj->klass()); } - if (end_index < len) { - MarkSweep::push_objarray(a, end_index); // Push the continuation. + oop_oop_iterate_elements(a, closure); + + return size; +} + +template +int ObjArrayKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { + assert(obj->is_array(), "obj must be array"); + objArrayOop a = objArrayOop(obj); + + // Get size before changing pointers. + // Don't call size() or oop_size() since that is a virtual call + int size = a->object_size(); + + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, a->klass()); } + + oop_oop_iterate_elements_bounded(a, closure, mr); + + return size; +} + +template +void ObjArrayKlass::oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end) { + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, a->klass()); + } + + T* low = start == 0 ? cast_from_oop(a) : a->obj_at_addr(start); + T* high = (T*)a->base() + end; + + oop_oop_iterate_elements_specialized_bounded(a, closure, low, high); +} + +// Like oop_oop_iterate but only iterates over a specified range and only used +// for objArrayOops. +template +int ObjArrayKlass::oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end) { + assert(obj->is_array(), "obj must be array"); + objArrayOop a = objArrayOop(obj); + + // Get size before changing pointers. + // Don't call size() or oop_size() since that is a virtual call + int size = a->object_size(); + + if (UseCompressedOops) { + oop_oop_iterate_range_specialized(a, closure, start, end); + } else { + oop_oop_iterate_range_specialized(a, closure, start, end); + } + + return size; +} + + +#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate(obj, closure); \ } #if INCLUDE_ALL_GCS -void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj, - int index) { - if (UseCompressedOops) { - objarray_follow_contents(cm, obj, index); - } else { - objarray_follow_contents(cm, obj, index); - } +#define ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ +int ObjArrayKlass::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + /* No reverse implementation ATM. */ \ + return oop_oop_iterate(obj, closure); \ +} +#else +#define ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + +#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ + \ +int ObjArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_bounded(obj, closure, mr); \ } -template -void ObjArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj, - int index) { - objArrayOop a = objArrayOop(obj); - const size_t len = size_t(a->length()); - const size_t beg_index = size_t(index); - assert(beg_index < len || len == 0, "index too large"); - - const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride); - const size_t end_index = beg_index + stride; - T* const base = (T*)a->base(); - T* const beg = base + beg_index; - T* const end = base + end_index; - - // Push the non-NULL elements of the next stride on the marking stack. - for (T* e = beg; e < end; e++) { - PSParallelCompact::mark_and_push(cm, e); - } - - if (end_index < len) { - cm->push_objarray(a, end_index); // Push the continuation. - } +#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r(OopClosureType, nv_suffix) \ + \ +int ObjArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end) { \ + return oop_oop_iterate_range(obj, closure, start, end); \ } -#endif // INCLUDE_ALL_GCS + + +#define ALL_OBJ_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + ObjArrayKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + ObjArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r( OopClosureType, nv_suffix) + #endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index fd6515a3228..c050a5ffb0f 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -298,19 +298,6 @@ class oopDesc { // garbage collection bool is_gc_marked() const; - // Apply "MarkSweep::mark_and_push" to (the address of) every non-NULL - // reference field in "this". - void follow_contents(void); - -#if INCLUDE_ALL_GCS - // Parallel Scavenge - void push_contents(PSPromotionManager* pm); - - // Parallel Old - void update_contents(ParCompactionManager* cm); - - void follow_contents(ParCompactionManager* cm); -#endif // INCLUDE_ALL_GCS bool is_scavengable() const; @@ -334,9 +321,6 @@ class oopDesc { uint age() const; void incr_age(); - // Adjust all pointers in this object to point at it's forwarded location and - // return the size of this oop. This is used by the MarkSweep collector. - int adjust_pointers(); // mark-sweep support void follow_body(int begin, int end); @@ -345,6 +329,22 @@ class oopDesc { static BarrierSet* bs() { return _bs; } static void set_bs(BarrierSet* bs) { _bs = bs; } + // Garbage Collection support + + // Mark Sweep + void ms_follow_contents(); + // Adjust all pointers in this object to point at it's forwarded location and + // return the size of this oop. This is used by the MarkSweep collector. + int ms_adjust_pointers(); +#if INCLUDE_ALL_GCS + // Parallel Compact + void pc_follow_contents(ParCompactionManager* pc); + void pc_update_contents(); + // Parallel Scavenge + void ps_push_contents(PSPromotionManager* pm); +#endif + + // iterators, returns size of object #define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ int oop_iterate(OopClosureType* blk); \ diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index dfc5ac385aa..11884598ab9 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -26,13 +26,11 @@ #define SHARE_VM_OOPS_OOP_INLINE_HPP #include "gc_implementation/shared/ageTable.hpp" -#include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "memory/barrierSet.inline.hpp" #include "memory/cardTableModRefBS.hpp" #include "memory/genCollectedHeap.hpp" #include "memory/generation.hpp" -#include "memory/specialized_oop_closures.hpp" #include "oops/arrayKlass.hpp" #include "oops/arrayOop.hpp" #include "oops/klass.inline.hpp" @@ -592,11 +590,6 @@ inline bool oopDesc::is_unlocked_oop() const { } #endif // PRODUCT -inline void oopDesc::follow_contents(void) { - assert (is_gc_marked(), "should be marked"); - klass()->oop_follow_contents(this); -} - inline bool oopDesc::is_scavengable() const { return Universe::heap()->is_scavengable(this); } @@ -706,21 +699,49 @@ inline intptr_t oopDesc::identity_hash() { } } -inline int oopDesc::adjust_pointers() { +inline void oopDesc::ms_follow_contents() { + klass()->oop_ms_follow_contents(this); +} + +inline int oopDesc::ms_adjust_pointers() { debug_only(int check_size = size()); - int s = klass()->oop_adjust_pointers(this); + int s = klass()->oop_ms_adjust_pointers(this); assert(s == check_size, "should be the same"); return s; } -#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -inline int oopDesc::oop_iterate(OopClosureType* blk) { \ - return klass()->oop_oop_iterate##nv_suffix(this, blk); \ -} \ - \ -inline int oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ - return klass()->oop_oop_iterate##nv_suffix##_m(this, blk, mr); \ +#if INCLUDE_ALL_GCS +inline void oopDesc::pc_follow_contents(ParCompactionManager* cm) { + klass()->oop_pc_follow_contents(this, cm); +} + +inline void oopDesc::pc_update_contents() { + Klass* k = klass(); + if (!k->oop_is_typeArray()) { + // It might contain oops beyond the header, so take the virtual call. + k->oop_pc_update_pointers(this); + } + // Else skip it. The TypeArrayKlass in the header never needs scavenging. +} + +inline void oopDesc::ps_push_contents(PSPromotionManager* pm) { + Klass* k = klass(); + if (!k->oop_is_typeArray()) { + // It might contain oops beyond the header, so take the virtual call. + k->oop_ps_push_contents(this, pm); + } + // Else skip it. The TypeArrayKlass in the header never needs scavenging. +} +#endif + +#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +inline int oopDesc::oop_iterate(OopClosureType* blk) { \ + return klass()->oop_oop_iterate##nv_suffix(this, blk); \ +} \ + \ +inline int oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ + return klass()->oop_oop_iterate##nv_suffix##_m(this, blk, mr); \ } @@ -736,18 +757,21 @@ inline int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { return oop_iterate(&cl, mr); } -ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DEFN) - #if INCLUDE_ALL_GCS -#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ - return klass()->oop_oop_iterate_backwards##nv_suffix(this, blk); \ +#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + \ +inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ + return klass()->oop_oop_iterate_backwards##nv_suffix(this, blk); \ } +#else +#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif -ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DEFN) -#endif // INCLUDE_ALL_GCS +#define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \ + OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + +ALL_OOP_OOP_ITERATE_CLOSURES_1(ALL_OOPDESC_OOP_ITERATE) +ALL_OOP_OOP_ITERATE_CLOSURES_2(ALL_OOPDESC_OOP_ITERATE) #endif // SHARE_VM_OOPS_OOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp deleted file mode 100644 index 930a770f63b..00000000000 --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * 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_OOPS_OOP_PCGC_INLINE_HPP -#define SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP - -#include "runtime/atomic.inline.hpp" -#include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/parNew/parNewGeneration.hpp" -#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" -#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" -#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" -#include "gc_implementation/parallelScavenge/psScavenge.hpp" -#endif // INCLUDE_ALL_GCS - -inline void oopDesc::update_contents(ParCompactionManager* cm) { - // The klass field must be updated before anything else - // can be done. - DEBUG_ONLY(Klass* original_klass = klass()); - - Klass* new_klass = klass(); - if (!new_klass->oop_is_typeArray()) { - // It might contain oops beyond the header, so take the virtual call. - new_klass->oop_update_pointers(cm, this); - } - // Else skip it. The TypeArrayKlass in the header never needs scavenging. -} - -inline void oopDesc::follow_contents(ParCompactionManager* cm) { - assert (PSParallelCompact::mark_bitmap()->is_marked(this), - "should be marked"); - klass()->oop_follow_contents(cm, this); -} - -#endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.cpp b/hotspot/src/share/vm/oops/typeArrayKlass.cpp index 26c9ca55f4c..54bb11df3ee 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp @@ -36,7 +36,7 @@ #include "oops/klass.inline.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" -#include "oops/typeArrayKlass.hpp" +#include "oops/typeArrayKlass.inline.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" @@ -204,57 +204,6 @@ int TypeArrayKlass::oop_size(oop obj) const { return t->object_size(); } -void TypeArrayKlass::oop_follow_contents(oop obj) { - assert(obj->is_typeArray(),"must be a type array"); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. -} - -#if INCLUDE_ALL_GCS -void TypeArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) { - assert(obj->is_typeArray(),"must be a type array"); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. -} -#endif // INCLUDE_ALL_GCS - -int TypeArrayKlass::oop_adjust_pointers(oop obj) { - assert(obj->is_typeArray(),"must be a type array"); - typeArrayOop t = typeArrayOop(obj); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. - return t->object_size(); -} - -int TypeArrayKlass::oop_oop_iterate(oop obj, ExtendedOopClosure* blk) { - assert(obj->is_typeArray(),"must be a type array"); - typeArrayOop t = typeArrayOop(obj); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. - return t->object_size(); -} - -int TypeArrayKlass::oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) { - assert(obj->is_typeArray(),"must be a type array"); - typeArrayOop t = typeArrayOop(obj); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. - return t->object_size(); -} - -#if INCLUDE_ALL_GCS -void TypeArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { - ShouldNotReachHere(); - assert(obj->is_typeArray(),"must be a type array"); -} - -int -TypeArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { - assert(obj->is_typeArray(),"must be a type array"); - return typeArrayOop(obj)->object_size(); -} -#endif // INCLUDE_ALL_GCS - void TypeArrayKlass::initialize(TRAPS) { // Nothing to do. Having this function is handy since objArrayKlasses can be // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.hpp b/hotspot/src/share/vm/oops/typeArrayKlass.hpp index cf363fc76c2..36600be0b84 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp @@ -72,16 +72,46 @@ class TypeArrayKlass : public ArrayKlass { // Copying void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); - // Iteration - int oop_oop_iterate(oop obj, ExtendedOopClosure* blk); - int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr); + // GC specific object visitors + // + // Mark Sweep + void oop_ms_follow_contents(oop obj); + int oop_ms_adjust_pointers(oop obj); +#if INCLUDE_ALL_GCS + // Parallel Scavenge + void oop_ps_push_contents( oop obj, PSPromotionManager* pm); + // Parallel Compact + void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); + void oop_pc_update_pointers(oop obj); +#endif - // Garbage collection - void oop_follow_contents(oop obj); - int oop_adjust_pointers(oop obj); + // Oop iterators. Since there are no oops in TypeArrayKlasses, + // these functions only return the size of the object. + + private: + // The implementation used by all oop_oop_iterate functions in TypeArrayKlasses. + inline int oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure); + + public: + +#define TypeArrayKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \ + int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, \ + MemRegion mr); \ + int oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, \ + int start, int end); + + ALL_OOP_OOP_ITERATE_CLOSURES_1(TypeArrayKlass_OOP_OOP_ITERATE_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_2(TypeArrayKlass_OOP_OOP_ITERATE_DECL) + +#if INCLUDE_ALL_GCS +#define TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ + int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); + + ALL_OOP_OOP_ITERATE_CLOSURES_1(TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) + ALL_OOP_OOP_ITERATE_CLOSURES_2(TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) +#endif // INCLUDE_ALL_GCS - // Parallel Scavenge and Parallel Old - PARALLEL_GC_DECLS protected: // Find n'th dimensional array diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.inline.hpp b/hotspot/src/share/vm/oops/typeArrayKlass.inline.hpp new file mode 100644 index 00000000000..9609972af8b --- /dev/null +++ b/hotspot/src/share/vm/oops/typeArrayKlass.inline.hpp @@ -0,0 +1,73 @@ +/* + * 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. + * + */ + +#ifndef SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP +#define SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP + +#include "oops/oop.inline.hpp" +#include "oops/typeArrayKlass.hpp" +#include "oops/typeArrayOop.hpp" + +class ExtendedOopClosure; + +inline int TypeArrayKlass::oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure) { + assert(obj->is_typeArray(),"must be a type array"); + typeArrayOop t = typeArrayOop(obj); + // Performance tweak: We skip iterating over the klass pointer since we + // know that Universe::TypeArrayKlass never moves. + return t->object_size(); +} + +#define TypeArrayKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +int TypeArrayKlass:: \ +oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_impl(obj, closure); \ +} + +#if INCLUDE_ALL_GCS +#define TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ + \ +int TypeArrayKlass:: \ +oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ + return oop_oop_iterate_impl(obj, closure); \ +} +#else +#define TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +#endif + + +#define TypeArrayKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ + \ +int TypeArrayKlass:: \ +oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr) { \ + return oop_oop_iterate_impl(obj, closure); \ +} + +#define ALL_TYPE_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + TypeArrayKlass_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ + TypeArrayKlass_OOP_OOP_ITERATE_DEFN_m( OopClosureType, nv_suffix) \ + TypeArrayKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) + +#endif // SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 757b9717668..fa476d62401 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -631,11 +631,11 @@ InlineTree *InlineTree::build_inline_tree_for_callee( ciMethod* callee_method, J } int max_inline_level_adjust = 0; if (caller_jvms->method() != NULL) { - if (caller_jvms->method()->is_compiled_lambda_form()) + if (caller_jvms->method()->is_compiled_lambda_form()) { max_inline_level_adjust += 1; // don't count actions in MH or indy adapter frames - else if (callee_method->is_method_handle_intrinsic() || - callee_method->is_compiled_lambda_form()) { - max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implem + } else if (callee_method->is_method_handle_intrinsic() || + callee_method->is_compiled_lambda_form()) { + max_inline_level_adjust += 1; // don't count method handle calls from java.lang.invoke implementation } if (max_inline_level_adjust != 0 && C->print_inlining() && (Verbose || WizardMode)) { CompileTask::print_inline_indent(inline_level()); diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index 84d3b7b5cc4..59517e40499 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -324,6 +324,9 @@ develop(bool, SuperWordRTDepCheck, false, \ "Enable runtime dependency checks.") \ \ + product(bool, SuperWordReductions, true, \ + "Enable reductions support in superword.") \ + \ notproduct(bool, TraceSuperWord, false, \ "Trace superword transforms") \ \ @@ -590,9 +593,6 @@ develop(bool, PoisonOSREntry, true, \ "Detect abnormal calls to OSR code") \ \ - product(bool, UseCondCardMark, false, \ - "Check for already marked card before updating card table") \ - \ develop(bool, SoftMatchFailure, trueInProduct, \ "If the DFA fails to match a node, print a message and bail out") \ \ diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index 296d316b999..716bc339732 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -876,7 +876,8 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* // Parse::do_call()) target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass, target, receiver_type, is_virtual, - call_does_dispatch, vtable_index); // out-parameters + call_does_dispatch, vtable_index, // out-parameters + /*check_access=*/false); // We lack profiling at this call but type speculation may // provide us with a type speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL; diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index 48aab726417..e20d13a3262 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -73,16 +73,6 @@ Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape){ return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL; } -//------------------------------Ideal_DU_postCCP------------------------------- -// Throw away cast after constant propagation -Node *ConstraintCastNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { - const Type *t = ccp->type(in(1)); - ccp->hash_delete(this); - set_type(t); // Turn into ID function - ccp->hash_insert(this); - return this; -} - uint CastIINode::size_of() const { return sizeof(*this); } @@ -164,13 +154,6 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { return res; } -Node *CastIINode::Ideal_DU_postCCP(PhaseCCP *ccp) { - if (_carry_dependency) { - return NULL; - } - return ConstraintCastNode::Ideal_DU_postCCP(ccp); -} - #ifndef PRODUCT void CastIINode::dump_spec(outputStream *st) const { TypeNode::dump_spec(st); @@ -180,20 +163,6 @@ void CastIINode::dump_spec(outputStream *st) const { } #endif -//============================================================================= - -//------------------------------Ideal_DU_postCCP------------------------------- -// If not converting int->oop, throw away cast after constant propagation -Node *CastPPNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { - const Type *t = ccp->type(in(1)); - if (!t->isa_oop_ptr() || ((in(1)->is_DecodeN()) && Matcher::gen_narrow_oop_implicit_null_checks())) { - return NULL; // do not transform raw pointers or narrow oops - } - return ConstraintCastNode::Ideal_DU_postCCP(ccp); -} - - - //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. @@ -216,16 +185,13 @@ const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { const Type *result = _type; if( in_type != NULL && my_type != NULL ) { TypePtr::PTR in_ptr = in_type->ptr(); - if( in_ptr == TypePtr::Null ) { + if (in_ptr == TypePtr::Null) { result = in_type; - } else if( in_ptr == TypePtr::Constant ) { - // Casting a constant oop to an interface? - // (i.e., a String to a Comparable?) - // Then return the interface. + } else if (in_ptr == TypePtr::Constant) { const TypeOopPtr *jptr = my_type->isa_oopptr(); - assert( jptr, "" ); - result = (jptr->klass()->is_interface() || !in_type->higher_equal(_type)) - ? my_type->cast_to_ptr_type( TypePtr::NotNull ) + assert(jptr, ""); + result = !in_type->higher_equal(_type) + ? my_type->cast_to_ptr_type(TypePtr::NotNull) : in_type; } else { result = my_type->cast_to_ptr_type( my_type->join_ptr(in_ptr) ); diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 8b79562b045..535b0e6610b 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -42,7 +42,6 @@ class ConstraintCastNode: public TypeNode { virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int Opcode() const; virtual uint ideal_reg() const = 0; - virtual Node *Ideal_DU_postCCP( PhaseCCP * ); }; //------------------------------CastIINode------------------------------------- @@ -63,7 +62,6 @@ class CastIINode: public ConstraintCastNode { virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Identity( PhaseTransform *phase ); virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Ideal_DU_postCCP( PhaseCCP * ); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; #endif @@ -76,7 +74,6 @@ class CastPPNode: public ConstraintCastNode { CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } - virtual Node *Ideal_DU_postCCP( PhaseCCP * ); }; //------------------------------CheckCastPPNode-------------------------------- @@ -94,9 +91,6 @@ class CheckCastPPNode: public TypeNode { virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } - // No longer remove CheckCast after CCP as it gives me a place to hang - // the proper address type - which is required to compute anti-deps. - //virtual Node *Ideal_DU_postCCP( PhaseCCP * ); }; diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index f609cf4e8a9..fcb3fcd2c20 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -525,13 +525,16 @@ Node *RegionNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Cut the backedge input and remove phis since no data paths left. // We don't cut outputs to other nodes here since we need to put them // on the worklist. + PhaseIterGVN *igvn = phase->is_IterGVN(); + if (in(1)->outcnt() == 1) { + igvn->_worklist.push(in(1)); + } del_req(1); cnt = 0; assert( req() == 1, "no more inputs expected" ); uint max = outcnt(); bool progress = true; Node *top = phase->C->top(); - PhaseIterGVN *igvn = phase->is_IterGVN(); DUIterator j; while(progress) { progress = false; diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index fc3235afecd..7d851b564e0 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -263,6 +263,30 @@ class IfNode : public MultiBranchNode { // Size is bigger to hold the probability field. However, _prob does not // change the semantics so it does not appear in the hash & cmp functions. virtual uint size_of() const { return sizeof(*this); } + +private: + ProjNode* range_check_trap_proj(int& flip, Node*& l, Node*& r); + ProjNode* range_check_trap_proj() { + int flip_test = 0; + Node* l = NULL; + Node* r = NULL; + return range_check_trap_proj(flip_test, l, r); + } + + // Helper methods for fold_compares + bool cmpi_folds(PhaseIterGVN* igvn); + bool is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn); + bool has_shared_region(ProjNode* proj, ProjNode*& success, ProjNode*& fail); + bool has_only_uncommon_traps(ProjNode* proj, ProjNode*& success, ProjNode*& fail, PhaseIterGVN* igvn); + static void merge_uncommon_traps(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn); + static void improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGVN* igvn); + bool is_cmp_with_loadrange(ProjNode* proj); + bool is_null_check(ProjNode* proj, PhaseIterGVN* igvn); + bool is_side_effect_free_test(ProjNode* proj, PhaseIterGVN* igvn); + void reroute_side_effect_free_unc(ProjNode* proj, ProjNode* dom_proj, PhaseIterGVN* igvn); + ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call) const; + bool fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn); + public: // Degrees of branch prediction probability by order of magnitude: @@ -348,7 +372,7 @@ public: virtual const RegMask &out_RegMask() const; void dominated_by(Node* prev_dom, PhaseIterGVN* igvn); int is_range_check(Node* &range, Node* &index, jint &offset); - Node* fold_compares(PhaseGVN* phase); + Node* fold_compares(PhaseIterGVN* phase); static Node* up_one_dom(Node* curr, bool linear_only = false); // Takes the type of val and filters it through the test represented diff --git a/hotspot/src/share/vm/opto/chaitin.cpp b/hotspot/src/share/vm/opto/chaitin.cpp index d60790276fa..284e6d2ad31 100644 --- a/hotspot/src/share/vm/opto/chaitin.cpp +++ b/hotspot/src/share/vm/opto/chaitin.cpp @@ -2095,7 +2095,7 @@ static char *print_reg( OptoReg::Name reg, const PhaseChaitin *pc, char *buf ) { // Dump a register name into a buffer. Be intelligent if we get called // before allocation is complete. char *PhaseChaitin::dump_register( const Node *n, char *buf ) const { - if( !this ) { // Not got anything? + if( this == NULL ) { // Not got anything? sprintf(buf,"N%d",n->_idx); // Then use Node index } else if( _node_regs ) { // Post allocation, use direct mappings, no LRG info available diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index a810a0158a4..2af7200ecce 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -266,9 +266,13 @@ macro(Vector) macro(AddVB) macro(AddVS) macro(AddVI) +macro(AddReductionVI) macro(AddVL) +macro(AddReductionVL) macro(AddVF) +macro(AddReductionVF) macro(AddVD) +macro(AddReductionVD) macro(SubVB) macro(SubVS) macro(SubVI) @@ -277,8 +281,11 @@ macro(SubVF) macro(SubVD) macro(MulVS) macro(MulVI) +macro(MulReductionVI) macro(MulVF) +macro(MulReductionVF) macro(MulVD) +macro(MulReductionVD) macro(DivVF) macro(DivVD) macro(LShiftCntV) diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index bbdb43e72a1..df2074dd710 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -2811,9 +2811,38 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { break; } -#ifdef _LP64 - case Op_CastPP: - if (n->in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks()) { + case Op_CastPP: { + // Remove CastPP nodes to gain more freedom during scheduling but + // keep the dependency they encode as control or precedence edges + // (if control is set already) on memory operations. Some CastPP + // nodes don't have a control (don't carry a dependency): skip + // those. + if (n->in(0) != NULL) { + ResourceMark rm; + Unique_Node_List wq; + wq.push(n); + for (uint next = 0; next < wq.size(); ++next) { + Node *m = wq.at(next); + for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) { + Node* use = m->fast_out(i); + if (use->is_Mem() || use->is_EncodeNarrowPtr()) { + use->ensure_control_or_add_prec(n->in(0)); + } else if (use->in(0) == NULL) { + switch(use->Opcode()) { + case Op_AddP: + case Op_DecodeN: + case Op_DecodeNKlass: + case Op_CheckCastPP: + case Op_CastPP: + wq.push(use); + break; + } + } + } + } + } + const bool is_LP64 = LP64_ONLY(true) NOT_LP64(false); + if (is_LP64 && n->in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks()) { Node* in1 = n->in(1); const Type* t = n->bottom_type(); Node* new_in1 = in1->clone(); @@ -2846,9 +2875,15 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { if (in1->outcnt() == 0) { in1->disconnect_inputs(NULL, this); } + } else { + n->subsume_by(n->in(1), this); + if (n->outcnt() == 0) { + n->disconnect_inputs(NULL, this); + } } break; - + } +#ifdef _LP64 case Op_CmpP: // Do this transformation here to preserve CmpPNode::sub() and // other TypePtr related Ideal optimizations (for example, ptr nullness). @@ -3049,6 +3084,15 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { case Op_StoreVector: break; + case Op_AddReductionVI: + case Op_AddReductionVL: + case Op_AddReductionVF: + case Op_AddReductionVD: + case Op_MulReductionVI: + case Op_MulReductionVF: + case Op_MulReductionVD: + break; + case Op_PackB: case Op_PackS: case Op_PackI: diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 2b9c3346997..0aa2dbdd991 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -879,9 +879,11 @@ class Compile : public Phase { ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass, ciKlass* holder, ciMethod* callee, const TypeOopPtr* receiver_type, bool is_virtual, - bool &call_does_dispatch, int &vtable_index); + bool &call_does_dispatch, int &vtable_index, + bool check_access = true); ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, - ciMethod* callee, const TypeOopPtr* receiver_type); + ciMethod* callee, const TypeOopPtr* receiver_type, + bool check_access = true); // Report if there were too many traps at a current method and bci. // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded. diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index 1697d7ee29e..3caa4332d6e 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -959,13 +959,15 @@ void Parse::count_compiled_calls(bool at_method_entry, bool is_inline) { ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass, ciKlass* holder, ciMethod* callee, const TypeOopPtr* receiver_type, bool is_virtual, - bool& call_does_dispatch, int& vtable_index) { + bool& call_does_dispatch, int& vtable_index, + bool check_access) { // Set default values for out-parameters. call_does_dispatch = true; vtable_index = Method::invalid_vtable_index; // Choose call strategy. - ciMethod* optimized_virtual_method = optimize_inlining(caller, bci, klass, callee, receiver_type); + ciMethod* optimized_virtual_method = optimize_inlining(caller, bci, klass, callee, + receiver_type, check_access); // Have the call been sufficiently improved such that it is no longer a virtual? if (optimized_virtual_method != NULL) { @@ -980,7 +982,8 @@ ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKl // Identify possible target method and inlining style ciMethod* Compile::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, - ciMethod* callee, const TypeOopPtr* receiver_type) { + ciMethod* callee, const TypeOopPtr* receiver_type, + bool check_access) { // only use for virtual or interface calls // If it is obviously final, do not bother to call find_monomorphic_target, @@ -1020,7 +1023,7 @@ ciMethod* Compile::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* } ciInstanceKlass* calling_klass = caller->holder(); - ciMethod* cha_monomorphic_target = callee->find_monomorphic_target(calling_klass, klass, actual_receiver); + ciMethod* cha_monomorphic_target = callee->find_monomorphic_target(calling_klass, klass, actual_receiver, check_access); if (cha_monomorphic_target != NULL) { assert(!cha_monomorphic_target->is_abstract(), ""); // Look at the method-receiver type. Does it add "too much information"? diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 0486bf6885b..4dab736ac91 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -100,6 +100,9 @@ void PhaseCFG::replace_block_proj_ctrl( Node *n ) { } } +static bool is_dominator(Block* d, Block* n) { + return d->dom_lca(n) == d; +} //------------------------------schedule_pinned_nodes-------------------------- // Set the basic block for Nodes pinned into blocks @@ -122,6 +125,42 @@ void PhaseCFG::schedule_pinned_nodes(VectorSet &visited) { schedule_node_into_block(node, block); } + // If the node has precedence edges (added when CastPP nodes are + // removed in final_graph_reshaping), fix the control of the + // node to cover the precedence edges and remove the + // dependencies. + Node* n = NULL; + for (uint i = node->len()-1; i >= node->req(); i--) { + Node* m = node->in(i); + if (m == NULL) continue; + // Skip the precedence edge if the test that guarded a CastPP: + // - was optimized out during escape analysis + // (OptimizePtrCompare): the CastPP's control isn't an end of + // block. + // - is moved in the branch of a dominating If: the control of + // the CastPP is then a Region. + if (m->is_block_proj() || m->is_block_start()) { + node->rm_prec(i); + if (n == NULL) { + n = m; + } else { + Block* bn = get_block_for_node(n); + Block* bm = get_block_for_node(m); + assert(is_dominator(bn, bm) || is_dominator(bm, bn), "one must dominate the other"); + n = is_dominator(bn, bm) ? m : n; + } + } + } + if (n != NULL) { + assert(node->in(0), "control should have been set"); + Block* bn = get_block_for_node(n); + Block* bnode = get_block_for_node(node->in(0)); + assert(is_dominator(bn, bnode) || is_dominator(bnode, bn), "one must dominate the other"); + if (!is_dominator(bn, bnode)) { + node->set_req(0, n); + } + } + // process all inputs that are non NULL for (int i = node->req() - 1; i >= 0; --i) { if (node->in(i) != NULL) { diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index a08b6da108d..26d24e3560b 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -2530,6 +2530,11 @@ static IfNode* gen_subtype_check_compare(Node* ctrl, Node* in1, Node* in2, BoolT // prior to coming here. Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, MergeMemNode* mem, PhaseGVN* gvn) { Compile* C = gvn->C; + + if ((*ctrl)->is_top()) { + return C->top(); + } + // Fast check for identical types, perhaps identical constants. // The types can even be identical non-constants, in cases // involving Array.newInstance, Object.clone, etc. @@ -2792,18 +2797,19 @@ Node* GraphKit::maybe_cast_profiled_receiver(Node* not_null_obj, */ Node* GraphKit::maybe_cast_profiled_obj(Node* obj, ciKlass* type, - bool not_null, - SafePointNode* sfpt) { + bool not_null) { + if (stopped()) { + return obj; + } + // type == NULL if profiling tells us this object is always null if (type != NULL) { Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check; Deoptimization::DeoptReason null_reason = Deoptimization::Reason_speculate_null_check; - ciMethod* trap_method = (sfpt == NULL) ? method() : sfpt->jvms()->method(); - int trap_bci = (sfpt == NULL) ? bci() : sfpt->jvms()->bci(); if (!too_many_traps(null_reason) && !too_many_recompiles(null_reason) && - !C->too_many_traps(trap_method, trap_bci, class_reason) && - !C->too_many_recompiles(trap_method, trap_bci, class_reason)) { + !too_many_traps(class_reason) && + !too_many_recompiles(class_reason)) { 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 @@ -2819,12 +2825,7 @@ Node* GraphKit::maybe_cast_profiled_obj(Node* obj, ciKlass* exact_kls = type; Node* slow_ctl = type_check_receiver(exact_obj, exact_kls, 1.0, &exact_obj); - if (sfpt != NULL) { - GraphKit kit(sfpt->jvms()); - PreserveJVMState pjvms(&kit); - kit.set_control(slow_ctl); - kit.uncommon_trap_exact(class_reason, Deoptimization::Action_maybe_recompile); - } else { + { PreserveJVMState pjvms(this); set_control(slow_ctl); uncommon_trap_exact(class_reason, Deoptimization::Action_maybe_recompile); diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 094a6834e37..ce0178d6a5a 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -409,8 +409,7 @@ class GraphKit : public Phase { // 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, - SafePointNode* sfpt = NULL); + bool not_null = false); // Cast obj to not-null on this path Node* cast_not_null(Node* obj, bool do_replace_in_map = true); diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 0b5b261e577..126b2f48dc7 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -25,11 +25,13 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/loopnode.hpp" #include "opto/phaseX.hpp" #include "opto/runtime.hpp" +#include "opto/rootnode.hpp" #include "opto/subnode.hpp" // Portions of code courtesy of Clifford Click @@ -232,16 +234,24 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) { // Make a region merging constants and a region merging the rest uint req_c = 0; Node* predicate_proj = NULL; + int nb_predicate_proj = 0; for (uint ii = 1; ii < r->req(); ii++) { if (phi->in(ii) == con1) { req_c++; } Node* proj = PhaseIdealLoop::find_predicate(r->in(ii)); if (proj != NULL) { - assert(predicate_proj == NULL, "only one predicate entry expected"); + nb_predicate_proj++; predicate_proj = proj; } } + if (nb_predicate_proj > 1) { + // Can happen in case of loop unswitching and when the loop is + // optimized out: it's not a loop anymore so we don't care about + // predicates. + assert(!r->is_Loop(), "this must not be a loop anymore"); + predicate_proj = NULL; + } Node* predicate_c = NULL; Node* predicate_x = NULL; bool counted_loop = r->is_CountedLoop(); @@ -449,62 +459,59 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) { return new ConINode(TypeInt::ZERO); } -//------------------------------is_range_check--------------------------------- -// Return 0 if not a range check. Return 1 if a range check and set index and -// offset. Return 2 if we had to negate the test. Index is NULL if the check -// is versus a constant. -int IfNode::is_range_check(Node* &range, Node* &index, jint &offset) { +// if this IfNode follows a range check pattern return the projection +// for the failed path +ProjNode* IfNode::range_check_trap_proj(int& flip_test, Node*& l, Node*& r) { Node* b = in(1); - if (b == NULL || !b->is_Bool()) return 0; + if (b == NULL || !b->is_Bool()) return NULL; BoolNode* bn = b->as_Bool(); Node* cmp = bn->in(1); - if (cmp == NULL) return 0; - if (cmp->Opcode() != Op_CmpU) return 0; + if (cmp == NULL) return NULL; + if (cmp->Opcode() != Op_CmpU) return NULL; - Node* l = cmp->in(1); - Node* r = cmp->in(2); - int flip_test = 1; + l = cmp->in(1); + r = cmp->in(2); + flip_test = 1; if (bn->_test._test == BoolTest::le) { l = cmp->in(2); r = cmp->in(1); flip_test = 2; } else if (bn->_test._test != BoolTest::lt) { - return 0; + return NULL; } - if (l->is_top()) return 0; // Top input means dead test - if (r->Opcode() != Op_LoadRange) return 0; + if (l->is_top()) return NULL; // Top input means dead test + if (r->Opcode() != Op_LoadRange) return NULL; // We have recognized one of these forms: // Flip 1: If (Bool[<] CmpU(l, LoadRange)) ... // Flip 2: If (Bool[<=] CmpU(LoadRange, l)) ... + ProjNode* iftrap = proj_out(flip_test == 2 ? true : false); + return iftrap; +} + + +//------------------------------is_range_check--------------------------------- +// Return 0 if not a range check. Return 1 if a range check and set index and +// offset. Return 2 if we had to negate the test. Index is NULL if the check +// is versus a constant. +int IfNode::is_range_check(Node* &range, Node* &index, jint &offset) { + int flip_test = 0; + Node* l = NULL; + Node* r = NULL; + ProjNode* iftrap = range_check_trap_proj(flip_test, l, r); + + if (iftrap == NULL) { + return 0; + } + // Make sure it's a real range check by requiring an uncommon trap // along the OOB path. Otherwise, it's possible that the user wrote // something which optimized to look like a range check but behaves // in some other way. - Node* iftrap = proj_out(flip_test == 2 ? true : false); - bool found_trap = false; - if (iftrap != NULL) { - Node* u = iftrap->unique_ctrl_out(); - if (u != NULL) { - // It could be a merge point (Region) for uncommon trap. - if (u->is_Region()) { - Node* c = u->unique_ctrl_out(); - if (c != NULL) { - iftrap = u; - u = c; - } - } - if (u->in(0) == iftrap && u->is_CallStaticJava()) { - int req = u->as_CallStaticJava()->uncommon_trap_request(); - if (Deoptimization::trap_request_reason(req) == - Deoptimization::Reason_range_check) { - found_trap = true; - } - } - } + if (iftrap->is_uncommon_trap_proj(Deoptimization::Reason_range_check) == NULL) { + return 0; } - if (!found_trap) return 0; // sorry, no cigar // Look for index+offset form Node* ind = l; @@ -664,11 +671,12 @@ const TypeInt* IfNode::filtered_int_type(PhaseGVN* gvn, Node *val, Node* if_proj //------------------------------fold_compares---------------------------- // See if a pair of CmpIs can be converted into a CmpU. In some cases // the direction of this if is determined by the preceding if so it -// can be eliminate entirely. Given an if testing (CmpI n c) check -// for an immediately control dependent if that is testing (CmpI n c2) -// and has one projection leading to this if and the other projection -// leading to a region that merges one of this ifs control -// projections. +// can be eliminate entirely. +// +// Given an if testing (CmpI n v) check for an immediately control +// dependent if that is testing (CmpI n v2) and has one projection +// leading to this if and the other projection leading to a region +// that merges one of this ifs control projections. // // If // / | @@ -680,79 +688,458 @@ const TypeInt* IfNode::filtered_int_type(PhaseGVN* gvn, Node *val, Node* if_proj // / \ | // / Region // -Node* IfNode::fold_compares(PhaseGVN* phase) { +// Or given an if testing (CmpI n v) check for a dominating if that is +// testing (CmpI n v2), both having one projection leading to an +// uncommon trap. Allow Another independent guard in between to cover +// an explicit range check: +// if (index < 0 || index >= array.length) { +// which may need a null check to guard the LoadRange +// +// If +// / \ +// / \ +// / \ +// If unc +// /\ +// / \ +// / \ +// / unc +// + +// Is the comparison for this If suitable for folding? +bool IfNode::cmpi_folds(PhaseIterGVN* igvn) { + return in(1) != NULL && + in(1)->is_Bool() && + in(1)->in(1) != NULL && + in(1)->in(1)->Opcode() == Op_CmpI && + in(1)->in(1)->in(2) != NULL && + in(1)->in(1)->in(2) != igvn->C->top() && + (in(1)->as_Bool()->_test.is_less() || + in(1)->as_Bool()->_test.is_greater()); +} + +// Is a dominating control suitable for folding with this if? +bool IfNode::is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn) { + return ctrl != NULL && + ctrl->is_Proj() && + ctrl->in(0) != NULL && + ctrl->in(0)->is_If() && + ctrl->in(0)->outcnt() == 2 && + ctrl->in(0)->as_If()->cmpi_folds(igvn) && + // Must compare same value + ctrl->in(0)->in(1)->in(1)->in(1) != NULL && + ctrl->in(0)->in(1)->in(1)->in(1) == in(1)->in(1)->in(1); +} + +// Do this If and the dominating If share a region? +bool IfNode::has_shared_region(ProjNode* proj, ProjNode*& success, ProjNode*& fail) { + ProjNode* otherproj = proj->other_if_proj(); + Node* otherproj_ctrl_use = otherproj->unique_ctrl_out(); + RegionNode* region = (otherproj_ctrl_use != NULL && otherproj_ctrl_use->is_Region()) ? otherproj_ctrl_use->as_Region() : NULL; + success = NULL; + fail = NULL; + + if (otherproj->outcnt() == 1 && region != NULL && !region->has_phi()) { + for (int i = 0; i < 2; i++) { + ProjNode* proj = proj_out(i); + if (success == NULL && proj->outcnt() == 1 && proj->unique_out() == region) { + success = proj; + } else if (fail == NULL) { + fail = proj; + } else { + success = fail = NULL; + } + } + } + return success != NULL && fail != NULL; +} + +// Return projection that leads to an uncommon trap if any +ProjNode* IfNode::uncommon_trap_proj(CallStaticJavaNode*& call) const { + for (int i = 0; i < 2; i++) { + call = proj_out(i)->is_uncommon_trap_proj(Deoptimization::Reason_none); + if (call != NULL) { + return proj_out(i); + } + } + return NULL; +} + +// Do this If and the dominating If both branch out to an uncommon trap +bool IfNode::has_only_uncommon_traps(ProjNode* proj, ProjNode*& success, ProjNode*& fail, PhaseIterGVN* igvn) { + ProjNode* otherproj = proj->other_if_proj(); + CallStaticJavaNode* dom_unc = otherproj->is_uncommon_trap_proj(Deoptimization::Reason_none); + + if (otherproj->outcnt() == 1 && dom_unc != NULL) { + CallStaticJavaNode* unc = NULL; + ProjNode* unc_proj = uncommon_trap_proj(unc); + if (unc_proj != NULL && unc_proj->outcnt() == 1) { + if (dom_unc == unc) { + // Allow the uncommon trap to be shared through a region + RegionNode* r = unc->in(0)->as_Region(); + if (r->outcnt() != 2 || r->req() != 3 || r->find_edge(otherproj) == -1 || r->find_edge(unc_proj) == -1) { + return false; + } + assert(r->has_phi() == NULL, "simple region shouldn't have a phi"); + } else if (dom_unc->in(0) != otherproj || unc->in(0) != unc_proj) { + return false; + } + // See merge_uncommon_traps: the reason of the uncommon trap + // will be changed and the state of the dominating If will be + // used. Checked that we didn't apply this transformation in a + // previous compilation and it didn't cause too many traps + if (!igvn->C->too_many_traps(dom_unc->jvms()->method(), dom_unc->jvms()->bci(), Deoptimization::Reason_unstable_fused_if) && + !igvn->C->too_many_traps(dom_unc->jvms()->method(), dom_unc->jvms()->bci(), Deoptimization::Reason_range_check)) { + success = unc_proj; + fail = unc_proj->other_if_proj(); + return true; + } + } + } + return false; +} + +// Check that the 2 CmpI can be folded into as single CmpU and proceed with the folding +bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn) { + Node* this_cmp = in(1)->in(1); + BoolNode* this_bool = in(1)->as_Bool(); + IfNode* dom_iff = proj->in(0)->as_If(); + BoolNode* dom_bool = dom_iff->in(1)->as_Bool(); + Node* lo = dom_iff->in(1)->in(1)->in(2); + Node* hi = this_cmp->in(2); + Node* n = this_cmp->in(1); + ProjNode* otherproj = proj->other_if_proj(); + + const TypeInt* lo_type = IfNode::filtered_int_type(igvn, n, otherproj); + const TypeInt* hi_type = IfNode::filtered_int_type(igvn, n, success); + + BoolTest::mask lo_test = dom_bool->_test._test; + BoolTest::mask hi_test = this_bool->_test._test; + BoolTest::mask cond = hi_test; + + // Figure out which of the two tests sets the upper bound and which + // sets the lower bound if any. + if (hi_type->_lo > lo_type->_hi && hi_type->_hi == max_jint && lo_type->_lo == min_jint) { + + assert((dom_bool->_test.is_less() && !proj->_con) || + (dom_bool->_test.is_greater() && proj->_con), "incorrect test"); + // this test was canonicalized + assert(this_bool->_test.is_less() && fail->_con, "incorrect test"); + + if (lo_test == BoolTest::gt || lo_test == BoolTest::le) { + lo = igvn->transform(new AddINode(lo, igvn->intcon(1))); + } + } else if (lo_type->_lo > hi_type->_hi && lo_type->_hi == max_jint && hi_type->_lo == min_jint) { + swap(lo, hi); + swap(lo_type, hi_type); + swap(lo_test, hi_test); + + assert((this_bool->_test.is_less() && proj->_con) || + (this_bool->_test.is_greater() && !proj->_con), "incorrect test"); + // this test was canonicalized + assert(dom_bool->_test.is_less() && !fail->_con, "incorrect test"); + + cond = (hi_test == BoolTest::le || hi_test == BoolTest::gt) ? BoolTest::gt : BoolTest::ge; + + if (lo_test == BoolTest::le) { + lo = igvn->transform(new AddINode(lo, igvn->intcon(1))); + } + + } else { + const TypeInt* failtype = filtered_int_type(igvn, n, proj); + if (failtype != NULL) { + const TypeInt* type2 = filtered_int_type(igvn, n, fail); + if (type2 != NULL) { + failtype = failtype->join(type2)->is_int(); + if (failtype->_lo > failtype->_hi) { + // previous if determines the result of this if so + // replace Bool with constant + igvn->hash_delete(this); + set_req(1, igvn->intcon(success->_con)); + return true; + } + } + } + + lo = NULL; + hi = NULL; + } + + if (lo && hi) { + // Merge the two compares into a single unsigned compare by building (CmpU (n - lo) (hi - lo)) + Node* adjusted_val = igvn->transform(new SubINode(n, lo)); + Node* adjusted_lim = igvn->transform(new SubINode(hi, lo)); + Node* newcmp = igvn->transform(new CmpUNode(adjusted_val, adjusted_lim)); + Node* newbool = igvn->transform(new BoolNode(newcmp, cond)); + + igvn->is_IterGVN()->replace_input_of(dom_iff, 1, igvn->intcon(proj->_con)); + igvn->hash_delete(this); + set_req(1, newbool); + + return true; + } + return false; +} + +// Merge the branches that trap for this If and the dominating If into +// a single region that branches to the uncommon trap for the +// dominating If +void IfNode::merge_uncommon_traps(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn) { + ProjNode* otherproj = proj->other_if_proj(); + + CallStaticJavaNode* unc = success->is_uncommon_trap_proj(Deoptimization::Reason_none); + CallStaticJavaNode* dom_unc = otherproj->is_uncommon_trap_proj(Deoptimization::Reason_none); + + if (unc != dom_unc) { + Node* r = new RegionNode(3); + + r->set_req(1, otherproj); + r->set_req(2, success); + r = igvn->transform(r); + assert(r->is_Region(), "can't go away"); + + // Make both If trap at the state of the first If: once the CmpI + // nodes are merged, if we trap we don't know which of the CmpI + // nodes would have caused the trap so we have to restart + // execution at the first one + igvn->replace_input_of(dom_unc, 0, r); + igvn->replace_input_of(unc, 0, igvn->C->top()); + } + int trap_request = dom_unc->uncommon_trap_request(); + Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request); + Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request); + + int flip_test = 0; + Node* l = NULL; + Node* r = NULL; + + if (success->in(0)->as_If()->range_check_trap_proj(flip_test, l, r) != NULL) { + // If this looks like a range check, change the trap to + // Reason_range_check so the compiler recognizes it as a range + // check and applies the corresponding optimizations + trap_request = Deoptimization::make_trap_request(Deoptimization::Reason_range_check, action); + + improve_address_types(l, r, fail, igvn); + } else if (unc != dom_unc) { + // If we trap we won't know what CmpI would have caused the trap + // so use a special trap reason to mark this pair of CmpI nodes as + // bad candidate for folding. On recompilation we won't fold them + // and we may trap again but this time we'll know what branch + // traps + trap_request = Deoptimization::make_trap_request(Deoptimization::Reason_unstable_fused_if, action); + } + igvn->replace_input_of(dom_unc, TypeFunc::Parms, igvn->intcon(trap_request)); +} + +// If we are turning 2 CmpI nodes into a CmpU that follows the pattern +// of a rangecheck on index i, on 64 bit the compares may be followed +// by memory accesses using i as index. In that case, the CmpU tells +// us something about the values taken by i that can help the compiler +// (see Compile::conv_I2X_index()) +void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGVN* igvn) { +#ifdef _LP64 + ResourceMark rm; + Node_Stack stack(2); + + assert(r->Opcode() == Op_LoadRange, "unexpected range check"); + const TypeInt* array_size = igvn->type(r)->is_int(); + + stack.push(l, 0); + + while(stack.size() > 0) { + Node* n = stack.node(); + uint start = stack.index(); + + uint i = start; + for (; i < n->outcnt(); i++) { + Node* use = n->raw_out(i); + if (stack.size() == 1) { + if (use->Opcode() == Op_ConvI2L) { + const TypeLong* bounds = use->as_Type()->type()->is_long(); + if (bounds->_lo <= array_size->_lo && bounds->_hi >= array_size->_hi && + (bounds->_lo != array_size->_lo || bounds->_hi != array_size->_hi)) { + stack.set_index(i+1); + stack.push(use, 0); + break; + } + } + } else if (use->is_Mem()) { + Node* ctrl = use->in(0); + for (int i = 0; i < 10 && ctrl != NULL && ctrl != fail; i++) { + ctrl = up_one_dom(ctrl); + } + if (ctrl == fail) { + Node* init_n = stack.node_at(1); + assert(init_n->Opcode() == Op_ConvI2L, "unexpected first node"); + Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size); + + for (uint j = 2; j < stack.size(); j++) { + Node* n = stack.node_at(j); + Node* clone = n->clone(); + int rep = clone->replace_edge(init_n, new_n); + assert(rep > 0, "can't find expected node?"); + clone = igvn->transform(clone); + init_n = n; + new_n = clone; + } + igvn->hash_delete(use); + int rep = use->replace_edge(init_n, new_n); + assert(rep > 0, "can't find expected node?"); + igvn->transform(use); + if (init_n->outcnt() == 0) { + igvn->_worklist.push(init_n); + } + } + } else if (use->in(0) == NULL && (igvn->type(use)->isa_long() || + igvn->type(use)->isa_ptr())) { + stack.set_index(i+1); + stack.push(use, 0); + break; + } + } + if (i == n->outcnt()) { + stack.pop(); + } + } +#endif +} + +bool IfNode::is_cmp_with_loadrange(ProjNode* proj) { + if (in(1) != NULL && + in(1)->in(1) != NULL && + in(1)->in(1)->in(2) != NULL) { + Node* other = in(1)->in(1)->in(2); + if (other->Opcode() == Op_LoadRange && + ((other->in(0) != NULL && other->in(0) == proj) || + (other->in(0) == NULL && + other->in(2) != NULL && + other->in(2)->is_AddP() && + other->in(2)->in(1) != NULL && + other->in(2)->in(1)->Opcode() == Op_CastPP && + other->in(2)->in(1)->in(0) == proj))) { + return true; + } + } + return false; +} + +bool IfNode::is_null_check(ProjNode* proj, PhaseIterGVN* igvn) { + Node* other = in(1)->in(1)->in(2); + if (other->in(MemNode::Address) != NULL && + proj->in(0)->in(1) != NULL && + proj->in(0)->in(1)->is_Bool() && + proj->in(0)->in(1)->in(1) != NULL && + proj->in(0)->in(1)->in(1)->Opcode() == Op_CmpP && + proj->in(0)->in(1)->in(1)->in(2) != NULL && + proj->in(0)->in(1)->in(1)->in(1) == other->in(MemNode::Address)->in(AddPNode::Address)->uncast() && + igvn->type(proj->in(0)->in(1)->in(1)->in(2)) == TypePtr::NULL_PTR) { + return true; + } + return false; +} + +// Check that the If that is in between the 2 integer comparisons has +// no side effect +bool IfNode::is_side_effect_free_test(ProjNode* proj, PhaseIterGVN* igvn) { + if (proj != NULL && + proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) && + proj->outcnt() <= 2) { + if (proj->outcnt() == 1 || + // Allow simple null check from LoadRange + (is_cmp_with_loadrange(proj) && is_null_check(proj, igvn))) { + CallStaticJavaNode* unc = proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + CallStaticJavaNode* dom_unc = proj->in(0)->in(0)->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + + // reroute_side_effect_free_unc changes the state of this + // uncommon trap to restart execution at the previous + // CmpI. Check that this change in a previous compilation didn't + // cause too many traps. + int trap_request = unc->uncommon_trap_request(); + Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request); + + if (igvn->C->too_many_traps(dom_unc->jvms()->method(), dom_unc->jvms()->bci(), reason)) { + return false; + } + + return true; + } + } + return false; +} + +// Make the If between the 2 integer comparisons trap at the state of +// the first If: the last CmpI is the one replaced by a CmpU and the +// first CmpI is eliminated, so the test between the 2 CmpI nodes +// won't be guarded by the first CmpI anymore. It can trap in cases +// where the first CmpI would have prevented it from executing: on a +// trap, we need to restart execution at the state of the first CmpI +void IfNode::reroute_side_effect_free_unc(ProjNode* proj, ProjNode* dom_proj, PhaseIterGVN* igvn) { + CallStaticJavaNode* dom_unc = dom_proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + ProjNode* otherproj = proj->other_if_proj(); + CallStaticJavaNode* unc = proj->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + Node* call_proj = dom_unc->unique_ctrl_out(); + Node* halt = call_proj->unique_ctrl_out(); + + Node* new_unc = dom_unc->clone(); + call_proj = call_proj->clone(); + halt = halt->clone(); + Node* c = otherproj->clone(); + + c = igvn->transform(c); + new_unc->set_req(TypeFunc::Parms, unc->in(TypeFunc::Parms)); + new_unc->set_req(0, c); + new_unc = igvn->transform(new_unc); + call_proj->set_req(0, new_unc); + call_proj = igvn->transform(call_proj); + halt->set_req(0, call_proj); + halt = igvn->transform(halt); + + igvn->replace_node(otherproj, igvn->C->top()); + igvn->C->root()->add_req(halt); +} + +Node* IfNode::fold_compares(PhaseIterGVN* igvn) { if (Opcode() != Op_If) return NULL; - Node* this_cmp = in(1)->in(1); - if (this_cmp != NULL && this_cmp->Opcode() == Op_CmpI && - this_cmp->in(2)->is_Con() && this_cmp->in(2) != phase->C->top()) { + if (cmpi_folds(igvn)) { Node* ctrl = in(0); - BoolNode* this_bool = in(1)->as_Bool(); - Node* n = this_cmp->in(1); - int hi = this_cmp->in(2)->get_int(); - if (ctrl != NULL && ctrl->is_Proj() && ctrl->outcnt() == 1 && - ctrl->in(0)->is_If() && - ctrl->in(0)->outcnt() == 2 && - 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); - if (otherproj->outcnt() == 1 && otherproj->unique_out()->is_Region() && - this_bool->_test._test != BoolTest::ne && this_bool->_test._test != BoolTest::eq) { - // Identify which proj goes to the region and which continues on - RegionNode* region = otherproj->unique_out()->as_Region(); - Node* success = NULL; - Node* fail = NULL; - for (int i = 0; i < 2; i++) { - Node* proj = proj_out(i); - if (success == NULL && proj->outcnt() == 1 && proj->unique_out() == region) { - success = proj; - } else if (fail == NULL) { - fail = proj; - } else { - success = fail = NULL; - } - } - if (success != NULL && fail != NULL && !region->has_phi()) { - int lo = dom_iff->in(1)->in(1)->in(2)->get_int(); - BoolNode* dom_bool = dom_iff->in(1)->as_Bool(); - Node* dom_cmp = dom_bool->in(1); - const TypeInt* failtype = filtered_int_type(phase, n, ctrl); - if (failtype != NULL) { - const TypeInt* type2 = filtered_int_type(phase, n, fail); - if (type2 != NULL) { - failtype = failtype->join(type2)->is_int(); - } else { - failtype = NULL; - } - } + if (is_ctrl_folds(ctrl, igvn) && + ctrl->outcnt() == 1) { + // A integer comparison immediately dominated by another integer + // comparison + ProjNode* success = NULL; + ProjNode* fail = NULL; + ProjNode* dom_cmp = ctrl->as_Proj(); + if (has_shared_region(dom_cmp, success, fail) && + // Next call modifies graph so must be last + fold_compares_helper(dom_cmp, success, fail, igvn)) { + return this; + } + if (has_only_uncommon_traps(dom_cmp, success, fail, igvn) && + // Next call modifies graph so must be last + fold_compares_helper(dom_cmp, success, fail, igvn)) { + merge_uncommon_traps(dom_cmp, success, fail, igvn); + return this; + } + return NULL; + } else if (ctrl->in(0) != NULL && + ctrl->in(0)->in(0) != NULL) { + ProjNode* success = NULL; + ProjNode* fail = NULL; + Node* dom = ctrl->in(0)->in(0); + ProjNode* dom_cmp = dom->isa_Proj(); + ProjNode* other_cmp = ctrl->isa_Proj(); - if (failtype != NULL && - dom_bool->_test._test != BoolTest::ne && dom_bool->_test._test != BoolTest::eq) { - int bound = failtype->_hi - failtype->_lo + 1; - if (failtype->_hi != max_jint && failtype->_lo != min_jint && bound > 1) { - // Merge the two compares into a single unsigned compare by building (CmpU (n - lo) hi) - BoolTest::mask cond = fail->as_Proj()->_con ? BoolTest::lt : BoolTest::ge; - Node* adjusted = phase->transform(new SubINode(n, phase->intcon(failtype->_lo))); - Node* newcmp = phase->transform(new CmpUNode(adjusted, phase->intcon(bound))); - Node* newbool = phase->transform(new BoolNode(newcmp, cond)); - phase->is_IterGVN()->replace_input_of(dom_iff, 1, phase->intcon(ctrl->as_Proj()->_con)); - phase->hash_delete(this); - set_req(1, newbool); - return this; - } - if (failtype->_lo > failtype->_hi) { - // previous if determines the result of this if so - // replace Bool with constant - phase->hash_delete(this); - set_req(1, phase->intcon(success->as_Proj()->_con)); - return this; - } - } - } + // Check if it's an integer comparison dominated by another + // integer comparison with another test in between + if (is_ctrl_folds(dom, igvn) && + has_only_uncommon_traps(dom_cmp, success, fail, igvn) && + is_side_effect_free_test(other_cmp, igvn) && + // Next call modifies graph so must be last + fold_compares_helper(dom_cmp, success, fail, igvn)) { + reroute_side_effect_free_unc(other_cmp, dom_cmp, igvn); + merge_uncommon_traps(dom_cmp, success, fail, igvn); + return this; } } } @@ -1029,7 +1416,7 @@ Node *IfNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Normal equivalent-test check. if( !dom ) return NULL; // Dead loop? - Node* result = fold_compares(phase); + Node* result = fold_compares(igvn); if (result != NULL) { return result; } @@ -1089,7 +1476,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 (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate)) + if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL) prev_dom = idom; // Now walk the current IfNode's projections. diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index e1fc843af61..62ae310cc52 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -262,6 +262,9 @@ class LibraryCallKit : public GraphKit { bool inline_arraycopy(); AllocateArrayNode* tightly_coupled_allocation(Node* ptr, RegionNode* slow_region); + JVMState* arraycopy_restore_alloc_state(AllocateArrayNode* alloc, int& saved_reexecute_sp); + void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp); + typedef enum { LS_xadd, LS_xchg, LS_cmpxchg } LoadStoreKind; bool inline_unsafe_load_store(BasicType type, LoadStoreKind kind); bool inline_unsafe_ordered_store(BasicType type); @@ -290,6 +293,7 @@ class LibraryCallKit : public GraphKit { bool inline_multiplyToLen(); bool inline_profileBoolean(); + bool inline_isCompileConstant(); }; @@ -549,6 +553,17 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { if (!Matcher::match_rule_supported(Op_OverflowMulL) || !UseMathExactIntrinsics) return NULL; break; + case vmIntrinsics::_getShortUnaligned: + case vmIntrinsics::_getCharUnaligned: + case vmIntrinsics::_getIntUnaligned: + case vmIntrinsics::_getLongUnaligned: + case vmIntrinsics::_putShortUnaligned: + case vmIntrinsics::_putCharUnaligned: + case vmIntrinsics::_putIntUnaligned: + case vmIntrinsics::_putLongUnaligned: + if (!UseUnalignedAccesses) return NULL; + break; + default: assert(id <= vmIntrinsics::LAST_COMPILER_INLINE, "caller responsibility"); assert(id != vmIntrinsics::_Object_init && id != vmIntrinsics::_invoke, "enum out of order?"); @@ -799,6 +814,16 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_putFloatVolatile: return inline_unsafe_access(!is_native_ptr, is_store, T_FLOAT, is_volatile); case vmIntrinsics::_putDoubleVolatile: return inline_unsafe_access(!is_native_ptr, is_store, T_DOUBLE, is_volatile); + case vmIntrinsics::_getShortUnaligned: return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT, !is_volatile); + case vmIntrinsics::_getCharUnaligned: return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR, !is_volatile); + case vmIntrinsics::_getIntUnaligned: return inline_unsafe_access(!is_native_ptr, !is_store, T_INT, !is_volatile); + case vmIntrinsics::_getLongUnaligned: return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG, !is_volatile); + + case vmIntrinsics::_putShortUnaligned: return inline_unsafe_access(!is_native_ptr, is_store, T_SHORT, !is_volatile); + case vmIntrinsics::_putCharUnaligned: return inline_unsafe_access(!is_native_ptr, is_store, T_CHAR, !is_volatile); + case vmIntrinsics::_putIntUnaligned: return inline_unsafe_access(!is_native_ptr, is_store, T_INT, !is_volatile); + case vmIntrinsics::_putLongUnaligned: return inline_unsafe_access(!is_native_ptr, is_store, T_LONG, !is_volatile); + case vmIntrinsics::_compareAndSwapObject: return inline_unsafe_load_store(T_OBJECT, LS_cmpxchg); case vmIntrinsics::_compareAndSwapInt: return inline_unsafe_load_store(T_INT, LS_cmpxchg); case vmIntrinsics::_compareAndSwapLong: return inline_unsafe_load_store(T_LONG, LS_cmpxchg); @@ -900,6 +925,8 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_profileBoolean: return inline_profileBoolean(); + case vmIntrinsics::_isCompileConstant: + return inline_isCompileConstant(); default: // If you get here, it may be that someone has added a new intrinsic @@ -3664,6 +3691,11 @@ bool LibraryCallKit::inline_native_subtype_check() { //---------------------generate_array_guard_common------------------------ Node* LibraryCallKit::generate_array_guard_common(Node* kls, RegionNode* region, bool obj_array, bool not_array) { + + if (stopped()) { + return NULL; + } + // If obj_array/non_array==false/false: // Branch around if the given klass is in fact an array (either obj or prim). // If obj_array/non_array==false/true: @@ -3911,21 +3943,23 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) { validated = true; } - newcopy = new_array(klass_node, length, 0); // no arguments to push + if (!stopped()) { + newcopy = new_array(klass_node, length, 0); // no arguments to push - ArrayCopyNode* ac = ArrayCopyNode::make(this, true, original, start, newcopy, intcon(0), moved, true, - load_object_klass(original), klass_node); - if (!is_copyOfRange) { - ac->set_copyof(validated); - } else { - ac->set_copyofrange(validated); - } - Node* n = _gvn.transform(ac); - if (n == ac) { - ac->connect_outputs(this); - } else { - assert(validated, "shouldn't transform if all arguments not validated"); - set_all_memory(n); + ArrayCopyNode* ac = ArrayCopyNode::make(this, true, original, start, newcopy, intcon(0), moved, true, + load_object_klass(original), klass_node); + if (!is_copyOfRange) { + ac->set_copyof(validated); + } else { + ac->set_copyofrange(validated); + } + Node* n = _gvn.transform(ac); + if (n == ac) { + ac->connect_outputs(this); + } else { + assert(validated, "shouldn't transform if all arguments not validated"); + set_all_memory(n); + } } } } // original reexecute is set back here @@ -4674,6 +4708,141 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { return true; } +// If we have a tighly coupled allocation, the arraycopy may take care +// of the array initialization. If one of the guards we insert between +// the allocation and the arraycopy causes a deoptimization, an +// unitialized array will escape the compiled method. To prevent that +// we set the JVM state for uncommon traps between the allocation and +// the arraycopy to the state before the allocation so, in case of +// deoptimization, we'll reexecute the allocation and the +// initialization. +JVMState* LibraryCallKit::arraycopy_restore_alloc_state(AllocateArrayNode* alloc, int& saved_reexecute_sp) { + if (alloc != NULL) { + ciMethod* trap_method = alloc->jvms()->method(); + int trap_bci = alloc->jvms()->bci(); + + if (!C->too_many_traps(trap_method, trap_bci, Deoptimization::Reason_intrinsic) & + !C->too_many_traps(trap_method, trap_bci, Deoptimization::Reason_null_check)) { + // Make sure there's no store between the allocation and the + // arraycopy otherwise visible side effects could be rexecuted + // in case of deoptimization and cause incorrect execution. + bool no_interfering_store = true; + Node* mem = alloc->in(TypeFunc::Memory); + if (mem->is_MergeMem()) { + for (MergeMemStream mms(merged_memory(), mem->as_MergeMem()); mms.next_non_empty2(); ) { + Node* n = mms.memory(); + if (n != mms.memory2() && !(n->is_Proj() && n->in(0) == alloc->initialization())) { + assert(n->is_Store(), "what else?"); + no_interfering_store = false; + break; + } + } + } else { + for (MergeMemStream mms(merged_memory()); mms.next_non_empty(); ) { + Node* n = mms.memory(); + if (n != mem && !(n->is_Proj() && n->in(0) == alloc->initialization())) { + assert(n->is_Store(), "what else?"); + no_interfering_store = false; + break; + } + } + } + + if (no_interfering_store) { + JVMState* old_jvms = alloc->jvms()->clone_shallow(C); + uint size = alloc->req(); + SafePointNode* sfpt = new SafePointNode(size, old_jvms); + old_jvms->set_map(sfpt); + for (uint i = 0; i < size; i++) { + sfpt->init_req(i, alloc->in(i)); + } + // re-push array length for deoptimization + sfpt->ins_req(old_jvms->stkoff() + old_jvms->sp(), alloc->in(AllocateNode::ALength)); + old_jvms->set_sp(old_jvms->sp()+1); + old_jvms->set_monoff(old_jvms->monoff()+1); + old_jvms->set_scloff(old_jvms->scloff()+1); + old_jvms->set_endoff(old_jvms->endoff()+1); + old_jvms->set_should_reexecute(true); + + sfpt->set_i_o(map()->i_o()); + sfpt->set_memory(map()->memory()); + sfpt->set_control(map()->control()); + + JVMState* saved_jvms = jvms(); + saved_reexecute_sp = _reexecute_sp; + + set_jvms(sfpt->jvms()); + _reexecute_sp = jvms()->sp(); + + return saved_jvms; + } + } + } + return NULL; +} + +// In case of a deoptimization, we restart execution at the +// allocation, allocating a new array. We would leave an uninitialized +// array in the heap that GCs wouldn't expect. Move the allocation +// after the traps so we don't allocate the array if we +// deoptimize. This is possible because tightly_coupled_allocation() +// guarantees there's no observer of the allocated array at this point +// and the control flow is simple enough. +void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp) { + if (saved_jvms != NULL && !stopped()) { + assert(alloc != NULL, "only with a tightly coupled allocation"); + // restore JVM state to the state at the arraycopy + saved_jvms->map()->set_control(map()->control()); + assert(saved_jvms->map()->memory() == map()->memory(), "memory state changed?"); + assert(saved_jvms->map()->i_o() == map()->i_o(), "IO state changed?"); + // If we've improved the types of some nodes (null check) while + // emitting the guards, propagate them to the current state + map()->replaced_nodes().apply(saved_jvms->map()); + set_jvms(saved_jvms); + _reexecute_sp = saved_reexecute_sp; + + // Remove the allocation from above the guards + CallProjections callprojs; + alloc->extract_projections(&callprojs, true); + InitializeNode* init = alloc->initialization(); + Node* alloc_mem = alloc->in(TypeFunc::Memory); + C->gvn_replace_by(callprojs.fallthrough_ioproj, alloc->in(TypeFunc::I_O)); + C->gvn_replace_by(init->proj_out(TypeFunc::Memory), alloc_mem); + C->gvn_replace_by(init->proj_out(TypeFunc::Control), alloc->in(0)); + + // move the allocation here (after the guards) + _gvn.hash_delete(alloc); + alloc->set_req(TypeFunc::Control, control()); + alloc->set_req(TypeFunc::I_O, i_o()); + Node *mem = reset_memory(); + set_all_memory(mem); + alloc->set_req(TypeFunc::Memory, mem); + set_control(init->proj_out(TypeFunc::Control)); + set_i_o(callprojs.fallthrough_ioproj); + + // Update memory as done in GraphKit::set_output_for_allocation() + const TypeInt* length_type = _gvn.find_int_type(alloc->in(AllocateNode::ALength)); + const TypeOopPtr* ary_type = _gvn.type(alloc->in(AllocateNode::KlassNode))->is_klassptr()->as_instance_type(); + if (ary_type->isa_aryptr() && length_type != NULL) { + ary_type = ary_type->is_aryptr()->cast_to_size(length_type); + } + const TypePtr* telemref = ary_type->add_offset(Type::OffsetBot); + int elemidx = C->get_alias_index(telemref); + set_memory(init->proj_out(TypeFunc::Memory), Compile::AliasIdxRaw); + set_memory(init->proj_out(TypeFunc::Memory), elemidx); + + Node* allocx = _gvn.transform(alloc); + assert(allocx == alloc, "where has the allocation gone?"); + assert(dest->is_CheckCastPP(), "not an allocation result?"); + + _gvn.hash_delete(dest); + dest->set_req(0, control()); + Node* destx = _gvn.transform(dest); + assert(destx == dest, "where has the allocation result gone?"); + } +} + + //------------------------------inline_arraycopy----------------------- // public static native void java.lang.System.arraycopy(Object src, int srcPos, // Object dest, int destPos, @@ -4686,6 +4855,19 @@ bool LibraryCallKit::inline_arraycopy() { Node* dest_offset = argument(3); // type: int Node* length = argument(4); // type: int + + // Check for allocation before we add nodes that would confuse + // tightly_coupled_allocation() + AllocateArrayNode* alloc = tightly_coupled_allocation(dest, NULL); + + int saved_reexecute_sp = -1; + JVMState* saved_jvms = arraycopy_restore_alloc_state(alloc, saved_reexecute_sp); + // See arraycopy_restore_alloc_state() comment + // if alloc == NULL we don't have to worry about a tightly coupled allocation so we can emit all needed guards + // if saved_jvms != NULL (then alloc != NULL) then we can handle guards and a tightly coupled allocation + // if saved_jvms == NULL and alloc != NULL, we can’t emit any guards + bool can_emit_guards = (alloc == NULL || saved_jvms != NULL); + // The following tests must be performed // (1) src and dest are arrays. // (2) src and dest arrays must have elements of the same BasicType @@ -4699,42 +4881,20 @@ bool LibraryCallKit::inline_arraycopy() { // (3) src and dest must not be null. // always do this here because we need the JVM state for uncommon traps - src = null_check(src, T_ARRAY); + Node* null_ctl = top(); + src = saved_jvms != NULL ? null_check_oop(src, &null_ctl, true, true) : null_check(src, T_ARRAY); + assert(null_ctl->is_top(), "no null control here"); dest = null_check(dest, T_ARRAY); - // Check for allocation before we add nodes that would confuse - // tightly_coupled_allocation() - AllocateArrayNode* alloc = tightly_coupled_allocation(dest, NULL); - - ciMethod* trap_method = method(); - int trap_bci = bci(); - SafePointNode* sfpt = NULL; - if (alloc != NULL) { - // The JVM state for uncommon traps between the allocation and - // arraycopy is set to the state before the allocation: if the - // initialization is performed by the array copy, we don't want to - // go back to the interpreter with an unitialized array. - JVMState* old_jvms = alloc->jvms(); - JVMState* jvms = old_jvms->clone_shallow(C); - uint size = alloc->req(); - sfpt = new SafePointNode(size, jvms); - jvms->set_map(sfpt); - for (uint i = 0; i < size; i++) { - sfpt->init_req(i, alloc->in(i)); - } - // re-push array length for deoptimization - sfpt->ins_req(jvms->stkoff() + jvms->sp(), alloc->in(AllocateNode::ALength)); - jvms->set_sp(jvms->sp()+1); - jvms->set_monoff(jvms->monoff()+1); - jvms->set_scloff(jvms->scloff()+1); - jvms->set_endoff(jvms->endoff()+1); - jvms->set_should_reexecute(true); - - sfpt->set_i_o(map()->i_o()); - sfpt->set_memory(map()->memory()); - - trap_method = jvms->method(); - trap_bci = jvms->bci(); + if (!can_emit_guards) { + // if saved_jvms == NULL and alloc != NULL, we don't emit any + // guards but the arraycopy node could still take advantage of a + // tightly allocated allocation. tightly_coupled_allocation() is + // called again to make sure it takes the null check above into + // account: the null check is mandatory and if it caused an + // uncommon trap to be emitted then the allocation can't be + // considered tightly coupled in this context. + alloc = tightly_coupled_allocation(dest, NULL); } bool validated = false; @@ -4753,7 +4913,7 @@ bool LibraryCallKit::inline_arraycopy() { // Is the type for dest from speculation? bool dest_spec = false; - if (!has_src || !has_dest) { + if ((!has_src || !has_dest) && can_emit_guards) { // 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. @@ -4782,7 +4942,7 @@ bool LibraryCallKit::inline_arraycopy() { 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, true, sfpt); + src = maybe_cast_profiled_obj(src, src_k, true); src_type = _gvn.type(src); top_src = src_type->isa_aryptr(); has_src = (top_src != NULL && top_src->klass() != NULL); @@ -4798,7 +4958,7 @@ bool LibraryCallKit::inline_arraycopy() { } } - if (has_src && has_dest) { + if (has_src && has_dest && can_emit_guards) { BasicType src_elem = top_src->klass()->as_array_klass()->element_type()->basic_type(); BasicType dest_elem = top_dest->klass()->as_array_klass()->element_type()->basic_type(); if (src_elem == T_ARRAY) src_elem = T_OBJECT; @@ -4830,7 +4990,7 @@ bool LibraryCallKit::inline_arraycopy() { 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, true, sfpt); + src = maybe_cast_profiled_obj(src, src_k, true); } if (could_have_dest && !dest_spec) { dest = maybe_cast_profiled_obj(dest, dest_k, true); @@ -4839,7 +4999,16 @@ bool LibraryCallKit::inline_arraycopy() { } } - if (!C->too_many_traps(trap_method, trap_bci, Deoptimization::Reason_intrinsic) && !src->is_top() && !dest->is_top()) { + ciMethod* trap_method = method(); + int trap_bci = bci(); + if (saved_jvms != NULL) { + trap_method = alloc->jvms()->method(); + trap_bci = alloc->jvms()->bci(); + } + + if (!C->too_many_traps(trap_method, trap_bci, Deoptimization::Reason_intrinsic) && + can_emit_guards && + !src->is_top() && !dest->is_top()) { // validate arguments: enables transformation the ArrayCopyNode validated = true; @@ -4875,28 +5044,13 @@ bool LibraryCallKit::inline_arraycopy() { Node* not_subtype_ctrl = gen_subtype_check(src_klass, dest_klass); if (not_subtype_ctrl != top()) { - if (sfpt != NULL) { - GraphKit kit(sfpt->jvms()); - PreserveJVMState pjvms(&kit); - kit.set_control(not_subtype_ctrl); - kit.uncommon_trap(Deoptimization::Reason_intrinsic, - Deoptimization::Action_make_not_entrant); - assert(kit.stopped(), "Should be stopped"); - } else { - PreserveJVMState pjvms(this); - set_control(not_subtype_ctrl); - uncommon_trap(Deoptimization::Reason_intrinsic, - Deoptimization::Action_make_not_entrant); - assert(stopped(), "Should be stopped"); - } + PreserveJVMState pjvms(this); + set_control(not_subtype_ctrl); + uncommon_trap(Deoptimization::Reason_intrinsic, + Deoptimization::Action_make_not_entrant); + assert(stopped(), "Should be stopped"); } - if (sfpt != NULL) { - GraphKit kit(sfpt->jvms()); - kit.set_control(_gvn.transform(slow_region)); - kit.uncommon_trap(Deoptimization::Reason_intrinsic, - Deoptimization::Action_make_not_entrant); - assert(kit.stopped(), "Should be stopped"); - } else { + { PreserveJVMState pjvms(this); set_control(_gvn.transform(slow_region)); uncommon_trap(Deoptimization::Reason_intrinsic, @@ -4905,6 +5059,8 @@ bool LibraryCallKit::inline_arraycopy() { } } + arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp); + if (stopped()) { return true; } @@ -5870,12 +6026,46 @@ bool LibraryCallKit::inline_profileBoolean() { Deoptimization::Action_reinterpret); return true; } + + // result is a boolean (0 or 1) and its profile (false_cnt & true_cnt) + // is a number of each value occurrences. + Node* result = argument(0); + if (false_cnt == 0 || true_cnt == 0) { + // According to profile, one value has been never seen. + int expected_val = (false_cnt == 0) ? 1 : 0; + + Node* cmp = _gvn.transform(new CmpINode(result, intcon(expected_val))); + Node* test = _gvn.transform(new BoolNode(cmp, BoolTest::eq)); + + IfNode* check = create_and_map_if(control(), test, PROB_ALWAYS, COUNT_UNKNOWN); + Node* fast_path = _gvn.transform(new IfTrueNode(check)); + Node* slow_path = _gvn.transform(new IfFalseNode(check)); + + { // Slow path: uncommon trap for never seen value and then reexecute + // MethodHandleImpl::profileBoolean() to bump the count, so JIT knows + // the value has been seen at least once. + PreserveJVMState pjvms(this); + PreserveReexecuteState preexecs(this); + jvms()->set_should_reexecute(true); + + set_control(slow_path); + set_i_o(i_o()); + + uncommon_trap_exact(Deoptimization::Reason_intrinsic, + Deoptimization::Action_reinterpret); + } + // The guard for never seen value enables sharpening of the result and + // returning a constant. It allows to eliminate branches on the same value + // later on. + set_control(fast_path); + result = intcon(expected_val); + } // Stop profiling. - // MethodHandleImpl::profileBoolean() has profiling logic in it's bytecode. - // By replacing method's body with profile data (represented as ProfileBooleanNode + // MethodHandleImpl::profileBoolean() has profiling logic in its bytecode. + // By replacing method body with profile data (represented as ProfileBooleanNode // on IR level) we effectively disable profiling. // It enables full speed execution once optimized code is generated. - Node* profile = _gvn.transform(new ProfileBooleanNode(argument(0), false_cnt, true_cnt)); + Node* profile = _gvn.transform(new ProfileBooleanNode(result, false_cnt, true_cnt)); C->record_for_igvn(profile); set_result(profile); return true; @@ -5888,3 +6078,9 @@ bool LibraryCallKit::inline_profileBoolean() { return false; } } + +bool LibraryCallKit::inline_isCompileConstant() { + Node* n = argument(0); + set_result(n->is_Con() ? intcon(1) : intcon(0)); + return true; +} diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp index 2539ae4d402..d5157b79afb 100644 --- a/hotspot/src/share/vm/opto/loopPredicate.cpp +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp @@ -89,7 +89,7 @@ void PhaseIdealLoop::register_control(Node* n, IdealLoopTree *loop, Node* pred) // // We will create a region to guard the uct call if there is no one there. // The true projecttion (if_cont) of the new_iff is returned. -// This code is also used to clone predicates to clonned loops. +// This code is also used to clone predicates to cloned loops. ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, Deoptimization::DeoptReason reason) { assert(cont_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!"); diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index d0e31cf142c..6b97ac86a1c 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -38,6 +38,7 @@ #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "opto/subnode.hpp" +#include "opto/vectornode.hpp" //------------------------------is_loop_exit----------------------------------- // Given an IfNode, return the loop-exiting projection or NULL if both @@ -1524,6 +1525,44 @@ void PhaseIdealLoop::do_maximally_unroll( IdealLoopTree *loop, Node_List &old_ne } } +void PhaseIdealLoop::mark_reductions(IdealLoopTree *loop) { + if (SuperWordReductions == false) return; + + CountedLoopNode* loop_head = loop->_head->as_CountedLoop(); + if (loop_head->unrolled_count() > 1) { + return; + } + + Node* trip_phi = loop_head->phi(); + for (DUIterator_Fast imax, i = loop_head->fast_outs(imax); i < imax; i++) { + Node* phi = loop_head->fast_out(i); + if (phi->is_Phi() && phi->outcnt() > 0 && phi != trip_phi) { + // For definitions which are loop inclusive and not tripcounts. + Node* def_node = phi->in(LoopNode::LoopBackControl); + + if (def_node != NULL) { + Node* n_ctrl = get_ctrl(def_node); + if (n_ctrl != NULL && loop->is_member(get_loop(n_ctrl))) { + // Now test it to see if it fits the standard pattern for a reduction operator. + int opc = def_node->Opcode(); + if (opc != ReductionNode::opcode(opc, def_node->bottom_type()->basic_type())) { + if (!def_node->is_reduction()) { // Not marked yet + // To be a reduction, the arithmetic node must have the phi as input and provide a def to it + for (unsigned j = 1; j < def_node->req(); j++) { + Node* in = def_node->in(j); + if (in == phi) { + def_node->add_flag(Node::Flag_is_reduction); + break; + } + } + } + } + } + } + } + } +} + //------------------------------dominates_backedge--------------------------------- // Returns true if ctrl is executed on every complete iteration bool IdealLoopTree::dominates_backedge(Node* ctrl) { @@ -2361,8 +2400,10 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ // an even number of trips). If we are peeling, we might enable some RCE // and we'd rather unroll the post-RCE'd loop SO... do not unroll if // peeling. - if (should_unroll && !should_peel) - phase->do_unroll(this,old_new, true); + if (should_unroll && !should_peel) { + phase->mark_reductions(this); + phase->do_unroll(this, old_new, true); + } // Adjust the pre-loop limits to align the main body // iterations. diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index c884dd38b96..a2063232763 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -872,6 +872,9 @@ public: // Unroll the loop body one step - make each trip do 2 iterations. void do_unroll( IdealLoopTree *loop, Node_List &old_new, bool adjust_min_trip ); + // Mark vector reduction candidates before loop unrolling + void mark_reductions( IdealLoopTree *loop ); + // Return true if exp is a constant times an induction var bool is_scaled_iv(Node* exp, Node* iv, int* p_scale); diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index e00a47dbfda..c378acb4e40 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -241,8 +241,8 @@ 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 && - (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) || - unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check))) { + (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL || + unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check) != NULL)) { // If this is a range check (IfNode::is_range_check), do not // reorder because Compile::allow_range_check_smearing might have // changed the check. diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index e16555f0f94..828fc9ffcc4 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -144,7 +144,9 @@ void PhaseMacroExpand::copy_predefined_input_for_runtime_call(Node * ctrl, CallN } //------------------------------make_slow_call--------------------------------- -CallNode* PhaseMacroExpand::make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call, const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1) { +CallNode* PhaseMacroExpand::make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, + address slow_call, const char* leaf_name, Node* slow_path, + Node* parm0, Node* parm1, Node* parm2) { // Slow-path call CallNode *call = leaf_name @@ -155,6 +157,7 @@ CallNode* PhaseMacroExpand::make_slow_call(CallNode *oldcall, const TypeFunc* sl copy_predefined_input_for_runtime_call(slow_path, oldcall, call ); if (parm0 != NULL) call->init_req(TypeFunc::Parms+0, parm0); if (parm1 != NULL) call->init_req(TypeFunc::Parms+1, parm1); + if (parm2 != NULL) call->init_req(TypeFunc::Parms+2, parm2); copy_call_debug_info(oldcall, call); call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON. _igvn.replace_node(oldcall, call); @@ -2328,7 +2331,9 @@ void PhaseMacroExpand::expand_lock_node(LockNode *lock) { } // Make slow path call - CallNode *call = make_slow_call( (CallNode *) lock, OptoRuntime::complete_monitor_enter_Type(), OptoRuntime::complete_monitor_locking_Java(), NULL, slow_path, obj, box ); + CallNode *call = make_slow_call((CallNode *) lock, OptoRuntime::complete_monitor_enter_Type(), + OptoRuntime::complete_monitor_locking_Java(), NULL, slow_path, + obj, box, NULL); extract_call_projections(call); @@ -2395,8 +2400,11 @@ void PhaseMacroExpand::expand_unlock_node(UnlockNode *unlock) { funlock = transform_later( funlock )->as_FastUnlock(); // Optimize test; set region slot 2 Node *slow_path = opt_bits_test(ctrl, region, 2, funlock, 0, 0); + Node *thread = transform_later(new ThreadLocalNode()); - CallNode *call = make_slow_call( (CallNode *) unlock, OptoRuntime::complete_monitor_exit_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C), "complete_monitor_unlocking_C", slow_path, obj, box ); + CallNode *call = make_slow_call((CallNode *) unlock, OptoRuntime::complete_monitor_exit_Type(), + CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C), + "complete_monitor_unlocking_C", slow_path, obj, box, thread); extract_call_projections(call); @@ -2535,7 +2543,7 @@ bool PhaseMacroExpand::expand_macro_nodes() { (bol->_test._test == BoolTest::ne), ""); IfNode* ifn = bol->unique_out()->as_If(); assert((ifn->outcnt() == 2) && - ifn->proj_out(1)->is_uncommon_trap_proj(Deoptimization::Reason_rtm_state_change), ""); + ifn->proj_out(1)->is_uncommon_trap_proj(Deoptimization::Reason_rtm_state_change) != NULL, ""); #endif Node* repl = n->in(1); if (!_has_locks) { diff --git a/hotspot/src/share/vm/opto/macro.hpp b/hotspot/src/share/vm/opto/macro.hpp index 3cb2e8a2bcf..7de164e335c 100644 --- a/hotspot/src/share/vm/opto/macro.hpp +++ b/hotspot/src/share/vm/opto/macro.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,7 +186,8 @@ private: Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false); void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call); CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call, - const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1); + const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1, + Node* parm2); void extract_call_projections(CallNode *call); Node* initialize_object(AllocateNode* alloc, diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index a0bf3eea694..e47ee7f0551 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1049,6 +1049,15 @@ Node *Matcher::xform( Node *n, int max_stack ) { mstack.push(m, Visit, n, -1); } + // Handle precedence edges for interior nodes + for (i = n->len()-1; (uint)i >= n->req(); i--) { + Node *m = n->in(i); + if (m == NULL || C->node_arena()->contains(m)) continue; + n->rm_prec(i); + // set -1 to call add_prec() instead of set_req() during Step1 + mstack.push(m, Visit, n, -1); + } + // For constant debug info, I'd rather have unmatched constants. int cnt = n->req(); JVMState* jvms = n->jvms(); @@ -1738,6 +1747,14 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { return ex; } +void Matcher::handle_precedence_edges(Node* n, MachNode *mach) { + for (uint i = n->req(); i < n->len(); i++) { + if (n->in(i) != NULL) { + mach->add_prec(n->in(i)); + } + } +} + void Matcher::ReduceInst_Chain_Rule( State *s, int rule, Node *&mem, MachNode *mach ) { // 'op' is what I am expecting to receive int op = _leftOp[rule]; @@ -1772,6 +1789,8 @@ void Matcher::ReduceInst_Chain_Rule( State *s, int rule, Node *&mem, MachNode *m uint Matcher::ReduceInst_Interior( State *s, int rule, Node *&mem, MachNode *mach, uint num_opnds ) { + handle_precedence_edges(s->_leaf, mach); + if( s->_leaf->is_Load() ) { Node *mem2 = s->_leaf->in(MemNode::Memory); assert( mem == (Node*)1 || mem == mem2, "multiple Memories being matched at once?" ); @@ -1854,6 +1873,9 @@ void Matcher::ReduceOper( State *s, int rule, Node *&mem, MachNode *mach ) { mem = s->_leaf->in(MemNode::Memory); debug_only(_mem_node = s->_leaf;) } + + handle_precedence_edges(s->_leaf, mach); + if( s->_leaf->in(0) && s->_leaf->req() > 1) { if( !mach->in(0) ) mach->set_req(0,s->_leaf->in(0)); diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index d88771aeda6..41c6759b9eb 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -124,6 +124,8 @@ class Matcher : public PhaseTransform { // Mach node for ConP #NULL MachNode* _mach_null; + void handle_precedence_edges(Node* n, MachNode *mach); + public: int LabelRootDepth; // Convert ideal machine register to a register mask for spill-loads diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 683ae584710..81bb5ab81e7 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -652,216 +652,6 @@ const TypePtr* MemNode::calculate_adr_type(const Type* t, const TypePtr* cross_c } } -//------------------------adr_phi_is_loop_invariant---------------------------- -// A helper function for Ideal_DU_postCCP to check if a Phi in a counted -// loop is loop invariant. Make a quick traversal of Phi and associated -// CastPP nodes, looking to see if they are a closed group within the loop. -bool MemNode::adr_phi_is_loop_invariant(Node* adr_phi, Node* cast) { - // The idea is that the phi-nest must boil down to only CastPP nodes - // with the same data. This implies that any path into the loop already - // includes such a CastPP, and so the original cast, whatever its input, - // must be covered by an equivalent cast, with an earlier control input. - ResourceMark rm; - - // The loop entry input of the phi should be the unique dominating - // node for every Phi/CastPP in the loop. - Unique_Node_List closure; - closure.push(adr_phi->in(LoopNode::EntryControl)); - - // Add the phi node and the cast to the worklist. - Unique_Node_List worklist; - worklist.push(adr_phi); - if( cast != NULL ){ - if( !cast->is_ConstraintCast() ) return false; - worklist.push(cast); - } - - // Begin recursive walk of phi nodes. - while( worklist.size() ){ - // Take a node off the worklist - Node *n = worklist.pop(); - if( !closure.member(n) ){ - // Add it to the closure. - closure.push(n); - // Make a sanity check to ensure we don't waste too much time here. - if( closure.size() > 20) return false; - // This node is OK if: - // - it is a cast of an identical value - // - or it is a phi node (then we add its inputs to the worklist) - // Otherwise, the node is not OK, and we presume the cast is not invariant - if( n->is_ConstraintCast() ){ - worklist.push(n->in(1)); - } else if( n->is_Phi() ) { - for( uint i = 1; i < n->req(); i++ ) { - worklist.push(n->in(i)); - } - } else { - return false; - } - } - } - - // Quit when the worklist is empty, and we've found no offending nodes. - return true; -} - -//------------------------------Ideal_DU_postCCP------------------------------- -// Find any cast-away of null-ness and keep its control. Null cast-aways are -// going away in this pass and we need to make this memory op depend on the -// gating null check. -Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { - return Ideal_common_DU_postCCP(ccp, this, in(MemNode::Address)); -} - -// I tried to leave the CastPP's in. This makes the graph more accurate in -// some sense; we get to keep around the knowledge that an oop is not-null -// after some test. Alas, the CastPP's interfere with GVN (some values are -// the regular oop, some are the CastPP of the oop, all merge at Phi's which -// cannot collapse, etc). This cost us 10% on SpecJVM, even when I removed -// some of the more trivial cases in the optimizer. Removing more useless -// Phi's started allowing Loads to illegally float above null checks. I gave -// up on this approach. CNC 10/20/2000 -// This static method may be called not from MemNode (EncodePNode calls it). -// Only the control edge of the node 'n' might be updated. -Node *MemNode::Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr ) { - Node *skipped_cast = NULL; - // Need a null check? Regular static accesses do not because they are - // from constant addresses. Array ops are gated by the range check (which - // always includes a NULL check). Just check field ops. - if( n->in(MemNode::Control) == NULL ) { - // Scan upwards for the highest location we can place this memory op. - while( true ) { - switch( adr->Opcode() ) { - - case Op_AddP: // No change to NULL-ness, so peek thru AddP's - adr = adr->in(AddPNode::Base); - continue; - - case Op_DecodeN: // No change to NULL-ness, so peek thru - case Op_DecodeNKlass: - adr = adr->in(1); - continue; - - case Op_EncodeP: - case Op_EncodePKlass: - // EncodeP node's control edge could be set by this method - // when EncodeP node depends on CastPP node. - // - // Use its control edge for memory op because EncodeP may go away - // later when it is folded with following or preceding DecodeN node. - if (adr->in(0) == NULL) { - // Keep looking for cast nodes. - adr = adr->in(1); - continue; - } - ccp->hash_delete(n); - n->set_req(MemNode::Control, adr->in(0)); - ccp->hash_insert(n); - return n; - - case Op_CastPP: - // If the CastPP is useless, just peek on through it. - if( ccp->type(adr) == ccp->type(adr->in(1)) ) { - // Remember the cast that we've peeked though. If we peek - // through more than one, then we end up remembering the highest - // one, that is, if in a loop, the one closest to the top. - skipped_cast = adr; - adr = adr->in(1); - continue; - } - // CastPP is going away in this pass! We need this memory op to be - // control-dependent on the test that is guarding the CastPP. - ccp->hash_delete(n); - n->set_req(MemNode::Control, adr->in(0)); - ccp->hash_insert(n); - return n; - - case Op_Phi: - // Attempt to float above a Phi to some dominating point. - if (adr->in(0) != NULL && adr->in(0)->is_CountedLoop()) { - // If we've already peeked through a Cast (which could have set the - // control), we can't float above a Phi, because the skipped Cast - // may not be loop invariant. - if (adr_phi_is_loop_invariant(adr, skipped_cast)) { - adr = adr->in(1); - continue; - } - } - - // Intentional fallthrough! - - // No obvious dominating point. The mem op is pinned below the Phi - // by the Phi itself. If the Phi goes away (no true value is merged) - // then the mem op can float, but not indefinitely. It must be pinned - // behind the controls leading to the Phi. - case Op_CheckCastPP: - // These usually stick around to change address type, however a - // useless one can be elided and we still need to pick up a control edge - if (adr->in(0) == NULL) { - // This CheckCastPP node has NO control and is likely useless. But we - // need check further up the ancestor chain for a control input to keep - // the node in place. 4959717. - skipped_cast = adr; - adr = adr->in(1); - continue; - } - ccp->hash_delete(n); - n->set_req(MemNode::Control, adr->in(0)); - ccp->hash_insert(n); - return n; - - // List of "safe" opcodes; those that implicitly block the memory - // op below any null check. - case Op_CastX2P: // no null checks on native pointers - case Op_Parm: // 'this' pointer is not null - case Op_LoadP: // Loading from within a klass - case Op_LoadN: // Loading from within a klass - case Op_LoadKlass: // Loading from within a klass - case Op_LoadNKlass: // Loading from within a klass - case Op_ConP: // Loading from a klass - case Op_ConN: // Loading from a klass - case Op_ConNKlass: // Loading from a klass - case Op_CreateEx: // Sucking up the guts of an exception oop - case Op_Con: // Reading from TLS - case Op_CMoveP: // CMoveP is pinned - case Op_CMoveN: // CMoveN is pinned - break; // No progress - - case Op_Proj: // Direct call to an allocation routine - case Op_SCMemProj: // Memory state from store conditional ops -#ifdef ASSERT - { - assert(adr->as_Proj()->_con == TypeFunc::Parms, "must be return value"); - const Node* call = adr->in(0); - if (call->is_CallJava()) { - const CallJavaNode* call_java = call->as_CallJava(); - const TypeTuple *r = call_java->tf()->range(); - assert(r->cnt() > TypeFunc::Parms, "must return value"); - const Type* ret_type = r->field_at(TypeFunc::Parms); - assert(ret_type && ret_type->isa_ptr(), "must return pointer"); - // We further presume that this is one of - // new_instance_Java, new_array_Java, or - // the like, but do not assert for this. - } else if (call->is_Allocate()) { - // similar case to new_instance_Java, etc. - } else if (!call->is_CallLeaf()) { - // Projections from fetch_oop (OSR) are allowed as well. - ShouldNotReachHere(); - } - } -#endif - break; - default: - ShouldNotReachHere(); - } - break; - } - } - - return NULL; // No progress -} - - //============================================================================= // Should LoadNode::Ideal() attempt to remove control edges? bool LoadNode::can_remove_control() const { diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index d1a65d1ebdb..a15e1ca2759 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -84,10 +84,6 @@ public: // This one should probably be a phase-specific function: static bool all_controls_dominate(Node* dom, Node* sub); - // Find any cast-away of null-ness and keep its control. - static Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr ); - virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); - virtual const class TypePtr *adr_type() const; // returns bottom_type of address // Shared code for Ideal methods: diff --git a/hotspot/src/share/vm/opto/multnode.cpp b/hotspot/src/share/vm/opto/multnode.cpp index c4d167faae9..00ff009660c 100644 --- a/hotspot/src/share/vm/opto/multnode.cpp +++ b/hotspot/src/share/vm/opto/multnode.cpp @@ -150,59 +150,67 @@ uint ProjNode::ideal_reg() const { } //-------------------------------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) { +// Return uncommon trap call node if proj is for "proj->[region->..]call_uct" +// NULL otherwise +CallStaticJavaNode* 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; + return NULL; if (out->is_CallStaticJava()) { - int req = out->as_CallStaticJava()->uncommon_trap_request(); + CallStaticJavaNode* call = out->as_CallStaticJava(); + int req = call->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 call; } } - return false; // don't do further after call + return NULL; // don't do further after call } if (out->Opcode() != Op_Region) - return false; + return NULL; } - return false; + return NULL; } //-------------------------------is_uncommon_trap_if_pattern------------------------- -// Return true for "if(test)-> proj -> ... -// | -// V -// other_proj->[region->..]call_uct" -// +// Return uncommon trap call node for "if(test)-> proj -> ... +// | +// V +// other_proj->[region->..]call_uct" +// NULL otherwise // "must_reason_predicate" means the uct reason must be Reason_predicate -bool ProjNode::is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason) { +CallStaticJavaNode* ProjNode::is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason) { Node *in0 = in(0); - if (!in0->is_If()) return false; + if (!in0->is_If()) return NULL; // Variation of a dead If node. - if (in0->outcnt() < 2) return false; + if (in0->outcnt() < 2) return NULL; 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; + return NULL; } } ProjNode* other_proj = iff->proj_out(1-_con); if (other_proj == NULL) // Should never happen, but make Parfait happy. - return false; - if (other_proj->is_uncommon_trap_proj(reason)) { + return NULL; + CallStaticJavaNode* call = other_proj->is_uncommon_trap_proj(reason); + if (call != NULL) { assert(reason == Deoptimization::Reason_none || Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); - return true; + return call; } - return false; + return NULL; +} + +ProjNode* ProjNode::other_if_proj() const { + assert(_con == 0 || _con == 1, "not an if?"); + return in(0)->as_If()->proj_out(1-_con); } diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index 6a0aea721b8..02558db1679 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -89,13 +89,18 @@ public: 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); + // Return uncommon trap call node if proj is for "proj->[region->..]call_uct" + // NULL otherwise + CallStaticJavaNode* is_uncommon_trap_proj(Deoptimization::DeoptReason reason); + // Return uncommon trap call node for "if(test)-> proj -> ... + // | + // V + // other_proj->[region->..]call_uct" + // NULL otherwise + CallStaticJavaNode* is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason); + + // Return other proj node when this is a If proj node + ProjNode* other_if_proj() const; }; #endif // SHARE_VM_OPTO_MULTNODE_HPP diff --git a/hotspot/src/share/vm/opto/narrowptrnode.cpp b/hotspot/src/share/vm/opto/narrowptrnode.cpp index 197d748f407..de88eb6393b 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.cpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.cpp @@ -67,10 +67,6 @@ const Type *EncodePNode::Value( PhaseTransform *phase ) const { } -Node *EncodeNarrowPtrNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { - return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1)); -} - Node* DecodeNKlassNode::Identity(PhaseTransform* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); diff --git a/hotspot/src/share/vm/opto/narrowptrnode.hpp b/hotspot/src/share/vm/opto/narrowptrnode.hpp index 9b737f59837..feecbd0b906 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.hpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.hpp @@ -39,7 +39,6 @@ class EncodeNarrowPtrNode : public TypeNode { } public: virtual uint ideal_reg() const { return Op_RegN; } - virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); }; //------------------------------EncodeP-------------------------------- diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index 225b20c55dd..35de94b414b 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1387,12 +1387,6 @@ bool Node::remove_dead_region(PhaseGVN *phase, bool can_reshape) { return false; } -//------------------------------Ideal_DU_postCCP------------------------------- -// Idealize graph, using DU info. Must clone result into new-space -Node *Node::Ideal_DU_postCCP( PhaseCCP * ) { - return NULL; // Default to no change -} - //------------------------------hash------------------------------------------- // Hash function over Nodes. uint Node::hash() const { @@ -2069,7 +2063,7 @@ Node* Node::find_similar(int opc) { //--------------------------unique_ctrl_out------------------------------ // Return the unique control out if only one. Null if none or more than one. -Node* Node::unique_ctrl_out() { +Node* Node::unique_ctrl_out() const { Node* found = NULL; for (uint i = 0; i < outcnt(); i++) { Node* use = raw_out(i); @@ -2081,6 +2075,14 @@ Node* Node::unique_ctrl_out() { return found; } +void Node::ensure_control_or_add_prec(Node* c) { + if (in(0) == NULL) { + set_req(0, c); + } else if (in(0) != c) { + add_prec(c); + } +} + //============================================================================= //------------------------------yank------------------------------------------- // Find and remove diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index ce591dce482..2dfedbc085a 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -673,7 +673,8 @@ public: Flag_avoid_back_to_back_before = Flag_may_be_short_branch << 1, Flag_avoid_back_to_back_after = Flag_avoid_back_to_back_before << 1, Flag_has_call = Flag_avoid_back_to_back_after << 1, - Flag_is_expensive = Flag_has_call << 1, + Flag_is_reduction = Flag_has_call << 1, + Flag_is_expensive = Flag_is_reduction << 1, _max_flags = (Flag_is_expensive << 1) - 1 // allow flags combination }; @@ -701,6 +702,10 @@ public: const jushort flags() const { return _flags; } + void add_flag(jushort fl) { init_flags(fl); } + + void remove_flag(jushort fl) { clear_flag(fl); } + // Return a dense integer opcode number virtual int Opcode() const; @@ -852,6 +857,10 @@ public: // The node is expensive: the best control is set during loop opts bool is_expensive() const { return (_flags & Flag_is_expensive) != 0 && in(0) != NULL; } + // An arithmetic node which accumulates a data in a loop. + // It must have the loop's phi as input and provide a def to the phi. + bool is_reduction() const { return (_flags & Flag_is_reduction) != 0; } + //----------------- Optimization // Get the worst-case Type output for this Node. @@ -897,9 +906,6 @@ protected: bool remove_dead_region(PhaseGVN *phase, bool can_reshape); public: - // Idealize graph, using DU info. Done after constant propagation - virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); - // See if there is valid pipeline info static const Pipeline *pipeline_class(); virtual const Pipeline *pipeline() const; @@ -931,7 +937,10 @@ public: Node* find_similar(int opc); // Return the unique control out if only one. Null if none or more than one. - Node* unique_ctrl_out(); + Node* unique_ctrl_out() const; + + // Set control or add control as precedence edge + void ensure_control_or_add_prec(Node* c); //----------------- Code Generation diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 477ab2883e3..861a84f4d20 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1605,21 +1605,6 @@ void PhaseCCP::do_transform() { C->set_root( transform(C->root())->as_Root() ); assert( C->top(), "missing TOP node" ); assert( C->root(), "missing root" ); - - // Eagerly remove castPP nodes here. CastPP nodes might not be - // removed in the subsequent IGVN phase if a node that changes - // in(1) of a castPP is processed prior to the castPP node. - for (uint i = 0; i < _worklist.size(); i++) { - Node* n = _worklist.at(i); - - if (n->is_ConstraintCast()) { - Node* nn = n->Identity(this); - if (nn != n) { - replace_node(n, nn); - --i; - } - } - } } //------------------------------transform-------------------------------------- @@ -1700,11 +1685,6 @@ Node *PhaseCCP::transform_once( Node *n ) { _worklist.push(n); // n re-enters the hash table via the worklist } - // Idealize graph using DU info. Must clone() into new-space. - // DU info is generally used to show profitability, progress or safety - // (but generally not needed for correctness). - Node *nn = n->Ideal_DU_postCCP(this); - // TEMPORARY fix to ensure that 2nd GVN pass eliminates NULL checks switch( n->Opcode() ) { case Op_FastLock: // Revisit FastLocks for lock coarsening @@ -1721,12 +1701,6 @@ Node *PhaseCCP::transform_once( Node *n ) { default: break; } - if( nn ) { - _worklist.push(n); - // Put users of 'n' onto worklist for second igvn transform - add_users_to_worklist(n); - return nn; - } return n; } diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index ece252c1af9..20674525aed 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -600,10 +600,11 @@ const TypeFunc *OptoRuntime::complete_monitor_enter_Type() { //----------------------------------------------------------------------------- const TypeFunc *OptoRuntime::complete_monitor_exit_Type() { // create input type (domain) - const Type **fields = TypeTuple::fields(2); + const Type **fields = TypeTuple::fields(3); fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // Object to be Locked - fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock - const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields); + fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // Address of stack location for lock - BasicLock + fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM; // Thread pointer (Self) + const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3,fields); // create result type (range) fields = TypeTuple::fields(0); diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index 3257d789ad0..aa08b657e05 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -184,7 +184,7 @@ class OptoRuntime : public AllStatic { public: // Slow-path Locking and Unlocking static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); - static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock); + static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); private: diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 4cc3dd700b5..485cd17717b 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -275,6 +275,8 @@ struct BoolTest VALUE_OBJ_CLASS_SPEC { 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 || _test == BoolTest::overflow); } + bool is_less( ) const { return _test == BoolTest::lt || _test == BoolTest::le; } + bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; } void dump_on(outputStream *st) const; }; diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index e20a187c6da..137a8f753ea 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -65,7 +65,8 @@ SuperWord::SuperWord(PhaseIdealLoop* phase) : _lpt(NULL), // loop tree node _lp(NULL), // LoopNode _bb(NULL), // basic block - _iv(NULL) // induction var + _iv(NULL), // induction var + _race_possible(false) // cases where SDMU is true {} //------------------------------transform_loop--------------------------- @@ -145,7 +146,6 @@ void SuperWord::transform_loop(IdealLoopTree* lpt) { void SuperWord::SLP_extract() { // Ready the block - if (!construct_bb()) return; // Exit if no interesting nodes or complex graph. @@ -449,11 +449,13 @@ bool SuperWord::ref_is_alignable(SWPointer& p) { int preloop_stride = pre_end->stride_con(); int span = preloop_stride * p.scale_in_bytes(); - - // Stride one accesses are alignable. - if (ABS(span) == p.memory_size()) + int mem_size = p.memory_size(); + int offset = p.offset_in_bytes(); + // Stride one accesses are alignable if offset is aligned to memory operation size. + // Offset can be unaligned when UseUnalignedAccesses is used. + if (ABS(span) == mem_size && (ABS(offset) % mem_size) == 0) { return true; - + } // If initial offset from start of object is computable, // compute alignment within the vector. int vw = vector_width_in_bytes(p.mem()); @@ -463,7 +465,7 @@ bool SuperWord::ref_is_alignable(SWPointer& p) { if (init_nd->is_Con() && p.invar() == NULL) { int init = init_nd->bottom_type()->is_int()->get_con(); - int init_offset = init * p.scale_in_bytes() + p.offset_in_bytes(); + int init_offset = init * p.scale_in_bytes() + offset; assert(init_offset >= 0, "positive offset from object start"); if (span > 0) { @@ -640,7 +642,7 @@ bool SuperWord::stmts_can_pack(Node* s1, Node* s2, int align) { } if (isomorphic(s1, s2)) { - if (independent(s1, s2)) { + if (independent(s1, s2) || reduction(s1, s2)) { if (!exists_at(s1, 0) && !exists_at(s2, 1)) { if (!s1->is_Mem() || are_adjacent_refs(s1, s2)) { int s1_align = alignment(s1); @@ -718,6 +720,28 @@ bool SuperWord::independent(Node* s1, Node* s2) { return independent_path(shallow, deep); } +//------------------------------reduction--------------------------- +// Is there a data path between s1 and s2 and the nodes reductions? +bool SuperWord::reduction(Node* s1, Node* s2) { + bool retValue = false; + int d1 = depth(s1); + int d2 = depth(s2); + if (d1 + 1 == d2) { + if (s1->is_reduction() && s2->is_reduction()) { + // This is an ordered set, so s1 should define s2 + for (DUIterator_Fast imax, i = s1->fast_outs(imax); i < imax; i++) { + Node* t1 = s1->fast_out(i); + if (t1 == s2) { + // both nodes are reductions and connected + retValue = true; + } + } + } + } + + return retValue; +} + //------------------------------independent_path------------------------------ // Helper for independent bool SuperWord::independent_path(Node* shallow, Node* deep, uint dp) { @@ -761,6 +785,7 @@ int SuperWord::data_size(Node* s) { void SuperWord::extend_packlist() { bool changed; do { + packset_sort(_packset.length()); changed = false; for (int i = 0; i < _packset.length(); i++) { Node_List* p = _packset.at(i); @@ -769,6 +794,13 @@ void SuperWord::extend_packlist() { } } while (changed); + if (_race_possible) { + for (int i = 0; i < _packset.length(); i++) { + Node_List* p = _packset.at(i); + order_def_uses(p); + } + } + #ifndef PRODUCT if (TraceSuperWord) { tty->print_cr("\nAfter extend_packlist"); @@ -825,10 +857,12 @@ bool SuperWord::follow_def_uses(Node_List* p) { int align = alignment(s1); int savings = -1; + int num_s1_uses = 0; Node* u1 = NULL; Node* u2 = NULL; for (DUIterator_Fast imax, i = s1->fast_outs(imax); i < imax; i++) { Node* t1 = s1->fast_out(i); + num_s1_uses++; if (!in_bb(t1)) continue; for (DUIterator_Fast jmax, j = s2->fast_outs(jmax); j < jmax; j++) { Node* t2 = s2->fast_out(j); @@ -845,6 +879,9 @@ bool SuperWord::follow_def_uses(Node_List* p) { } } } + if (num_s1_uses > 1) { + _race_possible = true; + } if (savings >= 0) { Node_List* pair = new Node_List(); pair->push(u1); @@ -856,9 +893,64 @@ bool SuperWord::follow_def_uses(Node_List* p) { return changed; } +//------------------------------order_def_uses--------------------------- +// For extended packsets, ordinally arrange uses packset by major component +void SuperWord::order_def_uses(Node_List* p) { + Node* s1 = p->at(0); + + if (s1->is_Store()) return; + + // reductions are always managed beforehand + if (s1->is_reduction()) return; + + for (DUIterator_Fast imax, i = s1->fast_outs(imax); i < imax; i++) { + Node* t1 = s1->fast_out(i); + + // Only allow operand swap on commuting operations + if (!t1->is_Add() && !t1->is_Mul()) { + break; + } + + // Now find t1's packset + Node_List* p2 = NULL; + for (int j = 0; j < _packset.length(); j++) { + p2 = _packset.at(j); + Node* first = p2->at(0); + if (t1 == first) { + break; + } + p2 = NULL; + } + // Arrange all sub components by the major component + if (p2 != NULL) { + for (uint j = 1; j < p->size(); j++) { + Node* d1 = p->at(j); + Node* u1 = p2->at(j); + opnd_positions_match(s1, t1, d1, u1); + } + } + } +} + //---------------------------opnd_positions_match------------------------- // Is the use of d1 in u1 at the same operand position as d2 in u2? bool SuperWord::opnd_positions_match(Node* d1, Node* u1, Node* d2, Node* u2) { + // check reductions to see if they are marshalled to represent the reduction + // operator in a specified opnd + if (u1->is_reduction() && u2->is_reduction()) { + // ensure reductions have phis and reduction definitions feeding the 1st operand + Node* first = u1->in(2); + if (first->is_Phi() || first->is_reduction()) { + u1->swap_edges(1, 2); + } + // ensure reductions have phis and reduction definitions feeding the 1st operand + first = u2->in(2); + if (first->is_Phi() || first->is_reduction()) { + u2->swap_edges(1, 2); + } + return true; + } + uint ct = u1->req(); if (ct != u2->req()) return false; uint i1 = 0; @@ -940,7 +1032,8 @@ void SuperWord::combine_packs() { for (int i = 0; i < _packset.length(); i++) { Node_List* p1 = _packset.at(i); if (p1 == NULL) continue; - for (int j = 0; j < _packset.length(); j++) { + // Because of sorting we can start at i + 1 + for (int j = i + 1; j < _packset.length(); j++) { Node_List* p2 = _packset.at(j); if (p2 == NULL) continue; if (i == j) continue; @@ -1067,8 +1160,19 @@ void SuperWord::filter_packs() { //------------------------------implemented--------------------------- // Can code be generated for pack p? bool SuperWord::implemented(Node_List* p) { + bool retValue = false; Node* p0 = p->at(0); - return VectorNode::implemented(p0->Opcode(), p->size(), velt_basic_type(p0)); + if (p0 != NULL) { + int opc = p0->Opcode(); + uint size = p->size(); + if (p0->is_reduction()) { + const Type *arith_type = p0->bottom_type(); + retValue = ReductionNode::implemented(opc, size, arith_type->basic_type()); + } else { + retValue = VectorNode::implemented(opc, size, velt_basic_type(p0)); + } + } + return retValue; } //------------------------------same_inputs-------------------------- @@ -1102,6 +1206,18 @@ bool SuperWord::profitable(Node_List* p) { if (!is_vector_use(p0, i)) return false; } + // Check if reductions are connected + if (p0->is_reduction()) { + Node* second_in = p0->in(2); + Node_List* second_pk = my_pack(second_in); + if (second_pk == NULL) { + // Remove reduction flag if no parent pack, it is not profitable + p0->remove_flag(Node::Flag_is_reduction); + return false; + } else if (second_pk->size() != p->size()) { + return false; + } + } if (VectorNode::is_shift(p0)) { // For now, return false if shift count is vector or not scalar promotion // case (different shift counts) because it is not supported yet. @@ -1123,6 +1239,9 @@ bool SuperWord::profitable(Node_List* p) { for (uint k = 0; k < use->req(); k++) { Node* n = use->in(k); if (def == n) { + // reductions can be loop carried dependences + if (def->is_reduction() && use->is_Phi()) + continue; if (!is_vector_use(use, k)) { return false; } @@ -1407,16 +1526,33 @@ void SuperWord::output() { vlen_in_bytes = vn->as_StoreVector()->memory_size(); } else if (n->req() == 3) { // Promote operands to vector - Node* in1 = vector_opd(p, 1); + Node* in1 = NULL; + bool node_isa_reduction = n->is_reduction(); + if (node_isa_reduction) { + // the input to the first reduction operation is retained + in1 = low_adr->in(1); + } else { + in1 = vector_opd(p, 1); + } Node* in2 = vector_opd(p, 2); - if (VectorNode::is_invariant_vector(in1) && (n->is_Add() || n->is_Mul())) { + if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) { // Move invariant vector input into second position to avoid register spilling. Node* tmp = in1; in1 = in2; in2 = tmp; } - vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n)); - vlen_in_bytes = vn->as_Vector()->length_in_bytes(); + if (node_isa_reduction) { + const Type *arith_type = n->bottom_type(); + vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type()); + if (in2->is_Load()) { + vlen_in_bytes = in2->as_LoadVector()->memory_size(); + } else { + vlen_in_bytes = in2->as_Vector()->length_in_bytes(); + } + } else { + vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n)); + vlen_in_bytes = vn->as_Vector()->length_in_bytes(); + } } else { ShouldNotReachHere(); } @@ -1556,6 +1692,8 @@ void SuperWord::insert_extracts(Node_List* p) { _n_idx_list.pop(); Node* def = use->in(idx); + if (def->is_reduction()) continue; + // Insert extract operation _igvn.hash_delete(def); int def_pos = alignment(def) / data_size(def); @@ -1576,6 +1714,7 @@ void SuperWord::insert_extracts(Node_List* p) { bool SuperWord::is_vector_use(Node* use, int u_idx) { Node_List* u_pk = my_pack(use); if (u_pk == NULL) return false; + if (use->is_reduction()) return true; Node* def = use->in(u_idx); Node_List* d_pk = my_pack(def); if (d_pk == NULL) { @@ -1613,7 +1752,7 @@ bool SuperWord::construct_bb() { // by the visited and post_visited sets, // and count number of nodes in block. int bb_ct = 0; - for (uint i = 0; i < lpt()->_body.size(); i++ ) { + for (uint i = 0; i < lpt()->_body.size(); i++) { Node *n = lpt()->_body.at(i); set_bb_idx(n, i); // Create a temporary map if (in_bb(n)) { @@ -1674,6 +1813,7 @@ bool SuperWord::construct_bb() { // Do a depth first walk over out edges int rpo_idx = bb_ct - 1; int size; + int reduction_uses = 0; while ((size = _stk.length()) > 0) { Node* n = _stk.top(); // Leave node on stack if (!visited_test_set(n)) { @@ -1685,6 +1825,14 @@ bool SuperWord::construct_bb() { if (in_bb(use) && !visited_test(use) && // Don't go around backedge (!use->is_Phi() || n == entry)) { + if (use->is_reduction()) { + // First see if we can map the reduction on the given system we are on, then + // make a data entry operation for each reduction we see. + BasicType bt = use->bottom_type()->basic_type(); + if (ReductionNode::implemented(use->Opcode(), Matcher::min_vector_size(bt), bt)) { + reduction_uses++; + } + } _stk.push(use); } } @@ -1708,7 +1856,8 @@ bool SuperWord::construct_bb() { set_bb_idx(n, j); } - initialize_bb(); // Ensure extra info is allocated. + // Ensure extra info is allocated. + initialize_bb(); #ifndef PRODUCT if (TraceSuperWord) { @@ -1726,7 +1875,7 @@ bool SuperWord::construct_bb() { } #endif assert(rpo_idx == -1 && bb_ct == _block.length(), "all block members found"); - return (_mem_slice_head.length() > 0) || (_data_entry.length() > 0); + return (_mem_slice_head.length() > 0) || (reduction_uses > 0) || (_data_entry.length() > 0); } //------------------------------initialize_bb--------------------------- @@ -1959,6 +2108,27 @@ void SuperWord::remove_pack_at(int pos) { _packset.remove_at(pos); } +void SuperWord::packset_sort(int n) { + // simple bubble sort so that we capitalize with O(n) when its already sorted + while (n != 0) { + bool swapped = false; + for (int i = 1; i < n; i++) { + Node_List* q_low = _packset.at(i-1); + Node_List* q_i = _packset.at(i); + + // only swap when we find something to swap + if (alignment(q_low->at(0)) > alignment(q_i->at(0))) { + Node_List* t = q_i; + *(_packset.adr_at(i)) = q_low; + *(_packset.adr_at(i-1)) = q_i; + swapped = true; + } + } + if (swapped == false) break; + n--; + } +} + //------------------------------executed_first--------------------------- // Return the node executed first in pack p. Uses the RPO block list // to determine order. diff --git a/hotspot/src/share/vm/opto/superword.hpp b/hotspot/src/share/vm/opto/superword.hpp index 05d079ca2ca..09bc0158e2b 100644 --- a/hotspot/src/share/vm/opto/superword.hpp +++ b/hotspot/src/share/vm/opto/superword.hpp @@ -249,6 +249,7 @@ class SuperWord : public ResourceObj { LoopNode* _lp; // Current LoopNode Node* _bb; // Current basic block PhiNode* _iv; // Induction var + bool _race_possible; // In cases where SDMU is true // Accessors Arena* arena() { return _arena; } @@ -337,6 +338,8 @@ class SuperWord : public ResourceObj { bool isomorphic(Node* s1, Node* s2); // Is there no data path from s1 to s2 or s2 to s1? bool independent(Node* s1, Node* s2); + // Is there a data path between s1 and s2 and both are reductions? + bool reduction(Node* s1, Node* s2); // Helper for independent bool independent_path(Node* shallow, Node* deep, uint dp=0); void set_alignment(Node* s1, Node* s2, int align); @@ -347,6 +350,8 @@ class SuperWord : public ResourceObj { bool follow_use_defs(Node_List* p); // Extend the packset by visiting uses of nodes in pack p bool follow_def_uses(Node_List* p); + // For extended packsets, ordinally arrange uses packset by major component + void order_def_uses(Node_List* p); // Estimate the savings from executing s1 and s2 as a pack int est_savings(Node* s1, Node* s2); int adjacent_profit(Node* s1, Node* s2); @@ -419,9 +424,12 @@ class SuperWord : public ResourceObj { void print_bb(); void print_stmt(Node* s); char* blank(uint depth); + + void packset_sort(int n); }; + //------------------------------SWPointer--------------------------- // Information about an address for dependence checking and vector alignment class SWPointer VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index a6e95fe92c7..c21fd8e158c 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -1158,11 +1158,11 @@ static int normalize_int_widen( jint lo, jint hi, int w ) { // Certain normalizations keep us sane when comparing types. // The 'SMALLINT' covers constants and also CC and its relatives. if (lo <= hi) { - if ((juint)(hi - lo) <= SMALLINT) w = Type::WidenMin; - if ((juint)(hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT + if (((juint)hi - lo) <= SMALLINT) w = Type::WidenMin; + if (((juint)hi - lo) >= max_juint) w = Type::WidenMax; // TypeInt::INT } else { - if ((juint)(lo - hi) <= SMALLINT) w = Type::WidenMin; - if ((juint)(lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT + if (((juint)lo - hi) <= SMALLINT) w = Type::WidenMin; + if (((juint)lo - hi) >= max_juint) w = Type::WidenMin; // dual TypeInt::INT } return w; } @@ -1416,11 +1416,11 @@ static int normalize_long_widen( jlong lo, jlong hi, int w ) { // Certain normalizations keep us sane when comparing types. // The 'SMALLINT' covers constants. if (lo <= hi) { - if ((julong)(hi - lo) <= SMALLINT) w = Type::WidenMin; - if ((julong)(hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG + if (((julong)hi - lo) <= SMALLINT) w = Type::WidenMin; + if (((julong)hi - lo) >= max_julong) w = Type::WidenMax; // TypeLong::LONG } else { - if ((julong)(lo - hi) <= SMALLINT) w = Type::WidenMin; - if ((julong)(lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG + if (((julong)lo - hi) <= SMALLINT) w = Type::WidenMin; + if (((julong)lo - hi) >= max_julong) w = Type::WidenMin; // dual TypeLong::LONG } return w; } @@ -4083,7 +4083,9 @@ const Type *TypeAryPtr::xmeet_helper(const Type *t) const { (tap->_klass_is_exact && !tap->klass()->is_subtype_of(klass())) || // '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); + if (above_centerline(ptr)) { + tary = TypeAry::make(Type::BOTTOM, tary->_size, tary->_stable); + } return make(NotNull, NULL, tary, lazy_klass, false, off, InstanceBot, speculative, depth); } diff --git a/hotspot/src/share/vm/opto/vectornode.cpp b/hotspot/src/share/vm/opto/vectornode.cpp index b4a07799efb..b6d73ecf571 100644 --- a/hotspot/src/share/vm/opto/vectornode.cpp +++ b/hotspot/src/share/vm/opto/vectornode.cpp @@ -250,7 +250,6 @@ VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, uint vlen, BasicType b int vopc = VectorNode::opcode(opc, bt); // This method should not be called for unimplemented vectors. guarantee(vopc > 0, err_msg_res("Vector for '%s' is not implemented", NodeClassNames[opc])); - switch (vopc) { case Op_AddVB: return new AddVBNode(n1, n2, vt); case Op_AddVS: return new AddVSNode(n1, n2, vt); @@ -441,3 +440,72 @@ Node* ExtractNode::make(Node* v, uint position, BasicType bt) { return NULL; } +int ReductionNode::opcode(int opc, BasicType bt) { + int vopc = opc; + switch (opc) { + case Op_AddI: + assert(bt == T_INT, "must be"); + vopc = Op_AddReductionVI; + break; + case Op_AddL: + assert(bt == T_LONG, "must be"); + vopc = Op_AddReductionVL; + break; + case Op_AddF: + assert(bt == T_FLOAT, "must be"); + vopc = Op_AddReductionVF; + break; + case Op_AddD: + assert(bt == T_DOUBLE, "must be"); + vopc = Op_AddReductionVD; + break; + case Op_MulI: + assert(bt == T_INT, "must be"); + vopc = Op_MulReductionVI; + break; + case Op_MulF: + assert(bt == T_FLOAT, "must be"); + vopc = Op_MulReductionVF; + break; + case Op_MulD: + assert(bt == T_DOUBLE, "must be"); + vopc = Op_MulReductionVD; + break; + // TODO: add MulL for targets that support it + default: + break; + } + return vopc; +} + +// Return the appropriate reduction node. +ReductionNode* ReductionNode::make(int opc, Node *ctrl, Node* n1, Node* n2, BasicType bt) { + + int vopc = opcode(opc, bt); + + // This method should not be called for unimplemented vectors. + guarantee(vopc != opc, err_msg_res("Vector for '%s' is not implemented", NodeClassNames[opc])); + + switch (vopc) { + case Op_AddReductionVI: return new AddReductionVINode(ctrl, n1, n2); + case Op_AddReductionVL: return new AddReductionVLNode(ctrl, n1, n2); + case Op_AddReductionVF: return new AddReductionVFNode(ctrl, n1, n2); + case Op_AddReductionVD: return new AddReductionVDNode(ctrl, n1, n2); + case Op_MulReductionVI: return new MulReductionVINode(ctrl, n1, n2); + case Op_MulReductionVF: return new MulReductionVFNode(ctrl, n1, n2); + case Op_MulReductionVD: return new MulReductionVDNode(ctrl, n1, n2); + } + fatal(err_msg_res("Missed vector creation for '%s'", NodeClassNames[vopc])); + return NULL; +} + +bool ReductionNode::implemented(int opc, uint vlen, BasicType bt) { + if (is_java_primitive(bt) && + (vlen > 1) && is_power_of_2(vlen) && + Matcher::vector_size_supported(bt, vlen)) { + int vopc = ReductionNode::opcode(opc, bt); + return vopc != opc && Matcher::match_rule_supported(vopc); + } + return false; +} + diff --git a/hotspot/src/share/vm/opto/vectornode.hpp b/hotspot/src/share/vm/opto/vectornode.hpp index 759d724335d..9256d53bf3a 100644 --- a/hotspot/src/share/vm/opto/vectornode.hpp +++ b/hotspot/src/share/vm/opto/vectornode.hpp @@ -90,6 +90,37 @@ class AddVINode : public VectorNode { virtual int Opcode() const; }; +//------------------------------ReductionNode------------------------------------ +// Perform reduction of a vector +class ReductionNode : public Node { + public: + ReductionNode(Node *ctrl, Node* in1, Node* in2) : Node(ctrl, in1, in2) {} + + static ReductionNode* make(int opc, Node *ctrl, Node* in1, Node* in2, BasicType bt); + static int opcode(int opc, BasicType bt); + static bool implemented(int opc, uint vlen, BasicType bt); +}; + +//------------------------------AddReductionVINode-------------------------------------- +// Vector add int as a reduction +class AddReductionVINode : public ReductionNode { +public: + AddReductionVINode(Node * ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return TypeInt::INT; } + virtual uint ideal_reg() const { return Op_RegI; } +}; + +//------------------------------AddReductionVLNode-------------------------------------- +// Vector add long as a reduction +class AddReductionVLNode : public ReductionNode { +public: + AddReductionVLNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return TypeLong::LONG; } + virtual uint ideal_reg() const { return Op_RegL; } +}; + //------------------------------AddVLNode-------------------------------------- // Vector add long class AddVLNode : public VectorNode { @@ -106,6 +137,16 @@ class AddVFNode : public VectorNode { virtual int Opcode() const; }; +//------------------------------AddReductionVFNode-------------------------------------- +// Vector add float as a reduction +class AddReductionVFNode : public ReductionNode { +public: + AddReductionVFNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return Type::FLOAT; } + virtual uint ideal_reg() const { return Op_RegF; } +}; + //------------------------------AddVDNode-------------------------------------- // Vector add double class AddVDNode : public VectorNode { @@ -114,6 +155,16 @@ class AddVDNode : public VectorNode { virtual int Opcode() const; }; +//------------------------------AddReductionVDNode-------------------------------------- +// Vector add double as a reduction +class AddReductionVDNode : public ReductionNode { +public: + AddReductionVDNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return Type::DOUBLE; } + virtual uint ideal_reg() const { return Op_RegD; } +}; + //------------------------------SubVBNode-------------------------------------- // Vector subtract byte class SubVBNode : public VectorNode { @@ -178,6 +229,16 @@ class MulVINode : public VectorNode { virtual int Opcode() const; }; +//------------------------------MulReductionVINode-------------------------------------- +// Vector multiply int as a reduction +class MulReductionVINode : public ReductionNode { +public: + MulReductionVINode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return TypeInt::INT; } + virtual uint ideal_reg() const { return Op_RegI; } +}; + //------------------------------MulVFNode-------------------------------------- // Vector multiply float class MulVFNode : public VectorNode { @@ -186,6 +247,16 @@ class MulVFNode : public VectorNode { virtual int Opcode() const; }; +//------------------------------MulReductionVFNode-------------------------------------- +// Vector multiply float as a reduction +class MulReductionVFNode : public ReductionNode { +public: + MulReductionVFNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return Type::FLOAT; } + virtual uint ideal_reg() const { return Op_RegF; } +}; + //------------------------------MulVDNode-------------------------------------- // Vector multiply double class MulVDNode : public VectorNode { @@ -194,6 +265,16 @@ class MulVDNode : public VectorNode { virtual int Opcode() const; }; +//------------------------------MulReductionVDNode-------------------------------------- +// Vector multiply double as a reduction +class MulReductionVDNode : public ReductionNode { +public: + MulReductionVDNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} + virtual int Opcode() const; + virtual const Type* bottom_type() const { return Type::DOUBLE; } + virtual uint ideal_reg() const { return Op_RegD; } +}; + //------------------------------DivVFNode-------------------------------------- // Vector divide float class DivVFNode : public VectorNode { diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index e69fdf460ad..864965e8181 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -94,7 +94,6 @@ # include "gc_implementation/shared/spaceCounters.hpp" # include "gc_implementation/shared/spaceDecorator.hpp" # include "gc_interface/collectedHeap.hpp" -# include "gc_interface/collectedHeap.inline.hpp" # include "gc_interface/gcCause.hpp" # include "interpreter/abstractInterpreter.hpp" # include "interpreter/bytecode.hpp" @@ -114,15 +113,12 @@ # include "memory/allocation.hpp" # include "memory/allocation.inline.hpp" # include "memory/barrierSet.hpp" -# include "memory/barrierSet.inline.hpp" # include "memory/blockOffsetTable.hpp" -# include "memory/blockOffsetTable.inline.hpp" # include "memory/cardTableModRefBS.hpp" # include "memory/collectorPolicy.hpp" # include "memory/defNewGeneration.hpp" # include "memory/gcLocker.hpp" # include "memory/genCollectedHeap.hpp" -# include "memory/genOopClosures.hpp" # include "memory/genRemSet.hpp" # include "memory/generation.hpp" # include "memory/heap.hpp" @@ -133,12 +129,11 @@ # include "memory/referencePolicy.hpp" # include "memory/referenceProcessor.hpp" # include "memory/resourceArea.hpp" -# include "memory/sharedHeap.hpp" # include "memory/space.hpp" # include "memory/threadLocalAllocBuffer.hpp" -# include "memory/threadLocalAllocBuffer.inline.hpp" # include "memory/universe.hpp" # include "memory/universe.inline.hpp" +# include "memory/virtualspace.hpp" # include "memory/watermark.hpp" # include "oops/arrayKlass.hpp" # include "oops/arrayOop.hpp" @@ -147,7 +142,6 @@ # include "oops/instanceOop.hpp" # include "oops/instanceRefKlass.hpp" # include "oops/klass.hpp" -# include "oops/klassPS.hpp" # include "oops/klassVtable.hpp" # include "oops/markOop.hpp" # include "oops/markOop.inline.hpp" @@ -211,7 +205,6 @@ # include "runtime/timer.hpp" # include "runtime/unhandledOops.hpp" # include "runtime/vframe.hpp" -# include "runtime/virtualspace.hpp" # include "runtime/vmThread.hpp" # include "runtime/vm_operations.hpp" # include "runtime/vm_version.hpp" @@ -305,7 +298,6 @@ # include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" # include "gc_implementation/g1/dirtyCardQueue.hpp" # include "gc_implementation/g1/g1BlockOffsetTable.hpp" -# include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" # include "gc_implementation/g1/g1OopClosures.hpp" # include "gc_implementation/g1/g1_globals.hpp" # include "gc_implementation/g1/ptrQueue.hpp" @@ -319,12 +311,11 @@ # include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" # include "gc_implementation/parallelScavenge/psGenerationCounters.hpp" # include "gc_implementation/parallelScavenge/psOldGen.hpp" -# include "gc_implementation/parallelScavenge/psParallelCompact.hpp" # include "gc_implementation/parallelScavenge/psVirtualspace.hpp" # include "gc_implementation/parallelScavenge/psYoungGen.hpp" # include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp" # include "gc_implementation/shared/gcPolicyCounters.hpp" -# include "gc_implementation/shared/parGCAllocBuffer.hpp" +# include "gc_implementation/shared/plab.hpp" #endif // INCLUDE_ALL_GCS #endif // !DONT_USE_PRECOMPILED_HEADER diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 2ae0e1bba9c..19d715ce36f 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -171,8 +171,27 @@ static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, nmetho // Now do we have a useful PcDesc? if (pc_desc == NULL || pc_desc->scope_decode_offset() == DebugInformationRecorder::serialized_null) { - // No debug information available for this pc - // vframeStream would explode if we try and walk the frames. + // No debug information is available for this PC. + // + // vframeStreamCommon::fill_from_frame() will decode the frame depending + // on the state of the thread. + // + // Case #1: If the thread is in Java (state == _thread_in_Java), then + // the vframeStreamCommon object will be filled as if the frame were a native + // compiled frame. Therefore, no debug information is needed. + // + // Case #2: If the thread is in any other state, then two steps will be performed: + // - if asserts are enabled, found_bad_method_frame() will be called and + // the assert in found_bad_method_frame() will be triggered; + // - if asserts are disabled, the vframeStreamCommon object will be filled + // as if it were a native compiled frame. + // + // Case (2) is similar to the way interpreter frames are processed in + // vframeStreamCommon::fill_from_interpreter_frame in case no valid BCI + // was found for an interpreted frame. If asserts are enabled, the assert + // in found_bad_method_frame() will be triggered. If asserts are disabled, + // the vframeStreamCommon object will be filled afterwards as if the + // interpreter were at the point of entering into the method. return false; } @@ -229,9 +248,10 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread, // a valid method. Then again we may have caught an interpreter // frame in the middle of construction and the bci field is // not yet valid. - - *method_p = method; if (!method->is_valid_method()) return false; + *method_p = method; // If the Method* found is invalid, it is + // ignored by forte_fill_call_trace_given_top(). + // So set method_p only if the Method is valid. address bcp = fr->interpreter_frame_bcp(); int bci = method->validate_bci_from_bcp(bcp); @@ -245,18 +265,33 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread, } -// Determine if 'fr' can be used to find an initial Java frame. -// Return false if it can not find a fully decipherable Java frame -// (in other words a frame that isn't safe to use in a vframe stream). -// Obviously if it can't even find a Java frame false will also be returned. +// Determine if a Java frame can be found starting with the frame 'fr'. // -// If we find a Java frame decipherable or not then by definition we have -// identified a method and that will be returned to the caller via method_p. -// If we can determine a bci that is returned also. (Hmm is it possible -// to return a method and bci and still return false? ) +// Check the return value of find_initial_Java_frame and the value of +// 'method_p' to decide on how use the results returned by this method. // -// The initial Java frame we find (if any) is return via initial_frame_p. +// If 'method_p' is not NULL, an initial Java frame has been found and +// the stack can be walked starting from that initial frame. In this case, +// 'method_p' points to the Method that the initial frame belongs to and +// the initial Java frame is returned in initial_frame_p. // +// find_initial_Java_frame() returns true if a Method has been found (i.e., +// 'method_p' is not NULL) and the initial frame that belongs to that Method +// is decipherable. +// +// A frame is considered to be decipherable: +// +// - if the frame is a compiled frame and a PCDesc is available; +// +// - if the frame is an interpreter frame that is valid or the thread is +// state (_thread_in_native || state == _thread_in_vm || state == _thread_blocked). +// +// Note that find_initial_Java_frame() can return false even if an initial +// Java method was found (e.g., there is no PCDesc available for the method). +// +// If 'method_p' is NULL, it was not possible to find a Java frame when +// walking the stack starting from 'fr'. In this case find_initial_Java_frame +// returns false. static bool find_initial_Java_frame(JavaThread* thread, frame* fr, @@ -276,8 +311,6 @@ static bool find_initial_Java_frame(JavaThread* thread, // recognizable to us. This should only happen if we are in a JRT_LEAF // or something called by a JRT_LEAF method. - - frame candidate = *fr; // If the starting frame we were given has no codeBlob associated with @@ -332,9 +365,11 @@ static bool find_initial_Java_frame(JavaThread* thread, nmethod* nm = (nmethod*) candidate.cb(); *method_p = nm->method(); - // If the frame isn't fully decipherable then the default - // value for the bci is a signal that we don't have a bci. - // If we have a decipherable frame this bci value will + // If the frame is not decipherable, then the value of -1 + // for the BCI is used to signal that no BCI is available. + // Furthermore, the method returns false in this case. + // + // If a decipherable frame is available, the BCI value will // not be used. *bci_p = -1; @@ -345,9 +380,9 @@ static bool find_initial_Java_frame(JavaThread* thread, if (nm->is_native_method()) return true; - // If it isn't decipherable then we have found a pc that doesn't - // have a PCDesc that can get us a bci however we did find - // a method + // If the frame is not decipherable, then a PC was found + // that does not have a PCDesc from which a BCI can be obtained. + // Nevertheless, a Method was found. if (!is_decipherable_compiled_frame(thread, &candidate, nm)) { return false; @@ -356,7 +391,7 @@ static bool find_initial_Java_frame(JavaThread* thread, // is_decipherable_compiled_frame may modify candidate's pc *initial_frame_p = candidate; - assert(nm->pc_desc_at(candidate.pc()) != NULL, "if it's decipherable then pc must be valid"); + assert(nm->pc_desc_at(candidate.pc()) != NULL, "debug information must be available if the frame is decipherable"); return true; } @@ -386,17 +421,17 @@ static void forte_fill_call_trace_given_top(JavaThread* thd, frame initial_Java_frame; Method* method; - int bci; + int bci = -1; // assume BCI is not available for method + // update with correct information if available int count; count = 0; assert(trace->frames != NULL, "trace->frames must be non-NULL"); - bool fully_decipherable = find_initial_Java_frame(thd, &top_frame, &initial_Java_frame, &method, &bci); - - // The frame might not be walkable but still recovered a method - // (e.g. an nmethod with no scope info for the pc) + // Walk the stack starting from 'top_frame' and search for an initial Java frame. + find_initial_Java_frame(thd, &top_frame, &initial_Java_frame, &method, &bci); + // Check if a Java Method has been found. if (method == NULL) return; if (!method->is_valid_method()) { @@ -404,29 +439,6 @@ static void forte_fill_call_trace_given_top(JavaThread* thd, return; } - // We got a Java frame however it isn't fully decipherable - // so it won't necessarily be safe to use it for the - // initial frame in the vframe stream. - - if (!fully_decipherable) { - // Take whatever method the top-frame decoder managed to scrape up. - // We look further at the top frame only if non-safepoint - // debugging information is available. - count++; - trace->num_frames = count; - trace->frames[0].method_id = method->find_jmethod_id_or_null(); - if (!method->is_native()) { - trace->frames[0].lineno = bci; - } else { - trace->frames[0].lineno = -3; - } - - if (!initial_Java_frame.safe_for_sender(thd)) return; - - RegisterMap map(thd, false); - initial_Java_frame = initial_Java_frame.sender(&map); - } - vframeStreamForte st(thd, initial_Java_frame, false); for (; !st.at_end() && count < depth; st.forte_next(), count++) { diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index ca3887bd6f1..63d865bca49 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -84,6 +84,9 @@ static jint CurrentVersion = JNI_VERSION_1_8; +#ifdef _WIN32 +extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* ); +#endif // The DT_RETURN_MARK macros create a scoped object to fire the dtrace // '-return' probe regardless of the return path is taken out of the function. @@ -3924,7 +3927,7 @@ void execute_internal_vm_tests() { DT_RETURN_MARK_DECL(CreateJavaVM, jint , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref)); -_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) { +static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { HOTSPOT_JNI_CREATEJAVAVM_ENTRY((void **) vm, penv, args); jint result = JNI_ERR; @@ -4001,18 +4004,14 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v } #ifndef PRODUCT - #ifndef CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() - #endif - // Check if we should compile all classes on bootclasspath if (CompileTheWorld) ClassLoader::compile_the_world(); if (ReplayCompiles) ciReplay::replay(thread); // Some platforms (like Win*) need a wrapper around these test // functions in order to properly handle error conditions. - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(test_error_handler); - CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(execute_internal_vm_tests); + test_error_handler(); + execute_internal_vm_tests(); #endif // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving. @@ -4045,8 +4044,23 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v } return result; + } +_JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) { + jint result = 0; + // On Windows, let CreateJavaVM run with SEH protection +#ifdef _WIN32 + __try { +#endif + result = JNI_CreateJavaVM_inner(vm, penv, args); +#ifdef _WIN32 + } __except(topLevelExceptionFilter((_EXCEPTION_POINTERS*)_exception_info())) { + // Nothing to do. + } +#endif + return result; +} _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **vm_buf, jsize bufLen, jsize *numVMs) { // See bug 4367188, the wrapper can sometimes cause VM crashes diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index e4204b200f2..9b5b9b1fbf5 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -1465,63 +1465,26 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass)) } JVM_END -// should be in InstanceKlass.cpp, but is here for historical reasons -Klass* InstanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, - bool* inner_is_member, - TRAPS) { - Thread* thread = THREAD; - InnerClassesIterator iter(k); - if (iter.length() == 0) { - // No inner class info => no declaring class +JVM_ENTRY(jstring, JVM_GetSimpleBinaryName(JNIEnv *env, jclass cls)) +{ + oop mirror = JNIHandles::resolve_non_null(cls); + if (java_lang_Class::is_primitive(mirror) || + !java_lang_Class::as_Klass(mirror)->oop_is_instance()) { return NULL; } - - constantPoolHandle i_cp(thread, k->constants()); - - bool found = false; - Klass* ok; - instanceKlassHandle outer_klass; - *inner_is_member = false; - - // Find inner_klass attribute - for (; !iter.done() && !found; iter.next()) { - int ioff = iter.inner_class_info_index(); - int ooff = iter.outer_class_info_index(); - int noff = iter.inner_name_index(); - if (ioff != 0) { - // Check to see if the name matches the class we're looking for - // before attempting to find the class. - if (i_cp->klass_name_at_matches(k, ioff)) { - Klass* inner_klass = i_cp->klass_at(ioff, CHECK_NULL); - found = (k() == inner_klass); - if (found && ooff != 0) { - ok = i_cp->klass_at(ooff, CHECK_NULL); - outer_klass = instanceKlassHandle(thread, ok); - *inner_is_member = true; - } - } + instanceKlassHandle k(THREAD, InstanceKlass::cast(java_lang_Class::as_Klass(mirror))); + int ooff = 0, noff = 0; + if (InstanceKlass::find_inner_classes_attr(k, &ooff, &noff, THREAD)) { + if (noff != 0) { + constantPoolHandle i_cp(thread, k->constants()); + Symbol* name = i_cp->symbol_at(noff); + Handle str = java_lang_String::create_from_symbol(name, CHECK_NULL); + return (jstring) JNIHandles::make_local(env, str()); } } - - if (found && outer_klass.is_null()) { - // It may be anonymous; try for that. - int encl_method_class_idx = k->enclosing_method_class_index(); - if (encl_method_class_idx != 0) { - ok = i_cp->klass_at(encl_method_class_idx, CHECK_NULL); - outer_klass = instanceKlassHandle(thread, ok); - *inner_is_member = false; - } - } - - // If no inner class attribute found for this class. - if (outer_klass.is_null()) return NULL; - - // Throws an exception if outer klass has not declared k as an inner klass - // We need evidence that each klass knows about the other, or else - // the system could allow a spoof of an inner class to gain access rights. - Reflection::check_for_inner_class(outer_klass, k, *inner_is_member, CHECK_NULL); - return outer_klass(); + return NULL; } +JVM_END JVM_ENTRY(jstring, JVM_GetClassSignature(JNIEnv *env, jclass cls)) assert (cls != NULL, "illegal class"); diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index 0bfce5ec62e..beb5bc8f32a 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -426,6 +426,9 @@ JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass); JNIEXPORT jclass JNICALL JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass); +JNIEXPORT jstring JNICALL +JVM_GetSimpleBinaryName(JNIEnv *env, jclass ofClass); + /* Generics support (JDK 1.5) */ JNIEXPORT jstring JNICALL JVM_GetClassSignature(JNIEnv *env, jclass cls); diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index 19f55acb0bd..5460707b853 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -3433,10 +3433,7 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { pv_node = pv_node->previous_versions()) { cp_cache = pv_node->constants()->cache(); if (cp_cache != NULL) { - cp_cache->adjust_method_entries(_matching_old_methods, - _matching_new_methods, - _matching_methods_length, - &trace_name_printed); + cp_cache->adjust_method_entries(pv_node, &trace_name_printed); } } } @@ -3992,14 +3989,13 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass, // the_class doesn't have a cache yet so copy it the_class->set_cached_class_file(scratch_class->get_cached_class_file()); } -#ifndef PRODUCT - else { - assert(the_class->get_cached_class_file_bytes() == - scratch_class->get_cached_class_file_bytes(), "cache ptrs must match"); - assert(the_class->get_cached_class_file_len() == - scratch_class->get_cached_class_file_len(), "cache lens must match"); + else if (scratch_class->get_cached_class_file_bytes() != + the_class->get_cached_class_file_bytes()) { + // The same class can be present twice in the scratch classes list or there + // are multiple concurrent RetransformClasses calls on different threads. + // In such cases we have to deallocate scratch_class cached_class_file_bytes. + os::free(scratch_class->get_cached_class_file_bytes()); } -#endif // NULL out in scratch class to not delete twice. The class to be redefined // always owns these bytes. @@ -4086,10 +4082,7 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass, MemberNameTable* mnt = the_class->member_names(); if (mnt != NULL) { bool trace_name_printed = false; - mnt->adjust_method_entries(_matching_old_methods, - _matching_new_methods, - _matching_methods_length, - &trace_name_printed); + mnt->adjust_method_entries(the_class(), &trace_name_printed); } // Fix Resolution Error table also to remove old constant pools diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index edbd865db92..f89ac74962a 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -35,6 +35,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" +#include "prims/jvmtiRedefineClassesTrace.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/javaCalls.hpp" #include "runtime/reflection.hpp" @@ -939,6 +940,24 @@ int MethodHandles::find_MemberNames(KlassHandle k, return rfill + overflow; } +// Get context class for a CallSite instance: either extract existing context or use default one. +InstanceKlass* MethodHandles::get_call_site_context(oop call_site) { + // In order to extract a context the following traversal is performed: + // CallSite.context => Cleaner.referent => Class._klass => Klass + assert(java_lang_invoke_CallSite::is_instance(call_site), ""); + oop context_oop = java_lang_invoke_CallSite::context_volatile(call_site); + if (oopDesc::is_null(context_oop)) { + return NULL; // The context hasn't been initialized yet. + } + oop context_class_oop = java_lang_ref_Reference::referent(context_oop); + if (oopDesc::is_null(context_class_oop)) { + // The context reference was cleared by GC, so current dependency context + // isn't usable anymore. Context should be fetched from CallSite again. + return NULL; + } + return InstanceKlass::cast(java_lang_Class::as_Klass(context_class_oop)); +} + //------------------------------------------------------------------------------ // MemberNameTable // @@ -965,21 +984,41 @@ void MemberNameTable::add_member_name(jweak mem_name_wref) { #if INCLUDE_JVMTI // It is called at safepoint only for RedefineClasses -void MemberNameTable::adjust_method_entries(Method** old_methods, Method** new_methods, - int methods_length, bool *trace_name_printed) { +void MemberNameTable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) { assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint"); // For each redefined method - for (int j = 0; j < methods_length; j++) { - Method* old_method = old_methods[j]; - Method* new_method = new_methods[j]; + for (int idx = 0; idx < length(); idx++) { + oop mem_name = JNIHandles::resolve(this->at(idx)); + if (mem_name == NULL) { + continue; + } + Method* old_method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name); - // search the MemberNameTable for uses of either obsolete or EMCP methods - for (int idx = 0; idx < length(); idx++) { - oop mem_name = JNIHandles::resolve(this->at(idx)); - if (mem_name != NULL) { - java_lang_invoke_MemberName::adjust_vmtarget(mem_name, old_method, new_method, - trace_name_printed); + if (old_method == NULL || !old_method->is_old()) { + continue; // skip uninteresting entries + } + if (old_method->is_deleted()) { + // skip entries with deleted methods + continue; + } + Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum()); + + assert(new_method != NULL, "method_with_idnum() should not be NULL"); + assert(old_method != new_method, "sanity check"); + + java_lang_invoke_MemberName::set_vmtarget(mem_name, 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", + old_method->method_holder()->external_name())); + *trace_name_printed = true; } + // RC_TRACE macro has an embedded ResourceMark + RC_TRACE(0x00400000, ("MemberName method update: %s(%s)", + new_method->name()->as_C_string(), + new_method->signature()->as_C_string())); } } } @@ -994,22 +1033,8 @@ void MemberNameTable::adjust_method_entries(Method** old_methods, Method** new_m // that intrinsic (non-JNI) native methods are defined in HotSpot. // -JVM_ENTRY(jint, MHN_getConstant(JNIEnv *env, jobject igcls, jint which)) { - switch (which) { - case MethodHandles::GC_COUNT_GWT: -#ifdef COMPILER2 - return true; -#else - return false; -#endif - } - return 0; -} -JVM_END - #ifndef PRODUCT #define EACH_NAMED_CON(template, requirement) \ - template(MethodHandles,GC_COUNT_GWT) \ template(java_lang_invoke_MemberName,MN_IS_METHOD) \ template(java_lang_invoke_MemberName,MN_IS_CONSTRUCTOR) \ template(java_lang_invoke_MemberName,MN_IS_FIELD) \ @@ -1019,7 +1044,6 @@ JVM_END template(java_lang_invoke_MemberName,MN_SEARCH_INTERFACES) \ template(java_lang_invoke_MemberName,MN_REFERENCE_KIND_SHIFT) \ template(java_lang_invoke_MemberName,MN_REFERENCE_KIND_MASK) \ - template(MethodHandles,GC_LAMBDA_SUPPORT) \ /*end*/ #define IGNORE_REQ(req_expr) /* req_expr */ @@ -1246,7 +1270,7 @@ JVM_END JVM_ENTRY(void, MHN_setCallSiteTargetNormal(JNIEnv* env, jobject igcls, jobject call_site_jh, jobject target_jh)) { Handle call_site(THREAD, JNIHandles::resolve_non_null(call_site_jh)); - Handle target (THREAD, JNIHandles::resolve(target_jh)); + Handle target (THREAD, JNIHandles::resolve_non_null(target_jh)); { // Walk all nmethods depending on this call site. MutexLocker mu(Compile_lock, thread); @@ -1258,7 +1282,7 @@ JVM_END JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobject call_site_jh, jobject target_jh)) { Handle call_site(THREAD, JNIHandles::resolve_non_null(call_site_jh)); - Handle target (THREAD, JNIHandles::resolve(target_jh)); + Handle target (THREAD, JNIHandles::resolve_non_null(target_jh)); { // Walk all nmethods depending on this call site. MutexLocker mu(Compile_lock, thread); @@ -1268,6 +1292,33 @@ JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobjec } JVM_END +JVM_ENTRY(void, MHN_invalidateDependentNMethods(JNIEnv* env, jobject igcls, jobject call_site_jh)) { + Handle call_site(THREAD, JNIHandles::resolve_non_null(call_site_jh)); + { + // Walk all nmethods depending on this call site. + MutexLocker mu1(Compile_lock, thread); + + CallSiteDepChange changes(call_site(), Handle()); + + InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site()); + if (ctxk == NULL) { + return; // No dependencies to invalidate yet. + } + int marked = 0; + { + MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); + marked = ctxk->mark_dependent_nmethods(changes); + } + java_lang_invoke_CallSite::set_context_volatile(call_site(), NULL); // Reset call site to initial state + if (marked > 0) { + // At least one nmethod has been marked for deoptimization + VM_Deoptimize op; + VMThread::execute(&op); + } + } +} +JVM_END + /** * Throws a java/lang/UnsupportedOperationException unconditionally. * This is required by the specification of MethodHandle.invoke if @@ -1313,7 +1364,6 @@ static JNINativeMethod MHN_methods[] = { {CC"init", CC"("MEM""OBJ")V", FN_PTR(MHN_init_Mem)}, {CC"expand", CC"("MEM")V", FN_PTR(MHN_expand_Mem)}, {CC"resolve", CC"("MEM""CLS")"MEM, FN_PTR(MHN_resolve_Mem)}, - {CC"getConstant", CC"(I)I", FN_PTR(MHN_getConstant)}, // static native int getNamedCon(int which, Object[] name) {CC"getNamedCon", CC"(I["OBJ")I", FN_PTR(MHN_getNamedCon)}, // static native int getMembers(Class defc, String matchName, String matchSig, @@ -1322,6 +1372,7 @@ static JNINativeMethod MHN_methods[] = { {CC"objectFieldOffset", CC"("MEM")J", FN_PTR(MHN_objectFieldOffset)}, {CC"setCallSiteTargetNormal", CC"("CS""MH")V", FN_PTR(MHN_setCallSiteTargetNormal)}, {CC"setCallSiteTargetVolatile", CC"("CS""MH")V", FN_PTR(MHN_setCallSiteTargetVolatile)}, + {CC"invalidateDependentNMethods", CC"("CS")V", FN_PTR(MHN_invalidateDependentNMethods)}, {CC"staticFieldOffset", CC"("MEM")J", FN_PTR(MHN_staticFieldOffset)}, {CC"staticFieldBase", CC"("MEM")"OBJ, FN_PTR(MHN_staticFieldBase)}, {CC"getMemberVMInfo", CC"("MEM")"OBJ, FN_PTR(MHN_getMemberVMInfo)} diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index 2d0ba43e8d5..5dd69bd42ff 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,6 +68,9 @@ class MethodHandles: AllStatic { // bit values for suppress argument to expand_MemberName: enum { _suppress_defc = 1, _suppress_name = 2, _suppress_type = 4 }; + // CallSite support + static InstanceKlass* get_call_site_context(oop call_site); + // Generate MethodHandles adapters. static bool generate_adapters(); @@ -125,11 +128,6 @@ class MethodHandles: AllStatic { return signature_polymorphic_name_id(klass, name) != vmIntrinsics::_none; } - enum { - // format of query to getConstant: - GC_COUNT_GWT = 4, - GC_LAMBDA_SUPPORT = 5 - }; static int get_named_constant(int which, Handle name_box, TRAPS); public: @@ -243,10 +241,8 @@ class MemberNameTable : public GrowableArray { #if INCLUDE_JVMTI // RedefineClasses() API support: - // If a MemberName refers to old_method then update it - // to refer to new_method. - void adjust_method_entries(Method** old_methods, Method** new_methods, - int methods_length, bool *trace_name_printed); + // If a MemberName refers to old_method then update it to refer to new_method. + void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed); #endif // INCLUDE_JVMTI }; diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 47921c6a2bc..cadf5a0c2e3 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -172,18 +172,6 @@ jint Unsafe_invocation_key_to_method_slot(jint key) { oop p = JNIHandles::resolve(obj); \ OrderAccess::release_store_fence((volatile type_name*)index_oop_from_field_offset_long(p, offset), x); -// Macros for oops that check UseCompressedOops - -#define GET_OOP_FIELD(obj, offset, v) \ - oop p = JNIHandles::resolve(obj); \ - oop v; \ - if (UseCompressedOops) { \ - narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); \ - v = oopDesc::decode_heap_oop(n); \ - } else { \ - v = *(oop*)index_oop_from_field_offset_long(p, offset); \ - } - // Get/SetObject must be special-cased, since it works with handles. @@ -192,7 +180,14 @@ jint Unsafe_invocation_key_to_method_slot(jint key) { // That is, it should be in the range [0, MAX_OBJECT_SIZE]. UNSAFE_ENTRY(jobject, Unsafe_GetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) UnsafeWrapper("Unsafe_GetObject"); - GET_OOP_FIELD(obj, offset, v) + oop p = JNIHandles::resolve(obj); + oop v; + if (UseCompressedOops) { + narrowOop n = *(narrowOop*)index_oop_from_field_offset_long(p, offset); + v = oopDesc::decode_heap_oop(n); + } else { + v = *(oop*)index_oop_from_field_offset_long(p, offset); + } jobject ret = JNIHandles::make_local(env, v); #if INCLUDE_ALL_GCS // We could be accessing the referent field in a reference @@ -261,6 +256,25 @@ UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject OrderAccess::fence(); UNSAFE_END +UNSAFE_ENTRY(jobject, Unsafe_GetUncompressedObject(JNIEnv *env, jobject unsafe, jlong addr)) + UnsafeWrapper("Unsafe_GetUncompressedObject"); + oop v = *(oop*) (address) addr; + return JNIHandles::make_local(env, v); +UNSAFE_END + +UNSAFE_ENTRY(jclass, Unsafe_GetJavaMirror(JNIEnv *env, jobject unsafe, jlong metaspace_klass)) + UnsafeWrapper("Unsafe_GetJavaMirror"); + Klass* klass = (Klass*) (address) metaspace_klass; + return (jclass) JNIHandles::make_local(klass->java_mirror()); +UNSAFE_END + +UNSAFE_ENTRY(jlong, Unsafe_GetKlassPointer(JNIEnv *env, jobject unsafe, jobject obj)) + UnsafeWrapper("Unsafe_GetKlassPointer"); + oop o = JNIHandles::resolve(obj); + jlong klass = (jlong) (address) o->klass(); + return klass; +UNSAFE_END + #ifndef SUPPORTS_NATIVE_CX8 // VM_Version::supports_cx8() is a surrogate for 'supports atomic long memory ops'. @@ -324,6 +338,24 @@ UNSAFE_END #endif // not SUPPORTS_NATIVE_CX8 +UNSAFE_ENTRY(jboolean, Unsafe_isBigEndian0(JNIEnv *env, jobject unsafe)) + UnsafeWrapper("Unsafe_IsBigEndian0"); + { +#ifdef VM_LITTLE_ENDIAN + return false; +#else + return true; +#endif + } +UNSAFE_END + +UNSAFE_ENTRY(jint, Unsafe_unalignedAccess0(JNIEnv *env, jobject unsafe)) + UnsafeWrapper("Unsafe_UnalignedAccess0"); + { + return UseUnalignedAccesses; + } +UNSAFE_END + #define DEFINE_GETSETOOP(jboolean, Boolean) \ \ UNSAFE_ENTRY(jboolean, Unsafe_Get##Boolean##140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) \ @@ -1204,6 +1236,10 @@ static JNINativeMethod methods[] = { {CC"getObjectVolatile",CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObjectVolatile)}, {CC"putObjectVolatile",CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObjectVolatile)}, + {CC"getUncompressedObject", CC"("ADR")"OBJ, FN_PTR(Unsafe_GetUncompressedObject)}, + {CC"getJavaMirror", CC"("ADR")"CLS, FN_PTR(Unsafe_GetJavaMirror)}, + {CC"getKlassPointer", CC"("OBJ")"ADR, FN_PTR(Unsafe_GetKlassPointer)}, + DECLARE_GETPUTOOP(Boolean, Z), DECLARE_GETPUTOOP(Byte, B), DECLARE_GETPUTOOP(Short, S), @@ -1261,6 +1297,9 @@ static JNINativeMethod methods[] = { {CC"loadFence", CC"()V", FN_PTR(Unsafe_LoadFence)}, {CC"storeFence", CC"()V", FN_PTR(Unsafe_StoreFence)}, {CC"fullFence", CC"()V", FN_PTR(Unsafe_FullFence)}, + + {CC"isBigEndian0", CC"()Z", FN_PTR(Unsafe_isBigEndian0)}, + {CC"unalignedAccess0", CC"()Z", FN_PTR(Unsafe_unalignedAccess0)} }; #undef CC diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 3c833ce3995..ff8acdcb9bc 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -89,6 +89,10 @@ WB_ENTRY(jint, WB_GetVMPageSize(JNIEnv* env, jobject o)) return os::vm_page_size(); WB_END +WB_ENTRY(jlong, WB_GetVMLargePageSize(JNIEnv* env, jobject o)) + return os::large_page_size(); +WB_END + class WBIsKlassAliveClosure : public KlassClosure { Symbol* _name; bool _found; @@ -819,46 +823,9 @@ WB_ENTRY(void, WB_UnlockCompilation(JNIEnv* env, jobject o)) mo.notify_all(); WB_END -void WhiteBox::sweeper_thread_entry(JavaThread* thread, TRAPS) { - guarantee(WhiteBoxAPI, "internal testing API :: WhiteBox has to be enabled"); - { - MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - NMethodSweeper::_should_sweep = true; - } - NMethodSweeper::possibly_sweep(); -} - -JavaThread* WhiteBox::create_sweeper_thread(TRAPS) { - // create sweeper thread w/ custom entry -- one iteration instead of loop - CodeCacheSweeperThread* sweeper_thread = new CodeCacheSweeperThread(); - sweeper_thread->set_entry_point(&WhiteBox::sweeper_thread_entry); - - // create j.l.Thread object and associate it w/ sweeper thread - { - // inherit deamon property from current thread - bool is_daemon = java_lang_Thread::is_daemon(JavaThread::current()->threadObj()); - - HandleMark hm(THREAD); - Handle thread_group(THREAD, Universe::system_thread_group()); - const char* name = "WB Sweeper thread"; - sweeper_thread->allocate_threadObj(thread_group, name, is_daemon, THREAD); - } - - { - MutexLocker mu(Threads_lock, THREAD); - Threads::add(sweeper_thread); - } - return sweeper_thread; -} - -WB_ENTRY(jobject, WB_ForceNMethodSweep(JNIEnv* env, jobject o)) - JavaThread* sweeper_thread = WhiteBox::create_sweeper_thread(Thread::current()); - if (sweeper_thread == NULL) { - return NULL; - } - jobject result = JNIHandles::make_local(env, sweeper_thread->threadObj()); - Thread::start(sweeper_thread); - return result; +WB_ENTRY(void, WB_ForceNMethodSweep(JNIEnv* env, jobject o)) + // Force a code cache sweep and block until it finished + NMethodSweeper::force_sweep(); WB_END WB_ENTRY(jboolean, WB_IsInStringTable(JNIEnv* env, jobject o, jstring javaString)) @@ -1234,7 +1201,7 @@ int WhiteBox::offset_for_field(const char* field_name, oop object, if (res == NULL) { tty->print_cr("Invalid layout of %s at %s", ik->external_name(), name_symbol->as_C_string()); - fatal("Invalid layout of preloaded class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); } //fetch the field at the offset we've found @@ -1296,19 +1263,20 @@ void WhiteBox::register_methods(JNIEnv* env, jclass wbclass, JavaThread* thread, #define CC (char*) static JNINativeMethod methods[] = { - {CC"getObjectAddress", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress }, - {CC"getObjectSize", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize }, - {CC"isObjectInOldGen", CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen }, + {CC"getObjectAddress0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress }, + {CC"getObjectSize0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize }, + {CC"isObjectInOldGen0", CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen }, {CC"getHeapOopSize", CC"()I", (void*)&WB_GetHeapOopSize }, {CC"getVMPageSize", CC"()I", (void*)&WB_GetVMPageSize }, + {CC"getVMLargePageSize", CC"()J", (void*)&WB_GetVMLargePageSize}, {CC"isClassAlive0", CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive }, - {CC"parseCommandLine", + {CC"parseCommandLine0", CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;", (void*) &WB_ParseCommandLine }, - {CC"addToBootstrapClassLoaderSearch", CC"(Ljava/lang/String;)V", + {CC"addToBootstrapClassLoaderSearch0", CC"(Ljava/lang/String;)V", (void*)&WB_AddToBootstrapClassLoaderSearch}, - {CC"addToSystemClassLoaderSearch", CC"(Ljava/lang/String;)V", + {CC"addToSystemClassLoaderSearch0", CC"(Ljava/lang/String;)V", (void*)&WB_AddToSystemClassLoaderSearch}, {CC"getCompressedOopsMaxHeapSize", CC"()J", (void*)&WB_GetCompressedOopsMaxHeapSize}, @@ -1318,7 +1286,7 @@ static JNINativeMethod methods[] = { {CC"stressVirtualSpaceResize",CC"(JJJ)I", (void*)&WB_StressVirtualSpaceResize}, #if INCLUDE_ALL_GCS {CC"g1InConcurrentMark", CC"()Z", (void*)&WB_G1InConcurrentMark}, - {CC"g1IsHumongous", CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous }, + {CC"g1IsHumongous0", CC"(Ljava/lang/Object;)Z", (void*)&WB_G1IsHumongous }, {CC"g1NumMaxRegions", CC"()J", (void*)&WB_G1NumMaxRegions }, {CC"g1NumFreeRegions", CC"()J", (void*)&WB_G1NumFreeRegions }, {CC"g1RegionSize", CC"()I", (void*)&WB_G1RegionSize }, @@ -1339,29 +1307,29 @@ static JNINativeMethod methods[] = { #endif // INCLUDE_NMT {CC"deoptimizeFrames", CC"(Z)I", (void*)&WB_DeoptimizeFrames }, {CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll }, - {CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;Z)I", + {CC"deoptimizeMethod0", CC"(Ljava/lang/reflect/Executable;Z)I", (void*)&WB_DeoptimizeMethod }, - {CC"isMethodCompiled", CC"(Ljava/lang/reflect/Executable;Z)Z", + {CC"isMethodCompiled0", CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_IsMethodCompiled }, - {CC"isMethodCompilable", CC"(Ljava/lang/reflect/Executable;IZ)Z", + {CC"isMethodCompilable0", CC"(Ljava/lang/reflect/Executable;IZ)Z", (void*)&WB_IsMethodCompilable}, - {CC"isMethodQueuedForCompilation", + {CC"isMethodQueuedForCompilation0", CC"(Ljava/lang/reflect/Executable;)Z", (void*)&WB_IsMethodQueuedForCompilation}, - {CC"makeMethodNotCompilable", + {CC"makeMethodNotCompilable0", CC"(Ljava/lang/reflect/Executable;IZ)V", (void*)&WB_MakeMethodNotCompilable}, - {CC"testSetDontInlineMethod", + {CC"testSetDontInlineMethod0", CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetDontInlineMethod}, - {CC"getMethodCompilationLevel", + {CC"getMethodCompilationLevel0", CC"(Ljava/lang/reflect/Executable;Z)I", (void*)&WB_GetMethodCompilationLevel}, - {CC"getMethodEntryBci", + {CC"getMethodEntryBci0", CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodEntryBci}, {CC"getCompileQueueSize", CC"(I)I", (void*)&WB_GetCompileQueueSize}, - {CC"testSetForceInlineMethod", + {CC"testSetForceInlineMethod0", CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod}, - {CC"enqueueMethodForCompilation", + {CC"enqueueMethodForCompilation0", CC"(Ljava/lang/reflect/Executable;II)Z", (void*)&WB_EnqueueMethodForCompilation}, - {CC"clearMethodState", + {CC"clearMethodState0", CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState}, {CC"lockCompilation", CC"()V", (void*)&WB_LockCompilation}, {CC"unlockCompilation", CC"()V", (void*)&WB_UnlockCompilation}, @@ -1400,9 +1368,9 @@ static JNINativeMethod methods[] = { {CC"incMetaspaceCapacityUntilGC", CC"(J)J", (void*)&WB_IncMetaspaceCapacityUntilGC }, {CC"metaspaceCapacityUntilGC", CC"()J", (void*)&WB_MetaspaceCapacityUntilGC }, {CC"getCPUFeatures", CC"()Ljava/lang/String;", (void*)&WB_GetCPUFeatures }, - {CC"getNMethod", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;", + {CC"getNMethod0", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;", (void*)&WB_GetNMethod }, - {CC"forceNMethodSweep0", CC"()Ljava/lang/Thread;", (void*)&WB_ForceNMethodSweep }, + {CC"forceNMethodSweep", CC"()V", (void*)&WB_ForceNMethodSweep }, {CC"allocateCodeBlob", CC"(II)J", (void*)&WB_AllocateCodeBlob }, {CC"freeCodeBlob", CC"(J)V", (void*)&WB_FreeCodeBlob }, {CC"getCodeHeapEntries", CC"(I)[Ljava/lang/Object;",(void*)&WB_GetCodeHeapEntries }, @@ -1412,7 +1380,7 @@ static JNINativeMethod methods[] = { {CC"getThreadStackSize", CC"()J", (void*)&WB_GetThreadStackSize }, {CC"getThreadRemainingStackSize", CC"()J", (void*)&WB_GetThreadRemainingStackSize }, {CC"assertMatchingSafepointCalls", CC"(ZZ)V", (void*)&WB_AssertMatchingSafepointCalls }, - {CC"isMonitorInflated", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated }, + {CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated }, {CC"forceSafepoint", CC"()V", (void*)&WB_ForceSafepoint }, {CC"getMethodBooleanOption", CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;", diff --git a/hotspot/src/share/vm/prims/whitebox.hpp b/hotspot/src/share/vm/prims/whitebox.hpp index 59754270e35..3ebada8fe5e 100644 --- a/hotspot/src/share/vm/prims/whitebox.hpp +++ b/hotspot/src/share/vm/prims/whitebox.hpp @@ -70,8 +70,6 @@ class WhiteBox : public AllStatic { Symbol* signature_symbol); static const char* lookup_jstring(const char* field_name, oop object); static bool lookup_bool(const char* field_name, oop object); - static void sweeper_thread_entry(JavaThread* thread, TRAPS); - static JavaThread* create_sweeper_thread(TRAPS); static int get_blob_type(const CodeBlob* code); static CodeHeap* get_code_heap(int blob_type); static CodeBlob* allocate_code_blob(int size, int blob_type); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index e2ba1c81050..cdd00e1c566 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -92,6 +92,8 @@ bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; bool Arguments::_UseOnStackReplacement = UseOnStackReplacement; bool Arguments::_BackgroundCompilation = BackgroundCompilation; bool Arguments::_ClipInlining = ClipInlining; +intx Arguments::_Tier3InvokeNotifyFreqLog = Tier3InvokeNotifyFreqLog; +intx Arguments::_Tier4InvocationThreshold = Tier4InvocationThreshold; char* Arguments::SharedArchivePath = NULL; @@ -240,6 +242,9 @@ void Arguments::init_version_specific_system_properties() { * and ignoring the value. Once the JDK version reaches the 'accept_until' * limit, we flatly refuse to admit the existence of the flag. This allows * a flag to die correctly over JDK releases using HSX. + * But now that HSX is no longer supported only options with a future + * accept_until value need to be listed, and the list can be pruned + * on each major release. */ typedef struct { const char* name; @@ -248,63 +253,8 @@ typedef struct { } ObsoleteFlag; static ObsoleteFlag obsolete_jvm_flags[] = { - { "UseTrainGC", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "UseSpecialLargeObjectHandling", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "UseOversizedCarHandling", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "TraceCarAllocation", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "PrintTrainGCProcessingStats", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "LogOfCarSpaceSize", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "OversizedCarThreshold", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "MinTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "DefaultTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "MaxTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "DelayTickAdjustment", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "ProcessingToTenuringRatio", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "MinTrainLength", JDK_Version::jdk(5), JDK_Version::jdk(7) }, - { "AppendRatio", JDK_Version::jdk_update(6,10), JDK_Version::jdk(7) }, - { "DefaultMaxRAM", JDK_Version::jdk_update(6,18), JDK_Version::jdk(7) }, - { "DefaultInitialRAMFraction", - JDK_Version::jdk_update(6,18), JDK_Version::jdk(7) }, - { "UseDepthFirstScavengeOrder", - JDK_Version::jdk_update(6,22), JDK_Version::jdk(7) }, - { "HandlePromotionFailure", - JDK_Version::jdk_update(6,24), JDK_Version::jdk(8) }, - { "MaxLiveObjectEvacuationRatio", - JDK_Version::jdk_update(6,24), JDK_Version::jdk(8) }, - { "ForceSharedSpaces", JDK_Version::jdk_update(6,25), JDK_Version::jdk(8) }, - { "UseParallelOldGCCompacting", - JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, - { "UseParallelDensePrefixUpdate", - JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, - { "UseParallelOldGCDensePrefix", - JDK_Version::jdk_update(6,27), JDK_Version::jdk(8) }, - { "AllowTransitionalJSR292", JDK_Version::jdk(7), JDK_Version::jdk(8) }, - { "UseCompressedStrings", JDK_Version::jdk(7), JDK_Version::jdk(8) }, - { "CMSPermGenPrecleaningEnabled", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "CMSTriggerPermRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "CMSInitiatingPermOccupancyFraction", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "AdaptivePermSizeWeight", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "PermGenPadding", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "PermMarkSweepDeadRatio", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "PermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "MaxPermSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "MinPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "MaxPermHeapExpansion", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "CMSRevisitStackSize", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "PrintRevisitStats", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UseVectoredExceptions", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UseSplitVerifier", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) }, - { "UseStringCache", JDK_Version::jdk(8), JDK_Version::jdk(9) }, { "UseOldInlining", JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "SafepointPollOffset", JDK_Version::jdk(9), JDK_Version::jdk(10) }, -#ifdef PRODUCT - { "DesiredMethodLimit", - JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, -#endif // PRODUCT - { "UseVMInterruptibleIO", JDK_Version::jdk(8), JDK_Version::jdk(9) }, { "UseBoundThreads", JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "DefaultThreadPriority", JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "NoYieldsInMicrolock", JDK_Version::jdk(9), JDK_Version::jdk(10) }, @@ -338,11 +288,8 @@ bool Arguments::is_newly_obsolete(const char *s, JDK_Version* version) { // =xxx form // [-|+] form size_t len = strlen(flag_status.name); - if (((strncmp(flag_status.name, s, len) == 0) && - (strlen(s) == len)) || - ((s[0] == '+' || s[0] == '-') && - (strncmp(flag_status.name, &s[1], len) == 0) && - (strlen(&s[1]) == len))) { + if ((strncmp(flag_status.name, s, len) == 0) && + (strlen(s) == len)){ if (JDK_Version::current().compare(flag_status.accept_until) == -1) { *version = flag_status.obsoleted_in; return true; @@ -858,17 +805,9 @@ bool Arguments::process_argument(const char* arg, return true; } + // Determine if the flag has '+', '-', or '=' characters. bool has_plus_minus = (*arg == '+' || *arg == '-'); const char* const argname = has_plus_minus ? arg + 1 : arg; - if (is_newly_obsolete(arg, &since)) { - char version[256]; - since.to_string(version, sizeof(version)); - warning("ignoring option %s; support was removed in %s", argname, version); - return true; - } - - // For locked flags, report a custom error message if available. - // Otherwise, report the standard unrecognized VM option. size_t arg_len; const char* equal_sign = strchr(argname, '='); @@ -878,6 +817,20 @@ bool Arguments::process_argument(const char* arg, arg_len = equal_sign - argname; } + // Construct a string which consists only of the argument name without '+', '-', or '='. + char stripped_argname[256]; + strncpy(stripped_argname, argname, arg_len); + stripped_argname[arg_len] = '\0'; //strncpy doesn't null terminate. + + if (is_newly_obsolete(stripped_argname, &since)) { + char version[256]; + since.to_string(version, sizeof(version)); + warning("ignoring option %s; support was removed in %s", stripped_argname, version); + return true; + } + + // For locked flags, report a custom error message if available. + // Otherwise, report the standard unrecognized VM option. Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true); if (found_flag != NULL) { char locked_message_buf[BUFLEN]; @@ -906,16 +859,8 @@ bool Arguments::process_argument(const char* arg, (fuzzy_matched->is_bool()) ? "(+/-)" : "", fuzzy_matched->_name, (fuzzy_matched->is_bool()) ? "" : "="); - if (is_newly_obsolete(fuzzy_matched->_name, &since)) { - char version[256]; - since.to_string(version, sizeof(version)); - jio_fprintf(defaultStream::error_stream(), - "Warning: support for %s was removed in %s\n", - fuzzy_matched->_name, - version); } } - } // allow for commandline "commenting out" options like -XX:#+Verbose return arg[0] == '#'; @@ -1069,6 +1014,14 @@ void Arguments::set_mode_flags(Mode mode) { AlwaysCompileLoopMethods = Arguments::_AlwaysCompileLoopMethods; UseOnStackReplacement = Arguments::_UseOnStackReplacement; BackgroundCompilation = Arguments::_BackgroundCompilation; + if (TieredCompilation) { + if (FLAG_IS_DEFAULT(Tier3InvokeNotifyFreqLog)) { + Tier3InvokeNotifyFreqLog = Arguments::_Tier3InvokeNotifyFreqLog; + } + if (FLAG_IS_DEFAULT(Tier4InvocationThreshold)) { + Tier4InvocationThreshold = Arguments::_Tier4InvocationThreshold; + } + } // Change from defaults based on mode switch (mode) { @@ -1607,12 +1560,15 @@ void Arguments::select_gc_ergonomically() { } else { FLAG_SET_ERGO(bool, UseParallelGC, true); } + } else { + FLAG_SET_ERGO(bool, UseSerialGC, true); } } void Arguments::select_gc() { if (!gc_selected()) { select_gc_ergonomically(); + guarantee(gc_selected(), "No GC selected"); } } @@ -1900,15 +1856,8 @@ void Arguments::set_heap_size() { } } -// This must be called after ergonomics because we want bytecode rewriting -// if the server compiler is used, or if UseSharedSpaces is disabled. +// This must be called after ergonomics. void Arguments::set_bytecode_flags() { - // Better not attempt to store into a read-only space. - if (UseSharedSpaces) { - FLAG_SET_DEFAULT(RewriteBytecodes, false); - FLAG_SET_DEFAULT(RewriteFrequentPairs, false); - } - if (!RewriteBytecodes) { FLAG_SET_DEFAULT(RewriteFrequentPairs, false); } @@ -2145,10 +2094,8 @@ bool Arguments::check_gc_consistency() { } if (UseParNewGC && !UseConcMarkSweepGC) { - // !UseConcMarkSweepGC means that we are using serial old gc. Unfortunately we don't - // set up UseSerialGC properly, so that can't be used in the check here. jio_fprintf(defaultStream::error_stream(), - "It is not possible to combine the ParNew young collector with the Serial old collector.\n"); + "It is not possible to combine the ParNew young collector with any collector other than CMS.\n"); return false; } @@ -2589,6 +2536,10 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) { Arguments::_UseOnStackReplacement = UseOnStackReplacement; Arguments::_ClipInlining = ClipInlining; Arguments::_BackgroundCompilation = BackgroundCompilation; + if (TieredCompilation) { + Arguments::_Tier3InvokeNotifyFreqLog = Tier3InvokeNotifyFreqLog; + Arguments::_Tier4InvocationThreshold = Tier4InvocationThreshold; + } // Setup flags for mixed which is the default set_mode_flags(_mixed); @@ -2764,7 +2715,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, char *options = NULL; if(pos != NULL) { - options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); + options = os::strdup_check_oom(pos + 1, mtInternal); } #if !INCLUDE_JVMTI if (valid_hprof_or_jdwp_agent(name, is_absolute_path)) { @@ -3070,8 +3021,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, } else if (match_option(option, "-Xnoagent")) { // For compatibility with classic. HotSpot refuses to load the old style agent.dll. } else if (match_option(option, "-Xboundthreads")) { - // Bind user level threads to kernel threads (Solaris only) - FLAG_SET_CMDLINE(bool, UseBoundThreads, true); + // Ignore silently for compatibility } else if (match_option(option, "-Xloggc:", &tail)) { // Redirect GC output to the file. -Xloggc: // ostream_init_log(), when called will use this filename @@ -3150,7 +3100,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize); } -#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. +#if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX. FLAG_SET_DEFAULT(UseLargePages, true); #endif @@ -3209,7 +3159,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, uintx max_tenuring_thresh = 0; if(!parse_uintx(tail, &max_tenuring_thresh, 0)) { jio_fprintf(defaultStream::error_stream(), - "Invalid MaxTenuringThreshold: %s\n", option->optionString); + "Improperly specified VM option 'MaxTenuringThreshold=%s'\n", tail); + return JNI_EINVAL; } FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh); @@ -3300,6 +3251,15 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, "ManagementServer is not supported in this VM.\n"); return JNI_ERR; #endif // INCLUDE_MANAGEMENT + // CreateMinidumpOnCrash is removed, and replaced by CreateCoredumpOnCrash + } else if (match_option(option, "-XX:+CreateMinidumpOnCrash")) { + FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, true); + jio_fprintf(defaultStream::output_stream(), + "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is on\n"); + } else if (match_option(option, "-XX:-CreateMinidumpOnCrash")) { + FLAG_SET_CMDLINE(bool, CreateCoredumpOnCrash, false); + jio_fprintf(defaultStream::output_stream(), + "CreateMinidumpOnCrash is replaced by CreateCoredumpOnCrash: CreateCoredumpOnCrash is off\n"); } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx // Skip -XX:Flags= since that case has already been handled if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { @@ -3355,8 +3315,7 @@ void Arguments::fix_appclasspath() { src ++; } - char* copy = AllocateHeap(strlen(src) + 1, mtInternal); - strncpy(copy, src, strlen(src) + 1); + char* copy = os::strdup_check_oom(src, mtInternal); // trim all trailing empty paths for (char* tail = copy + strlen(copy) - 1; tail >= copy && *tail == separator; tail--) { @@ -3514,15 +3473,14 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req if (os::is_headless_jre()) { const char* headless = Arguments::get_property("java.awt.headless"); if (headless == NULL) { - char envbuffer[128]; - if (!os::getenv("JAVA_AWT_HEADLESS", envbuffer, sizeof(envbuffer))) { + const char *headless_env = ::getenv("JAVA_AWT_HEADLESS"); + if (headless_env == NULL) { if (!add_property("java.awt.headless=true")) { return JNI_ENOMEM; } } else { char buffer[256]; - strcpy(buffer, "java.awt.headless="); - strcat(buffer, envbuffer); + jio_snprintf(buffer, sizeof(buffer), "java.awt.headless=%s", headless_env); if (!add_property(buffer)) { return JNI_ENOMEM; } @@ -3553,75 +3511,95 @@ jint Arguments::parse_java_tool_options_environment_variable(SysClassPath* scp_p } jint Arguments::parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p) { - const int N_MAX_OPTIONS = 64; - const int OPTION_BUFFER_SIZE = 1024; - char buffer[OPTION_BUFFER_SIZE]; + char *buffer = ::getenv(name); - // The variable will be ignored if it exceeds the length of the buffer. // Don't check this variable if user has special privileges // (e.g. unix su command). - if (os::getenv(name, buffer, sizeof(buffer)) && - !os::have_special_privileges()) { - JavaVMOption options[N_MAX_OPTIONS]; // Construct option array - jio_fprintf(defaultStream::error_stream(), - "Picked up %s: %s\n", name, buffer); - char* rd = buffer; // pointer to the input string (rd) - int i; - for (i = 0; i < N_MAX_OPTIONS;) { // repeat for all options in the input string - while (isspace(*rd)) rd++; // skip whitespace - if (*rd == 0) break; // we re done when the input string is read completely - - // The output, option string, overwrites the input string. - // Because of quoting, the pointer to the option string (wrt) may lag the pointer to - // input string (rd). - char* wrt = rd; - - options[i++].optionString = wrt; // Fill in option - while (*rd != 0 && !isspace(*rd)) { // unquoted strings terminate with a space or NULL - if (*rd == '\'' || *rd == '"') { // handle a quoted string - int quote = *rd; // matching quote to look for - rd++; // don't copy open quote - while (*rd != quote) { // include everything (even spaces) up until quote - if (*rd == 0) { // string termination means unmatched string - jio_fprintf(defaultStream::error_stream(), - "Unmatched quote in %s\n", name); - return JNI_ERR; - } - *wrt++ = *rd++; // copy to option string - } - rd++; // don't copy close quote - } else { - *wrt++ = *rd++; // copy to option string - } - } - // Need to check if we're done before writing a NULL, - // because the write could be to the byte that rd is pointing to. - if (*rd++ == 0) { - *wrt = 0; - break; - } - *wrt = 0; // Zero terminate option - } - // Construct JavaVMInitArgs structure and parse as if it was part of the command line - JavaVMInitArgs vm_args; - vm_args.version = JNI_VERSION_1_2; - vm_args.options = options; - vm_args.nOptions = i; - vm_args.ignoreUnrecognized = IgnoreUnrecognizedVMOptions; - - if (PrintVMOptions) { - const char* tail; - for (int i = 0; i < vm_args.nOptions; i++) { - const JavaVMOption *option = vm_args.options + i; - if (match_option(option, "-XX:", &tail)) { - logOption(tail); - } - } - } - - return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, Flag::ENVIRON_VAR)); + if (buffer == NULL || os::have_special_privileges()) { + return JNI_OK; } - return JNI_OK; + + if ((buffer = os::strdup(buffer)) == NULL) { + return JNI_ENOMEM; + } + + GrowableArray *options = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(2, true); // Construct option array + jio_fprintf(defaultStream::error_stream(), + "Picked up %s: %s\n", name, buffer); + char* rd = buffer; // pointer to the input string (rd) + while (true) { // repeat for all options in the input string + while (isspace(*rd)) rd++; // skip whitespace + if (*rd == 0) break; // we re done when the input string is read completely + + // The output, option string, overwrites the input string. + // Because of quoting, the pointer to the option string (wrt) may lag the pointer to + // input string (rd). + char* wrt = rd; + + JavaVMOption option; + option.optionString = wrt; + options->append(option); // Fill in option + while (*rd != 0 && !isspace(*rd)) { // unquoted strings terminate with a space or NULL + if (*rd == '\'' || *rd == '"') { // handle a quoted string + int quote = *rd; // matching quote to look for + rd++; // don't copy open quote + while (*rd != quote) { // include everything (even spaces) up until quote + if (*rd == 0) { // string termination means unmatched string + jio_fprintf(defaultStream::error_stream(), + "Unmatched quote in %s\n", name); + delete options; + os::free(buffer); + return JNI_ERR; + } + *wrt++ = *rd++; // copy to option string + } + rd++; // don't copy close quote + } else { + *wrt++ = *rd++; // copy to option string + } + } + // Need to check if we're done before writing a NULL, + // because the write could be to the byte that rd is pointing to. + if (*rd++ == 0) { + *wrt = 0; + break; + } + *wrt = 0; // Zero terminate option + } + JavaVMOption* options_arr = + NEW_C_HEAP_ARRAY_RETURN_NULL(JavaVMOption, options->length(), mtInternal); + if (options_arr == NULL) { + delete options; + os::free(buffer); + return JNI_ENOMEM; + } + for (int i = 0; i < options->length(); i++) { + options_arr[i] = options->at(i); + } + + // Construct JavaVMInitArgs structure and parse as if it was part of the command line + JavaVMInitArgs vm_args; + vm_args.version = JNI_VERSION_1_2; + vm_args.options = options_arr; + vm_args.nOptions = options->length(); + vm_args.ignoreUnrecognized = IgnoreUnrecognizedVMOptions; + + if (PrintVMOptions) { + const char* tail; + for (int i = 0; i < vm_args.nOptions; i++) { + const JavaVMOption *option = vm_args.options + i; + if (match_option(option, "-XX:", &tail)) { + logOption(tail); + } + } + } + + jint result = parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, + Flag::ENVIRON_VAR); + FREE_C_HEAP_ARRAY(JavaVMOption, options_arr); + delete options; + os::free(buffer); + return result; } void Arguments::set_shared_spaces_flags() { @@ -3665,18 +3643,14 @@ static char* get_shared_archive_path() { if (end != NULL) *end = '\0'; size_t jvm_path_len = strlen(jvm_path); size_t file_sep_len = strlen(os::file_separator()); - shared_archive_path = NEW_C_HEAP_ARRAY(char, jvm_path_len + - file_sep_len + 20, mtInternal); + const size_t len = jvm_path_len + file_sep_len + 20; + shared_archive_path = NEW_C_HEAP_ARRAY(char, len, mtInternal); if (shared_archive_path != NULL) { - strncpy(shared_archive_path, jvm_path, jvm_path_len + 1); - strncat(shared_archive_path, os::file_separator(), file_sep_len); - strncat(shared_archive_path, "classes.jsa", 11); + jio_snprintf(shared_archive_path, len, "%s%sclasses.jsa", + jvm_path, os::file_separator()); } } else { - shared_archive_path = NEW_C_HEAP_ARRAY(char, strlen(SharedArchiveFile) + 1, mtInternal); - if (shared_archive_path != NULL) { - strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1); - } + shared_archive_path = os::strdup_check_oom(SharedArchiveFile, mtInternal); } return shared_archive_path; } @@ -3752,8 +3726,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) { CommandLineFlags::printFlags(tty, false); vm_exit(0); } -#if INCLUDE_NMT if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { +#if INCLUDE_NMT // The launcher did not setup nmt environment variable properly. if (!MemTracker::check_launcher_nmt_support(tail)) { warning("Native Memory Tracking did not setup properly, using wrong launcher?"); @@ -3769,9 +3743,12 @@ jint Arguments::parse(const JavaVMInitArgs* args) { vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL); } continue; - } +#else + jio_fprintf(defaultStream::error_stream(), + "Native Memory Tracking is not supported in this VM\n"); + return JNI_ERR; #endif - + } #ifndef PRODUCT if (match_option(option, "-XX:+PrintFlagsWithComments")) { @@ -3839,7 +3816,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) { hotspotrc, hotspotrc); } -#ifdef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. +#if defined(_ALLBSD_SOURCE) || defined(AIX) // UseLargePages is not yet supported on BSD and AIX. UNSUPPORTED_OPTION(UseLargePages, "-XX:+UseLargePages"); #endif diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 99ecdd0d89a..971a78f0ebb 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -323,6 +323,8 @@ class Arguments : AllStatic { static bool _BackgroundCompilation; static bool _ClipInlining; static bool _CIDynamicCompilePriority; + static intx _Tier3InvokeNotifyFreqLog; + static intx _Tier4InvocationThreshold; // Tiered static void set_tiered_flags(); diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 32a924b7dd3..79518448b5e 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1861,6 +1861,7 @@ const char* Deoptimization::_trap_reason_name[] = { "speculate_null_check", "rtm_state_change", "unstable_if", + "unstable_fused_if", "tenured" }; const char* Deoptimization::_trap_action_name[] = { diff --git a/hotspot/src/share/vm/runtime/deoptimization.hpp b/hotspot/src/share/vm/runtime/deoptimization.hpp index e04ad5a0043..81900682e67 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.hpp +++ b/hotspot/src/share/vm/runtime/deoptimization.hpp @@ -63,6 +63,7 @@ class Deoptimization : AllStatic { Reason_speculate_null_check, // saw unexpected null from type speculation Reason_rtm_state_change, // rtm state change detected Reason_unstable_if, // a branch predicted always false was taken + Reason_unstable_fused_if, // fused two ifs that had each one untaken branch. One is now taken. // Reason_tenured is counted separately, add normal counted Reasons above. // Related to MethodData::_trap_hist_limit where Reason_tenured isn't included @@ -326,6 +327,8 @@ class Deoptimization : AllStatic { return Reason_null_check; else if (reason == Reason_unstable_if) return Reason_intrinsic; + else if (reason == Reason_unstable_fused_if) + return Reason_range_check; else return Reason_none; } diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 67adbb8e2aa..140a587800b 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -1104,9 +1104,9 @@ void frame::nmethods_do(CodeBlobClosure* cf) { // call f() on the interpreted Method*s in the stack. // Have to walk the entire code cache for the compiled frames Yuck. void frame::metadata_do(void f(Metadata*)) { - if (_cb != NULL && Interpreter::contains(pc())) { + if (is_interpreted_frame()) { Method* m = this->interpreter_frame_method(); - assert(m != NULL, "huh?"); + assert(m != NULL, "expecting a method in this frame"); f(m); } } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 51a85a0b727..eeedf639ad8 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -677,9 +677,6 @@ class CommandLineFlags { product(bool, PrintVMQWaitTime, false, \ "Print out the waiting time in VM operation queue") \ \ - develop(bool, NoYieldsInMicrolock, false, \ - "Disable yields in microlock") \ - \ develop(bool, TraceOopMapGeneration, false, \ "Show OopMapGeneration") \ \ @@ -936,8 +933,8 @@ class CommandLineFlags { product(bool, ShowMessageBoxOnError, false, \ "Keep process alive on VM fatal error") \ \ - product(bool, CreateMinidumpOnCrash, false, \ - "Create minidump on VM fatal error") \ + product(bool, CreateCoredumpOnCrash, true, \ + "Create core/mini dump on VM fatal error") \ \ product_pd(bool, UseOSErrorReporting, \ "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ @@ -1157,9 +1154,6 @@ class CommandLineFlags { "Convert yield to a sleep of MinSleepInterval to simulate Win32 " \ "behavior") \ \ - product(bool, UseBoundThreads, true, \ - "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)") \ @@ -1342,9 +1336,6 @@ class CommandLineFlags { product(intx, TraceRedefineClasses, 0, \ "Trace level for JVMTI RedefineClasses") \ \ - develop(bool, StressMethodComparator, false, \ - "Run the MethodComparator on all loaded methods") \ - \ /* change to false by default sometime after Mustang */ \ product(bool, VerifyMergedCPBytecodes, true, \ "Verify bytecodes after RedefineClasses constant pool merging") \ @@ -1963,7 +1954,7 @@ class CommandLineFlags { "collection") \ \ develop(uintx, PromotionFailureALotCount, 1000, \ - "Number of promotion failures occurring at ParGCAllocBuffer " \ + "Number of promotion failures occurring at PLAB " \ "refill attempts (ParNew) or promotion attempts " \ "(other young collectors)") \ \ @@ -2235,6 +2226,9 @@ class CommandLineFlags { "When +ReduceInitialCardMarks, explicitly defer any that " \ "may arise from new_pre_store_barrier") \ \ + product(bool, UseCondCardMark, false, \ + "Check for already marked card before updating card table") \ + \ diagnostic(bool, VerifyRememberedSets, false, \ "Verify GC remembered sets") \ \ @@ -2293,9 +2287,6 @@ class CommandLineFlags { "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)") \ @@ -3447,10 +3438,6 @@ class CommandLineFlags { product(bool, ThreadPriorityVerbose, false, \ "Print priority changes") \ \ - product(intx, DefaultThreadPriority, -1, \ - "The native priority at which threads run if not elsewhere " \ - "specified (-1 means no change)") \ - \ product(intx, CompilerThreadPriority, -1, \ "The native priority at which compiler threads should run " \ "(-1 means no change)") \ @@ -3912,7 +3899,14 @@ class CommandLineFlags { "Enable event-based tracing") \ \ product(bool, UseLockedTracing, false, \ - "Use locked-tracing when doing event-based tracing") + "Use locked-tracing when doing event-based tracing") \ + \ + diagnostic(bool, UseUnalignedAccesses, false, \ + "Use unaligned memory accesses in sun.misc.Unsafe") \ + \ + product_pd(bool, PreserveFramePointer, \ + "Use the FP register for holding the frame pointer " \ + "and not as a general purpose register.") /* * Macros for factoring of globals diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 351a4eb3702..581325792ae 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -169,7 +169,7 @@ void assert_lock_strong(const Monitor * lock) { #define def(var, type, pri, vm_block, safepoint_check_allowed ) { \ var = new type(Mutex::pri, #var, vm_block, safepoint_check_allowed); \ assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX"); \ - _mutex_array[_num_mutex] = var; \ + _mutex_array[_num_mutex++] = var; \ } void mutex_init() { diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index a2c28d90629..b3e5a0664d0 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -813,16 +813,16 @@ void os::print_hex_dump(outputStream* st, address start, address end, int unitsi st->cr(); } -void os::print_environment_variables(outputStream* st, const char** env_list, - char* buffer, int len) { +void os::print_environment_variables(outputStream* st, const char** env_list) { if (env_list) { st->print_cr("Environment Variables:"); for (int i = 0; env_list[i] != NULL; i++) { - if (getenv(env_list[i], buffer, len)) { + char *envvar = ::getenv(env_list[i]); + if (envvar != NULL) { st->print("%s", env_list[i]); st->print("="); - st->print_cr("%s", buffer); + st->print_cr("%s", envvar); } } } diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index ef654a8c675..ffe0e079b6a 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -164,8 +164,7 @@ class os: AllStatic { // Override me as needed static int file_name_strcmp(const char* s1, const char* s2); - // get/unset environment variable - static bool getenv(const char* name, char* buffer, int len); + // unset environment variable static bool unsetenv(const char* name); static bool have_special_privileges(); @@ -493,6 +492,7 @@ class os: AllStatic { // Terminate with an error. Default is to generate a core file on platforms // that support such things. This calls shutdown() and then aborts. + static void abort(bool dump_core, void *siginfo, void *context); static void abort(bool dump_core = true); // Die immediately, no exit hook, no abort hook, no cleanup. @@ -591,7 +591,7 @@ class os: AllStatic { static void pd_print_cpu_info(outputStream* st); static void print_memory_info(outputStream* st); static void print_dll_info(outputStream* st); - static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len); + static void print_environment_variables(outputStream* st, const char** env_list); static void print_context(outputStream* st, void* context); static void print_register_info(outputStream* st, void* context); static void print_siginfo(outputStream* st, void* siginfo); @@ -717,8 +717,13 @@ class os: AllStatic { // Structured OS Exception support static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); - // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits - static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize); + // On Posix compatible OS it will simply check core dump limits while on Windows + // it will check if dump file can be created. Check or prepare a core dump to be + // taken at a later point in the same thread in os::abort(). Use the caller + // provided buffer as a scratch buffer. The status message which will be written + // into the error log either is file location or a short error message, depending + // on the checking result. + static void check_dump_limit(char* buffer, size_t bufferSize); // Get the default path to the core file // Returns the length of the string diff --git a/hotspot/src/cpu/x86/vm/rtmLocking.cpp b/hotspot/src/share/vm/runtime/rtmLocking.cpp similarity index 93% rename from hotspot/src/cpu/x86/vm/rtmLocking.cpp rename to hotspot/src/share/vm/runtime/rtmLocking.cpp index e1b28654b03..56ad9fb3689 100644 --- a/hotspot/src/cpu/x86/vm/rtmLocking.cpp +++ b/hotspot/src/share/vm/runtime/rtmLocking.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,10 +23,15 @@ */ #include "precompiled.hpp" +#include "utilities/globalDefinitions.hpp" + +#if INCLUDE_RTM_OPT + #include "memory/allocation.inline.hpp" #include "runtime/task.hpp" #include "runtime/rtmLocking.hpp" + // One-shot PeriodicTask subclass for enabling RTM locking uintx RTMLockingCounters::_calculation_flag = 0; @@ -58,3 +63,5 @@ void RTMLockingCounters::print_on(outputStream* st) { tty->print_cr("# rtm lock aborts %d: " UINTX_FORMAT, i, _abortX_count[i]); } } + +#endif diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 04a23aa23c1..80a075e73d7 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1179,7 +1179,7 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread, #endif // JSR 292 key invariant: - // If the resolved method is a MethodHandle invoke target the call + // If the resolved method is a MethodHandle invoke target, the call // site must be a MethodHandle call site, because the lambda form might tail-call // leaving the stack in a state unknown to either caller or callee // TODO detune for now but we might need it again @@ -1793,7 +1793,9 @@ JRT_END // Handles the uncommon case in locking, i.e., contention or an inflated lock. JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread)) - if (!SafepointSynchronize::is_synchronizing()) { + // Disable ObjectSynchronizer::quick_enter() in default config + // until JDK-8077392 is resolved. + if ((SyncFlags & 256) != 0 && !SafepointSynchronize::is_synchronizing()) { // Only try quick_enter() if we're not trying to reach a safepoint // so that the calling thread reaches the safepoint more quickly. if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return; @@ -1819,9 +1821,9 @@ JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, B JRT_END // Handles the uncommon cases of monitor unlocking in compiled code -JRT_LEAF(void, SharedRuntime::complete_monitor_unlocking_C(oopDesc* _obj, BasicLock* lock)) +JRT_LEAF(void, SharedRuntime::complete_monitor_unlocking_C(oopDesc* _obj, BasicLock* lock, JavaThread * THREAD)) oop obj(_obj); - Thread* THREAD = JavaThread::current(); + assert(JavaThread::current() == THREAD, "invariant"); // I'm not convinced we need the code contained by MIGHT_HAVE_PENDING anymore // testing was unable to ever fire the assert that guarded it so I have removed it. assert(!HAS_PENDING_EXCEPTION, "Do we need code below anymore?"); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index c370a9f7a67..93ca5b2fa94 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -472,7 +472,7 @@ class SharedRuntime: AllStatic { // Slow-path Locking and Unlocking static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); - static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock); + static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); // Resolving of calls static address resolve_static_call_C (JavaThread *thread); diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index fc2c2b09e61..aac4353837d 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,31 +213,35 @@ static void test_arraycopy_func(address func, int alignment) { // simple test for SafeFetch32 static void test_safefetch32() { - int dummy = 17; - int* const p_invalid = (int*) get_segfault_address(); - int* const p_valid = &dummy; - int result_invalid = SafeFetch32(p_invalid, 0xABC); - assert(result_invalid == 0xABC, "SafeFetch32 error"); - int result_valid = SafeFetch32(p_valid, 0xABC); - assert(result_valid == 17, "SafeFetch32 error"); + if (CanUseSafeFetch32()) { + int dummy = 17; + int* const p_invalid = (int*) get_segfault_address(); + int* const p_valid = &dummy; + int result_invalid = SafeFetch32(p_invalid, 0xABC); + assert(result_invalid == 0xABC, "SafeFetch32 error"); + int result_valid = SafeFetch32(p_valid, 0xABC); + assert(result_valid == 17, "SafeFetch32 error"); + } } // simple test for SafeFetchN static void test_safefetchN() { + if (CanUseSafeFetchN()) { #ifdef _LP64 - const intptr_t v1 = UCONST64(0xABCD00000000ABCD); - const intptr_t v2 = UCONST64(0xDEFD00000000DEFD); + const intptr_t v1 = UCONST64(0xABCD00000000ABCD); + const intptr_t v2 = UCONST64(0xDEFD00000000DEFD); #else - const intptr_t v1 = 0xABCDABCD; - const intptr_t v2 = 0xDEFDDEFD; + const intptr_t v1 = 0xABCDABCD; + const intptr_t v2 = 0xDEFDDEFD; #endif - intptr_t dummy = v1; - intptr_t* const p_invalid = (intptr_t*) get_segfault_address(); - intptr_t* const p_valid = &dummy; - intptr_t result_invalid = SafeFetchN(p_invalid, v2); - assert(result_invalid == v2, "SafeFetchN error"); - intptr_t result_valid = SafeFetchN(p_valid, v2); - assert(result_valid == v1, "SafeFetchN error"); + intptr_t dummy = v1; + intptr_t* const p_invalid = (intptr_t*) get_segfault_address(); + intptr_t* const p_valid = &dummy; + intptr_t result_invalid = SafeFetchN(p_invalid, v2); + assert(result_invalid == v2, "SafeFetchN error"); + intptr_t result_valid = SafeFetchN(p_valid, v2); + assert(result_valid == v1, "SafeFetchN error"); + } } #endif diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 9a0e2314b78..619b3b45b42 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -450,7 +450,11 @@ inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated) -inline bool CanUseSafeFetch32() { return StubRoutines::SafeFetch32_stub() ? true : false; } -inline bool CanUseSafeFetchN() { return StubRoutines::SafeFetchN_stub() ? true : false; } +inline bool CanUseSafeFetch32() { + return StubRoutines::SafeFetch32_stub() ? true : false; +} +inline bool CanUseSafeFetchN() { + return StubRoutines::SafeFetchN_stub() ? true : false; +} #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP diff --git a/hotspot/src/share/vm/runtime/sweeper.cpp b/hotspot/src/share/vm/runtime/sweeper.cpp index c059be04e9c..42d9267875d 100644 --- a/hotspot/src/share/vm/runtime/sweeper.cpp +++ b/hotspot/src/share/vm/runtime/sweeper.cpp @@ -144,6 +144,7 @@ long NMethodSweeper::_last_sweep = 0; // Value of _time int NMethodSweeper::_seen = 0; // Nof. nmethod we have currently processed in current pass of CodeCache volatile bool NMethodSweeper::_should_sweep = true; // Indicates if we should invoke the sweeper +volatile bool NMethodSweeper::_force_sweep = false;// Indicates if we should force a sweep volatile int NMethodSweeper::_bytes_changed = 0; // Counts the total nmethod size if the nmethod changed from: // 1) alive -> not_entrant // 2) not_entrant -> zombie @@ -275,6 +276,23 @@ void NMethodSweeper::notify(int code_blob_type) { } } +/** + * Wakes up the sweeper thread and forces a sweep. Blocks until it finished. + */ +void NMethodSweeper::force_sweep() { + ThreadBlockInVM tbivm(JavaThread::current()); + MutexLockerEx waiter(CodeCache_lock, Mutex::_no_safepoint_check_flag); + // Request forced sweep + _force_sweep = true; + while (_force_sweep) { + // Notify sweeper that we want to force a sweep and wait for completion. + // In case a sweep currently takes place we timeout and try again because + // we want to enforce a full sweep. + CodeCache_lock->notify(); + CodeCache_lock->wait(Mutex::_no_safepoint_check_flag, 1000); + } +} + /** * Handle a safepoint request */ @@ -335,6 +353,9 @@ void NMethodSweeper::possibly_sweep() { } } + // Remember if this was a forced sweep + bool forced = _force_sweep; + // Force stack scanning if there is only 10% free space in the code cache. // We force stack scanning only non-profiled code heap gets full, since critical // allocation go to the non-profiled heap and we must be make sure that there is @@ -344,7 +365,7 @@ void NMethodSweeper::possibly_sweep() { do_stack_scanning(); } - if (_should_sweep) { + if (_should_sweep || forced) { init_sweeper_log(); sweep_code_cache(); } @@ -356,12 +377,20 @@ void NMethodSweeper::possibly_sweep() { _should_sweep = false; // If there was enough state change, 'possibly_enable_sweeper()' // sets '_should_sweep' to true - possibly_enable_sweeper(); + possibly_enable_sweeper(); // Reset _bytes_changed only if there was enough state change. _bytes_changed // can further increase by calls to 'report_state_change'. if (_should_sweep) { _bytes_changed = 0; } + + if (forced) { + // Notify requester that forced sweep finished + assert(_force_sweep, "Should be a forced sweep"); + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + _force_sweep = false; + CodeCache_lock->notify(); + } } void NMethodSweeper::sweep_code_cache() { diff --git a/hotspot/src/share/vm/runtime/sweeper.hpp b/hotspot/src/share/vm/runtime/sweeper.hpp index f0ce1e93e27..aa4860b5f71 100644 --- a/hotspot/src/share/vm/runtime/sweeper.hpp +++ b/hotspot/src/share/vm/runtime/sweeper.hpp @@ -54,7 +54,6 @@ class WhiteBox; // nmethod's space is freed. class NMethodSweeper : public AllStatic { - friend class WhiteBox; private: enum MethodStateChange { None, @@ -71,6 +70,7 @@ class NMethodSweeper : public AllStatic { static volatile int _sweep_started; // Flag to control conc sweeper static volatile bool _should_sweep; // Indicates if we should invoke the sweeper + static volatile bool _force_sweep; // Indicates if we should force a sweep static volatile int _bytes_changed; // Counts the total nmethod size if the nmethod changed from: // 1) alive -> not_entrant // 2) not_entrant -> zombie @@ -117,6 +117,7 @@ class NMethodSweeper : public AllStatic { static void mark_active_nmethods(); // Invoked at the end of each safepoint static void sweeper_loop(); static void notify(int code_blob_type); // Possibly start the sweeper thread. + static void force_sweep(); static int hotness_counter_reset_val(); static void report_state_change(nmethod* nm); diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index fa2928f6287..b11af25317f 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -109,17 +109,24 @@ int dtrace_waited_probe(ObjectMonitor* monitor, Handle obj, Thread* thr) { } #define NINFLATIONLOCKS 256 -static volatile intptr_t InflationLocks[NINFLATIONLOCKS]; +static volatile intptr_t gInflationLocks[NINFLATIONLOCKS]; +// global list of blocks of monitors // gBlockList is really PaddedEnd *, but we don't // want to expose the PaddedEnd template more than necessary. ObjectMonitor * ObjectSynchronizer::gBlockList = NULL; +// global monitor free list ObjectMonitor * volatile ObjectSynchronizer::gFreeList = NULL; +// global monitor in-use list, for moribund threads, +// monitors they inflated need to be scanned for deflation ObjectMonitor * volatile ObjectSynchronizer::gOmInUseList = NULL; +// count of entries in gOmInUseList 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 + +static volatile intptr_t gListLock = 0; // protects global monitor lists +static volatile int gMonitorFreeCount = 0; // # on gFreeList +static volatile int gMonitorPopulation = 0; // # Extant -- in circulation + #define CHAINMARKER (cast_to_oop(-1)) @@ -528,7 +535,7 @@ static markOop ReadStableMark(oop obj) { int YieldThenBlock = 0; assert(ix >= 0 && ix < NINFLATIONLOCKS, "invariant"); assert((NINFLATIONLOCKS & (NINFLATIONLOCKS-1)) == 0, "invariant"); - Thread::muxAcquire(InflationLocks + ix, "InflationLock"); + Thread::muxAcquire(gInflationLocks + ix, "gInflationLock"); while (obj->mark() == markOopDesc::INFLATING()) { // Beware: NakedYield() is advisory and has almost no effect on some platforms // so we periodically call Self->_ParkEvent->park(1). @@ -539,7 +546,7 @@ static markOop ReadStableMark(oop obj) { os::naked_yield(); } } - Thread::muxRelease(InflationLocks + ix); + Thread::muxRelease(gInflationLocks + ix); TEVENT(Inflate: INFLATING - yield/park); } } else { @@ -882,7 +889,7 @@ void ObjectSynchronizer::oops_do(OopClosure* f) { // STW-time -- disassociates idle monitors from objects. Such // scavenged monitors are returned to the gFreeList. // -// The global list is protected by ListLock. All the critical sections +// The global list is protected by gListLock. All the critical sections // are short and operate in constant-time. // // ObjectMonitors reside in type-stable memory (TSM) and are immortal. @@ -937,17 +944,17 @@ static void InduceScavenge(Thread * Self, const char * Whence) { void ObjectSynchronizer::verifyInUse(Thread *Self) { ObjectMonitor* mid; - int inusetally = 0; + int in_use_tally = 0; for (mid = Self->omInUseList; mid != NULL; mid = mid->FreeNext) { - inusetally++; + in_use_tally++; } - assert(inusetally == Self->omInUseCount, "inuse count off"); + assert(in_use_tally == Self->omInUseCount, "in-use count off"); - int freetally = 0; + int free_tally = 0; for (mid = Self->omFreeList; mid != NULL; mid = mid->FreeNext) { - freetally++; + free_tally++; } - assert(freetally == Self->omFreeCount, "free count off"); + assert(free_tally == Self->omFreeCount, "free count off"); } ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { @@ -964,7 +971,7 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { // Threads will attempt to allocate first from their local list, then // from the global list, and only after those attempts fail will the thread // attempt to instantiate new monitors. Thread-local free lists take - // heat off the ListLock and improve allocation latency, as well as reducing + // heat off the gListLock and improve allocation latency, as well as reducing // coherency traffic on the shared global list. m = Self->omFreeList; if (m != NULL) { @@ -994,9 +1001,9 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { // Reprovision the thread's omFreeList. // Use bulk transfers to reduce the allocation rate and heat // on various locks. - Thread::muxAcquire(&ListLock, "omAlloc"); + Thread::muxAcquire(&gListLock, "omAlloc"); for (int i = Self->omFreeProvision; --i >= 0 && gFreeList != NULL;) { - MonitorFreeCount--; + gMonitorFreeCount--; ObjectMonitor * take = gFreeList; gFreeList = take->FreeNext; guarantee(take->object() == NULL, "invariant"); @@ -1004,13 +1011,13 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { take->Recycle(); omRelease(Self, take, false); } - Thread::muxRelease(&ListLock); + Thread::muxRelease(&gListLock); Self->omFreeProvision += 1 + (Self->omFreeProvision/2); if (Self->omFreeProvision > MAXPRIVATE) Self->omFreeProvision = MAXPRIVATE; TEVENT(omFirst - reprovision); const int mx = MonitorBound; - if (mx > 0 && (MonitorPopulation-MonitorFreeCount) > mx) { + if (mx > 0 && (gMonitorPopulation-gMonitorFreeCount) > mx) { // We can't safely induce a STW safepoint from omAlloc() as our thread // state may not be appropriate for such activities and callers may hold // naked oops, so instead we defer the action. @@ -1068,11 +1075,11 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { // block in hand. This avoids some lock traffic and redundant // list activity. - // Acquire the ListLock to manipulate BlockList and FreeList. + // Acquire the gListLock to manipulate gBlockList and gFreeList. // An Oyama-Taura-Yonezawa scheme might be more efficient. - Thread::muxAcquire(&ListLock, "omAlloc [2]"); - MonitorPopulation += _BLOCKSIZE-1; - MonitorFreeCount += _BLOCKSIZE-1; + Thread::muxAcquire(&gListLock, "omAlloc [2]"); + gMonitorPopulation += _BLOCKSIZE-1; + gMonitorFreeCount += _BLOCKSIZE-1; // Add the new block to the list of extant blocks (gBlockList). // The very first objectMonitor in a block is reserved and dedicated. @@ -1083,7 +1090,7 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { // Add the new string of objectMonitors to the global free list temp[_BLOCKSIZE - 1].FreeNext = gFreeList; gFreeList = temp + 1; - Thread::muxRelease(&ListLock); + Thread::muxRelease(&gListLock); TEVENT(Allocate block of monitors); } } @@ -1094,32 +1101,36 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc(Thread * Self) { // omRelease is to return a monitor to the free list after a CAS // attempt failed. This doesn't allow unbounded #s of monitors to // accumulate on a thread's free list. +// +// Key constraint: all ObjectMonitors on a thread's free list and the global +// free list must have their object field set to null. This prevents the +// scavenger -- deflate_idle_monitors -- from reclaiming them. void ObjectSynchronizer::omRelease(Thread * Self, ObjectMonitor * m, bool fromPerThreadAlloc) { guarantee(m->object() == NULL, "invariant"); - + guarantee(((m->is_busy()|m->_recursions) == 0), "freeing in-use monitor"); // Remove from omInUseList if (MonitorInUseLists && fromPerThreadAlloc) { - ObjectMonitor* curmidinuse = NULL; - for (ObjectMonitor* mid = Self->omInUseList; mid != NULL;) { + ObjectMonitor* cur_mid_in_use = NULL; + bool extracted = false; + for (ObjectMonitor* mid = Self->omInUseList; mid != NULL; cur_mid_in_use = mid, mid = mid->FreeNext) { if (m == mid) { - // extract from per-thread in-use-list + // extract from per-thread in-use list if (mid == Self->omInUseList) { Self->omInUseList = mid->FreeNext; - } else if (curmidinuse != NULL) { - curmidinuse->FreeNext = mid->FreeNext; // maintain the current thread inuselist + } else if (cur_mid_in_use != NULL) { + cur_mid_in_use->FreeNext = mid->FreeNext; // maintain the current thread in-use list } + extracted = true; Self->omInUseCount--; if (ObjectMonitor::Knob_VerifyInUse) { verifyInUse(Self); } break; - } else { - curmidinuse = mid; - mid = mid->FreeNext; } } + assert(extracted, "Should have extracted from in-use list"); } // FreeNext is used for both omInUseList and omFreeList, so clear old before setting new @@ -1149,52 +1160,60 @@ void ObjectSynchronizer::omRelease(Thread * Self, ObjectMonitor * m, // operator. void ObjectSynchronizer::omFlush(Thread * Self) { - ObjectMonitor * List = Self->omFreeList; // Null-terminated SLL + ObjectMonitor * list = Self->omFreeList; // Null-terminated SLL Self->omFreeList = NULL; - ObjectMonitor * Tail = NULL; - int Tally = 0; - if (List != NULL) { + ObjectMonitor * tail = NULL; + int tally = 0; + if (list != NULL) { ObjectMonitor * s; - for (s = List; s != NULL; s = s->FreeNext) { - Tally++; - Tail = s; + // The thread is going away, the per-thread free monitors + // are freed via set_owner(NULL) + // Link them to tail, which will be linked into the global free list + // gFreeList below, under the gListLock + for (s = list; s != NULL; s = s->FreeNext) { + tally++; + tail = s; guarantee(s->object() == NULL, "invariant"); guarantee(!s->is_busy(), "invariant"); s->set_owner(NULL); // redundant but good hygiene TEVENT(omFlush - Move one); } - guarantee(Tail != NULL && List != NULL, "invariant"); + guarantee(tail != NULL && list != NULL, "invariant"); } - ObjectMonitor * InUseList = Self->omInUseList; - ObjectMonitor * InUseTail = NULL; - int InUseTally = 0; - if (InUseList != NULL) { + ObjectMonitor * inUseList = Self->omInUseList; + ObjectMonitor * inUseTail = NULL; + int inUseTally = 0; + if (inUseList != NULL) { Self->omInUseList = NULL; - ObjectMonitor *curom; - for (curom = InUseList; curom != NULL; curom = curom->FreeNext) { - InUseTail = curom; - InUseTally++; + ObjectMonitor *cur_om; + // The thread is going away, however the omInUseList inflated + // monitors may still be in-use by other threads. + // Link them to inUseTail, which will be linked into the global in-use list + // gOmInUseList below, under the gListLock + for (cur_om = inUseList; cur_om != NULL; cur_om = cur_om->FreeNext) { + inUseTail = cur_om; + inUseTally++; } - assert(Self->omInUseCount == InUseTally, "inuse count off"); + assert(Self->omInUseCount == inUseTally, "in-use count off"); Self->omInUseCount = 0; - guarantee(InUseTail != NULL && InUseList != NULL, "invariant"); + guarantee(inUseTail != NULL && inUseList != NULL, "invariant"); } - Thread::muxAcquire(&ListLock, "omFlush"); - if (Tail != NULL) { - Tail->FreeNext = gFreeList; - gFreeList = List; - MonitorFreeCount += Tally; + Thread::muxAcquire(&gListLock, "omFlush"); + if (tail != NULL) { + tail->FreeNext = gFreeList; + gFreeList = list; + gMonitorFreeCount += tally; } - if (InUseTail != NULL) { - InUseTail->FreeNext = gOmInUseList; - gOmInUseList = InUseList; - gOmInUseCount += InUseTally; + if (inUseTail != NULL) { + inUseTail->FreeNext = gOmInUseList; + gOmInUseList = inUseList; + gOmInUseCount += inUseTally; } - Thread::muxRelease(&ListLock); + Thread::muxRelease(&gListLock); TEVENT(omFlush); } @@ -1411,14 +1430,14 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, // // We have added a flag, MonitorInUseLists, which creates a list // of active monitors for each thread. deflate_idle_monitors() -// only scans the per-thread inuse lists. omAlloc() puts all +// only scans the per-thread in-use lists. omAlloc() puts all // assigned monitors on the per-thread list. deflate_idle_monitors() // returns the non-busy monitors to the global free list. // When a thread dies, omFlush() adds the list of active monitors for // that thread to a global gOmInUseList acquiring the // global list lock. deflate_idle_monitors() acquires the global // list lock to scan for non-busy monitors to the global free list. -// An alternative could have used a single global inuse list. The +// An alternative could have used a single global in-use list. The // downside would have been the additional cost of acquiring the global list lock // for every omAlloc(). // @@ -1432,8 +1451,8 @@ enum ManifestConstants { MaximumRecheckInterval = 1000 }; -// Deflate a single monitor if not in use -// Return true if deflated, false if in use +// Deflate a single monitor if not in-use +// Return true if deflated, false if in-use bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) { @@ -1465,11 +1484,11 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, assert(mid->object() == NULL, "invariant"); - // Move the object to the working free list defined by FreeHead,FreeTail. + // Move the object to the working free list defined by freeHeadp, freeTailp if (*freeHeadp == NULL) *freeHeadp = mid; if (*freeTailp != NULL) { ObjectMonitor * prevtail = *freeTailp; - assert(prevtail->FreeNext == NULL, "cleaned up deflated?"); // TODO KK + assert(prevtail->FreeNext == NULL, "cleaned up deflated?"); prevtail->FreeNext = mid; } *freeTailp = mid; @@ -1478,38 +1497,37 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, return deflated; } -// Caller acquires ListLock -int ObjectSynchronizer::walk_monitor_list(ObjectMonitor** listheadp, - ObjectMonitor** freeHeadp, - ObjectMonitor** freeTailp) { +// Walk a given monitor list, and deflate idle monitors +// The given list could be a per-thread list or a global list +// Caller acquires gListLock +int ObjectSynchronizer::deflate_monitor_list(ObjectMonitor** listHeadp, + ObjectMonitor** freeHeadp, + ObjectMonitor** freeTailp) { ObjectMonitor* mid; ObjectMonitor* next; - ObjectMonitor* curmidinuse = NULL; - int deflatedcount = 0; + ObjectMonitor* cur_mid_in_use = NULL; + int deflated_count = 0; - for (mid = *listheadp; mid != NULL;) { + for (mid = *listHeadp; mid != NULL;) { oop obj = (oop) mid->object(); - bool deflated = false; - if (obj != NULL) { - deflated = deflate_monitor(mid, obj, freeHeadp, freeTailp); - } - if (deflated) { - // extract from per-thread in-use-list - if (mid == *listheadp) { - *listheadp = mid->FreeNext; - } else if (curmidinuse != NULL) { - curmidinuse->FreeNext = mid->FreeNext; // maintain the current thread inuselist + if (obj != NULL && deflate_monitor(mid, obj, freeHeadp, freeTailp)) { + // if deflate_monitor succeeded, + // extract from per-thread in-use list + if (mid == *listHeadp) { + *listHeadp = mid->FreeNext; + } else if (cur_mid_in_use != NULL) { + cur_mid_in_use->FreeNext = mid->FreeNext; // maintain the current thread in-use list } next = mid->FreeNext; - mid->FreeNext = NULL; // This mid is current tail in the FreeHead list + mid->FreeNext = NULL; // This mid is current tail in the freeHeadp list mid = next; - deflatedcount++; + deflated_count++; } else { - curmidinuse = mid; + cur_mid_in_use = mid; mid = mid->FreeNext; } } - return deflatedcount; + return deflated_count; } void ObjectSynchronizer::deflate_idle_monitors() { @@ -1519,34 +1537,34 @@ void ObjectSynchronizer::deflate_idle_monitors() { int nScavenged = 0; // reclaimed bool deflated = false; - ObjectMonitor * FreeHead = NULL; // Local SLL of scavenged monitors - ObjectMonitor * FreeTail = NULL; + ObjectMonitor * freeHeadp = NULL; // Local SLL of scavenged monitors + ObjectMonitor * freeTailp = NULL; TEVENT(deflate_idle_monitors); // Prevent omFlush from changing mids in Thread dtor's during deflation // And in case the vm thread is acquiring a lock during a safepoint // See e.g. 6320749 - Thread::muxAcquire(&ListLock, "scavenge - return"); + Thread::muxAcquire(&gListLock, "scavenge - return"); if (MonitorInUseLists) { int inUse = 0; for (JavaThread* cur = Threads::first(); cur != NULL; cur = cur->next()) { nInCirculation+= cur->omInUseCount; - int deflatedcount = walk_monitor_list(cur->omInUseList_addr(), &FreeHead, &FreeTail); - cur->omInUseCount-= deflatedcount; + int deflated_count = deflate_monitor_list(cur->omInUseList_addr(), &freeHeadp, &freeTailp); + cur->omInUseCount-= deflated_count; if (ObjectMonitor::Knob_VerifyInUse) { verifyInUse(cur); } - nScavenged += deflatedcount; + nScavenged += deflated_count; nInuse += cur->omInUseCount; } // For moribund threads, scan gOmInUseList if (gOmInUseList) { nInCirculation += gOmInUseCount; - int deflatedcount = walk_monitor_list((ObjectMonitor **)&gOmInUseList, &FreeHead, &FreeTail); - gOmInUseCount-= deflatedcount; - nScavenged += deflatedcount; + int deflated_count = deflate_monitor_list((ObjectMonitor **)&gOmInUseList, &freeHeadp, &freeTailp); + gOmInUseCount-= deflated_count; + nScavenged += deflated_count; nInuse += gOmInUseCount; } @@ -1568,7 +1586,7 @@ void ObjectSynchronizer::deflate_idle_monitors() { guarantee(!mid->is_busy(), "invariant"); continue; } - deflated = deflate_monitor(mid, obj, &FreeHead, &FreeTail); + deflated = deflate_monitor(mid, obj, &freeHeadp, &freeTailp); if (deflated) { mid->FreeNext = NULL; @@ -1579,28 +1597,28 @@ void ObjectSynchronizer::deflate_idle_monitors() { } } - MonitorFreeCount += nScavenged; + gMonitorFreeCount += nScavenged; - // Consider: audit gFreeList to ensure that MonitorFreeCount and list agree. + // Consider: audit gFreeList to ensure that gMonitorFreeCount and list agree. if (ObjectMonitor::Knob_Verbose) { ::printf("Deflate: InCirc=%d InUse=%d Scavenged=%d ForceMonitorScavenge=%d : pop=%d free=%d\n", nInCirculation, nInuse, nScavenged, ForceMonitorScavenge, - MonitorPopulation, MonitorFreeCount); + gMonitorPopulation, gMonitorFreeCount); ::fflush(stdout); } ForceMonitorScavenge = 0; // Reset // Move the scavenged monitors back to the global free list. - if (FreeHead != NULL) { - guarantee(FreeTail != NULL && nScavenged > 0, "invariant"); - assert(FreeTail->FreeNext == NULL, "invariant"); + if (freeHeadp != NULL) { + guarantee(freeTailp != NULL && nScavenged > 0, "invariant"); + assert(freeTailp->FreeNext == NULL, "invariant"); // constant-time list splice - prepend scavenged segment to gFreeList - FreeTail->FreeNext = gFreeList; - gFreeList = FreeHead; + freeTailp->FreeNext = gFreeList; + gFreeList = freeHeadp; } - Thread::muxRelease(&ListLock); + Thread::muxRelease(&gListLock); if (ObjectMonitor::_sync_Deflations != NULL) ObjectMonitor::_sync_Deflations->inc(nScavenged); if (ObjectMonitor::_sync_MonExtant != NULL) ObjectMonitor::_sync_MonExtant ->set_value(nInCirculation); @@ -1648,9 +1666,9 @@ void ObjectSynchronizer::release_monitors_owned_by_thread(TRAPS) { assert(THREAD == JavaThread::current(), "must be current Java thread"); No_Safepoint_Verifier nsv; ReleaseJavaMonitorsClosure rjmc(THREAD); - Thread::muxAcquire(&ListLock, "release_monitors_owned_by_thread"); + Thread::muxAcquire(&gListLock, "release_monitors_owned_by_thread"); ObjectSynchronizer::monitors_iterate(&rjmc); - Thread::muxRelease(&ListLock); + Thread::muxRelease(&gListLock); THREAD->clear_pending_exception(); } diff --git a/hotspot/src/share/vm/runtime/synchronizer.hpp b/hotspot/src/share/vm/runtime/synchronizer.hpp index 320a617cb39..a7ad76d8b4f 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.hpp +++ b/hotspot/src/share/vm/runtime/synchronizer.hpp @@ -116,9 +116,10 @@ class ObjectSynchronizer : AllStatic { // Basically we deflate all monitors that are not busy. // An adaptive profile-based deflation policy could be used if needed static void deflate_idle_monitors(); - static int walk_monitor_list(ObjectMonitor** listheadp, - ObjectMonitor** freeHeadp, - ObjectMonitor** freeTailp); + // For a given monitor list: global or per-thread, deflate idle monitors + static int deflate_monitor_list(ObjectMonitor** listheadp, + ObjectMonitor** freeHeadp, + ObjectMonitor** freeTailp); static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp); @@ -135,16 +136,17 @@ class ObjectSynchronizer : AllStatic { private: enum { _BLOCKSIZE = 128 }; + // global list of blocks of monitors // gBlockList is really PaddedEnd *, but we don't // want to expose the PaddedEnd template more than necessary. - static ObjectMonitor* gBlockList; + static ObjectMonitor * gBlockList; + // global monitor free list static ObjectMonitor * volatile gFreeList; - // global monitor in use list, for moribund threads, + // global monitor in-use list, for moribund threads, // monitors they inflated need to be scanned for deflation static ObjectMonitor * volatile gOmInUseList; // count of entries in gOmInUseList static int gOmInUseCount; - }; // ObjectLocker enforced balanced locking and can never thrown an diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 544903d918e..19721c5650d 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -272,6 +272,11 @@ Thread::Thread() { #endif // ASSERT } +// Non-inlined version to be used where thread.inline.hpp shouldn't be included. +Thread* Thread::current_noinline() { + return Thread::current(); +} + void Thread::initialize_thread_local_storage() { // Note: Make sure this method only calls // non-blocking operations. Otherwise, it might not work @@ -754,13 +759,9 @@ bool Thread::claim_oops_do_par_case(int strong_roots_parity) { return true; } else { guarantee(res == strong_roots_parity, "Or else what?"); - assert(SharedHeap::heap()->workers()->active_workers() > 0, - "Should only fail when parallel."); return false; } } - assert(SharedHeap::heap()->workers()->active_workers() > 0, - "Should only fail when parallel."); return false; } @@ -4056,7 +4057,7 @@ void Threads::change_thread_claim_parity() { "Not in range."); } -#ifndef PRODUCT +#ifdef ASSERT void Threads::assert_all_threads_claimed() { ALL_JAVA_THREADS(p) { const int thread_parity = p->oops_do_parity(); @@ -4064,22 +4065,9 @@ void Threads::assert_all_threads_claimed() { err_msg("Thread " PTR_FORMAT " has incorrect parity %d != %d", p2i(p), thread_parity, _thread_claim_parity)); } } -#endif // PRODUCT +#endif // ASSERT -void Threads::possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) { - // Introduce a mechanism allowing parallel threads to claim threads as - // root groups. Overhead should be small enough to use all the time, - // even in sequential code. - SharedHeap* sh = SharedHeap::heap(); - // Cannot yet substitute active_workers for n_par_threads - // because of G1CollectedHeap::verify() use of - // SharedHeap::process_roots(). n_par_threads == 0 will - // turn off parallelism in process_roots while active_workers - // is being used for parallelism elsewhere. - bool is_par = sh->n_par_threads() > 0; - assert(!is_par || - (SharedHeap::heap()->n_par_threads() == - SharedHeap::heap()->workers()->active_workers()), "Mismatch"); +void Threads::possibly_parallel_oops_do(bool is_par, OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) { int cp = Threads::thread_claim_parity(); ALL_JAVA_THREADS(p) { if (p->claim_oops_do(is_par, cp)) { diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 2744281f00e..0e2b64f7f9a 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -324,6 +324,8 @@ class Thread: public ThreadShadow { // Returns the current thread static inline Thread* current(); + // ... without having to include thread.inline.hpp. + static Thread* current_noinline(); // Common thread operations static void set_priority(Thread* thread, ThreadPriority priority); @@ -1886,15 +1888,28 @@ class Threads: AllStatic { // Does not include JNI_VERSION_1_1 static jboolean is_supported_jni_version(jint version); + // The "thread claim parity" provides a way for threads to be claimed + // by parallel worker tasks. + // + // Each thread contains a a "parity" field. A task will claim the + // thread only if its parity field is the same as the global parity, + // which is updated by calling change_thread_claim_parity(). + // + // For this to work change_thread_claim_parity() needs to be called + // exactly once in sequential code before starting parallel tasks + // that should claim threads. + // + // New threads get their parity set to 0 and change_thread_claim_parity() + // never set the global parity to 0. static int thread_claim_parity() { return _thread_claim_parity; } static void change_thread_claim_parity(); + static void assert_all_threads_claimed() NOT_DEBUG_RETURN; - static void assert_all_threads_claimed() PRODUCT_RETURN; // Apply "f->do_oop" to all root oops in all threads. // This version may only be called by sequential code. static void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); // This version may be called by sequential or parallel code. - static void possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); + static void possibly_parallel_oops_do(bool is_par, OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); // This creates a list of GCTasks, one per thread. static void create_thread_roots_tasks(GCTaskQueue* q); // This creates a list of GCTasks, one per thread, for marking objects. diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 17ead61b782..badd129455b 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -389,12 +389,12 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { decode_offset < 0 || decode_offset >= nm()->scopes_data_size()) { // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. - // If we attempt to read nmethod::scopes_data at serialized_null (== 0), - // or if we read some at other crazy offset, - // we will decode garbage and make wild references into the heap, - // leading to crashes in product mode. - // (This isn't airtight, of course, since there are internal - // offsets which are also crazy.) + // If we read nmethod::scopes_data at serialized_null (== 0) + // or if read some at other invalid offset, invalid values will be decoded. + // Based on these values, invalid heap locations could be referenced + // that could lead to crashes in product mode. + // Therefore, do not use the decode offset if invalid, but fill the frame + // as it were a native compiled frame (no Java-level assumptions). #ifdef ASSERT if (WizardMode) { tty->print_cr("Error in fill_from_frame: pc_desc for " @@ -514,9 +514,15 @@ inline void vframeStreamCommon::fill_from_interpreter_frame() { address bcp = _frame.interpreter_frame_bcp(); int bci = method->validate_bci_from_bcp(bcp); // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. + // AsyncGetCallTrace interrupts the VM asynchronously. As a result + // it is possible to access an interpreter frame for which + // no Java-level information is yet available (e.g., becasue + // the frame was being created when the VM interrupted it). + // In this scenario, pretend that the interpreter is at the point + // of entering the method. if (bci < 0) { found_bad_method_frame(); - bci = 0; // pretend it's on the point of entering + bci = 0; } _mode = interpreted_mode; _method = method; diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index f7561b6f72f..318ce273668 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -65,6 +65,7 @@ #include "memory/space.hpp" #include "memory/tenuredGeneration.hpp" #include "memory/universe.hpp" +#include "memory/virtualspace.hpp" #include "memory/watermark.hpp" #include "oops/arrayKlass.hpp" #include "oops/arrayOop.hpp" @@ -100,7 +101,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/virtualspace.hpp" #include "runtime/vmStructs.hpp" #include "utilities/array.hpp" #include "utilities/globalDefinitions.hpp" @@ -555,10 +555,8 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(GenerationSpec, _init_size, size_t) \ nonstatic_field(GenerationSpec, _max_size, size_t) \ \ - static_field(GenCollectedHeap, _gch, GenCollectedHeap*) \ nonstatic_field(GenCollectedHeap, _young_gen, Generation*) \ nonstatic_field(GenCollectedHeap, _old_gen, Generation*) \ - nonstatic_field(GenCollectedHeap, _n_gens, int) \ \ nonstatic_field(GenCollectorPolicy, _young_gen_spec, GenerationSpec*) \ nonstatic_field(GenCollectorPolicy, _old_gen_spec, GenerationSpec*) \ @@ -1501,8 +1499,7 @@ typedef CompactHashtable SymbolCompactHashTable; /******************************************/ \ \ declare_toplevel_type(CollectedHeap) \ - declare_type(SharedHeap, CollectedHeap) \ - declare_type(GenCollectedHeap, SharedHeap) \ + declare_type(GenCollectedHeap, CollectedHeap) \ declare_toplevel_type(Generation) \ declare_type(DefNewGeneration, Generation) \ declare_type(CardGeneration, Generation) \ @@ -1985,13 +1982,18 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(PowDNode, Node) \ declare_c2_type(ReverseBytesINode, Node) \ declare_c2_type(ReverseBytesLNode, Node) \ + declare_c2_type(ReductionNode, Node) \ declare_c2_type(VectorNode, Node) \ declare_c2_type(AddVBNode, VectorNode) \ declare_c2_type(AddVSNode, VectorNode) \ declare_c2_type(AddVINode, VectorNode) \ + declare_c2_type(AddReductionVINode, ReductionNode) \ declare_c2_type(AddVLNode, VectorNode) \ + declare_c2_type(AddReductionVLNode, ReductionNode) \ declare_c2_type(AddVFNode, VectorNode) \ + declare_c2_type(AddReductionVFNode, ReductionNode) \ declare_c2_type(AddVDNode, VectorNode) \ + declare_c2_type(AddReductionVDNode, ReductionNode) \ declare_c2_type(SubVBNode, VectorNode) \ declare_c2_type(SubVSNode, VectorNode) \ declare_c2_type(SubVINode, VectorNode) \ @@ -2000,8 +2002,11 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(SubVDNode, VectorNode) \ declare_c2_type(MulVSNode, VectorNode) \ declare_c2_type(MulVINode, VectorNode) \ + declare_c2_type(MulReductionVINode, ReductionNode) \ declare_c2_type(MulVFNode, VectorNode) \ + declare_c2_type(MulReductionVFNode, ReductionNode) \ declare_c2_type(MulVDNode, VectorNode) \ + declare_c2_type(MulReductionVDNode, ReductionNode) \ declare_c2_type(DivVFNode, VectorNode) \ declare_c2_type(DivVDNode, VectorNode) \ declare_c2_type(LShiftVBNode, VectorNode) \ @@ -2257,8 +2262,6 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(CollectedHeap::ParallelScavengeHeap) \ declare_constant(CollectedHeap::G1CollectedHeap) \ \ - declare_constant(GenCollectedHeap::max_gens) \ - \ /* constants from Generation::Name enum */ \ \ declare_constant(Generation::DefNew) \ @@ -2516,6 +2519,7 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(Deoptimization::Reason_speculate_null_check) \ declare_constant(Deoptimization::Reason_rtm_state_change) \ declare_constant(Deoptimization::Reason_unstable_if) \ + declare_constant(Deoptimization::Reason_unstable_fused_if) \ declare_constant(Deoptimization::Reason_tenured) \ declare_constant(Deoptimization::Reason_LIMIT) \ declare_constant(Deoptimization::Reason_RECORDED_LIMIT) \ diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index ead6ad5482f..287f958a794 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -32,6 +32,7 @@ #include "services/diagnosticArgument.hpp" #include "services/diagnosticCommand.hpp" #include "services/diagnosticFramework.hpp" +#include "services/writeableFlags.hpp" #include "services/heapDumper.hpp" #include "services/management.hpp" #include "utilities/macros.hpp" @@ -50,6 +51,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -62,6 +64,9 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_SERVICES +#if INCLUDE_JVMTI + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); +#endif // INCLUDE_JVMTI DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -76,6 +81,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(jmx_agent_export_flags, true,false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(jmx_agent_export_flags, true,false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(jmx_agent_export_flags, true,false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(jmx_agent_export_flags, true,false)); } @@ -197,6 +203,46 @@ int PrintVMFlagsDCmd::num_arguments() { } } +SetVMFlagDCmd::SetVMFlagDCmd(outputStream* output, bool heap) : + DCmdWithParser(output, heap), + _flag("flag name", "The name of the flag we want to set", + "STRING", true), + _value("string value", "The value we want to set", "STRING", false) { + _dcmdparser.add_dcmd_argument(&_flag); + _dcmdparser.add_dcmd_argument(&_value); +} + +void SetVMFlagDCmd::execute(DCmdSource source, TRAPS) { + const char* val = NULL; + if (_value.value() != NULL) { + val = _value.value(); + } + + FormatBuffer<80> err_msg("%s", ""); + int ret = WriteableFlags::set_flag(_flag.value(), val, Flag::MANAGEMENT, err_msg); + + if (ret != WriteableFlags::SUCCESS) { + output()->print_cr("%s", err_msg.buffer()); + } +} + +int SetVMFlagDCmd::num_arguments() { + ResourceMark rm; + SetVMFlagDCmd* dcmd = new SetVMFlagDCmd(NULL, false); + if (dcmd != NULL) { + DCmdMark mark(dcmd); + return dcmd->_dcmdparser.num_arguments(); + } else { + return 0; + } +} + +void JVMTIDataDumpDCmd::execute(DCmdSource source, TRAPS) { + if (JvmtiExport::should_post_data_dump()) { + JvmtiExport::post_data_dump(); + } +} + void PrintSystemPropertiesDCmd::execute(DCmdSource source, TRAPS) { // load sun.misc.VMSupport Symbol* klass = vmSymbols::sun_misc_VMSupport(); @@ -663,6 +709,38 @@ void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); } +JMXStatusDCmd::JMXStatusDCmd(outputStream *output, bool heap_allocated) : + DCmd(output, heap_allocated) { + // do nothing +} + +void JMXStatusDCmd::execute(DCmdSource source, TRAPS) { + ResourceMark rm(THREAD); + HandleMark hm(THREAD); + + // Load and initialize the sun.management.Agent class + // invoke getManagementAgentStatus() method to generate the status info + // throw java.lang.NoSuchMethodError if method doesn't exist + + Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); + Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK); + instanceKlassHandle ik (THREAD, k); + + JavaValue result(T_OBJECT); + JavaCalls::call_static(&result, ik, vmSymbols::getAgentStatus_name(), vmSymbols::void_string_signature(), CHECK); + + jvalue* jv = (jvalue*) result.get_value_addr(); + oop str = (oop) jv->l; + if (str != NULL) { + char* out = java_lang_String::as_utf8_string(str); + if (out) { + output()->print_cr("%s", out); + return; + } + } + output()->print_cr("Error obtaining management agent status"); +} + VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) : DCmd(output, heap_allocated) { // do nothing diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index b51641bc684..71dbf62e629 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -131,6 +131,48 @@ public: virtual void execute(DCmdSource source, TRAPS); }; +class SetVMFlagDCmd : public DCmdWithParser { +protected: + DCmdArgument _flag; + DCmdArgument _value; + +public: + SetVMFlagDCmd(outputStream* output, bool heap); + static const char* name() { return "VM.set_flag"; } + static const char* description() { + return "Sets VM flag option using the provided value."; + } + static const char* impact() { + return "Low"; + } + static const JavaPermission permission() { + JavaPermission p = {"java.lang.management.ManagementPermission", + "control", NULL}; + return p; + } + static int num_arguments(); + virtual void execute(DCmdSource source, TRAPS); +}; + +class JVMTIDataDumpDCmd : public DCmd { +public: + JVMTIDataDumpDCmd(outputStream* output, bool heap) : DCmd(output, heap) { } + static const char* name() { return "JVMTI.data_dump"; } + static const char* description() { + return "Signal the JVM to do a data-dump request for JVMTI."; + } + static const char* impact() { + return "High"; + } + static const JavaPermission permission() { + JavaPermission p = {"java.lang.management.ManagementPermission", + "monitor", NULL}; + return p; + } + static int num_arguments() { return 0; } + virtual void execute(DCmdSource source, TRAPS); +}; + class VMDynamicLibrariesDCmd : public DCmd { public: VMDynamicLibrariesDCmd(outputStream* output, bool heap); @@ -410,6 +452,29 @@ public: virtual void execute(DCmdSource source, TRAPS); }; +// Print the JMX system status +class JMXStatusDCmd : public DCmd { +public: + JMXStatusDCmd(outputStream *output, bool heap_allocated); + + static const char *name() { + return "ManagementAgent.status"; + } + + static const char *description() { + return "Print the management agent status."; + } + + static const JavaPermission permission() { + JavaPermission p = {"java.lang.management.ManagementPermission", + "monitor", NULL}; + return p; + } + + virtual void execute(DCmdSource source, TRAPS); + +}; + class RotateGCLogDCmd : public DCmd { public: RotateGCLogDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} diff --git a/hotspot/src/share/vm/services/diagnosticFramework.cpp b/hotspot/src/share/vm/services/diagnosticFramework.cpp index e2183df19d0..c3d571d316a 100644 --- a/hotspot/src/share/vm/services/diagnosticFramework.cpp +++ b/hotspot/src/share/vm/services/diagnosticFramework.cpp @@ -455,12 +455,12 @@ void DCmdFactory::send_notification_internal(TRAPS) { } if (notif) { - Klass* k = Management::sun_management_ManagementFactoryHelper_klass(CHECK); - instanceKlassHandle mgmt_factory_helper_klass(THREAD, k); + Klass* k = Management::com_sun_management_internal_DiagnosticCommandImpl_klass(CHECK); + instanceKlassHandle dcmd_mbean_klass(THREAD, k); JavaValue result(T_OBJECT); JavaCalls::call_static(&result, - mgmt_factory_helper_klass, + dcmd_mbean_klass, vmSymbols::getDiagnosticCommandMBean_name(), vmSymbols::getDiagnosticCommandMBean_signature(), CHECK); @@ -468,12 +468,9 @@ void DCmdFactory::send_notification_internal(TRAPS) { instanceOop m = (instanceOop) result.get_jobject(); instanceHandle dcmd_mbean_h(THREAD, m); - Klass* k2 = Management::sun_management_DiagnosticCommandImpl_klass(CHECK); - instanceKlassHandle dcmd_mbean_klass(THREAD, k2); - - if (!dcmd_mbean_h->is_a(k2)) { + if (!dcmd_mbean_h->is_a(k)) { THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), - "ManagementFactory.getDiagnosticCommandMBean didn't return a DiagnosticCommandMBean instance"); + "DiagnosticCommandImpl.getDiagnosticCommandMBean didn't return a DiagnosticCommandMBean instance"); } JavaValue result2(T_VOID); diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp index 1025072339a..5a90b7be4f9 100644 --- a/hotspot/src/share/vm/services/gcNotifier.cpp +++ b/hotspot/src/share/vm/services/gcNotifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ bool GCNotifier::has_event() { static Handle getGcInfoBuilder(GCMemoryManager *gcManager,TRAPS) { - Klass* k = Management::sun_management_GarbageCollectorImpl_klass(CHECK_NH); + Klass* k = Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(CHECK_NH); instanceKlassHandle gcMBeanKlass (THREAD, k); instanceOop i = gcManager->get_memory_manager_instance(THREAD); @@ -214,8 +214,8 @@ void GCNotifier::sendNotificationInternal(TRAPS) { Handle objName = java_lang_String::create_from_str(request->gcManager->name(), CHECK); Handle objAction = java_lang_String::create_from_str(request->gcAction, CHECK); Handle objCause = java_lang_String::create_from_str(request->gcCause, CHECK); + Klass* k = Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(CHECK); - Klass* k = Management::sun_management_GarbageCollectorImpl_klass(CHECK); instanceKlassHandle gc_mbean_klass(THREAD, k); instanceOop gc_mbean = request->gcManager->get_memory_manager_instance(THREAD); diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index 3477bc9ff5a..3ccf098b7fc 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -64,18 +64,16 @@ PerfVariable* Management::_begin_vm_creation_time = NULL; PerfVariable* Management::_end_vm_creation_time = NULL; PerfVariable* Management::_vm_init_done_time = NULL; +Klass* Management::_diagnosticCommandImpl_klass = NULL; +Klass* Management::_garbageCollectorExtImpl_klass = NULL; +Klass* Management::_garbageCollectorMXBean_klass = NULL; +Klass* Management::_gcInfo_klass = NULL; +Klass* Management::_managementFactoryHelper_klass = NULL; +Klass* Management::_memoryManagerMXBean_klass = NULL; +Klass* Management::_memoryPoolMXBean_klass = NULL; +Klass* Management::_memoryUsage_klass = NULL; Klass* Management::_sensor_klass = NULL; Klass* Management::_threadInfo_klass = NULL; -Klass* Management::_memoryUsage_klass = NULL; -Klass* Management::_memoryPoolMXBean_klass = NULL; -Klass* Management::_memoryManagerMXBean_klass = NULL; -Klass* Management::_garbageCollectorMXBean_klass = NULL; -Klass* Management::_managementFactory_klass = NULL; -Klass* Management::_garbageCollectorImpl_klass = NULL; -Klass* Management::_gcInfo_klass = NULL; -Klass* Management::_diagnosticCommandImpl_klass = NULL; -Klass* Management::_managementFactoryHelper_klass = NULL; - jmmOptionalSupport Management::_optional_support = {0}; TimeStamp Management::_stamp; @@ -255,18 +253,18 @@ Klass* Management::sun_management_Sensor_klass(TRAPS) { return _sensor_klass; } -Klass* Management::sun_management_ManagementFactory_klass(TRAPS) { - if (_managementFactory_klass == NULL) { - _managementFactory_klass = load_and_initialize_klass(vmSymbols::sun_management_ManagementFactory(), CHECK_NULL); +Klass* Management::sun_management_ManagementFactoryHelper_klass(TRAPS) { + if (_managementFactoryHelper_klass == NULL) { + _managementFactoryHelper_klass = load_and_initialize_klass(vmSymbols::sun_management_ManagementFactoryHelper(), CHECK_NULL); } - return _managementFactory_klass; + return _managementFactoryHelper_klass; } -Klass* Management::sun_management_GarbageCollectorImpl_klass(TRAPS) { - if (_garbageCollectorImpl_klass == NULL) { - _garbageCollectorImpl_klass = load_and_initialize_klass(vmSymbols::sun_management_GarbageCollectorImpl(), CHECK_NULL); +Klass* Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(TRAPS) { + if (_garbageCollectorExtImpl_klass == NULL) { + _garbageCollectorExtImpl_klass = load_and_initialize_klass(vmSymbols::com_sun_management_internal_GarbageCollectorExtImpl(), CHECK_NULL); } - return _garbageCollectorImpl_klass; + return _garbageCollectorExtImpl_klass; } Klass* Management::com_sun_management_GcInfo_klass(TRAPS) { @@ -276,20 +274,13 @@ Klass* Management::com_sun_management_GcInfo_klass(TRAPS) { return _gcInfo_klass; } -Klass* Management::sun_management_DiagnosticCommandImpl_klass(TRAPS) { +Klass* Management::com_sun_management_internal_DiagnosticCommandImpl_klass(TRAPS) { if (_diagnosticCommandImpl_klass == NULL) { - _diagnosticCommandImpl_klass = load_and_initialize_klass(vmSymbols::sun_management_DiagnosticCommandImpl(), CHECK_NULL); + _diagnosticCommandImpl_klass = load_and_initialize_klass(vmSymbols::com_sun_management_internal_DiagnosticCommandImpl(), CHECK_NULL); } return _diagnosticCommandImpl_klass; } -Klass* Management::sun_management_ManagementFactoryHelper_klass(TRAPS) { - if (_managementFactoryHelper_klass == NULL) { - _managementFactoryHelper_klass = load_and_initialize_klass(vmSymbols::sun_management_ManagementFactoryHelper(), CHECK_NULL); - } - return _managementFactoryHelper_klass; -} - static void initialize_ThreadInfo_constructor_arguments(JavaCallArguments* args, ThreadSnapshot* snapshot, TRAPS) { Handle snapshot_thread(THREAD, snapshot->threadObj()); @@ -1109,6 +1100,8 @@ static void do_thread_dump(ThreadDumpResult* dump_result, bool with_locked_monitors, bool with_locked_synchronizers, TRAPS) { + // no need to actually perform thread dump if no TIDs are specified + if (num_threads == 0) return; // First get an array of threadObj handles. // A JavaThread may terminate before we get the stack trace. diff --git a/hotspot/src/share/vm/services/management.hpp b/hotspot/src/share/vm/services/management.hpp index 16d21f4bb55..e9a21980dcd 100644 --- a/hotspot/src/share/vm/services/management.hpp +++ b/hotspot/src/share/vm/services/management.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,18 +42,16 @@ private: static TimeStamp _stamp; // Timestamp since vm init done time // Management klasses + static Klass* _diagnosticCommandImpl_klass; + static Klass* _garbageCollectorExtImpl_klass; + static Klass* _garbageCollectorMXBean_klass; + static Klass* _gcInfo_klass; + static Klass* _managementFactoryHelper_klass; + static Klass* _memoryManagerMXBean_klass; + static Klass* _memoryPoolMXBean_klass; + static Klass* _memoryUsage_klass; static Klass* _sensor_klass; static Klass* _threadInfo_klass; - static Klass* _memoryUsage_klass; - static Klass* _memoryPoolMXBean_klass; - static Klass* _memoryManagerMXBean_klass; - static Klass* _garbageCollectorMXBean_klass; - static Klass* _managementFactory_klass; - static Klass* _garbageCollectorImpl_klass; - static Klass* _diagnosticCommandImpl_klass; - static Klass* _managementFactoryHelper_klass; - static Klass* _gcInfo_klass; - static Klass* load_and_initialize_klass(Symbol* sh, TRAPS); public: @@ -93,17 +91,15 @@ public: static Klass* java_lang_management_MemoryPoolMXBean_klass(TRAPS); static Klass* java_lang_management_MemoryManagerMXBean_klass(TRAPS); static Klass* java_lang_management_GarbageCollectorMXBean_klass(TRAPS); + static Klass* sun_management_ManagementFactoryHelper_klass(TRAPS) + NOT_MANAGEMENT_RETURN_(NULL); static Klass* sun_management_Sensor_klass(TRAPS) NOT_MANAGEMENT_RETURN_(NULL); - static Klass* sun_management_ManagementFactory_klass(TRAPS) - NOT_MANAGEMENT_RETURN_(NULL); - static Klass* sun_management_GarbageCollectorImpl_klass(TRAPS) + static Klass* com_sun_management_internal_GarbageCollectorExtImpl_klass(TRAPS) NOT_MANAGEMENT_RETURN_(NULL); static Klass* com_sun_management_GcInfo_klass(TRAPS) NOT_MANAGEMENT_RETURN_(NULL); - static Klass* sun_management_DiagnosticCommandImpl_klass(TRAPS) - NOT_MANAGEMENT_RETURN_(NULL); - static Klass* sun_management_ManagementFactoryHelper_klass(TRAPS) + static Klass* com_sun_management_internal_DiagnosticCommandImpl_klass(TRAPS) NOT_MANAGEMENT_RETURN_(NULL); static instanceOop create_thread_info_instance(ThreadSnapshot* snapshot, TRAPS); diff --git a/hotspot/src/share/vm/services/memTracker.cpp b/hotspot/src/share/vm/services/memTracker.cpp index 68d4337fd5a..136b0ca5903 100644 --- a/hotspot/src/share/vm/services/memTracker.cpp +++ b/hotspot/src/share/vm/services/memTracker.cpp @@ -47,9 +47,9 @@ bool MemTracker::_is_nmt_env_valid = true; NMT_TrackingLevel MemTracker::init_tracking_level() { NMT_TrackingLevel level = NMT_off; char buf[64]; - char nmt_option[64]; jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id()); - if (os::getenv(buf, nmt_option, sizeof(nmt_option))) { + const char *nmt_option = ::getenv(buf); + if (nmt_option != NULL) { if (strcmp(nmt_option, "summary") == 0) { level = NMT_summary; } else if (strcmp(nmt_option, "detail") == 0) { @@ -311,4 +311,3 @@ void MemTracker::tuning_statistics(outputStream* out) { out->print_cr(" "); walker.report_statistics(out); } - diff --git a/hotspot/src/share/vm/services/memoryManager.cpp b/hotspot/src/share/vm/services/memoryManager.cpp index 841b771067e..d42ec61a8c9 100644 --- a/hotspot/src/share/vm/services/memoryManager.cpp +++ b/hotspot/src/share/vm/services/memoryManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,8 +98,7 @@ instanceOop MemoryManager::get_memory_manager_instance(TRAPS) { if (mgr_obj == NULL) { // It's ok for more than one thread to execute the code up to the locked region. // Extra manager instances will just be gc'ed. - Klass* k = Management::sun_management_ManagementFactory_klass(CHECK_0); - instanceKlassHandle ik(THREAD, k); + Klass* k = Management::sun_management_ManagementFactoryHelper_klass(CHECK_0); Handle mgr_name = java_lang_String::create_from_str(name(), CHECK_0); @@ -110,7 +109,14 @@ instanceOop MemoryManager::get_memory_manager_instance(TRAPS) { Symbol* method_name = NULL; Symbol* signature = NULL; if (is_gc_memory_manager()) { + Klass* extKlass = Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(CHECK_0); + // com.sun.management.GarbageCollectorMXBean is in jdk.management module which may not be present. + if (extKlass != NULL) { + k = extKlass; + } + method_name = vmSymbols::createGarbageCollector_name(); + signature = vmSymbols::createGarbageCollector_signature(); args.push_oop(Handle()); // Argument 2 (for future extension) } else { @@ -118,6 +124,8 @@ instanceOop MemoryManager::get_memory_manager_instance(TRAPS) { signature = vmSymbols::createMemoryManager_signature(); } + instanceKlassHandle ik(THREAD, k); + JavaCalls::call_static(&result, ik, method_name, diff --git a/hotspot/src/share/vm/services/memoryManager.hpp b/hotspot/src/share/vm/services/memoryManager.hpp index 8e61f521bbc..f2a7d4c3420 100644 --- a/hotspot/src/share/vm/services/memoryManager.hpp +++ b/hotspot/src/share/vm/services/memoryManager.hpp @@ -53,20 +53,6 @@ protected: volatile instanceOop _memory_mgr_obj; public: - enum Name { - Abstract, - CodeCache, - Metaspace, - Copy, - MarkSweepCompact, - ParNew, - ConcurrentMarkSweep, - PSScavenge, - PSMarkSweep, - G1YoungGen, - G1OldGen - }; - MemoryManager(); int num_memory_pools() const { return _num_pools; } @@ -80,7 +66,6 @@ public: bool is_manager(instanceHandle mh) { return mh() == _memory_mgr_obj; } virtual instanceOop get_memory_manager_instance(TRAPS); - virtual MemoryManager::Name kind() { return MemoryManager::Abstract; } virtual bool is_gc_memory_manager() { return false; } virtual const char* name() = 0; @@ -98,7 +83,6 @@ public: static GCMemoryManager* get_psMarkSweep_memory_manager(); static GCMemoryManager* get_g1YoungGen_memory_manager(); static GCMemoryManager* get_g1OldGen_memory_manager(); - }; class CodeCacheMemoryManager : public MemoryManager { @@ -106,16 +90,14 @@ private: public: CodeCacheMemoryManager() : MemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::CodeCache; } - const char* name() { return "CodeCacheManager"; } + const char* name() { return "CodeCacheManager"; } }; class MetaspaceMemoryManager : public MemoryManager { public: MetaspaceMemoryManager() : MemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::Metaspace; } - const char *name() { return "Metaspace Manager"; } + const char* name() { return "Metaspace Manager"; } }; class GCStatInfo : public ResourceObj { @@ -202,7 +184,6 @@ public: void set_notification_enabled(bool enabled) { _notification_enabled = enabled; } bool is_notification_enabled() { return _notification_enabled; } - virtual MemoryManager::Name kind() = 0; }; // These subclasses of GCMemoryManager are defined to include @@ -213,8 +194,7 @@ private: public: CopyMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::Copy; } - const char* name() { return "Copy"; } + const char* name() { return "Copy"; } }; class MSCMemoryManager : public GCMemoryManager { @@ -222,9 +202,7 @@ private: public: MSCMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::MarkSweepCompact; } - const char* name() { return "MarkSweepCompact"; } - + const char* name() { return "MarkSweepCompact"; } }; class ParNewMemoryManager : public GCMemoryManager { @@ -232,9 +210,7 @@ private: public: ParNewMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::ParNew; } - const char* name() { return "ParNew"; } - + const char* name() { return "ParNew"; } }; class CMSMemoryManager : public GCMemoryManager { @@ -242,9 +218,7 @@ private: public: CMSMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::ConcurrentMarkSweep; } - const char* name() { return "ConcurrentMarkSweep";} - + const char* name() { return "ConcurrentMarkSweep";} }; class PSScavengeMemoryManager : public GCMemoryManager { @@ -252,9 +226,7 @@ private: public: PSScavengeMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::PSScavenge; } - const char* name() { return "PS Scavenge"; } - + const char* name() { return "PS Scavenge"; } }; class PSMarkSweepMemoryManager : public GCMemoryManager { @@ -262,8 +234,7 @@ private: public: PSMarkSweepMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::PSMarkSweep; } - const char* name() { return "PS MarkSweep"; } + const char* name() { return "PS MarkSweep"; } }; class G1YoungGenMemoryManager : public GCMemoryManager { @@ -271,8 +242,7 @@ private: public: G1YoungGenMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::G1YoungGen; } - const char* name() { return "G1 Young Generation"; } + const char* name() { return "G1 Young Generation"; } }; class G1OldGenMemoryManager : public GCMemoryManager { @@ -280,8 +250,7 @@ private: public: G1OldGenMemoryManager() : GCMemoryManager() {} - MemoryManager::Name kind() { return MemoryManager::G1OldGen; } - const char* name() { return "G1 Old Generation"; } + const char* name() { return "G1 Old Generation"; } }; #endif // SHARE_VM_SERVICES_MEMORYMANAGER_HPP diff --git a/hotspot/src/share/vm/services/memoryPool.cpp b/hotspot/src/share/vm/services/memoryPool.cpp index e9bc4d0542b..086530bd0d8 100644 --- a/hotspot/src/share/vm/services/memoryPool.cpp +++ b/hotspot/src/share/vm/services/memoryPool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ instanceOop MemoryPool::get_memory_pool_instance(TRAPS) { if (pool_obj == NULL) { // It's ok for more than one thread to execute the code up to the locked region. // Extra pool instances will just be gc'ed. - Klass* k = Management::sun_management_ManagementFactory_klass(CHECK_NULL); + Klass* k = Management::sun_management_ManagementFactoryHelper_klass(CHECK_NULL); instanceKlassHandle ik(THREAD, k); Handle pool_name = java_lang_String::create_from_str(_name, CHECK_NULL); diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 89e57affaa3..bb1f7f19d3c 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -126,9 +126,8 @@ void MemoryService::add_gen_collected_heap_info(GenCollectedHeap* heap) { CollectorPolicy* policy = heap->collector_policy(); assert(policy->is_generation_policy(), "Only support two generations"); - guarantee(heap->n_gens() == 2, "Only support two-generation heap"); - GenCollectorPolicy* gen_policy = policy->as_generation_policy(); + guarantee(gen_policy->number_of_generations() == 2, "Only support two-generation heap"); if (gen_policy != NULL) { Generation::Name kind = gen_policy->young_gen_spec()->name(); switch (kind) { diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 45dae674d53..15cfabb95e1 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -407,14 +407,6 @@ const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlas // Machine dependent stuff -#if defined(X86) && defined(COMPILER2) && !defined(JAVASE_EMBEDDED) -// Include Restricted Transactional Memory lock eliding optimization -#define INCLUDE_RTM_OPT 1 -#define RTM_OPT_ONLY(code) code -#else -#define INCLUDE_RTM_OPT 0 -#define RTM_OPT_ONLY(code) -#endif // States of Restricted Transactional Memory usage. enum RTMState { NoRTM = 0x2, // Don't use RTM @@ -446,6 +438,15 @@ enum RTMState { # include "globalDefinitions_aarch64.hpp" #endif +#ifndef INCLUDE_RTM_OPT +#define INCLUDE_RTM_OPT 0 +#endif +#if INCLUDE_RTM_OPT +#define RTM_OPT_ONLY(code) code +#else +#define RTM_OPT_ONLY(code) +#endif + // To assure the IRIW property on processors that are not multiple copy // atomic, sync instructions must be issued between volatile reads to // assure their ordering, instead of after volatile stores. @@ -1345,6 +1346,13 @@ inline intptr_t p2i(const void * p) { return (intptr_t) p; } +// swap a & b +template static void swap(T& a, T& b) { + T tmp = a; + a = b; + b = tmp; +} + // Printf-style formatters for fixed- and variable-width types as pointers and // integers. These are derived from the definitions in inttypes.h. If the platform // doesn't provide appropriate definitions, they should be provided in diff --git a/hotspot/src/share/vm/utilities/growableArray.hpp b/hotspot/src/share/vm/utilities/growableArray.hpp index c92848d200e..5d0ca20d052 100644 --- a/hotspot/src/share/vm/utilities/growableArray.hpp +++ b/hotspot/src/share/vm/utilities/growableArray.hpp @@ -168,6 +168,8 @@ template class GrowableArray : public GenericGrowableArray { GrowableArray(int initial_size, bool C_heap = false, MEMFLAGS F = mtInternal) : GenericGrowableArray(initial_size, 0, C_heap, F) { _data = (E*)raw_allocate(sizeof(E)); +// Needed for Visual Studio 2012 and older +#pragma warning(suppress: 4345) for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E(); } @@ -385,6 +387,8 @@ template void GrowableArray::grow(int j) { E* newData = (E*)raw_allocate(sizeof(E)); int i = 0; for ( ; i < _len; i++) ::new ((void*)&newData[i]) E(_data[i]); +// Needed for Visual Studio 2012 and older +#pragma warning(suppress: 4345) for ( ; i < _max; i++) ::new ((void*)&newData[i]) E(); for (i = 0; i < old_max; i++) _data[i].~E(); if (on_C_heap() && _data != NULL) { diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index b187f7a029f..57fe3465136 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -109,7 +109,7 @@ const char* outputStream::do_vsnprintf(char* buffer, size_t buflen, } if (add_cr) { if (result != buffer) { - strncpy(buffer, result, buflen); + memcpy(buffer, result, result_len); result = buffer; } buffer[result_len++] = '\n'; @@ -334,15 +334,19 @@ void stringStream::write(const char* s, size_t len) { assert(rm == NULL || Thread::current()->current_resource_mark() == rm, "stringStream is re-allocated with a different ResourceMark"); buffer = NEW_RESOURCE_ARRAY(char, end); - strncpy(buffer, oldbuf, buffer_pos); + if (buffer_pos > 0) { + memcpy(buffer, oldbuf, buffer_pos); + } buffer_length = end; } } // invariant: buffer is always null-terminated guarantee(buffer_pos + write_len + 1 <= buffer_length, "stringStream oob"); - buffer[buffer_pos + write_len] = 0; - strncpy(buffer + buffer_pos, s, write_len); - buffer_pos += write_len; + if (write_len > 0) { + buffer[buffer_pos + write_len] = 0; + memcpy(buffer + buffer_pos, s, write_len); + buffer_pos += write_len; + } // Note that the following does not depend on write_len. // This means that position and count get updated @@ -978,8 +982,13 @@ void defaultStream::start_log() { xs->head("properties"); // Print it as a java-style property list. // System properties don't generally contain newlines, so don't bother with unparsing. + outputStream *text = xs->text(); for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) { - xs->text()->print_cr("%s=%s", p->key(), p->value()); + // Print in two stages to avoid problems with long + // keys/values. + text->print_raw(p->key()); + text->put('='); + text->print_raw_cr(p->value()); } xs->tail("properties"); } diff --git a/hotspot/src/share/vm/utilities/stack.hpp b/hotspot/src/share/vm/utilities/stack.hpp index 4814bf92f2f..7c866897691 100644 --- a/hotspot/src/share/vm/utilities/stack.hpp +++ b/hotspot/src/share/vm/utilities/stack.hpp @@ -96,11 +96,16 @@ class Stack: public StackBase public: friend class StackIterator; + // Number of elements that fit in 4K bytes minus the size of two pointers + // (link field and malloc header). + static const size_t _default_segment_size = (4096 - 2 * sizeof(E*)) / sizeof(E); + static size_t default_segment_size() { return _default_segment_size; } + // segment_size: number of items per segment // max_cache_size: maxmium number of *segments* to cache // max_size: maximum number of items allowed, rounded to a multiple of // the segment size (0 == unlimited) - inline Stack(size_t segment_size = default_segment_size(), + inline Stack(size_t segment_size = _default_segment_size, size_t max_cache_size = 4, size_t max_size = 0); inline ~Stack() { clear(true); } @@ -122,8 +127,6 @@ public: // clear_cache is true, also release any cached segments. void clear(bool clear_cache = false); - static inline size_t default_segment_size(); - protected: // Each segment includes space for _seg_size elements followed by a link // (pointer) to the previous segment; the space is allocated as a single block diff --git a/hotspot/src/share/vm/utilities/stack.inline.hpp b/hotspot/src/share/vm/utilities/stack.inline.hpp index f63957a7a8c..201f044b714 100644 --- a/hotspot/src/share/vm/utilities/stack.inline.hpp +++ b/hotspot/src/share/vm/utilities/stack.inline.hpp @@ -85,14 +85,6 @@ void Stack::clear(bool clear_cache) reset(clear_cache); } -template -size_t Stack::default_segment_size() -{ - // Number of elements that fit in 4K bytes minus the size of two pointers - // (link field and malloc header). - return (4096 - 2 * sizeof(E*)) / sizeof(E); -} - template size_t Stack::adjust_segment_size(size_t seg_size) { diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 8f2d2ab1cf3..4eef724f6ec 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -217,7 +217,7 @@ static void print_bug_submit_message(outputStream *out, Thread *thread) { bool VMError::coredump_status; char VMError::coredump_message[O_BUFLEN]; -void VMError::report_coredump_status(const char* message, bool status) { +void VMError::record_coredump_status(const char* message, bool status) { coredump_status = status; strncpy(coredump_message, message, sizeof(coredump_message)); coredump_message[sizeof(coredump_message)-1] = 0; @@ -231,7 +231,7 @@ char* VMError::error_string(char* buf, int buflen) { if (signame) { jio_snprintf(buf, buflen, - "%s (0x%x) at pc=" PTR_FORMAT ", pid=%d, tid=" UINTX_FORMAT, + "%s (0x%x) at pc=" PTR_FORMAT ", pid=%d, tid=" INTPTR_FORMAT, signame, _id, _pc, os::current_process_id(), os::current_thread_id()); } else if (_filename != NULL && _lineno > 0) { @@ -239,7 +239,7 @@ char* VMError::error_string(char* buf, int buflen) { char separator = os::file_separator()[0]; const char *p = strrchr(_filename, separator); int n = jio_snprintf(buf, buflen, - "Internal Error at %s:%d, pid=%d, tid=" UINTX_FORMAT, + "Internal Error at %s:%d, pid=%d, tid=" INTPTR_FORMAT, p ? p + 1 : _filename, _lineno, os::current_process_id(), os::current_thread_id()); if (n >= 0 && n < buflen && _message) { @@ -253,7 +253,7 @@ char* VMError::error_string(char* buf, int buflen) { } } else { jio_snprintf(buf, buflen, - "Internal Error (0x%x), pid=%d, tid=" UINTX_FORMAT, + "Internal Error (0x%x), pid=%d, tid=" INTPTR_FORMAT, _id, os::current_process_id(), os::current_thread_id()); } @@ -463,14 +463,7 @@ void VMError::report(outputStream* st) { #else const char *file = _filename; #endif - size_t len = strlen(file); - size_t buflen = sizeof(buf); - - strncpy(buf, file, buflen); - if (len + 10 < buflen) { - sprintf(buf + len, ":%d", _lineno); - } - st->print(" (%s)", buf); + st->print(" (%s:%d)", file, _lineno); } else { st->print(" (0x%x)", _id); } @@ -480,7 +473,7 @@ void VMError::report(outputStream* st) { // process id, thread id st->print(", pid=%d", os::current_process_id()); - st->print(", tid=" UINTX_FORMAT, os::current_thread_id()); + st->print(", tid=" INTPTR_FORMAT, os::current_thread_id()); st->cr(); STEP(40, "(printing error message)") @@ -525,10 +518,14 @@ void VMError::report(outputStream* st) { } STEP(63, "(printing core file information)") st->print("# "); - if (coredump_status) { - st->print("Core dump written. Default location: %s", coredump_message); + if (CreateCoredumpOnCrash) { + if (coredump_status) { + st->print("Core dump will be written. %s", coredump_message); + } else { + st->print("No core dump will be written. %s", coredump_message); + } } else { - st->print("Failed to write core dump. %s", coredump_message); + st->print("CreateCoredumpOnCrash turned off, no core file dumped"); } st->cr(); st->print_cr("#"); @@ -768,7 +765,7 @@ void VMError::report(outputStream* st) { STEP(220, "(printing environment variables)" ) if (_verbose) { - os::print_environment_variables(st, env_list, buf, sizeof(buf)); + os::print_environment_variables(st, env_list); st->cr(); } @@ -918,7 +915,7 @@ void VMError::report_and_die() { static bool transmit_report_done = false; // done error reporting if (SuppressFatalErrorMessage) { - os::abort(); + os::abort(CreateCoredumpOnCrash); } jlong mytid = os::current_thread_id(); if (first_error == NULL && @@ -936,8 +933,7 @@ void VMError::report_and_die() { ShowMessageBoxOnError = false; } - // Write a minidump on Windows, check core dump limits on Linux/Solaris - os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer)); + os::check_dump_limit(buffer, sizeof(buffer)); // reset signal handlers or exception filter; make sure recursive crashes // are handled properly. @@ -1108,7 +1104,7 @@ void VMError::report_and_die() { if (!skip_os_abort) { skip_os_abort = true; bool dump_core = should_report_bug(first_error->_id); - os::abort(dump_core); + os::abort(dump_core && CreateCoredumpOnCrash, _siginfo, _context); } // if os::abort() doesn't abort, try os::die(); diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index 299cfaa6f3d..dfc147588b2 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +117,8 @@ public: // return a string to describe the error char *error_string(char* buf, int buflen); - // Report status of core/minidump - static void report_coredump_status(const char* message, bool status); + // Record status of core/minidump + static void record_coredump_status(const char* message, bool status); // main error reporting function void report_and_die(); diff --git a/hotspot/src/share/vm/utilities/workgroup.hpp b/hotspot/src/share/vm/utilities/workgroup.hpp index 30337f1ef50..bc4db6eb18d 100644 --- a/hotspot/src/share/vm/utilities/workgroup.hpp +++ b/hotspot/src/share/vm/utilities/workgroup.hpp @@ -340,18 +340,6 @@ class FlexibleWorkGang: public WorkGang { } }; -// Work gangs in garbage collectors: 2009-06-10 -// -// SharedHeap - work gang for stop-the-world parallel collection. -// Used by -// ParNewGeneration -// CMSParRemarkTask -// CMSRefProcTaskExecutor -// G1CollectedHeap -// G1ParFinalCountTask -// ConcurrentMark -// CMSCollector - // A class that acts as a synchronisation barrier. Workers enter // the barrier and must wait until all other workers have entered // before any of them may leave. diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile index 013824e61a1..a33358dec7e 100644 --- a/hotspot/test/Makefile +++ b/hotspot/test/Makefile @@ -279,6 +279,8 @@ endif # Default JTREG to run JTREG = $(JT_HOME)/bin/jtreg +# Use agent mode +JTREG_BASIC_OPTIONS += -agentvm # Only run automatic tests JTREG_BASIC_OPTIONS += -a # Report details on all failed or error tests, times too @@ -344,6 +346,34 @@ PHONY_LIST += sanitytest ################################################################ +# basicvmtest (make sure various basic java options work) + +# Set up the directory in which the jvm directories live (client/, server/, etc.) +ifeq ($(PLATFORM),windows) +JVMS_DIR := $(PRODUCT_HOME)/bin +else ifeq ($(PLATFORM),bsd) +JVMS_DIR := $(PRODUCT_HOME)/lib +else +# The jvms live in the architecture directory (amd64, sparcv9, +# etc.). By using a wildcard there's no need to figure out the exact +# name of that directory. +JVMS_DIR := $(PRODUCT_HOME)/lib/* +endif + +# Use the existance of a directory as a sign that jvm variant is available +CANDIDATE_JVM_VARIANTS := client minimal server +JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x)))) + +hotspot_basicvmtest: + for variant in $(JVM_VARIANTS); \ + do \ + $(MAKE) JAVA_ARGS="$(JAVA_ARGS) -$$variant" hotspot_$${variant}test; \ + done + +PHONY_LIST += hotspot_basicvmtest + +################################################################ + # clienttest (make sure various basic java client options work) hotspot_clienttest clienttest: sanitytest diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index db2196ac778..69e9b60a5e6 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -394,6 +394,7 @@ hotspot_compiler_closed = \ hotspot_gc = \ sanity/ExecuteInternalVMTests.java \ gc/ \ + -gc/g1/TestGreyReclaimedHumongousObjects.java \ -gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java hotspot_gc_closed = \ @@ -416,9 +417,7 @@ hotspot_runtime = \ -runtime/SharedArchiveFile/CdsSameObjectAlignment.java \ -runtime/SharedArchiveFile/DefaultUseWithClient.java \ -runtime/Thread/CancellableThreadTest.java \ - -runtime/7158988/FieldMonitor.java - -hotspot_runtime_closed = \ + -runtime/7158988/FieldMonitor.java \ sanity/ExecuteInternalVMTests.java \ testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyBadReexec.java b/hotspot/test/compiler/arraycopy/TestArrayCopyBadReexec.java new file mode 100644 index 00000000000..09b03328ed5 --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyBadReexec.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8073866 + * @summary Fix for 8064703 may also cause stores between the allocation and arraycopy to be rexecuted after a deoptimization + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyBadReexec + * + */ + +public class TestArrayCopyBadReexec { + + static int val; + + static int[] m1(int[] src, int l) { + if (src == null) { + return null; + } + int[] dest = new int[10]; + val++; + try { + System.arraycopy(src, 0, dest, 0, l); + } catch (IndexOutOfBoundsException npe) { + } + return dest; + } + + static public void main(String[] args) { + int[] src = new int[10]; + int[] res = null; + boolean success = true; + + for (int i = 0; i < 20000; i++) { + m1(src, 10); + } + + int val_before = val; + + m1(src, -1); + + if (val - val_before != 1) { + System.out.println("Bad increment: " + (val - val_before)); + throw new RuntimeException("Test failed"); + } + } +} diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInit.java b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInit.java index 4583e5a366f..8d9978a61a9 100644 --- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInit.java +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInit.java @@ -76,7 +76,7 @@ public class TestArrayCopyNoInit { static TestArrayCopyNoInit[] m5(Object[] src) { Object tmp = src[0]; TestArrayCopyNoInit[] dest = new TestArrayCopyNoInit[10]; - System.arraycopy(src, 0, dest, 0, 0); + System.arraycopy(src, 0, dest, 0, 10); return dest; } @@ -110,7 +110,7 @@ public class TestArrayCopyNoInit { static H[] m6(Object[] src) { Object tmp = src[0]; H[] dest = new H[10]; - System.arraycopy(src, 0, dest, 0, 0); + System.arraycopy(src, 0, dest, 0, 10); return dest; } diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java index c72ff09a4c5..8cef75f9606 100644 --- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java @@ -116,44 +116,46 @@ public class TestArrayCopyNoInitDeopt { throw new RuntimeException("m1 deoptimized again"); } - // Same test as above but with speculative types + if (WHITE_BOX.getUintxVMFlag("TypeProfileLevel") == 20) { + // Same test as above but with speculative types - // Warm up & make sure we collect type profiling - for (int i = 0; i < 20000; i++) { - m2(src); - } + // Warm up & make sure we collect type profiling + for (int i = 0; i < 20000; i++) { + m2(src); + } - // And make sure m2 is compiled by C2 - WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + // And make sure m2 is compiled by C2 + WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method_m2)) { - throw new RuntimeException("m2 not compiled"); - } + if (!WHITE_BOX.isMethodCompiled(method_m2)) { + throw new RuntimeException("m2 not compiled"); + } - // should deoptimize for speculative type check - if (!deoptimize(method_m2, src_obj)) { - throw new RuntimeException("m2 not deoptimized"); - } + // should deoptimize for speculative type check + if (!deoptimize(method_m2, src_obj)) { + throw new RuntimeException("m2 not deoptimized"); + } - WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method_m2)) { - throw new RuntimeException("m2 not recompiled"); - } + if (!WHITE_BOX.isMethodCompiled(method_m2)) { + throw new RuntimeException("m2 not recompiled"); + } - // should deoptimize for actual type check - if (!deoptimize(method_m2, src_obj)) { - throw new RuntimeException("m2 not deoptimized"); - } + // should deoptimize for actual type check + if (!deoptimize(method_m2, src_obj)) { + throw new RuntimeException("m2 not deoptimized"); + } - WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method_m2)) { - throw new RuntimeException("m2 not recompiled"); - } + if (!WHITE_BOX.isMethodCompiled(method_m2)) { + throw new RuntimeException("m2 not recompiled"); + } - if (deoptimize(method_m2, src_obj)) { - throw new RuntimeException("m2 deoptimized again"); + if (deoptimize(method_m2, src_obj)) { + throw new RuntimeException("m2 deoptimized again"); + } } } } diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyOfStopped.java b/hotspot/test/compiler/arraycopy/TestArrayCopyOfStopped.java new file mode 100644 index 00000000000..1d60235fffe --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyOfStopped.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074676 + * @summary after guards in Arrays.copyOf() intrinsic, control may become top + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOfStopped + * + */ + +import java.util.Arrays; + +public class TestArrayCopyOfStopped { + static class A { + } + + static class B { + } + + static final B[] array_of_bs = new B[10]; + static final A[] array_of_as = new A[10]; + + static Object[] m1_helper(Object[] array, boolean flag) { + if (flag) { + return Arrays.copyOf(array, 10, A[].class); + } + return null; + } + + static Object[] m1(boolean flag) { + return m1_helper(array_of_bs, flag); + } + + public static void main(String[] args) { + for (int i = 0; i < 20000; i++) { + m1_helper(array_of_as, (i%2) == 0); + } + + for (int i = 0; i < 20000; i++) { + m1(false); + } + } +} diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java b/hotspot/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java new file mode 100644 index 00000000000..c75a69677ad --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8075921 + * @summary control becomes top after arraycopy guards and confuses tighly coupled allocation logic + * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCopyStoppedAfterGuards.test,System.arraycopy TestArrayCopyStoppedAfterGuards + * + */ + +public class TestArrayCopyStoppedAfterGuards { + + static void test() { + Object src = new Object(); + int[] dst = new int[10]; + System.arraycopy(src, 0, dst, 0, 10); + } + + static public void main(String[] args) { + // warmup + Object o = new Object(); + int[] src = new int[10]; + int[] dst = new int[10]; + System.arraycopy(src, 0, dst, 0, 10); + + try { + test(); + } catch(ArrayStoreException ase) {} + } +} diff --git a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java index 8e390c1d70d..86c7bd9682b 100644 --- a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -37,7 +37,6 @@ import sun.hotspot.code.BlobType; /* * @test PoolsIndependenceTest - * @ignore 8068385 * @library /testlibrary /../../test/lib * @build PoolsIndependenceTest * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/jdk/test/java/lang/management/ThreadMXBean/Semaphore.java b/hotspot/test/compiler/inlining/DefaultMethodsDependencies.java similarity index 51% rename from jdk/test/java/lang/management/ThreadMXBean/Semaphore.java rename to hotspot/test/compiler/inlining/DefaultMethodsDependencies.java index c5a6635f286..5bdc60fdabd 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/Semaphore.java +++ b/hotspot/test/compiler/inlining/DefaultMethodsDependencies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * 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,53 +22,42 @@ */ /* - * @bug 4530538 - * @summary A semaphore utility class. - * @author Mandy Chung + * @test + * @bug 8069263 + * @summary Deoptimization between array allocation and arraycopy may result in non initialized array + * @run main/othervm -XX:-BackgroundCompilation -XX:CompileOnly=DefaultMethodsDependencies::test -XX:CompileOnly=DefaultMethodsDependencies$I2::m1 DefaultMethodsDependencies + * */ -public class Semaphore { - private Object go = new Object(); - private int semaCount; - private int waiters = 0; +public class DefaultMethodsDependencies { - public Semaphore() { - semaCount = 0; - } - - public Semaphore(int initialCount) { - semaCount = initialCount; - } - - public void semaP() { - synchronized (go) { - waiters++; - while (semaCount == 0) { - try { - go.wait(); - } catch (InterruptedException e) { - e.printStackTrace(); - throw new InternalError(); - } - } - semaCount--; - waiters--; - } - } - public void semaV() { - synchronized (go) { - semaCount++; - go.notify(); + interface I1 { + void m1(); + // triggers processing of default methods in C1 + default void m2() { } } - public int getWaiterCount() { - synchronized (go) { - return waiters; + interface I2 extends I1 { + // added to C2 as default method + default void m1() { } } - public Object getLock() { - return go; + static abstract class C1 implements I1 { + } + + static class C2 extends C1 implements I2 { + } + + static void test(C1 obj) { + obj.m1(); + } + + static public void main(String[] args) { + C2 obj = new C2(); + for (int i = 0; i < 20000; i++) { + test(obj); + } } } diff --git a/hotspot/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java b/hotspot/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java index c7425966076..a3b4bac74a8 100644 --- a/hotspot/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java +++ b/hotspot/test/compiler/intrinsics/multiplytolen/TestMultiplyToLen.java @@ -34,6 +34,7 @@ * -XX:CompileCommand=inline,java.math.BigInteger::multiply TestMultiplyToLen */ +import java.util.Arrays; import java.util.Random; import java.math.*; @@ -96,6 +97,29 @@ public class TestMultiplyToLen { oldsum = oldsum.add(oldres); newsum = newsum.add(newres); + if (!bytecompare(oldres,newres)) { + System.out.println(b1); + System.out.println(b2); + System.out.print("mismatch for:b1:" + stringify(b1) + " :b2:" + stringify(b2) + " :oldres:" + stringify(oldres) + " :newres:" + stringify(newres)); + throw new Exception("Failed"); + } + } + + // Test carry propagation. Multiple carries during bignum + // multiplication are rare (especially when using 64-bit + // arithmetic) so we have to provoke them deliberately. + for (int j = 4; j <= 396; j += 4) { + byte[] bytes = new byte[j]; + Arrays.fill(bytes, (byte)255); + b1 = new BigInteger(bytes); + b2 = new BigInteger(bytes); + + oldres = base_multiply(b1,b2); + newres = new_multiply(b1,b2); + + oldsum = oldsum.add(oldres); + newsum = newsum.add(newres); + if (!bytecompare(oldres,newres)) { System.out.print("mismatch for:b1:" + stringify(b1) + " :b2:" + stringify(b2) + " :oldres:" + stringify(oldres) + " :newres:" + stringify(newres)); System.out.println(b1); @@ -103,6 +127,7 @@ public class TestMultiplyToLen { throw new Exception("Failed"); } } + if (!bytecompare(oldsum,newsum)) { System.out.println("Failure: oldsum:" + stringify(oldsum) + " newsum:" + stringify(newsum)); throw new Exception("Failed"); diff --git a/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java b/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java new file mode 100644 index 00000000000..fc0890b6c3e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java @@ -0,0 +1,371 @@ +// +// Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, Red Hat Inc. All rights reserved. +// 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 com.oracle.java.testlibrary.Utils; +import static java.lang.Math.abs; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import static java.nio.ByteOrder.BIG_ENDIAN; +import static java.nio.ByteOrder.LITTLE_ENDIAN; +import java.util.Random; +import java.util.Arrays; + +/** + * @test + * @bug 8026049 + * @library /testlibrary + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses HeapByteBufferTest + * @run main/othervm HeapByteBufferTest + * @summary Verify that byte buffers are correctly accessed. + */ + +// A wrapper for a ByteBuffer which maintains a backing array and a +// position. Whenever this wrapper is written the backing array and +// the wrapped byte buffer are updated together, and whenever it is +// read we check that the ByteBuffer and the backing array are identical. + +class MyByteBuffer { + final ByteBuffer buf; + final byte[] bytes; + int pos; + ByteOrder byteOrder = BIG_ENDIAN; + + MyByteBuffer(ByteBuffer buf, byte[] bytes) { + this.buf = buf; + this.bytes = Arrays.copyOf(bytes, bytes.length); + pos = 0; + } + + public final MyByteBuffer order(ByteOrder bo) { + byteOrder = bo; + buf.order(bo); + return this; + } + + static MyByteBuffer wrap(byte[] bytes) { + return new MyByteBuffer(ByteBuffer.wrap(bytes), bytes); + } + + int capacity() { return bytes.length; } + int position() { + if (buf.position() != pos) + throw new RuntimeException(); + return buf.position(); + } + + byte[] array() { return buf.array(); } + byte[] backingArray() { return bytes; } + + private static byte long7(long x) { return (byte)(x >> 56); } + private static byte long6(long x) { return (byte)(x >> 48); } + private static byte long5(long x) { return (byte)(x >> 40); } + private static byte long4(long x) { return (byte)(x >> 32); } + private static byte long3(long x) { return (byte)(x >> 24); } + private static byte long2(long x) { return (byte)(x >> 16); } + private static byte long1(long x) { return (byte)(x >> 8); } + private static byte long0(long x) { return (byte)(x ); } + + private static byte int3(int x) { return (byte)(x >> 24); } + private static byte int2(int x) { return (byte)(x >> 16); } + private static byte int1(int x) { return (byte)(x >> 8); } + private static byte int0(int x) { return (byte)(x ); } + + private static byte short1(short x) { return (byte)(x >> 8); } + private static byte short0(short x) { return (byte)(x ); } + + byte _get(long i) { return bytes[(int)i]; } + void _put(long i, byte x) { bytes[(int)i] = x; } + + private void putLongX(long a, long x) { + if (byteOrder == BIG_ENDIAN) { + x = Long.reverseBytes(x); + } + _put(a + 7, long7(x)); + _put(a + 6, long6(x)); + _put(a + 5, long5(x)); + _put(a + 4, long4(x)); + _put(a + 3, long3(x)); + _put(a + 2, long2(x)); + _put(a + 1, long1(x)); + _put(a , long0(x)); + } + + private void putIntX(long a, int x) { + if (byteOrder == BIG_ENDIAN) { + x = Integer.reverseBytes(x); + } + _put(a + 3, int3(x)); + _put(a + 2, int2(x)); + _put(a + 1, int1(x)); + _put(a , int0(x)); + } + + private void putShortX(int bi, short x) { + if (byteOrder == BIG_ENDIAN) { + x = Short.reverseBytes(x); + } + _put(bi , short0(x)); + _put(bi + 1, short1(x)); + } + + static private int makeInt(byte b3, byte b2, byte b1, byte b0) { + return (((b3 ) << 24) | + ((b2 & 0xff) << 16) | + ((b1 & 0xff) << 8) | + ((b0 & 0xff) )); + } + int getIntX(long a) { + int x = makeInt(_get(a + 3), + _get(a + 2), + _get(a + 1), + _get(a)); + if (byteOrder == BIG_ENDIAN) { + x = Integer.reverseBytes(x); + } + return x; + } + + static private long makeLong(byte b7, byte b6, byte b5, byte b4, + byte b3, byte b2, byte b1, byte b0) + { + return ((((long)b7 ) << 56) | + (((long)b6 & 0xff) << 48) | + (((long)b5 & 0xff) << 40) | + (((long)b4 & 0xff) << 32) | + (((long)b3 & 0xff) << 24) | + (((long)b2 & 0xff) << 16) | + (((long)b1 & 0xff) << 8) | + (((long)b0 & 0xff) )); + } + + long getLongX(long a) { + long x = makeLong(_get(a + 7), + _get(a + 6), + _get(a + 5), + _get(a + 4), + _get(a + 3), + _get(a + 2), + _get(a + 1), + _get(a)); + if (byteOrder == BIG_ENDIAN) { + x = Long.reverseBytes(x); + } + return x; + } + + static private short makeShort(byte b1, byte b0) { + return (short)((b1 << 8) | (b0 & 0xff)); + } + + short getShortX(long a) { + short x = makeShort(_get(a + 1), + _get(a )); + if (byteOrder == BIG_ENDIAN) { + x = Short.reverseBytes(x); + } + return x; + } + + double getDoubleX(long a) { + long x = getLongX(a); + return Double.longBitsToDouble(x); + } + + double getFloatX(long a) { + int x = getIntX(a); + return Float.intBitsToFloat(x); + } + + void ck(long x, long y) { + if (x != y) { + throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y)); + } + } + + void ck(double x, double y) { + if (x == x && y == y && x != y) { + ck(x, y); + } + } + + long getLong(int i) { ck(buf.getLong(i), getLongX(i)); return buf.getLong(i); } + int getInt(int i) { ck(buf.getInt(i), getIntX(i)); return buf.getInt(i); } + short getShort(int i) { ck(buf.getShort(i), getShortX(i)); return buf.getShort(i); } + char getChar(int i) { ck(buf.getChar(i), (char)getShortX(i)); return buf.getChar(i); } + double getDouble(int i) { ck(buf.getDouble(i), getDoubleX(i)); return buf.getDouble(i); } + float getFloat(int i) { ck(buf.getFloat(i), getFloatX(i)); return buf.getFloat(i); } + + void putLong(int i, long x) { buf.putLong(i, x); putLongX(i, x); } + void putInt(int i, int x) { buf.putInt(i, x); putIntX(i, x); } + void putShort(int i, short x) { buf.putShort(i, x); putShortX(i, x); } + void putChar(int i, char x) { buf.putChar(i, x); putShortX(i, (short)x); } + void putDouble(int i, double x) { buf.putDouble(i, x); putLongX(i, Double.doubleToRawLongBits(x)); } + void putFloat(int i, float x) { buf.putFloat(i, x); putIntX(i, Float.floatToRawIntBits(x)); } + + long getLong() { ck(buf.getLong(buf.position()), getLongX(pos)); long x = buf.getLong(); pos += 8; return x; } + int getInt() { ck(buf.getInt(buf.position()), getIntX(pos)); int x = buf.getInt(); pos += 4; return x; } + short getShort() { ck(buf.getShort(buf.position()), getShortX(pos)); short x = buf.getShort(); pos += 2; return x; } + char getChar() { ck(buf.getChar(buf.position()), (char)getShortX(pos)); char x = buf.getChar(); pos += 2; return x; } + double getDouble() { ck(buf.getDouble(buf.position()), getDoubleX(pos)); double x = buf.getDouble(); pos += 8; return x; } + float getFloat() { ck(buf.getFloat(buf.position()), getFloatX(pos)); float x = buf.getFloat(); pos += 4; return x; } + + void putLong(long x) { putLongX(pos, x); pos += 8; buf.putLong(x); } + void putInt(int x) { putIntX(pos, x); pos += 4; buf.putInt(x); } + void putShort(short x) { putShortX(pos, x); pos += 2; buf.putShort(x); } + void putChar(char x) { putShortX(pos, (short)x); pos += 2; buf.putChar(x); } + void putDouble(double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; buf.putDouble(x); } + void putFloat(float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; buf.putFloat(x); } + + void rewind() { pos = 0; buf.rewind(); } +} + +public class HeapByteBufferTest implements Runnable { + + Random random = Utils.getRandomInstance(); + MyByteBuffer data = MyByteBuffer.wrap(new byte[1024]); + + int randomOffset(Random r, MyByteBuffer buf, int size) { + return r.nextInt(buf.capacity() - size); + } + + long iterations; + + HeapByteBufferTest(long iterations) { + this.iterations = iterations; + } + + // The core of the test. Walk over the buffer reading and writing + // random data, XORing it as we go. We can detect writes in the + // wrong place, writes which are too long or too short, and reads + // or writes of the wrong data, + void step(Random r) { + data.order((r.nextInt() & 1) != 0 ? BIG_ENDIAN : LITTLE_ENDIAN); + + data.rewind(); + while (data.position() < data.capacity()) + data.putLong(data.getLong() ^ random.nextLong()); + + data.rewind(); + while (data.position() < data.capacity()) + data.putInt(data.getInt() ^ random.nextInt()); + + data.rewind(); + while (data.position() < data.capacity()) + data.putShort((short)(data.getShort() ^ random.nextInt())); + + data.rewind(); + while (data.position() < data.capacity()) + data.putChar((char)(data.getChar() ^ random.nextInt())); + + data.rewind(); + while (data.position() < data.capacity()) { + data.putDouble(combine(data.getDouble(), random.nextLong())); + } + + data.rewind(); + while (data.position() < data.capacity()) + data.putFloat(combine(data.getFloat(), random.nextInt())); + + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 8); + data.putLong(offset, data.getLong(offset) ^ random.nextLong()); + } + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 4); + data.putInt(offset, data.getInt(offset) ^ random.nextInt()); + } + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 2); + data.putShort(offset, (short)(data.getShort(offset) ^ random.nextInt())); + } + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 2); + data.putChar(offset, (char)(data.getChar(offset) ^ random.nextInt())); + } + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 8); + data.putDouble(offset, combine(data.getDouble(offset), random.nextLong())); + } + for (int i = 0; i < 100; i++) { + int offset = randomOffset(r, data, 4); + data.putFloat(offset, combine(data.getFloat(offset), random.nextInt())); + } + } + + // XOR the bit pattern of a double and a long, returning the + // result as a double. + // + // We convert signalling NaNs to quiet NaNs. We need to do this + // because some platforms (in particular legacy 80x87) do not + // provide transparent conversions between integer and + // floating-point types even when using raw conversions but + // quietly convert sNaN to qNaN. This causes spurious test + // failures when the template interpreter uses 80x87 and the JITs + // use XMM registers. + // + public double combine(double prev, long bits) { + bits ^= Double.doubleToRawLongBits(prev); + double result = Double.longBitsToDouble(bits); + if (Double.isNaN(result)) { + result = Double.longBitsToDouble(bits | 0x8000000000000l); + } + return result; + } + + // XOR the bit pattern of a float and an int, returning the result + // as a float. Convert sNaNs to qNaNs. + public Float combine(float prev, int bits) { + bits ^= Float.floatToRawIntBits(prev); + Float result = Float.intBitsToFloat(bits); + if (Float.isNaN(result)) { + result = Float.intBitsToFloat(bits | 0x400000); + } + return result; + } + + public void run() { + for (int i = 0; i < data.capacity(); i += 8) { + data.putLong(i, random.nextLong()); + } + + for (int i = 0; i < iterations; i++) { + step(random); + } + + if (!Arrays.equals(data.array(), data.backingArray())) { + throw new RuntimeException(); + } + } + + public static void main(String[] args) { + // The number of iterations is high to ensure that tiered + // compilation kicks in all the way up to C2. + long iterations = 100000; + if (args.length > 0) + iterations = Long.parseLong(args[0]); + + new HeapByteBufferTest(iterations).run(); + } +} diff --git a/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java new file mode 100644 index 00000000000..8005a990d83 --- /dev/null +++ b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8057967 + * @ignore 8079205 + * @run main/bootclasspath -Xbatch java.lang.invoke.CallSiteDepContextTest + */ +package java.lang.invoke; + +import java.lang.ref.*; +import jdk.internal.org.objectweb.asm.*; +import sun.misc.Unsafe; + +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +public class CallSiteDepContextTest { + static final Unsafe UNSAFE = Unsafe.getUnsafe(); + static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP; + static final String CLASS_NAME = "java/lang/invoke/Test"; + static final String METHOD_NAME = "m"; + static final MethodType TYPE = MethodType.methodType(int.class); + + static MutableCallSite mcs; + static MethodHandle bsmMH; + + static { + try { + bsmMH = LOOKUP.findStatic( + CallSiteDepContextTest.class, "bootstrap", + MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class)); + } catch(Throwable e) { + throw new InternalError(e); + } + } + + public static CallSite bootstrap(MethodHandles.Lookup caller, + String invokedName, + MethodType invokedType) { + return mcs; + } + + static class T { + static int f1() { return 1; } + static int f2() { return 2; } + } + + static byte[] getClassFile(String suffix) { + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + MethodVisitor mv; + cw.visit(52, ACC_PUBLIC | ACC_SUPER, CLASS_NAME + suffix, null, "java/lang/Object", null); + { + mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, METHOD_NAME, TYPE.toMethodDescriptorString(), null, null); + mv.visitCode(); + Handle bsm = new Handle(H_INVOKESTATIC, + "java/lang/invoke/CallSiteDepContextTest", "bootstrap", + bsmMH.type().toMethodDescriptorString()); + mv.visitInvokeDynamicInsn("methodName", TYPE.toMethodDescriptorString(), bsm); + mv.visitInsn(IRETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + cw.visitEnd(); + return cw.toByteArray(); + } + + private static void execute(int expected, MethodHandle... mhs) throws Throwable { + for (int i = 0; i < 20_000; i++) { + for (MethodHandle mh : mhs) { + int r = (int) mh.invokeExact(); + if (r != expected) { + throw new Error(r + " != " + expected); + } + } + } + } + + public static void testSharedCallSite() throws Throwable { + Class cls1 = UNSAFE.defineAnonymousClass(Object.class, getClassFile("CS_1"), null); + Class cls2 = UNSAFE.defineAnonymousClass(Object.class, getClassFile("CS_2"), null); + + MethodHandle[] mhs = new MethodHandle[] { + LOOKUP.findStatic(cls1, METHOD_NAME, TYPE), + LOOKUP.findStatic(cls2, METHOD_NAME, TYPE) + }; + + mcs = new MutableCallSite(LOOKUP.findStatic(T.class, "f1", TYPE)); + execute(1, mhs); + mcs.setTarget(LOOKUP.findStatic(T.class, "f2", TYPE)); + execute(2, mhs); + } + + public static void testNonBoundCallSite() throws Throwable { + mcs = new MutableCallSite(LOOKUP.findStatic(T.class, "f1", TYPE)); + + // mcs.context == null + MethodHandle mh = mcs.dynamicInvoker(); + execute(1, mh); + + // mcs.context == cls1 + Class cls1 = UNSAFE.defineAnonymousClass(Object.class, getClassFile("NonBound_1"), null); + MethodHandle mh1 = LOOKUP.findStatic(cls1, METHOD_NAME, TYPE); + + execute(1, mh1); + + mcs.setTarget(LOOKUP.findStatic(T.class, "f2", TYPE)); + + execute(2, mh, mh1); + } + + static ReferenceQueue rq = new ReferenceQueue(); + static PhantomReference ref; + + public static void testGC() throws Throwable { + mcs = new MutableCallSite(LOOKUP.findStatic(T.class, "f1", TYPE)); + + Class[] cls = new Class[] { + UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_1"), null), + UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_2"), null), + }; + + MethodHandle[] mhs = new MethodHandle[] { + LOOKUP.findStatic(cls[0], METHOD_NAME, TYPE), + LOOKUP.findStatic(cls[1], METHOD_NAME, TYPE), + }; + + // mcs.context == cls[0] + int r = (int) mhs[0].invokeExact(); + + execute(1, mhs); + + ref = new PhantomReference<>(cls[0], rq); + cls[0] = UNSAFE.defineAnonymousClass(Object.class, getClassFile("GC_3"), null); + mhs[0] = LOOKUP.findStatic(cls[0], METHOD_NAME, TYPE); + + do { + System.gc(); + try { + Reference ref1 = rq.remove(1000); + if (ref1 == ref) { + ref1.clear(); + System.gc(); // Ensure that the stale context is cleared + break; + } + } catch(InterruptedException e) { /* ignore */ } + } while (true); + + execute(1, mhs); + mcs.setTarget(LOOKUP.findStatic(T.class, "f2", TYPE)); + execute(2, mhs); + } + + public static void main(String[] args) throws Throwable { + testSharedCallSite(); + testNonBoundCallSite(); + testGC(); + System.out.println("TEST PASSED"); + } +} diff --git a/hotspot/test/compiler/jsr292/MHInlineTest.java b/hotspot/test/compiler/jsr292/MHInlineTest.java new file mode 100644 index 00000000000..a167671b283 --- /dev/null +++ b/hotspot/test/compiler/jsr292/MHInlineTest.java @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8062280 + * @summary C2: inlining failure due to access checks being too strict + * @library /testlibrary + * @run main/othervm MHInlineTest + */ +import java.lang.invoke.*; +import com.oracle.java.testlibrary.*; +import static com.oracle.java.testlibrary.Asserts.*; + +public class MHInlineTest { + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", + "-server", "-XX:-TieredCompilation", "-Xbatch", + "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", + "-XX:CompileCommand=dontinline,MHInlineTest::test*", + "MHInlineTest$Launcher"); + + OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); + + analyzer.shouldHaveExitValue(0); + + // The test is applicable only to C2 (present in Server VM). + if (analyzer.getStderr().contains("Server VM")) { + analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$B::protected_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$B::package_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$B::private_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$B::private_static_x (3 bytes) inline (hot)"); + analyzer.shouldContain("MHInlineTest$A::package_static_x (3 bytes) inline (hot)"); + } + } + + static class A { + public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); + + public Class public_x() { return A.class; } + protected Class protected_x() { return A.class; } + Class package_x() { return A.class; } + final Class package_final_x() { return A.class; } + + static Class package_static_x() { return A.class; } + } + + static class B extends A { + public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); + + @Override public Class public_x() { return B.class; } + @Override protected Class protected_x() { return B.class; } + @Override Class package_x() { return B.class; } + + private Class private_x() { return B.class; } + static Class private_static_x() { return B.class; } + } + + static final MethodHandle A_PUBLIC_X; + static final MethodHandle A_PROTECTED_X; + static final MethodHandle A_PACKAGE_X; + static final MethodHandle A_PACKAGE_STATIC_X; + static final MethodHandle A_PACKAGE_FINAL_X; + + static final MethodHandle B_PRIVATE_X; + static final MethodHandle B_PRIVATE_STATIC_X; + + static { + try { + MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); + + A_PUBLIC_X = LOOKUP.findVirtual( + A.class, "public_x", MethodType.methodType(Class.class)); + A_PROTECTED_X = LOOKUP.findVirtual( + A.class, "protected_x", MethodType.methodType(Class.class)); + A_PACKAGE_X = LOOKUP.findVirtual( + A.class, "package_x", MethodType.methodType(Class.class)); + A_PACKAGE_FINAL_X = LOOKUP.findVirtual( + A.class, "package_final_x", MethodType.methodType(Class.class)); + A_PACKAGE_STATIC_X = LOOKUP.findStatic( + A.class, "package_static_x", MethodType.methodType(Class.class)); + + B_PRIVATE_X = B.LOOKUP.findVirtual( + B.class, "private_x", MethodType.methodType(Class.class)); + B_PRIVATE_STATIC_X = B.LOOKUP.findStatic( + B.class, "private_static_x", MethodType.methodType(Class.class)); + } catch (Exception e) { + throw new Error(e); + } + } + + static final A a = new B(); + + private static void testPublicMH() { + try { + Class r = (Class)A_PUBLIC_X.invokeExact(a); + assertEquals(r, B.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testProtectedMH() { + try { + Class r = (Class)A_PROTECTED_X.invokeExact(a); + assertEquals(r, B.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testPackageMH() { + try { + Class r = (Class)A_PACKAGE_X.invokeExact(a); + assertEquals(r, B.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testPackageFinalMH() { + try { + Class r = (Class)A_PACKAGE_FINAL_X.invokeExact(a); + assertEquals(r, A.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testPackageStaticMH() { + try { + Class r = (Class)A_PACKAGE_STATIC_X.invokeExact(); + assertEquals(r, A.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testPrivateMH() { + try { + Class r = (Class)B_PRIVATE_X.invokeExact((B)a); + assertEquals(r, B.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + private static void testPrivateStaticMH() { + try { + Class r = (Class)B_PRIVATE_STATIC_X.invokeExact(); + assertEquals(r, B.class); + } catch (Throwable throwable) { + throw new Error(throwable); + } + } + + static class Launcher { + public static void main(String[] args) throws Exception { + for (int i = 0; i < 20_000; i++) { + testPublicMH(); + } + for (int i = 0; i < 20_000; i++) { + testProtectedMH(); + } + for (int i = 0; i < 20_000; i++) { + testPackageMH(); + } + for (int i = 0; i < 20_000; i++) { + testPackageFinalMH(); + } + for (int i = 0; i < 20_000; i++) { + testPackageStaticMH(); + } + for (int i = 0; i < 20_000; i++) { + testPrivateMH(); + } + for (int i = 0; i < 20_000; i++) { + testPrivateStaticMH(); + } + } + } +} diff --git a/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java b/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java index deee0ecdeef..cf20e8f472b 100644 --- a/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java +++ b/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java @@ -30,7 +30,7 @@ * java.instrument * java.management * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java - * @run main RedefineMethodUsedByMultipleMethodHandles + * @run main/othervm RedefineMethodUsedByMultipleMethodHandles */ import java.io.*; diff --git a/hotspot/test/compiler/loopopts/TestPredicateLostDependency.java b/hotspot/test/compiler/loopopts/TestPredicateLostDependency.java new file mode 100644 index 00000000000..a9986c24155 --- /dev/null +++ b/hotspot/test/compiler/loopopts/TestPredicateLostDependency.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8069191 + * @summary predicate moved out of loops and CastPP removal causes dependency to be lost + * @run main/othervm -Xcomp -XX:CompileOnly=TestPredicateLostDependency.m1 -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestPredicateLostDependency + * + */ + +public class TestPredicateLostDependency { + static class A { + int i; + } + + static class B extends A { + } + + static boolean crash = false; + + static boolean m2() { + return crash; + } + + static int m3(float[] arr) { + return 0; + } + + static float m1(A aa) { + float res = 0; + float[] arr = new float[10]; + for (int i = 0; i < 10; i++) { + if (m2()) { + arr = null; + } + m3(arr); + int j = arr.length; + int k = 0; + for (k = 9; k < j; k++) { + } + if (k == 10) { + if (aa instanceof B) { + } + } + res += arr[0]; + res += arr[1]; + } + return res; + } + + static public void main(String args[]) { + A a = new A(); + B b = new B(); + for (int i = 0; i < 20000; i++) { + m1(a); + } + crash = true; + try { + m1(a); + } catch (NullPointerException npe) {} + } +} diff --git a/hotspot/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java b/hotspot/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java new file mode 100644 index 00000000000..78cda884119 --- /dev/null +++ b/hotspot/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8078426 + * @summary split if finds predicates on several incoming paths when unswitched's loops are optimized out + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-UseCompressedOops TestSplitIfUnswitchedLoopsEliminated + * + */ + + +public class TestSplitIfUnswitchedLoopsEliminated { + + static class A { + int f; + } + + static A aa = new A(); + static A aaa = new A(); + + static int test_helper(int stop, boolean unswitch) { + A a = null; + for (int i = 3; i < 10; i++) { + if (unswitch) { + a = null; + } else { + a = aa; + int v = a.f; + } + } + if (stop != 4) { + a = aaa; + } + if (a != null) { + return a.f; + } + return 0; + } + + static int test(boolean unswitch) { + int stop = 1; + for (; stop < 3; stop *= 4) { + } + return test_helper(stop, unswitch); + } + + public static void main(String[] args) { + for (int i = 0; i < 20000; i++) { + test_helper(10, i%2 == 0); + test(i%2 == 0); + } + } +} diff --git a/hotspot/test/compiler/loopopts/superword/ProdRed_Double.java b/hotspot/test/compiler/loopopts/superword/ProdRed_Double.java new file mode 100644 index 00000000000..538c963f22b --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/ProdRed_Double.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double + */ + +public class ProdRed_Double +{ + public static void main(String[] args) throws Exception { + double[] a = new double[256*1024]; + double[] b = new double[256*1024]; + prodReductionInit(a,b); + double valid = 2000; + double total = 0; + for(int j = 0; j < 2000; j++) { + total = j + 1; + total = prodReductionImplement(a,b, total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void prodReductionInit(double[] a, double[] b) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i + 2; + b[i] = i + 1; + } + } + + public static double prodReductionImplement(double[] a, double[] b, double total) + { + for(int i = 0; i < a.length; i++) + { + total *= a[i] - b[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/loopopts/superword/ProdRed_Float.java b/hotspot/test/compiler/loopopts/superword/ProdRed_Float.java new file mode 100644 index 00000000000..526e21ae472 --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/ProdRed_Float.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float + */ + +public class ProdRed_Float +{ + public static void main(String[] args) throws Exception { + float[] a = new float[256*1024]; + float[] b = new float[256*1024]; + prodReductionInit(a,b); + float valid = 2000; + float total = 0; + for(int j = 0; j < 2000; j++) { + total = j + 1; + total = prodReductionImplement(a,b, total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void prodReductionInit(float[] a, float[] b) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i + 2; + b[i] = i + 1; + } + } + + public static float prodReductionImplement(float[] a, float[] b, float total) + { + for(int i = 0; i < a.length; i++) + { + total *= a[i] - b[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/loopopts/superword/ProdRed_Int.java b/hotspot/test/compiler/loopopts/superword/ProdRed_Int.java new file mode 100644 index 00000000000..155e54a4331 --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/ProdRed_Int.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar product reduction optimizations : int test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int + */ + +public class ProdRed_Int +{ + public static void main(String[] args) throws Exception { + int[] a = new int[256*1024]; + int[] b = new int[256*1024]; + prodReductionInit(a,b); + int valid = 419430401; + int total = 1; + for(int j = 0; j < 2000; j++) { + total = prodReductionImplement(a,b,total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void prodReductionInit(int[] a, int[] b) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i + 2; + b[i] = i + 1; + } + } + + public static int prodReductionImplement(int[] a, int[] b, int total) + { + for(int i = 0; i < a.length; i++) + { + total *= a[i] + b[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/loopopts/superword/SumRed_Double.java b/hotspot/test/compiler/loopopts/superword/SumRed_Double.java new file mode 100644 index 00000000000..371635d20d1 --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/SumRed_Double.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double + */ + +public class SumRed_Double +{ + public static void main(String[] args) throws Exception { + double[] a = new double[256*1024]; + double[] b = new double[256*1024]; + double[] c = new double[256*1024]; + double[] d = new double[256*1024]; + sumReductionInit(a,b,c); + double total = 0; + double valid = 3.6028590866691944E19; + for(int j = 0; j < 2000; j++) { + total = sumReductionImplement(a,b,c,d,total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void sumReductionInit( + double[] a, + double[] b, + double[] c) + { + for(int j = 0; j < 1; j++) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } + } + + public static double sumReductionImplement( + double[] a, + double[] b, + double[] c, + double[] d, + double total) + { + for(int i = 0; i < a.length; i++) + { + d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/loopopts/superword/SumRed_Float.java b/hotspot/test/compiler/loopopts/superword/SumRed_Float.java new file mode 100644 index 00000000000..ef632011424 --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/SumRed_Float.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : float test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float + */ + +public class SumRed_Float +{ + public static void main(String[] args) throws Exception { + float[] a = new float[256*1024]; + float[] b = new float[256*1024]; + float[] c = new float[256*1024]; + float[] d = new float[256*1024]; + sumReductionInit(a,b,c); + float total = 0; + float valid = (float)4.611686E18; + for(int j = 0; j < 2000; j++) { + total = sumReductionImplement(a,b,c,d,total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void sumReductionInit( + float[] a, + float[] b, + float[] c) + { + for(int j = 0; j < 1; j++) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } + } + + public static float sumReductionImplement( + float[] a, + float[] b, + float[] c, + float[] d, + float total) + { + for(int i = 0; i < a.length; i++) + { + d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/loopopts/superword/SumRed_Int.java b/hotspot/test/compiler/loopopts/superword/SumRed_Int.java new file mode 100644 index 00000000000..33c5702bd45 --- /dev/null +++ b/hotspot/test/compiler/loopopts/superword/SumRed_Int.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8074981 + * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : int test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int + */ + +public class SumRed_Int +{ + public static void main(String[] args) throws Exception { + int[] a = new int[256*1024]; + int[] b = new int[256*1024]; + int[] c = new int[256*1024]; + int[] d = new int[256*1024]; + sumReductionInit(a,b,c); + int total = 0; + int valid = 262144000; + for(int j = 0; j < 2000; j++) { + total = sumReductionImplement(a,b,c,d,total); + } + if(total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } + } + + public static void sumReductionInit( + int[] a, + int[] b, + int[] c) + { + for(int j = 0; j < 1; j++) + { + for(int i = 0; i < a.length; i++) + { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } + } + + public static int sumReductionImplement( + int[] a, + int[] b, + int[] c, + int[] d, + int total) + { + for(int i = 0; i < a.length; i++) + { + d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; + } + +} diff --git a/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java new file mode 100644 index 00000000000..c8d007a9703 --- /dev/null +++ b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8073480 + * @summary explicit range checks should be recognized by C2 + * @library /testlibrary /../../test/lib /compiler/whitebox + * @build TestExplicitRangeChecks + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform + * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=compileonly,TestExplicitRangeChecks.test* TestExplicitRangeChecks + * + */ + +import java.lang.annotation.*; +import java.lang.reflect.*; +import java.util.*; +import sun.hotspot.WhiteBox; +import sun.hotspot.code.NMethod; +import com.oracle.java.testlibrary.Platform; +import sun.misc.Unsafe; + +public class TestExplicitRangeChecks { + + static int[] array = new int[10]; + + @Retention(RetentionPolicy.RUNTIME) + @interface Args { + int[] compile(); + int[] good(); + int[] bad(); + boolean deoptimize() default true; + } + + // Should be compiled as a single unsigned comparison + // 0 <= index < array.length + @Args(compile = {5,}, good = {0, 9}, bad = {-1, 10}) + static boolean test1_1(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + return true; + } + + // same test but so we can compile with same optimization after trap in test1_1 + static boolean test1_2(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + return true; + } + + // Shouldn't matter whether first or second test is the one + // against a constants + // 0 <= index < array.length + @Args(compile = {5,}, good = {0, 9}, bad = {-1, 10}) + static boolean test2_1(int index, int[] array) { + if (index >= array.length || index < 0) { + return false; + } + return true; + } + + static boolean test2_2(int index, int[] array) { + if (index >= array.length || index < 0) { + return false; + } + return true; + } + + // 0 <= index <= array.length + @Args(compile = {5,}, good = {0, 10}, bad = {-1, 11}) + static boolean test3_1(int index, int[] array) { + if (index < 0 || index > array.length) { + return false; + } + return true; + } + + static boolean test3_2(int index, int[] array) { + if (index < 0 || index > array.length) { + return false; + } + return true; + } + + // 0 <= index <= array.length + @Args(compile = {5,}, good = {0, 10}, bad = {-1, 11}) + static boolean test4_1(int index, int[] array) { + if (index > array.length || index < 0 ) { + return false; + } + return true; + } + + static boolean test4_2(int index, int[] array) { + if (index > array.length || index < 0) { + return false; + } + return true; + } + + static int[] test5_helper(int i) { + return (i < 100) ? new int[10] : new int[5]; + } + + // 0 < index < array.length + @Args(compile = {5,}, good = {1, 9}, bad = {0, 10}) + static boolean test5_1(int index, int[] array) { + array = test5_helper(index); // array.length must be not constant greater than 1 + if (index <= 0 || index >= array.length) { + return false; + } + return true; + } + + static boolean test5_2(int index, int[] array) { + array = test5_helper(index); // array.length must be not constant greater than 1 + if (index <= 0 || index >= array.length) { + return false; + } + return true; + } + + // 0 < index < array.length + @Args(compile = {5,}, good = {1, 9}, bad = {0, 10}) + static boolean test6_1(int index, int[] array) { + array = test5_helper(index); // array.length must be not constant greater than 1 + if (index >= array.length || index <= 0 ) { + return false; + } + return true; + } + + static boolean test6_2(int index, int[] array) { + array = test5_helper(index); // array.length must be not constant greater than 1 + if (index >= array.length || index <= 0) { + return false; + } + return true; + } + + // 0 < index <= array.length + @Args(compile = {5,}, good = {1, 10}, bad = {0, 11}) + static boolean test7_1(int index, int[] array) { + if (index <= 0 || index > array.length) { + return false; + } + return true; + } + + static boolean test7_2(int index, int[] array) { + if (index <= 0 || index > array.length) { + return false; + } + return true; + } + + // 0 < index <= array.length + @Args(compile = {5,}, good = {1, 10}, bad = {0, 11}) + static boolean test8_1(int index, int[] array) { + if (index > array.length || index <= 0 ) { + return false; + } + return true; + } + + static boolean test8_2(int index, int[] array) { + if (index > array.length || index <= 0) { + return false; + } + return true; + } + + static int[] test9_helper1(int i) { + return (i < 100) ? new int[1] : new int[2]; + } + + static int[] test9_helper2(int i) { + return (i < 100) ? new int[10] : new int[11]; + } + + // array1.length <= index < array2.length + @Args(compile = {5,}, good = {1, 9}, bad = {0, 10}) + static boolean test9_1(int index, int[] array) { + int[] array1 = test9_helper1(index); + int[] array2 = test9_helper2(index); + if (index < array1.length || index >= array2.length) { + return false; + } + return true; + } + + static boolean test9_2(int index, int[] array) { + int[] array1 = test9_helper1(index); + int[] array2 = test9_helper2(index); + if (index < array1.length || index >= array2.length) { + return false; + } + return true; + } + + // Previously supported pattern + @Args(compile = {-5,5,15}, good = {0, 9}, bad = {-1, 10}, deoptimize=false) + static boolean test10_1(int index, int[] array) { + if (index < 0 || index >= 10) { + return false; + } + return true; + } + + static int[] array11 = new int[10]; + @Args(compile = {5,}, good = {0, 9}, bad = {-1,}) + static boolean test11_1(int index, int[] array) { + if (index < 0) { + return false; + } + int unused = array11[index]; + // If this one is folded with the first test then we allow + // array access above to proceed even for out of bound array + // index and the method throws an + // ArrayIndexOutOfBoundsException. + if (index >= array.length) { + return false; + } + return true; + } + + static int[] array12 = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; + @Args(compile = {5,}, good = {0, 9}, bad = {-1,}) + static boolean test12_1(int index, int[] array) { + // Cannot be folded otherwise would cause incorrect array + // access if the array12 range check is executed before the + // folded test. + if (index < 0 || index >= array12[index]) { + return false; + } + return true; + } + + // Same as test1_1 but pass null array when index < 0: shouldn't + // cause NPE. + @Args(compile = {5,}, good = {0, 9}, bad = {}) + static boolean test13_1(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + return true; + } + + // Same as test10 but with uncommon traps + @Args(compile = {5}, good = {0, 9}, bad = {-1, 10}) + static boolean test14_1(int index, int[] array) { + if (index < 0 || index >= 10) { + return false; + } + return true; + } + + static boolean test14_2(int index, int[] array) { + if (index < 0 || index >= 10) { + return false; + } + return true; + } + + // Same as test13_1 but pass null array: null trap should be reported on first if + @Args(compile = {5,}, good = {0, 9}, bad = {}) + static boolean test15_1(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + return true; + } + + // Same as test1 but with no null check between the integer comparisons + @Args(compile = {5,}, good = {0, 9}, bad = {-1, 10}) + static boolean test16_1(int index, int[] array) { + int l = array.length; + if (index < 0 || index >= l) { + return false; + } + return true; + } + + static boolean test16_2(int index, int[] array) { + int l = array.length; + if (index < 0 || index >= l) { + return false; + } + return true; + } + + // Same as test1 but bound check on array access should optimize + // out. + @Args(compile = {5,}, good = {0, 9}, bad = {-1, 10}) + static boolean test17_1(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + array[index] = 0; + return true; + } + + static boolean test17_2(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + array[index] = 0; + return true; + } + + // Same as test1 but range check smearing should optimize + // 3rd range check out. + @Args(compile = {5,}, good = {}, bad = {}) + static boolean test18_1(int index, int[] array) { + if (index < 0 || index >= array.length) { + return false; + } + array[index+2] = 0; + array[index+1] = 0; + return true; + } + + static boolean test19_helper1(int index) { + if (index < 12) { + return false; + } + return true; + } + + static boolean test19_helper2(int index) { + if (index > 8) { + return false; + } + return true; + } + + // Second test should be optimized out + static boolean test19(int index, int[] array) { + test19_helper1(index); + test19_helper2(index); + return true; + } + + static boolean success = true; + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + final HashMap tests = new HashMap<>(); + { + for (Method m : this.getClass().getDeclaredMethods()) { + if (m.getName().matches("test[0-9]+(_[0-9])?")) { + assert(Modifier.isStatic(m.getModifiers())) : m; + tests.put(m.getName(), m); + } + } + } + + void doTest(String name) throws Exception { + Method m = tests.get(name + "_1"); + + Args anno = m.getAnnotation(Args.class); + int[] compile = anno.compile(); + int[] good = anno.good(); + int[] bad = anno.bad(); + boolean deoptimize = anno.deoptimize(); + + // Get compiled + for (int i = 0; i < 20000;) { + for (int j = 0; j < compile.length; j++) { + m.invoke(null, compile[j], array); + i++; + } + } + + if (!WHITE_BOX.isMethodCompiled(m)) { + System.out.println(name + "_1 not compiled"); + success = false; + } + + // check that good values don't trigger exception or + // deoptimization + for (int i = 0; i < good.length; i++) { + boolean res = (boolean)m.invoke(null, good[i], array); + + if (!res) { + System.out.println(name + " bad result for good input " + good[i]); + success = false; + } + if (!WHITE_BOX.isMethodCompiled(m)) { + System.out.println(name + " deoptimized on valid access"); + success = false; + } + } + + // check that bad values trigger exception and deoptimization + for (int i = 0; i < bad.length; i++) { + if (i > 0 && deoptimize) { + m = tests.get(name + "_" + (i+1)); + for (int k = 0; k < 20000;) { + for (int j = 0; j < compile.length; j++) { + m.invoke(null, compile[j], array); + k++; + } + } + if (!WHITE_BOX.isMethodCompiled(m)) { + System.out.println(name + ("_" + (i+1)) + " not compiled"); + success = false; + } + } + + boolean res = (boolean)m.invoke(null, bad[i], array); + + if (res) { + System.out.println(name + " bad result for bad input " + bad[i]); + success = false; + } + if (Platform.isServer()) { + if (deoptimize && WHITE_BOX.isMethodCompiled(m)) { + System.out.println(name + " not deoptimized on invalid access"); + success = false; + } else if (!deoptimize && !WHITE_BOX.isMethodCompiled(m)) { + System.out.println(name + " deoptimized on invalid access"); + success = false; + } + } + } + + } + + private static final Unsafe UNSAFE; + + static { + try { + Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); + unsafeField.setAccessible(true); + UNSAFE = (Unsafe) unsafeField.get(null); + } + catch (Exception e) { + throw new AssertionError(e); + } + } + + // On x64, int to long conversion should optimize away in address computation + static int test20(int[] a) { + int sum = 0; + for (int i = 0; i < a.length; i++) { + sum += test20_helper(a, i); + } + return sum; + } + + static int test20_helper(int[] a, int i) { + if (i < 0 || i >= a.length) + throw new ArrayIndexOutOfBoundsException(); + + long address = (((long) i) << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET; + return UNSAFE.getInt(a, address); + } + + static int test21(int[] a) { + int sum = 0; + for (int i = 0; i < a.length; i++) { + sum += test20_helper(a, i); + } + return sum; + } + + static int test21_helper(int[] a, int i) { + if (i < 0 || i >= a.length) + throw new ArrayIndexOutOfBoundsException(); + + long address = (((long) i) << 2) + UNSAFE.ARRAY_INT_BASE_OFFSET; + return UNSAFE.getIntVolatile(a, address); + } + + static public void main(String[] args) throws Exception { + + if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) { + throw new AssertionError("Background compilation enabled"); + } + + TestExplicitRangeChecks test = new TestExplicitRangeChecks(); + + test.doTest("test1"); + test.doTest("test2"); + test.doTest("test3"); + test.doTest("test4"); + + // pollute branch profile + for (int i = 0; i < 10000; i++) { + test5_helper((i%2 == 0) ? 0 : 1000); + } + + test.doTest("test5"); + test.doTest("test6"); + test.doTest("test7"); + test.doTest("test8"); + + // pollute branch profile + for (int i = 0; i < 10000; i++) { + test9_helper1((i%2 == 0) ? 0 : 1000); + test9_helper2((i%2 == 0) ? 0 : 1000); + } + + test.doTest("test9"); + test.doTest("test10"); + test.doTest("test11"); + test.doTest("test12"); + + test.doTest("test13"); + { + Method m = test.tests.get("test13_1"); + for (int i = 0; i < 1; i++) { + test13_1(-1, null); + if (!WHITE_BOX.isMethodCompiled(m)) { + break; + } + } + } + test.doTest("test13"); + { + Method m = test.tests.get("test13_1"); + for (int i = 0; i < 10; i++) { + test13_1(-1, null); + if (!WHITE_BOX.isMethodCompiled(m)) { + break; + } + } + } + + test.doTest("test14"); + + test.doTest("test15"); + { + Method m = test.tests.get("test15_1"); + for (int i = 0; i < 10; i++) { + try { + test15_1(5, null); + } catch(NullPointerException npe) {} + if (!WHITE_BOX.isMethodCompiled(m)) { + break; + } + } + } + test.doTest("test15"); + test.doTest("test16"); + test.doTest("test17"); + test.doTest("test18"); + + for (int i = 0; i < 20000; i++) { + test19_helper1(20); + test19_helper2(5); + } + + { + Method m = test.tests.get("test19"); + WHITE_BOX.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + } + + for (int i = 0; i < 20000; i++) { + test20(array); + } + + for (int i = 0; i < 20000; i++) { + test21(array); + } + + if (!success) { + throw new RuntimeException("some tests failed"); + } + } +} diff --git a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java index f13d8830774..f5cb3d5286c 100644 --- a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java +++ b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java @@ -40,20 +40,10 @@ public class NumCompilerThreadsCheck { String expectedOutput = "CICompilerCount of -1 is invalid"; out.shouldContain(expectedOutput); - if (isZeroVm()) { + if (Platform.isZero()) { String expectedLowWaterMarkText = "must be at least 0"; out.shouldContain(expectedLowWaterMarkText); } } - private static boolean isZeroVm() { - String vmName = System.getProperty("java.vm.name"); - if (vmName == null) { - throw new RuntimeException("No VM name"); - } - if (vmName.toLowerCase().contains("zero")) { - return true; - } - return false; - } } diff --git a/hotspot/test/compiler/types/TestMeetExactConstantArrays.java b/hotspot/test/compiler/types/TestMeetExactConstantArrays.java new file mode 100644 index 00000000000..951288ec21e --- /dev/null +++ b/hotspot/test/compiler/types/TestMeetExactConstantArrays.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8075587 + * @summary meet of 2 constant arrays result in bottom + * @run main/othervm TestMeetExactConstantArrays + * + */ + +public class TestMeetExactConstantArrays { + public abstract static class NumbersHolder { + public Number[] getNumbers() { + return null; + } + } + + public static class IntegersHolder extends NumbersHolder { + private final static Integer integers[] = { new Integer(1) }; + + public Number[] getNumbers() { + return integers; + } + } + + public static class LongsHolder extends NumbersHolder { + private final static Long longs[] = { new Long(1) }; + + public Number[] getNumbers() { + return longs; + } + } + + public static final void loopNumbers(NumbersHolder numbersHolder) { + Number[] numbers = numbersHolder.getNumbers(); + for (int i = 0; i < numbers.length; i++) { + numbers[i].longValue(); + } + } + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 10000; i++) { + IntegersHolder integersHolder = new IntegersHolder(); + LongsHolder longsHolder = new LongsHolder(); + loopNumbers(integersHolder); + loopNumbers(longsHolder); + } + } +} diff --git a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java index fe78d4c814c..ad899d8e5ce 100644 --- a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java +++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java @@ -69,7 +69,7 @@ import uncommontrap.Verifier; * -XX:CompileCommand=compileonly,UnstableIfExecutable.test * -XX:LogFile=never_taken_fired.xml * TestUnstableIfTrap NEVER_TAKEN true - * @run main uncommontrap.Verifier always_taken_not_fired.xml + * @run main/othervm uncommontrap.Verifier always_taken_not_fired.xml * always_taken_fired.xml * never_taken_not_fired.xml * never_taken_fired.xml diff --git a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java index 99cec702a54..043698d0639 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java @@ -32,12 +32,12 @@ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xmixed * -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method - * -XX:+IgnoreUnexpectedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot + * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot * DeoptimizeFramesTest true * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xmixed * -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method - * -XX:+IgnoreUnexpectedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot + * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot * DeoptimizeFramesTest false * @summary testing of WB::deoptimizeFrames() */ diff --git a/hotspot/test/gc/TestSmallHeap.java b/hotspot/test/gc/TestSmallHeap.java index 32eee646078..817a01fcf2a 100644 --- a/hotspot/test/gc/TestSmallHeap.java +++ b/hotspot/test/gc/TestSmallHeap.java @@ -58,9 +58,11 @@ */ import com.oracle.java.testlibrary.*; +import com.sun.management.HotSpotDiagnosticMXBean; +import java.lang.management.ManagementFactory; import static com.oracle.java.testlibrary.Asserts.*; + import sun.hotspot.WhiteBox; -import sun.management.ManagementFactoryHelper; public class TestSmallHeap { @@ -69,7 +71,9 @@ public class TestSmallHeap { int pageSize = wb.getVMPageSize(); int heapBytesPerCard = 512; long expectedMaxHeap = pageSize * heapBytesPerCard; - String maxHeap = ManagementFactoryHelper.getDiagnosticMXBean().getVMOption("MaxHeapSize").getValue(); + String maxHeap + = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption("MaxHeapSize").getValue(); assertEQ(Long.parseLong(maxHeap), expectedMaxHeap); } } diff --git a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java index c15a798cda4..55177bcabf6 100644 --- a/hotspot/test/gc/arguments/TestG1HeapRegionSize.java +++ b/hotspot/test/gc/arguments/TestG1HeapRegionSize.java @@ -33,14 +33,15 @@ * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m TestG1HeapRegionSize 33554432 */ -import sun.management.ManagementFactoryHelper; import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; +import java.lang.management.ManagementFactory; public class TestG1HeapRegionSize { public static void main(String[] args) { - HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + HotSpotDiagnosticMXBean diagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); String expectedValue = getExpectedValue(args); VMOption option = diagnostic.getVMOption("UseG1GC"); diff --git a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java index 65f1f3a8d6a..19c5afcc436 100644 --- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java +++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java @@ -70,6 +70,7 @@ public class TestInitialTenuringThreshold { runWithThresholds(10, 0, true); runWithThresholds(9, 8, true); runWithThresholds(-1, 8, true); + runWithThresholds(0, -1, true); runWithThresholds(8, -1, true); runWithThresholds(16, 8, true); runWithThresholds(8, 17, true); diff --git a/hotspot/test/gc/arguments/TestSelectDefaultGC.java b/hotspot/test/gc/arguments/TestSelectDefaultGC.java new file mode 100644 index 00000000000..709511838aa --- /dev/null +++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 TestSelectDefaultGC + * @summary Test selection of GC when no GC option is specified + * @bug 8068582 + * @key gc + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + * @run driver TestSelectDefaultGC + */ + +import com.oracle.java.testlibrary.*; +import java.util.regex.*; + +public class TestSelectDefaultGC { + public static boolean versionStringContains(OutputAnalyzer output, String pattern) { + Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStderr()); + return matcher.find(); + } + + public static void assertVMOption(OutputAnalyzer output, String option, boolean value) { + output.shouldMatch(" " + option + " .*=.* " + value + " "); + } + + public static void main(String[] args) throws Exception { + // Start VM without specifying GC + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintFlagsFinal", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + + boolean isServerVM = versionStringContains(output, "Server VM"); + + // Verify GC selection + assertVMOption(output, "UseParallelGC", isServerVM); + assertVMOption(output, "UseParallelOldGC", isServerVM); + assertVMOption(output, "UseSerialGC", !isServerVM); + assertVMOption(output, "UseConcMarkSweepGC", false); + assertVMOption(output, "UseG1GC", false); + assertVMOption(output, "UseParNewGC", false); + } +} diff --git a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java index 54c70672d04..71657645dab 100644 --- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java +++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 2015,Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,6 @@ * questions. */ -import sun.management.ManagementFactoryHelper; import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; @@ -31,6 +30,7 @@ import java.util.ArrayList; import java.util.Arrays; import com.oracle.java.testlibrary.*; +import java.lang.management.ManagementFactory; import sun.hotspot.WhiteBox; class DetermineMaxHeapForCompressedOops { @@ -43,7 +43,8 @@ class DetermineMaxHeapForCompressedOops { class TestUseCompressedOopsErgoTools { private static long getCompressedClassSpaceSize() { - HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + HotSpotDiagnosticMXBean diagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); VMOption option = diagnostic.getVMOption("CompressedClassSpaceSize"); return Long.parseLong(option.getValue()); @@ -174,4 +175,3 @@ class TestUseCompressedOopsErgoTools { return expect(flags, false, false, 0); } } - diff --git a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java new file mode 100644 index 00000000000..98e8c508b66 --- /dev/null +++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* 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 TestVerifyBeforeAndAfterGCFlags + * @key gc + * @bug 8000831 + * @summary Runs an simple application (GarbageProducer) with various + combinations of -XX:{+|-}Verify{After|Before}GC flags and checks that + output contain or doesn't contain expected patterns + * @modules java.management + * @library /testlibrary + * @run driver TestVerifyBeforeAndAfterGCFlags + */ + +import java.util.ArrayList; +import java.util.Collections; + +import com.oracle.java.testlibrary.Utils; +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.ProcessTools; + +public class TestVerifyBeforeAndAfterGCFlags { + + // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] + public static final String VERIFY_BEFORE_GC_PATTERN = "VerifyBeforeGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: + public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; + + // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] + public static final String VERIFY_AFTER_GC_PATTERN = "VerifyAfterGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: + public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; + + public static void main(String args[]) throws Exception { + String[] filteredOpts = Utils.getFilteredTestJavaOpts( + new String[] { "-Xloggc:", + "-XX:+UseGCLogFileRotation", + "-XX:-DisplayVMOutput", + "VerifyBeforeGC", + "VerifyAfterGC" }); + testVerifyFlags(false, false, filteredOpts); + testVerifyFlags(true, true, filteredOpts); + testVerifyFlags(true, false, filteredOpts); + testVerifyFlags(false, true, filteredOpts); + } + + public static void testVerifyFlags(boolean verifyBeforeGC, + boolean verifyAfterGC, + String[] opts) throws Exception { + ArrayList vmOpts = new ArrayList<>(); + if (opts != null && (opts.length > 0)) { + Collections.addAll(vmOpts, opts); + } + + Collections.addAll(vmOpts, new String[] { + "-Xmx5m", + "-Xms5m", + "-Xmn3m", + "-XX:+UnlockDiagnosticVMOptions", + (verifyBeforeGC ? "-XX:+VerifyBeforeGC" + : "-XX:-VerifyBeforeGC"), + (verifyAfterGC ? "-XX:+VerifyAfterGC" + : "-XX:-VerifyAfterGC"), + GarbageProducer.class.getName() }); + ProcessBuilder procBuilder = + ProcessTools.createJavaProcessBuilder(vmOpts.toArray( + new String[vmOpts.size()])); + OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start()); + + analyzer.shouldHaveExitValue(0); + analyzer.shouldNotMatch(VERIFY_BEFORE_GC_CORRUPTED_PATTERN); + analyzer.shouldNotMatch(VERIFY_AFTER_GC_CORRUPTED_PATTERN); + + if (verifyBeforeGC) { + analyzer.shouldMatch(VERIFY_BEFORE_GC_PATTERN); + } else { + analyzer.shouldNotMatch(VERIFY_BEFORE_GC_PATTERN); + } + + if (verifyAfterGC) { + analyzer.shouldMatch(VERIFY_AFTER_GC_PATTERN); + } else { + analyzer.shouldNotMatch(VERIFY_AFTER_GC_PATTERN); + } + } + + public static class GarbageProducer { + static long[][] garbage = new long[10][]; + + public static void main(String args[]) { + int j = 0; + for(int i = 0; i<1000; i++) { + garbage[j] = new long[10000]; + j = (j+1)%garbage.length; + } + } + } +} diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java index 7c182896da0..4802f62fc39 100644 --- a/hotspot/test/gc/g1/TestGCLogMessages.java +++ b/hotspot/test/gc/g1/TestGCLogMessages.java @@ -66,7 +66,6 @@ public class TestGCLogMessages { new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST), new LogMessageWithLevel("CLDG Roots", Level.FINEST), new LogMessageWithLevel("JVMTI Roots", Level.FINEST), - new LogMessageWithLevel("CodeCache Roots", Level.FINEST), new LogMessageWithLevel("SATB Filtering", Level.FINEST), new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST), new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST), diff --git a/hotspot/test/gc/g1/TestGreyReclaimedHumongousObjects.java b/hotspot/test/gc/g1/TestGreyReclaimedHumongousObjects.java new file mode 100644 index 00000000000..4c88649d1b2 --- /dev/null +++ b/hotspot/test/gc/g1/TestGreyReclaimedHumongousObjects.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 TestGreyReclaimedHumongousObjects.java + * @bug 8069367 + * @requires vm.gc == "G1" | vm.gc == "null" + * @summary Test handling of marked but unscanned reclaimed humongous objects. + * @key gc + * @run main/othervm -XX:+UseG1GC -Xss32m -Xmx128m -XX:G1HeapRegionSize=1m + * -XX:+UnlockExperimentalVMOptions + * -XX:+G1EagerReclaimHumongousObjects + * -XX:+G1EagerReclaimHumongousObjectsWithStaleRefs + * TestGreyReclaimedHumongousObjects 1048576 90 + */ + +// This test spawns a bunch of threads, each of them rapidly +// allocating large objects and storing them into a circular buffer +// associated with the thread. The circular buffer results in these +// objects becoming dead in fairly short order. +// +// The situation we're trying to provoke is +// +// (1) A humongous object H is marked and added to the mark stack. +// +// (2) An evacuation pause determines H is no longer live, and +// reclaims it. This occurs before concurrent marking has gotten +// around to processing the mark stack entry for H. +// +// (3) Concurrent marking processes the mark stack entry for H. The +// bug is that it would attempt to scan the now dead object. +// +// Unfortunately, this test is *very* sensitive to configuration. +// Among the parameters that affect whether / how often we'll get into +// the desired situation within a reasonable amount of time are: +// +// - THREAD_COUNT: The number of allocating threads. +// +// - OLD_COUNT: The number of objects each thread keeps. +// +// - MAX_MEMORY: The maximum heap size. +// +// - G1HeapRegionSize +// +// - The size of the objects being allocated. +// +// The parameter values specified here: +// +// - THREAD_COUNT = 12 +// - OLD_COUNT == 4 +// - MAX_MEMORY == 128m +// - G1HeapRegionSize = 1m +// - Object size = 1048576 (2 regions after header overhead and roundup) +// +// seems to work well at provoking the desired state fairly quickly. +// Even relatively small perturbations may change that. The key +// factors seem to be keeping the heap mostly full of live objects but +// having them become dead fairly quickly. + +import java.util.Date; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import com.sun.management.HotSpotDiagnosticMXBean; +import java.lang.management.ManagementFactory; + +public class TestGreyReclaimedHumongousObjects { + + static class NamedThreadFactory implements ThreadFactory { + private int threadNum = 0; + + @Override + public Thread newThread(Runnable r) { + return new Thread(r, THREAD_NAME + (threadNum++)); + } + } + + static class Runner extends Thread { + private final Date startDate = new Date(); + private final int obj_size; + private final Object[] old_garbage; + private int old_index = 0; + + public Runner(int obj_size) { + this.obj_size = obj_size; + old_garbage = new Object[OLD_COUNT]; + } + + private void allocate_garbage() { + byte[] garbage = new byte[obj_size]; + old_garbage[Math.abs(++old_index % OLD_COUNT)] = garbage; + } + + @Override + public void run() { + try { + while (!isInterrupted()) { + allocate_garbage(); + Thread.sleep(0); // Yield, to ensure interruptable. + } + } catch (InterruptedException e) { + System.out.println("Aborted after " + + (new Date().getTime() - startDate.getTime()) + + " ms"); + interrupt(); + } + } + } + + public static void main(String[] args) throws Exception { + HotSpotDiagnosticMXBean diagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); + + System.out.println("Max memory= " + MAX_MEMORY + " bytes"); + + int obj_size = 0; + long seconds_to_run = 0; + if (args.length != 2) { + throw new RuntimeException("Object size argument must be supplied"); + } else { + obj_size = Integer.parseInt(args[0]); + seconds_to_run = Integer.parseInt(args[1]); + } + System.out.println("Objects size= " + obj_size + " bytes"); + System.out.println("Seconds to run=" + seconds_to_run); + + int region_size = + Integer.parseInt(diagnostic.getVMOption("G1HeapRegionSize").getValue()); + if (obj_size < (region_size / 2)) { + throw new RuntimeException("Object size " + obj_size + + " is not humongous with region size " + region_size); + } + + ExecutorService executor = + Executors.newFixedThreadPool(THREAD_COUNT, new NamedThreadFactory()); + System.out.println("Starting " + THREAD_COUNT + " threads"); + + for (int i = 0; i < THREAD_COUNT; i++) { + executor.execute(new Runner(obj_size)); + } + + Thread.sleep(seconds_to_run * 1000); + executor.shutdownNow(); + + if (!executor.awaitTermination(10, TimeUnit.SECONDS)) { + System.err.println("Thread pool did not terminate after 10 seconds after shutdown"); + } + } + + private static final long MAX_MEMORY = Runtime.getRuntime().maxMemory(); + private static final int OLD_COUNT = 4; + private static final int THREAD_COUNT = 12; + private static final String THREAD_NAME = "TestGreyRH-"; +} diff --git a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java index 32856cac06b..52a2a07e5df 100644 --- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java +++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java @@ -34,11 +34,11 @@ * TestHumongousShrinkHeap */ +import com.sun.management.HotSpotDiagnosticMXBean; import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; import java.util.ArrayList; import java.util.List; -import sun.management.ManagementFactoryHelper; import static com.oracle.java.testlibrary.Asserts.*; public class TestHumongousShrinkHeap { @@ -83,9 +83,11 @@ public class TestHumongousShrinkHeap { "committed free heap size is not less than committed full heap size, heap hasn't been shrunk?%n" + "%s = %s%n%s = %s", MIN_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), MAX_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() )); } diff --git a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java new file mode 100644 index 00000000000..ada6b77b385 --- /dev/null +++ b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 TestLargePageUseForAuxMemory.java + * @bug 8058354 + * @ignore 8079208 + * @key gc + * @library /testlibrary /../../test/lib + * @requires (vm.gc=="G1" | vm.gc=="null") + * @build TestLargePageUseForAuxMemory + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @summary Test that auxiliary data structures are allocated using large pages if available. + * @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory + */ + +import com.oracle.java.testlibrary.*; +import sun.hotspot.WhiteBox; + +public class TestLargePageUseForAuxMemory { + static final int HEAP_REGION_SIZE = 4 * 1024 * 1024; + static long largePageSize; + static long smallPageSize; + + static void checkSmallTables(OutputAnalyzer output, long expectedPageSize) throws Exception { + output.shouldContain("G1 'Block offset table': pg_sz=" + expectedPageSize); + output.shouldContain("G1 'Card counts table': pg_sz=" + expectedPageSize); + } + + static void checkBitmaps(OutputAnalyzer output, long expectedPageSize) throws Exception { + output.shouldContain("G1 'Prev Bitmap': pg_sz=" + expectedPageSize); + output.shouldContain("G1 'Next Bitmap': pg_sz=" + expectedPageSize); + } + + static void testVM(long heapsize, boolean cardsShouldUseLargePages, boolean bitmapShouldUseLargePages) throws Exception { + ProcessBuilder pb; + // Test with large page enabled. + pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE, + "-Xms" + 10 * HEAP_REGION_SIZE, + "-Xmx" + heapsize, + "-XX:+TracePageSizes", + "-XX:+UseLargePages", + "-XX:+IgnoreUnrecognizedVMOptions", // there is on ObjectAlignmentInBytes in 32 bit builds + "-XX:ObjectAlignmentInBytes=8", + "-version"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + checkSmallTables(output, (cardsShouldUseLargePages ? largePageSize : smallPageSize)); + checkBitmaps(output, (bitmapShouldUseLargePages ? largePageSize : smallPageSize)); + output.shouldHaveExitValue(0); + + // Test with large page disabled. + pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", + "-XX:G1HeapRegionSize=" + HEAP_REGION_SIZE, + "-Xms" + 10 * HEAP_REGION_SIZE, + "-Xmx" + heapsize, + "-XX:+TracePageSizes", + "-XX:-UseLargePages", + "-XX:+IgnoreUnrecognizedVMOptions", // there is on ObjectAlignmentInBytes in 32 bit builds + "-XX:ObjectAlignmentInBytes=8", + "-version"); + + output = new OutputAnalyzer(pb.start()); + checkSmallTables(output, smallPageSize); + checkBitmaps(output, smallPageSize); + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + if (!Platform.isDebugBuild()) { + System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option."); + return; + } + + WhiteBox wb = WhiteBox.getWhiteBox(); + smallPageSize = wb.getVMPageSize(); + largePageSize = wb.getVMLargePageSize(); + + if (largePageSize == 0) { + System.out.println("Skip tests because large page support does not seem to be available on this platform."); + return; + } + + // To get large pages for the card table etc. we need at least a 1G heap (with 4k page size). + // 32 bit systems will have problems reserving such an amount of contiguous space, so skip the + // test there. + if (!Platform.is32bit()) { + // Size that a single card covers. + final int cardSize = 512; + + final long heapSizeForCardTableUsingLargePages = largePageSize * cardSize; + + testVM(heapSizeForCardTableUsingLargePages, true, true); + testVM(heapSizeForCardTableUsingLargePages + HEAP_REGION_SIZE, true, true); + testVM(heapSizeForCardTableUsingLargePages - HEAP_REGION_SIZE, false, true); + } + + // Minimum heap requirement to get large pages for bitmaps is 128M heap. This seems okay to test + // everywhere. + final int bitmapTranslationFactor = 8 * 8; // ObjectAlignmentInBytes * BitsPerByte + final long heapSizeForBitmapUsingLargePages = largePageSize * bitmapTranslationFactor; + + testVM(heapSizeForBitmapUsingLargePages, false, true); + testVM(heapSizeForBitmapUsingLargePages + HEAP_REGION_SIZE, false, true); + testVM(heapSizeForBitmapUsingLargePages - HEAP_REGION_SIZE, false, false); + } +} + diff --git a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java index 43c35a38b37..51653f4a491 100644 --- a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java +++ b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java @@ -39,10 +39,10 @@ import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; import java.util.ArrayList; import java.util.List; -import sun.management.ManagementFactoryHelper; import static com.oracle.java.testlibrary.Asserts.*; import com.oracle.java.testlibrary.ProcessTools; import com.oracle.java.testlibrary.OutputAnalyzer; +import com.sun.management.HotSpotDiagnosticMXBean; public class TestShrinkDefragmentedHeap { // Since we store all the small objects, they become old and old regions are also allocated at the bottom of the heap @@ -144,9 +144,11 @@ public class TestShrinkDefragmentedHeap { "committed free heap size is not less than committed full heap size, heap hasn't been shrunk?%n" + "%s = %s%n%s = %s", MIN_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), MAX_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() ); } diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java b/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java index 1ab8322291b..4853ada23e8 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java +++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,14 +25,11 @@ * 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.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.Arrays; @@ -74,7 +71,8 @@ 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(); + HotSpotDiagnosticMXBean diagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); VMOption option = diagnostic.getVMOption("UseG1GC"); if (option.getValue().equals("false")) { @@ -150,4 +148,3 @@ public class TestSummarizeRSetStatsTools { } } } - diff --git a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java index 4c9e8c53122..abec4042435 100644 --- a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java +++ b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java @@ -33,8 +33,8 @@ import com.oracle.java.testlibrary.DynamicVMOption; import java.lang.management.ManagementFactory; import java.lang.management.MemoryUsage; import java.util.ArrayList; -import sun.management.ManagementFactoryHelper; import static com.oracle.java.testlibrary.Asserts.assertLessThan; +import com.sun.management.HotSpotDiagnosticMXBean; public class TestDynShrinkHeap { @@ -63,9 +63,11 @@ public class TestDynShrinkHeap { "committed free heap size is not less than committed full heap size, heap hasn't been shrunk?%n" + "%s = %s%n%s = %s", MIN_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MIN_FREE_RATIO_FLAG_NAME).getValue(), MAX_FREE_RATIO_FLAG_NAME, - ManagementFactoryHelper.getDiagnosticMXBean().getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class) + .getVMOption(MAX_FREE_RATIO_FLAG_NAME).getValue() )); } diff --git a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java index a5a72a8ba6e..7d71a8e39ff 100644 --- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java +++ b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java @@ -40,7 +40,7 @@ public class TestParNewSerialOld { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("It is not possible to combine the ParNew young collector with the Serial old collector."); + output.shouldContain("It is not possible to combine the ParNew young collector with any collector other than CMS."); output.shouldContain("Error"); output.shouldHaveExitValue(1); } diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java index 3355f94ef81..59725d7e690 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java @@ -39,7 +39,7 @@ public class CDSCompressedKPtrs { if (Platform.is64bit()) { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); @@ -47,7 +47,7 @@ public class CDSCompressedKPtrs { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java index 38267dcf825..9d513d0bcd7 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java @@ -36,10 +36,12 @@ import com.oracle.java.testlibrary.*; public class CDSCompressedKPtrsError { public static void main(String[] args) throws Exception { ProcessBuilder pb; + String filename = "./CDSCompressedKPtrsError.jsa"; + if (Platform.is64bit()) { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:SharedArchiveFile=" + filename, "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); @@ -47,21 +49,21 @@ public class CDSCompressedKPtrsError { pb = ProcessTools.createJavaProcessBuilder( "-XX:-UseCompressedClassPointers", "-XX:-UseCompressedOops", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Unable to use shared archive"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder( "-XX:-UseCompressedClassPointers", "-XX:+UseCompressedOops", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Unable to use shared archive"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseCompressedClassPointers", "-XX:-UseCompressedOops", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Unable to use shared archive"); output.shouldHaveExitValue(0); @@ -74,19 +76,19 @@ public class CDSCompressedKPtrsError { // Test bad options with -Xshare:dump. pb = ProcessTools.createJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:+UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:SharedArchiveFile=./CDSCompressedKPtrsErrorBad1.jsa", "-Xshare:dump"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Cannot dump shared archive"); pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseCompressedOops", "-XX:-UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:SharedArchiveFile=./CDSCompressedKPtrsErrorBad2.jsa", "-Xshare:dump"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Cannot dump shared archive"); pb = ProcessTools.createJavaProcessBuilder( "-XX:-UseCompressedOops", "-XX:-UseCompressedClassPointers", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:SharedArchiveFile=./CDSCompressedKPtrsErrorBad3.jsa", "-Xshare:dump"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Cannot dump shared archive"); diff --git a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java index 6bf45d7ce9c..c9843fdb851 100644 --- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java +++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java @@ -37,14 +37,14 @@ public class XShareAuto { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-server", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:SharedArchiveFile=./XShareAuto.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder( "-server", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-version"); + "-XX:SharedArchiveFile=./XShareAuto.jsa", "-version"); output = new OutputAnalyzer(pb.start()); // We asked for server but it could be aliased to something else if (output.getOutput().contains("Server VM")) { @@ -59,7 +59,7 @@ public class XShareAuto { pb = ProcessTools.createJavaProcessBuilder( "-server", "-Xshare:auto", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", "-XX:+PrintSharedSpaces", "-version"); + "-XX:SharedArchiveFile=./XShareAuto.jsa", "-XX:+PrintSharedSpaces", "-version"); output = new OutputAnalyzer(pb.start()); try { output.shouldContain("sharing"); diff --git a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java index 05292ba557f..887f780f7dd 100644 --- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. * 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,24 +23,30 @@ /* * @test - * @bug 8060449 + * @bug 8060449 8073989 * @summary Newly obsolete command line options should still give useful error messages when used improperly. * @library /testlibrary - * @modules java.base/sun.misc - * java.management */ import com.oracle.java.testlibrary.*; public class ObsoleteFlagErrorMessage { public static void main(String[] args) throws Exception { + + // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449) ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:UseBoundThreadsPlusJunk", "-version"); + "-XX:UseOldInliningPlusJunk", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Unrecognized VM option 'UseBoundThreadsPlusJunk'"); // Must identify bad option. - output.shouldContain("UseBoundThreads"); // Should apply fuzzy matching to find correct option. - output.shouldContain("support").shouldContain("removed"); // Should warn user that the option they are trying to use is no longer supported. + output.shouldContain("Unrecognized VM option 'UseOldInliningPlusJunk'"); // Must identify bad option. output.shouldHaveExitValue(1); + + // Case 2: Newly obsolete integer-valued flags should be recognized as newly obsolete (8073989) + ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder( + "-XX:NmethodSweepFraction=10", "-version"); + + OutputAnalyzer output2 = new OutputAnalyzer(pb2.start()); + output2.shouldContain("ignoring option").shouldContain("support was removed"); + output2.shouldContain("NmethodSweepFraction"); } } diff --git a/hotspot/test/runtime/CommandLine/TestVMOptions.java b/hotspot/test/runtime/CommandLine/TestVMOptions.java index 158d0377908..4fd49d2e77f 100644 --- a/hotspot/test/runtime/CommandLine/TestVMOptions.java +++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java @@ -46,7 +46,7 @@ public class TestVMOptions { pb = ProcessTools.createJavaProcessBuilder( "-XX:-PrintVMOptions", "-version"); output = new OutputAnalyzer(pb.start()); - output.shouldContain("java version"); + output.shouldMatch("(openjdk|java)\\sversion"); File dir = new File(System.getProperty("test.src", ".")); File file = new File(dir, "flagfile.txt"); diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java index 25b7d15b883..9742a30c718 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -97,7 +97,7 @@ public class CompressedClassPointers { // Test small heaps ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", "-XX:SharedBaseAddress=8g", "-XX:+PrintCompressedOopsMode", @@ -110,7 +110,7 @@ public class CompressedClassPointers { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=./CompressedClassPointers.jsa", "-Xmx128m", "-XX:SharedBaseAddress=8g", "-XX:+PrintCompressedOopsMode", diff --git a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java index 04cc2a1b581..947472853d5 100644 --- a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java +++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java @@ -48,7 +48,7 @@ public class ProblematicFrameTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateMinidumpOnCrash", Crasher.class.getName()); + "-Xmx64m", "-XX:-TransmitErrorReport", "-XX:-CreateCoredumpOnCrash", Crasher.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotMatch("error occurred during error reporting \\(printing problematic frame\\)"); } diff --git a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java index 924920a68ac..6eec04e0c92 100644 --- a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java +++ b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.FileInputStream; @@ -21,7 +44,7 @@ public class SafeFetchInErrorHandlingTest { public static void main(String[] args) throws Exception { - if (!Platform.isDebugBuild()) { + if (!Platform.isDebugBuild() || Platform.isZero()) { return; } @@ -30,6 +53,7 @@ public class SafeFetchInErrorHandlingTest { "-Xmx100M", "-XX:ErrorHandlerTest=14", "-XX:+TestSafeFetchInErrorHandler", + "-XX:-CreateCoredumpOnCrash", "-version"); OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java index f3e5e155ff7..c29107c65a0 100644 --- a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java +++ b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java @@ -1,12 +1,26 @@ -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.util.regex.Pattern; +/* + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 com.oracle.java.testlibrary.OutputAnalyzer; -import com.oracle.java.testlibrary.Platform; -import com.oracle.java.testlibrary.ProcessTools; /* * @test @@ -18,6 +32,16 @@ import com.oracle.java.testlibrary.ProcessTools; * java.management */ +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.regex.Pattern; + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.Platform; +import com.oracle.java.testlibrary.ProcessTools; + public class SecondaryErrorTest { @@ -35,6 +59,7 @@ public class SecondaryErrorTest { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx100M", + "-XX:-CreateCoredumpOnCrash", "-XX:ErrorHandlerTest=15", "-XX:TestCrashInErrorHandler=14", "-version"); diff --git a/hotspot/test/runtime/NMT/JcmdDetailDiff.java b/hotspot/test/runtime/NMT/JcmdDetailDiff.java index bdef6eb0561..963d922eb06 100644 --- a/hotspot/test/runtime/NMT/JcmdDetailDiff.java +++ b/hotspot/test/runtime/NMT/JcmdDetailDiff.java @@ -28,7 +28,6 @@ * @library /testlibrary /../../test/lib * @modules java.base/sun.misc * java.management - * @ignore * @build JcmdDetailDiff * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail JcmdDetailDiff diff --git a/hotspot/test/runtime/NMT/NMTWithCDS.java b/hotspot/test/runtime/NMT/NMTWithCDS.java index efbb0529791..0c6a4ffa046 100644 --- a/hotspot/test/runtime/NMT/NMTWithCDS.java +++ b/hotspot/test/runtime/NMT/NMTWithCDS.java @@ -37,14 +37,14 @@ public class NMTWithCDS { public static void main(String[] args) throws Exception { ProcessBuilder pb; pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java index 472845d696b..c4c17c94c00 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java @@ -49,7 +49,7 @@ public class AssertSafepointCheckConsistency1 { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:-TransmitErrorReport", - "-XX:-CreateMinidumpOnCrash", + "-XX:-CreateCoredumpOnCrash", "-Xmx32m", "AssertSafepointCheckConsistency1", "test"); diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java index 5c3980b5e55..f90c5d1578c 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java @@ -49,7 +49,7 @@ public class AssertSafepointCheckConsistency2 { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:-TransmitErrorReport", - "-XX:-CreateMinidumpOnCrash", + "-XX:-CreateCoredumpOnCrash", "-Xmx32m", "AssertSafepointCheckConsistency2", "test"); diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java index 90b67d86af3..30d77b37b06 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java @@ -49,7 +49,7 @@ public class AssertSafepointCheckConsistency3 { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:-TransmitErrorReport", - "-XX:-CreateMinidumpOnCrash", + "-XX:-CreateCoredumpOnCrash", "-Xmx32m", "AssertSafepointCheckConsistency3", "test"); diff --git a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java index b1615d99b15..2f55e941fc9 100644 --- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java +++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java @@ -49,7 +49,7 @@ public class AssertSafepointCheckConsistency4 { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:-TransmitErrorReport", - "-XX:-CreateMinidumpOnCrash", + "-XX:-CreateCoredumpOnCrash", "-Xmx32m", "AssertSafepointCheckConsistency4", "test"); diff --git a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java index 08244c726c5..5803facd623 100644 --- a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java +++ b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java @@ -38,7 +38,7 @@ import java.io.File; public class ArchiveDoesNotExist { public static void main(String[] args) throws Exception { - String fileName = "test.jsa"; + String fileName = "ArchiveDoesNotExist.jsa"; File cdsFile = new File(fileName); if (cdsFile.exists()) diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java index e1cc78a2bfb..9bbb9af5d20 100644 --- a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java +++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java @@ -59,10 +59,11 @@ public class CdsDifferentObjectAlignment { createAlignment; String loadAlignmentArgument = "-XX:ObjectAlignmentInBytes=" + loadAlignment; + String filename = "./CdsDifferentObjectAlignment" + createAlignment + ".jsa"; ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", createAlignmentArgument); @@ -72,7 +73,7 @@ public class CdsDifferentObjectAlignment { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=" + filename, "-Xshare:on", loadAlignmentArgument, "-version"); diff --git a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java index 763aa842683..1d01c064e3d 100644 --- a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java +++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java @@ -55,10 +55,11 @@ public class CdsSameObjectAlignment { System.out.println("dumpAndLoadSharedArchive(): objectAlignmentInBytes = " + objectAlignmentInBytes); + String filename = "./CdsSameObjectAlignment" + objectAlignmentInBytes + ".jsa"; // create shared archive ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=" + filename, "-Xshare:dump", objectAlignmentArg); @@ -70,7 +71,7 @@ public class CdsSameObjectAlignment { // run using the shared archive pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=" + filename, "-Xshare:on", objectAlignmentArg, "-version"); diff --git a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java index d904448709b..2b26a04d6c1 100644 --- a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java +++ b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java @@ -36,7 +36,7 @@ import java.io.File; public class DefaultUseWithClient { public static void main(String[] args) throws Exception { - String fileName = "test.jsa"; + String fileName = "DefaultUseWithClient.jsa"; // On 32-bit windows CDS should be on by default in "-client" config // Skip this test on any other platform diff --git a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java index 8f2ebf7d640..9f26fb62b52 100644 --- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java +++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java @@ -125,9 +125,11 @@ public class LimitSharedSizes { }; public static void main(String[] args) throws Exception { - String fileName = "test.jsa"; - + int counter = 0; for (SharedSizeTestData td : testTable) { + String fileName = "LimitSharedSizes" + counter + ".jsa"; + counter++; + String option = td.optionName + "=" + td.optionValue; System.out.println("testing option <" + option + ">"); diff --git a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java index d3f74a20ab5..b80c639fb80 100644 --- a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java +++ b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java @@ -34,8 +34,10 @@ import com.oracle.java.testlibrary.*; public class PrintSharedArchiveAndExit { public static void main(String[] args) throws Exception { + String filename = "./PrintSharedArchiveAndExit.jsa"; + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); try { output.shouldContain("Loading classes to share"); @@ -43,7 +45,7 @@ public class PrintSharedArchiveAndExit { // (1) With a valid archive pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-XX:+PrintSharedArchiveAndExit", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("archive is valid"); @@ -51,7 +53,7 @@ public class PrintSharedArchiveAndExit { output.shouldHaveExitValue(0); // Should report success in error code. pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-XX:+PrintSharedArchiveAndExit"); output = new OutputAnalyzer(pb.start()); output.shouldContain("archive is valid"); @@ -61,7 +63,7 @@ public class PrintSharedArchiveAndExit { // (2) With an invalid archive (boot class path has been prepended) pb = ProcessTools.createJavaProcessBuilder( "-Xbootclasspath/p:foo.jar", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-XX:+PrintSharedArchiveAndExit", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("archive is invalid"); @@ -70,7 +72,7 @@ public class PrintSharedArchiveAndExit { pb = ProcessTools.createJavaProcessBuilder( "-Xbootclasspath/p:foo.jar", - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=" + filename, "-XX:+PrintSharedArchiveAndExit"); output = new OutputAnalyzer(pb.start()); output.shouldContain("archive is invalid"); diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java index d8221ef7933..cc57473333b 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java @@ -35,14 +35,14 @@ import com.oracle.java.testlibrary.*; public class SharedArchiveFile { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-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", "-Xshare:on", "-version"); + "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("sharing"); output.shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java index e47ce0f15af..f60e545b08e 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java @@ -49,11 +49,12 @@ public class SharedBaseAddress { return; for (String testEntry : testTable) { + String filename = "SharedBaseAddress" + testEntry + ".jsa"; System.out.println("sharedBaseAddress = " + testEntry); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=test.jsa", + "-XX:SharedArchiveFile=" + filename, "-XX:SharedBaseAddress=" + testEntry, "-Xshare:dump"); @@ -64,7 +65,7 @@ public class SharedBaseAddress { try { pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=test.jsa", + "-XX:SharedArchiveFile=" + filename, "-Xshare:on", "-version"); output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java index 208d834a0e0..b1b4d93471d 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java @@ -38,7 +38,7 @@ public class SharedSymbolTableBucketSize { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-Xshare:dump", "-XX:+PrintSharedSpaces", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=./SharedSymbolTableBucketSize.jsa", "-XX:SharedSymbolTableBucketSize=" + Integer.valueOf(bucket_size)); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Loading classes to share"); @@ -60,7 +60,7 @@ public class SharedSymbolTableBucketSize { pb = ProcessTools.createJavaProcessBuilder( "-Xshare:dump", "-XX:+PrintSharedSpaces", "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./sample.jsa", + "-XX:SharedArchiveFile=./SharedSymbolTableBucketSize.jsa", input[i]); output = new OutputAnalyzer(pb.start()); output.shouldContain("Improperly specified VM option"); diff --git a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java index dc5468d8e3f..713f930add1 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java +++ b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java @@ -50,7 +50,7 @@ public class SpaceUtilizationCheck { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", - "-XX:SharedArchiveFile=./test.jsa", + "-XX:SharedArchiveFile=./SpaceUtilizationCheck.jsa", "-Xshare:dump"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/StackGuardPages/invoke.c b/hotspot/test/runtime/StackGuardPages/invoke.c index 483ac0b98e7..be09572e1c6 100644 --- a/hotspot/test/runtime/StackGuardPages/invoke.c +++ b/hotspot/test/runtime/StackGuardPages/invoke.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -221,7 +221,7 @@ int main (int argc, const char** argv) { printf("Test started with pid: %ld\n", (long) getpid()); options[0].optionString = "-Xint"; - options[1].optionString = "-Xss320k"; + options[1].optionString = "-Xss328k"; vm_args.version = JNI_VERSION_1_2; vm_args.ignoreUnrecognized = JNI_TRUE; diff --git a/hotspot/test/runtime/Unsafe/GetKlassPointerGetJavaMirror.java b/hotspot/test/runtime/Unsafe/GetKlassPointerGetJavaMirror.java new file mode 100644 index 00000000000..10735d20a73 --- /dev/null +++ b/hotspot/test/runtime/Unsafe/GetKlassPointerGetJavaMirror.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8022853 + * @library /testlibrary + * @modules java.base/sun.misc + * @run main GetKlassPointerGetJavaMirror + */ + +import static com.oracle.java.testlibrary.Asserts.*; + +import com.oracle.java.testlibrary.*; +import sun.misc.Unsafe; + +public class GetKlassPointerGetJavaMirror { + + public static void main(String args[]) throws Exception { + Unsafe unsafe = Utils.getUnsafe(); + Object o = new GetKlassPointerGetJavaMirror(); + final long metaspaceKlass = unsafe.getKlassPointer(o); + Class c = unsafe.getJavaMirror(metaspaceKlass); + assertEquals(o.getClass(), c); + } + +} diff --git a/hotspot/test/runtime/Unsafe/GetUncompressedObject.java b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java new file mode 100644 index 00000000000..2db94a0faaf --- /dev/null +++ b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8022853 + * @library /testlibrary + * @modules java.base/sun.misc + * @run main GetUncompressedObject + */ + +import static com.oracle.java.testlibrary.Asserts.*; + +import com.oracle.java.testlibrary.*; +import sun.misc.Unsafe; + +public class GetUncompressedObject { + + public static void main(String args[]) throws Exception { + Unsafe unsafe = Utils.getUnsafe(); + + // Allocate some memory and fill it with non-zero values. + final int size = 32; + final long address = unsafe.allocateMemory(size); + unsafe.setMemory(address, size, (byte) 0x23); + + // The only thing we can do is check for null-ness. + // So, store a null somewhere. + unsafe.putAddress(address + 16, 0); + + Object nullObj = unsafe.getUncompressedObject(address + 16); + if (nullObj != null) { + throw new InternalError("should be null"); + } + } + +} diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java index 00513055a03..f4e78e13516 100644 --- a/hotspot/test/runtime/Unsafe/RangeCheck.java +++ b/hotspot/test/runtime/Unsafe/RangeCheck.java @@ -45,6 +45,7 @@ public class RangeCheck { true, "-Xmx32m", "-XX:-TransmitErrorReport", + "-XX:-CreateCoredumpOnCrash", "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert DummyClassWithMainRangeCheck.class.getName()); diff --git a/hotspot/test/runtime/handlerInTry/HandlerInTry.jasm b/hotspot/test/runtime/handlerInTry/HandlerInTry.jasm new file mode 100644 index 00000000000..39c367c8fa0 --- /dev/null +++ b/hotspot/test/runtime/handlerInTry/HandlerInTry.jasm @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +/* + * HandlerInTry contains a try block in a ctor whose handler is inside + * the same try block. The try block starts at line 74 (try t2;), ends at + * line 106 (endtry t2;), but its handler starts at line 101 (catch t2 #0;). + */ +super public class HandlerInTry + version 51:0 +{ + +public static final synthetic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;"; + +public Method "":"(Ljava/lang/Object;)V" + stack 5 locals 5 +{ + invokestatic Method ThreadLocalTransaction.getThreadLocalTransaction:"()Ljava/lang/Object;"; + checkcast class java/lang/Object; + astore_2; + aload_2; + invokestatic Method TransactionLogicDonor.isActiveTransaction:"(Ljava/lang/Object;)Z"; + ifeq L21; + aload_0; + aload_1; + aload_2; + invokespecial Method "":"(Ljava/lang/Object;Ljava/lang/Object;)V"; + return; + L21: stack_frame_type append; + locals_map class java/lang/Object; + aload_2; + getstatic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;"; + invokestatic Method TransactionLogicDonor.createTransaction:"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"; + astore_2; + aload_2; + iconst_1; + pop; + aload_2; + invokestatic Method ThreadLocalTransaction.setThreadLocalTransaction:"(Ljava/lang/Object;)V"; + try t0, t1; + aload_0; + aload_1; + aload_2; + invokespecial Method "":"(Ljava/lang/Object;Ljava/lang/Object;)V"; + aload_2; + pop; + aconst_null; + astore_2; + endtry t0, t1; + invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V"; + pop; + goto L107; + catch t0 java/lang/Throwable; + try t2; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore_3; + aload_2; + pop; + aload_3; + instanceof class ControlFlowError; + ifeq L82; + new class java/lang/NullPointerException; + dup; + invokespecial Method java/lang/NullPointerException."":"()V"; + athrow; + L82: stack_frame_type append; + locals_map class java/lang/Throwable; + aload_3; + instanceof class java/lang/Error; + ifeq L94; + aload_3; + checkcast class java/lang/Error; + athrow; + L94: stack_frame_type same; + aload_3; + checkcast class java/lang/Exception; + athrow; + catch t1 #0; + catch t2 #0; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore 4; + endtry t2; + invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V"; + aload 4; + athrow; + L107: stack_frame_type full; + locals_map class HandlerInTry, class java/lang/Object, null; + return; +} + +} // end Class HandlerInTry diff --git a/hotspot/test/runtime/handlerInTry/IsolatedHandlerInTry.jasm b/hotspot/test/runtime/handlerInTry/IsolatedHandlerInTry.jasm new file mode 100644 index 00000000000..513050eff81 --- /dev/null +++ b/hotspot/test/runtime/handlerInTry/IsolatedHandlerInTry.jasm @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +/* + * IsolatedHandlerInTry contains a try block in a ctor whose handler is inside + * the same try block but the handler can only be reached if an exception + * occurs. The handler does a return. So, a VerifyException should be thrown. + * The try block starts at line 77 (try t2;) and ends at line 113 (endtry t2;). + * Its handler starts at line 107 (catch t2 #0;). The handler can only be reached + * by exception because of the athrow at line 106. + */ +super public class IsolatedHandlerInTry + version 51:0 +{ + +public static final synthetic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;"; + +public Method "":"(Ljava/lang/Object;)V" + stack 5 locals 5 +{ + invokestatic Method ThreadLocalTransaction.getThreadLocalTransaction:"()Ljava/lang/Object;"; + checkcast class java/lang/Object; + astore_2; + aload_2; + invokestatic Method TransactionLogicDonor.isActiveTransaction:"(Ljava/lang/Object;)Z"; + ifeq L21; + aload_0; + aload_1; + aload_2; + invokespecial Method "":"(Ljava/lang/Object;Ljava/lang/Object;)V"; + return; + L21: stack_frame_type append; + locals_map class java/lang/Object; + aload_2; + getstatic Field ___transactionFactory_2002349702336125:"Ljava/lang/Object;"; + invokestatic Method TransactionLogicDonor.createTransaction:"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"; + astore_2; + aload_2; + iconst_1; + pop; + aload_2; + invokestatic Method ThreadLocalTransaction.setThreadLocalTransaction:"(Ljava/lang/Object;)V"; + try t0, t1; + aload_0; + aload_1; + aload_2; + invokespecial Method "":"(Ljava/lang/Object;Ljava/lang/Object;)V"; + aload_2; + pop; + aconst_null; + astore_2; + endtry t0, t1; + invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V"; + pop; + goto L107; + catch t0 java/lang/Throwable; + try t2; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore_3; + aload_2; + pop; + aload_3; + instanceof class ControlFlowError; + ifeq L82; + new class java/lang/NullPointerException; + dup; + invokespecial Method java/lang/NullPointerException."":"()V"; + athrow; + L82: stack_frame_type append; + locals_map class java/lang/Throwable; + aload_3; + instanceof class java/lang/Error; + ifeq L94; + aload_3; + checkcast class java/lang/Error; + athrow; + L94: stack_frame_type same; + aload_3; + checkcast class java/lang/Exception; + catch t1 #0; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + athrow; + catch t2 #0; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore 4; + return; + endtry t2; + stack_frame_type full; + locals_map bogus, class java/lang/Object, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + invokestatic Method ThreadLocalTransaction.clearThreadLocalTransaction:"()V"; + athrow; + L107: stack_frame_type full; + locals_map class IsolatedHandlerInTry, class java/lang/Object, null; + return; +} + +} // end Class IsolatedHandlerInTry diff --git a/hotspot/test/runtime/handlerInTry/LoadHandlerInTry.java b/hotspot/test/runtime/handlerInTry/LoadHandlerInTry.java new file mode 100644 index 00000000000..5fc7268790e --- /dev/null +++ b/hotspot/test/runtime/handlerInTry/LoadHandlerInTry.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8075118 + * @summary Allow a ctor to call super() from a switch bytecode. + * @compile HandlerInTry.jasm + * @compile IsolatedHandlerInTry.jasm + * @run main/othervm -Xverify:all LoadHandlerInTry + */ + +/* + * This test has two cases: + * + * 1. class HandlerInTry: Class HandlerInTry contains a TRY block in a + * constructor whose handler is inside the same TRY block. The last + * few bytecodes and exception table look like this: + * + * ... + * 87: athrow + * 88: astore 4 + * 90: invokestatic #9 + * 93: aload 4 + * 95: athrow + * 96: return + * Exception table: + * from to target type + * 36 46 53 Class java/lang/Throwable + * 36 46 88 any + * 53 90 88 any + * + * Note that the target for the third handler in the Exception table is + * inside its TRY block. + * Without the fix for bug JDK-8075118, this test will time out. + * + * + * 2. class IsolatedHandlerInTry: Class IsolatedHandlerInTry also contains + * a TRY block in a constructoer whose handler is inside its TRY block. + * But the handler is only reachable if an exception is thrown. The + * handler's bytecodes will not get parsed as part of parsing the TRY + * block. They will only get parsed as a handler for the TRY block. + * Since the isolated handler does a 'return', a VerifyError exception + * should get thrown. + */ + +public class LoadHandlerInTry { + + public static void main(String[] args) throws Exception { + System.out.println("Regression test for bug 8075118"); + try { + Class newClass = Class.forName("HandlerInTry"); + } catch (Exception e) { + System.out.println("Failed: Exception was thrown: " + e.toString()); + throw e; + } + + try { + Class newClass = Class.forName("IsolatedHandlerInTry"); + throw new RuntimeException( + "Failed to throw VerifyError for IsolatedHandlerInTry"); + } catch (java.lang.VerifyError e) { + System.out.println("Passed: VerifyError exception was thrown"); + } + } +} diff --git a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java index 11e0e01309e..95872c3b9d6 100644 --- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java +++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java @@ -50,6 +50,7 @@ public class ReadFromNoaccessArea { "-XX:+WhiteBoxAPI", "-XX:+UseCompressedOops", "-XX:HeapBaseMinAddress=33G", + "-XX:-CreateCoredumpOnCrash", "-Xmx32m", DummyClassWithMainTryingToReadFromNoaccessArea.class.getName()); diff --git a/hotspot/test/runtime/stackMapCheck/BadMap.jasm b/hotspot/test/runtime/stackMapCheck/BadMap.jasm new file mode 100644 index 00000000000..2a4c7856fe5 --- /dev/null +++ b/hotspot/test/runtime/stackMapCheck/BadMap.jasm @@ -0,0 +1,152 @@ + /* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +/* + * This class should throw VerifyError because the StackMap for bytecode index + * 45 (astore_2, line 123) is incorrect. The stack maps for bytecode indexes 45 + * and 49 (astore, line 133) do not match because 45 does not supply enough + * locals to satisfy 49. + * + * The astore_2 bytecode at bytecode index 45 changes the type state, + * preventing the stackmap mismatch. But, if the incoming type state is used, + * as required by JVM Spec 8, then the verifier will detected the stackmap + * mismatch, and throw VerifyError. + */ + +super public class BadMap + version 51:0 +{ + + +public Method "":"()V" + stack 1 locals 1 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +public static Method main:"([Ljava/lang/String;)V" + throws java/lang/Throwable + stack 0 locals 1 +{ + return; +} + +public static Method foo:"()V" + stack 3 locals 5 +{ + iconst_0; + ifne L5; + nop; + try t7; + L5: stack_frame_type full; + aconst_null; + dup; + astore_0; + astore_1; + try t0; + aconst_null; + astore_0; + endtry t0; + goto L19; + catch t0 java/io/IOException; + stack_frame_type full; + locals_map class java/lang/Object, null; + stack_map class java/io/IOException; + astore_2; + aconst_null; + dup; + astore_1; + astore_0; + try t1; + L19: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object; + aconst_null; + astore_2; + endtry t1; + aload_1; + ifnonnull L37; + nop; + goto L37; + catch t1 #0; + catch t2 #0; + try t2; + stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore_3; + endtry t2; + aload_1; + ifnonnull L35; + nop; + L35: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, bogus, class java/lang/Throwable; + aload_3; + athrow; + try t3, t4; + L37: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object; + aload_1; + ifnonnull L42; + nop; + endtry t3, t4; + L42: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object; + goto L54; + catch t3 java/lang/Exception; + try t5; + stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Exception; + astore_2; // astore_2, at bci 45, that changes the type state. + endtry t5; + goto L54; + catch t4 #0; + catch t5 #0; + catch t6 #0; + try t6; + stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object; + stack_map class java/lang/Throwable; + astore 4; + endtry t6; + aload 4; + athrow; + L54: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object; + goto L57; + L57: stack_frame_type full; + locals_map class java/lang/Object, class java/lang/Object, class java/lang/Object; + nop; + endtry t7; + return; + catch t7 #0; + stack_frame_type full; + stack_map class java/lang/Throwable; + nop; + athrow; +} + +} // end Class BadMap diff --git a/hotspot/test/runtime/stackMapCheck/BadMapDstore.jasm b/hotspot/test/runtime/stackMapCheck/BadMapDstore.jasm new file mode 100644 index 00000000000..16797fb9e39 --- /dev/null +++ b/hotspot/test/runtime/stackMapCheck/BadMapDstore.jasm @@ -0,0 +1,79 @@ + /* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +/* + * This class should throw VerifyError because the StackMap for bytecode index + * 9 (dstore_2, line 60) is incorrect. The stack maps for bytecode indexes 9 + * and 18 (astore_2, line 70) do not match because 9 does not supply enough + * locals to satisfy 18. + * + * The dstore_2 bytecode at bytecode index 9 changes the type state, + * preventing the stackmap mismatch. But, if the incoming type state is used, + * as required by JVM Spec 8, then the verifier will detected the stackmap + * mismatch, and throw VerifyError. + */ + +super public class BadMapDstore + version 51:0 +{ + +Field blah:I; + +public Method "":"()V" + stack 1 locals 1 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +public static Method main:"([Ljava/lang/String;)V" + stack 4 locals 4 +{ + new class BadMapDstore; + dup; + invokespecial Method "":"()V"; + astore_1; + dconst_1; + try t0; + dstore_2; + aload_1; + iconst_5; + putfield Field blah:"I"; + endtry t0; + goto L22; + catch t0 java/lang/Throwable; + stack_frame_type full; + locals_map class "[Ljava/lang/String;", class BadMapDstore, double; + stack_map class java/lang/Throwable; + astore_2; + aload_1; + dconst_0; + dstore_2; + pop; + L22: stack_frame_type same; + return; +} + +} // end Class BadMapDstore diff --git a/hotspot/test/runtime/stackMapCheck/BadMapIstore.jasm b/hotspot/test/runtime/stackMapCheck/BadMapIstore.jasm new file mode 100644 index 00000000000..63eeaf358ec --- /dev/null +++ b/hotspot/test/runtime/stackMapCheck/BadMapIstore.jasm @@ -0,0 +1,79 @@ + /* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +/* + * This class should throw VerifyError because the StackMap for bytecode index + * 9 (istore_2, line 60) is incorrect. The stack maps for bytecode indexes 9 + * and 18 (astore_2, line 70) do not match because 9 does not supply enough + * locals to satisfy 18. + * + * The istore_2 bytecode at bytecode index 9 changes the type state, + * preventing the stackmap mismatch. But, if the incoming type state is used, + * as required by JVM Spec 8, then the verifier will detected the stackmap + * mismatch, and throw VerifyError. + */ + +super public class BadMapIstore + version 51:0 +{ + +Field blah:I; + +public Method "":"()V" + stack 1 locals 1 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +public static Method main:"([Ljava/lang/String;)V" + stack 2 locals 3 +{ + new class BadMapIstore; + dup; + invokespecial Method "":"()V"; + astore_1; + iconst_2; + try t0; + istore_2; + aload_1; + iconst_5; + putfield Field blah:"I"; + endtry t0; + goto L22; + catch t0 java/lang/Throwable; + stack_frame_type full; + locals_map class "[Ljava/lang/String;", class BadMapIstore, int; + stack_map class java/lang/Throwable; + astore_2; + aload_1; + iconst_4; + istore_2; + pop; + L22: stack_frame_type same; + return; +} + +} // end Class BadMapIstore diff --git a/hotspot/test/runtime/stackMapCheck/StackMapCheck.java b/hotspot/test/runtime/stackMapCheck/StackMapCheck.java new file mode 100644 index 00000000000..56d1715855b --- /dev/null +++ b/hotspot/test/runtime/stackMapCheck/StackMapCheck.java @@ -0,0 +1,63 @@ + /* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 7127066 + * @summary Class verifier accepts an invalid class file + * @compile BadMap.jasm + * @compile BadMapDstore.jasm + * @compile BadMapIstore.jasm + * @run main/othervm -Xverify:all StackMapCheck + */ + +public class StackMapCheck { + public static void main(String args[]) throws Throwable { + + System.out.println("Regression test for bug 7127066"); + try { + Class newClass = Class.forName("BadMap"); + throw new RuntimeException( + "StackMapCheck failed, BadMap did not throw VerifyError"); + } catch (java.lang.VerifyError e) { + System.out.println("BadMap passed, VerifyError was thrown"); + } + + try { + Class newClass = Class.forName("BadMapDstore"); + throw new RuntimeException( + "StackMapCheck failed, BadMapDstore did not throw VerifyError"); + } catch (java.lang.VerifyError e) { + System.out.println("BadMapDstore passed, VerifyError was thrown"); + } + + try { + Class newClass = Class.forName("BadMapIstore"); + throw new RuntimeException( + "StackMapCheck failed, BadMapIstore did not throw VerifyError"); + } catch (java.lang.VerifyError e) { + System.out.println("BadMapIstore passed, VerifyError was thrown"); + } + } +} diff --git a/hotspot/test/sanity/WhiteBox.java b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java similarity index 98% rename from hotspot/test/sanity/WhiteBox.java rename to hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java index b47d339f55e..8841c1362ab 100644 --- a/hotspot/test/sanity/WhiteBox.java +++ b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java @@ -30,7 +30,6 @@ * @compile WhiteBox.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI sun.hotspot.WhiteBox - * @clean sun.hotspot.WhiteBox */ package sun.hotspot; diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java index 51798e6afe0..8c897cbf69b 100644 --- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java +++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7162400 * @key regression * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues - * @ignore 8024055 * @library /testlibrary * @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget * @run main AttachWithStalePidFile @@ -79,9 +78,7 @@ public class AttachWithStalePidFile { // wait for vm.paused file to be created and delete it once we find it. waitForAndResumeVM(pid); - // unfortunately there's no reliable way to know the VM is ready to receive the - // attach request so we have to do an arbitrary sleep. - Thread.sleep(5000); + waitForTargetReady(target); HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString()); BufferedReader remoteDataReader = new BufferedReader(new InputStreamReader(vm.remoteDataDump())); @@ -101,6 +98,16 @@ public class AttachWithStalePidFile { } } + private static void waitForTargetReady(Process target) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(target.getInputStream())); + String line = br.readLine(); + // wait for the ready message having been printed or EOF (line == null) + while (line != null && !line.equals(AttachWithStalePidFileTarget.READY_MSG)) { + line = br.readLine(); + } + // target VM ready + } + private static Path createJavaPidFile(int pid) throws Exception { Path pidFile = Paths.get("/tmp/.java_pid" + pid); if(Files.exists(pidFile)) { @@ -108,8 +115,10 @@ public class AttachWithStalePidFile { Files.delete(pidFile); } catch(FileSystemException e) { - if(e.getReason().equals("Operation not permitted")) { + if(e.getReason().matches("Operation not permitted|Not owner")) { System.out.println("Unable to remove exisiting stale PID file" + pidFile); + System.out.println("==================================================="); + e.printStackTrace(System.out); return null; } throw e; diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFileTarget.java b/hotspot/test/serviceability/attach/AttachWithStalePidFileTarget.java index bf87fb47094..972c5f3b28b 100644 --- a/hotspot/test/serviceability/attach/AttachWithStalePidFileTarget.java +++ b/hotspot/test/serviceability/attach/AttachWithStalePidFileTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,10 @@ * questions. */ public class AttachWithStalePidFileTarget { + static final String READY_MSG = "*ready*"; public static void main(String... args) throws Exception { - Thread.sleep(2*60*1000); + System.out.println(READY_MSG); + System.out.flush(); + System.in.read(); } } diff --git a/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java b/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java new file mode 100644 index 00000000000..be4f3e892af --- /dev/null +++ b/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.dcmd.CommandExecutor; +import com.oracle.java.testlibrary.dcmd.JMXExecutor; +import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor; +import org.testng.annotations.Test; + +/* + * @test + * @bug 8054890 + * @summary Test of JVMTI.data_dump diagnostic command + * @library /testlibrary + * @build com.oracle.java.testlibrary.* + * @run testng DataDumpDcmdTest + */ + +/** + * This test issues the "JVMTI.data_dump" command which will dump the related JVMTI + * data. + * + */ +public class DataDumpDcmdTest { + public void run(CommandExecutor executor) { + OutputAnalyzer output = executor.execute("JVMTI.data_dump"); + + output.stderrShouldBeEmpty(); + } + + @Test + public void jmx() throws Throwable { + run(new JMXExecutor()); + } + + @Test + public void cli() throws Throwable { + run(new PidJcmdExecutor()); + } +} \ No newline at end of file diff --git a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java new file mode 100644 index 00000000000..6a3ea0b50b6 --- /dev/null +++ b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.dcmd.CommandExecutor; +import com.oracle.java.testlibrary.dcmd.JMXExecutor; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/* + * @test + * @bug 8054890 + * @summary Test of VM.set_flag diagnostic command + * @library /testlibrary + * @build com.oracle.java.testlibrary.* + * @build com.oracle.java.testlibrary.dcmd.* + * @run testng SetVMFlagTest + */ + +public class SetVMFlagTest { + private static final String MANAGEABLE_PATTERN = "\\s*bool\\s+(\\S+)\\s+[\\:]?=\\s+" + + "(.*?)\\s+\\{manageable\\}"; + private static final String IMMUTABLE_PATTERN = "\\s*uintx\\s+(\\S+)\\s+[\\:]?=\\s+" + + "(.*?)\\s+\\{product\\}"; + + public void run(CommandExecutor executor) { + setMutableFlag(executor); + setMutableFlagWithInvalidValue(executor); + setImmutableFlag(executor); + setNonExistingFlag(executor); + } + + @Test + public void jmx() { + run(new JMXExecutor()); + } + + private void setMutableFlag(CommandExecutor executor) { + OutputAnalyzer out = getAllFlags(executor); + String flagName = out.firstMatch(MANAGEABLE_PATTERN, 1); + String flagVal = out.firstMatch(MANAGEABLE_PATTERN, 2); + + System.out.println("### Setting a mutable flag '" + flagName + "'"); + + if (flagVal == null) { + System.err.println(out.getOutput()); + throw new Error("Can not find a boolean manageable flag"); + } + + Boolean blnVal = Boolean.parseBoolean(flagVal); + + out = executor.execute("VM.set_flag " + flagName + " " + (blnVal ? 0 : 1)); + out.stderrShouldBeEmpty(); + + out = getAllFlags(executor); + + String newFlagVal = out.firstMatch(MANAGEABLE_PATTERN.replace("(\\S+)", flagName), 1); + + assertNotEquals(newFlagVal, flagVal); + } + + private void setMutableFlagWithInvalidValue(CommandExecutor executor) { + OutputAnalyzer out = getAllFlags(executor); + String flagName = out.firstMatch(MANAGEABLE_PATTERN, 1); + String flagVal = out.firstMatch(MANAGEABLE_PATTERN, 2); + + System.out.println("### Setting a mutable flag '" + flagName + "' to an invalid value"); + + if (flagVal == null) { + System.err.println(out.getOutput()); + throw new Error("Can not find a boolean manageable flag"); + } + + // a boolean flag accepts only 0/1 as its value + out = executor.execute("VM.set_flag " + flagName + " unexpected_value"); + out.stderrShouldBeEmpty(); + out.stdoutShouldContain("flag value must be a boolean (1 or 0)"); + + out = getAllFlags(executor); + + String newFlagVal = out.firstMatch(MANAGEABLE_PATTERN.replace("(\\S+)", flagName), 1); + + assertEquals(newFlagVal, flagVal); + } + + private void setImmutableFlag(CommandExecutor executor) { + OutputAnalyzer out = getAllFlags(executor); + String flagName = out.firstMatch(IMMUTABLE_PATTERN, 1); + String flagVal = out.firstMatch(IMMUTABLE_PATTERN, 2); + + System.out.println("### Setting an immutable flag '" + flagName + "'"); + + if (flagVal == null) { + System.err.println(out.getOutput()); + throw new Error("Can not find an immutable uintx flag"); + } + + Long numVal = Long.parseLong(flagVal); + + out = executor.execute("VM.set_flag " + flagName + " " + (numVal + 1)); + out.stderrShouldBeEmpty(); + out.stdoutShouldContain("only 'writeable' flags can be set"); + + out = getAllFlags(executor); + + String newFlagVal = out.firstMatch(IMMUTABLE_PATTERN.replace("(\\S+)", flagName), 1); + + assertEquals(newFlagVal, flagVal); + } + + private void setNonExistingFlag(CommandExecutor executor) { + String unknownFlag = "ThisIsUnknownFlag"; + System.out.println("### Setting a non-existing flag '" + unknownFlag + "'"); + OutputAnalyzer out = executor.execute("VM.set_flag " + unknownFlag + " 1"); + out.stderrShouldBeEmpty(); + out.stdoutShouldContain("flag " + unknownFlag + " does not exist"); + } + + private OutputAnalyzer getAllFlags(CommandExecutor executor) { + return executor.execute("VM.flags -all", true); + } +} \ No newline at end of file diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java b/hotspot/test/serviceability/hprof/cpu002.java similarity index 53% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java rename to hotspot/test/serviceability/hprof/cpu002.java index 1535ddaac48..765e6896a2a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SharedHeap.java +++ b/hotspot/test/serviceability/hprof/cpu002.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * 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,40 +19,28 @@ * Please 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; +/* + * @test + * @bug 8076421 + * @summary Test of hprof option crashes Zero + * @compile cpu002.java + * @run main/othervm -Xrunhprof:cpu=times,file=cpu002.hprof.out cpu002 + */ import java.io.*; -import java.util.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.gc_interface.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; +public class cpu002 { + public static final int PASSED = 0; + public static final int FAILED = 2; + public static final int JCK_STATUS_BASE = 95; -public abstract class SharedHeap extends CollectedHeap { - private static VirtualConstructor ctor; + public static void main (String argv[]) { + System.exit(run(argv,System.out) + JCK_STATUS_BASE); + } - 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("SharedHeap"); - ctor = new VirtualConstructor(db); - } - - public SharedHeap(Address addr) { - super(addr); - } - - public CollectedHeapName kind() { - return CollectedHeapName.SHARED_HEAP; - } - } + public static int run(String argv[], PrintStream out) { + return PASSED; + } +} diff --git a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java index fd014e3c48b..1df7791e0e8 100644 --- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java +++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java @@ -30,7 +30,6 @@ * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @ignore 8044416 * @build com.oracle.java.testlibrary.* * @compile -encoding utf8 Test8028623.java * @run main Test8028623 diff --git a/hotspot/test/serviceability/threads/TestFalseDeadLock.java b/hotspot/test/serviceability/threads/TestFalseDeadLock.java index c2797c232b3..58e34a69452 100644 --- a/hotspot/test/serviceability/threads/TestFalseDeadLock.java +++ b/hotspot/test/serviceability/threads/TestFalseDeadLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.util.Random; /* * @test - * @ignore 8061157 * @bug 8016304 * @summary Make sure no deadlock is reported for this program which has no deadlocks. * @library /testlibrary diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java index d26702deffa..19a228b3df3 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java @@ -48,6 +48,10 @@ public class Platform { return vmName.endsWith(" Graal VM"); } + public static boolean isZero() { + return vmName.endsWith(" Zero VM"); + } + public static boolean isMinimal() { return vmName.endsWith(" Minimal VM"); } diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java index 874eedcf015..5d87d8f6b8a 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java @@ -139,6 +139,9 @@ public final class ProcessTools { args.add(javapath); Collections.addAll(args, getPlatformSpecificVMArgs()); + args.add("-cp"); + args.add(System.getProperty("java.class.path")); + if (addTestVmAndJavaOptions) { Collections.addAll(args, Utils.getTestJavaOpts()); } diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java index dd2d3b83cc9..26051317883 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java @@ -40,16 +40,34 @@ public abstract class CommandExecutor { * stderr, regardless of the specific executor used. */ public final OutputAnalyzer execute(String cmd) throws CommandExecutorException { - System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName()); + return execute(cmd, false); + } + + /** + * Execute a diagnostic command + * + * @param cmd The diagnostic command to execute + * @param silent Do not print the command output + * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command + * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the + * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in + * stderr, regardless of the specific executor used. + */ + public final OutputAnalyzer execute(String cmd, boolean silent) throws CommandExecutorException { + if (!silent) { + System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName()); + } + OutputAnalyzer oa = executeImpl(cmd); - System.out.println("---------------- stdout ----------------"); - System.out.println(oa.getStdout()); - System.out.println("---------------- stderr ----------------"); - System.out.println(oa.getStderr()); - System.out.println("----------------------------------------"); - System.out.println(); - + if (!silent) { + System.out.println("---------------- stdout ----------------"); + System.out.println(oa.getStdout()); + System.out.println("---------------- stderr ----------------"); + System.out.println(oa.getStderr()); + System.out.println("----------------------------------------"); + System.out.println(); + } return oa; } diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java index bf33c254f08..e0111a148e5 100644 --- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java @@ -48,7 +48,7 @@ public class TestMutuallyExclusivePlatformPredicates { ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64"), BITNESS("is32bit", "is64bit"), OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"), - VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), + VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero"), IGNORED("isEmbedded", "isDebugBuild", "shouldSAAttach", "canPtraceAttachLinux", "canAttachOSX", "isTieredSupported"); diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java index e2d15630c04..5826e4178b4 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,13 +21,13 @@ * questions. */ -import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Function; import sun.hotspot.WhiteBox; import sun.management.*; import com.sun.management.*; import com.oracle.java.testlibrary.*; +import java.lang.management.ManagementFactory; public final class VmFlagTest { public static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); @@ -96,7 +96,7 @@ public final class VmFlagTest { return asString(getValue()); } HotSpotDiagnosticMXBean diagnostic - = ManagementFactoryHelper.getDiagnosticMXBean(); + = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); VMOption tmp; try { tmp = diagnostic.getVMOption(flagName); diff --git a/jdk/.hgtags b/jdk/.hgtags index 07c91542bbc..e75d6a7b447 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -305,3 +305,4 @@ c76339e86ea7da5d9ac7856f3fae9ef73eef04a2 jdk9-b57 84c5527f742bc64562e47d3149c16197fe1c4c1a jdk9-b60 da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61 49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62 +fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63 diff --git a/jdk/make/Import.gmk b/jdk/make/Import.gmk index 9e743349437..ffe2869897f 100644 --- a/jdk/make/Import.gmk +++ b/jdk/make/Import.gmk @@ -32,11 +32,11 @@ include MakeBase.gmk # Put the libraries here. Different locations for different target OS types. ifneq ($(OPENJDK_TARGET_OS), windows) - HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR) + HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR) BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR) SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent$(OPENJDK_TARGET_CPU_LIBDIR) else - HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/bin + HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/bin BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent endif @@ -80,11 +80,11 @@ SA_TARGETS := $(COPY_HOTSPOT_SA) ################################################################################ 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) ) + JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \ + $(wildcard $(HOTSPOT_DIST)/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) ) + JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \ + $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) ) endif ifneq ($(OPENJDK_TARGET_OS), windows) diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION index ebd4db73b0e..19d5533385c 100644 --- a/jdk/make/data/tzdata/VERSION +++ b/jdk/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015b +tzdata2015d diff --git a/jdk/make/data/tzdata/africa b/jdk/make/data/tzdata/africa index 43103225577..6099a70f5e6 100644 --- a/jdk/make/data/tzdata/africa +++ b/jdk/make/data/tzdata/africa @@ -342,35 +342,29 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 - # above) says DST had no affect on electricity consumption. There is # no information about when DST will end this fall. See: # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 + +# From Steffen Thorsen (2015-04-08): +# Egypt will start DST on midnight after Thursday, April 30, 2015. +# This is based on a law (no 35) from May 15, 2014 saying it starts the last +# Thursday of April.... Clocks will still be turned back for Ramadan, but +# dates not yet announced.... +# http://almogaz.com/news/weird-news/2015/04/05/1947105 ... +# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html + +# From Ahmed Nazmy (2015-04-20): +# Egypt's ministers cabinet just announced ... that it will cancel DST at +# least for 2015. # -# For now, guess that later spring and fall transitions will use -# 2010's rules, and guess that Egypt will switch to standard time at -# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the -# first Friday after Ramadan. To implement this, -# transition dates for 2015 through 2037 were determined by running -# the following program under GNU Emacs 24.3, with the results integrated -# by hand into the table below. Ramadan again intrudes on the guessed -# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff. -# (let ((islamic-year 1436)) -# (while (< islamic-year 1460) -# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (friday 5)) -# (while (/= friday (mod a 7)) -# (setq a (1- a))) -# (while (/= friday (mod b 7)) -# (setq b (1+ b))) -# (setq a (1- a)) -# (setq b (1- b)) -# (setq a (calendar-gregorian-from-absolute a)) -# (setq b (calendar-gregorian-from-absolute b)) -# (insert -# (format -# (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n" -# "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) -# (setq islamic-year (+ 1 islamic-year)))) +# From Tim Parenti (2015-04-20): +# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx +# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving +# time this summer, and carry out studies on the possibility of canceling the +# practice altogether in future years." +# +# From Paul Eggert (2015-04-20): +# For now, assume DST will be canceled. Any resumption would likely +# use different rules anyway. + Rule Egypt 2008 only - Aug lastThu 24:00 0 - Rule Egypt 2009 only - Aug 20 24:00 0 - Rule Egypt 2010 only - Aug 10 24:00 0 - @@ -379,22 +373,7 @@ Rule Egypt 2010 only - Sep lastThu 24:00 0 - Rule Egypt 2014 only - May 15 24:00 1:00 S Rule Egypt 2014 only - Jun 26 24:00 0 - Rule Egypt 2014 only - Jul 31 24:00 1:00 S -Rule Egypt 2014 max - Sep lastThu 24:00 0 - -Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S -Rule Egypt 2015 only - Jun 11 24:00 0 - -Rule Egypt 2015 only - Jul 23 24:00 1:00 S -Rule Egypt 2016 only - Jun 2 24:00 0 - -Rule Egypt 2016 only - Jul 7 24:00 1:00 S -Rule Egypt 2017 only - May 25 24:00 0 - -Rule Egypt 2017 only - Jun 29 24:00 1:00 S -Rule Egypt 2018 only - May 10 24:00 0 - -Rule Egypt 2018 only - Jun 14 24:00 1:00 S -Rule Egypt 2019 only - May 2 24:00 0 - -Rule Egypt 2019 only - Jun 6 24:00 1:00 S -Rule Egypt 2020 only - May 28 24:00 1:00 S -Rule Egypt 2021 only - May 13 24:00 1:00 S -Rule Egypt 2022 only - May 5 24:00 1:00 S -Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S +Rule Egypt 2014 only - Sep lastThu 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:09 - LMT 1900 Oct diff --git a/jdk/make/data/tzdata/antarctica b/jdk/make/data/tzdata/antarctica index 1f3e4347b21..102b496341d 100644 --- a/jdk/make/data/tzdata/antarctica +++ b/jdk/make/data/tzdata/antarctica @@ -38,41 +38,6 @@ # I made up all time zone abbreviations mentioned here; corrections welcome! # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited. -# 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 -Rule ArgAQ 1967 only - Apr 2 0:00 0 - -Rule ArgAQ 1967 1968 - Oct Sun>=1 0:00 1:00 S -Rule ArgAQ 1968 1969 - Apr Sun>=1 0:00 0 - -Rule ArgAQ 1974 only - Jan 23 0:00 1:00 S -Rule ArgAQ 1974 only - May 1 0:00 0 - -Rule ChileAQ 1972 1986 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1974 1987 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1987 only - Apr 12 3:00u 0 - -Rule ChileAQ 1988 1989 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1988 only - Oct Sun>=1 4:00u 1:00 S -Rule ChileAQ 1989 only - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1990 only - Mar 18 3:00u 0 - -Rule ChileAQ 1990 only - Sep 16 4:00u 1:00 S -Rule ChileAQ 1991 1996 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1991 1997 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1997 only - Mar 30 3:00u 0 - -Rule ChileAQ 1998 only - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1998 only - Sep 27 4:00u 1:00 S -Rule ChileAQ 1999 only - Apr 4 3:00u 0 - -Rule ChileAQ 1999 2010 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 2000 2007 - Mar Sun>=9 3:00u 0 - -# N.B.: the end of March 29 in Chile is March 30 in Universal time, -# which is used below in specifying the transition. -Rule ChileAQ 2008 only - Mar 30 3:00u 0 - -Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - -Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - -Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01 @@ -367,21 +332,7 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec 1 # USA - year-round bases # # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968) -# -# From Ethan Dicks (1996-10-06): -# It keeps the same time as Punta Arenas, Chile, because, just like us -# and the South Pole, that's the other end of their supply line.... -# I verified with someone who was there that since 1980, -# Palmer has followed Chile. Prior to that, before the Falklands War, -# Palmer used to be supplied from Argentina. -# -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 - -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u - -3:00 - CLT -# +# See 'southamerica' for Antarctica/Palmer, since it uses South American DST. # # McMurdo Station, Ross Island, since 1955-12 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20 diff --git a/jdk/make/data/tzdata/backward b/jdk/make/data/tzdata/backward index 95266a6f16c..3c845cfc01c 100644 --- a/jdk/make/data/tzdata/backward +++ b/jdk/make/data/tzdata/backward @@ -43,6 +43,7 @@ Link America/Argentina/Jujuy America/Jujuy Link America/Indiana/Knox America/Knox_IN Link America/Kentucky/Louisville America/Louisville Link America/Argentina/Mendoza America/Mendoza +Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario Link America/Denver America/Shiprock diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe index 008268ac763..7cee9a81527 100644 --- a/jdk/make/data/tzdata/europe +++ b/jdk/make/data/tzdata/europe @@ -99,7 +99,7 @@ # 1:00:14 SET Swedish (1879-1899)* # 2:00 EET EEST Eastern Europe # 3:00 FET Further-eastern Europe (2011-2014)* -# 3:00 MSK MSD MSM* Moscow +# 3:00 MSK MSD MSM* Minsk, Moscow # From Peter Ilieve (1994-12-04), # The original six [EU members]: Belgium, France, (West) Germany, Italy, diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica index 442a50eef0f..810cd93ade6 100644 --- a/jdk/make/data/tzdata/northamerica +++ b/jdk/make/data/tzdata/northamerica @@ -250,9 +250,14 @@ Zone PST8PDT -8:00 US P%sT # The law doesn't give abbreviations. # # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow: -# Public law 106-564 (2000-12-23) introduced the abbreviation -# "Chamorro Standard Time" for time in Guam and the Northern Marianas. -# See the file "australasia". +# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time" +# for time in Guam and the Northern Marianas. See the file "australasia". +# +# From Paul Eggert (2015-04-17): +# HST and HDT are standardized abbreviations for Hawaii-Aleutian +# standard and daylight times. See section 9.47 (p 234) of the +# U.S. Government Printing Office Style Manual (2008) +# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf # From Arthur David Olson, 2005-08-09 # The following was signed into law on 2005-08-08. @@ -559,7 +564,7 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18 -11:00 - BST 1969 -11:00 US B%sT 1983 Oct 30 2:00 -10:00 US AH%sT 1983 Nov 30 - -10:00 US HA%sT + -10:00 US H%sT # The following switches don't quite make our 1970 cutoff. # # Shanks writes that part of southwest Alaska (e.g. Aniak) @@ -1354,14 +1359,9 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Quebec -# 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 (2015-03-24): +# See America/Toronto for most of Quebec, including Montreal. +# # 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. @@ -1375,39 +1375,10 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # For lack of better info, guess this practice began around 1970, contra to # Shanks & Pottenger who have this region observing AST/ADT. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Mont 1917 only - Mar 25 2:00 1:00 D -Rule Mont 1917 only - Apr 24 0:00 0 S -Rule Mont 1919 only - Mar 31 2:30 1:00 D -Rule Mont 1919 only - Oct 25 2:30 0 S -Rule Mont 1920 only - May 2 2:30 1:00 D -Rule Mont 1920 1922 - Oct Sun>=1 2:30 0 S -Rule Mont 1921 only - May 1 2:00 1:00 D -Rule Mont 1922 only - Apr 30 2:00 1:00 D -Rule Mont 1924 only - May 17 2:00 1:00 D -Rule Mont 1924 1926 - Sep lastSun 2:30 0 S -Rule Mont 1925 1926 - May Sun>=1 2:00 1:00 D -Rule Mont 1927 1937 - Apr lastSat 24:00 1:00 D -Rule Mont 1927 1937 - Sep lastSat 24:00 0 S -Rule Mont 1938 1940 - Apr lastSun 0:00 1:00 D -Rule Mont 1938 1939 - Sep lastSun 0:00 0 S -Rule Mont 1946 1973 - Apr lastSun 2:00 1:00 D -Rule Mont 1945 1948 - Sep lastSun 2:00 0 S -Rule Mont 1949 1950 - Oct lastSun 2:00 0 S -Rule Mont 1951 1956 - Sep lastSun 2:00 0 S -Rule Mont 1957 1973 - Oct lastSun 2:00 0 S - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Blanc-Sablon -3:48:28 - LMT 1884 -4:00 Canada A%sT 1970 -4:00 - AST -Zone America/Montreal -4:54:16 - LMT 1884 - -5:00 Mont E%sT 1918 - -5:00 Canada E%sT 1919 - -5:00 Mont E%sT 1942 Feb 9 2:00s - -5:00 Canada E%sT 1946 - -5:00 Mont E%sT 1974 - -5:00 Canada E%sT # Ontario @@ -1898,17 +1869,115 @@ Zone America/Creston -7:46:04 - LMT 1884 # Dawson switched to PST in 1973. Inuvik switched to MST in 1979. # Mathew Englander (1996-10-07) gives the following refs: # * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68, -# c. 7 defines Yukon standard time as UTC-9. This is still valid; +# c. 7 defines Yukon standard time as UTC-9.... # see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1). +# [http://canlii.ca/t/7vhg] # * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00. # * O.I.C. 1980/02 established DST. # * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00. -# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go -# with Englander. -# From Chris Walton (2006-06-26): -# Here is a link to the old daylight saving portion of the interpretation -# act which was last updated in 1987: -# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf + +# From Brian Inglis (2015-04-14): +# +# I tried to trace the history of Yukon time and found the following +# regulations, giving the reference title and URL if found, regulation name, +# and relevant quote if available. Each regulation specifically revokes its +# predecessor. The final reference is to the current Interpretation Act +# authorizing and resulting from these regulatory changes. +# +# Only recent regulations were retrievable via Yukon government site search or +# index, and only some via Canadian legal sources. Other sources used include +# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS +# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and +# 1970 quoted below; each article includes current extracts from provincial +# and territorial ST and DST regulations at the end, summaries and details of +# standard times and daylight saving time at many locations across Canada, +# with time zone maps, tables and calculations for Canadian Sunrise, Sunset, +# and LMST; they also cover many countries and global locations, with a chart +# and table showing current Universal Time offsets, and may be useful as +# another source of information for 1970 and earlier. +# +# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26, +# pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS) +# http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75: +# Yukon Interpretation Ordinance +# Yukon standard time is the local mean time at the one hundred and +# thirty-fifth meridian. +# +# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.; +# JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System +# (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1: +# Yukon Interpretation Ordinance, 1955, Chap. 16. +# +# (1) Subject to this section, standard time shall be reckoned as nine +# hours behind Greenwich Time and called Yukon Standard Time. +# +# (2) Notwithstanding subsection (1), the Commissioner may make regulations +# varying the manner of reckoning standard time. +# +# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance +# http://? - no online source found +# +# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC, +# Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS) +# http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon +# Territory Commissioner's Order 1967-59 Interpretation Ordinance ... +# +# 1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon +# Territory on 27th January, 1966, is hereby revoked. +# +# 2. Yukon (East) Standard Time as defined by section 36 of the +# Interpretation Ordinance from and after mid-night on the 28th day of May, +# 1967 shall be reckoned in the same manner as Pacific Standard Time, that +# is to say, eight hours behind Greenwich Time in the area of the Yukon +# Territory lying east of the 138th degree longitude west. +# +# 3. In the remainder of the Territory, lying west of the 138th degree +# longitude west, Yukon (West) Standard Time shall be reckoned as nine +# hours behind Greenwich Time. +# +# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214 +# http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html +# C.O. 1973/214 INTERPRETATION ACT ... +# +# 1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby +# revoked. +# +# 2. Yukon Standard Time as defined by section 36 of the Interpretation +# Act from and after midnight on the twenty-eighth day of October, 1973 +# shall be reckoned in the same manner as Pacific Standard Time, that is +# to say eight hours behind Greenwich Time. +# +# * O.I.C. 1980/02 INTERPRETATION ACT +# http://? - no online source found +# +# * Yukon Daylight Saving Time, YOIC 1987/56 +# http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html +# O.I.C. 1987/056 INTERPRETATION ACT ... +# +# In every year between +# (a) two o'clock in the morning in the first Sunday in April, and +# (b) two o'clock in the morning in the last Sunday in October, +# Standard Time shall be reckoned as seven hours behind Greenwich Time and +# called Yukon Daylight Saving Time. +# ... +# Dated ... 9th day of March, A.D., 1987. +# +# * Yukon Daylight Saving Time 2006, YOIC 2006/127 +# http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html +# O.I.C. 2006/127 INTERPRETATION ACT ... +# +# 1. In Yukon each year the time for general purposes shall be 7 hours +# behind Greenwich mean time during the period commencing at two o'clock +# in the forenoon on the second Sunday of March and ending at two o'clock +# in the forenoon on the first Sunday of November and shall be called +# Yukon Daylight Saving Time. +# +# 2. Order-in-Council 1987/56 is revoked. +# +# 3. This order comes into force January 1, 2007. +# +# * Interpretation Act, RSY 2002, c 125 +# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html # From Rives McDow (1999-09-04): # Nunavut ... moved ... to incorporate the whole territory into one time zone. @@ -2134,7 +2203,7 @@ Zone America/Inuvik 0 - zzz 1953 # Inuvik founded -7:00 NT_YK M%sT 1980 -7:00 Canada M%sT Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1966 Jul 1 2:00 + -9:00 NT_YK Y%sT 1967 May 28 0:00 -8:00 NT_YK P%sT 1980 -8:00 Canada P%sT Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica index 238ae3dc569..375c2d2fa9d 100644 --- a/jdk/make/data/tzdata/southamerica +++ b/jdk/make/data/tzdata/southamerica @@ -1121,6 +1121,60 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # Chile +# From Paul Eggert (2015-04-03): +# Shanks & Pottenger says America/Santiago introduced standard time in +# 1890 and rounds its UTC offset to 70W40; guess that in practice this +# was the same offset as in 1916-1919. It also says Pacific/Easter +# standardized on 109W22 in 1890; assume this didn't change the clocks. +# +# Dates for America/Santiago from 1910 to 2004 are primarily from +# the following source, cited by Oscar van Vlijmen (2006-10-08): +# [1] Chile Law +# http://www.webexhibits.org/daylightsaving/chile.html +# This contains a copy of a this official table: +# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30) +# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm +# [1] needs several corrections, though. +# +# The first set of corrections is from: +# [2] History of the Official Time of Chile +# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06). See: +# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html +# This is an English translation of: +# Historia de la hora oficial de Chile (retrieved 2012-10-24). See: +# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm +# A fancier Spanish version (requiring mouse-clicking) is at: +# http://www.horaoficial.cl/historia_hora.html +# Conflicts between [1] and [2] were resolved as follows: +# +# - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites +# Boletín Nº 1, Aviso Nº 1 (1910). Go with [2]. +# +# - [1] says SMT was -4:42:45, [2] says Chile's official time from +# 1916 to 1919 was -4:42:46.3, the meridian of Chile's National +# Astronomical Observatory (OAN), then located in what is now +# Quinta Normal in Santiago. Go with [2], rounding it to -4:42:46. +# +# - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites +# Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23). Go with [2]. +# +# - [1] does not give times for transitions; assume they occur +# at midnight mainland time, the current common practice. However, +# go with [2]'s specification of 23:00 for the 1947-05-21 transition. +# +# Another correction to [1] is from Jesper Nørgaard Welen, who +# wrote (2006-10-08), "I think that there are some obvious mistakes in +# the suggested link from Oscar van Vlijmen,... for instance entry 66 +# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at +# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16 +# respectively), but anyhow it clears up some doubts too." +# +# Data for Pacific/Easter from 1910 through 1967 come from Shanks & +# Pottenger. After that, for lack of better info assume +# Pacific/Easter is always two hours behind America/Santiago; +# this is known to work for DST transitions starting in 2008 and +# may well be true for earlier transitions. + # From Eduardo Krell (1995-10-19): # The law says to switch to DST at midnight [24:00] on the second SATURDAY # of October.... The law is the same for March and October. @@ -1133,78 +1187,35 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # Because of the same drought, the government decided to end DST later, # on April 3, (one-time change). -# From Oscar van Vlijmen (2006-10-08): -# http://www.horaoficial.cl/cambio.htm - -# From Jesper Nørgaard Welen (2006-10-08): -# I think that there are some obvious mistakes in the suggested link -# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4 -# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15 -# (they should have been 1990-09-15 and 1990-09-16 respectively), but -# anyhow it clears up some doubts too. - -# From Paul Eggert (2014-08-12): -# The following data entries for Chile and America/Santiago are from -# (2006-09-20), transcribed by -# Jesper Nørgaard Welen. The data entries for Pacific/Easter are from Shanks -# & Pottenger, except with DST transitions after 1932 cloned from -# America/Santiago. The pre-1980 Pacific/Easter data entries are dubious, -# but we have no other source. - # From Germán Poo-Caamaño (2008-03-03): # Due to drought, Chile extends Daylight Time in three weeks. This # is one-time change (Saturday 3/29 at 24:00 for America/Santiago # and Saturday 3/29 at 22:00 for Pacific/Easter) # The Supreme Decree is located at # http://www.shoa.cl/servicios/supremo316.pdf -# and the instructions for 2008 are located in: -# http://www.horaoficial.cl/cambio.htm - +# # From José Miguel Garrido (2008-03-05): -# ... -# You could see the announces of the change on # http://www.shoa.cl/noticias/2008/04hora/hora.htm # From Angel Chiang (2010-03-04): # Subject: DST in Chile exceptionally extended to 3 April due to earthquake # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098 -# (in Spanish, last paragraph). # -# This is breaking news. There should be more information available later. - # From Arthur David Olson (2010-03-06): # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch. -# From Glenn Eychaner (2011-03-02): -# It appears that the Chilean government has decided to postpone the -# change from summer time to winter time again, by three weeks to April -# 2nd: -# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651 -# -# This is not yet reflected in the official "cambio de hora" site, but -# probably will be soon: -# http://www.horaoficial.cl/cambio.htm - -# From Arthur David Olson (2011-03-02): -# The emol.com article mentions a water shortage as the cause of the -# postponement, which may mean that it's not a permanent change. - # From Glenn Eychaner (2011-03-28): -# The article: # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E} -# # In English: # Chile's clocks will go back an hour this year on the 7th of May instead # of this Saturday. They will go forward again the 3rd Saturday in -# August, not in October as they have since 1968. This is a pilot plan -# which will be reevaluated in 2012. +# August, not in October as they have since 1968. # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23): # As stated in the website of the Chilean Energy Ministry # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html # The Chilean Government has decided to postpone the entrance into winter time -# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not -# been yet formalized but it will within the next days. +# (to leave DST) from March 11 2012 to April 28th 2012.... # Quote from the website communication: # # 6. For the year 2012, the dates of entry into winter time will be as follows: @@ -1237,17 +1248,9 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # From Paul Eggert (2015-03-03): # For now, assume that the extension will persist indefinitely. -# NOTE: ChileAQ rules for Antarctic bases are stored separately in the -# 'antarctica' file. - # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Chile 1927 1932 - Sep 1 0:00 1:00 S +Rule Chile 1927 1931 - Sep 1 0:00 1:00 S Rule Chile 1928 1932 - Apr 1 0:00 0 - -Rule Chile 1942 only - Jun 1 4:00u 0 - -Rule Chile 1942 only - Aug 1 5:00u 1:00 S -Rule Chile 1946 only - Jul 15 4:00u 1:00 S -Rule Chile 1946 only - Sep 1 3:00u 0:00 - -Rule Chile 1947 only - Apr 1 4:00u 0 - Rule Chile 1968 only - Nov 3 4:00u 1:00 S Rule Chile 1969 only - Mar 30 3:00u 0 - Rule Chile 1969 only - Nov 23 4:00u 1:00 S @@ -1258,10 +1261,8 @@ Rule Chile 1972 1986 - Mar Sun>=9 3:00u 0 - Rule Chile 1973 only - Sep 30 4:00u 1:00 S Rule Chile 1974 1987 - Oct Sun>=9 4:00u 1:00 S Rule Chile 1987 only - Apr 12 3:00u 0 - -Rule Chile 1988 1989 - Mar Sun>=9 3:00u 0 - -Rule Chile 1988 only - Oct Sun>=1 4:00u 1:00 S -Rule Chile 1989 only - Oct Sun>=9 4:00u 1:00 S -Rule Chile 1990 only - Mar 18 3:00u 0 - +Rule Chile 1988 1990 - Mar Sun>=9 3:00u 0 - +Rule Chile 1988 1989 - Oct Sun>=9 4:00u 1:00 S Rule Chile 1990 only - Sep 16 4:00u 1:00 S Rule Chile 1991 1996 - Mar Sun>=9 3:00u 0 - Rule Chile 1991 1997 - Oct Sun>=9 4:00u 1:00 S @@ -1284,15 +1285,21 @@ Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Santiago -4:42:46 - LMT 1890 - -4:42:46 - SMT 1910 # Santiago Mean Time + -4:42:46 - SMT 1910 Jan 10 # Santiago Mean Time -5:00 - CLT 1916 Jul 1 # Chile Time - -4:42:46 - SMT 1918 Sep 1 # Santiago Mean Time - -4:00 - CLT 1919 Jul 1 # Chile Time - -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time - -5:00 Chile CL%sT 1947 May 22 # Chile Time + -4:42:46 - SMT 1918 Sep 10 + -4:00 - CLT 1919 Jul 1 + -4:42:46 - SMT 1927 Sep 1 + -5:00 Chile CL%sT 1932 Sep 1 + -4:00 - CLT 1942 Jun 1 + -5:00 - CLT 1942 Aug 1 + -4:00 - CLT 1946 Jul 15 + -4:00 1:00 CLST 1946 Sep 1 # central Chile + -4:00 - CLT 1947 Apr 1 + -5:00 - CLT 1947 May 21 23:00 -4:00 Chile CL%sT 2015 Apr 26 3:00u -3:00 - CLT -Zone Pacific/Easter -7:17:44 - LMT 1890 +Zone Pacific/Easter -7:17:28 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time -7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time -6:00 Chile EAS%sT 2015 Apr 26 3:00u @@ -1302,6 +1309,25 @@ Zone Pacific/Easter -7:17:44 - LMT 1890 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, # and Antarctic bases, are like America/Santiago. +# Antarctic base using South American rules +# (See the file 'antarctica' for more.) +# +# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968) +# +# From Ethan Dicks (1996-10-06): +# It keeps the same time as Punta Arenas, Chile, because, just like us +# and the South Pole, that's the other end of their supply line.... +# I verified with someone who was there that since 1980, +# Palmer has followed Chile. Prior to that, before the Falklands War, +# Palmer used to be supplied from Argentina. +# +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Antarctica/Palmer 0 - zzz 1965 + -4:00 Arg AR%sT 1969 Oct 5 + -3:00 Arg AR%sT 1982 May + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT + # Colombia # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest. He writes, diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index 254f446a000..f0847a60e4b 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -827,7 +827,7 @@ ifndef BUILD_HEADLESS_ONLY LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.desktop/macosx/native/libsplashscreen endif - LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE \ + LIBSPLASHSCREEN_CFLAGS += -DSPLASHSCREEN -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \ $(addprefix -I, $(LIBSPLASHSCREEN_DIRS)) \ $(LIBJAVA_HEADER_FLAGS) \ # diff --git a/jdk/make/lib/Lib-java.instrument.gmk b/jdk/make/lib/Lib-java.instrument.gmk index 5b668c87872..b0eb7e858db 100644 --- a/jdk/make/lib/Lib-java.instrument.gmk +++ b/jdk/make/lib/Lib-java.instrument.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # 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,9 @@ include LibCommon.gmk +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.instrument.gmk)) + ################################################################################ LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/java.instrument/share/native/libinstrument \ diff --git a/jdk/make/lib/Lib-java.management.gmk b/jdk/make/lib/Lib-java.management.gmk index 29d5c081665..b0062445341 100644 --- a/jdk/make/lib/Lib-java.management.gmk +++ b/jdk/make/lib/Lib-java.management.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # 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,33 +30,14 @@ $(eval $(call IncludeCustomExtension, jdk, lib/Lib-java.management.gmk)) ################################################################################ -BUILD_LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \ +LIBMANAGEMENT_SRC += $(JDK_TOPDIR)/src/java.management/share/native/libmanagement \ $(JDK_TOPDIR)/src/java.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement -BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \ - $(addprefix -I,$(BUILD_LIBMANAGEMENT_SRC)) \ +LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \ + $(addprefix -I,$(LIBMANAGEMENT_SRC)) \ -I$(SUPPORT_OUTPUTDIR)/headers/java.management \ $(LIBJAVA_HEADER_FLAGS) \ # -# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate -# a binary that is compatible with windows versions older than 7/2008R2. -# See MSDN documentation for GetProcessMemoryInfo for more information. -BUILD_LIBMANAGEMENT_CFLAGS += -DPSAPI_VERSION=1 - -BUILD_LIBMANAGEMENT_EXCLUDES := - -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) @@ -64,17 +45,13 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) endif endif -# Make it possible to override this variable -LIBMANAGEMENT_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers - $(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \ LIBRARY := management, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ - SRC := $(BUILD_LIBMANAGEMENT_SRC), \ - EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \ + SRC := $(LIBMANAGEMENT_SRC), \ OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ - CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \ - MAPFILE := $(LIBMANAGEMENT_MAPFILE), \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(LIBMANAGEMENT_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_solaris := -lkstat, \ diff --git a/jdk/make/lib/Lib-jdk.hprof.agent.gmk b/jdk/make/lib/Lib-jdk.hprof.agent.gmk index 7c43331b33c..7f01e04790c 100644 --- a/jdk/make/lib/Lib-jdk.hprof.agent.gmk +++ b/jdk/make/lib/Lib-jdk.hprof.agent.gmk @@ -49,6 +49,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \ CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ $(BUILD_LIBHPROF_CFLAGS), \ CFLAGS_debug := -DHPROF_LOGGING, \ + CFLAGS_windows := -D_WINSOCK_DEPRECATED_NO_WARNINGS, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/Lib-jdk.management.gmk b/jdk/make/lib/Lib-jdk.management.gmk new file mode 100644 index 00000000000..bd07d478f5b --- /dev/null +++ b/jdk/make/lib/Lib-jdk.management.gmk @@ -0,0 +1,80 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# 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 LibCommon.gmk + +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, jdk, lib/Lib-jdk.management.gmk)) + +################################################################################ + +LIBMANAGEMENT_EXT_SRC += $(JDK_TOPDIR)/src/jdk.management/share/native/libmanagement_ext \ + $(JDK_TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS_TYPE)/native/libmanagement_ext \ + $(JDK_TOPDIR)/src/jdk.management/$(OPENJDK_TARGET_OS)/native/libmanagement_ext +LIBMANAGEMENT_EXT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/include \ + $(addprefix -I,$(LIBMANAGEMENT_EXT_SRC)) \ + -I$(SUPPORT_OUTPUTDIR)/headers/jdk.management \ + $(LIBJAVA_HEADER_FLAGS) \ + # + +# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate +# a binary that is compatible with windows versions older than 7/2008R2. +# See MSDN documentation for GetProcessMemoryInfo for more information. +BUILD_LIBMANAGEMENT_EXT_CFLAGS += -DPSAPI_VERSION=1 + +LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) + ifeq ($(ENABLE_DEBUG_SYMBOLS), true) + LIBMANAGEMENT_EXT_OPTIMIZATION := LOW + endif +endif + +$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT_EXT, \ + LIBRARY := management_ext, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ + SRC := $(LIBMANAGEMENT_EXT_SRC), \ + LANG := C, \ + OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(LIBMANAGEMENT_EXT_CFLAGS), \ + MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement_ext/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, \ + LDFLAGS_SUFFIX_aix := -lperfstat,\ + VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ + RC_FLAGS := $(RC_FLAGS) \ + -D "JDK_FNAME=management_ext.dll" \ + -D "JDK_INTERNAL_NAME=management_ext" \ + -D "JDK_FTYPE=0x2L", \ + OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement_ext, \ + DEBUG_SYMBOLS := true)) + +$(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java) + +TARGETS += $(BUILD_LIBMANAGEMENT_EXT) + +################################################################################ diff --git a/jdk/make/mapfiles/libmanagement/mapfile-vers b/jdk/make/mapfiles/libmanagement/mapfile-vers index a4cb163806a..228ef93abb6 100644 --- a/jdk/make/mapfiles/libmanagement/mapfile-vers +++ b/jdk/make/mapfiles/libmanagement/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # 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,10 @@ SUNWprivate_1.1 { global: - Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0; - Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0; - Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize0; - Java_sun_management_OperatingSystemImpl_getMaxFileDescriptorCount0; - Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount0; - Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0; - Java_sun_management_OperatingSystemImpl_getProcessCpuTime0; - Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0; - Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize0; - Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize0; - Java_sun_management_OperatingSystemImpl_initialize0; Java_sun_management_ClassLoadingImpl_setVerboseClass; - Java_sun_management_DiagnosticCommandImpl_executeDiagnosticCommand; - Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommands; - Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo; - Java_sun_management_DiagnosticCommandImpl_setNotificationEnabled; - Java_sun_management_FileSystemImpl_isAccessUserOnly0; - Java_sun_management_Flag_getAllFlagNames; - Java_sun_management_Flag_getFlags; - Java_sun_management_Flag_getInternalFlagCount; - Java_sun_management_Flag_initialize; - Java_sun_management_Flag_setLongValue; - Java_sun_management_Flag_setBooleanValue; - Java_sun_management_Flag_setStringValue; - Java_sun_management_GarbageCollectorImpl_getCollectionCount; + Java_sun_management_FileSystemImpl_isAccessUserOnly0; + Java_sun_management_GarbageCollectorImpl_getCollectionCount; Java_sun_management_GarbageCollectorImpl_getCollectionTime; - Java_sun_management_GarbageCollectorImpl_setNotificationEnabled; - Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; - Java_sun_management_GcInfoBuilder_getLastGcInfo0; - Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - 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/mapfiles/libmanagement_ext/mapfile-vers b/jdk/make/mapfiles/libmanagement_ext/mapfile-vers new file mode 100644 index 00000000000..b8397bf9c1b --- /dev/null +++ b/jdk/make/mapfiles/libmanagement_ext/mapfile-vers @@ -0,0 +1,60 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# 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. +# + +# Define library interface. + +SUNWprivate_1.1 { + global: + Java_com_sun_management_internal_OperatingSystemImpl_getCommittedVirtualMemorySize0; + Java_com_sun_management_internal_OperatingSystemImpl_getFreePhysicalMemorySize0; + Java_com_sun_management_internal_OperatingSystemImpl_getFreeSwapSpaceSize0; + Java_com_sun_management_internal_OperatingSystemImpl_getMaxFileDescriptorCount0; + Java_com_sun_management_internal_OperatingSystemImpl_getOpenFileDescriptorCount0; + Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0; + Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuTime0; + Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0; + Java_com_sun_management_internal_OperatingSystemImpl_getTotalPhysicalMemorySize0; + Java_com_sun_management_internal_OperatingSystemImpl_getTotalSwapSpaceSize0; + Java_com_sun_management_internal_OperatingSystemImpl_initialize0; + Java_com_sun_management_internal_DiagnosticCommandImpl_executeDiagnosticCommand; + Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommands; + Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommandInfo; + Java_com_sun_management_internal_DiagnosticCommandImpl_setNotificationEnabled; + Java_com_sun_management_internal_Flag_getAllFlagNames; + Java_com_sun_management_internal_Flag_getFlags; + Java_com_sun_management_internal_Flag_getInternalFlagCount; + Java_com_sun_management_internal_Flag_initialize; + Java_com_sun_management_internal_Flag_setLongValue; + Java_com_sun_management_internal_Flag_setBooleanValue; + Java_com_sun_management_internal_Flag_setStringValue; + Java_com_sun_management_internal_GarbageCollectorExtImpl_setNotificationEnabled; + Java_com_sun_management_internal_GcInfoBuilder_fillGcAttributeInfo; + Java_com_sun_management_internal_GcInfoBuilder_getLastGcInfo0; + Java_com_sun_management_internal_GcInfoBuilder_getNumGcExtAttributes; + Java_com_sun_management_internal_HotSpotDiagnostic_dumpHeap0; + JNI_OnLoad; + local: + *; +}; diff --git a/jdk/make/src/classes/build/tools/module/boot.modules b/jdk/make/src/classes/build/tools/module/boot.modules index 2c32d09526f..eb0ac74d739 100644 --- a/jdk/make/src/classes/build/tools/module/boot.modules +++ b/jdk/make/src/classes/build/tools/module/boot.modules @@ -22,6 +22,7 @@ jdk.deploy.osx jdk.hprof.agent jdk.httpserver jdk.jfr +jdk.management jdk.management.cmm jdk.naming.rmi jdk.sctp diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java index d4cd740af7b..f8a3eaa0a4c 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java @@ -38,7 +38,17 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE; * under section 6.5. It needs to be constructed w/ an initialized * cipher object, and initial counter block(ICB). Given an input X * of arbitrary length, it processes and returns an output which has - * the same length as X. + * the same length as X. The invariants of this class are: + * + * (1) The length of intialCounterBlk (and also of its clones, e.g., + * fields counter and counterSave) is equal to AES_BLOCK_SIZE. + * + * (2) After construction, the field counter never becomes null, it + * always contains a byte array of length AES_BLOCK_SIZE. + * + * If any invariant is broken, failures can occur because the + * AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM + * (see JDK-8067648 for details). * *

      This function is used in the implementation of GCM mode. * @@ -59,6 +69,10 @@ final class GCTR { // NOTE: cipher should already be initialized GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) { this.aes = cipher; + if (initialCounterBlk.length != AES_BLOCK_SIZE) { + throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length + + ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")"); + } this.icb = initialCounterBlk; this.counter = icb.clone(); } @@ -137,6 +151,8 @@ final class GCTR { * Restores the content of this object to the previous saved one. */ void restore() { - this.counter = this.counterSave; + if (this.counterSave != null) { + this.counter = this.counterSave; + } } } diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index 9748cc6c804..3aefe6ee2fb 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -1312,7 +1312,7 @@ public final class Class implements java.io.Serializable, // e) Anonymous classes - // JVM Spec 4.8.6: A class must have an EnclosingMethod + // JVM Spec 4.7.7: A class must have an EnclosingMethod // attribute if and only if it is a local class or an // anonymous class. EnclosingMethodInfo enclosingInfo = getEnclosingMethodInfo(); @@ -1357,28 +1357,7 @@ public final class Class implements java.io.Serializable, simpleName = getName(); return simpleName.substring(simpleName.lastIndexOf('.')+1); // strip the package name } - // According to JLS3 "Binary Compatibility" (13.1) the binary - // name of non-package classes (not top level) is the binary - // name of the immediately enclosing class followed by a '$' followed by: - // (for nested and inner classes): the simple name. - // (for local classes): 1 or more digits followed by the simple name. - // (for anonymous classes): 1 or more digits. - - // Since getSimpleBinaryName() will strip the binary name of - // the immediately enclosing class, we are now looking at a - // string that matches the regular expression "\$[0-9]*" - // followed by a simple name (considering the simple of an - // anonymous class to be the empty string). - - // Remove leading "\$[0-9]*" from the name - int length = simpleName.length(); - if (length < 1 || simpleName.charAt(0) != '$') - throw new InternalError("Malformed class name"); - int index = 1; - while (index < length && isAsciiDigit(simpleName.charAt(index))) - index++; - // Eventually, this is the empty string iff this is an anonymous class - return simpleName.substring(index); + return simpleName; } /** @@ -1489,20 +1468,20 @@ public final class Class implements java.io.Serializable, Class enclosingClass = getEnclosingClass(); if (enclosingClass == null) // top level class return null; - // Otherwise, strip the enclosing class' name - try { - return getName().substring(enclosingClass.getName().length()); - } catch (IndexOutOfBoundsException ex) { - throw new InternalError("Malformed class name", ex); - } + String name = getSimpleBinaryName0(); + if (name == null) // anonymous class + return ""; + return name; } + private native String getSimpleBinaryName0(); + /** * Returns {@code true} if this is a local class or an anonymous * class. Returns {@code false} otherwise. */ private boolean isLocalOrAnonymousClass() { - // JVM Spec 4.8.6: A class must have an EnclosingMethod + // JVM Spec 4.7.7: A class must have an EnclosingMethod // attribute if and only if it is a local class or an // anonymous class. return getEnclosingMethodInfo() != null; diff --git a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java index 53fa3e5eaca..a2ce1e3d837 100644 --- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java +++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java @@ -333,6 +333,19 @@ import java.util.StringTokenizer; * "../../../technotes/guides/plugin/developer_guide/rsa_how.html#use"> * usePolicy Permission. * + * + * + * localeServiceProvider + * This {@code RuntimePermission} is required to be granted to + * classes which subclass and implement + * {@code java.util.spi.LocaleServiceProvider}. The permission is + * checked during invocation of the abstract base class constructor. + * This permission ensures trust in classes which implement this + * security-sensitive provider mechanism. + * See + * {@code java.util.spi.LocaleServiceProvider} for more + * information. + * * * * @see java.security.BasicPermission diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java index 10ac1c0716e..11e452b96c9 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java @@ -25,9 +25,10 @@ package java.lang.invoke; -import sun.invoke.empty.Empty; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; +import java.lang.reflect.Field; +import sun.misc.Cleaner; /** * A {@code CallSite} is a holder for a variable {@link MethodHandle}, @@ -135,6 +136,50 @@ public class CallSite { this.target = boundTarget; } + /** + * {@code CallSite} dependency context. + * VM uses context class to store nmethod dependencies on the call site target. + * Can be in 2 states: (a) null; or (b) {@code Cleaner} instance pointing to some Class instance. + * Lazily initialized when CallSite instance is linked to some indy call site or VM needs + * it to store dependencies. As a corollary, "null" context means there are no dependencies + * registered yet. {@code Cleaner} is used in 2 roles: + * (a) context class access for VM; + * (b) stale context class cleanup. + * {@code Cleaner} holds the context class until cleanup action is finished (see {@code PhantomReference}). + * Though it's impossible to get the context class using {@code Reference.get()}, VM extracts it directly + * from {@code Reference.referent} field. + */ + private volatile Cleaner context = null; + + /** + * Default context. + * VM uses it to initialize non-linked CallSite context. + */ + private static class DefaultContext {} + private static final Cleaner DEFAULT_CONTEXT = makeContext(DefaultContext.class, null); + + private static Cleaner makeContext(Class referent, final CallSite holder) { + return Cleaner.create(referent, + new Runnable() { + @Override public void run() { + MethodHandleNatives.invalidateDependentNMethods(holder); + } + }); + } + + /** Initialize context class used for nmethod dependency tracking */ + /*package-private*/ + void initContext(Class newContext) { + // If there are concurrent actions, exactly one succeeds. + if (context == null) { + UNSAFE.compareAndSwapObject(this, CONTEXT_OFFSET, /*expected=*/null, makeContext(newContext, this)); + // No need to care about failed CAS attempt. + // Since initContext is called from indy call site linkage in newContext class, there's no risk + // that the context class becomes dead while corresponding context cleaner is alive (causing cleanup + // action in the wrong context). + } + } + /** * Returns the type of this call site's target. * Although targets may change, any call site's type is permanent, and can never change to an unequal type. @@ -246,11 +291,13 @@ public class CallSite { } // unsafe stuff: - private static final long TARGET_OFFSET; + private static final long TARGET_OFFSET; + private static final long CONTEXT_OFFSET; static { try { - TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target")); - } catch (Exception ex) { throw new Error(ex); } + TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target")); + CONTEXT_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("context")); + } catch (Exception ex) { throw newInternalError(ex); } } /*package-private*/ diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java index 7cdb8c5e982..f02ed74aae5 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java @@ -691,10 +691,4 @@ class DirectMethodHandle extends MethodHandle { } } } - - @Override - void customize() { - assert(form.customized == null); - // No need to customize DMHs. - } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index b44f9adf62f..225b998efb3 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -847,11 +847,7 @@ class InvokerBytecodeGenerator { refKind = REF_invokeVirtual; } - if (member.getDeclaringClass().isInterface() && refKind == REF_invokeVirtual) { - // Methods from Object declared in an interface can be resolved by JVM to invokevirtual kind. - // Need to convert it back to invokeinterface to pass verification and make the invocation works as expected. - refKind = REF_invokeInterface; - } + assert(!(member.getDeclaringClass().isInterface() && refKind == REF_invokeVirtual)); // push arguments emitPushArguments(name); diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java index 43cf38f12bd..e674829338e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -281,7 +281,7 @@ class Invokers { outArgs[0] = names[CHECK_TYPE]; } if (CHECK_CUSTOM != -1) { - names[CHECK_CUSTOM] = new Name(NF_checkCustomized, names[CALL_MH]); + names[CHECK_CUSTOM] = new Name(NF_checkCustomized, outArgs[0]); } names[LINKER_CALL] = new Name(outCallType, outArgs); lform = new LambdaForm(debugName, INARG_LIMIT, names); @@ -394,6 +394,7 @@ class Invokers { @ForceInline void checkCustomized(Object o) { MethodHandle mh = (MethodHandle)o; + if (MethodHandleImpl.isCompileConstant(mh)) return; if (mh.form.customized == null) { maybeCustomize(mh); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index c138676a8fb..d1c1d6984f8 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -722,6 +722,13 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; return result; } + // Intrinsified by C2. Returns true if obj is a compile-time constant. + @LambdaForm.Hidden + static + boolean isCompileConstant(Object obj) { + return false; + } + static MethodHandle makeGuardWithTest(MethodHandle test, MethodHandle target, diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index 01c3b33001d..3d3c47f689c 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,121 +55,42 @@ class MethodHandleNatives { static native Object staticFieldBase(MemberName self); // e.g., returns clazz static native Object getMemberVMInfo(MemberName self); // returns {vmindex,vmtarget} - /// MethodHandle support - - /** Fetch MH-related JVM parameter. - * which=0 retrieves MethodHandlePushLimit - * which=1 retrieves stack slot push size (in address units) - */ - static native int getConstant(int which); - - static final boolean COUNT_GWT; - /// CallSite support /** Tell the JVM that we need to change the target of a CallSite. */ static native void setCallSiteTargetNormal(CallSite site, MethodHandle target); static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target); + /** Invalidate CallSite context: clean up dependent nmethods and reset call site context to initial state (null). */ + static native void invalidateDependentNMethods(CallSite site); + private static native void registerNatives(); static { registerNatives(); - COUNT_GWT = getConstant(Constants.GC_COUNT_GWT) != 0; // The JVM calls MethodHandleNatives.. Cascade the calls as needed: MethodHandleImpl.initStatics(); } - // All compile-time constants go here. - // There is an opportunity to check them against the JVM's idea of them. + /** + * Compile-time constants go here. This collection exists not only for + * reference from clients, but also for ensuring the VM and JDK agree on the + * values of these constants (see {@link #verifyConstants()}). + */ static class Constants { Constants() { } // static only - // MethodHandleImpl - static final int // for getConstant - GC_COUNT_GWT = 4, - GC_LAMBDA_SUPPORT = 5; - // MemberName - // The JVM uses values of -2 and above for vtable indexes. - // Field values are simple positive offsets. - // Ref: src/share/vm/oops/methodOop.hpp - // This value is negative enough to avoid such numbers, - // but not too negative. static final int - MN_IS_METHOD = 0x00010000, // method (not constructor) - MN_IS_CONSTRUCTOR = 0x00020000, // constructor - MN_IS_FIELD = 0x00040000, // field - MN_IS_TYPE = 0x00080000, // nested type - MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected - MN_REFERENCE_KIND_SHIFT = 24, // refKind - MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT, - // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers: - MN_SEARCH_SUPERCLASSES = 0x00100000, - MN_SEARCH_INTERFACES = 0x00200000; - - /** - * Basic types as encoded in the JVM. These code values are not - * intended for use outside this class. They are used as part of - * a private interface between the JVM and this class. - */ - static final int - T_BOOLEAN = 4, - T_CHAR = 5, - T_FLOAT = 6, - T_DOUBLE = 7, - T_BYTE = 8, - T_SHORT = 9, - T_INT = 10, - T_LONG = 11, - T_OBJECT = 12, - //T_ARRAY = 13 - T_VOID = 14, - //T_ADDRESS = 15 - T_ILLEGAL = 99; - - /** - * Constant pool entry types. - */ - static final byte - CONSTANT_Utf8 = 1, - CONSTANT_Integer = 3, - CONSTANT_Float = 4, - CONSTANT_Long = 5, - CONSTANT_Double = 6, - CONSTANT_Class = 7, - CONSTANT_String = 8, - CONSTANT_Fieldref = 9, - CONSTANT_Methodref = 10, - CONSTANT_InterfaceMethodref = 11, - CONSTANT_NameAndType = 12, - CONSTANT_MethodHandle = 15, // JSR 292 - CONSTANT_MethodType = 16, // JSR 292 - CONSTANT_InvokeDynamic = 18, - CONSTANT_LIMIT = 19; // Limit to tags found in classfiles - - /** - * Access modifier flags. - */ - static final char - ACC_PUBLIC = 0x0001, - ACC_PRIVATE = 0x0002, - ACC_PROTECTED = 0x0004, - ACC_STATIC = 0x0008, - ACC_FINAL = 0x0010, - ACC_SYNCHRONIZED = 0x0020, - ACC_VOLATILE = 0x0040, - ACC_TRANSIENT = 0x0080, - ACC_NATIVE = 0x0100, - ACC_INTERFACE = 0x0200, - ACC_ABSTRACT = 0x0400, - ACC_STRICT = 0x0800, - ACC_SYNTHETIC = 0x1000, - ACC_ANNOTATION = 0x2000, - ACC_ENUM = 0x4000, - // aliases: - ACC_SUPER = ACC_SYNCHRONIZED, - ACC_BRIDGE = ACC_VOLATILE, - ACC_VARARGS = ACC_TRANSIENT; + MN_IS_METHOD = 0x00010000, // method (not constructor) + MN_IS_CONSTRUCTOR = 0x00020000, // constructor + MN_IS_FIELD = 0x00040000, // field + MN_IS_TYPE = 0x00080000, // nested type + MN_CALLER_SENSITIVE = 0x00100000, // @CallerSensitive annotation detected + MN_REFERENCE_KIND_SHIFT = 24, // refKind + MN_REFERENCE_KIND_MASK = 0x0F000000 >> MN_REFERENCE_KIND_SHIFT, + // The SEARCH_* bits are not for MN.flags but for the matchFlags argument of MHN.getMembers: + MN_SEARCH_SUPERCLASSES = 0x00100000, + MN_SEARCH_INTERFACES = 0x00200000; /** * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries. @@ -314,6 +235,7 @@ class MethodHandleNatives { return Invokers.linkToTargetMethod(type); } else { appendixResult[0] = callSite; + callSite.initContext(caller); return Invokers.linkToCallSiteMethod(type); } } diff --git a/jdk/src/java.base/share/classes/java/nio/Bits.java b/jdk/src/java.base/share/classes/java/nio/Bits.java index c7f2b78422b..d23e35e82aa 100644 --- a/jdk/src/java.base/share/classes/java/nio/Bits.java +++ b/jdk/src/java.base/share/classes/java/nio/Bits.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -567,32 +567,13 @@ class Bits { // package-private // -- Processor and memory-system properties -- - private static final ByteOrder byteOrder; + private static final ByteOrder byteOrder + = unsafe.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; static ByteOrder byteOrder() { - if (byteOrder == null) - throw new Error("Unknown byte order"); return byteOrder; } - static { - long a = unsafe.allocateMemory(8); - try { - unsafe.putLong(a, 0x0102030405060708L); - byte b = unsafe.getByte(a); - switch (b) { - case 0x01: byteOrder = ByteOrder.BIG_ENDIAN; break; - case 0x08: byteOrder = ByteOrder.LITTLE_ENDIAN; break; - default: - assert false; - byteOrder = null; - } - } finally { - unsafe.freeMemory(a); - } - } - - private static int pageSize = -1; static int pageSize() { @@ -605,17 +586,9 @@ class Bits { // package-private return (int)(size + (long)pageSize() - 1L) / pageSize(); } - private static boolean unaligned; - private static boolean unalignedKnown = false; + private static boolean unaligned = unsafe.unalignedAccess(); static boolean unaligned() { - if (unalignedKnown) - return unaligned; - String arch = AccessController.doPrivileged( - new sun.security.action.GetPropertyAction("os.arch")); - unaligned = arch.equals("i386") || arch.equals("x86") - || arch.equals("amd64") || arch.equals("x86_64"); - unalignedKnown = true; return unaligned; } diff --git a/jdk/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template index e8639c4d21f..3876b147093 100644 --- a/jdk/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template +++ b/jdk/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ package java.nio; +import sun.misc.Unsafe; /** #if[rw] @@ -52,6 +53,16 @@ class Heap$Type$Buffer$RW$ #end[rw] */ +#if[byte] + + // Cached unsafe-access object + private static final Unsafe unsafe = Bits.unsafe(); + + // Cached array base offset + private static final long arrayBaseOffset = unsafe.arrayBaseOffset($type$[].class); + +#end[byte] + Heap$Type$Buffer$RW$(int cap, int lim) { // package-private #if[rw] super(-1, 0, lim, cap, new $type$[cap], 0); @@ -131,6 +142,12 @@ class Heap$Type$Buffer$RW$ return i + offset; } +#if[byte] + private long byteOffset(long i) { + return arrayBaseOffset + i + offset; + } +#end[byte] + public $type$ get() { return hb[ix(nextGetIndex())]; } @@ -256,18 +273,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public char getChar() { - return Bits.getChar(this, ix(nextGetIndex(2)), bigEndian); + return unsafe.getCharUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); } public char getChar(int i) { - return Bits.getChar(this, ix(checkIndex(i, 2)), bigEndian); + return unsafe.getCharUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); } #end[rw] public $Type$Buffer putChar(char x) { #if[rw] - Bits.putChar(this, ix(nextPutIndex(2)), x, bigEndian); + unsafe.putCharUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -276,7 +293,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putChar(int i, char x) { #if[rw] - Bits.putChar(this, ix(checkIndex(i, 2)), x, bigEndian); + unsafe.putCharUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -307,18 +324,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public short getShort() { - return Bits.getShort(this, ix(nextGetIndex(2)), bigEndian); + return unsafe.getShortUnaligned(hb, byteOffset(nextGetIndex(2)), bigEndian); } public short getShort(int i) { - return Bits.getShort(this, ix(checkIndex(i, 2)), bigEndian); + return unsafe.getShortUnaligned(hb, byteOffset(checkIndex(i, 2)), bigEndian); } #end[rw] public $Type$Buffer putShort(short x) { #if[rw] - Bits.putShort(this, ix(nextPutIndex(2)), x, bigEndian); + unsafe.putShortUnaligned(hb, byteOffset(nextPutIndex(2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -327,7 +344,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putShort(int i, short x) { #if[rw] - Bits.putShort(this, ix(checkIndex(i, 2)), x, bigEndian); + unsafe.putShortUnaligned(hb, byteOffset(checkIndex(i, 2)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -358,18 +375,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public int getInt() { - return Bits.getInt(this, ix(nextGetIndex(4)), bigEndian); + return unsafe.getIntUnaligned(hb, byteOffset(nextGetIndex(4)), bigEndian); } public int getInt(int i) { - return Bits.getInt(this, ix(checkIndex(i, 4)), bigEndian); + return unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); } #end[rw] public $Type$Buffer putInt(int x) { #if[rw] - Bits.putInt(this, ix(nextPutIndex(4)), x, bigEndian); + unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -378,7 +395,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putInt(int i, int x) { #if[rw] - Bits.putInt(this, ix(checkIndex(i, 4)), x, bigEndian); + unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -409,18 +426,18 @@ class Heap$Type$Buffer$RW$ #if[rw] public long getLong() { - return Bits.getLong(this, ix(nextGetIndex(8)), bigEndian); + return unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); } public long getLong(int i) { - return Bits.getLong(this, ix(checkIndex(i, 8)), bigEndian); + return unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); } #end[rw] public $Type$Buffer putLong(long x) { #if[rw] - Bits.putLong(this, ix(nextPutIndex(8)), x, bigEndian); + unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -429,7 +446,7 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putLong(int i, long x) { #if[rw] - Bits.putLong(this, ix(checkIndex(i, 8)), x, bigEndian); + unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), x, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -460,18 +477,21 @@ class Heap$Type$Buffer$RW$ #if[rw] public float getFloat() { - return Bits.getFloat(this, ix(nextGetIndex(4)), bigEndian); + int x = unsafe.getIntUnaligned(hb, byteOffset(nextPutIndex(4)), bigEndian); + return Float.intBitsToFloat(x); } public float getFloat(int i) { - return Bits.getFloat(this, ix(checkIndex(i, 4)), bigEndian); + int x = unsafe.getIntUnaligned(hb, byteOffset(checkIndex(i, 4)), bigEndian); + return Float.intBitsToFloat(x); } #end[rw] public $Type$Buffer putFloat(float x) { #if[rw] - Bits.putFloat(this, ix(nextPutIndex(4)), x, bigEndian); + int y = Float.floatToRawIntBits(x); + unsafe.putIntUnaligned(hb, byteOffset(nextPutIndex(4)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -480,7 +500,8 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putFloat(int i, float x) { #if[rw] - Bits.putFloat(this, ix(checkIndex(i, 4)), x, bigEndian); + int y = Float.floatToRawIntBits(x); + unsafe.putIntUnaligned(hb, byteOffset(checkIndex(i, 4)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -511,18 +532,21 @@ class Heap$Type$Buffer$RW$ #if[rw] public double getDouble() { - return Bits.getDouble(this, ix(nextGetIndex(8)), bigEndian); + long x = unsafe.getLongUnaligned(hb, byteOffset(nextGetIndex(8)), bigEndian); + return Double.longBitsToDouble(x); } public double getDouble(int i) { - return Bits.getDouble(this, ix(checkIndex(i, 8)), bigEndian); + long x = unsafe.getLongUnaligned(hb, byteOffset(checkIndex(i, 8)), bigEndian); + return Double.longBitsToDouble(x); } #end[rw] public $Type$Buffer putDouble(double x) { #if[rw] - Bits.putDouble(this, ix(nextPutIndex(8)), x, bigEndian); + long y = Double.doubleToRawLongBits(x); + unsafe.putLongUnaligned(hb, byteOffset(nextPutIndex(8)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); @@ -531,7 +555,8 @@ class Heap$Type$Buffer$RW$ public $Type$Buffer putDouble(int i, double x) { #if[rw] - Bits.putDouble(this, ix(checkIndex(i, 8)), x, bigEndian); + long y = Double.doubleToRawLongBits(x); + unsafe.putLongUnaligned(hb, byteOffset(checkIndex(i, 8)), y, bigEndian); return this; #else[rw] throw new ReadOnlyBufferException(); diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index 80c76a2f571..7afd40bf12a 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -2851,7 +2851,10 @@ public final class Files { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. * * @see #write(Path,Iterable,Charset,OpenOption[]) */ @@ -2893,7 +2896,10 @@ public final class Files { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. * * @since 1.8 */ @@ -3290,7 +3296,10 @@ public final class Files { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. */ public static Path write(Path path, byte[] bytes, OpenOption... options) throws IOException @@ -3350,7 +3359,10 @@ public final class Files { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. */ public static Path write(Path path, Iterable lines, Charset cs, OpenOption... options) @@ -3398,7 +3410,10 @@ public final class Files { * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. * * @since 1.8 */ diff --git a/jdk/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java b/jdk/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java index 5f05338bd09..32ab6b82ddf 100644 --- a/jdk/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java +++ b/jdk/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java @@ -103,6 +103,10 @@ public final class ZoneOffsetTransition * Serialization version. */ private static final long serialVersionUID = -6946044323557704546L; + /** + * The transition epoch-second. + */ + private final long epochSecond; /** * The local transition date-time at the transition. */ @@ -152,6 +156,7 @@ public final class ZoneOffsetTransition * @param offsetAfter the offset at and after the transition, not null */ ZoneOffsetTransition(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) { + this.epochSecond = transition.toEpochSecond(offsetBefore); this.transition = transition; this.offsetBefore = offsetBefore; this.offsetAfter = offsetAfter; @@ -165,6 +170,7 @@ public final class ZoneOffsetTransition * @param offsetAfter the offset at and after the transition, not null */ ZoneOffsetTransition(long epochSecond, ZoneOffset offsetBefore, ZoneOffset offsetAfter) { + this.epochSecond = epochSecond; this.transition = LocalDateTime.ofEpochSecond(epochSecond, 0, offsetBefore); this.offsetBefore = offsetBefore; this.offsetAfter = offsetAfter; @@ -209,7 +215,7 @@ public final class ZoneOffsetTransition * @throws IOException if an error occurs */ void writeExternal(DataOutput out) throws IOException { - Ser.writeEpochSec(toEpochSecond(), out); + Ser.writeEpochSec(epochSecond, out); Ser.writeOffset(offsetBefore, out); Ser.writeOffset(offsetAfter, out); } @@ -253,7 +259,7 @@ public final class ZoneOffsetTransition * @return the transition epoch second */ public long toEpochSecond() { - return transition.toEpochSecond(offsetBefore); + return epochSecond; } //------------------------------------------------------------------------- @@ -397,7 +403,13 @@ public final class ZoneOffsetTransition */ @Override public int compareTo(ZoneOffsetTransition transition) { - return this.getInstant().compareTo(transition.getInstant()); + if (epochSecond < transition.epochSecond) { + return -1; + } else if (epochSecond > transition.epochSecond) { + return 1; + } else { + return this.getInstant().compareTo(transition.getInstant()); + } } //----------------------------------------------------------------------- @@ -416,7 +428,8 @@ public final class ZoneOffsetTransition } if (other instanceof ZoneOffsetTransition) { ZoneOffsetTransition d = (ZoneOffsetTransition) other; - return transition.equals(d.transition) && + return epochSecond == d.epochSecond && + transition.equals(d.transition) && offsetBefore.equals(d.offsetBefore) && offsetAfter.equals(d.offsetAfter); } return false; diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java index 5ca9cb3059d..1d3454e281e 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java @@ -183,7 +183,7 @@ public final class Unsafe { *

      * Unless the reference {@code x} being stored is either null * or matches the field type, the results are undefined. - * If the reference {@code o} is non-null, car marks or + * If the reference {@code o} is non-null, card marks or * other store barriers for that object (if the VM requires them) * are updated. * @see #putInt(Object, long, int) @@ -219,6 +219,35 @@ public final class Unsafe { /** @see #putInt(Object, long, int) */ public native void putDouble(Object o, long offset, double x); + // These read VM internal data. + + /** + * Fetches an uncompressed reference value from a given native variable + * ignoring the VM's compressed references mode. + * + * @param address a memory address locating the variable + * @return the value fetched from the indicated native variable + */ + public native Object getUncompressedObject(long address); + + /** + * Fetches the {@link java.lang.Class} Java mirror for the given native + * metaspace {@code Klass} pointer. + * + * @param metaspaceKlass a native metaspace {@code Klass} pointer + * @return the {@link java.lang.Class} Java mirror + */ + public native Class getJavaMirror(long metaspaceKlass); + + /** + * Fetches a native metaspace {@code Klass} pointer for the given Java + * object. + * + * @param o Java heap object for which to fetch the class pointer + * @return a native metaspace {@code Klass} pointer + */ + public native long getKlassPointer(Object o); + // These work on values in the C heap. /** @@ -934,4 +963,347 @@ public final class Unsafe { private static void throwIllegalAccessError() { throw new IllegalAccessError(); } + + /** + * @return Returns true if the native byte ordering of this + * platform is big-endian, false if it is little-endian. + */ + public final boolean isBigEndian() { return BE; } + + /** + * @return Returns true if this platform is capable of performing + * accesses at addresses which are not aligned for the type of the + * primitive type being accessed, false otherwise. + */ + public final boolean unalignedAccess() { return unalignedAccess; } + + /** + * Fetches a value at some byte offset into a given Java object. + * More specifically, fetches a value within the given object + * o at the given offset, or (if o is + * null) from the memory address whose numerical value is the + * given offset.

      + * + * The specification of this method is the same as {@link + * #getLong(Object, long)} except that the offset does not need to + * have been obtained from {@link #objectFieldOffset} on the + * {@link java.lang.reflect.Field} of some Java field. The value + * in memory is raw data, and need not correspond to any Java + * variable. Unless o is null, the value accessed + * must be entirely within the allocated object. The endianness + * of the value in memory is the endianness of the native platform. + * + *

      The read will be atomic with respect to the largest power + * of two that divides the GCD of the offset and the storage size. + * For example, getLongUnaligned will make atomic reads of 2-, 4-, + * or 8-byte storage units if the offset is zero mod 2, 4, or 8, + * respectively. There are no other guarantees of atomicity. + *

      + * 8-byte atomicity is only guaranteed on platforms on which + * support atomic accesses to longs. + * + * @param o Java heap object in which the value resides, if any, else + * null + * @param offset The offset in bytes from the start of the object + * @return the value fetched from the indicated object + * @throws RuntimeException No defined exceptions are thrown, not even + * {@link NullPointerException} + * @since 1.9 + */ + public final long getLongUnaligned(Object o, long offset) { + if ((offset & 7) == 0) { + return getLong(o, offset); + } else if ((offset & 3) == 0) { + return makeLong(getInt(o, offset), + getInt(o, offset + 4)); + } else if ((offset & 1) == 0) { + return makeLong(getShort(o, offset), + getShort(o, offset + 2), + getShort(o, offset + 4), + getShort(o, offset + 6)); + } else { + return makeLong(getByte(o, offset), + getByte(o, offset + 1), + getByte(o, offset + 2), + getByte(o, offset + 3), + getByte(o, offset + 4), + getByte(o, offset + 5), + getByte(o, offset + 6), + getByte(o, offset + 7)); + } + } + /** + * As {@link #getLongUnaligned(Object, long)} but with an + * additional argument which specifies the endianness of the value + * as stored in memory. + * + * @param o Java heap object in which the variable resides + * @param offset The offset in bytes from the start of the object + * @param bigEndian The endianness of the value + * @return the value fetched from the indicated object + * @since 1.9 + */ + public final long getLongUnaligned(Object o, long offset, boolean bigEndian) { + return convEndian(bigEndian, getLongUnaligned(o, offset)); + } + + /** @see #getLongUnaligned(Object, long) */ + public final int getIntUnaligned(Object o, long offset) { + if ((offset & 3) == 0) { + return getInt(o, offset); + } else if ((offset & 1) == 0) { + return makeInt(getShort(o, offset), + getShort(o, offset + 2)); + } else { + return makeInt(getByte(o, offset), + getByte(o, offset + 1), + getByte(o, offset + 2), + getByte(o, offset + 3)); + } + } + /** @see #getLongUnaligned(Object, long, boolean) */ + public final int getIntUnaligned(Object o, long offset, boolean bigEndian) { + return convEndian(bigEndian, getIntUnaligned(o, offset)); + } + + /** @see #getLongUnaligned(Object, long) */ + public final short getShortUnaligned(Object o, long offset) { + if ((offset & 1) == 0) { + return getShort(o, offset); + } else { + return makeShort(getByte(o, offset), + getByte(o, offset + 1)); + } + } + /** @see #getLongUnaligned(Object, long, boolean) */ + public final short getShortUnaligned(Object o, long offset, boolean bigEndian) { + return convEndian(bigEndian, getShortUnaligned(o, offset)); + } + + /** @see #getLongUnaligned(Object, long) */ + public final char getCharUnaligned(Object o, long offset) { + return (char)getShortUnaligned(o, offset); + } + /** @see #getLongUnaligned(Object, long, boolean) */ + public final char getCharUnaligned(Object o, long offset, boolean bigEndian) { + return convEndian(bigEndian, getCharUnaligned(o, offset)); + } + + /** + * Stores a value at some byte offset into a given Java object. + *

      + * The specification of this method is the same as {@link + * #getLong(Object, long)} except that the offset does not need to + * have been obtained from {@link #objectFieldOffset} on the + * {@link java.lang.reflect.Field} of some Java field. The value + * in memory is raw data, and need not correspond to any Java + * variable. The endianness of the value in memory is the + * endianness of the native platform. + *

      + * The write will be atomic with respect to the largest power of + * two that divides the GCD of the offset and the storage size. + * For example, putLongUnaligned will make atomic writes of 2-, 4-, + * or 8-byte storage units if the offset is zero mod 2, 4, or 8, + * respectively. There are no other guarantees of atomicity. + *

      + * 8-byte atomicity is only guaranteed on platforms on which + * support atomic accesses to longs. + *

      + * + * @param o Java heap object in which the value resides, if any, else + * null + * @param offset The offset in bytes from the start of the object + * @param x the value to store + * @throws RuntimeException No defined exceptions are thrown, not even + * {@link NullPointerException} + * @since 1.9 + */ + public final void putLongUnaligned(Object o, long offset, long x) { + if ((offset & 7) == 0) { + putLong(o, offset, x); + } else if ((offset & 3) == 0) { + putLongParts(o, offset, + (int)(x >> 0), + (int)(x >>> 32)); + } else if ((offset & 1) == 0) { + putLongParts(o, offset, + (short)(x >>> 0), + (short)(x >>> 16), + (short)(x >>> 32), + (short)(x >>> 48)); + } else { + putLongParts(o, offset, + (byte)(x >>> 0), + (byte)(x >>> 8), + (byte)(x >>> 16), + (byte)(x >>> 24), + (byte)(x >>> 32), + (byte)(x >>> 40), + (byte)(x >>> 48), + (byte)(x >>> 56)); + } + } + /** + * As {@link #putLongUnaligned(Object, long, long)} but with an additional + * argument which specifies the endianness of the value as stored in memory. + * @param o Java heap object in which the value resides + * @param offset The offset in bytes from the start of the object + * @param x the value to store + * @param bigEndian The endianness of the value + * @throws RuntimeException No defined exceptions are thrown, not even + * {@link NullPointerException} + * @since 1.9 + */ + public final void putLongUnaligned(Object o, long offset, long x, boolean bigEndian) { + putLongUnaligned(o, offset, convEndian(bigEndian, x)); + } + + /** @see #putLongUnaligned(Object, long, long) */ + public final void putIntUnaligned(Object o, long offset, int x) { + if ((offset & 3) == 0) { + putInt(o, offset, x); + } else if ((offset & 1) == 0) { + putIntParts(o, offset, + (short)(x >> 0), + (short)(x >>> 16)); + } else { + putIntParts(o, offset, + (byte)(x >>> 0), + (byte)(x >>> 8), + (byte)(x >>> 16), + (byte)(x >>> 24)); + } + } + /** @see #putLongUnaligned(Object, long, long, boolean) */ + public final void putIntUnaligned(Object o, long offset, int x, boolean bigEndian) { + putIntUnaligned(o, offset, convEndian(bigEndian, x)); + } + + /** @see #putLongUnaligned(Object, long, long) */ + public final void putShortUnaligned(Object o, long offset, short x) { + if ((offset & 1) == 0) { + putShort(o, offset, x); + } else { + putShortParts(o, offset, + (byte)(x >>> 0), + (byte)(x >>> 8)); + } + } + /** @see #putLongUnaligned(Object, long, long, boolean) */ + public final void putShortUnaligned(Object o, long offset, short x, boolean bigEndian) { + putShortUnaligned(o, offset, convEndian(bigEndian, x)); + } + + /** @see #putLongUnaligned(Object, long, long) */ + public final void putCharUnaligned(Object o, long offset, char x) { + putShortUnaligned(o, offset, (short)x); + } + /** @see #putLongUnaligned(Object, long, long, boolean) */ + public final void putCharUnaligned(Object o, long offset, char x, boolean bigEndian) { + putCharUnaligned(o, offset, convEndian(bigEndian, x)); + } + + // JVM interface methods + private native boolean unalignedAccess0(); + private native boolean isBigEndian0(); + + // BE is true iff the native endianness of this platform is big. + private static final boolean BE = theUnsafe.isBigEndian0(); + + // unalignedAccess is true iff this platform can perform unaligned accesses. + private static final boolean unalignedAccess = theUnsafe.unalignedAccess0(); + + private static int pickPos(int top, int pos) { return BE ? top - pos : pos; } + + // These methods construct integers from bytes. The byte ordering + // is the native endianness of this platform. + private static long makeLong(byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7) { + return ((toUnsignedLong(i0) << pickPos(56, 0)) + | (toUnsignedLong(i1) << pickPos(56, 8)) + | (toUnsignedLong(i2) << pickPos(56, 16)) + | (toUnsignedLong(i3) << pickPos(56, 24)) + | (toUnsignedLong(i4) << pickPos(56, 32)) + | (toUnsignedLong(i5) << pickPos(56, 40)) + | (toUnsignedLong(i6) << pickPos(56, 48)) + | (toUnsignedLong(i7) << pickPos(56, 56))); + } + private static long makeLong(short i0, short i1, short i2, short i3) { + return ((toUnsignedLong(i0) << pickPos(48, 0)) + | (toUnsignedLong(i1) << pickPos(48, 16)) + | (toUnsignedLong(i2) << pickPos(48, 32)) + | (toUnsignedLong(i3) << pickPos(48, 48))); + } + private static long makeLong(int i0, int i1) { + return (toUnsignedLong(i0) << pickPos(32, 0)) + | (toUnsignedLong(i1) << pickPos(32, 32)); + } + private static int makeInt(short i0, short i1) { + return (toUnsignedInt(i0) << pickPos(16, 0)) + | (toUnsignedInt(i1) << pickPos(16, 16)); + } + private static int makeInt(byte i0, byte i1, byte i2, byte i3) { + return ((toUnsignedInt(i0) << pickPos(24, 0)) + | (toUnsignedInt(i1) << pickPos(24, 8)) + | (toUnsignedInt(i2) << pickPos(24, 16)) + | (toUnsignedInt(i3) << pickPos(24, 24))); + } + private static short makeShort(byte i0, byte i1) { + return (short)((toUnsignedInt(i0) << pickPos(8, 0)) + | (toUnsignedInt(i1) << pickPos(8, 8))); + } + + private static byte pick(byte le, byte be) { return BE ? be : le; } + private static short pick(short le, short be) { return BE ? be : le; } + private static int pick(int le, int be) { return BE ? be : le; } + + // These methods write integers to memory from smaller parts + // provided by their caller. The ordering in which these parts + // are written is the native endianness of this platform. + private void putLongParts(Object o, long offset, byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7) { + putByte(o, offset + 0, pick(i0, i7)); + putByte(o, offset + 1, pick(i1, i6)); + putByte(o, offset + 2, pick(i2, i5)); + putByte(o, offset + 3, pick(i3, i4)); + putByte(o, offset + 4, pick(i4, i3)); + putByte(o, offset + 5, pick(i5, i2)); + putByte(o, offset + 6, pick(i6, i1)); + putByte(o, offset + 7, pick(i7, i0)); + } + private void putLongParts(Object o, long offset, short i0, short i1, short i2, short i3) { + putShort(o, offset + 0, pick(i0, i3)); + putShort(o, offset + 2, pick(i1, i2)); + putShort(o, offset + 4, pick(i2, i1)); + putShort(o, offset + 6, pick(i3, i0)); + } + private void putLongParts(Object o, long offset, int i0, int i1) { + putInt(o, offset + 0, pick(i0, i1)); + putInt(o, offset + 4, pick(i1, i0)); + } + private void putIntParts(Object o, long offset, short i0, short i1) { + putShort(o, offset + 0, pick(i0, i1)); + putShort(o, offset + 2, pick(i1, i0)); + } + private void putIntParts(Object o, long offset, byte i0, byte i1, byte i2, byte i3) { + putByte(o, offset + 0, pick(i0, i3)); + putByte(o, offset + 1, pick(i1, i2)); + putByte(o, offset + 2, pick(i2, i1)); + putByte(o, offset + 3, pick(i3, i0)); + } + private void putShortParts(Object o, long offset, byte i0, byte i1) { + putByte(o, offset + 0, pick(i0, i1)); + putByte(o, offset + 1, pick(i1, i0)); + } + + // Zero-extend an integer + private static int toUnsignedInt(byte n) { return n & 0xff; } + private static int toUnsignedInt(short n) { return n & 0xffff; } + private static long toUnsignedLong(byte n) { return n & 0xffl; } + private static long toUnsignedLong(short n) { return n & 0xffffl; } + private static long toUnsignedLong(int n) { return n & 0xffffffffl; } + + // Maybe byte-reverse an integer + private static char convEndian(boolean big, char n) { return big == BE ? n : Character.reverseBytes(n); } + private static short convEndian(boolean big, short n) { return big == BE ? n : Short.reverseBytes(n) ; } + private static int convEndian(boolean big, int n) { return big == BE ? n : Integer.reverseBytes(n) ; } + private static long convEndian(boolean big, long n) { return big == BE ? n : Long.reverseBytes(n) ; } } diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetBooleanAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetBooleanAction.java index e3a5d1991ef..d2bcb105d3a 100644 --- a/jdk/src/java.base/share/classes/sun/security/action/GetBooleanAction.java +++ b/jdk/src/java.base/share/classes/sun/security/action/GetBooleanAction.java @@ -33,7 +33,7 @@ package sun.security.action; * AccessController.doPrivileged. * *

      The following code retrieves the boolean value of the system - * property named "prop" as a privileged action:

      + * property named "prop" as a privileged action: * *

        * boolean b = java.security.AccessController.doPrivileged
      diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetBooleanSecurityPropertyAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetBooleanSecurityPropertyAction.java
      index a96d1e05e12..9b180f1bdfd 100644
      --- a/jdk/src/java.base/share/classes/sun/security/action/GetBooleanSecurityPropertyAction.java
      +++ b/jdk/src/java.base/share/classes/sun/security/action/GetBooleanSecurityPropertyAction.java
      @@ -35,7 +35,7 @@ import java.security.Security;
        * AccessController.doPrivileged.
        *
        * 

      The following code retrieves the boolean value of the security - * property named "prop" as a privileged action:

      + * property named "prop" as a privileged action: * *

        * boolean b = java.security.AccessController.doPrivileged
      diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java
      index 8002ef8ede5..ff2b2019b48 100644
      --- a/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java
      +++ b/jdk/src/java.base/share/classes/sun/security/action/GetIntegerAction.java
      @@ -36,7 +36,7 @@ package sun.security.action;
        * property named "prop" as a privileged action. Since it does
        * not pass a default value to be used in case the property
        * "prop" is not defined, it has to check the result for
      - * null: 

      + * null: * *

        * Integer tmp = java.security.AccessController.doPrivileged
      @@ -50,7 +50,7 @@ package sun.security.action;
        * 

      The following code retrieves the integer value of the system * property named "prop" as a privileged action, and also passes * a default value to be used in case the property "prop" is not - * defined:

      + * defined: * *

        * int i = ((Integer)java.security.AccessController.doPrivileged(
      @@ -84,7 +84,7 @@ public class GetIntegerAction
            * value of that property.
            *
            * @param theProp the name of the system property.
      -     * @param defaulVal the default value.
      +     * @param defaultVal the default value.
            */
           public GetIntegerAction(String theProp, int defaultVal) {
               this.theProp = theProp;
      diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetLongAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetLongAction.java
      index fdadc191b72..25335c62c36 100644
      --- a/jdk/src/java.base/share/classes/sun/security/action/GetLongAction.java
      +++ b/jdk/src/java.base/share/classes/sun/security/action/GetLongAction.java
      @@ -36,7 +36,7 @@ package sun.security.action;
        * property named "prop" as a privileged action. Since it does
        * not pass a default value to be used in case the property
        * "prop" is not defined, it has to check the result for
      - * null: 

      + * null: * *

        * Long tmp = java.security.AccessController.doPrivileged
      @@ -50,7 +50,7 @@ package sun.security.action;
        * 

      The following code retrieves the Long value of the system * property named "prop" as a privileged action, and also passes * a default value to be used in case the property "prop" is not - * defined:

      + * defined: * *

        * long l = java.security.AccessController.doPrivileged
      @@ -83,7 +83,7 @@ public class GetLongAction implements java.security.PrivilegedAction {
            * value of that property.
            *
            * @param theProp the name of the system property.
      -     * @param defaulVal the default value.
      +     * @param defaultVal the default value.
            */
           public GetLongAction(String theProp, long defaultVal) {
               this.theProp = theProp;
      diff --git a/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java b/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java
      index 4ed9bde3783..95a113c3bef 100644
      --- a/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java
      +++ b/jdk/src/java.base/share/classes/sun/security/action/GetPropertyAction.java
      @@ -33,7 +33,7 @@ package sun.security.action;
        * AccessController.doPrivileged.
        *
        * 

      The following code retrieves the value of the system - * property named "prop" as a privileged action:

      + * property named "prop" as a privileged action: * *

        * String s = java.security.AccessController.doPrivileged
      @@ -66,7 +66,7 @@ public class GetPropertyAction
            * value of that property.
            *
            * @param theProp the name of the system property.
      -     * @param defaulVal the default value.
      +     * @param defaultVal the default value.
            */
           public GetPropertyAction(String theProp, String defaultVal) {
               this.theProp = theProp;
      diff --git a/jdk/src/java.base/share/classes/sun/security/jca/GetInstance.java b/jdk/src/java.base/share/classes/sun/security/jca/GetInstance.java
      index 85ca272edfc..a5e5602dc4d 100644
      --- a/jdk/src/java.base/share/classes/sun/security/jca/GetInstance.java
      +++ b/jdk/src/java.base/share/classes/sun/security/jca/GetInstance.java
      @@ -117,7 +117,7 @@ public class GetInstance {
           /**
            * This method exists for compatibility with JCE only. It will be removed
            * once JCE has been changed to use the replacement method.
      -     * @deprecated use getServices(List) instead
      +     * @deprecated use {@code getServices(List)} instead
            */
           @Deprecated
           public static List getServices(String type,
      diff --git a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java
      index 66c8262418f..511693f734a 100644
      --- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java
      +++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java
      @@ -353,7 +353,7 @@ public final class ProviderList {
           /**
            * This method exists for compatibility with JCE only. It will be removed
            * once JCE has been changed to use the replacement method.
      -     * @deprecated use getServices(List) instead
      +     * @deprecated use {@code getServices(List)} instead
            */
           @Deprecated
           public List getServices(String type, List algorithms) {
      diff --git a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java
      index 943ba93cc28..378504c101f 100644
      --- a/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java
      +++ b/jdk/src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java
      @@ -51,7 +51,6 @@ import sun.misc.HexDumpEncoder;
        * in string form, its value is a (single-valued)
        * byte array that is the SET's encoding.
        *
      - * 

      * * * @@ -476,7 +475,7 @@ public class PKCS9Attribute implements DerEncoder { * Construct a PKCS9Attribute from its encoding on an input * stream. * - * @param val the DerValue representing the DER encoding of the attribute. + * @param derVal the DerValue representing the DER encoding of the attribute. * @exception IOException on parsing error. */ public PKCS9Attribute(DerValue derVal) throws IOException { diff --git a/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index 1f52015392c..625d31115a9 100644 --- a/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/jdk/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1642,23 +1642,22 @@ public final class PKCS12KeyStore extends KeyStoreSpi { Entry entry = entries.get(alias); // certificate chain - int chainLen = 1; - Certificate[] certs = null; + Certificate[] certs; if (entry instanceof PrivateKeyEntry) { PrivateKeyEntry keyEntry = (PrivateKeyEntry) entry; - if (keyEntry.chain == null) { - chainLen = 0; - } else { - chainLen = keyEntry.chain.length; - } - certs = keyEntry.chain; - + if (keyEntry.chain != null) { + certs = keyEntry.chain; + } else { + certs = new Certificate[0]; + } } else if (entry instanceof CertEntry) { - certs = new Certificate[]{((CertEntry) entry).cert}; + certs = new Certificate[]{((CertEntry) entry).cert}; + } else { + certs = new Certificate[0]; } - for (int i = 0; i < chainLen; i++) { + for (int i = 0; i < certs.length; i++) { // create SafeBag of Type CertBag DerOutputStream safeBag = new DerOutputStream(); safeBag.putOID(CertBag_OID); diff --git a/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java b/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java index e06832bf3c6..1669429a4fa 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/ByteArrayAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -88,13 +88,8 @@ final class ByteArrayAccess { // Return whether this platform supports full speed int/long memory access // at unaligned addresses. - // This code was copied from java.nio.Bits because there is no equivalent - // public API. private static boolean unaligned() { - String arch = java.security.AccessController.doPrivileged - (new sun.security.action.GetPropertyAction("os.arch", "")); - return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") - || arch.equals("x86_64"); + return unsafe.unalignedAccess(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/provider/PolicyFile.java b/jdk/src/java.base/share/classes/sun/security/provider/PolicyFile.java index b59c4794fda..9b1de6805f9 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/PolicyFile.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/PolicyFile.java @@ -186,7 +186,7 @@ import sun.net.www.ParseUtil; *

      Case is unimportant for the identifiers (permission, * signedBy, codeBase, etc.) but is * significant for the Type - * or for any string that is passed in as a value.

      + * or for any string that is passed in as a value. * *

      An example of two entries in a policy configuration file is *

      @@ -212,7 +212,7 @@ import sun.net.www.ParseUtil;
        *  with one or more Principal class/name pairs.  The exact
        *  replacement performed depends upon the contents of the
        *  grant clause to which the permission belongs.
      - *

      + *

      * * If the grant clause does not contain any principal information, * the permission will be ignored (permissions containing @@ -220,11 +220,11 @@ import sun.net.www.ParseUtil; * of a principal-based grant clause). For example, BarPermission * will always be ignored in the following grant clause: * - *

      + * 
        *    grant codebase "www.foo.com", signedby "duke" {
        *      permission BarPermission "... ${{self}} ...";
        *    };
      - *
      + *
      * * If the grant clause contains principal information, ${{self}} * will be replaced with that same principal information. @@ -389,7 +389,7 @@ public class PolicyFile extends java.security.Policy { *

      Case is unimportant for the identifiers (permission, * signedBy, codeBase, etc.) but is * significant for the Type - * or for any string that is passed in as a value.

      + * or for any string that is passed in as a value. * *

      An example of two entries in a policy configuration file is *

      @@ -399,7 +399,7 @@ public class PolicyFile extends java.security.Policy {
            *   grant signedBy "Duke" {
            *          permission java.io.FilePermission "/tmp/*", "read,write";
            *   };
      -     * 

      + * * // grant everyone the following permission * * grant { @@ -1044,8 +1044,8 @@ public class PolicyFile extends java.security.Policy { * the ProtectionDomain and tests whether the permission is * granted. * - * @param domain the ProtectionDomain to test - * @param permission the Permission object to be tested for implication. + * @param pd the ProtectionDomain to test + * @param p the Permission object to be tested for implication. * * @return true if "permission" is a proper subset of a permission * granted to this ProtectionDomain. @@ -1093,8 +1093,6 @@ public class PolicyFile extends java.security.Policy { * originally granted permission, as well as the Class and name * for the respective Principal. * - *

      - * * @param domain the Permissions granted to this * ProtectionDomain are returned. * @@ -1131,7 +1129,7 @@ public class PolicyFile extends java.security.Policy { * Examines this Policy and creates a PermissionCollection object with * the set of permissions for the specified CodeSource. * - * @param CodeSource the codesource associated with the caller. + * @param codesource the CodeSource associated with the caller. * This encapsulates the original location of the code (where the code * came from) and the public key(s) of its signer. * @@ -1430,9 +1428,7 @@ public class PolicyFile extends java.security.Policy { } /** - *

      - * - * @param sp the SelfPermission that needs to be expanded

      + * @param sp the SelfPermission that needs to be expanded. * * @param entryPs list of principals for the Policy entry. * diff --git a/jdk/src/java.base/share/classes/sun/security/provider/PolicyParser.java b/jdk/src/java.base/share/classes/sun/security/provider/PolicyParser.java index c22f5a4eac7..2658a9e03ba 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/PolicyParser.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/PolicyParser.java @@ -45,19 +45,19 @@ import sun.security.util.ResourcesMgr; * is represented as a separate * persistent configuration. The configuration may be stored as a * flat ASCII file, as a serialized binary file of - * the Policy class, or as a database.

      + * the Policy class, or as a database. * *

      The Java runtime creates one global Policy object, which is used to * represent the static policy configuration file. It is consulted by * a ProtectionDomain when the protection domain initializes its set of - * permissions.

      + * permissions. * *

      The Policy init method parses the policy * configuration file, and then * populates the Policy object. The Policy object is agnostic in that * it is not involved in making policy decisions. It is merely the * Java runtime representation of the persistent policy configuration - * file.

      + * file. * *

      When a protection domain needs to initialize its set of * permissions, it executes code such as the following @@ -842,8 +842,7 @@ public class PolicyParser { /** * Each grant entry in the policy configuration file is - * represented by a - * GrantEntry object.

      + * represented by a GrantEntry object. * *

      * For example, the entry @@ -1094,7 +1093,7 @@ public class PolicyParser { /** * Each permission entry in the policy configuration file is * represented by a - * PermissionEntry object.

      + * PermissionEntry object. * *

      * For example, the entry diff --git a/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java b/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java index 4f7d7c3aad6..99edb6a89d2 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/SecureRandom.java @@ -208,7 +208,7 @@ implements java.io.Serializable { /** * Generates a user-specified number of random bytes. * - * @param bytes the array to be filled in with random bytes. + * @param result the array to be filled in with random bytes. */ @Override public synchronized void engineNextBytes(byte[] result) { diff --git a/jdk/src/java.base/share/classes/sun/security/provider/X509Factory.java b/jdk/src/java.base/share/classes/sun/security/provider/X509Factory.java index 5fa9416e60d..1789dd62cf5 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/X509Factory.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/X509Factory.java @@ -41,7 +41,7 @@ import java.util.Base64; import sun.security.pkcs.ParsingException; /** - * This class defines a certificate factory for X.509 v3 certificates & + * This class defines a certificate factory for X.509 v3 certificates {@literal &} * certification paths, and X.509 v2 certificate revocation lists (CRLs). * * @author Jan Luehe @@ -536,7 +536,7 @@ public class X509Factory extends CertificateFactorySpi { * after the newline character after the -----END SOMETHING----- line. * * @param is the InputStream - * @returns byte block or null if end of stream + * @return byte block or null if end of stream * @throws IOException If any parsing error */ private static byte[] readOneBlock(InputStream is) throws IOException { @@ -664,7 +664,7 @@ public class X509Factory extends CertificateFactorySpi { * @param is Read from this InputStream * @param bout Write into this OutputStream * @param tag Tag already read (-1 mean not read) - * @returns The current tag, used to check EOC in indefinite-length BER + * @return The current tag, used to check EOC in indefinite-length BER * @throws IOException Any parsing error */ private static int readBERInternal(InputStream is, diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AdjacencyList.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AdjacencyList.java index f26919b891f..9039d4fe75b 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/AdjacencyList.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/AdjacencyList.java @@ -75,10 +75,10 @@ import java.util.List; * values SUCCEED and FAIL mean that we've come to * the end of the build process, and there will not be any more entries in * the list. - *

      + * * @see sun.security.provider.certpath.BuildStep * @see sun.security.provider.certpath.Vertex - *

      + * * @author seth proctor * @since 1.4 */ diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/BuildStep.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/BuildStep.java index bf06411e1b4..8ae3a8ecb5d 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/BuildStep.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/BuildStep.java @@ -93,7 +93,7 @@ public class BuildStep { /** * return vertex description for this build step * - * @returns Vertex + * @return Vertex */ public Vertex getVertex() { return vertex; @@ -102,7 +102,7 @@ public class BuildStep { /** * return the certificate associated with this build step * - * @returns X509Certificate + * @return X509Certificate */ public X509Certificate getCertificate() { return cert; @@ -112,7 +112,7 @@ public class BuildStep { * return string form of issuer name from certificate associated with this * build step * - * @returns String form of issuer name or null, if no certificate. + * @return String form of issuer name or null, if no certificate. */ public String getIssuerName() { return getIssuerName(null); @@ -125,7 +125,7 @@ public class BuildStep { * * @param defaultName name to use as default if unable to return an issuer * name from the certificate, or if no certificate. - * @returns String form of issuer name or defaultName, if no certificate or + * @return String form of issuer name or defaultName, if no certificate or * exception received while trying to extract issuer name from certificate. */ public String getIssuerName(String defaultName) { @@ -137,7 +137,7 @@ public class BuildStep { * return string form of subject name from certificate associated with this * build step. * - * @returns String form of subject name or null, if no certificate. + * @return String form of subject name or null, if no certificate. */ public String getSubjectName() { return getSubjectName(null); @@ -151,7 +151,7 @@ public class BuildStep { * * @param defaultName name to use as default if unable to return a subject * name from the certificate, or if no certificate. - * @returns String form of subject name or defaultName, if no certificate or + * @return String form of subject name or defaultName, if no certificate or * if an exception was received while attempting to extract the subject name * from the certificate. */ @@ -163,7 +163,7 @@ public class BuildStep { /** * return the exception associated with this build step. * - * @returns Throwable + * @return Throwable */ public Throwable getThrowable() { return throwable; @@ -173,7 +173,7 @@ public class BuildStep { * return the result code associated with this build step. The result codes * are POSSIBLE, FOLLOW, BACK, FAIL, SUCCEED. * - * @returns int result code + * @return int result code */ public int getResult() { return result; @@ -184,7 +184,7 @@ public class BuildStep { * with this build step. * * @param res result code - * @returns String string representing meaning of the result code + * @return String string representing meaning of the result code */ public String resultToString(int res) { String resultString = ""; @@ -216,7 +216,7 @@ public class BuildStep { * return a string representation of this build step, showing minimal * detail. * - * @returns String + * @return String */ @Override public String toString() { @@ -243,7 +243,7 @@ public class BuildStep { * the vertex state appropriate to the result of this build step, and the * certificate contents. * - * @returns String + * @return String */ public String verboseToString() { String out = resultToString(getResult()); @@ -269,7 +269,7 @@ public class BuildStep { * return a string representation of this build step, including all possible * detail of the vertex state, but not including the certificate contents. * - * @returns String + * @return String */ public String fullToString() { return resultToString(getResult()) + vertex.toString(); diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PolicyChecker.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PolicyChecker.java index dd030d3d9db..74af7bf16f1 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/PolicyChecker.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/PolicyChecker.java @@ -849,7 +849,7 @@ class PolicyChecker extends PKIXCertPathChecker { * @param initPolicies the Set of policies required by the user * @param currCertPolicies the CertificatePoliciesExtension of the * certificate being processed - * @returns the root node of the valid policy tree after modification + * @return the root node of the valid policy tree after modification * @exception CertPathValidatorException Exception thrown if error occurs. */ private static PolicyNodeImpl removeInvalidNodes(PolicyNodeImpl rootNode, @@ -909,7 +909,7 @@ class PolicyChecker extends PKIXCertPathChecker { * valid policy tree is null. Marks each node of the returned tree * immutable and thread-safe. * - * @returns the root node of the valid policy tree, or null if + * @return the root node of the valid policy tree, or null if * the valid policy tree is null */ PolicyNode getPolicyTree() { diff --git a/jdk/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java b/jdk/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java index e2503f0112f..06bfb2f111d 100644 --- a/jdk/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java +++ b/jdk/src/java.base/share/classes/sun/security/provider/certpath/Vertex.java @@ -67,7 +67,7 @@ public class Vertex { /** * return the certificate for this vertex * - * @returns X509Certificate + * @return X509Certificate */ public X509Certificate getCertificate() { return cert; @@ -78,7 +78,7 @@ public class Vertex { * adjacency list that contains certificates that could follow this * certificate. * - * @returns int index for this vertex, or -1 if no following certificates. + * @return int index for this vertex, or -1 if no following certificates. */ public int getIndex() { return index; @@ -99,7 +99,7 @@ public class Vertex { * return the throwable associated with this vertex; * returns null if none. * - * @returns Throwable + * @return Throwable */ public Throwable getThrowable() { return throwable; @@ -118,7 +118,7 @@ public class Vertex { /** * Return full string representation of vertex * - * @returns String representation of vertex + * @return String representation of vertex */ @Override public String toString() { @@ -129,7 +129,7 @@ public class Vertex { * Return string representation of this vertex's * certificate information. * - * @returns String representation of certificate info + * @return String representation of certificate info */ public String certToString() { StringBuilder sb = new StringBuilder(); @@ -197,7 +197,7 @@ public class Vertex { * return Vertex throwable as String compatible with * the way toString returns other information * - * @returns String form of exception (or "none") + * @return String form of exception (or "none") */ public String throwableToString() { StringBuilder sb = new StringBuilder("Exception: "); @@ -214,7 +214,7 @@ public class Vertex { * the way other Vertex.xToString() methods display * information. * - * @returns String form of index as "Last cert? [Yes/No] + * @return String form of index as "Last cert? [Yes/No] */ public String moreToString() { StringBuilder sb = new StringBuilder("Last cert? "); @@ -227,7 +227,7 @@ public class Vertex { * return Vertex index as String compatible with * the way other Vertex.xToString() methods displays other information. * - * @returns String form of index as "Index: [numeric index]" + * @return String form of index as "Index: [numeric index]" */ public String indexToString() { return "Index: " + index + "\n"; diff --git a/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java b/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java index 54aa0d269f5..fcca14bad2a 100644 --- a/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java +++ b/jdk/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java @@ -133,7 +133,7 @@ public final class RSAKeyFactory extends KeyFactorySpi { * * @param modulusLen the bit length of the RSA modulus. * @param exponent the RSA exponent - * @param minModulusLen if > 0, check to see if modulusLen is at + * @param minModulusLen if {@literal > 0}, check to see if modulusLen is at * least this long, otherwise unused. * @param maxModulusLen caller will allow this max number of bits. * Allow the smaller of the system-defined maximum and this param. diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java b/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java index 3bdf728b1f3..dd8110ef27e 100644 --- a/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java +++ b/jdk/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java @@ -39,11 +39,13 @@ import java.security.CryptoPrimitive; * * Checks for a particular version number should generally take this form: * + *

      {@code
        * if (protocolVersion.v >= ProtocolVersion.TLS10) {
        *   // TLS 1.0 code goes here
        * } else {
        *   // SSL 3.0 code here
        * }
      + * }
      * * @author Andreas Sterbenz * @since 1.4.1 diff --git a/jdk/src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java b/jdk/src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java index 50cef6ec04b..f0312ca427f 100644 --- a/jdk/src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java +++ b/jdk/src/java.base/share/classes/sun/security/timestamp/HttpTimestamper.java @@ -68,7 +68,7 @@ public class HttpTimestamper implements Timestamper { /** * Creates a timestamper that connects to the specified TSA. * - * @param tsa The location of the TSA. It must be an HTTP or HTTPS URI. + * @param tsaURI The location of the TSA. It must be an HTTP or HTTPS URI. * @throws IllegalArgumentException if tsaURI is not an HTTP or HTTPS URI */ public HttpTimestamper(URI tsaURI) { diff --git a/jdk/src/java.base/share/classes/sun/security/timestamp/TSRequest.java b/jdk/src/java.base/share/classes/sun/security/timestamp/TSRequest.java index 086c3b61aaa..290981dc7e8 100644 --- a/jdk/src/java.base/share/classes/sun/security/timestamp/TSRequest.java +++ b/jdk/src/java.base/share/classes/sun/security/timestamp/TSRequest.java @@ -112,7 +112,7 @@ public class TSRequest { /** * Sets an object identifier for the Time-Stamp Protocol policy. * - * @param version The policy object identifier. + * @param policyId The policy object identifier. */ public void setPolicyId(String policyId) { this.policyId = policyId; diff --git a/jdk/src/java.base/share/classes/sun/security/timestamp/TimestampToken.java b/jdk/src/java.base/share/classes/sun/security/timestamp/TimestampToken.java index 9df8f1c0bd0..be6a6d3821a 100644 --- a/jdk/src/java.base/share/classes/sun/security/timestamp/TimestampToken.java +++ b/jdk/src/java.base/share/classes/sun/security/timestamp/TimestampToken.java @@ -83,8 +83,8 @@ public class TimestampToken { /** * Constructs an object to store a timestamp token. * - * @param status A buffer containing the ASN.1 BER encoding of the - * TSTInfo element defined in RFC 3161. + * @param timestampTokenInfo A buffer containing the ASN.1 BER encoding of the + * TSTInfo element defined in RFC 3161. */ public TimestampToken(byte[] timestampTokenInfo) throws IOException { if (timestampTokenInfo == null) { diff --git a/jdk/src/java.base/share/classes/sun/security/tools/PathList.java b/jdk/src/java.base/share/classes/sun/security/tools/PathList.java index f059a5ea1aa..1bd9cb76e41 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/PathList.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/PathList.java @@ -42,7 +42,7 @@ public class PathList { * Utility method for appending path from pathFrom to pathTo. * * @param pathTo the target path - * @param pathSource the path to be appended to pathTo + * @param pathFrom the path to be appended to pathTo * @return the resulting path */ public static String appendPath(String pathTo, String pathFrom) { diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java index c1e58b5714f..37ed4105c9c 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -1887,7 +1887,7 @@ public final class Main { /** * Load the srckeystore from a stream, used in -importkeystore - * @returns the src KeyStore + * @return the src KeyStore */ KeyStore loadSourceKeyStore() throws Exception { boolean isPkcs11 = false; @@ -2005,7 +2005,7 @@ public final class Main { /** * Import a single entry named alias from srckeystore - * @returns 1 if the import action succeed + * @return 1 if the import action succeed * 0 if user choose to ignore an alias-dumplicated entry * 2 if setEntry throws Exception */ @@ -2836,7 +2836,7 @@ public final class Main { /** * Prompts user for alias name. * @param prompt the {0} of "Enter {0} alias name: " in prompt line - * @returns the string entered by the user, without the \n at the end + * @return the string entered by the user, without the \n at the end */ private String getAlias(String prompt) throws Exception { if (prompt != null) { @@ -2854,7 +2854,7 @@ public final class Main { /** * Prompts user for an input string from the command line (System.in) * @prompt the prompt string printed - * @returns the string entered by the user, without the \n at the end + * @return the string entered by the user, without the \n at the end */ private String inputStringFromStdin(String prompt) throws Exception { System.err.print(prompt); diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java index 0c7b513591e..3b944c3e84e 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_de.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_de extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java index 5348d1a104c..e8e731c2c3e 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_es.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_es extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java index 6b22844fe13..84fa8dcd765 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_fr.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_fr extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java index 2a49fe604fb..5912de860f0 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_it.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_it extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java index b5d7bb4d310..65d0285afcb 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ja.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_ja extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java index 40ede297df0..b4adfab9f13 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_ko.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_ko extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java index 0b784ce956b..747902a675f 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_pt_BR.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_pt_BR extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java index c6b4a8499a6..a8847f7e6e3 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_sv.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_sv extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java index 6ae574e4f34..e9dafbd1594 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_CN.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_zh_CN extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_HK.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_HK.java index 90cb13f86cd..89ef6076a62 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_HK.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_HK.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -420,8 +420,6 @@ public class Resources_zh_HK extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java index 1f0bb68b63e..60e67f4b426 100644 --- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java +++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Resources_zh_TW.java @@ -26,7 +26,7 @@ package sun.security.tools.keytool; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for the keytool. * */ @@ -433,8 +433,6 @@ public class Resources_zh_TW extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/util/BitArray.java b/jdk/src/java.base/share/classes/sun/security/util/BitArray.java index ad5ee5f6ee0..f22f259e15f 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/BitArray.java +++ b/jdk/src/java.base/share/classes/sun/security/util/BitArray.java @@ -66,10 +66,10 @@ public class BitArray { /** * Creates a BitArray of the specified size, initialized from the - * specified byte array. The most significant bit of a[0] gets + * specified byte array. The most significant bit of {@code a[0]} gets * index zero in the BitArray. The array a must be large enough * to specify a value for every bit in the BitArray. In other words, - * 8*a.length <= length. + * {@code 8*a.length <= length}. */ public BitArray(int length, byte[] a) throws IllegalArgumentException { diff --git a/jdk/src/java.base/share/classes/sun/security/util/ByteArrayLexOrder.java b/jdk/src/java.base/share/classes/sun/security/util/ByteArrayLexOrder.java index f943bc93062..7c8649c3e7f 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/ByteArrayLexOrder.java +++ b/jdk/src/java.base/share/classes/sun/security/util/ByteArrayLexOrder.java @@ -44,8 +44,9 @@ public class ByteArrayLexOrder implements Comparator { * * @param bytes1 first byte array to compare. * @param bytes2 second byte array to compare. - * @return negative number if bytes1 < bytes2, 0 if bytes1 == bytes2, - * positive number if bytes1 > bytes2. + * @return negative number if {@code bytes1 < bytes2}, + * 0 if {@code bytes1 == bytes2}, + * positive number if {@code bytes1 > bytes2}. * * @exception ClassCastException * if either argument is not a byte array. diff --git a/jdk/src/java.base/share/classes/sun/security/util/ByteArrayTagOrder.java b/jdk/src/java.base/share/classes/sun/security/util/ByteArrayTagOrder.java index 6ce51efaf58..dd5fae526ac 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/ByteArrayTagOrder.java +++ b/jdk/src/java.base/share/classes/sun/security/util/ByteArrayTagOrder.java @@ -44,8 +44,9 @@ public class ByteArrayTagOrder implements Comparator { * * @param bytes1 first byte array to compare. * @param bytes2 second byte array to compare. - * @return negative number if bytes1 < bytes2, 0 if bytes1 == bytes2, - * positive number if bytes1 > bytes2. + * @return negative number if {@code bytes1 < bytes2}, + * 0 if {@code bytes1 == bytes2}, + * positive number if {@code bytes1 > bytes2}. * * @exception ClassCastException * if either argument is not a byte array. diff --git a/jdk/src/java.base/share/classes/sun/security/util/DerOutputStream.java b/jdk/src/java.base/share/classes/sun/security/util/DerOutputStream.java index 05a7b6346a3..29425c79ce6 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/DerOutputStream.java +++ b/jdk/src/java.base/share/classes/sun/security/util/DerOutputStream.java @@ -103,7 +103,7 @@ extends ByteArrayOutputStream implements DerEncoder { * @param tag the DER value of the context-specific tag that replaces * original tag of the value in the output, such as in *

      -     *            [N] IMPLICIT 
      +     *           {@code  [N] IMPLICIT }
            * 
      * For example, FooLength [1] IMPLICIT INTEGER, with value=4; * would be encoded as "81 01 04" whereas in explicit @@ -245,7 +245,7 @@ extends ByteArrayOutputStream implements DerEncoder { * Marshals a DER bit string on the output stream. * The bit strings need not be byte-aligned. * - * @param bits the bit string, MSB first + * @param ba the bit string, MSB first */ public void putUnalignedBitString(BitArray ba) throws IOException { byte[] bits = ba.toByteArray(); @@ -260,7 +260,7 @@ extends ByteArrayOutputStream implements DerEncoder { * Marshals a truncated DER bit string on the output stream. * The bit strings need not be byte-aligned. * - * @param bits the bit string, MSB first + * @param ba the bit string, MSB first */ public void putTruncatedUnalignedBitString(BitArray ba) throws IOException { putUnalignedBitString(ba.truncate()); @@ -516,7 +516,7 @@ extends ByteArrayOutputStream implements DerEncoder { /** * Put the encoding of the length in the stream. * - * @params len the length of the attribute. + * @param len the length of the attribute. * @exception IOException on writing errors. */ public void putLength(int len) throws IOException { @@ -550,11 +550,11 @@ extends ByteArrayOutputStream implements DerEncoder { /** * Put the tag of the attribute in the stream. * - * @params class the tag class type, one of UNIVERSAL, CONTEXT, - * APPLICATION or PRIVATE - * @params form if true, the value is constructed, otherwise it is + * @param tagClass the tag class type, one of UNIVERSAL, CONTEXT, + * APPLICATION or PRIVATE + * @param form if true, the value is constructed, otherwise it is * primitive. - * @params val the tag value + * @param val the tag value */ public void putTag(byte tagClass, boolean form, byte val) { byte tag = (byte)(tagClass | val); diff --git a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java index 4b142bd4bfd..3ab10839661 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/DerValue.java +++ b/jdk/src/java.base/share/classes/sun/security/util/DerValue.java @@ -301,7 +301,7 @@ public class DerValue { * * @param buf the buffer * @param offset start point of the single DER-encoded dataum - * @param length how many bytes are in the encoded datum + * @param len how many bytes are in the encoded datum */ public DerValue(byte[] buf, int offset, int len) throws IOException { data = init(true, new ByteArrayInputStream(buf, offset, len)); @@ -594,7 +594,7 @@ public class DerValue { * Returns an ASN.1 BIT STRING value, with the tag assumed implicit * based on the parameter. The bit string must be byte-aligned. * - * @params tagImplicit if true, the tag is assumed implicit. + * @param tagImplicit if true, the tag is assumed implicit. * @return the bit string held in this value */ public byte[] getBitString(boolean tagImplicit) throws IOException { @@ -610,7 +610,7 @@ public class DerValue { * Returns an ASN.1 BIT STRING value, with the tag assumed implicit * based on the parameter. The bit string need not be byte-aligned. * - * @params tagImplicit if true, the tag is assumed implicit. + * @param tagImplicit if true, the tag is assumed implicit. * @return the bit string held in this value */ public BitArray getUnalignedBitString(boolean tagImplicit) @@ -750,7 +750,7 @@ public class DerValue { * encoding, so that bitwise equality of the encoded values is an * efficient way to establish equivalence of the unencoded values. * - * @param other the object being compared with this one + * @param o the object being compared with this one */ @Override public boolean equals(Object o) { @@ -892,11 +892,11 @@ public class DerValue { /** * Create the tag of the attribute. * - * @params class the tag class type, one of UNIVERSAL, CONTEXT, + * @param tagClass the tag class type, one of UNIVERSAL, CONTEXT, * APPLICATION or PRIVATE - * @params form if true, the value is constructed, otherwise it + * @param form if true, the value is constructed, otherwise it * is primitive. - * @params val the tag value + * @param val the tag value */ public static byte createTag(byte tagClass, boolean form, byte val) { byte tag = (byte)(tagClass | val); @@ -910,7 +910,7 @@ public class DerValue { * Set the tag of the attribute. Commonly used to reset the * tag value used for IMPLICIT encodings. * - * @params tag the tag value + * @param tag the tag value */ public void resetTag(byte tag) { this.tag = tag; diff --git a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java index 661e3b973b9..5e0f58ca2be 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java +++ b/jdk/src/java.base/share/classes/sun/security/util/KeyUtil.java @@ -100,11 +100,10 @@ public final class KeyUtil { *

      * Note that this method is only apply to DHPublicKey at present. * - * @param publicKey - * the key object, cannot be null + * @param key the key object, cannot be null * - * @throws NullPointerException if {@code publicKey} is null - * @throws InvalidKeyException if {@code publicKey} is invalid + * @throws NullPointerException if {@code key} is null + * @throws InvalidKeyException if {@code key} is invalid */ public static final void validate(Key key) throws InvalidKeyException { @@ -165,7 +164,8 @@ public final class KeyUtil { * version numbers in a manner indistinguishable from correctly * formatted RSA blocks. * - * RFC 5246 describes the approach as : + * RFC 5246 describes the approach as: + *

      {@literal
            *
            *  1. Generate a string R of 48 random bytes
            *
      @@ -183,6 +183,7 @@ public final class KeyUtil {
            *        premaster secret = M
            *
            * Note that #2 should have completed before the call to this method.
      +     * }
      * * @param clientVersion the version of the TLS protocol by which the * client wishes to communicate during this session @@ -190,7 +191,7 @@ public final class KeyUtil { * contains the lower of that suggested by the client in the client * hello and the highest supported by the server. * @param encoded the encoded key in its "RAW" encoding format - * @param isFailover whether or not the previous decryption of the + * @param isFailOver whether or not the previous decryption of the * encrypted PreMasterSecret message run into problem * @return the polished PreMasterSecret key in its "RAW" encoding format */ diff --git a/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java b/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java index 5314e69a14e..568e296f719 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java +++ b/jdk/src/java.base/share/classes/sun/security/util/ManifestDigester.java @@ -59,7 +59,7 @@ public class ManifestDigester { * * @pos set by * - * @returns false if end of bytes has been reached, otherwise returns + * @return false if end of bytes has been reached, otherwise returns * true */ @SuppressWarnings("fallthrough") diff --git a/jdk/src/java.base/share/classes/sun/security/util/PendingException.java b/jdk/src/java.base/share/classes/sun/security/util/PendingException.java index 3997f25d866..f510b3ab689 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/PendingException.java +++ b/jdk/src/java.base/share/classes/sun/security/util/PendingException.java @@ -47,8 +47,6 @@ public class PendingException extends RuntimeException { * A detail message is a String that describes this particular * exception. * - *

      - * * @param msg the detail message. */ public PendingException(String msg) { diff --git a/jdk/src/java.base/share/classes/sun/security/util/Resources.java b/jdk/src/java.base/share/classes/sun/security/util/Resources.java index 286acc99e28..5ddbab23140 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/Resources.java +++ b/jdk/src/java.base/share/classes/sun/security/util/Resources.java @@ -26,7 +26,7 @@ package sun.security.util; /** - *

      This class represents the ResourceBundle + * This class represents the ResourceBundle * for javax.security.auth and sun.security. * */ @@ -160,8 +160,6 @@ public class Resources extends java.util.ListResourceBundle { /** * Returns the contents of this ResourceBundle. * - *

      - * * @return the contents of this ResourceBundle. */ @Override diff --git a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java index 51b296544b2..88d0ccb00e4 100644 --- a/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/jdk/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java @@ -159,7 +159,7 @@ public class SignatureFileVerifier { * unknown signature related files (those starting with SIG- with * an optional [A-Z0-9]{1,3} extension right inside META-INF). * - * @param s file name + * @param name file name * @return true if the input file name is signature related */ public static boolean isSigningRelated(String name) { diff --git a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java index f3e71a793b3..4c941900468 100644 --- a/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java +++ b/jdk/src/java.base/share/classes/sun/security/validator/PKIXValidator.java @@ -36,7 +36,7 @@ import sun.security.provider.certpath.AlgorithmChecker; /** * Validator implementation built on the PKIX CertPath API. This - * implementation will be emphasized going forward.

      + * implementation will be emphasized going forward. *

      * Note that the validate() implementation tries to use a PKIX validator * if that appears possible and a PKIX builder otherwise. This increases diff --git a/jdk/src/java.base/share/classes/sun/security/validator/Validator.java b/jdk/src/java.base/share/classes/sun/security/validator/Validator.java index dd880a7b2dd..5bb2addbf32 100644 --- a/jdk/src/java.base/share/classes/sun/security/validator/Validator.java +++ b/jdk/src/java.base/share/classes/sun/security/validator/Validator.java @@ -228,7 +228,7 @@ public abstract class Validator { * used (see JSSE X509TrustManager specification). In the future, it * could be used to pass in a PKCS#7 object for code signing to check time * stamps. - *

      + * * @return a non-empty chain that was used to validate the path. The * end entity cert is at index 0, the trust anchor at index n-1. */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AlgIdDSA.java b/jdk/src/java.base/share/classes/sun/security/x509/AlgIdDSA.java index dc9c97dc591..c4d2f896b5d 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AlgIdDSA.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AlgIdDSA.java @@ -39,7 +39,7 @@ import sun.security.util.*; * NIST/IETF standard DER encoding. These are used to implement the Digital * Signature Standard (DSS), FIPS 186. * - *

      NOTE: DSS/DSA Algorithm IDs may be created without these + *

      NOTE: DSS/DSA Algorithm IDs may be created without these * parameters. Use of DSS/DSA in modes where parameters are * either implicit (e.g. a default applicable to a site or a larger scope), * or are derived from some Certificate Authority's DSS certificate, is @@ -49,8 +49,8 @@ import sun.security.util.*; * that we have a certificate called currentCert which doesn't * contain DSS/DSA parameters and we need to derive DSS/DSA parameters * from a CA's certificate called caCert. - *

      - *

      + *
      + * 
      {@code
        * // key containing parameters to use
        * DSAPublicKey cAKey = (DSAPublicKey)(caCert.getPublicKey());
        * // key without parameters
      @@ -63,7 +63,7 @@ import sun.security.util.*;
        *                                            cAKeyParams.getQ(),
        *                                            cAKeyParams.getG());
        * DSAPublicKey usableKey = kf.generatePublic(ks);
      - * 
      + * }
      * * @see java.security.interfaces.DSAParams * @see java.security.interfaces.DSAPublicKey diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java index afc642df2f7..69459fb6ef0 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java @@ -58,7 +58,7 @@ import sun.security.util.DerValue; * accessMethod OBJECT IDENTIFIER, * accessLocation GeneralName } *
      - *

      + * * @see Extension * @see CertAttrSet */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java index afd7c99683d..a8b04dea2b8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java @@ -117,17 +117,17 @@ implements CertAttrSet { * The default constructor for this extension. Null parameters make * the element optional (not present). * - * @param id the KeyIdentifier associated with this extension. + * @param kid the KeyIdentifier associated with this extension. * @param names the GeneralNames associated with this extension - * @param serialNum the CertificateSerialNumber associated with - * this extension. + * @param sn the CertificateSerialNumber associated with + * this extension. * @exception IOException on error. */ - public AuthorityKeyIdentifierExtension(KeyIdentifier kid, GeneralNames name, + public AuthorityKeyIdentifierExtension(KeyIdentifier kid, GeneralNames names, SerialNumber sn) throws IOException { this.id = kid; - this.names = name; + this.names = names; this.serialNum = sn; this.extensionId = PKIXExtensions.AuthorityKey_Id; diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java index c3814306978..eb2b0801fb8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java @@ -71,7 +71,7 @@ import sun.security.util.ObjectIdentifier; * * CRLDistPointsSyntax ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint *

      - *

      + * * @author Anne Anderson * @author Andreas Sterbenz * @since 1.4.2 diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CertificateSerialNumber.java b/jdk/src/java.base/share/classes/sun/security/x509/CertificateSerialNumber.java index 0e47fc87ed9..385c4917bf0 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CertificateSerialNumber.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificateSerialNumber.java @@ -57,7 +57,7 @@ public class CertificateSerialNumber implements CertAttrSet { /** * Default constructor for the certificate attribute. * - * @param serial the serial number for the certificate. + * @param num the serial number for the certificate. */ public CertificateSerialNumber(BigInteger num) { this.serial = new SerialNumber(num); @@ -66,7 +66,7 @@ public class CertificateSerialNumber implements CertAttrSet { /** * Default constructor for the certificate attribute. * - * @param serial the serial number for the certificate. + * @param num the serial number for the certificate. */ public CertificateSerialNumber(int num) { this.serial = new SerialNumber(num); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java b/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java index 2a35b86fb35..449d7550043 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/DNSName.java @@ -44,7 +44,7 @@ import sun.security.util.*; * the DNS representation for Internet mail addresses (wpolk.nist.gov * instead of wpolk@nist.gov) is not permitted; such identities are to * be encoded as rfc822Name. - *

      + * * @author Amit Kapoor * @author Hemma Prafullchandra */ @@ -186,9 +186,9 @@ public class DNSName implements GeneralNameInterface { * domain name comparisons for all present domain functions are done in a * case-insensitive manner, assuming an ASCII character set, and a high * order zero bit. - *

      + * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but narrowing and widening are * not supported for this name type. */ @@ -228,7 +228,7 @@ public class DNSName implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java index faca907518c..29b5f933dd3 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java @@ -143,9 +143,9 @@ public class DistributionPoint { * Constructor for the class using GeneralNames for DistributionPointName * * @param fullName the GeneralNames of the distribution point; may be null - * @param reasons the CRL reasons included in the CRL at this distribution + * @param reasonFlags the CRL reasons included in the CRL at this distribution * point; may be null - * @param issuer the name(s) of the CRL issuer for the CRL at this + * @param crlIssuer the name(s) of the CRL issuer for the CRL at this * distribution point; may be null */ public DistributionPoint(GeneralNames fullName, boolean[] reasonFlags, @@ -165,9 +165,9 @@ public class DistributionPoint { * * @param relativeName the RelativeDistinguishedName of the distribution * point; may not be null - * @param reasons the CRL reasons included in the CRL at this distribution + * @param reasonFlags the CRL reasons included in the CRL at this distribution * point; may be null - * @param issuer the name(s) of the CRL issuer for the CRL at this + * @param crlIssuer the name(s) of the CRL issuer for the CRL at this * distribution point; may not be null or empty. */ public DistributionPoint(RDN relativeName, boolean[] reasonFlags, diff --git a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java index feaf30bfd4f..e6a8c3bb076 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java @@ -146,7 +146,7 @@ public class EDIPartyName implements GeneralNameInterface { /** * Return the assignerName * - * @returns String assignerName + * @return String assignerName */ public String getAssignerName() { return assigner; @@ -155,7 +155,7 @@ public class EDIPartyName implements GeneralNameInterface { /** * Return the partyName * - * @returns String partyName + * @return String partyName */ public String getPartyName() { return party; @@ -166,7 +166,7 @@ public class EDIPartyName implements GeneralNameInterface { * comparison without regard to type of the partyName and * the assignerName. * - * @returns true if the two names match + * @return true if the two names match */ public boolean equals(Object other) { if (!(other instanceof EDIPartyName)) @@ -226,7 +226,7 @@ public class EDIPartyName implements GeneralNameInterface { * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is same type, but comparison operations are * not supported for this name type. */ @@ -247,7 +247,7 @@ public class EDIPartyName implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java index dc820770ef8..c8968448c7f 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/ExtendedKeyUsageExtension.java @@ -75,7 +75,7 @@ import sun.security.util.ObjectIdentifier; * processed independently and the certificate MUST only be used for a * purpose consistent with both fields. If there is no purpose * consistent with both fields, then the certificate MUST NOT be used - * for any purpose.

      + * for any purpose. * * @since 1.4 */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/Extension.java b/jdk/src/java.base/share/classes/sun/security/x509/Extension.java index a5bcc864717..04489d70094 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/Extension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/Extension.java @@ -50,11 +50,11 @@ import sun.security.util.*; * } * * All subclasses need to implement a constructor of the form - *

      + * 
      {@code
        *      (Boolean, Object)
      - * 
      + * }
      * where the Object is typically an array of DER encoded bytes. - *

      + * * @author Amit Kapoor * @author Hemma Prafullchandra */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralName.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralName.java index 0c03fa3167d..1cc95ce79e6 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,6 +116,15 @@ public class GeneralName { } break; + case GeneralNameInterface.NAME_X400: + if (encName.isContextSpecific() && encName.isConstructed()) { + encName.resetTag(DerValue.tag_IA5String); + name = new X400Address(encName); + } else { + throw new IOException("Invalid encoding of X400Address name"); + } + break; + case GeneralNameInterface.NAME_URI: if (encName.isContextSpecific() && !encName.isConstructed()) { encName.resetTag(DerValue.tag_IA5String); @@ -193,7 +202,7 @@ public class GeneralName { * Compare this GeneralName with another * * @param other GeneralName to compare to this - * @returns true if match + * @return true if match */ public boolean equals(Object other) { if (this == other) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralNameInterface.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralNameInterface.java index 1d81977e697..c26de28cf46 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralNameInterface.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralNameInterface.java @@ -85,7 +85,7 @@ public interface GeneralNameInterface { * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is same type, but comparison operations are * not supported for this name type. */ @@ -96,7 +96,7 @@ public interface GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ int subtreeDepth() throws UnsupportedOperationException; diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralNames.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralNames.java index 8e081aae6cf..ae9532d5dfa 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralNames.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralNames.java @@ -126,7 +126,7 @@ public class GeneralNames { /** * compare this GeneralNames to other object for equality * - * @returns true iff this equals other + * @return true if this equals obj */ public boolean equals(Object obj) { if (this == obj) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java index 9c12665cfb3..bbd2b2586bd 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java @@ -56,9 +56,9 @@ public class GeneralSubtree { /** * The default constructor for the class. * - * @params name the GeneralName - * @params min the minimum BaseDistance - * @params max the maximum BaseDistance + * @param name the GeneralName + * @param min the minimum BaseDistance + * @param max the maximum BaseDistance */ public GeneralSubtree(GeneralName name, int min, int max) { this.name = name; @@ -142,7 +142,7 @@ public class GeneralSubtree { * Compare this GeneralSubtree with another * * @param other GeneralSubtree to compare to this - * @returns true if match + * @return true if match */ public boolean equals(Object other) { if (!(other instanceof GeneralSubtree)) @@ -187,7 +187,7 @@ public class GeneralSubtree { /** * Encode the GeneralSubtree. * - * @params out the DerOutputStream to encode this object to. + * @param out the DerOutputStream to encode this object to. */ public void encode(DerOutputStream out) throws IOException { DerOutputStream seq = new DerOutputStream(); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java index 2d6e3a1df21..40c4db15986 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java @@ -37,7 +37,6 @@ import sun.security.util.*; *

        * GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
        * 
      - *

      * * * @author Amit Kapoor @@ -132,7 +131,7 @@ public class GeneralSubtrees implements Cloneable { /** * Encode the GeneralSubtrees. * - * @params out the DerOutputStrean to encode this object to. + * @param out the DerOutputStrean to encode this object to. */ public void encode(DerOutputStream out) throws IOException { DerOutputStream seq = new DerOutputStream(); @@ -147,8 +146,8 @@ public class GeneralSubtrees implements Cloneable { * Compare two general subtrees by comparing the subtrees * of each. * - * @param other GeneralSubtrees to compare to this - * @returns true if match + * @param obj GeneralSubtrees to compare to this + * @return true if match */ public boolean equals(Object obj) { if (this == obj) { @@ -236,8 +235,8 @@ public class GeneralSubtrees implements Cloneable { * create a subtree containing an instance of the input * name type that widens all other names of that type. * - * @params name GeneralNameInterface name - * @returns GeneralSubtree containing widest name of that type + * @param name GeneralNameInterface name + * @return GeneralSubtree containing widest name of that type * @throws RuntimeException on error (should not occur) */ private GeneralSubtree createWidestSubtree(GeneralNameInterface name) { @@ -309,10 +308,10 @@ public class GeneralSubtrees implements Cloneable { * the result contains the name in other. This means that * the name is now constrained in some way, whereas before it was * completely permitted. - *
        + *
      * * @param other GeneralSubtrees to be intersected with this - * @returns GeneralSubtrees to be merged with excluded; these are + * @return GeneralSubtrees to be merged with excluded; these are * empty-valued name types corresponding to entries that were * of the same type but did not share the same subtree between * this and other. Returns null if no such. diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java index 084a6f3760a..d9dd126baaa 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java @@ -75,7 +75,7 @@ public class IPAddressName implements GeneralNameInterface { /** * Create the IPAddressName object from the passed encoded Der value. * - * @params derValue the encoded DER IPAddressName. + * @param derValue the encoded DER IPAddressName. * @exception IOException on error. */ public IPAddressName(DerValue derValue) throws IOException { @@ -85,7 +85,7 @@ public class IPAddressName implements GeneralNameInterface { /** * Create the IPAddressName object with the specified octets. * - * @params address the IP address + * @param address the IP address * @throws IOException if address is not a valid IPv4 or IPv6 address */ public IPAddressName(byte[] address) throws IOException { @@ -106,7 +106,7 @@ public class IPAddressName implements GeneralNameInterface { /** * Create an IPAddressName from a String. - * [IETF RFC1338 Supernetting & IETF RFC1519 Classless Inter-Domain + * [IETF RFC1338 Supernetting {@literal &} IETF RFC1519 Classless Inter-Domain * Routing (CIDR)] For IPv4 addresses, the forms are * "b1.b2.b3.b4" or "b1.b2.b3.b4/m1.m2.m3.m4", where b1 - b4 are decimal * byte values 0-255 and m1 - m4 are decimal mask values @@ -118,7 +118,7 @@ public class IPAddressName implements GeneralNameInterface { * of the address. If /n is used, n is a decimal number indicating how many * of the leftmost contiguous bits of the address comprise the prefix for * this subnet. Internally, a mask value is created using the prefix length. - *

      + * * @param name String form of IPAddressName * @throws IOException if name can not be converted to a valid IPv4 or IPv6 * address @@ -224,7 +224,7 @@ public class IPAddressName implements GeneralNameInterface { /** * Encode the IPAddress name into the DerOutputStream. * - * @params out the DER stream to encode the IPAddressName to. + * @param out the DER stream to encode the IPAddressName to. * @exception IOException on encoding errors. */ public void encode(DerOutputStream out) throws IOException { @@ -384,9 +384,9 @@ public class IPAddressName implements GeneralNameInterface { * constraint for "class C" subnet 10.9.8.0 shall be represented as the * octets 0A 09 08 00 FF FF FF 00, representing the CIDR notation * 10.9.8.0/255.255.255.0. - *

      + * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but * narrowing and widening are not supported for this name type. */ @@ -479,7 +479,7 @@ public class IPAddressName implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java index 50bf342a17b..a20a1f55803 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/InhibitAnyPolicyExtension.java @@ -50,13 +50,13 @@ import sun.security.util.ObjectIdentifier; * This extension MUST be critical. *

      * The ASN.1 syntax for this extension is: - *

      + * 
      {@code
        * id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::=  { id-ce 54 }
        *
        * InhibitAnyPolicy ::= SkipCerts
        *
        * SkipCerts ::= INTEGER (0..MAX)
      - * 
      + * }
      * @author Anne Anderson * @see CertAttrSet * @see Extension @@ -211,7 +211,7 @@ implements CertAttrSet { * Get the attribute value. * * @param name name of attribute to get. Must be SKIP_CERTS. - * @returns value of the attribute. In this case it will be of type + * @return value of the attribute. In this case it will be of type * Integer. * @throws IOException on error */ @@ -244,7 +244,7 @@ implements CertAttrSet { * Return an enumeration of names of attributes existing within this * attribute. * - * @returns enumeration of elements + * @return enumeration of elements */ public Enumeration getElements() { AttributeNameEnumeration elements = new AttributeNameEnumeration(); @@ -255,7 +255,7 @@ implements CertAttrSet { /** * Return the name of this attribute. * - * @returns name of attribute. + * @return name of attribute. */ public String getName() { return (NAME); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java b/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java index 01d4803cecf..f60765f8ace 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java @@ -69,7 +69,7 @@ public class KeyIdentifier { *
    • The keyIdentifier is composed of the 160-bit SHA-1 hash of the * value of the BIT STRING subjectPublicKey (excluding the tag, * length, and number of unused bits). - *

      + * *

    • The keyIdentifier is composed of a four bit type field with * the value 0100 followed by the least significant 60 bits of the * SHA-1 hash of the value of the BIT STRING subjectPublicKey. diff --git a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java index f043183b95c..a8d46a8a8d0 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java @@ -328,7 +328,7 @@ implements CertAttrSet, Cloneable { * (k) If excludedSubtrees is present in the certificate, set the * excluded subtrees state variable to the union of its previous * value and the value indicated in the extension field. - *

      + * * @param newConstraints additional NameConstraints to be applied * @throws IOException on error */ @@ -406,7 +406,7 @@ implements CertAttrSet, Cloneable { * the excluded subtrees state variables. * * @param cert X509Certificate to be verified - * @returns true if certificate verifies successfully + * @return true if certificate verifies successfully * @throws IOException on error */ public boolean verify(X509Certificate cert) throws IOException { @@ -484,7 +484,7 @@ implements CertAttrSet, Cloneable { * permitted and excluded subtrees variables. * * @param name GeneralNameInterface name to be verified - * @returns true if certificate verifies successfully + * @return true if certificate verifies successfully * @throws IOException on error */ public boolean verify(GeneralNameInterface name) throws IOException { @@ -566,7 +566,7 @@ implements CertAttrSet, Cloneable { * NameConstraints. * * @param subject the certificate's subject name - * @returns true if certificate verifies successfully + * @return true if certificate verifies successfully * @throws IOException on error */ public boolean verifyRFC822SpecialCase(X500Name subject) throws IOException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java b/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java index f6358b92fd1..c8f0da3a671 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/OIDMap.java @@ -33,8 +33,8 @@ import java.security.cert.CertificateException; import sun.security.util.*; /** - * This class defines the mapping from OID & name to classes and vice - * versa. Used by CertificateExtensions & PKCS10 to get the java + * This class defines the mapping from OID {@literal &} name to classes and vice + * versa. Used by CertificateExtensions {@literal &} PKCS10 to get the java * classes associated with a particular OID/name. * * @author Amit Kapoor diff --git a/jdk/src/java.base/share/classes/sun/security/x509/OIDName.java b/jdk/src/java.base/share/classes/sun/security/x509/OIDName.java index 44187b036e0..b5435eb0653 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/OIDName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/OIDName.java @@ -55,7 +55,7 @@ public class OIDName implements GeneralNameInterface { /** * Create the OIDName object with the specified name. * - * @param name the OIDName. + * @param oid the OIDName. */ public OIDName(ObjectIdentifier oid) { this.oid = oid; @@ -143,7 +143,7 @@ public class OIDName implements GeneralNameInterface { * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but narrowing and widening are * not supported for this name type. */ @@ -166,7 +166,7 @@ public class OIDName implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/OtherName.java b/jdk/src/java.base/share/classes/sun/security/x509/OtherName.java index d2b68dae026..5b73fb1a176 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/OtherName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/OtherName.java @@ -237,7 +237,7 @@ public class OtherName implements GeneralNameInterface { * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is same type, but * comparison operations are not supported for this name type. */ @@ -258,7 +258,7 @@ public class OtherName implements GeneralNameInterface { * Return subtree depth of this name for purposes of determining * NameConstraints minimum and maximum bounds. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java index d37bafccc1d..175201c732b 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java @@ -88,9 +88,9 @@ implements CertAttrSet { * * @param maps the List of CertificatePolicyMap. */ - public PolicyMappingsExtension(List map) + public PolicyMappingsExtension(List maps) throws IOException { - this.maps = map; + this.maps = maps; this.extensionId = PKIXExtensions.PolicyMappings_Id; this.critical = true; encodeThis(); @@ -108,8 +108,8 @@ implements CertAttrSet { /** * Create the extension from the passed DER encoded value. * - * @params critical true if the extension is to be treated as critical. - * @params value an array of DER encoded bytes of the actual value. + * @param critical true if the extension is to be treated as critical. + * @param value an array of DER encoded bytes of the actual value. * @exception ClassCastException if value is not an array of bytes * @exception IOException on error. */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java index 4a59176c3e1..aa492e4e127 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java @@ -95,7 +95,7 @@ public class RDN { * preceded by '\'. * * @param name String form of RDN - * @param keyword an additional mapping of keywords to OIDs + * @param keywordMap an additional mapping of keywords to OIDs * @throws IOException on parsing error */ public RDN(String name, Map keywordMap) throws IOException { @@ -307,7 +307,7 @@ public class RDN { * Calculates a hash code value for the object. Objects * which are equal will also have the same hashcode. * - * @returns int hashCode value + * @return int hashCode value */ public int hashCode() { return toRFC2253String(true).hashCode(); @@ -316,8 +316,8 @@ public class RDN { /* * return specified attribute value from RDN * - * @params oid ObjectIdentifier of attribute to be found - * @returns DerValue of attribute value; null if attribute does not exist + * @param oid ObjectIdentifier of attribute to be found + * @return DerValue of attribute value; null if attribute does not exist */ DerValue findAttribute(ObjectIdentifier oid) { for (int i = 0; i < assertion.length; i++) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/RFC822Name.java b/jdk/src/java.base/share/classes/sun/security/x509/RFC822Name.java index e905ae1b7f2..57d5ffdd8a2 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/RFC822Name.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/RFC822Name.java @@ -174,9 +174,9 @@ public class RFC822Name implements GeneralNameInterface * surrounded in parentheses) after it, and is not surrounded by "<" and * ">". Note that while upper and lower case letters are allowed in an * RFC 822 addr-spec, no significance is attached to the case. - *

      + * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but narrowing and widening are * not supported for this name type. */ @@ -232,7 +232,7 @@ public class RFC822Name implements GeneralNameInterface * Return subtree depth of this name for purposes of determining * NameConstraints minimum and maximum bounds. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java index 20e6489398b..43defaaa176 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java @@ -62,7 +62,7 @@ import sun.security.util.DerValue; * accessMethod OBJECT IDENTIFIER, * accessLocation GeneralName } * - *

      + * * @see Extension * @see CertAttrSet */ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/URIName.java b/jdk/src/java.base/share/classes/sun/security/x509/URIName.java index 4331461f1b9..2f3e107ef0b 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/URIName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/URIName.java @@ -52,10 +52,10 @@ import sun.security.util.*; *

      * [RFC1738] In general, URLs are written as follows: *

      - * :
      + * {@code :}
        * 
      - * A URL contains the name of the scheme being used () followed - * by a colon and then a string (the ) whose + * A URL contains the name of the scheme being used ({@code }) followed + * by a colon and then a string (the {@code }) whose * interpretation depends on the scheme. *

      * While the syntax for the rest of the URL may vary depending on the @@ -63,13 +63,13 @@ import sun.security.util.*; * of an IP-based protocol to a specified host on the Internet use a * common syntax for the scheme-specific data: *

      - * //:@:/
      + * {@code //:@:/}
        * 
      * [RFC2732] specifies that an IPv6 address contained inside a URL * must be enclosed in square brackets (to allow distinguishing the * colons that separate IPv6 components from the colons that separate * scheme-specific data. - *

      + * * @author Amit Kapoor * @author Hemma Prafullchandra * @author Sean Mullan @@ -246,7 +246,7 @@ public class URIName implements GeneralNameInterface { /** * Return the scheme name portion of a URIName * - * @returns scheme portion of full name + * @return scheme portion of full name */ public String getScheme() { return uri.getScheme(); @@ -255,7 +255,7 @@ public class URIName implements GeneralNameInterface { /** * Return the host name or IP address portion of the URIName * - * @returns host name or IP address portion of full name + * @return host name or IP address portion of full name */ public String getHost() { return host; @@ -266,7 +266,7 @@ public class URIName implements GeneralNameInterface { * DNSName, then this host object does not include any * initial "." on the name. * - * @returns host name as DNSName or IPAddressName + * @return host name as DNSName or IPAddressName */ public Object getHostObject() { if (hostIP != null) { @@ -308,9 +308,9 @@ public class URIName implements GeneralNameInterface { * abc.def.xyz.com. However, the constraint ".xyz.com" is not satisfied * by "xyz.com". When the constraint does not begin with a period, it * specifies a host. - *

      + * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but * narrowing and widening are not supported for this name type. */ @@ -377,7 +377,7 @@ public class URIName implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java b/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java index dc50208a7c2..6060d342196 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/UniqueIdentity.java @@ -73,7 +73,6 @@ public class UniqueIdentity { * Create the object, decoding the values from the passed DER stream. * * @param derVal the DerValue decoded from the stream. - * @param tag the tag the value is encoded under. * @exception IOException on decoding errors. */ public UniqueIdentity(DerValue derVal) throws IOException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X400Address.java b/jdk/src/java.base/share/classes/sun/security/x509/X400Address.java index bfa8f94557b..35839e87825 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X400Address.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X400Address.java @@ -340,7 +340,7 @@ public class X400Address implements GeneralNameInterface { /** * Create the X400Address object from the specified byte array * - * @param nameValue value of the name as a byte array + * @param value value of the name as a byte array */ public X400Address(byte[] value) { nameValue = value; @@ -392,7 +392,7 @@ public class X400Address implements GeneralNameInterface { * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is same type, but comparison operations are * not supported for this name type. */ @@ -413,7 +413,7 @@ public class X400Address implements GeneralNameInterface { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java index 2b35f7a63af..578f8026666 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java @@ -84,14 +84,14 @@ import javax.security.auth.x500.X500Principal; *

    • attribute values encoded in different types (e.g., * PrintableString and BMPString) may be assumed to represent * different strings; - *

      + * *

    • attribute values in types other than PrintableString are case * sensitive (this permits matching of attribute values as binary * objects); - *

      + * *

    • attribute values in PrintableString are not case sensitive * (e.g., "Marianne Swanson" is the same as "MARIANNE SWANSON"); and - *

      + * *

    • attribute values in PrintableString are compared after * removing leading and trailing white space and converting internal * substrings of one or more consecutive white space characters to a @@ -1242,12 +1242,13 @@ public class X500Name implements GeneralNameInterface, Principal { *
    • NAME_NARROWS = 1: input name narrows this name *
    • NAME_WIDENS = 2: input name widens this name *
    • NAME_SAME_TYPE = 3: input name does not match or narrow this name, - & but is same type - * . These results are used in checking NameConstraints during + * but is same type. + * + * These results are used in checking NameConstraints during * certification path verification. * * @param inputName to be checked for being constrained - * @returns constraint type above + * @return constraint type above * @throws UnsupportedOperationException if name is not exact match, but * narrowing and widening are not supported for this name type. */ @@ -1313,7 +1314,7 @@ public class X500Name implements GeneralNameInterface, Principal { * NameConstraints minimum and maximum bounds and for calculating * path lengths in name subtrees. * - * @returns distance of name from root + * @return distance of name from root * @throws UnsupportedOperationException if not supported for this name type */ public int subtreeDepth() throws UnsupportedOperationException { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java index ab7270995fb..ccc7b893430 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java @@ -125,7 +125,7 @@ public class X509CRLEntryImpl extends X509CRLEntry /** * Unmarshals a revoked certificate from its encoded form. * - * @param derVal the DER value containing the revoked certificate. + * @param derValue the DER value containing the revoked certificate. * @exception CRLException on parsing errors. */ public X509CRLEntryImpl(DerValue derValue) throws CRLException { @@ -271,7 +271,7 @@ public class X509CRLEntryImpl extends X509CRLEntry /** * get Reason Code from CRL entry. * - * @returns Integer or null, if no such extension + * @return Integer or null, if no such extension * @throws IOException on error */ public Integer getReasonCode() throws IOException { @@ -432,7 +432,7 @@ public class X509CRLEntryImpl extends X509CRLEntry * get an extension * * @param oid ObjectIdentifier of extension desired - * @returns Extension of type or null, if not found + * @return Extension of type {@code } or null, if not found */ public Extension getExtension(ObjectIdentifier oid) { if (extensions == null) diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java index ade169e53a8..3797105c770 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java @@ -185,8 +185,8 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { * Initial CRL constructor, no revoked certs, and no extensions. * * @param issuer the name of the CA issuing this CRL. - * @param thisUpdate the Date of this issue. - * @param nextUpdate the Date of the next CRL. + * @param thisDate the Date of this issue. + * @param nextDate the Date of the next CRL. */ public X509CRLImpl(X500Name issuer, Date thisDate, Date nextDate) { this.issuer = issuer; @@ -198,8 +198,8 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { * CRL constructor, revoked certs, no extensions. * * @param issuer the name of the CA issuing this CRL. - * @param thisUpdate the Date of this issue. - * @param nextUpdate the Date of the next CRL. + * @param thisDate the Date of this issue. + * @param nextDate the Date of the next CRL. * @param badCerts the array of CRL entries. * * @exception CRLException on parsing/construction errors. @@ -237,8 +237,8 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { * CRL constructor, revoked certs and extensions. * * @param issuer the name of the CA issuing this CRL. - * @param thisUpdate the Date of this issue. - * @param nextUpdate the Date of the next CRL. + * @param thisDate the Date of this issue. + * @param nextDate the Date of the next CRL. * @param badCerts the array of CRL entries. * @param crlExts the CRL extensions. * @@ -832,8 +832,8 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the AuthorityKeyIdentifier, if any. * - * @returns AuthorityKeyIdentifier or null - * (if no AuthorityKeyIdentifierExtension) + * @return AuthorityKeyIdentifier or null + * (if no AuthorityKeyIdentifierExtension) * @throws IOException on error */ public KeyIdentifier getAuthKeyId() throws IOException { @@ -850,7 +850,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the AuthorityKeyIdentifierExtension, if any. * - * @returns AuthorityKeyIdentifierExtension or null (if no such extension) + * @return AuthorityKeyIdentifierExtension or null (if no such extension) * @throws IOException on error */ public AuthorityKeyIdentifierExtension getAuthKeyIdExtension() @@ -862,7 +862,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the CRLNumberExtension, if any. * - * @returns CRLNumberExtension or null (if no such extension) + * @return CRLNumberExtension or null (if no such extension) * @throws IOException on error */ public CRLNumberExtension getCRLNumberExtension() throws IOException { @@ -873,7 +873,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the CRL number from the CRLNumberExtension, if any. * - * @returns number or null (if no such extension) + * @return number or null (if no such extension) * @throws IOException on error */ public BigInteger getCRLNumber() throws IOException { @@ -889,7 +889,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the DeltaCRLIndicatorExtension, if any. * - * @returns DeltaCRLIndicatorExtension or null (if no such extension) + * @return DeltaCRLIndicatorExtension or null (if no such extension) * @throws IOException on error */ public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension() @@ -902,7 +902,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the base CRL number from the DeltaCRLIndicatorExtension, if any. * - * @returns number or null (if no such extension) + * @return number or null (if no such extension) * @throws IOException on error */ public BigInteger getBaseCRLNumber() throws IOException { @@ -918,7 +918,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the IssuerAlternativeNameExtension, if any. * - * @returns IssuerAlternativeNameExtension or null (if no such extension) + * @return IssuerAlternativeNameExtension or null (if no such extension) * @throws IOException on error */ public IssuerAlternativeNameExtension getIssuerAltNameExtension() @@ -930,8 +930,8 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { /** * return the IssuingDistributionPointExtension, if any. * - * @returns IssuingDistributionPointExtension or null - * (if no such extension) + * @return IssuingDistributionPointExtension or null + * (if no such extension) * @throws IOException on error */ public IssuingDistributionPointExtension @@ -1043,7 +1043,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { * get an extension * * @param oid ObjectIdentifier of extension desired - * @returns Object of type or null, if not found + * @return Object of type {@code } or null, if not found * @throws IOException on error */ public Object getExtension(ObjectIdentifier oid) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java index 201e10a6cfe..d1142a26336 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java @@ -247,7 +247,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { * read input stream as HEX-encoded DER-encoded bytes * * @param in InputStream to read - * @returns DerValue corresponding to decoded HEX-encoded bytes + * @return DerValue corresponding to decoded HEX-encoded bytes * @throws IOException if stream can not be interpreted as RFC1421 * encoded bytes */ @@ -289,8 +289,8 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { * Construct an initialized X509 Certificate. The certificate is stored * in raw form and has to be signed to be useful. * - * @params info the X509CertificateInfo which the Certificate is to be - * created from. + * @param certInfo the X509CertificateInfo which the Certificate is to be + * created from. */ public X509CertImpl(X509CertInfo certInfo) { this.info = certInfo; diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java index fa64e9d0fc2..9411519eec8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java @@ -38,8 +38,9 @@ import sun.misc.HexDumpEncoder; /** * The X509CertInfo class represents X.509 certificate information. * - *

      X.509 certificates have several base data elements, including:

        + *

        X.509 certificates have several base data elements, including: * + *

          *
        • The Subject Name, an X.500 Distinguished Name for * the entity (subject) for which the certificate was issued. * @@ -54,6 +55,7 @@ import sun.misc.HexDumpEncoder; * *
        • A Serial Number assigned by the CA, for use in * certificate revocation and other applications. + *
        * * @author Amit Kapoor * @author Hemma Prafullchandra @@ -356,8 +358,8 @@ public class X509CertInfo implements CertAttrSet { /** * Set the certificate attribute. * - * @params name the name of the Certificate attribute. - * @params val the value of the Certificate attribute. + * @param name the name of the Certificate attribute. + * @param val the value of the Certificate attribute. * @exception CertificateException on invalid attributes. * @exception IOException on other errors. */ @@ -446,7 +448,7 @@ public class X509CertInfo implements CertAttrSet { /** * Delete the certificate attribute. * - * @params name the name of the Certificate attribute. + * @param name the name of the Certificate attribute. * @exception CertificateException on invalid attributes. * @exception IOException on other errors. */ @@ -525,7 +527,7 @@ public class X509CertInfo implements CertAttrSet { /** * Get the certificate attribute. * - * @params name the name of the Certificate attribute. + * @param name the name of the Certificate attribute. * * @exception CertificateException on invalid attributes. * @exception IOException on other errors. @@ -812,7 +814,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the version number of the certificate. * - * @params val the Object class value for the Extensions + * @param val the Object class value for the Extensions * @exception CertificateException on invalid data. */ private void setVersion(Object val) throws CertificateException { @@ -825,7 +827,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the serial number of the certificate. * - * @params val the Object class value for the CertificateSerialNumber + * @param val the Object class value for the CertificateSerialNumber * @exception CertificateException on invalid data. */ private void setSerialNumber(Object val) throws CertificateException { @@ -838,7 +840,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the algorithm id of the certificate. * - * @params val the Object class value for the AlgorithmId + * @param val the Object class value for the AlgorithmId * @exception CertificateException on invalid data. */ private void setAlgorithmId(Object val) throws CertificateException { @@ -852,7 +854,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the issuer name of the certificate. * - * @params val the Object class value for the issuer + * @param val the Object class value for the issuer * @exception CertificateException on invalid data. */ private void setIssuer(Object val) throws CertificateException { @@ -866,7 +868,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the validity interval of the certificate. * - * @params val the Object class value for the CertificateValidity + * @param val the Object class value for the CertificateValidity * @exception CertificateException on invalid data. */ private void setValidity(Object val) throws CertificateException { @@ -880,7 +882,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the subject name of the certificate. * - * @params val the Object class value for the Subject + * @param val the Object class value for the Subject * @exception CertificateException on invalid data. */ private void setSubject(Object val) throws CertificateException { @@ -894,7 +896,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the public key in the certificate. * - * @params val the Object class value for the PublicKey + * @param val the Object class value for the PublicKey * @exception CertificateException on invalid data. */ private void setKey(Object val) throws CertificateException { @@ -908,7 +910,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the Issuer Unique Identity in the certificate. * - * @params val the Object class value for the IssuerUniqueId + * @param val the Object class value for the IssuerUniqueId * @exception CertificateException */ private void setIssuerUniqueId(Object val) throws CertificateException { @@ -925,7 +927,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the Subject Unique Identity in the certificate. * - * @params val the Object class value for the SubjectUniqueId + * @param val the Object class value for the SubjectUniqueId * @exception CertificateException */ private void setSubjectUniqueId(Object val) throws CertificateException { @@ -942,7 +944,7 @@ public class X509CertInfo implements CertAttrSet { /** * Set the extensions in the certificate. * - * @params val the Object class value for the Extensions + * @param val the Object class value for the Extensions * @exception CertificateException */ private void setExtensions(Object val) throws CertificateException { diff --git a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index 75efc60e0db..2a9242c1e79 100644 --- a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -152,9 +152,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { String GST[] = new String[] {"Gulf Standard Time", "GST", "Gulf Daylight Time", "GDT", "Gulf Time", "GT"}; - String HAST[] = new String[] {"Hawaii-Aleutian Standard Time", "HAST", - "Hawaii-Aleutian Daylight Time", "HADT", - "Hawaii-Aleutian Time", "HAT"}; String HKT[] = new String[] {"Hong Kong Time", "HKT", "Hong Kong Summer Time", "HKST", "Hong Kong Time", "HKT"}; @@ -371,7 +368,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -393,7 +390,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { "Paraguay Summer Time", "PYST", "Paraguay Time", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/java.base/share/native/include/jvm.h b/jdk/src/java.base/share/native/include/jvm.h index 7177f2e1d1e..91decb2ed82 100644 --- a/jdk/src/java.base/share/native/include/jvm.h +++ b/jdk/src/java.base/share/native/include/jvm.h @@ -395,6 +395,9 @@ JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass); JNIEXPORT jclass JNICALL JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass); +JNIEXPORT jstring JNICALL +JVM_GetSimpleBinaryName(JNIEnv *env, jclass ofClass); + /* Generics support (JDK 1.5) */ JNIEXPORT jstring JNICALL JVM_GetClassSignature(JNIEnv *env, jclass cls); diff --git a/jdk/src/java.base/share/native/libjava/Class.c b/jdk/src/java.base/share/native/libjava/Class.c index ae759514a79..07a3f6db716 100644 --- a/jdk/src/java.base/share/native/libjava/Class.c +++ b/jdk/src/java.base/share/native/libjava/Class.c @@ -67,6 +67,7 @@ static JNINativeMethod methods[] = { {"getProtectionDomain0", "()" PD, (void *)&JVM_GetProtectionDomain}, {"getDeclaredClasses0", "()[" CLS, (void *)&JVM_GetDeclaredClasses}, {"getDeclaringClass0", "()" CLS, (void *)&JVM_GetDeclaringClass}, + {"getSimpleBinaryName0", "()" STR, (void *)&JVM_GetSimpleBinaryName}, {"getGenericSignature0", "()" STR, (void *)&JVM_GetClassSignature}, {"getRawAnnotations", "()" BA, (void *)&JVM_GetClassAnnotations}, {"getConstantPool", "()" CPL, (void *)&JVM_GetClassConstantPool}, diff --git a/jdk/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java b/jdk/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java index 128b0ba8afd..f265f4c44fe 100644 --- a/jdk/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java +++ b/jdk/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java @@ -33,7 +33,6 @@ import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.management.DynamicMBean; import javax.management.ObjectName; import sun.management.ManagementFactoryHelper; import sun.management.spi.PlatformMBeanProvider; @@ -162,8 +161,7 @@ class DefaultPlatformMBeanProvider extends PlatformMBeanProvider { @Override public Set> mbeanInterfaces() { return Stream.of(MemoryManagerMXBean.class, - GarbageCollectorMXBean.class, - com.sun.management.GarbageCollectorMXBean.class).collect(Collectors.toSet()); + GarbageCollectorMXBean.class).collect(Collectors.toSet()); } @Override @@ -464,39 +462,6 @@ class DefaultPlatformMBeanProvider extends PlatformMBeanProvider { }); - /** - * DynamicMBean - */ - HashMap dynmbeans - = ManagementFactoryHelper.getPlatformDynamicMBeans(); - final Set dynamicMBeanInterfaceNames = - Collections.unmodifiableSet(Collections.singleton("javax.management.DynamicMBean")); - for (Map.Entry e : dynmbeans.entrySet()) { - initMBeanList.add(new PlatformComponent() { - @Override - public Set> mbeanInterfaces() { - return Collections.emptySet(); - } - - @Override - public Set mbeanInterfaceNames() { - return dynamicMBeanInterfaceNames; - } - - @Override - public String getObjectNamePattern() { - return e.getKey().getCanonicalName(); - } - - @Override - public Map nameToMBeanMap() { - return Collections.singletonMap( - e.getKey().getCanonicalName(), - e.getValue()); - } - }); - } - initMBeanList.trimToSize(); return initMBeanList; } diff --git a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java index 9a0e1ebbd61..82508822954 100644 --- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java +++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java @@ -582,7 +582,7 @@ public class ManagementFactory { final Class cls = mxbeanInterface; ClassLoader loader = AccessController.doPrivileged( - (PrivilegedAction) () -> cls.getClassLoader()); + (PrivilegedAction) () -> cls.getClassLoader()); if (!sun.misc.VM.isSystemDomainLoader(loader)) { throw new IllegalArgumentException(mxbeanName + " is not a platform MXBean"); @@ -883,7 +883,7 @@ public class ManagementFactory { all.add(new DefaultPlatformMBeanProvider()); return all; }, null, new FilePermission("<>", "read"), - new RuntimePermission("sun.management.spi.PlatformMBeanProvider")); + new RuntimePermission("sun.management.spi.PlatformMBeanProvider.subclass")); // load all platform components into a map componentMap = providers.stream() @@ -970,4 +970,11 @@ public class ManagementFactory { return singleton; } } + + static { + AccessController.doPrivileged((PrivilegedAction) () -> { + System.loadLibrary("management"); + return null; + }); + } } diff --git a/jdk/src/java.management/share/classes/sun/management/Agent.java b/jdk/src/java.management/share/classes/sun/management/Agent.java index 3128ca442ea..ffb3105255e 100644 --- a/jdk/src/java.management/share/classes/sun/management/Agent.java +++ b/jdk/src/java.management/share/classes/sun/management/Agent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import java.lang.management.ManagementFactory; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.InetAddress; +import java.net.MalformedURLException; import java.net.UnknownHostException; import java.text.MessageFormat; import java.util.MissingResourceException; @@ -55,6 +56,125 @@ import sun.misc.VMSupport; * system class loader. Also jmx framework could be started by jcmd */ public class Agent { + /** + * Agent status collector strategy class + */ + private static abstract class StatusCollector { + final protected StringBuilder sb = new StringBuilder(); + final public String collect() { + Properties agentProps = VMSupport.getAgentProperties(); + String localConnAddr = (String)agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP); + if (localConnAddr != null || jmxServer != null) { + addAgentStatus(true); + appendConnections(localConnAddr); + } else { + addAgentStatus(false); + } + return sb.toString(); + } + + private void appendConnections(String localConnAddr) { + appendConnectionsHeader(); + if (localConnAddr != null) { + try { + JMXServiceURL u = new JMXServiceURL(localConnAddr); + addConnection(false, u); + } catch (MalformedURLException e) { + // will never happen + } + + } + if (jmxServer != null) { + addConnection(true, jmxServer.getAddress()); + } + appendConnectionsFooter(); + } + + private void addConnection(boolean remote, JMXServiceURL u) { + appendConnectionHeader(remote); + addConnectionDetails(u); + if (remote) { + addConfigProperties(); + } + appendConnectionFooter(remote); + } + + private void addConfigProperties() { + appendConfigPropsHeader(); + boolean[] first = new boolean[] {true}; + configProps.entrySet().stream().forEach((e) -> { + String key = (String)e.getKey(); + if (key.startsWith("com.sun.management.")) { + addConfigProp(key, e.getValue(), first[0]); + first[0] = false; + } + }); + appendConfigPropsFooter(); + } + + abstract protected void addAgentStatus(boolean enabled); + abstract protected void appendConnectionsHeader(); + abstract protected void appendConnectionsFooter(); + abstract protected void addConnectionDetails(JMXServiceURL u); + abstract protected void appendConnectionHeader(boolean remote); + abstract protected void appendConnectionFooter(boolean remote); + abstract protected void appendConfigPropsHeader(); + abstract protected void appendConfigPropsFooter(); + abstract protected void addConfigProp(String key, Object value, boolean first); + } + + /** + * Free-text status collector strategy implementation + */ + final private static class TextStatusCollector extends StatusCollector { + + @Override + protected void addAgentStatus(boolean enabled) { + sb.append("Agent: ").append(enabled ? "enabled" : "disabled").append('\n'); + } + + @Override + protected void appendConnectionsHeader() { + sb.append('\n'); + } + + @Override + protected void addConnectionDetails(JMXServiceURL u) { + sb.append("Protocol : ").append(u.getProtocol()).append('\n') + .append("Host : ").append(u.getHost()).append('\n') + .append("URL : ").append(u).append('\n'); + } + + @Override + protected void appendConnectionHeader(boolean remote) { + sb.append("Connection Type: ").append(remote ? "remote" : "local").append('\n'); + } + + @Override + protected void appendConfigPropsHeader() { + sb.append("Properties :\n"); + } + + @Override + protected void addConfigProp(String key, Object value, boolean first) { + if (!first) { + sb.append('\n'); + } + sb.append(" ").append(key).append(" = ").append(value); + } + + @Override + protected void appendConnectionsFooter() {} + + @Override + protected void appendConnectionFooter(boolean remote) { + sb.append('\n'); + } + + @Override + protected void appendConfigPropsFooter() {} + } + // management properties private static Properties mgmtProps; @@ -81,6 +201,8 @@ public class Agent { // The only active agent allowed private static JMXConnectorServer jmxServer = null; + // The properties used to configure the server + private static Properties configProps = null; // Parse string com.sun.management.prop=xxx,com.sun.management.prop=yyyy // and return property set if args is null or empty @@ -161,7 +283,7 @@ public class Agent { try { Properties argProps = parseString(args); - Properties configProps = new Properties(); + configProps = new Properties(); // Load the management properties from the config file // if config file is not specified readConfiguration implicitly @@ -228,9 +350,14 @@ public class Agent { // Don't cause any errors. jmxServer.stop(); jmxServer = null; + configProps = null; } } + private static synchronized String getManagementAgentStatus() throws Exception { + return new TextStatusCollector().collect(); + } + private static void startAgent(Properties props) throws Exception { String snmpPort = props.getProperty(SNMP_PORT); String jmxremote = props.getProperty(JMXREMOTE); diff --git a/jdk/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java b/jdk/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java index 251dad43e04..9c1373f854e 100644 --- a/jdk/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java +++ b/jdk/src/java.management/share/classes/sun/management/GarbageCollectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,168 +25,31 @@ package sun.management; -import com.sun.management.GarbageCollectorMXBean; -import com.sun.management.GarbageCollectionNotificationInfo; +import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.MemoryUsage; - -import com.sun.management.GcInfo; -import javax.management.openmbean.CompositeData; -import javax.management.MBeanInfo; -import javax.management.MBeanAttributeInfo; import javax.management.ObjectName; -import javax.management.MBeanNotificationInfo; -import javax.management.Notification; -import javax.management.NotificationFilter; -import javax.management.NotificationListener; -import javax.management.ListenerNotFoundException; - -import java.util.List; -import java.util.ListIterator; -import java.util.Map; /** * Implementation class for the garbage collector. - * Standard and committed hotspot-specific metrics if any. * * ManagementFactory.getGarbageCollectorMXBeans() returns a list * of instances of this class. */ -class GarbageCollectorImpl extends MemoryManagerImpl +public class GarbageCollectorImpl extends MemoryManagerImpl implements GarbageCollectorMXBean { - GarbageCollectorImpl(String name) { + protected GarbageCollectorImpl(String name) { super(name); } + @Override public native long getCollectionCount(); + + @Override public native long getCollectionTime(); - - // The memory pools are static and won't be changed. - // TODO: If the hotspot implementation begins to have pools - // dynamically created and removed, this needs to be modified. - private String[] poolNames = null; - synchronized String[] getAllPoolNames() { - if (poolNames == null) { - List pools = ManagementFactory.getMemoryPoolMXBeans(); - poolNames = new String[pools.size()]; - int i = 0; - for (MemoryPoolMXBean m : pools) { - poolNames[i++] = m.getName(); - } - } - return poolNames; - } - - // Sun JDK extension - private GcInfoBuilder gcInfoBuilder; - - private synchronized GcInfoBuilder getGcInfoBuilder() { - if(gcInfoBuilder == null) { - gcInfoBuilder = new GcInfoBuilder(this, getAllPoolNames()); - } - return gcInfoBuilder; - } - - public GcInfo getLastGcInfo() { - GcInfo info = getGcInfoBuilder().getLastGcInfo(); - return info; - } - - private final static String notifName = - "javax.management.Notification"; - - private final static String[] gcNotifTypes = { - GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION - }; - - private MBeanNotificationInfo[] notifInfo = null; - public MBeanNotificationInfo[] getNotificationInfo() { - synchronized (this) { - if (notifInfo == null) { - notifInfo = new MBeanNotificationInfo[1]; - notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes, - notifName, - "GC Notification"); - } - } - return notifInfo; - } - - private static long seqNumber = 0; - private static long getNextSeqNumber() { - return ++seqNumber; - } - - void createGCNotification(long timestamp, - String gcName, - String gcAction, - String gcCause, - GcInfo gcInfo) { - - if (!hasListeners()) { - return; - } - - Notification notif = new Notification(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION, - getObjectName(), - getNextSeqNumber(), - timestamp, - gcName); - GarbageCollectionNotificationInfo info = - new GarbageCollectionNotificationInfo(gcName, - gcAction, - gcCause, - gcInfo); - - CompositeData cd = - GarbageCollectionNotifInfoCompositeData.toCompositeData(info); - notif.setUserData(cd); - sendNotification(notif); - } - - public synchronized void addNotificationListener(NotificationListener listener, - NotificationFilter filter, - Object handback) - { - boolean before = hasListeners(); - super.addNotificationListener(listener, filter, handback); - boolean after = hasListeners(); - if (!before && after) { - setNotificationEnabled(this, true); - } - } - - public synchronized void removeNotificationListener(NotificationListener listener) - throws ListenerNotFoundException { - boolean before = hasListeners(); - super.removeNotificationListener(listener); - boolean after = hasListeners(); - if (before && !after) { - setNotificationEnabled(this,false); - } - } - - public synchronized void removeNotificationListener(NotificationListener listener, - NotificationFilter filter, - Object handback) - throws ListenerNotFoundException - { - boolean before = hasListeners(); - super.removeNotificationListener(listener,filter,handback); - boolean after = hasListeners(); - if (before && !after) { - setNotificationEnabled(this,false); - } - } - + @Override public ObjectName getObjectName() { return Util.newObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE, getName()); } - - native void setNotificationEnabled(GarbageCollectorMXBean gc, - boolean enabled); - } diff --git a/jdk/src/java.management/share/classes/sun/management/LazyCompositeData.java b/jdk/src/java.management/share/classes/sun/management/LazyCompositeData.java index 935f09a156b..8d9c4c03b5f 100644 --- a/jdk/src/java.management/share/classes/sun/management/LazyCompositeData.java +++ b/jdk/src/java.management/share/classes/sun/management/LazyCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,28 +115,28 @@ public abstract class LazyCompositeData protected abstract CompositeData getCompositeData(); // Helper methods - static String getString(CompositeData cd, String itemName) { + public static String getString(CompositeData cd, String itemName) { if (cd == null) throw new IllegalArgumentException("Null CompositeData"); return (String) cd.get(itemName); } - static boolean getBoolean(CompositeData cd, String itemName) { + public static boolean getBoolean(CompositeData cd, String itemName) { if (cd == null) throw new IllegalArgumentException("Null CompositeData"); return ((Boolean) cd.get(itemName)).booleanValue(); } - static long getLong(CompositeData cd, String itemName) { + public static long getLong(CompositeData cd, String itemName) { if (cd == null) throw new IllegalArgumentException("Null CompositeData"); return ((Long) cd.get(itemName)).longValue(); } - static int getInt(CompositeData cd, String itemName) { + public static int getInt(CompositeData cd, String itemName) { if (cd == null) throw new IllegalArgumentException("Null CompositeData"); diff --git a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java index c06fb71b27d..a8d4279d862 100644 --- a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java +++ b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +26,6 @@ package sun.management; import java.lang.management.*; - -import javax.management.DynamicMBean; import javax.management.InstanceAlreadyExistsException; import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; @@ -38,30 +36,35 @@ import javax.management.RuntimeOperationsException; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; - import sun.util.logging.LoggingSupport; - import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import com.sun.management.DiagnosticCommandMBean; -import com.sun.management.HotSpotDiagnosticMXBean; /** * ManagementFactoryHelper provides static factory methods to create * instances of the management interface. */ public class ManagementFactoryHelper { + static { + // make sure that the management lib is loaded within + // java.lang.management.ManagementFactory + sun.misc.Unsafe.getUnsafe().ensureClassInitialized(ManagementFactory.class); + } + + private static final VMManagement jvm = new VMManagementImpl(); + private ManagementFactoryHelper() {}; - private static VMManagement jvm; + public static VMManagement getVMManagement() { + return jvm; + } private static ClassLoadingImpl classMBean = null; private static MemoryImpl memoryMBean = null; private static ThreadImpl threadMBean = null; private static RuntimeImpl runtimeMBean = null; private static CompilationImpl compileMBean = null; - private static OperatingSystemImpl osMBean = null; + private static BaseOperatingSystemImpl osMBean = null; public static synchronized ClassLoadingMXBean getClassLoadingMXBean() { if (classMBean == null) { @@ -100,7 +103,7 @@ public class ManagementFactoryHelper { public static synchronized OperatingSystemMXBean getOperatingSystemMXBean() { if (osMBean == null) { - osMBean = new OperatingSystemImpl(jvm); + osMBean = new BaseOperatingSystemImpl(jvm); } return osMBean; } @@ -123,7 +126,7 @@ public class ManagementFactoryHelper { return result; } - public static List getGarbageCollectorMXBeans() { + public static List getGarbageCollectorMXBeans() { MemoryManagerMXBean[] mgrs = MemoryImpl.getMemoryManagers(); List result = new ArrayList<>(mgrs.length); for (MemoryManagerMXBean m : mgrs) { @@ -257,20 +260,11 @@ public class ManagementFactoryHelper { }; } - private static HotSpotDiagnostic hsDiagMBean = null; private static HotspotRuntime hsRuntimeMBean = null; private static HotspotClassLoading hsClassMBean = null; private static HotspotThread hsThreadMBean = null; private static HotspotCompilation hsCompileMBean = null; private static HotspotMemory hsMemoryMBean = null; - private static DiagnosticCommandImpl hsDiagCommandMBean = null; - - public static synchronized HotSpotDiagnosticMXBean getDiagnosticMXBean() { - if (hsDiagMBean == null) { - hsDiagMBean = new HotSpotDiagnostic(); - } - return hsDiagMBean; - } /** * This method is for testing only. @@ -312,14 +306,6 @@ public class ManagementFactoryHelper { return hsMemoryMBean; } - public static synchronized DiagnosticCommandMBean getDiagnosticCommandMBean() { - // Remote Diagnostic Commands may not be supported - if (hsDiagCommandMBean == null && jvm.isRemoteDiagnosticCommandsSupported()) { - hsDiagCommandMBean = new DiagnosticCommandImpl(jvm); - } - return hsDiagCommandMBean; - } - /** * This method is for testing only. */ @@ -374,18 +360,6 @@ public class ManagementFactoryHelper { private final static String HOTSPOT_THREAD_MBEAN_NAME = "sun.management:type=HotspotThreading"; - final static String HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME = - "com.sun.management:type=DiagnosticCommand"; - - public static HashMap getPlatformDynamicMBeans() { - HashMap map = new HashMap<>(); - DiagnosticCommandMBean diagMBean = getDiagnosticCommandMBean(); - if (diagMBean != null) { - map.put(Util.newObjectName(HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME), diagMBean); - } - return map; - } - static void registerInternalMBeans(MBeanServer mbs) { // register all internal MBeans if not registered // No exception is thrown if a MBean with that object name @@ -441,17 +415,6 @@ public class ManagementFactoryHelper { } } - static { - AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Void run() { - System.loadLibrary("management"); - return null; - } - }); - jvm = new VMManagementImpl(); - } - public static boolean isThreadSuspended(int state) { return ((state & JMM_THREAD_STATE_FLAG_SUSPENDED) != 0); } @@ -471,4 +434,20 @@ public class ManagementFactoryHelper { private static final int JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000; private static final int JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000; + // Invoked by the VM + private static MemoryPoolMXBean createMemoryPool + (String name, boolean isHeap, long uThreshold, long gcThreshold) { + return new MemoryPoolImpl(name, isHeap, uThreshold, gcThreshold); + } + + private static MemoryManagerMXBean createMemoryManager(String name) { + return new MemoryManagerImpl(name); + } + + private static GarbageCollectorMXBean + createGarbageCollector(String name, String type) { + + // ignore type parameter which is for future extension + return new GarbageCollectorImpl(name); + } } diff --git a/jdk/src/java.management/share/classes/sun/management/MappedMXBeanType.java b/jdk/src/java.management/share/classes/sun/management/MappedMXBeanType.java index 04ab87153f8..85cdfdf1833 100644 --- a/jdk/src/java.management/share/classes/sun/management/MappedMXBeanType.java +++ b/jdk/src/java.management/share/classes/sun/management/MappedMXBeanType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,10 +38,8 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import javax.management.*; import javax.management.openmbean.*; import static javax.management.openmbean.SimpleType.*; -import com.sun.management.VMOption; /** * A mapped mxbean type maps a Java type to an open type. @@ -113,7 +111,7 @@ public abstract class MappedMXBeanType { return mt; } - static synchronized MappedMXBeanType getMappedType(Type t) + public static synchronized MappedMXBeanType getMappedType(Type t) throws OpenDataException { MappedMXBeanType mt = convertedTypes.get(t); if (mt == null) { @@ -152,7 +150,7 @@ public abstract class MappedMXBeanType { } // Return the mapped open type - OpenType getOpenType() { + public OpenType getOpenType() { return openType; } @@ -177,10 +175,10 @@ public abstract class MappedMXBeanType { // return name of the class or the generic type abstract String getName(); - abstract Object toOpenTypeData(Object javaTypeData) + public abstract Object toOpenTypeData(Object javaTypeData) throws OpenDataException; - abstract Object toJavaTypeData(Object openTypeData) + public abstract Object toJavaTypeData(Object openTypeData) throws OpenDataException, InvalidObjectException; // Basic Types - Classes that do not require data conversion @@ -208,11 +206,11 @@ public abstract class MappedMXBeanType { return basicType.getName(); } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { return data; } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { return data; @@ -243,11 +241,11 @@ public abstract class MappedMXBeanType { return enumClass.getName(); } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { return ((Enum) data).name(); } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { try { @@ -315,7 +313,7 @@ public abstract class MappedMXBeanType { return arrayClass.getName(); } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { // If the base element type is a basic type // return the data as no conversion is needed. // Primitive types are not converted to wrappers. @@ -340,7 +338,7 @@ public abstract class MappedMXBeanType { } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { // If the base element type is a basic type @@ -457,7 +455,7 @@ public abstract class MappedMXBeanType { return typeName; } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { final List list = (List) data; final Object[] openArray = (Object[]) @@ -470,7 +468,7 @@ public abstract class MappedMXBeanType { return openArray; } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { final Object[] openArray = (Object[]) data; @@ -538,7 +536,7 @@ public abstract class MappedMXBeanType { return typeName; } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { final Map map = (Map) data; final TabularType tabularType = (TabularType) openType; final TabularData table = new TabularDataSupport(tabularType); @@ -556,7 +554,7 @@ public abstract class MappedMXBeanType { return table; } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { final TabularData td = (TabularData) data; @@ -605,8 +603,9 @@ public abstract class MappedMXBeanType { // static class CompositeDataMXBeanType extends MappedMXBeanType { final Class javaClass; - final boolean isCompositeData; + boolean isCompositeData = false; Method fromMethod = null; + Method toMethod = null; CompositeDataMXBeanType(Class c) throws OpenDataException { this.javaClass = c; @@ -624,6 +623,26 @@ public abstract class MappedMXBeanType { // that has no from method to be embeded in another class. } + // check if a static "toCompositeData" method exists + try { + toMethod = AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Method run() throws NoSuchMethodException { + Method m = javaClass.getDeclaredMethod("toCompositeData", javaClass); + if (m != null + && CompositeData.class.isAssignableFrom(m.getReturnType()) + && Modifier.isStatic(m.getModifiers())) { + m.setAccessible(true); + return m; + } else { + return null; + } + } + }); + } catch (PrivilegedActionException e) { + // ignore NoSuchMethodException since we allow classes + // that has no from method to be embeded in another class. + } + if (COMPOSITE_DATA_CLASS.isAssignableFrom(c)) { // c implements CompositeData - set openType to null // defer generating the CompositeType @@ -636,16 +655,16 @@ public abstract class MappedMXBeanType { // Make a CompositeData containing all the getters final Method[] methods = AccessController.doPrivileged(new PrivilegedAction() { - public Method[] run() { - return javaClass.getMethods(); - } - }); + public Method[] run() { + return javaClass.getMethods(); + } + }); final List names = new ArrayList<>(); final List> types = new ArrayList<>(); /* Select public methods that look like "T getX()" or "boolean - isX()", where T is not void and X is not the empty - string. Exclude "Class getClass()" inherited from Object. */ + isX()", where T is not void and X is not the empty + string. Exclude "Class getClass()" inherited from Object. */ for (int i = 0; i < methods.length; i++) { final Method method = methods[i]; final String name = method.getName(); @@ -676,10 +695,10 @@ public abstract class MappedMXBeanType { final String[] nameArray = names.toArray(new String[0]); openType = new CompositeType(c.getName(), - c.getName(), - nameArray, // field names - nameArray, // field descriptions - types.toArray(new OpenType[0])); + c.getName(), + nameArray, // field names + nameArray, // field descriptions + types.toArray(new OpenType[0])); } } @@ -691,7 +710,23 @@ public abstract class MappedMXBeanType { return javaClass.getName(); } - Object toOpenTypeData(Object data) throws OpenDataException { + public Object toOpenTypeData(Object data) throws OpenDataException { + if (toMethod != null) { + try { + return toMethod.invoke(null, data); + } catch (IllegalAccessException e) { + // should never reach here + throw new AssertionError(e); + } catch (InvocationTargetException e) { + final OpenDataException ode + = new OpenDataException("Failed to invoke " + + toMethod.getName() + " to convert " + javaClass.getName() + + " to CompositeData"); + ode.initCause(e); + throw ode; + } + } + if (data instanceof MemoryUsage) { return MemoryUsageCompositeData.toCompositeData((MemoryUsage) data); } @@ -712,10 +747,6 @@ public abstract class MappedMXBeanType { toCompositeData((MemoryNotificationInfo) data); } - if (data instanceof VMOption) { - return VMOptionCompositeData.toCompositeData((VMOption) data); - } - if (isCompositeData) { // Classes that implement CompositeData // @@ -732,7 +763,7 @@ public abstract class MappedMXBeanType { " is not supported for platform MXBeans"); } - Object toJavaTypeData(Object data) + public Object toJavaTypeData(Object data) throws OpenDataException, InvalidObjectException { if (fromMethod == null) { diff --git a/jdk/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java b/jdk/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java index cff7ac39217..a78b3453b0d 100644 --- a/jdk/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java +++ b/jdk/src/java.management/share/classes/sun/management/NotificationEmitterSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,13 +34,12 @@ import javax.management.NotificationListener; import java.util.List; import java.util.ArrayList; -import java.util.ListIterator; import java.util.Collections; /** * Abstract helper class for notification emitter support. */ -abstract class NotificationEmitterSupport implements NotificationEmitter { +public abstract class NotificationEmitterSupport implements NotificationEmitter { protected NotificationEmitterSupport() { } @@ -135,7 +134,7 @@ abstract class NotificationEmitterSupport implements NotificationEmitter { } } - void sendNotification(Notification notification) { + public void sendNotification(Notification notification) { if (notification == null) { return; @@ -162,7 +161,7 @@ abstract class NotificationEmitterSupport implements NotificationEmitter { } } - boolean hasListeners() { + public boolean hasListeners() { synchronized (listenerLock) { return !listenerList.isEmpty(); } diff --git a/jdk/src/java.management/share/classes/sun/management/ThreadImpl.java b/jdk/src/java.management/share/classes/sun/management/ThreadImpl.java index 019646ad4fe..129ecfcc5da 100644 --- a/jdk/src/java.management/share/classes/sun/management/ThreadImpl.java +++ b/jdk/src/java.management/share/classes/sun/management/ThreadImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,20 +26,18 @@ package sun.management; import java.lang.management.ManagementFactory; - import java.lang.management.ThreadInfo; - +import java.lang.management.ThreadMXBean; import javax.management.ObjectName; /** - * Implementation class for the thread subsystem. - * Standard and committed hotspot-specific metrics if any. - * - * ManagementFactory.getThreadMXBean() returns an instance - * of this class. + * Implementation for java.lang.management.ThreadMXBean as well as providing the + * supporting method for com.sun.management.ThreadMXBean. + * The supporting method for com.sun.management.ThreadMXBean can be moved to + * jdk.management in the future. */ -class ThreadImpl implements com.sun.management.ThreadMXBean { +public class ThreadImpl implements ThreadMXBean { private final VMManagement jvm; // default for thread contention monitoring is disabled. @@ -50,32 +48,38 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { /** * Constructor of ThreadImpl class. */ - ThreadImpl(VMManagement vm) { + protected ThreadImpl(VMManagement vm) { this.jvm = vm; this.cpuTimeEnabled = jvm.isThreadCpuTimeEnabled(); this.allocatedMemoryEnabled = jvm.isThreadAllocatedMemoryEnabled(); } + @Override public int getThreadCount() { return jvm.getLiveThreadCount(); } + @Override public int getPeakThreadCount() { return jvm.getPeakThreadCount(); } + @Override public long getTotalStartedThreadCount() { return jvm.getTotalThreadCount(); } + @Override public int getDaemonThreadCount() { return jvm.getDaemonThreadCount(); } + @Override public boolean isThreadContentionMonitoringSupported() { return jvm.isThreadContentionMonitoringSupported(); } + @Override public synchronized boolean isThreadContentionMonitoringEnabled() { if (!isThreadContentionMonitoringSupported()) { throw new UnsupportedOperationException( @@ -84,18 +88,21 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return contentionMonitoringEnabled; } + @Override public boolean isThreadCpuTimeSupported() { return jvm.isOtherThreadCpuTimeSupported(); } + @Override public boolean isCurrentThreadCpuTimeSupported() { return jvm.isCurrentThreadCpuTimeSupported(); } - public boolean isThreadAllocatedMemorySupported() { + protected boolean isThreadAllocatedMemorySupported() { return jvm.isThreadAllocatedMemorySupported(); } + @Override public boolean isThreadCpuTimeEnabled() { if (!isThreadCpuTimeSupported() && !isCurrentThreadCpuTimeSupported()) { @@ -105,7 +112,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return cpuTimeEnabled; } - public boolean isThreadAllocatedMemoryEnabled() { + protected boolean isThreadAllocatedMemoryEnabled() { if (!isThreadAllocatedMemorySupported()) { throw new UnsupportedOperationException( "Thread allocated memory measurement is not supported"); @@ -113,6 +120,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return allocatedMemoryEnabled; } + @Override public long[] getAllThreadIds() { Util.checkMonitorAccess(); @@ -126,6 +134,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return ids; } + @Override public ThreadInfo getThreadInfo(long id) { long[] ids = new long[1]; ids[0] = id; @@ -133,6 +142,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return infos[0]; } + @Override public ThreadInfo getThreadInfo(long id, int maxDepth) { long[] ids = new long[1]; ids[0] = id; @@ -140,6 +150,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return infos[0]; } + @Override public ThreadInfo[] getThreadInfo(long[] ids) { return getThreadInfo(ids, 0); } @@ -157,6 +168,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { } } + @Override public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) { verifyThreadIds(ids); @@ -165,6 +177,10 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { "Invalid maxDepth parameter: " + maxDepth); } + // ids has been verified to be non-null + // an empty array of ids should return an empty array of ThreadInfos + if (ids.length == 0) return new ThreadInfo[0]; + Util.checkMonitorAccess(); ThreadInfo[] infos = new ThreadInfo[ids.length]; // nulls @@ -176,6 +192,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return infos; } + @Override public void setThreadContentionMonitoringEnabled(boolean enable) { if (!isThreadContentionMonitoringSupported()) { throw new UnsupportedOperationException( @@ -209,6 +226,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return isThreadCpuTimeEnabled(); } + @Override public long getCurrentThreadCpuTime() { if (verifyCurrentThreadCpuTime()) { return getThreadTotalCpuTime0(0); @@ -216,6 +234,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return -1; } + @Override public long getThreadCpuTime(long id) { long[] ids = new long[1]; ids[0] = id; @@ -247,7 +266,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return isThreadCpuTimeEnabled(); } - public long[] getThreadCpuTime(long[] ids) { + protected long[] getThreadCpuTime(long[] ids) { boolean verified = verifyThreadCpuTime(ids); int length = ids.length; @@ -268,6 +287,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return times; } + @Override public long getCurrentThreadUserTime() { if (verifyCurrentThreadCpuTime()) { return getThreadUserCpuTime0(0); @@ -275,6 +295,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return -1; } + @Override public long getThreadUserTime(long id) { long[] ids = new long[1]; ids[0] = id; @@ -282,7 +303,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return times[0]; } - public long[] getThreadUserTime(long[] ids) { + protected long[] getThreadUserTime(long[] ids) { boolean verified = verifyThreadCpuTime(ids); int length = ids.length; @@ -303,6 +324,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return times; } + @Override public void setThreadCpuTimeEnabled(boolean enable) { if (!isThreadCpuTimeSupported() && !isCurrentThreadCpuTimeSupported()) { @@ -320,7 +342,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { } } - public long getThreadAllocatedBytes(long id) { + protected long getThreadAllocatedBytes(long id) { long[] ids = new long[1]; ids[0] = id; final long[] sizes = getThreadAllocatedBytes(ids); @@ -339,7 +361,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return isThreadAllocatedMemoryEnabled(); } - public long[] getThreadAllocatedBytes(long[] ids) { + protected long[] getThreadAllocatedBytes(long[] ids) { boolean verified = verifyThreadAllocatedMemory(ids); long[] sizes = new long[ids.length]; @@ -351,7 +373,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return sizes; } - public void setThreadAllocatedMemoryEnabled(boolean enable) { + protected void setThreadAllocatedMemoryEnabled(boolean enable) { if (!isThreadAllocatedMemorySupported()) { throw new UnsupportedOperationException( "Thread allocated memory measurement is not supported."); @@ -367,6 +389,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { } } + @Override public long[] findMonitorDeadlockedThreads() { Util.checkMonitorAccess(); @@ -383,6 +406,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return ids; } + @Override public long[] findDeadlockedThreads() { if (!isSynchronizerUsageSupported()) { throw new UnsupportedOperationException( @@ -404,15 +428,18 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { return ids; } + @Override public void resetPeakThreadCount() { Util.checkControlAccess(); resetPeakThreadCount0(); } + @Override public boolean isObjectMonitorUsageSupported() { return jvm.isObjectMonitorUsageSupported(); } + @Override public boolean isSynchronizerUsageSupported() { return jvm.isSynchronizerUsageSupported(); } @@ -432,14 +459,20 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { Util.checkMonitorAccess(); } + @Override public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) { verifyThreadIds(ids); + // ids has been verified to be non-null + // an empty array of ids should return an empty array of ThreadInfos + if (ids.length == 0) return new ThreadInfo[0]; + verifyDumpThreads(lockedMonitors, lockedSynchronizers); return dumpThreads0(ids, lockedMonitors, lockedSynchronizers); } + @Override public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) { verifyDumpThreads(lockedMonitors, lockedSynchronizers); @@ -469,6 +502,7 @@ class ThreadImpl implements com.sun.management.ThreadMXBean { // tid == 0 to reset contention times for all threads private static native void resetContentionTimes0(long tid); + @Override public ObjectName getObjectName() { return Util.newObjectName(ManagementFactory.THREAD_MXBEAN_NAME); } diff --git a/jdk/src/java.management/share/classes/sun/management/Util.java b/jdk/src/java.management/share/classes/sun/management/Util.java index 6350408735e..145749e40f2 100644 --- a/jdk/src/java.management/share/classes/sun/management/Util.java +++ b/jdk/src/java.management/share/classes/sun/management/Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class Util { static void checkMonitorAccess() throws SecurityException { checkAccess(monitorPermission); } - static void checkControlAccess() throws SecurityException { + public static void checkControlAccess() throws SecurityException { checkAccess(controlPermission); } } diff --git a/jdk/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java b/jdk/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java index 6f224c95e68..0ce516511bb 100644 --- a/jdk/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java +++ b/jdk/src/java.management/share/classes/sun/management/spi/PlatformMBeanProvider.java @@ -205,7 +205,7 @@ public abstract class PlatformMBeanProvider { * Instantiates a new PlatformMBeanProvider. * * @throws SecurityException if the subclass (and calling code) does not - * have {@code RuntimePermission("sun.management.spi.PlatformMBeanProvider", "subclass")} + * have {@code RuntimePermission("sun.management.spi.PlatformMBeanProvider.subclass")} */ protected PlatformMBeanProvider () { this(checkSubclassPermission()); @@ -226,7 +226,7 @@ public abstract class PlatformMBeanProvider { private static Void checkSubclassPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { - sm.checkPermission(new RuntimePermission(PlatformMBeanProvider.class.getName(), "subclass")); + sm.checkPermission(new RuntimePermission(PlatformMBeanProvider.class.getName()+".subclass")); } return null; } diff --git a/jdk/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c b/jdk/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c index 020335d32ea..3f2e3e75eba 100644 --- a/jdk/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c +++ b/jdk/src/java.management/share/native/libmanagement/GarbageCollectorImpl.c @@ -36,17 +36,3 @@ JNIEXPORT jlong JNICALL Java_sun_management_GarbageCollectorImpl_getCollectionTi (JNIEnv *env, jobject mgr) { return jmm_interface->GetLongAttribute(env, mgr, JMM_GC_TIME_MS); } - - -JNIEXPORT void JNICALL Java_sun_management_GarbageCollectorImpl_setNotificationEnabled -(JNIEnv *env, jobject dummy, jobject gc,jboolean enabled) { - - if (gc == NULL) { - JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean"); - return; - } - if((jmm_version > JMM_VERSION_1_2) - || (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=1))) { - jmm_interface->SetGCNotificationEnabled(env, gc, enabled); - } -} diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java index 51dbdd62846..abcacf024a4 100644 --- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java +++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java @@ -59,6 +59,8 @@ public class GSSUtil { GSSUtil.createOid("1.2.840.113554.1.2.2"); public static final Oid GSS_KRB5_MECH_OID2 = GSSUtil.createOid("1.3.5.1.5.2"); + public static final Oid GSS_KRB5_MECH_OID_MS = + GSSUtil.createOid("1.2.840.48018.1.2.2"); public static final Oid GSS_SPNEGO_MECH_OID = GSSUtil.createOid("1.3.6.1.5.5.2"); @@ -101,7 +103,8 @@ public class GSSUtil { public static boolean isKerberosMech(Oid oid) { return (GSS_KRB5_MECH_OID.equals(oid) || - GSS_KRB5_MECH_OID2.equals(oid)); + GSS_KRB5_MECH_OID2.equals(oid) || + GSS_KRB5_MECH_OID_MS.equals(oid)); } diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/spnego/SpNegoContext.java b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/spnego/SpNegoContext.java index 355816dc887..416c091d4e6 100644 --- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/spnego/SpNegoContext.java +++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/spnego/SpNegoContext.java @@ -538,14 +538,21 @@ public class SpNegoContext implements GSSContextSpi { // get the token for mechanism byte[] accept_token; - if (mechList[0].equals(mech_wanted)) { + if (mechList[0].equals(mech_wanted) || + (GSSUtil.isKerberosMech(mechList[0]) && + GSSUtil.isKerberosMech(mech_wanted))) { // get the mechanism token + if (DEBUG && !mech_wanted.equals(mechList[0])) { + System.out.println("SpNegoContext.acceptSecContext: " + + "negotiated mech adjusted to " + mechList[0]); + } byte[] mechToken = initToken.getMechToken(); if (mechToken == null) { throw new GSSException(GSSException.FAILURE, -1, "mechToken is missing"); } accept_token = GSS_acceptSecContext(mechToken); + mech_wanted = mechList[0]; } else { accept_token = null; } diff --git a/jdk/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c b/jdk/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c index ab0ee036e6b..554eb63c19d 100644 --- a/jdk/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c +++ b/jdk/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c @@ -389,7 +389,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_krb5_Credentials_acquireDefaultNativ jobject authTime, renewTillTime, hostAddresses = NULL; KERB_EXTERNAL_TICKET *msticket; int found = 0; - FILETIME Now, EndTime, LocalEndTime; + FILETIME Now, EndTime; int i, netypes; jint *etypes = NULL; @@ -476,8 +476,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_krb5_Credentials_acquireDefaultNativ GetSystemTimeAsFileTime(&Now); EndTime.dwLowDateTime = msticket->EndTime.LowPart; EndTime.dwHighDateTime = msticket->EndTime.HighPart; - FileTimeToLocalFileTime(&EndTime, &LocalEndTime); - if (CompareFileTime(&Now, &LocalEndTime) < 0) { + if (CompareFileTime(&Now, &EndTime) < 0) { for (i=0; iSessionKey.KeyType) { found = 1; diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java index da7e55a2d9f..0f263ad3537 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -130,6 +130,15 @@ final public class InterfaceTypeImpl extends InvokableTypeImpl return null; } + @Override + boolean isAssignableTo(ReferenceType type) { + if (type.name().equals("java.lang.Object")) { + // interfaces are always assignable to j.l.Object + return true; + } + return super.isAssignableTo(type); + } + @Override List interfaces() { return superinterfaces(); @@ -140,4 +149,4 @@ final public class InterfaceTypeImpl extends InvokableTypeImpl // method must be directly in this interface return this.equals(method.declaringType()); } -} \ No newline at end of file +} diff --git a/jdk/src/jdk.jvmstat/share/classes/sun/tools/jstatd/Jstatd.java b/jdk/src/jdk.jvmstat/share/classes/sun/tools/jstatd/Jstatd.java index 09a17803cfa..160314aa7a3 100644 --- a/jdk/src/jdk.jvmstat/share/classes/sun/tools/jstatd/Jstatd.java +++ b/jdk/src/jdk.jvmstat/share/classes/sun/tools/jstatd/Jstatd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,15 +64,9 @@ public class Jstatd { int localport = (port < 0) ? Registry.REGISTRY_PORT : port; registry = LocateRegistry.createRegistry(localport); bind(name, remoteHost); + } else { + throw e; } - else { - System.out.println("Could not contact registry\n" - + e.getMessage()); - e.printStackTrace(); - } - } catch (RemoteException e) { - System.err.println("Could not bind " + name + " to RMI Registry"); - e.printStackTrace(); } } @@ -142,23 +136,28 @@ public class Jstatd { RemoteHost stub = (RemoteHost) UnicastRemoteObject.exportObject( remoteHost, 0); bind(name.toString(), remoteHost); + System.out.println("jstatd started (bound to " + name.toString() + ")"); + System.out.flush(); } catch (MalformedURLException e) { if (rminame != null) { System.out.println("Bad RMI server name: " + rminame); } else { - System.out.println("Bad RMI URL: " + name + " : " - + e.getMessage()); + System.out.println("Bad RMI URL: " + name); } + e.printStackTrace(System.out); System.exit(1); } catch (java.rmi.ConnectException e) { // could not attach to or create a registry - System.out.println("Could not contact RMI registry\n" - + e.getMessage()); + System.out.println("Could not contact RMI registry"); + e.printStackTrace(System.out); + System.exit(1); + } catch (RemoteException e) { + System.out.println("Could not bind " + name + " to RMI Registry"); + e.printStackTrace(System.out); System.exit(1); } catch (Exception e) { - System.out.println("Could not create remote object\n" - + e.getMessage()); - e.printStackTrace(); + System.out.println("Could not create remote object"); + e.printStackTrace(System.out); System.exit(1); } } diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java index 7dd97ebd058..152cc67fcb5 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { String GST[] = new String[] {"Golf Normalzeit", "GST", "Golf Sommerzeit", "GDT", "Zeitzone f\u00FCr Persischen Golf", "GT"}; - String HAST[] = new String[] {"Hawaii-Aleutische Normalzeit", "HAST", - "Hawaii-Aleutische Sommerzeit", "HADT", - "Zeitzone f\u00FCr Hawaii und Al\u00EButen", "HAT"}; String HKT[] = new String[] {"Hongkong Zeit", "HKT", "Hongkong Sommerzeit", "HKST", "Hongkong Zeit", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Paraguay Sommerzeit", "PYST", "Paraguay Zeit", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java index 99f48b2d902..50075d56378 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { String GST[] = new String[] {"Hora est\u00e1ndar del Golfo", "GST", "Hora de verano del Golfo", "GDT", "Hora del Golfo", "GT"}; - String HAST[] = new String[] {"Hora est\u00e1ndar de Hawaii-Aleutianas", "HAST", - "Hora de verano de Hawaii-Aleutianas", "HADT", - "Hora de Hawaii-Aleutian", "HAT"}; String HKT[] = new String[] {"Hora de Hong Kong", "HKT", "Hora de verano de Hong Kong", "HKST", "Hora de Hong Kong", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Hora de verano de Paraguay", "PYST", "Hora de Paraguay", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java index 9a89c8508df..50e2f5be093 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { String GST[] = new String[] {"Heure normale du Golfe", "GST", "Heure avanc\u00e9e du Golfe", "GDT", "Golfe", "GT"} ; - String HAST[] = new String[] {"Heure normale d'Hawa\u00ef-Al\u00e9outiennes", "HAST", - "Heure avanc\u00e9e d'Hawa\u00ef-Al\u00e9outiennes", "HADT", - "Hawa\u00EF-Iles Al\u00E9outiennes", "HAT"} ; String HKT[] = new String[] {"Heure de Hong Kong", "HKT", "Heure d'\u00e9t\u00e9 de Hong Kong", "HKST", "Heure de Hong-Kong", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Heure d'\u00e9t\u00e9 du Paraguay", "PYST", "Heure du Paraguay", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java index b3edb6e4236..d7021e7b465 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { String GST[] = new String[] {"Ora solare del golfo", "GST", "Ora legale del golfo", "GDT", "Ora del golfo", "GT"}; - String HAST[] = new String[] {"Ora solare delle Isole Hawaii-Aleutine", "HAST", - "Ora solare delle Isole Hawaii-Aleutine", "HADT", - "Ora Hawaii-Aleutine", "HAT"}; String HKT[] = new String[] {"Ora di Hong Kong", "HKT", "Ora estiva di Hong Kong", "HKST", "Ora di Hong Kong", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Ora estiva del Paraguay", "PYST", "Ora del Paraguay", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java index df5d3acbba2..b4d3d2ad40e 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { String GST[] = new String[] {"\u6e7e\u5cb8\u6a19\u6e96\u6642", "GST", "\u6e7e\u5cb8\u590f\u6642\u9593", "GDT", "\u6E7E\u5CB8\u6642\u9593", "GT"}; - String HAST[] = new String[] {"\u30cf\u30ef\u30a4 - \u30a2\u30ea\u30e5\u30fc\u30b7\u30e3\u30f3\u6a19\u6e96\u6642", "HAST", - "\u30cf\u30ef\u30a4 - \u30a2\u30ea\u30e5\u30fc\u30b7\u30e3\u30f3\u590f\u6642\u9593", "HADT", - "\u30CF\u30EF\u30A4\u30FB\u30A2\u30EA\u30E5\u30FC\u30B7\u30E3\u30F3\u6642\u9593", "HAT"}; String HKT[] = new String[] {"\u9999\u6e2f\u6642\u9593", "HKT", "\u9999\u6e2f\u590f\u6642\u9593", "HKST", "\u9999\u6E2F\u6642\u9593", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "\u30d1\u30e9\u30b0\u30a2\u30a4\u590f\u6642\u9593", "PYST", "\u30D1\u30E9\u30B0\u30A2\u30A4\u6642\u9593", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java index 2ef152babc1..522c3e8f0fd 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { String GST[] = new String[] {"\uac78\ud504\ub9cc \ud45c\uc900\uc2dc", "GST", "\uac78\ud504\ub9cc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "GDT", "\uAC78\uD504\uB9CC \uD45C\uC900\uC2DC", "GT"}; - String HAST[] = new String[] {"\ud558\uc640\uc774 \uc54c\ub958\uc0e8 \ud45c\uc900\uc2dc", "HAST", - "\ud558\uc640\uc774 \uc54c\ub958\uc0e8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "HADT", - "\uD558\uC640\uC774-\uC54C\uB8E8\uC0E8 \uD45C\uC900\uC2DC", "HAT"}; String HKT[] = new String[] {"\ud64d\ucf69 \uc2dc\uac04", "HKT", "\ud64d\ucf69 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "HKST", "\uD64D\uCF69 \uD45C\uC900\uC2DC", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "\ud30c\ub77c\uacfc\uc774 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PYST", "\uD30C\uB77C\uACFC\uC774 \uD45C\uC900\uC2DC", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java index 9ff7e574c84..2e1d131215f 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java @@ -150,9 +150,6 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { String GST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do golfo", "GST", "Hor\u00e1rio de luz natural do golfo", "GDT", "Hor\u00E1rio do Golfo", "GT"}; - String HAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Hava\u00ed-Aleutian", "HAST", - "Hor\u00e1rio de luz natural do Hava\u00ed-Aleutian", "HADT", - "Hor\u00E1rio do Hava\u00ED-Aleutas", "HAT"}; String HKT[] = new String[] {"Fuso hor\u00e1rio de Hong Kong", "HKT", "Fuso hor\u00e1rio de ver\u00e3o de Hong Kong", "HKST", "Hor\u00E1rio de Hong Kong", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { "Fuso hor\u00e1rio de ver\u00e3o do Paraguai", "PYST", "Hor\u00E1rio do Paraguai", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java index 916c2c5d981..f8b56830052 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { String GST[] = new String[] {"Gulf-normaltid", "GST", "Gulf-sommartid", "GDT", "Golfens tid", "GT"}; - String HAST[] = new String[] {"Hawaii-Aleuterna, normaltid", "HAST", - "Hawaii-Aleuterna, sommartid", "HADT", - "Hawaiiansk-aleutisk tid", "HAT"}; String HKT[] = new String[] {"Hong Kong, normaltid", "HKT", "Hong Kong, sommartid", "HKST", "Hongkong-tid", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Paraguay, sommartid", "PYST", "Paraguayansk tid", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java index 5cb70c85eb9..cdbfdbbcb6d 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { String GST[] = new String[] {"\u6ce2\u65af\u6e7e\u6807\u51c6\u65f6\u95f4", "GST", "\u6ce2\u65af\u6e7e\u590f\u4ee4\u65f6", "GDT", "\u6D77\u6E7E\u65F6\u95F4", "GT"}; - String HAST[] = new String[] {"\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5c9b\u6807\u51c6\u65f6\u95f4", "HAST", - "\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5c9b\u590f\u4ee4\u65f6", "HADT", - "\u590F\u5A01\u5937-\u963F\u7559\u7533\u65F6\u95F4", "HAT"}; String HKT[] = new String[] {"\u9999\u6e2f\u65f6\u95f4", "HKT", "\u9999\u6e2f\u590f\u4ee4\u65f6", "HKST", "\u9999\u6E2F\u65F6\u95F4", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "\u5df4\u62c9\u572d\u590f\u4ee4\u65f6", "PYST", "\u5DF4\u62C9\u572D\u65F6\u95F4", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1024,7 +1021,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java index 0074f49da8b..4ba8e02139b 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java @@ -153,9 +153,6 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { String GST[] = new String[] {"\u6ce2\u65af\u7063\u6a19\u6e96\u6642\u9593", "GST", "\u6ce2\u65af\u7063\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "GDT", "\u6CE2\u65AF\u7063\u6642\u9593", "GT"}; - String HAST[] = new String[] {"\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5cf6\u6a19\u6e96\u6642\u9593", "HAST", - "\u590f\u5a01\u5937-\u963f\u7559\u7533\u7fa4\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "HADT", - "\u590F\u5A01\u5937-\u963F\u7559\u7533\u6642\u9593", "HAT"}; String HKT[] = new String[] {"\u9999\u6e2f\u6642\u9593", "HKT", "\u9999\u6e2f\u590f\u4ee4\u6642\u9593", "HKST", "\u9999\u6E2F\u6642\u9593", "HKT"}; @@ -372,7 +369,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, {"Africa/Windhoek", WAT}, - {"America/Adak", HAST}, + {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, {"America/Araguaina", BRT}, @@ -394,7 +391,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "\u5df4\u62c9\u572d\u590f\u4ee4\u6642\u9593", "PYST", "\u5DF4\u62C9\u572D\u6642\u9593", "PYT"}}, {"America/Atikokan", EST}, - {"America/Atka", HAST}, + {"America/Atka", HST}, {"America/Bahia", BRT}, {"America/Bahia_Banderas", CST}, {"America/Barbados", AST}, @@ -1026,7 +1023,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"UCT", UTC}, {"Universal", UTC}, {"US/Alaska", AKST}, - {"US/Aleutian", HAST}, + {"US/Aleutian", HST}, {"US/Arizona", MST}, {"US/Central", CST}, {"US/Eastern", EST}, diff --git a/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c b/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c new file mode 100644 index 00000000000..bee3753b3c1 --- /dev/null +++ b/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. 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. + */ + +/* Empty stubs for now to satisfy the new build process. */ +/* Implement and update https://bugs.openjdk.java.net/browse/JDK-8030957 */ + +#include +#include "com_sun_management_internal_OperatingSystemImpl.h" + +JNIEXPORT jdouble JNICALL +Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0 +(JNIEnv *env, jobject dummy) +{ + return -1.0; +} + +JNIEXPORT jdouble JNICALL +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0 +(JNIEnv *env, jobject dummy) +{ + return -1.0; +} diff --git a/jdk/src/java.management/unix/native/libmanagement/LinuxOperatingSystem.c b/jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c similarity index 97% rename from jdk/src/java.management/unix/native/libmanagement/LinuxOperatingSystem.c rename to jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c index 9029bd0a660..95d3eae2da4 100644 --- a/jdk/src/java.management/unix/native/libmanagement/LinuxOperatingSystem.c +++ b/jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +36,7 @@ #include #include #include -#include "sun_management_OperatingSystemImpl.h" +#include "com_sun_management_internal_OperatingSystemImpl.h" struct ticks { uint64_t used; @@ -311,7 +311,7 @@ double get_process_load() { } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0 (JNIEnv *env, jobject dummy) { if(perfInit() == 0) { @@ -322,7 +322,7 @@ Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0 (JNIEnv *env, jobject dummy) { if(perfInit() == 0) { diff --git a/jdk/src/java.management/unix/native/libmanagement/MacosxOperatingSystem.c b/jdk/src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c similarity index 94% rename from jdk/src/java.management/unix/native/libmanagement/MacosxOperatingSystem.c rename to jdk/src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c index 7771ccd5cb4..edfa7649d46 100644 --- a/jdk/src/java.management/unix/native/libmanagement/MacosxOperatingSystem.c +++ b/jdk/src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -#include "sun_management_OperatingSystemImpl.h" +#include "com_sun_management_internal_OperatingSystemImpl.h" #include #include @@ -32,7 +32,7 @@ #include "jvm.h" JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0 (JNIEnv *env, jobject dummy) { // This code is influenced by the darwin top source @@ -84,7 +84,7 @@ Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0 (JNIEnv *env, jobject dummy) { // This code is influenced by the darwin top source diff --git a/jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider b/jdk/src/jdk.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider similarity index 100% rename from jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider rename to jdk/src/jdk.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider diff --git a/jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/DiagnosticCommandMBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java similarity index 97% rename from jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java rename to jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java index 68e88b79544..8396a850202 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,13 +25,10 @@ package com.sun.management; -import javax.management.Notification; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeDataView; import javax.management.openmbean.CompositeType; -import java.util.Collection; -import java.util.Collections; -import sun.management.GarbageCollectionNotifInfoCompositeData; +import com.sun.management.internal.GarbageCollectionNotifInfoCompositeData; /** * The information about a garbage collection diff --git a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectorMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/GarbageCollectorMXBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java similarity index 98% rename from jdk/src/java.management/share/classes/com/sun/management/GcInfo.java rename to jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java index 5dc732d84f8..f256b086a88 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,9 +33,8 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import java.util.List; -import sun.management.GcInfoCompositeData; -import sun.management.GcInfoBuilder; +import com.sun.management.internal.GcInfoCompositeData; +import com.sun.management.internal.GcInfoBuilder; /** * Garbage collection information. It contains the following diff --git a/jdk/src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/OperatingSystemMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/OperatingSystemMXBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/ThreadMXBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java rename to jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java diff --git a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java similarity index 96% rename from jdk/src/java.management/share/classes/com/sun/management/VMOption.java rename to jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java index b1ba961923d..bebe1974010 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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.management; -import sun.management.VMOptionCompositeData; +import com.sun.management.internal.VMOptionCompositeData; import javax.management.openmbean.CompositeData; /** @@ -241,5 +241,8 @@ public class VMOption { } - + // for sun.management.MappedMXBeanType + static CompositeData toCompositeData(VMOption option) { + return VMOptionCompositeData.toCompositeData(option); + } } diff --git a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandArgumentInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandArgumentInfo.java similarity index 97% rename from jdk/src/java.management/share/classes/sun/management/DiagnosticCommandArgumentInfo.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandArgumentInfo.java index 1ad267b1ecf..3c956a49172 100644 --- a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandArgumentInfo.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandArgumentInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -package sun.management; +package com.sun.management.internal; /** * Diagnostic Command Argument information. It contains the description diff --git a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java similarity index 90% rename from jdk/src/java.management/share/classes/sun/management/DiagnosticCommandImpl.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java index 27730898f1b..a0718a3c2f3 100644 --- a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandImpl.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,21 +23,41 @@ * questions. */ -package sun.management; +package com.sun.management.internal; import com.sun.management.DiagnosticCommandMBean; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.security.Permission; import java.util.*; -import javax.management.*; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.Descriptor; +import javax.management.ImmutableDescriptor; +import javax.management.InvalidAttributeValueException; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanOperationInfo; +import javax.management.MBeanParameterInfo; +import javax.management.MalformedObjectNameException; +import javax.management.Notification; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import sun.management.ManagementFactoryHelper; +import sun.management.NotificationEmitterSupport; +import sun.management.VMManagement; /** * Implementation class for the diagnostic commands subsystem. * * @since 1.8 */ -class DiagnosticCommandImpl extends NotificationEmitterSupport +public class DiagnosticCommandImpl extends NotificationEmitterSupport implements DiagnosticCommandMBean { private final VMManagement jvm; @@ -45,6 +65,17 @@ class DiagnosticCommandImpl extends NotificationEmitterSupport private static final String strClassName = "".getClass().getName(); private static final String strArrayClassName = String[].class.getName(); private final boolean isSupported; + private static DiagnosticCommandImpl diagCommandMBean = null; + + static synchronized DiagnosticCommandMBean getDiagnosticCommandMBean() { + VMManagement jvm = ManagementFactoryHelper.getVMManagement(); + + // Remote Diagnostic Commands may not be supported + if (diagCommandMBean == null && jvm.isRemoteDiagnosticCommandsSupported()) { + diagCommandMBean = new DiagnosticCommandImpl(jvm); + } + return diagCommandMBean; + } @Override public Object getAttribute(String attribute) throws AttributeNotFoundException, @@ -327,7 +358,7 @@ class DiagnosticCommandImpl extends NotificationEmitterSupport } ObjectName on = null; try { - on = ObjectName.getInstance(ManagementFactoryHelper.HOTSPOT_DIAGNOSTIC_COMMAND_MBEAN_NAME); + on = ObjectName.getInstance(PlatformMBeanProviderImpl.DIAGNOSTIC_COMMAND_MBEAN_NAME); } catch (MalformedObjectNameException e) { } Notification notif = new Notification("jmx.mbean.info.changed", on, diff --git a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandInfo.java similarity index 97% rename from jdk/src/java.management/share/classes/sun/management/DiagnosticCommandInfo.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandInfo.java index 08541b3d276..1184a40b64c 100644 --- a/jdk/src/java.management/share/classes/sun/management/DiagnosticCommandInfo.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/DiagnosticCommandInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -package sun.management; +package com.sun.management.internal; import java.util.List; diff --git a/jdk/src/java.management/share/classes/sun/management/Flag.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/Flag.java similarity index 97% rename from jdk/src/java.management/share/classes/sun/management/Flag.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/Flag.java index 52da43e8408..3b5402fb040 100644 --- a/jdk/src/java.management/share/classes/sun/management/Flag.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/Flag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -package sun.management; +package com.sun.management.internal; import java.util.*; import com.sun.management.VMOption; diff --git a/jdk/src/java.management/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java similarity index 96% rename from jdk/src/java.management/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java index 722c0dfc55f..ff11d7b5aef 100644 --- a/jdk/src/java.management/share/classes/sun/management/GarbageCollectionNotifInfoCompositeData.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectionNotifInfoCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,11 +23,10 @@ * questions. */ -package sun.management; +package com.sun.management.internal; import com.sun.management.GarbageCollectionNotificationInfo; import com.sun.management.GcInfo; -import java.lang.reflect.Method; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeType; import javax.management.openmbean.CompositeDataSupport; @@ -38,6 +37,9 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.lang.reflect.Field; import java.util.HashMap; +import sun.management.LazyCompositeData; +import static sun.management.LazyCompositeData.getString; +import sun.management.Util; /** * A CompositeData for GarbageCollectionNotificationInfo for the local management support. @@ -95,7 +97,7 @@ public class GarbageCollectionNotifInfoCompositeData extends LazyCompositeData { compositeTypeByBuilder.put(builder,gict); } catch (OpenDataException e) { // shouldn't reach here - throw Util.newException(e); + throw new RuntimeException(e); } } } @@ -205,7 +207,7 @@ public class GarbageCollectionNotifInfoCompositeData extends LazyCompositeData { baseGcNotifInfoItemTypes); } catch (OpenDataException e) { // shouldn't reach here - throw Util.newException(e); + throw new RuntimeException(e); } } return baseGcNotifInfoCompositeType; diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java new file mode 100644 index 00000000000..8e0512dde5f --- /dev/null +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GarbageCollectorExtImpl.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * 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.management.internal; + +import com.sun.management.GarbageCollectionNotificationInfo; +import com.sun.management.GarbageCollectorMXBean; +import com.sun.management.GcInfo; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.util.List; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanNotificationInfo; +import javax.management.Notification; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.openmbean.CompositeData; +import sun.management.GarbageCollectorImpl; + +/** + * Implementation class for the garbage collector. + * Standard and committed hotspot-specific metrics if any. + * + * ManagementFactory.getGarbageCollectorMXBeans() returns a list + * of instances of this class. + */ +public class GarbageCollectorExtImpl extends GarbageCollectorImpl + implements GarbageCollectorMXBean { + + public GarbageCollectorExtImpl(String name) { + super(name); + } + + // The memory pools are static and won't be changed. + // TODO: If the hotspot implementation begins to have pools + // dynamically created and removed, this needs to be modified. + private String[] poolNames = null; + private synchronized String[] getAllPoolNames() { + if (poolNames == null) { + List pools = ManagementFactory.getMemoryPoolMXBeans(); + poolNames = new String[pools.size()]; + int i = 0; + for (MemoryPoolMXBean m : pools) { + poolNames[i++] = m.getName(); + } + } + return poolNames; + } + + public GcInfo getLastGcInfo() { + GcInfo info = getGcInfoBuilder().getLastGcInfo(); + return info; + } + + private final static String notifName = + "javax.management.Notification"; + + private final static String[] gcNotifTypes = { + GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION + }; + + private MBeanNotificationInfo[] notifInfo = null; + public MBeanNotificationInfo[] getNotificationInfo() { + synchronized (this) { + if (notifInfo == null) { + notifInfo = new MBeanNotificationInfo[1]; + notifInfo[0] = new MBeanNotificationInfo(gcNotifTypes, + notifName, + "GC Notification"); + } + } + return notifInfo; + } + + private static long seqNumber = 0; + private static long getNextSeqNumber() { + return ++seqNumber; + } + + protected void createGCNotification(long timestamp, + String gcName, + String gcAction, + String gcCause, + GcInfo gcInfo) { + if (!hasListeners()) { + return; + } + Notification notif = new Notification(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION, + getObjectName(), + getNextSeqNumber(), + timestamp, + gcName); + GarbageCollectionNotificationInfo info = + new GarbageCollectionNotificationInfo(gcName, + gcAction, + gcCause, + gcInfo); + + CompositeData cd = + GarbageCollectionNotifInfoCompositeData.toCompositeData(info); + notif.setUserData(cd); + sendNotification(notif); + } + + public synchronized void addNotificationListener(NotificationListener listener, + NotificationFilter filter, + Object handback) + { + boolean before = hasListeners(); + super.addNotificationListener(listener, filter, handback); + boolean after = hasListeners(); + if (!before && after) { + setNotificationEnabled(this, true); + } + } + + public synchronized void removeNotificationListener(NotificationListener listener) + throws ListenerNotFoundException { + boolean before = hasListeners(); + super.removeNotificationListener(listener); + boolean after = hasListeners(); + + if (before && !after) { + setNotificationEnabled(this,false); + } + } + + public synchronized void removeNotificationListener(NotificationListener listener, + NotificationFilter filter, + Object handback) + throws ListenerNotFoundException + { + boolean before = hasListeners(); + super.removeNotificationListener(listener,filter,handback); + boolean after = hasListeners(); + if (before && !after) { + setNotificationEnabled(this,false); + } + } + + private GcInfoBuilder gcInfoBuilder; + // Invoked also by the VM + private synchronized GcInfoBuilder getGcInfoBuilder() { + if(gcInfoBuilder == null) { + gcInfoBuilder = new GcInfoBuilder(this, getAllPoolNames()); + } + return gcInfoBuilder; + } + + private native void setNotificationEnabled(GarbageCollectorMXBean gc, + boolean enabled); + + // Invoked by the VM + private static java.lang.management.GarbageCollectorMXBean + createGarbageCollector(String name, String type) { + + return new GarbageCollectorExtImpl(name); + } +} diff --git a/jdk/src/java.management/share/classes/sun/management/GcInfoBuilder.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java similarity index 95% rename from jdk/src/java.management/share/classes/sun/management/GcInfoBuilder.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java index b503df57ad9..ab5f795f147 100644 --- a/jdk/src/java.management/share/classes/sun/management/GcInfoBuilder.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,20 +22,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package sun.management; +package com.sun.management.internal; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.MemoryUsage; import javax.management.openmbean.OpenType; import javax.management.openmbean.SimpleType; -import javax.management.openmbean.TabularType; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.CompositeType; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.OpenDataException; import com.sun.management.GcInfo; +import sun.management.Util; /** * Helper class to build composite data. @@ -164,7 +160,7 @@ public class GcInfoBuilder { allItemTypes); } catch (OpenDataException e) { // shouldn't reach here - throw Util.newException(e); + throw new RuntimeException(e); } gcInfoCompositeType = gict; diff --git a/jdk/src/java.management/share/classes/sun/management/GcInfoCompositeData.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java similarity index 97% rename from jdk/src/java.management/share/classes/sun/management/GcInfoCompositeData.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java index b1cb38e16b1..67444a4b5d6 100644 --- a/jdk/src/java.management/share/classes/sun/management/GcInfoCompositeData.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,16 +23,12 @@ * questions. */ -package sun.management; +package com.sun.management.internal; import java.lang.management.MemoryUsage; import java.lang.reflect.Method; import java.lang.reflect.Field; -import java.util.Iterator; import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.Collections; import java.io.InvalidObjectException; import javax.management.openmbean.CompositeType; import javax.management.openmbean.CompositeData; @@ -42,9 +38,12 @@ import javax.management.openmbean.SimpleType; import javax.management.openmbean.OpenType; import javax.management.openmbean.OpenDataException; import com.sun.management.GcInfo; -import com.sun.management.GarbageCollectionNotificationInfo; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.management.LazyCompositeData; +import static sun.management.LazyCompositeData.getLong; +import sun.management.MappedMXBeanType; +import sun.management.Util; /** * A CompositeData for GcInfo for the local management support. @@ -266,7 +265,7 @@ public class GcInfoCompositeData extends LazyCompositeData { getBaseGcInfoItemTypes()); } catch (OpenDataException e) { // shouldn't reach here - throw Util.newException(e); + throw new RuntimeException(e); } } return baseGcInfoCompositeType; diff --git a/jdk/src/java.management/share/classes/sun/management/HotSpotDiagnostic.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotDiagnostic.java similarity index 97% rename from jdk/src/java.management/share/classes/sun/management/HotSpotDiagnostic.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotDiagnostic.java index 7c39ea7e9d3..5b9d8efdafc 100644 --- a/jdk/src/java.management/share/classes/sun/management/HotSpotDiagnostic.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotDiagnostic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -package sun.management; +package com.sun.management.internal; import java.io.IOException; import java.util.ArrayList; @@ -32,6 +32,7 @@ import javax.management.ObjectName; import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; +import sun.management.Util; /** * Implementation of the diagnostic MBean for Hotspot VM. diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotThreadImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotThreadImpl.java new file mode 100644 index 00000000000..e31947e4647 --- /dev/null +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/HotSpotThreadImpl.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.management.internal; + +import com.sun.management.ThreadMXBean; +import sun.management.ManagementFactoryHelper; +import sun.management.ThreadImpl; +import sun.management.VMManagement; + +/** + * + */ +public class HotSpotThreadImpl extends ThreadImpl implements ThreadMXBean { + public HotSpotThreadImpl(VMManagement vm) { + super(ManagementFactoryHelper.getVMManagement()); + } + + @Override + public boolean isThreadAllocatedMemorySupported() { + return super.isThreadAllocatedMemorySupported(); + } + + @Override + public boolean isThreadAllocatedMemoryEnabled() { + return super.isThreadAllocatedMemoryEnabled(); + } + + @Override + public long[] getThreadCpuTime(long[] ids) { + return super.getThreadCpuTime(ids); + } + + @Override + public long[] getThreadUserTime(long[] ids) { + return super.getThreadUserTime(ids); + } + + @Override + public long getThreadAllocatedBytes(long id) { + return super.getThreadAllocatedBytes(id); + } + + @Override + public long[] getThreadAllocatedBytes(long[] ids) { + return super.getThreadAllocatedBytes(ids); + } + + @Override + public void setThreadAllocatedMemoryEnabled(boolean enable) { + super.setThreadAllocatedMemoryEnabled(enable); + } +} diff --git a/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java similarity index 63% rename from jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java index 42d41b65992..24fbbb54c93 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java @@ -24,7 +24,14 @@ */ package com.sun.management.internal; +import com.sun.management.DiagnosticCommandMBean; +import com.sun.management.HotSpotDiagnosticMXBean; +import com.sun.management.ThreadMXBean; import java.lang.management.ManagementFactory; +import java.lang.management.MemoryManagerMXBean; +import java.lang.management.OperatingSystemMXBean; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -34,12 +41,23 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.management.DynamicMBean; -import javax.management.ObjectName; import sun.management.ManagementFactoryHelper; import sun.management.spi.PlatformMBeanProvider; public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { + final static String DIAGNOSTIC_COMMAND_MBEAN_NAME = + "com.sun.management:type=DiagnosticCommand"; + private final List> mxbeanList; + private static HotSpotDiagnostic hsDiagMBean = null; + private static OperatingSystemMXBean osMBean = null; + + static { + AccessController.doPrivileged((PrivilegedAction) () -> { + System.loadLibrary("management_ext"); + return null; + }); + } public PlatformMBeanProviderImpl() { mxbeanList = Collections.unmodifiableList(init()); @@ -55,7 +73,7 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { /** * Garbage Collector in the Java virtual machine. */ - initMBeanList.add(new PlatformComponent() { + initMBeanList.add(new PlatformComponent() { private final Set garbageCollectorMXBeanInterfaceNames = Collections.unmodifiableSet( Stream.of("java.lang.management.MemoryManagerMXBean", @@ -64,8 +82,8 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { .collect(Collectors.toSet())); @Override - public Set> mbeanInterfaces() { - return Stream.of(java.lang.management.MemoryManagerMXBean.class, + public Set> mbeanInterfaces() { + return Stream.of(MemoryManagerMXBean.class, java.lang.management.GarbageCollectorMXBean.class, com.sun.management.GarbageCollectorMXBean.class) .collect(Collectors.toSet()); @@ -87,27 +105,67 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { } @Override - public Map nameToMBeanMap() { + public Map nameToMBeanMap() { List list - = ManagementFactoryHelper.getGarbageCollectorMXBeans();; - Map map; + = ManagementFactoryHelper.getGarbageCollectorMXBeans(); + Map map; if (list.isEmpty()) { - map = Collections.emptyMap(); + map = Collections.emptyMap(); } else { map = new HashMap<>(list.size()); - for (java.lang.management.MemoryManagerMXBean gcm : list) { + for (MemoryManagerMXBean gcm : list) { map.put(gcm.getObjectName().getCanonicalName(), gcm); } } + return map; } }); + /** + * Threading system of the Java virtual machine. + */ + initMBeanList.add(new PlatformComponent() { + private final Set threadMXBeanInterfaceNames + = Collections.unmodifiableSet( + Stream.of("java.lang.management.ThreadMXBean", + "com.sun.management.ThreadMXBean") + .collect(Collectors.toSet())); + private ThreadMXBean threadMBean = null; + + @Override + public Set> mbeanInterfaces() { + return Stream.of(java.lang.management.ThreadMXBean.class, + com.sun.management.ThreadMXBean.class) + .collect(Collectors.toSet()); + } + + @Override + public Set mbeanInterfaceNames() { + return threadMXBeanInterfaceNames; + } + + @Override + public String getObjectNamePattern() { + return ManagementFactory.THREAD_MXBEAN_NAME; + } + + @Override + public synchronized Map nameToMBeanMap() { + if (threadMBean == null) { + threadMBean = new HotSpotThreadImpl(ManagementFactoryHelper.getVMManagement()); + } + return Collections.singletonMap( + ManagementFactory.THREAD_MXBEAN_NAME, + threadMBean); + } + }); + /** * OperatingSystemMXBean */ - initMBeanList.add(new PlatformComponent() { + initMBeanList.add(new PlatformComponent() { private final Set operatingSystemMXBeanInterfaceNames = Collections.unmodifiableSet( Stream.of("java.lang.management.OperatingSystemMXBean", @@ -116,7 +174,7 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { .collect(Collectors.toSet())); @Override - public Set> mbeanInterfaces() { + public Set> mbeanInterfaces() { return Stream.of(java.lang.management.OperatingSystemMXBean.class, com.sun.management.OperatingSystemMXBean.class, com.sun.management.UnixOperatingSystemMXBean.class) @@ -137,7 +195,7 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { public Map nameToMBeanMap() { return Collections.singletonMap( ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, - ManagementFactoryHelper.getOperatingSystemMXBean()); + getOperatingSystemMXBean()); } }); @@ -146,7 +204,8 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { */ initMBeanList.add(new PlatformComponent() { private final Set hotSpotDiagnosticMXBeanInterfaceNames = - Collections.unmodifiableSet(Collections.singleton("com.sun.management.HotSpotDiagnosticMXBean")); + Collections.unmodifiableSet(Collections.singleton( + "com.sun.management.HotSpotDiagnosticMXBean")); @Override public Set> mbeanInterfaces() { @@ -167,19 +226,20 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { public Map nameToMBeanMap() { return Collections.singletonMap( "com.sun.management:type=HotSpotDiagnostic", - ManagementFactoryHelper.getDiagnosticMXBean()); + getDiagnosticMXBean()); } }); /** - * DynamicMBean + * Diagnostic command MBean */ - HashMap dynmbeans - = ManagementFactoryHelper.getPlatformDynamicMBeans(); - final Set dynamicMBeanInterfaceNames = - Collections.unmodifiableSet(Collections.singleton("javax.management.DynamicMBean")); - for (Map.Entry e : dynmbeans.entrySet()) { + DiagnosticCommandMBean diagMBean = DiagnosticCommandImpl.getDiagnosticCommandMBean(); + if (diagMBean != null) { initMBeanList.add(new PlatformComponent() { + final Set dynamicMBeanInterfaceNames + = Collections.unmodifiableSet(Collections.singleton( + "javax.management.DynamicMBean")); + @Override public Set mbeanInterfaceNames() { return dynamicMBeanInterfaceNames; @@ -187,23 +247,39 @@ public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider { @Override public Set> mbeanInterfaces() { - return Collections.emptySet(); // DynamicMBean cannot be used to find an MBean by ManagementFactory + // DynamicMBean cannot be used to find an MBean by ManagementFactory + return Collections.emptySet(); } @Override public String getObjectNamePattern() { - return e.getKey().getCanonicalName(); + return DIAGNOSTIC_COMMAND_MBEAN_NAME; } @Override public Map nameToMBeanMap() { return Collections.singletonMap( - e.getKey().getCanonicalName(), - e.getValue()); + DIAGNOSTIC_COMMAND_MBEAN_NAME, + diagMBean); } }); } + initMBeanList.trimToSize(); return initMBeanList; } + + private static synchronized HotSpotDiagnosticMXBean getDiagnosticMXBean() { + if (hsDiagMBean == null) { + hsDiagMBean = new HotSpotDiagnostic(); + } + return hsDiagMBean; + } + + private static synchronized OperatingSystemMXBean getOperatingSystemMXBean() { + if (osMBean == null) { + osMBean = new OperatingSystemImpl(ManagementFactoryHelper.getVMManagement()); + } + return osMBean; + } } diff --git a/jdk/src/java.management/share/classes/sun/management/VMOptionCompositeData.java b/jdk/src/jdk.management/share/classes/com/sun/management/internal/VMOptionCompositeData.java similarity index 96% rename from jdk/src/java.management/share/classes/sun/management/VMOptionCompositeData.java rename to jdk/src/jdk.management/share/classes/com/sun/management/internal/VMOptionCompositeData.java index 6eeac787000..9ca81a4d6ea 100644 --- a/jdk/src/java.management/share/classes/sun/management/VMOptionCompositeData.java +++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/VMOptionCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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. */ -package sun.management; +package com.sun.management.internal; import com.sun.management.VMOption; import com.sun.management.VMOption.Origin; @@ -31,6 +31,8 @@ import javax.management.openmbean.CompositeType; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.OpenDataException; +import sun.management.LazyCompositeData; +import sun.management.MappedMXBeanType; /** * A CompositeData for VMOption for the local management support. diff --git a/jdk/src/java.management/share/classes/com/sun/management/package-info.java b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java similarity index 100% rename from jdk/src/java.management/share/classes/com/sun/management/package-info.java rename to jdk/src/jdk.management/share/classes/com/sun/management/package-info.java diff --git a/jdk/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c b/jdk/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c similarity index 89% rename from jdk/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c rename to jdk/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c index 4c1eeea2f0b..f0267dd3ee3 100644 --- a/jdk/src/java.management/share/native/libmanagement/DiagnosticCommandImpl.c +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ #include #include -#include "management.h" -#include "sun_management_DiagnosticCommandImpl.h" +#include "management_ext.h" +#include "com_sun_management_internal_DiagnosticCommandImpl.h" -JNIEXPORT void JNICALL Java_sun_management_DiagnosticCommandImpl_setNotificationEnabled +JNIEXPORT void JNICALL Java_com_sun_management_internal_DiagnosticCommandImpl_setNotificationEnabled (JNIEnv *env, jobject dummy, jboolean enabled) { if (jmm_version <= JMM_VERSION_1_2_2) { JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", @@ -39,7 +39,7 @@ JNIEXPORT void JNICALL Java_sun_management_DiagnosticCommandImpl_setNotification } JNIEXPORT jobjectArray JNICALL -Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommands +Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommands (JNIEnv *env, jobject dummy) { return jmm_interface->GetDiagnosticCommands(env); @@ -64,7 +64,7 @@ jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command, jmm_interface->GetDiagnosticCommandArgumentsInfo(env, command, dcmd_arg_info_array); dcmdArgInfoCls = (*env)->FindClass(env, - "sun/management/DiagnosticCommandArgumentInfo"); + "com/sun/management/internal/DiagnosticCommandArgumentInfo"); if ((*env)->ExceptionCheck(env)) { free(dcmd_arg_info_array); return NULL; @@ -77,7 +77,7 @@ jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command, } for (i=0; iNewStringUTF(env,dcmd_arg_info_array[i].name), (*env)->NewStringUTF(env,dcmd_arg_info_array[i].description), @@ -113,7 +113,7 @@ jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command, * passed in argument is not supported by the JVM */ JNIEXPORT jobjectArray JNICALL -Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo +Java_com_sun_management_internal_DiagnosticCommandImpl_getDiagnosticCommandInfo (JNIEnv *env, jobject dummy, jobjectArray commands) { int i; @@ -132,7 +132,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo } num_commands = (*env)->GetArrayLength(env, commands); dcmdInfoCls = (*env)->FindClass(env, - "sun/management/DiagnosticCommandInfo"); + "com/sun/management/internal/DiagnosticCommandInfo"); if ((*env)->ExceptionCheck(env)) { return NULL; } @@ -163,7 +163,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo return NULL; } obj = JNU_NewObjectByName(env, - "sun/management/DiagnosticCommandInfo", + "com/sun/management/internal/DiagnosticCommandInfo", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/util/List;)V", (*env)->NewStringUTF(env,dcmd_info_array[i].name), (*env)->NewStringUTF(env,dcmd_info_array[i].description), @@ -188,7 +188,7 @@ Java_sun_management_DiagnosticCommandImpl_getDiagnosticCommandInfo * passed in argument is not supported by the JVM */ JNIEXPORT jstring JNICALL -Java_sun_management_DiagnosticCommandImpl_executeDiagnosticCommand +Java_com_sun_management_internal_DiagnosticCommandImpl_executeDiagnosticCommand (JNIEnv *env, jobject dummy, jstring command) { return jmm_interface->ExecuteDiagnosticCommand(env, command); } diff --git a/jdk/src/java.management/share/native/libmanagement/Flag.c b/jdk/src/jdk.management/share/native/libmanagement_ext/Flag.c similarity index 91% rename from jdk/src/java.management/share/native/libmanagement/Flag.c rename to jdk/src/jdk.management/share/native/libmanagement_ext/Flag.c index 00828f34967..1629468f398 100644 --- a/jdk/src/java.management/share/native/libmanagement/Flag.c +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/Flag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include #include #include -#include "management.h" -#include "sun_management_Flag.h" +#include "management_ext.h" +#include "com_sun_management_internal_Flag.h" static jobject default_origin = NULL; static jobject vm_creation_origin = NULL; @@ -40,7 +40,7 @@ static jobject attach_origin = NULL; static jobject other_origin = NULL; JNIEXPORT jint JNICALL -Java_sun_management_Flag_getInternalFlagCount +Java_com_sun_management_internal_Flag_getInternalFlagCount (JNIEnv *env, jclass cls) { jlong count = jmm_interface->GetLongAttribute(env, NULL, @@ -49,7 +49,7 @@ Java_sun_management_Flag_getInternalFlagCount } JNIEXPORT jobjectArray JNICALL - Java_sun_management_Flag_getAllFlagNames + Java_com_sun_management_internal_Flag_getAllFlagNames (JNIEnv *env, jclass cls) { return jmm_interface->GetVMGlobalNames(env); @@ -66,7 +66,7 @@ static jobject find_origin_constant(JNIEnv* env, const char* enum_name) { } JNIEXPORT void JNICALL -Java_sun_management_Flag_initialize +Java_com_sun_management_internal_Flag_initialize (JNIEnv *env, jclass cls) { default_origin = find_origin_constant(env, "DEFAULT"); @@ -80,13 +80,13 @@ Java_sun_management_Flag_initialize } JNIEXPORT jint JNICALL -Java_sun_management_Flag_getFlags +Java_com_sun_management_internal_Flag_getFlags (JNIEnv *env, jclass cls, jobjectArray names, jobjectArray flags, jint count) { jint num_flags, i, index; jmmVMGlobal* globals; size_t gsize; - const char* class_name = "sun/management/Flag"; + const char* class_name = "com/sun/management/internal/Flag"; const char* signature = "(Ljava/lang/String;Ljava/lang/Object;ZZLcom/sun/management/VMOption$Origin;)V"; jobject origin; jobject valueObj; @@ -196,7 +196,7 @@ Java_sun_management_Flag_getFlags } JNIEXPORT void JNICALL -Java_sun_management_Flag_setLongValue +Java_com_sun_management_internal_Flag_setLongValue (JNIEnv *env, jclass cls, jstring name, jlong value) { jvalue v; @@ -206,7 +206,7 @@ Java_sun_management_Flag_setLongValue } JNIEXPORT void JNICALL -Java_sun_management_Flag_setDoubleValue +Java_com_sun_management_internal_Flag_setDoubleValue (JNIEnv *env, jclass cls, jstring name, jdouble value) { jvalue v; @@ -216,7 +216,7 @@ Java_sun_management_Flag_setDoubleValue } JNIEXPORT void JNICALL -Java_sun_management_Flag_setBooleanValue +Java_com_sun_management_internal_Flag_setBooleanValue (JNIEnv *env, jclass cls, jstring name, jboolean value) { jvalue v; @@ -226,7 +226,7 @@ Java_sun_management_Flag_setBooleanValue } JNIEXPORT void JNICALL -Java_sun_management_Flag_setStringValue +Java_com_sun_management_internal_Flag_setStringValue (JNIEnv *env, jclass cls, jstring name, jstring value) { jvalue v; diff --git a/jdk/src/jdk.management/share/native/libmanagement_ext/GarbageCollectorExtImpl.c b/jdk/src/jdk.management/share/native/libmanagement_ext/GarbageCollectorExtImpl.c new file mode 100644 index 00000000000..f34d1959a32 --- /dev/null +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/GarbageCollectorExtImpl.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 +#include "management_ext.h" +#include "com_sun_management_internal_GarbageCollectorExtImpl.h" + +JNIEXPORT void JNICALL Java_com_sun_management_internal_GarbageCollectorExtImpl_setNotificationEnabled +(JNIEnv *env, jobject dummy, jobject gc,jboolean enabled) { + + if (gc == NULL) { + JNU_ThrowNullPointerException(env, "Invalid GarbageCollectorMBean"); + return; + } + if((jmm_version > JMM_VERSION_1_2) + || (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=1))) { + jmm_interface->SetGCNotificationEnabled(env, gc, enabled); + } +} diff --git a/jdk/src/java.management/share/native/libmanagement/GcInfoBuilder.c b/jdk/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c similarity index 94% rename from jdk/src/java.management/share/native/libmanagement/GcInfoBuilder.c rename to jdk/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c index 672cc6a7782..8fb337b8ecd 100644 --- a/jdk/src/java.management/share/native/libmanagement/GcInfoBuilder.c +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/GcInfoBuilder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include #include #include -#include "management.h" -#include "sun_management_GcInfoBuilder.h" +#include "management_ext.h" +#include "com_sun_management_internal_GcInfoBuilder.h" -JNIEXPORT jint JNICALL Java_sun_management_GcInfoBuilder_getNumGcExtAttributes +JNIEXPORT jint JNICALL Java_com_sun_management_internal_GcInfoBuilder_getNumGcExtAttributes (JNIEnv *env, jobject dummy, jobject gc) { jlong value; @@ -42,7 +42,7 @@ JNIEXPORT jint JNICALL Java_sun_management_GcInfoBuilder_getNumGcExtAttributes return (jint) value; } -JNIEXPORT void JNICALL Java_sun_management_GcInfoBuilder_fillGcAttributeInfo +JNIEXPORT void JNICALL Java_com_sun_management_internal_GcInfoBuilder_fillGcAttributeInfo (JNIEnv *env, jobject dummy, jobject gc, jint num_attributes, jobjectArray attributeNames, jcharArray types, jobjectArray descriptions) { @@ -173,7 +173,7 @@ static void setCharValueAtObjectArray(JNIEnv *env, jobjectArray array, (*env)->SetObjectArrayElement(env, array, index, obj); } -JNIEXPORT jobject JNICALL Java_sun_management_GcInfoBuilder_getLastGcInfo0 +JNIEXPORT jobject JNICALL Java_com_sun_management_internal_GcInfoBuilder_getLastGcInfo0 (JNIEnv *env, jobject builder, jobject gc, jint ext_att_count, jobjectArray ext_att_values, jcharArray ext_att_types, jobjectArray usageBeforeGC, jobjectArray usageAfterGC) { @@ -273,7 +273,7 @@ JNIEXPORT jobject JNICALL Java_sun_management_GcInfoBuilder_getLastGcInfo0 return JNU_NewObjectByName(env, "com/sun/management/GcInfo", - "(Lsun/management/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V", + "(Lcom/sun/management/internal/GcInfoBuilder;JJJ[Ljava/lang/management/MemoryUsage;[Ljava/lang/management/MemoryUsage;[Ljava/lang/Object;)V", builder, gc_stat.gc_index, gc_stat.start_time, diff --git a/jdk/src/java.management/share/native/libmanagement/HotSpotDiagnostic.c b/jdk/src/jdk.management/share/native/libmanagement_ext/HotSpotDiagnostic.c similarity index 86% rename from jdk/src/java.management/share/native/libmanagement/HotSpotDiagnostic.c rename to jdk/src/jdk.management/share/native/libmanagement_ext/HotSpotDiagnostic.c index fe6b2c6e7d2..d4b26771be6 100644 --- a/jdk/src/java.management/share/native/libmanagement/HotSpotDiagnostic.c +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/HotSpotDiagnostic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include #include "jvm.h" -#include "management.h" -#include "sun_management_HotSpotDiagnostic.h" +#include "management_ext.h" +#include "com_sun_management_internal_HotSpotDiagnostic.h" JNIEXPORT void JNICALL -Java_sun_management_HotSpotDiagnostic_dumpHeap0 +Java_com_sun_management_internal_HotSpotDiagnostic_dumpHeap0 (JNIEnv *env, jobject dummy, jstring outputfile, jboolean live) { jmm_interface->DumpHeap0(env, outputfile, live); diff --git a/jdk/src/java.management/share/classes/sun/management/ManagementFactory.java b/jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.c similarity index 53% rename from jdk/src/java.management/share/classes/sun/management/ManagementFactory.java rename to jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.c index b12a1c80b08..9d22c0a10a6 100644 --- a/jdk/src/java.management/share/classes/sun/management/ManagementFactory.java +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * 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,33 +23,39 @@ * questions. */ -package sun.management; +#include +#include +#include "jvm.h" +#include "management_ext.h" -import java.lang.management.MemoryManagerMXBean; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.GarbageCollectorMXBean; +#define ERR_MSG_SIZE 128 -/** - * ManagementFactory class provides the methods that the HotSpot VM - * will invoke. So the class and method names cannot be renamed. - */ -class ManagementFactory { - private ManagementFactory() {}; +const JmmInterface* jmm_interface = NULL; +JavaVM* jvm = NULL; +jint jmm_version = 0; - // Invoked by the VM - private static MemoryPoolMXBean createMemoryPool - (String name, boolean isHeap, long uThreshold, long gcThreshold) { - return new MemoryPoolImpl(name, isHeap, uThreshold, gcThreshold); +JNIEXPORT jint JNICALL + JNI_OnLoad(JavaVM *vm, void *reserved) { + JNIEnv* env; + + jvm = vm; + if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK) { + return JNI_ERR; } - private static MemoryManagerMXBean createMemoryManager(String name) { - return new MemoryManagerImpl(name); + jmm_interface = (JmmInterface*) JVM_GetManagement(JMM_VERSION_1_0); + if (jmm_interface == NULL) { + JNU_ThrowInternalError(env, "Unsupported Management version"); + return JNI_ERR; } - private static GarbageCollectorMXBean - createGarbageCollector(String name, String type) { - - // ignore type parameter which is for future extension - return new GarbageCollectorImpl(name); - } + jmm_version = jmm_interface->GetVersion(env); + return (*env)->GetVersion(env); +} + +void throw_internal_error(JNIEnv* env, const char* msg) { + char errmsg[128]; + + sprintf(errmsg, "errno: %d error: %s\n", errno, msg); + JNU_ThrowInternalError(env, errmsg); } diff --git a/jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.h b/jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.h new file mode 100644 index 00000000000..843de66872b --- /dev/null +++ b/jdk/src/jdk.management/share/native/libmanagement_ext/management_ext.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 + +#include "jni_util.h" +#include "jmm.h" + +#ifndef _MANAGEMENT_EXT_H_ +#define _MANAGEMENT_EXT_H_ + +extern const JmmInterface* jmm_interface; +extern jint jmm_version; +extern void throw_internal_error(JNIEnv* env, const char* msg); + +#endif diff --git a/jdk/src/java.management/unix/native/libmanagement/SolarisOperatingSystem.c b/jdk/src/jdk.management/solaris/native/libmanagement_ext/UnixOperatingSystem.c similarity index 95% rename from jdk/src/java.management/unix/native/libmanagement/SolarisOperatingSystem.c rename to jdk/src/jdk.management/solaris/native/libmanagement_ext/UnixOperatingSystem.c index d13a1b3d814..7628ed770a5 100644 --- a/jdk/src/java.management/unix/native/libmanagement/SolarisOperatingSystem.c +++ b/jdk/src/jdk.management/solaris/native/libmanagement_ext/UnixOperatingSystem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ #include #include #include "jvm.h" -#include "sun_management_OperatingSystemImpl.h" +#include "com_sun_management_internal_OperatingSystemImpl.h" typedef struct { kstat_t *kstat; @@ -226,14 +226,14 @@ double get_process_load(void) { } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0 (JNIEnv *env, jobject dummy) { return get_cpu_load(-1); } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0 (JNIEnv *env, jobject dummy) { return get_process_load(); diff --git a/jdk/src/java.management/unix/classes/sun/management/OperatingSystemImpl.java b/jdk/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java similarity index 94% rename from jdk/src/java.management/unix/classes/sun/management/OperatingSystemImpl.java rename to jdk/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java index b99c8008b1d..d1ce39c854b 100644 --- a/jdk/src/java.management/unix/classes/sun/management/OperatingSystemImpl.java +++ b/jdk/src/jdk.management/unix/classes/com/sun/management/internal/OperatingSystemImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +23,10 @@ * questions. */ -package sun.management; +package com.sun.management.internal; +import sun.management.BaseOperatingSystemImpl; +import sun.management.VMManagement; /** * Implementation class for the operating system. * Standard and committed hotspot-specific metrics if any. diff --git a/jdk/src/java.management/unix/native/libmanagement/OperatingSystemImpl.c b/jdk/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c similarity index 93% rename from jdk/src/java.management/unix/native/libmanagement/OperatingSystemImpl.c rename to jdk/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c index 00c4d558c96..1adeaf7bb53 100644 --- a/jdk/src/java.management/unix/native/libmanagement/OperatingSystemImpl.c +++ b/jdk/src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include "jni_util.h" #include "jlong.h" #include "jvm.h" -#include "management.h" -#include "sun_management_OperatingSystemImpl.h" +#include "management_ext.h" +#include "com_sun_management_internal_OperatingSystemImpl.h" #include #include @@ -179,14 +179,14 @@ static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean availa } JNIEXPORT void JNICALL -Java_sun_management_OperatingSystemImpl_initialize0 +Java_com_sun_management_internal_OperatingSystemImpl_initialize0 (JNIEnv *env, jclass cls) { page_size = sysconf(_SC_PAGESIZE); } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getCommittedVirtualMemorySize0 (JNIEnv *env, jobject mbean) { #ifdef __solaris__ @@ -256,21 +256,21 @@ Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize0 +Java_com_sun_management_internal_OperatingSystemImpl_getTotalSwapSpaceSize0 (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_FALSE); } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize0 +Java_com_sun_management_internal_OperatingSystemImpl_getFreeSwapSpaceSize0 (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_TRUE); } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuTime0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuTime0 (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ @@ -312,7 +312,7 @@ Java_sun_management_OperatingSystemImpl_getProcessCpuTime0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getFreePhysicalMemorySize0 (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ @@ -346,7 +346,7 @@ Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getTotalPhysicalMemorySize0 (JNIEnv *env, jobject mbean) { #ifdef _ALLBSD_SOURCE @@ -377,7 +377,7 @@ Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize0 JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount0 +Java_com_sun_management_internal_OperatingSystemImpl_getOpenFileDescriptorCount0 (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ @@ -466,7 +466,7 @@ Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getMaxFileDescriptorCount0 +Java_com_sun_management_internal_OperatingSystemImpl_getMaxFileDescriptorCount0 (JNIEnv *env, jobject mbean) { struct rlimit rlp; diff --git a/jdk/src/java.management/windows/classes/sun/management/OperatingSystemImpl.java b/jdk/src/jdk.management/windows/classes/com/sun/management/internal/OperatingSystemImpl.java similarity index 91% rename from jdk/src/java.management/windows/classes/sun/management/OperatingSystemImpl.java rename to jdk/src/jdk.management/windows/classes/com/sun/management/internal/OperatingSystemImpl.java index 52fb709b923..3ab491d422f 100644 --- a/jdk/src/java.management/windows/classes/sun/management/OperatingSystemImpl.java +++ b/jdk/src/jdk.management/windows/classes/com/sun/management/internal/OperatingSystemImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,9 +23,11 @@ * questions. */ -package sun.management; +package com.sun.management.internal; import com.sun.management.OperatingSystemMXBean; +import sun.management.BaseOperatingSystemImpl; +import sun.management.VMManagement; /** * Implementation class for the operating system. @@ -45,36 +47,44 @@ class OperatingSystemImpl extends BaseOperatingSystemImpl super(vm); } + @Override public long getCommittedVirtualMemorySize() { synchronized (psapiLock) { return getCommittedVirtualMemorySize0(); } } + @Override public long getTotalSwapSpaceSize() { return getTotalSwapSpaceSize0(); } + @Override public long getFreeSwapSpaceSize() { return getFreeSwapSpaceSize0(); } + @Override public long getProcessCpuTime() { return getProcessCpuTime0(); } + @Override public long getFreePhysicalMemorySize() { return getFreePhysicalMemorySize0(); } + @Override public long getTotalPhysicalMemorySize() { return getTotalPhysicalMemorySize0(); } + @Override public double getSystemCpuLoad() { return getSystemCpuLoad0(); } + @Override public double getProcessCpuLoad() { return getProcessCpuLoad0(); } diff --git a/jdk/src/java.management/windows/native/libmanagement/OperatingSystemImpl.c b/jdk/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c similarity index 98% rename from jdk/src/java.management/windows/native/libmanagement/OperatingSystemImpl.c rename to jdk/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c index 04dbf8497c8..9ff4980f0ba 100644 --- a/jdk/src/java.management/windows/native/libmanagement/OperatingSystemImpl.c +++ b/jdk/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include "jni_util.h" #include "jlong.h" #include "jvm.h" -#include "management.h" -#include "sun_management_OperatingSystemImpl.h" +#include "management_ext.h" +#include "com_sun_management_internal_OperatingSystemImpl.h" #include #include @@ -75,7 +75,7 @@ static HANDLE main_process; static void perfInit(void); JNIEXPORT void JNICALL -Java_sun_management_OperatingSystemImpl_initialize0 +Java_com_sun_management_internal_OperatingSystemImpl_initialize0 (JNIEnv *env, jclass cls) { main_process = GetCurrentProcess(); @@ -83,7 +83,7 @@ Java_sun_management_OperatingSystemImpl_initialize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getCommittedVirtualMemorySize0 (JNIEnv *env, jobject mbean) { PROCESS_MEMORY_COUNTERS pmc; @@ -95,7 +95,7 @@ Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize0 +Java_com_sun_management_internal_OperatingSystemImpl_getTotalSwapSpaceSize0 (JNIEnv *env, jobject mbean) { MEMORYSTATUSEX ms; @@ -105,7 +105,7 @@ Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize0 +Java_com_sun_management_internal_OperatingSystemImpl_getFreeSwapSpaceSize0 (JNIEnv *env, jobject mbean) { MEMORYSTATUSEX ms; @@ -115,7 +115,7 @@ Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuTime0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuTime0 (JNIEnv *env, jobject mbean) { @@ -134,7 +134,7 @@ Java_sun_management_OperatingSystemImpl_getProcessCpuTime0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getFreePhysicalMemorySize0 (JNIEnv *env, jobject mbean) { MEMORYSTATUSEX ms; @@ -144,7 +144,7 @@ Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize0 } JNIEXPORT jlong JNICALL -Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize0 +Java_com_sun_management_internal_OperatingSystemImpl_getTotalPhysicalMemorySize0 (JNIEnv *env, jobject mbean) { MEMORYSTATUSEX ms; @@ -1349,14 +1349,14 @@ perfGetCPULoad(int which) { } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getSystemCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getSystemCpuLoad0 (JNIEnv *env, jobject dummy) { return perfGetCPULoad(-1); } JNIEXPORT jdouble JNICALL -Java_sun_management_OperatingSystemImpl_getProcessCpuLoad0 +Java_com_sun_management_internal_OperatingSystemImpl_getProcessCpuLoad0 (JNIEnv *env, jobject dummy) { return perfGetProcessCPULoad(); diff --git a/jdk/src/linux/doc/man/ja/appletviewer.1 b/jdk/src/linux/doc/man/ja/appletviewer.1 index 76609bfd263..e85be92d09f 100644 --- a/jdk/src/linux/doc/man/ja/appletviewer.1 +++ b/jdk/src/linux/doc/man/ja/appletviewer.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: appletviewer .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "appletviewer" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "appletviewer" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -appletviewer \- Web֥饦γ¦ǥץåȤ¹Ԥޤ -.SH "" +appletviewer \- Webブラウザの外側でアプレットを実行します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,39 +64,39 @@ appletviewer \- Web .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fIurl\fR .RS 4 -ɽɥȤޤϥ꥽ξꡣǶڤ줿ʣURLǤޤ +表示するドキュメントまたはリソースの場所。空白で区切られた複数のURLを指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIappletviewer\fRޥɤ\fIurls\fR˻ꤵ줿ɥȤ뤤ϥ꥽³ơΥɥȤȤ뤽줾ΥץåȤȼΥɥɽޤurlsˤäƻȤ줿ɥȤ\fIOBJECT\fR\fIEMBED\fRޤ\fIAPPLET\fRǤɤΥץåȤ⻲ȤƤʤ硢\fIappletviewer\fRޥɤϲԤޤ\fIappletviewer\fRޥɤǥݡȤHTMLξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.htmlˤ -ץåȡӥ塼򻲾ȤƤ +\fIappletviewer\fRコマンドは\fIurls\fRに指定されたドキュメントあるいはリソースと接続して、そのドキュメントが参照するそれぞれのアプレットを独自のウィンドウで表示します。urlsによって参照されたドキュメントが、\fIOBJECT\fR、\fIEMBED\fRまたは\fIAPPLET\fRタグでどのアプレットも参照していない場合、\fIappletviewer\fRコマンドは何も行いません。\fIappletviewer\fRコマンドでサポートされるHTMLタグの詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.htmlにある +アプレット・ビューア・タグを参照してください。 .PP -\fIappletviewer\fRޥɤϡRFC2396줿סᥫ˥˽äƥ󥳡ɤ줿URLɬפȤޤݡȤΤϡ󥳡ɤ줿URLΤߤǤե̾ˤĤƤϡRFC2396λͤ˽äƥ󥳡ɤƤɬפޤ +\fIappletviewer\fRコマンドは、RFC2396で定義されたエスケープ・メカニズムに従ってエンコードされたURLを必要とします。サポートされるのは、エンコードされたURLのみです。ただし、ファイル名については、RFC2396の仕様に従ってエンコードを解除しておく必要があります。 .PP -\fB:\fR +\fB注意:\fR The -\fIappletviewer\fRޥɤϳȯѤǤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.htmlˤ -ץ/ƥȡץꥱ󤪤ӥɤˤĤƤ򻲾ȤƤ -.SH "ץ" +\fIappletviewer\fRコマンドは開発専用です。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.htmlにある +サンプル/テスト・アプリケーションおよびコードについてを参照してください。 +.SH "オプション" .PP \-debug .RS 4 -\fIjdb\fRޥɤѤJavaǥХåǥץåȡӥ塼򳫻ϤơɥΥץåȤǥХåޤ +\fIjdb\fRコマンドを使用してJavaデバッガでアプレット・ビューアを開始して、ドキュメント中のアプレットをデバッグします。 .RE .PP \-encoding \fIencoding\-name\fR .RS 4 -HTMLեΥ󥳡ǥ̾ꤷޤ +入力HTMLファイルのエンコーディング名を指定します。 .RE .PP \-J\fIjavaoption\fR .RS 4 -ʸ\fIjavaoption\fRϡץåȡӥ塼¹ԤJava󥿥ץ꥿1ĤΰȤϤޤ˥ڡޤʤǤʣΰϡ٤ƤƬ\fI\-J\fRǻϤޤɬפޤϡѥμ¹ԴĶޤϥ꡼ѤĴͭǤ +文字列\fIjavaoption\fRは、アプレット・ビューアを実行するJavaインタプリタに1つの引数として渡されます。引数にスペースを含めないでください。複数の引数は、すべてが接頭辞\fI\-J\fRで始まる必要があります。これは、コンパイラの実行環境またはメモリー使用の調整に有効です。 .RE .PP diff --git a/jdk/src/linux/doc/man/ja/idlj.1 b/jdk/src/linux/doc/man/ja/idlj.1 index 92b10e2e57d..f18c3f137f3 100644 --- a/jdk/src/linux/doc/man/ja/idlj.1 +++ b/jdk/src/linux/doc/man/ja/idlj.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: idlj .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "idlj" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "idlj" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -idlj \- ꤵ줿󥿥ե(IDL)եФJavaХǥ󥰤ޤ -.SH "" +idlj \- 指定されたインタフェース定義言語(IDL)ファイルに対してJavaバインディングを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,22 +64,22 @@ idlj \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤoptionsν֤ǤդǤ\fIidlfile\fR˻ꤹɬפޤ +コマンドライン・オプション。オプションを参照してください。optionsの順番は任意ですが、\fIidlfile\fRよりも前に指定する必要があります。 .RE .PP \fIidlfile\fR .RS 4 -󥿥ե(IDL)ˤޤޤե̾ +インタフェース定義言語(IDL)による定義が含まれるファイルの名前。 .RE -.SH "" +.SH "説明" .PP -IDL\-to\-Javaѥϡꤵ줿IDLեФJavaХǥ󥰤ޤХǥ󥰤ξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlˤ -Java IDL: Javaޥåԥ󥰤ؤIDL򻲾ȤƤ +IDL\-to\-Javaコンパイラは、指定されたIDLファイルに対してJavaバインディングを生成します。バインディングの詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlにある +Java IDL: Java言語マッピングへのIDLを参照してください。 .PP -IDL\-to\-JavaѥΰΥ꡼ˤϡ\fIidltojava\fRȤ̾äΤޤ -.SS "饤ȡХǥ󥰤ӥСХǥ󥰤ȯ" +IDL\-to\-Javaコンパイラの以前のリリースの中には、\fIidltojava\fRという名前だったものがあります。 +.SS "クライアント・バインディングおよびサーバー・バインディングの発行" .PP -\fIidlj\fRޥɤϡ饤¦Хǥ󥰤ޤ\fIMy\&.idl\fRȤ̾IDLեޤ +次の\fIidlj\fRコマンドは、クライアント側バインディングを含む\fIMy\&.idl\fRという名前のIDLファイルを生成します。 .sp .if n \{\ .RS 4 @@ -91,7 +91,7 @@ idlj My\&.idl .RE .\} .PP -ιʸϼƱǤ +前の構文は次と同等です。 .sp .if n \{\ .RS 4 @@ -103,7 +103,7 @@ idlj \-fclient My\&.idl .RE .\} .PP -ǤϡС¦Хǥ󥰤饤¦Хǥ󥰤ӥȥޤƤꡢϤ٤ơPOA (Ѿǥ)Ǥ +次の例では、サーバー側バインディングを生成し、クライアント側バインディングおよびスケルトンを含めており、これらはすべて、POA (継承モデル)です。 .sp .if n \{\ .RS 4 @@ -115,7 +115,7 @@ idlg \-fserver My\&.idl .RE .\} .PP -饤¦ȥС¦ξΥХǥ󥰤ϡΥޥ(ɤ)Τ1ĤѤޤ +クライアント側とサーバー側の両方のバインディングを生成する場合は、次のコマンド(どれも等価)のうちの1つを使用します。 .sp .if n \{\ .RS 4 @@ -128,7 +128,7 @@ idlj \-fall My\&.idl .RE .\} .PP -С¦Dzǽʥǥ2ĤޤܿǽХȷѾǥTieǥǤTieѾǥ򻲾ȤƤ +サーバー側で可能なモデルは2つあります。移殖可能サーバント継承モデルとTieモデルです。Tie委譲モデルを参照してください。 .if n \{\ .sp .\} @@ -138,21 +138,21 @@ idlj \-fall My\&.idl .nr an-break-flag 1 .br .ps +1 -\fBܿǽХȷѾǥ\fR +\fB移殖可能サーバント継承モデル\fR .ps -1 .br .PP -ǥեȤΥС¦ΥǥϡܿǽХȷѾǥǤ\fIMy\&.idl\fR\fIMy\fR󥿥եƤϡ\fIMyPOA\&.java\fRȤե뤬ޤ\fIMy\fR󥿥եμ󶡤ɬפꡢ\fIMy\fR󥿥ե\fIMyPOA\fR饹Ѿɬפޤ\fIMyPOA\&.java\fRϡhttp://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.htmlˤ -\fIorg\&.omg\&.PortableServer\&.Servant\fR饹ĥ륹ȥ꡼١ΥȥǤ +デフォルトのサーバー側のモデルは、移殖可能サーバント継承モデルです。\fIMy\&.idl\fR内で\fIMy\fRインタフェースが定義されている場合は、\fIMyPOA\&.java\fRというファイルが生成されます。\fIMy\fRインタフェースの実装を提供する必要があり、\fIMy\fRインタフェースは\fIMyPOA\fRクラスから継承する必要があります。\fIMyPOA\&.java\fRは、http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.htmlにある +\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスを拡張するストリームベースのスケルトンです。 .PP -\fIMy\fR󥿥եϡȥ󤬼IDL󥿥ե˴ϢդƤ\fIcallHandler\fR󥿥ե󥿥եޤ +\fIMy\fRインタフェースは、スケルトンが実装するIDLインタフェースに関連付けられている\fIcallHandler\fRインタフェースと操作インタフェースを実装します。 .PP -ݡ֥롦֥ȡץ(POA)\fIPortableServer\fR⥸塼ϡͥƥ֤\fIServant\fRޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.htmlˤ -ݡ֥롦֥ȡץ(POA)򻲾ȤƤ +ポータブル・オブジェクト・アダプタ(POA)の\fIPortableServer\fRモジュールは、ネイティブの\fIServant\fR型を定義します。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.htmlにある +ポータブル・オブジェクト・アダプタ(POA)を参照してください。 .PP -Javaץߥ󥰸Ǥϡ\fIServant\fRJava\fIorg\&.omg\&.PortableServer\&.Servant\fR饹˥ޥåפޤϡ٤ƤPOAХȼΥ١饹ȤƵǽץꥱ󡦥ץޤƤӽФȤΤǤ뤤ĤΥ᥽åɡPOAˤäƸƤӽФ졢ХȤư椹뤿˥桼С饤ɤǤ᥽åɤ󶡤ޤ +Javaプログラミング言語では、\fIServant\fR型はJavaの\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスにマップされます。これは、すべてのPOAサーバント実装のベース・クラスとして機能し、アプリケーション・プログラマが呼び出すことのできるいくつかのメソッド、およびPOAによって呼び出され、サーバントの動作を制御するためにユーザーがオーバーライドできるメソッドを提供します。 .PP -ѾǥΤ⤦1ĤΥץϡ\fI\-oldImplBase\fRե饰ѤơJava SE 1\&.4Υ꡼Javaץߥ󥰸ȸߴΤ륵С¦Хǥ󥰤뤳ȤǤ\-\fIoldImplBase\fRե饰ɸǡAPI侩ǤΥե饰ѤΤϡJava SE 1\&.3ǵҤ줿¸ΥСȤθߴɬפʾΤߤǤξ硢¸makeեѹơ\fI\-oldImplBase\fRե饰\fIidlj\fRѥɲäɬפޤʳξ硢POA١ΥС¦ޥåԥ󥰤ޤ̸ߴΤ륵С¦Хǥ󥰤ˤϡ¹Ԥޤ +継承モデルのもう1つのオプションは、\fI\-oldImplBase\fRフラグを使用して、Java SE 1\&.4より前のリリースのJavaプログラミング言語と互換性のあるサーバー側バインディングを生成することです。\-\fIoldImplBase\fRフラグは非標準で、これらのAPIは非推奨です。このフラグを使用するのは、Java SE 1\&.3で記述された既存のサーバーとの互換性が必要な場合のみです。その場合、既存のmakeファイルを変更して、\fI\-oldImplBase\fRフラグを\fIidlj\fRコンパイラに追加する必要があります。それ以外の場合、POAベースのサーバー側マッピングが生成されます。下位互換性のあるサーバー側バインディングを生成するには、次を実行します。 .sp .5v .RE .sp @@ -167,7 +167,7 @@ idlj \-fall \-oldImplBase My\&.idl .RE .\} .PP -\fIMy\&.idl\fR\fIMy\fR󥿥եƤϡ\fI_MyImplBase\&.java\fRȤե뤬ޤ\fIMy\fR󥿥եμ󶡤ɬפꡢ\fIMy\fR󥿥ե\fI_MyImplBase\fR饹Ѿɬפޤ +\fIMy\&.idl\fR内で\fIMy\fRインタフェースが定義されている場合は、\fI_MyImplBase\&.java\fRというファイルが生成されます。\fIMy\fRインタフェースの実装を提供する必要があり、\fIMy\fRインタフェースは\fI_MyImplBase\fRクラスから継承する必要があります。 .if n \{\ .sp .\} @@ -177,11 +177,11 @@ idlj \-fall \-oldImplBase My\&.idl .nr an-break-flag 1 .br .ps +1 -\fBTieѾǥ\fR +\fBTie委譲モデル\fR .ps -1 .br .PP -⤦1ĤΥС¦ǥϡTieǥȸƤФΤǤΥС¦ǥϡѾǥǤTieȥȥƱ뤳ȤϤǤʤᡢ̡ɬפޤΥޥɤˤäơTieǥѤΥХǥ󥰤ޤ +もう1つのサーバー側モデルは、Tieモデルと呼ばれるものです。このサーバー側モデルは、委譲モデルです。Tieとスケルトンを同時に生成することはできないため、それらは別々に生成する必要があります。次のコマンドによって、Tieモデル用のバインディングが生成されます。 .sp .5v .RE .sp @@ -196,7 +196,7 @@ idlj \-fallTIE My\&.idl .RE .\} .PP -\fIMy\fR󥿥եξ硢2ܤΥޥɤˤꡢ\fIMyPOATie\&.java\fRޤ\fIMyPOATie\fR饹ؤΥ󥹥ȥ饯ϡdelegateޤǤϡǥեȤPOAǥѤƤ뤿ᡢ󥹥ȥ饯ˤPOAɬפǤdelegateФƼ󶡤ɬפޤμ\fIMyOperations\fR󥿥եѾɬפΤߤǡ¾Υ饹ѾɬפϤޤ󡣤ORBȰ˻ѤˤϡȤмΤ褦\fIMyPOATie\fR饹Ǽåפɬפޤ +\fIMy\fRインタフェースの場合、2番目のコマンドにより、\fIMyPOATie\&.java\fRが生成されます。\fIMyPOATie\fRクラスへのコンストラクタは、delegateを取ります。この例では、デフォルトのPOAモデルを使用しているため、コンストラクタにもPOAが必要です。delegateに対して実装を提供する必要がありますが、この実装は\fIMyOperations\fRインタフェースから継承する必要があるのみで、その他のクラスから継承する必要はありません。これをORBと一緒に使用するには、たとえば次のように\fIMyPOATie\fRクラス内で実装をラップする必要があります。 .sp .if n \{\ .RS 4 @@ -222,9 +222,9 @@ My ref = tie\&._this(orb); .RE .\} .PP -¾μѾɬפ硢ɸηѾǥǤϤʤTieǥѤ뤳ȤǤޤJavaξϡ󥿥եηѾθĿ¤Ϥޤ󤬡饹ηѾ˻ѤǤ륹åȤ1ĤΤߤǤѾǥѤϡΥåȤͭޤTieǥѤȡΥåȤѤ줺桼ȼŪǻѤǤޤˡˤϡΥ٥뤬1ƳȤû꤬ޤ᥽åɤƤӽФȤˡ;ʬʥ᥽åɸƽФ1ȯޤ +他の実装から継承する必要がある場合、標準の継承モデルではなくTieモデルを使用することもできます。Javaの場合は、インタフェースの継承の個数に制限はありませんが、クラスの継承に使用できるスロットは1つのみです。継承モデルを使用した場合は、そのスロットが占有されます。Tieモデルを使用すると、そのスロットが使用されず、ユーザーが独自の目的で使用できます。この方法には、間接性のレベルが1つ導入されるという短所があります。メソッドを呼び出すときに、余分なメソッド呼出しが1回発生します。 .PP -С¦ξ硢Java SE 1\&.4ΥСJava˥ޥåԥ󥰤IDLΥСȸߴΤ롢TieǥΥХǥ󥰤Ǥ +サーバー側の生成の場合、Java SE 1\&.4より前のバージョンのJava言語にマッピングするIDLのバージョンと互換性のある、Tieモデルのバインディングです。 .sp .if n \{\ .RS 4 @@ -237,7 +237,7 @@ idlj \-oldImplBase \-fallTIE My\&.idl .RE .\} .PP -\fIMy\fR󥿥եξ硢ˤꡢ\fIMy_Tie\&.java\fRޤ\fIMy_Tie\fR饹ؤΥ󥹥ȥ饯ϡ\fIimpl\fR֥Ȥޤ\fIimpl\fRФƼ󶡤ɬפޤμ\fIHelloOperations\fR󥿥եѾɬפΤߤǡ¾Υ饹ѾɬפϤޤ󡣤ORBȰ˻ѤˤϡȤмΤ褦\fIMy_Tie\fRǼåפɬפޤ +\fIMy\fRインタフェースの場合、これにより、\fIMy_Tie\&.java\fRが生成されます。\fIMy_Tie\fRクラスへのコンストラクタは、\fIimpl\fRオブジェクトを取ります。\fIimpl\fRに対して実装を提供する必要がありますが、その実装は\fIHelloOperations\fRインタフェースから継承する必要があるのみで、その他のクラスから継承する必要はありません。しかし、これをORBと一緒に使用するには、たとえば次のように\fIMy_Tie\fR内で実装をラップする必要があります。 .sp .if n \{\ .RS 4 @@ -258,15 +258,15 @@ My ref = tie\&._this(orb); .if n \{\ .RE .\} -.SS "ȯԤ줿եذ֤λ" +.SS "発行されたファイルの代替位置の指定" .PP -ȯԤ줿ե򸽺ߤΥǥ쥯ȥʳΥǥ쥯ȥ֤ˤϡ\fIi\fR\fIdlj \-td /altdir My\&.idl\fRΥޥɤǥѥƤӽФޤ +発行されたファイルを現在のディレクトリ以外のディレクトリに置くには、\fIi\fR\fIdlj \-td /altdir My\&.idl\fRのコマンドでコンパイラを呼び出します。 .PP -\fIMy\fR󥿥եξ硢Хǥ󥰤ϡ\fI\&./My\&.java\fRǤϤʤ\fI/altdir/My\&.java\fRʤɤȯԤޤ -.SS "󥯥롼ɡեذ֤λ" +\fIMy\fRインタフェースの場合、バインディングは、\fI\&./My\&.java\fRではなく、\fI/altdir/My\&.java\fRなどに発行されます。 +.SS "インクルード・ファイルの代替位置の指定" .PP -\fIMy\&.idl\fRե뤬̤\fIidl\fRեǤ\fIMyOther\&.idl\fR򥤥󥯥롼ɤ硢ѥǤϡ\fIMyOther\&.idl\fRե뤬롦ǥ쥯ȥ¸ߤ뤳ȤȤƤޤȤС줬\fI/includes\fRˤϡΤ褦ʥޥɤǥѥƤӽФޤ +\fIMy\&.idl\fRファイルが別の\fIidl\fRファイルである\fIMyOther\&.idl\fRをインクルードする場合、コンパイラでは、\fIMyOther\&.idl\fRファイルがローカル・ディレクトリに存在することを前提としています。たとえば、それが\fI/includes\fRにある場合は、次のようなコマンドでコンパイラを呼び出します。 .sp .if n \{\ .RS 4 @@ -278,7 +278,7 @@ idlj \-i /includes My\&.idl .RE .\} .PP -ȤС\fI/moreIncludes\fRˤ\fIAnother\&.idl\fR\fIMy\&.idl\fR˥󥯥롼ɤƤΤǤСΤ褦ʥޥɤǥѥƤӽФޤ +たとえば、\fI/moreIncludes\fRにある\fIAnother\&.idl\fRも\fIMy\&.idl\fRにインクルードされているのであれば、次のようなコマンドでコンパイラを呼び出します。 .sp .if n \{\ .RS 4 @@ -290,7 +290,7 @@ idlj \-i /includes \-i /moreIncludes My\&.idl .RE .\} .PP -Τ褦ʷ\fIinclude\fRĹʤ뤿ᡢ󥯥롼ɡե򸡺򥳥ѥ˻ؼ뤿̤ˡѰդƤޤˡϡĶѿιͤȻƤޤ\fICLASSPATH\fRѿ˰ɽƤǥ쥯ȥidl\&.configȤ̾Υեޤ\fIidl\&.config\fRˡΤ褦ʷιԤޤ +このような形式の\fIinclude\fRは長くなるため、インクルード・ファイルを検索する場所をコンパイラに指示するための別の方法が用意されています。この方法は、環境変数の考え方と似ています。\fICLASSPATH\fR変数に一覧表示されているディレクトリ内にidl\&.configという名前のファイルを作成します。その\fIidl\&.config\fRの中に、次のような形式の行を入れます。 .sp .if n \{\ .RS 4 @@ -302,10 +302,10 @@ includes=/includes;/moreIncludes .RE .\} .PP -ѥϡΥե򸡺󥯥롼ɡꥹȤɤ߹ߤޤǤϡǥ쥯ȥδ֤ζڤʸϥߥ(;)ˤʤäƤޤζڤʸϡץåȥեˤäưۤʤޤWindowsץåȥեǤϥߥѤUNIXץåȥեǤϥѤʤɤǤ -.SS "󥯥롼ɡեФХǥ󥰤ȯ" +コンパイラは、このファイルを検索し、インクルード・リストを読み込みます。この例では、ディレクトリの間の区切り文字はセミコロン(;)になっています。この区切り文字は、プラットフォームによって異なります。Windowsプラットフォームではセミコロンを使用し、UNIXプラットフォームではコロンを使用するなどです。 +.SS "インクルード・ファイルに対するバインディングの発行" .PP -ǥեȤǤϡޥɥ饤˻ꤷ\fIidl\fRեƤ륤󥿥ե乽¤ΤʤɤˤĤƤΤߡJavaХǥ󥰤ޤ󥯥롼ɤ줿եƤ뷿ˤĤƤޤ󡣤ȤС2Ĥ\fIidl\fRեˤĤƹͤƤߤޤ +デフォルトでは、コマンドラインに指定した\fIidl\fRファイルで定義されているインタフェースや構造体などについてのみ、Javaバインディングが生成されます。インクルードされたファイルで定義されている型については生成されません。たとえば、次の2つの\fIidl\fRファイルについて考えてみます。 .sp .if n \{\ .RS 4 @@ -328,7 +328,7 @@ interface MyOther .RE .\} .PP -ǥեȤΥ롼˴ؤƷٹ𤬤ޤХ롦פɽ\fI#include\fRʸϡҤΤȤ˽ޤ\fI#include\fRʸϡݡʸȸʤȤǤޤϤޤ줿ɽ\fI#include\fRʸϡΰ̣Ǥ\fI#include\fRʸȤƽޤĤޤꡢ󥯥롼ɤ줿եˤ륳ɤΥեˤΤޤɽƤ뤫Τ褦˽졢ФJavaХǥ󥰤ȯԤޤϤǤ +デフォルトのルールに関して警告があります。グローバル・スコープに表示される\fI#include\fR文は、前述のとおりに処理されます。これらの\fI#include\fR文は、インポート文と見なすことができます。囲まれたスコープ内に表示される\fI#include\fR文は、本当の意味での\fI#include\fR文として処理されます。つまり、インクルードされたファイルにあるコードが、元のファイルにそのまま表示されているかのように処理され、それに対してJavaバインディングが発行されます。次はその例です。 .sp .if n \{\ .RS 4 @@ -356,7 +356,7 @@ enum E {one, two, three}; .RE .\} .PP -\fI idlj My\&.idl \fR¹ԤơJavaեμΥꥹȤޤݡʸȤߤʤ\fI#include\fRƤᡢ\fIMyOther\&.java\fRޤǤΰ̣Ǥ\fI#include\fRƤᡢ\fIE\&.java\fRޤ\fIEmbedded\&.idl\fRե뤬\fIMy\fR󥿥եΥ˥󥯥롼ɤƤ뤿ᡢ\fIMy\fRΥ(Ĥޤꡢ\fIMyPackage\fR)Ƥޤ\fI\-emitAll\fRե饰Ѥ硢󥯥롼ɤ줿٤ƤΥեˤ뤹٤ƤηȯԤޤ +\fI idlj My\&.idl \fRを実行して、Javaファイルの次のリストを生成します。インポート文とみなされる\fI#include\fRに定義されていたため、\fIMyOther\&.java\fRは生成されませんでした。ただし、本当の意味での\fI#include\fRで定義されていたため、\fIE\&.java\fRは生成されました。\fIEmbedded\&.idl\fRファイルが\fIMy\fRインタフェースのスコープ内にインクルードされているため、\fIMy\fRのスコープ内(つまり、\fIMyPackage\fR内)に生成されています。\fI\-emitAll\fRフラグを使用した場合、インクルードされたすべてのファイルにあるすべての型が発行されます。 .sp .if n \{\ .RS 4 @@ -374,9 +374,9 @@ enum E {one, two, three}; .if n \{\ .RE .\} -.SS "ѥåƬ" +.SS "パッケージの接頭辞の挿入" .PP -ABCȤ̾βҤΤ˺ȤƤơΤ褦IDLեۤȤޤ礦 +ABCという名前の会社のために作業していて、次のようなIDLファイルを構築したとしましょう。 .sp .if n \{\ .RS 4 @@ -394,7 +394,7 @@ module Widgets .RE .\} .PP -IDL\-to\-Javaѥ𤷤ƤΥե¹Ԥ硢W1W2ФJavaХǥ󥰤ϡ\fIWidgets\fRѥå˳ǼޤȳδˤȡҤΥѥåϡ\fIcom\&.\fRȤ̾Υѥå֤ȤˤʤäƤޤδ˽ˤϡѥå̾\fIcom\&.abc\&.Widgets\fRˤɬפޤΥѥåƬWidgets⥸塼ղäˤϡΥޥɤ¹Ԥޤ +IDL\-to\-Javaコンパイラを介してこのファイルを実行した場合、W1およびW2に対するJavaバインディングは、\fIWidgets\fRパッケージ内に格納されます。業界の慣例によると、会社のパッケージは、\fIcom\&.\fRという名前のパッケージ内に置くことになっています。この慣例に従うには、パッケージ名を\fIcom\&.abc\&.Widgets\fRにする必要があります。このパッケージ接頭辞をWidgetsモジュールに付加するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -406,30 +406,30 @@ idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl .RE .\} .PP -Widgets\&.idl򥤥󥯥롼ɤƤIDLե뤬ϡΥޥɤˤ\fI\-pkgPrefix\fRե饰ɬפǤΥե饰ꤷʤȡIDLեϡ\fIcom\&.abc\&.Widgets\fRѥåǤϤʤ\fIWidgets\fRѥå򸡺뤳Ȥˤʤޤ +Widgets\&.idlをインクルードしているIDLファイルがある場合は、そのコマンドにも\fI\-pkgPrefix\fRフラグが必要です。このフラグを指定しないと、そのIDLファイルは、\fIcom\&.abc\&.Widgets\fRパッケージではなく、\fIWidgets\fRパッケージを検索することになります。 .PP -ƬɬפʥѥåĤ⤢ϡҤidl\&.configեƬꤹΤñǤѥåƬγƹԤϡ\fIPkgPrefix\&.=\fRηǤɬפޤҤιԤǤϡ\fIPkgPrefix\&.Widgets=com\&.abc\fRˤʤޤΥץϡݥȥIDˤϱƶޤ -.SS "ѥΥܥ" +接頭辞が必要なパッケージがいくつもある場合は、前述のidl\&.configファイルで接頭辞を指定するのが簡単です。パッケージ接頭辞の各行は、\fIPkgPrefix\&.=\fRの形式である必要があります。前述の例の行では、\fIPkgPrefix\&.Widgets=com\&.abc\fRになります。このオプションは、リポジトリIDには影響しません。 +.SS "コンパイル前のシンボルの定義" .PP -ѥѤΥܥ뤬IDLեƤʤϡΥܥɬפޤϡȤСХǥ˥ǥХåɤȤȤ˻Ѥޤޥ\fIidlj \-d MYDEF My\&.idl \fRϡMy\&.idl˹\fI#define MYDEF\fR֤Ʊˤʤޤ -.SS "¸ΥХǥ󥰤ݻ" +コンパイル用のシンボルがIDLファイル内で定義されていない場合は、そのシンボルを定義する必要があります。これは、たとえば、バインディング内にデバッグ・コードを組み入れるときに使用します。コマンド\fIidlj \-d MYDEF My\&.idl \fRは、My\&.idl内に行\fI#define MYDEF\fRを配置した場合と同等になります。 +.SS "既存のバインディングの保持" .PP -JavaХǥ󥰡ե뤬Ǥ¸ߤϡ\fI\-keep\fRե饰ꤹȡѥˤ񤭤ǤޤǥեȤǤϡǤ¸ߤ뤫ɤˤ餺٤ƤΥե뤬ޤΥե򥫥ޥ(ƤΤǤȤʳϥޥ򤱤)\fI\-keep\fRץͭѤǤޥ\fIidlj \-keep My\&.idl\fRϡǤ¸ߤʤ٤ƤΥ饤¦Хǥ󥰤ȯԤޤ -.SS "ѥοĽɽ" +Javaバインディング・ファイルがすでに存在する場合は、\fI\-keep\fRフラグを指定すると、コンパイラによる上書きを回避できます。デフォルトでは、すでに存在するかどうかにかかわらず、すべてのファイルが生成されます。これらのファイルをカスタマイズした場合(ただし、それらの内容が正確であるとき以外はカスタマイズは避ける)、\fI\-keep\fRオプションは有用です。コマンド\fIidlj \-keep My\&.idl\fRは、すでに存在しないすべてのクライアント側バインディングを発行します。 +.SS "コンパイルの進捗状況の表示" .PP -IDL\-to\-Javaѥϡ¹ԤγʳǾ֥åޤ\fI\-v\fRץѤơ\fIidlj \-v My\&.idl\fRΤ褦ʾĹ⡼ɤ򥢥ƥֲޤ +IDL\-to\-Javaコンパイラは、実行の各段階で状態メッセージを生成します。\fI\-v\fRオプションを使用して、\fIidlj \-v My\&.idl\fRのような冗長モードをアクティブ化します。 .PP -ǥեȤǤϡѥϾĹ⡼ɤǤϼ¹Ԥޤ -.SS "Сɽ" +デフォルトでは、コンパイラは冗長モードでは実行されません。 +.SS "バージョン情報の表示" .PP -IDL\-to\-JavaѥΥӥɡСɽˤϡޥɥ饤\fIidlj \-version\fR\fI\-version\fRץꤷޤ +IDL\-to\-Javaコンパイラのビルド・バージョンを表示するには、コマンドライン\fIidlj \-version\fRで\fI\-version\fRオプションを指定します。 .PP -Сϡѥˤä줿Хǥˤ񤭹ޤƤޤΥץ򥳥ޥɥ饤˻ꤹȡʳΥץꤷƤ⡢٤̵뤵ޤ -.SH "ץ" +バージョン情報は、コンパイラによって生成されたバインディング内にも書き込まれています。このオプションをコマンドラインに指定すると、それ以外のオプションを指定しても、すべて無視されます。 +.SH "オプション" .PP \-d \fIsymbol\fR .RS 4 -ΥץϡIDLե˼Τ褦ʹԤɲäǤ +このオプションは、IDLファイルに次のような行を追加した場合と等価です。 .sp .if n \{\ .RS 4 @@ -444,46 +444,46 @@ IDL\-to\-Java .PP \-demitAll .RS 4 -\fI#include\fRեƤΤޤơ٤ƤηȯԤޤ +\fI#include\fRファイル内で定義されているものも含めて、すべての型を発行します。 .RE .PP \-fside .RS 4 -ȯԤХǥ󥰤ޤ\fIside\fRѥ᡼ˤϡ\fIclient\fR\fIserver\fR\fIserverTIE\fR\fIall\fRޤ\fIallTIE\fRǤޤ\fI\-fserverTIE\fRޤ\fI\-fallTIE\fRץꤹȡѾǥ롦ȥȯԤޤե饰ꤷʤ硢\fI\-fclient\fR˥ǥեꤵޤ +発行するバインディングを定義します。\fIside\fRパラメータには、\fIclient\fR、\fIserver\fR、\fIserverTIE\fR、\fIall\fRまたは\fIallTIE\fRを指定できます。\fI\-fserverTIE\fRまたは\fI\-fallTIE\fRオプションを指定すると、委譲モデル・スケルトンが発行されます。フラグを指定しない場合、\fI\-fclient\fRにデフォルト設定されます。 .RE .PP \-i \fIinclude\-path\fR .RS 4 -ǥեȤǤϡ󥯥롼ɡեϸߤΥǥ쥯ȥ꤫鸡ޤΥץꤹȡ¾Υǥ쥯ȥɲäǤޤ +デフォルトでは、インクルード・ファイルは現在のディレクトリから検索されます。このオプションを指定すると、他のディレクトリを追加できます。 .RE .PP \-i \fIkeep\fR .RS 4 -ե뤬Ǥ¸ߤƤϡΥե뤬񤭤ޤ󡣥ǥեȤǤϡ񤭤ޤ +生成されるファイルがすでに存在している場合は、そのファイルが上書きされません。デフォルトでは、上書きされます。 .RE .PP \-noWarn .RS 4 -ٹåɽʤ褦ˤޤ +警告メッセージを表示しないようにします。 .RE .PP \-oldImplBase .RS 4 -1\&.4JDK ORBȸߴΤ륹ȥޤǥեȤǤϡPOAѾǥΥС¦Хǥ󥰤ޤΥץꤹȡ\fIImplBase\fRѾǥΥ饹Ǥ륵С¦Хǥ󥰤ΤǡΥ꡼Javaץߥ󥰸Ȥβ̸ߴޤ +1\&.4より前のJDK ORBと互換性のあるスケルトンを生成します。デフォルトでは、POA継承モデルのサーバー側バインディングが生成されます。このオプションを指定すると、\fIImplBase\fR継承モデルのクラスであるサーバー側バインディングが生成されるので、以前のリリースのJavaプログラミング言語との下位互換性が得られます。 .RE .PP \-pkgPrefix \fItype\fR \fIprefix\fR .RS 4 -\fItype\fRե롦פǸФ줿ϡηФ뤹٤ƤΥեˤĤơJavaѥå̾\fIprefix\fRȤƬղäޤtypeϡȥåץ٥롦⥸塼ñ̾ɤΥ⥸塼⳰¦줿IDLñ̾Τɤ餫Ǥ +\fItype\fRがファイル・スコープで検出された場合は、その型に対して生成されるすべてのファイルについて、生成されるJavaパッケージ名に\fIprefix\fRという接頭辞が付加されます。typeは、トップレベル・モジュールの単純名か、どのモジュールよりも外側で定義されたIDL型の単純名のどちらかです。 .RE .PP \-pkgTranslate \fItype\fR \fIpackage\fR .RS 4 -̻Ҥ˥⥸塼̾typeФȡJavaѥåΤ٤ƤΥեˤĤơ̻ҤΤ̾package֤ޤǽ\fIpkgPrefix\fRѹԤޤtypeͤϡȥåץ٥Υ⥸塼ñ̾ޤϤ٤ƤΥ⥸塼γ줿IDLñ̾ǡʥѥå̾Τ˰פɬפޤ +識別子の中にモジュール名typeが検出されると、生成されるJavaパッケージ内のすべてのファイルについて、識別子の中のその名前がpackageで置き換えられます。最初に\fIpkgPrefix\fRの変更が行われます。typeの値は、トップレベルのモジュールの単純名、またはすべてのモジュールの外部で定義されたIDL型の単純名で、完全なパッケージ名に正確に一致する必要があります。 .sp -ʣѴ̻Ҥ˰פ硢˼褦ˡǤĹפ򤵤ޤ +複数の変換が識別子に一致する場合、次の例に示すように、最も長い一致が選択されます。 .sp -\fBޥ\fR: +\fBコマンド\fR: .sp .if n \{\ .RS 4 @@ -494,7 +494,7 @@ pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz .if n \{\ .RE .\} -\fB̤Ѵ\fR: +\fB結果の変換\fR: .sp .if n \{\ .RS 4 @@ -508,47 +508,47 @@ type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg .if n \{\ .RE .\} -ѥå̾\fIorg\fR\fIorg\fR\&.o\fImg\fRޤ\fIorg\&.omg\fRΥ֥ѥåϡѴǤޤ󡣤Υѥå̾Ѵ褦ȤȡߴΤʤɤ졢\fI\-pkgTranslate\fRθκǽΰȤƤΥѥåѤȡ顼Ȥưޤ +パッケージ名\fIorg\fR、\fIorg\fR\&.o\fImg\fR、または\fIorg\&.omg\fRのサブパッケージは、変換できません。これらのパッケージ名を変換しようとすると、互換性のないコードが生成され、\fI\-pkgTranslate\fRの後の最初の引数としてそれらのパッケージを使用すると、エラーとして扱われます。 .RE .PP \-skeletonName \fIxxx%yyy\fR .RS 4 -\fIxxx%yyy\fRȥ̾դѥȤƻѤޤǥեȤϼΤȤǤ\fIPOA\fR١饹ξ\fI%POA\fR -(\fI\-fserver\fRޤ\fI\-fall\fR)\fIoldImplBase\fR饹ξ\fI_%ImplBase\fR -(\-\fIoldImplBase\fR)(\fI\-fserver\fRޤ\fI\-fall\fR)) +\fIxxx%yyy\fRが、スケルトンに名前を付けるパターンとして使用されます。デフォルトは次のとおりです。\fIPOA\fRベース・クラスの場合は\fI%POA\fR +(\fI\-fserver\fRまたは\fI\-fall\fR)、\fIoldImplBase\fRクラスの場合は\fI_%ImplBase\fR +(\-\fIoldImplBase\fR)および(\fI\-fserver\fRまたは\fI\-fall\fR))。 .RE .PP \-td \fIdir\fR .RS 4 -ϥǥ쥯ȥȤơߤΥǥ쥯ȥǤϤʤ\fIdir\fRѤޤ +出力ディレクトリとして、現在のディレクトリではなく、\fIdir\fRが使用されます。 .RE .PP \-tieName \fIxxx%yyy\fR .RS 4 -ѥ˽äơ\fIxxx%yyy\fRѤޤǥեȤϼΤȤǤ\fIPOA\fR١饹ξ\fI%POA\fR -(\fI\-fserverTieޤ\-fallTie\fR)\fIoldImplBase\fR -tie饹ξ\fI_%Tie\fR -(\-\fIoldImplBase\fR)(\fI\-fserverTie\fRޤ\fI\-fallTie\fR)) +パターンに従って、\fIxxx%yyy\fRを使用します。デフォルトは次のとおりです。\fIPOA\fRベース・クラスの場合は\fI%POA\fR +(\fI\-fserverTieまたは\-fallTie\fR)、\fIoldImplBase\fR +tieクラスの場合は\fI_%Tie\fR +(\-\fIoldImplBase\fR)および(\fI\-fserverTie\fRまたは\fI\-fallTie\fR))。 .RE .PP -\-nowarn\-verbose +\-nowarn、\-verbose .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE .PP \-version .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE -.SH "»" +.SH "制限事項" .PP -Х롦Υפ줿̻ҤϡIDLץߥƥַ\fIObject\fRޤ\fIValueBase\fRƱ֤ˤʤǤϡܥɽμ̻ҤǥץɤƤ뤿ǤκĤȡ񤭤ޤϡ餯ŪǤ +グローバル・スコープ内のエスケープされた識別子は、IDLプリミティブ型の\fIObject\fRまたは\fIValueBase\fRと同じ綴りにしないでください。これは、シンボル表がこれらの識別子でプリロードされているためです。これらの再定義を許可すると、元の定義が上書きされます。これは、おそらく恒久的な制約です。 .PP -\fIfixed\fRȤIDLϥݡȤƤޤ -.SH "Τ" +\fIfixed\fRというIDL型はサポートされていません。 +.SH "既知の問題" .PP -Х뼱̻ҤˤĤƥݡȤޤͽʤ\fIimpl\fR֥ȤƤӽФȡ㳰ޤθϡ\fIServerDelegate\fR -DSI\fINullPointerException\fRˤ褦Ǥ +グローバル識別子についてインポートが生成されません。予期されないローカル\fIimpl\fRオブジェクトを呼び出すと、例外を受け取ります。しかし、その原因は、\fIServerDelegate\fR +DSIコード内の\fINullPointerException\fRにあるようです。 .br 'pl 8.5i 'bp diff --git a/jdk/src/linux/doc/man/ja/jar.1 b/jdk/src/linux/doc/man/ja/jar.1 index dc1fc5869f7..d04f76e1c3b 100644 --- a/jdk/src/linux/doc/man/ja/jar.1 +++ b/jdk/src/linux/doc/man/ja/jar.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jar .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jar" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jar" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,9 +49,9 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jar \- Java Archive (JAR)եޤ -.SH "" -JARեκ +jar \- Java Archive (JAR)ファイルを操作します。 +.SH "概要" +JARファイルの作成 .sp .if n \{\ .RS 4 @@ -62,7 +62,7 @@ JAR .if n \{\ .RE .\} -JARեι +JARファイルの更新 .sp .if n \{\ .RS 4 @@ -73,7 +73,7 @@ JAR .if n \{\ .RE .\} -JARե +JARファイルの抽出 .sp .if n \{\ .RS 4 @@ -84,7 +84,7 @@ JAR .if n \{\ .RE .\} -JARեΥƥĤΥꥹ +JARファイルのコンテンツのリスト .sp .if n \{\ .RS 4 @@ -95,7 +95,7 @@ JAR .if n \{\ .RE .\} -JARեؤκɲ +JARファイルへの索引の追加 .sp .if n \{\ .RS 4 @@ -106,48 +106,48 @@ JAR .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIjar\fRޥɤϡZIPZLIB̷˴ŤѤΥ֤Ӱ̥ġǤ\fIjar\fRޥɤϡˤĤJavaץåȤ䥢ץꥱñΥ֤˥ѥå褦߷פޤץåȤ䥢ץꥱΥݡͥ(ե롢᡼ӥ)1ĤΥ֤˷礵ƤȡJava(֥饦ʤ)ϡΥݡͥȤ1HTTPȥ󥶥ǥɤ뤳ȤǤݡͥȤȤ˿³פˤʤޤˤꡢɻ֤ṳ̂ޤޤ\fIjar\fRޥɤϥեΰ̤Ԥᡢɻ֤ṳ̂ޤޤ\fIjar\fRޥɤˤäơեθġΥȥ˥ץåȺԤˤ̾񤭹뤿ᡢ۸ǧڤǽˤʤޤJARեϡ̤Ƥ뤫ɤˤ餺饹ѥΥȥȤƻѤǤޤ +\fIjar\fRコマンドは、ZIPおよびZLIB圧縮形式に基づく汎用のアーカイブおよび圧縮ツールです。ただし、\fIjar\fRコマンドは、主にいくつかのJavaアプレットやアプリケーションを単一のアーカイブにパッケージ化するように設計されました。アプレットやアプリケーションのコンポーネント(ファイル、イメージ、およびサウンド)が1つのアーカイブに結合されていると、Javaエージェント(ブラウザなど)は、それらのコンポーネントを1回のHTTPトランザクションでダウンロードすることができ、コンポーネントごとに新しい接続が不要になります。これにより、ダウンロード時間が大幅に短縮されます。また、\fIjar\fRコマンドはファイルの圧縮も行うため、ダウンロード時間がさらに短縮されます。また、\fIjar\fRコマンドによって、ファイル内の個々のエントリにアプレット作成者による署名を書き込めるため、配布元の認証が可能になります。JARファイルは、圧縮されているかどうかにかかわらず、クラス・パスのエントリとして使用できます。 .PP -\fIjar\fRޥɤιʸϡ\fItar\fRޥɤιʸ˻Ƥޤɬܤ\fIΰ\fR1Ĥ줿ʣ⡼ɤޤ¾ΰϡưѹ\fIץ\fRޤ¹Ԥ뤿ɬפ\fIڥ\fRѤޤ -.SH "ΰ" +\fIjar\fRコマンドの構文は、\fItar\fRコマンドの構文に似ています。必須の\fI操作の引数\fRの1つで定義された複数の操作モードがあります。他の引数は、操作の動作を変更する\fIオプション\fR、または操作を実行するために必要な\fIオペランド\fRを使用します。 +.SH "操作の引数" .PP -\fIjar\fRޥɤѤϡΰΤ줫ꤷƼ¹Ԥ򤹤ɬפޤޥɥ饤¾1ʸΥץȺߤ뤳ȤǤޤ̾ΰϻꤵǽΰǤ +\fIjar\fRコマンドを使用する場合は、次の操作の引数のいずれかを指定して実行される操作を選択する必要があります。コマンドラインで他の1文字のオプションと混在させることができますが、通常、操作の引数は指定される最初の引数です。 .PP c .RS 4 -JAR֤ޤ +新しいJARアーカイブを作成します。 .RE .PP i .RS 4 -JAR֤κޤ +JARアーカイブの索引情報を生成します。 .RE .PP t .RS 4 -JAR֤ΥƥĤꥹȤޤ +JARアーカイブのコンテンツをリストします。 .RE .PP u .RS 4 -JAR֤򹹿ޤ +JARアーカイブを更新します。 .RE .PP x .RS 4 -JAR֤եФޤ +JARアーカイブからファイルを抽出します。 .RE -.SH "ץ" +.SH "オプション" .PP -ΥץѤơJARեФޤɽˡ򥫥ޥޤ +次のオプションを使用して、JARファイルを作成、更新、抽出または表示する方法をカスタマイズします。 .PP e .RS 4 -\fIentrypoint\fRڥɤǻꤵ륯饹򡢼¹ԲǽJARե˥Хɥ뤵륹ɥJavaץꥱΥȥꡦݥȤꤷޤΥץѤȡޥ˥եȡե\fIMain\-Class\fR°ͤޤϥС饤ɤޤ\fIe\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +\fIentrypoint\fRオペランドで指定されるクラスを、実行可能JARファイルにバンドルされるスタンドアロンJavaアプリケーションのエントリ・ポイントに設定します。このオプションを使用すると、マニフェスト・ファイル内の\fIMain\-Class\fR属性値が作成またはオーバーライドされます。\fIe\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .sp -ȤСΥޥɤǤϡ\fIMain\&.jar\fR֤\fIMain\&.class\fRեȤȤ˺ޤκݡޥ˥ե\fIMain\-Class\fR°ͤ\fIMain\fRꤵޤ +たとえば、次のコマンドでは、\fIMain\&.jar\fRアーカイブが\fIMain\&.class\fRファイルとともに作成されますが、その際、マニフェスト内の\fIMain\-Class\fR属性値は\fIMain\fRに設定されます。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ jar cfe Main\&.jar Main Main\&.class .if n \{\ .RE .\} -Java Runtime Environment (JRE)ϡΥޥɤ¹ԤơΥץꥱľܸƤӽФȤǤޤ +Java Runtime Environment (JRE)は、次のコマンドを実行して、このアプリケーションを直接呼び出すことができます。 .sp .if n \{\ .RS 4 @@ -169,7 +169,7 @@ java \-jar Main\&.jar .if n \{\ .RE .\} -ѥå˥ȥꡦݥȤΥ饹̾ޤޤƤ硢ɥå(\&.)ޤϥå(/)Τ줫ڤʸȤƻѤǤޤȤС\fIMain\&.class\fR\fImydir\fRȤ̾Υѥå˴ޤޤƤ硢ȥꡦݥȤϼΤ줫ˡǻǤޤ +あるパッケージ内にエントリ・ポイントのクラス名が含まれている場合、ドット(\&.)またはスラッシュ(/)のいずれかを区切り文字として使用できます。たとえば、\fIMain\&.class\fRが\fImydir\fRという名前のパッケージに含まれている場合、エントリ・ポイントは次のいずれかの方法で指定できます。 .sp .if n \{\ .RS 4 @@ -197,8 +197,8 @@ jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class allbox tab(:); l. T{ - -Υޥ˥եȤˤ\fIMain\-Class\fR°ޤޤƤ\fIm\fRץ\fIe\fRץξƱ˻ꤹȡ\fIMain\-Class\fRλ꤬ޤˤʤޤΤޤˤäƥ顼ȯ\fIjar\fRޥɤκ乹λޤ +注意 +特定のマニフェストにも\fIMain\-Class\fR属性が含まれている場合に\fIm\fRオプションと\fIe\fRオプションの両方を同時に指定すると、\fIMain\-Class\fRの指定があいまいになります。このあいまいさによってエラーが発生し、\fIjar\fRコマンドの作成や更新の操作が終了します。 T} .TE .sp 1 @@ -208,42 +208,42 @@ T} .PP f .RS 4 -\fIjarfile\fRڥɤǻꤵ줿ե򡢺(\fIc\fR)(\fIu\fR)(\fIx\fR)ޤɽ(\fIt\fR)JARե̾ꤷޤ\fIf\fRץ󤪤\fIjarfile\fRڥɤάȡ\fIjar\fRޥɤˡ\fIstdin\fRJARե̾뤫(\fIx\fR\fIt\fRξ)JARե\fIstdout\fR뤳(\fIc\fR\fIu\fRξ)ؼޤ +\fIjarfile\fRオペランドで指定されたファイルを、作成(\fIc\fR)、更新(\fIu\fR)、抽出(\fIx\fR)または表示(\fIt\fR)されるJARファイルの名前に設定します。\fIf\fRオプションおよび\fIjarfile\fRオペランドを省略すると、\fIjar\fRコマンドに、\fIstdin\fRからのJARファイル名を受け入れるか(\fIx\fRおよび\fIt\fRの場合)、JARファイルを\fIstdout\fRに送信すること(\fIc\fRおよび\fIu\fRの場合)が指示されます。 .RE .PP m .RS 4 -(\fIMETA\-INF/MANIFEST\&.MF\fRΥ֤ˤ) -\fIjar\fRޥɤΥޥ˥եȡե\fImanifest\fRڥɤǻꤵ줿ե뤫顢°̾ͤΥڥޤޤ\fIjar\fRޥɤϡƱ̾Υȥ꤬Ǥ¸ߤ°̾ͤJARեɲäޤƱ̾Υȥ꤬Ǥ¸ߤ硢\fIjar\fRޥɤ°ͤ򹹿ޤ\fIm\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +(\fIMETA\-INF/MANIFEST\&.MF\fRのアーカイブにある) +\fIjar\fRコマンドのマニフェスト・ファイルの\fImanifest\fRオペランドで指定されたファイルから、属性の名前と値のペアを含めます。\fIjar\fRコマンドは、同じ名前のエントリがすでに存在する場合を除き、属性の名前と値をJARファイルに追加します。同じ名前のエントリがすでに存在する場合、\fIjar\fRコマンドは属性の値を更新します。\fIm\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .sp -ǥեȤΥޥ˥եȡեˤϴޤޤʤޥ˥եȤˡ̤Ū̾\-ͤ°ڥɲäǤޤȤС٥󡢥꡼󡢥ѥå󥰤ꤹ°ޤJAR˥Хɥ뤵줿ץꥱ¹Բǽˤ뤿°ɲäǤޤ\fIm\fRץλϡhttp://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -ץΥѥå˴ؤ򻲾ȤƤ +デフォルトのマニフェスト・ファイルには含まれないマニフェストに、特別な目的の名前\-値の属性ペアを追加できます。たとえば、ベンダー情報、リリース情報、パッケージ・シーリングを指定する属性、またはJARにバンドルされたアプリケーションを実行可能にするための属性を追加できます。\fIm\fRオプションの使用例は、http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +プログラムのパッケージ化に関する項を参照してください。 .RE .PP M .RS 4 -ޥ˥եȡե롦ȥʤ(\fIc\fR\fIu\fRξ)ޤϥޥ˥եȡե롦ȥ꤬¸ߤϺޤ(\fIu\fRξ)\fIM\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +マニフェスト・ファイル・エントリを作成しない(\fIc\fRおよび\fIu\fRの場合)か、またはマニフェスト・ファイル・エントリが存在する場合は削除します(\fIu\fRの場合)。\fIM\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .RE .PP n .RS 4 -JARեκ(\fIc\fR)ˡΥץϡƥĤpack200(1)ޥɤΥѥåӥѥåαƶʤ褦˥֤ޤѤʤ硢̾դJARν̵̾ˤʤޤ +JARファイルの作成(\fIc\fR)時に、このオプションは、コンテンツがpack200(1)コマンドのパックおよびアンパック操作の影響を受けないようにアーカイブを正規化します。この正規化を使用しない場合、署名付きJARの署名は無効になります。 .RE .PP v .RS 4 -ܺ٤ʽϤɸϤޤ򻲾ȤƤ +詳細な出力を標準出力に生成します。例を参照してください。 .RE .PP 0 .RS 4 -() ZIP̤ѤʤJARե(\fIc\fR)ޤϹ(\fIu\fR)ޤ +(ゼロ) ZIP圧縮を使用しないでJARファイルを作成(\fIc\fR)または更新(\fIu\fR)します。 .RE .PP \-C \fIdir\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡΥץ\fIfile\fRڥɤǻꤵ줿եν˥ǥ쥯ȥŪѹޤϡUNIX -\fItar\fR桼ƥƥ\fI\-C\fRץƱͤˤʤ뤳ȤŪȤƤޤȤСΥޥɤˤäơ\fIclasses\fRǥ쥯ȥѹ졢Υǥ쥯ȥ꤫\fImy\&.jar\fR\fIBar\&.class\fRե뤬ɲäޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、このオプションは\fIfile\fRオペランドで指定されたファイルの処理中にディレクトリを一時的に変更します。この操作は、UNIX +\fItar\fRユーティリティの\fI\-C\fRオプションと同様になることを目的としています。たとえば、次のコマンドによって、\fIclasses\fRディレクトリに変更され、そのディレクトリから\fImy\&.jar\fRに\fIBar\&.class\fRファイルが追加されます。 .sp .if n \{\ .RS 4 @@ -254,7 +254,7 @@ jar uf my\&.jar \-C classes Bar\&.class .if n \{\ .RE .\} -ΥޥɤǤϡ\fIclasses\fRǥ쥯ȥ˰ưclassesǥ쥯ȥΤ٤ƤΥե\fImy\&.jar\fRɲäޤ(JARեˤ\fIclasses\fRǥ쥯ȥޤ)˸Υǥ쥯ȥäƤ顢\fIbin\fRǥ쥯ȥ˰ư\fIXyz\&.class\fR\fImy\&.jar\fRɲäޤ +次のコマンドでは、\fIclasses\fRディレクトリに移動し、classesディレクトリ内のすべてのファイルを\fImy\&.jar\fRに追加します(JARファイルには\fIclasses\fRディレクトリを作成しません)。次に元のディレクトリに戻ってから、\fIbin\fRディレクトリに移動し、\fIXyz\&.class\fRを\fImy\&.jar\fRに追加します。 .sp .if n \{\ .RS 4 @@ -265,7 +265,7 @@ jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class .if n \{\ .RE .\} -\fIclasses\fR\fIbar1\fRե\fIbar2\fRե뤬ޤޤƤ硢ҤΥޥɤ¹Ԥ塢JARեˤϼΤΤޤޤޤ +\fIclasses\fRに\fIbar1\fRファイルと\fIbar2\fRファイルが含まれている場合、前述のコマンドを実行した後、JARファイルには次のものが含まれます。 .sp .if n \{\ .RS 4 @@ -285,41 +285,41 @@ Xyz\&.class .PP \-J\fIoption\fR .RS 4 -ꤷJVMץJREJARե¹Ԥݤ˻Ѥ褦ꤷޤJVMץϡjava(1)ޥɤΥե󥹡ڡƤޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤ +指定したJVMオプションを、JREがJARファイルを実行する際に使用するように設定します。JVMオプションは、java(1)コマンドのリファレンス・ページで説明されています。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。 .RE -.SH "ڥ" +.SH "オペランド" .PP -Υڥɤϡ\fIjar\fRޥɤǧޤ +次のオペランドは、\fIjar\fRコマンドで認識されます。 .PP \fIfile\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fIfile\fRڥɤϡ֤ɲäɬפΤեޤϥǥ쥯ȥΥѥ̾ޤJARե(\fIx\fR)ޤϥƥĤΥꥹ(\fIt\fR)ˡ\fIfile\fRڥɤФޤϥꥹȤեΥѥ̾ޤʤȤ1Ĥͭʥեޤϥǥ쥯ȥꤹɬפޤʣ\fIfile\fRڥɤǶڤޤ\fIentrypoint\fR\fIjarfile\fRޤ\fImanifest\fRڥɤѤϡθ\fIfile\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fIfile\fRオペランドは、アーカイブに追加する必要のあるファイルまたはディレクトリのパスと名前を定義します。JARファイルの抽出(\fIx\fR)またはコンテンツのリスト(\fIt\fR)時に、\fIfile\fRオペランドは抽出またはリストするファイルのパスと名前を定義します。少なくとも1つの有効なファイルまたはディレクトリを指定する必要があります。複数の\fIfile\fRオペランドを空白で区切ります。\fIentrypoint\fR、\fIjarfile\fRまたは\fImanifest\fRオペランドが使用される場合は、その後に\fIfile\fRオペランドを指定する必要があります。 .RE .PP \fIentrypoint\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fIentrypoint\fRڥɤϡ¹ԲǽJARե˥Хɥ뤵Ƥ륹ɥJavaץꥱΥȥꡦݥȤȤʤ륯饹̾ޤ\fIe\fRץ¸ߤ\fIentrypoint\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fIentrypoint\fRオペランドは、実行可能JARファイルにバンドルされているスタンドアロンJavaアプリケーションのエントリ・ポイントとなるクラスの名前を定義します。\fIe\fRオプションが存在する場合は\fIentrypoint\fRオペランドを指定する必要があります。 .RE .PP \fIjarfile\fR .RS 4 -(\fIc\fR)(\fIu\fR)(\fIx\fR)ޤɽ(\fIt\fR)ե̾ޤ\fIf\fRץ¸ߤ\fIjarfile\fRڥɤꤹɬפޤ\fIf\fRץ󤪤\fIjarfile\fRڥɤάȡ\fIjar\fRޥɤˡ\fIstdin\fRJARե̾뤫(\fIx\fR\fIt\fRξ)JARե\fIstdout\fR뤳(\fIc\fR\fIu\fRξ)ؼޤ +作成(\fIc\fR)、更新(\fIu\fR)、抽出(\fIx\fR)または表示(\fIt\fR)するファイルの名前を定義します。\fIf\fRオプションが存在する場合は\fIjarfile\fRオペランドを指定する必要があります。\fIf\fRオプションおよび\fIjarfile\fRオペランドを省略すると、\fIjar\fRコマンドに、\fIstdin\fRからのJARファイル名を受け入れるか(\fIx\fRおよび\fIt\fRの場合)、JARファイルを\fIstdout\fRに送信すること(\fIc\fRおよび\fIu\fRの場合)が指示されます。 .sp -JARեդ(\fIi\fR)ϡ\fIf\fRץꤷʤ\fIjarfile\fRڥɤꤷޤ +JARファイルを索引付け(\fIi\fR)する場合は、\fIf\fRオプションを指定しないで\fIjarfile\fRオペランドを指定します。 .RE .PP \fImanifest\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fImanifest\fRڥɤJARե\fIMANIFEST\&.MF\fR˴ޤ°̾ͤĴ¸Υޥ˥եȡեޤ\fIf\fRץ¸ߤ\fImanifest\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fImanifest\fRオペランドはJARファイルの\fIMANIFEST\&.MF\fRに含める属性の名前と値を持つ既存のマニフェスト・ファイルを定義します。\fIf\fRオプションが存在する場合は\fImanifest\fRオペランドを指定する必要があります。 .RE .PP \fI@arg\-file\fR .RS 4 -\fIjar\fRޥɤṳ̂ޤϴDzˤϡ̤ΥƥȡեΰꤷƬȤƥåȥޡ(@)դ\fIjar\fRޥɤϤȤǤޤ\fIjar\fRޥɤϡåȥޡʸǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjar\fRコマンドを短縮または簡素化するには、別のテキスト・ファイル内の引数を指定し、接頭辞としてアットマーク(@)を付けて\fIjar\fRコマンドに渡すことができます。\fIjar\fRコマンドは、アットマーク文字で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .sp -եˤϡ\fIjar\fRޥɤΥץȰ(ե򥵥ݡȤʤưġϤ\fI\-J\fRץ)ޤ뤳ȤǤޤեΰϡޤϲʸǶڤ뤳ȤǤޤեΥե̾ϡ\fIjar\fRޥɤ¹ԤǤ븽ߤΥǥ쥯ȥФŪǤꡢեξФƤŪǤϤޤ̾ϥڥ졼ƥ󥰡ƥࡦˤäŸ륢ꥹ(*)ʤɤΥ磻ɥɤŸޤ +引数ファイルには、\fIjar\fRコマンドのオプションと引数(引数ファイルをサポートしない起動ツールに渡される\fI\-J\fRオプションを除く)を含めることができます。ファイル内の引数は、空白または改行文字で区切ることができます。引数ファイル内のファイル名は、\fIjar\fRコマンドを実行できる現在のディレクトリに対して相対的であり、引数ファイルの場所に対しては相対的ではありません。通常はオペレーティング・システム・シェルによって展開されるアスタリスク(*)などのワイルドカードは展開されません。 .sp -ϡ\fIfind\fRޥɤˤ븽ߤΥǥ쥯ȥϤΥե̾\fIclasses\&.list\fRեˡ򼨤ޤ +次の例は、\fIfind\fRコマンドによる現在のディレクトリ出力からのファイル名で\fIclasses\&.list\fRファイルを作成する方法を示します。 .sp .if n \{\ .RS 4 @@ -330,7 +330,7 @@ find \&. \-name \*(Aq*\&.class\*(Aq \-print > classes\&.list .if n \{\ .RE .\} -\fIjar\fRޥɤ¹Ԥ\fI@arg\-file\fRʸѤ\fIclasses\&.list\fRեϤȤǤޤ +\fIjar\fRコマンドを実行し、\fI@arg\-file\fR構文を使用して\fIclasses\&.list\fRファイルを渡すことができます。 .sp .if n \{\ .RS 4 @@ -341,7 +341,7 @@ jar cf my\&.jar @classes\&.list .if n \{\ .RE .\} -եϥѥǤޤХѥҤ줿եΤ٤ƤΥե̾ϡϤ줿ѥФŪǤϤʤ\fIjar\fRޥɤθߤκȥǥ쥯ȥŪȤʤޤȤСΤ褦ˤʤޤ +引数ファイルはパスを指定できますが、相対パスが記述された引数ファイル内のすべてのファイル名は、渡されたパスに対して相対的ではなく、\fIjar\fRコマンドの現在の作業ディレクトリに相対的となります。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -353,9 +353,9 @@ jar @dir/classes\&.list .RE .\} .RE -.SH "" +.SH "注意" .PP -\fIe\fR\fIf\fR\fIm\fRץϡ\fIentrypoint\fR\fIjarfile\fR\fImanifest\fRڥɤƱǥޥɥ饤˽иɬפޤ +\fIe\fR、\fIf\fRおよび\fIm\fRオプションは、\fIentrypoint\fR、\fIjarfile\fRおよび\fImanifest\fRオペランドと同じ順序でコマンドラインに出現する必要があります。 .sp .if n \{\ .RS 4 @@ -366,9 +366,9 @@ jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class .if n \{\ .RE .\} -.SH "" +.SH "例" .PP -\fBExample 1\fR, ĹʽϤˤ븽ߤΥǥ쥯ȥ꤫Τ٤ƤΥեɲ +\fBExample 1\fR, 冗長な出力による現在のディレクトリからのすべてのファイルの追加 .RS 4 .sp .if n \{\ @@ -396,7 +396,7 @@ adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%) .\} .RE .PP -\fBExample 2\fR, ֥ǥ쥯ȥ꤫Υեɲ +\fBExample 2\fR, サブディレクトリからのファイルの追加 .RS 4 .sp .if n \{\ @@ -427,7 +427,7 @@ audio/ bundle\&.jar classes/ images/ .\} .RE .PP -\fBExample 3\fR, JARΥƥĤΥꥹ +\fBExample 3\fR, JARのコンテンツのリスト .RS 4 .sp .if n \{\ @@ -460,9 +460,9 @@ images/at_work\&.gif .\} .RE .PP -\fBExample 4\fR, ɲ +\fBExample 4\fR, 索引の追加 .RS 4 -Υץꥱ߰¸饹\fImain\&.jar\fR\fIbuy\&.jar\fR\fIsell\&.jar\fR3ĤJARեʬ䤹硢\fIi\fRץѤޤ\fImain\&.jar\fRޥ˥ե\fIClass\-Path\fR°ꤹ硢\fIi\fRץѤơץꥱΥ饹ɤ®٤Ǥޤ +株式取引のアプリケーションの相互依存クラスを、\fImain\&.jar\fR、\fIbuy\&.jar\fRおよび\fIsell\&.jar\fRの3つのJARファイルに分割する場合、\fIi\fRオプションを使用します。\fImain\&.jar\fRマニフェスト内の\fIClass\-Path\fR属性を指定する場合、\fIi\fRオプションを使用して、アプリケーションのクラス・ロードの速度を向上できます。 .sp .if n \{\ .RS 4 @@ -474,9 +474,9 @@ jar i main\&.jar .if n \{\ .RE .\} -\fIINDEX\&.LIST\fRե뤬\fIMETA\-INF\fRǥ쥯ȥޤˤꡢץꥱΥ饹ˤäƥ饹ޤϥ꥽θԤȤˡꤷJARե뤬ɤ褦ˤʤޤ +\fIINDEX\&.LIST\fRファイルが\fIMETA\-INF\fRディレクトリに挿入されます。これにより、アプリケーションのクラス・ローダーによってクラスまたはリソースの検索が行われるときに、指定したJARファイルがダウンロードされるようになります。 .sp -ץꥱΥ饹ϡΥե˳ǼƤѤơΨŪ˥饹ɤޤǥ쥯ȥ򥳥ԡˤϡǽ\fIdir1\fRΥե\fIstdout\fR˰̤Ƥ顢\fIstdin\fR\fIdir2\fR˥ѥץ饤Фޤ(\fI\-f\fRץξ\fIjar\fRޥɤǾάޤ) +アプリケーションのクラス・ローダーは、このファイルに格納されている情報を使用して、効率的にクラスをロードします。ディレクトリをコピーするには、最初に\fIdir1\fR内のファイルを\fIstdout\fRに圧縮してから、\fIstdin\fRから\fIdir2\fRにパイプラインを作成して抽出します(\fI\-f\fRオプションは両方の\fIjar\fRコマンドで省略します)。 .sp .if n \{\ .RS 4 @@ -488,7 +488,7 @@ jar i main\&.jar .RE .\} .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -509,8 +509,8 @@ pack200(1)\&. .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -Java塼ȥꥢJAR˴ؤ +http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +JavaチュートリアルのJARに関する項 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/jarsigner.1 b/jdk/src/linux/doc/man/ja/jarsigner.1 index fa0799a8c60..4642c958add 100644 --- a/jdk/src/linux/doc/man/ja/jarsigner.1 +++ b/jdk/src/linux/doc/man/ja/jarsigner.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jarsigner .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ƥġ +.\" Date: 2013年11月21日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jarsigner" "1" "2013ǯ1121" "JDK 8" "ƥġ" +.TH "jarsigner" "1" "2013年11月21日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jarsigner \- Java(JAR)եФƽ̾ӸڤԤޤ -.SH "" +jarsigner \- Javaアーカイブ(JAR)ファイルに対して署名および検証を行います。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,30 +74,30 @@ jarsigner \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \-verify .RS 4 -\fI\-verify\fRץǤϡJARե̾θ0İʾΥȥ̾Ǥޤ\fI\-verify\fRץ󤬻ꤵ줿硢\fIjarsigner\fRޥɤǤϡJARեγƽ̾դƥƥθڤ˻Ѥ񤬡줫Υȥ̾˰פ뤳Ȥåޤ̾ϡ\fI\-keystore\fRǻꤵ줿ȥޤϥǥեȤΥȥޤ +\fI\-verify\fRオプションでは、JARファイル名の後に0個以上のキーストア別名を指定できます。\fI\-verify\fRオプションが指定された場合、\fIjarsigner\fRコマンドでは、JARファイル内の各署名付きエンティティの検証に使用される証明書が、いずれかのキーストア別名に一致することをチェックします。別名は、\fI\-keystore\fRで指定されたキーストア内またはデフォルトのキーストア内に定義されます。 .sp -\fI\-strict\fRץꤷ硢\fIjarsigner\fRޥɤˤʷٹ𤬸Фȡåjarڤޤ̾ԥ顼פɽޤ +\fI\-strict\fRオプションも指定した場合、\fIjarsigner\fRコマンドにより重大な警告が検出されると、メッセージ「jarが検証されました。署名者エラー」が表示されます。 .RE .PP \fIjar\-file\fR .RS 4 -̾JARե롣 +署名されるJARファイル。 .sp -\fI\-strict\fRץꤷ硢\fIjarsigner\fRޥɤˤʷٹ𤬸ФȡåjarϽ̾ޤ \- ̾ԥ顼ޤפȤåɽޤ +\fI\-strict\fRオプションも指定した場合、\fIjarsigner\fRコマンドにより重大な警告が検出されると、メッセージ「jarは署名されました \- 署名者エラーがあります。」というメッセージが表示されます。 .RE .PP \fIalias\fR .RS 4 -̾ϡ\fI\-keystore\fRǻꤵ줿ȥޤϥǥեȤΥȥޤ +別名は、\fI\-keystore\fRで指定されたキーストア内またはデフォルトのキーストア内に定義されます。 .RE -.SH "" +.SH "説明" .PP -\fIjarsigner\fRġˤϡ2ĤŪޤ +\fIjarsigner\fRツールには、次の2つの目的があります。 .sp .RS 4 .ie n \{\ @@ -107,7 +107,7 @@ jarsigner \- Java .sp -1 .IP \(bu 2.3 .\} -Java(JAR)ե˽̾Ū +Javaアーカイブ(JAR)ファイルに署名する目的。 .RE .sp .RS 4 @@ -118,12 +118,12 @@ Java .sp -1 .IP \(bu 2.3 .\} -̾դJARեν̾򸡾ڤŪ +署名付きJARファイルの署名と整合性を検証する目的。 .RE .PP -JARǽѤȡ饹ե롢᡼ɤӤ¾Υǥ롦ǡñΥե˥ѥåǤΤǡե®ưפۤǤޤ\fIjar\fRȤ̾ΥġѤơȯԤJARեǤޤ(ŪʴС٤ƤZIPեJARեȤߤʤȤǤޤ\fIjar\fRޥɤˤäƺ줿JARե롢ޤ\fIjarsigner\fRޥɤˤäƽ줿JARեˤϡ\fIMETA\-INF/MANIFEST\&.MF\fRեޤޤƤޤ) +JAR機能を使用すると、クラス・ファイル、イメージ、サウンドおよびその他のデジタル・データを単一のファイルにパッケージ化できるので、ファイルを迅速かつ容易に配布できます。\fIjar\fRという名前のツールを使用して、開発者はJARファイルを作成できます。(技術的な観点から言えば、すべてのZIPファイルもJARファイルとみなすことができます。ただし、\fIjar\fRコマンドによって作成されたJARファイル、または\fIjarsigner\fRコマンドによって処理されたJARファイルには、\fIMETA\-INF/MANIFEST\&.MF\fRファイルも含まれています。) .PP -ǥ̾ϡʤ餫Υǡ(̾оݤȤʤǡ)ӥƥƥ(͡Ҥʤ)̩׻ӥåȤʸǤ񤭤ν̾Ʊ͡ǥ̾ˤ¿ޤ +デジタル署名は、なんらかのデータ(署名の対象となるデータ)、およびエンティティ(人、会社など)の秘密鍵から計算されるビットの文字列です。手書きの署名同様、デジタル署名には多くの利点があります。 .sp .RS 4 .ie n \{\ @@ -133,7 +133,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̾˻Ѥ줿̩бѤ׻ˤäơ줬ʪǤ뤳Ȥ򸡾ڤǤޤ +署名の生成に使用された秘密鍵に対応する公開鍵を使用する計算によって、それが本物であることを検証できます。 .RE .sp .RS 4 @@ -144,7 +144,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̩¾ͤΤʤ¤ꡢǥ̾ε¤ԲǽǤ +秘密鍵が他人に知られない限り、デジタル署名の偽造は不可能です。 .RE .sp .RS 4 @@ -155,7 +155,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -ϡ̾դǡεǽǤꡢ¾Υǡν̾Ȥʤ褦׵Ǥޤ +これは、署名が付いたデータの機能であり、他のデータの署名となるように要求できません。 .RE .sp .RS 4 @@ -166,27 +166,27 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̾դǡѹǤޤ󡣥ǡѹ줿硢̾ˤäʪǤȸڤǤޤ +署名付きデータは変更できません。データが変更された場合、署名によって本物であると検証できません。 .RE .PP -եФƥƥƥν̾ˤϡޤƥƥϡΥƥƥ˴Ϣ/̩Υڥȡǧڤ1İʾξɬפޤȤϡ륨ƥƥΥǥ̾դʸǡ̤ΥƥƥθͤĤȤ򼨤Ƥޤ +ファイルに対してエンティティの署名を生成するには、まず、エンティティは、そのエンティティに関連する公開鍵/秘密鍵のペアと、公開鍵を認証する1つ以上の証明書を持つ必要があります。証明書とは、あるエンティティからのデジタル署名付きの文書で、別のエンティティの公開鍵が特定の値を持つことを示しています。 .PP -\fIjarsigner\fRޥɤϡȥθȾѤơJARեΥǥ̾ޤȥϡ̩бǧڤ롢̩˴ϢX\&.509Υǡ١Ǥ\fIkeytool\fRޥɤѤơȥӴޤ +\fIjarsigner\fRコマンドは、キーストアからの鍵と証明書情報を使用して、JARファイルのデジタル署名を生成します。キーストアは、秘密鍵、および対応する公開鍵を認証する、秘密鍵に関連したX\&.509証明書チェーンのデータベースです。\fIkeytool\fRコマンドを使用して、キーストアを作成および管理します。 .PP -\fIjarsigner\fRޥɤǤϡƥƥ̩Ѥƽ̾ޤ̾դJARեˤϡäˡեؤν̾˻Ѥ̩бΥȥξΥԡޤޤޤ\fIjarsigner\fRޥɤǤϡ(֥̾åե)ξѤơ̾դJARեΥǥ̾򸡾ڤǤޤ +\fIjarsigner\fRコマンドでは、エンティティの秘密鍵を使用して署名を生成します。署名付きJARファイルには、特に、ファイルへの署名に使用する秘密鍵に対応する公開鍵のキーストアからの証明書のコピーが含まれます。\fIjarsigner\fRコマンドでは、内部(署名ブロック・ファイル内)の証明書を使用して、署名付きJARファイルのデジタル署名を検証できます。 .PP -\fIjarsigner\fRޥɤǤϡ̾ͭJARե뤬̾줿줿ɤ򥷥ƥǥץ(Java Plug\-inޤ)åǤ롢ॹפޤ̾ǤޤˡAPIѤȡץꥱǥॹ׾Ǥޤ +\fIjarsigner\fRコマンドでは、署名証明書の有効期間中にJARファイルが署名されたされたかどうかをシステムやデプロイヤ(Java Plug\-inを含む)がチェックできる、タイムスタンプを含む署名を生成できます。さらに、APIを使用すると、アプリケーションでタイムスタンプ情報を取得できます。 .PP -Ǥϡ\fIjarsigner\fRޥɤǤϡ\fIjar\fRޥɤޤZIPեˤäƺ줿JARեΤߤ˽̾ǤޤJARեZIPեƱǤJARեˤ\fIMETA\-INF/MANIFEST\&.MF\fRեޤޤƤۤʤޤ\fIMETA\-INF/MANIFEST\&.MF\fRեϡ\fIjarsigner\fRޥɤˤäZIPե˽̾ݤ˺ޤ +現時点では、\fIjarsigner\fRコマンドでは、\fIjar\fRコマンドまたはZIPファイルによって作成されたJARファイルのみに署名できます。JARファイルはZIPファイルと同じですが、JARファイルには\fIMETA\-INF/MANIFEST\&.MF\fRファイルも含まれている点が異なります。\fIMETA\-INF/MANIFEST\&.MF\fRファイルは、\fIjarsigner\fRコマンドによってZIPファイルに署名する際に作成されます。 .PP -ǥեȤ\fIjarsigner\fRޥɤưǤϡJARޤZIPե˽̾ޤ\fI\-verify\fRץѤơ̾դJARե򸡾ڤޤ +デフォルトの\fIjarsigner\fRコマンドの動作では、JARまたはZIPファイルに署名します。\fI\-verify\fRオプションを使用して、署名付きJARファイルを検証します。 .PP -\fIjarsigner\fRޥɤϡ̾ޤϸڤθ˽̾ԤξθڤԤޤڥ顼ޤϤ¾꤬ȯȡޥɤˤٹåޤ\fI\-strict\fRץꤷ硢ޥɤˤʷٹ𤬥顼Ȥƽޤ顼ȷٹ򻲾ȤƤ -.SS "ȥ̾" +\fIjarsigner\fRコマンドは、署名または検証の後に署名者の証明書の検証も試行します。検証エラーまたはその他の問題が発生すると、コマンドにより警告メッセージが生成されます。\fI\-strict\fRオプションを指定した場合、コマンドにより重大な警告がエラーとして処理されます。エラーと警告を参照してください。 +.SS "キーストアの別名" .PP -ȥΤ٤ƤΥƥƥϡդ̾Ѥƥޤ +キーストアのすべてのエンティティは、一意の別名を使用してアクセスされます。 .PP -\fIjarsigner\fRޥɤѤJARե˽̾Ȥϡ̾ɬפ̩ޤ७ȥȥ̾ꤹɬפޤȤСΥޥɤǤϡ\fIworking\fRǥ쥯ȥ\fImystore\fRȤ̾Υȥ˴ޤޤ̾\fIduke\fR˴Ϣդ줿̩Ѥơ\fIMyJARFile\&.jar\fRȤ̾JARե˽̾ޤϥեϻꤵƤʤᡢ\fIMyJARFile\&.jar\fRϽ̾դJARեˤäƾ񤭤ޤ +\fIjarsigner\fRコマンドを使用してJARファイルに署名するときは、署名の生成に必要な秘密鍵を含むキーストア・エントリの別名を指定する必要があります。たとえば、次のコマンドでは、\fIworking\fRディレクトリの\fImystore\fRという名前のキーストアに含まれる別名\fIduke\fRに関連付けられた秘密鍵を使用して、\fIMyJARFile\&.jar\fRという名前のJARファイルに署名します。出力ファイルは指定されていないため、\fIMyJARFile\&.jar\fRは署名付きのJARファイルによって上書きされます。 .sp .if n \{\ .RS 4 @@ -199,36 +199,36 @@ jarsigner \-keystore /working/mystore \-storepass .RE .\} .PP -ȥϥѥɤݸƤΤǡȥΥѥɤꤹɬפޤޥɥ饤ǻꤷʤȡϤޤƱͤˡ̩⥭ȥǥѥɤˤäݸƤ뤿ᡢ̩Υѥɤꤹɬפޤޥɥ饤ǥѥɤꤷƤʤ硢ޤϻꤷѥȤ¸ƤѥɤƱǤϤʤϡѥɤϤޤ -.SS "ȥξ" +キーストアはパスワードで保護されているので、ストアのパスワードを指定する必要があります。コマンドラインで指定しないと、入力を求められます。同様に、秘密鍵もキーストア内でパスワードによって保護されているため、秘密鍵のパスワードを指定する必要があります。コマンドラインでパスワードを指定していない場合、または指定したパスワートが保存されているパスワードと同じではない場合は、パスワードの入力を求められます。 +.SS "キーストアの場所" .PP -\fIjarsigner\fRޥɤˤϡѤ륭ȥURLꤹ\fI\-keystore\fRץ󤬤ޤȥϥǥեȤǡ\fIuser\&.home\fRƥࡦץѥƥǷޤ桼Υۡࡦǥ쥯ȥ\fI\&.keystore\fRȤ̾Υե˳Ǽޤ +\fIjarsigner\fRコマンドには、使用するキーストアのURLを指定する\fI\-keystore\fRオプションがあります。キーストアはデフォルトで、\fIuser\&.home\fRシステム・プロパティで決まるユーザーのホーム・ディレクトリの\fI\&.keystore\fRという名前のファイル内に格納されます。 .PP -Oracle Solarisƥξ硢\fIuser\&.home\fRϡ桼Υۡࡦǥ쥯ȥ˥ǥեꤵޤ +Oracle Solarisシステムの場合、\fIuser\&.home\fRは、ユーザーのホーム・ディレクトリにデフォルト設定されます。 .PP -\fI\-keystore\fRץ󤫤ϥȥ꡼ϡ\fIKeyStore\&.load\fR᥽åɤϤޤURLȤ\fINONE\fRꤵƤϡnullΥȥ꡼ब\fIKeyStore\&.load\fR᥽åɤϤޤ\fINONE\fRϡ\fIKeyStore\fR饹ե١ǤϤʤ硢ȤСϡɥȡ󡦥ǥХ֤Ƥ˻ꤷޤ -.SS "ȥμ" +\fI\-keystore\fRオプションからの入力ストリームは、\fIKeyStore\&.load\fRメソッドに渡されます。URLとして\fINONE\fRが指定されている場合は、nullのストリームが\fIKeyStore\&.load\fRメソッドに渡されます。\fINONE\fRは、\fIKeyStore\fRクラスがファイルベースではない場合、たとえば、ハードウェア・トークン・デバイスに置かれている場合に指定します。 +.SS "キーストアの実装" .PP -\fIjava\&.security package\fR󶡤Ƥ\fIKeyStore\fR饹ϡȥξؤΥӾѹԤΡΤ줿¿Υ󥿥ե󶡤ޤʣΰۤʤꤹ뤳ȤǤƼΥפΥȥоݤȤޤ +\fIjava\&.security package\fRで提供されている\fIKeyStore\fRクラスは、キーストア内の情報へのアクセスおよび情報の変更を行うための、明確に定義された多くのインタフェースを提供します。複数の異なる固定実装を指定することができ、各実装は特定のタイプのキーストアを対象とします。 .PP -ߡȥμѤ2ĤΥޥɥ饤󡦥ġ(\fIkeytool\fR\fIjarsigner\fR)ӥݥꥷġȤ̾1ĤGUI١Υġ뤬ޤ\fIKeyStore\fR饹ϸƤ뤿ᡢJDK桼ϡѤ¾Υƥץꥱ񤭹ळȤǤޤ +現在、キーストアの実装を使用する2つのコマンドライン・ツール(\fIkeytool\fRと\fIjarsigner\fR)、およびポリシー・ツールという名前の1つのGUIベースのツールがあります。\fIKeyStore\fRクラスは公開されているため、JDKユーザーは、それを使用する他のセキュリティ・アプリケーションを書き込むことができます。 .PP -Oracle󶡤ȹߤΥǥեȤμޤϡJKSȤ̾ȼΥȥ()ѤΤǡȥեȤƼƤޤȹߤμǤϡ̩ϸ̤Υѥɤˤäݸ졢ȥΤ(̩Ȥ̤)ѥɤˤäݸޤ +Oracleが提供する組込みのデフォルトの実装があります。これは、JKSという名前の独自のキーストア・タイプ(形式)を使用するもので、キーストアをファイルとして実装しています。組込みの実装では、各秘密鍵は個別のパスワードによって保護され、キーストア全体の整合性は(秘密鍵とは別の)パスワードによって保護されます。 .PP -ȥμϥץХ١ǡĤޤꡢ\fIKeyStore\fR饹ˤ󶡤륢ץꥱ󡦥󥿥եϡӥץХ󥿥ե(SPI)˴ؤƼޤб\fIKeystoreSpi\fRݥ饹ꡢ\fIjava\&.security package\fR˴ޤޤƤޤΥ饹ץХɬפΤ륵ӥץХ󥿥եΥ᥽åɤƤޤǡץХȤϡJava Security APIˤäƥǽʥӥΥ֥åȤФθ󶡤ѥåޤϥѥåνΤȤǤȥμ󶡤ˤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlˤ -JavaŹ沽ƥΥץХμˡƤ褦ˡ饤ȤϥץХ\fIKeystoreSpi\fR֥饹μ󶡤ɬפޤ +キーストアの実装はプロバイダベースで、つまり、\fIKeyStore\fRクラスにより提供されるアプリケーション・インタフェースは、サービス・プロバイダ・インタフェース(SPI)に関して実装されます。対応する\fIKeystoreSpi\fR抽象クラスがあり、これも\fIjava\&.security package\fRに含まれています。このクラスが、プロバイダが実装する必要のあるサービス・プロバイダ・インタフェースのメソッドを定義しています。ここで、プロバイダとは、Java Security APIによってアクセス可能なサービスのサブセットに対し、その固定実装を提供するパッケージまたはパッケージの集合のことです。キーストアの実装を提供するには、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlにある +Java暗号化アーキテクチャのプロバイダの実装方法で説明しているように、クライアントはプロバイダを実装し、\fIKeystoreSpi\fRサブクラスの実装を提供する必要があります。 .PP -ץꥱǤϡ\fIKeyStore\fR饹\fIgetInstance\fRեȥꡦ᥽åɤѤơ͡ʥץХۤʤ륿פΥȥμǤޤȥΥפϡȥγǼȥǡȤȤˡȥ̩ȥȥΤݸ뤿˻Ѥ륢르ꥺޤۤʤ륿פΥȥμˤϡߴϤޤ +アプリケーションでは、\fIKeyStore\fRクラスの\fIgetInstance\fRファクトリ・メソッドを使用して、様々なプロバイダから異なるタイプのキーストアの実装を選択できます。キーストアのタイプは、キーストア情報の格納形式とデータ形式を定義するとともに、キーストア内の秘密鍵とキーストア自体の整合性を保護するために使用されるアルゴリズムを定義します。異なるタイプのキーストアの実装には、互換性はありません。 .PP -\fIjarsigner\fR\fIpolicytool\fRޥɤϡURLѤƻǤǤդξ꤫ե١Υȥɤ߼뤳ȤǤޤޤΥޥɤϡWindowsMSCAPIӤ٤ƤΥץåȥեPKCS11󶡤褦ե١Υȥɤ߼뤳ȤǤޤ +\fIjarsigner\fRおよび\fIpolicytool\fRコマンドは、URLを使用して指定できる任意の場所からファイルベースのキーストアを読み取ることができます。また、これらのコマンドは、Windows上のMSCAPIおよびすべてのプラットフォーム上のPKCS11で提供されるような非ファイルベースのキーストアを読み取ることができます。 .PP -\fIjarsigner\fRޥɤ\fIkeytool\fRޥɤξ硢\fI\-storetype\fRץѤơޥɥ饤ǥȥΥפǤޤݥꥷġξ硢\fB֥ȥ\fR˥塼\fBԽ\fRޥɤѤơȥΥפǤޤ +\fIjarsigner\fRコマンドおよび\fIkeytool\fRコマンドの場合、\fI\-storetype\fRオプションを使用して、コマンドラインでキーストアのタイプを指定できます。ポリシー・ツールの場合、\fB「キーストア」\fRメニューの\fB「編集」\fRコマンドを使用して、キーストアのタイプを指定できます。 .PP -桼ȥΥפŪ˻ꤷʤä硢ƥץѥƥեǻꤵ줿\fIkeystore\&.type\fRץѥƥͤ˴Ťơġˤäƥȥμ򤵤ޤΥƥץѥƥե\fIjava\&.security\fRȸƤФ졢JDKƥץѥƥǥ쥯ȥ\fIjava\&.home/lib/security\fR¸ߤƤޤǡ\fIjava\&.home\fRϼ¹ԻĶΥǥ쥯ȥǤ\fIjre\fRǥ쥯ȥϡJDKޤJava Runtime Environment (JRE)κǾ̤Υǥ쥯ȥˤޤ +ユーザーがキーストアのタイプを明示的に指定しなかった場合、セキュリティ・プロパティ・ファイルで指定された\fIkeystore\&.type\fRプロパティの値に基づいて、ツールによってキーストアの実装が選択されます。このセキュリティ・プロパティ・ファイルは\fIjava\&.security\fRと呼ばれ、JDKセキュリティ・プロパティ・ディレクトリ\fIjava\&.home/lib/security\fR内に存在しています。ここで、\fIjava\&.home\fRは実行時環境のディレクトリです。\fIjre\fRディレクトリは、JDKまたはJava Runtime Environment (JRE)の最上位のディレクトリにあります。 .PP -ƥġϡ\fIkeystore\&.type\fRͤΥפΥȥƤץХĤޤǡ󥹥ȡ뤵Ƥ뤹٤ƤΥץХĴ٤ޤŪΥץХĤȡΥץХΥȥμѤޤ +各ツールは、\fIkeystore\&.type\fRの値を取得し、そのタイプのキーストアを実装しているプロバイダが見つかるまで、インストールされているすべてのプロバイダを調べます。目的のプロバイダが見つかると、そのプロバイダからのキーストアの実装を使用します。 .PP -\fIKeyStore\fR饹Ƥstatic᥽å\fIgetDefaultType\fRѤȡץꥱ䥢ץåȤ\fIkeystore\&.type\fRץѥƥͤǤޤΥɤιԤǤϡ\fIkeystore\&.type property\fRǻꤵ줿ǥեȤΥȥפΥ󥹥󥹤ޤ +\fIKeyStore\fRクラスに定義されているstaticメソッド\fIgetDefaultType\fRを使用すると、アプリケーションやアプレットから\fIkeystore\&.type\fRプロパティの値を取得できます。次のコードの行では、\fIkeystore\&.type property\fRで指定された、デフォルトのキーストア・タイプのインスタンスを作成します。 .sp .if n \{\ .RS 4 @@ -240,8 +240,8 @@ KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType()); .RE .\} .PP -ǥեȤΥȥפϡ\fIjks\fR -(Oracle󶡤ȼΥפΥȥμ)ǤϡƥץѥƥեμιԤˤäƻꤵƤޤ +デフォルトのキーストア・タイプは、\fIjks\fR +(Oracleが提供する独自のタイプのキーストアの実装)です。これは、セキュリティ・プロパティ・ファイル内の次の行によって指定されています。 .sp .if n \{\ .RS 4 @@ -253,9 +253,9 @@ keystore\&.type=jks .RE .\} .PP -ȥΥפλǤϡʸȾʸ϶̤ޤ󡣤ȤС\fIJKS\fR\fIjks\fRƱˤʤޤ +キーストアのタイプの指定では、大文字と小文字は区別されません。たとえば、\fIJKS\fRは\fIjks\fRと同じになります。 .PP -ġǥǥեȰʳΥȥμѤˤϡιԤѹ̤ΥȥΥפꤷޤȤС\fIpkcs12\fRȸƤФ륭ȥΥפΥȥμ󶡤ץХѥå硢Ԥ򼡤Τ褦ѹޤ +ツールでデフォルト以外のキーストアの実装を使用するには、その行を変更して別のキーストアのタイプを指定します。たとえば、\fIpkcs12\fRと呼ばれるキーストアのタイプのキーストアの実装を提供するプロバイダ・パッケージがある場合、行を次のように変更します。 .sp .if n \{\ .RS 4 @@ -267,12 +267,12 @@ keystore\&.type=pkcs12 .RE .\} .PP -\fB:\fR -PKCS 11ץХѥåѤ硢http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.htmlˤ -Java PKCS #11ե󥹡ɤΡKeyToolפӡJarSignerפ򻲾ȤƤ -.SS "ݡȤ륢르ꥺ" +\fB注意:\fR +PKCS 11プロバイダ・パッケージを使用する場合、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.htmlにある +Java PKCS #11リファレンス・ガイドの「KeyTool」および「JarSigner」を参照してください。 +.SS "サポートされるアルゴリズム" .PP -ǥեȤǡ\fIjarsigner\fRޥɤǤϼΤ줫Υ르ꥺѤJARե˽̾ޤ +デフォルトで、\fIjarsigner\fRコマンドでは次のいずれかのアルゴリズムを使用してJARファイルに署名します。 .sp .RS 4 .ie n \{\ @@ -282,7 +282,7 @@ Java PKCS #11 .sp -1 .IP \(bu 2.3 .\} -SHA1ȡ르ꥺѤǥ̾르ꥺ(DSA) +SHA1ダイジェスト・アルゴリズムを使用したデジタル署名アルゴリズム(DSA) .RE .sp .RS 4 @@ -293,7 +293,7 @@ SHA1 .sp -1 .IP \(bu 2.3 .\} -SHA256ȡ르ꥺѤRSA르ꥺࡣ +SHA256ダイジェスト・アルゴリズムを使用したRSAアルゴリズム。 .RE .sp .RS 4 @@ -304,15 +304,15 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -SHA256ʱ߶ǥ̾르ꥺ(ECDSA)Ѥʱ߶(EC)Ź르ꥺ +SHA256と楕円曲線デジタル署名アルゴリズム(ECDSA)を使用した楕円曲線(EC)暗号方式アルゴリズム .RE .PP -̾Ԥθ̩DSAǤ硢\fIjarsigner\fR\fISHA1withDSA\fR르ꥺѤJARե˽̾ޤ̾ԤθRSAǤ硢\fIjarsigner\fR\fISHA256withRSA\fR르ꥺѤJARե˽̾褦Ȥޤ̾ԤθECǤ硢\fIjarsigner\fR\fISHA256withECDSA\fR르ꥺѤJARե˽̾ޤ +署名者の公開鍵と秘密鍵がDSA鍵である場合、\fIjarsigner\fRは\fISHA1withDSA\fRアルゴリズムを使用してJARファイルに署名します。署名者の鍵がRSA鍵である場合、\fIjarsigner\fRは\fISHA256withRSA\fRアルゴリズムを使用してJARファイルに署名しようとします。署名者の鍵がEC鍵である場合、\fIjarsigner\fRは\fISHA256withECDSA\fRアルゴリズムを使用してJARファイルに署名します。 .PP -ΥǥեȤν̾르ꥺϡ\fI\-sigalg\fRץѤƥС饤ɤǤޤ -.SS "̾դJARե" +これらのデフォルトの署名アルゴリズムは、\fI\-sigalg\fRオプションを使用してオーバーライドできます。 +.SS "署名付きJARファイル" .PP -\fIjarsigner\fRޥɤѤJARե˽̾硢Ϥ̾դJARեJARեƱǤ2Ĥɲåե뤬META\-INFǥ쥯ȥ֤ۤʤޤ +\fIjarsigner\fRコマンドを使用してJARファイルに署名する場合、出力される署名付きJARファイルは入力JARファイルと同じですが、次の2つの追加ファイルがMETA\-INFディレクトリに置かれる点が異なります。 .sp .RS 4 .ie n \{\ @@ -322,7 +322,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -\fI\&.SF\fRĥҤդ̾ե +\fI\&.SF\fR拡張子の付いた署名ファイル .RE .sp .RS 4 @@ -333,14 +333,14 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -\fI\&.DSA\fR\fI\&.RSA\fRޤ\fI\&.EC\fRĥҤդ֥̾åե +\fI\&.DSA\fR、\fI\&.RSA\fRまたは\fI\&.EC\fR拡張子の付いた署名ブロック・ファイル .RE .PP -2ĤΥեΥ١ե̾ϡ\fI\-sigFile\fRץͤޤȤСץ\fI\-sigFile MKSIGN\fRξ硢ե\fIMKSIGN\&.SF\fR\fIMKSIGN\&.DSA\fRȤ̾ˤʤޤ +これら2つのファイルのベース・ファイル名は、\fI\-sigFile\fRオプションの値から作成されます。たとえば、オプションが\fI\-sigFile MKSIGN\fRの場合、ファイルは\fIMKSIGN\&.SF\fRおよび\fIMKSIGN\&.DSA\fRという名前になります。 .PP -ޥɥ饤\fI\-sigfile\fRץꤷʤä硢\fI\&.SF\fRե\fI\&.DSA\fRեΥ١ե̾ϡޥɥ饤ǻꤵ줿̾Ƭ8ʸ򤹤٤ʸѴΤˤʤޤ̾8ʸ̤ξϡ̾Τޤ޻Ѥޤ̾ˡ̾ե̾ǻѤǤʤʸޤޤƤ硢ե̾κˡʸ(_)ʸѴޤͭʸϡե٥åȡӥϥեǤ -̾ե.PP -̾ե(\fI\&.SF\fRե)ϡ\fIjarsigner\fRޥɤѤƥե˽̾ݤJARե˾˴ޤޤޥ˥եȡեȻƤޤJARե˴ޤޤƤ륽ե뤴Ȥˡ\fI\&.SF\fRեˤϡޥ˥եȡեˤ褦ʡ˼3ĤιԤޤ +コマンドラインで\fI\-sigfile\fRオプションを指定しなかった場合、\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルのベース・ファイル名は、コマンドラインで指定された別名の先頭の8文字をすべて大文字に変換したものになります。別名が8文字未満の場合は、別名がそのまま使用されます。別名に、署名ファイル名で使用できない文字が含まれている場合、ファイル名の作成時に、該当する文字が下線(_)文字に変換されます。有効な文字は、アルファベット、数字、下線およびハイフンです。 +署名ファイル.PP +署名ファイル(\fI\&.SF\fRファイル)は、\fIjarsigner\fRコマンドを使用してファイルに署名する際にJARファイルに常に含まれるマニフェスト・ファイルと似ています。JARファイルに含まれているソース・ファイルごとに、\fI\&.SF\fRファイルには、マニフェスト・ファイルにあるような、次に示す3つの行があります。 .sp .RS 4 .ie n \{\ @@ -350,7 +350,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -ե̾ +ファイル名 .RE .sp .RS 4 @@ -361,7 +361,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -ȡ르ꥺ(SHA)̾ +ダイジェスト・アルゴリズム(SHA)の名前 .RE .sp .RS 4 @@ -372,17 +372,17 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -SHAȤ +SHAダイジェストの値 .RE .PP -ޥ˥եȡեǤϡƥեSHAȤͤϡեΥХʥꡦǡΥ(ϥå)ˤʤޤ\fI\&.SF\fRեǤϡꤵ줿եΥȤͤϡեΥޥ˥եȡեΤ3ԤΥϥåˤʤޤ +マニフェスト・ファイルでは、各ソース・ファイルのSHAダイジェストの値は、ソース・ファイルのバイナリ・データのダイジェスト(ハッシュ)になります。\fI\&.SF\fRファイルでは、指定されたソース・ファイルのダイジェストの値は、ソース・ファイルのマニフェスト・ファイル内のその3行のハッシュになります。 .PP -̾եˤϡǥեȤǡޥ˥եȡեΤΥϥå夬Ǽ줿إåޤޤƤޤإåˤϥޥ˥եȡإåΥϥåޤޤƤޤإå¸ߤȡڤκŬͭˤʤޤJARեθڤ򻲾ȤƤ -֥̾åե.PP -\fI\&.SF\fRեˤϽ̾դ졢̾Ͻ֥̾åե֤ޤΥեˤϡ̾˻Ѥ줿̩бǧڤ륭ȥξޤϾ⡢ǥ󥳡ɤƴޤޤƤޤեγĥҤϡѤȡ르ꥺ˱ơ\fI\&.DSA\fR\fI\&.RSA\fRޤ\fI\&.EC\fRˤʤޤ -.SS "̾ॹ" +署名ファイルには、デフォルトで、マニフェスト・ファイル全体のハッシュが格納されたヘッダーが含まれています。ヘッダーにはマニフェスト・ヘッダーのハッシュも含まれています。ヘッダーが存在すると、検証の最適化が有効になります。JARファイルの検証を参照してください。 +署名ブロック・ファイル.PP +\fI\&.SF\fRファイルには署名が付けられ、署名は署名ブロック・ファイルに置かれます。このファイルには、署名に使用された秘密鍵に対応する公開鍵を認証するキーストアからの証明書または証明書チェーンも、内部でエンコードされて含まれています。ファイルの拡張子は、使用されるダイジェスト・アルゴリズムに応じて、\fI\&.DSA\fR、\fI\&.RSA\fRまたは\fI\&.EC\fRになります。 +.SS "署名タイムスタンプ" .PP -\fIjarsigner\fRޥɤǤϡJARեν̾˽̾ॹפ¸Ǥޤˡ\fIjarsigner\fRؽ̾򥵥ݡȤޤưϾάǽǡ̾˼γƥץˤä椵ޤץ򻲾ȤƤ +\fIjarsigner\fRコマンドでは、JARファイルの署名時に署名タイムスタンプを生成および保存できます。さらに、\fIjarsigner\fRは代替署名機構をサポートします。この動作は省略可能で、署名時に次の各オプションによって制御されます。オプションを参照してください。 .sp .if n \{\ .RS 4 @@ -397,9 +397,9 @@ SHA .if n \{\ .RE .\} -.SS "JARեθ" +.SS "JARファイルの検証" .PP -JARեθڤΤϡ̾ͭǤꡢĽ̾ʹߤJARեΤɤΥեѹƤʤǤJARեθڤϡμǹԤޤ +JARファイルの検証が成功するのは、署名が有効であり、かつ署名の生成以降にJARファイル内のどのファイルも変更されていない場合です。JARファイルの検証は、次の手順で行われます。 .sp .RS 4 .ie n \{\ @@ -409,9 +409,9 @@ JAR .sp -1 .IP " 1." 4.2 .\} -\fI\&.SF\fRեν̾򸡾ڤޤ +\fI\&.SF\fRファイルの署名を検証します。 .sp -ڤǤϡƽ֥̾å(\fI\&.DSA\fR)ե˳Ǽ줿̾(ޤϾ)\fI\&.DSA\fRե˼б̩Ѥ줿Ȥǧޤޤ̾б̾(\fI\&.SF\fR)եͭʽ̾Ǥ뤳Ȥǧ졢ˤꡢ\fI\&.SF\fRե뤬󤵤ƤʤȤǧޤ +検証では、各署名ブロック(\fI\&.DSA\fR)ファイルに格納された署名が、証明書(または証明書チェーン)も\fI\&.DSA\fRファイルに示される公開鍵に対応する秘密鍵を使用して生成されたことを確認します。また、署名が対応する署名(\fI\&.SF\fR)ファイルの有効な署名であることが確認され、それにより、\fI\&.SF\fRファイルが改ざんされていないことも確認されます。 .RE .sp .RS 4 @@ -422,13 +422,13 @@ JAR .sp -1 .IP " 2." 4.2 .\} -\fI\&.SF\fRեγƥȥ˼Ȥ򡢥ޥ˥եбƥͤ碌Ƹڤޤ +\fI\&.SF\fRファイル内の各エントリに示されるダイジェストを、マニフェスト内の対応する各セクションと突きあわせて検証します。 .sp -\fI\&.SF\fRեˤϡޥ˥եȡեΤΥϥå夬Ǽ줿إåǥեȤǴޤޤƤޤإå¸ߤ硢ڤǤϡإåΥϥå夬ޥ˥եȡեΥϥåȰפ뤫ɤǧ뤿˥åǤޤפ硢ڤϼμ˿ʤߤޤ +\fI\&.SF\fRファイルには、マニフェスト・ファイル全体のハッシュが格納されたヘッダーがデフォルトで含まれています。ヘッダーが存在する場合、検証では、ヘッダー内のハッシュがマニフェスト・ファイルのハッシュと一致するかどうかを確認するためにチェックできます。一致する場合、検証は次の手順に進みます。 .sp -פʤ硢\fI\&.SF\fRեγƥե󥻥Υϥå夬ޥ˥եȡեб륻ΥϥåȰפ뤳Ȥǧ뤿ˡޤŬƤʤڤɬפˤʤޤ̾ե򻲾ȤƤ +一致しない場合、\fI\&.SF\fRファイル内の各ソース・ファイル情報セクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致することを確認するために、あまり最適化されていない検証が必要になります。署名ファイルを参照してください。 .sp -\fI\&.SF\fRեΥإå˳Ǽ줿ޥ˥եȡեΥϥå夬ߤΥޥ˥եȡեΥϥå˰פʤͳ1Ĥϡ̾\fI\&.SF\fRեˡ(\fIjar\fRġѤ)1İʾΥե뤬JARեɲä줿ȤǤ\fIjar\fRġѤƥեɲä硢եѤΥɲä뤳Ȥˤꡢޥ˥եȡեѹޤ\fI\&.SF\fRեѹޤ󡣸ڤޤƤȤߤʤΤϡ̾ʹߤJARեΤɤΥեѹƤʤǤ줬ȯΤϡ\fI\&.SF\fRեΥإåʳΥΥϥå夬ޥ˥եȡեб륻ΥϥåȰפǤ +\fI\&.SF\fRファイルのヘッダーに格納されたマニフェスト・ファイルのハッシュが、現在のマニフェスト・ファイルのハッシュに一致しない理由の1つは、署名および\fI\&.SF\fRファイルの生成後に、(\fIjar\fRツールを使用して)1つ以上のファイルがJARファイルに追加されたことです。\fIjar\fRツールを使用してファイルを追加した場合、新しいファイル用のセクションが追加されることにより、マニフェスト・ファイルは変更されますが、\fI\&.SF\fRファイルは変更されません。検証がまだ成功しているとみなされるのは、署名の生成以降にJARファイル内のどのファイルも変更されていない場合です。これが発生するのは、\fI\&.SF\fRファイルのヘッダー以外のセクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致する場合です。 .RE .sp .RS 4 @@ -439,16 +439,16 @@ JAR .sp -1 .IP " 3." 4.2 .\} -\fI\&.SF\fRե˥ȥJARեγƥեɤ߼ޤɼ˥եΥȤ׻̤ޥ˥եȡΤΥեΥȤӤޤȤƱǤɬפꡢǤʤϸڤԤޤ +\fI\&.SF\fRファイル内にエントリを持つJARファイル内の各ファイルを読み取ります。読取り中にファイルのダイジェストを計算し、結果をマニフェスト・セクション内のこのファイルのダイジェストと比較します。ダイジェストは同じである必要があり、そうでない場合は検証が失敗します。 .sp -ڥץˤʤ餫νʸڥ顼ȯ硢Υץߤ졢ƥ㳰ޤ\fIjarsigner\fRޥɤǤϡ㳰ªɽޤ +検証プロセス中になんらかの重大な検証エラーが発生した場合、そのプロセスは停止され、セキュリティ例外がスローされます。\fIjarsigner\fRコマンドでは、例外を捕捉および表示します。 .RE .PP -\fB:\fR -ɲäηٹ(ޤϡ\fI\-strict\fRץꤷϥ顼)Ϥ٤ɤɬפޤƱͤˡǤ뤫ꤹ뤿ˡ(\fI\-verbose\fR\fI\-certs\fRץꤷ)Ƥɤɬפޤ -.SS "1ĤJARեоݤȤʣν̾" +\fB注意:\fR +追加の警告(または、\fI\-strict\fRオプションを指定した場合はエラー)はすべて読む必要があります。同様に、証明が信頼できるかを決定するために、(\fI\-verbose\fRおよび\fI\-certs\fRオプションを指定して)証明書の内容も読む必要があります。 +.SS "1つのJARファイルを対象とする複数の署名" .PP -Τ褦ˡ\fIjarsigner\fRޥɤեʣ¹Ԥ¹ԤΤӤ˰ۤʤ桼̾ꤹ뤳Ȥˤäơ1ĤJARեʣΥ桼ν̾դ뤳ȤǤޤ +次のように、\fIjarsigner\fRコマンドをファイルで複数回実行し、実行のたびに異なるユーザーの別名を指定することによって、1つのJARファイルに複数のユーザーの署名を付けることができます。 .sp .if n \{\ .RS 4 @@ -461,7 +461,7 @@ jarsigner myBundle\&.jar kevin .RE .\} .PP -JARե뤬ʣ̾Ƥ硢JARեˤϡʣ\fI\&.SF\fRե\fI\&.DSA\fRե뤬ޤޤƤꡢ1ν̾Ф1ĤΥڥȤʤޤҤǤϡJARեˤϡ̾Υե뤬ޤޤƤޤ +JARファイルが複数回署名されている場合、そのJARファイルには、複数の\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルが含まれており、1回の署名に対して1つのペアとなります。前述の例では、出力JARファイルには、次の名前のファイルが含まれています。 .sp .if n \{\ .RS 4 @@ -475,9 +475,9 @@ KEVIN\&.DSA .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -γƹǤϡ͡\fIjarsigner\fRץˤĤޤɸդƤ +次の各項では、様々な\fIjarsigner\fRオプションについて説明します。次の標準に注意してください。 .sp .RS 4 .ie n \{\ @@ -487,7 +487,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -ɤΥץ̾ˤƬ˥ޥʥ(\-)դޤ +どのオプション名にも先頭にマイナス記号(\-)が付きます。 .RE .sp .RS 4 @@ -498,7 +498,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -ץǤդνǻǤޤ +オプションは任意の順序で指定できます。 .RE .sp .RS 4 @@ -509,7 +509,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -åΤޤϲդι(ץ)μºݤͤϡꤹɬפޤ +イタリック体または下線付きの項目(オプションの値)の実際の値は、指定する必要があります。 .RE .sp .RS 4 @@ -520,18 +520,18 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -\fI\-storepass\fR\fI\-keypass\fR\fI\-sigfile\fR\fI\-sigalg\fR\fI\-digestalg\fR\fI\-signedjar\fRTSAϢΥץѤǤΤϡJARե˽̾ΤߤǤ̾դJARե򸡾ڤǤϤޤ\fI\-keystore \fRץϡJARեν̾Ӹڤ˴Ϣޤޤ̾ϡJARեν̾Ӹڻ˻ꤷޤ +\fI\-storepass\fR、\fI\-keypass\fR、\fI\-sigfile\fR、\fI\-sigalg\fR、\fI\-digestalg\fR、\fI\-signedjar\fRおよびTSA関連のオプションを使用できるのは、JARファイルに署名する場合のみです。署名付きJARファイルを検証する場合ではありません。\fI\-keystore \fRオプションは、JARファイルの署名および検証に関連します。また、別名は、JARファイルの署名および検証時に指定します。 .RE .PP \-keystore \fIurl\fR .RS 4 -ȥξ򼨤URLꤷޤˤꡢ\fIuser\&.home\fRƥࡦץѥƥǷꤵ줿桼Υۡࡦǥ쥯ȥΥե\fI\&.keystore\fR˥ǥեꤵޤ +キーストアの場所を示すURLを指定します。これにより、\fIuser\&.home\fRシステム・プロパティで決定されたユーザーのホーム・ディレクトリ内のファイル\fI\&.keystore\fRにデフォルト設定されます。 .sp -ȥϽ̾ˤɬפǤǥեȤΥȥ¸ߤʤ硢ޤϥǥեȰʳΥȥѤϡȥŪ˻ꤹɬפޤ +キーストアは署名時には必要です。デフォルトのキーストアが存在しない場合、またはデフォルト以外のキーストアを使用する場合は、キーストアを明示的に指定する必要があります。 .sp -ڤȤϥȥɬפޤ󡣤ȥꤵƤ뤫뤤ϥǥեȤΥȥ¸ߤƤơ\fI\-verbose\fRץꤵƤ硢JARեθڤ˻Ѥ񤬤Υȥ1ĤǤޤޤƤ뤫ɤ˴ؤɲþ󤬽Ϥޤ +検証するときはキーストアは必要ありません。ただし、キーストアが指定されているか、あるいはデフォルトのキーストアが存在していて、さらに\fI\-verbose\fRオプションも指定されていた場合、JARファイルの検証に使用される証明書がそのキーストアに1つでも含まれているかどうかに関する追加情報が出力されます。 .sp -\fI\-keystore\fRˤϡURLǤϤʤե̾ȥѥǤξ硢ե: URLƱ褦˽ޤȤСˤ褦˻ꤹƱˤʤޤ +\fI\-keystore\fR引数には、URLではなくファイル名とパスを指定でき、この場合、ファイル: URLと同じように処理されます。たとえば、次にように指定すると同等になります。 .sp .if n \{\ .RS 4 @@ -543,8 +543,8 @@ KEVIN\&.DSA .if n \{\ .RE .\} -(JRE\fI$JAVA_HOME/lib/security directory\fRˤ) -\fIjava\&.security\fRƥץѥƥեSun PKCS #11ץХ줿硢\fIkeytool\fR\fIjarsigner\fRġPKCS#11ȡ˴ŤưǤޤΥץꤷޤ +(JREの\fI$JAVA_HOME/lib/security directory\fRにある) +\fIjava\&.security\fRセキュリティ・プロパティ・ファイル内でSun PKCS #11プロバイダが構成された場合、\fIkeytool\fRおよび\fIjarsigner\fRツールはPKCS#11トークンに基づいて動作できます。次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -556,7 +556,7 @@ KEVIN\&.DSA .if n \{\ .RE .\} -ȤСΥޥɤϡ줿PKCS#11ȡƤɽޤ +たとえば、次のコマンドは、構成されたPKCS#11トークンの内容を一覧表示します。 .sp .if n \{\ .RS 4 @@ -571,17 +571,17 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .PP \-storetype \fIstoretype\fR .RS 4 -󥹥󥹤륭ȥΥפꤷޤǥեȤΥȥפϡƥץѥƥե\fIkeystore\&.type\fRץѥƥͤǻꤵ줿פǤͤϡ\fIjava\&.security\&.KeyStore\fRstatic -\fIgetDefaultType\fR᥽åɤˤä֤ޤ +インスタンスを生成するキーストアのタイプを指定します。デフォルトのキーストア・タイプは、セキュリティ・プロパティ・ファイル内の\fIkeystore\&.type\fRプロパティの値で指定されたタイプです。この値は、\fIjava\&.security\&.KeyStore\fRのstatic +\fIgetDefaultType\fRメソッドによって返されます。 .sp -\fI\-storepass\fRץѤơPCKS #11ȡPINꤹ뤳ȤǤޤꤷʤ硢\fIkeytool\fR\fIjarsigner\fRޥɤˤäơȡPINλޤȡݸ줿ǧڥѥ(ѤPINѥåɤɼ굡ʤ)硢\fI\-protected\fRץꤹɬפޤѥɡץϻǤޤ +\fI\-storepass\fRオプションを使用して、PCKS #11トークンのPINを指定することもできます。何も指定しない場合、\fIkeytool\fRおよび\fIjarsigner\fRコマンドによって、トークンPINの指定を求められます。トークンに保護された認証パス(専用のPINパッドや生体読取り機など)がある場合、\fI\-protected\fRオプションを指定する必要がありますが、パスワード・オプションは指定できません。 .RE .PP \-storepass[:env | :file] \fIargument\fR .RS 4 -ȥ˥Τɬפʥѥɤꤷޤ줬ɬפʤΤϡJARե˽̾դȤΤߤǤ(ڤȤˤפǤ)ξ硢\fI\-storepass\fRץ򥳥ޥɥ饤ǻꤷʤȡѥɤϤޤ +キーストアにアクセスするのに必要なパスワードを指定します。これが必要なのは、JARファイルに署名を付けるときのみです(検証するときには不要です)。その場合、\fI\-storepass\fRオプションをコマンドラインで指定しないと、パスワードの入力を求められます。 .sp -\fIenv\fRޤ\fIfile\fRꤵƤʤ硢ѥɤͤ\fIargument\fRˤʤޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRが指定されていない場合、パスワードの値は\fIargument\fRになります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -592,7 +592,7 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -604,18 +604,18 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIfile\fR: -\fIargument\fRȤ̾Υե뤫ѥɤޤ +\fIargument\fRという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -ƥȤŪȤޤϥƥݸ줿ƥѤƤʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤ +\fB注意:\fR +テストを目的とする場合またはセキュリティ保護されたシステムを使用している場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。 .RE .PP \-keypass [:env | :file] \fIargument\fR .RS 4 -ޥɥ饤ǻꤵ줿̾б륭ȥȥ̩ݸΤ˻Ѥѥɤꤷޤ\fIjarsigner\fRѤJARե˽̾դȤϡѥɤɬפǤޥɥ饤ǥѥɤꤵƤ餺ɬפʥѥɤȥΥѥɤȰۤʤϡѥɤϤޤ +コマンドラインで指定された別名に対応するキーストア・エントリの秘密鍵を保護するのに使用するパスワードを指定します。\fIjarsigner\fRを使用してJARファイルに署名を付けるときは、パスワードが必要です。コマンドラインでパスワードが指定されておらず、必要なパスワードがストアのパスワードと異なる場合は、パスワードの入力を求められます。 .sp -\fIenv\fRޤ\fIfile\fRꤵƤʤ硢ѥɤͤ\fIargument\fRˤʤޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRが指定されていない場合、パスワードの値は\fIargument\fRになります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -626,7 +626,7 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -638,84 +638,84 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIfile\fR: -\fIargument\fRȤ̾Υե뤫ѥɤޤ +\fIargument\fRという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -ƥȤŪȤޤϥƥݸ줿ƥѤƤʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤ +\fB注意:\fR +テストを目的とする場合またはセキュリティ保護されたシステムを使用している場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。 .RE .PP \-sigfile \fIfile\fR .RS 4 -줿\fI\&.SF\fRե뤪\fI\&.DSA\fRե˻Ѥ١ե̾ꤷޤȤСե뤬\fIDUKESIGN\fRξ硢\fI\&.SF\fR\fI\&.DSA\fRեϡ\fIDUKESIGN\&.SF\fR\fIDUKESIGN\&.DSA\fRȤ̾ǡ̾դJARե\fIMETA\-INF\fRǥ쥯ȥ˳Ǽޤ +生成された\fI\&.SF\fRファイルおよび\fI\&.DSA\fRファイルに使用するベース・ファイル名を指定します。たとえば、ファイルが\fIDUKESIGN\fRの場合、生成される\fI\&.SF\fRおよび\fI\&.DSA\fRファイルは、\fIDUKESIGN\&.SF\fRおよび\fIDUKESIGN\&.DSA\fRという名前で、署名付きJARファイルの\fIMETA\-INF\fRディレクトリに格納されます。 .sp -եʸϡå\fIa\-zA\-Z0\-9_\-\fRꤵɬפޤե٥åȡӥϥեʸΤߤѤǤޤ\fI\&.SF\fR\fI\&.DSA\fRΥե̾ǤϡʸϤ٤ʸѴޤ +ファイル内の文字は、セット\fIa\-zA\-Z0\-9_\-\fRから指定される必要があります。アルファベット、数字、下線およびハイフン文字のみを使用できます。\fI\&.SF\fRおよび\fI\&.DSA\fRのファイル名では、小文字はすべて大文字に変換されます。 .sp -ޥɥ饤\fI\-sigfile\fRץꤷʤä硢\fI\&.SF\fRե\fI\&.DSA\fRեΥ١ե̾ϡޥɥ饤ǻꤵ줿̾Ƭ8ʸ򤹤٤ʸѴΤˤʤޤ̾8ʸ̤ξϡ̾Τޤ޻Ѥޤ̾ˡ̾ե̵̾ʸޤޤƤ硢ե̾뤿ˡʸ(_)ʸѴޤ +コマンドラインで\fI\-sigfile\fRオプションを指定しなかった場合、\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルのベース・ファイル名は、コマンドラインで指定された別名の先頭の8文字をすべて大文字に変換したものになります。別名が8文字未満の場合は、別名がそのまま使用されます。別名に、署名ファイル名で無効な文字が含まれている場合、ファイル名を作成するために、該当する文字が下線(_)文字に変換されます。 .RE .PP \-sigalg \fIalgorithm\fR .RS 4 -JARեν̾˻Ѥ̾르ꥺ̾ꤷޤ +JARファイルの署名に使用する署名アルゴリズムの名前を指定します。 .sp -ɸŪʽ̾르ꥺ̾ΥꥹȤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAˤ -Java Cryptography Architecture (JCA)ե󥹡ɤΡϿA: ɸ̾פ򻲾ȤƤ +標準的な署名アルゴリズム名のリストは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAにある +Java Cryptography Architecture (JCA)リファレンス・ガイドの「付録A: 標準名」を参照してください。 .sp -Υ르ꥺˤϡJARեν̾˻Ѥ̩ȤθߴɬפǤΥץꤷʤ硢̩Υפ˱ơ\fISHA1withDSA\fR\fISHA256withRSA\fRޤ\fISHA256withECDSA\fRѤޤꤵ줿르ꥺμ󶡤ץХŪ˥󥹥ȡ뤵Ƥ뤫\fI\-providerClass\fRץѤƤΤ褦ʥץХ桼ꤹɬפޤǤʤ硢ޥɤϼԤޤ +このアルゴリズムには、JARファイルの署名に使用する秘密鍵との互換性が必要です。このオプションを指定しない場合、秘密鍵のタイプに応じて、\fISHA1withDSA\fR、\fISHA256withRSA\fRまたは\fISHA256withECDSA\fRが使用されます。指定されたアルゴリズムの実装を提供するプロバイダが静的にインストールされているか、\fI\-providerClass\fRオプションを使用してそのようなプロバイダをユーザーが指定する必要があります。そうでない場合、コマンドは失敗します。 .RE .PP \-digestalg \fIalgorithm\fR .RS 4 -JARեΥȥȤݤ˻Ѥåȡ르ꥺ̾ꤷޤ +JARファイルのエントリをダイジェストする際に使用するメッセージ・ダイジェスト・アルゴリズムの名前を指定します。 .sp -ɸŪʥåȡ르ꥺ̾ΥꥹȤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAˤ -Java Cryptography Architecture (JCA)ե󥹡ɤΡϿA: ɸ̾פ򻲾ȤƤ +標準的なメッセージ・ダイジェスト・アルゴリズム名のリストは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAにある +Java Cryptography Architecture (JCA)リファレンス・ガイドの「付録A: 標準名」を参照してください。 .sp -Υץꤷʤ硢\fISHA256\fRѤޤꤵ줿르ꥺμ󶡤ץХŪ˥󥹥ȡ뤵Ƥ뤫\fI\-providerClass\fRץѤƤΤ褦ʥץХ桼ꤹɬפޤǤʤ硢ޥɤϼԤޤ +このオプションを指定しない場合、\fISHA256\fRが使用されます。指定されたアルゴリズムの実装を提供するプロバイダが静的にインストールされているか、\fI\-providerClass\fRオプションを使用してそのようなプロバイダをユーザーが指定する必要があります。そうでない場合、コマンドは失敗します。 .RE .PP \-certs .RS 4 -ޥɥ饤ǡ\fI\-certs\fRץ\fI\-verify\fR\fI\-verbose\fRץȤȤ˻ꤷ硢JARեγƽ̾Ԥξ󤬽Ϥ˴ޤޤޤξˤϡ̾Ԥθ(\fI\&.DSA\fRե˳Ǽ)Υפ̾ޤޤ졢X\&.509(\fIjava\&.security\&.cert\&.X509Certificate\fRΥ󥹥)ξ硢̾Ԥμ̾ޤޤޤ +コマンドラインで、\fI\-certs\fRオプションを\fI\-verify\fRおよび\fI\-verbose\fRオプションとともに指定した場合、JARファイルの各署名者の証明書情報が出力に含まれます。この情報には、署名者の公開鍵を証明する証明書(\fI\&.DSA\fRファイルに格納)のタイプの名前が含まれ、証明書がX\&.509証明書(\fIjava\&.security\&.cert\&.X509Certificate\fRのインスタンス)の場合、署名者の識別名が含まれます。 .sp -ȥγǧԤޤޥɥ饤ǥȥͤꤵƤʤ硢ǥեȤΥȥե()åޤ̾Ԥθξ񤬥ȥΥȥȰפ硢ν̾ԤΥȥΥȥ̾ݥåɽޤ +キーストアの確認も行われます。コマンドラインでキーストアの値が指定されていない場合、デフォルトのキーストア・ファイル(ある場合)がチェックされます。署名者の公開鍵の証明書がキーストア内のエントリと一致する場合、その署名者のキーストアのエントリの別名が丸カッコ内に表示されます。 .RE .PP \-certchain \fIfile\fR .RS 4 -ޥɥ饤ǻꤷ̾ˤäɽ륭ȥȥ̩˴Ϣդ줿󤬴ǤϤʤˡѤꤷޤϡΤݻΤ˽ʬΰ褬ʤϡɥȡ˥ȥǼƤȯޤΥեϰϢϢ뤵줿X\&.509PKCS#7ñǡ֥åΤ줫ȤʤꡢΥ󥳡ǥ󥰷ϥХʥꡦ󥳡ǥ󥰷Internet RFC 1421ɸǵꤵǽ󥳡ǥ󥰷(Base64󥳡ǥ󥰤ȤƤФ)Τ줫ˤʤޤ󥿡ͥåRFC 1421沽ʤhttp://tools\&.ietf\&.org/html/rfc1421򻲾ȤƤ +コマンドラインで指定した別名によって表されるキーストア・エントリの秘密鍵に関連付けられた証明書チェーンが完全ではない場合に、使用する証明書チェーンを指定します。これは、証明書チェーン全体を保持するのに十分な領域がないハードウェア・トークン上にキーストアが格納されている場合に発生します。このファイルは一連の連結されたX\&.509証明書、PKCS#7形式の単一データ・ブロックのいずれかとなり、そのエンコーディング形式はバイナリ・エンコーディング形式、Internet RFC 1421標準で規定される印刷可能エンコーディング形式(Base64エンコーディングとも呼ばれる)のいずれかになります。インターネットRFC 1421証明書符号化規格およびhttp://tools\&.ietf\&.org/html/rfc1421を参照してください。 .RE .PP \-verbose .RS 4 -ޥɥ饤\fI\-verbose\fRץꤷ硢Ĺ⡼ɤưΥ⡼ɤǤϡ\fIjarsigner\fRϡJARν̾ޤϸڤοʹԾ˴ؤɲþϤޤ +コマンドラインで\fI\-verbose\fRオプションを指定した場合、冗長モードで動作し、このモードでは、\fIjarsigner\fRは、JARの署名または検証の進行状況に関する追加情報を出力します。 .RE .PP \-internalsf .RS 4 -ϡJARեν̾줿\fI\&.DSA\fR -(֥̾å)եˡ줿\fI\&.SF\fRե(̾ե)Υ󥳡ɤ줿ʥԡޤޤƤޤ ưѹޤJARեΤΥ򾮤뤿ˡǥեȤǤ\fI\&.DSA\fRեˤ\fI\&.SF\fRեΥԡޤޤʤ褦ˤʤäƤޤޥɥ饤\fI\-internalsf\fRꤷ硢Ʊ褦ưޤΥץϡƥȤԤǤºݤˤϡ\fI\-internalsf\fRץϡСإåɤ礭ʤ뤿ᡢѤʤǤ +以前は、JARファイルの署名時に生成された\fI\&.DSA\fR +(署名ブロック)ファイルに、生成された\fI\&.SF\fRファイル(署名ファイル)のエンコードされた完全なコピーが含まれていました。 この動作は変更されました。出力JARファイル全体のサイズを小さくするために、デフォルトでは\fI\&.DSA\fRファイルには\fI\&.SF\fRファイルのコピーが含まれないようになっています。コマンドラインで\fI\-internalsf\fRを指定した場合、以前と同じように動作します。このオプションは、テストを行う場合に便利です。実際には、\fI\-internalsf\fRオプションは、オーバーヘッドが大きくなるため、使用しないでください。 .RE .PP \-sectionsonly .RS 4 -ޥɥ饤\fI\-sectionsonly\fRץꤷ硢JARեν̾\fI\&.SF\fRե(̾ե)ˤϡޥ˥եȡեΤΥϥåޤإåϴޤޤޤ󡣤˴ޤޤΤϡJARեγƥե˴Ϣ󤪤ӥϥåΤߤǤ̾ե򻲾ȤƤ +コマンドラインで\fI\-sectionsonly\fRオプションを指定した場合、JARファイルの署名時に生成される\fI\&.SF\fRファイル(署名ファイル)には、マニフェスト・ファイル全体のハッシュを含むヘッダーは含まれません。これに含まれるのは、JARファイル内の各ソース・ファイルに関連する情報およびハッシュのみです。署名ファイルを参照してください。 .sp -ǥեȤǤϡŬΤˡΥإåɲäޤإå¸ߤ硢JARե򸡾ڤ뤿ӤˡڤǤϡޤإåΥϥå夬ޥ˥եȡեΤΥϥåȰפ뤫ɤǧ뤿˥åǤޤפ硢ڤϼμ˿ʤߤޤפʤ硢\fI\&.SF\fRեγƥե󥻥Υϥå夬ޥ˥եȡեб륻ΥϥåȰפȤޤŬƤʤڤ¹ԤɬפޤJARեθڤ򻲾ȤƤ +デフォルトでは、最適化のために、このヘッダーが追加されます。ヘッダーが存在する場合、JARファイルを検証するたびに、検証では、まずヘッダー内のハッシュがマニフェスト・ファイル全体のハッシュと一致するかどうかを確認するためにチェックできます。一致する場合、検証は次の手順に進みます。一致しない場合、\fI\&.SF\fRファイル内の各ソース・ファイル情報セクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致するという、あまり最適化されていない検証を実行する必要があります。JARファイルの検証を参照してください。 .sp -\fI\-sectionsonly\fRץϡ˥ƥѤ˻ѤޤѤȥСإåɤ礭ʤ뤿ᡢƥѰʳǤϻѤʤǤ +\fI\-sectionsonly\fRオプションは、主にテスト用に使用されます。これを使用するとオーバーヘッドが大きくなるため、テスト用以外では使用しないでください。 .RE .PP \-protected .RS 4 -\fItrue\fRޤ\fIfalse\fRΤ줫ͤǤޤPIN꡼ʤɤݸ줿ǧڥѥˤäƥѥɤꤹɬפ硢\fItrue\fRꤷޤ +\fItrue\fRまたは\fIfalse\fRのいずれかの値を指定できます。専用PINリーダーなどの保護された認証パスによってパスワードを指定する必要がある場合、\fItrue\fRを指定します。 .RE .PP \-providerClass \fIprovider\-class\-name\fR .RS 4 -Ź沽ӥץХ\fIjava\&.security\fRƥץѥƥե˻ꤵƤʤȤϡΥޥ饹ե̾ꤹȤ˻Ѥޤ +暗号化サービス・プロバイダが\fIjava\&.security\fRセキュリティ・プロパティ・ファイルに指定されていないときは、そのマスター・クラス・ファイルの名前を指定するときに使用されます。 .sp -\fI\-providerArg ConfigFilePath\fRץȤȤ˻Ѥ\fIkeytool\fR\fIjarsigner\fRġϡץХưŪ˥󥹥ȡ뤷ȡեؤΥѥ\fIConfigFilePath\fRѤޤϡOracle PKCS #11ץХƥץѥƥե˹Ƥʤä\fIPKCS #11\fRȥɽ륳ޥɤ򼨤Ƥޤ +\fI\-providerArg ConfigFilePath\fRオプションとともに使用し、\fIkeytool\fRおよび\fIjarsigner\fRツールは、プロバイダを動的にインストールし、トークン構成ファイルへのパスに\fIConfigFilePath\fRを使用します。次の例は、Oracle PKCS #11プロバイダがセキュリティ・プロパティ・ファイルに構成されていなかった場合に\fIPKCS #11\fRキーストアを一覧表示するコマンドを示しています。 .sp .if n \{\ .RS 4 @@ -733,9 +733,9 @@ jarsigner \-keystore NONE \-storetype PKCS11 \e .PP \-providerName \fIproviderName\fR .RS 4 -\fIjava\&.security\fRƥץѥƥե2İʾΥץХ줿硢\fI\-providerName\fRץѤơΥץХ󥹥󥹤оݤˤ뤳ȤǤޤΥץΰϡץХ̾Ǥ +\fIjava\&.security\fRセキュリティ・プロパティ・ファイル内で2つ以上のプロバイダが構成された場合、\fI\-providerName\fRオプションを使用して、特定のプロバイダ・インスタンスを対象にすることができます。このオプションの引数は、プロバイダの名前です。 .sp -Oracle PKCS #11ץХξ硢\fIproviderName\fR\fISunPKCS11\-\fR\fITokenName\fRȤˤʤޤǡ°ɽǾܺ٤Ƥ褦ˡ\fITokenName\fRϡץХ󥹥󥹤줿̾ǤȤСΥޥɤϡ̾\fISmartCard\fR\fIPKCS #11\fRȥץХ󥹥󥹤Ƥɽޤ +Oracle PKCS #11プロバイダの場合、\fIproviderName\fRは\fISunPKCS11\-\fR\fITokenName\fRという形式になります。ここで、構成属性の表で詳細に説明されているように、\fITokenName\fRは、プロバイダ・インスタンスが構成された名前の接尾辞です。たとえば、次のコマンドは、名前接尾辞\fISmartCard\fRの\fIPKCS #11\fRキーストア・プロバイダ・インスタンスの内容を一覧表示します。 .sp .if n \{\ .RS 4 @@ -752,45 +752,45 @@ jarsigner \-keystore NONE \-storetype PKCS11 \e .PP \-J\fIjavaoption\fR .RS 4 -ꤵ줿\fIjavaoption\fRʸJava󥿥ץ꥿ľϤޤ\fIjarsigner\fRޥɤϡ󥿥ץ꥿ФåѡǤΥץˤϡޤ뤳ȤϤǤޤ󡣤Υץϡ¹ԴĶޤϥ꡼ѤĴǤǤ륤󥿥ץ꥿ץɽˤϡޥɥ饤\fIjava \-h\fRޤ\fIjava \-X\fRϤƤ +指定された\fIjavaoption\fR文字列をJavaインタプリタに直接渡します。\fIjarsigner\fRコマンドは、インタプリタに対するラッパーです。このオプションには、空白を含めることはできません。このオプションは、実行環境またはメモリー使用を調整する場合に便利です。指定できるインタプリタ・オプションを一覧表示するには、コマンドラインで\fIjava \-h\fRまたは\fIjava \-X\fRと入力してください。 .RE .PP \-tsa \fIurl\fR .RS 4 -\fI\-tsa http://example\&.tsa\&.url\fRJARեν̾˥ޥɥ饤ˤ硢̾ΥॹפޤURL -\fIhttp://example\&.tsa\&.url\fRϡTime Stamping Authority (TSA)ξꤷ\fI\-tsacert\fRץꤷƸФ줿URL򥪡С饤ɤޤ\fI\-tsa\fRץǤϡTSAθ򥭡ȥ֤ɬפϤޤ +\fI\-tsa http://example\&.tsa\&.url\fRがJARファイルの署名時にコマンドラインにある場合、署名のタイムスタンプが生成されます。URL +\fIhttp://example\&.tsa\&.url\fRは、Time Stamping Authority (TSA)の場所を特定し、\fI\-tsacert\fRオプションを指定して検出されたURLをオーバーライドします。\fI\-tsa\fRオプションでは、TSAの公開鍵証明書をキーストアに配置する必要はありません。 .sp -ॹפ뤿ˡ\fIjarsigner\fRϡRFC 3161Ƥ륿ॹסץȥ(TSP)ѤTSA̿ޤȡTSAˤä֤줿ॹסȡϡ֥̾åեν̾ȤȤ¸ޤ +タイムスタンプを生成するために、\fIjarsigner\fRは、RFC 3161で定義されているタイムスタンプ・プロトコル(TSP)を使用してTSAと通信します。成功すると、TSAによって返されたタイムスタンプ・トークンは、署名ブロック・ファイルの署名とともに保存されます。 .RE .PP \-tsacert \fIalias\fR .RS 4 -\fI\-tsacert alias\fRJARեν̾˥ޥɥ饤ˤ硢̾Υॹפޤ̾ϡȥͭTSAθꤷޤȥξǡTSAξꤹURLޤSubject Information Accessĥǽǧޤ +\fI\-tsacert alias\fRがJARファイルの署名時にコマンドラインにある場合、署名のタイムスタンプが生成されます。別名は、キーストア内の有効なTSAの公開鍵証明書を特定します。エントリの証明書で、TSAの場所を特定するURLを含むSubject Information Access拡張機能が確認されます。 .sp -\fI\-tsacert\fRץѤϡTSAθ񤬥ȥ֤Ƥɬפޤ +\fI\-tsacert\fRオプションを使用する場合は、TSAの公開鍵証明書がキーストアに配置されている必要があります。 .RE .PP \-tsapolicyid \fIpolicyid\fR .RS 4 -TSAСݥꥷID̤륪֥ȼ̻(OID)ꤷޤΥץꤷʤ硢ݥꥷID줺TSAСϥǥեȤΥݥꥷID򤷤ޤ +TSAサーバーに送信するポリシーIDを識別するオブジェクト識別子(OID)を指定します。このオプションを指定しない場合、ポリシーIDは送信されず、TSAサーバーはデフォルトのポリシーIDを選択します。 .sp -֥ȼ̻ҤϡITU Telecommunication Standardization Sector (ITU\-T)ɸǤX\&.696ˤäޤμ̻Ҥϡ̾\fI1\&.2\&.3\&.4\fRʤɤΡǤϤʤΥԥꥪɶڤΥåȤǤ +オブジェクト識別子は、ITU Telecommunication Standardization Sector (ITU\-T)標準であるX\&.696によって定義されます。これらの識別子は、通常、\fI1\&.2\&.3\&.4\fRなどの、負ではない数字のピリオド区切りのセットです。 .RE .PP \-altsigner \fIclass\fR .RS 4 -Υץϡؽ̾ᥫ˥ꤷޤ饹̾ϡ\fIcom\&.sun\&.jarsigner\&.ContentSigner\fRݥ饹ĥ륯饹ե̤ޤΥ饹եؤΥѥϡ\fI\-altsignerpath\fRץˤäޤ\fI\-altsigner\fRץѤ硢\fIjarsigner\fRޥɤǤϡꤵ줿饹ˤä󶡤̾ᥫ˥Ѥޤʳξ硢\fIjarsigner\fRޥɤϥǥեȤν̾ᥫ˥Ѥޤ +このオプションは、代替署名メカニズムを指定します。完全修飾クラス名は、\fIcom\&.sun\&.jarsigner\&.ContentSigner\fR抽象クラスを拡張するクラス・ファイルを識別します。このクラス・ファイルへのパスは、\fI\-altsignerpath\fRオプションによって定義されます。\fI\-altsigner\fRオプションを使用した場合、\fIjarsigner\fRコマンドでは、指定されたクラスによって提供される署名メカニズムを使用します。それ以外の場合、\fIjarsigner\fRコマンドはデフォルトの署名メカニズムを使用します。 .sp -ȤС\fIcom\&.sun\&.sun\&.jarsigner\&.AuthSigner\fRȤ̾Υ饹󶡤̾ᥫ˥ѤˤϡjarsignerΥץ\fI\-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fRѤޤ +たとえば、\fIcom\&.sun\&.sun\&.jarsigner\&.AuthSigner\fRという名前のクラスが提供する署名メカニズムを使用するには、jarsignerのオプション\fI\-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fRを使用します。 .RE .PP \-altsignerpath \fIclasspathlist\fR .RS 4 -饹ե뤪Ӥ줬¸JARեؤΥѥꤷޤ\fI\-altsigner\fRץѤơ饹ե̾ꤷޤ饹ե뤬JARեˤ硢ΥץǤϡJARեؤΥѥꤷޤ +クラス・ファイルおよびそれが依存するJARファイルへのパスを指定します。\fI\-altsigner\fRオプションを使用して、クラス・ファイル名を指定します。クラス・ファイルがJARファイル内にある場合、このオプションでは、そのJARファイルへのパスを指定します。 .sp -ХѥޤϸߤΥǥ쥯ȥؤХѥǤޤ\fIclasspathlist\fRʣΥѥJARե뤬ޤޤ硢Oracle Solarisξϥ(:)ǡWindowsξϥߥ(;)ǡ줾ڤޤŪΥ饹Ǥ˸ѥˤϡΥץפǤ +絶対パスまたは現在のディレクトリへの相対パスを指定できます。\fIclasspathlist\fRに複数のパスやJARファイルが含まれる場合、それらを、Oracle Solarisの場合はコロン(:)で、Windowsの場合はセミコロン(;)で、それぞれ区切ります。目的のクラスがすでに検索パス内にある場合は、このオプションは不要です。 .sp -Ǥϡ饹եޤJARեؤΥѥꤹˡ򼨤ޤJARե̾ޤޤ +次の例では、クラス・ファイルを含むJARファイルへのパスを指定する方法を示します。JARファイル名を含めます。 .sp .if n \{\ .RS 4 @@ -801,7 +801,7 @@ TSA .if n \{\ .RE .\} -Ǥϡ饹եޤJARեؤΥѥꤹˡ򼨤ޤJARե̾άޤ +次の例では、クラス・ファイルを含むJARファイルへのパスを指定する方法を示します。JARファイル名を省略します。 .sp .if n \{\ .RS 4 @@ -816,101 +816,101 @@ TSA .PP \-strict .RS 4 -̾ޤϸڽˡޥɤˤٹåȯԤ礬ޤΥץꤹȡޥɤˤ긡Ф줿ʷٹåġνλɤȿǤޤ顼ȷٹ򻲾ȤƤ +署名または検証処理中に、コマンドにより警告メッセージが発行される場合があります。このオプションを指定すると、コマンドにより検出された重大な警告メッセージがツールの終了コードに反映されます。エラーと警告を参照してください。 .RE .PP \-verbose \fIsuboptions\fR .RS 4 -ڽξ硢\fI\-verbose\fRץˤϡɽ̤ꤹ륵֥ץꤷޤ\fI\-certs\fRץꤷ硢ǥեȡ⡼(ޤϥ֥ץ\fIall\fR)Ǥϡȥ꤬뤿Ӥ˳ƥȥ꤬ɽ졢θJARեγƽ̾Ԥξɽޤ\fI\-certs\fR\fI\-verbose:grouped\fR֥ץꤷ硢Ʊ̾Ծĥȥ꤬ξȤȤˡ롼ײɽޤ\fI\-certs\fR\fI\-verbose:summary\fR֥ץꤷ硢Ʊ̾Ծĥȥ꤬ξȤȤˡ롼ײɽޤƥȥξܺ٤ϡ\fI1ĤΥȥ(ʾ)\fRˤޤȤɽޤ򻲾ȤƤ +検証処理の場合、\fI\-verbose\fRオプションには、表示する情報の量を決定するサブオプションを指定します。\fI\-certs\fRオプションも指定した場合、デフォルト・モード(またはサブオプション\fIall\fR)では、エントリが処理されるたびに各エントリが表示され、その後にJARファイルの各署名者の証明書情報も表示されます。\fI\-certs\fRおよび\fI\-verbose:grouped\fRサブオプションを指定した場合、同じ署名者情報を持つエントリが、その証明書情報とともに、グループ化されて表示されます。\fI\-certs\fRおよび\fI\-verbose:summary\fRサブオプションを指定した場合、同じ署名者情報を持つエントリが、その証明書情報とともに、グループ化されて表示されます。各エントリの詳細は、\fI1つのエントリ(以上)\fRにまとめられて表示されます。例を参照してください。 .RE -.SH "顼ȷٹ" +.SH "エラーと警告" .PP -̾ޤϸڥץˡ\fIjarsigner\fRޥɤǡ͡ʥ顼ޤϷٹȯԤǽޤ +署名または検証プロセス中に、\fIjarsigner\fRコマンドで、様々なエラーまたは警告が発行される可能性があります。 .PP -㳲硢\fIjarsigner\fRޥɤϥ1ǽλޤ㳲Ϥʤ1İʾνʷٹ𤬤硢\fI\-strict\fRץ󤬻ꤵ\fBʤ\fRϡ\fIjarsigner\fRޥɤϥ0ǽλ\fI\-strict\fRꤵƤϷٹ𥳡ɤORͤǽλޤٹΤߤ롢ޤϷٹ𤬤ޤäʤ硢ޥɤϾ˥0ǽλޤ +障害がある場合、\fIjarsigner\fRコマンドはコード1で終了します。障害はないが、1つ以上の重大な警告がある場合、\fI\-strict\fRオプションが指定されて\fBいない\fR場合は、\fIjarsigner\fRコマンドはコード0で終了し、\fI\-strict\fRが指定されている場合は警告コードのOR値で終了します。情報警告のみがある、または警告がまったくない場合、コマンドは常にコード0で終了します。 .PP -ȤСȥν̾˻Ѥ񤬴ڤǡեν̾ĤʤKeyUsageĥǽѤƤ硢\fI\-strict\fRץ󤬻ꤵƤȡ\fIjarsigner\fRޥɤϥ12 (=4+8)ǽλޤ +たとえば、エントリの署名に使用される証明書が期限切れで、ファイルの署名を許可しないKeyUsage拡張機能を使用している場合、\fI\-strict\fRオプションが指定されていると、\fIjarsigner\fRコマンドはコード12 (=4+8)で終了します。 .PP -\fB:\fR -UNIX١Υڥ졼ƥ󥰡ƥǤ0255ޤǤͤΤߤͭΤᡢλɤϺѤޤ +\fB注意:\fR +UNIXベースのオペレーティング・システムでは0から255までの値のみが有効のため、終了コードは再利用されます。 .PP -ΥǤϡ\fIjarsigner\fRޥɤˤȯԤǤ륨顼ӷٹ̾ɡ򵭽Ҥޤ -.SS "㳲" +次のセクションでは、\fIjarsigner\fRコマンドにより発行できるエラーおよび警告の名前、コード、説明を記述します。 +.SS "障害" .PP -ޥɥ饤ϥ顼JARե˽̾븰ڥ򸡺ǤʤޤϽ̾դJARեθڼԤʤ(ꤵޤ)\fIjarsigner\fRޥɤμͳ +コマンドライン解析エラー、JARファイルに署名する鍵ペアを検索できない、または署名付きJARファイルの検証失敗など(限定されません)、\fIjarsigner\fRコマンドの失敗理由。 .PP failure .RS 4 -1̾ޤϸڤԤޤ +コード1。署名または検証が失敗します。 .RE -.SS "ʷٹ" +.SS "重大な警告" .PP -\fB:\fR -\fI\-strict\fRץꤷ硢ʷٹϥ顼Ȥ𤵤ޤ +\fB注意:\fR +\fI\-strict\fRオプションを指定した場合、重大な警告はエラーとして報告されます。 .PP -JARեν̾˻Ѥ˥顼롢ޤϽ̾դJARե¾꤬ʤɡ\fIjarsigner\fRޥɤʷٹȯԤͳ +JARファイルの署名に使用する証明書にエラーがある、または署名付きJARファイルに他の問題があるなど、\fIjarsigner\fRコマンドが重大な警告を発行する理由。 .PP hasExpiredCert .RS 4 -4jarˤϡ̾Ծ񤬴ڤΥȥ꤬ޤޤƤޤ +コード4。このjarには、署名者証明書が期限切れのエントリが含まれています。 .RE .PP notYetValidCert .RS 4 -4jarˤϡ̾Ծ񤬤ޤͭˤʤäƤʤȥ꤬ޤޤƤޤ +コード4。このjarには、署名者証明書がまだ有効になっていないエントリが含まれています。 .RE .PP chainNotValidated .RS 4 -4jarˤϡڤǤʤȥ꤬ޤޤƤޤ +コード4。このjarには、証明書チェーンが正しく検証できないエントリが含まれています。 .RE .PP badKeyUsage .RS 4 -8JARˤϡ̾ԾKeyUsageĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このJARには、署名者証明書のKeyUsage拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP badExtendedKeyUsage .RS 4 -8jarˤϡ̾ԾExtendedKeyUsageĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このjarには、署名者証明書のExtendedKeyUsage拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP badNetscapeCertType .RS 4 -8jarˤϡ̾ԾNetscapeCertTypeĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このjarには、署名者証明書のNetscapeCertType拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP hasUnsignedEntry .RS 4 -16jarˤϡå򤷤Ƥʤ̤̾Υȥ꤬ޤޤƤޤ +コード16。このjarには、整合性チェックをしていない未署名のエントリが含まれています。 .RE .PP notSignedByAlias .RS 4 -32jarˤϡꤵ줿̾ˤäƽ̾Ƥʤ̾ѥȥ꤬ޤޤƤޤ +コード32。このjarには、指定された別名によって署名されていない署名済エントリが含まれています。 .RE .PP aliasNotInStore .RS 4 -32jarˤϡΥȥ̾ˤäƽ̾Ƥʤ̾ѥȥ꤬ޤޤޤ +コード32。このjarには、このキーストア内の別名によって署名されていない署名済エントリが含まれます。 .RE -.SS "ٹ" +.SS "情報警告" .PP -ٹˤϡ顼ǤϤʤŬڤȤߤʤΤޤޤޤɤϤޤ +情報警告には、エラーではないが不適切とみなされるものが含まれます。コードはありません。 .PP hasExpiringCert .RS 4 -jarˤϡ̾Ծ6˴ڤȤʤ륨ȥ꤬ޤޤƤޤ +このjarには、署名者証明書が6か月以内に期限切れとなるエントリが含まれています。 .RE .PP noTimestamp .RS 4 -jarˤϡॹפޤޤʤ̾ޤޤƤޤॹפʤǤϡ̾Ծͭ(\fIYYYY\-MM\-DD\fR)ޤϾμ塢桼ϤJARե򸡾ڤǤʤ礬ޤ +このjarには、タイムスタンプを含まない署名が含まれています。タイムスタンプなしでは、署名者証明書の有効期限(\fIYYYY\-MM\-DD\fR)後または将来の取消日後、ユーザーはこのJARファイルを検証できない場合があります。 .RE -.SH "" -.SS "JARեν̾" +.SH "例" +.SS "JARファイルの署名" .PP -ΥޥɤѤơȥ̾\fIworking\fRǥ쥯ȥ\fImystore\fRȤ̾Υȥˤ\fIjane\fRǤ桼̩bundle\&.jar˽̾̾դJARե\fIsbundle\&.jar\fRȤ̾դޤ +次のコマンドを使用して、キーストア別名が\fIworking\fRディレクトリの\fImystore\fRという名前のキーストアにある\fIjane\fRであるユーザーの秘密鍵でbundle\&.jarに署名し、署名付きJARファイルに\fIsbundle\&.jar\fRという名前を付けます。 .sp .if n \{\ .RS 4 @@ -925,9 +925,9 @@ jarsigner \-keystore /working/mystore .RE .\} .PP -ҤΥޥɤǤ\fI\-sigfile\fRꤵƤʤᡢ̾դJARե˳Ǽ줿\fI\&.SF\fRե뤪\fI\&.DSA\fRե̾ϡ̾˴ŤǥեȤ̾ˤʤޤϡ̾դ\fIJANE\&.SF\fR\fIJANE\&.DSA\fRǤ +前述のコマンドでは\fI\-sigfile\fRが指定されていないため、署名付きJARファイルに格納される生成された\fI\&.SF\fRファイルおよび\fI\&.DSA\fRファイルの名前は、別名に基づいたデフォルトの名前になります。これらは、名前付きの\fIJANE\&.SF\fRおよび\fIJANE\&.DSA\fRです。 .PP -ȥΥѥɤ̩Υѥɤ硢ҤΥޥɤṳ̂ơΤȤ¹ԤǤޤ +ストアのパスワードおよび秘密鍵のパスワードを求められる場合、前述のコマンドを短縮して、次のことを実行できます。 .sp .if n \{\ .RS 4 @@ -940,7 +940,7 @@ jarsigner \-keystore /working/mystore .RE .\} .PP -ȥǥեȤΥȥ(ۡࡦǥ쥯ȥ\&.keystore)Ǥ硢˼褦ˡȥꤹɬפޤ +キーストアがデフォルトのキーストア(ホーム・ディレクトリ内の\&.keystore)である場合、次に示すように、キーストアを指定する必要がありません。 .sp .if n \{\ .RS 4 @@ -952,7 +952,7 @@ jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane .RE .\} .PP -JARե(bundle\&.jar)̾դJARեǾ񤭤硢Τ褦\fI\-signedjar\fRץꤹɬפϤޤ +入力JARファイル(bundle\&.jar)を署名付きJARファイルで上書きする場合、次のように\fI\-signedjar\fRオプションを指定する必要はありません。 .sp .if n \{\ .RS 4 @@ -963,9 +963,9 @@ jarsigner bundle\&.jar jane .if n \{\ .RE .\} -.SS "̾դJARեθ" +.SS "署名付きJARファイルの検証" .PP -̾դJARե򸡾ڤơ̾ͭJARե뤬󤵤ʤäȤǧˤϡΤ褦ʥޥɤѤޤ +署名付きJARファイルを検証して、署名が有効でJARファイルが改ざんされなかったことを確認するには、次のようなコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -977,7 +977,7 @@ jarsigner \-verify sbundle\&.jar .RE .\} .PP -ڤȡ\fIjar verified\fRɽޤǤʤϡ顼åɽޤ\fI\-verbose\fRץѤȡܺپǤޤ\fIjarsigner\fR\fI\-verbose\fRץȤȤ˻Ѥ륵ץ򡢼˼ޤ +検証が成功すると、\fIjar verified\fRが表示されます。そうでない場合は、エラー・メッセージが表示されます。\fI\-verbose\fRオプションを使用すると、詳細情報を取得できます。\fIjarsigner\fRを\fI\-verbose\fRオプションとともに使用するサンプルを、次に示します。 .sp .if n \{\ .RS 4 @@ -1000,9 +1000,9 @@ jarsigner \-verify \-verbose sbundle\&.jar .if n \{\ .RE .\} -.SS "Ѥ" +.SS "証明書情報を使用した検証" .PP -\fI\-certs\fRץ\fI\-verify\fR\fI\-verbose\fRץȤȤ˻ꤷ硢JARեγƽ̾Ԥξ󤬽Ϥ˴ޤޤޤξˤϡ񥿥ס̾Ԥμ̾(X\&.509ξ)ޤޤ졢ݥåˤϡJARեθ񤬥ȥȥθ˰פν̾ԤΥȥ̾ޤޤޤȤСΤ褦ˤʤޤ +\fI\-certs\fRオプションを\fI\-verify\fRおよび\fI\-verbose\fRオプションとともに指定した場合、JARファイルの各署名者の証明書情報が出力に含まれます。この情報には、証明書タイプ、署名者の識別名情報(X\&.509証明書の場合)が含まれ、丸カッコ内には、JARファイルの公開鍵証明書がキーストア・エントリの公開鍵証明書に一致する場合の署名者のキーストア別名が含まれます。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1030,8 +1030,8 @@ jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar .RE .\} .PP -̾ԤξX\&.509ǤϤʤ硢̾ɽޤ󡣤ξˤϡΥפ̾ΤߤɽޤȤСPGPǡ̾\fIbob\fRǤ硢\fIPGP, (bob)\fRޤ -.SH "Ϣ" +署名者の証明書がX\&.509証明書ではない場合、識別名情報は表示されません。その場合には、証明書のタイプと別名のみが表示されます。たとえば、証明書がPGP証明書で、別名が\fIbob\fRである場合、\fIPGP, (bob)\fRを取得します。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -1063,8 +1063,8 @@ keytool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlˤ -֥: Java SEΥƥǽ +http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlにある +「コース: Java SEのセキュリティ機能」 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/java.1 b/jdk/src/linux/doc/man/ja/java.1 index f134a028e6c..15e9bb78246 100644 --- a/jdk/src/linux/doc/man/ja/java.1 +++ b/jdk/src/linux/doc/man/ja/java.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: java .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "java" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "java" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -java \- Javaץꥱưޤ -.SH "" +java \- Javaアプリケーションを起動します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,26 +74,26 @@ java \- Java .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassname\fR .RS 4 -ư륯饹̾ +起動するクラスの名前。 .RE .PP \fIfilename\fR .RS 4 -ƤӽФJava(JAR)ե̾\fI\-jar\fRץȰˤΤ߻Ѥޤ +呼び出されるJavaアーカイブ(JAR)ファイルの名前。\fI\-jar\fRオプションと一緒にのみ使用します。 .RE .PP \fIargs\fR .RS 4 -Ƕڤ줿\fImain()\fR᥽åɤϤ +空白で区切られた\fImain()\fRメソッドに渡される引数。 .RE -.SH "" +.SH "説明" .PP -\fIjava\fRޥɤJavaץꥱ򳫻ϤޤJava Runtime Environment (JRE)ư塢ꤷ饹ɤΥ饹\fImain()\fR᥽åɤƤӽФȤˤꡢԤޤΥ᥽åɤϡ\fIpublic\fR\fIstatic\fRȤɬפޤޤ֤ͤޤ󡣤ˡ\fIString\fRѥ᡼ȤƻǤɬפޤ᥽åϼηޤߤޤ +\fIjava\fRコマンドはJavaアプリケーションを開始します。Java Runtime Environment (JRE)を起動した後、指定したクラスをロードし、そのクラスの\fImain()\fRメソッドを呼び出すことにより、これを行います。このメソッドは、\fIpublic\fRおよび\fIstatic\fRとして宣言する必要があります。また、値は返せません。さらに、\fIString\fR配列をパラメータとして指定できる必要があります。メソッド宣言は次の形式を含みます。 .sp .if n \{\ .RS 4 @@ -105,16 +105,16 @@ public static void main(String[] args) .RE .\} .PP -\fIjava\fRޥɤѤơ\fImain()\fR᥽åɤ뤫\fIjavafx\&.application\&.Application\fRĥ륯饹ɤ뤳ȤǡJavaFXץꥱưǤޤԤξ硢ưġ\fIApplication\fR饹Υ󥹥󥹤\fIinit()\fR᥽åɤ򥳡뤷\fIstart(javafx\&.stage\&.Stage)\fR᥽åɤ򥳡뤷ޤ +\fIjava\fRコマンドを使用して、\fImain()\fRメソッドがあるか\fIjavafx\&.application\&.Application\fRを拡張するクラスをロードすることで、JavaFXアプリケーションを起動できます。後者の場合、起動ツールは\fIApplication\fRクラスのインスタンスを構成し、その\fIinit()\fRメソッドをコールし、\fIstart(javafx\&.stage\&.Stage)\fRメソッドをコールします。 .PP -ǥեȤǤϡ\fIjava\fRޥɤΥץǤϤʤǽΰϡƤӽФ륯饹δ̾Ǥ\fI\-jar\fRץꤷ硢ΰϡץꥱΥ饹եȥ꥽եޤJARե̾ˤʤޤư饹ϡɤ\fIMain\-Class\fRޥ˥եȡإåˤäƻꤵɬפޤ +デフォルトでは、\fIjava\fRコマンドのオプションではない最初の引数は、呼び出されるクラスの完全修飾名です。\fI\-jar\fRオプションを指定した場合、その引数は、アプリケーションのクラス・ファイルとリソース・ファイルを含むJARファイルの名前になります。起動クラスは、ソース・コードの\fIMain\-Class\fRマニフェスト・ヘッダーによって指定される必要があります。 .PP -JREϡ֡ȥȥåס饹ѥ󥹥ȡѳĥǽӥ桼Υ饹ѥ3ս꤫顢ư饹(ӥץꥱǻѤƤ¾Υ饹)򸡺ޤ +JREは、ブートストラップ・クラス・パス、インストール済拡張機能およびユーザーのクラス・パスの3箇所から、起動クラス(およびアプリケーションで使用されている他のクラス)を検索します。 .PP -饹ե̾ޤJARե̾θΰϡ\fImain()\fR᥽åɤϤޤ -.SH "ץ" +クラス・ファイル名またはJARファイル名の後の引数は、\fImain()\fRメソッドに渡されます。 +.SH "オプション" .PP -\fIjava\fRޥɤϡΥƥʬǤ빭Ϥʥץ򥵥ݡȤƤޤ +\fIjava\fRコマンドは、次のカテゴリに分類できる広範なオプションをサポートしています。 .sp .RS 4 .ie n \{\ @@ -124,7 +124,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ +標準オプション .RE .sp .RS 4 @@ -135,7 +135,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ +非標準オプション .RE .sp .RS 4 @@ -146,7 +146,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥ󥿥ࡦץ +高度なランタイム・オプション .RE .sp .RS 4 @@ -157,7 +157,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤JITѥ顦ץ +高度なJITコンパイラ・オプション .RE .sp .RS 4 @@ -168,7 +168,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥӥӥƥץ +高度なサービスアビリティ・オプション .RE .sp .RS 4 @@ -179,31 +179,31 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥ١쥯󡦥ץ +高度なガベージ・コレクション・オプション .RE .PP -ɸΥץϡJava Virtual Machine (JVM)Τ٤ƤμǥݡȤ뤳ȤݾڤޤϡJREΥСγǧ饹ѥꡢĹʽϤͭʤɤΰŪʥ˻Ѥޤ +標準のオプションは、Java Virtual Machine (JVM)のすべての実装でサポートすることが保証されます。これらは、JREのバージョンの確認、クラス・パスの設定、冗長な出力の有効化などの一般的なアクションに使用されます。 .PP -ɸʳΥץϡJava HotSpotۥޥ˸ͭѥץǤ뤿ᡢ٤ƤJVMǥݡȤ뤳Ȥݾڤ줺ѹǽޤΥץ\fI\-X\fRdzϤޤ +標準以外のオプションは、Java HotSpot仮想マシンに固有の汎用オプションであるため、すべてのJVM実装でサポートされることは保証されず、変更される可能性があります。これらのオプションは\fI\-X\fRで開始します。 .PP -ĥץϡѰդ˻ѤʤȤᤷޤϡΥƥ׷ĤȤ¿ƥ๽ѥ᡼ؤøɬפʾ礬Java HotSpotۥޥΰĴ뤿˻Ѥ볫ȯԥץǤϡ٤ƤJVMǥݡȤ뤳Ȥݾڤ줺ѹǽޤĥץ\fI\-XX\fRǻϤޤޤ +拡張オプションは、不用意に使用しないことをお薦めします。これらは、特定のシステム要件を持つことが多く、システム構成パラメータへの特権アクセスが必要な場合があるJava HotSpot仮想マシン操作の特定の領域を調整するために使用される開発者オプションです。これらは、すべてのJVM実装でサポートされることは保証されず、変更される可能性があります。拡張オプションは\fI\-XX\fRで始まります。 .PP -ǿ꡼侩ޤϺ륪ץפ뤿ˡɥȤκǸ侩Ǻ줿ץȤ̾Υ󤬤ޤ +最新リリースで非推奨または削除されるオプションを追跡するために、ドキュメントの最後に非推奨で削除されたオプションという名前のセクションがあります。 .PP -֡롦ץϡǥեȤ̵ˤʤäƤ뵡ǽͭˤꡢǥեȤͭˤʤäƤ뵡ǽ̵ˤ뤿˻ѤޤΤ褦ʥץϡѥ᡼ɬפȤޤ󡣥֡\fI\-XX\fRץϡץ饹(\fI\-XX:+\fR\fIOptionName\fR)Ѥͭˤޥʥ(\fI\-XX:\-\fR\fIOptionName\fR)Ѥ̵ˤޤ +ブール・オプションは、デフォルトで無効になっている機能を有効にしたり、デフォルトで有効になっている機能を無効にするために使用されます。このようなオプションは、パラメータを必要としません。ブール値\fI\-XX\fRオプションは、プラス記号(\fI\-XX:+\fR\fIOptionName\fR)を使用して有効にし、マイナス記号(\fI\-XX:\-\fR\fIOptionName\fR)を使用して無効にします。 .PP -ɬפʥץξ硢ϡץ̾򡢥(:)ޤ(=)ǶڤäΤˤʤ뤫뤤ϰץθľ³⤢ޤ(Τʹʸϳƥץˤäưۤʤޤ)Хñ̤ǻꤹ褦Ƥ硢Ѥʤ뤤ϥХ(KB)ˤ\fIk\fRޤ\fIK\fRᥬХ(MB)ˤ\fIm\fRޤ\fIM\fRХ(GB)ˤ\fIg\fRޤ\fIG\fRѤޤȤС8GBꤹˤϡ\fI8g\fR\fI8192m\fR\fI8388608k\fRޤ\fI8589934592\fRΤ줫ȤƻǤޤѡȤλ꤬ɬפʾϡ01οͤѤޤ(ȤС25%ξ\fI0\&.25\fRꤷޤ) -.SS "ɸ४ץ" +引数が必要なオプションの場合、引数は、オプション名を空白、コロン(:)または等号(=)で区切ったものになるか、あるいは引数がオプションの後に直接続く場合もあります(正確な構文は各オプションによって異なります)。サイズをバイト単位で指定するよう求められている場合、接尾辞を使用しないか、あるいはキロバイト(KB)には接尾辞\fIk\fRまたは\fIK\fR、メガバイト(MB)には接尾辞\fIm\fRまたは\fIM\fR、ギガバイト(GB)には接尾辞\fIg\fRまたは\fIG\fRを使用します。たとえば、サイズを8GBに設定するには、\fI8g\fR、\fI8192m\fR、\fI8388608k\fRまたは\fI8589934592\fRのいずれかを引数として指定できます。パーセントの指定が必要な場合は、0から1の数値を使用します(たとえば、25%の場合は\fI0\&.25\fRを指定します)。 +.SS "標準オプション" .PP -ϡJVMΤ٤ƤμǥݡȤǤŪ˻Ѥ륪ץǤ +これらは、JVMのすべての実装でサポートされる最も一般的に使用されるオプションです。 .PP \-agentlib:\fIlibname\fR[=\fIoptions\fR] .RS 4 -ꤷͥƥ֡ȡ饤֥ɤޤ饤֥̾θˡ饤֥˸ͭΥץΥ޶ڤꥹȤѤǤޤ +指定したネイティブ・エージェント・ライブラリをロードします。ライブラリ名の後に、ライブラリに固有のオプションのカンマ区切りリストを使用できます。 .sp -ץ\fI\-agentlib:foo\fRꤷ硢JVMϡ\fILD_LIBRARY_PATH\fRƥѿ(OS XǤϡѿ\fIDYLD_LIBRARY_PATH\fRˤʤޤ)ǻꤵ줿\fIlibfoo\&.so\fRȤ̾Υ饤֥ɤ褦Ȥޤ +オプション\fI\-agentlib:foo\fRを指定した場合、JVMは、\fILD_LIBRARY_PATH\fRシステム変数(OS Xでは、この変数は\fIDYLD_LIBRARY_PATH\fRになります)で指定された場所に\fIlibfoo\&.so\fRという名前のライブラリをロードしようとします。 .sp -Ǥϡåο3ǡ20ߥäȤ˥ҡסץե󥰡ġ(HPROF)饤֥ɤơץCPUˡ򼨤ޤ +次の例では、スタックの深さ3で、20ミリ秒ごとにヒープ・プロファイリング・ツール(HPROF)ライブラリをロードして、サンプルのCPU情報を取得する方法を示します。 .sp .if n \{\ .RS 4 @@ -214,7 +214,7 @@ JRE .if n \{\ .RE .\} -Ǥϡᥤ󡦥饹ΥJVMߤơJavaǥХå磻䡦ץȥ(JDWP)饤֥ɤơݡ8000ǤΥå³Ѥ˥ꥹ˥󥰤ˡ򼨤ޤ +次の例では、メイン・クラスのロード前にJVMを一時停止して、Javaデバッグ・ワイヤ・プロトコル(JDWP)ライブラリをロードして、ポート8000でのソケット接続用にリスニングする方法を示します。 .sp .if n \{\ .RS 4 @@ -225,7 +225,7 @@ JRE .if n \{\ .RE .\} -ͥƥ֡ȡ饤֥ξܺ٤ϡ򻲾ȤƤ +ネイティブ・エージェント・ライブラリの詳細は、次を参照してください。 .sp .RS 4 .ie n \{\ @@ -235,7 +235,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlˤ\fIjava\&.lang\&.instrument\fRѥå +http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlにある\fIjava\&.lang\&.instrument\fRパッケージの説明 .RE .sp .RS 4 @@ -246,54 +246,54 @@ http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summa .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#startingˤJVMġ롦󥿥եɤΥȤΥޥɥ饤󡦥ץ˴ؤ +http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#startingにあるJVMツール・インタフェース・ガイドのエージェントのコマンドライン・オプションに関する項 .RE .RE .PP \-agentpath:\fIpathname\fR[=\fIoptions\fR] .RS 4 -Хѥ̾ǻꤵ줿ͥƥ֡ȡ饤֥ɤޤΥץ\fI\-agentlib\fRƱǤ饤֥Υե롦ѥӥե̾Ѥޤ +絶対パス名で指定されたネイティブ・エージェント・ライブラリをロードします。このオプションは\fI\-agentlib\fRと同等ですが、ライブラリのフル・パスおよびファイル名を使用します。 .RE .PP \-client .RS 4 -Java HotSpot Client VM򤷤ޤ64ӥåȡСJava SE Development Kit (JDK)ǤϡߡΥץ̵뤵졢Server JVMѤޤ +Java HotSpot Client VMを選択します。64ビット・バージョンのJava SE Development Kit (JDK)では、現在、このオプションは無視され、かわりにServer JVMが使用されます。 .sp -ǥեȤJVMϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlˤ -С饹ޥθФ򻲾ȤƤ +デフォルトのJVM選択は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlにある +サーバークラス・マシンの検出を参照してください。 .RE .PP \-D\fIproperty\fR=\fIvalue\fR .RS 4 -ƥࡦץѥƥͤꤷޤ\fIproperty\fRѿϡץѥƥ̾ɽΤʤʸǤ\fIvalue\fRѿϡץѥƥͤɽʸǤ\fIvalue\fRޤʸξ硢ǰϤߤޤ(: -\fI\-Dfoo="foo bar"\fR) +システム・プロパティの値を設定します。\fIproperty\fR変数は、プロパティの名前を表す、空白のない文字列です。\fIvalue\fR変数は、プロパティの値を表す文字列です。\fIvalue\fRが空白を含む文字列の場合、それを引用符で囲みます(例: +\fI\-Dfoo="foo bar"\fR)。 .RE .PP \-d32 .RS 4 -ץꥱ32ӥåȴĶǼ¹Ԥޤ32ӥåȴĶ󥹥ȡ뤵ƤʤݡȤƤʤϡ顼𤵤ޤǥեȤǤϡ64ӥåȡƥबѤƤץꥱ32ӥåȴĶǼ¹Ԥޤ +アプリケーションを32ビット環境で実行します。32ビット環境がインストールされていないかサポートされていない場合は、エラーが報告されます。デフォルトでは、64ビット・システムが使用されている場合を除き、アプリケーションは32ビット環境で実行されます。 .RE .PP \-d64 .RS 4 -ץꥱ64ӥåȴĶǼ¹Ԥޤ64ӥåȴĶ󥹥ȡ뤵ƤʤݡȤƤʤϡ顼𤵤ޤǥեȤǤϡ64ӥåȡƥबѤƤץꥱ32ӥåȴĶǼ¹Ԥޤ +アプリケーションを64ビット環境で実行します。64ビット環境がインストールされていないかサポートされていない場合は、エラーが報告されます。デフォルトでは、64ビット・システムが使用されている場合を除き、アプリケーションは32ビット環境で実行されます。 .sp -ߤΤȤJava HotSpot Server VMΤߤ64ӥåȤ򥵥ݡȤƤ뤿ᡢ\fI\-d64\fRѻˤ\fI\-server\fRץ󤬰Ū˻Ѥޤ\fI\-d64\fRѻˤϡ\fI\-client\fRץ̵뤵ޤλͤϡΥ꡼Ǥѹˤʤǽޤ +現在のところ、Java HotSpot Server VMのみが64ビットの操作をサポートしているため、\fI\-d64\fR使用時には\fI\-server\fRオプションが暗黙的に使用されます。\fI\-d64\fR使用時には、\fI\-client\fRオプションは無視されます。この仕様は、将来のリリースでは変更になる可能性があります。 .RE .PP \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR] .RS 4 -̵ˤޤǥեȤǤϡϤ٤ƤΥѥåӥ饹̵ˤʤäƤޤ +アサーションを無効にします。デフォルトでは、アサーションはすべてのパッケージおよびクラスで無効になっています。 .sp -ʤ\fI\-disableassertions\fR -(\fI\-da\fR)ꤹȡ٤ƤΥѥåӥ饹ǥ̵ˤʤޤ\fI\&.\&.\&.\fRǽ\fIpackagename\fRꤹȡꤷѥåȤΥ֥ѥåǥ̵ˤʤޤȤ\fI\&.\&.\&.\fRΤߤꤹȡߤκȥǥ쥯ȥˤ̾Τʤѥåǥ̵ˤʤޤ\fIclassname\fRꤹȡؤˤäơꤷ饹ǥ̵ˤʤޤ +引数なしの\fI\-disableassertions\fR +(\fI\-da\fR)を指定すると、すべてのパッケージおよびクラスでアサーションが無効になります。\fI\&.\&.\&.\fRで終わる\fIpackagename\fR引数を指定すると、指定したパッケージとそのサブパッケージ内でアサーションが無効になります。引数として\fI\&.\&.\&.\fRのみを指定すると、現在の作業ディレクトリにある名前のないパッケージ内でアサーションが無効になります。\fIclassname\fR引数を指定すると、切替えによって、指定したクラス内でアサーションが無効になります。 .sp \fI\-disableassertions\fR -(\fI\-da\fR)ץϡ٤ƤΥ饹ӥƥࡦ饹ŬѤޤ(ƥࡦ饹ˤϥ饹Ϥޤ)Υ롼ˤ1㳰ޤץΰꤵƤʤϡƥࡦ饹ŬѤޤ󡣤ˤꡢƥࡦ饹٤ƤΥ饹ǥñ̵ˤ뤳ȤǤޤ\fI\-disablesystemassertions\fRץѤȡ٤ƤΥƥࡦ饹ǥ̵ˤ뤳ȤǤޤ +(\fI\-da\fR)オプションは、すべてのクラス・ローダーおよびシステム・クラスに適用されます(システム・クラスにはクラス・ローダーはありません)。このルールには1つ例外があります。オプションの引数が指定されていない場合は、システム・クラスに適用されません。これにより、システム・クラスを除くすべてのクラスでアサーションを簡単に無効にすることができます。\fI\-disablesystemassertions\fRオプションを使用すると、すべてのシステム・クラスでアサーションを無効にすることができます。 .sp -Υѥå䥯饹ǥŪͭˤˤϡ\fI\-enableassertions\fR -(\fI\-ea\fR)ץѤޤξΥץƱ˻ѤǤޤȤСѥå\fIcom\&.wombat\&.fruitbat\fR -(ӤΥ֥ѥå)Ǥϥͭˤơ饹\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRǤϥ̵ˤơ\fIMyClass\fRץꥱ¹ԤˤϡΥޥɤѤޤ +特定のパッケージやクラスでアサーションを明示的に有効にするには、\fI\-enableassertions\fR +(\fI\-ea\fR)オプションを使用します。両方のオプションを同時に使用できます。たとえば、パッケージ\fIcom\&.wombat\&.fruitbat\fR +(およびそのサブパッケージ)ではアサーションを有効にして、クラス\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRではアサーションを無効にして、\fIMyClass\fRアプリケーションを実行するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -308,22 +308,22 @@ java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickb .PP \-disablesystemassertions, \-dsa .RS 4 -٤ƤΥƥࡦ饹ǥ̵ˤޤ +すべてのシステム・クラス内でアサーションを無効にします。 .RE .PP \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR] .RS 4 -ͭˤޤǥեȤǤϡϤ٤ƤΥѥåӥ饹̵ˤʤäƤޤ +アサーションを有効にします。デフォルトでは、アサーションはすべてのパッケージおよびクラスで無効になっています。 .sp -ʤ\fI\-enableassertions\fR -(\fI\-ea\fR)ꤹȡ٤ƤΥѥåӥ饹ǥͭˤʤޤ\fI\&.\&.\&.\fRǽ\fIpackagename\fRꤹȡꤷѥåȤΥ֥ѥåǥͭˤʤޤȤ\fI\&.\&.\&.\fRΤߤꤹȡߤκȥǥ쥯ȥˤ̾Τʤѥåǥͭˤʤޤ\fIclassname\fRꤹȡؤˤäơꤷ饹ǥͭˤʤޤ +引数なしの\fI\-enableassertions\fR +(\fI\-ea\fR)を指定すると、すべてのパッケージおよびクラスでアサーションが有効になります。\fI\&.\&.\&.\fRで終わる\fIpackagename\fR引数を指定すると、指定したパッケージとそのサブパッケージ内でアサーションが有効になります。引数として\fI\&.\&.\&.\fRのみを指定すると、現在の作業ディレクトリにある名前のないパッケージ内でアサーションが有効になります。\fIclassname\fR引数を指定すると、切替えによって、指定したクラス内でアサーションが有効になります。 .sp \fI\-enableassertions\fR -(\fI\-ea\fR)ץϡ٤ƤΥ饹ӥƥࡦ饹ŬѤޤ(ƥࡦ饹ˤϥ饹Ϥޤ)Υ롼ˤ1㳰ޤץΰꤵƤʤϡƥࡦ饹ŬѤޤ󡣤ˤꡢƥࡦ饹٤ƤΥ饹ǥñͭˤ뤳ȤǤޤ\fI\-enablesystemassertions\fRץϡ٤ƤΥƥࡦ饹ǥͭˤ̤Υå󶡤ޤ +(\fI\-ea\fR)オプションは、すべてのクラス・ローダーおよびシステム・クラスに適用されます(システム・クラスにはクラス・ローダーはありません)。このルールには1つ例外があります。オプションの引数が指定されていない場合は、システム・クラスに適用されません。これにより、システム・クラスを除くすべてのクラスでアサーションを簡単に有効にすることができます。\fI\-enablesystemassertions\fRオプションは、すべてのシステム・クラスでアサーションを有効にする別のスイッチを提供します。 .sp -Υѥå䥯饹ǥŪ̵ˤˤϡ\fI\-disableassertions\fR -(\fI\-da\fR)ץѤޤñ쥳ޥɤˤΥåΥ󥹥󥹤ʣꤷϡꤷå֤˽Ƥ饯饹ɤޤȤСѥå\fIcom\&.wombat\&.fruitbat\fR -(ӤΥ֥ѥå)ǤΤߥͭˤơ饹\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRǤϥ̵ˤơ\fIMyClass\fRץꥱ¹ԤˤϡΥޥɤѤޤ +特定のパッケージやクラスでアサーションを明示的に無効にするには、\fI\-disableassertions\fR +(\fI\-da\fR)オプションを使用します。単一コマンドにこれらのスイッチのインスタンスを複数指定した場合は、指定したスイッチが順番に処理されてからクラスがロードされます。たとえば、パッケージ\fIcom\&.wombat\&.fruitbat\fR +(およびそのサブパッケージ)でのみアサーションを有効にして、クラス\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRではアサーションを無効にして、\fIMyClass\fRアプリケーションを実行するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -338,21 +338,21 @@ java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickb .PP \-enablesystemassertions, \-esa .RS 4 -٤ƤΥƥࡦ饹ǥͭˤޤ +すべてのシステム・クラス内でアサーションを有効にします。 .RE .PP \-help, \-? .RS 4 -ºݤJVM¹Ԥˡ\fIjava\fRޥɤλѾɽޤ +実際にJVMを実行せずに、\fIjava\fRコマンドの使用状況情報を表示します。 .RE .PP \-jar \fIfilename\fR .RS 4 -JARե˥ץ벽줿ץ¹Ԥޤ\fIfilename\fRϡѤ륢ץꥱγȤƵǽ\fIpublic static void main(String[] args)\fR᥽åɤ롢\fIMain\-Class:\fR\fIclassname\fRȤ1Ԥޤޥ˥եȤJARե̾Ǥ +JARファイルにカプセル化されたプログラムを実行します。\fIfilename\fR引数は、使用するアプリケーションの開始点として機能する\fIpublic static void main(String[] args)\fRメソッドを定義する、\fIMain\-Class:\fR\fIclassname\fRという形式の1行を含むマニフェストを持つJARファイルの名前です。 .sp -\fI\-jar\fRץѤȡꤷJARե뤬٤ƤΥ桼饹Υˤʤꡢ饹ѥ¾̵뤵ޤ +\fI\-jar\fRオプションを使用すると、指定したJARファイルがすべてのユーザー・クラスのソースになり、クラス・パスの他の設定は無視されます。 .sp -JARեξܺ٤ϡΥ꥽򻲾ȤƤ +JARファイルの詳細は、次のリソースを参照してください。 .sp .RS 4 .ie n \{\ @@ -373,7 +373,7 @@ jar(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.htmlˤJava(JAR)եΥ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.htmlにあるJavaアーカイブ(JAR)ファイルのガイド .RE .sp .RS 4 @@ -384,42 +384,42 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -֥å: JARեΥץΥѥå +http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +「レッスン: JARファイルのプログラムのパッケージ化」 .RE .RE .PP \-javaagent:\fIjarpath\fR[=\fIoptions\fR] .RS 4 -ꤷJavaץߥ󥰸쥨ȤɤޤJavaץꥱΥ󥹥ȥȤξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlˤJava APIɥȤ\fIjava\&.lang\&.instrument\fRѥå򻲾ȤƤ +指定したJavaプログラミング言語エージェントをロードします。Javaアプリケーションのインストゥルメントの詳細は、http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlにあるJava APIドキュメントの\fIjava\&.lang\&.instrument\fRパッケージの説明を参照してください。 .RE .PP \-jre\-restrict\-search .RS 4 -桼ץ饤١ȤJREС󸡺˴ޤޤ +ユーザー・プライベートなJREをバージョン検索に含めます。 .RE .PP \-no\-jre\-restrict\-search .RS 4 -桼ץ饤١ȤJREС󸡺ޤ +ユーザー・プライベートなJREをバージョン検索から除外します。 .RE .PP \-server .RS 4 -Java HotSpot Server VM򤷤ޤ64ӥåȡСJDKǤϡServer VMΤߤ򥵥ݡȤƤ뤿ᡢξ硢ΥץϰŪǤ +Java HotSpot Server VMを選択します。64ビット・バージョンのJDKでは、Server VMのみをサポートしているため、その場合、このオプションは暗黙的です。 .sp -ǥեȤJVMϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlˤ -С饹ޥθФ򻲾ȤƤ +デフォルトのJVM選択は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlにある +サーバークラス・マシンの検出を参照してください。 .RE .PP \-showversion .RS 4 -Сɽץꥱμ¹Ԥ³ԤޤΥץ\fI\-version\fRץƱǤ\-versionϥСɽJVM˽λؼۤʤޤ +バージョン情報を表示し、アプリケーションの実行を続行します。このオプションは\fI\-version\fRオプションと同等ですが、\-versionはバージョン情報の表示後にJVMに終了を指示する点が異なります。 .RE .PP \-splash:\fIimgname\fR .RS 4 -\fIimgname\fRǻꤵ줿᡼ޤॹץå̤ɽޤȤСץꥱεư\fIimages\fRǥ쥯ȥ\fIsplash\&.gif\fRեɽˤϡΥץѤޤ +\fIimgname\fRで指定されたイメージを含むスプラッシュ画面を表示します。たとえば、アプリケーションの起動時に\fIimages\fRディレクトリの\fIsplash\&.gif\fRファイルを表示するには、次のオプションを使用します。 .sp .if n \{\ .RS 4 @@ -434,31 +434,31 @@ Java HotSpot Server VM .PP \-verbose:class .RS 4 -ɤ줿ƥ饹˴ؤɽޤ +ロードされた各クラスに関する情報を表示します。 .RE .PP \-verbose:gc .RS 4 -ƥ١쥯(GC)٥Ȥ˴ؤɽޤ +各ガベージ・コレクション(GC)イベントに関する情報を表示します。 .RE .PP \-verbose:jni .RS 4 -ͥƥ֡᥽åɤλѤӤ¾Java Native Interface (JNI)ƥӥƥ˴ؤɽޤ +ネイティブ・メソッドの使用およびその他のJava Native Interface (JNI)アクティビティに関する情報を表示します。 .RE .PP \-version .RS 4 -СɽƤ齪λޤΥץ\fI\-showversion\fRץƱǤ\-showversionϥСɽJVM˽λؼʤۤʤޤ +バージョン情報を表示してから終了します。このオプションは\fI\-showversion\fRオプションと同等ですが、\-showversionはバージョン情報の表示後にJVMに終了を指示しない点が異なります。 .RE .PP \-version:\fIrelease\fR .RS 4 -ץꥱμ¹Ԥ˻Ѥ꡼Сꤷޤ뤵줿\fIjava\fRޥɤΥС󤬤λƤŬڤʼƥǸĤäˤϡŬڤʼѤޤ +アプリケーションの実行に使用するリリース・バージョンを指定します。コールされた\fIjava\fRコマンドのバージョンがこの指定内容を満たさず、かつ適切な実装がシステム上で見つかった場合には、その適切な実装が使用されます。 .sp -\fIrelease\fRϡΤʥСʸ󡢤ޤ϶Ƕڤ줿СʸȥСϰϤΥꥹȤꤷޤ\fIСʸ\fRϡηǡȯԤΥСֹꤷޤ: +\fIrelease\fR引数は、正確なバージョン文字列、または空白で区切られたバージョン文字列とバージョン範囲のリストを指定します。\fIバージョン文字列\fRは、次の形式で、開発者のバージョン番号を指定します: \fI1\&.\fR\fIx\fR\fI\&.0_\fR\fIu\fR -(\fIx\fRϥ᥸㡼Сֹ桢\fIu\fRϹСֹǤ)\fIСϰ\fRϡΥСʹߤꤹˤϥСʸθ˥ץ饹(\fI+\fR)³ΡޤϰפƬޤǤդΥСʸꤹˤϰΥСʸθ˥ꥹ(\fI*\fR)³Τǹޤ\fIOR\fRȹ礻ˤ϶2ĤΥСʸ/ϰϤ\fIAND\fRȹ礻ˤϥѥ(\fI&\fR)ѤơСʸȥСϰϤȤ߹礻뤳ȤǤޤȤС饹ޤJARեμ¹ԤJRE 6u13 (1\&.6\&.0_13)ޤ6u10 (1\&.6\&.0_10)ʹߤǤդJRE 6Τ줫ɬפȤ硢ꤷޤ +(\fIx\fRはメジャー・バージョン番号、\fIu\fRは更新バージョン番号です)。\fIバージョン範囲\fRは、このバージョン以降を指定するにはバージョン文字列の後にプラス記号(\fI+\fR)を続けたもの、または一致する接頭辞を含む任意のバージョン文字列を指定するには一部のバージョン文字列の後にアスタリスク(\fI*\fR)を続けたもので構成されます。論理\fIOR\fRの組合せには空白、2つのバージョンの文字列/範囲の論理\fIAND\fRの組合せにはアンパサンド(\fI&\fR)を使用して、バージョン文字列とバージョン範囲を組み合せることができます。たとえば、クラスまたはJARファイルの実行にJRE 6u13 (1\&.6\&.0_13)または6u10 (1\&.6\&.0_10)以降の任意のJRE 6のいずれかを必要とする場合、次を指定します。 .sp .if n \{\ .RS 4 @@ -469,99 +469,99 @@ Java HotSpot Server VM .if n \{\ .RE .\} -䤬ɬפʤΤϡ\fIrelease\fRѥ᡼˶򤬤ΤߤǤ +引用符が必要なのは、\fIrelease\fRパラメータに空白がある場合のみです。 .sp -JARեξϡС׷򥳥ޥɥ饤˻ꤹ⡢JARեΥޥ˥ե˻ꤹ뤳Ȥ侩Ƥޤ +JARファイルの場合は、バージョン要件をコマンドラインに指定するよりも、JARファイルのマニフェスト内に指定することが推奨されています。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP -ΥץϡJava HotSpotۥޥ˸ͭѥץǤ +これらのオプションは、Java HotSpot仮想マシンに固有の汎用オプションです。 .PP \-X .RS 4 -Ѳǽʤ٤Ƥ\fI\-X\fRץΥإפɽޤ +使用可能なすべての\fI\-X\fRオプションのヘルプを表示します。 .RE .PP \-Xbatch .RS 4 -Хå饦ɡѥ̵ˤޤǥեȤǤϡJVMǤϡХå饦ɡѥ뤬λޤǡ᥽åɤХå饦ɡȤƥѥ뤷󥿥ץ꥿⡼ɤǥ᥽åɤ¹Ԥޤ\fI\-Xbatch\fRե饰ꤹȡХå饦ɡѥ뤬̵ˤʤꡢ٤ƤΥ᥽åɤΥѥ뤬λޤǥե饦ɡȤƽޤ +バックグラウンド・コンパイルを無効にします。デフォルトでは、JVMでは、バックグラウンド・コンパイルが終了するまで、メソッドをバックグラウンド・タスクとしてコンパイルし、インタプリタ・モードでメソッドを実行します。\fI\-Xbatch\fRフラグを指定すると、バックグラウンド・コンパイルが無効になり、すべてのメソッドのコンパイルが完了するまでフォアグラウンド・タスクとして処理されます。 .sp -Υץ\fI\-XX:\-BackgroundCompilation\fRƱǤ +このオプションは\fI\-XX:\-BackgroundCompilation\fRと同等です。 .RE .PP \-Xbootclasspath:\fIpath\fR .RS 4 -֡ȡ饹ե򸡺ǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤϡJDK˴ޤޤ֡ȡ饹եΤ˻Ѥޤ +ブート・クラス・ファイルを検索するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。これらは、JDKに含まれるブート・クラス・ファイルのかわりに使用されます。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xbootclasspath/a:\fIpath\fR .RS 4 -ǥեȤΥ֡ȥȥåס饹ѥκǸɲäǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤ +デフォルトのブートストラップ・クラス・パスの最後に追加するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xbootclasspath/p:\fIpath\fR .RS 4 -ǥեȤΥ֡ȥȥåס饹ѥƬɲäǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤ +デフォルトのブートストラップ・クラス・パスの先頭に追加するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xboundthreads .RS 4 -桼٥Υåɤ򥫡ͥ롦åɤ˥Хɤޤ +ユーザー・レベルのスレッドをカーネル・スレッドにバインドします。 .RE .PP \-Xcheck:jni .RS 4 -Java Native Interface (JNI)ǽФɲååԤޤŪˤϡϡJNIꥯȤˡJNIؿϤѥ᡼ȼ¹ԴĶΥǡ򸡾ڤޤ̵ʥǡĤäϡͥƥ֡ɤ꤬뤳Ȥ򼨤Ƥ뤿ᡢJVMϥꥫХǽʥ顼ȯƽλޤΥץѤȡѥեޥ㲼ͽۤޤ +Java Native Interface (JNI)機能に対して追加チェックを行います。具体的には、これは、JNIリクエストを処理する前に、JNI関数に渡されるパラメータと実行環境のデータを検証します。無効なデータが見つかった場合は、ネイティブ・コードに問題があることを示しているため、JVMはリカバリ不能なエラーを発生して終了します。このオプションを使用すると、パフォーマンス低下が予想されます。 .RE .PP \-Xcomp .RS 4 -ǽθƽФJavaɤӥѥ롦᥽åɤβ̵ˤޤǥեȤǤϡJITѥϡ10,000βᤵ줿᥽åɸƽФ¹ԤơΨŪʥѥΤξޤΨˤƥѥΥѥեޥ󥹤夵ˤϡ\fI\-Xcomp\fRե饰Ѥơᤵ줿᥽åɸƽФ̵ˤޤ +最初の呼出しでJavaコードおよびコンパイル・メソッドの解釈を無効にします。デフォルトでは、JITコンパイラは、10,000の解釈されたメソッド呼出しを実行して、効率的なコンパイルのための情報を収集します。効率を犠牲にしてコンパイルのパフォーマンスを向上させるには、\fI\-Xcomp\fRフラグを使用して、解釈されたメソッド呼出しを無効にします。 .sp -\fI\-XX:CompileThreshold\fRץѤơѥˡᤵ줿᥽åɸƽФοѹ뤳ȤǤޤ +\fI\-XX:CompileThreshold\fRオプションを使用して、コンパイルの前に、解釈されたメソッド呼出しの数を変更することもできます。 .RE .PP \-Xdebug .RS 4 -Ԥޤ󡣲̸ߴΤѰդƤޤ +何も行いません。下位互換性のために用意されています。 .RE .PP \-Xdiag .RS 4 -ɲäοǥåɽޤ +追加の診断メッセージを表示します。 .RE .PP \-Xfuture .RS 4 -饹եλͤؤν򶯲롢̩ʥ饹եΥåͭˤʤޤΥ꡼Ǥϡ긷̩ʥåǥեȤˤʤ뤿ᡢɤȯȤˤϡȯԤϤΥե饰Ѥ뤳Ȥᤷޤ +クラス・ファイル形式の仕様への準拠を強化する、厳密なクラス・ファイル形式のチェックが有効になります。将来のリリースでは、より厳密なチェックがデフォルトになるため、新しいコードを開発するときには、開発者はこのフラグを使用することをお薦めします。 .RE .PP \-Xincgc .RS 4 -ʬGCͭˤޤ +増分GCを有効にします。 .RE .PP \-Xint .RS 4 -󥿥ץ꥿ѥ⡼ɤǥץꥱ¹Ԥޤͥƥ֡ɤؤΥѥ̵ˤʤꡢ٤ƤΥХȥɤ󥿥ץ꥿ˤäƼ¹Ԥޤ㥹ȡ󡦥(JIT)ѥ餬󶡤ѥեޥ󥹾ϡΥ⡼ɤǤϼ¸ޤ +インタプリタ専用モードでアプリケーションを実行します。ネイティブ・コードへのコンパイルは無効になり、すべてのバイトコードがインタプリタによって実行されます。ジャスト・イン・タイム(JIT)コンパイラが提供するパフォーマンス上の利点は、このモードでは実現されません。 .RE .PP \-Xinternalversion .RS 4 -\fI\-version\fRץܺ٤JVMСɽƤ齪λޤ +\fI\-version\fRオプションより詳細なJVMバージョン情報を表示してから終了します。 .RE .PP \-Xloggc:\fIfilename\fR .RS 4 -ܺ٤GC٥ȾѤ˥쥯ȤեꤷޤΥե˽񤭹ޤϡϿ줿ƥ٥Ȥ˹ԤǽGC٥Ȱʹߤ˷вᤷ֤ꤷ\fI\-verbose:gc\fRνϤƤޤ\fI\-Xloggc\fRץ\fI\-verbose:gc\fR򥪡С饤ɤޤ(ξƱ\fIjava\fRޥɤǻꤵ줿) +詳細なGCイベント情報をロギング用にリダイレクトするファイルを設定します。このファイルに書き込まれる情報は、記録された各イベントの前に行われる最初のGCイベント以降に経過した時間を指定した\fI\-verbose:gc\fRの出力と類似しています。\fI\-Xloggc\fRオプションは\fI\-verbose:gc\fRをオーバーライドします(これらの両方が同じ\fIjava\fRコマンドで指定された場合)。 .sp -: +例: .sp .if n \{\ .RS 4 @@ -576,7 +576,7 @@ Java Native Interface (JNI) .PP \-Xmaxjitcodesize=\fIsize\fR .RS 4 -JITѥ뤵줿ɤκ祳ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡͤ48MBꤵƤޤ +JITコンパイルされたコードの最大コード・キャッシュ・サイズ(バイト単位)を指定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、この値は48MBに設定されています。 .sp .if n \{\ .RS 4 @@ -587,21 +587,21 @@ JIT .if n \{\ .RE .\} -Υץ\fI\-XX:ReservedCodeCacheSize\fRƱǤ +このオプションは\fI\-XX:ReservedCodeCacheSize\fRと同等です。 .RE .PP \-Xmixed .RS 4 -ͥƥ֡ɤ˥ѥ뤵줿ۥåȡ᥽åɤ󥿥ץ꥿ˤäƤ٤ƤΥХȥɤ¹Ԥޤ +ネイティブ・コードにコンパイルされたホット・メソッドを除き、インタプリタによってすべてのバイトコードを実行します。 .RE .PP \-Xmn\fIsize\fR .RS 4 -㤤(ʡ)ΥҡפνӺ祵(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +若い世代(ナーサリ)のヒープの初期サイズおよび最大サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ҡפμ㤤꡼Ͽ֥Ȥ˻ѤޤGCϡ¾Υ꡼ꤳΥ꡼ǡˤ˼¹Ԥޤ㤤Υ硢¿Υޥʡ١쥯󤬼¹Ԥޤ礭硢ե롦١쥯Τߤ¹ԤޤλޤǤ˻֤뤳Ȥޤ㤤ΥϡΤΥҡסȾʬ4ʬ1δ֤ˤƤȤᤷޤ +ヒープの若い世代リージョンは新しいオブジェクトに使用されます。GCは、他のリージョンよりこのリージョンで、より頻繁に実行されます。若い世代のサイズが小さすぎる場合、多数のマイナー・ガベージ・コレクションが実行されます。サイズが大きすぎる場合、フル・ガベージ・コレクションのみが実行されますが、完了までに時間がかかることがあります。若い世代のサイズは、全体のヒープ・サイズの半分から4分の1の間にしておくことをお薦めします。 .sp -Ǥϡ㤤νӺ祵͡ñ̤Ѥ256MBꤹˡ򼨤ޤ +次の例では、若い世代の初期サイズおよび最大サイズを様々な単位を使用して256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -614,14 +614,14 @@ JIT .if n \{\ .RE .\} -㤤ΥҡפνȺ祵ξꤹ\fI\-Xmn\fRץΤˡˤ\fI\-XX:NewSize\fR򡢺祵ˤ\fI\-XX:MaxNewSize\fRѤǤޤ +若い世代のヒープの初期サイズと最大サイズの両方を設定する\fI\-Xmn\fRオプションのかわりに、初期サイズの設定には\fI\-XX:NewSize\fRを、最大サイズの設定には\fI\-XX:MaxNewSize\fRを使用できます。 .RE .PP \-Xms\fIsize\fR .RS 4 -ҡפν(Хñ)ꤷޤꤹͤϡ1MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +ヒープの初期サイズ(バイト単位)を設定します。指定する値は、1MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ǤϡƤ줿꡼Υ͡ñ̤Ѥ6MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーのサイズを様々な単位を使用して6MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -634,14 +634,14 @@ JIT .if n \{\ .RE .\} -Υץꤷʤ硢ϡŤȼ㤤˳Ƥ줿ιפȤꤵޤ㤤Υҡפνϡ\fI\-Xmn\fRץޤ\fI\-XX:NewSize\fRץѤǤޤ +このオプションを設定しない場合、初期サイズは、古い世代と若い世代に割り当てられたサイズの合計として設定されます。若い世代のヒープの初期サイズは、\fI\-Xmn\fRオプションまたは\fI\-XX:NewSize\fRオプションを使用して設定できます。 .RE .PP \-Xmx\fIsize\fR .RS 4 -꡼ƥסκ祵(Хñ)ꤷޤꤹͤϡ2MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤСǥץȤǤϡ\fI\-Xms\fR\fI\-Xmx\fR̾Ʊͤꤵޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの最大サイズ(バイト単位)を指定します。指定する値は、2MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。サーバー・デプロイメントでは、\fI\-Xms\fRおよび\fI\-Xmx\fRは通常同じ値に設定されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼εĤ祵͡ñ̤Ѥ80MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーの許可される最大サイズを様々な単位を使用して80MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -654,34 +654,34 @@ JIT .if n \{\ .RE .\} -\fI\-Xmx\fRץ\fI\-XX:MaxHeapSize\fRƱǤ +\fI\-Xmx\fRオプションは\fI\-XX:MaxHeapSize\fRと同等です。 .RE .PP \-Xnoclassgc .RS 4 -饹Υ١쥯(GC)̵ˤޤˤꡢGC֤Ǥץꥱ¹Ǥṳ̂ޤ +クラスのガベージ・コレクション(GC)を無効にします。これにより、GC時間を節約でき、アプリケーション実行中の中断が短縮されます。 .sp -ư\fI\-Xnoclassgc\fRꤹȡץꥱΥ饹֥ȤϡGCδ֤ϤΤޤ޻Ĥꡢ˥饤֤ǤȤߤʤޤˤꡢ¿Υ꡼ʵפͭ뤳ȤˤʤꡢդƻѤʤȡ꡼­㳰ޤ +起動時に\fI\-Xnoclassgc\fRを指定すると、アプリケーション内のクラス・オブジェクトは、GCの間はそのまま残り、常にライブであるとみなされます。これにより、より多くのメモリーが永久に占有されることになり、注意して使用しないと、メモリー不足の例外がスローされます。 .RE .PP \-Xprof .RS 4 -¹ΥץΥץեץե롦ǡɸϤޤΥץϡץ೫ȯѤΥ桼ƥƥȤ󶡤ƤޤֲƯƥǤλѤŪȤΤǤϤޤ +実行中のプログラムのプロファイルを生成し、プロファイル・データを標準出力に送信します。このオプションは、プログラム開発用のユーティリティとして提供されています。本番稼働システムでの使用を目的としたものではありません。 .RE .PP \-Xrs .RS 4 -JVMˤ륪ڥ졼ƥ󥰡ƥࡦʥλѤ򸺤餷ޤ +JVMによるオペレーティング・システム・シグナルの使用を減らします。 .sp -åȥ󡦥եåϡJVMλǤ⡢åȥ˥桼꡼󥢥åס(ǡ١³Υʤ)¹Ԥ뤳ȤˤäơJavaץꥱΥåȥ֤ͭˤޤ +シャットダウン・フックは、JVMが突然終了した場合でも、シャットダウン時にユーザー・クリーンアップ・コード(データベース接続のクローズなど)を実行することによって、Javaアプリケーションのシャットダウンを順番に有効にします。 .sp -JVMϡͽʤλΥåȥ󡦥եå뤿˥ʥ򥭥åޤJVMϡ\fISIGHUP\fR\fISIGINT\fR\fISIGTERM\fRѤơåȥ󡦥եåμ¹Ԥ򳫻Ϥޤ +JVMは、予期しない終了のシャットダウン・フックを実装するためにシグナルをキャッチします。JVMは、\fISIGHUP\fR、\fISIGINT\fRおよび\fISIGTERM\fRを使用して、シャットダウン・フックの実行を開始します。 .sp -JVMϡǥХåŪǥåɡåפȤǽ¸뤿ˡƱͤΥᥫ˥ѤޤJVMϡåɡפ¹Ԥ뤿\fISIGQUIT\fRѤޤ +JVMは、デバッグの目的でスレッド・スタックをダンプするという機能を実現するために、同様のメカニズムを使用します。JVMは、スレッド・ダンプを実行するために\fISIGQUIT\fRを使用します。 .sp -JVMǤ륢ץꥱϡ\fISIGINT\fR\fISIGTERM\fRʤɤΥʥˤ˥ȥåפɬפꡢη̡JVMΥʥ롦ϥɥȾͤǽޤ\fI\-Xrs\fRץϡн褹뤿˻ѤǤޤ\fI\-Xrs\fRѤƤ硢\fISIGINT\fR\fISIGTERM\fR\fISIGHUP\fR\fISIGQUIT\fRΥʥ롦ޥJVMˤäѹ줺ΥʥΥʥ롦ϥɥϥ󥹥ȡ뤵ޤ +JVMを埋め込んでいるアプリケーションは、\fISIGINT\fRや\fISIGTERM\fRなどのシグナルを頻繁にトラップする必要があり、その結果、JVMのシグナル・ハンドラと衝突する可能性があります。\fI\-Xrs\fRオプションは、この問題に対処するために使用できます。\fI\-Xrs\fRが使用されている場合、\fISIGINT\fR、\fISIGTERM\fR、\fISIGHUP\fRおよび\fISIGQUIT\fRのシグナル・マスクはJVMによって変更されず、これらのシグナルのシグナル・ハンドラはインストールされません。 .sp -\fI\-Xrs\fRꤹȡ2Ĥη̤ޤ: +\fI\-Xrs\fRを指定すると、次の2つの結果が生じます: .sp .RS 4 .ie n \{\ @@ -691,7 +691,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -\fISIGQUIT\fRˤ륹åɡפϻѤǤޤ +\fISIGQUIT\fRによるスレッド・ダンプは使用できません。 .RE .sp .RS 4 @@ -702,63 +702,63 @@ JVM .sp -1 .IP \(bu 2.3 .\} -åȥ󡦥եåμ¹ԤϡJVMλ褦ȤƤ\fISystem\&.exit()\fRƤӽФʤɤơ桼¦ǹԤɬפޤ +シャットダウン・フック処理の実行は、JVMが終了しようとしている時点で\fISystem\&.exit()\fRを呼び出すなどして、ユーザー・コード側で行う必要があります。 .RE .RE .PP \-Xshare:\fImode\fR .RS 4 -饹ǡͭ⡼ɤꤷޤΥץǻѲǽ\fImode\fRϼΤȤǤ +クラス・データ共有モードを設定します。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP auto .RS 4 -ǽʾ硢ͭ饹ΥǡѤޤϡJava HotSpot 32\-Bit Client VMξΥǥեͤǤ +可能な場合、共有クラスのデータを使用します。これは、Java HotSpot 32\-Bit Client VMの場合のデフォルト値です。 .RE .PP on .RS 4 -饹ǡͭλѤɬפǤ饹ǡͭѤǤʤ硢顼åϤƽλޤ +クラス・データ共有の使用が必要です。クラス・データ共有を使用できない場合、エラー・メッセージを出力して終了します。 .RE .PP off .RS 4 -ͭ饹ǡѤޤ󡣤ϡJava HotSpot 32\-Bit Server VMJava HotSpot 64\-Bit Client VMJava HotSpot 64\-Bit Server VMξΥǥեͤǤ +共有クラス・データを使用しません。これは、Java HotSpot 32\-Bit Server VM、Java HotSpot 64\-Bit Client VMおよびJava HotSpot 64\-Bit Server VMの場合のデフォルト値です。 .RE .PP dump .RS 4 -饹ǡ֤ͭưޤ +クラス・データ共有アーカイブを手動で生成します。 .RE .RE .PP \-XshowSettings:\fIcategory\fR .RS 4 -ɽ³ԤޤΥץǻѲǽ\fIcategory\fRϼΤȤǤ +設定を表示して続行します。このオプションで使用可能な\fIcategory\fR引数は次のとおりです。 .PP all .RS 4 -Τ٤ƤΥƥɽޤ줬ǥեͤǤ +設定のすべてのカテゴリを表示します。これがデフォルト値です。 .RE .PP locale .RS 4 -˴Ϣɽޤ +ロケールに関連する設定を表示します。 .RE .PP properties .RS 4 -ƥࡦץѥƥ˴Ϣɽޤ +システム・プロパティに関連する設定を表示します。 .RE .PP vm .RS 4 -JVMɽޤ +JVMの設定を表示します。 .RE .RE .PP \-Xss\fIsize\fR .RS 4 -åɤΥå(Хñ)ꤷޤKB򼨤ʸ\fIk\fRޤ\fIK\fRMB򼨤ʸ\fIm\fRޤ\fIM\fRGB򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϥץåȥեˤäưۤʤޤ +スレッドのスタック・サイズ(バイト単位)を設定します。KBを示す場合は文字\fIk\fRまたは\fIK\fR、MBを示す場合は文字\fIm\fRまたは\fIM\fR、GBを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値はプラットフォームによって異なります。 .sp .RS 4 .ie n \{\ @@ -768,7 +768,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -Linux/ARM (32ӥå): 320KB +Linux/ARM (32ビット): 320KB .RE .sp .RS 4 @@ -779,7 +779,7 @@ Linux/ARM (32 .sp -1 .IP \(bu 2.3 .\} -Linux/i386 (32ӥå): 320KB +Linux/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -790,7 +790,7 @@ Linux/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Linux/x64 (64ӥå): 1024KB +Linux/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -801,7 +801,7 @@ Linux/x64 (64 .sp -1 .IP \(bu 2.3 .\} -OS X (64ӥå): 1024KB +OS X (64ビット): 1024KB .RE .sp .RS 4 @@ -812,7 +812,7 @@ OS X (64 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/i386 (32ӥå): 320KB +Oracle Solaris/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -823,7 +823,7 @@ Oracle Solaris/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/x64 (64ӥå): 1024KB +Oracle Solaris/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -834,10 +834,10 @@ Oracle Solaris/x64 (64 .sp -1 .IP \(bu 2.3 .\} -Windows: ۥ꡼ˤäưۤʤޤ +Windows: 仮想メモリーによって異なります。 .RE .sp -Ǥϡåɡåۤʤñ̤1024KBꤷޤ +次の例では、スレッド・スタック・サイズを異なる単位で1024KBに設定します。 .sp .if n \{\ .RS 4 @@ -850,46 +850,46 @@ Windows: .if n \{\ .RE .\} -Υץ\fI\-XX:ThreadStackSize\fRƱǤ +このオプションは\fI\-XX:ThreadStackSize\fRと同等です。 .RE .PP \-Xusealtsigs .RS 4 -JVMʥ\fISIGUSR1\fR\fISIGUSR2\fRΤˡإʥѤޤΥץ\fI\-XX:+UseAltSigs\fRƱǤ +JVM内部シグナルの\fISIGUSR1\fRおよび\fISIGUSR2\fRのかわりに、代替シグナルを使用します。このオプションは\fI\-XX:+UseAltSigs\fRと同等です。 .RE .PP \-Xverify:\fImode\fR .RS 4 -Хȥɡ٥եΥ⡼ɤꤷޤХȥɤθڤϰΥȥ֥륷塼ƥ󥰤Ωޤ¹ΥץꥱؤΥСإåɤ礵ޤΥץǻѲǽ\fImode\fRϼΤȤǤ +バイトコード・ベリファイアのモードを設定します。バイトコードの検証は一部の問題のトラブルシューティングに役立ちますが、実行中のアプリケーションへのオーバーヘッドを増大させます。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP none .RS 4 -Хȥɤ򸡾ڤޤ󡣤ˤꡢư֤ṳ̂졢Javaˤä󶡤ݸڸޤ +バイトコードを検証しません。これにより、起動時間が短縮され、Javaによって提供される保護も軽減されます。 .RE .PP remote .RS 4 -ͥåȥ𤷤ƥ⡼Ȥǥɤ륯饹Τߤ򸡾ڤޤϡ\fI\-Xverify\fRץꤷʤΥǥեȤưǤ +ネットワークを介してリモートでロードされるクラスのみを検証します。これは、\fI\-Xverify\fRオプションを指定しない場合のデフォルトの動作です。 .RE .PP all .RS 4 -٤ƤΥ饹򸡾ڤޤ +すべてのクラスを検証します。 .RE .RE -.SS "٤ʥ󥿥ࡦץ" +.SS "高度なランタイム・オプション" .PP -ΥץϡJava HotSpot VMμ¹Իư椷ޤ +これらのオプションは、Java HotSpot VMの実行時の動作を制御します。 .PP \-XX:+DisableAttachMechanism .RS 4 -JVM˥ġ򥢥åᥫ˥̵ˤ륪ץͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢϡåᥫ˥ͭˤȡ\fIjcmd\fR\fIjstack\fR\fIjmap\fR\fIjinfo\fRʤɤΥġѤǤ뤳Ȥ̣ޤ +JVMにツールをアタッチするメカニズムを無効にするオプションを有効にします。デフォルトでは、このオプションは無効になっており、これは、アタッチ・メカニズムを有効にすると、\fIjcmd\fR、\fIjstack\fR、\fIjmap\fR、\fIjinfo\fRなどのツールを使用できることを意味します。 .RE .PP \-XX:ErrorFile=\fIfilename\fR .RS 4 -ꥫХǽʥ顼ȯ˥顼ǡ񤭹ޤѥӥե̾ꤷޤǥեȤǤϡΥեϡߤκȥǥ쥯ȥ˺졢̾\fIhs_err_pid\fR\fIpid\fR\fI\&.log\fR -(\fIpid\fRϥ顼θȤʤäץμ̻)ˤʤޤǤϡǥեȤΥեꤹˡ򼨤ޤ(ץμ̻Ҥ\fI%p\fRȤƻꤵޤ) +リカバリ不能なエラーが発生した場合にエラー・データが書き込まれるパスおよびファイル名を指定します。デフォルトでは、このファイルは、現在の作業ディレクトリに作成され、名前は\fIhs_err_pid\fR\fIpid\fR\fI\&.log\fR +(\fIpid\fRはエラーの原因となったプロセスの識別子)になります。次の例では、デフォルトのログ・ファイルを設定する方法を示します(プロセスの識別子は\fI%p\fRとして指定されます)。 .sp .if n \{\ .RS 4 @@ -900,7 +900,7 @@ JVM .if n \{\ .RE .\} -Ǥϡ顼\fI/var/log/java/java_error\&.log\fRꤹˡ򼨤ޤ +次の例では、エラー・ログを\fI/var/log/java/java_error\&.log\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -911,14 +911,14 @@ JVM .if n \{\ .RE .\} -(ΰ­¤ޤ̤ˤ)ꤷǥ쥯ȥ˥եǤʤ硢եϥڥ졼ƥ󥰡ƥΰǥ쥯ȥ˺ޤǥ쥯ȥ\fI/tmp\fRǤ +(領域不足、権限の問題または別の問題により)指定したディレクトリにファイルを作成できない場合、ファイルはオペレーティング・システムの一時ディレクトリに作成されます。一時ディレクトリは\fI/tmp\fRです。 .RE .PP \-XX:LargePageSizeInBytes=\fIsize\fR .RS 4 -Javaҡפ˻Ѥ礭ڡκ祵(Хñ)ꤷޤ\fIsize\fRϡ2߾(24816\&.\&.\&.)ǤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ0ꤵ졢ϡJVMǤ礭ڡΥưŪ򤵤Ƥ뤳Ȥ̣ޤ +Javaヒープに使用される大きいページの最大サイズ(バイト単位)を設定します。\fIsize\fR引数は、2の累乗(2、4、8、16、\&.\&.\&.)である必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、サイズは0に設定され、これは、JVMでは大きいページのサイズが自動的に選択されていることを意味します。 .sp -Ǥϡ礭ڡΥ4ᥬХ(MB)ꤹˡ򼨤ޤ +次の例では、大きいページのサイズを4メガバイト(MB)に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -933,9 +933,9 @@ Java .PP \-XX:MaxDirectMemorySize=\fIsize\fR .RS 4 -I/O (\fIjava\&.nio\fRѥå)ľܥХåեƤκץ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ0ꤵ졢ϡJVMǤNIOľܥХåեƤΥưŪ򤵤Ƥ뤳Ȥ̣ޤ +新規I/O (\fIjava\&.nio\fRパッケージ)の直接バッファ割当ての最大合計サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、サイズは0に設定され、これは、JVMではNIOの直接バッファ割当てのサイズが自動的に選択されていることを意味します。 .sp -ǤϡNIOۤʤñ̤1024KBꤹˡ򼨤ޤ +次の例では、NIOサイズを異なる単位で1024KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -952,30 +952,30 @@ Java .PP \-XX:NativeMemoryTracking=\fImode\fR .RS 4 -JVMΥͥƥ֡꡼ѾΥȥå󥰤Υ⡼ɤꤷޤΥץǻѲǽ\fImode\fRϼΤȤǤ +JVMのネイティブ・メモリー使用状況のトラッキングのモードを指定します。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP off .RS 4 -JVMΥͥƥ֡꡼Ѿפޤ󡣤ϡ\fI\-XX:NativeMemoryTracking\fRץꤷʤΥǥեȤưǤ +JVMのネイティブ・メモリー使用状況を追跡しません。これは、\fI\-XX:NativeMemoryTracking\fRオプションを指定しない場合のデフォルトの動作です。 .RE .PP summary .RS 4 -JVM֥ƥ(Javaҡס饹ɡåɤʤ)ˤ꡼ѾΤפޤ +JVMサブシステム(Javaヒープ、クラス、コード、スレッドなど)によるメモリー使用状況のみ追跡します。 .RE .PP detail .RS 4 -JVM֥ƥˤ꡼ѾΥȥå󥰤˲äơġ\fICallSite\fR -(ġβۥ꡼꡼󤪤ӤΥߥåȺѥ꡼)ˤ꡼Ѿפޤ +JVMサブシステムによるメモリー使用状況のトラッキングに加えて、個々の\fICallSite\fR +(個々の仮想メモリー・リージョンおよびそのコミット済リージョン)によるメモリー使用状況を追跡します。 .RE .RE .PP \-XX:OnError=\fIstring\fR .RS 4 -ꥫХǽʥ顼ȯȤ˼¹Ԥ롢ࡦޥɤޤϰϢΥߥڤΥޥɤꤷޤʸ˶򤬴ޤޤƤϡǰϤɬפޤ +リカバリ不能なエラーが発生したときに実行する、カスタム・コマンドまたは一連のセミコロン区切りのコマンドを設定します。文字列に空白が含まれている場合は、引用符で囲む必要があります。 .sp -Ǥϡ\fI\-XX:OnError\fRץѤƥ᡼뤿\fIgcore\fRޥɤ¹ԤˡӥꥫХǽʥ顼ξ˥ǥХåưƥץ³ˡ򼨤ޤ(\fI%p\fRϸߤΥץꤷޤ) +次の例では、\fI\-XX:OnError\fRオプションを使用してコア・イメージを作成するために\fIgcore\fRコマンドを実行する方法、およびリカバリ不能なエラーの場合にデバッガを起動してプロセスに接続する方法を示します(\fI%p\fRは現在のプロセスを指定します)。 .sp .if n \{\ .RS 4 @@ -990,27 +990,27 @@ JVM .PP \-XX:OnOutOfMemoryError=\fIstring\fR .RS 4 -\fIOutOfMemoryError\fR㳰ǽ˥줿Ȥ˼¹Ԥ롢ࡦޥɤޤϰϢΥߥڤΥޥɤꤷޤʸ˶򤬴ޤޤƤϡǰϤɬפޤޥʸϡ\fI\-XX:OnError\fRץ򻲾ȤƤ +\fIOutOfMemoryError\fR例外が最初にスローされたときに実行する、カスタム・コマンドまたは一連のセミコロン区切りのコマンドを設定します。文字列に空白が含まれている場合は、引用符で囲む必要があります。コマンド文字列の例は、\fI\-XX:OnError\fRオプションの説明を参照してください。 .RE .PP \-XX:+PrintCommandLineFlags .RS 4 -ޥɥ饤ɽ줿ʹֹŪ򤷤JVMե饰ΰͭˤޤϡҡΰ襵򤵤줿١쥯ʤɡJVMˤäꤵ줿르ΥߥåͤǧΩޤǥեȤǤϡΥץ̵Ǥꡢե饰ϰޤ +コマンドラインに表示された、人間工学的に選択したJVMフラグの印刷を有効にします。これは、ヒープ領域サイズや選択されたガベージ・コレクタなど、JVMによって設定されたエルゴノミック値を確認する場合に役立ちます。デフォルトでは、このオプションは無効であり、フラグは印刷されません。 .RE .PP \-XX:+PrintNMTStatistics .RS 4 -ͥƥ֡꡼Υȥå󥰤ͭʾˡJVMνλ˼줿ͥƥ֡꡼Υȥå󥰡ǡΰͭˤޤ(\fI\-XX:NativeMemoryTracking\fR򻲾ȤƤ)ǥեȤǤϡΥץ̵Ǥꡢͥƥ֡꡼Υȥå󥰡ǡϰޤ +ネイティブ・メモリーのトラッキングが有効な場合に、JVMの終了時に収集されたネイティブ・メモリーのトラッキング・データの印刷を有効にします(\fI\-XX:NativeMemoryTracking\fRを参照してください)。デフォルトでは、このオプションは無効であり、ネイティブ・メモリーのトラッキング・データは印刷されません。 .RE .PP \-XX:+ShowMessageBoxOnError .RS 4 -JVMǥꥫХǽʥ顼ȯ硢ܥåɽͭˤޤˤꡢJVM˥ǥХå³ƥ顼θĴǤ褦ˡJVMλʤ褦ˤơץ򥢥ƥ֤ʤޤޤˤޤǥեȤǤϡΥץ̵Ǥ +JVMでリカバリ不能なエラーが発生した場合、ダイアログ・ボックスの表示を有効にします。これにより、JVMにデバッガを接続してエラーの原因を調査できるように、JVMを終了しないようにして、プロセスをアクティブなままにします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:ThreadStackSize=\fIsize\fR .RS 4 -åɤΥå(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϥץåȥեˤäưۤʤޤ +スレッドのスタック・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値はプラットフォームによって異なります。 .sp .RS 4 .ie n \{\ @@ -1020,7 +1020,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -Linux/ARM (32ӥå): 320KB +Linux/ARM (32ビット): 320KB .RE .sp .RS 4 @@ -1031,7 +1031,7 @@ Linux/ARM (32 .sp -1 .IP \(bu 2.3 .\} -Linux/i386 (32ӥå): 320KB +Linux/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -1042,7 +1042,7 @@ Linux/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Linux/x64 (64ӥå): 1024KB +Linux/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -1053,7 +1053,7 @@ Linux/x64 (64 .sp -1 .IP \(bu 2.3 .\} -OS X (64ӥå): 1024KB +OS X (64ビット): 1024KB .RE .sp .RS 4 @@ -1064,7 +1064,7 @@ OS X (64 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/i386 (32ӥå): 320KB +Oracle Solaris/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -1075,7 +1075,7 @@ Oracle Solaris/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/x64 (64ӥå): 1024KB +Oracle Solaris/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -1086,10 +1086,10 @@ Oracle Solaris/x64 (64 .sp -1 .IP \(bu 2.3 .\} -Windows: ۥ꡼ˤäưۤʤޤ +Windows: 仮想メモリーによって異なります。 .RE .sp -Ǥϡåɡåۤʤñ̤1024KBꤹˡ򼨤ޤ +次の例では、スレッド・スタック・サイズを異なる単位で1024KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1102,86 +1102,86 @@ Windows: .if n \{\ .RE .\} -Υץ\fI\-Xss\fRƱǤ +このオプションは\fI\-Xss\fRと同等です。 .RE .PP \-XX:+TraceClassLoading .RS 4 -饹ɤȤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスがロードされるときのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceClassLoadingPreorder .RS 4 -饹Ȥǡɤ줿٤ƤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスが参照される順序で、ロードされたすべてのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceClassResolution .RS 4 -סβΥȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢסβϥȥ졼ޤ +定数プールの解決のトレースを有効にします。デフォルトでは、このオプションは無効であり、定数プールの解決はトレースされません。 .RE .PP \-XX:+TraceClassUnloading .RS 4 -饹ɤȤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスがアンロードされるときのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceLoaderConstraints .RS 4 -εϿΥȥ졼ͭˤޤǥեȤǤϡΥץ̵ǤꡢεϿפޤ +ローダー制約の記録のトレースを有効にします。デフォルトでは、このオプションは無効であり、ローダー制約の記録は追跡されません。 .RE .PP \-XX:+UseAltSigs .RS 4 -JVMʥ\fISIGUSR1\fR\fISIGUSR2\fRΤˡإʥλѤͭˤޤǥեȤǤϡΥץ̵ǤꡢإʥϻѤޤ󡣤Υץ\fI\-Xusealtsigs\fRƱǤ +JVM内部シグナルの\fISIGUSR1\fRおよび\fISIGUSR2\fRのかわりに、代替シグナルの使用を有効にします。デフォルトでは、このオプションは無効であり、代替シグナルは使用されません。このオプションは\fI\-Xusealtsigs\fRと同等です。 .RE .PP \-XX:+UseBiasedLocking .RS 4 -ХåλѤͭˤޤʤ̤󶥹ƱΥץꥱϡΥե饰ͭˤʹ®¸ޤΥѥΥå륢ץꥱϡ®٤㲼뤳ȤޤХåˡξܺ٤ϡhttp://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5ˤJava塼˥󥰤Υۥ磻ȡڡѡ򻲾ȤƤ +バイアス・ロックの使用を有効にします。かなりの量の非競合の同期化がある一部のアプリケーションは、このフラグを有効にすると大幅な高速化が実現しますが、特定のパターンのロックがあるアプリケーションは、速度が低下することがあります。バイアス・ロックの方法の詳細は、http://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5にあるJavaチューニングのホワイト・ペーパーの例を参照してください。 .sp -ǥեȤǤϡΥץ̵ǤꡢХåϻѤޤ +デフォルトでは、このオプションは無効であり、バイアス・ロックは使用されません。 .RE .PP \-XX:+UseCompressedOops .RS 4 -̤줿ݥ󥿤λѤͭˤޤΥץͭˤȡ֥ȻȤϡ64ӥåȤΥݥ󥿤ǤϤʤ32ӥåȤΥեåȤȤɽ졢ˤꡢ32GB꾮JavaҡסΥץꥱμ¹Իˡ̾ѥեޥ󥹤夷ޤΥץϡ64ӥåȤJVMǤΤߵǽޤ +圧縮されたポインタの使用を有効にします。このオプションを有効にすると、オブジェクト参照は、64ビットのポインタではなく32ビットのオフセットとして表され、これにより、32GBより小さいJavaヒープ・サイズのアプリケーションの実行時に、通常、パフォーマンスが向上します。このオプションは、64ビットのJVMでのみ機能します。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ̥ݥ󥿤ϻѤޤ +デフォルトでは、このオプションは無効であり、圧縮ポインタは使用されません。 .RE .PP \-XX:+UseLargePages .RS 4 -礭ڡΥ꡼λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤ礭ڡΥ꡼λѤ̵ˤˤϡ\fI\-XX:\-UseLargePages\fRꤷޤ +大きいページのメモリーの使用を有効にします。このオプションはデフォルトで有効になっています。大きいページのメモリーの使用を無効にするには、\fI\-XX:\-UseLargePages\fRを指定します。 .sp -ܺ٤ϡhttp://www\&.oracle\&.com/technetwork/java/javase/tech/largememory\-jsp\-137182\&.htmlˤ礭꡼ڡѤJavaݡȤ򻲾ȤƤ +詳細は、http://www\&.oracle\&.com/technetwork/java/javase/tech/largememory\-jsp\-137182\&.htmlにある大きいメモリー・ページ用のJavaサポートを参照してください。 .RE .PP \-XX:+UseMembar .RS 4 -åɤξ֤ܤǥСȯԤͭˤޤΥץϡͭˤʤäƤPower PCARMС٤ƤΥץåȥեǡǥեȤǤ̵ˤʤäƤޤPower PCARMΥåɾܤФСȯԤ̵ˤˤϡ\fI\-XX:\-UseMembar\fRꤷޤ +スレッドの状態の遷移でメンバーの発行を有効にします。このオプションは、有効になっているPower PCおよびARMサーバーを除くすべてのプラットフォーム上で、デフォルトでは無効になっています。Power PCとARMのスレッド状態遷移に対するメンバーの発行を無効にするには、\fI\-XX:\-UseMembar\fRを指定します。 .RE .PP \-XX:+UsePerfData .RS 4 -\fIperfdata\fRǽͭˤޤΥץϥǥեȤͭˤʤäƤꡢJVMΥ˥󥰤ӥѥեޥ󥹡ƥȤǽˤʤޤ̵ˤȡ\fIhsperfdata_userid\fRǥ쥯ȥκޤ\fIperfdata\fRǽ̵ˤˤϡ\fI\-XX:\-UsePerfData\fRꤷޤ +\fIperfdata\fR機能を有効にします。このオプションはデフォルトで有効になっており、JVMのモニタリングおよびパフォーマンス・テストが可能になります。これを無効にすると、\fIhsperfdata_userid\fRディレクトリの作成を抑制します。\fIperfdata\fR機能を無効にするには、\fI\-XX:\-UsePerfData\fRを指定します。 .RE .PP \-XX:+AllowUserSignalHandlers .RS 4 -ץꥱˤ륷ʥ롦ϥɥΥ󥹥ȡͭˤޤǥեȤǤϡΥץ̵Ǥꡢץꥱϥʥ롦ϥɥ򥤥󥹥ȡ뤹뤳ȤϵĤƤޤ +アプリケーションによるシグナル・ハンドラのインストールを有効にします。デフォルトでは、このオプションは無効であり、アプリケーションはシグナル・ハンドラをインストールすることは許可されていません。 .RE -.SS "٤JITѥ顦ץ" +.SS "高度なJITコンパイラ・オプション" .PP -ΥץϡJava HotSpot VMǼ¹ԤưŪjust\-in\-time (JIT)ѥ椷ޤ +これらのオプションは、Java HotSpot VMで実行される動的なjust\-in\-time (JIT)コンパイラを制御します。 .PP \-XX:+AggressiveOpts .RS 4 -ѶŪʥѥեޥ󥹺ŬǽλѤͭˤޤϺΥ꡼ǥǥեȤˤʤͽǤǥեȤǤϡΥץ̵ǤꡢŪʥѥեޥ󥹵ǽϻѤޤ +積極的なパフォーマンス最適化機能の使用を有効にします。これは今後のリリースでデフォルトになる予定です。デフォルトでは、このオプションは無効であり、試験的なパフォーマンス機能は使用されません。 .RE .PP \-XX:AllocateInstancePrefetchLines=\fIlines\fR .RS 4 -󥹥󥹳ƥݥ󥿤˥ץեåԿꤷޤǥեȤǤϡץեåԿ1ꤵƤޤ +インスタンス割当てポインタの前にプリフェッチする行数を設定します。デフォルトでは、プリフェッチする行数は1に設定されています。 .sp .if n \{\ .RS 4 @@ -1196,7 +1196,7 @@ JVM .PP \-XX:AllocatePrefetchInstr=\fIinstruction\fR .RS 4 -ƥݥ󥿤˥ץեåץեå̿ꤷޤѲǽͤ03ޤǤǤͤظˤºݤ̿ϡץåȥեˤäưۤʤޤǥեȤǤϡץեå̿0ꤵƤޤ +割当てポインタの前にプリフェッチするプリフェッチ命令を設定します。使用可能な値は0から3までです。値の背後にある実際の命令は、プラットフォームによって異なります。デフォルトでは、プリフェッチ命令は0に設定されています。 .sp .if n \{\ .RS 4 @@ -1211,7 +1211,7 @@ JVM .PP \-XX:AllocatePrefetchStepSize=\fIsize\fR .RS 4 -缡ץեå̿Υƥåס(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡƥåס16ХȤꤵƤޤ +順次プリフェッチ命令のステップ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、ステップ・サイズは16バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1226,12 +1226,12 @@ JVM .PP \-XX:+BackgroundCompilation .RS 4 -Хå饦ɡѥͭˤޤΥץϥǥեȤͭˤʤäƤޤХå饦ɡѥ̵ˤˤϡ\fI\-XX:\-BackgroundCompilation\fRꤷޤ(\fI\-Xbatch\fRꤹΤƱǤ) +バックグラウンド・コンパイルを有効にします。このオプションはデフォルトで有効になっています。バックグラウンド・コンパイルを無効にするには、\fI\-XX:\-BackgroundCompilation\fRを指定します(これは\fI\-Xbatch\fRを指定するのと同等です)。 .RE .PP \-XX:CICompilerCount=\fIthreads\fR .RS 4 -ѥ˻Ѥ륳ѥ顦åɤοꤷޤǥեȤǤϡåɿϡСJVMξ2饤JVMξ1ꤵƤꡢإѥ뤬ѤƤ硢˹礻ޤǤϡåɤο2ꤹˡ򼨤ޤ +コンパイルに使用するコンパイラ・スレッドの数を設定します。デフォルトでは、スレッド数は、サーバーJVMの場合は2、クライアントJVMの場合は1に設定されており、層コンパイルが使用されている場合、コア数に合せて増減します。次の例では、スレッドの数を2に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1246,7 +1246,7 @@ JVM .PP \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR .RS 4 -ѥɬפʺǾΰ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǾΰ꾯ʤΰ褷ĤäƤʤ硢ѥߤޤǥեȤǤϡΥץ500KBꤵƤޤǤϡǾΰ1024MBꤹˡ򼨤ޤ +コンパイルに必要な最小空き領域(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。最小空き領域より少ない領域しか残っていない場合、コンパイルは停止します。デフォルトでは、このオプションは500KBに設定されています。次の例では、最小空き領域を1024MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1261,7 +1261,7 @@ JVM .PP \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR] .RS 4 -᥽åɤǼ¹Ԥ륳ޥɤꤷޤȤСѥ븵\fIString\fR饹\fIindexOf()\fR᥽åɤ¹ԤˤϡѤޤ +メソッドで実行するコマンドを指定します。たとえば、コンパイル元から\fIString\fRクラスの\fIindexOf()\fRメソッドを実行するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1272,7 +1272,7 @@ JVM .if n \{\ .RE .\} -å(\fI/\fR)Ƕڤ줿٤ƤΥѥåӥ֥ѥåޤࡢ饹̾ꤷޤڼŽդưפˤ뤿ˡ\fI\-XX:+PrintCompilation\fRץ󤪤\fI\-XX:+LogCompilation\fRץˤä᥽å̾ηѤ뤳ȤǤޤ +スラッシュ(\fI/\fR)で区切られたすべてのパッケージおよびサブパッケージを含む、完全クラス名を指定します。切取りと貼付けの操作を容易にするために、\fI\-XX:+PrintCompilation\fRオプションおよび\fI\-XX:+LogCompilation\fRオプションによって生成されるメソッド名の形式を使用することもできます。 .sp .if n \{\ .RS 4 @@ -1283,7 +1283,7 @@ JVM .if n \{\ .RE .\} -̾ʤǥ᥽åɤꤹȡޥɤϻꤷ̾Ĥ٤ƤΥ᥽åɤŬѤޤ饹եǥ᥽åɤν̾ꤹ뤳ȤǤޤȤСѥ븵\fIString\fR饹\fIindexOf(String)\fR᥽åɤΤ߽ˤϡѤޤ +署名なしでメソッドを指定すると、コマンドは指定した名前を持つすべてのメソッドに適用されます。ただし、クラス・ファイル形式でメソッドの署名を指定することもできます。たとえば、コンパイル元から\fIString\fRクラスの\fIindexOf(String)\fRメソッドのみ除外するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1294,7 +1294,7 @@ JVM .if n \{\ .RE .\} -ޤ饹̾ӥ᥽å̾˥磻ɥɤȤƥꥹ(*)ѤǤޤȤСѥ븵餹٤ƤΥ饹Τ٤Ƥ\fIindexOf()\fR᥽åɤˤϡѤޤ +また、クラス名およびメソッド名にワイルドカードとしてアスタリスク(*)を使用できます。たとえば、コンパイル元からすべてのクラスのすべての\fIindexOf()\fRメソッドを除外するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1305,7 +1305,7 @@ JVM .if n \{\ .RE .\} -ޤȥԥꥪɤ϶̾ǡˤꡢ𤷤ƥѥ顦ޥɤϤȤưפˤʤޤǰϤळȤǡ򥻥ѥ졼ȤƻѤ\fI\-XX:CompileCommand\fR˰ϤȤǤޤ +カンマとピリオドは空白の別名で、これにより、シェルを介してコンパイラ・コマンドを渡すことが容易になります。引数を引用符で囲むことで、空白をセパレータとして使用して\fI\-XX:CompileCommand\fRに引数を渡すことができます。 .sp .if n \{\ .RS 4 @@ -1316,48 +1316,48 @@ JVM .if n \{\ .RE .\} -\fI\-XX:CompileCommand\fRץѤƥޥɥ饤Ϥ줿ޥɤϤˡJITѥ\fI\&.hotspot_compiler\fRե뤫饳ޥɤɤ߼ޤΥե˥ޥɤɲä뤫ޤ\fI\-XX:CompileCommandFile\fRץѤ̤Υեꤹ뤳ȤǤޤ +\fI\-XX:CompileCommand\fRオプションを使用してコマンドラインで渡されたコマンドを解析した後に、JITコンパイラは\fI\&.hotspot_compiler\fRファイルからコマンドを読み取ります。このファイルにコマンドを追加するか、または\fI\-XX:CompileCommandFile\fRオプションを使用して別のファイルを指定することができます。 .sp -ʣΥޥɤɲäˤϡ\fI\-XX:CompileCommand\fRץʣꤹ뤫ޤϲԥѥ졼(\fI\en\fR)ѤƳưڤޤΥޥɤѤǤޤ +複数のコマンドを追加するには、\fI\-XX:CompileCommand\fRオプションを複数回指定するか、または改行セパレータ(\fI\en\fR)を使用して各引数を区切ります。次のコマンドを使用できます。 .PP break .RS 4 -ꤷ᥽åɤΥѥκǽߤ뤿ˡJVMΥǥХåΥ֥졼ݥȤꤷޤ +指定したメソッドのコンパイルの最初に停止するために、JVMのデバッグ時のブレークポイントを設定します。 .RE .PP compileonly .RS 4 -ꤷ᥽åɤ٤ƤΥ᥽åɤ򡢥ѥ뤫ޤ̤ˡȤơ\fI\-XX:CompileOnly\fRץѤʣΥ᥽åɤǤޤ +指定したメソッドを除いたすべてのメソッドを、コンパイルから除外します。別の方法として、\fI\-XX:CompileOnly\fRオプションを使用して複数のメソッドを指定できます。 .RE .PP dontinline .RS 4 -ꤷ᥽åɤ򥤥饤󲽤ʤ褦ˤޤ +指定したメソッドをインライン化しないようにします。 .RE .PP exclude .RS 4 -ꤷ᥽åɤ򥳥ѥ뤫ޤ +指定したメソッドをコンパイルから除外します。 .RE .PP help .RS 4 -\fI\-XX:CompileCommand\fRץΥإסåޤ +\fI\-XX:CompileCommand\fRオプションのヘルプ・メッセージを印刷します。 .RE .PP inline .RS 4 -ꤷ᥽åɤ򥤥饤󲽤褦Ȥޤ +指定したメソッドをインライン化しようとします。 .RE .PP log .RS 4 -ꤷ᥽åɤ٤ƤΥ᥽åɤФơ(\fI\-XX:+LogCompilation\fRץѤ)ѥ롦󥰤ޤǥեȤǤϡѥ뤵줿٤ƤΥ᥽åɤ˥󥰤¹Ԥޤ +指定したメソッドを除くすべてのメソッドに対して、(\fI\-XX:+LogCompilation\fRオプションを使用して)コンパイル・ロギングを除外します。デフォルトでは、コンパイルされたすべてのメソッドにロギングが実行されます。 .RE .PP option .RS 4 -ΥޥɤϡǸΰ(\fIoption\fR)Τˡꤷ᥽åɤJITѥ롦ץϤ˻ѤǤޤѥ롦ץϡ᥽å̾θꤵޤȤС\fIStringBuffer\fR饹\fIappend()\fR᥽åɤФ\fIBlockLayoutByFrequency\fRץͭˤˤϡѤޤ +このコマンドは、最後の引数(\fIoption\fR)のかわりに、指定したメソッドにJITコンパイル・オプションを渡すために使用できます。コンパイル・オプションは、メソッド名の後の末尾に設定されます。たとえば、\fIStringBuffer\fRクラスの\fIappend()\fRメソッドに対して\fIBlockLayoutByFrequency\fRオプションを有効にするには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1368,17 +1368,17 @@ option .if n \{\ .RE .\} -ޤޤ϶ǶڤäơʣΥѥ롦ץǤޤ +カンマまたは空白で区切って、複数のコンパイル・オプションを指定できます。 .RE .PP print .RS 4 -ꤷ᥽åɤΥѥ줿֥顦ɤϤޤ +指定したメソッドのコンパイル後に生成されたアセンブラ・コードを出力します。 .RE .PP quiet .RS 4 -ѥ롦ޥɤϤޤ󡣥ǥեȤǤϡ\fI\-XX:CompileCommand\fRץѤƻꤷޥɤϤޤȤС\fIString\fR饹\fIindexOf()\fR᥽åɤΥѥ뤫硢ɸϤ˽Ϥޤ +コンパイル・コマンドを出力しません。デフォルトでは、\fI\-XX:CompileCommand\fRオプションを使用して指定したコマンドが出力されます。たとえば、\fIString\fRクラスの\fIindexOf()\fRメソッドのコンパイルから除外する場合、次が標準出力に出力されます。 .sp .if n \{\ .RS 4 @@ -1389,15 +1389,15 @@ CompilerOracle: exclude java/lang/String\&.indexOf .if n \{\ .RE .\} -¾\fI\-XX:CompileCommand\fRץ\fI\-XX:CompileCommand=quiet\fRץꤹ뤳ȤˤäơǤޤ +他の\fI\-XX:CompileCommand\fRオプションの前に\fI\-XX:CompileCommand=quiet\fRオプションを指定することによって、これを抑制できます。 .RE .RE .PP \-XX:CompileCommandFile=\fIfilename\fR .RS 4 -JITѥ顦ޥɤɼ긵ΥեꤷޤǥեȤǤϡJITѥˤäƼ¹Ԥ륳ޥɤǼ뤿ˡ\fI\&.hotspot_compiler\fRե뤬Ѥޤ +JITコンパイラ・コマンドの読取り元のファイルを設定します。デフォルトでは、JITコンパイラによって実行されるコマンドを格納するために、\fI\&.hotspot_compiler\fRファイルが使用されます。 .sp -ޥɡեγƹԤϡޥɤѤ륳ޥɡ饹̾ӥ᥽å̾ɽޤȤСιԤϡ\fIString\fR饹\fItoString()\fR᥽åɤФƥ֥ꡦɤϤޤ +コマンド・ファイルの各行は、コマンドが使用されるコマンド、クラス名およびメソッド名を表します。たとえば、次の行は、\fIString\fRクラスの\fItoString()\fRメソッドに対してアセンブリ・コードを出力します。 .sp .if n \{\ .RS 4 @@ -1408,12 +1408,12 @@ print java/lang/String toString .if n \{\ .RE .\} -᥽åɤǼ¹ԤJITѥΥޥɤλξܺ٤ϡ\fI\-XX:CompileCommand\fRץ򻲾ȤƤ +メソッドで実行するJITコンパイラのコマンドの指定の詳細は、\fI\-XX:CompileCommand\fRオプションを参照してください。 .RE .PP \-XX:CompileOnly=\fImethods\fR .RS 4 -ѥ¤(ޤǶڤ줿)᥽åɤΥꥹȤꤷޤꤷ᥽åɤΤߤѥ뤵ޤ饹̾(ѥåӥ֥ѥåޤ)dzƥ᥽åɤꤷޤȤС\fIString\fR饹\fIlength()\fR᥽åɤ\fIList\fR饹\fIsize()\fR᥽åɤΤߤ򥳥ѥ뤹ˤϡѤޤ +コンパイルを制限する(カンマで区切られた)メソッドのリストを設定します。指定したメソッドのみがコンパイルされます。完全クラス名(パッケージおよびサブパッケージを含む)で各メソッドを指定します。たとえば、\fIString\fRクラスの\fIlength()\fRメソッドおよび\fIList\fRクラスの\fIsize()\fRメソッドのみをコンパイルするには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1424,7 +1424,7 @@ print java/lang/String toString .if n \{\ .RE .\} -å(\fI/\fR)Ƕڤ줿٤ƤΥѥåӥ֥ѥåޤࡢ饹̾ꤷޤڼŽդưפˤ뤿ˡ\fI\-XX:+PrintCompilation\fRץ󤪤\fI\-XX:+LogCompilation\fRץˤä᥽å̾ηѤ뤳ȤǤޤ +スラッシュ(\fI/\fR)で区切られたすべてのパッケージおよびサブパッケージを含む、完全クラス名を指定します。切取りと貼付けの操作を容易にするために、\fI\-XX:+PrintCompilation\fRオプションおよび\fI\-XX:+LogCompilation\fRオプションによって生成されるメソッド名の形式を使用することもできます。 .sp .if n \{\ .RS 4 @@ -1435,7 +1435,7 @@ print java/lang/String toString .if n \{\ .RE .\} -磻ɥɤϥݡȤƤޤ󤬡饹̾ޤϥѥå̾ꤷƥ饹ޤϥѥåΤ٤ƤΥ᥽åɤ򥳥ѥ뤹뤳Ȥ⡢᥽åɤꤷǤդΥ饹Τ̾ĥ᥽åɤ򥳥ѥ뤹뤳ȤǤޤ +ワイルドカードはサポートされていませんが、クラス名またはパッケージ名だけを指定してクラスまたはパッケージのすべてのメソッドをコンパイルすることも、メソッドだけを指定して任意のクラスのこの名前を持つメソッドをコンパイルすることもできます。 .sp .if n \{\ .RS 4 @@ -1452,7 +1452,7 @@ print java/lang/String toString .PP \-XX:CompileThreshold=\fIinvocations\fR .RS 4 -ѥ˲ᤵ줿᥽åɸƽФοꤷޤǥեȤǤϡСJVMǤϡJITѥϡ10,000βᤵ줿᥽åɸƽФ¹ԤơΨŪʥѥΤξޤ饤JVMξ硢ǥե1,500ƽФǤǤϡᤵ줿᥽åɸƽФο5,000ꤹˡ򼨤ޤ +コンパイル前に解釈されたメソッド呼出しの数を設定します。デフォルトでは、サーバーJVMでは、JITコンパイラは、10,000の解釈されたメソッド呼出しを実行して、効率的なコンパイルのための情報を収集します。クライアントJVMの場合、デフォルト設定は1,500呼出しです。次の例では、解釈されたメソッド呼出しの数を5,000に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1463,22 +1463,22 @@ print java/lang/String toString .if n \{\ .RE .\} -\fI\-Xcomp\fRץꤷơѥˡJava᥽åɤβ̵ˤ뤳ȤǤޤ +\fI\-Xcomp\fRオプションを指定して、コンパイルの前に、Javaメソッドの解釈を完全に無効にすることができます。 .RE .PP \-XX:+DoEscapeAnalysis .RS 4 -ʬϤλѤͭˤޤΥץϥǥեȤͭˤʤäƤޤʬϤλѤ̵ˤˤϡ\fI\-XX:\-DoEscapeAnalysis\fRꤷޤ +エスケープ分析の使用を有効にします。このオプションはデフォルトで有効になっています。エスケープ分析の使用を無効にするには、\fI\-XX:\-DoEscapeAnalysis\fRを指定します。 .RE .PP \-XX:+FailOverToOldVerifier .RS 4 -סåԤΡŤ٥եؤμưե륪СͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢǶΥХȥɡСѤ饹ˤϡ̵뤵ޤ(Ĥޤꡢ̵Ȥƽޤ)ŤСΥХȥɤѤ饹ˤϡͭǤޤ +新しいタイプ・チェッカが失敗した場合の、古いベリファイアへの自動フェイルオーバーを有効にします。デフォルトでは、このオプションは無効になっており、最近のバイトコード・バージョンを使用したクラスには、これは無視されます(つまり、無効として処理されます)。古いバージョンのバイトコードを使用したクラスには、これを有効化できます。 .RE .PP \-XX:InitialCodeCacheSize=\fIsize\fR .RS 4 -ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤ500KBꤵƤޤǤϡɡå塦32KBꤹˡ򼨤ޤ +初期コード・キャッシュ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は500KBに設定されています。次の例では、初期コード・キャッシュ・サイズを32KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1493,12 +1493,12 @@ print java/lang/String toString .PP \-XX:+Inline .RS 4 -᥽åɤΥ饤󲽤ͭˤޤΥץϡѥեޥ󥹤夵뤿˥ǥեȤͭˤʤäƤޤ᥽åɤΥ饤󲽤̵ˤˤϡ\fI\-XX:\-Inline\fRꤷޤ +メソッドのインライン化を有効にします。このオプションは、パフォーマンスを向上させるためにデフォルトで有効になっています。メソッドのインライン化を無効にするには、\fI\-XX:\-Inline\fRを指定します。 .RE .PP \-XX:InlineSmallCode=\fIsize\fR .RS 4 -饤󲽤ɬפʥѥ뤵줿᥽åɤκ祳ɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤꤷ꾮Υѥ뤵줿᥽åɤΤߤ饤󲽤ޤǥեȤǤϡ祳ɡ1000ХȤꤵƤޤ +インライン化が必要なコンパイルされたメソッドの最大コード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。指定したサイズより小さいサイズのコンパイルされたメソッドのみが、インライン化されます。デフォルトでは、最大コード・サイズは1000バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1513,16 +1513,16 @@ print java/lang/String toString .PP \-XX:+LogCompilation .RS 4 -ߤκȥǥ쥯ȥˤ\fIhotspot\&.log\fRȤ̾ΥեؤΥѥ롦ƥӥƥΥ󥰤ͭˤޤ\fI\-XX:LogFile\fRץѤơۤʤե롦ѥ̾Ǥޤ +現在の作業ディレクトリにある\fIhotspot\&.log\fRという名前のファイルへのコンパイル・アクティビティのロギングを有効にします。\fI\-XX:LogFile\fRオプションを使用して、異なるログ・ファイル・パスと名前を指定できます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢѥ롦ƥӥƥϵϿޤ\fI\-XX:+LogCompilation\fRץϡJVMץΥå\fI\-XX:UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、コンパイル・アクティビティは記録されません。\fI\-XX:+LogCompilation\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .sp -\fI\-XX:+PrintCompilation\fRץѤơ᥽åɤ򥳥ѥ뤹뤿Ӥˡ󥽡˽Ϥ줿åޤܺ٤ʿǽϤͭǤޤ +\fI\-XX:+PrintCompilation\fRオプションを使用して、メソッドをコンパイルするたびに、コンソールに出力されたメッセージを含む詳細な診断出力を有効化できます。 .RE .PP \-XX:MaxInlineSize=\fIsize\fR .RS 4 -饤󲽤᥽åɤκХȥɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡХȥɡ35ХȤꤵƤޤ +インライン化するメソッドの最大バイトコード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、最大バイトコード・サイズは35バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1537,7 +1537,7 @@ print java/lang/String toString .PP \-XX:MaxNodeLimit=\fInodes\fR .RS 4 -ñΥ᥽åɤΥѥ˻ѤΡɤκꤷޤǥեȤǤϡΡɤκ65,000ꤵƤޤ +単一のメソッドのコンパイル時に使用されるノードの最大数を設定します。デフォルトでは、ノードの最大数は65,000に設定されています。 .sp .if n \{\ .RS 4 @@ -1552,7 +1552,7 @@ print java/lang/String toString .PP \-XX:MaxTrivialSize=\fIsize\fR .RS 4 -饤󲽤ñ᥽åɤκХȥɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡñ᥽åɤκХȥɡ6ХȤꤵƤޤ +インライン化する単純メソッドの最大バイトコード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、単純メソッドの最大バイトコード・サイズは6バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1567,77 +1567,77 @@ print java/lang/String toString .PP \-XX:+OptimizeStringConcat .RS 4 -\fIString\fRϢκŬͭˤޤΥץϥǥեȤͭˤʤäƤޤ\fIString\fRϢκŬ̵ˤˤϡ\fI\-XX:\-OptimizeStringConcat\fRꤷޤ +\fIString\fR連結操作の最適化を有効にします。このオプションはデフォルトで有効になっています。\fIString\fR連結操作の最適化を無効にするには、\fI\-XX:\-OptimizeStringConcat\fRを指定します。 .RE .PP \-XX:+PrintAssembly .RS 4 -\fIdisassembler\&.so\fR饤֥ѤơХȥɲ줿ͥƥ֤Υ᥽åɤΥ֥ꡦɤνϤͭˤޤˤꡢ줿ɤɽ뤳ȤǤѥեޥ󥹤οǤΩޤ +外部の\fIdisassembler\&.so\fRライブラリを使用して、バイトコード化されたネイティブのメソッドのアセンブリ・コードの出力を有効にします。これにより、生成されたコードを表示することができ、パフォーマンスの問題の診断に役立ちます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ֥ꡦɤϰޤ\fI\-XX:+PrintAssembly\fRץϡJVMץΥå\fI\-XX:UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、アセンブリ・コードは印刷されません。\fI\-XX:+PrintAssembly\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .RE .PP \-XX:+PrintCompilation .RS 4 -᥽åɤ򥳥ѥ뤹뤿Ӥˡ󥽡˥åϤ뤳ȤˤäơJVMξܺ٤ʿǽϤͭˤޤˤꡢºݤ˥ѥ뤵᥽åɤǧǤޤǥեȤǤϡΥץ̵ǤꡢǽϤϰޤ +メソッドをコンパイルするたびに、コンソールにメッセージを出力することによって、JVMからの詳細な診断出力を有効にします。これにより、実際にコンパイルされるメソッドを確認できます。デフォルトでは、このオプションは無効であり、診断出力は印刷されません。 .sp -\fI\-XX:+LogCompilation\fRץѤơѥ롦ƥӥƥե˵Ͽ뤳ȤǤޤ +\fI\-XX:+LogCompilation\fRオプションを使用して、コンパイル・アクティビティをファイルに記録することもできます。 .RE .PP \-XX:+PrintInlining .RS 4 -饤󲽤ηƤνϤͭˤޤˤꡢ饤󲽤᥽åɤǧǤޤ +インライン化の決定内容の出力を有効にします。これにより、インライン化されるメソッドを確認できます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ饤󲽾ϽϤޤ\fI\-XX:+PrintInlining\fRץϡJVMץΥå\fI\-XX:+UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、インライン化情報は出力されません。\fI\-XX:+PrintInlining\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:+UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .RE .PP \-XX:+RelaxAccessControlCheck .RS 4 -٥եΥå̤򸺤餷ޤǥեȤǤϡΥץ̵ˤʤäƤꡢǶΥХȥɡСѤ饹ˤϡ̵뤵ޤ(Ĥޤꡢ̵Ȥƽޤ)ŤСΥХȥɤѤ饹ˤϡͭǤޤ +ベリファイア内のアクセス制御チェックの量を減らします。デフォルトでは、このオプションは無効になっており、最近のバイトコード・バージョンを使用したクラスには、これは無視されます(つまり、無効として処理されます)。古いバージョンのバイトコードを使用したクラスには、これを有効化できます。 .RE .PP \-XX:ReservedCodeCacheSize=\fIsize\fR .RS 4 -JITѥ뤵줿ɤκ祳ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤΥץ\fI\-Xmaxjitcodesize\fRƱǤ +JITコンパイルされたコードの最大コード・キャッシュ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。このオプションは\fI\-Xmaxjitcodesize\fRと同等です。 .RE .PP \-XX:+TieredCompilation .RS 4 -إѥλѤͭˤޤǥեȤǤϡΥץ̵ǤꡢإѥϻѤޤ +層コンパイルの使用を有効にします。デフォルトでは、このオプションは無効であり、層コンパイルは使用されません。 .RE .PP \-XX:+UseCodeCacheFlushing .RS 4 -ѥ򥷥åȥ󤹤ˡɡåΥեåͭˤޤΥץϥǥեȤͭˤʤäƤޤѥ򥷥åȥ󤹤˥ɡåΥեå̵ˤˤ\fI\-XX:\-UseCodeCacheFlushing\fRꤷޤ +コンパイラをシャットダウンする前に、コード・キャッシュのフラッシュを有効にします。このオプションはデフォルトで有効になっています。コンパイラをシャットダウンする前にコード・キャッシュのフラッシュを無効にするには\fI\-XX:\-UseCodeCacheFlushing\fRを指定します。 .RE .PP \-XX:+UseCondCardMark .RS 4 -ɽιˡɤǤ˥ޡƤ뤫ɤΥåͭˤޤΥץϡǥեȤǤ̵ˤʤäƤꡢʣΥåȤĥޥǤΤ߻ѤɬפޤˤꡢƱˤʤ¸ƤJavaץꥱΥѥեޥ󥹤夷ޤ +カード表の更新前に、カードがすでにマークされているかどうかのチェックを有効にします。このオプションは、デフォルトでは無効になっており、複数のソケットを持つマシン上でのみ使用する必要があります。これにより、同時操作にかなり依存しているJavaアプリケーションのパフォーマンスが向上します。 .RE .PP \-XX:+UseSuperWord .RS 4 -顼黻Υѡɱ黻ؤѴͭˤޤΥץϥǥեȤͭˤʤäƤޤ顼黻Υѡɱ黻ؤѴ̵ˤˤϡ\fI\-XX:\-UseSuperWord\fRꤷޤ +スカラー演算のスーパーワード演算への変換を有効にします。このオプションはデフォルトで有効になっています。スカラー演算のスーパーワード演算への変換を無効にするには、\fI\-XX:\-UseSuperWord\fRを指定します。 .RE -.SS "٤ʥӥӥƥץ" +.SS "高度なサービスアビリティ・オプション" .PP -Υץϡƥܺ٤ʥǥХå¹Ԥ뵡ǽ󶡤ޤ +これらのオプションは、システム情報を収集し、詳細なデバッグを実行する機能を提供します。 .PP \-XX:+ExtendedDTraceProbes .RS 4 -ѥեޥ󥹤˱ƶͿɲä\fIdtrace\fRġ롦ץ֤ͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢ\fIdtrace\fRɸץ֤Τߤ¹Ԥޤ +パフォーマンスに影響を与える追加の\fIdtrace\fRツール・プローブを有効にします。デフォルトでは、このオプションは無効になっており、\fIdtrace\fRは標準プローブのみを実行します。 .RE .PP \-XX:+HeapDumpOnOutOfMemory .RS 4 -\fIjava\&.lang\&.OutOfMemoryError\fR㳰줿ˡҡסץե(HPROF)ѤơߤΥǥ쥯ȥΥեؤJavaҡפΥפͭˤޤ\fI\-XX:HeapDumpPath\fRץѤơҡססեΥѥ̾ŪǤޤǥեȤǤϡΥץ̵Ǥꡢ\fIOutOfMemoryError\fR㳰줿˥ҡפϥפޤ +\fIjava\&.lang\&.OutOfMemoryError\fR例外がスローされた場合に、ヒープ・プロファイラ(HPROF)を使用して、現在のディレクトリ内のファイルへのJavaヒープのダンプを有効にします。\fI\-XX:HeapDumpPath\fRオプションを使用して、ヒープ・ダンプ・ファイルのパスおよび名前を明示的に設定できます。デフォルトでは、このオプションは無効であり、\fIOutOfMemoryError\fR例外がスローされた場合にヒープはダンプされません。 .RE .PP \-XX:HeapDumpPath=\fIpath\fR .RS 4 -\fI\-XX:+HeapDumpOnOutOfMemoryError\fRץꤵƤ硢ҡסץե(HPROF)󶡤ҡספ񤭹ѥӥե̾ꤷޤǥեȤǤϡΥեϡߤκȥǥ쥯ȥ˺졢̾\fIjava_pid\fR\fIpid\fR\fI\&.hprof\fR -(\fIpid\fRϥ顼θȤʤäץμ̻)ˤʤޤǤϡǥեȤΥեŪꤹˡ򼨤ޤ(\fI%p\fRϸߤΥץμ̻Ҥɽޤ) +\fI\-XX:+HeapDumpOnOutOfMemoryError\fRオプションが設定されている場合、ヒープ・プロファイラ(HPROF)が提供するヒープ・ダンプを書き込むパスおよびファイル名を設定します。デフォルトでは、このファイルは、現在の作業ディレクトリに作成され、名前は\fIjava_pid\fR\fIpid\fR\fI\&.hprof\fR +(\fIpid\fRはエラーの原因となったプロセスの識別子)になります。次の例では、デフォルトのファイルを明示的に設定する方法を示します(\fI%p\fRは現在のプロセスの識別子を表します)。 .sp .if n \{\ .RS 4 @@ -1648,7 +1648,7 @@ JIT .if n \{\ .RE .\} -Ǥϡҡססե\fI/var/log/java/java_heapdump\&.hprof\fRꤹˡ򼨤ޤ +次の例では、ヒープ・ダンプ・ファイルを\fI/var/log/java/java_heapdump\&.hprof\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1663,9 +1663,9 @@ JIT .PP \-XX:LogFile=\fIpath\fR .RS 4 -ǡ񤭹ޤѥӥե̾ꤷޤǥեȤǤϡեϸߤκȥǥ쥯ȥ˺졢̾\fIhotspot\&.log\fRǤ +ログ・データが書き込まれるパスおよびファイル名を設定します。デフォルトでは、ファイルは現在の作業ディレクトリに作成され、名前は\fIhotspot\&.log\fRです。 .sp -Ǥϡե\fI/var/log/java/hotspot\&.log\fRꤹˡ򼨤ޤ +次の例では、ログ・ファイルを\fI/var/log/java/hotspot\&.log\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1680,39 +1680,39 @@ JIT .PP \-XX:+PrintClassHistogram .RS 4 -\fI[Control]+[C]\fR٥(\fISIGTERM\fR)˥饹󥹥󥹤ΥҥȥΰͭˤޤǥեȤǤϡΥץ̵Ǥ +\fI[Control]+[C]\fRイベント(\fISIGTERM\fR)後にクラス・インスタンスのヒストグラムの印刷を有効にします。デフォルトでは、このオプションは無効です。 .sp -Υץꤹȡ\fIjmap \-histo\fRޥɡޤ\fIjcmd \fR\fIpid\fR\fI GC\&.class_histogram\fRޥ(\fIpid\fRϸߤJavaץμ̻)¹ԤƱˤʤޤ +このオプションを設定すると、\fIjmap \-histo\fRコマンド、または\fIjcmd \fR\fIpid\fR\fI GC\&.class_histogram\fRコマンド(\fIpid\fRは現在のJavaプロセスの識別子)を実行する場合と同じになります。 .RE .PP \-XX:+PrintConcurrentLocks .RS 4 .sp -\fI[Control]+[C]\fR٥(\fISIGTERM\fR)\fIjava\&.util\&.concurrent\fRåΰͭˤޤǥեȤǤϡΥץ̵Ǥ +\fI[Control]+[C]\fRイベント(\fISIGTERM\fR)後に\fIjava\&.util\&.concurrent\fRロックの印刷を有効にします。デフォルトでは、このオプションは無効です。 .sp -Υץꤹȡ\fIjstack \-l\fRޥɡޤ\fIjcmd \fR\fIpid\fR\fI Thread\&.print \-l\fRޥ(\fIpid\fRϸߤJavaץμ̻)¹ԤƱˤʤޤ +このオプションを設定すると、\fIjstack \-l\fRコマンド、または\fIjcmd \fR\fIpid\fR\fI Thread\&.print \-l\fRコマンド(\fIpid\fRは現在のJavaプロセスの識別子)を実行する場合と同じになります。 .RE .PP \-XX:+UnlockDiagnosticVMOptions .RS 4 -JVMοǤŪȤץ򥢥åޤǥեȤǤϡΥץ̵ǤꡢǥץϻѤǤޤ +JVMの診断を目的としたオプションをアンロックします。デフォルトでは、このオプションは無効であり、診断オプションは使用できません。 .RE -.SS "٤ʥ١쥯󡦥ץ" +.SS "高度なガベージ・コレクション・オプション" .PP -Υץϡ١쥯(GC)Java HotSpot VMˤäƤɤΤ褦˼¹Ԥ뤫椷ޤ +これらのオプションは、ガベージ・コレクション(GC)がJava HotSpot VMによってどのように実行されるかを制御します。 .PP \-XX:+AggressiveHeap .RS 4 -JavaҡפκŬͭˤޤˤꡢԥ塼ι(RAMCPU)˴Ťơ͡ʥѥ᡼꡼Ƥ椷Ĺּ¹ԥ֤˺Ŭˤʤ褦ꤵޤǥեȤǤϡΥץ̵ǤꡢҡפϺŬޤ +Javaヒープの最適化を有効にします。これにより、コンピュータの構成(RAMおよびCPU)に基づいて、様々なパラメータが、メモリー割当てが集中した長時間実行ジョブに最適になるように設定されます。デフォルトでは、このオプションは無効であり、ヒープは最適化されません。 .RE .PP \-XX:AllocatePrefetchDistance=\fIsize\fR .RS 4 -֥ȳƤΥץեåΥΥ(Хñ)ꤷޤ֥Ȥͤǽ񤭹⤦Ȥ꡼ϡǸ˳Ƥ줿֥ȤΥɥ쥹顢εΥޤǥץեåޤJavaåɤˤȼγƥݥȤޤ +オブジェクト割当てのプリフェッチ距離のサイズ(バイト単位)を設定します。新規オブジェクトの値で書き込もうとするメモリーは、最後に割り当てられたオブジェクトのアドレスから、この距離までプリフェッチされます。各Javaスレッドには独自の割当てポイントがあります。 .sp -ͤϡץեåΥϥץåȥե˴Ť򤵤뤳Ȥ򼨤ޤͤϡץեåХȿǤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤ\-1ꤵƤޤ +負の値は、プリフェッチ距離はプラットフォームに基づいて選択されることを示します。正の値は、プリフェッチするバイト数です。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は\-1に設定されています。 .sp -ǤϡץեåΥ1024ХȤꤹˡ򼨤ޤ +次の例では、プリフェッチ距離を1024バイトに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1727,9 +1727,9 @@ Java .PP \-XX:AllocatePrefetchLines=\fIlines\fR .RS 4 -ѥ뤵줿ɤץեå̿ѤơǸΥ֥ȳƸ˥ɤ륭åԿꤷޤǸ˳Ƥ줿֥Ȥ󥹥󥹤ξϡǥեͤ1ˤʤꡢξ3ˤʤޤ +コンパイルされたコードで生成されるプリフェッチ命令を使用して、最後のオブジェクト割当て後にロードするキャッシュ行数を設定します。最後に割り当てられたオブジェクトがインスタンスの場合は、デフォルト値は1になり、配列の場合は3になります。 .sp -Ǥϡɤ륭åԿ5ꤹˡ򼨤ޤ +次の例では、ロードされるキャッシュ行数を5に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1744,42 +1744,42 @@ Java .PP \-XX:AllocatePrefetchStyle=\fIstyle\fR .RS 4 -ץեå̿륳ɡꤷޤ\fIstyle\fRϡ03ޤǤǤ +プリフェッチ命令に生成されるコード・スタイルを設定します。\fIstyle\fR引数は、0から3までの整数です。 .PP 0 .RS 4 -ץեå̿ޤ +プリフェッチ命令を生成しません。 .RE .PP 1 .RS 4 -ƳƤθǡץեå̿¹ԤޤϥǥեȤΥѥ᡼Ǥ +各割当ての後で、プリフェッチ命令を実行します。これはデフォルトのパラメータです。 .RE .PP 2 .RS 4 -åɡʳƥ֥å(TLAB)ޡݥ󥿤Ѥơץեå̿¹Ԥ륿ߥ󥰤ꤷޤ +スレッド・ローカルな割当てブロック(TLAB)ウォーターマーク・ポインタを使用して、プリフェッチ命令を実行するタイミングを決定します。 .RE .PP 3 .RS 4 -ƥץեåѤSPARCBIS̿Ѥޤ +割当てプリフェッチ用のSPARCでBIS命令を使用します。 .RE .RE .PP \-XX:+AlwaysPreTouch .RS 4 -JVMνJavaҡ׾Τ٤ƤΥڡΥåͭˤޤˤꡢ\fImain()\fR᥽åɤˡ٤ƤΥڡ꡼˼ޤΥץϡʪ꡼˥ޥåפ줿٤Ƥβۥ꡼ޤĹּ¹ԤΥƥ򥷥ߥ졼ȤƥȤǻѤǤޤǥեȤǤϡΥץ̵ˤʤäƤꡢJVMҡΰ褬äѤˤʤȡ٤ƤΥڡߥåȤޤ +JVMの初期化中にJavaヒープ上のすべてのページのタッチを有効にします。これにより、\fImain()\fRメソッドの入力前に、すべてのページがメモリーに取得されます。このオプションは、物理メモリーにマップされたすべての仮想メモリーを含む長時間実行のシステムをシミュレートするテストで使用できます。デフォルトでは、このオプションは無効になっており、JVMヒープ領域がいっぱいになると、すべてのページがコミットされます。 .RE .PP \-XX:+CMSClassUnloadingEnabled .RS 4 -¹ԥޡ(CMS)١쥯Ѥˡɤ륯饹ͭˤޤΥץϥǥեȤͭˤʤäƤޤCMS١쥯Υ饹ɤ̵ˤˤϡ\fI\-XX:\-CMSClassUnloadingEnabled\fRꤷޤ +並行マークスイープ(CMS)ガベージ・コレクタを使用する場合に、アンロードするクラスを有効にします。このオプションはデフォルトで有効になっています。CMSガベージ・コレクタのクラス・アンロードを無効にするには、\fI\-XX:\-CMSClassUnloadingEnabled\fRを指定します。 .RE .PP \-XX:CMSExpAvgFactor=\fIpercent\fR .RS 4 -¹ԥ쥯פλؿʿѤ׻ݤˡߤΥץŤդ뤿˻Ѥ֤γ(0100ޤ)ꤷޤǥեȤǤϡؿʿѷ25%ꤵƤޤǤϡ15%ꤹˡ򼨤ޤ +並行コレクション統計の指数平均を計算する際に、現在のサンプルを重み付けするために使用される時間の割合(0から100まで)を設定します。デフォルトでは、指数平均係数は25%に設定されています。次の例では、係数を15%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1794,9 +1794,9 @@ JVM .PP \-XX:CMSIncrementalDutyCycle=\fIpercent\fR .RS 4 -¹ԥ쥯μ¹ԤĤƤޥʡ쥯֤λ֤γ(0100ޤ)ꤷޤ\fI\-XX:+CMSIncrementalPacing\fRͭʾ硢ǥ塼ƥ뤬ưŪꤵ졢ΥץϽͤΤߤꤷޤ +並行コレクタの実行が許可されているマイナー・コレクション間の時間の割合(0から100まで)を設定します。\fI\-XX:+CMSIncrementalPacing\fRが有効な場合、デューティ・サイクルが自動的に設定され、このオプションは初期値のみを設定します。 .sp -ǥեȤǤϡǥ塼ƥ10%ꤵƤޤǤϡǥ塼ƥ20%ꤹˡ򼨤ޤ +デフォルトでは、デューティ・サイクルは10%に設定されています。次の例では、デューティ・サイクルを20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1811,7 +1811,7 @@ JVM .PP \-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR .RS 4 -\fI\-XX:+CMSIncrementalPacing\fRͭʾ˥ǥ塼ƥβ¤Ǥޥʡ쥯֤λ֤γ(0100ޤ)ꤷޤǥեȤǤϡǥ塼ƥβ¤0%ꤵƤޤǤϡ¤10%ꤹˡ򼨤ޤ +\fI\-XX:+CMSIncrementalPacing\fRが有効な場合にデューティ・サイクルの下限であるマイナー・コレクション間の時間の割合(0から100まで)を設定します。デフォルトでは、デューティ・サイクルの下限は0%に設定されています。次の例では、下限を10%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1826,12 +1826,12 @@ JVM .PP \-XX:+CMSIncrementalMode .RS 4 -CMS쥯ʬ⡼ɤͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ2İʲGCåɤĹˤΤͭˤɬפޤ\fICMSIncremental\fRǻϤޤ뤹٤ƤΥץϡΥץͭʾΤߡŬѤޤ +CMSコレクタの増分モードを有効にします。このオプションはデフォルトで無効になっており、2つ以下のGCスレッドを持つ構成にのみ有効にする必要があります。\fICMSIncremental\fRで始まるすべてのオプションは、このオプションが有効な場合のみ、適用されます。 .RE .PP \-XX:CMSIncrementalOffset=\fIpercent\fR .RS 4 -ʬ⡼ɤΥǥ塼ƥޥʡ쥯֤Ǵ˱˰ư֤γ(0100ޤ)ꤷޤǥեȤǤϡեåȤ0%ꤵƤޤǤϡǥ塼ƥΥեåȤ25%ꤹˡ򼨤ޤ +増分モードのデューティ・サイクルをマイナー・コレクション間で期間内に右に移動する時間の割合(0から100まで)を設定します。デフォルトでは、オフセットは0%に設定されています。次の例では、デューティ・サイクルのオフセットを25%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1846,12 +1846,12 @@ CMS .PP \-XX:+CMSIncrementalPacing .RS 4 -JVMμ¹˼줿פ˴Ťơʬ⡼ɤΥǥ塼ƥμưĴͭˤޤΥץϥǥեȤͭˤʤäƤޤʬ⡼ɡǥ塼ƥμưĴ̵ˤˤϡ\fI\-XX:\-CMSIncrementalPacing\fRꤷޤ +JVMの実行中に収集された統計に基づいて、増分モードのデューティ・サイクルの自動調整を有効にします。このオプションはデフォルトで有効になっています。増分モード・デューティ・サイクルの自動調整を無効にするには、\fI\-XX:\-CMSIncrementalPacing\fRを指定します。 .RE .PP \-XX:CMSIncrementalSafetyFactor=\fIpercent\fR .RS 4 -ǥ塼ƥ׻ݤˡݼɲä뤿˻Ѥ֤γ(0100ޤ)ꤷޤǥեȤǤϡ10%ꤵƤޤǤϡ5%ꤹˡ򼨤ޤ +デューティ・サイクルを計算する際に、保守を追加するために使用される時間の割合(0から100まで)を設定します。デフォルトでは、安全係数は10%に設定されています。次の例では、安全係数を5%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1866,9 +1866,9 @@ JVM .PP \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR .RS 4 -CMS򳫻ϤŤͭΨ(0100ޤ)ꤷޤǥեͤ\-1ꤵƤޤ(ǥեȤޤ)ϡ\fI\-XX:CMSTriggerRatio\fRͭΨͤ뤿˻Ѥ뤳Ȥ̣ޤ +CMS収集サイクルを開始する古い世代の占有率(0から100まで)を設定します。デフォルト値は\-1に設定されています。負の値(デフォルトを含む)は、\fI\-XX:CMSTriggerRatio\fRが開始占有率の値を定義するために使用されることを意味します。 .sp -ǤϡͭΨ20%ꤹˡ򼨤ޤ +次の例では、占有率を20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1883,14 +1883,14 @@ CMS .PP \-XX:+CMSScavengeBeforeRemark .RS 4 -CMSȡƥåפ˥٥󥸤λԤͭˤޤǥեȤǤϡΥץ̵Ǥ +CMSコメント・ステップの前にスカベンジの試行を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:CMSTriggerRatio=\fIpercent\fR .RS 4 -CMS뤬Ϥ˳Ƥ\fI\-XX:MinHeapFreeRatio\fRˤäƻꤵͤγ(0100ޤ)ꤷޤǥեͤ80%ꤵƤޤ +CMS収集サイクルが開始する前に割り当てられる\fI\-XX:MinHeapFreeRatio\fRによって指定される値の割合(0から100まで)を設定します。デフォルト値は80%に設定されています。 .sp -ǤϡͭΨ75%ꤹˡ򼨤ޤ +次の例では、占有率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1905,9 +1905,9 @@ CMS .PP \-XX:ConcGCThreads=\fIthreads\fR .RS 4 -¹GC˻Ѥ륹åɤοꤷޤǥեͤϡJVM˻ѤǤCPUοˤäưۤʤޤ +並行GCに使用されるスレッドの数を設定します。デフォルト値は、JVMに使用できるCPUの数によって異なります。 .sp -ȤС¹GCΥåɿ2ꤹˤϡΥץꤷޤ +たとえば、並行GCのスレッド数を2に設定するには、次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -1922,24 +1922,24 @@ CMS .PP \-XX:+DisableExplicitGC .RS 4 -\fISystem\&.gc()\fRθƽФν̵ˤ륪ץͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fISystem\&.gc()\fRؤθƽФ뤳Ȥ̣ޤ\fISystem\&.gc()\fRθƽФν̵ˤʤäƤ硢JVMɬפ˱GC¹Ԥޤ +\fISystem\&.gc()\fRの呼出しの処理を無効にするオプションを有効にします。このオプションはデフォルトで無効になっており、これは\fISystem\&.gc()\fRへの呼出しが処理されることを意味します。\fISystem\&.gc()\fRの呼出しの処理が無効になっている場合、JVMは必要に応じてGCを実行します。 .RE .PP \-XX:+ExplicitGCInvokesConcurrent .RS 4 -\fISystem\&.gc()\fRꥯȤѤ뤳Ȥˤäơ¹GCθƽФͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fI\-XX:+UseConcMarkSweepGC\fRץȤȤ˻ѤΤߡͭˤ뤳ȤǤޤ +\fISystem\&.gc()\fRリクエストを使用することによって、並行GCの呼出しを有効にします。このオプションはデフォルトで無効になっており、\fI\-XX:+UseConcMarkSweepGC\fRオプションとともに使用する場合のみ、有効にすることができます。 .RE .PP \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses .RS 4 -\fISystem\&.gc()\fRꥯȤѤ¹GC˥饹򥢥ɤ뤳Ȥˤäơ¹GCθƽФͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fI\-XX:+UseConcMarkSweepGC\fRץȤȤ˻ѤΤߡͭˤ뤳ȤǤޤ +\fISystem\&.gc()\fRリクエストを使用し、並行GCサイクル中にクラスをアンロードすることによって、並行GCの呼出しを有効にします。このオプションはデフォルトで無効になっており、\fI\-XX:+UseConcMarkSweepGC\fRオプションとともに使用する場合のみ、有効にすることができます。 .RE .PP \-XX:G1HeapRegionSize=\fIsize\fR .RS 4 -١ե(G1)쥯ѤݤJavaҡפʬ꡼Υꤷޤͤˤϡ1MB32MBޤǤǤޤǥեȤΥ꡼󡦥ϡҡס˴ŤƿʹֹŪ˷ꤵޤ +ガベージファースト(G1)コレクタを使用する際にJavaヒープを細分化するリージョンのサイズを設定します。値には、1MBから32MBまでを指定できます。デフォルトのリージョン・サイズは、ヒープ・サイズに基づいて人間工学的に決定されます。 .sp -Ǥϡʬ줿16MBꤹˡ򼨤ޤ +次の例では、細分化されたサイズを16MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1954,14 +1954,14 @@ CMS .PP \-XX:+G1PrintHeapRegions .RS 4 -Ƥ줿꡼󤪤G1쥯ˤäƺ׵ᤵ줿Τ˴ؤΰͭˤޤǥեȤǤϡΥץ̵Ǥ +割り当てられたリージョンおよびG1コレクタによって再要求されたものに関する情報の印刷を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:G1ReservePercent=\fIpercent\fR .RS 4 -G1쥯ξʤԤǽ򸺤餹falseξ¤Ȥͽ󤵤줿ҡפγ(050ޤ)ꤷޤǥեȤǤϡΥץ10%ꤵƤޤ +G1コレクタの昇格が失敗する可能性を減らすためのfalseの上限として予約されたヒープの割合(0から50まで)を設定します。デフォルトでは、このオプションは10%に設定されています。 .sp -Ǥϡͽ󤵤줿ҡפ20%ꤹˡ򼨤ޤ +次の例では、予約されたヒープを20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1976,9 +1976,9 @@ G1 .PP \-XX:InitialHeapSize=\fIsize\fR .RS 4 -꡼ƥסν(Хñ)ꤷޤꤹͤϡ0ޤ1MB礭1024ܿΤ줫ˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの初期サイズ(バイト単位)を設定します。指定する値は、0、または1MBより大きい1024の倍数のいずれかにする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼Υ͡ñ̤Ѥ6MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーのサイズを様々な単位を使用して6MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1991,14 +1991,14 @@ G1 .if n \{\ .RE .\} -Υץ0ꤷ硢ϡŤȼ㤤˳Ƥ줿ιפȤꤵޤ㤤ΥҡפΥϡ\fI\-XX:NewSize\fRץѤǤޤ +このオプションを0に設定した場合、初期サイズは、古い世代と若い世代に割り当てられたサイズの合計として設定されます。若い世代のヒープのサイズは、\fI\-XX:NewSize\fRオプションを使用して設定できます。 .RE .PP \-XX:InitialSurvivorRatio=\fIratio\fR .RS 4 -롼ץåȡ١쥯Ѥ륵Хΰνꤷޤ(\fI\-XX:+UseParallelGC\fR/ޤ\fI\-XX:+UseParallelOldGC\fRץˤäͭˤʤޤ)\fI\-XX:+UseParallelGC\fRץ󤪤\fI\-XX:+UseParallelOldGC\fRץѤ뤳Ȥˤäơ롼ץåȡ١쥯ŬǥեȤͭˤޤͤϤơץꥱư˽äơХΰ褬ѹޤ(\fI\-XX:\-UseAdaptiveSizePolicy\fRץѤ)Ŭ̵ˤ硢\fI\-XX:SurvivorRatio\fRץѤơץꥱμ¹ΤΥХΰΥꤹɬפޤ +スループット・ガベージ・コレクタが使用するサバイバ領域の初期比を設定します(\fI\-XX:+UseParallelGC\fRおよび/または\fI\-XX:+UseParallelOldGC\fRオプションによって有効になります)。\fI\-XX:+UseParallelGC\fRオプションおよび\fI\-XX:+UseParallelOldGC\fRオプションを使用することによって、スループット・ガベージ・コレクタで適応サイズ指定をデフォルトで有効にします。初期値から始めて、アプリケーションの動作に従って、サバイバ領域がサイズ変更されます。(\fI\-XX:\-UseAdaptiveSizePolicy\fRオプションを使用して)適応サイズ指定を無効にした場合、\fI\-XX:SurvivorRatio\fRオプションを使用して、アプリケーションの実行全体のサバイバ領域のサイズを設定する必要があります。 .sp -μѤơ㤤Υ(Y)ӥХΰν(R)˴ŤơХΰν(S)׻Ǥޤ +次の式を使用して、若い世代のサイズ(Y)およびサバイバ領域の初期比(R)に基づいて、サバイバ領域の初期サイズ(S)を計算できます。 .sp .if n \{\ .RS 4 @@ -2009,11 +2009,11 @@ S=Y/(R+2) .if n \{\ .RE .\} -2ϡ2ĤΥХΰ򼨤ޤХΰν˻ꤹͤ礭ȡХΰνϾʤޤ +等式内の2は、2つのサバイバ領域を示します。サバイバ領域の初期比に指定する値を大きくすると、サバイバ領域の初期サイズは小さくなります。 .sp -ǥեȤǤϡХΰν8ꤵƤޤ㤤ΰ襵Υǥե(2MB)Ѥ硢Хΰν0\&.2MBˤʤޤ +デフォルトでは、サバイバ領域の初期比は8に設定されています。若い世代の領域サイズのデフォルト値(2MB)を使用した場合、サバイバ領域の初期サイズは0\&.2MBになります。 .sp -ǤϡХΰν4ꤹˡ򼨤ޤ +次の例では、サバイバ領域の初期比を4に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2028,9 +2028,9 @@ S=Y/(R+2) .PP \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR .RS 4 -¹GC򳫻ϤҡͭΨ(0100ޤ)ꤷޤϡ1ĤΤ(ȤG1١쥯ʤ)ǤϤʤҡΤͭ˴Ť¹GCȥꥬ륬١쥯ˤäƻѤޤ +並行GCサイクルを開始するヒープ占有率(0から100まで)を設定します。これは、1つの世代のみ(たとえばG1ガベージ・コレクタなど)ではなく、ヒープ全体の占有に基づいて並行GCサイクルをトリガーするガベージ・コレクタによって使用されます。 .sp -ǥեȤǤϡͤ45%ꤵƤޤ0ϡGC뤬ߤʤȤ̣ޤǤϡϥҡͭΨ75%ꤹˡ򼨤ޤ +デフォルトでは、開始値は45%に設定されています。値0は、GCサイクルが停止しないことを意味します。次の例では、開始ヒープ占有率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2045,9 +2045,9 @@ S=Y/(R+2) .PP \-XX:MaxGCPauseMillis=\fItime\fR .RS 4 -GCٻ߻(ߥñ)ΥåȤꤷޤϥեȡΤᡢJVMϼ¸Τ˺Ϥ򤷤ޤǥեȤǤϡٻ߻֤κͤϤޤ +最大GC休止時間(ミリ秒単位)のターゲットを設定します。これはソフト・ゴールのため、JVMは実現のために最善の努力をします。デフォルトでは、休止時間の最大値はありません。 .sp -Ǥϡ祿åȵٻ߻֤500ߥäꤹˡ򼨤ޤ +次の例では、最大ターゲット休止時間を500ミリ秒に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2062,9 +2062,9 @@ S=Y/(R+2) .PP \-XX:MaxHeapSize=\fIsize\fR .RS 4 -꡼ƥסκ祵(Хñ)ꤷޤꤹͤϡ2MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤСǥץȤǤϡ\fI\-XX:InitialHeapSize\fR\fI\-XX:MaxHeapSize\fR̾Ʊͤꤵޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの最大サイズ(バイト単位)を設定します。指定する値は、2MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。サーバー・デプロイメントでは、\fI\-XX:InitialHeapSize\fRおよび\fI\-XX:MaxHeapSize\fRは通常同じ値に設定されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼εĤ祵͡ñ̤Ѥ80MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーの許可される最大サイズを様々な単位を使用して80MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2077,16 +2077,16 @@ S=Y/(R+2) .if n \{\ .RE .\} -Oracle Solaris 7Oracle Solaris 8 SPARCץåȥեξΤͤξ¤ϡ褽4,000MB饪Сإåɤ̤ΤǤOracle Solaris 2\&.6x86ץåȥեξξ¤ϡ褽2,000MB饪Сإåɤ̤ΤǤLinuxץåȥեξξ¤ϡ褽2,000MB饪Сإåɤ̤ΤǤ +Oracle Solaris 7およびOracle Solaris 8 SPARCプラットフォームの場合のこの値の上限は、およそ4,000MBからオーバーヘッドの量を引いたものです。Oracle Solaris 2\&.6およびx86プラットフォームの場合の上限は、およそ2,000MBからオーバーヘッドの量を引いたものです。Linuxプラットフォームの場合の上限は、およそ2,000MBからオーバーヘッドの量を引いたものです。 .sp -\fI\-XX:MaxHeapSize\fRץ\fI\-Xmx\fRƱǤ +\fI\-XX:MaxHeapSize\fRオプションは\fI\-Xmx\fRと同等です。 .RE .PP \-XX:MaxHeapFreeRatio=\fIpercent\fR .RS 4 -GC٥ȸζҡΰεĤƤγ(0100ޤ)ꤷޤҡΰ褬ͤĶƳ礷硢ΥҡפϽ̾ޤǥեȤǤϡͤ70%ꤵƤޤ +GCイベント後の空きヒープ領域の許可されている最大の割合(0から100まで)を設定します。空きヒープ領域がこの値を超えて拡大した場合、そのヒープは縮小します。デフォルトでは、この値は70%に設定されています。 .sp -ǤϡҡפκΨ75%ꤹˡ򼨤ޤ +次の例では、空きヒープの最大比率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2101,9 +2101,9 @@ GC .PP \-XX:MaxMetaspaceSize=\fIsize\fR .RS 4 -饹᥿ǡ˳Ƥ뤳ȤǤͥƥ֡꡼κ̤ꤷޤǥեȤǤϡΥ¤Ƥޤ󡣥ץꥱΥ᥿ǡ̤ϡץꥱΡ¾μ¹楢ץꥱ󡢤ӥƥǻѲǽʥ꡼̤ˤäưۤʤޤ +クラス・メタデータに割り当てることができるネイティブ・メモリーの最大量を設定します。デフォルトでは、このサイズは制限されていません。アプリケーションのメタデータの量は、アプリケーション自体、他の実行中アプリケーション、およびシステムで使用可能なメモリーの量によって異なります。 .sp -Ǥϡ饹᥿ǡκ祵256MBꤹˡ򼨤ޤ +次の例では、クラス・メタデータの最大サイズを256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2118,14 +2118,14 @@ GC .PP \-XX:MaxNewSize=\fIsize\fR .RS 4 -㤤(ʡ)Υҡפκ祵(Хñ)ꤷޤǥեͤϿʹֹŪꤵޤ +若い世代(ナーサリ)のヒープの最大サイズ(バイト単位)を設定します。デフォルト値は人間工学的に設定されます。 .RE .PP \-XX:MaxTenuringThreshold=\fIthreshold\fR .RS 4 -ŬGCǻѤƲꤷͤꤷޤͤ15Ǥǥեͤϡѥ(롼ץå)쥯ξ15CMS쥯ξ6Ǥ +適応GCサイズ指定で使用する最大殿堂入りしきい値を設定します。最大値は15です。デフォルト値は、パラレル(スループット)コレクタの場合は15、CMSコレクタの場合は6です。 .sp -ǤϡƲꤷͤ10ꤹˡ򼨤ޤ +次の例では、最大殿堂入りしきい値を10に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2140,14 +2140,14 @@ GC .PP \-XX:MetaspaceSize=\fIsize\fR .RS 4 -ǽĶȤ˥١쥯ȥꥬ롢Ƥ줿饹᥿ǡΰΥꤷޤΥ١쥯ΤͤϡѤ᥿ǡ̤ˤääޤϸޤǥեȤΥϥץåȥեˤäưۤʤޤ +最初に超えたときにガベージ・コレクションをトリガーする、割り当てられたクラス・メタデータ領域のサイズを設定します。このガベージ・コレクションのしきい値は、使用されるメタデータの量によって増加または減少します。デフォルトのサイズはプラットフォームによって異なります。 .RE .PP \-XX:MinHeapFreeRatio=\fIpercent\fR .RS 4 -GC٥ȸζҡΰεĤƤǾγ(0100ޤ)ꤷޤҡΰ褬ͤ򲼲ä硢Υҡפϳ礷ޤǥեȤǤϡͤ40%ꤵƤޤ +GCイベント後の空きヒープ領域の許可されている最小の割合(0から100まで)を設定します。空きヒープ領域がこの値を下回った場合、そのヒープは拡大します。デフォルトでは、この値は40%に設定されています。 .sp -ǤϡҡפκǾΨ25%ꤹˡ򼨤ޤ +次の例では、空きヒープの最小比率を25%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2162,7 +2162,7 @@ GC .PP \-XX:NewRatio=\fIratio\fR .RS 4 -㤤ΥȸŤΥȤΨꤷޤǥեȤǤϡΥץ2ꤵƤޤǤϡ㤤/ŤΨ1ꤹˡ򼨤ޤ +若い世代のサイズと古い世代のサイズとの比率を設定します。デフォルトでは、このオプションは2に設定されています。次の例では、若い/古いの比率を1に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2177,11 +2177,11 @@ GC .PP \-XX:NewSize=\fIsize\fR .RS 4 -㤤(ʡ)Υҡפν(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +若い世代(ナーサリ)のヒープの初期サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ҡפμ㤤꡼Ͽ֥Ȥ˻ѤޤGCϡ¾Υ꡼ꤳΥ꡼ǡˤ˼¹Ԥޤ㤤Υ硢¿ΥޥʡGC¹Ԥޤ礭硢եGCΤߤ¹ԤޤλޤǤ˻֤뤳Ȥޤ㤤ΥϡΤΥҡסȾʬ4ʬ1δ֤ˤƤȤᤷޤ +ヒープの若い世代リージョンは新しいオブジェクトに使用されます。GCは、他のリージョンよりこのリージョンで、より頻繁に実行されます。若い世代のサイズが小さすぎる場合、多数のマイナーGCが実行されます。サイズが大きすぎる場合、フルGCのみが実行されますが、完了までに時間がかかることがあります。若い世代のサイズは、全体のヒープ・サイズの半分から4分の1の間にしておくことをお薦めします。 .sp -Ǥϡ㤤ν͡ñ̤Ѥ256MBꤹˡ򼨤ޤ +次の例では、若い世代の初期サイズを様々な単位を使用して256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2194,14 +2194,14 @@ GC .if n \{\ .RE .\} -\fI\-XX:NewSize\fRץ\fI\-Xmn\fRƱǤ +\fI\-XX:NewSize\fRオプションは\fI\-Xmn\fRと同等です。 .RE .PP \-XX:ParallelGCThreads=\fIthreads\fR .RS 4 -㤤ȸŤǥѥ롦١쥯˻Ѥ륹åɤοꤷޤǥեͤϡJVM˻ѤǤCPUοˤäưۤʤޤ +若い世代と古い世代でパラレル・ガベージ・コレクションに使用するスレッドの数を設定します。デフォルト値は、JVMに使用できるCPUの数によって異なります。 .sp -ȤСѥGCΥåɿ2ꤹˤϡΥץꤷޤ +たとえば、パラレルGCのスレッド数を2に設定するには、次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -2216,52 +2216,52 @@ GC .PP \-XX:+ParallelRefProcEnabled .RS 4 -ѥ뻲ȽͭˤޤǥեȤǤϡΥץ̵Ǥ +パラレル参照処理を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintAdaptiveSizePolicy .RS 4 -Ŭ奵˴ؤνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +適応世代サイズ指定に関する情報の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGC .RS 4 -GCȤΥåνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとのメッセージの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCApplicationConcurrentTime .RS 4 -Ǹεٻ(ȤGCٻߤʤ)ʹߤ˷вᤷ֤νϤͭˤޤǥեȤǤϡΥץ̵Ǥ +最後の休止(たとえばGC休止など)以降に経過した時間の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCApplicationStoppedTime .RS 4 -ٻ(ȤGCٻߤʤ)³֤νϤͭˤޤǥեȤǤϡΥץ̵Ǥ +休止(たとえばGC休止など)が継続した時間の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX+PrintGCDateStamp .RS 4 -GCȤեפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとの日付スタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCDetails .RS 4 -GCȤξܺ٥åνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとの詳細メッセージの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCTaskTimeStamps .RS 4 -ġGCåɡȤΥॹפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +個々のGCワーカー・スレッド・タスクごとのタイムスタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCTimeStamp .RS 4 -GCȤΥॹפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとのタイムスタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintTenuringDistribution .RS 4 -Ʋ־νϤͭˤޤˡϤ򼨤ޤ +殿堂入り期間情報の出力を有効にします。次に、出力の例を示します。 .sp .if n \{\ .RS 4 @@ -2276,23 +2276,23 @@ Desired survivor size 48286924 bytes, new threshold 10 (max 10) .if n \{\ .RE .\} -1֥ȤϡǤ㤤ХФǤ(Υ٥󥸤θ˺졢ǿΥ٥󥸤¸³Edenΰ褫饵Хΰ˰ưޤ)2֥Ȥϡ2ĤΥ٥󥸤¸³ޤ(2ܤΥ٥ˡ륵Хΰ褫鼡ΰ˥ԡޤ)Τ褦³ޤ +期間1オブジェクトは、最も若いサバイバです(前のスカベンジの後に作成され、最新のスカベンジで存続し、Eden領域からサバイバ領域に移動しました)。期間2オブジェクトは、2つのスカベンジで存続します(2番目のスカベンジ中に、あるサバイバ領域から次の領域にコピーされました)。このように続きます。 .sp -ҤǤϡ28,992,024ХȤ1ĤΥ٥󥸤¸³Edenΰ褫饵Хΰ˥ԡޤ1,366,864ХȤϴ2֥ȤʤɤˤͭƤޤƹԤ3ܤͤϡnʲΥ֥ȤѥǤ +前述の例では、28,992,024バイトが1つのスカベンジで存続し、Eden領域からサバイバ領域にコピーされました。1,366,864バイトは期間2オブジェクトなどにより占有されています。各行の3番目の値は、期間n以下のオブジェクトの累積サイズです。 .sp -ǥեȤǤϡΥץ̵Ǥ +デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+ScavengeBeforeFullGC .RS 4 -줾ΥեGC˼㤤GCͭˤޤΥץϥǥեȤͭˤʤäƤޤեGC˼㤤Υ٥󥸤ԤȡŤΰ褫㤤ΰؤΥǽʥ֥Ȥο򸺤餹ȤǤ뤿ᡢ̵\fIʤ\fRȤᤷޤƥեGC˼㤤GC̵ˤˤϡ\fI\-XX:\-ScavengeBeforeFullGC\fRꤷޤ +それぞれのフルGCの前に若い世代のGCを有効にします。このオプションはデフォルトで有効になっています。フルGCの前に若い世代のスカベンジを行うと、古い世代領域から若い世代領域へのアクセスが可能なオブジェクトの数を減らすことができるため、これを無効に\fIしない\fRことをお薦めします。各フルGCの前に若い世代のGCを無効にするには、\fI\-XX:\-ScavengeBeforeFullGC\fRを指定します。 .RE .PP \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR .RS 4 -եȡǽʥ֥ȤǸ˻ȤƤҡ׾ǥƥ֤ʤޤޤˤʤäƤ(ߥñ)ꤷޤǥեͤϡҡζᥬХ1丳֤Ǥ\fI\-XX:SoftRefLRUPolicyMSPerMB\fRץϡߤΥҡס(Java HotSpot Client VM)ޤϺǽҡס(Java HotSpot Server VM)1ᥬХΥߥäɽͤޤΰ㤤ϡClient VMϡҡפ礭ΤǤϤʤեȻȤեå夹뷹ΤФServer VMϡեȻȤեå夹ΤǤϤʤҡפ礭뷹뤳Ȥ̣ޤԤξ硢\fI\-Xmx\fRץͤϡեȻȤɤΤ餤®˥١쥯󤵤뤫˽פʱƶڤܤޤ +ソフト・アクセスが可能なオブジェクトが最後に参照されてからヒープ上でアクティブなままになっている時間(ミリ秒単位)を設定します。デフォルト値は、ヒープ内の空きメガバイト当たりで1秒の存続期間です。\fI\-XX:SoftRefLRUPolicyMSPerMB\fRオプションは、現在のヒープ・サイズ(Java HotSpot Client VM用)または最大可能ヒープ・サイズ(Java HotSpot Server VM用)の1メガバイト当たりのミリ秒を表す整数値を受け入れます。この違いは、Client VMは、ヒープを大きくするのではなく、ソフト参照をフラッシュする傾向があるのに対し、Server VMは、ソフト参照をフラッシュするのではなく、ヒープを大きくする傾向があることを意味します。後者の場合、\fI\-Xmx\fRオプションの値は、ソフト参照がどのくらい迅速にガベージ・コレクションされるかに重要な影響を及ぼします。 .sp -Ǥϡͤ2\&.5äꤹˡ򼨤ޤ +次の例では、値を2\&.5秒に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2307,7 +2307,7 @@ Desired survivor size 48286924 bytes, new threshold 10 (max 10) .PP \-XX:SurvivorRatio=\fIratio\fR .RS 4 -EdenΰΥȥХΰΥȤΨꤷޤǥեȤǤϡΥץ8ꤵƤޤǤϡEden/ХΰΨ4ꤹˡ򼨤ޤ +Eden領域のサイズとサバイバ領域のサイズとの比率を設定します。デフォルトでは、このオプションは8に設定されています。次の例では、Eden/サバイバ領域の比率を4に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2322,9 +2322,9 @@ Eden .PP \-XX:TargetSurvivorRatio=\fIpercent\fR .RS 4 -㤤١쥯θ˻Ѥ륵ХΰŪγ(0100ޤ)ꤷޤǥեȤǤϡΥץ50%ꤵƤޤ +若いガベージ・コレクションの後に使用されるサバイバ領域の目的の割合(0から100まで)を設定します。デフォルトでは、このオプションは50%に設定されています。 .sp -ǤϡåȤΥХΰΨ30%ꤹˡ򼨤ޤ +次の例では、ターゲットのサバイバ領域の比率を30%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2339,9 +2339,9 @@ Eden .PP \-XX:TLABSize=\fIsize\fR .RS 4 -åɡʳƥХåե(TLAB)ν(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤΥץ0ꤵƤ硢JVMǤϽưŪ򤵤ޤ +スレッド・ローカルな割当てバッファ(TLAB)の初期サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。このオプションが0に設定されている場合、JVMでは初期サイズが自動的に選択されます。 .sp -ǤϡTLABν512KBꤹˡ򼨤ޤ +次の例では、TLABの初期サイズを512KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2356,102 +2356,102 @@ Eden .PP \-XX:+UseAdaptiveSizePolicy .RS 4 -Ŭ奵λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤŬ奵̵ˤˤϡ\fI\-XX:\-UseAdaptiveSizePolicy\fRꤷ꡼ƥסΥŪꤷޤ(\fI\-XX:SurvivorRatio\fRץ򻲹ͤˤƤ) +適応世代サイズ指定の使用を有効にします。このオプションはデフォルトで有効になっています。適応世代サイズ指定を無効にするには、\fI\-XX:\-UseAdaptiveSizePolicy\fRを指定し、メモリー割当てプールのサイズを明示的に設定します(\fI\-XX:SurvivorRatio\fRオプションを参考にしてください)。 .RE .PP \-XX:+UseCMSInitiatingOccupancyOnly .RS 4 -CMS쥯γϤΤͣδȤƤͭͤλѤͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢ¾δबѤޤ +CMSコレクタの開始のための唯一の基準としての占有値の使用を有効にします。デフォルトでは、このオプションは無効になっており、他の基準が使用されます。 .RE .PP \-XX:+UseConcMarkSweepGC .RS 4 -ŤؤCMS١쥯λѤͭˤޤץꥱԵ֤׷򡢥롼ץå(\fI\-XX:+UseParallelGC\fR)١쥯ˤäȤǤʤ硢CMS١쥯Ѥ뤳ȤᤷޤG1١쥯(\fI\-XX:+UseG1GC\fR)̤ؤȤʤޤ +古い世代へのCMSガベージ・コレクタの使用を有効にします。アプリケーションの待機時間の要件を、スループット(\fI\-XX:+UseParallelGC\fR)ガベージ・コレクタによって満たすことができない場合、CMSガベージ・コレクタを使用することをお薦めします。G1ガベージ・コレクタ(\fI\-XX:+UseG1GC\fR)は別の代替となります。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤΥץͭˤȡ\fI\-XX:+UseParNewGC\fRץ󤬼ưŪꤵޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。このオプションを有効にすると、\fI\-XX:+UseParNewGC\fRオプションが自動的に設定されます。 .RE .PP \-XX:+UseG1GC .RS 4 -G1١쥯λѤͭˤޤϥСΥ١쥯ǡ̤RAMĥޥץåޥоݤȤƤޤ⤤ΨGCٻ߻֤ɸãƱŬڤʥ롼ץåȤݻޤG1쥯ϡGCԵ֤θꤵ줿׷(ꤷͽ¬ǽ0\&.5̤εٻ߻)ġ礭ҡ(6GBʾΥ)ɬפʥץꥱ˿侩ޤ +G1ガベージ・コレクタの使用を有効にします。これはサーバー形式のガベージ・コレクタで、大量のRAMを持つマルチプロセッサ・マシンを対象としています。高い確率でGC休止時間の目標を達成し、同時に適切なスループットも維持します。G1コレクタは、GC待機時間の限定された要件(安定した予測可能な0\&.5秒未満の休止時間)を持つ、大きいヒープ(約6GB以上のサイズ)が必要なアプリケーションに推奨されます。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。 .RE .PP \-XX:+UseGCOverheadLimit .RS 4 -\fIOutOfMemoryError\fR㳰ޤǤˡGCJVMˤäפ֤γ¤ݥꥷλѤͭˤޤǥեȤǤϡΥץͭˤʤäƤꡢ١쥯˹׻֤98%¿䤵졢ҡפΥꥫХ꤬2%̤Ǥ硢ѥGCˤä\fIOutOfMemoryError\fRޤҡפ硢εǽϡץꥱĹ֤ۤȤɤޤϤޤäĽʤ¹ԤƤ֤򤹤뤿˻ѤǤޤΥץ̵ˤˤϡ\fI\-XX:\-UseGCOverheadLimit\fRꤷޤ +\fIOutOfMemoryError\fR例外がスローされるまでに、GCでJVMによって要した時間の割合を制限するポリシーの使用を有効にします。デフォルトでは、このオプションは有効になっており、ガベージ・コレクションに合計時間の98%より多く費やされ、ヒープのリカバリが2%未満である場合、パラレルGCによって\fIOutOfMemoryError\fRがスローされます。ヒープが小さい場合、この機能は、アプリケーションが長期間ほとんどまたはまったく進捗なく実行している状態を回避するために使用できます。このオプションを無効にするには、\fI\-XX:\-UseGCOverheadLimit\fRを指定します。 .RE .PP \-XX:+UseNUMA .RS 4 -ץꥱûԵ֤Υ꡼λѤä뤳ȤǡԶѰʥ꡼ƥ(NUMA)ѤޥΥץꥱΥѥեޥ󥹺ŬͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢNUMAФŬϹԤޤ󡣤Υץϡѥ롦١쥯(\fI\-XX:+UseParallelGC\fR)ѤƤΤ߻ѲǽǤ +アプリケーションで短い待機時間のメモリーの使用を増加させることで、不均一なメモリー・アーキテクチャ(NUMA)を使用したマシン上のアプリケーションのパフォーマンス最適化を有効にします。デフォルトでは、このオプションは無効になっており、NUMAに対する最適化は行われません。このオプションは、パラレル・ガベージ・コレクタ(\fI\-XX:+UseParallelGC\fR)が使用されている場合のみ使用可能です。 .RE .PP \-XX:+UseParallelGC .RS 4 -ʣΥץåѤƥץꥱΥѥեޥ󥹤夵롢ѥ롦٥󥸡١쥯(롼ץåȡ쥯ȤƤФ)λѤͭˤޤ +複数のプロセッサを利用してアプリケーションのパフォーマンスを向上させる、パラレル・スカベンジ・ガベージ・コレクタ(スループット・コレクタとも呼ばれる)の使用を有効にします。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤͭˤ硢Ū̵ˤʤꡢ\fI\-XX:+UseParallelOldGC\fRץ󤬼ưŪͭˤʤޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。これを有効にした場合、明示的に無効にしないかぎり、\fI\-XX:+UseParallelOldGC\fRオプションが自動的に有効になります。 .RE .PP \-XX:+UseParallelOldGC .RS 4 -եGCؤΥѥ롦١쥯λѤͭˤޤǥեȤǤϡΥץ̵Ǥͭˤȡ\fI\-XX:+UseParallelGC\fRץ󤬼ưŪͭˤʤޤ +フルGCへのパラレル・ガベージ・コレクタの使用を有効にします。デフォルトでは、このオプションは無効です。これを有効にすると、\fI\-XX:+UseParallelGC\fRオプションが自動的に有効になります。 .RE .PP \-XX:+UseParNewGC .RS 4 -㤤ǤΥ쥯ؤΥѥ롦åɤλѤͭˤޤǥեȤǤϡΥץ̵Ǥ\fI\-XX:+UseConcMarkSweepGC\fRץꤹȡϼưŪͭˤʤޤ +若い世代でのコレクションへのパラレル・スレッドの使用を有効にします。デフォルトでは、このオプションは無効です。\fI\-XX:+UseConcMarkSweepGC\fRオプションを設定すると、これは自動的に有効になります。 .RE .PP \-XX:+UseSerialGC .RS 4 -ꥢ롦١쥯λѤͭˤޤ١쥯󤫤̤ʵǽɬפȤʤϤñʥץꥱξˤϡϰ̤˺ŬǤǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤ +シリアル・ガベージ・コレクタの使用を有効にします。ガベージ・コレクションから特別な機能を必要としない、小規模で単純なアプリケーションの場合には、これは一般に最適な選択です。デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。 .RE .PP \-XX:+UseTLAB .RS 4 -㤤ΰǤΥåɡʳƥ֥å(TLAB)λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤTLABλѤ̵ˤˤϡ\fI\-XX:\-UseTLAB\fRꤷޤ +若い世代の領域でのスレッド・ローカルな割当てブロック(TLAB)の使用を有効にします。このオプションはデフォルトで有効になっています。TLABの使用を無効にするには、\fI\-XX:\-UseTLAB\fRを指定します。 .RE -.SS "侩Ǻ줿ץ" +.SS "非推奨で削除されたオプション" .PP -ΥץϡΥ꡼ˤϴޤޤƤޤʹߤפȤߤʤƤޤ +これらのオプションは、以前のリリースには含まれていましたが、以降は不要とみなされています。 .PP \-Xrun\fIlibname\fR .RS 4 -ꤷǥХå/ץեΥ饤֥ɤޤΥץϡ\fI\-agentlib\fRץ˼äޤ +指定したデバッグ/プロファイルのライブラリをロードします。このオプションは、\fI\-agentlib\fRオプションに取って代わられました。 .RE .PP \-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR .RS 4 -GC򳫻ϤʵͭΨ(0100ޤ)ꤷޤΥץJDK 8Ǥ侩ǡΤϤޤ +GCを開始する永久世代占有率(0から100まで)を設定します。このオプションはJDK 8では非推奨で、それに代わるものはありません。 .RE .PP \-XX:MaxPermSize=\fIsize\fR .RS 4 -ʵΰκ祵(Хñ)ꤷޤΥץϡJDK 8侩ˤʤꡢ\fI\-XX:MaxMetaspaceSize\fRץ˼äޤ +永久世代領域の最大サイズ(バイト単位)を設定します。このオプションは、JDK 8で非推奨になり、\fI\-XX:MaxMetaspaceSize\fRオプションに取って代わられました。 .RE .PP \-XX:PermSize=\fIsize\fR .RS 4 -Ķˤϥ١쥯ȥꥬ롢ʵ˳Ƥ줿ΰ(Хñ)ꤷޤΥץϡJDK 8侩ˤʤꡢ\fI\-XX:MetaspaceSize\fRץ˼äޤ +超えた場合にはガベージ・コレクションをトリガーする、永久世代に割り当てられた領域(バイト単位)を設定します。このオプションは、JDK 8で非推奨になり、\fI\-XX:MetaspaceSize\fRオプションに取って代わられました。 .RE .PP \-XX:+UseSplitVerifier .RS 4 -ڥץʬͭˤޤǥեȤǤϡΥץϰΥ꡼ǤͭˤʤäƤꡢڤϡ׻(ѥˤäƼ¹)ȡסå(JVM󥿥ˤäƼ¹)2ĤΥեʬ䤵ƤޤΥץJDK 8侩ȤʤꡢڤϥǥեȤʬ䤵졢̵ˤˡϤޤ +検証プロセスの分割を有効にします。デフォルトでは、このオプションは以前のリリースでは有効になっており、検証は、タイプ参照(コンパイラによって実行)と、タイプ・チェック(JVMランタイムによって実行)の2つのフェーズに分割されていました。このオプションはJDK 8で非推奨となり、検証はデフォルトで分割され、無効にする方法はありません。 .RE .PP \-XX:+UseStringCache .RS 4 -̤˳Ƥ줿ʸΥå󥰤ͭˤޤΥץJDK 8졢ΤϤޤ +一般に割り当てられた文字列のキャッシングを有効にします。このオプションはJDK 8から削除され、それに代わるものはありません。 .RE -.SH "ѥեޥ󥹡塼˥󥰤" +.SH "パフォーマンス・チューニングの例" .PP -Ǥϡ롼ץåȤκŬޤϥ쥹ݥ󥹻֤û̲Τ줫ԤΡŪʥ塼˥󥰡ե饰λˡ򼨤ޤ +次の例では、スループットの最適化またはレスポンス時間の短縮化のいずれかを行うための、試験的なチューニング・フラグの使用方法を示します。 .PP -\fBExample 1\fR, 롼ץåȤ夹뤿Υ塼˥ +\fBExample 1\fR, スループットを向上するためのチューニング .RS 4 .sp .if n \{\ @@ -2465,7 +2465,7 @@ java \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g .\} .RE .PP -\fBExample 2\fR, 쥹ݥ󥹻֤®뤿Υ塼˥ +\fBExample 2\fR, レスポンス時間を速くするためのチューニング .RS 4 .sp .if n \{\ @@ -2478,9 +2478,9 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .RE .\} .RE -.SH "λơ" +.SH "終了ステータス" .PP -̾νλͤưġ뤫֤ΤϡưʰǸƤӽФ줿ʥ顼ȯ뤤JVMˤ㳰줿ǤJavaץꥱϡAPIƽФ\fISystem\&.exit(exitValue)\fRѤǤդ֤ͤȤ򤹤뤳ȤǤޤͤϼΤȤǤ +通常、次の終了値が起動ツールから返されるのは、起動元が不正な引数で呼び出されたか、深刻なエラーが発生したか、あるいはJVMにより例外がスローされた場合です。ただし、Javaアプリケーションは、API呼出し\fISystem\&.exit(exitValue)\fRを使用して任意の値を返すことを選択することもできます。値は次のとおりです。 .sp .RS 4 .ie n \{\ @@ -2490,7 +2490,7 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .sp -1 .IP \(bu 2.3 .\} -\fI0\fR: ェλ +\fI0\fR: 正常終了 .RE .sp .RS 4 @@ -2501,9 +2501,9 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .sp -1 .IP \(bu 2.3 .\} -\fI>0\fR: 顼ȯ +\fI>0\fR: エラー発生 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/javac.1 b/jdk/src/linux/doc/man/ja/javac.1 index 5d829a38a81..c4c16f7f1e3 100644 --- a/jdk/src/linux/doc/man/ja/javac.1 +++ b/jdk/src/linux/doc/man/ja/javac.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javac .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javac" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javac" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javac \- Java饹ӥ󥿥եɤ߼ꡢХȥɤӥ饹ե˥ѥ뤷ޤ -.SH "" +javac \- Javaクラスおよびインタフェースの定義を読み取り、バイトコードおよびクラス・ファイルにコンパイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -62,32 +62,32 @@ javac \- Java .RE .\} .PP -ꤹǤդǤ +引数を指定する順序は任意です。 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIsourcefiles\fR .RS 4 -ѥ뤵1İʾΥե(\fIMyClass\&.java\fRʤ) +コンパイルされる1つ以上のソース・ファイル(\fIMyClass\&.java\fRなど)。 .RE .PP \fIclasses\fR .RS 4 -νоݤȤʤ1İʾΥ饹(\fIMyPackage\&.MyClass\fRʤ) +注釈の処理対象となる1つ以上のクラス(\fIMyPackage\&.MyClass\fRなど)。 .RE .PP \fI@argfiles\fR .RS 4 -ץȥեɽ1İʾΥե롣ΥեǤ\fI\-J\fRץϻǤޤ󡣥ޥɥ饤ե򻲾ȤƤ +オプションとソース・ファイルを一覧表示する1つ以上のファイル。このファイルの中では\fI\-J\fRオプションは指定できません。コマンドライン引数ファイルを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjavac\fRޥɤϡJavaץߥ󥰸ǵҤ줿饹ȥ󥿥եɤ߼ꡢХȥɤΥ饹ե˥ѥ뤷ޤ\fIjavac\fRޥɤǤϡJavaե뤪ӥ饹νǤޤ +\fIjavac\fRコマンドは、Javaプログラミング言語で記述されたクラスとインタフェースの定義を読み取り、バイトコードのクラス・ファイルにコンパイルします。\fIjavac\fRコマンドでは、Javaソース・ファイルおよびクラス内の注釈の処理もできます。 .PP -ɤΥե̾\fIjavac\fRϤˤϡ2Ĥˡޤ +ソース・コードのファイル名を\fIjavac\fRに渡すには、2つの方法があります。 .sp .RS 4 .ie n \{\ @@ -97,7 +97,7 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -եοʤϡե̾򥳥ޥɥ饤ǻꤷޤ +ソース・ファイルの数が少ない場合は、ファイル名をコマンドラインで指定します。 .RE .sp .RS 4 @@ -108,19 +108,19 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -եο¿ϡեΥե̾ޤϲԤǶڤäƻꤷޤ\fIjavac\fRޥɤǡꥹȡե̾Ƭ˥åȥޡ(@)Ѥޤ +ソース・ファイルの数が多い場合は、ファイル内のファイル名を空白または改行で区切って指定します。\fIjavac\fRコマンドで、リスト・ファイル名の先頭にアットマーク(@)を使用します。 .RE .PP -ɤΥե̾\&.javaĥҤ򡢥饹Υե̾\&.classĥҤäƤɬפޤޤեȥ饹եΤɤ⡢륯饹б롼̾äƤɬפޤȤС\fIMyClass\fRȤ̾Υ饹ϡ\fIMyClass\&.java\fRȤ̾Υե˵ҤޤΥեϡ\fIMyClass\&.class\fRȤ̾ΥХȥɡ饹ե˥ѥ뤵ޤ +ソース・コードのファイル名は\&.java拡張子を、クラスのファイル名は\&.class拡張子を持っている必要があります。また、ソース・ファイルとクラス・ファイルのどちらも、該当するクラスに対応するルート名を持っている必要があります。たとえば、\fIMyClass\fRという名前のクラスは、\fIMyClass\&.java\fRという名前のソース・ファイルに記述されます。このソース・ファイルは、\fIMyClass\&.class\fRという名前のバイトコード・クラス・ファイルにコンパイルされます。 .PP -饹ƤȡɲäΥ饹ե뤬ޤΥ饹ե̾ϡ\fIMyClass$MyInnerClass\&.class\fRΤ褦ˡ饹̾ȳ饹̾Ȥ߹礻Τˤʤޤ +内部クラスが定義されていると、追加のクラス・ファイルが生成されます。これらのクラス・ファイルの名前は、\fIMyClass$MyInnerClass\&.class\fRのように、内部クラス名と外部クラス名を組み合せたものになります。 .PP -եϡѥåĥ꡼ȿǤǥ쥯ȥꡦĥ꡼֤ޤȤС٤ƤΥե뤬\fI/workspace\fRˤ硢\fIcom\&.mysoft\&.mypack\&.MyClass\fRΥɤ\fI/workspace/com/mysoft/mypack/MyClass\&.java\fR˳Ǽޤ +ソース・ファイルは、パッケージ・ツリーを反映したディレクトリ・ツリーに配置します。たとえば、すべてのソース・ファイルが\fI/workspace\fRにある場合、\fIcom\&.mysoft\&.mypack\&.MyClass\fRのソース・コードを、\fI/workspace/com/mysoft/mypack/MyClass\&.java\fRに格納します。 .PP -ǥեȤǤϡѥϡƥ饹եб륽եƱǥ쥯ȥ˳Ǽޤ\fI\-d\fRץѤơ̤νǥ쥯ȥǤޤ -.SH "ץ" +デフォルトでは、コンパイラは、各クラス・ファイルを対応するソース・ファイルと同じディレクトリに格納します。\fI\-d\fRオプションを使用して、別の出力先ディレクトリを指定できます。 +.SH "オプション" .PP -ѥˤϡߤγȯĶǥݡȤɸ४ץΥåȤޤʳɸ४ץϡߤβۥޥ󤪤ӥѥμ˸ͭΥץǡ衢ѹǽޤɸ४ץϡ\fI\-X\fRץǻϤޤޤ +コンパイラには、現在の開発環境でサポートされる標準オプションのセットがあります。これ以外の非標準オプションは、現在の仮想マシンおよびコンパイラの実装に固有のオプションで、将来、変更される可能性があります。非標準オプションは、\fI\-X\fRオプションで始まります。 .sp .RS 4 .ie n \{\ @@ -130,7 +130,7 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -ѥ롦ץ򻲾ȤƤ +クロスコンパイル・オプションを参照してください。 .RE .sp .RS 4 @@ -141,230 +141,230 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ򻲾ȤƤ +非標準オプションを参照してください。 .RE -.SS "ɸ४ץ" +.SS "標準オプション" .PP \-A\fIkey\fR[\fI=value\fR] .RS 4 -ץåϤץꤷޤΥץϡ\fIjavac\fRľ᤹ܲΤǤϤʤ줾ΥץåǻѤǤ褦ˤʤޤ\fIkey\fRͤϡ1Ĥޤʣμ̻Ҥɥå(\&.)Ƕڤɬפޤ +注釈プロセッサに渡すオプションを指定します。これらのオプションは、\fIjavac\fRが直接解釈するのではなく、それぞれのプロセッサで使用できるようになります。\fIkey\fRの値は、1つまたは複数の識別子をドット(\&.)で区切る必要があります。 .RE .PP \-cp \fIpath\fR or \-classpath \fIpath\fR .RS 4 -桼饹ե롢(ץ)ץåȥե򸡺ꤷޤΥ饹ѥ\fICLASSPATH\fRĶѿΥ桼饹ѥ򥪡С饤ɤޤ\fICLASSPATH\fR\fI\-cp\fR\fI\-classpath\fRΤꤵƤʤ硢桼\fI饹ѥ\fRϡߤΥǥ쥯ȥˤʤޤSetting the Class Path 򻲾ȤƤ +ユーザー・クラス・ファイル、および(オプションで)注釈プロセッサとソース・ファイルを検索する場所を指定します。このクラス・パスは\fICLASSPATH\fR環境変数のユーザー・クラス・パスをオーバーライドします。\fICLASSPATH\fR、\fI\-cp\fR、\fI\-classpath\fRのいずれも指定されていない場合、ユーザーの\fIクラス・パス\fRは、現在のディレクトリになります。Setting the Class Path を参照してください。 .sp -\fI\-sourcepath\fRץ󤬻ꤵƤʤ硢ե桼饹ѥ鸡ޤ +\fI\-sourcepath\fRオプションが指定されていない場合、ソース・ファイルもユーザー・クラス・パスから検索されます。 .sp -\fI\-processorpath\fRץ󤬻ꤵƤʤ硢ץå⥯饹ѥ鸡ޤ +\fI\-processorpath\fRオプションが指定されていない場合、注釈プロセッサもクラス・パスから検索されます。 .RE .PP \-Djava\&.ext\&.dirs=\fIdirectories\fR .RS 4 -󥹥ȡѳĥǽΰ֤򥪡С饤ɤޤ +インストール済拡張機能の位置をオーバーライドします。 .RE .PP \-Djava\&.endorsed\&.dirs=\fIdirectories\fR .RS 4 -ǧ줿ɸѥΰ֤򥪡С饤ɤޤ +承認された標準パスの位置をオーバーライドします。 .RE .PP \-d \fIdirectory\fR .RS 4 -饹եνǥ쥯ȥꤷޤΥǥ쥯ȥ\fIjavac\fRǤϺʤᡢǤ¸ߤƤɬפޤ饹ѥåΰǤ硢\fIjavac\fRϡѥå̾ȿǤ֥ǥ쥯ȥ˥饹եǼɬפ˱ƥǥ쥯ȥޤ +クラス・ファイルの出力先ディレクトリを設定します。そのディレクトリは\fIjavac\fRでは作成されないため、すでに存在している必要があります。クラスがパッケージの一部である場合、\fIjavac\fRは、パッケージ名を反映したサブディレクトリ内にクラス・ファイルを格納し、必要に応じてディレクトリを作成します。 .sp \fI\-d\fR -\fI/home/myclasses\fRȻꤷ饹̾\fIcom\&.mypackage\&.MyClass\fRǤ硢饹ե\fI/home/myclasses/com/mypackage/MyClass\&.class\fRˤʤޤ +\fI/home/myclasses\fRと指定し、クラスの名前が\fIcom\&.mypackage\&.MyClass\fRである場合、クラス・ファイルは\fI/home/myclasses/com/mypackage/MyClass\&.class\fRになります。 .sp -\fI\-d\fRץ󤬻ꤵʤä硢\fIjavac\fRϡƥ饹ե򡢤Ȥʤ륽եƱǥ쥯ȥ˳Ǽޤ +\fI\-d\fRオプションが指定されなかった場合、\fIjavac\fRは、各クラス・ファイルを、その生成元となるソース・ファイルと同じディレクトリ内に格納します。 .sp -\fB:\fR -\fI\-d\fRץˤäƻꤵ줿ǥ쥯ȥϡ桼饹ѥ˼ưŪɲäޤ +\fB注意:\fR +\fI\-d\fRオプションによって指定されたディレクトリは、ユーザー・クラス・パスに自動的に追加されません。 .RE .PP \-deprecation .RS 4 -侩ΥСޤϥ饹ѤޤϥС饤ɤ뤿Ӥˡɽޤ\fI\-deprecation\fRץ󤬻ꤵƤʤ硢\fIjavac\fRϡ侩ΥСޤϥ饹ѤޤϥС饤ɤƤ륽եΥޥ꡼ɽޤ\fI\-deprecation\fRץϡ\fI\-Xlint:deprecation\fRξάɽǤ +非推奨のメンバーまたはクラスが使用またはオーバーライドされるたびに、説明を表示します。\fI\-deprecation\fRオプションが指定されていない場合、\fIjavac\fRは、非推奨のメンバーまたはクラスを使用またはオーバーライドしているソース・ファイルのサマリーを表示します。\fI\-deprecation\fRオプションは、\fI\-Xlint:deprecation\fRの省略表記です。 .RE .PP \-encoding \fIencoding\fR .RS 4 -եΥ󥳡ǥ̾(EUC\-JPUTF\-8ʤ)ꤷޤ\fI\-encoding\fRץ󤬻ꤵƤʤϡץåȥեΥǥեȡСѤޤ +ソース・ファイルのエンコーディング名(EUC\-JPやUTF\-8など)を設定します。\fI\-encoding\fRオプションが指定されていない場合は、プラットフォームのデフォルト・コンバータが使用されます。 .RE .PP \-endorseddirs \fIdirectories\fR .RS 4 -ǧ줿ɸѥΰ֤򥪡С饤ɤޤ +承認された標準パスの位置をオーバーライドします。 .RE .PP \-extdirs \fIdirectories\fR .RS 4 -\fIext\fRǥ쥯ȥΰ֤򥪡С饤ɤޤdirectoriesѿˤϡǶڤäǥ쥯ȥΥꥹȤꤷޤꤷǥ쥯ȥγJARե뤫顢饹ե뤬ޤФ줿٤ƤJARեϡ饹ѥΰˤʤޤ +\fIext\fRディレクトリの位置をオーバーライドします。directories変数には、コロンで区切ったディレクトリのリストを指定します。指定したディレクトリ内の各JARファイルから、クラス・ファイルが検索されます。検出されたすべてのJARファイルは、クラス・パスの一部になります。 .sp -ѥ(ۤʤJavaץåȥե˼줿֡ȥȥåס饹ĥǽ饹ФƥѥԤ)¹Ԥ硢Υץˤϳĥǽ饹ޤǥ쥯ȥꤷޤܺ٤ϥѥ롦ץ򻲾ȤƤ +クロスコンパイル(異なるJavaプラットフォームに実装されたブートストラップ・クラスや拡張機能クラスに対してコンパイルを行う)を実行する場合、このオプションには拡張機能クラスを含むディレクトリを指定します。詳細はクロスコンパイル・オプションを参照してください。 .RE .PP \-g .RS 4 -ѿޤह٤ƤΥǥХåޤǥեȤǤϡֹ椪ӥեΤߤޤ +ローカル変数を含むすべてのデバッグ情報を生成します。デフォルトでは、行番号およびソース・ファイル情報のみが生成されます。 .RE .PP \-g:none .RS 4 -ǥХåޤ +デバッグ情報を生成しません。 .RE .PP \-g:[\fIkeyword list\fR] .RS 4 -ޤǶڤ줿ɡꥹȤˤꤵ줿μΥǥХåΤߤޤΥɤͭǤ +カンマで区切られたキーワード・リストにより指定された、特定の種類のデバッグ情報のみを生成します。次のキーワードが有効です。 .PP source .RS 4 -եΥǥХå +ソース・ファイルのデバッグ情報。 .RE .PP lines .RS 4 -ֹΥǥХå +行番号のデバッグ情報。 .RE .PP vars .RS 4 -ѿΥǥХå +ローカル変数のデバッグ情報。 .RE .RE .PP \-help .RS 4 -ɸ४ץγפϤޤ +標準オプションの概要を出力します。 .RE .PP \-implicit:[\fIclass, none\fR] .RS 4 -Ū˥ɤ줿եФ륯饹ե椷ޤ饹եưˤϡ\fI\-implicit:class\fRѤޤ饹եˤϡ\fI\-implicit:none\fRѤޤΥץ󤬻ꤵʤäΥǥեưϡ饹եμưˤʤޤξ硢Τ褦ʥ饹ե뤬줿¹Ԥȡѥ餫ٹȯԤޤ\fI\-implicit\fRץŪꤵ줿硢ٹȯԤޤ󡣷θ򻲾ȤƤ +暗黙的にロードされたソース・ファイルに対するクラス・ファイルの生成を制御します。クラス・ファイルを自動生成するには、\fI\-implicit:class\fRを使用します。クラス・ファイルの生成を抑制するには、\fI\-implicit:none\fRを使用します。このオプションが指定されなかった場合のデフォルト動作は、クラス・ファイルの自動生成になります。その場合、そのようなクラス・ファイルが生成された時に注釈処理も実行されると、コンパイラから警告が発行されます。\fI\-implicit\fRオプションが明示的に設定された場合、警告は発行されません。型の検索を参照してください。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ(JVM)\fIoption\fRϤޤoptionˤϡJavaưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Java起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .sp -\fB:\fR -\fICLASSPATH\fR\fI\-classpath\fR\fI\-bootclasspath\fR\fI\-extdirs\fRץϡ\fIjavac\fRμ¹Ԥ˻Ѥ륯饹ꤷޤ󡣤Υץ󤪤ѿѤƥѥμ򥫥ޥ褦Ȥȡꥹ⤯¿ξ硢ɬפʽ¹Ԥޤ󡣥ѥμ򥫥ޥɬפ硢\fI\-J\fRץѤơäȤʤJavaưġ˥ץϤޤ +\fB注意:\fR +\fICLASSPATH\fR、\fI\-classpath\fR、\fI\-bootclasspath\fRおよび\fI\-extdirs\fRオプションは、\fIjavac\fRの実行に使用されるクラスを指定しません。これらのオプションおよび変数を使用してコンパイラの実装をカスタマイズしようとすると、リスクが高く、多くの場合、必要な処理が実行されません。コンパイラの実装をカスタマイズする必要がある場合、\fI\-J\fRオプションを使用して、基礎となるJava起動ツールにオプションを渡します。 .RE .PP \-nowarn .RS 4 -ٹå̵ˤޤΥץϡ\fI\-Xlint:none\fRץƱ褦ưޤ +警告メッセージを無効にします。このオプションは、\fI\-Xlint:none\fRオプションと同じように動作します。 .RE .PP \-parameters .RS 4 -ե쥯APIΥ᥽å\fIjava\&.lang\&.reflect\&.Executable\&.getParameters\fRǤ褦ˡ륯饹եΥ󥹥ȥ饯ȥ᥽åɤβѥ᡼̾Ǽޤ +リフレクションAPIのメソッド\fIjava\&.lang\&.reflect\&.Executable\&.getParameters\fRが取得できるように、生成されるクラス・ファイル内のコンストラクタとメソッドの仮パラメータ名を格納します。 .RE .PP \-proc: [\fInone\fR, \fIonly\fR] .RS 4 -ӥѥ¹Ԥ뤫椷ޤ\fI\-proc:none\fRϡʤǥѥ뤬¹Ԥ뤳Ȥ̣ޤ\fI\-proc:only\fRϡΤߤ¹Ԥ졢³ΥѥϤޤä¹ԤʤȤ̣ޤ +注釈処理およびコンパイルを実行するかを制御します。\fI\-proc:none\fRは、注釈処理なしでコンパイルが実行されることを意味します。\fI\-proc:only\fRは、注釈処理のみが実行され、後続のコンパイルはまったく実行されないことを意味します。 .RE .PP \-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.] .RS 4 -¹Ԥץå̾ꤷ硢ǥեȤθϾάޤ +実行する注釈プロセッサの名前。これを指定した場合、デフォルトの検索処理は省略されます。 .RE .PP \-processorpath \fIpath\fR .RS 4 -ץå򸡺ꤷޤΥץ󤬻Ѥʤ硢饹ѥΥץåޤ +注釈プロセッサを検索する場所を指定します。このオプションが使用されない場合、クラス・パスのプロセッサが検索されます。 .RE .PP \-s \fIdir\fR .RS 4 -줿եγǼȤʤǥ쥯ȥꤷޤΥǥ쥯ȥ\fIjavac\fRǤϺʤᡢǤ¸ߤƤɬפޤ饹ѥåΰǤ硢ѥϡѥå̾ȿǤ֥ǥ쥯ȥ˥եǼɬפ˱ƥǥ쥯ȥޤ +生成されたソース・ファイルの格納先となるディレクトリを指定します。そのディレクトリは\fIjavac\fRでは作成されないため、すでに存在している必要があります。クラスがパッケージの一部である場合、コンパイラは、パッケージ名を反映したサブディレクトリ内にソース・ファイルを格納し、必要に応じてディレクトリを作成します。 .sp -\fI\-s /home/mysrc\fRȻꤷ饹̾\fIcom\&.mypackage\&.MyClass\fRǤ硢ե\fI/home/mysrc/com/mypackage/MyClass\&.java\fR˳Ǽޤ +\fI\-s /home/mysrc\fRと指定し、クラスの名前が\fIcom\&.mypackage\&.MyClass\fRである場合、ソース・ファイルは\fI/home/mysrc/com/mypackage/MyClass\&.java\fRに格納されます。 .RE .PP \-source \fIrelease\fR .RS 4 -դ륽ɤΥСꤷޤ\fIrelease\fRˤϼͤǤޤ +受け付けるソース・コードのバージョンを指定します。\fIrelease\fRには次の値を指定できます。 .PP 1\&.3 .RS 4 -ΥѥǤϡJava SE 1\&.3ʹߤƳ줿Τޤ¾θ쵡ǽ򥵥ݡȤޤ +このコンパイラでは、Java SE 1\&.3以降に導入されたアサーション、総称または他の言語機能をサポートしません。 .RE .PP 1\&.4 .RS 4 -Java SE 1\&.4Ƴ줿ޤॳɤդޤ +Java SE 1\&.4で導入された、アサーションを含むコードを受け付けます。 .RE .PP 1\&.5 .RS 4 -Java SE 5Ƴ줿Τ¾θ쵡ǽޤɤդޤ +Java SE 5で導入された総称および他の言語機能を含んだコードを受け付けます。 .RE .PP 5 .RS 4 -1\&.5ƱǤ +1\&.5と同義です。 .RE .PP 1\&.6 .RS 4 -Java SE 6ǤϸФѹƳޤǤեΥ󥳡ǥ󥰡顼Java Platform, Standard EditionΰΥ꡼褦ʷٹǤϤʤ顼Ȥ𤵤褦ˤʤޤ +Java SE 6では言語に対する変更は導入されませんでした。しかし、ソース・ファイル内のエンコーディング・エラーが、Java Platform, Standard Editionの以前のリリースような警告ではなく、エラーとして報告されるようになりました。 .RE .PP 6 .RS 4 -1\&.6ƱǤ +1\&.6と同義です。 .RE .PP 1\&.7 .RS 4 -줬ǥեͤǤJava SE 7Ƴ줿ǽޤॳɤդޤ +これがデフォルト値です。Java SE 7で導入された機能を含むコードを受け付けます。 .RE .PP 7 .RS 4 -1\&.7ƱǤ +1\&.7と同義です。 .RE .RE .PP \-sourcepath \fIsourcepath\fR .RS 4 -饹ޤϥ󥿥ե򸡺륽ɡѥꤷޤ桼饹ѥƱͤˡѥΥȥϡOracle SolarisǤϥ(:)ǡWindowsǤϥߥǶڤꡢˤϡǥ쥯ȥꡢJAR֤ޤZIP֤ǤޤѥåѤƤϡǥ쥯ȥޤϥΥ롦ѥ̾ѥå̾ȿǤƤɬפޤ +クラスまたはインタフェースの定義を検索するソース・コード・パスを指定します。ユーザー・クラス・パスと同様に、ソース・パスのエントリは、Oracle Solarisではコロン(:)で、Windowsではセミコロンで区切り、ここには、ディレクトリ、JARアーカイブまたはZIPアーカイブを指定できます。パッケージを使用している場合は、ディレクトリまたはアーカイブ内のローカル・パス名がパッケージ名を反映している必要があります。 .sp -\fB:\fR -ե⸫Ĥä硢饹ѥˤ긫Ĥä饹Ϻƥѥ뤵ǽޤθ򻲾ȤƤ +\fB注意:\fR +ソース・ファイルも見つかった場合、クラス・パスにより見つかったクラスは再コンパイルされる可能性があります。型の検索を参照してください。 .RE .PP \-verbose .RS 4 -ɤ륯饹ӥѥ뤵륽ե뤴Ȥξ󤬽Ϥ롢ܺٽϤѤޤ +ロードされるクラスおよびコンパイルされるソース・ファイルごとの情報が出力される、詳細出力を使用します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-werror .RS 4 -ٹȯ˥ѥλޤ +警告が発生した場合にコンパイルを終了します。 .RE .PP \-X .RS 4 -ɸ४ץ˴ؤɽƽλޤ +非標準オプションに関する情報を表示して終了します。 .RE -.SS "ѥ롦ץ" +.SS "クロスコンパイル・オプション" .PP -ǥեȤǤϡ饹Υѥϡ\fIjavac\fRźդƤץåȥեΥ֡ȥȥåס饹ӳĥǽ饹ФƹԤޤ\fIjavac\fRϡۤʤJavaץåȥե˼줿֡ȥȥåס饹ӳĥǽ饹ФƥѥԤѥ⥵ݡȤƤޤѥԤϡ\fI\-bootclasspath\fR\fI\-extdirs\fRץѤ뤳ȤפǤ +デフォルトでは、クラスのコンパイルは、\fIjavac\fRが添付されているプラットフォームのブートストラップ・クラスおよび拡張機能クラスに対して行われます。ただし、\fIjavac\fRは、異なるJavaプラットフォームに実装されたブートストラップ・クラスおよび拡張機能クラスに対してコンパイルを行うクロスコンパイルもサポートしています。クロスコンパイルを行う場合は、\fI\-bootclasspath\fRおよび\fI\-extdirs\fRオプションを使用することが重要です。 .PP \-target \fIversion\fR .RS 4 -ۥޥλꤵ줿꡼оݤȤ륯饹եޤ饹եϡꤵ줿åȰʹߤΥ꡼ǤưޤΥ꡼JVMǤưޤͭʥåȤϡ1\&.11\&.21\&.31\&.41\&.5 (5)1\&.6 (6)1\&.7 (7)Ǥ +仮想マシンの指定されたリリースを対象とするクラス・ファイルを生成します。クラス・ファイルは、指定されたターゲット以降のリリースでは動作しますが、それより前のリリースのJVMでは動作しません。有効なターゲットは、1\&.1、1\&.2、1\&.3、1\&.4、1\&.5 (5も可)、1\&.6 (6も可)および1\&.7 (7も可)です。 .sp -\fI\-target\fRץΥǥեȤϡ\fI\-source\fRץͤˤäưۤʤޤ +\fI\-target\fRオプションのデフォルトは、\fI\-source\fRオプションの値によって異なります。 .sp .RS 4 .ie n \{\ @@ -374,7 +374,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ󤬻ꤵƤʤ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが指定されていない場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -385,7 +385,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.2ξ硢\fI\-target\fRץͤ1\&.4Ǥ +\fI\-source\fRオプションが1\&.2の場合、\fI\-target\fRオプションの値は1\&.4です。 .RE .sp .RS 4 @@ -396,7 +396,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.3ξ硢\fI\-target\fRץͤ1\&.4Ǥ +\fI\-source\fRオプションが1\&.3の場合、\fI\-target\fRオプションの値は1\&.4です。 .RE .sp .RS 4 @@ -407,7 +407,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.5ξ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが1\&.5の場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -418,7 +418,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.6ξ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが1\&.6の場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -429,23 +429,23 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ¾Τ٤Ƥͤξ硢\fI\-target\fRץͤϡ\fI\-source\fRץͤˤʤޤ +\fI\-source\fRオプションの他のすべての値の場合、\fI\-target\fRオプションの値は、\fI\-source\fRオプションの値になります。 .RE .RE .PP \-bootclasspath \fIbootclasspath\fR .RS 4 -ꤵ줿ϢΥ֡ȡ饹ФƥѥԤޤ桼饹ѥƱͤˡ֡ȡ饹ѥΥȥϥ(:)Ƕڤꡢˤϡǥ쥯ȥꡢJAR֤ޤZIP֤Ǥޤ +指定された一連のブート・クラスに対してクロスコンパイルを行います。ユーザー・クラス・パスと同様に、ブート・クラス・パスのエントリはコロン(:)で区切り、ここには、ディレクトリ、JARアーカイブまたはZIPアーカイブを指定できます。 .RE -.SS "ѥȡץե롦ץ" +.SS "コンパクト・プロファイル・オプション" .PP -JDK 8ʹߤ顢\fIjavac\fRѥϥѥȡץե򥵥ݡȤޤѥȡץեѤȡJavaץåȥեΤɬפȤʤץꥱϡǥץǽǡեåȥץȤǼ¹ԤǤޤѥȡץե뵡ǽϡץꥱ󡦥ȥΥץꥱΥɻ֤ṳ̂Τ˻ѤǤޤεǽϡJREХɥ뤹JavaץꥱΡꥳѥȤʥǥץȤΩޤεǽϡǥХǤΩޤ +JDK 8以降から、\fIjavac\fRコンパイラはコンパクト・プロファイルをサポートします。コンパクト・プロファイルを使用すると、Javaプラットフォーム全体を必要としないアプリケーションは、デプロイ可能で、小さいフットプリントで実行できます。コンパクト・プロファイル機能は、アプリケーション・ストアからのアプリケーションのダウンロード時間を短縮するのに使用できます。この機能は、JREをバンドルするJavaアプリケーションの、よりコンパクトなデプロイメントに役立ちます。この機能は、小さいデバイスでも役立ちます。 .PP -ݡȤƤץեͤϡ\fIcompact1\fR\fIcompact2\fR\fIcompact3\fRǤϡɲäΥ쥤䡼Ǥ礭ֹγƥѥȡץեˤϡֹ̾ΥץեΤ٤ƤAPIޤޤޤ +サポートされているプロファイル値は、\fIcompact1\fR、\fIcompact2\fRおよび\fIcompact3\fRです。これらは、追加のレイヤーです。大きい番号の各コンパクト・プロファイルには、小さい番号の名前のプロファイル内のすべてのAPIが含まれます。 .PP \-profile .RS 4 -ѥȡץեѤ硢Υץϡѥ˥ץե̾ꤷޤ򼨤ޤ +コンパクト・プロファイルを使用する場合、このオプションは、コンパイル時にプロファイル名を指定します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -456,7 +456,7 @@ javac \-profile compact1 Hello\&.java .if n \{\ .RE .\} -javacϡꤵ줿ץեˤʤǤդJava SE APIѤ륽ɤ򥳥ѥ뤷ޤ󡣤ϡΤ褦ʥɤ򥳥ѥ뤷褦Ȥ뤳Ȥˤä륨顼åǤ +javacは、指定されたプロファイルにない任意のJava SE APIを使用するソース・コードをコンパイルしません。これは、そのようなソース・コードをコンパイルしようとすることによって生じるエラー・メッセージの例です。 .sp .if n \{\ .RS 4 @@ -470,32 +470,32 @@ import java\&.applet\&.Applet; .if n \{\ .RE .\} -Ǥϡ\fIApplet\fR饹Ѥʤ褦˥ѹ뤳Ȥˤäơ顼Ǥޤ\-profileץꤻ˥ѥ뤹뤳Ȥˤäơ顼뤳ȤǤޤѥϡJava SE APIδʥåȤФƼ¹Ԥޤ(ɤΥѥȡץեˤ⡢\fIApplet\fR饹ϴޤޤƤޤ) +この例では、\fIApplet\fRクラスを使用しないようにソースを変更することによって、エラーを修正できます。\-profileオプションを指定せずにコンパイルすることによって、エラーを修正することもできます。コンパイルは、Java SE APIの完全なセットに対して実行されます。(どのコンパクト・プロファイルにも、\fIApplet\fRクラスは含まれていません。) .sp -ѥȡץեѤƥѥ뤹뤿̤ˡȤơ\fI\-bootclasspath\fRץѤơץեΥ᡼ꤹ\fIrt\&.jar\fRեؤΥѥꤷޤ\fI\-profile\fRץѤȡץե롦᡼ϡѥ˥ƥ¸ߤɬפޤ󡣤ϡѥΩޤ +コンパクト・プロファイルを使用してコンパイルするための別の方法として、\fI\-bootclasspath\fRオプションを使用して、プロファイルのイメージを指定する\fIrt\&.jar\fRファイルへのパスを指定します。かわりに\fI\-profile\fRオプションを使用すると、プロファイル・イメージは、コンパイル時にシステム上に存在する必要がありません。これは、クロスコンパイル時に役立ちます。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP \-Xbootclasspath/p:\fIpath\fR .RS 4 -֡ȥȥåס饹ѥɲäޤ +ブートストラップ・クラス・パスに接尾辞を追加します。 .RE .PP \-Xbootclasspath/a:\fIpath\fR .RS 4 -֡ȥȥåס饹ѥƬɲäޤ +ブートストラップ・クラス・パスに接頭辞を追加します。 .RE .PP \-Xbootclasspath/:\fIpath\fR .RS 4 -֡ȥȥåס饹եΰ֤򥪡С饤ɤޤ +ブートストラップ・クラス・ファイルの位置をオーバーライドします。 .RE .PP \-Xdoclint:[\-]\fIgroup\fR [\fI/access\fR] .RS 4 -\fIgroup\fRͤ\fIaccessibility\fR\fIsyntax\fR\fIreference\fR\fIhtml\fRޤ\fImissing\fRΤ줫ǤΥå롼פͭޤ̵ˤޤΥå롼פξܺ٤ϡ\fIjavadoc\fRޥɤ\fI\-Xdoclint\fRץ򻲾ȤƤ\fI\-Xdoclint\fRץϡ\fIjavac\fRޥɤǤϥǥեȤ̵ˤʤޤ +\fIgroup\fRの値が\fIaccessibility\fR、\fIsyntax\fR、\fIreference\fR、\fIhtml\fRまたは\fImissing\fRのいずれかである特定のチェック・グループを有効または無効にします。これらのチェック・グループの詳細は、\fIjavadoc\fRコマンドの\fI\-Xdoclint\fRオプションを参照してください。\fI\-Xdoclint\fRオプションは、\fIjavac\fRコマンドではデフォルトで無効になります。 .sp -ѿ\fIaccess\fRϡ\fI\-Xdoclint\fRץ󤬥å륯饹ȥСκǾβĻ٥ꤷޤ\fIpublic\fR\fIprotected\fR\fIpackage\fR\fIprivate\fR(Ļι⤤)1ĤĤȤǤޤȤСΥץϡ(protectedpackagepublicޤ) protectedʾΥ٥ĥ饹ӥС(٤ƤΥå롼פ)åޤ +変数\fIaccess\fRは、\fI\-Xdoclint\fRオプションがチェックするクラスとメンバーの最小の可視性レベルを指定します。\fIpublic\fR、\fIprotected\fR、\fIpackage\fRおよび\fIprivate\fRの値(可視性の高い順)の1つを持つことができます。たとえば、次のオプションは、(protected、package、publicを含む) protected以上のアクセス・レベルを持つクラスおよびメンバーを(すべてのチェック・グループで)チェックします。 .sp .if n \{\ .RS 4 @@ -506,7 +506,7 @@ import java\&.applet\&.Applet; .if n \{\ .RE .\} -ΥץϡpackageʾΥ(packagepublicޤ)ĥ饹ӥСФHTML顼åʤȤ٤ƤΥ٥ФƤ٤ƤΥå롼פͭˤޤ +次のオプションは、package以上のアクセス権(packageおよびpublicを含む)を持つクラスおよびメンバーに対するHTMLエラーをチェックしないことを除き、すべてのアクセス・レベルに対してすべてのチェック・グループを有効にします。 .sp .if n \{\ .RS 4 @@ -521,103 +521,103 @@ import java\&.applet\&.Applet; .PP \-Xdoclint:none .RS 4 -٤ƤΥå롼פ̵ˤޤ +すべてのチェック・グループを無効にします。 .RE .PP \-Xdoclint:all[\fI/access\fR] .RS 4 -٤ƤΥå롼פͭˤޤ +すべてのチェック・グループを有効にします。 .RE .PP \-Xlint .RS 4 -侩뤹٤ƤηٹͭˤޤΥ꡼ǤϡѲǽʤ٤Ƥηٹͭˤ뤳Ȥᤷޤ +推奨されるすべての警告を有効にします。このリリースでは、利用可能なすべての警告を有効にすることをお薦めします。 .RE .PP \-Xlint:all .RS 4 -侩뤹٤ƤηٹͭˤޤΥ꡼ǤϡѲǽʤ٤Ƥηٹͭˤ뤳Ȥᤷޤ +推奨されるすべての警告を有効にします。このリリースでは、利用可能なすべての警告を有効にすることをお薦めします。 .RE .PP \-Xlint:none .RS 4 -٤Ƥηٹ̵ˤޤ +すべての警告を無効にします。 .RE .PP \-Xlint:\fIname\fR .RS 4 -ٹ̵̾ˤޤΥץ̵ˤǤٹΥꥹȤϡ\-XlintץѤٹͭޤ̵򻲾ȤƤ +警告名を無効にします。このオプションで無効にできる警告のリストは、\-Xlintオプションを使用した警告の有効化または無効化を参照してください。 .RE .PP \-Xlint:\fI\-name\fR .RS 4 -ٹ̵̾ˤޤΥץ̵ˤǤٹΥꥹȤˤϡ\-XlintץѤٹͭޤ̵\-Xlint\fIץѤ\fR򻲾ȤƤ +警告名を無効にします。このオプションで無効にできる警告のリストを取得するには、\-Xlintオプションを使用した警告の有効化または無効化\-Xlint\fIオプションを使用した\fRを参照してください。 .RE .PP \-Xmaxerrs \fInumber\fR .RS 4 -륨顼κꤷޤ +印刷するエラーの最大数を設定します。 .RE .PP \-Xmaxwarns \fInumber\fR .RS 4 -ٹκꤷޤ +印刷する警告の最大数を設定します。 .RE .PP \-Xstdout \fIfilename\fR .RS 4 -ѥΥå򡢻ꤵ줿եޤǥեȤǤϡѥΥå\fISystem\&.err\fRޤ +コンパイラのメッセージを、指定されたファイルに送信します。デフォルトでは、コンパイラのメッセージは\fISystem\&.err\fRに送られます。 .RE .PP \-Xprefer:[\fInewer,source\fR] .RS 4 -뷿Фƥեȥ饹եξĤä硢ΤɤΥեɤ߼뤫ꤷޤ(θ򻲾ȤƤ)\fI\-Xprefer:newer\fRץѤ硢뷿Ф륽եȥ饹եΤɤ߼ޤ(ǥե)\fI\-Xprefer:source\fRץѤ硢ե뤬ɤ߼ޤ\fISOURCE\fR¸ݥꥷѤ줿ǤդץåǤ褦ˤϡ\fI\-Xprefer:source\fRѤƤ +ある型に対してソース・ファイルとクラス・ファイルの両方が見つかった場合、そのどちらのファイルを読み取るかを指定します。(型の検索を参照してください)。\fI\-Xprefer:newer\fRオプションを使用した場合、ある型に対するソース・ファイルとクラス・ファイルのうち新しい方が読み取られます(デフォルト)。\fI\-Xprefer:source\fRオプションを使用した場合、ソース・ファイルが読み取られます。\fISOURCE\fRの保存ポリシーを使用して宣言された注釈に任意の注釈プロセッサがアクセスできるようにする場合は、\fI\-Xprefer:source\fRを使用してください。 .RE .PP \-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR] .RS 4 -javacpackage\-info\&.javaե뤫\fIpackage\-info\&.class\fRե뤫ɤ椷ޤΥץǻѲǽmodeϼΤȤǤ +javacがpackage\-info\&.javaファイルから\fIpackage\-info\&.class\fRファイルを生成するかどうかを制御します。このオプションで使用可能なmode引数は次のとおりです。 .PP always .RS 4 -٤Ƥ\fIpackage\-info\&.java\fRե\fIpackage\-info\&.class\fRեޤΥץϡ\fI\&.java\fRեб\fI\&.class\fRե뤬뤳ȤǧAntʤɤΥӥɡƥѤΩĤȤޤ +すべての\fIpackage\-info\&.java\fRファイルの\fIpackage\-info\&.class\fRファイルを常に生成します。このオプションは、各\fI\&.java\fRファイルに対応する\fI\&.class\fRファイルがあることを確認するAntなどのビルド・システムを使用する場合に役立つことがあります。 .RE .PP legacy .RS 4 -package\-info\&.java᤬ޤޤˤΤ\fIpackage\-info\&.class\fRեޤpackage\-info\&.java˥ȤΤߴޤޤ\fIpackage\-info\&.class\fRեޤ +package\-info\&.javaに注釈が含まれる場合にのみ\fIpackage\-info\&.class\fRファイルを生成します。package\-info\&.javaにコメントのみ含まれる場合に\fIpackage\-info\&.class\fRファイルを生成しません。 .sp -\fB:\fR -\fIpackage\-info\&.class\fRեǤޤpackage\-info\&.javaեΤ٤Ƥ\fIRetentionPolicy\&.SOURCE\fR϶ˤʤޤ +\fB注意:\fR +\fIpackage\-info\&.class\fRファイルは生成できますが、package\-info\&.javaファイル内のすべての注釈に\fIRetentionPolicy\&.SOURCE\fRがある場合は空になります。 .RE .PP nonempty .RS 4 -package\-info\&.java\fIRetentionPolicy\&.CLASS\fRޤ\fIRetentionPolicy\&.RUNTIME\fRȤȤ᤬ޤޤˤΤ\fIpackage\-info\&.class\fRեޤ +package\-info\&.javaに\fIRetentionPolicy\&.CLASS\fRまたは\fIRetentionPolicy\&.RUNTIME\fRとともに注釈が含まれる場合にのみ\fIpackage\-info\&.class\fRファイルを生成します。 .RE .RE .PP \-Xprint .RS 4 -ǥХåŪǻꤷΥƥɽϤޤ⥳ѥ¹Ԥޤ󡣽Ϸѹǽޤ +デバッグ目的で指定した型のテキスト表示を出力します。注釈処理もコンパイルも実行されません。出力形式は変更される可能性があります。 .RE .PP \-XprintProcessorInfo .RS 4 -ΥץåꤵƤ˴ؤϤޤ +ある特定のプロセッサが処理を依頼されている注釈に関する情報を出力します。 .RE .PP \-XprintRounds .RS 4 -󤪤Ӹ³饦ɤ˴ؤϤޤ +初回および後続の注釈処理ラウンドに関する情報を出力します。 .RE -.SH "-XLINTץѤٹͭޤ̵" +.SH "-XLINTオプションを使用した警告の有効化または無効化" .PP -\fI\-Xlint:name\fRץѤƷٹ\fIname\fRͭˤޤǡ\fIname\fRϼηٹ̾Τ줫ˤʤޤ\fI\-Xlint:\-name:\fRץѤơٹ̵Ǥޤ +\fI\-Xlint:name\fRオプションを使用して警告\fIname\fRを有効にします。ここで、\fIname\fRは次の警告名のいずれかになります。\fI\-Xlint:\-name:\fRオプションを使用して、警告を無効化できます。 .PP cast .RS 4 -פǾĹʥ㥹ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +不要で冗長なキャストについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -632,12 +632,12 @@ String s = (String) "Hello!" .PP classfile .RS 4 -饹եƤ˴ϢˤĤƷٹ𤷤ޤ +クラス・ファイルの内容に関連した問題について警告します。 .RE .PP deprecation .RS 4 -侩ιܤλѤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +非推奨の項目の使用について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -649,13 +649,13 @@ int currentDay = myDate\&.getDay(); .if n \{\ .RE .\} -᥽å\fIjava\&.util\&.Date\&.getDay\fRJDK 1\&.1ʹߤ侩ˤʤޤ +メソッド\fIjava\&.util\&.Date\&.getDay\fRはJDK 1\&.1以降は非推奨になりました。 .RE .PP dep\-ann .RS 4 \fI@deprecated\fR -JavadocȤǥɥȲƤ뤬\fI@Deprecated\fR᤬դƤʤܤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +Javadocコメントでドキュメント化されているが、\fI@Deprecated\fR注釈が付いていない項目について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -674,7 +674,7 @@ public static void newMethod() { } .PP divzero .RS 4 -0ǽ뤳ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +定整数0で除算されることについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -689,7 +689,7 @@ int divideByZero = 42 / 0; .PP empty .RS 4 -\fIif \fRʸʹߤʸǤ뤳ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +\fIif \fR文以降が空の文であることについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -708,7 +708,7 @@ class E { .PP fallthrough .RS 4 -fall\-throughswitch֥ååФ줿ΤФƷٹåɽޤFall\-throughϡswitch֥åκǸΥǤΥɤˤbreakʸϴޤޤޤ󡣥ɤμ¹Ԥ򤽤Υ鼡ΥذưޤȤСswitch֥åcase 1٥³ɤϡbreakʸǽäƤޤ +fall\-throughケースのswitchブロックをチェックし、検出されたものに対して警告メッセージを表示します。Fall\-throughケースは、switchブロック内の最後のケースを除くケースです。このコードにはbreak文は含まれません。コードの実行をそのケースから次のケースへ移動します。たとえば、このswitchブロック内のcase 1ラベルに続くコードは、break文で終わっていません。 .sp .if n \{\ .RS 4 @@ -725,12 +725,12 @@ case 2: .if n \{\ .RE .\} -ΥɤΥѥ\fI\-Xlint:fallthrough\fRץ󤬻ѤƤ硢ѥϡˤʤäƤ륱ιֹȤȤˡcasefall\-throughǽ뤳Ȥ򼨤ٹȯԤޤ +このコードのコンパイル時に\fI\-Xlint:fallthrough\fRオプションが使用されていた場合、コンパイラは、問題になっているケースの行番号とともに、caseにfall\-throughする可能性があることを示す警告を発行します。 .RE .PP finally .RS 4 -˴λǤʤ\fIfinally\fRˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +正常に完了できない\fIfinally\fR句について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -750,17 +750,17 @@ public static int m() { .if n \{\ .RE .\} -Ǥϡѥ\fIfinally\fR֥å˴ؤٹޤ\fIint\fR᥽åɤƤӽФȡ0֤ޤ\fIfinally\fR֥åϡ\fItry\fR֥åλȼ¹ԤޤǤϡ椬\fIcatch\fR֥å˰ܤ줿硢\fIint\fR᥽åɤϽλޤ\fIfinally\fR֥åϼ¹Ԥɬפ뤿ᡢ椬᥽åɤγ˰ܤƤƤ⡢Υ֥åϼ¹Ԥޤ +この例では、コンパイラは\fIfinally\fRブロックに関する警告を生成します。\fIint\fRメソッドが呼び出されると、値0が返されます。\fIfinally\fRブロックは、\fItry\fRブロックが終了すると実行されます。この例では、制御が\fIcatch\fRブロックに移された場合、\fIint\fRメソッドは終了します。ただし、\fIfinally\fRブロックは実行される必要があるため、制御がメソッドの外部に移されていても、このブロックは実行されます。 .RE .PP options .RS 4 -ޥɥ饤󡦥ץλѤ˴ؤˤĤƷٹ𤷤ޤѥ롦ץ򻲾ȤƤ +コマンドライン・オプションの使用に関する問題について警告します。クロスコンパイル・オプションを参照してください。 .RE .PP overrides .RS 4 -᥽åɤΥС饤ɤ˴ؤˤĤƷٹ𤷤ޤȤС2ĤΥ饹Ȥޤ +メソッドのオーバーライドに関する問題について警告します。たとえば、次の2つのクラスがあるとします。 .sp .if n \{\ .RS 4 @@ -778,7 +778,7 @@ public class ClassWithOverridingMethod extends ClassWithVarargsMethod { .if n \{\ .RE .\} -ѥϡΤ褦ʷٹޤ +コンパイラは、次のような警告を生成します。 .sp .if n \{\ .RS 4 @@ -791,12 +791,12 @@ method is missing \*(Aq\&.\&.\&.\*(Aq .if n \{\ .RE .\} -ѥϡ\fIvarargs\fR᥽åɤ򸡽Фȡ\fIvarargs\fRβѥ᡼Ѵޤ᥽å\fIClassWithVarargsMethod\&.varargsMethod\fRǤϡѥ\fIvarargs\fRβѥ᡼\fIString\&.\&.\&. s\fR򲾥ѥ᡼\fIString[] s\fRѴޤϡ᥽å\fIClassWithOverridingMethod\&.varargsMethod\fRβѥ᡼бǤη̡Ǥϥѥ뤬Ԥޤ +コンパイラは、\fIvarargs\fRメソッドを検出すると、\fIvarargs\fRの仮パラメータを配列に変換します。メソッド\fIClassWithVarargsMethod\&.varargsMethod\fRでは、コンパイラは\fIvarargs\fRの仮パラメータ\fIString\&.\&.\&. s\fRを仮パラメータ\fIString[] s\fRに変換します。これは、メソッド\fIClassWithOverridingMethod\&.varargsMethod\fRの仮パラメータに対応する配列です。その結果、この例ではコンパイルが行われます。 .RE .PP path .RS 4 -ޥɥ饤Ǥ̵ʥѥǤ¸ߤʤѥǥ쥯ȥˤĤƷٹ𤷤ޤ(饹ѥѥʤɤΥѥϢ)Τ褦ʷٹ\fI@SuppressWarnings\fR뤳ȤϤǤޤ󡣤ȤСΤ褦ˤʤޤ +コマンドラインでの無効なパス要素と存在しないパス・ディレクトリについて警告します(クラス・パス、ソース・パスなどのパス関連)。このような警告を\fI@SuppressWarnings\fR注釈で抑制することはできません。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -811,9 +811,9 @@ javac \-Xlint:path \-classpath /nonexistentpath Example\&.java .PP processing .RS 4 -˴ؤˤĤƷٹ𤷤ޤѥ餬ηٹΤϡޤ९饹ȤˡѤƤץåǤΥפ㳰ǤʤǤȤСñץå򼡤˼ޤ +注釈処理に関する問題について警告します。コンパイラがこの警告を生成するのは、注釈を含むクラスがあるときに、使用している注釈プロセッサでそのタイプの例外を処理できない場合です。たとえば、単純な注釈プロセッサを次に示します。 .sp -\fBեAnnocProc\&.java\fR: +\fBソース・ファイルAnnocProc\&.java\fR: .sp .if n \{\ .RS 4 @@ -838,7 +838,7 @@ public class AnnoProc extends AbstractProcessor { .if n \{\ .RE .\} -\fBեAnnosWithoutProcessors\&.java\fR: +\fBソース・ファイルAnnosWithoutProcessors\&.java\fR: .sp .if n \{\ .RS 4 @@ -852,7 +852,7 @@ class AnnosWithoutProcessors { } .if n \{\ .RE .\} -Υޥɤϡץå\fIAnnoProc\fR򥳥ѥ뤷ץå򥽡ե\fIAnnosWithoutProcessors\&.java\fRФƼ¹Ԥޤ +次のコマンドは、注釈プロセッサ\fIAnnoProc\fRをコンパイルし、この注釈プロセッサをソース・ファイル\fIAnnosWithoutProcessors\&.java\fRに対して実行します。 .sp .if n \{\ .RS 4 @@ -864,7 +864,7 @@ javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutP .if n \{\ .RE .\} -ѥ餬ե\fIAnnosWithoutProcessors\&.java\fRФץå¹Ԥȡηٹޤ +コンパイラがソース・ファイル\fIAnnosWithoutProcessors\&.java\fRに対して注釈プロセッサを実行すると、次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -876,12 +876,12 @@ warning: [processing] No processor claimed any of these annotations: Anno .if n \{\ .RE .\} -褹뤿ˡ饹\fIAnnosWithoutProcessors\fRӻѤ̾\fIAnno\fR\fINotAnno\fRѹǤޤ +この問題を解決するために、クラス\fIAnnosWithoutProcessors\fRで定義および使用される注釈の名前を、\fIAnno\fRから\fINotAnno\fRに変更できます。 .RE .PP rawtypes .RS 4 -rawФ̤ˤĤƷٹ𤷤ޤʸǤϡ\fIrawtypes\fRٹޤ +raw型に対する未検査操作について警告します。次の文では、\fIrawtypes\fR警告が生成されます。 .sp .if n \{\ .RS 4 @@ -892,7 +892,7 @@ void countElements(List l) { \&.\&.\&. } .if n \{\ .RE .\} -Ǥϡ\fIrawtypes\fRٹޤ +次の例では、\fIrawtypes\fR警告は生成されません。 .sp .if n \{\ .RS 4 @@ -903,12 +903,12 @@ void countElements(List l) { \&.\&.\&. } .if n \{\ .RE .\} -\fIList\fRrawǤ\fIList\fRϡХɷΥ磻ɥɤΥѥ᡼줿Ǥ\fIList\fRϥѥ᡼줿󥿥եǤ뤿ᡢˤηꤷޤǤϡ\fIList\fRβϥХɷΥ磻ɥ(\fI?\fR)ѤƤβѥ᡼ȤƻꤵޤĤޤꡢ\fIcountElements\fR᥽åɤ\fIList\fR󥿥եΤɤΥ󥹥󥹲դ뤳ȤǤޤ +\fIList\fRはraw型です。ただし、\fIList\fRは、アンバウンド形式のワイルドカードのパラメータ化された型です。\fIList\fRはパラメータ化されたインタフェースであるため、常にその型引数を指定します。この例では、\fIList\fRの仮引数はアンバウンド形式のワイルドカード(\fI?\fR)を使用してその仮型パラメータとして指定されます。つまり、\fIcountElements\fRメソッドは\fIList\fRインタフェースのどのインスタンス化も受け付けることができます。 .RE .PP Serial .RS 4 -ľ󲽲ǽ饹\fIserialVersionUID\fRʤȤٹ𤷤ޤȤСΤ褦ˤʤޤ +直列化可能クラスに\fIserialVersionUID\fR定義がないことを警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -930,7 +930,7 @@ public class PersistentTime implements Serializable .if n \{\ .RE .\} -ѥϼηٹޤ +コンパイラは次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -942,12 +942,12 @@ serialVersionUID .if n \{\ .RE .\} -ľ󲽲ǽ饹\fIserialVersionUID\fRȤ̾ΥեɤŪʤ硢ľ󲽥󥿥ĶǤϡJava֥ľ󲽻͡פƤ褦ˡ饹͡¦̤˴Ťơ饹\fIserialVersionUID\fRΥǥեͤ׻ޤ٤Ƥľ󲽲ǽ饹\fIserialVersionUID\fRͤŪ뤳Ȥ򶯤ᤷޤ ϡ\fIserialVersionUID\fRͤ׻ǥեȤΥץѥμˤäưۤʤǽΤ륯饹ξܺ٤ˤƱƶ䤹η̡ľͽʤ\fIInvalidClassExceptions\fRȯǽ뤿ǤJavaѥμۤʤäƤ\fIserialVersionUID\fRͤΰݤˤˤϡľ󲽲ǽ饹\fIserialVersionUID\fRͤŪɬפޤ +直列化可能クラスが\fIserialVersionUID\fRという名前のフィールドを明示的に宣言しない場合、直列化ランタイム環境では、「Javaオブジェクト直列化仕様」で説明されているように、クラスの様々な側面に基づいて、クラスの\fIserialVersionUID\fRのデフォルト値を計算します。ただし、すべての直列化可能クラスが\fIserialVersionUID\fR値を明示的に宣言することを強くお薦めします。 これは、\fIserialVersionUID\fR値を計算するデフォルトのプロセスが、コンパイラの実装によって異なる可能性のあるクラスの詳細にきわめて影響を受けやすく、その結果、直列化復元中に予期しない\fIInvalidClassExceptions\fRが発生する可能性があるためです。Javaコンパイラの実装が異なっても\fIserialVersionUID\fR値の一貫性を確保にするには、直列化可能クラスが\fIserialVersionUID\fR値を明示的に宣言する必要があります。 .RE .PP static .RS 4 -staticλѤ˴ؤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +staticの使用に関する問題について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -961,7 +961,7 @@ class XLintStatic { .if n \{\ .RE .\} -ѥϼηٹޤ +コンパイラは次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -973,7 +973,7 @@ XLintStatic, instead of by an expression .if n \{\ .RE .\} -褹뤿ˡΤ褦\fIstatic\fR᥽å\fIm1\fRƤӽФȤǤޤ +この問題を解決するために、次のように\fIstatic\fRメソッド\fIm1\fRを呼び出すことができます。 .sp .if n \{\ .RS 4 @@ -984,12 +984,12 @@ XLintStatic\&.m1(); .if n \{\ .RE .\} -뤤ϡ\fIstatic\fRɤ᥽å\fIm1\fR뤳ȤǤޤ +あるいは、\fIstatic\fRキーワードをメソッド\fIm1\fRの宣言から削除することもできます。 .RE .PP try .RS 4 -try\-with\-resourcesʸޤࡢ\fItry\fR֥åλѤ˴ؤˤĤƷٹ𤷤ޤȤС\fItry\fR֥å줿꥽\fIac\fRѤʤˡʸФƷٹޤ +try\-with\-resources文を含む、\fItry\fRブロックの使用に関する問題について警告します。たとえば、\fItry\fRブロックで宣言されたリソース\fIac\fRが使用されないために、次の文に対して警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1004,7 +1004,7 @@ try ( AutoCloseable ac = getResource() ) { // do nothing} .PP unchecked .RS 4 -JavaͤǻꤵƤ̤Ѵٹξܺ٤򼨤ޤȤСΤ褦ˤʤޤ +Java言語仕様で指定されている未検査変換警告の詳細を示します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1016,19 +1016,19 @@ List ls = l; // unchecked warning .if n \{\ .RE .\} -ξõˡ\fIArrayList\fR\fIList\fRϡ줾\fIArrayList\fR\fIList\fRˤʤޤ +型の消去中に、型\fIArrayList\fRおよび\fIList\fRは、それぞれ\fIArrayList\fRおよび\fIList\fRになります。 .sp -\fIls\fRޥɤˤϡѥ᡼줿\fIList\fRꤵƤޤ\fIl\fRˤäƻȤ\fIList\fR\fIls\fR˳Ƥ줿硢ѥ̤ٹޤѥˡѥ餪JVMϡ\fIl\fR\fIList\fR򻲾Ȥ뤫ɤȽ̤Ǥޤ󡣤ξ硢\fIl\fRϡ\fIList\fR򻲾Ȥޤ󡣤η̡ҡױȯޤ +\fIls\fRコマンドには、パラメータ化された型\fIList\fRが指定されています。\fIl\fRによって参照される\fIList\fRが\fIls\fRに割り当てられた場合、コンパイラは未検査警告を生成します。コンパイル時に、コンパイラおよびJVMは、\fIl\fRが\fIList\fR型を参照するかどうかを判別できません。この場合、\fIl\fRは、\fIList\fR型を参照しません。その結果、ヒープ汚染が発生します。 .sp -ҡױ֤ȯΤϡ\fIList\fR֥\fIl\fR -(static\fIList\fR)̤\fIList\fR֥\fIls\fR -(ۤʤstatic\fIList\fR)ǤѥǤϤ򤤤ޤ˵ĤƤޤΤ򥵥ݡȤʤJava SEΥ꡼Ȥβ̸ߴݤ뤿ˡĤɬפޤõˤꡢ\fIList\fR\fIList\fRϡξȤ\fIList\fRˤʤޤη̡ѥϥ֥\fIl\fR -(\fIList\fRȤraw)򥪥֥\fIls\fR뤳ȤĤޤ +ヒープ汚染状態が発生するのは、\fIList\fRオブジェクト\fIl\fR +(そのstatic型は\fIList\fR)が別の\fIList\fRオブジェクト\fIls\fR +(異なるstatic型\fIList\fRを持つ)に代入される場合です。しかし、コンパイラではこの代入をいまだに許可しています。総称をサポートしないJava SEのリリースとの下位互換性を確保するために、この代入を許可する必要があります。型消去により、\fIList\fRおよび\fIList\fRは、両方とも\fIList\fRになります。その結果、コンパイラはオブジェクト\fIl\fR +(\fIList\fRというraw型を持つ)をオブジェクト\fIls\fRに代入することを許可します。 .RE .PP varargs .RS 4 -Ѱ(\fIvarargs\fR)᥽åɡäݲǽޤΤλѤǤʤȤٹ𤷤ޤȤСΤ褦ˤʤޤ +可変引数(\fIvarargs\fR)メソッド、特に非具象化可能引数を含むものの使用が安全でないことを警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1045,10 +1045,10 @@ public class ArrayBuilder { .if n \{\ .RE .\} -\fB:\fR -ݲǽϡ󤬼¹Ի˴˻ԲǽʷǤ +\fB注意:\fR +非具象化可能型は、型情報が実行時に完全に使用不可能な型です。 .sp -ѥϡ᥽å\fIArrayBuilder\&.addToList\fR˴ؤ뼡ηٹޤ +コンパイラは、メソッド\fIArrayBuilder\&.addToList\fRの定義に関する次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -1059,21 +1059,21 @@ warning: [varargs] Possible heap pollution from parameterized vararg type T .if n \{\ .RE .\} -ѥϡvarargs᥽åɤ򸡽Фȡ\fIvarargs\fRβѥ᡼ѴޤJavaץߥ󥰸Ǥϡѥ᡼줿κĤƤޤ󡣥᥽å\fIArrayBuilder\&.addToList\fRǤϡѥ\fIvarargs\fRβѥ᡼\fIT\&.\&.\&.\fRǤ򲾥ѥ᡼\fIT[]\fR()Ѵޤõˤꡢѥ\fIvarargs\fRβѥ᡼\fIObject[]\fRǤѴޤη̡ҡױȯǽޤ +コンパイラは、varargsメソッドを検出すると、\fIvarargs\fRの仮パラメータを配列に変換します。しかし、Javaプログラミング言語では、パラメータ化された型の配列の作成を許可していません。メソッド\fIArrayBuilder\&.addToList\fRでは、コンパイラは\fIvarargs\fRの仮パラメータ\fIT\&.\&.\&.\fR要素を仮パラメータ\fIT[]\fR要素(配列)に変換します。しかし、型消去により、コンパイラは\fIvarargs\fRの仮パラメータを\fIObject[]\fR要素に変換します。その結果、ヒープ汚染が発生する可能性があります。 .RE -.SH "ޥɥ饤ե" +.SH "コマンドライン引数ファイル" .PP -\fIjavac\fRޥɤûʷˤꤹ뤿ˡ\fIjavac\fRޥɤФ(\fI\-J\fRץ)ޤ1İʾΥեꤹ뤳ȤǤޤˤꡢɤΥڥ졼ƥ󥰡ƥǤ⡢ǤդĹ\fIjavac\fRޥɤǤޤ +\fIjavac\fRコマンドを短くしたり簡潔にしたりするために、\fIjavac\fRコマンドに対する引数(\fI\-J\fRオプションを除く)を含む1つ以上のファイルを指定することができます。これにより、どのオペレーティング・システム上でも、任意の長さの\fIjavac\fRコマンドを作成できます。 .PP -եˤϡ\fIjavac\fRΥץȥե̾ͳȤ߹礻ƵҤǤޤեΰϡޤϲʸǶڤ뤳ȤǤޤե̾ޤ줿򤬤硢ե̾ΤŰǰϤߤޤ +引数ファイルには、\fIjavac\fRのオプションとソース・ファイル名を自由に組み合せて記述できます。ファイル内の引数は、空白または改行文字で区切ることができます。ファイル名に埋め込まれた空白がある場合、ファイル名全体を二重引用符で囲みます。 .PP -եΥե̾ϡեΰ֤ǤϤʤߤΥǥ쥯ȥŪȤʤޤΥꥹȤǤϡ磻ɥ(*)ϻѤǤޤ(ȤС\fI*\&.java\fRȤϻǤޤ)åȥޡ(@)ѤեκƵŪʲϥݡȤƤޤ󡣤ޤ\fI\-J\fRץ⥵ݡȤƤޤ󡣤ΥץϵưġϤޤưġǤϰե򥵥ݡȤƤʤǤ +引数ファイル内のファイル名は、引数ファイルの位置ではなく、現在のディレクトリに相対的となります。これらのリストでは、ワイルドカード(*)は使用できません(たとえば、\fI*\&.java\fRとは指定できません)。アットマーク(@)を使用したファイルの再帰的な解釈はサポートされていません。また、\fI\-J\fRオプションもサポートされていません。このオプションは起動ツールに渡されますが、起動ツールでは引数ファイルをサポートしていないからです。 .PP -\fIjavac\fRޥɤ¹ԤȤˡưեΥѥ̾Ƭ˥åȥޡ(@)ʸդϤޤ\fIjavac\fRޥɤϡåȥޡ(@)ǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjavac\fRコマンドを実行するときに、各引数ファイルのパスと名前の先頭にアットマーク(@)文字を付けて渡します。\fIjavac\fRコマンドは、アットマーク(@)で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .PP -\fBExample 1\fR, ñΰե +\fBExample 1\fR, 単一の引数ファイル .RS 4 -\fIargfile\fRȤ̾ñΰեѤơ٤Ƥ\fIjavac\fRǼϡΤ褦˻ꤷޤ +\fIargfile\fRという名前の単一の引数ファイルを使用して、すべての\fIjavac\fR引数を格納する場合は、次のように指定します。 .sp .if n \{\ .RS 4 @@ -1084,14 +1084,14 @@ javac @argfile .if n \{\ .RE .\} -ΰեˤϡ2ǼƤξΥեƤ뤳ȤǤޤ +この引数ファイルには、例2で示されている両方のファイルの内容を入れることができます。 .RE .PP -\fBExample 2\fR, 2Ĥΰե +\fBExample 2\fR, 2つの引数ファイル .RS 4 -\fIjavac\fRץѤȥե̾Ѥˡ2ĤΰեǤޤΥꥹȤˤϡԤη³ʸϤޤ +\fIjavac\fRオプション用とソース・ファイル名用に、2つの引数ファイルを作成できます。次のリストには、行の継続文字はありません。 .sp -ޤoptionsȤ̾Υեޤ +次を含むoptionsという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -1113,7 +1113,7 @@ javac @argfile .if n \{\ .RE .\} -ޤclassesȤ̾Υեޤ +次を含むclassesという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -1126,7 +1126,7 @@ MyClass3\&.java .if n \{\ .RE .\} -줫顢Τ褦\fIjavac\fRޥɤ¹Ԥޤ +それから、次のように\fIjavac\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -1139,9 +1139,9 @@ javac @options @classes .\} .RE .PP -\fBExample 3\fR, ѥѤե +\fBExample 3\fR, パスを使用した引数ファイル .RS 4 -եϥѥǤޤեΤ٤ƤΥե̾ϡ(\fIpath1\fR\fIpath2\fRǤϤʤ)Τ褦˸ߤκȥǥ쥯ȥŪȤʤޤ +引数ファイルはパスを指定できますが、ファイル内のすべてのファイル名は、(\fIpath1\fRや\fIpath2\fRではなく)次のように現在の作業ディレクトリに相対的となります。 .sp .if n \{\ .RS 4 @@ -1153,46 +1153,46 @@ javac @path1/options @path2/classes .RE .\} .RE -.SH "" +.SH "注釈処理" .PP -\fIjavac\fRޥɤľܥݡȤƤ뤿ᡢΩޥɤǤ\fIapt\fRѤɬפʤʤޤ +\fIjavac\fRコマンドが注釈処理を直接サポートしているため、独立した注釈処理コマンドである\fIapt\fRを使用する必要がなくなりました。 .PP -ץåAPIϡ\fIjavax\&.annotation\&.processing\fR\fIjavax\&.lang\&.model\fRѥåȤΥ֥ѥåƤޤ -.SS "Ԥˡ" +注釈プロセッサのAPIは、\fIjavax\&.annotation\&.processing\fRおよび\fIjavax\&.lang\&.model\fRパッケージとそのサブパッケージ内に定義されています。 +.SS "注釈処理を行う方法" .PP -\fI\-proc:none\fRץˤä̵ʤ¤ꡢѥϻѲǽʤ٤Ƥץå򸡺ޤѥϡ\fI\-processorpath\fRץѤƻǤޤѥꤷʤ硢桼饹ѥѤޤץåθϡѥ\fIMETA\-INF/services/javax\&.annotation\&.processing\fR\&.ProcessorȤ̾ΥӥץХե˴ŤƹԤޤΤ褦ʥեˤϡѤ뤹٤Ƥץå̾1Ԥ1ĤĴޤƤޤ̤ˡȤơ\fI\-processor\fRץѤƥץåŪ˻ꤹ뤳ȤǤޤ +\fI\-proc:none\fRオプションによって注釈処理が無効化されない限り、コンパイラは使用可能なすべての注釈プロセッサを検索します。検索パスは、\fI\-processorpath\fRオプションを使用して指定できます。パスを指定しない場合、ユーザー・クラス・パスが使用されます。プロセッサの検索は、検索パス上の\fIMETA\-INF/services/javax\&.annotation\&.processing\fR\&.Processorという名前のサービス・プロバイダ構成ファイルに基づいて行われます。このようなファイルには、使用するすべての注釈プロセッサの名前を、1行に1つずつ含めてください。また、別の方法として、\fI\-processor\fRオプションを使用してプロセッサを明示的に指定することもできます。 .PP -ѥϡޥɥ饤Υե䥯饹뤳ȤǡɤΤ褦᤬¸ߤƤ뤫ǧȡץåФ礻ԤΥץåɤǤΤǧޤפΤĤä硢ΥץåƤӽФޤƥץåϡȤ׵Ǥޤξ硢Ф̤Υץå򸫤ĤߤϹԤޤ󡣤٤Ƥ᤬׵ᤵȡѥϤʾץåθԤޤ +コンパイラは、コマンドラインのソース・ファイルやクラスを走査することで、どのような注釈が存在しているかを確認し終わると、プロセッサに対して問合せを行い、それらのプロセッサがどの注釈を処理できるのかを確認します。一致するものが見つかった場合、そのプロセッサが呼び出されます。各プロセッサは、自身が処理する注釈を要求できます。その場合、それらの注釈に対する別のプロセッサを見つける試みは行われません。すべての注釈が要求されると、コンパイラはそれ以上プロセッサの検索を行いません。 .PP -줫Υץåˤäƿե뤬ȡ2ܤΥ饦ɤϤޤ줿٤ƤΥե뤬󤵤졢Ʊͤ᤬ޤΥ饦ɤǸƤӽФ줿ץåϤ٤ơ³ΤɤΥ饦ɤǤƤӽФޤ줬ե뤬ʤʤޤ³ޤ +いずれかのプロセッサによって新しいソース・ファイルが生成されると、注釈処理の2回目のラウンドが開始されます。新しく生成されたすべてのソース・ファイルがスキャンされ、前回と同様に注釈が処理されます。以前のラウンドで呼び出されたプロセッサはすべて、後続のどのラウンドでも呼び出されます。これが、新しいソース・ファイルが生成されなくなるまで続きます。 .PP -饦ɤǿե뤬ʤä硢ץå1Τ߸ƤӽФ졢Ĥν¹Ԥ뵡ͿޤǸˡ\fI\-proc:only\fRץ󤬻ѤʤꡢѥϡΥե줿٤ƤΥե򥳥ѥ뤷ޤ -.SS "Ū˥ɤ줿ե" +あるラウンドで新しいソース・ファイルが生成されなかった場合、注釈プロセッサがあと1回のみ呼び出され、残りの処理を実行する機会が与えられます。最後に、\fI\-proc:only\fRオプションが使用されないかぎり、コンパイラは、元のソース・ファイルと生成されたすべてのソース・ファイルをコンパイルします。 +.SS "暗黙的にロードされたソース・ファイル" .PP -ѥϡϢΥե򥳥ѥ뤹ݤˡ̤ΥեŪ˥ɤ뤳Ȥɬפʾ礬ޤθ򻲾ȤƤΤ褦ʥեϡǤоݤˤʤޤ󡣥ǥեȤǤϡ¹Ԥ졢İŪ˥ɤ줿ǤդΥե뤬ѥ뤵줿硢ѥϷٹȯԤޤ\fI\-implicit\fRץǤϡٹˡ󶡤ޤ -.SH "θ" +コンパイラは、一連のソース・ファイルをコンパイルする際に、別のソース・ファイルを暗黙的にロードすることが必要な場合があります。型の検索を参照してください。そのようなファイルは、現時点では注釈処理の対象になりません。デフォルトでは、注釈処理が実行され、かつ暗黙的にロードされた任意のソース・ファイルがコンパイルされた場合、コンパイラは警告を発行します。\fI\-implicit\fRオプションでは、警告を抑制する方法が提供されます。 +.SH "型の検索" .PP -ե򥳥ѥ뤹뤿ˡѥ̾˴ؤɬפȤޤηϥޥɥ饤ǻꤷեˤޤ󡣥ѥϡեǻѤƤ륯饹ޤϥ󥿥եĥƤ륯饹ޤϥ󥿥ե뤤ϼƤ륯饹ޤϥ󥿥ե٤ƤˤĤơξɬפȤޤˤϡեŪˤϸڤƤʤƤ⡢Ѿ̤ƾ󶡤륯饹ȥ󥿥եޤޤޤ +ソース・ファイルをコンパイルするために、コンパイラは通常、型に関する情報を必要としますが、その型の定義はコマンドラインで指定したソース・ファイルにありません。コンパイラは、ソース・ファイルで使用されているクラスまたはインタフェース、拡張されているクラスまたはインタフェース、あるいは実装されているクラスまたはインタフェースすべてについて、型の情報を必要とします。これには、ソース・ファイルで明示的には言及されていなくても、継承を通じて情報を提供するクラスとインタフェースも含まれます。 .PP -ȤС֥饹\fIjava\&.applet\&.Applet\fRȡ\fIץå\fRΥ饹(\fIjava\&.awt\&.Panel\fR\fIjava\&.awt\&.Container\fR\fIjava\&.awt\&.Component\fR\fIjava\&.lang\&.Object\fR)ѤƤ뤳Ȥˤʤޤ +たとえば、サブクラス\fIjava\&.applet\&.Applet\fRを作成すると、\fIアプレット\fRの祖先のクラス(\fIjava\&.awt\&.Panel\fR、\fIjava\&.awt\&.Container\fR、\fIjava\&.awt\&.Component\fRおよび\fIjava\&.lang\&.Object\fR)を使用していることにもなります。 .PP -ѥϡξɬפˤʤȡηƤ륽եޤϥ饹ե򸡺ޤޤ֡ȥȥåס饹ȳĥǽ饹򸡺³ƥ桼饹ѥ(ǥեȤǤϸߤΥǥ쥯ȥ)򸡺ޤ桼饹ѥϡ\fICLASSPATH\fRĶѿꤷ뤫ޤ\fI\-classpath\fRץѤޤ +コンパイラは、型の情報が必要になると、その型を定義しているソース・ファイルまたはクラス・ファイルを検索します。まず、ブートストラップ・クラスと拡張機能クラスを検索し、続いてユーザー・クラス・パス(デフォルトでは現在のディレクトリ)を検索します。ユーザー・クラス・パスは、\fICLASSPATH\fR環境変数を設定して定義するか、または\fI\-classpath\fRオプションを使用して定義します。 .PP -\fI\-sourcepath\fRץꤵƤ硢ѥϡꤵ줿ѥ饽ե򸡺ޤʳξ硢ѥϡ桼饹ѥ饯饹եȥեξ򸡺ޤ +\fI\-sourcepath\fRオプションが設定されている場合、コンパイラは、指定されたパスからソース・ファイルを検索します。それ以外の場合、コンパイラは、ユーザー・クラス・パスからクラス・ファイルとソース・ファイルの両方を検索します。 .PP -\fI\-bootclasspath\fRץ󤪤\fI\-extdirs\fRץѤơ̤Υ֡ȥȥåס饹ĥǽ饹Ǥޤѥ롦ץ򻲾ȤƤ +\fI\-bootclasspath\fRオプションおよび\fI\-extdirs\fRオプションを使用して、別のブートストラップ・クラスや拡張機能クラスを指定できます。クロスコンパイル・オプションを参照してください。 .PP -θȤ̤ϡ饹ե롢ե롢ޤϤξǤ礬ޤξĤä硢ΤɤѤ뤫\fI\-Xprefer\fRץǥѥ˻ؼǤޤ\fInewer\fRꤵ줿硢ѥ2ĤΥեΤѤޤ\fIsource\fRꤵ줿硢ѥϥեѤޤǥեȤ\fInewer\fRǤ +型の検索に成功したときに得られる結果は、クラス・ファイル、ソース・ファイル、またはその両方である場合があります。両方が見つかった場合、そのどちらを使用するかを\fI\-Xprefer\fRオプションでコンパイラに指示できます。\fInewer\fRが指定された場合、コンパイラは2つのファイルのうち新しい方を使用します。\fIsource\fRが指定された場合、コンパイラはソース・ファイルを使用します。デフォルトは\fInewer\fRです。 .PP -θΤˤäơޤ\fI\-Xprefer\fRץꤵ줿̤ȤɬפʷΥե뤬Ĥä硢ѥϤΥեɤ߼ꡢɬפʾޤǥեȤǤϡѥϥեΥѥԤޤ\fI\-implicit\fRץѤƤưǤޤ\fInone\fRꤵ줿硢եФƥ饹եޤ\fIclass\fRꤵ줿硢եФƥ饹ե뤬ޤ +型の検索自体によって、または\fI\-Xprefer\fRオプションが設定された結果として必要な型のソース・ファイルが見つかった場合、コンパイラはそのソース・ファイルを読み取り、必要な情報を取得します。デフォルトでは、コンパイラはソース・ファイルのコンパイルも行います。\fI\-implicit\fRオプションを使用してその動作を指定できます。\fInone\fRが指定された場合、ソース・ファイルに対してクラス・ファイルは生成されません。\fIclass\fRが指定された場合、ソース・ファイルに対してクラス・ファイルが生成されます。 .PP -ѥϡλޤǡ뷿ɬǧʤ礬ޤ󤬥ե˸Ĥꡢ\fI\-implicit\fRץ󤬻ꤵƤʤ硢ѥˤäơΥե뤬оݤȤʤ餺˥ѥ뤵뤳Ȥٹ𤵤ޤηٹ̵ˤˤϡ(Υե뤬оݤȤʤ褦)Υե򥳥ޥɥ饤˻ꤹ뤫뤤ϤΤ褦ʥեФƥ饹եɬפ뤫ɤ\fI\-implicit\fRץѤƻꤷޤ -.SH "ץޥƥå󥿥ե" +コンパイラは、注釈処理が完了するまで、ある型情報の必要性を認識しない場合があります。型情報がソース・ファイル内に見つかり、かつ\fI\-implicit\fRオプションが指定されていない場合、コンパイラによって、そのファイルが注釈処理の対象とならずにコンパイルされることが警告されます。この警告を無効にするには、(そのファイルが注釈処理の対象となるように)そのファイルをコマンドラインに指定するか、あるいはそのようなソース・ファイルに対してクラス・ファイルを生成する必要があるかどうかを\fI\-implicit\fRオプションを使用して指定します。 +.SH "プログラマティック・インタフェース" .PP -\fIjavac\fRޥɤϡ\fIjavax\&.tools\fRѥåΥ饹ȥ󥿥եˤä뿷Java Compiler API򥵥ݡȤޤ -.SS "" +\fIjavac\fRコマンドは、\fIjavax\&.tools\fRパッケージ内のクラスとインタフェースによって定義される新しいJava Compiler APIをサポートします。 +.SS "例" .PP -ޥɥ饤ꤹ褦˥ѥ뤹ˤϡιʸѤޤ +コマンドライン引数を指定するようにコンパイルするには、次の構文を使用します。 .sp .if n \{\ .RS 4 @@ -1205,15 +1205,15 @@ JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler(); .RE .\} .PP -ǤϡǤɸϥȥ꡼˽񤭹ߡޥɥ饤󤫤θƽФ\fIjavac\fRꤹ뽪λɤ֤ޤ +例では、診断を標準出力ストリームに書き込み、コマンドラインからの呼出し時に\fIjavac\fRが指定する終了コードを返します。 .PP -\fIjavax\&.tools\&.JavaCompiler\fR󥿥ե¾Υ᥽åɤѤȡǤνեɼ긵/ʤɤԤȤǤޤ -.SS "켰Υ󥿥ե" +\fIjavax\&.tools\&.JavaCompiler\fRインタフェースの他のメソッドを使用すると、診断の処理やファイルの読取り元/書込み先の制御などを行うことができます。 +.SS "旧式のインタフェース" .PP -\fB:\fR -APIϡ̸ߴΤˤΤݻƤޤ٤ƤοɤϡJava Compiler APIѤɬפޤ +\fB注意:\fR +このAPIは、下位互換性のためにのみ保持されています。すべての新しいコードは、新しいJava Compiler APIを使用する必要があります。 .PP -Τ褦ˡ\fIcom\&.sun\&.tools\&.javac\&.Main\fR饹ˤϡץफ饳ѥƤӽФstatic᥽åɤ2ѰդƤޤ +次のように、\fIcom\&.sun\&.tools\&.javac\&.Main\fRクラスには、プログラムからコンパイラを呼び出すためのstaticメソッドが2つ用意されています。 .sp .if n \{\ .RS 4 @@ -1226,21 +1226,21 @@ public static int compile(String[] args, PrintWriter out); .RE .\} .PP -\fIargs\fRѥ᡼ϡ̾拾ѥϤǤդΥޥɥ饤ɽƤޤ +\fIargs\fRパラメータは、通常コンパイラに渡される任意のコマンドライン引数を表しています。 .PP -\fIout\fRѥ᡼ϡѥοǽϤΰ򼨤ޤ +\fIout\fRパラメータは、コンパイラの診断出力の宛先を示します。 .PP -\fIreturn\fRͤϡ\fIjavac\fR\fIexit\fRͤƱǤ +\fIreturn\fR値は、\fIjavac\fRの\fIexit\fR値と同じです。 .PP -\fB:\fR -̾\fIcom\&.sun\&.tools\&.javac\fRǻϤޤѥå(\fIcom\&.sun\&.tools\&.javac\fRΥ֥ѥå)ǸФ¾Τ٤ƤΥ饹ӥ᥽åɤϡѤǤꡢĤǤѹǽޤ -.SH "" +\fB注意:\fR +名前が\fIcom\&.sun\&.tools\&.javac\fRで始まるパッケージ(\fIcom\&.sun\&.tools\&.javac\fRのサブパッケージ)で検出される他のすべてのクラスおよびメソッドは、完全に内部用であり、いつでも変更される可能性があります。 +.SH "例" .PP -\fBExample 1\fR, ñʥץΥѥ +\fBExample 1\fR, 簡単なプログラムのコンパイル .RS 4 -Ǥϡgreetingsǥ쥯ȥ\fIHello\&.java\fRե򥳥ѥ뤹ˡ򼨤Ƥޤ\fIHello\&.java\fR줿饹ϡ\fIgreetings\&.Hello\fRȸƤФޤgreetingsǥ쥯ȥϡեȥ饹եξѥåǥ쥯ȥǡߤΥǥ쥯ȥΤˤޤˤꡢǥեȤΥ桼饹ѥѤǤ褦ˤʤޤޤ\fI\-d\fRץѤ̤νǥ쥯ȥꤹɬפ⤢ޤ +この例では、greetingsディレクトリで\fIHello\&.java\fRソース・ファイルをコンパイルする方法を示しています。\fIHello\&.java\fRで定義されたクラスは、\fIgreetings\&.Hello\fRと呼ばれます。greetingsディレクトリは、ソース・ファイルとクラス・ファイルの両方があるパッケージ・ディレクトリで、現在のディレクトリのすぐ下にあります。これにより、デフォルトのユーザー・クラス・パスを使用できるようになります。また、\fI\-d\fRオプションを使用して別の出力先ディレクトリを指定する必要もありません。 .sp -\fIHello\&.java\fRΥɤϼΤȤǤ +\fIHello\&.java\fR内のソース・コードは次のとおりです。 .sp .if n \{\ .RS 4 @@ -1259,7 +1259,7 @@ public class Hello { .if n \{\ .RE .\} -greetings\&.HelloΥѥ: +greetings\&.Helloのコンパイル: .sp .if n \{\ .RS 4 @@ -1270,7 +1270,7 @@ javac greetings/Hello\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hello\fRμ¹: +\fIgreetings\&.Hello\fRの実行: .sp .if n \{\ .RS 4 @@ -1286,9 +1286,9 @@ Hello Everyone .\} .RE .PP -\fBExample 2\fR, ʣΥեΥѥ +\fBExample 2\fR, 複数のソース・ファイルのコンパイル .RS 4 -Ǥϡ\fIgreetings\fRѥåΥե\fIAloha\&.java\fR\fIGutenTag\&.java\fR\fIHello\&.java\fR\fIHi\&.java\fR򥳥ѥ뤷ޤ +この例では、\fIgreetings\fRパッケージのソース・ファイル\fIAloha\&.java\fR、\fIGutenTag\&.java\fR、\fIHello\&.java\fRおよび\fIHi\&.java\fRをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1304,9 +1304,9 @@ Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java .\} .RE .PP -\fBExample 3\fR, 桼饹ѥλ +\fBExample 3\fR, ユーザー・クラス・パスの指定 .RS 4 -ҤΥեΤ1ĤѹˡΥեƥѥ뤷ޤ +前述の例のソース・ファイルのうち1つを変更した後に、そのファイルを再コンパイルします。 .sp .if n \{\ .RS 4 @@ -1319,7 +1319,7 @@ javac greetings/Hi\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hi\fR\fIgreetings\fRѥå¾Υ饹򻲾ȤƤ뤿ᡢѥϤ¾Υ饹õɬפޤǥեȤΥ桼饹ѥϥѥåǥ쥯ȥޤǥ쥯ȥǤ뤿ᡢҤưޤߤΥǥ쥯ȥ򵤤ˤˤΥեƥѥ뤹硢\fICLASSPATH\fRꤷơ桼饹ѥΥǥ쥯ȥɲäޤǤϡ\fI\-classpath\fRץѤƤޤ +\fIgreetings\&.Hi\fRは\fIgreetings\fRパッケージ内の他のクラスを参照しているため、コンパイラはこれらの他のクラスを探す必要があります。デフォルトのユーザー・クラス・パスはパッケージ・ディレクトリを含むディレクトリであるため、前述の例は動作します。現在のディレクトリを気にせずにこのファイルを再コンパイルする場合、\fICLASSPATH\fRを設定して、ユーザー・クラス・パスに例のディレクトリを追加します。この例では、\fI\-classpath\fRオプションを使用しています。 .sp .if n \{\ .RS 4 @@ -1330,7 +1330,7 @@ javac \-classpath /examples /examples/greetings/Hi\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hi\fRѹƥХʡ桼ƥƥѤ褦ˤ硢 Υ桼ƥƥ桼饹ѥ̤ƥǤ褦ˤʤäƤɬפޤ +\fIgreetings\&.Hi\fRを変更してバナー・ユーティリティを使用するようにした場合、 そのユーティリティもユーザー・クラス・パスを通じてアクセスできるようになっている必要があります。 .sp .if n \{\ .RS 4 @@ -1342,7 +1342,7 @@ javac \-classpath /examples:/lib/Banners\&.jar \e .if n \{\ .RE .\} -\fIgreetings\fRѥåǥ饹¹Ԥˤϡץ\fIgreetings\fRѥå\fIgreetings\fR饹Ѥ륯饹˥ɬפޤ +\fIgreetings\fRパッケージでクラスを実行するには、プログラムは\fIgreetings\fRパッケージ、および\fIgreetings\fRクラスが使用するクラスにアクセスする必要があります。 .sp .if n \{\ .RS 4 @@ -1355,9 +1355,9 @@ java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi .\} .RE .PP -\fBExample 4\fR, եȥ饹եʬΥ +\fBExample 4\fR, ソース・ファイルとクラス・ファイルの分離 .RS 4 -Ǥϡ\fIjavac\fRѤơJVM 1\&.6Ǽ¹Ԥ륳ɤ򥳥ѥ뤷ޤ +次の例では、\fIjavac\fRを使用して、JVM 1\&.6上で実行するコードをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1369,9 +1369,9 @@ javac \-source 1\&.6 \-target 1\&.6 \-bootclasspath jdk1\&.6\&.0/lib/rt\&.jar \e .if n \{\ .RE .\} -\fI\-source 1\&.6\fRץˤꡢ\fIOldCode\&.java\fRΥѥˤϥ꡼1\&.6(ޤ6)Javaץߥ󥰸줬Ѥޤ\fI\-target 1\&.6\fRץˤꡢJVM 1\&.6ȸߴΤ륯饹ե뤬ޤۤȤɤξ硢\fI\-target\fRץͤ\fI\-source\fRץͤˤʤޤǤϡ\fI\-target\fRץάǤޤ +\fI\-source 1\&.6\fRオプションにより、\fIOldCode\&.java\fRのコンパイルにはリリース1\&.6(または6)のJavaプログラミング言語が使用されます。\fI\-target 1\&.6\fRオプションにより、JVM 1\&.6と互換性のあるクラス・ファイルが生成されます。ほとんどの場合、\fI\-target\fRオプションの値は\fI\-source\fRオプションの値になります。この例では、\fI\-target\fRオプションを省略できます。 .sp -\fI\-bootclasspath\fRץѤơŬڤʥСΥ֡ȥȥåס饹(\fIrt\&.jar\fR饤֥)ꤹɬפޤꤷʤϡѥˤäƼηٹޤ +\fI\-bootclasspath\fRオプションを使用して、適切なバージョンのブートストラップ・クラス(\fIrt\&.jar\fRライブラリ)を指定する必要があります。指定しない場合は、コンパイラによって次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1384,12 +1384,12 @@ warning: [options] bootstrap class path not set in conjunction with .if n \{\ .RE .\} -ŬڤʥСΥ֡ȥȥåס饹ꤷʤ硢ѥϸŤ(ǤϡС1\&.6Javaץߥ󥰸)򿷤֡ȥȥåס饹Ȥ߹礻ƻѤޤη̡¸ߤʤ᥽åɤؤλȤޤޤƤ뤳Ȥ뤿ᡢ饹ե뤬Ťץåȥե(ξJava SE 6)ưʤǽޤ +適切なバージョンのブートストラップ・クラスを指定しない場合、コンパイラは古い言語仕様(この例では、バージョン1\&.6のJavaプログラミング言語)を新しいブートストラップ・クラスと組み合せて使用します。その結果、存在しないメソッドへの参照が含まれていることがあるため、クラス・ファイルが古いプラットフォーム(この場合はJava SE 6)で動作しない可能性があります。 .RE .PP -\fBExample 5\fR, ѥ +\fBExample 5\fR, クロス・コンパイル .RS 4 -Ǥϡ\fIjavac\fRѤơJVM 1\&.6Ǽ¹Ԥ륳ɤ򥳥ѥ뤷ޤ +この例では、\fIjavac\fRを使用して、JVM 1\&.6上で実行するコードをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1401,9 +1401,9 @@ javac \-source 1\&.6 \-target 1\&.6 \-bootclasspath jdk1\&.6\&.0/lib/rt\&.jar \e .if n \{\ .RE .\} -The\fI \-source 1\&.6\fRץˤꡢOldCode\&.javaΥѥˤϥ꡼1\&.6(ޤ6)Javaץߥ󥰸줬Ѥޤ\fI\-target 1\&.6\fRץˤꡢJVM 1\&.6ȸߴΤ륯饹ե뤬ޤۤȤɤξ硢\fI\-target\fRͤ\fI\-source\fRͤˤʤޤǤϡ\fI\-target\fRץϾάޤ +The\fI \-source 1\&.6\fRオプションにより、OldCode\&.javaのコンパイルにはリリース1\&.6(または6)のJavaプログラミング言語が使用されます。\fI\-target 1\&.6\fRオプションにより、JVM 1\&.6と互換性のあるクラス・ファイルが生成されます。ほとんどの場合、\fI\-target\fRの値は\fI\-source\fRの値になります。この例では、\fI\-target\fRオプションは省略されます。 .sp -\fI\-bootclasspath\fRץѤơŬڤʥСΥ֡ȥȥåס饹(\fIrt\&.jar\fR饤֥)ꤹɬפޤꤷʤϡѥˤäƼηٹޤ +\fI\-bootclasspath\fRオプションを使用して、適切なバージョンのブートストラップ・クラス(\fIrt\&.jar\fRライブラリ)を指定する必要があります。指定しない場合は、コンパイラによって次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1415,9 +1415,9 @@ warning: [options] bootstrap class path not set in conjunction with \-source 1\& .if n \{\ .RE .\} -ŬڤʥСΥ֡ȥȥåס饹ꤷʤ硢ѥϸŤͤ򿷤֡ȥȥåס饹Ȥ߹礻ƻѤޤȹ礻ϡ¸ߤʤ᥽åɤؤλȤޤޤƤ뤳Ȥ뤿ᡢ饹ե뤬Ťץåȥե(ξJava SE 6)ưʤǽޤǤϡѥJavaץߥ󥰸Υ꡼1\&.6Ѥޤ +適切なバージョンのブートストラップ・クラスを指定しない場合、コンパイラは古い言語仕様を新しいブートストラップ・クラスと組み合せて使用します。この組合せは、存在しないメソッドへの参照が含まれていることがあるため、クラス・ファイルが古いプラットフォーム(この場合はJava SE 6)で動作しない可能性があります。この例では、コンパイラはJavaプログラミング言語のリリース1\&.6を使用します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/javadoc.1 b/jdk/src/linux/doc/man/ja/javadoc.1 index 74cdf8f655b..5c1e8683918 100644 --- a/jdk/src/linux/doc/man/ja/javadoc.1 +++ b/jdk/src/linux/doc/man/ja/javadoc.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javadoc .\" Language: English -.\" Date: 2011ǯ510 -.\" SectDesc: ܥġ +.\" Date: 2011年5月10日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javadoc" "1" "2011ǯ510" "JDK 8" "ܥġ" +.TH "javadoc" "1" "2011年5月10日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javadoc \- Javaե뤫顢APIɥȤHTMLڡޤ -.SH "" +javadoc \- Javaソース・ファイルから、APIドキュメントのHTMLページを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,33 +64,33 @@ javadoc \- Java .PP \fIpackages\fR .RS 4 -\fIjava\&.lang java\&.lang\&.reflect java\&.awt\fRʤɡǶڤäƥɥȲѥå֥̾ѥåɥȲϡ\fI\-subpackages\fRץѤƥѥåꤷޤ +\fIjava\&.lang java\&.lang\&.reflect java\&.awt\fRなど、空白で区切ってドキュメント化するパッケージの名前。サブパッケージもドキュメント化する場合は、\fI\-subpackages\fRオプションを使用してパッケージを指定します。 .sp -ǥեȤǤϡ\fIjavadoc\fRϡߤΥǥ쥯ȥꤪӥ֥ǥ쥯ȥǻꤵ줿ѥåõޤ\fI\-sourcepath\fRץѤơѥåõǥ쥯ȥΥꥹȤꤷޤ +デフォルトでは、\fIjavadoc\fRは、現在のディレクトリおよびサブディレクトリで指定されたパッケージを探します。\fI\-sourcepath\fRオプションを使用して、パッケージを探すディレクトリのリストを指定します。 .RE .PP \fIsource\-files\fR .RS 4 -\fIClass\&.java Object\&.java Button\&.java\fRΤ褦˶ǶڤäɥȲJavaե̾ǥեȤǤϡ\fIjavadoc\fRϡߤΥǥ쥯ȥǻꤵ줿饹õޤ\fI/home/src/java/awt/Graphics*\&.java\fRΤ褦ˡ饹եΥեѥꤷ磻ɥʸѤǤޤߤΥǥ쥯ȥ꤫ХѥǤޤ +\fIClass\&.java Object\&.java Button\&.java\fRのように空白で区切った、ドキュメント化するJavaソース・ファイルの名前。デフォルトでは、\fIjavadoc\fRは、現在のディレクトリで指定されたクラスを探します。ただし、\fI/home/src/java/awt/Graphics*\&.java\fRのように、クラス・ファイルのフルパスを指定し、ワイルドカード文字を使用できます。現在のディレクトリからの相対パスも指定できます。 .RE .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fI@argfiles\fR .RS 4 -\fIjavadoc\fRޥɡץ󡢥ѥå̾ӥե̾ΥꥹȤǤդνǴޤե̾ +\fIjavadoc\fRコマンド・オプション、パッケージ名およびソース・ファイル名のリストを任意の順序で含むファイルの名前。 .RE -.SH "" +.SH "説明" .PP -\fIjavadoc\fRޥɤϡϢJavaեˤӥɥơ󡦥ȤϤǥեȤǤϡpublic饹protected饹ͥȤ줿饹(ƿ̾饹Ͻ)󥿥ե󥹥ȥ饯᥽åɡӥեɤˤĤƵҤϢHTMLڡޤ\fIjavadoc\fRޥɤϡAPIɥȤ䡢ϢΥեμɥȤ˻ѤǤޤ +\fIjavadoc\fRコマンドは、一連のJavaソース・ファイルにある宣言およびドキュメンテーション・コメントを解析し、デフォルトでは、publicクラス、protectedクラス、ネストされたクラス(匿名の内部クラスは除く)、インタフェース、コンストラクタ、メソッド、およびフィールドについて記述した一連のHTMLページを生成します。\fIjavadoc\fRコマンドは、APIドキュメントの生成や、一連のソース・ファイルの実装ドキュメントの生成に使用できます。 .PP -\fIjavadoc\fRޥɤϡѥåΡġΥե롢ޤϤξФƼ¹ԤǤޤѥåΤΥɥȲԤˤϡ\fI\-subpackages\fRץѤƥǥ쥯ȥꤪӤΥ֥ǥ쥯ȥƵŪˤɤ뤫ѥå̾ŪʥꥹȤϤޤġΥեɥȲˤϡJavaե̾ΥꥹȤϤޤñ򻲾ȤƤ -.SS "եν" +\fIjavadoc\fRコマンドは、パッケージ全体、個々のソース・ファイル、またはその両方に対して実行できます。パッケージ全体のドキュメント化を行うには、\fI\-subpackages\fRオプションを使用してディレクトリおよびそのサブディレクトリを再帰的にたどるか、パッケージ名の明示的なリストを渡します。個々のソース・ファイルをドキュメント化するには、Javaソース・ファイル名のリストを渡します。簡単な例を参照してください。 +.SS "ソース・ファイルの処理" .PP -\fIjavadoc\fRޥɤϡǽե롢ӥեƤ뤽¾ΥեޤġΥե̾Ϥ\fIjavadoc\fR¹Ԥ硢ɤΥե뤫Τ˻Ǥޤ¿γȯԤϤˡǤϺȤޤ󡣥ѥå̾ϤۤñǤե̾Ū˻ꤷʤƤ⡢\fIjavadoc\fRޥɤ3ĤˡǼ¹ԤǤޤѥå̾Ϥ\fI\-subpackages\fRץѤ뤫ޤϥե̾˥磻ɥɤѤ뤳ȤǤޤξ硢\fIjavadoc\fRޥɤեνԤΤϡΥե뤬Τ٤Ƥ׷ΤߤǤ +\fIjavadoc\fRコマンドは、ソースで終わるファイル、およびソース・ファイルで説明しているその他のファイルを処理します。個々のソース・ファイル名を渡して\fIjavadoc\fRを実行する場合、どのソース・ファイルを処理するかを正確に指定できます。ただし、多くの開発者はこの方法では作業しません。パッケージ名を渡すほうが簡単だからです。ソース・ファイル名を明示的に指定しなくても、\fIjavadoc\fRコマンドは3つの方法で実行できます。パッケージ名を渡し、\fI\-subpackages\fRオプションを使用するか、またはソース・ファイル名にワイルドカードを使用することができます。これらの場合、\fIjavadoc\fRコマンドがソース・ファイルの処理を行うのは、そのファイルが次のすべての要件を満たす場合のみです。 .sp .RS 4 .ie n \{\ @@ -100,7 +100,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ե̾Ƭ(\fI\&.java\fR)ͭʥ饹̾Ǥ롣 +ファイル名の接頭辞(\fI\&.java\fRを削除)が有効なクラス名である。 .RE .sp .RS 4 @@ -111,7 +111,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ĥ꡼Υ롼ȤŪʥѥ̾ڤʸɥåȤѴȡͭʥѥå̾ˤʤ롣 +ソース・ツリーのルートからの相対的なパス名が、区切り文字をドットに変換すると、有効なパッケージ名になる。 .RE .sp .RS 4 @@ -122,10 +122,10 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥåʸͭʥѥå̾ޤޤƤ롣 +パッケージ文に有効なパッケージ名が含まれている。 .RE -󥯤ν.PP -μ¹ˡ\fIjavadoc\fRޥɤϡμ¹ԤǥɥȲѥå饹ӥС̾Фơ߻ȥ󥯤ɲäޤ󥯤ϡξɽޤ@ˤĤƤϡjavadoc򻲾ȤƤ +リンクの処理.PP +処理の実行中に、\fIjavadoc\fRコマンドは、その実行でドキュメント化されるパッケージ、クラス、およびメンバーの名前に対して、相互参照リンクを追加します。リンクは、次の場所に表示されます。@タグの説明については、javadocタグを参照してください。 .sp .RS 4 .ie n \{\ @@ -135,7 +135,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -(ͤηηեɤη) +宣言(戻り値の型、引数の型、フィールドの型)。 .RE .sp .RS 4 @@ -146,7 +146,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI@see\fR줿\fIϢ\fRץ +\fI@see\fRタグから生成された「\fI関連項目\fR」セクション。 .RE .sp .RS 4 @@ -157,7 +157,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI{@link}\fR줿饤󡦥ƥȡ +\fI{@link}\fRタグから生成されたインライン・テキスト。 .RE .sp .RS 4 @@ -168,7 +168,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI@throws\fR줿㳰̾ +\fI@throws\fRタグから生成された例外の名前。 .RE .sp .RS 4 @@ -179,7 +179,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -󥿥եΥСФ\fI\fRץ󥯤ȡ饹ΥСФ\fIС饤\fRץ󥯡᥽åɡȤηѾ򻲾ȤƤ +インタフェースのメンバーに対する「\fI定義\fR」リンクと、クラスのメンバーに対する「\fIオーバーライド\fR」リンク。メソッド・コメントの継承を参照してください。 .RE .sp .RS 4 @@ -190,7 +190,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥå饹ӥСꥹȤƤ륵ޥ꡼ɽ +パッケージ、クラス、およびメンバーをリストしているサマリー表。 .RE .sp .RS 4 @@ -201,7 +201,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥåӥ饹ηѾĥ꡼ +パッケージおよびクラスの継承ツリー。 .RE .sp .RS 4 @@ -212,42 +212,42 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} - +索引。 .RE .PP -ޥɥ饤ǻꤷʤä饹ˤĤƤδ¸Υƥ(̤ƥ)Фƥ󥯤ɲäˤϡ\fI\-link\fR\fI\-linkoffline\fRץѤǤޤ -ξܺ.PP -\fIjavadoc\fRޥɤϼ¹Ԥ뤿Ӥ1ĤδʥɥȤޤμ¹Ԥη̤ѹޤľܼࡢʬӥɤԤޤ󡣤\fIjavadoc\fRޥɤϡ¾μ¹Ԥη̤˥󥯤Ǥޤ +コマンドラインで指定しなかったクラスについての既存のテキスト(別に生成したテキスト)に対してリンクを追加するには、\fI\-link\fRおよび\fI\-linkoffline\fRオプションを利用できます。 +処理の詳細.PP +\fIjavadoc\fRコマンドは実行するたびに1つの完全なドキュメントを生成します。前の実行の結果を変更または直接取り込む、増分ビルドを行いません。ただし、\fIjavadoc\fRコマンドは、他の実行の結果にリンクできます。 .PP -\fIjavadoc\fRޥɤμˤJavaѥ餬ɬפǡJavaѥ˰¸Ƥޤ\fIjavadoc\fRޥɤ\fIjavac\fRޥɤΰƤӽФ򥳥ѥ뤷ơСμ̵뤷ޤ\fIjavadoc\fRޥɤϡ饹ؤޤ९饹˭٤ɽȥ饹Ρֻѡ״طۤHTMLޤˡJ\fIjavadoc\fRޥɤϡɤΥɥơ󡦥Ȥ顢桼󶡤ɥȤޤɥơ󡦥Ȥ򻲾ȤƤ +\fIjavadoc\fRコマンドの実装にはJavaコンパイラが必要で、Javaコンパイラに依存しています。\fIjavadoc\fRコマンドは\fIjavac\fRコマンドの一部を呼び出し、宣言をコンパイルして、メンバーの実装を無視します。\fIjavadoc\fRコマンドは、クラス階層を含むクラスの豊富な内部表現とクラスの「使用」関係を構築し、HTMLを生成します。さらに、J\fIjavadoc\fRコマンドは、ソース・コードのドキュメンテーション・コメントから、ユーザーの提供したドキュメントも取得します。ドキュメンテーション・コメントを参照してください。 .PP -\fIjavadoc\fRޥɤϡ᥽åΤʤʥ֡եǤ륽եФƼ¹ԤǤޤäơAPIμ߷פᤤʳǡɥơ󡦥Ȥ򵭽Ҥ\fIjavadoc\fRȤ¹ԤǤޤ +\fIjavadoc\fRコマンドは、メソッド本体を持たない純粋なスタブ・ファイルであるソース・ファイルに対して実行できます。したがって、APIの実装前の設計の早い段階で、ドキュメンテーション・コメントを記述して\fIjavadoc\fRコメントを実行できます。 .PP -ѥ˰¸뤳ȤˤäơHTMLϤϡºݤμΤбޤºݤμϡŪʥɤˤǤϤʤۤΥɤ˰¸礬ޤȤС\fIjavadoc\fRޥɤϡѥѥ饹եˤ¸ߤ뤬ɤˤ¸ߤʤǥեȡ󥹥ȥ饯ɥȲޤ +コンパイラに依存することによって、HTML出力は、実際の実装に正確に対応します。実際の実装は、明示的なソース・コードにではなく、暗黙のソース・コードに依存する場合があります。たとえば、\fIjavadoc\fRコマンドは、コンパイル済クラス・ファイルには存在するがソース・コードには存在しないデフォルト・コンストラクタをドキュメント化します。 .PP -¿ξ硢\fIjavadoc\fRޥɤǤϡեΥɤԴޤϥ顼ޤǤǤɥȤǤޤ٤ƤΥǥХåȥ֥륷塼ƥ󥰤λ˥ɥȤǤޤ\fIjavadoc\fRޥɤϥɥơ󡦥ȤδŪʥåԤޤ +多くの場合、\fIjavadoc\fRコマンドでは、ソース・ファイルのコードが不完全またはエラーを含んでいる場合でもドキュメントを生成できます。すべてのデバッグやトラブルシューティングを完了する前にドキュメントを生成できます。\fIjavadoc\fRコマンドはドキュメンテーション・コメントの基本的なチェックを行います。 .PP -\fIjavadoc\fRޥɤϡɥȤ¤ۤݡȥ饹򤹤٤ƥɤޤΤᡢ -\fIjavadoc\fRޥɤϡ֡ȥȥåס饹ĥǽޤϥ桼饹ˤ餺٤Ƥλȥ饹򸡺Ǥɬפޤ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +\fIjavadoc\fRコマンドは、ドキュメントの内部構造を構築する際、参照クラスをすべてロードします。このため、 +\fIjavadoc\fRコマンドは、ブートストラップ・クラス、拡張機能、またはユーザー・クラスにかかわらず、すべての参照クラスを検索できる必要があります。クラスの検出方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください .PP -̾륯饹ϡĥ饹Ȥơޤ\fIjavadoc\fRޥɤΥ饹ѥǥɤɬפޤ -.SS "JavadocΥɥåå" +通常、作成するクラスは、拡張クラスとして、または\fIjavadoc\fRコマンドのクラス・パスでロードされる必要があります。 +.SS "Javadocのドックレット" .PP -\fIjavadoc\fRޥɤνϤƤȷϡɥååȤѤƥޥǤޤ\fIjavadoc\fRޥɤˤϡɸɥååȤȸƤФǥեȤȹߥɥååȤޤɸɥååȤϡHTMLAPIɥȤޤɸɥååȤޤϥ֥饹뤳Ȥ䡢HTMLXMLMIFRTFʤɤιߤνϷȼΥɥååȤ򵭽Ҥ뤳ȤǽǤ +\fIjavadoc\fRコマンドの出力の内容と形式は、ドックレットを使用してカスタマイズできます。\fIjavadoc\fRコマンドには、標準ドックレットと呼ばれるデフォルトの組込みドックレットがあります。標準ドックレットは、HTML形式のAPIドキュメントを生成します。標準ドックレットを修正またはサブクラスを作成することや、HTML、XML、MIF、RTFなどの好みの出力形式を生成する独自のドックレットを記述することも可能です。 .PP -\fI\-doclet\fRץǥࡦɥååȤꤵƤʤ硢\fIjavadoc\fRޥɤϡǥեȤɸɥååȤѤޤ\fIjavadoc\fRޥɤˤϡѤƤɥååȤ˴طʤѤǤ뤤ĤΥץ󤬤ޤɸɥååȤǤϡ¾ˡĤΥޥɥ饤󡦥ץɲäޤץ򻲾ȤƤ -.SH "ե" +\fI\-doclet\fRオプションでカスタム・ドックレットが指定されていない場合、\fIjavadoc\fRコマンドは、デフォルトの標準ドックレットを使用します。\fIjavadoc\fRコマンドには、使用されているドックレットに関係なく使用できるいくつかのオプションがあります。標準ドックレットでは、これらの他に、いくつかのコマンドライン・オプションが追加されます。オプションを参照してください。 +.SH "ソース・ファイル" .PP -\fIjavadoc\fRޥɤϡΥפΥե뤫ϤޤΥեϡ饹Java쥽ե(\fI\&.java\fR)ѥåȡե롢ץȡե롢Ӥ¾̤ΥեǤǤϡɥȲʤĥ꡼¸ߤ礬ƥȡեƥץ졼ȡեˤĤƤޤ -.SS "饹Υե" +\fIjavadoc\fRコマンドは、次のタイプのソース・ファイルから出力を生成します。そのファイルは、クラスのJava言語ソース・ファイル(\fI\&.java\fR)、パッケージ・コメント・ファイル、概要コメント・ファイル、およびその他の未処理のファイルです。ここでは、ドキュメント化しないがソース・ツリーに存在する場合があるテスト・ファイルやテンプレート・ファイルについても説明します。 +.SS "クラスのソース・ファイル" .PP -줾Υ饹ޤϥ󥿥եӤΥСϡȼΥɥơ󡦥ȤĤȤǤ򥽡եݻޤɥơ󡦥Ȥ򻲾ȤƤ -.SS "ѥåȡե" +それぞれのクラスまたはインタフェース、およびそのメンバーは、独自のドキュメンテーション・コメントを持つことができ、それをソース・ファイル内に保持します。ドキュメンテーション・コメントを参照してください。 +.SS "パッケージ・コメント・ファイル" .PP -줾ΥѥåϡȼΥɥơ󡦥ȤĤȤǤѤΥեݻޤƤϡ\fIjavadoc\fRޥɤˤäѥåΥޥ꡼ڡȤ߹ޤޤΥȤˤϡ̾ΥѥåΤƤϤޤɥȤ򵭽Ҥޤ +それぞれのパッケージは、独自のドキュメンテーション・コメントを持つことができ、それを専用のソース・ファイルに保持します。その内容は、\fIjavadoc\fRコマンドによって生成されるパッケージのサマリー・ページに組み込まれます。このコメントには、通常、そのパッケージ全体に当てはまるドキュメントを記述します。 .PP -ѥåȡեˤϡΤ줫Υե˥ȤǼǤޤ +パッケージ・コメント・ファイルを作成するには、次のいずれかのファイルにコメントを格納できます。 .sp .RS 4 .ie n \{\ @@ -257,7 +257,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fIpackage\-info\&.java\fRեˤϡѥåѥåᡢѥåȡJavadocǼǤޤΥե뤬ͥ褵ޤ +\fIpackage\-info\&.java\fRファイルには、パッケージ宣言、パッケージ注釈、パッケージ・コメント、およびJavadocタグを格納できます。このファイルが優先されます。 .RE .sp .RS 4 @@ -268,15 +268,15 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fIpackage\&.html\fRեˤϡѥåȤJavadocΤߤǼǤޤѥåϳǼǤޤ +\fIpackage\&.html\fRファイルには、パッケージ・コメントとJavadocタグのみを格納できます。パッケージ注釈は格納できません。 .RE .PP -ƥѥåϡ\fIpackage\&.html\fRեޤ\fIpackage\-info\&.java\fRեΤ줫1ĻĤȤǤޤξĤȤϤǤޤ󡣤Τɤ餫Υե򥽡եȤȤˡĥ꡼ΤΥѥåǥ쥯ȥ֤Ƥ -package\-info\&.javaե.PP -\fIpackage\-info\&.java\fRեˤϡι¤ΥѥåȤޤ뤳ȤǤޤȤϡѥå֤ޤ +各パッケージは、\fIpackage\&.html\fRファイルまたは\fIpackage\-info\&.java\fRファイルのいずれかを1つ持つことができますが、その両方を持つことはできません。このどちらかのファイルをソース・ファイルとともに、ソース・ツリー内のそのパッケージ・ディレクトリ内に配置してください。 +package\-info\&.javaファイル.PP +\fIpackage\-info\&.java\fRファイルには、次の構造のパッケージ・コメントを含めることができます。コメントは、パッケージ宣言の前に配置されます。 .PP -\fB:\fR -ȶڤʸǤ\fI/**\fR\fI*/\fR¸ߤɬפޤ֤ιԤƬΥꥹϾάǽǤ +\fB注意:\fR +コメント区切り文字である\fI/**\fRおよび\fI*/\fRが存在する必要がありますが、中間の行の先頭のアスタリスクは省略可能です。 .sp .if n \{\ .RS 4 @@ -302,10 +302,10 @@ package java\&.lang\&.applet; .if n \{\ .RE .\} -package\&.htmlե.PP -\fIpackage\&.html\fRեˤϡι¤ΥѥåȤޤ뤳ȤǤޤȤϡ\fI\fRǤ֤ޤ +package\&.htmlファイル.PP +\fIpackage\&.html\fRファイルには、次の構造のパッケージ・コメントを含めることができます。コメントは、\fI\fR要素に配置されます。 .PP -ե: +ファイル: \fIjava/applet/package\&.html\fR .sp .if n \{\ @@ -332,9 +332,9 @@ initialize, start, and stop the applet\&. .RE .\} .PP -\fIpackage\&.html\fRե̾HTMLեǤꡢѥåޤǤޤ󡣥ѥåȡեƤHTMLǵҤޤ㳰1ĤޤΥɥơ󡦥ȤˤϡȶڤʸǤ\fI/**\fR\fI*/\fRޤϹƬΥꥹޤʤȤǤȤ񤯾ϡǽʸѥåΥޥ꡼Ȥ\fI\fRȺǽʸδ֤˥ȥ䤽¾ΥƥȤޤʤ褦ˤޤѥåޤ뤳ȤǤޤ٤ƤΥ֥åϡθ֤ɬפޤ\fI@see\fRѥåȡեɲäˤϡ̾Ѥɬפޤ -ȡեν.PP -\fIjavadoc\fRȤ¹Ԥȡѥåȡե뤬ޤѥåȡե뤬Ĥäϡ\fIjavadoc\fRޥɤϼμ¹Ԥޤ +\fIpackage\&.html\fRファイルは通常のHTMLファイルであり、パッケージ宣言を含んでいません。パッケージ・コメント・ファイルの内容はHTMLで記述しますが、例外が1つあります。このドキュメンテーション・コメントには、コメント区切り文字である\fI/**\fRと\fI*/\fR、または行頭のアスタリスクを含めない、という点です。コメントを書く場合は、最初の文をパッケージのサマリーとし、\fI\fRタグと最初の文の間にタイトルやその他のテキストを含めないようにします。パッケージ・タグを含めることができます。すべてのブロック・タグは、主説明の後に配置する必要があります。\fI@see\fRタグをパッケージ・コメント・ファイルに追加する場合には、完全修飾名を使用する必要があります。 +コメント・ファイルの処理.PP +\fIjavadoc\fRコメントを実行すると、パッケージ・コメント・ファイルが検索されます。パッケージ・コメント・ファイルが見つかった場合は、\fIjavadoc\fRコマンドは次の手順を実行します。 .sp .RS 4 .ie n \{\ @@ -344,8 +344,8 @@ initialize, start, and stop the applet\&. .sp -1 .IP \(bu 2.3 .\} -Ǥ褦˥Ȥ򥳥ԡޤpackage\&.htmlξ硢\fIjavadoc\fRޥɤϡ\fI\fR\fI\fR -HTML֤Τ٤ƤƤ򥳥ԡޤ\fI\fRޤᡢ\fI\fR䥽եҤʤɤξ֤뤳ȤǤޤ줿ɥȤˤϤϰɽޤ +処理できるようにコメントをコピーします。package\&.htmlの場合、\fIjavadoc\fRコマンドは、\fI<body>\fRと\fI</body>\fR +HTMLタグ間のすべての内容をコピーします。\fI<head>\fRセクションを含め、そこに\fI<title>\fRタグやソース・ファイルの著作権記述などの情報を配置することもできますが、生成されたドキュメントにはそれらは一切表示されません。 .RE .sp .RS 4 @@ -356,7 +356,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ѥåޤѥå򻲾ȤƤ +パッケージ・タグを処理します。パッケージ・タグを参照してください。 .RE .sp .RS 4 @@ -367,8 +367,8 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ƥȤ줿ѥåΥޥ꡼ڡβޤJavaץåȥեࡢStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +処理したテキストを生成されたパッケージのサマリー・ページの下部に挿入します。Javaプラットフォーム、Standard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .RE .sp .RS 4 @@ -379,24 +379,24 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ѥåΥޥ꡼ڡƬˡѥåȤκǽʸ򥳥ԡޤˡ\fIjavadoc\fRޥɤϡץڡΥѥåꥹȤˡѥå̾ȥѥåȤκǽʸɲäޤJavaץåȥեࡢStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +パッケージのサマリー・ページの先頭に、パッケージ・コメントの最初の文をコピーします。さらに、\fIjavadoc\fRコマンドは、概要ページのパッケージ・リストに、パッケージ名とパッケージ・コメントの最初の文を追加します。Javaプラットフォーム、Standard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .sp -ʸνϡ饹СμκǽʸνƱ롼ˤäȽǤޤ +文の終わりは、クラスやメンバーの主説明の最初の文の終わりと同じルールによって判断されます。 .RE -.SS "ץȡե" +.SS "概要コメント・ファイル" .PP -ɥȲƥץꥱޤϥѥååȤϡȼγץɥơ󡦥ȤĤȤǤѤΥեݻޤƤϡ\fIjavadoc\fRޥɤˤä복ץڡȤ߹ޤޤΥȤˤϡ̾ץꥱޤϥѥååΤƤϤޤɥȤ򵭽Ҥޤ +ドキュメント化する各アプリケーションまたはパッケージ・セットは、独自の概要ドキュメンテーション・コメントを持つことができ、それは専用のソース・ファイルに保持されます。その内容は、\fIjavadoc\fRコマンドによって生成される概要ページに組み込まれます。このコメントには、通常、アプリケーションまたはパッケージ・セット全体に当てはまるドキュメントを記述します。 .PP -Υեˤoverview\&.htmlʤɤ̾դ뤳ȤǤɤ֤Ƥ⤫ޤޤ󡣰Ūʾϡĥ꡼κǾǤ +このファイルにはoverview\&.htmlなどの名前を付けることができ、どこに配置してもかまいません。一般的な場所は、ソース・ツリーの最上部です。 .PP -ȤС\fIjava\&.applet\fRѥåΥե뤬/home/user/src/java/appletǥ쥯ȥ˳ǼƤ硢ץȡե/home/user/src/overview\&.html˺Ǥޤ +たとえば、\fIjava\&.applet\fRパッケージのソース・ファイルが/home/user/src/java/appletディレクトリに格納されている場合、概要コメント・ファイルは/home/user/src/overview\&.htmlに作成できます。 .PP -ۤʤѥåΥåȤФ\fIjavadoc\fRޥɤʣ¹ԤϡƱ1ĤΥեΥåȤФʣγץȡեǤޤȤСɥѤ\fI\-private\fRꤷ\fIjavadoc\fRޥɤ1¹Ԥ塢ɥѤˤΥץꤷʤǺټ¹Ԥ뤳ȤǤޤξ硢Ƴץȡե1ʸܤǡΥɥȤѤޤѤȤƵҤǤޤ +異なるパッケージのセットに対して\fIjavadoc\fRコマンドを複数回実行する場合は、同じ1つのソース・ファイルのセットに対して複数の概要コメント・ファイルを作成できます。たとえば、内部ドキュメント用に\fI\-private\fRを指定して\fIjavadoc\fRコマンドを1回実行した後、公開ドキュメント用にそのオプションを指定しないで再度実行することができます。この場合、各概要コメント・ファイルの1文目で、そのドキュメントを公開用または内部用として記述できます。 .PP -ץȡեƤϡHTMLǵҤ줿1Ĥ礭ʥɥơ󡦥ȤǤǽʸϥץꥱޤϥѥåΥåȤΥޥ꡼Ȥޤ\fI<body>\fRȺǽʸδ֤˥ȥ䤽¾ΥƥȤޤʤ褦ˤޤ{\fI@link}\fRʤɤΥ饤󡦥٤ƤΥϡθ֤ɬפޤ\fI@see\fRɲäˤϡ̾Ѥɬפޤ +概要コメント・ファイルの内容は、HTMLで記述された1つの大きなドキュメンテーション・コメントです。最初の文はアプリケーションまたはパッケージのセットのサマリーとします。\fI<body>\fRタグと最初の文の間にタイトルやその他のテキストを含めないようにします。{\fI@link}\fRなどのインライン・タグを除くすべてのタグは、主説明の後に配置する必要があります。\fI@see\fRタグを追加する場合には、完全修飾名を使用する必要があります。 .PP -\fIjavadoc\fRޥɤμ¹Իˡ\fI\-overview\fRץѤƳץȡե̾ꤷޤΥեϡѥåȡեƱ褦˽ޤ\fIjavadoc\fRޥɤϼμ¹Ԥޤ +\fIjavadoc\fRコマンドの実行時に、\fI\-overview\fRオプションを使用して概要コメント・ファイル名を指定します。このファイルは、パッケージ・コメント・ファイルと同じように処理されます。\fIjavadoc\fRコマンドは次の手順を実行します。 .sp .RS 4 .ie n \{\ @@ -406,7 +406,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fI<body>\fR\fI</body>\fRδ֤ˤƤ򤹤٤ƽоݤȤƥԡޤ +\fI<body>\fRと\fI</body>\fRタグの間にある内容をすべて処理対象としてコピーします。 .RE .sp .RS 4 @@ -417,7 +417,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ץнޤץ򻲾ȤƤ +概要タグがあれば処理します。概要タグを参照してください。 .RE .sp .RS 4 @@ -428,8 +428,8 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ƥȤ줿ץڡβޤJavaץåȥեStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +処理したテキストを生成された概要ページの下部に挿入します。JavaプラットフォームStandard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .RE .sp .RS 4 @@ -440,17 +440,17 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ץޥ꡼ڡƬˡץȤκǽʸ򥳥ԡޤ +概要サマリー・ページの先頭に、概要コメントの最初の文をコピーします。 .RE -.SS "̤Υե" +.SS "未処理のファイル" .PP -եˤϡ\fIjavadoc\fRޥɤˤäưǥ쥯ȥ˥ԡ롢ǤդΥեޤ뤳ȤǤޤΤ褦ʥեˤϡ̾եåե롢ץJavaӥ饹ե롢ŪJavaեΥɥơ󡦥Ȥαƶʤ¿ƤޤΩHTMLեʤɤޤ +ソース・ファイルには、\fIjavadoc\fRコマンドによって宛先ディレクトリにコピーされる、任意のファイルを含めることができます。このようなファイルには、通常、グラフィック・ファイル、サンプルのJavaソースおよびクラス・ファイル、一般的なJavaソース・ファイルのドキュメンテーション・コメントの影響を受けない多くの内容を含む独立したHTMLファイルなどがあります。 .PP -̤Υեޤˤϡdoc\-filesȤǥ쥯ȥ˥ե֤ޤdoc\-filesǥ쥯ȥϡեޤǤդΥѥåǥ쥯ȥΥ֥ǥ쥯ȥˤʤ뤳ȤǤޤdoc\-files֥ǥ쥯ȥϡѥåȤ1ѰդǤޤ +未処理のファイルを含めるには、doc\-filesというディレクトリにファイルを配置します。doc\-filesディレクトリは、ソース・ファイルを含む任意のパッケージ・ディレクトリのサブディレクトリになることができます。doc\-filesサブディレクトリは、パッケージごとに1つ用意できます。 .PP -ȤСܥΥ᡼\fIjava\&.awt\&.Button\fR饹ΥɥȤ˴ޤˤϡΥ᡼ե/home/user/src/java/awt/doc\-files/ǥ쥯ȥ֤ޤdoc\-filesǥ쥯ȥ/home/user/src/java/doc\-files֤ʤǤjavaϥѥåǤϤʤǤեޤ뤳ȤǤޤ +たとえば、ボタンのイメージを\fIjava\&.awt\&.Button\fRクラスのドキュメントに含める場合には、そのイメージ・ファイルを/home/user/src/java/awt/doc\-files/ディレクトリに置きます。doc\-filesディレクトリを/home/user/src/java/doc\-filesに置かないでください。javaはパッケージではないからです。ソース・ファイルを含めることもできません。 .PP -\fIjavadoc\fRޥɤϥե򻲾ȤʤΤǡ̤ΥեؤΤ٤ƤΥ󥯤ϡɤ˴ޤޤƤɬפޤ\fIjavadoc\fRޥɤϥǥ쥯ȥȤΤ٤ƤƤ˥ԡޤǤϡButton\&.javaɥơ󡦥ȤΥ󥯤ɤΤ褦˸뤫򼨤Ƥޤ +\fIjavadoc\fRコマンドはファイルを参照しないので、未処理のファイルへのすべてのリンクは、コードに含まれている必要があります。\fIjavadoc\fRコマンドはディレクトリとそのすべての内容を宛先にコピーします。次の例では、Button\&.javaドキュメンテーション・コメントのリンクがどのように見えるかを示しています。 .sp .if n \{\ .RS 4 @@ -464,13 +464,13 @@ HTML .if n \{\ .RE .\} -.SS "ƥȤӥƥץ졼ȡե" +.SS "テストおよびテンプレート・ファイル" .PP -ĥ꡼ΥƥȤӥƥץ졼ȡե򡢥ե뤬¸ߤǥ쥯ȥޤϥ֥ǥ쥯ȥƱǥ쥯ȥ˳ǼǤޤƥȤӥƥץ졼ȡե뤬Τɤˤϡ\fIjavadoc\fRޥɤ¹ԤŪ˸̤Υե̾Ϥޤ +ソース・ツリーのテストおよびテンプレート・ファイルを、ソース・ファイルが存在するディレクトリまたはサブディレクトリと同じディレクトリに格納できます。テストおよびテンプレート・ファイルが処理されるのを防ぐには、\fIjavadoc\fRコマンドを実行し、明示的に個別のソース・ファイル名を渡します。 .PP -ƥȡեϡͭʡѥǽʥեǤƥץ졼ȡեϡͭʡߴΤ륽եǤϤޤ󤬡¿ξ硢\fI\&.java\fRäƤޤ -ƥȡե.PP -ƥȡե̾ʤѥå䡢ե뤬¸ߤѥåȤ̤Υѥå°褦ˤ硢ƥȡե򥽡եβΥ֥ǥ쥯ȥ֤Υǥ쥯ȥ̵̾դޤƥȡե򥽡Ʊǥ쥯ȥ֤ѥå̾򼨤ޥɥ饤ꤷ\fIjavadoc\fRޥɤƤӽФȡƥȡեϷٹޤϥ顼ޤե뤬̵̾ĥ֥ǥ쥯ȥ¸ߤ硢ƥȡե롦ǥ쥯ȥϥåפ졢顼ޤϷٹȯԤޤ󡣤ȤСեΥƥȡեcom\&.package1ɲäˤϡ̵ʥѥå̾Υ֥ǥ쥯ȥ֤ޤΥǥ쥯ȥ̾ˤϥϥե󤬴ޤޤƤ뤿̵Ǥ +テスト・ファイルは、有効な、コンパイル可能なソース・ファイルです。テンプレート・ファイルは、有効な、互換性のあるソース・ファイルではありませんが、多くの場合、\fI\&.java\fR接尾辞を持っています。 +テスト・ファイル.PP +テスト・ファイルを、名前なしパッケージや、ソース・ファイルが存在するパッケージとは別のパッケージに属するようにする場合、テスト・ファイルをソース・ファイルの下のサブディレクトリに配置し、そのディレクトリに無効な名前を付けます。テスト・ファイルをソースと同じディレクトリに配置し、パッケージ名を示すコマンドライン引数を指定して\fIjavadoc\fRコマンドを呼び出すと、テスト・ファイルは警告またはエラーを引き起こします。ファイルが無効な名前を持つサブディレクトリ内に存在する場合、テスト・ファイル・ディレクトリはスキップされ、エラーまたは警告は発行されません。たとえば、ソース・ファイルのテスト・ファイルをcom\&.package1に追加するには、無効なパッケージ名のサブディレクトリに配置します。次のディレクトリ名にはハイフンが含まれているため無効です。 .sp .if n \{\ .RS 4 @@ -482,13 +482,13 @@ com/package1/test\-files/ .RE .\} .PP -ƥȡե˥ɥơ󡦥Ȥޤޤ硢\fIjavadoc\fRޥɤθ̤μ¹Ԥǡ磻ɥɤޤƥȡե̾(\fIcom/package1/test\-files/*\&.java\fRʤ)ϤơƥȡեΥɥȤ褦Ǥޤ -ƥץ졼ȡե.PP -ƥץ졼ȡե򥽡ǥ쥯ȥ֤뤬\fIjavadoc\fRޥɤ¹ԤȤ˥顼ʤ硢ե\fIBuffer\-Template\&.java\fRʤɤ̵̾դơʤ褦ˤޤ\fIjavadoc\fRޥɤϡ\fI\&.java\fRͭʥ饹̾ˤʤ̾ĥեΤߤޤ -.SH "ե" +テスト・ファイルにドキュメンテーション・コメントが含まれる場合、\fIjavadoc\fRコマンドの個別の実行で、ワイルドカードを含んだテスト・ソース・ファイル名(\fIcom/package1/test\-files/*\&.java\fRなど)を渡して、テスト・ファイルのドキュメントを生成するように設定できます。 +テンプレート・ファイル.PP +テンプレート・ファイルをソース・ディレクトリに配置するが、\fIjavadoc\fRコマンドを実行するときにエラーを生成しない場合、ファイルに\fIBuffer\-Template\&.java\fRなどの無効な名前を付けて、処理させないようにします。\fIjavadoc\fRコマンドは、接尾辞の\fI\&.java\fRが削除されると有効なクラス名になる名前を持つソース・ファイルのみを処理します。 +.SH "生成されるファイル" .PP -ǥեȤǤϡ\fIjavadoc\fRޥɤϡHTMLΥɥȤɸɥååȤѤޤɸɥååȤϡ롢ƥڡ߻ȥڡݡȡڡޤHTMLڡϸ̤Υեбޤ\fIjavadoc\fRޥɤϡ2ĤΥפΥեޤǽΥפˤϡ饹ӥ󥿥ե˱̾դޤ2ܤΥפˤϡǽΥפΥեȤζɤˡϥե󤬴ޤޤޤ(package\-summary\&.htmlʤ) -.SS "ƥڡ" +デフォルトでは、\fIjavadoc\fRコマンドは、HTML形式のドキュメントを生成する標準ドックレットを使用します。標準ドックレットは、ここで説明する、基本内容ページ、相互参照ページ、サポート・ページを生成します。各HTMLページは個別のファイルに対応します。\fIjavadoc\fRコマンドは、2つのタイプのファイルを生成します。最初のタイプには、クラスおよびインタフェースに応じた名前が付けられます。2番目のタイプには、最初のタイプのファイルとの競合を防ぐために、ハイフンが含まれます(package\-summary\&.htmlなど)。 +.SS "基本内容ページ" .sp .RS 4 .ie n \{\ @@ -498,7 +498,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ܤƤ륯饹ޤϥ󥿥եȤ1ĤΥ饹ޤϥ󥿥եڡ(classname\&.html) +記載されているクラスまたはインタフェースごとに1つのクラスまたはインタフェース・ページ(classname\&.html)。 .RE .sp .RS 4 @@ -509,7 +509,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ܤƤѥåȤ1ĤΥѥåڡ(package\-summary\&.html)\fIjavadoc\fRޥɤϡĥ꡼Υѥåǥ쥯ȥˤpackage\&.htmlޤpackage\-info\&.javaȤ̾ΥեHTMLƥȤ򤹤٤Ȥޤ +記載されているパッケージごとに1つのパッケージ・ページ(package\-summary\&.html)。\fIjavadoc\fRコマンドは、ソース・ツリーのパッケージ・ディレクトリ内にあるpackage\&.htmlまたはpackage\-info\&.javaという名前のファイル内のHTMLテキストをすべて組み入れます。 .RE .sp .RS 4 @@ -520,9 +520,9 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåΥåΤФ1Ĥγץڡ(overview\-summary\&.html)ץڡϡɥȤƬڡˤʤޤ\fIjavadoc\fRޥɤϡ\fI\-overview\fRץǻꤵ줿եHTMLƥȤ򤹤٤ȤޤץڡΤϡ\fIjavadoc\fRޥɤʣΥѥå̾ϤΤߤǤHTMLե졼पӥץ򻲾ȤƤ +パッケージのセット全体に対して1つの概要ページ(overview\-summary\&.html)。概要ページは、生成ドキュメントの先頭ページになります。\fIjavadoc\fRコマンドは、\fI\-overview\fRオプションで指定されたファイル内のHTMLテキストをすべて組み入れます。概要ページが作成されるのは、\fIjavadoc\fRコマンドに複数のパッケージ名を渡した場合のみです。HTMLフレームおよびオプションを参照してください。 .RE -.SS "߻ȥڡ" +.SS "相互参照ページ" .sp .RS 4 .ie n \{\ @@ -532,7 +532,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåΥåΤФ1ĤΥ饹إڡ(overview\-tree\&.html)إڡɽˤϡʥӥ󡦥СΡֳספ򥯥åƤ顢ֳإĥ꡼פ򥯥åޤ +パッケージのセット全体に対して1つのクラス階層ページ(overview\-tree\&.html)。階層ページを表示するには、ナビゲーション・バーの「概要」をクリックしてから、「階層ツリー」をクリックします。 .RE .sp .RS 4 @@ -543,7 +543,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåȤ1ĤΥ饹إڡ(package\-tree\&.html)إڡɽˤϡΥѥå饹ޤϥ󥿥եΥڡ˰ưֳإĥ꡼פ򥯥åƤΥѥåγؤɽޤ +パッケージごとに1つのクラス階層ページ(package\-tree\&.html)。階層ページを表示するには、特定のパッケージ、クラス、またはインタフェースのページに移動し、「階層ツリー」をクリックしてそのパッケージの階層を表示します。 .RE .sp .RS 4 @@ -554,7 +554,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåȤ1Ĥλѥڡ(package\-use\&.html)ȡ饹ӥ󥿥եȤ1ĤĤλѥڡ(class\-use/classname\&.html)ѥڡǤϡꤷ饹󥿥եޤϥѥåΰѤƤѥå饹᥽åɡ󥹥ȥ饯ӥեɤˤĤƵҤޤȤС饹ޤϥ󥿥եAˤȡλѥڡˤϡAΥ֥饹AȤ줿եɡA֤᥽åɡAΥѥ᡼ĥ᥽åɤӥ󥹥ȥ饯Ȥ߹ޤޤѥڡɽˤϡѥå饹ޤϥ󥿥ե˰ưʥӥ󡦥СΡֻѡץ󥯤򥯥åޤ +パッケージごとに1つの使用ページ(package\-use\&.html)と、クラスおよびインタフェースごとに1つずつの使用ページ(class\-use/classname\&.html)。使用ページでは、指定したクラス、インタフェース、またはパッケージの一部を使用しているパッケージ、クラス、メソッド、コンストラクタ、およびフィールドについて記述されます。たとえば、クラスまたはインタフェースAを例にすると、その使用ページには、Aのサブクラス、Aとして宣言されたフィールド、Aを返すメソッド、A型のパラメータを持つメソッドおよびコンストラクタが組み込まれます。使用ページを表示するには、パッケージ、クラス、またはインタフェースに移動し、ナビゲーション・バーの「使用」リンクをクリックします。 .RE .sp .RS 4 @@ -565,7 +565,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -٤Ƥ侩APIȤο侩ؤꥹȤ侩APIڡ(deprecated\-list\&.html)侩APIϾμǺǽΤǻѤʤǤ +すべての非推奨APIとその推奨する代替をリストする非推奨APIページ(deprecated\-list\&.html)。非推奨APIは将来の実装で削除される可能性があるので使用しないでください。 .RE .sp .RS 4 @@ -576,7 +576,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -եɤѤեͥڡ(constant\-values\&.html) +定数フィールドの値用の定数フィールド値ページ(constant\-values\&.html)。 .RE .sp .RS 4 @@ -587,9 +587,9 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ľ󲽤줿ڡ(serialized\-form\&.html)եɤӥ᥽åɤޤࡢľ󲽲ǽijǽʥ饹˴ؤѤΥڡǤΥڡξϡAPIѤ볫ȯԤǤϤʤƼԤɬפʾǤľ󲽤줿ڡإˤϡľ󲽤줿饹˰ươΥ饹ȤˤִϢܡץǡľ󲽤줿פ򥯥åޤɸɥååȤľ󲽤줿ڡޤΥڡˤϡSerializable뤹٤ƤΥ饹(publicޤpublic)\fIreadObject\fR\fIwriteObject\fR᥽åɡľ󲽤줿եɡ\fI@serial\fR\fI@serialField\fR\fI@serialData\fRΥɥơ󡦥ȤȤȤ˥ꥹȤޤľ󲽲ǽpublic饹ˤϡΥ饹(ޤϤΥѥå)\fI@serial\fR -excludeǥޡޤľ󲽲ǽpackage\-private饹ޤˤϡΥ饹(ޤϤΥѥå)\fI@serial\fR -includeǥޡޤ꡼1\&.4Ǥϡ\fI\-private\fRץꤻ\fIjavadoc\fRޥɤ¹Ԥ뤳Ȥˤꡢpublic饹private饹δľ󲽤줿Ǥޤץ򻲾ȤƤ +直列化された形式ページ(serialized\-form\&.html)。フィールドおよびメソッドの説明を含む、直列化可能かつ外部化可能なクラスに関する情報用のページです。このページ内の情報は、APIを使用する開発者ではなく、再実装者に必要な情報です。直列化された形式ページへアクセスするには、直列化されたクラスに移動して、そのクラス・コメントにある「関連項目」セクションで「直列化された形式」をクリックします。標準ドックレットは直列化された形式ページを生成します。このページには、Serializableを実装するすべてのクラス(publicまたは非public)が、その\fIreadObject\fRや\fIwriteObject\fRメソッド、直列化されたフィールド、および\fI@serial\fR、\fI@serialField\fR、\fI@serialData\fRタグからのドキュメンテーション・コメントとともにリストされます。直列化可能なpublicクラスを除外するには、そのクラス(またはそのパッケージ)を\fI@serial\fR +excludeでマークします。直列化可能なpackage\-privateクラスを含めるには、そのクラス(またはそのパッケージ)を\fI@serial\fR +includeでマークします。リリース1\&.4では、\fI\-private\fRオプションを指定せずに\fIjavadoc\fRコマンドを実行することにより、publicクラスおよびprivateクラスの完全に直列化された形式を生成できます。オプションを参照してください。 .RE .sp .RS 4 @@ -600,9 +600,9 @@ include .sp -1 .IP \(bu 2.3 .\} -ڡ(\fIindex\-*\&.html\fR)٤ƤΥ饹̾󥿥ե̾󥹥ȥ饯̾ե̾ӥ᥽å̾ե٥åȽ¤ǤޤڡϡUnicode򰷤褦˹ݲƤޤ1ĤΥեȤ뤳Ȥ⡢Ƭʸ(ѸξA\(enZ)Ȥ̡ΥեȤ뤳ȤǤޤ +索引ページ(\fIindex\-*\&.html\fR)。すべてのクラス名、インタフェース名、コンストラクタ名、フィールド名、およびメソッド名がアルファベット順に並んでいます。索引ページは、Unicodeを扱えるように国際化されています。1つのファイルとして生成することも、先頭文字(英語の場合A\(enZ)ごとに別々のファイルとして生成することもできます。 .RE -.SS "ݡȡڡ" +.SS "サポート・ページ" .sp .RS 4 .ie n \{\ @@ -612,7 +612,7 @@ include .sp -1 .IP \(bu 2.3 .\} -إסڡ(help\-doc\&.html)ʥӥ󡦥СҤγƥڡ˴ؤܤƤޤǥեȤΥإסեȼΥࡦإסեǥС饤ɤˤϡ\fI\-helpfile\fRѤޤ +ヘルプ・ページ(help\-doc\&.html)。ナビゲーション・バーや前述の各ページに関する説明が記載されています。デフォルトのヘルプ・ファイルを独自のカスタム・ヘルプ・ファイルでオーバーライドするには、\fI\-helpfile\fRを使用します。 .RE .sp .RS 4 @@ -623,7 +623,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ɽѤHTMLե졼1Ĥindex\&.htmlե롣ե졼դƬڡɽˤϤΥեɤޤindex\&.htmlեˤϡƥȡƥĤϴޤޤƤޤ +表示用のHTMLフレームを作成する1つのindex\&.htmlファイル。フレーム付きの先頭ページを表示するにはこのファイルをロードします。index\&.htmlファイルには、テキスト・コンテンツは含まれていません。 .RE .sp .RS 4 @@ -634,7 +634,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ʣΥե졼ࡦե(\fI*\-frame\&.html\fR)ѥå饹ӥ󥿥եΥꥹȤޤޤƤޤե졼ࡦեHTMLե졼ɽޤ +複数のフレーム・ファイル(\fI*\-frame\&.html\fR)。パッケージ、クラス、およびインタフェースのリストが含まれています。フレーム・ファイルはHTMLフレームを表示します。 .RE .sp .RS 4 @@ -645,7 +645,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ѥåꥹȡե(package\-list)\fI\-link\fR\fI\-linkoffline\fRץǻѤޤѥåꥹȡեϥƥȡեǤꡢɤΥ󥯤⥢Ǥޤ +パッケージ・リスト・ファイル(package\-list)。\fI\-link\fRおよび\fI\-linkoffline\fRオプションで使用されます。パッケージ・リスト・ファイルはテキスト・ファイルであり、どのリンクからもアクセスできません。 .RE .sp .RS 4 @@ -656,7 +656,7 @@ include .sp -1 .IP \(bu 2.3 .\} -륷ȡե(stylesheet\&.css)ڡΰǤˤĤƿեȡեߥꡢեȡեȡ롢֤椷ޤ +スタイルシート・ファイル(stylesheet\&.css)。生成されるページの一部の要素について色、フォント・ファミリ、フォント・サイズ、フォント・スタイル、および配置を制御します。 .RE .sp .RS 4 @@ -667,22 +667,22 @@ include .sp -1 .IP \(bu 2.3 .\} -doc\-filesǥ쥯ȥꡣǥ쥯ȥ˥ԡ륤᡼ץ롦ɡɤʤɤΥե뤬ǼޤΥեϡ\fIjavadoc\fRޥɤˤäƽޤ󡣤Υǥ쥯ȥϡĥ꡼¸ߤˤΤ߽ޤ +doc\-filesディレクトリ。宛先ディレクトリにコピーするイメージ、サンプル・コード、ソース・コードなどのファイルが格納されます。これらのファイルは、\fIjavadoc\fRコマンドによって処理されません。このディレクトリは、ソース・ツリーの中に存在する場合にのみ処理されます。 .RE .PP -ץ򻲾ȤƤ -.SS "HTMLե졼" +オプションを参照してください。 +.SS "HTMLフレーム" .PP -\fIjavadoc\fRޥɤϡޥɤϤ줿ͤ˴ŤǾɬפʿ(2ޤ3)Υե졼ޤ\fIjavadoc\fRޥɤ˰Ȥ1ĤΥѥå̾ޤ1ĤΥѥå˴ޤޤ륽եϤϡѥåΥꥹȤάޤΤˡ\fIjavadoc\fRޥɤϺ¦1ĤΥե졼饹ΥꥹȤɽޤʣΥѥå̾Ϥϡ\fIjavadoc\fRޥɤϡ٤ƤΥѥåꥹȤ3Υե졼ȳץڡ(overview\-summary\&.html)ޤե졼άˤϡ֥ե졼ʤץ󥯤򥯥å뤫overview\-summary\&.htmlڡڡåȤɽޤ -.SS "եι¤" +\fIjavadoc\fRコマンドは、コマンドに渡された値に基づき、最小限必要な数(2または3)のフレームを生成します。\fIjavadoc\fRコマンドに引数として1つのパッケージ名または1つのパッケージに含まれるソース・ファイルを渡す場合は、パッケージのリストが省略されます。そのかわりに、\fIjavadoc\fRコマンドは左側の列に1つのフレームを作成し、クラスのリストを表示します。複数のパッケージ名を渡した場合は、\fIjavadoc\fRコマンドは、すべてのパッケージをリストする第3のフレームと概要ページ(overview\-summary\&.html)を作成します。フレームを省略するには、「フレームなし」リンクをクリックするか、overview\-summary\&.htmlページからページ・セットを表示します。 +.SS "生成されるファイルの構造" .PP -륯饹ե뤪ӥ󥿥եեϡJavaե뤪ӥ饹եƱǥ쥯ȥ곬ؤޤ1ĤΥ֥ѥåˤĤ1ĤΥǥ쥯ȥꡢȤ¤ˤʤޤ +生成されるクラス・ファイルおよびインタフェース・ファイルは、Javaソース・ファイルおよびクラス・ファイルと同じディレクトリ階層に編成されます。1つのサブパッケージにつき1つのディレクトリ、という構造になります。 .PP -ȤС\fIjava\&.applet\&.Applet\fR饹ѤɥȤϡjava/applet/Applet\&.html˳Ǽޤ +たとえば、\fIjava\&.applet\&.Applet\fRクラス用に生成されるドキュメントは、java/applet/Applet\&.htmlに格納されます。 .PP -ǥ쥯ȥ̾\fIapidocs\fRȤȡ\fIjava\&.applet\fRѥåΥեι¤ϡΤȤǤҤΤ褦ˡ\fIframe\fRȤ̾˴ޤեϡ٤ƺޤϺΥե졼ɽޤʳHTMLեϡ٤Ʊ¦Υե졼ɽޤ +生成先ディレクトリの名前が\fIapidocs\fRだとすると、\fIjava\&.applet\fRパッケージのファイルの構造は、次のとおりです。前述のように、\fIframe\fRという語を名前に含むファイルは、すべて左上または左下のフレームに表示されます。それ以外のHTMLファイルは、すべて右側のフレームに表示されます。 .PP -ǥ쥯ȥǤꥹ(*)ϡ\fIjavadoc\fRޥɤؤΰѥå̾ǤϤʤե̾Ǥ˾άե뤪ӥǥ쥯ȥ򼨤Ƥޤե̾ξ硢ΥѥåꥹȤޤdoc\-filesǥ쥯ȥϡĥ꡼¸ߤˤΤߡ˺ޤե򻲾ȤƤ +ディレクトリは太字です。アスタリスク(*)は、\fIjavadoc\fRコマンドへの引数がパッケージ名ではなくソース・ファイル名である場合に省略されるファイルおよびディレクトリを示しています。引数がソース・ファイル名の場合、空のパッケージ・リストが作成されます。doc\-filesディレクトリは、ソース・ツリー内に存在する場合にのみ、生成先に作成されます。生成されるファイルを参照してください。 .sp .RS 4 .ie n \{\ @@ -692,7 +692,7 @@ doc\-files .sp -1 .IP \(bu 2.3 .\} -\fBapidocs\fR: Ǿ̥٥롦ǥ쥯ȥ +\fBapidocs\fR: 最上位レベル・ディレクトリ .sp .RS 4 .ie n \{\ @@ -702,7 +702,7 @@ doc\-files .sp -1 .IP \(bu 2.3 .\} -index\&.html: HTMLե졼ꤹڡ +index\&.html: HTMLフレームを設定する初期ページ .RE .sp .RS 4 @@ -713,7 +713,7 @@ index\&.html: HTML .sp -1 .IP \(bu 2.3 .\} -*overview\-summary\&.html: ѥåꥹȤȥޥ꡼ +*overview\-summary\&.html: パッケージ・リストとサマリー .RE .sp .RS 4 @@ -724,7 +724,7 @@ index\&.html: HTML .sp -1 .IP \(bu 2.3 .\} -overview\-tree\&.html: ٤ƤΥѥåΥ饹 +overview\-tree\&.html: すべてのパッケージのクラス階層 .RE .sp .RS 4 @@ -735,7 +735,7 @@ overview\-tree\&.html: .sp -1 .IP \(bu 2.3 .\} -deprecated\-list\&.html: ٤ƤΥѥå侩API +deprecated\-list\&.html: すべてのパッケージの非推奨API .RE .sp .RS 4 @@ -746,7 +746,7 @@ deprecated\-list\&.html: .sp -1 .IP \(bu 2.3 .\} -constant\-values\&.html: ٤ƤΥѥåŪե +constant\-values\&.html: すべてのパッケージの静的フィールド値 .RE .sp .RS 4 @@ -757,7 +757,7 @@ constant\-values\&.html: .sp -1 .IP \(bu 2.3 .\} -serialized\-form\&.html: ٤ƤΥѥåľ󲽤줿ե +serialized\-form\&.html: すべてのパッケージの直列化されたフォーム .RE .sp .RS 4 @@ -768,7 +768,7 @@ serialized\-form\&.html: .sp -1 .IP \(bu 2.3 .\} -*overview\-frame\&.html: Υե졼ɽ뤹٤ƤΥѥå +*overview\-frame\&.html: 左上のフレームに表示するすべてのパッケージ .RE .sp .RS 4 @@ -779,7 +779,7 @@ serialized\-form\&.html: .sp -1 .IP \(bu 2.3 .\} -allclasses\-frame\&.html: Υե졼ɽ뤹٤ƤΥ饹 +allclasses\-frame\&.html: 左下のフレームに表示するすべてのクラス .RE .sp .RS 4 @@ -790,7 +790,7 @@ allclasses\-frame\&.html: .sp -1 .IP \(bu 2.3 .\} -help\-doc\&.html: Javadocڡ˴ؤإ +help\-doc\&.html: Javadocページの編成に関するヘルプ .RE .sp .RS 4 @@ -802,7 +802,7 @@ help\-doc\&.html: Javadoc .IP \(bu 2.3 .\} index\-all\&.html: -\fI\-splitindex\fRץʤǺ줿ǥեȤκ +\fI\-splitindex\fRオプションなしで作成されたデフォルトの索引 .RE .sp .RS 4 @@ -814,7 +814,7 @@ index\-all\&.html: .IP \(bu 2.3 .\} \fBindex\-files\fR: -\fI\-splitindex\fRץꤷƺ줿ǥ쥯ȥ +\fI\-splitindex\fRオプションを指定して作成されたディレクトリ .sp .RS 4 .ie n \{\ @@ -825,7 +825,7 @@ index\-all\&.html: .IP \(bu 2.3 .\} index\-<number>\&.html: -\fI\-splitindex\fRץꤷƺ줿ե +\fI\-splitindex\fRオプションを指定して作成された索引ファイル .RE .RE .sp @@ -837,7 +837,7 @@ index\-<number>\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-list: Ȥ褹뤿Υѥå̾ +package\-list: 外部参照を解決するためのパッケージ名 .RE .sp .RS 4 @@ -848,7 +848,7 @@ package\-list: .sp -1 .IP \(bu 2.3 .\} -stylesheet\&.css: եȡ֤ʤɤޤ +stylesheet\&.css: フォント、色、位置などを定義します .RE .RE .sp @@ -860,7 +860,7 @@ stylesheet\&.css: .sp -1 .IP \(bu 2.3 .\} -\fBjava\fR: ѥåǥ쥯ȥ +\fBjava\fR: パッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -870,7 +870,7 @@ stylesheet\&.css: .sp -1 .IP \(bu 2.3 .\} -\fBapplet\fR: ֥ѥåǥ쥯ȥ +\fBapplet\fR: サブパッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -881,7 +881,7 @@ stylesheet\&.css: .IP \(bu 2.3 .\} Applet\&.html: -\fIApplet\fR饹ڡ +\fIApplet\fRクラス・ページ .RE .sp .RS 4 @@ -893,7 +893,7 @@ Applet\&.html: .IP \(bu 2.3 .\} AppletContext\&.html: -\fIAppletContext\fR󥿥ե +\fIAppletContext\fRインタフェース .RE .sp .RS 4 @@ -905,7 +905,7 @@ AppletContext\&.html: .IP \(bu 2.3 .\} AppletStub\&.html: -\fIAppletStub\fR󥿥ե +\fIAppletStub\fRインタフェース .RE .sp .RS 4 @@ -917,7 +917,7 @@ AppletStub\&.html: .IP \(bu 2.3 .\} AudioClip\&.html: -\fIAudioClip\fR󥿥ե +\fIAudioClip\fRインタフェース .RE .sp .RS 4 @@ -928,7 +928,7 @@ AudioClip\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-summary\&.html: 饹ȥޥ꡼ +package\-summary\&.html: クラスとサマリー .RE .sp .RS 4 @@ -939,7 +939,7 @@ package\-summary\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-frame\&.html: Υե졼ɽѥå饹 +package\-frame\&.html: 左下のフレームに表示するパッケージ・クラス .RE .sp .RS 4 @@ -950,7 +950,7 @@ package\-frame\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-tree\&.html: ΥѥåΥ饹 +package\-tree\&.html: このパッケージのクラス階層 .RE .sp .RS 4 @@ -961,7 +961,7 @@ package\-tree\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-use\&.html: ΥѥåѤ +package\-use\&.html: このパッケージが使用される場所 .RE .sp .RS 4 @@ -972,7 +972,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBdoc\-files\fR: ᡼ӥץ롦եΥǥ쥯ȥ +\fBdoc\-files\fR: イメージおよびサンプル・ファイルのディレクトリ .RE .sp .RS 4 @@ -983,18 +983,18 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBclass\-use\fR: ᡼ӥץ롦եξ +\fBclass\-use\fR: イメージおよびサンプル・ファイルの場所 .sp -\- Applet\&.html: Applet饹λ +\- Applet\&.html: Appletクラスの使用 .sp \- AppletContext\&.html: -\fIAppletContext\fR󥿥եλ +\fIAppletContext\fRインタフェースの使用 .sp \- AppletStub\&.html: -\fIAppletStub\fR󥿥եλ +\fIAppletStub\fRインタフェースの使用 .sp \- AudioClip\&.html: -\fIAudioClip\fR󥿥եλ +\fIAudioClip\fRインタフェースの使用 .RE .RE .RE @@ -1007,7 +1007,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBsrc\-html\fR: ɡǥ쥯ȥ +\fBsrc\-html\fR: ソース・コード・ディレクトリ .sp .RS 4 .ie n \{\ @@ -1017,7 +1017,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBjava\fR: ѥåǥ쥯ȥ +\fBjava\fR: パッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -1027,24 +1027,24 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBapplet\fR: ֥ѥåǥ쥯ȥ +\fBapplet\fR: サブパッケージ・ディレクトリ .sp -\- Applet\&.html: Applet +\- Applet\&.html: Appletソース・コード .sp \- AppletContext\&.html: -\fIAppletContext\fR +\fIAppletContext\fRソース・コード .sp \- AppletStub\&.html: -\fIAppletStub\fR +\fIAppletStub\fRソース・コード .sp \- AudioClip\&.html: -\fIAudioClip\fR +\fIAudioClip\fRソース・コード .RE .RE .RE -.SS "API" +.SS "生成されるAPI宣言" .PP -\fIjavadoc\fRޥɤϡ줾Υ饹󥿥եեɡ󥹥ȥ饯ӥ᥽åɤεҤκǽˡAPIѤޤȤС\fIBoolean\fR饹ϡΤ褦ˤʤޤ +\fIjavadoc\fRコマンドは、それぞれのクラス、インタフェース、フィールド、コンストラクタ、およびメソッドの記述の最初に、そのAPI用の宣言を生成します。たとえば、\fIBoolean\fRクラスの宣言は、次のようになります。 .sp .if n \{\ .RS 4 @@ -1058,7 +1058,7 @@ implements Serializable .RE .\} .PP -\fIBoolean\&.valueOf\fR᥽åɤϼΤȤǤ +\fIBoolean\&.valueOf\fRメソッドの宣言は次のとおりです。 .sp .if n \{\ .RS 4 @@ -1070,15 +1070,15 @@ public static Boolean valueOf(String s) .RE .\} .PP -\fIjavadoc\fRޥɤϡ\fIpublic\fR\fIprotected\fR\fIprivate\fR\fIabstract\fR\fIfinal\fR\fIstatic\fR\fItransient\fR\fIvolatile\fRޤ뤳ȤǤޤ\fIsynchronized\fR\fInative\fRϤǤޤ\fIsynchronized\fR\fInative\fRҤϡξܺ٤ȤߤʤƤ뤿ᡢAPIͤˤϴޤޤޤ +\fIjavadoc\fRコマンドは、修飾子\fIpublic\fR、\fIprotected\fR、\fIprivate\fR、\fIabstract\fR、\fIfinal\fR、\fIstatic\fR、\fItransient\fR、および\fIvolatile\fRを含めることができますが、\fIsynchronized\fRおよび\fInative\fRはできません。\fIsynchronized\fRおよび\fInative\fR修飾子は、実装の詳細とみなされているため、API仕様には含まれません。 .PP -APIǤϡ¹ޥƥˤĤơ\fIsynchronized\fR˰¸ΤǤϤʤȤμȤƥɥȲɬפޤȤС1ĤenumerationʣΥåɤ¹ԤƻѤ뤳ȤϤǤʤפΤ褦˵ҤޤɥȤˤϡΥޥƥ¸ˡ򵭽ҤʤǤȤС\fIHashtable\fRץϥåɥդǤɬפޤ֥ݡȤ뤹٤ƤΥ᥽åɤƱƤ¸פΤ褦˻ꤹ뺬Ϥޤ󡣤٤¹ΤˡХåȡ٥ŪƱ븢¤ͭƤȤᤷޤ -.SH "ɥơ󡦥" +APIでは、並行性セマンティクスについて、キーワード\fIsynchronized\fRに依存するのではなく、コメントの主説明としてドキュメント化する必要があります。たとえば、「1つのenumerationを複数のスレッドから並行して使用することはできない」のように記述します。ドキュメントには、これらのセマンティクスを実現する方法を記述しないでください。たとえば、\fIHashtable\fRオプションはスレッドセーフである必要がありますが、「エクスポートされるすべてのメソッドを同期化してそれを実現する」のように指定する根拠はありません。より高度な並行性のために、バケット・レベルで内部的に同期化する権限を保有しておくことをお薦めします。 +.SH "ドキュメンテーション・コメント" .PP -ΥǤϡɤΥȤȥȤηѾˤĤޤ -.SS "ɡ" +このセクションでは、ソース・コードのコメントとコメントの継承について説明します。 +.SS "ソース・コード・コメント" .PP -ɤǤդΥ饹󥿥ե᥽åɡ󥹥ȥ饯ޤϥեɤˡɥơ󡦥Ȥ򵭽Ҥ뤳ȤǤޤƥѥåˤɥơ󡦥ȤǤޤʸϼ㴳ۤʤޤפˤɥơ󡦥ȤǤޤɥơ󡦥Ȥϡ\fI/**\fRȡɽ\fI*/\fRδ֤ˤʸ鹽ޤƬΥꥹϳƹԤǻѤǤιǾܤޤȤΥƥȤϡʣԤˤ錄äƵҤǤޤ +ソース・コードの任意のクラス、インタフェース、メソッド、コンストラクタ、またはフィールドの宣言の前に、ドキュメンテーション・コメントを記述することができます。各パッケージにもドキュメンテーション・コメントを作成できます。構文は若干異なりますが、概要にもドキュメンテーション・コメントを作成できます。ドキュメンテーション・コメントは、\fI/**\fRと、終わりを表す\fI*/\fRの間にある文字から構成されます。先頭のアスタリスクは各行で使用でき、次の項で詳しく説明します。コメントのテキストは、複数行にわたって記述できます。 .sp .if n \{\ .RS 4 @@ -1093,7 +1093,7 @@ API .RE .\} .PP -ڡ󤹤ˤϡȤ1Ԥޤ +スペースを節約するには、コメントを1行に入れます。 .sp .if n \{\ .RS 4 @@ -1104,10 +1104,10 @@ API .if n \{\ .RE .\} -Ȥ.PP -ɥơ󡦥Ȥϡ饹󥿥ե󥹥ȥ饯᥽åɡޤϥեľ֤ˤΤǧޤ᥽åɤΤ֤Ƥɥơ󡦥Ȥ̵뤵ޤ\fIjavadoc\fRޥɤϡʸȤ1ĤΥɥơ󡦥Ȥǧޤ󡣥ѤǤ򻲾ȤƤ +コメントの配置.PP +ドキュメンテーション・コメントは、クラス、インタフェース、コンストラクタ、メソッド、またはフィールド宣言の直前に配置される場合にのみ認識されます。メソッドの本体に置かれているドキュメンテーション・コメントは無視されます。\fIjavadoc\fRコマンドは、宣言文ごとに1つのドキュメンテーション・コメントしか認識しません。タグを使用できる場所を参照してください。 .PP -褯ְ㤤ϡ饹Ȥȥ饹δ֤\fIimport\fRʸ֤ƤޤȤǤ\fIjavadoc\fRޥɤϥ饹Ȥ̵뤹Τǡ\fIimport\fRʸ򤳤ξ֤ʤǤ +よくある間違いは、クラス・コメントとクラス宣言の間に\fIimport\fR文を置いてしまうことです。\fIjavadoc\fRコマンドはクラス・コメントを無視するので、\fIimport\fR文をこの場所に配置しないでください。 .sp .if n \{\ .RS 4 @@ -1124,8 +1124,8 @@ public class Whatever{ } .if n \{\ .RE .\} -ȤΥѡ.PP -ɥơ󡦥ȤˤϡȤθ³󤬴ޤޤޤϡ϶ڤʸ\fI/**\fRǻϤޤꡢޤ³ޤϡƬʸ\fI@\fRιԤǽΥ֥åϤޤޤ(ƬΥꥹʸƬζڤʸ\fI/**\fRϽ)򵭽ҤΤߤΥȤ򵭽Ҥ뤳ȤǤޤϡʹߤ³뤳ȤϤǤޤ󡣥ΰϡʣԤˤ錄äƵҤǤޤο¤Ϥޤ󡣲⵭ҤǤ륿ȡ1󤷤ҤǤʤޤȤС\fI@see\fR饿ϻϤޤޤ +コメントのパーツ.PP +ドキュメンテーション・コメントには、主説明とその後に続くタグ・セクションが含まれます。主説明は、開始区切り文字\fI/**\fRで始まり、タグ・セクションまで続きます。タグ・セクションは、先頭文字が\fI@\fRの行で定義される最初のブロック・タグから始まります(先頭のアスタリスク、空白文字、先頭の区切り文字\fI/**\fRは除く)。主説明を記述せず、タグ・セクションのみのコメントを記述することもできます。主説明は、タグ・セクション以降に続けることはできません。タグの引数は、複数行にわたって記述できます。タグの数に制限はありません。何回も記述できるタグと、1回しか記述できないタグがあります。たとえば、次の\fI@see\fRタグからタグ・セクションは始まります。 .sp .if n \{\ .RS 4 @@ -1139,8 +1139,8 @@ public class Whatever{ } .if n \{\ .RE .\} -֥åӥ饤󡦥.PP -ϡ\fIjavadoc\fRޥɤɥơ󡦥üʥɤǤˤ2ĤΥפޤ1Ĥ\fI@tag\fRΤ褦ɽ֥å(ɥ󡦥ȤƤФ)⤦1Ĥ\fI{@tag}\fRΤ褦楫åǰϤɽ륤饤󡦥Ǥ֥åᤵˤϡƬΥꥹʸڤʸ(\fI/**\fR)ơԤƬ֤ɬפޤϡ\fI@\fRʸƥ̤ξǻѤƤ⡢γϤȤƲᤵʤȤ̣Ƥޤ\fI@\fRʸѤƹԤ򳫻ϤƤ⡢줬ᤵʤ褦ˤˤϡHTMLƥƥ\fI@\fRѤޤ줾Υ֥åˤϡϢդ줿ƥȤޤΥƥȤϡθ夫顢Υޤϥɥơ󡦥ȤκǸޤǤδ֤˵Ҥ줿ƥȤǤ(ޤϥȶڤʸ)δϢƥȤϡʣԤˤ錄äƵҤǤޤ饤󡦥ϡƥȤ򵭽ҤǤǤФɤˤǤ֤ȤǤᤵޤˤϥ֥å\fI@deprecated\fRȥ饤󡦥\fI{@link}\fRޤޤƤޤjavadoc򻲾ȤƤ +ブロックおよびインライン・タグ.PP +タグは、\fIjavadoc\fRコマンドが処理するドキュメンテーション・コメント内の特殊なキーワードです。タグには2つのタイプがあります。1つは\fI@tag\fRタグのように表記されるブロック・タグ(スタンドアロン・タグとも呼ばれる)、もう1つは\fI{@tag}\fRタグのように中カッコで囲んで表記されるインライン・タグです。ブロック・タグが解釈されるには、行頭のアスタリスク、空白文字、区切り文字(\fI/**\fR)を除いて、行の先頭に置く必要があります。これは、\fI@\fR文字をテキスト内の別の場所で使用しても、タグの開始として解釈されないことを意味しています。\fI@\fR文字を使用して行を開始しても、それが解釈されないようにするには、HTMLエンティティ\fI@\fRを使用します。それぞれのブロック・タグには、関連付けられたテキストがあります。このテキストは、タグの後から、次のタグの前、またはドキュメンテーション・コメントの最後までの間に記述されたテキストです(タグまたはコメント区切り文字を除く)。この関連テキストは、複数行にわたって記述できます。インライン・タグは、テキストを記述できる場所であればどこにでも置くことができ、解釈されます。次の例にはブロック・タグ\fI@deprecated\fRとインライン・タグ\fI{@link}\fRが含まれています。javadocタグを参照してください。 .sp .if n \{\ .RS 4 @@ -1153,10 +1153,10 @@ public class Whatever{ } .if n \{\ .RE .\} -HTMLǤΥȤε.PP -ƥȤHTMLƥƥHTMLѤHTMLǵҤɬפޤѤ֥饦ݡȤǤդHTMLΥСѤǤޤɸɥååȤϡǥ󥰡롦Ȥӥե졼ޤᡢɥơ󡦥ȰʳʬHTML 3\&.2˽򤷤ɤޤե졼ࡦåȤΤᡢ줿եˤHTML 4\&.0侩ޤ +HTMLでのコメントの記述.PP +テキストはHTMLエンティティとHTMLタグを使用してHTMLで記述される必要があります。使用するブラウザがサポートする任意のHTMLのバージョンを使用できます。標準ドックレットは、カスケーディング・スタイル・シートおよびフレームを含め、ドキュメンテーション・コメント以外の部分でHTML 3\&.2に準拠したコードを生成します。フレーム・セットのため、生成されたファイルにはHTML 4\&.0が推奨されます。 .PP -ȤС꾮(<)Ӥ礭(>)Υƥƥϡ\fI<\fR\fI>\fRȵҤɬפޤƱͤˡѥ(&)\fI&\fRȵҤɬפޤǤϡHTML\fI<b>\fRѤƤޤ +たとえば、より小さい記号(<)およびより大きい記号(>)のエンティティは、\fI<\fRおよび\fI>\fRと記述する必要があります。同様に、アンパサンド(&)は\fI&\fRと記述する必要があります。次の例では、太字のHTMLタグ\fI<b>\fRを使用しています。 .sp .if n \{\ .RS 4 @@ -1170,12 +1170,12 @@ HTML .if n \{\ .RE .\} -ƬΥꥹ.PP -\fIjavadoc\fRޥɤˤɥơ󡦥ȤβϻˡƹԤƬˤ륢ꥹ(*)ʸ˴ޤǽΥꥹ(*)ʸˤ䥿֤˴ޤƬΥꥹά硢ǥȤݻޤޤǥץ롦ɤ\fI<PRE>\fRΥɥơ󡦥ȤľŽդ褦ˡƬζʸϺʤʤޤ֥饦ϡʸ򥿥֤Χ˲ᤷޤǥȤε(ڤʸ\fI/**\fRޤ\fI<PRE>\fRǤϤʤ)ޡˤʤޤ -ǽʸ.PP -ƥɥơ󡦥ȤκǽʸϡƤ륨ƥƥ˴ؤʷ餫Ĵʥޥ꡼ʸǤɬפޤʸϡ򡢥֡ޤϹԽλʸ³ǽΥԥꥪɡޤϺǽΥ֥å֤ǽޤǽʸϡ\fIjavadoc\fRޥɤˤäHTMLڡƬˤСΥޥ꡼ʬ˥ԡޤ -ʣեɤ.PP -JavaץåȥեǤϡ1ĤʸʣΥեɤǤޤʸˤϡ1ĤΥɥơ󡦥ȤҤǤޤ󡣤ΥȤ٤ƤΥեɤФƥԡޤեɤȤ˥ɥơ󡦥Ȥ򵭽Ҥɬפϡƥեɤ̡ʸɬפޤȤСΥɥơ󡦥Ȥϡ1ĤȤƵҤŬڤǤξϡ2Ĥʬ뤳Ȥᤷޤ +先頭のアスタリスク.PP +\fIjavadoc\fRコマンドによるドキュメンテーション・コメントの解析時に、各行の先頭にあるアスタリスク(*)文字は破棄されます。最初のアスタリスク(*)文字より前にある空白やタブも破棄されます。行頭のアスタリスクを省略した場合、インデントを保持したままでサンプル・コードを\fI<PRE>\fRタグ内のドキュメンテーション・コメントに直接貼り付けられるように、先頭の空白文字は削除されなくなります。ブラウザは、空白文字をタブよりも一律に解釈します。インデントの起点は(区切り文字\fI/**\fRまたは\fI<PRE>\fRタグではなく)左マージンになります。 +最初の文.PP +各ドキュメンテーション・コメントの最初の文は、宣言されているエンティティに関する簡潔かつ完全なサマリー文である必要があります。この文は、空白、タブ、または行終了文字が続く最初のピリオド、または最初のブロック・タグがある位置で終わります。最初の文は、\fIjavadoc\fRコマンドによってHTMLページの先頭にあるメンバーのサマリーの部分にコピーされます。 +複数フィールドの宣言.PP +Javaプラットフォームでは、1つの文で複数のフィールドを宣言できます。ただし、この文には、1つのドキュメンテーション・コメントしか記述できません。そのコメントが、すべてのフィールドに対してコピーされます。フィールドごとにドキュメンテーション・コメントを記述する必要がある場合は、各フィールドを別々の文で宣言する必要があります。たとえば、次のドキュメンテーション・コメントは、1つの宣言として記述すると不適切です。この場合は、宣言を2つに分けることをお薦めします。 .sp .if n \{\ .RS 4 @@ -1191,7 +1191,7 @@ public int x, y; // Avoid this .RE .\} .PP -\fIjavadoc\fRޥɤϡΥɤ鼡Τ褦ʥɥȤޤ +\fIjavadoc\fRコマンドは、上のコードから次のようなドキュメントを生成します。 .sp .if n \{\ .RS 4 @@ -1216,27 +1216,27 @@ public int y .\} .PP The horizontal and vertical distances of point (x, y)\&. -إåλ.PP -СФƥɥơ󡦥Ȥ򵭽ҤȤˤϡ\fI<H1>\fR\fI<H2>\fRʤɤHTMLФѤʤȤᤷޤ\fIjavadoc\fRޥɤϡʹ¤ɥȤΤǡΤ褦ʹ¤ѤƤȡɥȤηƶ뤳Ȥޤ饹ѥåΥȤǤϡθФѤȼι¤ꤷƤޤޤ -.SS "᥽åɡȤηѾ" +ヘッダー・タグの使用.PP +メンバーに対してドキュメンテーション・コメントを記述するときには、\fI<H1>\fRや\fI<H2>\fRなどのHTML見出しタグを使用しないことをお薦めします。\fIjavadoc\fRコマンドは、完全な構造化ドキュメントを作成するので、このような構造化タグが使用されていると、生成ドキュメントの形式が悪影響を受けることがあります。ただし、クラスやパッケージのコメントでは、これらの見出しを使用して独自の構造を指定してかまいません。 +.SS "メソッド・コメントの継承" .PP -\fIjavadoc\fRޥɤǤϡ饹ӥ󥿥եǥ᥽åɡȤѾơƥȤϤꡢŪ˥᥽åɡȤѾ뤳ȤǤޤ󥹥ȥ饯եɡӥͥȤ줿饹ϡɥơ󡦥ȤѾޤ +\fIjavadoc\fRコマンドでは、クラスおよびインタフェースでメソッド・コメントを継承して、欠落したテキストを入力したり、明示的にメソッド・コメントを継承することができます。コンストラクタ、フィールド、およびネストされたクラスは、ドキュメンテーション・コメントを継承しません。 .PP -\fB:\fR -ɥơ󡦥Ȥ򥳥ԡѤˤϡѾ᥽åɤΥե뤬\fI\-sourcepath\fRץǻꤷѥΤߤ֤Ƥɬפޤޥɥ饤ǡ饹ѥåϤɬפϤޤ󡣤ϥ꡼1\&.3\&.\fIn\fRȤоŪǤޤǤϡ饹ɥȲ륯饹Ǥ뤳ȤɬפǤ -ƥȤ.PP -ޤ\fI@return\fR\fI@param\fR\fI@throws\fR᥽åɡȤƤ硢\fIjavadoc\fRޥɤϡбޤϥȤ򡢤줬С饤ɤޤϼƤ᥽å()饳ԡޤ᥽åɡȤηѾ򻲾ȤƤ +\fB注意:\fR +ドキュメンテーション・コメントをコピーに利用するには、継承したメソッドのソース・ファイルが\fI\-sourcepath\fRオプションで指定したパスのみに置かれている必要があります。コマンドラインで、クラスもパッケージも渡す必要はありません。この点はリリース1\&.3\&.\fIn\fR以前とは対照的です。これまでは、クラスがドキュメント化されるクラスであることが必要でした。 +欠落テキストの入力.PP +主説明、または\fI@return\fR、\fI@param\fR、\fI@throws\fRタグがメソッド・コメントから欠落している場合、\fIjavadoc\fRコマンドは、対応する主説明またはタグ・コメントを、それがオーバーライドまたは実装しているメソッド(ある場合)からコピーします。メソッド・コメントの継承を参照してください。 .PP -Υѥ᡼\fI@param\fRĤʤ硢Υѥ᡼ΥȤ̤ηѾؤΥ᥽åɤ饳ԡޤ㳰\fI@throws\fRĤʤ硢㳰Ƥˤꡢ\fI@throws\fRԡޤ +特定のパラメータの\fI@param\fRタグが見つからない場合、そのパラメータのコメントが、上位の継承階層のメソッドからコピーされます。特定の例外の\fI@throws\fRタグが見つからない場合、その例外が宣言されている場合にかぎり、\fI@throws\fRタグがコピーされます。 .PP -ưϥ꡼1\&.3ưȤоŪǤޤǤΥСǤϡޤϥ¸ߤСȤϰڷѾޤǤ +この動作はリリース1\&.3以前の動作とは対照的です。これまでのバージョンでは、主説明またはタグが存在すれば、コメントは一切継承されませんでした。 .PP -javadocӥץ򻲾ȤƤ -ŪʷѾ.PP -\fI{@inheritDoc}\fR饤󡦥᥽åɤμޤ\fI@return\fR\fI@param\fR\fI@throws\fRȤޤбѾ줿ޤϥȤϡξ˥ԡޤ -.SS "饹ӥ󥿥եηѾ" +javadocタグおよびオプションを参照してください。 +明示的な継承.PP +\fI{@inheritDoc}\fRインライン・タグをメソッドの主説明または\fI@return\fR、\fI@param\fR、\fI@throws\fRタグ・コメントに挿入します。対応する継承された主説明またはタグ・コメントは、その場所にコピーされます。 +.SS "クラスおよびインタフェースの継承" .PP -ȤηѾϡ饹ӥ󥿥եηѾΡͤ뤹٤Ƥξȯޤ +コメントの継承は、クラスおよびインタフェースからの継承の、考えられるすべての場合に発生します。 .sp .RS 4 .ie n \{\ @@ -1246,7 +1246,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饹Υ᥽åɤѡ饹Υ᥽åɤ򥪡С饤ɤƤ +クラスのメソッドがスーパークラスのメソッドをオーバーライドしている場合 .RE .sp .RS 4 @@ -1257,7 +1257,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -󥿥եΥ᥽åɤѡ󥿥եΥ᥽åɤ򥪡С饤ɤƤ +インタフェースのメソッドがスーパーインタフェースのメソッドをオーバーライドしている場合 .RE .sp .RS 4 @@ -1268,15 +1268,15 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饹Υ᥽åɤ󥿥եΥ᥽åɤƤ +クラスのメソッドがインタフェースのメソッドを実装している場合 .RE .PP -ǽ2ĤΥǤϡ\fIjavadoc\fRޥɤϡС饤ɤƤ᥽åɤΥɥ\fI֥С饤ɡ\fRȤФޤȤѾƤ뤫ɤˤ餺С饤ɤƤ᥽åɤؤΥ󥯤ޤޤޤ +最初の2つのケースでは、\fIjavadoc\fRコマンドは、オーバーライドしているメソッドのドキュメント内に\fI「オーバーライド」\fRという小見出しを生成します。コメントが継承されているかどうかにかかわらず、オーバーライドされているメソッドへのリンクが含まれます。 .PP -3ܤΥ(Υ饹Υ᥽åɤ󥿥եΥ᥽åɤƤ)Ǥϡ\fIjavadoc\fRޥɤϡС饤ɤƤ᥽åɤΥɥ\fI\fRȤФޤȤѾƤ뤫ɤˤ餺Ƥ᥽åɤؤΥ󥯤ޤޤޤ -.SS "᥽åɡȤΥ르ꥺ" +3つ目のケース(特定のクラスのメソッドがインタフェースのメソッドを実装している場合)では、\fIjavadoc\fRコマンドは、オーバーライドしているメソッドのドキュメント内に\fI「定義」\fRという小見出しを生成します。コメントが継承されているかどうかにかかわらず、実装されているメソッドへのリンクが含まれます。 +.SS "メソッド・コメントのアルゴリズム" .PP -᥽åɤ˥ɥơ󡦥Ȥʤޤ\fI{@inheritDoc}\fR硢\fIjavadoc\fRޥɤϼΥ르ꥺѤŬѤǤ륳Ȥ򸡺ޤ르ꥺϡǤꤵŬѲǽʥɥơ󡦥Ȥõѡ饹⥤󥿥եͥ褹褦߷פƤޤ +メソッドにドキュメンテーション・コメントがない、または\fI{@inheritDoc}\fRタグがある場合、\fIjavadoc\fRコマンドは次のアルゴリズムを使用して適用できるコメントを検索します。アルゴリズムは、最も特定される適用可能なドキュメンテーション・コメントを探し、スーパークラスよりもインタフェースを優先するように設計されています。 .sp .RS 4 .ie n \{\ @@ -1286,7 +1286,7 @@ javadoc .sp -1 .IP " 1." 4.2 .\} -ľܤ˼Ƥ(ޤϡĥƤ)󥿥ե򡢥᥽åɤ\fIimplements\fR(ޤ\fIextends\fR)Ȥθ˽иǡ1ĤĴ٤ޤΥ᥽åɤˤĤƺǽ˸Ĥäɥơ󡦥ȤѤޤ +直接に実装されている(または、拡張されている)インタフェースを、メソッドの宣言で\fIimplements\fR(または\fIextends\fR)という語の後に出現する順序で、1つずつ調べます。このメソッドについて最初に見つかったドキュメンテーション・コメントを採用します。 .RE .sp .RS 4 @@ -1297,7 +1297,7 @@ javadoc .sp -1 .IP " 2." 4.2 .\} -1ǥɥơ󡦥ȤĤʤäϡľܼƤ(ޤϡĥƤ)󥿥եΤ줾ФơΥ르ꥺΤƵŪŬѤޤ(κݤνϡ1ǥ󥿥եĴ٤ȤνƱ) +手順1でドキュメンテーション・コメントが見つからなかった場合は、直接実装されている(または、拡張されている)インタフェースのそれぞれに対して、このアルゴリズム全体を再帰的に適用します(その際の順序は、手順1でインタフェースを調べたときの順序と同じ)。 .RE .sp .RS 4 @@ -1308,7 +1308,7 @@ javadoc .sp -1 .IP " 3." 4.2 .\} -2ǥɥơ󡦥ȤĤʤäǡΥ饹\fIObject\fRʳΥ饹Ǥ뤬󥿥եǤϤʤϡΤ褦˽ޤ +手順2でドキュメンテーション・コメントが見つからなかった場合で、このクラスが\fIObject\fR以外のクラスであるが、インタフェースではない場合は、次のように処理します。 .sp .RS 4 .ie n \{\ @@ -1318,7 +1318,7 @@ javadoc .sp -1 .IP " 1." 4.2 .\} -ѡ饹ˤΥ᥽åɤˤĤƤΥɥơ󡦥ȤҤƤϡΥȤѤޤ +スーパークラスにこのメソッドについてのドキュメンテーション・コメントが記述されている場合は、そのコメントを採用します。 .RE .sp .RS 4 @@ -1329,14 +1329,14 @@ javadoc .sp -1 .IP " 2." 4.2 .\} -3aǥɥơ󡦥ȤĤʤäϡѡ饹ФơΥ르ꥺΤƵŪŬѤޤ +手順3aでドキュメンテーション・コメントが見つからなかった場合は、スーパークラスに対して、このアルゴリズム全体を再帰的に適用します。 .RE .RE -.SH "JAVADOC" +.SH "JAVADOCタグ" .PP -\fIjavadoc\fRޥɤϡJavaΥɥơ󡦥ޤ줿̤ʥϤޤ\fIjavadoc\fRѤȡAPI򥽡ɤ鼫ưŪǤޤϥåȥޡ(\fI@\fR)ǻϤޤꡢʸȾʸ̤ޤΥϡɽƤȤʸȾʸѤϤɬפޤϡԤƬ(ƬζʸȾάǽʥꥹθ)֤ɬפޤʤȡƥȤȤưޤȤơƱ̾Υ1սˤޤȤޤȤС\fI@see\fRʣϡ٤ƱˤޤȤ֤ޤܺ٤ϡѤǤ򻲾ȤƤ +\fIjavadoc\fRコマンドは、Javaのドキュメンテーション・コメント内に埋め込まれた特別なタグを解析します。\fIjavadoc\fRタグを使用すると、完全な整形式のAPIをソース・コードから自動的に生成できます。タグはアットマーク記号(\fI@\fR)で始まり、大文字と小文字が区別されます。これらのタグは、表示されているとおりに大文字と小文字を使用して入力する必要があります。タグは、行の先頭(先頭の空白文字と省略可能なアスタリスクの後)に置く必要があります。そうしないと、テキストとして扱われます。慣例として、同じ名前のタグは1箇所にまとめます。たとえば、\fI@see\fRタグが複数ある場合は、すべて同じ場所にまとめて配置します。詳細は、タグを使用できる場所を参照してください。 .PP -ˤϡΥפޤ +タグには、次のタイプがあります。 .sp .RS 4 .ie n \{\ @@ -1346,7 +1346,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -֥å: ֥åϼ³ˤΤ֤ޤ֥åϡ\fI@tag\fRηȤޤ +ブロック・タグ: ブロック・タグは主説明に続くタグ・セクション内にのみ配置します。ブロック・タグは、\fI@tag\fRの形式をとります。 .RE .sp .RS 4 @@ -1357,52 +1357,52 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饤󡦥: 饤󡦥ϼޤϥ֥åΥǤդξ֤ޤ饤󡦥\fI{@tag}\fRΤ褦楫åǰϤߤޤ +インライン・タグ: インライン・タグは主説明内またはブロック・タグのコメント内の任意の場所に配置します。インライン・タグは\fI{@tag}\fRのように中カッコで囲みます。 .RE .PP -ࡦˤĤƤϡ\-tag tagname:Xaoptcmf:"taghead"򻲾ȤƤѤǤ⻲ȤƤ -.SS "" +カスタム・タグについては、\-tag tagname:Xaoptcmf:"taghead"を参照してください。タグを使用できる場所も参照してください。 +.SS "タグの説明" .PP @author \fIname\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI\-author\fRץ󤬻ѤƤ硢ꤷ̾ΥƥȤκԥȥɥȤɲäޤ1ĤΥɥơ󡦥Ȥʣ\fI@author\fRޤ뤳ȤǤޤ1Ĥ\fI@author\fR1Ĥ̾ꤹ뤳Ȥ⡢ʣ̾ꤹ뤳ȤǤޤԤξϡ\fIjavadoc\fRޥɤˤä̾̾δ֤˥(,)ȶʸޤԤξϡƥΤϤ뤳ȤʤɥȤ˥ԡޤäơޤǤϤʤƸб̾ڤʸѤɬפȤˡ1Ԥʣ̾ǤޤJavadocġǤDocȤεˡ@author˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@author)򻲾ȤƤ +\fI\-author\fRオプションが使用されている場合、指定した名前のテキストの作成者エントリを生成されるドキュメントに追加します。1つのドキュメンテーション・コメントに複数の\fI@author\fRタグを含めることができます。1つの\fI@author\fRタグに1つの名前を指定することも、複数の名前を指定することもできます。前者の場合は、\fIjavadoc\fRコマンドによって名前と名前の間にカンマ(,)と空白文字が挿入されます。後者の場合は、テキスト全体が解析されることなく、生成ドキュメントにコピーされます。したがって、カンマではなく、各言語に対応した名前区切り文字を使用する必要があるときに、1行に複数の名前を指定できます。JavadocツールでのDocコメントの記述方法の@authorに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@author)を参照してください。 .RE .PP {@code \fItext\fR} .RS 4 -JDK 1\&.5Ƴ +JDK 1\&.5で導入 .sp -\fI<code>{@literal}</code>\fRƱǤ +\fI<code>{@literal}</code>\fRと同等です。 .sp -ƥȤHTMLޡåפޤϥͥȤ줿JavadocȤƲ᤻ˡtext򥳡ɡեȤɽޤˤꡢɥơ󡦥ȤǤϡѥ᡼η(\fI<Object>\fR)(\fI3 < 4\fR)(\fI<\-\fR)ʤɤǡ̾λå(<>)HTMLƥƥ(\fI<\fR\fI>\fR)Τ˻ѤǤޤȤСɥơ󡦥\fI{@code A<B>C}\fR\fIA<B>C\fRȤѹ줺줿HTMLڡɽޤĤޤꡢ\fI<B>\fRȤƲᤵ줺ΥեȤϥɡեȤˤʤޤɡեȤʤƱǽ¸ˤϡ\fI{@literal}\fRѤޤ +テキストをHTMLマークアップまたはネストされたJavadocタグとして解釈せずに、textをコード・フォントで表示します。これにより、ドキュメンテーション・コメントでは、パラメータの型(\fI<Object>\fR)、不等号(\fI3 < 4\fR)、矢印(\fI<\-\fR)などで、通常の山カッコ(<および>)をHTMLエンティティ(\fI<\fRおよび\fI>\fR)のかわりに使用できます。たとえば、ドキュメンテーション・コメント\fI{@code A<B>C}\fRは\fIA<B>C\fRとして変更されずに生成されたHTMLページに表示されます。つまり、\fI<B>\fRが太字として解釈されず、そのフォントはコード・フォントになります。コード・フォントなしで同じ機能を実現するには、\fI{@literal}\fRタグを使用します。 .RE .PP @deprecated \fIdeprecated\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -APIư³ޤAPIѤʤȤ륳Ȥɲäޤ\fIjavadoc\fRޥɤϡ\fIdeprecated\-text\fR˰ưƥåˤηٹֿ侩Ƥޤ󡣡פɲäޤΥϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤ +このAPIは動作し続けますが、このAPIを使用しないことを薦めるコメントを追加します。\fIjavadoc\fRコマンドは、\fIdeprecated\-text\fRを主説明の前に移動してイタリックにし、その前に太字の警告「推奨されていません。」を追加します。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。 .sp -侩ƥȤκǽʸǤϡAPI侩ʤʤäȡؤȤƻѤAPI桼󼨤ɬפޤ\fIjavadoc\fRޥɤϡκǽʸ򡢥ޥ꡼Ⱥ˥ԡޤθʸ侩ˤʤäͳ뤳ȤǤޤAPIؤ\fI{@link}\fR(Javadoc 1\&.2ʹߤξ)ޤɬפޤ +非推奨テキストの最初の文では、そのAPIが推奨されなくなった時期と、代替として使用するAPIをユーザーに提示する必要があります。\fIjavadoc\fRコマンドは、この最初の文を、サマリー・セクションと索引にコピーします。その後の文で非推奨になった理由を説明することもできます。代替APIを指し示す\fI{@link}\fRタグ(Javadoc 1\&.2以降の場合)を含める必要があります。 .sp -\fI@deprecated annotation\fRѤƥץǤ侩ˤޤAPI侩ˤˡȻ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html)򻲾ȤƤ +\fI@deprecated annotation\fRタグを使用してプログラム要素を非推奨にします。APIを非推奨にする方法と時期 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html)を参照してください。 .sp -JavadocġǤDocȤεˡ@deprecated˴ؤ +JavadocツールでのDocコメントの記述方法の@deprecatedに関する項 -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@deprecated)⻲ȤƤ +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@deprecated)も参照してください。 .RE .PP {@docRoot} .RS 4 -JDK 1\&.3Ƴ +JDK 1\&.3で導入 .sp -ڡΡɥȤ()롼ȡǥ쥯ȥؤХѥɽޤΥϡΥڡҤΥʤɡ뤹٤ƤΥڡ黲ȤեȤ߹ȤǤ̾ϡƥڡκDzΥڡ˥󥯤ޤ +生成されるページからの、生成ドキュメントの(生成先)ルート・ディレクトリへの相対パスを表します。このタグは、著作権のページや会社のロゴなど、生成されるすべてのページから参照するファイルを組み込むときに便利です。通常は、各ページの最下部から著作権のページにリンクします。 .sp -\fI{@docRoot}\fRϡޥɥ饤Ǥɥơ󡦥ǤѤǤޤΥϡǤդΥ(\fI@return\fR\fI@param\fR\fI@deprecated\fRʤ)Υƥʬޤࡢ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤ +この\fI{@docRoot}\fRタグは、コマンドラインでもドキュメンテーション・コメント内でも使用できます。このタグは、任意のタグ(\fI@return\fR、\fI@param\fRおよび\fI@deprecated\fRタグなど)のテキスト部分を含む、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。 .sp .RS 4 .ie n \{\ @@ -1412,9 +1412,9 @@ JDK 1\&.3 .sp -1 .IP \(bu 2.3 .\} -ޥɥ饤ǡإåեåޤϺDzΤ褦ޤ\fIjavadoc \-bottom \*(Aq<a href="{@docRoot}/copyright\&.html">Copyright</a>\*(Aq\fR +コマンドラインで、ヘッダー、フッターまたは最下部が次のように定義されます。\fIjavadoc \-bottom \*(Aq<a href="{@docRoot}/copyright\&.html">Copyright</a>\*(Aq\fR .sp -\fI{@docRoot}\fRmakefileǤΤ褦Ѥ硢\fImakefile\fRץǤϡ楫å\fI{}\fRʸ̤˥פɬפޤȤСInprise MAKEС5\&.2WindowsǼ¹Ԥϡ\fI{{@docRoot}}\fRΤ褦ˡ楫åŤˤɬפޤ\fI\-bottom\fRץʤɤΥץؤΰϤΤˡ(ŤǤϤʤ)ɬפǤ(\fIhref\fRϤϾά) +\fI{@docRoot}\fRタグをmakefile内でこのように利用する場合、一部の\fImakefile\fRプログラムでは、中カッコ\fI{}\fR文字を特別にエスケープする必要があります。たとえば、Inprise MAKEバージョン5\&.2をWindows上で実行する場合は、\fI{{@docRoot}}\fRのように、中カッコを二重にする必要があります。\fI\-bottom\fRオプションなどのオプションへの引数を囲むのに、二重(一重ではなく)引用符も必要です(\fIhref\fR引数を囲む引用符は省略)。 .RE .sp .RS 4 @@ -1425,7 +1425,7 @@ JDK 1\&.3 .sp -1 .IP \(bu 2.3 .\} -ɥơ󡦥ȤǤ +ドキュメンテーション・コメントでは .sp .if n \{\ .RS 4 @@ -1438,24 +1438,24 @@ JDK 1\&.3 .if n \{\ .RE .\} -ΥɬפͳϡɥȤ֥ѥåƱijع¤Υǥ쥯ȥ˳Ǽ뤫Ǥ\fI<a href="{@docRoot}/copyright\&.html">\fRϡ\fIjava/lang/Object\&.java\fRФƤ\fI<a href="\&.\&./\&.\&./copyright\&.html">\fR˲褵졢\fIjava/lang/ref/Reference\&.java\fRФƤ\fI<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR˲褵ޤ +このタグが必要な理由は、生成ドキュメントが、サブパッケージと同じ深さを持つ階層構造のディレクトリに格納されるからです。式\fI<a href="{@docRoot}/copyright\&.html">\fRは、\fIjava/lang/Object\&.java\fRに対しては\fI<a href="\&.\&./\&.\&./copyright\&.html">\fRに解決され、\fIjava/lang/ref/Reference\&.java\fRに対しては\fI<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fRに解決されます。 .RE .RE .PP @exception \fIclass\-name description\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI@throws\fRƱǤ@throws class\-name description򻲾ȤƤ +\fI@throws\fRタグと同じです。@throws class\-name descriptionを参照してください。 .RE .PP {@inheritDoc} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -ǤᤤѾǽʥ饹ޤϼǽʥ󥿥ե顢Υΰ֤ˤ븽ߤΥɥơ󡦥ȤˡɥȤѾ(ԡ)ޤˤꡢŪʥȤѾĥ꡼ξ̤˵ҤԡƥȤѤƵҤ뤳ȤǤޤ +最も近い継承可能なクラスまたは実装可能なインタフェースから、このタグの位置にある現在のドキュメンテーション・コメントに、ドキュメントを継承(コピー)します。これにより、より汎用的なコメントを継承ツリーの上位に記述し、コピーしたテキストを使用して記述することができます。 .sp -Υϡɥơ󡦥Ȥμΰ֤ǤΤͭǤ +このタグは、ドキュメンテーション・コメントの次の位置でのみ有効です。 .sp .RS 4 .ie n \{\ @@ -1465,7 +1465,7 @@ JDK 1\&.4 .sp -1 .IP \(bu 2.3 .\} -᥽åɤμ֥å⡣ξ硢ϡ̳ؤΥ饹ޤϥ󥿥ե饳ԡޤ +メソッドの主説明ブロック内。この場合、主説明は、上位階層のクラスまたはインタフェースからコピーされます。 .RE .sp .RS 4 @@ -1476,24 +1476,24 @@ JDK 1\&.4 .sp -1 .IP \(bu 2.3 .\} -᥽åɤ\fI@return\fR\fI@param\fR\fI@throws\fRΥƥȰ⡣ξ硢ƥȤϡ̳ؤб륿饳ԡޤ +メソッドの\fI@return\fR、\fI@param\fR、\fI@throws\fRタグのテキスト引数内。この場合、タグ・テキストは、上位階層の対応するタグからコピーされます。 .RE .sp -ѾؤǥȤ򸫤Ĥˡ˴ؤϡ᥽åɡȤηѾ򻲾ȤƤΥĤʤ硢Ȥϡι롼˱ơưŪ˷Ѿ뤫ɤޤޤ +継承階層でコメントを見つける方法に関する説明は、メソッド・コメントの継承を参照してください。このタグが見つからない場合、コメントは、この項で説明するルールに応じて、自動的に継承されるかどうかが決まります。 .RE .PP {@link \fIpackage\&.class#member label\fR} .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ɽƥlabelȤȤ˥饤󡦥󥯤ޤlabelϡȥ饹λꤵ줿ѥå饹ޤϥС̾ΥɥȤؤޤΥϡ\fI@return\fR\fI@param\fR\fI@deprecated\fRʤɤǤդΥΥƥʬޤࡢ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤJavadocġǤDocȤεˡ@link˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#{@link)򻲾ȤƤ +表示テキストlabelとともにインライン・リンクを挿入します。labelは、参照クラスの指定されたパッケージ、クラス、またはメンバーの名前のドキュメントを指し示します。このタグは、\fI@return\fR、\fI@param\fRおよび\fI@deprecated\fRタグなどの任意のタグのテキスト部分を含む、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。JavadocツールでのDocコメントの記述方法の@linkに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#{@link)を参照してください。 .sp -Υ\fI@see\fR˻ƤޤɤΥ⡢\fIpackage\&.class#member\fR\fIlabel\fRλˡȡͭʹʸƱǤʰ㤤ϡ\fI{@link}\fRǤϡִϢܡץ˥󥯤֤뤫ˡ饤󡦥󥯤ȤǤ饤󡦥ƥȤ¾ʬȶ̤뤿ˡ\fI{@link}\fRκǽȺǸ楫å򵭽Ҥޤ٥DZ楫å(\fI}\fR)Ѥɬפ硢HTMLƥƥˡ\fI}\fRѤޤ +このタグは\fI@see\fRタグに似ています。どちらのタグも、\fIpackage\&.class#member\fRと\fIlabel\fRの参照方法と、有効な構文が同じです。主な違いは、\fI{@link}\fRタグでは、「関連項目」セクションにリンクが配置されるかわりに、インライン・リンクが生成されるという点です。インライン・テキストの他の部分と区別するために、\fI{@link}\fRタグの最初と最後に中カッコを記述します。ラベル内で右中カッコ(\fI}\fR)を使用する必要がある場合、HTMLエンティティ記法\fI}\fRを使用します。 .sp -1ʸǻѤǤ\fI{@link}\fRο¤Ϥޤ󡣤Υϡɥơ󡦥Ȥμʬޤ\fI@deprecated\fR\fI@return\fR\fI@param\fRʤɤǤդΥΥƥʬǻѤǤޤ +1つ文の中で使用できる\fI{@link}\fRタグの数に制限はありません。このタグは、ドキュメンテーション・コメントの主説明部分、または\fI@deprecated\fR、\fI@return\fR、\fI@param\fRタグなどの任意のタグのテキスト部分で使用できます。 .sp -ȤСΥȤǤ\fIgetComponentAt(int,int)\fR᥽åɤ򻲾ȤƤޤ +たとえば、次のコメントでは\fIgetComponentAt(int,int)\fRメソッドを参照しています。 .sp .if n \{\ .RS 4 @@ -1504,7 +1504,7 @@ Use the {@link #getComponentAt(int, int) getComponentAt} method\&. .if n \{\ .RE .\} -ɸɥååȤǤϡΥɤ鼡HTMLޤ(ΥȤƱѥå̤Υ饹򻲾ȤƤ) +標準ドックレットでは、このコードから次のHTMLが生成されます(このコメントが同じパッケージの別のクラスを参照している場合)。 .sp .if n \{\ .RS 4 @@ -1515,7 +1515,7 @@ Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> m .if n \{\ .RE .\} -ιԤϡΤ褦Webڡɽޤ +前の行は、次のようにWebページに表示されます。 .sp .if n \{\ .RS 4 @@ -1530,28 +1530,28 @@ Use the getComponentAt method\&. .PP {@linkplain \fIpackage\&.class#member label\fR} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -\fI{@link}\fRƱư򤷤ޤ󥯡٥뤬ɡեȤǤϤʤץ졼󡦥ƥȤɽۤʤޤ٥뤬ץ졼󡦥ƥȤǵҤƤǤȤС\fIRefer to {@linkplain add() the overridden method}\fR\&.פϡRefer to the overridden methodפɽޤ +\fI{@link}\fRタグと同じ動作をしますが、リンク・ラベルがコード・フォントではなくプレーン・テキストで表示される点が異なります。ラベルがプレーン・テキストで記述されていると便利です。たとえば、「\fIRefer to {@linkplain add() the overridden method}\fR\&.」は「Refer to the overridden method」と表示されます。 .RE .PP {@literal \fItext\fR} .RS 4 -JDK 1\&.5Ƴ +JDK 1\&.5で導入 .sp -ƥȤHTMLޡåפޤϥͥȤ줿JavadocȤƲ᤻ˡtextɽޤˤꡢɥơ󡦥ȤǤϡѥ᡼η(\fI<Object>\fR)(\fI3 < 4\fR)(<\-)ʤɤǡå(\fI<>\fR)HTMLƥƥ(\fI<\fR\fI>\fR)Τ˻ѤǤޤȤСɥơ󡦥ȤΥƥ\fI{@literal A<B>C}\fR\fIA<B>C\fRȤơ֥饦줿HTMLڡѹ줺ɽޤ\fI<B>\fRȤƲᤵޤ(ɡեȤˤʤޤ)ɡեȤƱǽ¸ˤϡ\fI{@code}\fRѤޤ +テキストをHTMLマークアップまたはネストされたJavadocタグとして解釈せずに、textを表示します。これにより、ドキュメンテーション・コメントでは、パラメータの型(\fI<Object>\fR)、不等号(\fI3 < 4\fR)、矢印(<\-)などで、山カッコ(\fI<および>\fR)をHTMLエンティティ(\fI<\fRおよび\fI>\fR)のかわりに使用できます。たとえば、ドキュメンテーション・コメントのテキスト\fI{@literal A<B>C}\fRは\fIA<B>C\fRとして、ブラウザの生成されたHTMLページに変更されずに表示されます。\fI<B>\fRは太字として解釈されません(コード・フォントになりません)。コード・フォントで同じ機能を実現するには、\fI{@code}\fRタグを使用します。 .RE .PP @param \fIparameter\-name description\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -֥ѥ᡼ץˡꤵ줿\fIparameter\-name\fRθ˻ꤵ줿description³ƥѥ᡼ɲäޤɥơ󡦥Ȥ򵭽ҤȤˤϡdescriptionʣԤˤ錄äƵҤ뤳ȤǤޤΥϡ᥽åɡ󥹥ȥ饯ޤϥ饹Υɥơ󡦥ǤΤͭǤJavadocġǤDocȤεˡ@param˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@param)򻲾ȤƤ +「パラメータ」セクションに、指定された\fIparameter\-name\fRの後に指定されたdescriptionを続けてパラメータを追加します。ドキュメンテーション・コメントを記述するときには、descriptionを複数行にわたって記述することもできます。このタグは、メソッド、コンストラクタ、またはクラスのドキュメンテーション・コメント内でのみ有効です。JavadocツールでのDocコメントの記述方法の@paramに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@param)を参照してください。 .sp -\fIparameter\-name\fRϡ᥽åɤޤϥ󥹥ȥ饯ǤΥѥ᡼̾饹᥽åɤޤϥ󥹥ȥ饯ηѥ᡼̾ˤʤޤåǤΥѥ᡼̾Ϥߡѥ᡼Ѥ뤳Ȥꤷޤ +\fIparameter\-name\fRは、メソッドまたはコンストラクタでのパラメータの名前か、クラス、メソッドまたはコンストラクタの型パラメータの名前になります。山カッコでこのパラメータ名を囲み、型パラメータを使用することを指定します。 .sp -饹ηѥ᡼: +クラスの型パラメータの例: .sp .if n \{\ .RS 4 @@ -1566,7 +1566,7 @@ public interface List<E> extends Collection<E> { .if n \{\ .RE .\} -᥽åɤηѥ᡼: +メソッドの型パラメータの例: .sp .if n \{\ .RS 4 @@ -1588,35 +1588,35 @@ public interface List<E> extends Collection<E> { .PP @return \fIdescription\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -͡ץɲäơdescriptionΥƥȤ񤭹ߤޤΥƥȤǤϡͤηȡͤϰϤˤĤƵҤɬפޤΥϡ᥽åɤΥɥơ󡦥ȤǤΤͭǤJavadocġǤDocȤεˡ@return˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@return)򻲾ȤƤ +「戻り値」セクションを追加して、descriptionのテキストを書き込みます。このテキストでは、戻り値の型と、取り得る値の範囲について記述する必要があります。このタグは、メソッドのドキュメンテーション・コメントでのみ有効です。JavadocツールでのDocコメントの記述方法の@returnに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@return)を参照してください。 .RE .PP @see \fIreference\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fIִϢܡ\fRФɲäơreferenceؤ󥯡ޤϥƥȡȥ񤭹ߤޤ1ĤΥɥơ󡦥ȤˤǤդο\fI@see\fRޤ뤳ȤǤޤϤ٤ƱФβ˥롼ײޤ\fI@see\fRˤϡ3ĤΥפηޤηǤŪǤΥϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤͭǤѥå饹ޤϥСФ륤饤󡦥󥯤ʸˡϡ\fI{@link}\fR򻲾ȤƤ +\fI「関連項目」\fR見出しを追加して、referenceを指すリンク、またはテキスト・エントリを書き込みます。1つのドキュメンテーション・コメントには任意の数の\fI@see\fRタグを含めることができますが、それらはすべて同じ見出しの下にグループ化されます。\fI@see\fRタグには、3つのタイプの形式があります。この形式が最も一般的です。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドで有効です。パッケージ、クラス、またはメンバーに対するインライン・リンクを文中に挿入する方法は、\fI{@link}\fRを参照してください。 .sp -\fB1\fR@see -\fIstring\fRϡ\fIstring\fRΥƥȡȥɲäޤ󥯤ޤstringϡҤޤURLǤϥǤʤλǤ\fIjavadoc\fRޥɤϡǽʸȤŰ(")򸡺ơηҤηȶ̤ޤȤС\fI@see "The Java Programming Language"\fRϼΥƥȤޤ +\fB形式1\fR。@see +\fIstring\fRタグ形式は、\fIstring\fRのテキスト・エントリを追加します。リンクは生成されません。stringは、書籍またはURLではアクセスできない情報の参照先です。\fIjavadoc\fRコマンドは、最初の文字として二重引用符(")を検索して、この形式を前述の形式と区別します。たとえば、\fI@see "The Java Programming Language"\fRは次のテキストを生成します。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp "The Java Programming Language" .sp -\fB2\fR\fI@see <a href="URL#value">label</a>\fRϡ\fIURL#value\fRˤ줿󥯤ɲäޤ\fIURL#value\fRѥ᡼ϡURLޤURLǤ\fIjavadoc\fRޥɤϡǽʸȤơ֤꾮׵(\fI<\fR)򸡺ơη¾ηȶ̤ޤȤС\fI@see <a href="spec\&.html#section">Java Spec</a>\fRϼΥ󥯤ޤ +\fB形式2\fR。\fI@see <a href="URL#value">label</a>\fR形式は、\fIURL#value\fRにより定義されたリンクを追加します。\fIURL#value\fRパラメータは、相対URLまたは絶対URLです。\fIjavadoc\fRコマンドは、最初の文字として「より小さい」記号(\fI<\fR)を検索して、この形式を他の形式と区別します。たとえば、\fI@see <a href="spec\&.html#section">Java Spec</a>\fRは次のリンクを生成します。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp Java Spec .sp -\fB3\fR\fI@see package\&.class#member label\fRϡɽƥȡ٥ȤȤ˥󥯤ɲäޤΥ٥ϻȤƤJavaλꤵ줿̾ΥɥȤؤޤ٥ϥץǤ٥άϡɽƥȤΤˡ̾Ŭڤṳ̂ɽޤ\fI\-noqualifier\fRץѤȡɽƥȤѥå̾Ū˺ޤ٥ϡưɽƥȤȤϰۤʤɽƥȤˤ˻Ѥޤ̾ɽˡפ򻲾ȤƤ +\fB形式3\fR。\fI@see package\&.class#member label\fR形式は、表示テキスト・ラベルとともにリンクを追加します。このラベルは参照されているJava言語の指定された名前のドキュメントを指し示します。ラベルはオプションです。ラベルを省略した場合は、表示テキストのかわりに、名前が適切に短縮されて表示されます。\fI\-noqualifier\fRオプションを使用すると、この表示テキストからパッケージ名が全体的に削除されます。ラベルは、自動生成される表示テキストとは異なる表示テキストにする場合に使用します。「名前が表示される方法」を参照してください。 .sp -Java SE 1\&.2ϡ٥ǤϤʤ̾\fI<code>\fR -HTML˼ưŪɽޤJava SE 1\&.2\&.2ϡ٥Ѥ뤫ʤˤ餺\fI<code>\fRϾɽƥȤϤफǴޤޤޤ +Java SE 1\&.2だけは、ラベルではなく名前が\fI<code>\fR +HTMLタグ内に自動的に表示されます。Java SE 1\&.2\&.2からは、ラベルを使用するかしないかにかかわらず、\fI<code>\fRタグは常に表示テキストを囲むかたちで含まれます。 .sp .RS 4 .ie n \{\ @@ -1626,10 +1626,10 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fIpackage\&.class#member\fRˤϡȤƤǤդͭʥץǤ̾ꤷޤĤޤꡢѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤ̾ǤС̾ʸϡ㡼׵(\fI#\fR)ˤɬפޤclassϡǤդΥȥåץ٥ޤϥͥȤ줿饹󥿥եɽޤmemberϡǤդΥ󥹥ȥ饯᥽åɤޤϥեɤɽޤ(ͥȤ줿饹ޤϥ󥿥եǤϤޤ)̾ɥȲ륯饹˴ޤޤƤ硢\fIjavadoc\fRޥɤϡ̾ؤΥ󥯤ޤȥ饹ؤΥ󥯤ˤϡ\fI\-link\fRץѤޤȥ饹°Ƥʤ̾ΥɥȤ򻲾Ȥˤϡ¾2Ĥ\fI@see\fRΤɤ餫Ѥޤ̾λפ򻲾ȤƤ +\fIpackage\&.class#member\fRには、参照されている任意の有効なプログラム要素の名前を指定します。つまり、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドの名前です。ただし、メンバー名の前の文字は、シャープ記号(\fI#\fR)にする必要があります。classは、任意のトップレベルまたはネストされたクラスか、インタフェースを表します。memberは、任意のコンストラクタ、メソッドまたはフィールドを表します(ネストされたクラスまたはインタフェースではありません)。この名前が、ドキュメント化されるクラスに含まれている場合、\fIjavadoc\fRコマンドは、その名前へのリンクを作成します。外部参照クラスへのリンクを作成するには、\fI\-link\fRオプションを使用します。参照クラスに属していない名前のドキュメントを参照するには、他の2つの\fI@see\fRタグ形式のどちらかを使用します。「名前の指定」を参照してください。 .sp -\fB:\fR -ȥ饹ϡޥɥ饤\fIjavadoc\fRޥɤϤʤ饹Ǥɥdzȥ饹˥󥯤ƤսϡȤޤϳ󥯤ȸƤФޤȤС\fIjava\&.awt package\fRФƤΤ\fIjavadoc\fRޥɤ¹Ԥ硢\fIObject\fRʤɤ\fIjava\&.lang\fRΤ٤ƤΥ饹ȥ饹ˤʤޤ\fI\-link\fR\fI\-linkoffline\fRץѤơȥ饹إ󥯤ޤȥ饹ΥȤ\fIjavadoc\fRޥɤμ¹ԤˤϻѤǤޤ +\fB注意:\fR +外部参照クラスは、コマンドラインで\fIjavadoc\fRコマンドに渡されないクラスです。生成ドキュメント内で外部参照クラスにリンクしている箇所は、外部参照または外部リンクと呼ばれます。たとえば、\fIjava\&.awt package\fRに対してのみ\fIjavadoc\fRコマンドを実行した場合、\fIObject\fRなどの\fIjava\&.lang\fR内のすべてのクラスが外部参照クラスになります。\fI\-link\fRおよび\fI\-linkoffline\fRオプションを使用して、外部参照クラスへリンクします。外部参照クラスのソース・コメントは\fIjavadoc\fRコマンドの実行には使用できません。 .RE .sp .RS 4 @@ -1640,7 +1640,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fIlabel\fRϡάǽʥƥȤǡ󥯤Υ٥Ȥɽޤ٥ˤ϶ޤ뤳ȤǤޤ\fIlabel\fRάȡ\fIpackage\&.class\&.member\fRߤΥ饹ӥѥå˱Ŭڤṳ̂ɽޤ̾ɽˡפ򻲾ȤƤ +\fIlabel\fRは、省略可能なテキストで、リンクのラベルとして表示されます。ラベルには空白を含めることができます。\fIlabel\fRを省略すると、\fIpackage\&.class\&.member\fRが、現在のクラスおよびパッケージに応じて適切に短縮されて表示されます。「名前が表示される方法」を参照してください。 .RE .sp .RS 4 @@ -1651,10 +1651,10 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ʸ\fIpackage\&.class#member\fR\fIlabel\fRδ֤ζڤʸˤʤޤå¦ζʸϥ٥ƬȤϲᤵʤᡢ᥽åɤΥѥ᡼֤˶ʸƤ⤫ޤޤ +空白文字が、\fIpackage\&.class#member\fRと\fIlabel\fRの間の区切り文字になります。カッコの内側の空白文字はラベルの先頭とは解釈されないため、メソッドのパラメータ間に空白文字を入れてもかまいません。 .RE .sp -Ǥϡ\fI@see\fR(\fICharacter\fR饹)\fIString\fR饹equals᥽åɤ򻲾ȤƤޤˤϡ̾\fIString#equals(Object)\fRȥ٥\fIequals\fRξΰޤޤƤޤ +この例では、\fI@see\fRタグ(\fICharacter\fRクラス内)が、\fIString\fRクラスのequalsメソッドを参照しています。タグには、名前\fIString#equals(Object)\fRとラベル\fIequals\fRの両方の引数が含まれています。 .sp .if n \{\ .RS 4 @@ -1667,7 +1667,7 @@ HTML .if n \{\ .RE .\} -ɸɥååȤϡΤ褦HTMLޤ +標準ドックレットは、次のようなHTMLを生成します。 .sp .if n \{\ .RS 4 @@ -1681,14 +1681,14 @@ HTML .if n \{\ .RE .\} -ҤΥɤϡ֥饦˼Τ褦ɽ졢٥ɽ󥯡ƥȤˤʤäƤޤ +前述のコードは、ブラウザに次のように表示され、ラベルは表示リンク・テキストになっています。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp equals .RE -̾λ.PP -\fIpackage\&.class#member\fRȤ̾ϡ\fIjava\&.lang\&.String#toUpperCase()\fRΤ褦ʴ̾ˤ뤳Ȥ⡢\fIString#toUpperCase()\fR\fI#toUpperCase()\fRΤ褦̾ˤ뤳ȤǤޤ̾ûϡ\fIjavadoc\fRޥɤϡɸJavaѥθѤõޤ@seeθפ򻲾ȤƤ̾ϡ᥽åɰδ֤ʤɡåΥڡޤ뤳ȤǤޤʬŪ˽û̾ꤹ뤳ȤϡϤʸ뤳Ȥ䡢ɤɤߤ䤹ʤ뤳ȤǤΥꥹȤ͡ʷ̾򼨤ޤǡ\fIClass\fRˤϥ饹ޤϥ󥿥եTypeˤϥ饹󥿥ե󡢤ޤϥץߥƥ֤methodˤϥ᥽åɤޤϥ󥹥ȥ饯򡢤줾Ǥޤ +名前の指定.PP +この\fIpackage\&.class#member\fRという名前は、\fIjava\&.lang\&.String#toUpperCase()\fRのような完全修飾名にすることも、\fIString#toUpperCase()\fRや\fI#toUpperCase()\fRのような非完全修飾名にすることもできます。名前が完全修飾より短い場合は、\fIjavadoc\fRコマンドは、標準のJavaコンパイラの検索順序を使用して探します。「@seeタグの検索順序」を参照してください。名前は、メソッド引数の間など、カッコ内のスペースを含めることができます。部分的に修飾した短い名前を指定することの利点は、入力する文字数が減ることや、ソース・コードが読みやすくなることです。次のリストに様々な形式の名前を示します。ここで、\fIClass\fRにはクラスまたはインタフェースを、Typeにはクラス、インタフェース、配列、またはプリミティブを、methodにはメソッドまたはコンストラクタを、それぞれ指定できます。 .sp .if n \{\ .RS 4 @@ -1725,7 +1725,7 @@ equals .RE .\} .PP -ΥꥹȤ˴ؤ: +前のリストに関するメモ: .sp .RS 4 .ie n \{\ @@ -1735,7 +1735,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -ǽΥפη(ѥåȥ饹ά)ξ硢\fIjavadoc\fRޥɤϡߤΥ饹γؤΤߤ򸡺ޤĤޤꡢߤΥ饹󥿥եΥѡ饹ѡ󥿥եޤϤγ¦ϤǤ륯饹󥿥եС򸡺ޤ(1\(en3)ߤΥѥå¾ʬ䡢¾Υѥåϸޤ(4\(en5)@seeθפ򻲾ȤƤ +最初のタイプの形式(パッケージとクラスを省略)の場合、\fIjavadoc\fRコマンドは、現在のクラスの階層のみを検索します。つまり、現在のクラスかインタフェース、そのスーパークラスかスーパーインタフェース、またはその外側を囲んでいるクラスかインタフェースからメンバーを検索します(検索項目1\(en3)。現在のパッケージの他の部分や、他のパッケージは検索しません(検索項目4\(en5)。「@seeタグの検索順序」を参照してください。 .RE .sp .RS 4 @@ -1746,7 +1746,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -᥽åɤޤϥ󥹥ȥ饯ϻˡ\fIgetValue\fRΤ褦˥åʤ̾Ѥ硢Ʊ̾Υեɤ¸ߤƤʤС\fIjavadoc\fRޥɤϤΥ᥽åɤؤΥ󥯤ޤΥ᥽åɤСɤƤ硢\fIjavadoc\fRޥɤϡǺǽ˸Ĥä᥽åɤ˥󥯤ޤ̤äǤޤ +メソッドまたはコンストラクタの入力時に、\fIgetValue\fRのようにカッコなしの名前を使用した場合、同じ名前のフィールドが存在していなければ、\fIjavadoc\fRコマンドはそのメソッドへのリンクを作成します。このメソッドがオーバーロードされている場合、\fIjavadoc\fRコマンドは、検索で最初に見つかったメソッドにリンクします。結果は前もって特定できません。 .RE .sp .RS 4 @@ -1757,7 +1757,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -ͥȤ줿饹ϡ٤ƤηˤĤơ\fIouter\&.inner\fRȤƻꤹɬפޤñ\fIinner\fRȤϤʤǤ +ネストされたクラスは、すべての形式について、\fIouter\&.inner\fRとして指定する必要があります。単純に\fIinner\fRとはしないでください。 .RE .sp .RS 4 @@ -1768,12 +1768,12 @@ equals .sp -1 .IP \(bu 2.3 .\} -Ǥ˽Ҥ٤褦ˡ饹ȥСȤδ֤ζڤʸȤƤϡɥå(\fI\&.\fR)ǤϤʤ㡼׵(\fI#\fR)ѤޤΤ褦˻ꤹȡ\fIjavadoc\fRޥɤϡޤǤޤɥåȤϡ饹ͥȤ줿饹ѥåӥ֥ѥåڤ뤿ˤѤ뤫Ǥ\fIjavadoc\fRޥɤǤϡޤʤХɥåȤϤޤٹɽޤ +すでに述べたように、クラスとメンバーとの間の区切り文字としては、ドット(\fI\&.\fR)ではなくシャープ記号(\fI#\fR)を使用します。このように指定すると、\fIjavadoc\fRコマンドは、あいまいさを解決できます。ドットは、クラス、ネストされたクラス、パッケージ、およびサブパッケージを区切るためにも使用されるからです。ただし、\fIjavadoc\fRコマンドでは、あいまいさがなければドットは正しく解析されますが、警告は表示されます。 .RE -@seeθ.PP -\fIjavadoc\fRޥɤϡե롢ѥåե롢ץեɽ\fI@see\fRޤԤ2ĤΥեǤϡ̾\fI@see\fR˻ꤹɬפޤեǤϡ̾ޤʬ̾Ǥޤ +@seeタグの検索順序.PP +\fIjavadoc\fRコマンドは、ソース・ファイル、パッケージ・ファイル、概要ファイルに表示される\fI@see\fRタグを処理します。後者の2つのファイルでは、完全修飾の名前を\fI@see\fRタグに指定する必要があります。ソース・ファイルでは、完全修飾の名前、または部分修飾の名前を指定できます。 .PP -ˡ\fI@see\fRθ򼨤ޤ +次に、\fI@see\fRタグの検索順序を示します。 .sp .RS 4 .ie n \{\ @@ -1783,7 +1783,7 @@ equals .sp -1 .IP " 1." 4.2 .\} -ߤΥ饹ޤϥ󥿥ե +現在のクラスまたはインタフェース。 .RE .sp .RS 4 @@ -1794,7 +1794,7 @@ equals .sp -1 .IP " 2." 4.2 .\} -¦ϤǤ륯饹ȥ󥿥ե(ǤᤤΤ鸡) +外側を囲んでいるクラスとインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1805,7 +1805,7 @@ equals .sp -1 .IP " 3." 4.2 .\} -ѡ饹ȥѡ󥿥ե(ǤᤤΤ鸡) +スーパークラスとスーパーインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1816,7 +1816,7 @@ equals .sp -1 .IP " 4." 4.2 .\} -ߤΥѥå +現在のパッケージ。 .RE .sp .RS 4 @@ -1827,12 +1827,12 @@ equals .sp -1 .IP " 5." 4.2 .\} -ݡȤƤѥå饹ӥ󥿥ե(\fIimport\fRʸν˽äƸ) +インポートされているパッケージ、クラス、およびインタフェース(\fIimport\fR文の順序に従って検索)。 .RE .PP -\fIjavadoc\fRޥɤϡƥ饹ˤĤƹ1\-3ƵŪŬѤʤ顢פ̾ĤޤǸ³ޤĤޤꡢޤߤΥ饹򸡺ˤγ¦ϤǤ륯饹E򸡺塢EΥѡ饹򸡺Ƥ顢EϤǤ륯饹򸡺ޤ45Ǥϡ\fIjavadoc\fRޥɤ1ĤΥѥåΥ饹ޤϥ󥿥ե򸡺ϷޤäƤޤ(νϡġΥѥˤäưۤʤޤ)5Ǥϡ\fIjavadoc\fRޥɤϡ\fIjava\&.lang\fR򸡺ޤΥѥåϡ٤ƤΥץ˼ưŪ˥ݡȤ뤫Ǥ +\fIjavadoc\fRコマンドは、各クラスについて項目1\-3を再帰的に適用しながら、一致する名前が見つかるまで検索を続けます。つまり、まず現在のクラスを検索し、次にその外側を囲んでいるクラスEを検索した後、Eのスーパークラスを検索してから、Eを囲んでいるクラスを検索します。項目4と5では、\fIjavadoc\fRコマンドが1つのパッケージ内のクラスまたはインタフェースを検索する順序は決まっていません(その順序は、個々のコンパイラによって異なります)。項目5では、\fIjavadoc\fRコマンドは、\fIjava\&.lang\fRを検索します。このパッケージは、すべてのプログラムに自動的にインポートされるからです。 .PP -\fIjavadoc\fRޥɤϡǤʤե\fI@see\fR򸫤ĤȡJavaѥƱǻꤵ줿̾򸡺ޤ(\fIjavadoc\fRޥɤϡ֤̾Τޤ򸡽Фޤ󡣤ϡɤˤΥ顼¸ߤƤʤȤȤƤ뤿Ǥ)θϡJavaͤƤޤ\fIjavadoc\fRޥɤϡϢ륯饹ȥѥåӥݡȤ줿饹ȥѥåΤ٤Ƥ餽̾򸡺ޤŪˤϡνǸޤ +\fIjavadoc\fRコマンドは、完全修飾でないソース・ファイルで\fI@see\fRタグを見つけると、Javaコンパイラと同じ順序で指定された名前を検索します(ただし、\fIjavadoc\fRコマンドは、特定の名前空間のあいまいさを検出しません。これは、ソース・コードにこれらのエラーが存在していないことを前提としているためです)。この検索順序は、Java言語仕様で正式に定義されています。\fIjavadoc\fRコマンドは、関連するクラスとパッケージ、およびインポートされたクラスとパッケージのすべてからその名前を検索します。具体的には、次の順序で検索します。 .sp .RS 4 .ie n \{\ @@ -1842,7 +1842,7 @@ equals .sp -1 .IP " 1." 4.2 .\} -ߤΥ饹ޤϥ󥿥ե +現在のクラスまたはインタフェース。 .RE .sp .RS 4 @@ -1853,7 +1853,7 @@ equals .sp -1 .IP " 2." 4.2 .\} -¦ϤǤ륯饹ȥ󥿥ե(ǤᤤΤ鸡) +外側を囲んでいるクラスとインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1864,7 +1864,7 @@ equals .sp -1 .IP " 3." 4.2 .\} -ѡ饹ȥѡ󥿥ե(ǤᤤΤ鸡) +スーパークラスとスーパーインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1875,7 +1875,7 @@ equals .sp -1 .IP " 4." 4.2 .\} -ߤΥѥå +現在のパッケージ。 .RE .sp .RS 4 @@ -1886,48 +1886,48 @@ equals .sp -1 .IP " 5." 4.2 .\} -ݡȤƤѥå饹ӥ󥿥ե(\fIimport\fRʸν˽äƸ) +インポートされているパッケージ、クラス、およびインタフェース(\fIimport\fR文の順序に従って検索)。 .RE .PP -\fIjavadoc\fRޥɤϡɬ⥵֥饹򸡺Ȥϸ¤ޤ󡣤ޤ¹¾ΥѥåΥɥȤǤ⡢¾Υѥå򸡺ޤ󡣤ȤС\fI@see\fR\fIjava\&.awt\&.event\&.KeyEvent\fR饹˴ޤޤƤơ\fIjava\&.awt package\fRΤ̾򻲾ȤƤƤ⡢Υ饹ݡȤʤ\fIjavadoc\fRޥɤϤΥѥå򸡺ޤ -̾ɽˡ.PP -\fIlabel\fRάȡ\fIpackage\&.class\&.member\fRɽޤ̤ˡϸߤΥ饹ӥѥå˱Ŭڤṳ̂ޤṳ̂Ȥϡ\fIjavadoc\fRޥɤˤɬ׺Ǿ¤̾ΤߤɽȤȤǤȤС\fIString\&.toUpperCase()\fR᥽åɤˡƱ饹ΥСؤλȤ¾Υ饹ΥСؤλȤޤޤƤ硢饹̾ɽΤϸԤΥΤߤǤ(ΥꥹȤ򻲾)ѥå̾Ū˺ˤϡ\fI\-noqualifier\fRץѤޤ +\fIjavadoc\fRコマンドは、必ずしもサブクラスを検索するとは限りません。また、実行中に他のパッケージのドキュメントが生成される場合でも、他のパッケージを検索しません。たとえば、\fI@see\fRタグが\fIjava\&.awt\&.event\&.KeyEvent\fRクラス内に含まれていて、\fIjava\&.awt package\fR内のある名前を参照していても、そのクラスがインポートしないかぎり\fIjavadoc\fRコマンドはそのパッケージを検索しません。 +名前が表示される方法.PP +\fIlabel\fRを省略すると、\fIpackage\&.class\&.member\fRが表示されます。一般に、これは現在のクラスおよびパッケージに応じて適切に短縮されます。短縮されるとは、\fIjavadoc\fRコマンドにより必要最小限の名前のみが表示されるということです。たとえば、\fIString\&.toUpperCase()\fRメソッドに、同じクラスのメンバーへの参照と他のクラスのメンバーへの参照が含まれている場合、クラス名が表示されるのは後者のケースのみです(次のリストを参照)。パッケージ名を全体的に削除するには、\fI\-noqualifier\fRオプションを使用します。 .RS 4 -\fBȤΥ\fR: \fI@see\fRƱ饹ƱѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは同じクラス、同じパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see String#toLowerCase()\fR +\fB例\fR: \fI@see String#toLowerCase()\fR .RE .RS 4 -\fBɽ\fR: \fItoLowerCase()\fR \- ѥåӥ饹̾άޤ +\fB表示\fR: \fItoLowerCase()\fR \- パッケージおよびクラス名を省略します .RE .RS 4 .RE .RS 4 -\fBȤΥ\fR: \fI@see\fR̤Υ饹ƱѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは別のクラス、同じパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see Character#toLowerCase(char)\fR +\fB例\fR: \fI@see Character#toLowerCase(char)\fR .RE .RS 4 -\fBɽ\fR: \fICharacter\&.toLowerCase(char)\fR \- ѥå̾ά饹̾ޤߤޤ +\fB表示\fR: \fICharacter\&.toLowerCase(char)\fR \- パッケージ名を省略し、クラス名を含みます .RE .RS 4 .RE .RS 4 -\fBȤΥ\fR: \fI@see\fRϰۤʤ륯饹ۤʤѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは異なるクラス、異なるパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see java\&.io\&.File#exists()\fR +\fB例\fR: \fI@see java\&.io\&.File#exists()\fR .RE .RS 4 -\fBɽ\fR: \fIjava\&.io\&.File\&.exists()\fR \- ѥåӥ饹̾ޤߤޤ +\fB表示\fR: \fIjava\&.io\&.File\&.exists()\fR \- パッケージおよびクラス名を含みます .RE .RS 4 .RE -@see.PP -¦ΥȤϡ\fI@see\fR\fIjava\&.applet\&.Applet\fRʤɤ̤ΥѥåΥ饹ˤˡ̾ɤΤ褦ɽ뤫򼨤ƤޤJavadocġǤDocȤεˡ@see˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@see)򻲾ȤƤ +@seeタグの例.PP +右側のコメントは、\fI@see\fRタグが\fIjava\&.applet\&.Applet\fRなどの別のパッケージのクラス内にある場合に、名前がどのように表示されるかを示しています。JavadocツールでのDocコメントの記述方法の@seeに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@see)を参照してください。 .sp .if n \{\ .RS 4 @@ -1948,24 +1948,24 @@ equals .RE .\} .PP -\fB:\fR -\fI@se\fR\fIe\fRĥƥɥȲʤ饹˥󥯤ˤϡ\fI\-link\fRץѤޤ +\fB注意:\fR +\fI@se\fR\fIe\fRタグを拡張してドキュメント化されないクラスにリンクするには、\fI\-link\fRオプションを使用します。 .PP @serial \fIfield\-description\fR | include | exclude .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ǥեȤľ󲽲ǽեɤΥɥơ󡦥ȤǻѤޤ饹ľ󲽲ǽʥեɤӥǡʸ -(http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial\-arch\&.html#5251)򻲾ȤƤ +デフォルトの直列化可能フィールドのドキュメンテーション・コメントで使用します。クラスの直列化可能なフィールドおよびデータの文書化 +(http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial\-arch\&.html#5251)を参照してください .sp -Oracleľ󲽤줿λͤ˥饹ޤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized\-criteria\-137781\&.html)⻲ȤƤ +Oracleの直列化された形式の仕様にクラスを含める基準 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized\-criteria\-137781\&.html)も参照してください .sp -\fIfield\-description\fR(άǽ)Ǥϡեɤΰ̣ͤΥꥹȤ򼨤ɬפޤɬפʾϡʣιԤϤä򵭽ҤǤޤɸɥååȤϡξľ󲽤줿ڡɲäޤ߻ȥڡ򻲾ȤƤ +\fIfield\-description\fR(省略可能)では、フィールドの意味を説明し、取り得る値のリストを示す必要があります。必要な場合は、複数の行に渡って説明を記述できます。標準ドックレットは、この情報を、直列化された形式ページに追加します。相互参照ページを参照してください。 .sp -饹ľ󲽤ľ󲽲ǽեɤ򥯥饹ɲä硢ˡɲäС̤ʸɲäɬפޤ +クラスを直列化した後に直列化可能フィールドをクラスに追加した場合、主説明に、追加したバージョンを識別する文を追加する必要があります。 .sp -\fIinclude\fR\fIexclude\fRϡľ󲽤줿ڡ˥饹ޤϥѥåޤ뤫뤫򼨤ޤΤ褦˵ǽޤ +\fIinclude\fRおよび\fIexclude\fR引数は、直列化された形式ページにクラスまたはパッケージを含めるか除外するかを示します。次のように機能します。 .sp .RS 4 .ie n \{\ @@ -1975,7 +1975,7 @@ Oracle .sp -1 .IP \(bu 2.3 .\} -\fISerializable\fRƤpublicޤprotected饹ϡΥ饹(ޤϤΥ饹°ѥå)\fI@serial exclude\fRǥޡƤʤꡢޤޤ +\fISerializable\fRを実装しているpublicまたはprotectedクラスは、そのクラス(またはそのクラスが属するパッケージ)が\fI@serial exclude\fRタグでマークされていないかぎり、含められます。 .RE .sp .RS 4 @@ -1986,59 +1986,59 @@ Oracle .sp -1 .IP \(bu 2.3 .\} -\fISerializable\fRƤprivateޤpackage\-private饹ϡΥ饹(ޤϤΥ饹°ѥå)\fI@serial include\fRǥޡƤʤꡢޤ +\fISerializable\fRを実装しているprivateまたはpackage\-privateクラスは、そのクラス(またはそのクラスが属するパッケージ)が\fI@serial include\fRタグでマークされていないかぎり、除外されます。 .RE .sp -ȤС\fIjavax\&.swing\fRѥåpackage\&.htmlޤpackage\-info\&.java\fI@serial\fR -\fIexclude\fRǥޡƤޤpublic饹\fIjava\&.security\&.BasicPermission\fR\fI@serial exclude\fRǥޡƤޤpackage\-private饹\fIjava\&.util\&.PropertyPermissionCollection\fR\fI@serial include\fRǥޡƤޤ +たとえば、\fIjavax\&.swing\fRパッケージはpackage\&.htmlまたはpackage\-info\&.java内で\fI@serial\fR +\fIexclude\fRタグでマークされています。publicクラス\fIjava\&.security\&.BasicPermission\fRは\fI@serial exclude\fRタグでマークされています。package\-privateクラス\fIjava\&.util\&.PropertyPermissionCollection\fRは\fI@serial include\fRタグでマークされています。 .sp -饹٥\fI@serial\fRϥѥå٥\fI@serial\fR򥪡С饤ɤޤ +クラス・レベルの\fI@serial\fRタグはパッケージ・レベルの\fI@serial\fRタグをオーバーライドします。 .RE .PP @serialData \fIdata\-description\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ǡͤѤơľ󲽤줿ǤΥǡηȽɥȲޤΥǡˤϡ\fIwriteObject\fR᥽åɤˤäƽ񤭹ޤάǽʥǡ\fIExternalizable\&.writeExternal\fR᥽åɤˤäƽ񤭹ޤ뤹٤ƤΥǡ(١饹ޤ)ޤޤޤ +データの説明値を使用して、直列化された形式でのデータの型と順序をドキュメント化します。このデータには、\fIwriteObject\fRメソッドによって書き込まれる省略可能なデータ、および\fIExternalizable\&.writeExternal\fRメソッドによって書き込まれるすべてのデータ(ベース・クラスを含む)が含まれます。 .sp -\fI@serialData\fRϡ\fIwriteObject\fR\fIreadObject\fR\fIwriteExternal\fR\fIreadExternal\fR\fIwriteReplace\fR\fIreadResolve\fR᥽åɤΥɥơ󡦥ȤǻѤǤޤ +\fI@serialData\fRタグは、\fIwriteObject\fR、\fIreadObject\fR、\fIwriteExternal\fR、\fIreadExternal\fR、\fIwriteReplace\fRおよび\fIreadResolve\fRメソッドのドキュメンテーション・コメントで使用できます。 .RE .PP @serialField \fIfield\-name\fR \fIfield\-type\fR \fIfield\-description\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -\fISerializable\fR饹\fIserialPersistentFields\fRС\fIObjectStreamField\fRݡͥȤɥȲޤ\fIObjectStreamField\fRݡͥȤȤ1Ĥ\fI@serialField\fRѤޤ +\fISerializable\fRクラスの\fIserialPersistentFields\fRメンバーの\fIObjectStreamField\fRコンポーネントをドキュメント化します。\fIObjectStreamField\fRコンポーネントごとに1つの\fI@serialField\fRタグを使用します。 .RE .PP @since \fIsince\-text\fR .RS 4 -JDK 1\&.1Ƴ +JDK 1\&.1で導入 .sp -ɥȤˡꤵ줿\fIsince\-text\fRͤ\fIƳ줿С\fRФɲäޤΥƥȤˤϡ̤¤Ϥޤ󡣤Υϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤͭǤΥϡѹޤϵǽ\fIsince\-text\fRͤˤäƻꤵ줿եȥ꡼ʹߡ¸ߤƤ뤳Ȥ̣ޤȤС\fI@since 1\&.5\fRǤ +生成ドキュメントに、指定された\fIsince\-text\fRの値の\fI「導入されたバージョン」\fR見出しを追加します。このテキストには、特別な内部構造はありません。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドで有効です。このタグは、特定の変更または機能が、\fIsince\-text\fRの値によって指定されたソフトウェア・リリース以降、存在していることを意味します。たとえば、\fI@since 1\&.5\fRです。 .sp -JavaץåȥեΥɤξ硢\fI@since\fRϡJavaץåȥեAPIͤΥС򼨤ޤɤե󥹼ɲä줿򼨤Ȥϸ¤ޤʣ\fI@since\fRѤǤʣ\fI@author\fRΤ褦˰ޤץǤʣAPIǻѤ硢ʣΥѤǤޤ +Javaプラットフォームのソース・コードの場合、\fI@since\fRタグは、JavaプラットフォームAPI仕様のバージョンを示します。ソース・コードがリファレンス実装に追加された時期を示すとは限りません。複数の\fI@since\fRタグを使用でき、複数の\fI@author\fRタグのように扱われます。プログラム要素が複数のAPIで使用される場合、複数のタグを使用できます。 .RE .PP @throws \fIclass\-name\fR \fIdescription\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -\fI@exception\fRƱư򤷤ޤJavadocġǤDocȤεˡ@throws˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@exception)򻲾ȤƤ +\fI@exception\fRタグと同じ動作をします。JavadocツールでのDocコメントの記述方法の@throwsに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@exception)を参照してください .sp -\fI@throws\fRϡɥȤ\fIThrows\fRФɲäơ\fIclass\-name\fR\fIdescription\fRƥȤ񤭹ߤޤ\fIclass\-name\fRϡΥ᥽åɤ饹ǽΤ㳰̾ǤΥϡ᥽åɡ󥹥ȥ饯Υɥơ󡦥ǤΤͭǤΥ饹̾ǵҤƤʤ硢\fIjavadoc\fRޥɤϡ˽äƥ饹õޤʣ\fI@throws\fRƱ㳰ޤϰ㤦㳰λꤷɥơ󡦥ȤǻѤǤޤ@seeθפ򻲾ȤƤ +\fI@throws\fRタグは、生成ドキュメントに\fIThrows\fR小見出しを追加して、\fIclass\-name\fRおよび\fIdescription\fRテキストを書き込みます。\fIclass\-name\fRは、そのメソッドからスローされる可能性のある例外の名前です。このタグは、メソッド、コンストラクタのドキュメンテーション・コメント内でのみ有効です。このクラスが完全指定の名前で記述されていない場合、\fIjavadoc\fRコマンドは、検索順序に従ってクラスを探します。複数の\fI@throws\fRタグを、同じ例外または違う例外の指定したドキュメンテーション・コメントで使用できます。「@seeタグの検索順序」を参照してください。 .sp -٤ƤΥå㳰ɥȲ褦ˤ뤿ˡ\fI@throws\fRthrows㳰Ѥ¸ߤʤϡ\fI@throws\fRǥɥȲ줿Τ褦ˡ\fIjavadoc\fRޥɤˤä㳰HTMLϤʤɲäޤ +すべてのチェック済例外がドキュメント化されるようにするために、\fI@throws\fRタグがthrows節内の例外用に存在しない場合は、\fI@throws\fRタグでドキュメント化されたかのように、\fIjavadoc\fRコマンドによって例外がHTML出力に説明なしで追加されます。 .sp -С饤ɤ᥽å㳰ŪƤΤߡ\fI@throws\fRΥɥȤΥ᥽åɤ饵֥饹˥ԡޤ󥿥ե᥽åɤ᥽åɤ˥ԡƱͤǤ\fI{@inheritDoc}\fRѤơ\fI@throws\fRɥơѾ褦˶Ǥޤ +オーバーライドされるメソッド内で例外が明示的に宣言されている場合のみ、\fI@throws\fRのドキュメントがそのメソッドからサブクラスにコピーされます。インタフェース・メソッドから実装メソッドにコピーされる場合も同様です。\fI{@inheritDoc}\fRタグを使用して、\fI@throws\fRタグがドキュメンテーションを継承するように強制できます。 .RE .PP {@value \fIpackage\&.class#field\fR} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -ͤɽޤ\fI{@value}\fRŪեɤΥɥơ󡦥ȤǰʤǻѤƤ硢ͤɽޤ +定数の値を表示します。\fI{@value}\fRタグが静的フィールドのドキュメンテーション・コメントで引数なしで使用されている場合、その定数の値を表示します。 .sp .if n \{\ .RS 4 @@ -2052,7 +2052,7 @@ public static final String SCRIPT_START = "<script>" .if n \{\ .RE .\} -ǤդΥɥơ󡦥ǰ\fIpackage\&.class#field\fRǻѤ줿硢\fI{@value}\fRϻꤵ줿ͤɽޤ +任意のドキュメンテーション・コメント内で引数\fIpackage\&.class#field\fRありで使用された場合、\fI{@value}\fRタグは指定された定数の値を表示します。 .sp .if n \{\ .RS 4 @@ -2066,48 +2066,48 @@ public String evalScript(String script) {} .if n \{\ .RE .\} -\fIpackage\&.class#field\fRϡ\fI@see\fRƱηˤʤޤСŪեɤǤɬפޤ +引数\fIpackage\&.class#field\fRは、\fI@see\fRタグ引数と同一の形式になります。ただし、メンバーは静的フィールドである必要があります。 .sp -ͤϡե͡ -(http://docs\&.oracle\&.com/javase/8/docs/api/constant\-values\&.html)ˤɽޤ +これらの定数の値は「定数フィールド値」 +(http://docs\&.oracle\&.com/javase/8/docs/api/constant\-values\&.html)にも表示されます .RE .PP @version \fIversion\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI\-version\fRץ󤬻ѤƤ硢ɥȤ\fI֥С\fRФɲäơꤵ줿\fIversion\-text\fRͤ񤭹ߤޤΥϤΥɤޤޤ륽եȥθߤΥ꡼ֹݻ뤿ΤΤǤΤФ\fI@since\fRϡΥɤƳ줿꡼ֹݻޤ\fIversion\-text\fRͤˤϡ̤¤ϤޤJavadocġǤDocȤεˡ@version˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@version)򻲾ȤƤ +\fI\-version\fRオプションが使用されている場合、生成ドキュメントに\fI「バージョン」\fR小見出しを追加して、指定された\fIversion\-text\fRの値を書き込みます。このタグはこのコードが含まれるソフトウェアの現在のリリース番号を保持するためのものであるのに対し、\fI@since\fRタグは、このコードが導入されたリリース番号を保持します。\fIversion\-text\fRの値には、特別な内部構造はありません。JavadocツールでのDocコメントの記述方法の@versionに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@version)を参照してください .sp -1ĤΥɥơ󡦥Ȥʣ\fI@version\fRޤ뤳ȤǤޤɬפ˱ơ1Ĥ\fI@version\fR1ĤΥ꡼ֹꤹ뤳Ȥ⡢ʣΥ꡼ֹꤹ뤳ȤǤޤԤξϡ\fIjavadoc\fRޥɤˤä̾̾δ֤˥(,)ȶʸޤԤξϡƥΤϤ뤳ȤʤɥȤ˥ԡޤäơޤǤϤʤƸб̾ڤʸѤɬפȤˡ1Ԥʣ̾Ǥޤ +1つのドキュメンテーション・コメントに複数の\fI@version\fRタグを含めることができます。必要に応じて、1つの\fI@version\fRタグに1つのリリース番号を指定することも、複数のリリース番号を指定することもできます。前者の場合は、\fIjavadoc\fRコマンドによって名前と名前の間にカンマ(,)と空白文字が挿入されます。後者の場合は、テキスト全体が解析されることなく、生成ドキュメントにコピーされます。したがって、カンマではなく、各言語に対応した名前区切り文字を使用する必要があるときに、1行に複数の名前を指定できます。 .RE -.SH "ѤǤ" +.SH "タグを使用できる場所" .PP -ǤϡѤǤˤĤޤΥ٤ƤΥɥơ󡦥ȤǻѤǤޤ\fI@see\fR\fI@since\fR\fI@deprecated\fR\fI{@link}\fR\fI{@linkplain}\fR\fI{@docroot}\fR -.SS "ץ" +ここでは、タグを使用できる場所について説明します。次のタグがすべてのドキュメンテーション・コメントで使用できます。\fI@see\fR、\fI@since\fR、\fI@deprecated\fR、\fI{@link}\fR、\fI{@linkplain}\fRおよび\fI{@docroot}\fR。 +.SS "概要タグ" .PP -ץϡץڡΥɥơ󡦥ȤǻѤǤ륿Ǥ(Υɥơ󡦥Ȥϡ̾overview\&.htmlȤ̾Υեˤޤ)¾Υɥơ󡦥ȤξƱͤˡΥϡθǻѤɬפޤ +概要タグは、概要ページのドキュメンテーション・コメントで使用できるタグです(このドキュメンテーション・コメントは、通常overview\&.htmlという名前のソース・ファイル内にあります)。他のドキュメンテーション・コメントの場合と同様に、これらのタグは、主説明の後で使用する必要があります。 .PP -\fB:\fR -Java SE 1\&.2Ǥϡץɥ\fI{@link}\fRԶ礬ޤƥȤɽޤ󥯤ꤵޤ󡣸ߤΤȤ\fI{@docRoot}\fRϡץɥǤϵǽޤ +\fB注意:\fR +Java SE 1\&.2では、概要ドキュメント内の\fI{@link}\fRタグに不具合があります。テキストは正しく表示されますが、リンクが設定されません。現在のところ、\fI{@docRoot}\fRタグは、概要ドキュメント内では機能しません。 .PP -ץϡΤȤǤ +概要タグは、次のとおりです。 .PP @see reference || @since since\-text || @serialField field\-name field\-type field\-description || @author name\-text || @version version\-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || -.SS "ѥå" +.SS "パッケージ・タグ" .PP -ѥåϡѥåΥɥơ󡦥ȤǻѤǤ륿ǡɥơ󡦥Ȥpackage\&.htmlޤpackage\-info\&.javaȤ̾ΥեˤޤǻѤǤ\fI@serial\fRϡ\fIinclude\fRޤ\fIexclude\fRꤷΤΤߤǤ +パッケージ・タグは、パッケージのドキュメンテーション・コメントで使用できるタグで、ドキュメンテーション・コメントはpackage\&.htmlまたはpackage\-info\&.javaという名前のソース・ファイル内にあります。ここで使用できる\fI@serial\fRタグは、\fIinclude\fRまたは\fIexclude\fR引数を指定したもののみです。 .PP -ѥåϡΤȤǤ +パッケージ・タグは、次のとおりです。 .PP @see reference || @since since\-text || @serial field\-description | include | exclude || @author name\-text || @version version\-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || -.SS "饹ӥ󥿥ե" +.SS "クラスおよびインタフェース・タグ" .PP -ˡ饹ޤϥ󥿥եΥɥơ󡦥ȤǻѤǤ륿򼨤ޤ\fI@serial\fRϡ\fIinclude\fRޤ\fIexclude\fRꤷơ饹ޤϥ󥿥եΥɥơǤΤ߻ѤǤޤ +次に、クラスまたはインタフェースのドキュメンテーション・コメントで使用できるタグを示します。\fI@serial\fRタグは、\fIinclude\fRまたは\fIexclude\fR引数を指定して、クラスまたはインタフェースのドキュメンテーション内でのみ使用できます。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @serial field\-description | include | exclude || @author name\-text || @version version\-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || .PP -饹Ȥ: +クラス・コメントの例: .sp .if n \{\ .RS 4 @@ -2133,13 +2133,13 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SS "եɡ" +.SS "フィールド・タグ" .PP -ΥϡեɤɽǤޤ +これらのタグは、フィールドに表示できます。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @serial field\-description | include | exclude || @serialField field\-name field\-type field\-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field} .PP -եɡȤ: +フィールド・コメントの例: .sp .if n \{\ .RS 4 @@ -2155,17 +2155,17 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SS "󥹥ȥ饯ȥ᥽åɡ" +.SS "コンストラクタとメソッド・タグ" .PP -ˡ󥹥ȥ饯ޤϥ᥽åɤΥɥơ󡦥ȤǻѤǤ륿򼨤ޤ\fI@return\fRϥ󥹥ȥ饯ǤϻѤǤ -\fI{@inheritDoc}\fRˤ¤ޤ +次に、コンストラクタまたはメソッドのドキュメンテーション・コメントで使用できるタグを示します。ただし、\fI@return\fRはコンストラクタでは使用できず、 +\fI{@inheritDoc}\fRには制限があります。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @param parameter\-name description || @return description || @throws class\-name description || @exception class\-name description || @serialData data\-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot} .PP -\fB:\fR -\fI@serialData\fRϡ\fIwriteObject\fR\fIreadObject\fR\fIwriteExternal\fR\fIreadExternal\fR\fIwriteReplace\fR\fIreadResolve\fR᥽åɤΥɥơ󡦥ȤǤΤ߻ѤǤޤ +\fB注意:\fR +\fI@serialData\fRタグは、\fIwriteObject\fR、\fIreadObject\fR、\fIwriteExternal\fR、\fIreadExternal\fR、\fIwriteReplace\fRおよび\fIreadResolve\fRメソッドのドキュメンテーション・コメントでのみ使用できます。 .PP -᥽åɡȤ: +メソッド・コメントの例: .sp .if n \{\ .RS 4 @@ -2189,9 +2189,9 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -\fIjavadoc\fRޥɤϡɥååȤѤƽϤꤷޤ\fIjavadoc\fRޥɤϡ\fI\-doclet\fRץǥࡦɥååȤꤵƤʳϡǥեȤɸɥååȤѤޤ\fIjavadoc\fRޥɤˤϡǤդΥɥååȤȤȤ˻ѤǤ륳ޥɥ饤󡦥ץ󤬤ޤΥץˤĤƤϡJavadocץޤɸɥååȤǤϡ¾ˡĤɲäΥޥɥ饤󡦥ץ󶡤ޤΥץˤĤƤϡɸɥååȤΥץޤɤΥץ̾⡢ʸȾʸ̤ޤ󡣤ץΰǤϡʸȾʸ̤ޤ +\fIjavadoc\fRコマンドは、ドックレットを使用して出力を決定します。\fIjavadoc\fRコマンドは、\fI\-doclet\fRオプションでカスタム・ドックレットが指定されている場合以外は、デフォルトの標準ドックレットを使用します。\fIjavadoc\fRコマンドには、任意のドックレットとともに使用できるコマンドライン・オプションがあります。これらのオプションについては、Javadocオプションで説明します。標準ドックレットでは、この他に、いくつかの追加のコマンドライン・オプションが提供されます。これらのオプションについては、標準ドックレットのオプションで説明します。どのオプション名も、大文字と小文字が区別されません。ただし、オプションの引数では、大文字と小文字が区別されます。 .sp .RS 4 .ie n \{\ @@ -2201,7 +2201,7 @@ class Window extends BaseWindow { .sp -1 .IP \(bu 2.3 .\} -Javadocץ⻲ȤƤ +Javadocオプションも参照してください .RE .sp .RS 4 @@ -2212,45 +2212,45 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -ɸɥååȤΥץ⻲ȤƤ +標準ドックレットのオプションも参照してください .RE .PP -ץϼΤȤǤ +オプションは次のとおりです。 .PP \-1\&.1 || \-author || \-bootclasspath classpathlist || \-bottom text || \-breakiterator || \-charset name || \-classpath classpathlist || \-d directory || \-docencoding name || \-docfilesubdirs || \-doclet class || \-docletpath classpathlist || \-doctitle title || \-encoding || \-exclude packagename1:packagename2:\&.\&.\&. || \-excludedocfilessubdir name1:name2 || \-extdirs dirist || \-footer footer || \-group groupheading packagepattern:packagepattern || \-header header || \-help || \-helpfile path\efilename || \-Jflag || \-keywords || \-link extdocURL || \-linkoffline extdocURL packagelistLoc || \-linksource || \-locale language_country_variant || \-nocomment || \-nodeprecated || \-nodeprecatedlist || \-nohelp || \-noindex || \-nonavbar || \-noqualifier all | packagename1:packagename2\&.\&.\&. || \-nosince || \-notimestamp || \-notree || \fI\-overview path/filename || \fR\-package || \-private || \-protected || \-public || \-quiet || \-serialwarn || \-source release || \-sourcepath sourcepathlist || \-sourcetab tablength || \-splitindex || \fI\-stylesheet path/filename || \fR\-subpackages package1:package2:\&.\&.\&. || \-tag tagname:Xaoptcmf:"taghead" || \-taglet class || \-tagletpath tagletpathlist || \-title title || \-top || \-use || \-verbose || \-version || \-windowtitle title .PP -Υץϡ٤ƤΥɥååȤ˻ѲǽʥJavadocץǤɸɥååȤǤϡɥååȤ¾ʬ󶡤ޤ\fI\-bootclasspath\fR\fI\-breakiterator\fR\fI\-classpath\fR\fI\-doclet\fR\fI\-docletpath\fR\fI\-encoding\fR\-\fIexclude\fR\fI\-extdirs\fR\fI\-help\fR\fI\-locale\fR\fI\-\fR\fIoverview\fR\fI\-package\fR\fI\-private\fR\fI\-protected\fR\fI\-public\fR\fI\-quiet\fR\fI\-source\fR\fI\-sourcepath\fR\fI\-subpackages\fR\fI\-verbose\fR -.SS "Javadocץ" +次のオプションは、すべてのドックレットに使用可能なコアのJavadocオプションです。標準ドックレットでは、ドックレットの他の部分を提供します。\fI\-bootclasspath\fR、\fI\-breakiterator\fR、\fI\-classpath\fR、\fI\-doclet\fR、\fI\-docletpath\fR、\fI\-encoding\fR、\-\fIexclude\fR、\fI\-extdirs\fR、\fI\-help\fR、\fI\-locale\fR、\fI\-\fR\fIoverview\fR、\fI\-package\fR、\fI\-private\fR、\fI\-protected\fR、\fI\-public\fR、\fI\-quiet\fR、\fI\-source\fR、\fI\-sourcepath\fR、\fI\-subpackages\fRおよび\fI\-verbose\fR。 +.SS "Javadocオプション" .PP \-overview \fIpath/filename \fR .RS 4 -\fIjavadoc\fRޥɤФơ\fIpath/filename \fRǻꤵ줿ե뤫鳵ץɥѤΥƥȤΥƥȤץڡ(overview\-summary\&.html)֤褦˻ꤷޤ\fIpath/filename\fRϡߤΥǥ쥯ȥ꤫ХѥǤ +\fIjavadoc\fRコマンドに対して、\fIpath/filename \fRで指定されたソース・ファイルから概要ドキュメント用のテキストを取得し、そのテキストを概要ページ(overview\-summary\&.html)に配置するように指定します。\fIpath/filename\fRは、現在のディレクトリからの相対パスです。 .sp -\fIfilename\fRͤǤդ̾ѤpathǤդǤޤ̾overview\&.htmlȤ̾դĥ꡼κǾ̥ѥåǥ쥯ȥޤǥ쥯ȥ֤ޤξ֤ȡѥåɥȲȤpathꤹɬפʤʤޤϡ\fI\-sourcepath\fRץˤäƤΥե뤬ؤ뤫Ǥ +\fIfilename\fRの値で任意の名前を使用し、pathで任意の配置先を指定できますが、通常はoverview\&.htmlという名前を付け、ソース・ツリー内の最上位パッケージ・ディレクトリを含むディレクトリに配置します。この場所に配置すると、パッケージをドキュメント化するときにpathを指定する必要がなくなります。これは、\fI\-sourcepath\fRオプションによってこのファイルが指し示されるからです。 .sp -ȤС\fIjava\&.lang\fRѥåΥĥ꡼/src/classes/java/lang/ξ硢ץե/src/classes/overview\&.html֤Ǥޤ +たとえば、\fIjava\&.lang\fRパッケージのソース・ツリーが/src/classes/java/lang/の場合、概要ファイルを/src/classes/overview\&.htmlに配置できます .sp -ºݤ򻲾ȤƤ +実際の例を参照してください。 .sp -\fIpath/filename\fRǻꤹեˤĤƤϡץȡե򻲾ȤƤ +\fIpath/filename\fRで指定するファイルについては、概要コメント・ファイルを参照してください。 .sp -ץڡΤϡ\fIjavadoc\fRޥɤʣΥѥå̾ϤΤߤǤܺ٤ϡHTMLե졼򻲾ȤƤץڡΥȥϡ\fI\-doctitle\fRˤäꤵޤ +概要ページが作成されるのは、\fIjavadoc\fRコマンドに複数のパッケージ名を渡した場合のみです。詳細は、HTMLフレームを参照してください。概要ページのタイトルは、\fI\-doctitle\fRによって設定されます。 .RE .PP \-Xdoclint:(all|none|[\-]\fI<group>\fR) .RS 4 -ʻȡӥƥηJavadocȤ­ηٹݡȤ̵Javadocʸ­ƤHTMLΥ顼ݡȤޤ +不正な参照、アクセシビリティの欠落およびJavadocコメントの不足の警告をレポートし、無効なJavadoc構文および不足しているHTMLタグのエラーをレポートします。 .sp -Υץˤꡢ\fIjavadoc\fRޥɤ줿Ϥ˴ޤޤ뤹٤ƤΥɥȡȤåޤ̾ɤꡢɸ४ץ\fI\-public\fR\fI\-protected\fR\fI\-package\fR\fI\-private\fR줿Ϥ˴ޤܤǤޤ +このオプションにより、\fIjavadoc\fRコマンドは生成された出力に含まれるすべてのドキュメント・コメントをチェックします。通常どおり、標準オプション\fI\-public\fR、\fI\-protected\fR、\fI\-package\fRおよび\fI\-private\fRで生成された出力に含む項目を選択できます。 .sp -\fI\-Xdoclint\fRͭˤʤäƤϡ\fIjavac\fRޥɤƱͤ˥å꤬ݡȤޤ\fIjavadoc\fRޥɤϡåեΥԡӥ顼Ф줿Τʰ֤ؤåȤϤޤåϡ١줿ɥȤХǡѤƼ¹Ԥ줿˥顼ȯǽ˱ơٹޤϥ顼ˤʤޤȤСʻȤޤJavadocȤηϡ\fIjavadoc\fRޥɤ̵HTML븶ˤʤʤᡢϷٹȤƥݡȤޤʸ顼ޤHTMLληϡ\fIjavadoc\fRޥɤ̵HTML븶ˤʤ뤿ᡢϥ顼ȤƥݡȤޤ +\fI\-Xdoclint\fRが有効になっている場合は、\fIjavac\fRコマンドと同様にメッセージで問題がレポートされます。\fIjavadoc\fRコマンドは、メッセージ、ソース・ファイルのコピーおよびエラーが検出された正確な位置を指すキャレットを出力します。メッセージは、重大度、および生成されたドキュメントがバリデータを使用して実行された場合にエラーが発生する可能性に応じて、警告またはエラーになります。たとえば、不正な参照またはJavadocコメントの欠落は、\fIjavadoc\fRコマンドが無効なHTMLを生成する原因にならないため、これらの問題は警告としてレポートされます。構文エラーまたはHTML終了タグの欠落は、\fIjavadoc\fRコマンドが無効なHTMLを生成する原因になるため、これらの問題はエラーとしてレポートされます。 .sp -ǥեȤǤϡ\fI\-Xdoclint\fRץͭˤʤäƤޤץ\fI\-Xdoclint:none\fR̵ˤޤ +デフォルトでは、\fI\-Xdoclint\fRオプションは有効になっています。オプション\fI\-Xdoclint:none\fRで無効にします。 .sp -\fI\-Xdoclint\fRץǥݡȤƤϼΥץѹޤ +\fI\-Xdoclint\fRオプションでレポートされる内容は次のオプションで変更します。 .sp .RS 4 .ie n \{\ @@ -2261,7 +2261,7 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI none\fR: -\fI\-Xdoclint\fRץ̵ˤޤ +\fI\-Xdoclint\fRオプションを無効にします。 .RE .sp .RS 4 @@ -2273,7 +2273,7 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI \fR\fIgroup\fR: -\fIgroup\fRåͭˤޤ +\fIgroup\fRチェックを有効にします。 .RE .sp .RS 4 @@ -2284,7 +2284,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fI\-Xdoclint\fR\fI\fR\fI all\fR: ٤ƤΥå롼פͭˤޤ +\fI\-Xdoclint\fR\fI\fR\fI all\fR: すべてのチェック・グループを有効にします。 .RE .sp .RS 4 @@ -2296,10 +2296,10 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI all,\fR\fI\-group\fR: -\fIgroup\fRåʳΤ٤Ƥͭˤޤ +\fIgroup\fRチェック以外のすべてを有効にします。 .RE .sp -ѿ\fIgroup\fRϼΤ줫ͤޤ +変数\fIgroup\fRは次のいずれかの値を持ちます。 .sp .RS 4 .ie n \{\ @@ -2309,7 +2309,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIaccessibility\fR: ӥƥåǸФåޤ(ȤС\fI<table>\fRǻꤵno captionޤsummary°) +\fIaccessibility\fR: アクセシビリティ・チェッカで検出する問題をチェックします(たとえば、\fI<table>\fRタグで指定されるno captionまたはsummary属性)。 .RE .sp .RS 4 @@ -2320,7 +2320,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIhtml\fR: 饤ǤؤΥ֥åǤ佪λɬפȤǤλʤʤɡ̥٥HTML򸡽Фޤ롼ϡHTML 4\&.01ͤƳФޤΥפΥåϡ\fIjavadoc\fRޥɤͭˤơ֥饦ǽΤHTML򸡽Фޤ +\fIhtml\fR: インライン要素へのブロック要素の挿入や終了タグを必要とする要素を終了しないなど、上位レベルHTMLの問題を検出します。ルールは、HTML 4\&.01仕様から導出されます。このタイプのチェックは、\fIjavadoc\fRコマンドを有効にして、ブラウザが受け入れる可能性のあるHTMLの問題を検出します。 .RE .sp .RS 4 @@ -2331,7 +2331,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fImissing\fR: ƤJavadocȤޤϥåޤ(ȤСƤ륳Ȥ䥯饹ޤϷƤ\fI@return\fR᥽åɾƱͤΥ) +\fImissing\fR: 欠落しているJavadocコメントまたはタグをチェックします(たとえば、欠落しているコメントやクラス、または欠落している\fI@return\fRタグやメソッド上の同様のタグ)。 .RE .sp .RS 4 @@ -2342,7 +2342,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIreference\fR: JavadocJava APIǤλȤ˴Ϣåޤ(ȤС\fI@see\fRǸĤʤܡޤ\fI@param\fRθ̾) +\fIreference\fR: JavadocタグのJava API要素の参照に関連する問題をチェックします(たとえば、\fI@see\fRで見つからない項目、または\fI@param\fRの後の不正な名前)。 .RE .sp .RS 4 @@ -2353,10 +2353,10 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIsyntax\fR: פƤʤå(\fI<\fR\fI>\fR)䥢ѥ(\fI&\fR)̵Javadocʤɤβ̥٥ǧޤ +\fIsyntax\fR: エスケープされていない山カッコ(\fI<\fRおよび\fI>\fR)やアンパサンド(\fI&\fR)、無効なJavadocタグなどの下位レベルの問題を確認します。 .RE .sp -\fI\-Xdoclint\fRץʣꤷơʣΥƥΥ顼ȷٹå륪ץͭˤǤޤޤϡΥץѤơʣΥ顼ӷٹ𥫥ƥǤޤȤСΥޥɤΤ줫Ѥơ\fIfilename\fRեHTMLʸӥӥƥåޤ +\fI\-Xdoclint\fRオプションを複数回指定して、複数のカテゴリのエラーと警告をチェックするオプションを有効にできます。または、前のオプションを使用して、複数のエラーおよび警告カテゴリを指定できます。たとえば、次のコマンドのいずれかを使用して、\fIfilename\fRファイル内のHTML、構文およびアクセシビリティの問題をチェックします。 .sp .if n \{\ .RS 4 @@ -2368,57 +2368,57 @@ javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR .if n \{\ .RE .\} -\fB:\fR -\fIjavadoc\fRޥɤǤϡΥåδݾڤޤ󡣶ŪˤϡHTMLץ饤󥹡åǤϤޤ\-\fIXdoclint\fRץŪϡ\fIjavadoc\fRޥɤͭˤưŪʥ顼ȾݡȤ뤳ȤǤ +\fB注意:\fR +\fIjavadoc\fRコマンドでは、これらのチェックの完全性は保証されません。具体的には、完全なHTMLコンプライアンス・チェッカではありません。\-\fIXdoclint\fRオプションの目的は、\fIjavadoc\fRコマンドを有効にして一般的なエラーの大半をレポートすることです。 .sp -\fIjavadoc\fRޥɤϡ̵ϤνԤݡȤΤ߹Ԥޤ +\fIjavadoc\fRコマンドは、無効な入力の修正を試行せず、レポートのみ行います。 .RE .PP \-public .RS 4 -public饹ӥСΤɽޤ +publicクラスおよびメンバーのみ表示します。 .RE .PP \-protected .RS 4 -protectedpublicΥ饹ȥСΤߤɽޤ줬ǥեȤǤ +protectedおよびpublicのクラスとメンバーのみを表示します。これがデフォルトです。 .RE .PP \-package .RS 4 -packageprotectedpublicΥ饹ȥСΤɽޤ +package、protected、およびpublicのクラスとメンバーのみ表示します。 .RE .PP \-private .RS 4 -٤ƤΥ饹ȥСɽޤ +すべてのクラスとメンバーを表示します。 .RE .PP \-help .RS 4 -饤󡦥إפɽޤ\fIjavadoc\fR\fIɥåå\fRΥޥɥ饤󡦥ץ󤬥ꥹȤޤ +オンライン・ヘルプを表示します。\fIjavadoc\fRと\fIドックレット\fRのコマンドライン・オプションがリストされます。 .RE .PP \-doclet \fIclass\fR .RS 4 -ɥȤ˻ѤɥååȤư뤿Υ饹եꤷޤ̾ѤޤΥɥååȤˤꡢϤƤȷޤ\fI\-doclet\fRץ󤬻ѤƤʤ硢\fIjavadoc\fRޥɤϡɸɥååȤѤƥǥեȤHTMLޤΥ饹ˤ\fIstart(Root)\fR᥽åɤޤޤƤɬפޤεư饹ؤΥѥ\fI\-docletpath\fRץˤäޤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ +ドキュメントの生成に使用するドックレットを起動するためのクラス・ファイルを指定します。完全修飾名を使用します。このドックレットにより、出力の内容と形式が定義されます。\fI\-doclet\fRオプションが使用されていない場合、\fIjavadoc\fRコマンドは、標準ドックレットを使用してデフォルトのHTML形式を生成します。このクラスには\fIstart(Root)\fRメソッドが含まれている必要があります。この起動クラスへのパスは\fI\-docletpath\fRオプションによって定義されます。ドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください .RE .PP \-docletpath \fIclasspathlist\fR .RS 4 -\fI\-doclet\fRץǻꤵ줿ɥååȳϥ饹ե롢ӤΥ饹¸뤹٤ƤJARեؤΥѥꤷޤϥ饹ե뤬JARեˤ硢ΥץJARեؤΥѥꤷޤХѥޤϸߤΥǥ쥯ȥ꤫ХѥǤޤ\fIclasspathlist\fRʣΥѥJARե뤬ޤޤˤϡSolarisξϥ(:)ǡWindowsξϥߥ(;)Ǥ줾ڤޤŪΥɥååȳϥ饹Ǥ˸ѥˤϡΥץפǤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ +\fI\-doclet\fRオプションで指定されたドックレット開始クラス・ファイル、およびそのクラスが依存するすべてのJARファイルへのパスを指定します。開始クラス・ファイルがJARファイル内にある場合、このオプションでJARファイルへのパスを指定します。絶対パスまたは現在のディレクトリからの相対パスを指定できます。\fIclasspathlist\fRに複数のパスやJARファイルが含まれる場合には、それらをSolarisの場合はコロン(:)で、Windowsの場合はセミコロン(;)でそれぞれ区切ります。目的のドックレット開始クラスがすでに検索パス内にある場合は、このオプションは不要です。ドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください .RE .PP \-1\&.1 .RS 4 -Javadoc 1\&.4졢ؤϤޤ󡣤ΥץϡJavadoc 1\&.1ˤäΤƱȵǽĥɥȤ뤿ΤΤǤ(ͥȤ줿饹ϥݡȤƤޤ)ΥץɬפʾϡJavadoc 1\&.2ޤ1\&.3򤫤˻ѤƤ +Javadoc 1\&.4から削除され、代替はありません。このオプションは、Javadoc 1\&.1によって生成されるのと同じ外見と機能を持つドキュメントを作成するためのものでした(ネストされたクラスはサポートされていません)。このオプションが必要な場合は、Javadoc 1\&.2または1\&.3をかわりに使用してください。 .RE .PP \-source \fIrelease\fR .RS 4 -դ륽ɤΥ꡼ꤷޤ\fIrelease\fRѥ᡼ˤϼͤǤޤ\fIjavac\fRޥɤǥɤ򥳥ѥ뤹Ȥ˻Ѥͤб\fI꡼\fRͤѤޤ +受け付けるソース・コードのリリースを指定します。\fIrelease\fRパラメータには次の値を指定できます。\fIjavac\fRコマンドでコードをコンパイルするときに使用する値に対応する\fIリリース\fRの値を使用します。 .sp .RS 4 .ie n \{\ @@ -2428,7 +2428,7 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.5\fR\fIjavadoc\fRޥɤϡJDK 1\&.5Ƴ줿Τ¾θ쵡ǽޤॳɤդޤ\fI\-source\fRץ󤬻ѤʤäΥѥΥǥեưϡ1\&.5ΤΤˤʤޤ +\fBリリース値: 1\&.5\fR。\fIjavadoc\fRコマンドは、JDK 1\&.5で導入された総称および他の言語機能を含むコードを受け付けます。\fI\-source\fRオプションが使用されなかった場合のコンパイラのデフォルト動作は、1\&.5のものになります。 .RE .sp .RS 4 @@ -2439,7 +2439,7 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.4\fR\fIjavadoc\fRޥɤϡJDK 1\&.4Ƴ줿ޤॳɤդޤ +\fBリリース値: 1\&.4\fR。\fIjavadoc\fRコマンドは、JDK 1\&.4で導入されたアサーションを含むコードを受け付けます。 .RE .sp .RS 4 @@ -2450,20 +2450,20 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.3\fR\fIjavadoc\fRޥɤϡJDK 1\&.3ʹߤƳ줿Ρޤ¾θ쵡ǽ򥵥ݡȤޤ +\fBリリース値: 1\&.3\fR。\fIjavadoc\fRコマンドは、JDK 1\&.3以降に導入されたアサーション、総称、または他の言語機能をサポートしません。 .RE .RE .PP \-sourcepath \fIsourcepathlist\fR .RS 4 -ѥå̾ޤ\fI\-subpackages\fRץ\fIjavadoc\fRޥɤϤȤˡե򸫤Ĥ뤿θѥꤷޤ -\fIʣΥѥϥ(:)Ƕڤޤ\fR\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤΥץѤơɥȲ륽եΰ֤ΤߤǤʤ켫ΤϥɥȲʤɥȲ륽ե뤫Ѿ줿Ȥĥեΰ֤ǧǤޤ +パッケージ名または\fI\-subpackages\fRオプションを\fIjavadoc\fRコマンドに渡すときに、ソース・ファイルを見つけるための検索パスを指定します。 +\fI複数のパスはコロン(:)で区切ります。\fR\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。このオプションを使用して、ドキュメント化されるソース・ファイルの位置のみでなく、それ自体はドキュメント化されないがドキュメント化されるソース・ファイルから継承されたコメントを持つソース・ファイルの位置も確認できます。 .sp -\fI\-sourcepath\fRץѤǤΤϡ\fIjavadoc\fRޥɤ˥ѥå̾ϤΤߤǤ\fIjavadoc\fRޥɤϤ륽եϸޤ󡣥եꤹˤϡΥǥ쥯ȥ˰ư뤫1İʾΥ饹ΥɥȲפ˼褦˳ƥե˥ѥޤޤ\fI\-sourcepath\fRά줿硢\fIjavadoc\fRޥɤϡ饹ѥѤƥե򸡺ޤ(\fI\-classpath\fR򻲾)ǥեȤ\fI\-sourcepath\fRϡ饹ѥͤǤ\fI\-classpath\fRάƥѥå̾\fIjavadoc\fRޥɤϤȡ\fIjavadoc\fRޥɤϸߤΥǥ쥯ȥ(ӤΥ֥ǥ쥯ȥ)饽ե򸡺ޤ +\fI\-sourcepath\fRオプションを使用できるのは、\fIjavadoc\fRコマンドにパッケージ名を渡す場合のみです。\fIjavadoc\fRコマンドに渡されるソース・ファイルは検索されません。ソース・ファイルを特定するには、そのディレクトリに移動するか、「1つ以上のクラスのドキュメント化」に示すように各ファイルの前にパスを含めます。\fI\-sourcepath\fRが省略された場合、\fIjavadoc\fRコマンドは、クラス・パスを使用してソース・ファイルを検索します(\fI\-classpath\fRを参照)。デフォルトの\fI\-sourcepath\fRは、クラス・パスの値です。\fI\-classpath\fRを省略してパッケージ名を\fIjavadoc\fRコマンドに渡すと、\fIjavadoc\fRコマンドは現在のディレクトリ(およびそのサブディレクトリ)からソース・ファイルを検索します。 .sp -\fIsourcepathlist\fRˤϡɥȲѥåΥĥ꡼Υ롼ȡǥ쥯ȥꤷޤ +\fIsourcepathlist\fRには、ドキュメント化するパッケージのソース・ツリーのルート・ディレクトリを設定します。 .sp -ȤС\fIcom\&.mypackage\fRȤ̾ΥѥåɥȲˡΥե뤬/home/user/src/com/mypackage/*\&.javaˤȤޤѥcom\emypackageޤޤǥ쥯ȥ/home/user/src˻ꤷƤ顢Τ褦ˡѥå̾ꤷޤ +たとえば、\fIcom\&.mypackage\fRという名前のパッケージをドキュメント化する場合に、そのソース・ファイルが/home/user/src/com/mypackage/*\&.javaにあるとします。ソース・パスをcom\emypackageが含まれるディレクトリ/home/user/srcに指定してから、次のように、パッケージ名を指定します。 .sp .if n \{\ .RS 4 @@ -2474,11 +2474,11 @@ javadoc \-sourcepath /home/user/src/ com\&.mypackage .if n \{\ .RE .\} -ѥͤȥѥå̾Ϣ뤷ơɥåȤ򥹥å(/)ѹȡΤ褦ˡѥåΥեѥˤʤޤ +ソース・パスの値とパッケージ名を連結して、ドットをスラッシュ(/)に変更すると、次のように、パッケージのフルパスになります。 .sp /home/user/src/com/mypackage .sp -2ĤΥѥꤹˤϡΤ褦ˤޤ +2つのソース・パスを設定するには、次のようにします。 .sp .if n \{\ .RS 4 @@ -2493,12 +2493,12 @@ javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage .PP \-classpath \fIclasspathlist\fR .RS 4 -\fIjavadoc\fRޥɤȥ饹θԤȤ˻Ѥѥꤷޤȥ饹ȤϡɥȲ륯饹ȡΥ饹ˤäƻȤ뤹٤ƤΥ饹ΤȤǤ -\fIʣΥѥϥ(:)Ƕڤޤ\fR\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤ\fIclasspathlist\fRͤꤹȤϡ饹ѥΥɥȤˤؼ˽äƤ +\fIjavadoc\fRコマンドが参照クラスの検索を行うときに使用するパスを指定します。参照クラスとは、ドキュメント化されるクラスと、それらのクラスによって参照されるすべてのクラスのことです。 +\fI複数のパスはコロン(:)で区切ります。\fR\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。\fIclasspathlist\fRの値を指定するときは、クラス・パスのドキュメントにある指示に従ってください。 .sp -\fI\-sourcepath\fRά줿硢\fIjavadoc\fRޥɤ\fI\-classpath\fRѤơե뤪ӥ饹ե򸡺ޤ(̸ߴΤ)եȥ饹ե̡Υѥ鸡ɬפϡ\fI\-sourcepath\fR\fI\-classpath\fRξѤޤ +\fI\-sourcepath\fRが省略された場合、\fIjavadoc\fRコマンドは\fI\-classpath\fRを使用して、ソース・ファイルおよびクラス・ファイルを検索します(下位互換性のため)。ソース・ファイルとクラス・ファイルを別々のパスから検索する必要がある場合は、\fI\-sourcepath\fRと\fI\-classpath\fRの両方を使用します。 .sp -ȤС\fIcom\&.mypackage\fRɥȲˡΥե뤬ǥ쥯ȥ/home/user/src/com/mypackageˤꡢΥѥå/home/user/libthenΥ饤֥˰¸ƤȤΤ褦˻ꤷޤ +たとえば、\fIcom\&.mypackage\fRをドキュメント化する場合に、そのソース・ファイルがディレクトリ/home/user/src/com/mypackageにあり、このパッケージが/home/user/libthen内のライブラリに依存しているとき、次のように指定します。 .sp .if n \{\ .RS 4 @@ -2509,21 +2509,21 @@ javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage .if n \{\ .RE .\} -¾ΥġƱͤˡ\fI\-classpath\fRꤵƤʤ硢\fICLASSPATH\fRĶѿꤵƤС\fIjavadoc\fRޥɤϤδĶѿѤޤɤꤵƤʤ硢\fIjavadoc\fRޥɤϸߤΥǥ쥯ȥ꤫饯饹򸡺ޤ +他のツールと同様に、\fI\-classpath\fRが指定されていない場合、\fICLASSPATH\fR環境変数が設定されていれば、\fIjavadoc\fRコマンドはその環境変数を使用します。どちらも設定されていない場合、\fIjavadoc\fRコマンドは現在のディレクトリからクラスを検索します。 .sp -\fIjavadoc\fRޥɤ\fI\-classpath\fRѤƥ桼饹򸡺ˡˤĤƤΡĥǽ饹֡ȥȥåס饹˴Ϣܺ٤ϡ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +\fIjavadoc\fRコマンドが\fI\-classpath\fRを使用してユーザー・クラスを検索する方法についての、拡張機能クラスやブートストラップ・クラスに関連した詳細は、クラスの検索方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください。 .sp -*Υ١̾ޤ९饹ѥǤϡ\fI\&.jar\fRޤ\fI\&.JAR\fRĥҤ˻ĥǥ쥯ȥΤ٤ƤΥեΥꥹȤꤹΤƱȤߤʤޤ +*のベース名を含むクラス・パス要素は、\fI\&.jar\fRまたは\fI\&.JAR\fRを拡張子に持つディレクトリ内のすべてのファイルのリストを指定するのと同等とみなされます。 .sp -ȤСǥ쥯ȥ\fImydir\fR\fIa\&.jar\fR\fIb\&.JA\fRRޤޤƤ硢饹ѥ\fIfoo/*\fR\fIA\&.jar:b\&.JAR\fRŸޤJARեν֤̤ȤʤޤɽΥեޤࡢꤷǥ쥯ȥΤ٤ƤJARե뤬ꥹȤ˴ޤޤޤ*ʤ륯饹ѥȥϡߤΥǥ쥯ȥΤ٤ƤJARեΥꥹȤŸޤ\fICLASSPATH\fRĶѿƱͤŸޤ饹ѥΥ磻ɥɤŸϡJavaۥޥ(JVM)γ˹ԤޤJavaץϡSystem\&.getenv(\fI"CLASSPATH"\fR)θƤӽФˤäƤʤɡĶ䤤礻ŸƤʤ磻ɥɤ򻲾Ȥޤ +たとえば、ディレクトリ\fImydir\fRに\fIa\&.jar\fRと\fIb\&.JA\fRRが含まれている場合、クラス・パス要素\fIfoo/*\fRは\fIA\&.jar:b\&.JAR\fRに展開されますが、JARファイルの順番は未指定となります。非表示のファイルを含む、指定したディレクトリ内のすべてのJARファイルがリストに含まれます。*からなるクラス・パス・エントリは、現在のディレクトリ内のすべてのJARファイルのリストに展開されます。\fICLASSPATH\fR環境変数も同様に展開されます。クラス・パスのワイルドカードの展開は、Java仮想マシン(JVM)の開始前に行われます。Javaプログラムは、System\&.getenv(\fI"CLASSPATH"\fR)の呼び出しによってなど、環境を問い合せる場合を除き、展開されていないワイルドカードを参照しません。 .RE .PP \-subpackages \fIpackage1:package2:\&.\&.\&.\fR .RS 4 -ե뤫ꤵ줿ѥåӤΥ֥ѥå˺ƵŪ˥ɥȤޤΥץϡɤ˿֥ѥåɲäݤǤ֥ѥåưŪȤ߹ޤ뤫ǤpackageϡǤդκǾ̥֥ѥå(\fIjava\fRʤ)ޤϴѥå(\fIjavax\&.swing\fRʤ)ˤʤޤեޤɬפϤޤ󡣰ϡ٤ƤΥڥ졼ƥ󥰡ƥǡǶڤޤ磻ɥɤϻѤǤޤ󡣥ѥåθꤹˤϡ\fI\-sourcepath\fRѤޤΥץǤϡĥ꡼¸ߤ뤬ѥå˴ޤޤʤեޤ󡣥եν򻲾ȤƤ +ソース・ファイルから指定されたパッケージおよびそのサブパッケージ内に再帰的にドキュメントを生成します。このオプションは、ソース・コードに新しいサブパッケージを追加する際に便利です。新しいサブパッケージが自動的に組み込まれるからです。各package引数は、任意の最上位サブパッケージ(\fIjava\fRなど)または完全修飾パッケージ(\fIjavax\&.swing\fRなど)になります。ソース・ファイルを含める必要はありません。引数は、すべてのオペレーティング・システムで、コロンで区切られます。ワイルドカードは使用できません。パッケージの検索場所を指定するには、\fI\-sourcepath\fRを使用します。このオプションでは、ソース・ツリー内に存在するがパッケージに含まれないソース・ファイルを処理しません。ソース・ファイルの処理を参照してください。 .sp -ȤСΥޥɤϡ\fIjava\fR\fIjavax\&.swing\fRȤ̾ΥѥåȤΥ֥ѥåΥɥȤޤ +たとえば、次のコマンドは、\fIjava\fRおよび\fIjavax\&.swing\fRという名前のパッケージとこれらのサブパッケージ全部のドキュメントを生成します。 .sp .if n \{\ .RS 4 @@ -2538,9 +2538,9 @@ javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing .PP \-exclude \fIpackagename1:packagename2:\&.\&.\&.\fR .RS 4 -ꤵ줿ѥåȤΥ֥ѥå\fI\-subpackages\fRˤäƺ줿ꥹȤ̵˽ޤޤϾ\fI\-subpackages\fRץλˤäȤ߹ޤѥåоݤȤʤޤ +指定されたパッケージとそのサブパッケージを\fI\-subpackages\fRによって作成されたリストから無条件に除外します。過去または将来の\fI\-subpackages\fRオプションの指定によって組み込まれるパッケージも除外の対象となります。 .sp -Ǥϡ\fIjava\&.io\fR\fIjava\&.util\fR\fIjava\&.math\fRʤɤȤ߹ޤޤ\fIjava\&.net\fR\fIjava\&.lang\fR롼Ȥ˻ĥѥåϽޤ\fIjava\&.lang\fRΥ֥ѥåǤ\fIjava\&.lang\&.ref\fRդƤ +次の例では、\fIjava\&.io\fR、\fIjava\&.util\fR、\fIjava\&.math\fRなどは組み込まれますが、\fIjava\&.net\fRと\fIjava\&.lang\fRをルートに持つパッケージは除外されます。\fIjava\&.lang\fRのサブパッケージである\fIjava\&.lang\&.ref\fRが除外される点に注意してください。 .sp .if n \{\ .RS 4 @@ -2556,30 +2556,30 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .PP \-bootclasspath \fIclasspathlist\fR .RS 4 -֡ȡ饹¸ߤѥꤷޤ֡ȡ饹Ȥϡ̾Javaץåȥեࡦ饹ΤȤǤ\fIbootclasspath\fRϡ\fIjavadoc\fRޥɤեȥ饹եõȤ˻Ѥ븡ѥΰǤܺ٤ϡ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +ブート・クラスが存在するパスを指定します。ブート・クラスとは、通常、Javaプラットフォーム・クラスのことです。\fIbootclasspath\fRは、\fIjavadoc\fRコマンドがソース・ファイルとクラス・ファイルを探すときに使用する検索パスの一部です。詳細は、クラスの検出方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください .sp -\fIclasspathlist\fRѥ᡼Υǥ쥯ȥϡߥ(;)Ƕڤ(Windowsξ)(:)Ƕڤޤ(Oracle Solarisξ) +\fIclasspathlist\fRパラメータ内のディレクトリは、セミコロン(;)で区切る(Windowsの場合)か、コロン(:)で区切ります(Oracle Solarisの場合)。 .RE .PP \-extdirs \fIdirist\fR .RS 4 -ĥǽ饹¸ߤǥ쥯ȥꤷޤĥǽ饹ȤϡJavaĥǽѤ뤹٤ƤΥ饹Ǥ\fIextdirs\fRץϡ\fIjavadoc\fRޥɤեȥ饹եõȤ˻Ѥ븡ѥΰǤܺ٤ϡ\fI\-classpath\fRץ򻲾ȤƤ\fIdirlist\fRΥǥ쥯ȥϡߥ(;)Ƕڤ(Windowsξ)(:)Ƕڤޤ(Oracle Solarisξ) +拡張機能クラスが存在するディレクトリを指定します。拡張機能クラスとは、Java拡張機能機構を使用するすべてのクラスです。\fIextdirs\fRオプションは、\fIjavadoc\fRコマンドがソース・ファイルとクラス・ファイルを探すときに使用する検索パスの一部です。詳細は、\fI\-classpath\fRオプションを参照してください。\fIdirlist\fR内のディレクトリは、セミコロン(;)で区切る(Windowsの場合)か、コロン(:)で区切ります(Oracle Solarisの場合)。 .RE .PP \-verbose .RS 4 -\fIjavadoc\fRޥɤμ¹˾ܺ٤ʥåɽޤ\fIverbose\fRץꤷʤȡեΥɻɥȤ(ե뤴Ȥ1ĤΥå)ӥȻ˥åɽޤverboseץꤹȡJavaեβϤפ(ߥñ)򼨤ɲäΥåɽޤ +\fIjavadoc\fRコマンドの実行中に詳細なメッセージを表示します。\fIverbose\fRオプションを指定しないと、ソース・ファイルのロード時、ドキュメントの生成時(ソース・ファイルごとに1つのメッセージ)、およびソート時にメッセージが表示されます。verboseオプションを指定すると、各Javaソース・ファイルの解析に要した時間(ミリ秒単位)を示す追加のメッセージが表示されます。 .RE .PP \-quiet .RS 4 -åٹȥ顼Τߤɽ褦ˤơǧ䤹ޤ\fIversion\fRʸ޻ߤޤ +メッセージを抑制し、警告とエラーのみが表示されるようにして、これらを確認しやすくします。\fIversion\fR文字列も抑止します。 .RE .PP \-breakiterator .RS 4 -Ѹξ硢ѥå饹ޤϥСμκǽʸνȽǤݤˡ\fIjava\&.text\&.BreakIterator\fRιݲ줿ʸѤޤ¾Τ٤ƤΥϡѸȤͭΥ르ꥺǤϤʤǤ\fIBreakIterator\fR饹ѤƤޤǽʸϡѥå饹ޤϥСΥޥ꡼˥ԡ졢ե٥åȽκ˥ԡޤJDK 1\&.2ʹߡ\fIBreakIterator\fR饹ϡѸ٤ƤθʸνȽǤ뤿ˡǤ˻ѤƤޤäơ\fI\-breakiterator\fRץϡ1\&.2ʹߤǤϱʸʳˤϸ̤ޤ󡣱ʸˤϡΤ褦ȼΥǥեȤΥ르ꥺबޤ +英語の場合、パッケージ、クラスまたはメンバーの主説明の最初の文の終わりを判断する際に、\fIjava\&.text\&.BreakIterator\fRの国際化された文境界を使用します。他のすべてのロケールは、英語言語というロケール固有のアルゴリズムではなく、すでに\fIBreakIterator\fRクラスを使用しています。最初の文は、パッケージ、クラス、またはメンバーのサマリーにコピーされ、アルファベット順の索引にコピーされます。JDK 1\&.2以降、\fIBreakIterator\fRクラスは、英語を除くすべての言語の文の終わりを判断するために、すでに使用されています。したがって、\fI\-breakiterator\fRオプションは、1\&.2以降では英文以外には効果がありません。英文には、次のような独自のデフォルトのアルゴリズムがあります。 .sp .RS 4 .ie n \{\ @@ -2589,7 +2589,7 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .sp -1 .IP \(bu 2.3 .\} -ʸΥǥեȤʸڤꥢ르ꥺࡣʸޤHTML֥å(\fI<P>\fRʤ)³ԥꥪɤߤޤ +英文のデフォルトの文区切りアルゴリズム。空白文字またはHTMLブロック・タグ(\fI<P>\fRなど)が続くピリオドで停止します。 .RE .sp .RS 4 @@ -2600,36 +2600,36 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .sp -1 .IP \(bu 2.3 .\} -breakiteratorʸڤꥢ르ꥺࡣθ줬ʸǻϤޤ硢ʸ³ԥꥪɡ䡢ޤϴòߤޤΥ르ꥺǤϡThe serial no\&. is validפʤɡۤȤɤξάɽޤMr\&. SmithפϽޤ\fI\-breakiterator\fRץǤϡHTML䡢ޤϵǻϤޤʸǤߤޤHTMLޤƤǤ⡢\&.\&./filenameפκǸΥԥꥪɤߤޤ +breakiterator文区切りアルゴリズム。次の語が大文字で始まる場合、空白文字が続くピリオド、疑問符、または感嘆符で停止します。このアルゴリズムでは「The serial no\&. is valid」など、ほとんどの省略表記が処理されますが、「Mr\&. Smith」は処理されません。\fI\-breakiterator\fRオプションでは、HTMLタグや、数字または記号で始まる文では停止しません。HTMLタグに埋め込まれている場合でも、「\&.\&./filename」の最後のピリオドで停止します。 .RE .sp -Java SE 1\&.5Ǥ\fI\-breakiterator\fRٹå졢ǥեȤʸڤꥢ르ꥺѹƤޤ󡣥ɤѹSE 1\&.4\&.xǤ\fI\-breakiterator\fRץηٹƤʤǤ⡢⤹ɬפϤޤJava SE 1\&.5\&.0ϷٹϾǤƤޤ +Java SE 1\&.5では\fI\-breakiterator\fR警告メッセージが削除され、デフォルトの文区切りアルゴリズムは変更されていません。ソース・コードを変更せず、SE 1\&.4\&.xでの\fI\-breakiterator\fRオプションの警告を除去していない場合でも、何もする必要はありません。Java SE 1\&.5\&.0からは警告は消滅しています。 .RE .PP \-locale \fIlanguage_country_variant\fR .RS 4 -\fIjavadoc\fRޥɤɥȤȤ˻Ѥꤷޤΰϡ\fIj\fR\fIava\&.util\&.Locale\fRɥȤƤ褦ˡ\fIen_US\fR -(Ѹ졢ƹ)ޤ\fIen_US_WIN\fR -(WindowsХꥢ)ʤɤΥ̾Ǥ +\fIjavadoc\fRコマンドがドキュメントを生成するときに使用するロケールを指定します。この引数は、\fIj\fR\fIava\&.util\&.Locale\fRドキュメントで説明しているように、\fIen_US\fR +(英語、米国)または\fIen_US_WIN\fR +(Windowsバリアント)などのロケールの名前です。 .sp -\fB:\fR -\fI\-locale\fRץϡɸɥååȤ󶡤뤹٤ƤΥץ󡢤ޤϤ¾ǤդΥɥååȤ󶡤뤹٤ƤΥץ(¦)˻ꤹɬפޤʤȡʥӥ󡦥СѸɽޤΥޥɥ饤󡦥ץΤߡꤹ˰¸ޤɸɥååȤΥץ򻲾ȤƤ +\fB注意:\fR +\fI\-locale\fRオプションは、標準ドックレットが提供するすべてのオプション、またはその他の任意のドックレットが提供するすべてのオプションより前(左側)に指定する必要があります。そうしないと、ナビゲーション・バーが英語で表示されます。このコマンドライン・オプションのみ、指定する順序に依存します。標準ドックレットのオプションを参照してください。 .sp -ꤹȡꤷΥ꥽ե뤬\fIjavadoc\fRޥɤˤä򤵤ơå(ʥӥ󡦥СꥹȤɽθФإסեܼstylesheet\&.cssΥȤʤɤʸ)Τ˻Ѥޤޤե٥åȽ˥ȤꥹȤΥȽ硢ӺǽʸνȽǤ뤿ʸζڤʸ⡢ꤷˤäƷޤޤ\fI\-locale\fRץϡɥȲ륯饹ΥեǻꤵƤɥơ󡦥ȤΥƥȤΥꤹΤǤϤޤ +ロケールを指定すると、指定したロケールのリソース・ファイルが\fIjavadoc\fRコマンドによって選択されて、メッセージ(ナビゲーション・バー、リストと表の見出し、ヘルプ・ファイルの目次、stylesheet\&.cssのコメントなどの文字列)のために使用されます。また、アルファベット順にソートされるリストのソート順、および最初の文の終わりを判断するための文の区切り文字も、指定したロケールによって決まります。\fI\-locale\fRオプションは、ドキュメント化されるクラスのソース・ファイル内で指定されているドキュメンテーション・コメントのテキストのロケールを決定するものではありません。 .RE .PP \-encoding .RS 4 -եΥ󥳡ǥ󥰤̾(\fIEUCJIS/SJIS\fRʤ)ꤷޤΥץ󤬻ꤵƤʤϡץåȥեΥǥեȡСѤޤӥץ⻲ȤƤ +ソース・ファイルのエンコーディングの名前(\fIEUCJIS/SJIS\fRなど)を指定します。このオプションが指定されていない場合は、プラットフォームのデフォルト・コンバータが使用されます。およびオプションも参照してください。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjavadoc\fRޥɤ¹ԤJava Runtime Environment (JRE)ˡ\fIflag\fRľϤޤȤСɥȤ뤿˥ƥ32MBΥ꡼ݤƤɬפϡ\fI\-Xmx\fRץ򼡤Τ褦˸ƤӽФޤ\fIjavadoc \-J\-Xmx32m \-J\-Xms32m com\&.mypackage\fR\fI\-Xms\fRϾάǽǡϽ꡼ΥꤹΤߤΥץǡɬפʥ꡼κǾ̤狼äƤǤ +\fIjavadoc\fRコマンドを実行するJava Runtime Environment (JRE)に、\fIflag\fRを直接渡します。たとえば、生成ドキュメントを処理するためにシステムで32MBのメモリーを確保しておく必要がある場合は、\fI\-Xmx\fRオプションを次のように呼び出します。\fIjavadoc \-J\-Xmx32m \-J\-Xms32m com\&.mypackage\fR。\fI\-Xms\fRは省略可能で、これは初期メモリーのサイズを設定するのみのオプションで、必要なメモリーの最小量がわかっている場合に便利です。 .sp -\fIJ\fR\fIflag\fRδ֤˶ʸϤޤ +\fIJ\fRと\fIflag\fRの間に空白文字はありません。 .sp -ѤƤ\fIjavadoc\fRޥɤΥСǧˤ\fI\-version\fRץѤޤϥȥ꡼ˤɸɥååȤΥСֹ椬ޤޤޤJavadocޥɤμ¹Ԥ򻲾ȤƤ +使用している\fIjavadoc\fRコマンドのバージョンを確認するには\fI\-version\fRオプションを使用します。出力ストリームには標準ドックレットのバージョン番号が含まれます。Javadocコマンドの実行を参照してください。 .sp .if n \{\ .RS 4 @@ -2644,76 +2644,76 @@ Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode) .RE .\} .RE -.SS "ɸɥååȤΥץ" +.SS "標準ドックレットのオプション" .PP \-d \fIdirectory\fR .RS 4 -\fIjavadoc\fRޥɤ줿HTMLե¸ǥ쥯ȥꤷޤ\fI\-d\fRץάȡեϸߤΥǥ쥯ȥ¸ޤ\fIdirectory\fRͤˤϡХǥ쥯ȥꡢޤϸߤκȥǥ쥯ȥ꤫Хǥ쥯ȥǤޤJava SE 1\&.4Ǥϡ\fIjavadoc\fRޥɤ¹Ԥǥ쥯ȥ꤬ưŪ˺ޤ +\fIjavadoc\fRコマンドが生成されたHTMLファイルを保存する生成先ディレクトリを指定します。\fI\-d\fRオプションを省略すると、ファイルは現在のディレクトリに保存されます。\fIdirectory\fRの値には、絶対ディレクトリ、または現在の作業ディレクトリからの相対ディレクトリを指定できます。Java SE 1\&.4では、\fIjavadoc\fRコマンドを実行すると生成先ディレクトリが自動的に作成されます。 .sp -ȤСǤϡ\fIcom\&.mypackage\fRѥåΥɥȤ졢η̤\fI/user/doc/ \fRǥ쥯ȥ¸ޤ\fIjavadoc \-d \fR\fI/user/doc/ \fR\fIcom\&.mypackage\fR +たとえば、次の例では、\fIcom\&.mypackage\fRパッケージのドキュメントが生成され、その結果が\fI/user/doc/ \fRディレクトリに保存されます。\fIjavadoc \-d \fR\fI/user/doc/ \fR\fIcom\&.mypackage\fR .RE .PP \-use .RS 4 -ɥȲ륯饹ӥѥåȤ1ĤλѥڡȤ߹ߤޤΥڡˤϡΥ饹ޤϥѥåAPIѤƤѥå饹᥽åɡ󥹥ȥ饯ӥեɤҤޤȤС饹CˤȤȡ饹CѤƤΤȤƤϡCΥ֥饹CȤƤեɡC֤᥽åɡӷCΥѥ᡼ĥ᥽åɤȥ󥹥ȥ饯ޤȤС\fIString\fRѤλѥڡɽǤޤ\fIjava\&.awt\&.Font\fR饹\fIgetName\fR᥽åɤ\fIString\fR᤹Τǡ\fIgetName\fR᥽åɤ\fIString\fRѤ\fIgetName\fR᥽åɤ\fIString\fRѤλѥڡɽޤϼǤϤʤAPIλѤΤߤɥȲޤ᥽åɤμ\fIString\fRѤ뤬Ȥʸʤޤʸ֤ʤ硢\fIString\fRλѤȤϤߤʤޤ줿ѥڡ˥ˤϡ饹ޤϥѥå˰ưʥӥ󡦥С\fB󥯤λ\fR򥯥åޤ +ドキュメント化されるクラスおよびパッケージごとに1つの使用ページを組み込みます。このページには、その特定のクラスまたはパッケージのAPIを使用しているパッケージ、クラス、メソッド、コンストラクタ、およびフィールドが記述されます。たとえば、クラスCを例にとると、クラスCを使用しているものとしては、Cのサブクラス、Cとして宣言されているフィールド、Cを返すメソッド、および型Cのパラメータを持つメソッドとコンストラクタがあります。たとえば、\fIString\fR型用の使用ページを表示できます。\fIjava\&.awt\&.Font\fRクラスの\fIgetName\fRメソッドは\fIString\fR型を戻すので、\fIgetName\fRメソッドは\fIString\fRを使用し、\fIgetName\fRメソッドが\fIString\fR用の使用ページに表示されます。これは実装ではなくAPIの使用のみをドキュメント化します。メソッドがその実装で\fIString\fRを使用するが、引数として文字列を取らない、または文字列を返さない場合、それは\fIString\fRの使用とはみなされません。生成された使用ページにアクセスするには、クラスまたはパッケージに移動し、ナビゲーション・バーの\fBリンクの使用\fRをクリックします。 .RE .PP \-version .RS 4 -ɥȤˡ@versionΥƥȤȤ߹ߤޤΥƥȤϡǥեȤǤϾάޤѤƤ\fIjavadoc\fRޥɤΥСǧˤ\fI\-J\-version\fRץѤޤ +生成ドキュメントに、@versionのテキストを組み込みます。このテキストは、デフォルトでは省略されます。使用している\fIjavadoc\fRコマンドのバージョンを確認するには\fI\-J\-version\fRオプションを使用します。 .RE .PP \-author .RS 4 -ɥȤˡ\fI@author\fRΥƥȤȤ߹ߤޤ +生成ドキュメントに、\fI@author\fRのテキストを組み込みます。 .RE .PP \-splitindex .RS 4 -ե򥢥ե٥åȤȤʣΥեʬ䤷ʸȤ1ĤΥեȡե٥åȰʳεǻϤޤȥѤ1ĤΥեޤ +索引ファイルをアルファベットごとに複数のファイルに分割し、文字ごとに1つのファイルと、アルファベット以外の記号で始まる索引エントリ用に1つのファイルを作成します。 .RE .PP \-windowtitle \fItitle\fR .RS 4 -HTML\fI<title>\fR֤륿ȥꤷޤ\fItitle\fR˻ꤷƥȤϡɥΥȥ䡢ΥڡФƺ줿֥饦Υ֥åޡ()ɽޤΥȥˤHTMLޤʤǤȥHTMLޤޤƤȡ֥饦Ǥޤ\fItitle\fRŰϥʸѤƥޡޤ\fI\-windowtitle\fRץάȡ\fIjavadoc\fRޥɤϡ\fI\-windowtitle\fRץΤˡ\fI\-doctitle\fRץͤѤޤȤС\fIjavadoc \-windowtitle "Java SE Platform" com\&.mypackage\fRǤ +HTMLの\fI<title>\fRタグに配置するタイトルを指定します。\fItitle\fRタグに指定したテキストは、ウィンドウのタイトルや、このページに対して作成されたブラウザのブックマーク(お気に入り)に表示されます。このタイトルにはHTMLタグを含めないでください。タイトルにHTMLタグが含まれていると、ブラウザがタグを正しく解釈できません。\fItitle\fRタグ内の内部の二重引用符はエスケープ文字を使用してマークします。\fI\-windowtitle\fRオプションを省略すると、\fIjavadoc\fRコマンドは、\fI\-windowtitle\fRオプションのかわりに、\fI\-doctitle\fRオプションの値を使用します。たとえば、\fIjavadoc \-windowtitle "Java SE Platform" com\&.mypackage\fRです。 .RE .PP \-doctitle \fItitle\fR .RS 4 -ץޥ꡼եκǾζ᤯֤륿ȥꤷޤ\fItitle\fR˻ꤷƥȤ·ˤʤꡢ٥1θФȤơʥӥ󡦥СΤ֤ޤ\fItitle\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢ȥǰϤɬפޤ\fItitle\fRǰѤϡפɬפޤȤС\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRǤ +概要サマリー・ファイルの最上部の近くに配置するタイトルを指定します。\fItitle\fRタグに指定したテキストは中央揃えになり、レベル1の見出しとして、上部ナビゲーション・バーのすぐ下に置かれます。\fItitle\fRタグにはHTMLタグおよび空白文字を含めることができますが、その場合、タイトルを引用符で囲む必要があります。\fItitle\fRタグの内部で引用符を使用する場合は、エスケープする必要があります。たとえば、\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRです。 .RE .PP \-title \fItitle\fR .RS 4 -Ǥ¸ߤޤJavadoc 1\&.2Υ١Ǥˤ¸ߤƤޤǤΥץϡ\fI\-doctitle\fRȤ̾ѹޤ̾ѹͳϡΥץ󤬡ɥΥȥǤϤʤɥȤΥȥ뤳ȤΤˤ뤿Ǥ +すでに存在しません。Javadoc 1\&.2のベータ版にしか存在していませんでした。このオプションは、\fI\-doctitle\fRという名前に変更されました。名前を変更した理由は、このオプションが、ウィンドウのタイトルではなくドキュメントのタイトルを定義することを明確にするためです。 .RE .PP \-header \fIheader\fR .RS 4 -ƽϥեκǾ֤إåƥȤꤷޤإåϡʥӥ󡦥Сα֤ޤ\fIheader\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢\fIheader\fRǰϤɬפޤإåΰˤϥʸѤޤȤС\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRǤ +各出力ファイルの最上部に配置するヘッダー・テキストを指定します。ヘッダーは、ナビゲーション・バーの右上に配置されます。\fIheader\fRにはHTMLタグおよび空白文字を含めることができますが、その場合、\fIheader\fRを引用符で囲む必要があります。ヘッダー内部の引用符にはエスケープ文字を使用します。たとえば、\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRです。 .RE .PP \-footer \fIfooter\fR .RS 4 -ƽϥեκDz֤եåƥȤꤷޤ\fIfooter\fRͤϡʥӥ󡦥Сα֤ޤ\fIfooter\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢\fIfooter\fRǰϤɬפޤեåΰˤϥʸѤޤ +各出力ファイルの最下部に配置するフッター・テキストを指定します。\fIfooter\fRの値は、ナビゲーション・バーの右下に配置されます。\fIfooter\fRにはHTMLタグおよび空白文字を含めることができますが、その場合、\fIfooter\fRを引用符で囲む必要があります。フッター内部の引用符にはエスケープ文字を使用します。 .RE .PP \-top .RS 4 -ƽϥեκǾ֤ƥȤꤷޤ +各出力ファイルの最上部に配置するテキストを指定します。 .RE .PP \-bottom \fItext\fR .RS 4 -ƽϥեκDz֤ƥȤꤷޤΥƥȤϡʥӥ󡦥С겼ΡڡκDz֤ޤƥȤˤHTMLӶʸޤ뤳ȤǤޤξ硢ƥȤǰϤɬפޤƥΰˤϥʸѤޤ +各出力ファイルの最下部に配置するテキストを指定します。このテキストは、下部ナビゲーション・バーより下の、ページの最下部に配置されます。テキストにはHTMLタグおよび空白文字を含めることができますが、その場合、テキストを引用符で囲む必要があります。テキスト内部の引用符にはエスケープ文字を使用します。 .RE .PP \-link \fIextdocURL\fR .RS 4 -¸Javadocˤ줿ȥ饹ΥɥȤؤΥ󥯤ޤ\fIextdocURL\fRϡȤƻꤹ롢Javadocˤ줿ɥȤޤǥ쥯ȥURLޤURLǤꤷ\fIjavadoc\fRޥɤμ¹Ԥǡʣ\fI\-link\fRץꤷʣΥɥȤؤΥ󥯤Ǥޤ +既存のJavadocにより生成された外部参照クラスのドキュメントへのリンクを作成します。\fIextdocURL\fR引数は、リンク先として指定する、Javadocにより生成された外部ドキュメントを含むディレクトリの絶対URLまたは相対URLです。指定した\fIjavadoc\fRコマンドの実行で、複数の\fI\-link\fRオプションを指定して複数のドキュメントへのリンクを作成できます。 .sp -Υǥ쥯ȥpackage\-listե뤬¸ߤɬפޤ(¸ߤʤϡ\fI\-linkoffline\fRץѤޤ)\fIjavadoc\fRޥɤϡpackage\-listե뤫ѥå̾ɤ߼ä塢URLǤΥѥå˥󥯤ޤ\fIjavadoc\fRޥɤμ¹Իˡ\fIextdocURL\fRͤ줿\fI<A HREF>\fR˥ԡޤäơ\fIextdocURL\fRϥեǤϤʤǥ쥯ȥؤURLǤɬפޤ\fIextdocURL\fRХ󥯤Ѥȡ桼ΥɥȤǤդWebȾΥɥȤ˥󥯤Ǥޤа֤إ󥯤ΤߤξХ󥯤ѤǤޤХ󥯤Ѥ硢Ϥͤϰǥ쥯ȥ꤫顢󥯤Ƥѥåޤǥ쥯ȥؤǤɬפޤ(\fI\-d\fRץǻ)Х󥯤ꤹ硢̾HTTP󥯤ѤޤWebСʤե롦ƥ˥󥯤ϡե롦󥯤ѤǤޤ줿ɥơ˥Ʊե롦ƥͭˤΤߥե롦󥯤Ѥޤɤξ⡢ɤΥڥ졼ƥ󥰡ƥǤ⡢URLФޤФΤǤ⡢ޤ\fIh\fR\fIttp:\fRޤ\fIf\fR\fIile:\fRΤǤ⡢URL: Uniform Resource Locators -(http://www\&.ietf\&.org/rfc/rfc1738\&.txt)˻ꤵƤȤꡢڤʸȤƥåѤޤ +このディレクトリ内にpackage\-listファイルが存在する必要があります(存在しない場合は、\fI\-linkoffline\fRオプションを使用します)。\fIjavadoc\fRコマンドは、package\-listファイルからパッケージ名を読み取った後、そのURLでこれらのパッケージにリンクします。\fIjavadoc\fRコマンドの実行時に、\fIextdocURL\fRの値が、作成された\fI<A HREF>\fRリンク内にコピーされます。したがって、\fIextdocURL\fRはファイルではなくディレクトリへのURLである必要があります。\fIextdocURL\fRに絶対リンクを使用すると、ユーザーのドキュメントを任意のWebサイト上のドキュメントにリンクできます。相対位置へリンクするのみの場合は相対リンクを使用できます。相対リンクを使用する場合、渡す値は宛先ディレクトリから、リンクされているパッケージを含むディレクトリへである必要があります(\fI\-d\fRオプションで指定)。絶対リンクを指定する場合、通常、HTTPリンクを使用します。ただし、Webサーバーを持たないファイル・システムにリンクする場合は、ファイル・リンクを使用できます。生成されたドキュメンテーションにアクセスする全員が同じファイル・システムを共有する場合にのみファイル・リンクを使用します。どの場合も、どのオペレーティング・システムでも、URLが絶対または相対のいずれでも、また\fIh\fR\fIttp:\fRまたは\fIf\fR\fIile:\fRのいずれでも、URLメモ: Uniform Resource Locators +(http://www\&.ietf\&.org/rfc/rfc1738\&.txt)に指定されているとおり、区切り文字としてスラッシュを使用します。 .sp .if n \{\ .RS 4 @@ -2727,8 +2727,8 @@ HTML .RE .\} .RE -\-linkoffline\-linkץΰ㤤.PP -ξˡ\fI\-link\fRץѤޤ +\-linkofflineおよび\-linkオプションの違い.PP +次の場合に、\fI\-link\fRオプションを使用します。 .sp .RS 4 .ie n \{\ @@ -2738,7 +2738,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -APIɥȤؤХѥѤ硣 +外部APIドキュメントへの相対パスを使用する場合。 .RE .sp .RS 4 @@ -2749,14 +2749,14 @@ HTML .sp -1 .IP \(bu 2.3 .\} -APIɥȤؤURLѤ(URL³ɼԤȤˤäƵĤƤ) +外部APIドキュメントへの絶対URLを使用する場合(そのURLに接続し、読取りを行うことがシェルによって許可されている場合)。 .RE .PP -APIɥȤؤURLѤ(URL³ɼԤȤˤäƵĤƤʤ)\fI\-linkoffline\fRץѤޤΤ褦ʾϡե¦եγ¦ˤɥȤ˥󥯤褦Ȥȯޤ +外部APIドキュメントへの絶対URLを使用する場合(そのURLに接続し、読取りを行うことがシェルによって許可されていない場合)は\fI\-linkoffline\fRオプションを使用します。このような状況は、ファイアウォールの内側からファイアウォールの外側にあるドキュメントにリンクしようとする場合に発生します。 .PP -\fBExample 1\fR, ɥȤؤХ +\fBExample 1\fR, 外部ドキュメントへの絶対リンク .RS 4 -http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html˼褦ʡ\fIjava\&.lang\fR\fIjava\&.io\fRӤ¾Javaץåȥեࡦѥå˥󥯤硢ΥޥɤѤޤ +http://docs\&.oracle\&.com/javase/8/docs/api/index\&.htmlに示すような、\fIjava\&.lang\fR、\fIjava\&.io\fRおよびその他のJavaプラットフォーム・パッケージにリンクする場合、次のコマンドを使用します .sp .if n \{\ .RS 4 @@ -2767,37 +2767,37 @@ javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage .if n \{\ .RE .\} -ΥޥɤϡJava SEץåȥեࡦѥåؤΥ󥯻\fIcom\&.mypackage\fRѥåΥɥȤޤɥȤˤϡȤХ饹\fItrees\fR\fIObject\fR饹ؤΥ󥯤ޤޤƤޤ\fI\-sourcepath\fR\fI\-d\fRʤɤ¾Υץɽޤ +このコマンドは、Java SEプラットフォーム・パッケージへのリンク持つ\fIcom\&.mypackage\fRパッケージのドキュメントを生成します。生成ドキュメントには、たとえばクラス\fItrees\fR内の\fIObject\fRクラスへのリンクが含まれています。\fI\-sourcepath\fRや\fI\-d\fRなどの他のオプションは表示されません。 .RE .PP -\fBExample 2\fR, ɥȤؤХ +\fBExample 2\fR, 外部ドキュメントへの相対リンク .RS 4 -Ǥϡ2ĤΥѥåꡢΥɥȤ\fIjavadoc\fRޥɤʣ¹Ԥ줿ΤǤˡΥɥȤХѥʬ䤵ƤޤѥåϡAPIǤ\fIcom\&.apipackage\fRȡSPI(ӥץХ󥿥ե)Ǥc\fIom\&.spipackage\fRǤɥȤγǼϡdocs/api/com/apipackagedocs/spi/com/spipackageǤAPIѥåΥɥȤϤǤƤơdocsߤΥǥ쥯ȥǤ硢APIɥȤؤΥ󥯤SPIѥåɥȲˤϡΥޥɤ¹Ԥޤ\fIjavadoc \-d \&./spi \-link \&.\&./api com\&.spipackage\fR +この例では、2つのパッケージがあり、そのドキュメントは\fIjavadoc\fRコマンドを複数回実行した結果生成されたものです。さらに、これらのドキュメントは相対パスで分割されています。パッケージは、APIである\fIcom\&.apipackage\fRと、SPI(サービス・プロバイダ・インタフェース)であるc\fIom\&.spipackage\fRです。ドキュメントの格納先は、docs/api/com/apipackageとdocs/spi/com/spipackageです。APIパッケージのドキュメントはすでに生成されていて、docsが現在のディレクトリである場合、APIドキュメントへのリンクを持つSPIパッケージをドキュメント化するには、次のコマンドを実行します。\fIjavadoc \-d \&./spi \-link \&.\&./api com\&.spipackage\fR .sp -\fI\-link\fRץϡǥ쥯ȥ(docs/spi)ХѥǤ +\fI\-link\fRオプションは、宛先ディレクトリ(docs/spi)からの相対パスです。 .RE -.PP -\fI\-link\fRץѤȡɤϻȤƤƤ⡢\fIjavadoc\fRμ¹ԤǤϥɥȲʤ饹˥󥯤Ǥ褦ˤʤޤ󥯤ͭʥڡ˰ưǤ褦ˤˤϡHTMLڡĴ١ξ\fIextdocURL\fR˻ꤹɬפޤˤꡢɥѡƥΥɥơjava\&.*ɥơ(http://docs\&.oracle\&.com)إ󥯤뤳ȤǤޤ\fIjavadoc\fRޥɤǡߤμ¹ԤƤɥơAPIؤΥ󥯤Τߤˤϡ\fI\-link\fRץάޤ\fI\-link\fRץꤷʤȡ\fIjavadoc\fRޥɤϳȤΤΥɥơؤΥ󥯤ޤ󡣥ɥơ¸ߤΤɤޤϤɤ¸ߤΤ狼ʤǤ\fI\-link\fRץǤϡɥơʣξ˥󥯤Ǥޤեν򻲾ȤƤ⤦1ĤӤϡѥååȤδ֤˥󥯤뤳ȤǤΥѥååȤФ\fIjavadoc\fRޥɤ¹Ԥ塢¾ΥѥååȤФ\fIjavadoc\fRޥɤټ¹Ԥȡξåȴ֤Υ󥯤Ǥޤ -饹λˡ.PP -ɽ볰ȥ饹ؤΥ󥯤ξ(ӤΥƥȡ٥ǤϤʤ)饹ϼˡǻȤɬפޤ᥽åɤΤǥ饹򻲾ȤΤߤǤϽʬǤϤޤ\fIimport\fRʸΤ줫ǻȤɬפޤˡ饹\fIjava\&.io\&.File\fR򻲾Ȥˡ򼨤ޤ +注意.PP +\fI\-link\fRオプションを使用すると、コードからは参照されていても、今回の\fIjavadoc\fRの実行ではドキュメント化されないクラスにリンクできるようになります。リンクから有効なページに移動できるようにするには、それらのHTMLページがある場所を調べ、その場所を\fIextdocURL\fRに指定する必要があります。これにより、サードパーティのドキュメンテーションがjava\&.*ドキュメンテーション(http://docs\&.oracle\&.com)へリンクすることができます。\fIjavadoc\fRコマンドで、現在の実行で生成しているドキュメンテーション内のAPIへのリンクのみを作成する場合には、\fI\-link\fRオプションを省略します。\fI\-link\fRオプションを指定しないと、\fIjavadoc\fRコマンドは外部参照のためのドキュメンテーションへのリンクを作成しません。ドキュメンテーションが存在するのかどうか、またはどこに存在するのかがわからないからです。\fI\-link\fRオプションでは、生成ドキュメンテーション内の複数の場所にリンクを作成できます。ソース・ファイルの処理を参照してください。もう1つの用途は、パッケージ・セットの間にクロスリンクを作成することです。一方のパッケージ・セットに対して\fIjavadoc\fRコマンドを実行した後、他方のパッケージ・セットに対して\fIjavadoc\fRコマンドを再度実行すると、両セット間に双方向のリンクを作成できます。 +クラスの参照方法.PP +表示される外部参照クラスへのリンクの場合(およびそのテキスト・ラベルだけではなく)、クラスは次の方法で参照される必要があります。メソッドの本体でクラスを参照するのみでは十分ではありません。\fIimport\fR文、宣言のいずれかで参照する必要があります。次に、クラス\fIjava\&.io\&.File\fRを参照する方法の例を示します。 .PP -٤ƤΥפimportʸξ硣磻ɥɤˤ륤ݡȡ̾ˤŪʥݡȡޤ\fIjava\&.lang\&.*\fRФ뼫ưݡȡ +すべてのタイプのimport文の場合。ワイルドカードによるインポート、名前による明示的なインポート、または\fIjava\&.lang\&.*\fRに対する自動インポート。 .PP -Java SE 1\&.3\&.\fIn\fR1\&.2\&.\fIn\fRǤϡ̾ˤŪʥݡȤΤߵǽޤ磻ɥɤˤ\fIimport\fRʸ⡢\fIimport java\&.lang\&.*\fRμưݡȤⵡǽޤ +Java SE 1\&.3\&.\fIn\fRおよび1\&.2\&.\fIn\fRでは、名前による明示的なインポートのみ機能します。ワイルドカードによる\fIimport\fR文も、\fIimport java\&.lang\&.*\fRの自動インポートも機能しません。 .PP -ξ: +宣言の場合: \fIvoid mymethod(File f) {}\fR .PP -Ȥϡ᥽åɡ󥹥ȥ饯եɡ饹ޤϥ󥿥ե귿ޤϥѥ᡼ס뤤ϼĥޤϥʸˤޤ +参照は、メソッド、コンストラクタ、フィールド、クラスまたはインタフェースの戻り型またはパラメータ・タイプ、あるいは実装、拡張またはスロー文にあります。 .PP -פʷ̤Ȥơ\fI\-link\fRץѤƤ⡢¤Τ˸äɽʤ󥯤¿ȯǽޤƥȤϥϥѡƥȡ󥯤դ줺ɽޤ󥯤ɽٹ𤫤顢Υ󥯤ǧǤޤ饹Ȥˤäƥ󥯤ɲä뤿κǤñˡϤΥ饹򥤥ݡȤ뤳ȤǤ -ѥåꥹ.PP -\fI\-link\fRץˤϡ\fIjavadoc\fRޥɤˤäpackage\-listȤ̾Υե뤬\fI\-link\fRץ˻ꤷURL¸ߤƤ뤳ȤɬפǤpackage\-listեϡξˤɥȲ줿ѥå̾ΥꥹȤäñʥƥȡեǤҤǤϡ\fIjavadoc\fRޥɤϡꤷURLpackage\-listȤ̾Υե򸡺ѥå̾ɤ߼äơURLǤΥѥå˥󥯤ޤ +重要な結果として、\fI\-link\fRオプションを使用しても、この制限のために誤って表示されないリンクが多数発生する可能性があります。テキストはハイパーテキスト・リンクが付けられずに表示されます。リンクが表示する警告から、これらのリンクを認識できます。クラスを正しく参照し、それによってリンクを追加するための最も簡単な方法はそのクラスをインポートすることです。 +パッケージ・リスト.PP +\fI\-link\fRオプションには、\fIjavadoc\fRコマンドによって生成されるpackage\-listという名前のファイルが、\fI\-link\fRオプションに指定したURLに存在していることが必要です。package\-listファイルは、その場所にあるドキュメント化されたパッケージの名前のリストが入った単純なテキスト・ファイルです。前述の例では、\fIjavadoc\fRコマンドは、指定したURLでpackage\-listという名前のファイルを検索し、パッケージ名を読み取って、そのURLでこれらのパッケージにリンクします。 .PP -ȤСJava SE APIΥѥåꥹȤ -http://docs\&.oracle\&.com/javase/8/docs/api/package\-listˤޤ +たとえば、Java SE APIのパッケージ・リストは +http://docs\&.oracle\&.com/javase/8/docs/api/package\-listにあります。 .PP -ΥѥåꥹȤϼΤ褦ƤǻϤޤäƤޤ +このパッケージ・リストは次のような内容で始まっています。 .sp .if n \{\ .RS 4 @@ -2816,20 +2816,20 @@ and so on \&.\&.\&.\&. .RE .\} .PP -\fI\-link\fRץꤻ\fIjavadoc\fR¹Ԥ硢ȥ饹°̾򸫤Ĥȡ̾󥯤ʤǽϤޤ\fI\-link\fRץꤷ硢\fIjavadoc\fRޥɤϡꤵ줿\fIextdocURL\fRξˤpackage\-listեǤΥѥå̾򸡺ޤѥå̾Ĥȡ\fIextdocURL\fR̾ղäޤ +\fI\-link\fRオプションを指定せずに\fIjavadoc\fRを実行した場合、外部参照クラスに属する名前を見つけると、その名前をリンクなしで出力します。一方、\fI\-link\fRオプションを指定した場合、\fIjavadoc\fRコマンドは、指定された\fIextdocURL\fRの場所にあるpackage\-listファイルでそのパッケージ名を検索します。パッケージ名が見つかると、\fIextdocURL\fRが名前の前に付加されます。 .PP -٤ƤΥ󥯤ǽ뤿ˤϡȤΤ٤ƤΥɥȤꤷURL¸ߤɬפޤ\fIjavadoc\fRޥɤϡꤵ줿package\-list¸ߤ뤫ɤΤߤåΥڡ¸ߤ뤫ɤϥåޤ -ʣΥ.PP -ʣ\fI\-link\fRץꤹȡǤդογɥȤؤΥ󥯤ǤޤJavadoc 1\&.2ˤϡʣ\fI\-link\fRץǤʤȤΤԶ礬ޤJavadoc 1\&.2\&.2ǽޤ󥯤볰ɥȤȤˡΤ褦̡Υ󥯡ץꤷޤ\fIjavadoc \-link extdocURL1 \-link extdocURL2 \&.\&.\&. \-link extdocURLn com\&.mypackage\fR -\fIextdocURL1\fR\fIextdocURL2\fR\&.\fI\&.\&. extdocURLn\fRϡ줾쳰ɥȤΥ롼Ȥؤƥ롼Ȥˤϡpackage\-listȤ̾Υե뤬äƤޤ -.PP -˺줿ʣΥɥȤ򥯥󥯤硢֡ȥȥåפɬפˤʤ뤳ȤޤɤΥɥȤˤĤƤpackage\-list¸ߤƤʤϡǽΥɥȤФ\fIjavadoc\fRޥɤ¹Ԥǡ2ܤΥɥȤpackage\-listϤޤ¸ߤƤޤ󡣤äơ󥯤ˤϡ2ܤΥɥȤǡǽΥɥȤʤɬפޤ +すべてのリンクが正しく機能するためには、外部参照のすべてのドキュメントが、指定したURLに存在する必要があります。\fIjavadoc\fRコマンドは、指定されたpackage\-listが存在するかどうかのみをチェックし、これらのページが存在するかどうかはチェックしません。 +複数のリンク.PP +複数の\fI\-link\fRオプションを指定すると、任意の数の外部生成ドキュメントへのリンクを作成できます。Javadoc 1\&.2には、複数の\fI\-link\fRオプションを指定できないという既知の不具合があります。これはJavadoc 1\&.2\&.2で修正されました。リンクする外部ドキュメントごとに、次のように別々のリンク・オプションを指定します。\fIjavadoc \-link extdocURL1 \-link extdocURL2 \&.\&.\&. \-link extdocURLn com\&.mypackage\fR +\fIextdocURL1\fR、\fIextdocURL2\fR、\&.\fI\&.\&. extdocURLn\fRは、それぞれ外部ドキュメントのルートを指し、各ルートには、package\-listという名前のファイルが入っています。 +クロスリンク.PP +以前に作成された複数のドキュメントをクロスリンクする場合、ブートストラップが必要になることがあります。どのドキュメントについてもpackage\-listが存在していない場合は、最初のドキュメントに対して\fIjavadoc\fRコマンドを実行する時点で、2番目のドキュメントのpackage\-listはまだ存在していません。したがって、外部リンクを作成するには、2番目のドキュメントを生成した後で、最初のドキュメントを生成しなおす必要があります。 .PP -ξ硢ǽΥɥŪϡpackage\-list뤳ȤǤ(ѥå̾İƤϼưǺƤ⤫ޤޤ)ˡ2ܤΥɥȤȤγ󥯤ޤɬפʳpackage\-listե뤬¸ߤʤϡ\fIjavadoc\fRޥɤٹ𤬽Ϥޤ +この場合、最初のドキュメント生成の目的は、package\-listを作成することです(パッケージ名を把握している場合は手動で作成してもかまいません)。次に、2番目のドキュメントとその外部リンクを生成します。必要な外部のpackage\-listファイルが存在しない場合は、\fIjavadoc\fRコマンドから警告が出力されます。 .PP \-linkoffline \fIextdocURL packagelistLoc\fR .RS 4 -Υץ\fI\-link\fRץΥХꥨǤξȤ⡢Javadocˤ줿ȥ饹ΥɥȤؤΥ󥯤ޤ\fIjavadoc\fRޥɤWeb³ѤƥɥȤ˥ǤʤȤWebΥɥȤ˥󥯤ˤϡ\fI\-link\fRo\fIffline\fRץѤޤɥȤpackage\-listե˥ǤʤȤޤϤΥե뤬\fIextdocURL\fRǻꤵ줿ˤ¸ߤ\fIpackageListLoc\fRǻǤ̤ξ(̾)¸ߤȤ\fI\-linkoffline\fRץѤޤ\fIextdocURL\fRWorld Wide WebǤǤʤϡ\fI\-linkoffline\fRץꤹ뤳ȤˤꡢɥȤ\fIjavadoc\fRޥɤWeb³ɬפȤ󤬤ʤʤޤ⤦1ĤӤϡɥȤ򹹿뤿βȤƻѤ뤳ȤǤѥåΥåΤФ\fIjavadoc\fRޥɤ¹Ԥ塢ѹΥѥåФƤΤ\fIjavadoc\fRޥɤټ¹Ԥơ줿ե򡢥ꥸʥΥåȤǤ褦ˤޤ򼨤ޤ\fI\-linkoffline\fRץϰ2ļޤ1\fI<a href>\fR󥯤Ȥ߹ޤʸꤷ2package\-listθ\fI\-linkoffline\fRޤ +このオプションは\fI\-link\fRオプションのバリエーションです。両方とも、Javadocにより生成された外部参照クラスのドキュメントへのリンクを作成します。\fIjavadoc\fRコマンドがWeb接続を使用してドキュメントにアクセスできないとき、Web上のドキュメントにリンクするには、\fI\-link\fRo\fIffline\fRオプションを使用します。外部ドキュメントのpackage\-listファイルにアクセスできないとき、またはこのファイルが\fIextdocURL\fRで指定された場所には存在せず、\fIpackageListLoc\fRで指定できる別の場所(通常ローカル)に存在するとき、\fI\-linkoffline\fRオプションを使用します。\fIextdocURL\fRにWorld Wide Web上でしかアクセスできない場合は、\fI\-linkoffline\fRオプションを指定することにより、ドキュメントの生成時に\fIjavadoc\fRコマンドがWebに接続する必要があるという制約がなくなります。もう1つの用途は、ドキュメントを更新するための回避策として使用することです。パッケージのセット全体に対して\fIjavadoc\fRコマンドを実行した後、変更した一部のパッケージに対してのみ\fIjavadoc\fRコマンドを再度実行して、更新されたファイルを、オリジナルのセットに挿入できるようにします。次に例を示します。\fI\-linkoffline\fRオプションは引数を2つ取ります。第1引数は\fI<a href>\fRリンクに組み込まれる文字列を指定し、第2引数はpackage\-listの検索場所を\fI\-linkoffline\fRに伝えます。 .sp .RS 4 .ie n \{\ @@ -2839,7 +2839,7 @@ and so on \&.\&.\&.\&. .sp -1 .IP \(bu 2.3 .\} -\fIextdocURL\fRͤϡȤƻꤹ롢Javadocˤ줿ɥȤޤǥ쥯ȥURLޤURLǤURLξ硢ͤϡǥ쥯ȥ(\fI\-d\fRץǻ)ȤʤѥåΥ롼ȤؤХѥˤɬפޤܺ٤ϡ\fI\-link\fRץ\fIextdocURL\fR򻲾ȤƤ +\fIextdocURL\fRの値は、リンク先として指定する、Javadocにより生成された外部ドキュメントを含むディレクトリの絶対URLまたは相対URLです。相対URLの場合、値は、生成先ディレクトリ(\fI\-d\fRオプションで指定)からリンク先となるパッケージのルートへの相対パスにする必要があります。詳細は、\fI\-link\fRオプションの\fIextdocURL\fRを参照してください。 .RE .sp .RS 4 @@ -2850,16 +2850,16 @@ and so on \&.\&.\&.\&. .sp -1 .IP \(bu 2.3 .\} -\fIpackagelistLoc\fRͤϡɥȤpackage\-listեޤǥ쥯ȥؤΥѥޤURLǤϡURL (http:ޤfile:)Ǥե롦ѥǤ⤫ޤޤ󡣤ޤХѥХѥΤɤǤ⤫ޤޤХѥξϡ\fIjavadoc\fRޥɤ¹Ԥ븽ߤΥǥ쥯ȥ꤫ХѥȤƻꤷޤpackage\-listե̾ޤʤǤ +\fIpackagelistLoc\fRの値は、外部ドキュメントのpackage\-listファイルを含むディレクトリへのパスまたはURLです。これは、URL (http:またはfile:)でもファイル・パスでもかまいません。また、絶対パスと相対パスのどちらでもかまいません。相対パスの場合は、\fIjavadoc\fRコマンドが実行される現在のディレクトリからの相対パスとして指定します。package\-listファイル名を含めないでください。 .sp -ꤷ\fIjavadoc\fRޥɤμ¹Ԥǡʣ\fI\-link\fRץǤޤJavadoc 1\&.2\&.2Ǥϡ\fI\-linkfile\fRץ1󤷤ǤޤǤ +指定した\fIjavadoc\fRコマンドの実行で、複数の\fI\-link\fRオプションを指定できます。Javadoc 1\&.2\&.2より前では、\fI\-linkfile\fRオプションは1回しか指定できませんでした。 .RE .RE -ɥȤؤХ.PP -http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html˼褦ʡ\fIjava\&.lang\fR -\fIjava\&.io\fRӤ¾Java SEѥå˥󥯤ɬפ礬ޤ +外部ドキュメントへの絶対リンク.PP +http://docs\&.oracle\&.com/javase/8/docs/api/index\&.htmlに示すような、\fIjava\&.lang\fR、 +\fIjava\&.io\fRおよびその他のJava SEパッケージにリンクする必要がある場合があります。 .PP -ˤWebޤ󡣤ξ硢Ԥޤ +ただし、シェルにはWebアクセス権がありません。この場合、次を行います。 .sp .RS 4 .ie n \{\ @@ -2869,7 +2869,7 @@ http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html .sp -1 .IP " 1." 4.2 .\} -֥饦package\-listե򳫤ޤ(http://docs\&.oracle\&.com/javase/8/docs/api/package\-list) +ブラウザでpackage\-listファイルを開きます(http://docs\&.oracle\&.com/javase/8/docs/api/package\-list) .RE .sp .RS 4 @@ -2880,10 +2880,10 @@ http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html .sp -1 .IP " 2." 4.2 .\} -ե롦ǥ쥯ȥ¸Υ롦ԡ2\fIpackagelistLoc\fRǻꤷޤǤϡѥåꥹȡեϥȡǥ쥯ȥ(\&.)¸Ƥޤ +ファイルをローカル・ディレクトリに保存し、このローカル・コピーを第2引数\fIpackagelistLoc\fRで指定します。この例では、パッケージ・リスト・ファイルはカレント・ディレクトリ(\&.)に保存されています。 .RE .PP -ΥޥɤϡJava SEץåȥեࡦѥåؤΥ󥯤c\fIom\&.mypackage\fRѥåΥɥȤޤɥȤˤϡȤХ饹\fItrees\fR\fIObject\fR饹ؤΥ󥯤ޤޤƤޤ\fI\-sourcepath\fRʤɡ¾ɬפʥץɽޤ +次のコマンドは、Java SEプラットフォーム・パッケージへのリンクを持つc\fIom\&.mypackage\fRパッケージのドキュメントを生成します。生成ドキュメントには、たとえばクラス\fItrees\fR内の\fIObject\fRクラスへのリンクが含まれています。\fI\-sourcepath\fRなど、他の必要なオプションは表示されません。 .sp .if n \{\ .RS 4 @@ -2894,12 +2894,12 @@ javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.m .if n \{\ .RE .\} -ɥȤؤХ.PP -\fI\-linkoffline\fRХѥȤȤ˻Ѥ뤳ȤϤޤꤢޤͳñǡ̾\fI\-link\fRǴ֤˹礦Ǥ\fI\-linkoffline\fRץѤ硢̾package\-listեϥǡХ󥯤ѤϥΥեʤΤǡ̾\fI\-linkoffline\fRץ2ĤΰˡۤʤѥꤹɬפϤޤ2ĤΰƱξ硢\fI\-link\fRץѤǤޤ -package\-listեμưǤκ.PP -package\-listե뤬ޤ¸ߤʤƤ⡢ɥȤΥΥѥå̾狼äƤϡΥեΥԡưǺ\fIpackagelistLoc\fRǤΥѥꤹ뤳ȤǤޤ\fIcom\&.apipackage\fRǽ줿\fIcom\&.spipackage\fRΥѥåꥹȤ¸ߤʤȤФΥȤƵ󤲤ޤˡϡѥå̾Ϥ狼äƤΤΡޤƤʤɥȤ˥󥯤ɥȤɬפǤޤpackage\-listե뤬ʤJavadoc 1\&.0ޤ1\&.1줿ѥåѤpackage\-listեˤ⡢ˡѤǤޤƱͤˡ2ĤδȤ̤package\-listեͭǤ뤿ᡢ󥯤ꤷɥȤƱ˥꡼뤳Ȥǽˤʤޤ -ʣɥȤؤΥ.PP -ɥȤȤ1\fI\-linkoffline\fRץޤ뤳ȤǤޤ +外部ドキュメントへの相対リンク.PP +\fI\-linkoffline\fRを相対パスとともに使用することはあまりありません。理由は単純で、通常は\fI\-link\fRで間に合うからです。\fI\-linkoffline\fRオプションを使用する場合、通常、package\-listファイルはローカルで、相対リンクを使用する場合はリンク先のファイルもローカルなので、通常は\fI\-linkoffline\fRオプションの2つの引数に、異なるパスを指定する必要はありません。2つの引数が同一の場合、\fI\-link\fRオプションを使用できます。 +package\-listファイルの手動での作成.PP +package\-listファイルがまだ存在しなくても、ドキュメントのリンク先のパッケージ名がわかっている場合は、このファイルのコピーを手動で作成し、\fIpackagelistLoc\fRでそのパスを指定することができます。\fIcom\&.apipackage\fRが最初に生成された時点で\fIcom\&.spipackage\fRのパッケージ・リストが存在しないという前出のケースが一例として挙げられます。この方法は、パッケージ名はわかっているものの、まだ公開されていない、新しい外部ドキュメントにリンクするドキュメントを生成する必要がある場合に便利です。また、package\-listファイルが生成されないJavadoc 1\&.0または1\&.1で生成されたパッケージ用にpackage\-listファイルを作成する場合にも、この方法が使用できます。同様に、2つの企業が未公開のpackage\-listファイルを共有できるため、クロスリンクを設定したドキュメントを同時にリリースすることも可能になります。 +複数ドキュメントへのリンク.PP +参照先の生成ドキュメントごとに1回、\fI\-linkoffline\fRオプションを含めることができます。 .sp .if n \{\ .RS 4 @@ -2911,10 +2911,10 @@ packagelistLoc2 \&.\&.\&. .if n \{\ .RE .\} -ɥȤι.PP -ץȤ˲ޤϲɴΥѥåޤޤˤ⡢\fI\-linkoffline\fRץѤǤޤĥ꡼ΤǤǤ\fIjavadoc\fRޥɤ¹ԤȤ硢ɥơ󡦥Ȥˤ鷺ѹ®˲äĥ꡼ΰ\fIjavadoc\fRޥɤƼ¹Ԥ뤳ȤǤޤ2ܤμ¹Ԥϡɥơ󡦥ȤѹѹʤˤΤ뤳ȤդƤɤФɲáޤѹϡѥåĥ꡼ѾСΥꥹȡѥڡʤɤξǡ󥯤뤳Ȥޤ +ドキュメントの更新.PP +プロジェクトに何十または何百のパッケージが含まれる場合にも、\fI\-linkoffline\fRオプションを使用できます。ソース・ツリー全体ですでに\fIjavadoc\fRコマンドを実行したことがある場合、ドキュメンテーション・コメントにわずかな変更を迅速に加え、ソース・ツリーの一部で\fIjavadoc\fRコマンドを再実行することができます。2回目の実行は、ドキュメンテーション・コメントを変更し、宣言は変更しない場合にのみ正しく処理されることに注意してください。ソース・コードに対して宣言を追加、削除、または変更した場合は、索引、パッケージ・ツリー、継承されるメンバーのリスト、使用ページなどの場所で、リンクが壊れることがあります。 .PP -ޤοϤʼ¹ԤǻѤ롢ǥ쥯ȥ(updateʤ)ޤǤϡǥ쥯ȥ̾htmlǤǤñǤϡhtmlǥ쥯ȥοƥǥ쥯ȥ˰ưޤ\fI\-linkoffline\fRץ1˥ȡǥ쥯ȥ(\&.)ꤷ2package\-listhtmlؤХѥꤷѥåΥѥå̾ΤߤϤޤ +まず、この新しい小規模な実行で使用する、新しい生成先ディレクトリ(updateなど)を作成します。この例では、元の生成先ディレクトリの名前はhtmlです。最も単純な例では、htmlディレクトリの親ディレクトリに移動します。\fI\-linkoffline\fRオプションの第1引数にカレント・ディレクトリ(\&.)を設定し、第2引数にpackage\-listが検索されるhtmlへの相対パスを設定し、更新するパッケージのパッケージ名のみを渡します。 .sp .if n \{\ .RS 4 @@ -2926,15 +2926,15 @@ javadoc \-d update \-linkoffline \&. html com\&.mypackage .RE .\} .PP -\fIjavadoc\fRޥɤνλ塢update/com/package줿饹Υڡ򥳥ԡ(פϽ)html/com/packageθΥե˾񤭤ޤ +\fIjavadoc\fRコマンドの終了後、update/com/package内の生成されたクラスのページをコピーし(概要や索引は除く)、html/com/package内の元のファイルに上書きします。 .PP \-linksource .RS 4 -ƥե(ֹդ)HTMLСɸHTMLɥȤ饽եؤΥ󥯤ɲäޤ󥯤ϡեƤ륯饹󥿥ե󥹥ȥ饯᥽åɡեɤФƺޤǤʤ硢ȤХǥեȡ󥹥ȥ饯줿饹ФƤϡ󥯤Ϻޤ +各ソース・ファイル(行番号付き)のHTMLバージョンを作成し、標準HTMLドキュメントからソース・ファイルへのリンクを追加します。リンクは、ソース・ファイル内に宣言されているクラス、インタフェース、コンストラクタ、メソッド、フィールドに対して作成されます。そうでない場合、たとえばデフォルト・コンストラクタや生成されたクラスに対しては、リンクは作成されません。 .sp -Υץϡ\fI\-public\fR\fI\-package\fR\fI\-protected\fR\fI\-private\fRγƥץȤϴطʤΥ饹եɡΥ᥽åɤΤϤȤȤ߹ޤ줿եΤ٤Ƥξܺ٤ޤ\fI\-private\fRץ⤢碌ƻꤷʤꡢΥ饹䥤󥿥եΰˤϡ󥯤𤷤ƥǤʤȤޤ +このオプションは、\fI\-public\fR、\fI\-package\fR、\fI\-protected\fRおよび\fI\-private\fRの各オプションとは関係なく、非公開のクラス、フィールド、非公開のメソッドの本体をはじめとする組み込まれたソース・ファイル内のすべての非公開実装の詳細を公開します。\fI\-private\fRオプションもあわせて指定しないかぎり、非公開のクラスやインタフェースの一部には、リンクを介してアクセスできないことがあります。 .sp -ƥ󥯤ϡμ̻̾ξ˺ޤȤС\fIButton\fR饹ΥɤؤΥ󥯤ϡ\fIButton\fRȤξ˺ޤ +各リンクは、その宣言内の識別子名の上に作成されます。たとえば、\fIButton\fRクラスのソース・コードへのリンクは、\fIButton\fRという語の上に作成されます。 .sp .if n \{\ .RS 4 @@ -2945,7 +2945,7 @@ public class Button extends Component implements Accessible .if n \{\ .RE .\} -\fIButton\fR饹\fIgetLabel\fR᥽åɤΥɤؤΥ󥯤ϡ\fIgetLabel\fRȤξ˺ޤ +\fIButton\fRクラスの\fIgetLabel\fRメソッドのソース・コードへのリンクは、\fIgetLabel\fRという語の上に作成されます。 .sp .if n \{\ .RS 4 @@ -2960,7 +2960,7 @@ public String getLabel() .PP \-group groupheading \fIpackagepattern:packagepattern\fR .RS 4 -ץڡʣΥѥå򡢻ꤷ롼פʬơ롼פȤɽޤƥ롼פϡ줾̤\fI\-group\fRץǻꤷޤ롼פϡޥɹԤǻꤵ줿ǥڡɽޤѥåϡ롼ǥե٥åȽˤʤäƤޤꤷ\fI\-group\fRץǤϡ\fIpackagepattern\fRΥꥹȤ˰פѥåФȤ\fIgroupheading\fR1Ĥɽɽޤ +概要ページの複数のパッケージを、指定したグループに分けて、グループごとに表を作成します。各グループは、それぞれ別の\fI\-group\fRオプションで指定します。グループは、コマンド行で指定された順序でページに表示されます。パッケージは、グループ内でアルファベット順になっています。指定した\fI\-group\fRオプションでは、\fIpackagepattern\fR式のリストに一致するパッケージが、見出しとして\fIgroupheading\fRを持つ1つの表に表示されます。 .sp .RS 4 .ie n \{\ @@ -2970,7 +2970,7 @@ public String getLabel() .sp -1 .IP \(bu 2.3 .\} -\fIgroupheading\fRˤϡǤդΥƥȤǤޤ뤳ȤǤޤꤷƥȤϡ롼פɽФˤʤޤ +\fIgroupheading\fRには、任意のテキストを指定でき、空白を含めることができます。指定したテキストは、グループの表見出しになります。 .RE .sp .RS 4 @@ -2981,12 +2981,12 @@ public String getLabel() .sp -1 .IP \(bu 2.3 .\} -\fIpackagepattern\fRͤˤϡǤդΥѥå̾ƬʬȤ³1ĤΥꥹ(*)ǤդΥѥå̾ǤޤꥹϻѤǤͣΥ磻ɥɤǡǤդʸ˰פ롢Ȥ̣Ǥ1ĤΥ롼פˤϡ(:)ǶڤäʣΥѥޤ뤳ȤǤޤѥޤϥѥ󡦥ꥹȤǥꥹѤ硢ѥ󡦥ꥹȤ\fI"java\&.lang*:java\&.util"\fRΤ褦˰ǰϤɬפޤ +\fIpackagepattern\fRの値には、任意のパッケージ名の先頭部分とそれに続く1つのアスタリスク(*)で任意のパッケージ名を指定できます。アスタリスクは使用できる唯一のワイルドカードで、任意の文字に一致する、という意味です。1つのグループには、コロン(:)で区切って複数のパターンを含めることができます。パターンまたはパターン・リストでアスタリスクを使用する場合、パターン・リストは\fI"java\&.lang*:java\&.util"\fRのように引用符で囲む必要があります。 .RE .sp -\fI\-group\fRץꤷʤϡФ\fIPackages\fRŬڤʾФ1ĤΥ롼פ֤ޤФˤ٤ƤΥɥȲѥå(٤ƤΥ롼)ޤޤ櫓ǤϤʤ硢ĤΥѥåϡ֤¾ΥѥåפȤָФΩ롼פޤ +\fI\-group\fRオプションを指定しない場合は、見出し\fIPackages\fRおよび適切な小見出しを持つ1つのグループに配置されます。小見出しにすべてのドキュメント化されるパッケージ(すべてのグループ)が含まれるわけではない場合、残りのパッケージは「その他のパッケージ」というサブ見出しを持つ独立したグループに入れられます。 .sp -ȤС\fIjavadoc\fRޥɤǤϡ3ĤΥɥȲ줿ѥå\fI֥\fR\fIֳĥ\fR\fI֤¾Υѥå\fRʬޤ\fIjava\&.lang*\fRǤϡǸΥɥå(\&.)ꤷƤޤ\fIjava\&.lang\&.*\fRΤ褦˥ɥåȤȡ\fI java\&.lang\fRѥåϽ뤳Ȥˤʤޤ +たとえば、次の\fIjavadoc\fRコマンドでは、3つのドキュメント化されたパッケージが\fI「コア」\fR、\fI「拡張」\fRおよび\fI「その他のパッケージ」\fRに分けられます。\fIjava\&.lang*\fRでは、最後のドット(\&.)を指定していません。\fIjava\&.lang\&.*\fRのようにドットを入れると、\fI java\&.lang\fRパッケージは除外されることになります。 .sp .if n \{\ .RS 4 @@ -2999,7 +2999,7 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .if n \{\ .RE .\} -\fBѥå\fR +\fBコア・パッケージ\fR .sp \fIjava\&.lang\fR .sp @@ -3007,7 +3007,7 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .sp \fIjava\&.util\fR .sp -\fBĥǽѥå\fR +\fB拡張機能パッケージ\fR .sp \fIjavax\&.servlet\fR .sp @@ -3018,42 +3018,42 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .PP \-nodeprecated .RS 4 -侩APIɥȤʤ褦ˤޤΥץꤹȡ\fI\-nodeprecatedlist\fRץꤷƱ̤ꡢɥȤ¾ʬΤǤ⡢侩APIޤ󡣤Υץϡɤ򵭽ҤƤȤ侩ΥɤˤäƵ򻶤餵줿ʤǤ +非推奨のAPIをドキュメントに生成しないようにします。このオプションを指定すると、\fI\-nodeprecatedlist\fRオプションを指定した場合と同じ効果があり、ドキュメントの他の部分全体でも、非推奨のAPIが生成されません。このオプションは、コードを記述しているとき、非推奨のコードによって気を散らされたくない場合に便利です。 .RE .PP \-nodeprecatedlist .RS 4 -侩APIΥꥹȤޤե(deprecated\-list\&.html)ӥʥӥ󡦥СΤΥڡؤΥ󥯤ʤ褦ˤޤ\fIjavadoc\fRޥɤǤϡ³ɥȤ¾ʬǤϡ侩APIޤΥץϡ侩APIɤ˴ޤޤƤ餺ʥӥ󡦥С򤹤äȸǤ +非推奨のAPIのリストを含むファイル(deprecated\-list\&.html)、およびナビゲーション・バーのそのページへのリンクが生成されないようにします。\fIjavadoc\fRコマンドでは、引き続き、ドキュメントの他の部分では、非推奨のAPIが生成されます。このオプションは、非推奨のAPIがソース・コードに含まれておらず、ナビゲーション・バーをすっきりと見せる場合に便利です。 .RE .PP \-nosince .RS 4 -ɥȤ顢\fI@since\fR˴Ϣդ줿\fIƳ줿С\fRάޤ +生成ドキュメントから、\fI@since\fRタグに関連付けられた\fI「導入されたバージョン」\fRセクションを省略します。 .RE .PP \-notree .RS 4 -ɥȤ顢饹ӥ󥿥եγإڡάޤΥڡˤϡʥӥ󡦥СΡֳإĥ꡼ץܥ󤫤饢ǤޤǥեȤǤϡؤޤ +生成ドキュメントから、クラスおよびインタフェースの階層ページを省略します。これらのページには、ナビゲーション・バーの「階層ツリー」ボタンからアクセスできます。デフォルトでは、階層が生成されます。 .RE .PP \-noindex .RS 4 -ɥȤ顢άޤǥեȤǤϡޤ +生成ドキュメントから、索引を省略します。デフォルトでは、索引が生成されます。 .RE .PP \-nohelp .RS 4 -ϤγƥڡκǾȺDzˤʥӥ󡦥С֥إסץ󥯤άޤ +出力の各ページの最上部と最下部にあるナビゲーション・バーから「ヘルプ」リンクを省略します。 .RE .PP \-nonavbar .RS 4 -̾ڡκǾȺDzɽʥӥ󡦥Сإåӥեåʤ褦ˤޤ\fI\-nonavbar\fRץ\fI\-bottom\fRץ˱ƶͿޤ\fI\-nonavbar\fRץϡ뤿ˤΤߥեPostScriptPDFѴʤɡƤΤߤפǡʥӥɬפʤǤ +通常、生成されるページの最上部と最下部に表示されるナビゲーション・バー、ヘッダー、およびフッターを生成しないようにします。\fI\-nonavbar\fRオプションは\fI\-bottom\fRオプションに影響を与えません。\fI\-nonavbar\fRオプションは、印刷するためにのみファイルをPostScriptやPDFに変換する場合など、内容のみが重要で、ナビゲーションの必要がない場合に便利です。 .RE .PP \-helpfile \fIpath\efilename\fR .RS 4 -ǾӺDzΥʥӥ󡦥СΡ֥إסץ󥯤ΥȤʤإإסեpath\efilenameΥѥꤷޤΥץ󤬻ꤵƤʤȡ\fIjavadoc\fRޥɤϡ\fIjavadoc\fRޥǥϡɥɤƤإסեhelp\-doc\&.htmlưޤΥץѤȡǥեȤ򥪡С饤ɤǤޤե̾ˤϤɤ̾ǤǤhelp\-doc\&.html˸ꤵޤ\fIjavadoc\fRޥɤϡΤ褦ˡʥӥ󡦥СΥ󥯤ɬפ˱Ĵޤ +最上部および最下部のナビゲーション・バーの「ヘルプ」リンクのリンク先となる代替ヘルプ・ファイルpath\efilenameのパスを指定します。このオプションが指定されていないと、\fIjavadoc\fRコマンドは、\fIjavadoc\fRコマンド内でハードコードされているヘルプ・ファイルhelp\-doc\&.htmlを自動作成します。このオプションを使用すると、デフォルトをオーバーライドできます。ファイル名にはどんな名前でも指定でき、help\-doc\&.htmlに限定されません。\fIjavadoc\fRコマンドは、次の例のように、ナビゲーション・バー内のリンクを必要に応じて調整します。 .sp .if n \{\ .RS 4 @@ -3068,7 +3068,7 @@ javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&. .PP \-stylesheet \fIpath/filename \fR .RS 4 -HTML륷ȡեΥѥꤷޤΥץ󤬻ꤵƤʤȡ\fIjavadoc\fRޥɤϡ\fIjavadoc\fRޥǥϡɥɤƤ륹륷ȡեstylesheet\&.cssưޤΥץѤȡǥեȤ򥪡С饤ɤǤޤե̾ˤϤɤ̾ǤǤstylesheet\&.css˸ꤵޤ +代替HTMLスタイルシート・ファイルのパスを指定します。このオプションが指定されていないと、\fIjavadoc\fRコマンドは、\fIjavadoc\fRコマンド内でハードコードされているスタイルシート・ファイルstylesheet\&.cssを自動作成します。このオプションを使用すると、デフォルトをオーバーライドできます。ファイル名にはどんな名前でも指定でき、stylesheet\&.cssに限定されません。 .sp .if n \{\ .RS 4 @@ -3083,15 +3083,15 @@ javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage .PP \-serialwarn .RS 4 -\fI@serial\fRʤϡѥ˷ٹޤǥեȤǤϡJavadoc 1\&.2\&.2ʹߤǤϡľ󲽤ηٹޤ󡣰Υ꡼ȤϵդưǤΥץѤȡľ󲽤ηٹɽΤǡǥեȤľ󲽲ǽեɤ\fIwriteExternal\fR᥽åɤŬڤ˥ɥȲΤΩޤ +\fI@serial\fRタグがない場合は、コンパイル時に警告を生成します。デフォルトでは、Javadoc 1\&.2\&.2以降では、直列化の警告は生成されません。以前のリリースとは逆の動作です。このオプションを使用すると、直列化の警告が表示されるので、デフォルトの直列化可能フィールドと\fIwriteExternal\fRメソッドを適切にドキュメント化するのに役立ちます。 .RE .PP \-charset \fIname\fR .RS 4 -ΥɥѤHTMLʸåȤꤷޤ̾ϡIANA RegistryCharacter Sets -(http://www\&.iana\&.org/assignments/character\-sets)˼줿ͥMIME̾Ǥɬפޤ +このドキュメント用のHTML文字セットを指定します。この名前は、IANA RegistryのCharacter Sets +(http://www\&.iana\&.org/assignments/character\-sets)に示された、優先MIME名である必要があります。 .sp -ȤС\fIjavadoc \-charset "iso\-8859\-1" mypackage\fRϼιԤ줿ƥڡΥإåޤ +たとえば、\fIjavadoc \-charset "iso\-8859\-1" mypackage\fRは次の行を生成された各ページのヘッダーに挿入します。 .sp .if n \{\ .RS 4 @@ -3102,24 +3102,24 @@ javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage .if n \{\ .RE .\} -\fIMETA\fRϡHTMLɸ(41972654137321)HTML Document Representation -(http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2)˵ܤƤޤ +この\fIMETA\fRタグは、HTML標準(4197265および4137321)のHTML Document Representation +(http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2)に記載されています。 .sp -ӥץ⻲ȤƤ +およびオプションも参照してください。 .RE .PP \-docencoding \fIname\fR .RS 4 -HTMLեΥ󥳡ǥ󥰤ꤷޤ̾ϡIANA RegistryCharacter Sets -(http://www\&.iana\&.org/assignments/character\-sets)˼줿ͥMIME̾Ǥɬפޤ +生成されるHTMLファイルのエンコーディングを指定します。この名前は、IANA RegistryのCharacter Sets +(http://www\&.iana\&.org/assignments/character\-sets)に示された、優先MIME名である必要があります。 .sp -\fI\-docencoding\fRץά\fI\-encoding\fRץѤȡ줿HTMLեΰŹ沽\fI\-encoding\fRץꤵޤ: -\fIjavadoc \-docencoding"iso\-8859\-1" mypackage\fRӥץ⻲ȤƤ +\fI\-docencoding\fRオプションを省略し、\fI\-encoding\fRオプションを使用すると、生成されたHTMLファイルの暗号化は\fI\-encoding\fRオプションで特定されます。例: +\fIjavadoc \-docencoding"iso\-8859\-1" mypackage\fRおよびオプションも参照してください。 .RE .PP \-keywords .RS 4 -HTML<META>򡢥饹ȤեɲäޤΥϡ<META>򸡺륵󥸥󤬥ڡ򸫤ĤΩޤ󥿡ͥåΤ򸡺븡󥸥ΤۤȤɤ<META>򻲾Ȥޤ󡣥ڡѤƤǽ뤫ǤȤWebȤؤθ¤롢Ȥˤ󶡤븡󥸥ϡ<META>򻲾Ȥ뤳ȤDzä뤳ȤǤޤ<META>ˤϡ饹δ̾ȡեɤӥ᥽åɤνƤʤ̾ޤޤޤ󥹥ȥ饯ϡ饹̾ƱǤ뤿ޤޤޤ󡣤ȤС饹\fIString\fRϼΥɤdzϤޤ +HTMLキーワード<META>タグを、クラスごとに生成されるファイルに追加します。これらのタグは、<META>タグを検索するサーチ・エンジンがページを見つける場合に役立ちます。インターネット全体を検索する検索エンジンのほとんどは<META>タグを参照しません。ページが誤用している可能性があるからです。自身のWebサイトへの検索を制限する、企業により提供される検索エンジンは、<META>タグを参照することで恩恵を受けることができます。<META>タグには、クラスの完全修飾名と、フィールドおよびメソッドの修飾されていない名前が含まれます。コンストラクタは、クラス名と同じであるため含まれません。たとえば、クラス\fIString\fRは次のキーワードで開始します。 .sp .if n \{\ .RS 4 @@ -3137,42 +3137,42 @@ HTML .PP \-tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR" .RS 4 -\fIjavadoc\fRޥɤɥơ󡦥ΰ1ļñʥࡦ֥å\fI@tagname\fRǤ褦ˤޤˤꡢ\fIjavadoc\fRޥɤϥ̾ΥڥåԤȤǤΤǡ¸ߤ뤹٤ƤΥࡦˤĤơ\fI\-tag\fRץȤ߹ळȤפǤμ¹ԤǤϽϤʤϡ\fIX\fRդ̵ˤޤ\fI\-tag\fRץϡθФ\fItaghead\fRǽϤޤμιԤˤϡΥץ1ĤΰǻꤷƥȤ³ޤ֥åƱ͡ΰΥƥȤˤϥ饤󡦥ޤ뤳ȤǤޤΥ饤󡦥ᤵޤϤϡ1ļɸΥ(\fI@return\fR\fI@author\fRʤ)νϤȤ褯Ƥޤ\fItaghead\fRͤάȡ\fItagname\fRФȤɽޤ +\fIjavadoc\fRコマンドがドキュメンテーション・コメント内の引数を1つ取る単純なカスタム・ブロック・タグ\fI@tagname\fRを解釈できるようにします。これにより、\fIjavadoc\fRコマンドはタグ名のスペルチェックを行うことができるので、ソース・コード内に存在するすべてのカスタム・タグについて、\fI\-tag\fRオプションを組み込むことが重要です。今回の実行では出力されないタグは、\fIX\fRを付けて無効にします。\fI\-tag\fRオプションは、タグの見出し\fItaghead\fRを太字で出力します。その次の行には、このオプションの1つの引数で指定したテキストが続きます。ブロック・タグと同様、この引数のテキストにはインライン・タグを含めることができます。このインライン・タグも解釈されます。出力は、引数を1つ取る標準のタグ(\fI@return\fRや\fI@author\fRなど)の出力とよく似ています。\fItaghead\fRの値を省略すると、\fItagname\fRが見出しとして表示されます。 .sp -\fB\fR: -\fIXaoptcmf\fRˤꡢǥ֤Ǥ꤬ޤꡢ̵ˤǤ뤫ɤ(\fIX\fRѤ)ޤޤְ֤¤ʤ\fIa\fRꤷޤʳʸȹ礻ǽǤ +\fBタグの配置\fR: +\fIXaoptcmf\fR引数により、ソース・コード内でタグを配置できる場所が決まり、タグを無効にできるかどうか(\fIX\fRを使用して)が決まります。タグの配置位置を制限しない場合は\fIa\fRを指定します。それ以外の文字の組合せも可能です。 .sp \fIX\fR -(̵) +(タグの無効化) .sp \fIa\fR -(٤) +(すべて) .sp \fIo\fR -() +(概要) .sp \fIp\fR -(ѥå) +(パッケージ) .sp \fIt\fR -(סĤޤꥯ饹ȥ󥿥ե) +(タイプ、つまりクラスとインタフェース) .sp \fIc\fR -(󥹥ȥ饯) +(コンストラクタ) .sp \fIm\fR -(᥽å) +(メソッド) .sp \fIf\fR -(ե) +(フィールド) .sp -\fB󥰥롦\fR: Ǥդΰ֤ǻѤǤ륿Υץ򼨤ޤ\fI\-tag todo:a:"To Do:"\fR +\fBシングル・タグの例\fR: ソース・コード内の任意の位置で使用できるタグのタグ・オプションの例を示します。\fI\-tag todo:a:"To Do:"\fR .sp -\fI@todo\fR򥳥󥹥ȥ饯᥽åɤӥեɤȤΤ߻Ѥ硢\fI\-tag todo:cmf:"To Do:"\fRѤޤ +\fI@todo\fRタグをコンストラクタ、メソッドおよびフィールドとのみ使用する場合、\fI\-tag todo:cmf:"To Do:"\fRを使用します。 .sp -ǸΥ(:)ϡѥ᡼ڤʸǤϤʤФƥȤΰˤʤäƤޤ\fI@todo\fRޤࡢѤΤ줫ΥץѤޤȤС\fI@todo The documentation for this method needs work\fRǤ +最後のコロン(:)は、パラメータ区切り文字ではなく、見出しテキストの一部になっています。\fI@todo\fRタグを含む、ソース・コード用のいずれかのタグ・オプションを使用します。たとえば、\fI@todo The documentation for this method needs work\fRです。 .sp -\fB̾Υ\fR: ̾ǥѤϥХååѤƥפޤΥɥơ󡦥Ȥˤϡ\fI\-tag ejb\e\e:bean:a:"EJB Bean:"\fRץѤޤ +\fBタグ名内のコロン\fR: タグ名内でコロンを使用する場合はバックスラッシュを使用してエスケープします。次のドキュメンテーション・コメントには、\fI\-tag ejb\e\e:bean:a:"EJB Bean:"\fRオプションを使用します。 .sp .if n \{\ .RS 4 @@ -3185,12 +3185,12 @@ HTML .if n \{\ .RE .\} -\fB̾Υڥå\fR: γȯԤɬϤʤࡦ򥽡֤뤳Ȥޤξ硢Τ٤ƤΥꥹȤϤ륿ͭˤϤʤ̵ˤɬפޤ\fIX\fRꤹȥ̵ˤʤޤꤷʤȡͭˤʤޤˤꡢ\fIjavadoc\fRޥɤϡФϥߥʤɤˤǤ뤫ɤǤޤΤ褦ʾˡ\fIjavadoc\fRޥɤٹ𤬽ϤޤǤ֤Ƥͤ\fIX\fRɲäǤޤƤС\fIX\fRΤߤǥͭˤ뤳ȤǤޤȤС\fI@todo\fRϤ硢\fI\-tag todo:Xcmf:"To Do:"\fRѤޤ˴ñˤ硢\fI\-tag todo:X\fRѤޤʸ\fI\-tag todo:X\fRϡ\fI@todo\fRåȤƤƤⵡǽޤ +\fBタグ名のスペルチェック\fR: 一部の開発者が必ずしも出力しないカスタム・タグをソース・コード内に配置することがあります。この場合、ソース・コード内のすべてのタグをリストし、出力するタグを有効にし、出力しないタグを無効にする必要があります。\fIX\fRを指定するとタグは無効になります。指定しないと、タグは有効になります。これにより、\fIjavadoc\fRコマンドは、検出したタグが入力ミスなどによる不明タグであるかどうかを特定できます。このような場合に、\fIjavadoc\fRコマンドから警告が出力されます。すでに配置されている値に\fIX\fRを追加できます。こうしておけば、\fIX\fRを削除するのみでタグを有効にすることができます。たとえば、\fI@todo\fRタグを出力で抑制する場合、\fI\-tag todo:Xcmf:"To Do:"\fRを使用します。さらに簡単にする場合、\fI\-tag todo:X\fRを使用します。構文\fI\-tag todo:X\fRは、\fI@todo\fRタグがタグレットで定義されていても機能します。 .sp -\fBν\fR: -\fI\-ta\fR\fIg\fR\fI\-taglet\fRץνˤäơνϽ礬ޤޤࡦɸॿȤ߹礻ƻѤ뤳ȤǤޤɸॿΥץϡꤹ뤿Υץ졼ۥǤɸॿ̾ΤߤޤɸॿξФѹǤޤ󡣤򼡤˼ޤ\fI\-tag\fRץꤷʤȡ\fI\-tagle\fR\fIt\fRץΰ֤ˤꡢޤޤξȤ¸ߤ硢ޥɥ饤κǸˤνꤷޤϡ䥿åȤޥɥ饤˻ꤵ줿֤˽뤿ǤȤС\fI\-taglet\fR\fI\-tag\fRץ̾\fItodo\fRͤľ硢ޥɥ饤˺Ǹ˻ꤵ줿Τꤷޤ +\fBタグの順序\fR: +\fI\-ta\fR\fIg\fRおよび\fI\-taglet\fRオプションの順序によって、タグの出力順が決まります。カスタム・タグと標準タグを組み合せて使用することもできます。標準タグのタグ・オプションは、順序を決定するためだけのプレースホルダです。標準タグの名前のみを取ります。標準タグの小見出しは変更できません。これを次の例に示します。\fI\-tag\fRオプションを指定しないと、\fI\-tagle\fR\fIt\fRオプションの位置により、順序が決まります。タグが両方とも存在する場合、コマンドラインの最後にある方がその順序を決定します。これは、タグやタグレットがコマンドラインに指定された順番に処理されるためです。たとえば、\fI\-taglet\fRおよび\fI\-tag\fRオプションが名前\fItodo\fR値を持つ場合、コマンドラインに最後に指定されたものが順序を決定します。 .sp -\fBδåȤ\fR: ǤϡϤParametersThrowsδ֤To Doޤ\fIX\fRѤơ\fI@example\fRκμ¹ԤǤϽϤʤǤ뤳Ȥꤷޤ\fI@argfile\fRѤϡΤ褦ˡե̡ιԤ˥֤Ǥޤ(Ԥη³򼨤ʸ) +\fBタグの完全セットの例\fR: この例では、出力のParametersとThrowsの間にTo Doを挿入します。\fIX\fRを使用して、\fI@example\fRタグが、ソース・コード内の今回の実行では出力されないタグであることも指定します。\fI@argfile\fRタグを使用する場合は、次のように、引数ファイル内の別々の行にタグを配置できます(行の継続を示す文字は不要)。 .sp .if n \{\ .RS 4 @@ -3206,24 +3206,24 @@ HTML .if n \{\ .RE .\} -\fIjavadoc\fRޥɤɥơ󡦥ȤϤݤ˸줿ΤɸॿǤ⡢\fI\-tag\fR\fI\-taglet\fRץϤ줿ǤʤΤϤ٤Ȥߤʤ졢ٹ𤬥ޤ +\fIjavadoc\fRコマンドがドキュメンテーション・コメントを解析する際に検索されたタグのうち、標準タグでも、\fI\-tag\fRや\fI\-taglet\fRオプションで渡されたタグでもないものはすべて不明タグとみなされ、警告がスローされます。 .sp -ɸॿϡǽ顢ǥեȤνǥꥹŪ˳Ǽޤ\fI\-tag\fRץѤȡΥϤΥꥹȤɲäޤɸॿϡǥեȤΰ֤ưޤΤᡢɸॿ\fI\-tag\fRץάȡϥǥեȤΰ֤֤줿ޤޤˤʤޤ +標準タグは、最初、デフォルトの順序でリスト内に内部的に格納されます。\fI\-tag\fRオプションを使用すると、それらのタグはこのリストに追加されます。標準タグは、デフォルトの位置から移動されます。そのため、標準タグの\fI\-tag\fRオプションを省略すると、それはデフォルトの位置に配置されたままになります。 .sp -\fBβ\fR: ֤ͭ̾ˤϡѥå˻ѤƤ\fIcom\&.mycompany\&.todo\fRȤ̾Τ褦ˡɥåȤǶڤ줿̾ѤޤOracleϡ̾˥ɥåȤޤޤʤɸॿޤ桼ϡOracleƱ̾Υư򥪡С饤ɤޤ\fI@todo\fRȤ̾ΥޤϥåȤ桼硢θOracleƱ̾ɸॿƤ⡢ΥޤϥåȤϾ˥桼ΤƱưݻޤ +\fB競合の回避\fR: 固有の名前空間を作成するには、パッケージに使用されている\fIcom\&.mycompany\&.todo\fRという名前のように、ドットで区切られた名前を使用します。Oracleは、今後も名前にドットを含まない標準タグを作成します。ユーザーが作成したタグは、Oracleが定義する同じ名前のタグの動作をオーバーライドします。\fI@todo\fRという名前のタグまたはタグレットをユーザーが作成した場合、その後にOracleが同じ名前の標準タグを作成しても、そのタグまたはタグレットは常にユーザーが定義したのと同じ動作を保持します。 .sp -\fBvs\&. Javadoc\fR: ̤ˡɲäɬפΤޡåפɥȤ˱ƶͿɥȤꤹ뤿ΤΤǤ硢ΥޡåפJavadocˤޤʳξˤޤJavadocġǤDocȤεˡΥࡦ˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#annotations)򻲾ȤƤ +\fB注釈vs\&. Javadocタグ\fR: 一般に、追加する必要のあるマークアップが、ドキュメントに影響を与えたりドキュメントを生成したりするためのものである場合、そのマークアップはJavadocタグにします。それ以外の場合は注釈にします。JavadocツールでのDocコメントの記述方法のカスタム・タグと注釈に関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#annotations)を参照してください。 .sp -\fI\-taglet\fRץѤơʣʥ֥å䥫ࡦ饤󡦥Ǥޤ +\fI\-taglet\fRオプションを使用して、より複雑なブロック・タグやカスタム・インライン・タグも作成できます。 .RE .PP \-taglet \fIclass\fR .RS 4 -ΥΥɥȤ˻ѤɥååȤư뤿Υ饹եꤷޤ\fIclass\fRͤδ̾ѤޤΥåȤϡࡦΥƥȰοޤåȤϡΰդϤޤåȤѤ˭٤ʥɥȤˤĤƤϡåȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html)򻲾ȤƤ +そのタグのドキュメントの生成に使用するドックレットを起動するためのクラス・ファイルを指定します。\fIclass\fR値の完全修飾名を使用します。このタグレットは、カスタム・タグのテキスト引数の数も定義します。タグレットは、これらの引数を受け付け、処理し、出力を生成します。タグレットの例を使用した豊富なドキュメントについては、タグレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html)を参照してください。 .sp -åȤϡ֥åޤϥ饤󡦥ǤåȤǤդοΰȤ뤳ȤǤޤޤƥȤˤ롢վ񤭤롢ƥȤե˽񤭽Ф¾Υץ򳫻ϤʤɤΥưǤޤåȤǻǤΤϡ־ַΤߤǤ¾Τ٤ƤηϡɥååȤˤäƹԤޤåȤѤƤ⡢ޥ饹ΥꥹȤ饯饹̾ʤɤνϼ¹ԤǤޤ󡣤ΥƥȤե˽Ϥꡢ̤ΥץȥꥬʤɤѤޤåȤؤΥѥꤹˤϡ\fI\-tagletpath\fRץѤޤˡڡParametersThrowsδ֤To DoåȤ򼨤ޤޤϡ\fI\-taglet\fRץ򤽤\fI\-tag\fRץΤ˻Ѥ뤳ȤǤޤɤ߼꤬ˤʤǽޤ +タグレットは、ブロックタグまたはインライン・タグで便利です。タグレットは任意の数の引数をとることができます。また、テキストを太字にする、箇条書きを作成する、テキストをファイルに書き出す、その他のプロセスを開始するなどのカスタム動作を実装できます。タグレットで指定できるのは、タグの配置場所と配置形式のみです。その他のすべての決定は、ドックレットによって行われます。タグレットを使用しても、包含クラスのリストからクラス名を削除するなどの処理は実行できません。ただし、タグのテキストをファイルに出力したり、別のプロセスをトリガーするなどの副作用は得られます。タグレットへのパスを指定するには、\fI\-tagletpath\fRオプションを使用します。次に、生成されるページのParametersとThrowsの間にTo Doタグレットを挿入する例を示します。または、\fI\-taglet\fRオプションをその\fI\-tag\fRオプションのかわりに使用することができますが、読み取りが困難になる可能性があります。 .sp .if n \{\ .RS 4 @@ -3244,67 +3244,67 @@ HTML .PP \-tagletpath \fItagletpathlist\fR .RS 4 -taglet饹ե򸡺뤿θѥꤷޤ\fItagletpathlist\fRˤϡ(:)ǶڤäʣΥѥޤ뤳ȤǤޤ\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤ +tagletクラス・ファイルを検索するための検索パスを指定します。\fItagletpathlist\fRには、コロン(:)で区切って複数のパスを含めることができます。\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。 .RE .PP \-docfilesubdirs .RS 4 -doc\-filesǥ쥯ȥΥǥסԡͭˤޤˤϡ֥ǥ쥯ȥȤΤ٤ƤƵŪ˥ԡޤȤСǥ쥯ȥoc\-files/example/imagesȤƤ٤ƥԡޤǤ⡢֥ǥ쥯ȥ꤬ǽǤ +doc\-filesディレクトリのディープ・コピーを有効にします。宛先には、サブディレクトリとそのすべて内容が再帰的にコピーされます。たとえば、ディレクトリoc\-files/example/imagesとその内容がすべてコピーされます。ここでも、サブディレクトリを除外する指定が可能です。 .RE .PP \-excludedocfilessubdir \fIname1:name2\fR .RS 4 -ꤵ줿̾doc\-files֥ǥ쥯ȥ򤹤٤ƽޤˤꡢSCCSȤ¾Υ極֥ǥ쥯ȥΥԡɤޤ +指定された名前のdoc\-filesサブディレクトリをすべて除外します。これにより、SCCSとその他のソース・コード制御サブディレクトリのコピーを防ぎます。 .RE .PP \-noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR .RS 4 -Ϥ륯饹̾齤ѥå̾άޤ\fI\-noqualifier\fRץΰϡ\fIall\fR(٤ƤΥѥåҤά)ޤϽҤȤƺѥåΥڤꥹ(磻ɥɤ)Τ줫Ȥʤޤ饹ޤϥ󥿥ե̾ɽ֤ѥå̾ޤեν򻲾ȤƤ +出力されるクラス名から修飾パッケージ名を省略します。\fI\-noqualifier\fRオプションの引数は、\fIall\fR(すべてのパッケージ修飾子を省略)、または修飾子として削除するパッケージのコロン区切りリスト(ワイルドカードも可)、のいずれかとなります。クラスまたはインタフェース名が表示される位置からパッケージ名が削除されます。ソース・ファイルの処理を参照してください。 .sp -Ǥϡ٤ƤΥѥåҤάޤ\fI\-noqualifier all\fR +次の例では、すべてのパッケージ修飾子を省略します。\fI\-noqualifier all\fR .sp -Ǥϡ\fIjava\&.lang\fR\fIjava\&.io\fRѥåҤάޤ: -\fI\-noqualifier java\&.lang:java\&.io\fR +次の例では、\fIjava\&.lang\fRおよび\fIjava\&.io\fRパッケージ修飾子を省略します: +\fI\-noqualifier java\&.lang:java\&.io\fR。 .sp -Ǥϡ\fIjava\fRǻϤޤѥåҤ\fIcom\&.sun\fR֥ѥåάޤ\fIjavax\fRϾάޤ\fI\-noqualifier java\&.*:com\&.sun\&.*\fR +次の例では、\fIjava\fRで始まるパッケージ修飾子および\fIcom\&.sun\fRサブパッケージを省略しますが、\fIjavax\fRは省略しません。\fI\-noqualifier java\&.*:com\&.sun\&.*\fR .sp -ѥåҤҤư˽äɽ硢̾Ŭڤṳ̂ޤ̾ɽˡפ򻲾ȤƤΥ롼ϡ\fI\-noqualifier\fRץѤ뤫ɤˤ餺ͭǤ +パッケージ修飾子が前述の動作に従って表示される場合、名前は適切に短縮されます。「名前が表示される方法」を参照してください。このルールは、\fI\-noqualifier\fRオプションを使用するかどうかにかかわらず有効です。 .RE .PP \-notimestamp .RS 4 -ॹפޤƥڡƬ᤯ˤ롢줿HTMLHTMLȤǥॹפޤ\fI\-notimestamp\fRץϡ\fIjavadoc\fRޥɤ2ĤΥ١Ǽ¹Ԥδ֤κʬ\fIdiff\fRΩޤॹפˤ\fIdiff\fRȯɤǤ(ǤʤȤ٤ƤΥڡ\fIdiff\fRˤʤޤ)ॹפˤ\fIjavadoc\fRޥɤΥ꡼ֹ椬ޤޤ졢ߤǤϡ\fI<!\-\- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 \-\->\fRΤ褦ɽޤ +タイムスタンプが抑制されます。各ページの先頭近くにある、生成されたHTML内のHTMLコメントでタイムスタンプが隠されます。\fI\-notimestamp\fRオプションは、\fIjavadoc\fRコマンドを2つのソース・ベースで実行し、それらの間の差分\fIdiff\fRを取得する場合に役立ちます。タイムスタンプによる\fIdiff\fRの発生を防ぐからです(そうでないとすべてのページで\fIdiff\fRになります)。タイムスタンプには\fIjavadoc\fRコマンドのリリース番号が含まれ、現在では、\fI<!\-\- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 \-\->\fRのように表示されます。 .RE .PP \-nocomment .RS 4 -Ӥ٤ƤΥޤॳʸΤΤߤޤΥץˤꡢϰۤʤŪΤäեѤץȤᤤʳǥȥHTMLɥȤǤ褦ˤʤޤ +主説明およびすべてのタグを含むコメント本文全体を抑制し、宣言のみを生成します。このオプションにより、元は異なる目的のためだったソース・ファイルを再利用し、新しいプロジェクトの早い段階でスケルトンHTMLドキュメントを作成できるようになります。 .RE .PP \-sourcetab \fItablength\fR .RS 4 -dzƥ֤Ѥʸοꤷޤ +ソース内で各タブが使用する空白文字の数を指定します。 .RE -.SH "ޥɥ饤ե" +.SH "コマンドライン引数ファイル" .PP -\fIjavadoc\fRޥɤûʷˤꤹ뤿ˡ\fIjavadoc\fRޥɤФ(\fI\-J\fRץ)ä1İʾΥեꤹ뤳ȤǤޤΤȤѤСɤΥڥ졼ƥ󥰡ƥǤ⡢ǤդĹ\fIjavadoc\fRޥɤǤޤ +\fIjavadoc\fRコマンドを短くしたり簡潔にしたりするために、\fIjavadoc\fRコマンドに対する引数(\fI\-J\fRオプションを除く)が入った1つ以上のファイルを指定することができます。このことを利用すれば、どのオペレーティング・システム上でも、任意の長さの\fIjavadoc\fRコマンドを作成できます。 .PP -եˤϡ\fIjavac\fRΥץȥե̾ͳȤ߹礻ƵҤǤޤեγưϡڡޤϲԤǶڤޤե̾ޤ줿򤬤硢ե̾ΤŰǰϤߤޤ +引数ファイルには、\fIjavac\fRのオプションとソース・ファイル名を自由に組み合せて記述できます。ファイル内の各引数は、スペースまたは改行で区切ります。ファイル名に埋め込まれた空白がある場合、ファイル名全体を二重引用符で囲みます。 .PP -եΥե̾ϡեΰ֤ǤϤʤߤΥǥ쥯ȥŪȤʤޤΥꥹȤǤϡ磻ɥ(\fI*\fR)ϻѤǤޤ󡣤ȤС*\&.javaȤϻǤޤ󡣥åȥޡ(@)ѤơեƵŪ˲᤹뤳ȤϤǤޤ󡣤ޤ\fI\-J\fRץ⥵ݡȤƤޤ󡣤ΥץϵưġϤޤưġǤϰե򥵥ݡȤƤʤǤ +引数ファイル内のファイル名は、引数ファイルの位置ではなく、現在のディレクトリに相対的となります。これらのリストでは、ワイルドカード(\fI*\fR)は使用できません。たとえば、*\&.javaとは指定できません。アットマーク(@)を使用して、ファイルを再帰的に解釈することはできません。また、\fI\-J\fRオプションもサポートされていません。このオプションは起動ツールに渡されますが、起動ツールでは引数ファイルをサポートしていないからです。 .PP -\fIjavadoc\fR¹ԤȤˡưեΥѥȥե̾Ƭ@ʸդϤޤ\fIjavadoc\fRޥɤϡåȥޡ(@)ʸǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjavadoc\fRを実行するときに、各引数ファイルのパスとファイル名の先頭に@文字を付けて渡します。\fIjavadoc\fRコマンドは、アットマーク(@)文字で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .PP -\fBExample 1\fR, ñΰե +\fBExample 1\fR, 単一の引数ファイル .RS 4 -\fIargfile\fRȤ̾1ĤΰեѤơ٤Ƥ\fIjavadoc\fRޥɰݻǤޤ\fIjavadoc @argfile\fR˼褦ˡΰեˤξΥեƤޤޤƤޤ +\fIargfile\fRという名前の1つの引数ファイルを使用して、すべての\fIjavadoc\fRコマンド引数を保持できます。\fIjavadoc @argfile\fR次の例に示すように、この引数ファイルには両方のファイルの内容が含まれています。 .RE .PP -\fBExample 2\fR, 2Ĥΰե +\fBExample 2\fR, 2つの引数ファイル .RS 4 -Τ褦ˡ2ĤΰեǤޤ\fIjavadoc\fRޥɤΥץѤ1ġѥå̾ޤϥե̾Ѥ1ĤǤΥꥹȤǤϹԷ³ʸѤƤޤ +次のように、2つの引数ファイルを作成できます。\fIjavadoc\fRコマンドのオプション用に1つ、パッケージ名またはソース・ファイル名用に1つです。次のリストでは行継続文字を使用していません。 .sp -ƤޤࡢoptionsȤ̾Υեޤ +次の内容を含む、optionsという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -3324,7 +3324,7 @@ doc\-files .if n \{\ .RE .\} -ƤޤࡢpackagesȤ̾Υեޤ +次の内容を含む、packagesという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -3337,7 +3337,7 @@ com\&.mypackage3 .if n \{\ .RE .\} -Τ褦ˡ\fIjavadoc\fRޥɤ¹Ԥޤ +次のように、\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3350,9 +3350,9 @@ javadoc @options @packages .\} .RE .PP -\fBExample 3\fR, ѥѤե +\fBExample 3\fR, パスを使用した引数ファイル .RS 4 -եϥѥǤޤեΤ٤ƤΥե̾ϡ(\fIpath1\fR\fIpath2\fRǤϤʤ)Τ褦˸ߤκȥǥ쥯ȥŪȤʤޤ +引数ファイルはパスを指定できますが、ファイル内のすべてのファイル名は、(\fIpath1\fRや\fIpath2\fRではなく)次のように現在の作業ディレクトリに相対的となります。 .sp .if n \{\ .RS 4 @@ -3365,9 +3365,9 @@ javadoc @path1/options @path2/packages .\} .RE .PP -\fBExample 4\fR, ץ +\fBExample 4\fR, オプション引数 .RS 4 -ˡ\fIjavadoc\fRޥɤΥץФե˳Ǽ򼨤ޤĹǤΤǡ\fI\-bottom\fRץѤޤΤ褦ʥƥȰޤࡢbottomȤ̾ΥեǤޤ +次に、\fIjavadoc\fRコマンドのオプションに対する引数を引数ファイルに格納する例を示します。長い引数を指定できるので、\fI\-bottom\fRオプションを使用します。次のようなテキスト引数を含む、bottomという名前のファイルを作成できます。 .sp .if n \{\ .RS 4 @@ -3382,37 +3382,37 @@ javadoc @path1/options @path2/packages .if n \{\ .RE .\} -\fIjavadoc\fRޥɤ򼡤Τ褦˼¹Ԥޤ\fI javadoc \-bottom @bottom @packages\fR +\fIjavadoc\fRコマンドを次のように実行します。\fI javadoc \-bottom @bottom @packages\fR .sp -\fI\-bottom\fRץեκǽ˴ޤơΤ褦\fIjavadoc\fRޥɤ¹Ԥ뤳ȤǤޤ\fIjavadoc @bottom @packages\fR +\fI\-bottom\fRオプションを引数ファイルの最初に含めて、次のように\fIjavadoc\fRコマンドを実行することもできます。\fIjavadoc @bottom @packages\fR .RE -.SH "JAVADOCޥɤμ¹" +.SH "JAVADOCコマンドの実行" .PP -\fIjavadoc\fRޥɤΥ꡼ֹ\fIjavadoc \-J\-version\fRץǤޤϥȥ꡼ˤɸɥååȤΥ꡼ֹ椬ޤޤޤ\fI\-quiet\fRץ̵ˤǤޤ +\fIjavadoc\fRコマンドのリリース番号は\fIjavadoc \-J\-version\fRオプションで特定できます。出力ストリームには標準ドックレットのリリース番号が含まれます。\fI\-quiet\fRオプションで無効にできます。 .PP -JavaǵҤ줿ץफ\fIjavadoc\fRޥɤưˤϸץޥƥå󥿥եѤޤΥ󥿥ե\fIcom\&.sun\&.tools\&.javadoc\&.Main\fRˤޤ(ޤ\fIjavadoc\fRޥɤϺǽǤ)ܺ٤ϡɸɥåå -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard\-doclet\&.html#runningprogrammatically)򻲾ȤƤ +Java言語で記述されたプログラムから\fIjavadoc\fRコマンドを起動するには公開プログラマティック・インタフェースを使用します。このインタフェースは\fIcom\&.sun\&.tools\&.javadoc\&.Main\fRにあります(また\fIjavadoc\fRコマンドは再入可能です)。詳細は、標準ドックレット +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard\-doclet\&.html#runningprogrammatically)を参照してください。 .PP -μǤϡɸHTMLɥååȤƤӽФޤࡦɥååȤƤӽФˤϡ\fI\-doclet\fR\fI\-docletpath\fRץѤޤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ -.SS "ñ" +次の手順では、標準HTMLドックレットを呼び出します。カスタム・ドックレットを呼び出すには、\fI\-doclet\fRおよび\fI\-docletpath\fRオプションを使用しますドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください +.SS "簡単な例" .PP -\fIjavadoc\fRޥɤϡѥåΤФƼ¹Ԥ뤳Ȥ⡢ġΥեФƼ¹Ԥ뤳ȤǤޤƥѥå̾ϡ줾Υѥå̾бǥ쥯ȥ̾ޤ +\fIjavadoc\fRコマンドは、パッケージ全体に対して実行することも、個々のソース・ファイルに対して実行することもできます。各パッケージ名は、それぞれのパッケージ名に対応するディレクトリ名を持ちます。 .PP -Ǥϡե/home/src/java/awt/*\&.javaˤޤǥ쥯ȥ/home/htmlǤ -1İʾΥѥåΥɥȲ.PP -ѥåɥȲˤϡΥѥåΥե򡢤ΥѥåƱ̾Υǥ쥯ȥ˳Ǽɬפޤ +次の例では、ソース・ファイルは/home/src/java/awt/*\&.javaにあります。生成先ディレクトリは/home/htmlです。 +1つ以上のパッケージのドキュメント化.PP +パッケージをドキュメント化するには、そのパッケージのソース・ファイルを、そのパッケージと同じ名前のディレクトリ内に格納する必要があります。 .PP -ѥå̾(\fIjava\&.awt\&.color\fRΤ褦˥ɥåȤǶڤ줿)ʣμ̻Ҥ鹽Ƥ硢³γƼ̻Ҥ̤Υ֥ǥ쥯ȥ(ava/awt/colorʤ)бƤɬפޤ +パッケージ名が(\fIjava\&.awt\&.color\fRのようにドットで区切られた)複数の識別子から構成されている場合、後続の各識別子が下位のサブディレクトリ(ava/awt/colorなど)に対応している必要があります。 .PP -1ĤΥѥåΤʣΥե򡢰ۤʤˤ뤽Τ褦2ĤΥǥ쥯ȥꡦĥ꡼ʬƳǼ뤳ȤǤޤξ\fI\-sourcepath\fRˤäƤξξꤹɬפޤȤСsrc1/java/awt/colorsrc2/java/awt/color +1つのパッケージのための複数のソース・ファイルを、異なる場所にあるそのような2つのディレクトリ・ツリーに分けて格納することもできます。ただし、その場合は\fI\-sourcepath\fRによってその両方の場所を指定する必要があります。たとえば、src1/java/awt/colorとsrc2/java/awt/color。 .PP -ǥ쥯ȥѹ(\fIcd\fRޥɤ)ޤ\fI\-sourcepath\fRץˤꡢ\fIjavadoc\fRޥɤ¹ԤǤޤξ򼨤ޤ +ディレクトリの変更(\fIcd\fRコマンドを使用)または\fI\-sourcepath\fRオプションにより、\fIjavadoc\fRコマンドを実行できます。次の例で両方の選択肢を示します。 .PP -\fBExample 1\fR, 1İʾΥѥåƵŪ˼¹ +\fBExample 1\fR, 1つ以上のパッケージから再帰的に実行 .RS 4 -Ǥ\fIjavadoc\fRޥɤǤդΥǥ쥯ȥ꤫¹ԤǤ褦ˡ\fI\-sourcepath\fRѤƵŪΤ\fI\-subpackages\fR -(1\&.4οץ)Ѥޤϡjavaǥ쥯ȥΥ֥ѥå򤿤ɤޤ\fIjava\&.net\fR\fIjava\&.lang\fR롼Ȥ˻ĥѥåϽޤ\fIjava\&.lang\fRΥ֥ѥåǤ\fIjava\&.lang\&.ref\fRդƤޤ¾Υѥåĥ꡼ˤɤˤϡ\fIjava:javax:org\&.xml\&.sax\fRΤ褦ˡΥѥå̾\fI\-subpackages\fRΰɲäޤ +この例では\fIjavadoc\fRコマンドが任意のディレクトリから実行できるように、\fI\-sourcepath\fRを使用し、再帰的処理のために\fI\-subpackages\fR +(1\&.4の新オプション)を使用します。これは、javaディレクトリのサブパッケージをたどりますが、\fIjava\&.net\fRと\fIjava\&.lang\fRをルートに持つパッケージは除外されます。\fIjava\&.lang\fRのサブパッケージである\fIjava\&.lang\&.ref\fRが除外される点に注意してください。また、他のパッケージ・ツリーを下方にたどるには、\fIjava:javax:org\&.xml\&.sax\fRのように、それらのパッケージの名前を\fI\-subpackages\fRの引数に追加します。 .sp .if n \{\ .RS 4 @@ -3425,9 +3425,9 @@ javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude .\} .RE .PP -\fBExample 2\fR, 롼ȤؤΰưŪʥѥåμ¹ +\fBExample 2\fR, ルートへの移動および明示的なパッケージの実行 .RS 4 -줿ѥåοƥǥ쥯ȥ˰ưޤˡɥȲ1İʾΥѥå̾ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +完全修飾されたパッケージの親ディレクトリに移動します。次に、ドキュメント化する1つ以上のパッケージの名前を指定して\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3439,12 +3439,12 @@ javadoc \-d /home/html java\&.awt java\&.awt\&.event .if n \{\ .RE .\} -ޤ¾Υѥåĥ꡼ˤɤˤϡj\fIava:javax:org\&.xml\&.sax\fRΤ褦ˡΥѥå̾\fI\-subpackages\fRΰɲäޤ +また、他のパッケージ・ツリーを下方にたどるには、j\fIava:javax:org\&.xml\&.sax\fRのように、それらのパッケージの名前を\fI\-subpackages\fRの引数に追加します。 .RE .PP -\fBExample 3\fR, 1ĤΥĥ꡼ŪʥѥåǤդΥǥ쥯ȥ꤫¹ +\fBExample 3\fR, 1つのツリーの明示的なパッケージの任意のディレクトリから実行 .RS 4 -ξ硢ߤΥǥ쥯ȥ꤬ɤǤϤޤ\fIjavadoc\fRޥɤ¹ԤǾ̥ѥåοƥǥ쥯ȥꤷ\fI\-sourcepath\fRץѤޤɥȲ1İʾΥѥå̾ꤷޤ +この場合、現在のディレクトリがどこかは問題ではありません。\fIjavadoc\fRコマンドを実行し、最上位パッケージの親ディレクトリを指定して\fI\-sourcepath\fRオプションを使用します。ドキュメント化する1つ以上のパッケージの名前を指定します。 .sp .if n \{\ .RS 4 @@ -3457,9 +3457,9 @@ javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event .\} .RE .PP -\fBExample 4\fR, ʣΥĥ꡼ŪʥѥåǤդΥǥ쥯ȥ꤫¹ +\fBExample 4\fR, 複数のツリーの明示的なパッケージの任意のディレクトリから実行 .RS 4 -\fIjavadoc\fRޥɤ¹Ԥƥĥ꡼Υ롼ȤؤΥѥΥڤꥹȤꤷ\fI\-sourcepath\fRץѤޤɥȲ1İʾΥѥå̾ꤷޤꤷѥåΤ٤ƤΥե뤬1ĤΥ롼ȡǥ쥯ȥβ¸ߤɬפϤޤ󤬡ѥǻꤵ줿ΤɤǸĤɬפޤ +\fIjavadoc\fRコマンドを実行し、各ツリーのルートへのパスのコロン区切りリストを指定して\fI\-sourcepath\fRオプションを使用します。ドキュメント化する1つ以上のパッケージの名前を指定します。指定したパッケージのすべてのソース・ファイルが、1つのルート・ディレクトリの下に存在する必要はありませんが、ソース・パスで指定された場所のどこかで見つかる必要があります。 .sp .if n \{\ .RS 4 @@ -3470,16 +3470,16 @@ javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\ .if n \{\ .RE .\} -٤ƤΥj\fIava\&.awt\fR\fIjava\&.awt\&.even\fRtѥå\fIpublic\fR\fIprotected\fR饹ȥ󥿥եˤĤơHTMLΥɥȤ졢ꤵ줿ǥ쥯ȥHTMLե뤬¸ޤ2İʾΥѥåƤΤǡɥȤϡѥåΥꥹȡ饹ΥꥹȡӥᥤΥ饹ڡȤ3ĤHTMLե졼ĤȤˤʤޤ +すべてのケースでj\fIava\&.awt\fRおよび\fIjava\&.awt\&.even\fRtパッケージ内の\fIpublic\fRおよび\fIprotected\fRクラスとインタフェースについて、HTML形式のドキュメントが生成され、指定された生成先ディレクトリにHTMLファイルが保存されます。2つ以上のパッケージが生成されているので、ドキュメントは、パッケージのリスト、クラスのリスト、およびメインのクラス・ページという3つのHTMLフレームを持つことになります。 .RE -1İʾΥ饹ΥɥȲ.PP -ޤ1İʾΥեϤơ\fIjavadoc\fRޥɤ¹Ԥ뤳ȤǤޤ\fIjavadoc\fRϡ2ĤˡΤ줫Ǽ¹ԤǤޤ1Ĥϥǥ쥯ȥѹˡ(\fIcd\fR)⤦1ĤϥեؤΥѥ˻ꤹˡǤХѥϡߤΥǥ쥯ȥȤޤեϤȤϡ\fI\-sourcepath\fRץ̵뤵ޤꥹ(*)Τ褦ʥޥɥ饤󡦥磻ɥɤѤȡ饹Υ롼פǤޤ +1つ以上のクラスのドキュメント化.PP +また、1つ以上のソース・ファイルを渡して、\fIjavadoc\fRコマンドを実行することもできます。\fIjavadoc\fRは、次の2つの方法のいずれかで実行できます。1つはディレクトリを変更する方法(\fIcd\fRを使用)、もう1つはソース・ファイルへのパスを完全に指定する方法です。相対パスは、現在のディレクトリを起点とします。ソース・ファイルを渡すときは、\fI\-sourcepath\fRオプションは無視されます。アスタリスク(*)のようなコマンドライン・ワイルドカードを使用すると、クラスのグループを指定できます。 .PP -\fBExample 1\fR, ǥ쥯ȥѹ +\fBExample 1\fR, ソース・ディレクトリに変更 .RS 4 -ݻǥ쥯ȥѹޤˡɥȲ1İʾΥե̾ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +ソースを保持するディレクトリに変更します。次に、ドキュメント化する1つ以上のソース・ファイルの名前を指定して\fIjavadoc\fRコマンドを実行します。 .sp -Ǥϡ\fIButton\fR饹\fICanvas\fR饹̾\fIGraphics\fRǻϤޤ륯饹ˤĤơHTMLΥɥȤޤѥå̾ǤϤʤե뤬\fIjavadoc\fRޥɤ˰ȤϤƤΤǡɥȤϡ饹ΥꥹȤȥᥤ󡦥ڡȤ2ĤΥե졼ĤȤˤʤޤ +この例では、\fIButton\fRクラスと\fICanvas\fRクラス、および名前が\fIGraphics\fRで始まるクラスについて、HTML形式のドキュメントが生成されます。パッケージ名ではなくソース・ファイルが\fIjavadoc\fRコマンドに引数として渡されているので、ドキュメントは、クラスのリストとメイン・ページという2つのフレームを持つことになります。 .sp .if n \{\ .RS 4 @@ -3493,9 +3493,9 @@ javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java .\} .RE .PP -\fBExample 2\fR, ѥåΥ롼ȡǥ쥯ȥѹ +\fBExample 2\fR, パッケージのルート・ディレクトリに変更 .RS 4 -ϡƱ롼Ȥ̤Υ֥ѥåθġΥեɥȲΤΩޤѥåΥ롼ȡǥ쥯ȥ˰ܤꡢƥե򡢥롼ȤΥѥȤȤ˻ꤷޤ +これは、同じルートからの別のサブパッケージの個々のソース・ファイルをドキュメント化するのに役立ちます。パッケージのルート・ディレクトリに移り、各ソース・ファイルを、ルートからのパスとともに指定します。 .sp .if n \{\ .RS 4 @@ -3509,9 +3509,9 @@ javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java .\} .RE .PP -\fBExample 3\fR, ǤդΥǥ쥯ȥ꤫ΥեΥɥȲ +\fBExample 3\fR, 任意のディレクトリからのファイルのドキュメント化 .RS 4 -ξ硢ߤΥǥ쥯ȥ꤬ɤǤϤޤ󡣥ɥȲ륽եؤХѥ(ޤϸߤΥǥ쥯ȥ꤫Хѥ)ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +この場合、現在のディレクトリがどこかは問題ではありません。ドキュメント化するソース・ファイルへの絶対パス(または現在のディレクトリからの相対パス)を指定して\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3524,8 +3524,8 @@ javadoc \-d /home/html /home/src/java/awt/Button\&.java .RE .\} .RE -ѥåӥ饹ΥɥȲ.PP -ѥåΤȸġΥ饹Ʊ˻ꤷƥɥȲ뤳ȤǤޤˡҤ2ĤȤ߹礻򼨤ޤ\fI\-sourcepath\fRץϡѥåؤΥѥФƤϻѤǤޤġΥ饹ؤΥѥФƤϻѤǤޤ +パッケージおよびクラスのドキュメント化.PP +パッケージ全体と個々のクラスを同時に指定してドキュメント化することもできます。次に、前述の2つの例を組み合せた例を示します。\fI\-sourcepath\fRオプションは、パッケージへのパスに対しては使用できますが、個々のクラスへのパスに対しては使用できません。 .sp .if n \{\ .RS 4 @@ -3537,14 +3537,14 @@ javadoc \-d /home/html \-sourcepath /home/src java\&.awt .if n \{\ .RE .\} -.SS "ºݤ" +.SS "実際の例" .PP -Υޥɥ饤󤪤\fImakefile\fRС\fIjavadoc\fRޥɤJavaץåȥեAPIǼ¹ԤޤJava SE 1\&.21500Ĥpublicprotected饹ΥɥȤˤϡ180MBΥ꡼Ѥޤɤ⥪ץΰХѥѤƤ뤿ᡢǤդΥǥ쥯ȥ꤫Ʊ\fIjavadoc\fRޥɤ¹ԤǤޤ -ޥɥ饤.PP -ΥޥɤϡΥФĹǽޤ¤򤹤ˤϡޥɥ饤եѤޤޤϡ롦ץȤ򵭽Ҥޤ +次のコマンドラインおよび\fImakefile\fRバージョンの\fIjavadoc\fRコマンドをJavaプラットフォームAPIで実行します。Java SE 1\&.2で約1500個のpublicおよびprotectedクラスのドキュメントを生成するには、180MBのメモリーを使用します。どちらの例もオプションの引数で絶対パスが使用されているため、任意のディレクトリから同じ\fIjavadoc\fRコマンドを実行できます。 +コマンドラインの例.PP +次のコマンドは、一部のシェルに対して長すぎる可能性があります。この制限を回避するには、コマンドライン引数ファイルを使用します。または、シェル・スクリプトを記述します。 .PP -Ǥϡ\fIpackages\fRϽѥåޤ̾ǡ\fIjava\&.applet\fR -\fIjava\&.lang\fRʤɤǤƥץΡŰǰϤޤ줿¦ˤϡʸǤޤ󡣤ȤС򥳥ԡɡڡȤϡ\fI\-bottom\fRץ󤫤ʸƤ +この例では、\fIpackages\fRは処理するパッケージを含む名前で、\fIjava\&.applet\fR +\fIjava\&.lang\fRなどです。各オプションの、一重引用符で囲まれた引数の内側には、改行文字を挿入できません。たとえば、この例をコピー・アンド・ペーストする場合は、\fI\-bottom\fRオプションから改行文字を削除してください。 .sp .if n \{\ .RS 4 @@ -3571,10 +3571,10 @@ Other names may be trademarks of their respective owners\&.</font>\*(Aq \e .if n \{\ .RE .\} -ץޥƥå󥿥ե.PP -Javadoc Access APIǤϡץ¹ԤʤƤ⡢JavadocġJavaץꥱ󤫤ľܵưǤޤ +プログラマティック・インタフェース.PP +Javadoc Access APIでは、新しいプロセスを実行しなくても、JavadocツールをJavaアプリケーションから直接起動できます。 .PP -ȤСʸϥޥ\fIjavadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude java\&.net:java\&.lang com\&.example\fRƱǤ +たとえば、次の文はコマンド\fIjavadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude java\&.net:java\&.lang com\&.example\fRと同等です。 .sp .if n \{\ .RS 4 @@ -3599,13 +3599,13 @@ public class JavaAccessSample{ .RE .\} .PP -\fIrun\fR᥽åɤκǽ3Ĥΰϡϡɸϡɸ२顼ȥ꡼ꤷޤ\fINull\fR\fISystem\&.in\fR\fISystem\&.out\fR\fISystem\&.err\fR줾ΥǥեͤǤ -.SS "makefile" +\fIrun\fRメソッドの最初の3つの引数は、入力、標準出力、および標準エラー・ストリームを指定します。\fINull\fRは\fISystem\&.in\fR、\fISystem\&.out\fRおよび\fISystem\&.err\fRそれぞれのデフォルト値です。 +.SS "makefileの例" .PP -ǤϡGNU -\fImakefile\fR򼨤ޤ\fImakefile\fRΰϡŰǰϤߤޤWindows -\fImakefile\fRˤĤƤϡJavadoc FAQ\fImakefiles\fR˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html#makefiles)򻲾ȤƤ +ここでは、GNU +\fImakefile\fRの例を示します。\fImakefile\fRの引数は、一重引用符で囲みます。Windows +\fImakefile\fRの例については、Javadoc FAQの\fImakefiles\fRに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html#makefiles)を参照してください .sp .if n \{\ .RS 4 @@ -3642,7 +3642,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .if n \{\ .RE .\} -.SS "" +.SS "注意" .sp .RS 4 .ie n \{\ @@ -3652,7 +3652,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fI\-windowtitle\fRץάȡ\fIjavadoc\fRޥɤˤäƥɥȡȥ뤬ɥȥ˥ԡޤ\fI\-windowtitle\fRץΥƥȤϡ\fI\-doctitle\fRץƱǤHTMLϴޤޤޤ󡣤ϡHTMLɥȥˤΤޤޤΥƥȤȤɽΤɤǤ +\fI\-windowtitle\fRオプションを省略すると、\fIjavadoc\fRコマンドによってドキュメント・タイトルがウィンドウ・タイトルにコピーされます。\fI\-windowtitle\fRオプションのテキストは、\fI\-doctitle\fRオプションと同じですが、HTMLタグは含まれません。これは、HTMLタグが、ウィンドウ・タイトル内にそのままのテキストとして表示されるのを防ぐためです。 .RE .sp .RS 4 @@ -3663,7 +3663,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fI\-footer\fRץάȡ\fIjavadoc\fRޥɤˤäƥإåƥȤեå˥ԡޤ +\fI\-footer\fRオプションを省略すると、\fIjavadoc\fRコマンドによってヘッダー・テキストがフッターにコピーされます。 .RE .sp .RS 4 @@ -3674,9 +3674,9 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -Ǥɬפޤ󤬡\fI\-classpath\fR\fI\-link\fRפʥץǤ +この例では必要ありませんが、\fI\-classpath\fRと\fI\-link\fRも重要なオプションです。 .RE -.SH "Ūʥȥ֥륷塼ƥ" +.SH "一般的なトラブルシューティング" .sp .RS 4 .ie n \{\ @@ -3686,7 +3686,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fIjavadoc\fRޥɤͭʥ饹̾ޤեΤߤɤ߼ޤ\fIjavadoc\fRޥɤեƤɤ߼äƤʤϡ饹̾ͭǤ뤳Ȥǧޤեν򻲾ȤƤ +\fIjavadoc\fRコマンドは有効なクラス名を含むファイルのみを読み取ります。\fIjavadoc\fRコマンドがファイルの内容を正しく読み取っていない場合は、クラス名が有効であることを確認します。ソース・ファイルの処理を参照してください。 .RE .sp .RS 4 @@ -3697,27 +3697,27 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -̤Զ礪ӥȥ֥륷塼ƥ󥰤ΥҥȤˤĤƤϡJavadoc FAQ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html)򻲾ȤƤ +共通の不具合およびトラブルシューティングのヒントについては、Javadoc FAQ +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html)を参照してください。 .RE -.SH "顼ȷٹ" +.SH "エラーと警告" .PP -顼ӷٹåˤϡե̾(ɥơ󡦥ιԤǤϤʤ)ιֹ椬ޤޤޤ +エラーおよび警告メッセージには、ファイル名と宣言行(ドキュメンテーション・コメント内の特定の行ではない)の行番号が含まれます。 .PP -ȤСå\fI֥顼: Class1\&.javaɤ߹ޤ\fRϡ\fIjavadoc\fRޥɤ\fIClass1\&.jav\fR\fIa\fR򸽺ߤΥǥ쥯ȥ˥ɤ褦ȤƤ뤳Ȥ̣ޤ饹̾ϤΥѥ(Фޤ)ɽޤ -.SH "Ķ" +たとえば、メッセージ\fI「エラー: Class1\&.javaを読み込めません」\fRは、\fIjavadoc\fRコマンドが\fIClass1\&.jav\fR\fIa\fRを現在のディレクトリにロードしようとしていることを意味します。クラス名はそのパス(絶対または相対)で表示されます。 +.SH "環境" .PP CLASSPATH .RS 4 -\fICLASSPATH\fRϡ\fIjavadoc\fRޥɤ桼饹եθФ˻Ѥѥ󶡤ĶѿǤδĶѿϡ\fI\-classpath\fRץˤäƥС饤ɤޤǥ쥯ȥϥߥ(Windowsξ)ޤϥ(Oracle Solarisξ)Ƕڤޤ +\fICLASSPATH\fRは、\fIjavadoc\fRコマンドがユーザー・クラス・ファイルの検出に使用するパスを提供する環境変数です。この環境変数は、\fI\-classpath\fRオプションによってオーバーライドされます。ディレクトリはセミコロン(Windowsの場合)またはコロン(Oracle Solarisの場合)で区切ります。 .sp -\fBWindows\fR: +\fBWindowsの例\fR: \fI\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR .sp -\fBOracle Solaris\fR: +\fBOracle Solarisの例\fR: \fI\&.:/home/classes:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -3773,7 +3773,7 @@ javah(1) .\} javap(1) .RE -.SH "Ϣɥ" +.SH "関連ドキュメント" .sp .RS 4 .ie n \{\ @@ -3783,7 +3783,7 @@ javap(1) .sp -1 .IP \(bu 2.3 .\} -JavadocƥΥ +Javadocテクノロジ (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html) .RE .sp @@ -3795,7 +3795,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -饹θˡ +クラスの検出方法 (http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html) .RE .sp @@ -3807,7 +3807,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -JavadocġǤDocȤεˡ +JavadocツールでのDocコメントの記述方法 (http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html) .RE .sp @@ -3819,7 +3819,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -URL⡢Uniform Resource Locators +URLメモ、Uniform Resource Locators (http://www\&.ietf\&.org/rfc/rfc1738\&.txt) .RE .sp @@ -3831,7 +3831,7 @@ URL .sp -1 .IP \(bu 2.3 .\} -HTMLɸࡢHTML Document Representation (41972654137321) +HTML標準、HTML Document Representation (4197265および4137321) (http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2) .RE .br diff --git a/jdk/src/linux/doc/man/ja/javah.1 b/jdk/src/linux/doc/man/ja/javah.1 index e88dfbfaabd..056a1092e2e 100644 --- a/jdk/src/linux/doc/man/ja/javah.1 +++ b/jdk/src/linux/doc/man/ja/javah.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javah .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javah" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javah" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javah \- Java饹Cإåȥեޤ -.SH "" +javah \- JavaクラスからCヘッダーとソース・ファイルを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,102 +64,102 @@ javah \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIfully\-qualified\-class\-name\fR .RS 4 -CإåȥեѴ륯饹δ줿ꡣ +Cヘッダーとソース・ファイルに変換されるクラスの完全修飾された場所。 .RE -.SH "" +.SH "説明" .PP -\fIjavah\fRޥɤϡͥƥ֡᥽åɤ뤿ɬפCإåȥեޤ줿إåȥեϡͥƥ֡ɤ饪֥ȤΥ󥹥ѿ򻲾Ȥ뤿CץˤäƻѤޤ\fI\&.h\fRեϡб륯饹Ȱפ֤\fIstruct\fRޤߤޤ\fIstruct\fRΥեɤϡ饹Υ󥹥ѿбޤ +\fIjavah\fRコマンドは、ネイティブ・メソッドを実装するために必要なCヘッダーとソース・ファイルを生成します。作成されたヘッダーとソース・ファイルは、ネイティブ・ソース・コードからオブジェクトのインスタンス変数を参照するためにCプログラムによって使用されます。\fI\&.h\fRファイルは、対応するクラスと一致する配置を持つ\fIstruct\fR定義を含みます。\fIstruct\fRのフィールドは、クラスのインスタンス変数に対応します。 .PP -إåեȤ빽¤Τ̾ϥ饹̾ޤ\fIjavah\fRޥɤϤ륯饹ѥåˤ硢ѥå̾ϥإåե̾ȹ¤̾ξƬղäޤ(_)̾ζڤʸȤƻѤޤ +ヘッダー・ファイルとその中で宣言される構造体の名前はクラスの名前から派生します。\fIjavah\fRコマンドに渡されるクラスがパッケージの中にある場合、パッケージ名はヘッダー・ファイル名と構造体名の両方の先頭に付加されます。下線(_)が名前の区切り文字として使用されます。 .PP -ǥեȤǤ\fIjavah\fRޥɤϡޥɥ饤˥ꥹȤƥ饹ΥإåեߤΥǥ쥯ȥ˥ե֤ޤեˤϡ\fI\-stubs\fRץѤƤ1ĤΥեˡꥹȤ줿٤ƤΥ饹η̤Ϣ뤹ˤϡ\fI\-o\fRץѤƤ +デフォルトでは\fIjavah\fRコマンドは、コマンドラインにリストされる各クラスのヘッダー・ファイルを作成し、現在のディレクトリにファイルを置きます。ソース・ファイルを作成するには、\fI\-stubs\fRオプションを使用してください。1つのファイルの中に、リストされたすべてのクラスの結果を連結するには、\fI\-o\fRオプションを使用してください。 .PP -Java Native Interface (JNI)ϥإåޤϥ֡եɬפȤޤ\fIjavah\fRޥɤϰ³JNIΥͥƥ֡᥽åɤɬפʥͥƥ֡᥽åɴؿץȥפ˻ѤǤޤ\fIjavah\fRޥɤϥǥեȤJNIνϤη̤\fI\&.h\fRե˳Ǽޤ -.SH "ץ" +Java Native Interface (JNI)はヘッダー情報またはスタブ・ファイルを必要としません。\fIjavah\fRコマンドは引き続きJNI形式のネイティブ・メソッドに必要なネイティブ・メソッド関数プロトタイプの生成に使用できます。\fIjavah\fRコマンドはデフォルトでJNI形式の出力を生成し、その結果を\fI\&.h\fRファイルに格納します。 +.SH "オプション" .PP \-o \fIoutputfile\fR .RS 4 -ޥɥ饤˥ꥹȤ줿٤ƤΥ饹Фơ̤ΥإåޤϥեϢ뤷ƽϥե˳Ǽޤ\fI\-o\fRޤ\fI\-d\fRΤɤ餫Τ߻ѤǤޤ +コマンドラインにリストされたすべてのクラスに対して、結果のヘッダーまたはソース・ファイルを連結して出力ファイルに格納します。\fI\-o\fRまたは\fI\-d\fRのどちらかのみ使用できます。 .RE .PP \-d \fIdirectory\fR .RS 4 -\fIjavah\fRإåեޤϥ֡ե¸롢ǥ쥯ȥꤷޤ\fI\-d\fRޤ\fI\-o\fRΤɤ餫Τ߻ѤǤޤ +\fIjavah\fRがヘッダー・ファイルまたはスタブ・ファイルを保存する、ディレクトリを設定します。\fI\-d\fRまたは\fI\-o\fRのどちらかのみ使用できます。 .RE .PP \-stubs .RS 4 -\fIjavah\fRޥɤJava֥ȡե뤫Cޤ +\fIjavah\fRコマンドが、Javaオブジェクト・ファイルからC宣言を生成します。 .RE .PP \-verbose .RS 4 -ܺٽϤꤷեξ֤˴ؤå\fIjavah\fRޥɤ\fIɸ\fR˽Ϥޤ +詳細出力を指定し、作成ファイルの状態に関するメッセージを、\fIjavah\fRコマンドが\fI標準出力\fRに出力します。 .RE .PP \-help .RS 4 -\fIjavah\fRλˡˤĤƤΥإסåϤޤ +\fIjavah\fRの使用方法についてのヘルプ・メッセージを出力します。 .RE .PP \-version .RS 4 -\fIjavah\fRޥɤΥ꡼Ϥޤ +\fIjavah\fRコマンドのリリース情報を出力します。 .RE .PP \-jni .RS 4 -JNIΥͥƥ֡᥽åɵǽץȥפޤϥե\fIjavah\fRޥɤޤɸϤǤ뤿ᡢ\fI\-jni\fRλѤϥץǤ +JNI形式のネイティブ・メソッド機能プロトタイプを含む出力ファイルを、\fIjavah\fRコマンドが作成します。これは標準出力であるため、\fI\-jni\fRの使用はオプションです。 .RE .PP \-classpath \fIpath\fR .RS 4 -饹õ\fIjavah\fRޥɤѤѥꤷޤǥեȤޤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤǥ쥯ȥOracle SolarisξϥǡWindowsξϥߥǶڤޤѥΰŪʷϼΤ褦ˤʤޤ +クラスを探すために\fIjavah\fRコマンドが使用するパスを指定します。デフォルトまたは\fICLASSPATH\fR環境変数の設定をオーバーライドします。ディレクトリはOracle Solarisの場合はコロンで、Windowsの場合はセミコロンで区切られます。パスの一般的な形式は次のようになります。 .sp -\fBOracle Solaris\fRξ: +\fBOracle Solaris\fRの場合: .sp \&.:\fIyour\-path\fR .sp -: +例: \fI\&.:/home/avh/classes:/usr/local/java/classes\fR .sp -\fBWindows\fRξ: +\fBWindows\fRの場合: .sp \&.;\fIyour\-path\fR .sp -: +例: \fI\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR .sp -ص塢*Υ١̾ޤ९饹ѥǤϡ\fI\&.jar\fRޤ\fI\&.JAR\fRĥҤ˻ĥǥ쥯ȥΤ٤ƤΥեΥꥹȤꤹΤƱȤߤʤޤ +便宜上、*のベース名を含むクラス・パス要素は、\fI\&.jar\fRまたは\fI\&.JAR\fRを拡張子に持つディレクトリ内のすべてのファイルのリストを指定するのと同等とみなされます。 .sp -ȤСǥ쥯ȥ\fImydir\fR\fIa\&.jar\fR\fIb\&.JAR\fRޤޤƤ硢饹ѥ\fImydir/*\fR\fIA\fR\fI\&.jar:b\&.JAR\fRŸޤJARեν֤̤ȤʤޤΥꥹȤˤϡեޤᡢꤵ줿ǥ쥯ȥΤ٤ƤJARե뤬ޤޤޤ*ʤ륯饹ѥȥϡߤΥǥ쥯ȥΤ٤ƤJARեΥꥹȤŸޤ\fICLASSPATH\fRĶѿ⡢ˤƱͤŸޤ饹ѥΥ磻ɥɤŸϡJavaۥޥ(JVM)γ˹ԤޤJavaץϡĶ䤤礻ŸƤʤ磻ɥɤ򻲾Ȥޤ󡣤ȤС\fISystem\&.getenv("CLASSPATH")\fR򥳡뤷䤤礻Ǥ +たとえば、ディレクトリ\fImydir\fRに\fIa\&.jar\fRと\fIb\&.JAR\fRが含まれている場合、クラス・パス要素\fImydir/*\fRは\fIA\fR\fI\&.jar:b\&.JAR\fRに展開されますが、JARファイルの順番は未指定となります。このリストには、隠しファイルも含め、指定されたディレクトリ内のすべてのJARファイルが含まれます。*からなるクラス・パス・エントリは、現在のディレクトリ内のすべてのJARファイルのリストに展開されます。\fICLASSPATH\fR環境変数も、定義時には同様に展開されます。クラス・パスのワイルドカードの展開は、Java仮想マシン(JVM)の開始前に行われます。Javaプログラムは、環境を問い合せる場合を除き、展開されていないワイルドカードを参照しません。たとえば、\fISystem\&.getenv("CLASSPATH")\fRをコールして問い合せる場合です。 .RE .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹ɤѥꤷޤ֡ȥȥåס饹ϡǥեȤǤ\fIjre\elib\ert\&.jar\fR¾ΤĤJARեˤ롢Javaץåȥե륯饹Ǥ +ブートストラップ・クラスをロードするパスを指定します。ブートストラップ・クラスは、デフォルトでは\fIjre\elib\ert\&.jar\fRおよび他のいくつかのJARファイルにある、コアJavaプラットフォームを実装するクラスです。 .RE .PP \-old .RS 4 -ŤJDK 1\&.0Υإåե褦˻ꤷޤ +古いJDK 1\&.0形式のヘッダー・ファイルを生成するように指定します。 .RE .PP \-force .RS 4 -ϥե뤬˽񤭹ޤ褦˻ꤷޤ +出力ファイルが常に書き込まれるように指定します。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/javap.1 b/jdk/src/linux/doc/man/ja/javap.1 index 152821dfebe..5e115dc6192 100644 --- a/jdk/src/linux/doc/man/ja/javap.1 +++ b/jdk/src/linux/doc/man/ja/javap.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javap .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javap" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javap" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javap \- 1İʾΥ饹եե֥뤷ޤ -.SH "" +javap \- 1つ以上のクラス・ファイルを逆アセンブルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,51 +64,51 @@ javap \- 1 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassfile\fR .RS 4 -νоݤȤʤ롢Ƕڤä1İʾΥ饹(DocFooter\&.classʤ)饹ѥǸФǤ륯饹򡢥ե̾ޤURL(\fIfile:///home/user/myproject/src/DocFooter\&.class\fRʤ)ǻǤޤ +注釈の処理対象となる、空白で区切った1つ以上のクラス(DocFooter\&.classなど)。クラス・パスで検出できるクラスを、ファイル名またはURL(\fIfile:///home/user/myproject/src/DocFooter\&.class\fRなど)で指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjavap\fRޥɤϡ1ĤޤʣΥ饹եե֥뤷ޤνϤϻꤹ륪ץˤۤʤޤץꤷʤ硢\fIjavap\fRޥɤϡΥѥåϤ줿饹protectedpublicΥեɤȥ᥽åɤϤޤ\fIjavap\fRޥɤϤνϤ\fIɸ\fRɽޤ -.SH "ץ" +\fIjavap\fRコマンドは、1つまたは複数のクラス・ファイルを逆アセンブルします。その出力は指定するオプションにより異なります。オプションを指定しない場合、\fIjavap\fRコマンドは、そのパッケージ、渡されたクラスのprotectedおよびpublicのフィールドとメソッドを出力します。\fIjavap\fRコマンドはその出力を\fI標準出力\fRに表示します。 +.SH "オプション" .PP \-help, \-\-help, \-? .RS 4 -\fIjavap\fRޥɤˤĤƤΥإסåϤޤ +\fIjavap\fRコマンドについてのヘルプ・メッセージを出力します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-l .RS 4 -ֹȥѿɽϤޤ +行番号とローカル変数表を出力します。 .RE .PP \-public .RS 4 -public饹ӥСΤɽޤ +publicクラスおよびメンバーのみ表示します。 .RE .PP \-protected .RS 4 -protectedpublicΥ饹ȥСΤߤɽޤ +protectedおよびpublicのクラスとメンバーのみを表示します。 .RE .PP \-private, \-p .RS 4 -٤ƤΥ饹ȥСɽޤ +すべてのクラスとメンバーを表示します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤵ줿ץJVMϤޤ򼨤ޤ +指定されたオプションをJVMに渡します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -120,51 +120,51 @@ javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy My .if n \{\ .RE .\} -JVMץξܺ٤ϡޥɤΥޥ˥奢򻲾ȤƤ +JVMオプションの詳細は、コマンドのマニュアルを参照してください。 .RE .PP \-s .RS 4 -η˥Ϥޤ +内部の型シグニチャを出力します。 .RE .PP \-sysinfo .RS 4 -Υ饹Υƥ(ѥաMD5ϥå)ɽޤ +処理中のクラスのシステム情報(パス、サイズ、日付、MD5ハッシュ)を表示します。 .RE .PP \-constants .RS 4 -\fIstatic final\fRɽޤ +\fIstatic final\fR定数を表示します。 .RE .PP \-c .RS 4 -饹γƥ᥽åɤΤ˵ե֥뤵륳ɡʤJavaХȥɤʤ̿ɽޤ +クラスの各メソッドのために逆アセンブルされるコード、すなわちJavaバイトコードからなる命令を表示します。 .RE .PP \-verbose .RS 4 -᥽åɤΥålocalsargumentsοϤޤ +メソッドのスタック・サイズ、localsとargumentsの数を出力します。 .RE .PP \-classpath \fIpath\fR .RS 4 -饹õ\fIjavap\fRޥɤѤѥꤷޤǥեȤޤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤ +クラスを探すために\fIjavap\fRコマンドが使用するパスを指定します。デフォルトまたは\fICLASSPATH\fR環境変数の設定をオーバーライドします。 .RE .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹ɤѥꤷޤ֡ȥȥåס饹ϡǥեȤǤ\fIjre/lib/rt\&.jar\fR¾ΤĤJARեˤ롢Javaץåȥե륯饹Ǥ +ブートストラップ・クラスをロードするパスを指定します。ブートストラップ・クラスは、デフォルトでは\fIjre/lib/rt\&.jar\fRおよび他のいくつかのJARファイルにある、コアJavaプラットフォームを実装するクラスです。 .RE .PP \-extdir \fIdirs\fR .RS 4 -󥹥ȡ뤵줿ĥǽ򸡺򥪡С饤ɤޤĥǽΥǥեȰ֤\fIjava\&.ext\&.dirs\fRǤ +インストールされた拡張機能を検索する場所をオーバーライドします。拡張機能のデフォルト位置は\fIjava\&.ext\&.dirs\fRです。 .RE -.SH "" +.SH "例" .PP -\fIDocFooter\fR饹򥳥ѥ뤷ޤ +次の\fIDocFooter\fRクラスをコンパイルします。 .sp .if n \{\ .RS 4 @@ -193,7 +193,7 @@ public class DocFooter extends Applet { .RE .\} .PP -\fIjavap DocFooter\&.class\fRޥɤνϤϼޤ +\fIjavap DocFooter\&.class\fRコマンドからの出力は次を生成します。 .sp .if n \{\ .RS 4 @@ -212,7 +212,7 @@ public class DocFooter extends java\&.applet\&.Applet { .RE .\} .PP -\fIjavap \-c DocFooter\&.class\fRޥɤνϤϼޤ +\fIjavap \-c DocFooter\&.class\fRコマンドからの出力は次を生成します。 .sp .if n \{\ .RS 4 @@ -283,7 +283,7 @@ java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/javaws.1 b/jdk/src/linux/doc/man/ja/javaws.1 index fc32e88de73..97d9f82229c 100644 --- a/jdk/src/linux/doc/man/ja/javaws.1 +++ b/jdk/src/linux/doc/man/ja/javaws.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javaws .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Web Startġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Web Startツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javaws" "1" "2013ǯ1121" "JDK 8" "Java Web Startġ" +.TH "javaws" "1" "2013年11月21日" "JDK 8" "Java Web Startツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javaws \- Java Web Startưޤ -.SH "" +javaws \- Java Web Startを起動します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,147 +74,147 @@ javaws \- Java Web Start .PP \fIrun\-options\fR .RS 4 -ޥɥ饤\fI¹ԥץ\fR\fI¹ԥץ\fRǤդνǻǤޤ¹ԥץ򻲾ȤƤ +コマンドライン\fI実行オプション\fR。\fI実行オプション\fRは任意の順序で指定できます。実行オプションを参照してください。 .RE .PP \fIjnlp\fR .RS 4 -JNLP (Java Network Launching Protocol)եΥѥޤURL (Uniform Resource Locator)Τɤ餫 +JNLP (Java Network Launching Protocol)ファイルのパスまたはURL (Uniform Resource Locator)のどちらか。 .RE .PP -\fI楪ץ\fR +\fI制御オプション\fR .RS 4 -ޥɥ饤\fI楪ץ\fR\fI楪ץ\fRǤդνǻǤޤ楪ץ򻲾ȤƤ +コマンドライン\fI制御オプション\fR。\fI制御オプション\fRは任意の順序で指定できます。制御オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fB:\fR -\fIjavaws\fRޥɤϡOracle SolarisǤϻѤǤޤ +\fB注意:\fR +\fIjavaws\fRコマンドは、Oracle Solarisでは使用できません。 .PP -\fIjavaws\fRޥɤϡJNLPΥե󥹼ǤJava Web StartưޤJava Web StartϡͥåȥưJavaץꥱ󤪤ӥץåȤưޤ +\fIjavaws\fRコマンドは、JNLPのリファレンス実装であるJava Web Startを起動します。Java Web Startは、ネットワーク上で動作するJavaアプリケーションおよびアプレットを起動します。 .PP -JNLPե뤬ꤵȡ\fIjavaws\fRޥɤJNLPեǻꤷJavaץꥱޤϥץåȤưޤ +JNLPファイルが指定されると、\fIjavaws\fRコマンドはJNLPファイルで指定したJavaアプリケーションまたはアプレットを起動します。 .PP -\fIjavaws\fRưġˤϡߤΥ꡼ǥݡȤƤ1ȤΥץ󤬤ޤΥץϾΥ꡼ǤϺǽޤ -.SH "¹ԥץ" +\fIjavaws\fR起動ツールには、現在のリリースでサポートされている1組のオプションがあります。ただし、これらのオプションは将来のリリースでは削除される可能性があります。 +.SH "実行オプション" .PP \-offline .RS 4 -Java Web Start򥪥ե饤󡦥⡼ɤǼ¹Ԥޤ +Java Web Startをオフライン・モードで実行します。 .RE .PP \-Xnosplash .RS 4 -ץå̤ɽޤ +初期スプラッシュ画面を表示しません。 .RE .PP \-open \fIarguments\fR .RS 4 -ΥץꤹȡJNLPեΰ\fI\-open\fR -\fIarguments\fR֤ޤ +このオプションを指定すると、JNLPファイル内の引数が\fI\-open\fR +\fIarguments\fRに置き換わります。 .RE .PP \-print \fIarguments\fR .RS 4 -ΥץꤹȡJNLPեΰ\fI\-print\fR -\fIarguments\fR֤ޤ +このオプションを指定すると、JNLPファイル内の引数が\fI\-print\fR +\fIarguments\fRに置き換わります。 .RE .PP \-online .RS 4 -饤󡦥⡼ɤѤޤϡǥեȤưǤ +オンライン・モードを使用します。これは、デフォルトの動作です。 .RE .PP \-wait .RS 4 -\fIjavaws\fRץϡץꥱ󤬽λޤǽλޤWindowsץåȥեǤϡΥץȤ˵ǽޤ +\fIjavaws\fRプロセスは、アプリケーションが終了するまで終了しません。Windowsプラットフォーム上では、このオプションは説明したとおりに機能しません。 .RE .PP \-verbose .RS 4 -ɲäνϤɽޤ +追加の出力を表示します。 .RE .PP \-J\fIoption\fR .RS 4 -JavaۥޥoptionϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンにoptionを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE .PP \-system .RS 4 -ץꥱ򥷥ƥࡦåΤߤ¹Ԥޤ +アプリケーションをシステム・キャッシュのみから実行します。 .RE -.SH "楪ץ" +.SH "制御オプション" .PP \-viewer .RS 4 -Javaȥ롦ѥͥǥå塦ӥ塼ɽޤ +Javaコントロール・パネルでキャッシュ・ビューアを表示します。 .RE .PP \-clearcache .RS 4 -󥹥ȡ뤵Ƥʤ٤ƤΥץꥱ򥭥å夫ޤ +インストールされていないすべてのアプリケーションをキャッシュから削除します。 .RE .PP \-userConfig \fIproperty\-name\fR .RS 4 -ꤵ줿ǥץȡץѥƥ򥯥ꥢޤ +指定されたデプロイメント・プロパティをクリアします。 .RE .PP \-userConfig \fIproperty\-name property\-value\fR .RS 4 -ꤵ줿ǥץȡץѥƥꤵ줿ͤꤷޤ +指定されたデプロイメント・プロパティを指定された値に設定します。 .RE .PP \-uninstall .RS 4 -å夫餹٤ƤΥץꥱޤ +キャッシュからすべてのアプリケーションを削除します。 .RE .PP \-uninstall \fIjnlp\fR .RS 4 -å夫饢ץꥱޤ +キャッシュからアプリケーションを削除します。 .RE .PP \-print \fIimport\-options \fRjnlp .RS 4 -å˥ץꥱ򥤥ݡȤޤ +キャッシュにアプリケーションをインポートします。 .RE -.SH "ݡȡץ" +.SH "インポート・オプション" .PP \-silent .RS 4 -ȡ⡼ɤǥݡȤޤ(桼󥿥եɽޤ) +サイレント・モードでインポートします(ユーザー・インタフェースは表示されません)。 .RE .PP \-system .RS 4 -ƥࡦå˥ץꥱ򥤥ݡȤޤ +システム・キャッシュにアプリケーションをインポートします。 .RE .PP \-codebase \fIurl\fR .RS 4 -ꤷɥ١꥽ޤ +指定したコードベースからリソースを取得します。 .RE .PP \-shortcut .RS 4 -桼ץץȤХ硼ȥåȤ򥤥󥹥ȡ뤷ޤΥץϡ -\fI\-silent\fRץѤʤȸ̤ޤ +ユーザーがプロンプトを受け入れればショートカットをインストールします。このオプションは、 +\fI\-silent\fRオプションも使用しないと効果がありません。 .RE .PP \-association .RS 4 -桼ץץȤХ򥤥󥹥ȡ뤷ޤΥץϡ -\fI\-silent\fRץѤʤȸ̤ޤ +ユーザーがプロンプトを受け入れればアソシエーションをインストールします。このオプションは、 +\fI\-silent\fRオプションも使用しないと効果がありません。 .RE .PP -\fB:\fR\fIjavaws \-shortcut \-uninstall\fR -.SH "ե" +\fB注意:\fR\fIjavaws \-shortcut \-uninstall\fR +.SH "ファイル" .PP -桼ӥƥࡦåʤӤdeployment\&.propertiesեξܺ٤ϡե뤪ӥץѥƥΥǥץ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment\-guide/properties\&.html)򻲾ȤƤ -.SH "Ϣ" +ユーザーおよびシステム・キャッシュならびにdeployment\&.propertiesファイルの詳細は、構成ファイルおよびプロパティのデプロイメント +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment\-guide/properties\&.html)を参照してください +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jcmd.1 b/jdk/src/linux/doc/man/ja/jcmd.1 index d79de5a2d19..7dff3400c42 100644 --- a/jdk/src/linux/doc/man/ja/jcmd.1 +++ b/jdk/src/linux/doc/man/ja/jcmd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jcmd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jcmd" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jcmd" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jcmd \- ¹Javaۥޥ(JVM)˿ǥޥɡꥯȤޤ -.SH "" +jcmd \- 実行中のJava仮想マシン(JVM)に診断コマンド・リクエストを送信します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -91,53 +91,53 @@ jcmd \- .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIjcmd\fR桼ƥƥϡJVM˿ǥޥɡꥯȤ뤿˻ѤޤJVMƯƤΤƱޥǻѤJVMεư˻ѤΤƱͭ桼ӥ롼׼̻ҤäƤɬפޤ +\fIjcmd\fRユーティリティは、JVMに診断コマンド・リクエストを送信するために使用されます。これはJVMが稼働しているのと同じマシンで使用し、JVMの起動に使用したものと同じ有効ユーザーおよびグループ識別子を持っている必要があります。 .PP -\fB:\fR -⡼ȡޥ󤫤顢ޤ̤μ̻Ҥǿǥޥɤưˤϡ\fIcom\&.sun\&.management\&.DiagnosticCommandMBean\fR󥿥եѤǤޤ\fIDiagnosticCommandMBean\fR󥿥եξܺ٤ϡhttp://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.htmlˤAPIɥȤ򻲾ȤƤ +\fB注意:\fR +リモート・マシンから、または別の識別子で診断コマンドを起動するには、\fIcom\&.sun\&.management\&.DiagnosticCommandMBean\fRインタフェースを使用できます。\fIDiagnosticCommandMBean\fRインタフェースの詳細は、http://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.htmlにあるAPIドキュメントを参照してください。 .PP -\fIjcmd\fRʤޤ\fI\- l\fRץꤷƼ¹Ԥϡ¹Javaץ̻ҤΥꥹȤᥤ󡦥饹ӥץεư˻Ѥ줿ޥɥ饤ȤȤ˽Ϥޤ\fI\-h\fRޤ\fI\-help\fRץꤷ\fIjcmd\fR¹ԤȡġΥإסåϤޤ +\fIjcmd\fRを引数なしまたは\fI\- l\fRオプションを指定して実行した場合は、実行中のJavaプロセス識別子のリストが、メイン・クラスおよびプロセスの起動に使用されたコマンドライン引数とともに出力されます。\fI\-h\fRまたは\fI\-help\fRオプションを指定して\fIjcmd\fRを実行すると、ツールのヘルプ・メッセージが出力されます。 .PP -ץ̻(\fIpid\fR)ޤϥᥤ󡦥饹(\fImain\-class\fR)ǽΰȤƻꤷ硢\fIjcmd\fRϡ̻ҤꤷJavaץˡᥤ󡦥饹̾ꤷϤ٤ƤJavaץ˿ǥޥɡꥯȤޤץ̻ҤȤ\fI0\fRꤷơ٤ƤλѲǽJavaץ˿ǥޥɡꥯȤ뤳ȤǤޤǥޥɡꥯȤȤơΤ줫Ѥޤ +プロセス識別子(\fIpid\fR)またはメイン・クラス(\fImain\-class\fR)を最初の引数として指定した場合、\fIjcmd\fRは、識別子を指定した場合はJavaプロセスに、メイン・クラスの名前を指定した場合はすべてのJavaプロセスに診断コマンド・リクエストを送信します。プロセス識別子として\fI0\fRを指定して、すべての使用可能なJavaプロセスに診断コマンド・リクエストを送信することもできます。診断コマンド・リクエストとして、次のいずれかを使用します。 .PP Perfcounter\&.print .RS 4 -ꤷJavaץǻѲǽʥѥեޥ󥹡󥿤Ϥޤѥեޥ󥹡󥿤ΥꥹȤJavaץˤäưۤʤ礬ޤ +指定したJavaプロセスで使用可能なパフォーマンス・カウンタが出力されます。パフォーマンス・カウンタのリストはJavaプロセスによって異なる場合があります。 .RE .PP \-f \fIfilename\fR .RS 4 -ǥޥɤɤ߼ꡢꤷJavaץե̾\fI\-f\fRץǤΤ߻Ѥޤեγƥޥɤϡ1ԤǵҤɬפޤֹ浭(\fI#\fR)ǻϤޤԤ̵뤵ޤ٤ƤιԤɤ߼뤫\fIstop\fRɤޤԤɤ߼ȡեνλޤ +診断コマンドを読み取り、指定したJavaプロセスに送信するファイルの名前。\fI\-f\fRオプションでのみ使用します。ファイル内の各コマンドは、1行で記述する必要があります。番号記号(\fI#\fR)で始まる行は無視されます。すべての行が読み取られるか、\fIstop\fRキーワードを含む行が読み取られると、ファイルの処理が終了します。 .RE .PP \fIcommand\fR [\fIarguments\fR] .RS 4 -ꤵ줿Javaץ륳ޥɡꤷץǻѤǤǥޥɤΥꥹȤϡΥץФ\fIhelp\fRޥɤɽޤƿǥޥɤȼΰåȤޤޥɤʸӻѲǽʰΥꥹȤɽˤϡ\fIhelp\fRޥɤΰȤƥޥ̾Ѥޤ +指定されたJavaプロセスに送信するコマンド。指定したプロセスで使用できる診断コマンドのリストは、このプロセスに対して\fIhelp\fRコマンドを送信すれば表示されます。各診断コマンドに独自の引数セットがあります。コマンドの説明、構文および使用可能な引数のリストを表示するには、\fIhelp\fRコマンドの引数としてコマンド名を使用します。 .sp -\fB:\fR -˥ڡޤޤƤϡŰޤŰ(\fI\*(Aq\fRޤ\fI"\fR)ǰϤɬפޤäơڥ졼ƥ󥰡ƥࡦ뤬ʤ褦ˡХåå(\fI\e\fR)ǰŰޤŰ򥨥פɬפޤޤϡΰŰǰϤǤ顢ŰǰϤळȤǤޤ(ޤŰǰϤǤ顢ŰǰϤ) +\fB注意:\fR +引数にスペースが含まれている場合は、一重引用符または二重引用符(\fI\*(Aq\fRまたは\fI"\fR)で囲む必要があります。加えて、オペレーティング・システム・シェルが引用符を処理しないように、バックスラッシュ(\fI\e\fR)で一重引用符または二重引用符をエスケープする必要があります。または、これらの引数を一重引用符で囲んでから、二重引用符で囲むこともできます(または二重引用符で囲んでから、一重引用符で囲む)。 .RE -.SH "ץ" +.SH "オプション" .PP -ƥץϸߤ¾ŪǤ +各オプションは互いに排他的です。 .PP \-f \fIfilename\fR .RS 4 -ꤵ줿ե뤫饳ޥɤɤ߼ޤΥץϡǽΰȤƥץ̻Ҥޤϥᥤ󡦥饹ꤹˤΤ߻ѤǤޤեγƥޥɤϡ1ԤǵҤɬפޤֹ浭(\fI#\fR)ǻϤޤԤ̵뤵ޤ٤ƤιԤɤ߼뤫\fIstop\fRɤޤԤɤ߼ȡեνλޤ +指定されたファイルからコマンドを読み取ります。このオプションは、最初の引数としてプロセス識別子またはメイン・クラスを指定する場合にのみ使用できます。ファイル内の各コマンドは、1行で記述する必要があります。番号記号(\fI#\fR)で始まる行は無視されます。すべての行が読み取られるか、\fIstop\fRキーワードを含む行が読み取られると、ファイルの処理が終了します。 .RE .PP \-h, \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-l .RS 4 -¹Javaץ̻ҤΥꥹȤᥤ󡦥饹ӥޥɥ饤ȤȤ˽Ϥޤ +実行中のJavaプロセス識別子のリストをメイン・クラスおよびコマンドライン引数とともに出力します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jconsole.1 b/jdk/src/linux/doc/man/ja/jconsole.1 index 426fb365ba8..1ba103b7db0 100644 --- a/jdk/src/linux/doc/man/ja/jconsole.1 +++ b/jdk/src/linux/doc/man/ja/jconsole.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jconsole .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaȥ֥륷塼ƥ󥰡ץե󥰡˥󥰤Ӵġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaトラブルシューティング、プロファイリング、モニタリングおよび管理ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jconsole" "1" "2013ǯ1121" "JDK 8" "Javaȥ֥륷塼ƥ󥰡ץե󥰡˥" +.TH "jconsole" "1" "2013年11月21日" "JDK 8" "Javaトラブルシューティング、プロファイリング、モニタリン" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jconsole \- Javaץꥱƻ뤪Ӵ뤿Υե롦󥽡򳫻Ϥޤ -.SH "" +jconsole \- Javaアプリケーションを監視および管理するためのグラフィカル・コンソールを開始します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,56 +64,56 @@ jconsole \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR .RS 4 -\fIpid\fRͤϥJavaۥޥ(JVM)ΥץIDǤJVM\fIjconsole\fRޥɤ¹ԤƤ桼IDƱ桼IDǼ¹Ԥɬפޤ\fIhost:port\fRͤJVMưƤۥȡƥ̾ȡJVMϤȤ˥ƥࡦץѥƥ\fIcom\&.sun\&.management\&.jmxremote\&.port\fRǻꤷݡֹǤ\fIjmxUrl\fRͤϡJMXServiceURLǵҤƤ롢³JMXȤΥɥ쥹Ǥ +\fIpid\fR値はローカルのJava仮想マシン(JVM)のプロセスIDです。JVMは\fIjconsole\fRコマンドを実行しているユーザーIDと同じユーザーIDで実行する必要があります。\fIhost:port\fR値はJVMが動作しているホスト・システムの名前と、JVMが開始したときにシステム・プロパティ\fIcom\&.sun\&.management\&.jmxremote\&.port\fRで指定したポート番号です。\fIjmxUrl\fR値は、JMXServiceURLで記述されている、接続されるJMXエージェントのアドレスです。 .sp -\fIconnection\fRѥ᡼ξܺ٤ϡJMXƥΥѤ˥󥰤Ӵ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html)򻲾ȤƤ +\fIconnection\fRパラメータの詳細は、JMXテクノロジを使用したモニタリングおよび管理 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html)を参照してください .sp -\fIJMXServiceURL\fR饹( -http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html)⻲ȤƤ +\fIJMXServiceURL\fRクラスの説明( +http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html)も参照してください .RE -.SH "" +.SH "説明" .PP -\fIjconsole\fRޥɤϡ롦ޥޤϥ⡼ȡޥJavaץꥱȲۥޥδƻȴԤե롦󥽡롦ġưޤ +\fIjconsole\fRコマンドは、ローカル・マシンまたはリモート・マシン上のJavaアプリケーションと仮想マシンの監視と管理を行うグラフィカル・コンソール・ツールを起動します。 .PP -WindowsǤϡ\fIjconsole\fRޥɤϥ󥽡롦ɥȴϢդƤޤ󡣤\fIjconsole\fRޥɤԤȡ顼򼨤ܥåɽޤ -.SH "ץ" +Windows上では、\fIjconsole\fRコマンドはコンソール・ウィンドウと関連付けられていません。ただし、\fIjconsole\fRコマンドが失敗すると、エラー情報を示すダイアログ・ボックスが表示されます。 +.SH "オプション" .PP \-interval\fI=n\fR .RS 4 -ֳ֤\fIn\fRäꤷޤ(ǥեȤ4) +更新間隔を\fIn\fR秒に設定します(デフォルトは4秒)。 .RE .PP \-notile .RS 4 -ǽ˥ɥ򥿥󥰤ޤ(ʣ³ξ) +最初にウィンドウをタイリングしません(複数接続の場合)。 .RE .PP \-pluginpath \fIplugins\fR .RS 4 -\fIJConsole\fRץ饰򸡺ǥ쥯ȥޤJARեΥꥹȤꤷޤ\fIplugins\fRѥˤ\fIMETA\-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRȤ̾ΥץХեޤǤɬפꡢˤϥץ饰󤴤Ȥ1ԤޤޤƤޤιԤ\fIcom\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR饹Ƥ륯饹δ饹̾ꤷޤ +\fIJConsole\fRプラグインを検索するディレクトリまたはJARファイルのリストを指定します。\fIplugins\fRパスには\fIMETA\-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRという名前のプロバイダ構成ファイルを含んでいる必要があり、これにはプラグインごとに1行が含まれています。その行は\fIcom\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRクラスを実装しているクラスの完全修飾クラス名を指定します。 .RE .PP \-version .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjconsole\fRޥɤ¹ԤJVM\fIflag\fRϤޤ +\fIjconsole\fRコマンドを実行したJVMに\fIflag\fRを渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -123,7 +123,7 @@ Windows .sp -1 .IP \(bu 2.3 .\} -JConsoleλ +JConsoleの使用 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html) .RE .sp @@ -135,7 +135,7 @@ JConsole .sp -1 .IP \(bu 2.3 .\} -JMXƥΥѤ˥󥰤Ӵ +JMXテクノロジを使用したモニタリングおよび管理 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html) .RE @@ -148,7 +148,7 @@ JMX .sp -1 .IP \(bu 2.3 .\} -\fIJMXServiceURL\fR饹( +\fIJMXServiceURL\fRクラスの説明( http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html) .RE .br diff --git a/jdk/src/linux/doc/man/ja/jdb.1 b/jdk/src/linux/doc/man/ja/jdb.1 index f7bcabdec2f..fe08770ee07 100644 --- a/jdk/src/linux/doc/man/ja/jdb.1 +++ b/jdk/src/linux/doc/man/ja/jdb.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jdb .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jdb" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jdb" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jdb \- JavaץåȥեࡦץԶ򸡽Фӽޤ -.SH "" +jdb \- Javaプラットフォーム・プログラムの不具合を検出および修正します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,25 +64,25 @@ jdb \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclass\fRname .RS 4 -ǥХåᥤ󡦥饹̾ +デバッグするメイン・クラスの名前。 .RE .PP \fIarguments\fR .RS 4 -class\fImain()\fR᥽åɤϤ +classの\fImain()\fRメソッドに渡す引数。 .RE -.SH "" +.SH "説明" .PP -JavaǥХå(JDB)ϡJava饹Ѥδñʥޥɥ饤󡦥ǥХåǤ\fIjdb\fRޥɤȤΥץJDBƤӽФޤ\fIjdb\fRޥɤϡJDBA (Java Platform Debugger Architecture)Ū˼¹Ԥޤϥ⡼ȤJavaۥޥ(JVM)θȥǥХåԤȤǤޤJava Platform Debugger Architecture (JDBA) -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)򻲾ȤƤ -.SS "JDBåγ" +Javaデバッガ(JDB)は、Javaクラス用の簡単なコマンドライン・デバッガです。\fIjdb\fRコマンドとそのオプションはJDBを呼び出します。\fIjdb\fRコマンドは、JDBA (Java Platform Debugger Architecture)を視覚的に実行し、ローカルまたはリモートのJava仮想マシン(JVM)の検査とデバッグを行うことができます。Java Platform Debugger Architecture (JDBA) +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)を参照してください。 +.SS "JDBセッションの開始" .PP -JDBå򳫻Ϥˤ͡ˡޤǤˤ˻ѤΤϡǥХå륢ץꥱΥᥤ󡦥饹ѤơJDB鿷JVMưˡǤޥɥ饤ǡ\fIjava\fRޥɤΤ\fIjdb\fRޥɤϤޤȤСץꥱΥᥤ󡦥饹\fIMyClass\fRξϡJDBĶǥǥХåȤ˼ΥޥɤѤޤ +JDBセッションを開始するには様々な方法があります。最も頻繁に使用されるのは、デバッグするアプリケーションのメイン・クラスを使用して、JDBから新しいJVMを起動する方法です。コマンドラインで、\fIjava\fRコマンドのかわりに\fIjdb\fRコマンドを入力します。たとえば、アプリケーションのメイン・クラスが\fIMyClass\fRの場合は、JDB環境でデバッグするときに次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -94,9 +94,9 @@ jdb MyClass .RE .\} .PP -ˡǵưȡ\fIjdb\fRޥɤϡꤵ줿ѥ᡼Ѥ2ܤJVMƤӽФޤˡꤵ줿饹ɤơ饹κǽ̿¹ԤJVMߤޤ +この方法で起動すると、\fIjdb\fRコマンドは、指定されたパラメータを使用して2つ目のJVMを呼び出します。次に、指定されたクラスをロードして、クラスの最初の命令を実行する前にJVMを停止させます。 .PP -\fIjdb\fRޥɤΤ⤦1ĤλˡϡǤ˼¹JVMjdb³뤳ȤǤ\fIjdb\fRޥɤ³VM򡢤μ¹˵ư뤿ιʸ򼡤˼ޤϡץǥХåѥ饤֥ɤ³μꤷޤ +\fIjdb\fRコマンドのもう1つの使用方法は、すでに実行中のJVMにjdbを接続することです。\fIjdb\fRコマンドが接続するVMを、その実行中に起動するための構文を次に示します。これは、インプロセス・デバッグ用ライブラリをロードし、接続の種類を指定します。 .sp .if n \{\ .RS 4 @@ -108,7 +108,7 @@ java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass .RE .\} .PP -ΥޥɤѤơ\fIjdb\fRޥɤJVM³Ǥޤ +次のコマンドを使用して、\fIjdb\fRコマンドをJVMに接続できます。 .sp .if n \{\ .RS 4 @@ -120,36 +120,36 @@ jdb \-attach 8000 .RE .\} .PP -ξ硢\fIjdb\fRޥɤϿJVMư뤫˴¸JVM³뤿ᡢ\fIjdb\fRޥɥ饤\fIMyClass\fRϻꤷޤ +この場合、\fIjdb\fRコマンドは新しいJVMを起動するかわりに既存のJVMに接続されるため、\fIjdb\fRコマンドラインに\fIMyClass\fR引数は指定しません。 .PP -ǥХåJVM³ˤ¾ˤ͡ˡꡢ٤\fIjdb\fRޥɤǥݡȤƤޤ³ץˤĤƤϡJava Platform Debugger ArchitectureΥɥȤ򻲾ȤƤ -.SS "jdbޥ" +デバッガをJVMに接続するには他にも様々な方法があり、すべて\fIjdb\fRコマンドでサポートされています。接続オプションについては、Java Platform Debugger Architectureのドキュメントを参照してください。 +.SS "基本jdbコマンド" .PP -Ū\fIjdb\fRޥɤΰ򼨤ޤJDBݡȤ륳ޥɤϤʳˤ⤢ꡢ\fI\-help\fRץѤɽǤޤ +基本的な\fIjdb\fRコマンドの一覧を示します。JDBがサポートするコマンドはこれ以外にもあり、それらは\fI\-help\fRオプションを使用して表示できます。 .PP -helpޤ? +helpまたは? .RS 4 -\fIhelp\fRޤ\fI?\fRޥɤϡǧ줿ޥɤΥꥹȤ˴ʷդɽޤ +\fIhelp\fRまたは\fI?\fRコマンドは、認識されたコマンドのリストに簡潔な説明を付けて表示します。 .RE .PP run .RS 4 -JDBưƥ֥졼ݥȤꤷȤˡ\fIrun\fRޥɤѤơǥХå륢ץꥱμ¹Ԥ򳫻ϤǤޤ\fIrun\fRޥɤϡ¸VM³ƤȤϰۤʤꡢǥХå륢ץꥱ\fIjdb\fR鵯ưȤˤΤ߻ѤǤޤ +JDBを起動してブレークポイントを設定したあとに、\fIrun\fRコマンドを使用して、デバッグするアプリケーションの実行を開始できます。\fIrun\fRコマンドは、既存のVMに接続している場合とは異なり、デバッグするアプリケーションが\fIjdb\fRから起動したときにのみ使用できます。 .RE .PP cont .RS 4 -֥졼ݥȡ㳰ޤϥƥå׼¹ԤθǡǥХå륢ץꥱμ¹Ԥ³ޤ +ブレークポイント、例外、またはステップ実行の後で、デバッグするアプリケーションの実行を継続します。 .RE .PP print .RS 4 -Java֥ȤӥץߥƥͤɽޤץߥƥַѿޤϥեɤξˤϡºݤͤϤޤ֥ȤξˤϡûϤޤ֥Ȥξܺ٤ˡõˤϡdumpޥɤ򻲾ȤƤ +Javaオブジェクトおよびプリミティブ値を表示します。プリミティブ型の変数またはフィールドの場合には、実際の値が出力されます。オブジェクトの場合には、短い説明が出力されます。オブジェクトの詳細を取得する方法を探すには、dumpコマンドを参照してください。 .sp -\fB:\fR -ѿɽˤϡޤǤ륯饹\fIjavac \-g\fRץѤƥѥ뤵Ƥɬפޤ +\fB注意:\fR +ローカル変数を表示するには、含んでいるクラスが\fIjavac \-g\fRオプションを使用してコンパイルされている必要があります。 .sp -\fIprint\fRޥɤϡ˼褦ʡ᥽åɸƽФѤΤʤɡ¿δñJava򥵥ݡȤޤ +\fIprint\fRコマンドは、次に示すような、メソッド呼出しを使用したものなど、多くの簡単なJava式をサポートします。 .sp .if n \{\ .RS 4 @@ -168,12 +168,12 @@ print new java\&.lang\&.String("Hello")\&.length() .PP dump .RS 4 -ץߥƥͤξ硢\fIdump\fRޥɤ\fIprint\fRޥɤƱǤ֥Ȥξ硢\fIdump\fRޥɤǤϡ֥ƤƥեɤθߤͤϤޤstaticեɤinstanceեɤϤޤ\fIdump\fRޥɤǤϡ\fIprint\fRޥɤƱݡȤޤ +プリミティブ値の場合、\fIdump\fRコマンドは\fIprint\fRコマンドと同一です。オブジェクトの場合、\fIdump\fRコマンドでは、オブジェクト内に定義されている各フィールドの現在の値が出力されます。staticフィールドとinstanceフィールドが出力されます。\fIdump\fRコマンドでは、\fIprint\fRコマンドと同じ式がサポートされます。 .RE .PP threads .RS 4 -߼¹ΥåɤɽޤåɤȤˡ̾ȸߤξ֡¾Υޥɤ˻ѤǤ륤ǥåϤޤǤϡåɡǥå4Ǥꡢåɤ\fIjava\&.lang\&.Thread\fRΥ󥹥󥹤ǡåɤ̾\fImain\fRǤꡢ߼¹Ǥ +現在実行中のスレッドを一覧表示します。スレッドごとに、名前と現在の状態、および他のコマンドに使用できるインデックスが出力されます。この例では、スレッド・インデックスは4であり、スレッドは\fIjava\&.lang\&.Thread\fRのインスタンスで、スレッドの名前は\fImain\fRであり、現在実行中です。 .sp .if n \{\ .RS 4 @@ -188,20 +188,20 @@ threads .PP thread .RS 4 -ߤΥåɤˤ륹åɤ򤷤ޤ¿\fIjdb\fRޥɤϡߤΥåɤ˴ŤƼ¹ԤޤåɤϡthreadsޥɤåɡǥåȤȤ˻ꤷޤ +現在のスレッドにするスレッドを選択します。多くの\fIjdb\fRコマンドは、現在のスレッドの設定に基づいて実行されます。スレッドは、threadsコマンドで説明したスレッド・インデックスとともに指定します。 .RE .PP where .RS 4 -ꤷʤ\fIwhere\fRޥɤ¹ԤȡߤΥåɤΥåפޤ\fIwhere\fR -\fIall\fRޥɤϡߤΥåɡ롼פˤ륹åɤΥå򤹤٤ƥפޤ\fIwhere\fR -\fIthreadindex\fRޥɤϡꤵ줿åɤΥåפޤ +引数を指定しないで\fIwhere\fRコマンドを実行すると、現在のスレッドのスタックがダンプされます。\fIwhere\fR +\fIall\fRコマンドは、現在のスレッド・グループにあるスレッドのスタックをすべてダンプします。\fIwhere\fR +\fIthreadindex\fRコマンドは、指定されたスレッドのスタックをダンプします。 .sp -ߤΥåɤ(֥졼ݥȤ\fIsuspend\fRޥɤˤä)ǤƤϡѿȥեɤ\fIprint\fRޥɤ\fIdump\fRޥɤɽǤޤ\fIup\fRޥɤ\fIdown\fRޥɤǡɤΥåե졼򸽺ߤΥåե졼ˤ뤫֤ȤǤޤ +現在のスレッドが(ブレークポイントか\fIsuspend\fRコマンドによって)中断している場合は、ローカル変数とフィールドは\fIprint\fRコマンドと\fIdump\fRコマンドで表示できます。\fIup\fRコマンドと\fIdown\fRコマンドで、どのスタック・フレームを現在のスタック・フレームにするかを選ぶことができます。 .RE -.SS "֥졼ݥ" +.SS "ブレークポイント" .PP -֥졼ݥȤϡֹޤϥ᥽åɤκǽ̿JDBǤޤ򼨤ޤ +ブレークポイントは、行番号またはメソッドの最初の命令でJDBに設定できます。次に例を示します。 .sp .RS 4 .ie n \{\ @@ -211,7 +211,7 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop at MyClass:22\fRϡ\fIMyClass\fRޤޤ륽ե22ܤκǽ̿˥֥졼ݥȤꤷޤ +コマンド\fIstop at MyClass:22\fRは、\fIMyClass\fRが含まれるソース・ファイルの22行目の最初の命令にブレークポイントを設定します。 .RE .sp .RS 4 @@ -222,7 +222,7 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop in java\&.lang\&.String\&.length\fRϡ᥽å\fIjava\&.lang\&.String\&.length\fRƬ˥֥졼ݥȤꤷޤ +コマンド\fIstop in java\&.lang\&.String\&.length\fRは、メソッド\fIjava\&.lang\&.String\&.length\fRの先頭にブレークポイントを設定します。 .RE .sp .RS 4 @@ -233,106 +233,106 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop in MyClass\&.<clinit>\fRϡ\fI<clinit>\fRѤ\fIMyClass\fRŪɤꤷޤ +コマンド\fIstop in MyClass\&.<clinit>\fRは、\fI<clinit>\fRを使用して\fIMyClass\fRの静的初期化コードを特定します。 .RE .PP -᥽åɤСɤƤˤϡ᥽åɤΰηꤷơ֥졼ݥȤФŬڤʥ᥽åɤ򤵤褦ˤɬפޤȤС\fIMyClass\&.myMethod(int,java\&.lang\&.String)\fRޤ\fIMyClass\&.myMethod()\fRȻꤷޤ +メソッドがオーバーロードされている場合には、メソッドの引数の型も指定して、ブレークポイントに対して適切なメソッドが選択されるようにする必要があります。たとえば、\fIMyClass\&.myMethod(int,java\&.lang\&.String)\fRまたは\fIMyClass\&.myMethod()\fRと指定します。 .PP -\fIclear\fRޥɤϡ\fIclear MyClass:45\fRΤ褦ʹʸѤƥ֥졼ݥȤޤ\fIclear\fRѤ뤫ꤷʤ\fIstop\fRޥɤѤȡꤵƤ뤹٤ƤΥ֥졼ݥȤɽޤ\fIcont\fRޥɤϼ¹Ԥ³ޤ -.SS "ƥå׼¹" +\fIclear\fRコマンドは、\fIclear MyClass:45\fRのような構文を使用してブレークポイントを削除します。\fIclear\fRを使用するか、引数を指定しないで\fIstop\fRコマンドを使用すると、現在設定されているすべてのブレークポイントが表示されます。\fIcont\fRコマンドは実行を継続します。 +.SS "ステップ実行" .PP -\fIstep\fRޥɤϡߤΥåե졼ޤϸƤӽФ줿᥽åǡιԤ¹Ԥޤ\fInext\fRޥɤϡߤΥåե졼μιԤ¹Ԥޤ -.SS "㳰" +\fIstep\fRコマンドは、現在のスタック・フレームまたは呼び出されたメソッド内で、次の行を実行します。\fInext\fRコマンドは、現在のスタック・フレームの次の行を実行します。 +.SS "例外" .PP -Ƥ륹åɤθƽФåΤɤˤ\fIcatch\fRʸʤ㳰ȯȡJVM̾㳰ȥ졼ϤƽλޤJDBĶǼ¹ԤƤϡȿΥJDB椬ޤˡ\fIjdb\fRޥɤѤ㳰θǤޤ +スローしているスレッドの呼出しスタック上のどこにも\fIcatch\fR文がない場合に例外が発生すると、JVMは通常、例外トレースを出力して終了します。ただし、JDB環境で実行している場合は、違反のスロー時にJDBに制御が戻ります。次に、\fIjdb\fRコマンドを使用して例外の原因を診断します。 .PP -ȤС\fIcatch java\&.io\&.FileNotFoundException\fRޤ\fIcatch\fR -\fImypackage\&.BigTroubleException\fRΤ褦\fIcatch\fRޥɤѤȡǥХå줿ץꥱϡ¾㳰줿Ȥߤޤ㳰Υ饹ޤϥ֥饹Υ󥹥󥹤ξϡץꥱ㳰줿ߤޤ +たとえば、\fIcatch java\&.io\&.FileNotFoundException\fRまたは\fIcatch\fR +\fImypackage\&.BigTroubleException\fRのように\fIcatch\fRコマンドを使用すると、デバッグされたアプリケーションは、他の例外がスローされたときに停止します。例外が特定のクラスまたはサブクラスのインスタンスの場合は、アプリケーションは例外がスローされた場所で停止します。 .PP -\fIignore\fRޥɤѤȡ\fIcatch\fRޥɤθ̵̤ˤʤޤ\fIignore\fRޥɤǤϡǥХåJVM㳰̵뤻ǥХåΤߤ̵뤷ޤ -.SH "ץ" +\fIignore\fRコマンドを使用すると、以前の\fIcatch\fRコマンドの効果が無効になります。\fIignore\fRコマンドでは、デバッグされるJVMは特定の例外を無視せず、デバッガのみを無視します。 +.SH "オプション" .PP -ޥɥ饤\fIjava\fRޥɤΤ\fIjdb\fRޥɤѤ硢\fIjdb\fRޥɤϡ\fI\-D\fR\fI\-classpath\fR\fI\-X\fRʤɡ\fIjava\fRޥɤƱΥץޤ\fIjdb\fRޥɤϡ¾˼ΥꥹȤˤ륪ץޤ +コマンドラインで\fIjava\fRコマンドのかわりに\fIjdb\fRコマンドを使用する場合、\fIjdb\fRコマンドは、\fI\-D\fR、\fI\-classpath\fR、\fI\-X\fRなど、\fIjava\fRコマンドと同じ数のオプションを受け入れます。\fIjdb\fRコマンドは、その他に次のリストにあるオプションを受け入れます。 .PP -ǥХåԤJVM˥ǥХå³뤿ص󶡤뤿ˡ¾Υץ󤬥ݡȤƤޤ³ؤ˴ؤܺ٤ʥɥȤϡJava Platform Debugger Architecture (JPDA) -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)򻲾ȤƤ +デバッグを行うJVMにデバッガを接続するための代替機構を提供するために、その他のオプションがサポートされています。これらの接続の代替に関する詳細なドキュメントは、Java Platform Debugger Architecture (JPDA) +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)を参照してください .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-sourcepath \fIdir1:dir2: \&. \&. \&.\fR .RS 4 -ꤵ줿ѥѤơե򸡺ޤΥץ󤬻ꤵƤʤϡǥեȡѥΥɥå(\&.)Ѥޤ +指定されたパスを使用して、ソース・ファイルを検索します。このオプションが指定されていない場合は、デフォルト・パスのドット(\&.)が使用されます。 .RE .PP \-attach \fIaddress\fR .RS 4 -ǥեȤ³Ѥơ¹JVM˥ǥХå³ޤ +デフォルトの接続機構を使用して、実行中のJVMにデバッガを接続します。 .RE .PP \-listen \fIaddress\fR .RS 4 -¹JVMɸΥͥѤƻꤵ줿ɥ쥹³ΤԵޤ +実行中のJVMが標準のコネクタを使用して指定されたアドレスに接続するのを待機します。 .RE .PP \-launch .RS 4 -ǥХå륢ץꥱJDBεư夿˵ưޤ\fI\-launch\fRץˤꡢ\fIrun\fRޥɤɬפʤʤޤǥХå륢ץꥱϡư塢ץꥱ󡦥饹ɤľߤޤλǡɬפʥ֥졼ݥȤꤷ\fIcont\fRޥɤѤƼ¹Ԥ³Ǥޤ +デバッグするアプリケーションをJDBの起動後ただちに起動します。\fI\-launch\fRオプションにより、\fIrun\fRコマンドが必要なくなります。デバッグするアプリケーションは、起動後、初期アプリケーション・クラスがロードされる直前に停止します。その時点で、必要なブレークポイントを設定し、\fIcont\fRコマンドを使用して実行を継続できます。 .RE .PP \-listconnectors .RS 4 -JVMѤǤ륳ͥɽޤ +このJVMで利用できるコネクタを一覧表示します。 .RE .PP \-connect connector\-name:\fIname1=value1\fR .RS 4 -ɽ줿ͤȻΥͥѤƥåJVM³ޤ +一覧表示された引数の値と指定のコネクタを使用してターゲットJVMに接続します。 .RE .PP \-dbgtrace [\fIflags\fR] .RS 4 -\fIjdb\fRޥɤΥǥХåξϤޤ +\fIjdb\fRコマンドのデバッグの情報を出力します。 .RE .PP \-tclient .RS 4 -Java HotSpot VM饤ǥץꥱ¹Ԥޤ +Java HotSpot VMクライアント内でアプリケーションを実行します。 .RE .PP \-tserver .RS 4 -Java HotSpot VMСǥץꥱ¹Ԥޤ +Java HotSpot VMサーバー内でアプリケーションを実行します。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ǥХåоݤΥץž륪ץ" +.SH "デバッグ対象のプロセスに転送されるオプション" .PP \-v \-verbose[:\fIclass\fR|gc|jni] .RS 4 -Ĺ⡼ɤˤޤ +冗長モードにします。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -ƥࡦץѥƥꤷޤ +システム・プロパティを設定します。 .RE .PP \-classpath \fIdir\fR .RS 4 -饹򸡺뤿ΡǶڤäƻꤵ줿ǥ쥯ȥΥꥹȡ +クラスを検索するための、コロンで区切って指定されたディレクトリのリスト。 .RE .PP \-X\fIoption\fR .RS 4 -ɸॿåJVMץǤ +非標準ターゲットJVMオプションです。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jdeps.1 b/jdk/src/linux/doc/man/ja/jdeps.1 index 9ab6f666e0c..0dd46783822 100644 --- a/jdk/src/linux/doc/man/ja/jdeps.1 +++ b/jdk/src/linux/doc/man/ja/jdeps.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jdeps .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jdeps" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jdeps" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jdeps \- Java饹¸ʥ饤 -.SH "" +jdeps \- Javaクラス依存性アナライザ。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,99 +64,99 @@ jdeps \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclasses\fR .RS 4 -ʬϤ륯饹̾饹ѥǸФǤ륯饹򡢥ե̾ǥ쥯ȥޤJARեǻǤޤ +分析するクラスの名前。クラス・パスで検出できるクラスを、ファイル名、ディレクトリまたはJARファイルで指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjdeps\fRޥɤϡJava饹եΥѥå٥ޤϥ饹٥ΰ¸򼨤ޤϥ饹ˤϡ\fI\&.class\fRեΥѥ̾ǥ쥯ȥꡢJARե롢ޤϤ٤ƤΥ饹եʬϤ뤿δ饹̾ǤޤץˤϤꤷޤǥեȤǤϡ\fIjdeps\fRϥƥϤ˰¸طϤޤDOTǰ¸طǤޤ(\fI\-dotoutput\fRץ򻲾) -.SH "ץ" +\fIjdeps\fRコマンドは、Javaクラス・ファイルのパッケージレベルまたはクラスレベルの依存性を示します。入力クラスには、\fI\&.class\fRファイルのパス名、ディレクトリ、JARファイル、またはすべてのクラス・ファイルを分析するための完全修飾クラス名を指定できます。オプションにより出力が決定します。デフォルトでは、\fIjdeps\fRはシステム出力に依存関係を出力します。DOT言語で依存関係を生成できます(\fI\-dotoutput\fRオプションを参照)。 +.SH "オプション" .PP \-dotoutput <\fIdir\fR> .RS 4 -DOTեϤΰǥ쥯ȥꡣꤷ\fIjdeps\fR<\fIarchive\-file\-name\fR>\&.dotȤ̾ʬϺѤߥ֤Ȥ˰¸طꥹȤ1Ĥdotեִ֤ΰ¸طꥹȤsummary\&.dotȤ̾Υޥ꡼եޤ +DOTファイル出力の宛先ディレクトリ。指定した場合は\fIjdeps\fRは<\fIarchive\-file\-name\fR>\&.dotという名前の分析済みアーカイブごとに依存関係をリストする1つのdotファイルを生成し、アーカイブ間の依存関係をリストするsummary\&.dotという名前のサマリー・ファイルも生成します。 .RE .PP \-s, \-summary .RS 4 -¸طΥޥ꡼ΤߤϤޤ +依存関係のサマリーのみを出力します。 .RE .PP \-v, \-verbose .RS 4 -٤ƤΥ饹٥ΰ¸طϤޤ +すべてのクラスレベルの依存関係を出力します。 .RE .PP \-verbose:package .RS 4 -Ʊΰ¸طѥå٥ΰ¸طϤޤ +同じアーカイブ内の依存関係を除き、パッケージレベルの依存関係を出力します。 .RE .PP \-verbose:class .RS 4 -Ʊΰ¸ط饹٥ΰ¸طϤޤ +同じアーカイブ内の依存関係を除き、クラスレベルの依存関係を出力します。 .RE .PP \-cp <\fIpath\fR>, \-classpath <\fIpath\fR> .RS 4 -饹եθꤷޤ +クラス・ファイルの検索場所を指定します。 .sp -Setting the Class Path ⻲ȤƤ +Setting the Class Path も参照してください。 .RE .PP \-p <\fIpkg name\fR>, \-package <\fIpkg name\fR> .RS 4 -ꤷѥåΰ¸ط򸡽ФޤۤʤѥåФƤΥץʣǤޤ\fI\-p\fRץ\fI\-e\fRץƱ˻ꤹ뤳ȤϤǤޤ +指定したパッケージの依存関係を検出します。異なるパッケージに対してこのオプションを複数回指定できます。\fI\-p\fRオプションと\fI\-e\fRオプションを同時に指定することはできません。 .RE .PP \-e <\fIregex\fR>, \-regex <\fIregex\fR> .RS 4 -ꤷɽѥȰפѥåΰ¸ط򸡽Фޤ\fI\-p\fRץ\fI\-e\fRץƱ˻ꤹ뤳ȤϤǤޤ +指定した正規表現パターンと一致するパッケージの依存関係を検出します。\fI\-p\fRオプションと\fI\-e\fRオプションを同時に指定することはできません。 .RE .PP \-include <\fIregex\fR> .RS 4 -ʬϤѥ˰פ륯饹¤ޤΥץϡʬϤ륯饹ΥꥹȤե륿ޤ¸ط˥ѥŬѤ\fI\-p\fR\fI\-e\fRȤȤ˻ѤǤޤ +分析をパターンに一致するクラスに制限します。このオプションは、分析するクラスのリストをフィルタします。依存関係にパターンを適用する\fI\-p\fRおよび\fI\-e\fRとともに使用できます。 .RE .PP \-jdkinternals .RS 4 -JDKAPIΥ饹٥ΰ¸ط򸡽ФޤǥեȤǤϡ\fI\-include\fRץꤷʤꡢ\fI\-classpath\fRץ󤪤ϥե˻ꤵ줿٤ƤΥ饹ʬϤޤΥץϡ\fI\-p\fRץ\fI\-e\fRץ󤪤\fI\-s\fRץȤȤ˻ѤǤޤ +JDKの内部APIのクラスレベルの依存関係を検出します。デフォルトでは、\fI\-include\fRオプションを指定しないかぎり、\fI\-classpath\fRオプションおよび入力ファイルに指定されたすべてのクラスを分析します。このオプションは、\fI\-p\fRオプション、\fI\-e\fRオプションおよび\fI\-s\fRオプションとともに使用できません。 .sp -\fBٹ\fR: JDKAPIϡΥ꡼ǥǤʤʤǽޤ +\fB警告\fR: JDKの内部APIは、今後のリリースでアクセスできなくなる可能性があります。 .RE .PP \-P, \-profile .RS 4 -ѥåޤץեޤϥեɽޤ +パッケージを含むプロファイルまたはファイルを表示します。 .RE .PP \-apionly .RS 4 -եɡס᥽åɡѥ᡼ס꥿סå줿㳰פޤѥ֥å饹\fIpublic\fR\fIprotected\fRСν̾ΰ¸طʤɡʬϤAPI¤ޤ +フィールド・タイプ、メソッド・パラメータ・タイプ、戻りタイプ、チェックされた例外タイプを含むパブリック・クラスの\fIpublic\fRおよび\fIprotected\fRメンバーの署名からの依存関係など、分析をAPIに制限します。 .RE .PP \-R, \-recursive .RS 4 -٤Ƥΰ¸طƵŪޤ +すべての依存関係を再帰的に走査します。 .RE .PP \-version .RS 4 -СϤޤ +バージョン情報を出力します。 .RE .PP \-h, \-?, \-help .RS 4 -\fIjdeps\fR˴ؤإסåϤޤ +\fIjdeps\fRに関するヘルプ・メッセージを出力します。 .RE -.SH "" +.SH "例" .PP -Notepad\&.jarΰ¸طʬϡ +Notepad\&.jarの依存関係の分析。 .sp .if n \{\ .RS 4 @@ -185,7 +185,7 @@ demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\-Pޤ\-profileץѤơĢ¸ץեɽޤ +\-Pまたは\-profileオプションを使用して、メモ帳が依存するプロファイルを表示します。 .sp .if n \{\ .RS 4 @@ -213,7 +213,7 @@ demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE) .RE .\} .PP -tools\&.jarե\fIcom\&.sun\&.tools\&.jdeps\&.Main\fR饹ʤɡΥ饹ѥΥ饹ľܰ¸طʬϡ +tools\&.jarファイル内の\fIcom\&.sun\&.tools\&.jdeps\&.Main\fRクラスなど、特定のクラスパス内の特定のクラスの直接依存関係の分析。 .sp .if n \{\ .RS 4 @@ -229,7 +229,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\fI\-verbose:class\fRץѤơ饹٥¸ط򸡺뤫\fI\-v\fRޤ\fI\-verbose\fRץѤƱJARե뤫ΰ¸طޤޤ +\fI\-verbose:class\fRオプションを使用して、クラスレベル依存関係を検索するか\fI\-v\fRまたは\fI\-verbose\fRオプションを使用して同じJARファイルからの依存関係を含めます。 .sp .if n \{\ .RS 4 @@ -249,7 +249,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\fI\-R\fRޤ\fI\-recursive\fRץѤơ\fIcom\&.sun\&.tools\&.jdeps\&.Main\fR饹οŪʰ¸طʬϤޤ +\fI\-R\fRまたは\fI\-recursive\fRオプションを使用して、\fIcom\&.sun\&.tools\&.jdeps\&.Main\fRクラスの推移的な依存関係を分析します。 .sp .if n \{\ .RS 4 @@ -305,7 +305,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -Ģǥΰ¸طdotեޤ +メモ帳デモの依存関係のdotファイルを生成します。 .sp .if n \{\ .RS 4 @@ -317,7 +317,7 @@ $ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar .RE .\} .PP -\fIjdeps\fRϡ\fI\-dotoutput\fRץǻꤵ줿dotǥ쥯ȥ<\fIfilename\fR>\&.dotȤ̾dotեJARե뤴Ȥ˺JARե֤ΰ¸طꥹȤsummary\&.dotȤ̾Υޥ꡼եޤ +\fIjdeps\fRは、\fI\-dotoutput\fRオプションで指定されたdotディレクトリに<\fIfilename\fR>\&.dotという名前のdotファイルを特定のJARファイルごとに作成し、JARファイル間の依存関係をリストするsummary\&.dotという名前のサマリー・ファイルも作成します .sp .if n \{\ .RS 4 @@ -350,7 +350,7 @@ digraph "summary" { .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jhat.1 b/jdk/src/linux/doc/man/ja/jhat.1 index 63415d9a6da..71243fa5747 100644 --- a/jdk/src/linux/doc/man/ja/jhat.1 +++ b/jdk/src/linux/doc/man/ja/jhat.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jhat .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jhat" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jhat" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jhat \- JavaҡפʬϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jhat \- Javaヒープを分析します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,18 +64,18 @@ jhat \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIheap\-dump\-file\fR .RS 4 -֥饦оݤȤʤJavaХʥꡦҡססե롣ʣΥҡספޤסեξ硢\fImyfile\&.hprof#3\fRΤ褦˥ե̾θ\fI#<number>\fRղä뤳ȤǡեΥפǤޤ +ブラウズ対象となるJavaバイナリ・ヒープ・ダンプ・ファイル。複数のヒープ・ダンプを含むダンプ・ファイルの場合、\fImyfile\&.hprof#3\fRのようにファイル名の後に\fI#<number>\fRを付加することで、ファイル内の特定のダンプを指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjhat\fRޥɤJavaҡססեϤWebС򳫻Ϥޤ\fIjhat\fRޥɤѤơΥ֥饦ǥҡספ򻲾ȤǤޤ\fIjhat\fRޥɤϡΤΥ饹\fIMyClass\fRΤ٤ƤΥ󥹥󥹤ɽʤɤλ߷׺Ѥ礻Object Query Language (OQL)򥵥ݡȤޤҡספ礻OQLSQL˻ƤޤOQLΥإפˤϡ\fIjhat\fRޥɤˤäɽOQLإסڡ饢ǤޤǥեȡݡȤѤ硢OQLΥإפhttp://localhost:7000/oqlhelp/ѲǽǤ +\fIjhat\fRコマンドはJavaヒープ・ダンプ・ファイルを解析し、Webサーバーを開始します。\fIjhat\fRコマンドを使用して、お気に入りのブラウザでヒープ・ダンプを参照できます。\fIjhat\fRコマンドは、既知のクラス\fIMyClass\fRのすべてのインスタンスを表示するなどの事前設計済の問合せやObject Query Language (OQL)をサポートします。ヒープ・ダンプの問合せを除き、OQLはSQLに似ています。OQLのヘルプには、\fIjhat\fRコマンドによって表示されるOQLヘルプ・ページからアクセスできます。デフォルト・ポートを使用する場合、OQLのヘルプはhttp://localhost:7000/oqlhelp/で利用可能です。 .PP -JavaΥҡספˤϡΤĤˡޤ +Javaのヒープ・ダンプを生成するには、次のいくつかの方法があります。 .sp .RS 4 .ie n \{\ @@ -85,7 +85,7 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIjmap \-dump\fRץѤƼ¹Ի˥ҡספޤjmap(1)򻲾ȤƤ +\fIjmap \-dump\fRオプションを使用して実行時にヒープ・ダンプを取得します。jmap(1)を参照してください。 .RE .sp .RS 4 @@ -96,8 +96,8 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIjconsole\fRץѤ\fIHotSpotDiagnosticMXBean\fRͳǼ¹Ի˥ҡספޤjconsole(1)\fIHotSpotDiagnosticMXBean\fRΥ󥿥ե( -http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html)򻲾ȤƤ +\fIjconsole\fRオプションを使用して\fIHotSpotDiagnosticMXBean\fR経由で実行時にヒープ・ダンプを取得します。jconsole(1)および\fIHotSpotDiagnosticMXBean\fRのインタフェースの説明( +http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html)を参照してください。 .RE .sp .RS 4 @@ -108,8 +108,8 @@ http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/ma .sp -1 .IP \(bu 2.3 .\} -ҡספϡ\fI\-XX:+HeapDumpOnOutOfMemoryError\fR -Javaۥޥ(JVM)ץꤹ뤳Ȥǡ\fIOutOfMemoryError\fR줿Ȥޤ +ヒープ・ダンプは、\fI\-XX:+HeapDumpOnOutOfMemoryError\fR +Java仮想マシン(JVM)オプションを指定することで、\fIOutOfMemoryError\fRがスローされたときに生成されます。 .RE .sp .RS 4 @@ -120,61 +120,61 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIhprof\fRޥɤѤޤHPROF: Heap/CPUץե󥰡ġ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html)򻲾ȤƤ +\fIhprof\fRコマンドを使用します。HPROF: Heap/CPUプロファイリング・ツール +(http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html)を参照してください .RE -.SH "ץ" +.SH "オプション" .PP \-stack false|true .RS 4 -֥ȳƽФåפ̵ˤޤҡסdzȾ󤬻ѤǤʤ硢Υե饰\fIfalse\fRꤹɬפޤǥեȤ\fItrue\fRǤ +オブジェクト割当呼出しスタックの追跡を無効にします。ヒープ・ダンプ内で割当サイト情報が使用できない場合、このフラグを\fIfalse\fRに設定する必要があります。デフォルトは\fItrue\fRです。 .RE .PP \-refs false|true .RS 4 -֥ȤؤλȤפ̵ˤޤǥեȤ\fItrue\fRǤǥեȤǤϡҡΤ٤ƤΥ֥ȤˤĤơХåݥ(ꤵ줿֥ȤݥȤƤ륪֥ȡȼԤޤϼȤȤƤФ)׻ޤ +オブジェクトへの参照の追跡を無効にします。デフォルトは\fItrue\fRです。デフォルトでは、ヒープ内のすべてのオブジェクトについて、バックポインタ(指定されたオブジェクトをポイントしているオブジェクト。参照者または受信参照とも呼ばれる)が計算されます。 .RE .PP \-port \fIport\-number\fR .RS 4 -\fIjhat\fRHTTPСΥݡȤꤷޤǥեȤ7000Ǥ +\fIjhat\fRのHTTPサーバーのポートを設定します。デフォルトは7000です。 .RE .PP \-exclude \fIexclude\-file\fR .RS 4 -ãǽʥ֥Ȥ礻ɬפǡСΰޤեꤷޤȤСΥե\fIjava\&.lang\&.String\&.value\fRޤޤƤ硢Υ֥\fIo\fRãǽʥ֥ȤΥꥹȤ׻ݤˡ\fIjava\&.lang\&.String\&.value\fRեɤ˴Ϣ뻲ȥѥθʤʤޤ +到達可能なオブジェクトの問合せから除外する必要があるデータ・メンバーの一覧を含むファイルを指定します。たとえば、このファイルに\fIjava\&.lang\&.String\&.value\fRが含まれていた場合、特定のオブジェクト\fIo\fRから到達可能なオブジェクトのリストを計算する際に、\fIjava\&.lang\&.String\&.value\fRフィールドに関連する参照パスが考慮されなくなります。 .RE .PP \-baseline \fIexclude\-file\fR .RS 4 -١饤ȤʤҡספꤷޤξΥҡסƱ֥IDĥ֥ȤϿǤϤʤȤƥޡޤ¾Υ֥ȤϿȤƥޡޤϡۤʤ2ĤΥҡספӤݤΩޤ +ベースラインとなるヒープ・ダンプを指定します。両方のヒープ・ダンプ内で同じオブジェクトIDを持つオブジェクトは新規ではないとしてマークされます。他のオブジェクトは新規としてマークされます。これは、異なる2つのヒープ・ダンプを比較する際に役立ちます。 .RE .PP \-debug \fIint\fR .RS 4 -ΥġΥǥХå٥ꤷޤ٥0ϥǥХåϤʤȤ̣ޤ礭ͤꤹȡĹʥ⡼ɤˤʤޤ +このツールのデバッグ・レベルを設定します。レベル0はデバッグ出力がないことを意味します。より大きな値を設定すると、より冗長なモードになります。 .RE .PP \-version .RS 4 -꡼ֹݡȤƽλޤ +リリース番号をレポートして終了します .RE .PP \-h .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-help .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjhat\fRޥɤ¹ԤƤJavaۥޥ\fIflag\fRϤޤȤС512MХȤκҡסѤˤϡ\fI\-J\-Xmx512m\fRȤޤ +\fIjhat\fRコマンドを実行しているJava仮想マシンに\fIflag\fRを渡します。たとえば、512Mバイトの最大ヒープ・サイズを使用するには、\fI\-J\-Xmx512m\fRとします。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -206,7 +206,7 @@ jconsole(1) .sp -1 .IP \(bu 2.3 .\} -HPROF: Heap/CPUץե󥰡ġ +HPROF: Heap/CPUプロファイリング・ツール (http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html) .RE .br diff --git a/jdk/src/linux/doc/man/ja/jinfo.1 b/jdk/src/linux/doc/man/ja/jinfo.1 index f4e7ae9c4ec..e86c941c81b 100644 --- a/jdk/src/linux/doc/man/ja/jinfo.1 +++ b/jdk/src/linux/doc/man/ja/jinfo.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jinfo .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jinfo" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jinfo" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jinfo \- ޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jinfo \- 構成情報を生成します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -82,83 +82,83 @@ jinfo \- .RE .\} .PP -\fIץ\fR +\fIオプション\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -󤬽ϤץIDץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +構成情報が出力されるプロセスID。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -󤬽Ϥ륳ե롣 +構成情報が出力されるコア・ファイル。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjinfo\fRޥɤϡꤵ줿Javaץ䥳եޤϥ⡼ȡǥХåСJavaϤޤˤϡJavaƥࡦץѥƥJavaۥޥ(JVM)Υޥɥ饤󡦥ե饰ޤޤƤޤꤵ줿ץ64ӥåJVMǼ¹ԤƤ硢\fI\-J\-d64\fRץꤹɬפ礬ޤ򼨤ޤ\fIjinfo\fR -\fI\-J\-d64 \-sysprops pid\fR +\fIjinfo\fRコマンドは、指定されたJavaプロセスやコア・ファイルまたはリモート・デバッグ・サーバーのJava構成情報を出力します。構成情報には、Javaシステム・プロパティとJava仮想マシン(JVM)のコマンドライン・フラグが含まれています。指定されたプロセスが64ビットJVM上で実行されている場合、\fI\-J\-d64\fRオプションを指定する必要がある場合があります。次に例を示します。\fIjinfo\fR +\fI\-J\-d64 \-sysprops pid\fR。 .PP -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fR¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤȤС\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fRǤ -.SH "ץ" +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。たとえば、\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fRです。 +.SH "オプション" .PP no\-option .RS 4 -ޥɥ饤󡦥ե饰򡢥ƥࡦץѥƥ̾ͤΥڥȤȤ˽Ϥޤ +コマンドライン・フラグを、システム・プロパティ名と値のペアとともに出力します。 .RE .PP \-flag \fIname\fR .RS 4 -ꤵ줿ޥɥ饤󡦥ե饰̾ͤϤޤ +指定されたコマンドライン・フラグの名前と値を出力します。 .RE .PP \-flag \fI[+|\-]name\fR .RS 4 -ꤵ줿֡뷿Υޥɥ饤󡦥ե饰ͭޤ̵ˤޤ +指定されたブール型のコマンドライン・フラグを有効または無効にします。 .RE .PP \-flag \fIname=value\fR .RS 4 -ꤵ줿ޥɥ饤󡦥ե饰ꤵ줿ͤꤷޤ +指定されたコマンドライン・フラグを指定された値に設定します。 .RE .PP \-flags .RS 4 -JVMϤ륳ޥɥ饤󡦥ե饰Ϥޤ +JVMに渡されるコマンドライン・フラグを出力します。 .RE .PP \-sysprops .RS 4 -Javaƥࡦץѥƥ̾ͤΥڥȤƽϤޤ +Javaシステム・プロパティを名前と値のペアとして出力します。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jjs.1 b/jdk/src/linux/doc/man/ja/jjs.1 index bcf28254fe2..c6c7d72d7ad 100644 --- a/jdk/src/linux/doc/man/ja/jjs.1 +++ b/jdk/src/linux/doc/man/ja/jjs.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jjs .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jjs" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jjs" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jjs \- Nashorn󥸥ƤӽФޤ -.SH "" +jjs \- Nashornエンジンを呼び出します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,28 +64,28 @@ jjs \- Nashorn .PP \fIoptions\fR .RS 4 -ʸǶڤ줿\fIjjs\fRޥɤ1İʾΥץ󡣾ܺ٤ϡץ򻲾ȤƤ +空白文字で区切られた、\fIjjs\fRコマンドの1つ以上のオプション。詳細は、オプションを参照してください。 .RE .PP \fIscript\-files\fR .RS 4 -ʸǶڤ줿NashornѤƲ᤹1İʾΥץȡե롣ե뤬ꤵʤϡ÷뤬ưޤ +空白文字で区切られた、Nashornを使用して解釈する1つ以上のスクリプト・ファイル。ファイルが指定されない場合は、対話型シェルが起動されます。 .RE .PP \fIarguments\fR .RS 4 -ťϥե󡦥ޡ(\fI\-\-\fR)θΤ٤ƤͤȤƥץȤޤ÷Ϥޤͤˤ\fIarguments\fRץѥƥѤƥǤޤ(Example 3򻲾ȤƤ) +二重ハイフン・マーカー(\fI\-\-\fR)の後のすべての値が、引数としてスクリプトまたは対話型シェルに渡されます。これらの値には\fIarguments\fRプロパティを使用してアクセスできます(Example 3を参照してください)。 .RE -.SH "" +.SH "説明" .PP -\fIjjs\fRޥɥ饤󡦥ġѤNashorn󥸥ƤӽФޤѤơ1ĤޤʣΥץȡեᤷꡢ÷¹Ԥ뤳ȤǤޤ -.SH "ץ" +\fIjjs\fRコマンドライン・ツールを使用してNashornエンジンを呼び出します。これを使用して、1つまたは複数のスクリプト・ファイルを解釈したり、対話型シェルを実行することができます。 +.SH "オプション" .PP -\fIjjs\fRޥɤΥץϥץȤNashornˤäƲᤵ椷ޤ +\fIjjs\fRコマンドのオプションはスクリプトがNashornによって解釈される条件を制御します。 .PP \-ccs=\fIsize\fR, \-\-class\-cache\-size=\fIsize\fR .RS 4 -饹å塦Хñ̤ꤷޤХ(KB)򼨤\fIk\fRޤ\fIK\fRʸɲäᥬХ(MB)򼨤\fIm\fRޤ\fIM\fRʸɲäХ(GB)򼨤\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ饹å塦50ХȤꤵޤϡ1024Х(1 KB)ꤹˡ򼨤ޤ +クラス・キャッシュ・サイズをバイト単位で設定します。キロバイト(KB)を示すために\fIk\fRまたは\fIK\fRの文字を追加し、メガバイト(MB)を示すために\fIm\fRまたは\fIM\fRの文字を追加し、ギガバイト(GB)を示すために\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、クラス・キャッシュ・サイズは50バイトに設定されます。次の例は、1024バイト(1 KB)に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -101,17 +101,17 @@ jjs \- Nashorn .PP \-co, \-\-compile\-only .RS 4 -ץȤ¹Ԥ˥ѥ뤷ޤ +スクリプトを実行せずにコンパイルします。 .RE .PP \-cp \fIpath\fR, \-\-classpath \fIpath\fR .RS 4 -ݡȤ륯饹ؤΥѥꤷޤʣΥѥꤹˤϡΥץ򷫤֤ޤϳƥѥ򥳥(:)Ƕڤޤ +サポートするクラスへのパスを指定します。複数のパスを設定するには、このオプションを繰り返すか、または各パスをコロン(:)で区切ります。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -ץѥƥ̾ͤƤ뤳ȤǡץȤϤƥࡦץѥƥꤷޤǡ÷⡼ɤNashornƤӽФơ\fImyValue\fR\fImyKey\fRȤ̾Υץѥƥ˳Ƥˡ򼨤ޤ +プロパティ名に値を割り当てることで、スクリプトに渡すシステム・プロパティを設定します。次の例で、対話型モードでNashornを呼び出して、\fImyValue\fRを\fImyKey\fRという名前のプロパティに割り当てる方法を示します。 .sp .if n \{\ .RS 4 @@ -125,67 +125,67 @@ jjs> .if n \{\ .RE .\} -Υץ򷫤֤ѤȡʣΥץѥƥǤޤ +このオプションを繰り返し使用すると、複数のプロパティを設定できます。 .RE .PP \-d=\fIpath\fR, \-\-dump\-debug\-dir=\fIpath\fR .RS 4 -饹եפǥ쥯ȥؤΥѥꤷޤ +クラス・ファイルをダンプするディレクトリへのパスを指定します。 .RE .PP \-\-debug\-lines .RS 4 -饹եιֹɽޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-debug\-lines=false\fRꤷޤ +クラス・ファイル内の行番号表を生成します。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-debug\-lines=false\fRを指定します。 .RE .PP \-\-debug\-locals .RS 4 -饹եΥѿޤ +クラス・ファイル内のローカル変数を生成します。 .RE .PP \-doe, \-\-dump\-on\-error .RS 4 -顼ȯȤˡե롦åȥ졼󶡤ޤǥեȤǤϡñʥ顼åΤߤϤޤ +エラーが発生したときに、フル・スタック・トレースを提供します。デフォルトでは、簡単なエラー・メッセージのみが出力されます。 .RE .PP \-\-early\-lvalue\-error .RS 4 -̵ʺͼ顼Ȥ(ĤޤꡢɤϤȤ)𤵤ޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-early\-lvalue\-error=false\fRꤷޤ̵ʾ硢̵ʺͼϥɤ¹Ԥޤ𤵤ޤ +無効な左辺値式が早期エラーとして(つまり、コードが解析されるときに)報告されます。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-early\-lvalue\-error=false\fRを指定します。無効な場合、無効な左辺値式はコードが実行されるまで報告されません。 .RE .PP \-\-empty\-statements .RS 4 -ʸJavaݹʸĥ꡼¸ޤ +空の文をJavaの抽象構文ツリーに保存します。 .RE .PP \-fv, \-\-fullversion .RS 4 -NashornСʸϤޤ +完全なNashornバージョン文字列を出力します。 .RE .PP \-\-function\-statement\-error .RS 4 -ؿʸȤƻѤȥ顼åϤޤ +関数の宣言が文として使用されるとエラー・メッセージが出力されます。 .RE .PP \-\-function\-statement\-warning .RS 4 -ؿʸȤƻѤȷٹåϤޤ +関数の宣言が文として使用されると警告メッセージが出力されます。 .RE .PP \-fx .RS 4 -ץȤJavaFXץꥱȤƵưޤ +スクリプトをJavaFXアプリケーションとして起動します。 .RE .PP \-h, \-help .RS 4 -ץΥꥹȤȤϤޤ +オプションのリストとその説明を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤷ\fIjava\fRưץJVMϤޤǡ÷⡼ɤNashornƤӽФơJVMˤäƻѤ꡼4 GBꤹˡ򼨤ޤ +指定した\fIjava\fR起動オプションをJVMに渡します。次の例で、対話型モードでNashornを呼び出して、JVMによって使用される最大メモリーを4 GBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -199,22 +199,22 @@ jjs> .if n \{\ .RE .\} -Υץ򷫤֤Ѥȡʣ\fIjava\fRޥɡץϤȤǤޤ +このオプションを繰り返し使用すると、複数の\fIjava\fRコマンド・オプションを渡すことができます。 .RE .PP \-\-lazy\-compilation .RS 4 -쥤ά(ĤޤꡢץΤ٤˥ѥ뤵ʤ)ͭˤޤΥץϻŪʤΤǤ +レイジー・コード生成戦略(つまり、スクリプト全体が一度にコンパイルされない)を有効にします。このオプションは試験的なものです。 .RE .PP \-\-loader\-per\-compile .RS 4 -ѥ뤴Ȥ˿饹ޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-loader\-per\-compile=false\fRꤷޤ +コンパイルごとに新しいクラス・ローダーを作成します。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-loader\-per\-compile=false\fRを指定します。 .RE .PP \-\-log=\fIsubsystem\fR:\fIlevel\fR .RS 4 -ꤵ줿֥ƥФơΥ٥ǥ󥰤¹ԤޤޤǶڤäʣΥ֥ƥΥ󥰡٥Ǥޤ򼨤ޤ +指定されたサブシステムに対して、特定のレベルでロギングを実行します。カンマで区切って複数のサブシステムのロギング・レベルを指定できます。次に例を示します。 .sp .if n \{\ .RS 4 @@ -229,116 +229,116 @@ jjs> .PP \-\-package=\fIname\fR .RS 4 -줿饹եɲäѥåꤷޤ +生成されたクラス・ファイルを追加するパッケージを指定します。 .RE .PP \-\-parse\-only .RS 4 -ѥ뤻˥ɤϤޤ +コンパイルせずにコードを解析します。 .RE .PP \-\-print\-ast .RS 4 -ݹʸĥ꡼Ϥޤ +抽象構文ツリーを出力します。 .RE .PP \-\-print\-code .RS 4 -ХȥɤϤޤ +バイトコードを出力します。 .RE .PP \-\-print\-lower\-ast .RS 4 -겼ݹʸĥ꡼Ϥޤ +掘り下げた抽象構文ツリーを出力します。 .RE .PP \-\-print\-lower\-parse .RS 4 -겼ϥĥ꡼Ϥޤ +掘り下げた解析ツリーを出力します。 .RE .PP \-\-print\-no\-newline .RS 4 -¾\fI\-\-print*\fRץǶŪ1ԤǽϤޤ +その他の\fI\-\-print*\fRオプションで強制的に1行で出力します。 .RE .PP \-\-print\-parse .RS 4 -ϥĥ꡼Ϥޤ +解析ツリーを出力します。 .RE .PP \-\-print\-symbols .RS 4 -ɽϤޤ +記号表を出力します。 .RE .PP \-pcs, \-\-profile\-callsites .RS 4 -ƤӽФȤΥץե롦ǡפޤ +呼び出しサイトのプロファイル・データをダンプします。 .RE .PP \-scripting .RS 4 -Υץȵǽͭˤޤ +シェルのスクリプト機能を有効にします。 .RE .PP \-\-stderr=\fIfilename\fR|\fIstream\fR|\fItty\fR .RS 4 -ɸ२顼ȥ꡼ꤷե롢ȥ꡼(Ȥ\fIstdout\fR)ˡޤϥƥü˥쥯Ȥޤ +標準エラー・ストリームを指定したファイル、ストリーム(たとえば\fIstdout\fR)に、またはテキスト端末にリダイレクトします。 .RE .PP \-\-stdout=\fIfilename\fR|\fIstream\fR|\fItty\fR .RS 4 -ɸϥȥ꡼ꤷե롢ȥ꡼(Ȥ\fIstderr\fR)ˡޤϥƥü˥쥯Ȥޤ +標準出力ストリームを指定したファイル、ストリーム(たとえば\fIstderr\fR)に、またはテキスト端末にリダイレクトします。 .RE .PP \-strict .RS 4 -ɸ(ECMAScript Edition 5\&.1)ؤν򶯲strict⡼ɤͭˤˤ궦̤Υǥ󥰡顼ñ˸ФǤ褦ˤʤޤ +標準(ECMAScript Edition 5\&.1)への準拠を強化するstrictモードを有効にし、これにより共通のコーディング・エラーを簡単に検出できるようになります。 .RE .PP \-t=\fIzone\fR, \-timezone=\fIzone\fR .RS 4 -ץȤμ¹ԤФꤷॾꤷޤOSꤵ줿ॾ򥪡С饤ɤ\fIDate\fR֥ȤǻѤޤ +スクリプトの実行に対し指定したタイムゾーンを設定します。OSで設定されたタイムゾーンをオーバーライドし、\fIDate\fRオブジェクトで使用されます。 .RE .PP \-tcs=\fIparameter\fR, \-\-trace\-callsites=\fIparameter\fR .RS 4 -ƽФȤΥȥ졼Υ⡼ɤͭˤޤѲǽʥѥ᡼ϡΤȤǤ +呼出しサイトのトレースのモードを有効にします。使用可能なパラメータは、次のとおりです。 .PP miss .RS 4 -ƽФȤΥߥȥ졼ޤ +呼出しサイトのミスをトレースします。 .RE .PP enterexit .RS 4 -ƽФȤؤνȥ졼ޤ +呼出しサイトへの出入りをトレースします。 .RE .PP objects .RS 4 -֥ȤΥץѥƥϤޤ +オブジェクトのプロパティを出力します。 .RE .RE .PP \-\-verify\-code .RS 4 -Хȥɤ¹Ԥ˸ڤޤ +バイトコードを実行する前に検証します。 .RE .PP \-v, \-version .RS 4 -NashornСʸϤޤ +Nashornバージョン文字列を出力します。 .RE .PP \-xhelp .RS 4 -ޥɥ饤󡦥ץγĥإפϤޤ +コマンドライン・オプションの拡張ヘルプを出力します。 .RE -.SH "" +.SH "例" .PP -\fBExample 1\fR, NashornѤץȤμ¹ +\fBExample 1\fR, Nashornを使用したスクリプトの実行 .RS 4 .sp .if n \{\ @@ -352,7 +352,7 @@ jjs script\&.js .\} .RE .PP -\fBExample 2\fR, ÷⡼ɤǤNashornμ¹ +\fBExample 2\fR, 対話型モードでのNashornの実行 .RS 4 .sp .if n \{\ @@ -370,7 +370,7 @@ jjs> \fBquit()\fR .\} .RE .PP -\fBExample 3\fR, NashornؤΰϤ +\fBExample 3\fR, Nashornへの引数の渡し .RS 4 .sp .if n \{\ @@ -386,7 +386,7 @@ jjs> .RE .\} .RE -.SH "Ϣ" +.SH "関連項目" .PP \fIjrunscript\fR .br diff --git a/jdk/src/linux/doc/man/ja/jmap.1 b/jdk/src/linux/doc/man/ja/jmap.1 index cc465a08b4e..07b59ddc5cc 100644 --- a/jdk/src/linux/doc/man/ja/jmap.1 +++ b/jdk/src/linux/doc/man/ja/jmap.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jmap .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jmap" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jmap" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jmap \- ץ䥳եޤϥ⡼ȡǥХåСΡѥ֥ȡ꡼ޥåפޤϥҡס꡼ξܺ٤ϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jmap \- プロセスやコア・ファイルまたはリモート・デバッグ・サーバーの、共用オブジェクト・メモリー・マップまたはヒープ・メモリーの詳細を出力します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -84,93 +84,93 @@ jmap \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -Ϥ꡼ޥåפΥץIDץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +出力するメモリー・マップのプロセスID。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -Ϥ꡼ޥåפΥե롣 +出力するメモリー・マップのコア・ファイル。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjmap\fRޥɤϡꤵ줿ץ䥳եޤϥ⡼ȡǥХåСΡѥ֥ȡ꡼ޥåפޤϥҡס꡼ξܺ٤Ϥޤꤵ줿ץ64ӥåJavaۥޥ(JVM)Ǽ¹ԤƤ硢\fI\-J\-d64\fRץꤹɬפ礬ޤ򼨤ޤ\fIjmap\fR -\fI\-J\-d64 \-heap pid\fR +\fIjmap\fRコマンドは、指定されたプロセスやコア・ファイルまたはリモート・デバッグ・サーバーの、共用オブジェクト・メモリー・マップまたはヒープ・メモリーの詳細を出力します。指定されたプロセスが64ビットJava仮想マシン(JVM)上で実行されている場合、\fI\-J\-d64\fRオプションを指定する必要がある場合があります。次に例を示します。\fIjmap\fR +\fI\-J\-d64 \-heap pid\fR。 .PP -\fB:\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fRե뤬¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤ\fIjvm\&.dll\fRξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ򼨤ޤ\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR -.SH "ץ" +\fB注意:\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRファイルが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用される\fIjvm\&.dll\fRの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。次に例を示します。\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR。 +.SH "オプション" .PP -<ץʤ> +<オプションなし> .RS 4 -ץѤʤ硢\fIjmap\fRޥɤ϶ѥ֥ȡޥåԥ󥰤ϤޤåJVM˥ɤ줿ѥ֥ȤȤˡϥɥ쥹ޥåԥ󥰤ΥӶѥ֥ȡեΥեѥϤޤưϡOracle Solaris -\fIpmap\fR桼ƥƥƤޤ +オプションを使用しない場合、\fIjmap\fRコマンドは共用オブジェクト・マッピングを出力します。ターゲットJVMにロードされた共用オブジェクトごとに、開始アドレス、マッピングのサイズおよび共用オブジェクト・ファイルのフルパスが出力されます。この動作は、Oracle Solaris +\fIpmap\fRユーティリティと類似しています。 .RE .PP \-dump:[live,] format=b, file=\fIfilename\fR .RS 4 -Javaҡפ\fIhprof\fRХʥ\fIfilename\fR˥פޤ\fIlive\fR֥ץϥץǤꤷ硢ҡΥƥ֤ʥ֥ȤΤߤפޤҡספ򻲾Ȥˤϡjhat(1)ޥɤѤ줿եɤ߼ޤ +Javaヒープを\fIhprof\fRバイナリ形式で\fIfilename\fRにダンプします。\fIlive\fRサブオプションはオプションですが、指定した場合、ヒープ内のアクティブなオブジェクトのみがダンプされます。ヒープ・ダンプを参照するには、jhat(1)コマンドを使用して生成されたファイルを読み取ります。 .RE .PP \-finalizerinfo .RS 4 -եʥ饤ԤäƤ륪֥Ȥ˴ؤϤޤ +ファイナライズを待っているオブジェクトに関する情報を出力します。 .RE .PP \-heap .RS 4 -ѤƤ륬١쥯Υҡסޥ꡼إåϢΥҡ׻ѾϤޤˡintern줿ʸοȥϤޤ +使用されているガベージ・コレクションのヒープ・サマリー、ヘッダー構成、および世代関連のヒープ使用状況を出力します。さらに、internされた文字列の数とサイズも出力されます。 .RE .PP \-histo[:live] .RS 4 -ҡפΥҥȥϤޤJava饹Ȥˡ֥ȤοХñ̤ǤΥ꡼Ӵ饹̾ϤޤJVM饹̾ϥꥹ(*)ƬդƽϤޤ\fIlive\fR֥ץ󤬻ꤵ줿硢ƥ֤ʥ֥ȤΤߤȤޤ +ヒープのヒストグラムを出力します。Javaクラスごとに、オブジェクトの数、バイト単位でのメモリー・サイズ、および完全修飾クラス名が出力されます。JVMの内部クラス名はアスタリスク(*)の接頭辞を付けて出力されます。\fIlive\fRサブオプションが指定された場合、アクティブなオブジェクトのみがカウントされます。 .RE .PP \-clstats .RS 4 -JavaҡפΡ饹ϢץǡϤޤ饹Ȥˡ̾֡ɥ쥹ƥ饹ӥ饹ɤ饹οȥϤޤ +Javaヒープの、クラス・ローダー関連の統計データを出力します。クラス・ローダーごとに、その名前、状態、アドレス、親クラス・ローダー、およびクラス・ローダーがロードしたクラスの数とサイズが出力されます。 .RE .PP \-F .RS 4 -ޤPIDʤȤˡΥץ\fIjmap \-dump\fRޤ\fIjmap \-histo\fRץȤȤ˻ѤޤΥ⡼ɤǤϡ\fIlive\fR֥ץϥݡȤޤ +強制します。PIDが応答しないときに、このオプションを\fIjmap \-dump\fRまたは\fIjmap \-histo\fRオプションとともに使用します。このモードでは、\fIlive\fRサブオプションはサポートされません。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjmap\fRޥɤ¹ԤƤJavaۥޥ\fIflag\fRϤޤ +\fIjmap\fRコマンドを実行しているJava仮想マシンに\fIflag\fRを渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jps.1 b/jdk/src/linux/doc/man/ja/jps.1 index d6a7ae886f9..bef7d60260f 100644 --- a/jdk/src/linux/doc/man/ja/jps.1 +++ b/jdk/src/linux/doc/man/ja/jps.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jps .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jps" "1" "2013ǯ1121" "JDK 8" "˥󥰡ġ" +.TH "jps" "1" "2013年11月21日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jps \- åȡƥǷ¬줿Javaۥޥ(JVM)ɽޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jps \- ターゲット・システム上で計測されたJava仮想マシン(JVM)を一覧表示します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,60 +64,60 @@ jps \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIhostid\fR .RS 4 -ץݡȤۥȤμ̻ҡ\fIhostid\fRˤϡ̿ץȥ롢ݡֹ桢˸ͭ¾Υǡꤷץ󡦥ݡͥȤޤ뤳ȤǤޤۥȼ̻Ҥ򻲾ȤƤ +プロセス・レポートを生成するホストの識別子。\fIhostid\fRには、通信プロトコル、ポート番号、実装に固有な他のデータを指定したオプション・コンポーネントを含めることができます。ホスト識別子を参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjps\fRޥɤϡåȡƥǷ¬줿Java HotSpot VMɽޤΥޥɤɽǤݡȾϡäJVM˴ؤΤ˸ꤵޤ +\fIjps\fRコマンドは、ターゲット・システム上で計測されたJava HotSpot VMを一覧表示します。このコマンドで表示できるレポート情報は、アクセス権を持ったJVMに関するものに限定されます。 .PP -\fIhostid\fRꤻ\fIjps\fRޥɤ¹Ԥ硢롦ۥȤǷ¬줿JVMޤ\fIhostid\fRꤷƵư硢ꤵ줿ץȥȥݡȤѤơꤵ줿ۥȾJVM򸡺ޤ\fIjstatd\fRץåȡۥȾǼ¹ԤƤꤵޤ +\fIhostid\fRを指定せずに\fIjps\fRコマンドを実行した場合、ローカル・ホストで計測されたJVMが検索されます。\fIhostid\fRを指定して起動した場合、指定されたプロトコルとポートを使用して、指定されたホスト上のJVMを検索します。\fIjstatd\fRプロセスがターゲット・ホスト上で実行されていると想定されます。 .PP -\fIjps\fRޥɤϡåȡƥǷ¬줿JVMˤĤơVM̻ҡĤޤ\fIlvmid\fRݡȤޤ\fIlvmid\fRϡŪˤJVMץФ륪ڥ졼ƥ󥰡ƥΥץ̻ҤǤɬ⤽ǤȤϸ¤ޤ󡣥ץꤷʤ硢\fIjps\fRˤäơJavaץꥱ\fIlvmid\fRɽ졢줾˥ץꥱΥ饹̾ޤJARե̾ñʷǼޤδñʷΥ饹̾JARե̾Ǥϡ饹ΥѥåޤJARե롦ѥ󤬾άƤޤ +\fIjps\fRコマンドは、ターゲット・システムで計測された各JVMについて、ローカルVM識別子、つまり\fIlvmid\fRをレポートします。\fIlvmid\fRは、一般的にはJVMプロセスに対するオペレーティング・システムのプロセス識別子ですが、必ずしもそうであるとは限りません。オプションを指定しない場合、\fIjps\fRによって、各Javaアプリケーションの\fIlvmid\fRが一覧表示され、それぞれにアプリケーションのクラス名またはJARファイル名が簡単な形式で示されます。この簡単な形式のクラス名とJARファイル名では、クラスのパッケージ情報またはJARファイル・パス情報が省略されています。 .PP -\fIjps\fRޥɤϡJavaưġѤmain᥽åɤϤ륯饹̾Ȱ򸡺ޤȼεưġѤƥåJVMưϡ\fImain\fR᥽åɤϤ륯饹̾ޤJARե̾ȰѤǤޤ󡣤ξ硢\fIjps\fRޥɤϡ\fImain\fR᥽åɤϤ륯饹̾ޤJARե̾ȰФơʸ\fIUnknown\fRϤޤ +\fIjps\fRコマンドは、Java起動ツールを使用してmainメソッドに渡されるクラス名と引数を検索します。独自の起動ツールを使用してターゲットJVMを起動した場合は、\fImain\fRメソッドに渡されるクラス名またはJARファイル名と引数は利用できません。この場合、\fIjps\fRコマンドは、\fImain\fRメソッドに渡されるクラス名またはJARファイル名と引数に対して、文字列\fIUnknown\fRを出力します。 .PP -\fIjps\fRޥɤJVMΥꥹȤϡΥޥɤ¹Ԥץ󥷥ѥͿ줿˴Ť¤礬ޤΥޥɤϡڥ졼ƥ󥰡ƥȼΥ浡ˤ˴Ťơץ󥷥ѥ˥ͿƤJVMΤߤɽޤ -.SH "ץ" +\fIjps\fRコマンドで生成されるJVMのリストは、このコマンドを実行するプリンシパルに与えられたアクセス権に基づき、制限される場合があります。このコマンドは、オペレーティング・システム独自のアクセス制御機構による決定に基づいて、プリンシパルにアクセス権が与えられているJVMのみを一覧表示します。 +.SH "オプション" .PP -\fIjps\fRޥɤǤϡޥɤνϤѹ륪ץ¿ݡȤƤޤ衢Υץϡѹޤѻߤǽޤ +\fIjps\fRコマンドでは、コマンドの出力を変更するオプションが多数サポートされています。将来、これらのオプションは、変更または廃止される可能性があります。 .PP \-q .RS 4 -饹̾JARե̾\fImain\fR᥽åɤϤ줿νϤVM̻ҤΰΤߤޤ +クラス名、JARファイル名、および\fImain\fRメソッドに渡された引数の出力を抑制し、ローカルVM識別子の一覧のみを生成します。 .RE .PP \-m .RS 4 -\fImain\fR᥽åɤϤϤޤνϤϡȤ߹ޤƤJVMФ\fInull\fRˤʤ뤳Ȥ⤢ޤ +\fImain\fRメソッドに渡される引数を出力します。この出力は、組み込まれているJVMに対して\fInull\fRになることもあります。 .RE .PP \-l .RS 4 -ץꥱ\fImain\fR饹Υե롦ѥå̾ޤϥץꥱJARեؤΥեѥ̾Ϥޤ +アプリケーションの\fImain\fRクラスのフル・パッケージ名、またはアプリケーションのJARファイルへのフルパス名を出力します。 .RE .PP \-v .RS 4 -JVMϤɽޤ +JVMに渡される引数を表示します。 .RE .PP \-V .RS 4 -饹̾JARե̾mai᥽åɤϤ줿νϤVM̻ҤΰΤߤޤ +クラス名、JARファイル名、およびmaiメソッドに渡された引数の出力を抑制し、ローカルVM識別子の一覧のみを生成します。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ\fIץ\fR1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されている\fIオプション\fRを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ۥȼ̻" +.SH "ホスト識別子" .PP -ۥȼ̻ҡĤޤ\fIhostid\fRϡåȡƥ򼨤ʸǤ\fIhostid\fRʸιʸϡURIιʸбƤޤ +ホスト識別子、つまり\fIhostid\fRは、ターゲット・システムを示す文字列です。\fIhostid\fR文字列の構文は、URIの構文に対応しています。 .sp .if n \{\ .RS 4 @@ -131,27 +131,27 @@ JVM .PP \fIprotocol\fR .RS 4 -̿ץȥǤ\fIprotocol\fRά졢\fIhostname\fRꤵƤʤ硢ǥեȤΥץȥ뤬ץåȥեͭκŬ줿롦ץȥˤʤޤץȥ뤬ά졢ۥ̾ꤵƤϡǥեȡץȥ\fIrmi\fRˤʤޤ +通信プロトコルです。\fIprotocol\fRが省略され、\fIhostname\fRが指定されていない場合、デフォルトのプロトコルが、プラットフォーム固有の最適化されたローカル・プロトコルになります。プロトコルが省略され、ホスト名が指定されている場合は、デフォルト・プロトコルは\fIrmi\fRになります。 .RE .PP hostname .RS 4 -åȡۥȤ򼨤ۥ̾ޤIPɥ쥹Ǥ\fIhostname\fRѥ᡼άƤϡåȡۥȤϥ롦ۥȤˤʤޤ +ターゲット・ホストを示すホスト名またはIPアドレスです。\fIhostname\fRパラメータが省略されている場合は、ターゲット・ホストはローカル・ホストになります。 .RE .PP port .RS 4 -⡼ȡС̿뤿ΥǥեȡݡȤǤ\fIhostname\fRѥ᡼άƤ뤫\fIprotocol\fRѥ᡼Ŭ줿롦ץȥꤷƤ硢\fIport\fRѥ᡼̵뤵ޤʳξ硢\fIport\fRѥ᡼ΰϡˤäưۤʤޤǥեȤ -\fIrmi\fRץȥξ硢\fIport\fRѥ᡼ϡ⡼ȡۥȾrmiregistryΥݡֹ򼨤ޤ\fIport\fRѥ᡼άƤ뤫\fIprotocol\fRѥ᡼\fIrmi\fR򼨤Ƥ硢ǥեȤrmiregistryݡ(1099)Ѥޤ +リモート・サーバーと通信するためのデフォルト・ポートです。\fIhostname\fRパラメータが省略されているか、\fIprotocol\fRパラメータが、最適化されたローカル・プロトコルを指定している場合、\fIport\fRパラメータは無視されます。それ以外の場合、\fIport\fRパラメータの扱いは、実装によって異なります。デフォルトの +\fIrmi\fRプロトコルの場合、\fIport\fRパラメータは、リモート・ホスト上のrmiregistryのポート番号を示します。\fIport\fRパラメータが省略されているか、\fIprotocol\fRパラメータが\fIrmi\fRを示している場合、デフォルトのrmiregistryポート(1099)が使用されます。 .RE .PP servername .RS 4 -Υѥ᡼ΰϡˤäưۤʤޤŬ줿롦ץȥξ硢Υեɤ̵뤵ޤ\fIrmi\fRץȥξ硢Υѥ᡼ϡ⡼ȡۥȾRMI⡼ȡ֥Ȥ̾򼨤ʸˤʤޤܺ٤ϡ\fIjstatd\fRޥɤ\fI\-n\fRץ򻲾ȤƤ +このパラメータの扱いは、実装によって異なります。最適化されたローカル・プロトコルの場合、このフィールドは無視されます。\fIrmi\fRプロトコルの場合、このパラメータは、リモート・ホスト上のRMIリモート・オブジェクトの名前を示す文字列になります。詳細は、\fIjstatd\fRコマンドの\fI\-n\fRオプションを参照してください。 .RE -.SH "ϥեޥå" +.SH "出力フォーマット" .PP -\fIjps\fRޥɤνϤϡΥѥ˽ޤ +\fIjps\fRコマンドの出力は、次のパターンに従います。 .sp .if n \{\ .RS 4 @@ -163,15 +163,15 @@ lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ] .RE .\} .PP -٤Ƥνϥȡ϶ʸǶڤޤ\fIarg\fRͤǶѤȡºݤ֥ѥ᡼˰ޥåԥ󥰤褦ȤȤˡޤˤʤޤ +すべての出力トークンは空白文字で区切られます。\fIarg\fR値の中で空白を使用すると、実際の定位置パラメータに引数をマッピングしようとするときに、あいまいになります。 .PP -\fB:\fR -Υ꡼Ǥηѹǽ뤿ᡢ\fIjps\fRνϤϤ륹ץȤϺʤȤᤷޤ\fIjps\fRϤϤ륹ץȤȡΥġξΥ꡼ǡץȤѹɬפˤʤǽޤ -.SH "" +\fB注意:\fR +将来のリリースでこの形式は変更される可能性があるため、\fIjps\fRの出力を解析するスクリプトは作成しないことをお薦めします。\fIjps\fR出力を解析するスクリプトを作成すると、このツールの将来のリリースで、作成したスクリプトの変更が必要になる可能性があります。 +.SH "例" .PP -ιǤϡ\fIjps\fRޥɤ򼨤ޤ +この項では、\fIjps\fRコマンドの例を示します。 .PP -롦ۥȾǷ¬줿JVMɽ: +ローカル・ホスト上で計測されたJVMを一覧表示する場合: .sp .if n \{\ .RS 4 @@ -186,7 +186,7 @@ jps .RE .\} .PP -Ǥϡ⡼ȡۥȾǷ¬줿JVMɽޤǤϡ\fIjstat\fRСȡRMI쥸ȥޤ̤γrmiregistryץΤ줫⡼ȡۥȤΥǥեȡݡ(ݡ1099)Ǽ¹ԤƤꤷƤޤޤ롦ۥȤ⡼ȡۥȤؤͭʥäƤ뤳ȤꤷƤޤˤϡ\fI\-l\fRץޤޤ졢饹̾ޤJARե̾ܺ٤ʷǽϤޤ +次の例では、リモート・ホスト上で計測されたJVMを一覧表示します。この例では、\fIjstat\fRサーバーと、その内部RMIレジストリまたは別の外部rmiregistryプロセスのいずれかが、リモート・ホストのデフォルト・ポート(ポート1099)で実行されていると想定しています。また、ローカル・ホストが、リモート・ホストへの有効なアクセス権を持っていることも想定しています。この例には、\fI\-l\fRオプションも含まれ、クラス名またはJARファイル名を詳細な形式で出力します。 .sp .if n \{\ .RS 4 @@ -200,7 +200,7 @@ jps \-l remote\&.domain .RE .\} .PP -ǤϡRMI쥸ȥ˥ǥեȤǤϤʤݡȤѤơ⡼ȡۥȾǷ¬줿JVMɽޤǤϡRMI쥸ȥ꤬ݡ2002˥Хɤ줿\fIjstatd\fRС⡼ȡۥȾǼ¹ԤƤꤷƤޤޤ\fI\-m\fRץѤơɽ줿줾Javaץꥱ\fImain\fR᥽åɤϤȤ߹Ǥޤ +次の例では、RMIレジストリにデフォルトではないポートを使用して、リモート・ホスト上で計測されたJVMを一覧表示します。この例では、内部RMIレジストリがポート2002にバインドされた\fIjstatd\fRサーバーが、リモート・ホスト上で実行されていると想定しています。また、\fI\-m\fRオプションを使用して、一覧表示されたそれぞれのJavaアプリケーションの\fImain\fRメソッドに渡される引数を組み込んでいます。 .sp .if n \{\ .RS 4 @@ -213,7 +213,7 @@ jps \-m remote\&.domain:2002 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jrunscript.1 b/jdk/src/linux/doc/man/ja/jrunscript.1 index f53c29f59c7..2c9c82d9022 100644 --- a/jdk/src/linux/doc/man/ja/jrunscript.1 +++ b/jdk/src/linux/doc/man/ja/jrunscript.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jrunscript .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ץƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: スクリプティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jrunscript" "1" "2013ǯ1121" "JDK 8" "ץƥ󥰡ġ" +.TH "jrunscript" "1" "2013年11月21日" "JDK 8" "スクリプティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jrunscript \- ÷⡼ɤȥХå⡼ɤ򥵥ݡȤ륳ޥɥ饤󡦥ץȡ¹ԤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jrunscript \- 対話型モードとバッチ・モードをサポートするコマンドライン・スクリプト・シェルを実行します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,83 +64,83 @@ jrunscript \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIarguments\fR .RS 4 -Ѥ硢ץޤϥޥ̾ľ˵ҤƤ򻲾ȤƤ +引数を使用する場合、オプションまたはコマンド名の直後に記述してください。引数を参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjrunscript\fRޥɤϡ˰¸ʤޥɥ饤󡦥ץȡǤ\fIjrunscript\fRϡ÷(read\-eval\-print)⡼ɤȥХå(\fI\-f\fRץ)⡼ɤξΥץȼ¹Ԥ򥵥ݡȤޤǥեȤλѸJavaScriptǤ\fI\-l\fRץѤ¾θǤޤ\fIjrunscript\fRޥɤϡJavaȥץȸȤ̿ѤõŪʥץߥ󥰡򥵥ݡȤޤ -.SH "ץ" +\fIjrunscript\fRコマンドは、言語に依存しないコマンドライン・スクリプト・シェルです。\fIjrunscript\fRは、対話型(read\-eval\-print)モードとバッチ(\fI\-f\fRオプション)・モードの両方のスクリプト実行をサポートします。デフォルトの使用言語はJavaScriptですが、\fI\-l\fRオプションを使用すれば他の言語も指定できます。\fIjrunscript\fRコマンドは、Javaとスクリプト言語との通信を使用して探求的なプログラミング・スタイルをサポートします。 +.SH "オプション" .PP \-classpath \fIpath\fR .RS 4 -ץȤɬפΤ륯饹եξ򼨤ޤ +スクリプトがアクセスする必要のあるクラス・ファイルの場所を示します。 .RE .PP \-cp \fIpath\fR .RS 4 \fI\-classpath\fR -\fIpath\fRƱǤ +\fIpath\fRと同じです。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -JavaΥƥࡦץѥƥꤷޤ +Javaのシステム・プロパティを設定します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIflag\fR\fIjrunscript\fRޥɤ¹ԤƤJavaۥޥľϤޤ +\fIflag\fRを、\fIjrunscript\fRコマンドが実行されているJava仮想マシンに直接渡します。 .RE .PP \-I \fIlanguage\fR .RS 4 -ꤵ줿ץȸѤޤǥեȤǤJavaScriptѤޤ¾ΥץȸѤˤϡ\fI\-cp\fRޤ\fI\-classpath\fRץѤơб륹ץȡ󥸥JARեꤹɬפޤ +指定されたスクリプト言語を使用します。デフォルトではJavaScriptが使用されます。他のスクリプト言語を使用するには、\fI\-cp\fRまたは\fI\-classpath\fRオプションを使用して、対応するスクリプト・エンジンのJARファイルを指定する必要があります。 .RE .PP \-e \fIscript\fR .RS 4 -ꤵ줿ץȤɾޤΥץѤСޥɥ饤ˤ٤Ƥꤵ줿1ԥץȤ¹ԤǤޤ +指定されたスクリプトを評価します。このオプションを使用すれば、コマンドラインにすべてが指定された1行スクリプトを実行できます。 .RE .PP \-encoding \fIencoding\fR .RS 4 -ץȡեɼ˻Ѥʸ󥳡ǥ󥰤ꤷޤ +スクリプト・ファイルの読取り時に使用する文字エンコーディングを指定します。 .RE .PP \-f \fIscript\-file\fR .RS 4 -ꤵ줿ץȡե(Хå⡼)ɾޤ +指定されたスクリプト・ファイル(バッチ・モード)を評価します。 .RE .PP \-f \- .RS 4 -ɸϤ饹ץȤɤ߼ꡢɾޤ(÷⡼) +標準入力からスクリプトを読み取り、それを評価します(対話型モード)。 .RE .PP \-help .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-? .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-q .RS 4 -Ѳǽʤ٤ƤΥץȡ󥸥ɽȡλޤ +利用可能なすべてのスクリプト・エンジンを一覧表示したあと、終了します。 .RE -.SH "" +.SH "引数" .PP -arguments¸ߤƤơ\fI\-e\fR\fI\-f\fRΤΥץѤʤä硢ǽΰץȡեȤʤꡢ¾ΰ¸ߤϥץȤϤޤargumentsȡ\fI\-e\fRޤ\fI\-f\fRץ󤬻ѤƤ硢٤ƤargumentsץȤϤޤarguments\fI\-e\fR\fI\-f\fRɤ¸ߤʤäϡ÷⡼ɤѤޤץȤ饹ץȰѤˤϡ\fIarguments\fRȤ̾\fIString\fR󷿤Υ󥸥ѿѤޤ -.SH "" -.SS "饤󡦥ץȤμ¹" +argumentsが存在していて、かつ\fI\-e\fR、\fI\-f\fRのいずれのオプションも使用されなかった場合、最初の引数がスクリプト・ファイルとなり、他の引数が存在する場合はスクリプトに渡されます。argumentsと、\fI\-e\fRまたは\fI\-f\fRオプションが使用されている場合、すべてのargumentsがスクリプトに渡されます。arguments、\fI\-e\fR、\fI\-f\fRがどれも存在しなかった場合は、対話型モードが使用されます。スクリプトからスクリプト引数を使用するには、\fIarguments\fRという名前の\fIString\fR配列型のエンジン変数を使用します。 +.SH "例" +.SS "インライン・スクリプトの実行" .sp .if n \{\ .RS 4 @@ -152,7 +152,7 @@ jrunscript \-e "cat(\*(Aqhttp://www\&.example\&.com\*(Aq)" .if n \{\ .RE .\} -.SS "ꤵ줿λѤӥץȡեɾ" +.SS "指定された言語の使用およびスクリプト・ファイルの評価" .sp .if n \{\ .RS 4 @@ -163,7 +163,7 @@ jrunscript \-l js \-f test\&.js .if n \{\ .RE .\} -.SS "÷⡼" +.SS "対話型モード" .sp .if n \{\ .RS 4 @@ -184,9 +184,9 @@ js> .if n \{\ .RE .\} -.SS "ץȰꤷץȡեμ¹" +.SS "スクリプト引数を指定したスクリプト・ファイルの実行" .PP -test\&.jsեϥץȡեǤ\fIarg1\fR\fIarg2\fR\fIarg3\fRγưץȤϤޤץȤargumentsѤƤΰ˥Ǥޤ +test\&.jsファイルはスクリプト・ファイルです。\fIarg1\fR、\fIarg2\fRおよび\fIarg3\fRの各引数がスクリプトに渡されます。スクリプトはarguments配列を使用してこれらの引数にアクセスできます。 .sp .if n \{\ .RS 4 @@ -197,10 +197,10 @@ jrunscript test\&.js arg1 arg2 arg3 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .PP -JavaScriptѤ硢桼ץȤɾˡ\fIjrunscript\fRޥɤϤĤȹߴؿȹߥ֥ȤޤJavaScriptȹߤˤĤƤϡhttp://code\&.google\&.com/p/jsdoc\-toolkit/ˤ -JsDoc\-Toolkit򻲾ȤƤ +JavaScriptが使用される場合、ユーザー定義スクリプトを評価する前に、\fIjrunscript\fRコマンドはいくつかの組込み関数や組込みオブジェクトを初期化します。これらのJavaScriptの組込みについては、http://code\&.google\&.com/p/jsdoc\-toolkit/にある +JsDoc\-Toolkitを参照してください。 .br 'pl 8.5i 'bp diff --git a/jdk/src/linux/doc/man/ja/jsadebugd.1 b/jdk/src/linux/doc/man/ja/jsadebugd.1 index 0425f1af70a..be8c6bc7756 100644 --- a/jdk/src/linux/doc/man/ja/jsadebugd.1 +++ b/jdk/src/linux/doc/man/ja/jsadebugd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jsadebugd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jsadebugd" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jsadebugd" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jsadebugd \- Javaץޤϥե³ǥХåСȤƵǽޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jsadebugd \- Javaプロセスまたはコア・ファイルに接続し、デバッグ・サーバーとして機能します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,26 +74,26 @@ jsadebugd \- Java .PP \fIpid\fR .RS 4 -ǥХåС³ץΥץIDǤץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤñΥץ³ǤǥХåСΥ󥹥󥹤ϡ1Ĥ¤ޤ +デバッグ・サーバーが接続するプロセスのプロセスIDです。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。単一のプロセスに接続できるデバッグ・サーバーのインスタンスは、1つに制限されます。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -ǥХåС³륳եǤ +デバッグ・サーバーを接続するコア・ファイルです。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥޥǼ¹ԤƤɬפˤʤ롢ץΰդIDǤIDϡ⡼ȡ饤Ȥ³ΥǥХåСꤹ뤿˻ѤɬפޤIDϡñΥޥǰդˤɬפޤ +複数のデバッグ・サーバーが同一のマシン上で実行されている場合に必要になる、オプションの一意のIDです。このIDは、リモート・クライアントが、接続先のデバッグ・サーバーを特定するために使用する必要があります。このIDは、単一のマシン内で一意にする必要があります。 .RE -.SH "" +.SH "説明" .PP -\fIjsadebugd\fRޥɤϡJavaץޤϥե³ǥХåСȤƵǽޤ\fIjstack\fR\fIjmap\fR\fIjinfo\fRʤɤΥ⡼ȡ饤ȤϡJava Remote Method Invocation (RMI)ѤƤ륵С³Ǥޤ\fIjsadebugd\fRޥɤưˡ\fIrmiregistry\fRޥɤRMI쥸ȥ򼡤Τ褦˵ưޤ\fI$JAVA_HOME\fRJDKΥ󥹥ȡ롦ǥ쥯ȥǤ +\fIjsadebugd\fRコマンドは、Javaプロセスまたはコア・ファイルに接続し、デバッグ・サーバーとして機能します。\fIjstack\fR、\fIjmap\fRおよび\fIjinfo\fRなどのリモート・クライアントは、Java Remote Method Invocation (RMI)を使用しているサーバーに接続できます。\fIjsadebugd\fRコマンドを起動する前に、\fIrmiregistry\fRコマンドでRMIレジストリを次のように起動します。\fI$JAVA_HOME\fRはJDKのインストール・ディレクトリです。 .sp .if n \{\ .RS 4 @@ -105,12 +105,12 @@ rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar .RE .\} .PP -RMI쥸ȥ꤬ưƤʤ硢\fIjsadebugd\fRޥɤRMI쥸ȥɸ(1099)ݡȤǵưޤǥХåСϡ\fISIGINT\fR뤳ȤˤߤǤޤSIGINTˤϡ\fB[Ctrl] + [C]\fR򲡤ޤ +RMIレジストリが起動していない場合、\fIjsadebugd\fRコマンドはRMIレジストリを標準(1099)ポートで内部で起動します。デバッグ・サーバーは、\fISIGINT\fRを送信することにより停止できます。SIGINTを送信するには、\fB[Ctrl] + [C]\fRを押します。 .PP -\fB:\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fR¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ: +\fB注意:\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。例: \fIs\fR\fIet PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jstack.1 b/jdk/src/linux/doc/man/ja/jstack.1 index 0afbad29b1d..ce2e8067621 100644 --- a/jdk/src/linux/doc/man/ja/jstack.1 +++ b/jdk/src/linux/doc/man/ja/jstack.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstack .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstack" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jstack" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstack \- Javaץեޤϥ⡼ȡǥХåСФJavaåɤΥåȥ졼ϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstack \- Javaプロセス、コア・ファイルまたはリモート・デバッグ・サーバーに対するJavaスレッドのスタック・トレースを出力します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -84,40 +84,40 @@ jstack \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -Ϥ륹åȥ졼ΥץIDǤץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +出力するスタック・トレースのプロセスIDです。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -Ϥ륹åȥ졼ΥեǤ +出力するスタック・トレースのコア・ファイルです。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjstack\fRޥɤϡꤵ줿Javaץեޤϥ⡼ȡǥХåСФJavaåɤJavaåȥ졼ϤޤJavaե졼ऴȤˡե륯饹̾᥽å̾Хȥɡǥå(bci)ӹֹ(Ѳǽʾ)Ϥޤ\fI\-m\fRץѤȡ\fIjstack\fRޥɤϡ٤ƤΥåɤJavaե졼ȥͥƥ֡ե졼ξ򡢥ץࡦ(PC)ȤȤ˽Ϥޤͥƥ֡ե졼ऴȤˡPC˺Ǥᤤͥƥ֡ܥ(Ѳǽʾ)ϤޤC++ʬ̾ʬޤC++̾ʬˤϡΥޥɤνϤ\fIc++filt\fR˥ѥפޤꤵ줿ץ64ӥåJavaۥޥǼ¹ԤƤϡ\fI\-J\-d64\fRץꤹɬפޤ(: -\fIjstack \-J\-d64 \-m pid\fR) +\fIjstack\fRコマンドは、指定されたJavaプロセス、コア・ファイルまたはリモート・デバッグ・サーバーに対するJavaスレッドのJavaスタック・トレースを出力します。Javaフレームごとに、フルクラス名、メソッド名、バイトコード・インデックス(bci)、および行番号(利用可能な場合)が出力されます。\fI\-m\fRオプションを使用すると、\fIjstack\fRコマンドは、すべてのスレッドのJavaフレームとネイティブ・フレームの両方を、プログラム・カウンタ(PC)とともに出力します。ネイティブ・フレームごとに、PCに最も近いネイティブ・シンボル(利用可能な場合)が出力されます。C++分解名は分解解除されません。C++名を分解解除するには、このコマンドの出力を\fIc++filt\fRにパイプします。指定されたプロセスが64ビットJava仮想マシン上で実行されている場合は、\fI\-J\-d64\fRオプションを指定する必要があります(例: +\fIjstack \-J\-d64 \-m pid\fR)。 .PP -\fB\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤdbgeng\&.dllե뤬¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ󡣤ޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ򼨤ޤ +\fB注意\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。dbgeng\&.dllファイルが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。また、\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。次に例を示します。 .sp .if n \{\ .RS 4 @@ -128,39 +128,39 @@ set PATH=<jdk>\ejre\ebin\eclient;%PATH% .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-F .RS 4 \fIjstack\fR [\fI\-l\fR] -\fIpid\fRʤ˥åפޤ +\fIpid\fRが応答しない場合にスタック・ダンプを強制します。 .RE .PP \-l .RS 4 -ĹΥꥹȡͭ\fIjava\&.util\&.concurrent\fRνͭǤ륷󥯥ʥΰʤɡåˤĤƤɲþޤhttp://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.htmlˤ -\fIAbstractOwnableSynchronizer\fR饹Ҥ򻲾ȤƤ +長形式のリスト。所有\fIjava\&.util\&.concurrent\fRの所有できるシンクロナイザの一覧など、ロックについての追加情報を印刷します。http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.htmlにある +\fIAbstractOwnableSynchronizer\fRクラス記述を参照してください .RE .PP \-m .RS 4 -JavaӥͥƥC/C++ե졼ξĺ⡼ɤΥåȥ졼Ϥޤ +JavaおよびネイティブC/C++フレームの両方を持つ混合モードのスタック・トレースを出力します。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE -.SH "ΤԶ" +.SH "既知の不具合" .PP -⡼ɤΥåȥ졼Ǥϡ\fI\-m\fRץϥ⡼ȡǥХåСǤϵǽޤ -.SH "Ϣ" +混合モードのスタック・トレースでは、\fI\-m\fRオプションはリモート・デバッグ・サーバーでは機能しません。 +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jstat.1 b/jdk/src/linux/doc/man/ja/jstat.1 index 046a2f37b7f..cf8321c9d6a 100644 --- a/jdk/src/linux/doc/man/ja/jstat.1 +++ b/jdk/src/linux/doc/man/ja/jstat.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstat .\" Language: English -.\" Date: 2011ǯ510 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2011年5月10日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstat" "1" "2011ǯ510" "JDK 8" "˥󥰡ġ" +.TH "jstat" "1" "2011年5月10日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstat \- Javaۥޥ(JVM)פƻ뤷ޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstat \- Java仮想マシン(JVM)の統計を監視します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ jstat \- Java .PP \fIgeneralOption\fR .RS 4 -ñȤǻѤŪʥޥɥ饤󡦥ץǤ(\fI\-help\fRޤ\fI\-options\fR)Ūʥץ򻲾ȤƤ +単独で使用する一般的なコマンドライン・オプションです(\fI\-help\fRまたは\fI\-options\fR)。一般的なオプションを参照してください。 .RE .PP \fIoutputOptions\fR .RS 4 -ñ\fIstatOption\fR\fI\-t\fR\fI\-h\fR\fI\-J\fRΤ줫Υץǹ1İʾνϥץ󡣽ϥץ򻲾ȤƤ +単一の\fIstatOption\fRと\fI\-t\fR、\fI\-h\fRおよび\fI\-J\fRのいずれかのオプションで構成される1つ以上の出力オプション。出力オプションを参照してください。 .RE .PP \fIvmid\fR .RS 4 -åJVM򼨤ʸǤ벾ۥޥ̻ҤǤŪʹʸϼΤȤǤ +ターゲットJVMを示す文字列である仮想マシン識別子です。一般的な構文は次のとおりです。 .sp .if n \{\ .RS 4 @@ -85,24 +85,24 @@ jstat \- Java .if n \{\ .RE .\} -\fIvmid\fRʸιʸϡURIιʸбƤޤ\fIvmid\fRʸϡJVMɽñ顢̿ץȥ롢ݡֹ桢¾μͭͤ򼨤ʣʹ¤ޤǡ͡˰ۤʤޤۥޥ̻Ҥ򻲾ȤƤ +\fIvmid\fR文字列の構文は、URIの構文に対応しています。\fIvmid\fR文字列は、ローカルJVMを表す単純な整数から、通信プロトコル、ポート番号、および他の実装固有の値を示す複雑な構造まで、様々に異なります。仮想マシン識別子を参照してください。 .RE .PP \fIinterval\fR [s|ms] .RS 4 -(s)ޤϥߥ(ms)Τꤷñ̤ǤΥץ󥰴ֳ֤ǤǥեȤñ̤ϥߥäǤˤɬפޤꤷ硢\fIjstat\fRޥɤϳƴֳ֤ǽϤޤ +秒(s)またはミリ秒(ms)のうち指定した単位でのサンプリング間隔です。デフォルトの単位はミリ秒です。正の整数にする必要があります。指定した場合、\fIjstat\fRコマンドは各間隔で出力を生成します。 .RE .PP \fIcount\fR .RS 4 -ɽ륵ץǤǥե̵ͤ¤ǡåJVMλޤǡޤ\fIjstat\fRޥɤλޤǡ\fIjstat\fRޥɤץǡɽޤͤϡǤɬפޤ +表示するサンプル数です。デフォルト値は無限で、ターゲットJVMが終了するまで、または\fIjstat\fRコマンドが終了するまで、\fIjstat\fRコマンドは統計データを表示します。この値は、正の整数である必要があります。 .RE -.SH "" +.SH "説明" .PP -\fIjstat\fRޥɤϡ֤ƤJava HotSpot VMΥѥեޥץǡɽޤåJVMϡۥޥ̻Ҥޤ\fIvmid\fRץˤäƼ̤ޤ -.SH "ۥޥ̻" +\fIjstat\fRコマンドは、設置されているJava HotSpot VMのパフォーマンス統計データを表示します。ターゲットJVMは、仮想マシン識別子または\fIvmid\fRオプションによって識別されます。 +.SH "仮想マシン識別子" .PP -\fIvmid\fRʸιʸϡURIιʸбƤޤ +\fIvmid\fR文字列の構文は、URIの構文に対応しています。 .sp .if n \{\ .RS 4 @@ -116,380 +116,380 @@ jstat \- Java .PP \fIprotocol\fR .RS 4 -̿ץȥǤ\fIprotocol\fRͤά졢ۥ̾ꤵƤʤ硢ǥեȤΥץȥ뤬ץåȥեͭκŬ줿롦ץȥˤʤޤ\fIprotocol\fRͤά졢ۥ̾ꤵƤϡǥեȡץȥ\fIrmi\fRˤʤޤ +通信プロトコルです。\fIprotocol\fR値が省略され、ホスト名が指定されていない場合、デフォルトのプロトコルが、プラットフォーム固有の最適化されたローカル・プロトコルになります。\fIprotocol\fR値が省略され、ホスト名が指定されている場合は、デフォルト・プロトコルは\fIrmi\fRになります。 .RE .PP \fIlvmid\fR .RS 4 -åJVMΥ벾ۥޥ̻ҤǤ\fIlvmid\fRϡƥJVMդ˼̤ץåȥեͭͤǤ\fIlvmid\fRϡۥޥ̻ҤͣɬǤǤ\fIlvmid\fRϡŪˤϥåJVMץФ륪ڥ졼ƥ󥰡ƥΥץ̻ҤǤɬ⤽ǤȤϸ¤ޤ\fIjps\fRޥɤѤơ\fIlvmid\fRǤޤޤUNIXץåȥեǤ\fIps\fRޥɤѤơWindowsǤWindowsޥ͡Ѥơ\fIlvmid\fRǤޤ +ターゲットJVMのローカル仮想マシン識別子です。\fIlvmid\fRは、システム上のJVMを一意に識別するプラットフォーム固有の値です。\fIlvmid\fRは、仮想マシン識別子の唯一の必須要素です。\fIlvmid\fRは、一般的にはターゲットJVMプロセスに対するオペレーティング・システムのプロセス識別子ですが、必ずしもそうであるとは限りません。\fIjps\fRコマンドを使用して、\fIlvmid\fRを特定できます。また、UNIXプラットフォームでは\fIps\fRコマンドを使用して、WindowsではWindowsタスク・マネージャを使用して、\fIlvmid\fRを特定できます。 .RE .PP \fIhostname\fR .RS 4 -åȡۥȤ򼨤ۥ̾ޤIPɥ쥹Ǥ\fIhostname\fRͤάƤϡåȡۥȤϥ롦ۥȤˤʤޤ +ターゲット・ホストを示すホスト名またはIPアドレスです。\fIhostname\fR値が省略されている場合は、ターゲット・ホストはローカル・ホストになります。 .RE .PP \fIport\fR .RS 4 -⡼ȡС̿뤿ΥǥեȡݡȤǤ\fIhostname\fRͤάƤ뤫Ŭ줿롦ץȥ뤬\fIprotocol\fRͤ˻ꤵƤ硢\fIport\fR̵ͤ뤵ޤʳξ硢\fIport\fRѥ᡼ΰϡˤäưۤʤޤǥեȤ\fIrmi\fRץȥξ硢ݡͤϡ⡼ȡۥȾrmiregistryΥݡֹ򼨤ޤ\fIport\fRͤά졢\fIprotocol\fRͤ\fIrmi\fRꤵƤ硢ǥեȤrmiregistryݡ(1099)Ѥޤ +リモート・サーバーと通信するためのデフォルト・ポートです。\fIhostname\fR値が省略されているか、最適化されたローカル・プロトコルが\fIprotocol\fR値に指定されている場合、\fIport\fR値は無視されます。それ以外の場合、\fIport\fRパラメータの扱いは、実装によって異なります。デフォルトの\fIrmi\fRプロトコルの場合、ポート値は、リモート・ホスト上のrmiregistryのポート番号を示します。\fIport\fR値が省略され、\fIprotocol\fR値で\fIrmi\fRが指定されている場合、デフォルトのrmiregistryポート(1099)が使用されます。 .RE .PP \fIservername\fR .RS 4 -\fIservername\fRѥ᡼ΰϡˤäưۤʤޤŬ줿롦ץȥξ硢Υեɤ̵뤵ޤ\fIrmi\fRץȥξ硢ϡ⡼ȡۥȾRMI꥽֥Ȥ̾ɽޤ +\fIservername\fRパラメータの扱いは、実装によって異なります。最適化されたローカル・プロトコルの場合、このフィールドは無視されます。\fIrmi\fRプロトコルの場合、これは、リモート・ホスト上のRMIリソース・オブジェクトの名前を表します。 .RE -.SH "ץ" +.SH "オプション" .PP -\fIjstat\fRޥɤϡŪʥץȽϥץ2ĤΥפΥץ򥵥ݡȤƤޤŪʥץѤ硢\fIjstat\fRޥɤϴñʻΨӥСɽޤϥץˤäơץǡϤƤȷޤޤ +\fIjstat\fRコマンドは、一般的なオプションと出力オプションの2つのタイプのオプションをサポートしています。一般的なオプションを使用した場合、\fIjstat\fRコマンドは簡単な使用率およびバージョン情報を表示します。出力オプションによって、統計データ出力の内容と形式が決まります。 .PP -٤ƤΥץȤεǽϡΥ꡼ѹޤѻߤǽޤ -.SS "Ūʥץ" +すべてのオプションとその機能は、将来のリリースで変更または廃止される可能性があります。 +.SS "一般的なオプション" .PP -줫ΰŪʥץꤷ硢¾Υץޤϥѥ᡼ϰڻǤޤ +いずれかの一般的なオプションを指定した場合、他のオプションまたはパラメータは一切指定できません。 .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-options .RS 4 -StaticץΥꥹȤɽޤϥץ򻲾ȤƤ +Staticオプションのリストを表示します。出力オプションを参照してください。 .RE -.SS "ϥץ" +.SS "出力オプション" .PP -ŪʥץꤷʤˡϥץǤޤϥץϡ\fIjstat\fRޥɤνϤƤȷꤷñ\fIstatOption\fRȤ줫νϥץ(\fI\-h\fR\fI\-t\fR\fI\-J\fR)ǹޤ\fIstatOption\fRϺǽ˵Ҥɬפޤ +一般的なオプションを指定しない場合に、出力オプションを指定できます。出力オプションは、\fIjstat\fRコマンドの出力の内容と形式を決定し、単一の\fIstatOption\fRといずれかの出力オプション(\fI\-h\fR、\fI\-t\fRおよび\fI\-J\fR)で構成されます。\fIstatOption\fRは最初に記述する必要があります。 .PP -Ϥϡ󤬶Ƕڤ줿ɽηˤʤޤȥޤإåԤˤäơΰ̣狼ޤإåɽ٤ꤹˤϡ\fI\-h\fRץѤޤΥإå̾ϡ͡ʥץ֤ǰݤƤޤ̤ˡ2ĤΥץƱ̾󤬻ѤƤС2ĤΥǡƱǤ +出力は、各列が空白で区切られた表の形式になります。タイトルを含むヘッダー行によって、各列の意味がわかります。ヘッダーの表示頻度を設定するには、\fI\-h\fRオプションを使用します。列のヘッダー名は、様々なオプション間で一貫性が保たれています。一般に、2つのオプションで同じ名前の列が使用されていれば、2つの列のデータ・ソースは同じです。 .PP -\fI\-t\fRץѤȡTimestampȤ٥դॹפ󤬡ϤκǽȤɽޤTimestampˤϡåJVMεưηв֤ñ̤ɽޤॹפ٤ϡ͡װˤäưۤʤꡢ̤٤ΤäƥǤΥåɡ塼ٱˤưޤ +\fI\-t\fRオプションを使用すると、Timestampというラベルの付いたタイムスタンプの列が、出力の最初の列として表示されます。Timestamp列には、ターゲットJVMの起動からの経過時間が、秒単位で表示されます。タイムスタンプの精度は、様々な要因によって異なり、大量の負荷のかかったシステムでのスレッド・スケジュールの遅延により変動します。 .PP -intervalcountѥ᡼Ѥơ\fIjstat\fRޥɤνϤɽ٤Ȳ򤽤줾ꤷޤ +intervalおよびcountパラメータを使用して、\fIjstat\fRコマンドがその出力を表示する頻度と回数をそれぞれ指定します。 .PP -\fB:\fR -Υ꡼Ǥηѹǽ뤿ᡢ\fIjstat\fRޥɤνϤϤ륹ץȤϺʤǤ\fIjstat\fRޥɤνϤϤ륹ץȤϡΥġξΥ꡼ǡΥץȤѹɬפ뤳ȤαդƤ +\fB注意:\fR +将来のリリースでこの形式は変更される可能性があるため、\fIjstat\fRコマンドの出力を解析するスクリプトは作成しなでください。\fIjstat\fRコマンドの出力を解析するスクリプトを作成する場合は、このツールの将来のリリースで、そのスクリプトを変更する必要があることに留意してください。 .PP \-\fIstatOption\fR .RS 4 -\fIjstat\fRޥɤɽץǡꤷޤˡѲǽʥץΰ򼨤ޤΥץåȥեࡦ󥹥ȡΥץɽˤϡŪʥץ\fI\-options\fRѤޤStatץ󤪤ӽϤ򻲾ȤƤ +\fIjstat\fRコマンドが表示する統計データ情報を指定します。次に、利用可能なオプションの一覧を示します。特定のプラットフォーム・インストールのオプションを一覧表示するには、一般的なオプションの\fI\-options\fRを使用します。Statオプションおよび出力を参照してください。 .sp -\fIclass\fR: 饹ư˴ؤץǡɽޤ +\fIclass\fR: クラス・ローダーの動作に関する統計データを表示します。 .sp -\fIcompiler\fR: Java HotSpot VM Just\-in\-Timeѥư˴ؤץǡɽޤ +\fIcompiler\fR: Java HotSpot VM Just\-in\-Timeコンパイラの動作に関する統計データを表示します。 .sp -\fIgc\fR: ١쥯Ȥ줿ҡפư˴ؤץǡɽޤ +\fIgc\fR: ガベージ・コレクトされたヒープの動作に関する統計データを表示します。 .sp -\fIgccapacity\fR: 头Ȥ̤бΰ˴ؤץǡɽޤ +\fIgccapacity\fR: 世代ごとの容量と対応する領域に関する統計データを表示します。 .sp -\fIgccause\fR: ١쥯ץǡΥޥ꡼(\fI\-gcutil\fRƱ)ȡľӸ(ŬѲǽʾ)Υ١쥯󡦥٥Ȥθɽޤ +\fIgccause\fR: ガベージ・コレクション統計データのサマリー(\fI\-gcutil\fRと同じ)と、直前および現在(適用可能な場合)のガベージ・コレクション・イベントの原因を表示します。 .sp -\fIgcnew\fR: Newư˴ؤץǡɽޤ +\fIgcnew\fR: New世代の動作に関する統計データを表示します。 .sp -\fIgcnewcapacity\fR: NewΥбΰ˴ؤץǡɽޤ +\fIgcnewcapacity\fR: New世代のサイズと対応する領域に関する統計データを表示します。 .sp -\fIgcold\fR: Oldưȥ᥿ڡ˴ؤץǡɽޤ +\fIgcold\fR: Old世代の動作とメタスペースに関する統計データを表示します。 .sp -\fIgcoldcapacity\fR: OldΥ˴ؤץǡɽޤ +\fIgcoldcapacity\fR: Old世代のサイズに関する統計データを表示します。 .sp -\fIgcmetacapacity\fR: ᥿ڡΥ˴ؤץǡɽޤ +\fIgcmetacapacity\fR: メタスペースのサイズに関する統計データを表示します。 .sp -\fIgcutil\fR: ١쥯Υޥ꡼˴ؤץǡɽޤ +\fIgcutil\fR: ガベージ・コレクションのサマリーに関する統計データを表示します。 .sp -\fIprintcompilation\fR: Java HotSpot VMѥ롦᥽åɤץǡɽޤ +\fIprintcompilation\fR: Java HotSpot VMコンパイル・メソッドの統計データを表示します。 .RE .PP \-h \fIn\fR .RS 4 -\fIn\fRץ(Ϲ)Ȥإåɽޤǡ\fIn\fRͤǤǥեͤ0Ǥξ硢ǡκǽιԤξإåɽޤ +\fIn\fRサンプル(出力行)ごとに列ヘッダーを表示します。ここで、\fIn\fRは正の整数値です。デフォルト値は0です。この場合、データの最初の行の上に列ヘッダーが表示されます。 .RE .PP \-t .RS 4 -ॹϤκǽȤɽޤॹפϡåJVMεưηв֤Ǥ +タイムスタンプ列を出力の最初の列として表示します。タイムスタンプは、ターゲットJVMの起動時からの経過時間です。 .RE .PP \-J\fIjavaOption\fR .RS 4 -\fIjavaOption\fRJavaץꥱưġϤޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤץδʥꥹȤˤĤƤϡjava(1)򻲾ȤƤ +\fIjavaOption\fRをJavaアプリケーション起動ツールに渡します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。オプションの完全なリストについては、java(1)を参照してください。 .RE -.SS "Statץ󤪤ӽ" +.SS "Statオプションおよび出力" .PP -ξϡ\fIjstat\fRޥɤ\fIstatOption\fRˤĤƽϤޤȤ᤿ΤǤ +次の情報は、\fIjstat\fRコマンドが各\fIstatOption\fRについて出力する列をまとめたものです。 .PP \-class \fIoption\fR .RS 4 -饹ץǡ +クラス・ローダーの統計データ。 .sp -\fILoaded\fR: ɤ줿饹ο +\fILoaded\fR: ロードされたクラスの数。 .sp -\fIBytes\fR: ɤ줿KBο +\fIBytes\fR: ロードされたKBの数。 .sp -\fIUnloaded\fR: ɤ줿饹ο +\fIUnloaded\fR: アンロードされたクラスの数。 .sp -\fIBytes\fR: ɤ줿KBο +\fIBytes\fR: アンロードされたKBの数。 .sp -\fITime\fR: 饹Υɤ䥢ɽפ֡ +\fITime\fR: クラスのロードやアンロード処理に要した時間。 .RE .PP \-compiler \fIoption\fR .RS 4 -Java HotSpot VM Just\-in\-Timeѥץǡ +Java HotSpot VM Just\-in\-Timeコンパイラの統計データ。 .sp -\fICompiled\fR: ¹Ԥ줿ѥ롦ο +\fICompiled\fR: 実行されたコンパイル・タスクの数。 .sp -\fIFailed\fR: Ԥѥ롦ο +\fIFailed\fR: 失敗したコンパイル・タスクの数。 .sp -\fIInvalid\fR: ̵ˤ줿ѥ롦ο +\fIInvalid\fR: 無効にされたコンパイル・タスクの数。 .sp -\fITime\fR: ѥ롦μ¹Ԥפ֡ +\fITime\fR: コンパイル・タスクの実行に要した時間。 .sp -\fIFailedType\fR: Ǹ˼ԤѥΥѥ롦ס +\fIFailedType\fR: 最後に失敗したコンパイルのコンパイル・タイプ。 .sp -\fIFailedMethod\fR: Ǹ˼ԤѥΥ饹̾ȥ᥽åɡ +\fIFailedMethod\fR: 最後に失敗したコンパイルのクラス名とメソッド。 .RE .PP \-gc \fIoption\fR .RS 4 -١쥯Ȥ줿ҡפץǡ +ガベージ・コレクトされたヒープの統計データ。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIS0U\fR: Survivorΰ0λΨ(KB) +\fIS0U\fR: Survivor領域0の使用率(KB)。 .sp -\fIS1U\fR: Survivorΰ1λΨ(KB) +\fIS1U\fR: Survivor領域1の使用率(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIEU\fR: EdenΰλΨ(KB) +\fIEU\fR: Eden領域の使用率(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIOU\fR: OldΰλΨ(KB) +\fIOU\fR: Old領域の使用率(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIMU\fR: ᥿ڡλΨ(KB) +\fIMU\fR: メタスペースの使用率(KB)。 .sp -\fIYGC\fR: 㤤Υ١쥯󡦥٥Ȥο +\fIYGC\fR: 若い世代のガベージ・コレクション・イベントの数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gccapacity \fIoption\fR .RS 4 -꡼ס太ΰ̡ +メモリー・プール世代および領域容量。 .sp -\fINGCMN\fR: NewκǾ(KB) +\fINGCMN\fR: New世代の最小容量(KB)。 .sp -\fINGCMX\fR: Newκ(KB) +\fINGCMX\fR: New世代の最大容量(KB)。 .sp -\fINGC\fR: Newθߤ(KB) +\fINGC\fR: New世代の現在の容量(KB)。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIOGCMN\fR: OldκǾ(KB) +\fIOGCMN\fR: Old世代の最小容量(KB)。 .sp -\fIOGCMX\fR: Oldκ(KB) +\fIOGCMX\fR: Old世代の最大容量(KB)。 .sp -\fIOGC\fR: Oldθߤ(KB) +\fIOGC\fR: Old世代の現在の容量(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIMCMN\fR: ᥿ڡκǾ(KB) +\fIMCMN\fR: メタスペースの最小容量(KB)。 .sp -\fIMCMX\fR: ᥿ڡκ(KB) +\fIMCMX\fR: メタスペースの最大容量(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .RE .PP \-gccause \fIoption\fR .RS 4 -Υץϡ\fI\-gcutil\fRץƱ١쥯ץǡΥޥ꡼ɽޤǸΥ١쥯󡦥٥Ȥ(ŬѲǽʾ)ߤΥ١쥯󡦥٥Ȥθޤޤޤ\fI\-gcutil\fRǰɽΤۤΥץǤϼɲäޤ +このオプションは、\fI\-gcutil\fRオプションと同じガベージ・コレクション統計データのサマリーを表示しますが、最後のガベージ・コレクション・イベントと(適用可能な場合は)現在のガベージ・コレクション・イベントの原因が含まれます。\fI\-gcutil\fRで一覧表示される列のほか、このオプションでは次の列が追加されます。 .sp -١쥯󡦥٥Ȥޤ६١쥯ץǡ +ガベージ・コレクション・イベントを含むガベージ・コレクション統計データ。 .sp -\fILGCC\fR: ǸΥ١쥯θ +\fILGCC\fR: 最後のガベージ・コレクションの原因。 .sp -\fIGCC\fR: ߤΥ١쥯θ +\fIGCC\fR: 現在のガベージ・コレクションの原因。 .RE .PP \-gcnew \fIoption\fR .RS 4 -Newץǡ +New世代の統計データ。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIS0U\fR: Survivorΰ0λΨ(KB) +\fIS0U\fR: Survivor領域0の使用率(KB)。 .sp -\fIS1U\fR: Survivorΰ1λΨ(KB) +\fIS1U\fR: Survivor領域1の使用率(KB)。 .sp -\fITT\fR: Ʋꤷ͡ +\fITT\fR: 殿堂入りしきい値。 .sp -\fIMTT\fR: Ʋꤷ͡ +\fIMTT\fR: 最大殿堂入りしきい値。 .sp -\fIDSS\fR: ŬڤSurvivor(KB) +\fIDSS\fR: 適切なSurvivorサイズ(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIEU\fR: EdenΰλΨ(KB) +\fIEU\fR: Eden領域の使用率(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .RE .PP \-gcnewcapacity \fIoption\fR .RS 4 -Newΰ襵ץǡ +New世代領域サイズの統計データ。 .sp -NGCMN: NewκǾ(KB) +NGCMN: New世代の最小容量(KB)。 .sp -\fINGCMX\fR: Newκ(KB) +\fINGCMX\fR: New世代の最大容量(KB)。 .sp -\fINGC\fR: Newθߤ(KB) +\fINGC\fR: New世代の現在の容量(KB)。 .sp -\fIS0CMX\fR: Survivorΰ0κ(KB) +\fIS0CMX\fR: Survivor領域0の最大容量(KB)。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1CMX\fR: Survivorΰ1κ(KB) +\fIS1CMX\fR: Survivor領域1の最大容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIECMX\fR: Edenΰκ(KB) +\fIECMX\fR: Eden領域の最大容量(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .RE .PP \-gcold \fIoption\fR .RS 4 -OldPermanentץǡ +OldおよびPermanent世代の統計データ。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIMU\fR: ᥿ڡλΨ(KB) +\fIMU\fR: メタスペースの使用率(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIOU\fR: OldΰλΨ(KB) +\fIOU\fR: Old領域の使用率(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcoldcapacity \fIoption\fR .RS 4 -Oldץǡ +Old世代の統計データ。 .sp -\fIOGCMN\fR: OldκǾ(KB) +\fIOGCMN\fR: Old世代の最小容量(KB)。 .sp -\fIOGCMX\fR: Oldκ(KB) +\fIOGCMX\fR: Old世代の最大容量(KB)。 .sp -\fIOGC\fR: Oldθߤ(KB) +\fIOGC\fR: Old世代の現在の容量(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcmetacapacity \fIoption\fR .RS 4 -Permanentץǡ +Permanent世代の統計データ。 .sp -\fIMCMN\fR: ᥿ڡκǾ(KB) +\fIMCMN\fR: メタスペースの最小容量(KB)。 .sp -\fIMCMX\fR: ᥿ڡκ(KB) +\fIMCMX\fR: メタスペースの最大容量(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcutil \fIoption\fR .RS 4 -١쥯ץǡΥޥ꡼ +ガベージ・コレクション統計データのサマリー .sp -\fIS0\fR: Survivorΰ0λΨ(ߤ̤Фѡơ) +\fIS0\fR: Survivor領域0の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIS1\fR: Survivorΰ1λΨ(ߤ̤Фѡơ) +\fIS1\fR: Survivor領域1の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIE\fR: EdenΰλΨ(ߤ̤Фѡơ) +\fIE\fR: Eden領域の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIO\fR: OldΰλΨ(ߤ̤Фѡơ) +\fIO\fR: Old領域の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIM\fR: ᥿ڡλΨ(ΰθߤ̤Фѡơ) +\fIM\fR: メタスペースの使用率(領域の現在の容量に対するパーセンテージ)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-printcompilation \fIoption\fR .RS 4 -Java HotSpot VMѥ롦᥽åɤץǡ +Java HotSpot VMコンパイル・メソッドの統計データ。 .sp -\fICompiled\fR: Ƕᥳѥ뤵줿᥽åɤǼ¹Ԥ줿ѥ롦ο +\fICompiled\fR: 最近コンパイルされたメソッドで実行されたコンパイル・タスクの数。 .sp -\fISize\fR: Ƕᥳѥ뤵줿᥽åɤΥХȡɤΥХȿ +\fISize\fR: 最近コンパイルされたメソッドのバイト・コードのバイト数。 .sp -\fIType\fR: Ƕᥳѥ뤵줿᥽åɤΥѥ롦ס +\fIType\fR: 最近コンパイルされたメソッドのコンパイル・タイプ。 .sp -\fIMethod\fR: Ƕᥳѥ뤵줿᥽åɤꤹ륯饹̾ȥ᥽å̾饹̾Ǥϡ֤̾ζڤʸȤơɥå(\&.)Τ˥å(/)Ѥޤ᥽å̾ϡꤵ줿饹Υ᥽åɤǤ2ĤΥեɤηϡHotSpot -\fI\-XX:+PrintComplation\fRץбƤޤ +\fIMethod\fR: 最近コンパイルされたメソッドを特定するクラス名とメソッド名。クラス名では、名前空間の区切り文字として、ドット(\&.)のかわりにスラッシュ(/)が使用されます。メソッド名は、指定されたクラス内のメソッドです。これらの2つのフィールドの形式は、HotSpot +\fI\-XX:+PrintComplation\fRオプションと対応しています。 .RE -.SH "" +.SH "例" .PP -ιǤϡ21891\fIlvmid\fRĥJVM˥󥰤򼨤ޤ -.SS "gcutilץ" +この項では、21891の\fIlvmid\fRを持つローカルJVMをモニタリングする例を示します。 +.SS "gcutilオプション" .PP -Ǥϡlvmid 21891³ơ250ߥôֳ֤7ĤΥץ\-\fIgcutil\fRץǤλ˽äƽϤɽޤ +この例では、lvmid 21891に接続して、250ミリ秒間隔で7つのサンプルを取得し、\-\fIgcutil\fRオプションでの指定に従って出力を表示します。 .PP -νϤϡ㤤Υ쥯3ܤ4ܤΥץ֤ǹԤ줿Ȥ򼨤Ƥޤ쥯ˤ0\&.001ääƤꡢ֥ȤEdenΰ(E)Oldΰ(O)˾ʤᡢOldΰλΨ9\&.49%9\&.51%äƤޤSurvivorΰϡ쥯12\&.44%ѤƤޤ쥯λѤ7\&.74%ΤߤǤ +この例の出力は、若い世代のコレクションが3番目と4番目のサンプル間で行われたことを示しています。コレクションには0\&.001秒かかっており、オブジェクトがEden領域(E)からOld領域(O)に昇格したため、Old領域の使用率は9\&.49%から9\&.51%に増加しています。Survivor領域は、コレクション前は12\&.44%が使用されていましたが、コレクション後の使用は7\&.74%のみです。 .sp .if n \{\ .RS 4 @@ -508,13 +508,13 @@ jstat \-gcutil 21891 250 7 .if n \{\ .RE .\} -.SS "إåʸη֤" +.SS "列ヘッダー文字列の繰返し" .PP -Ǥϡlvmid 21891³ơ250ߥôֳ֤ǥץ\fI\-gcutil\fRץǤλ˽äƽϤɽޤˡ\fI\-h3\fRץѤơǡ3ɽ뤴ȤإåϤޤ +この例では、lvmid 21891に接続して、250ミリ秒間隔でサンプルを取得し、\fI\-gcutil\fRオプションでの指定に従って出力を表示します。さらに、\fI\-h3\fRオプションを使用して、データが3行表示されるごとに列ヘッダーを出力します。 .PP -Ǥϡإåʸη֤ɽƤۤ2ܤ3ܤΥץ֤Young GCԤ줿Ȥ狼ޤη³֤0\&.001äǤΥ쥯ǤϡSurvivorΰ0λΨ(S0U)ŬڤSurvivor(DSS)Ķ᤹뤳Ȥˤʤ륢ƥ֡ǡФޤη̡֥ȤϡOld(νϤˤɽ)ؾʤ졢Ʋꤷ(TT)312ع߳ʤޤ +この例では、ヘッダー文字列の繰返しが表示されているほか、2番目と3番目のサンプル間でYoung GCが行われたことがわかります。この継続時間は0\&.001秒でした。このコレクションでは、Survivor領域0の使用率(S0U)が適切なSurvivorサイズ(DSS)を超過することになるアクティブ・データが検出されました。この結果、オブジェクトは、Old世代(この出力には非表示)へ昇格され、殿堂入りしきい値(TT)が、31から2へ降格されました。 .PP -̤Υ쥯󤬡5ܤ6ܤΥץ֤ǹԤƤޤΥ쥯ǤϡSurvivorۤȤɸ줺Ʋꤷͤ31ᤷޤ +別のコレクションが、5番目と6番目のサンプル間で行われています。このコレクションでは、Survivorがほとんど見られず、殿堂入りしきい値を31に戻しました。 .sp .if n \{\ .RS 4 @@ -535,11 +535,11 @@ jstat \-gcnew \-h3 21891 250 .if n \{\ .RE .\} -.SS "ץ뤴ȤΥॹפ" +.SS "サンプルごとのタイムスタンプの挿入" .PP -Ǥϡlvmid21891³250ߥôֳ֤3ĤΥץƤޤ\fI\-t\fRץѤơǽ˥ץ뤴ȤΥॹפɽƤޤ +この例では、lvmid21891へ接続し、250ミリ秒間隔で3つのサンプルを取得しています。\fI\-t\fRオプションを使用して、最初の列にサンプルごとのタイムスタンプを表示しています。 .PP -TimestampˤϡåJVMεưηв֤ñ̤ǥݡȤƤޤˡ\fI\-gcoldcapacity\fRϤǤϡꥯȤޤϾʥꥯȤ뤤Ϥξ˥ҡפĥ뤿ӤˡOld(OGC)Oldΰ(OC)ȤäƤ뤳Ȥ狼ޤ81ܤΥե롦١쥯(FGC)θ塢Old(OGC)11,696 KB13820 KBäޤ(ΰ)κ̤ϡ60,544 KB (OGCMX)ʤΤǡޤĥǤ;͵ĤƤޤ +Timestamp列には、ターゲットJVMの起動時からの経過時間が、秒単位でレポートされています。さらに、\fI\-gcoldcapacity\fR出力では、割当リクエストまたは昇格リクエストあるいはその両方を満たすためにヒープが拡張するたびに、Old世代の容量(OGC)とOld領域の容量(OC)とが増加していることがわかります。81番目のフル・ガベージ・コレクション(FGC)の後、Old世代の容量(OGC)は11,696 KBから13820 KBに増加しました。この世代(および領域)の最大容量は、60,544 KB (OGCMX)なので、まだ拡張できる余裕が残されています。 .sp .if n \{\ .RS 4 @@ -553,11 +553,11 @@ Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT .if n \{\ .RE .\} -.SS "⡼JVMΥ󥹥ȥơδƻ" +.SS "リモートJVMのインストゥルメンテーションの監視" .PP -ϡ\fI\-gcutil\fRץѤơremote\&.domainȤƥlvmid 40496³ץñ̵̤¤˼Ƥޤ +この例は、\fI\-gcutil\fRオプションを使用して、remote\&.domainというシステム上のlvmid 40496に接続し、サンプルを秒単位で無期限に取得しています。 .PP -lvmidϡ⡼ȡۥȤ̾ȷ礵ơ\fI40496@remote\&.domain\fR\fIvmid\fRƤޤ̤Ȥơvmidϡ\fIrmi\fRץȥѤơ⡼ȡۥȾΥǥեȤ\fIjstatd\fRС̿ޤ\fIjstatd\fRСϡrmiregistryѤơǥեȤrmiregistryݡ(ݡ1099)˥Хɤ줿\fIremote\&.domain\fR֤ޤ +lvmidは、リモート・ホストの名前と結合されて、\fI40496@remote\&.domain\fRの\fIvmid\fRを構成しています。結果として、このvmidは、\fIrmi\fRプロトコルを使用して、リモート・ホスト上のデフォルトの\fIjstatd\fRサーバーと通信します。\fIjstatd\fRサーバーは、rmiregistryを使用して、デフォルトのrmiregistryポート(ポート1099)にバインドされた\fIremote\&.domain\fRに配置されます。 .sp .if n \{\ .RS 4 @@ -569,7 +569,7 @@ jstat \-gcutil 40496@remote\&.domain 1000 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jstatd.1 b/jdk/src/linux/doc/man/ja/jstatd.1 index cfd8e4e4b82..e39a21cce5a 100644 --- a/jdk/src/linux/doc/man/ja/jstatd.1 +++ b/jdk/src/linux/doc/man/ja/jstatd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstatd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstatd" "1" "2013ǯ1121" "JDK 8" "˥󥰡ġ" +.TH "jstatd" "1" "2013年11月21日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstatd \- Javaۥޥ(JVM)˥⡼ȡ˥󥰡ġ뤬JVM³Ǥ褦ˤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstatd \- Java仮想マシン(JVM)をモニターし、リモート・モニタリング・ツールがJVMに接続できるようにします。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,47 +64,47 @@ jstatd \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjstatd\fRޥɤϡ¬줿Java HotSpot VMκȽλ˥롦ƥǼ¹ԤƤJVMˡ⡼ȡ˥󥰡ġ뤬³Ǥ褦ˤ뤿Υ󥿥ե󶡤RMIСץꥱǤ +\fIjstatd\fRコマンドは、計測されたJava HotSpot VMの作成と終了をモニターし、ローカル・システム上で実行されているJVMに、リモート・モニタリング・ツールが接続できるようにするためのインタフェースを提供するRMIサーバー・アプリケーションです。 .PP -\fIjstatd\fRСǤϡ롦ۥȤRMI쥸ȥ꤬ɬפˤʤޤ\fIjstatd\fRСϥǥեȡݡȤǡޤ\fI\-p\fR -\fIport\fRץǻꤷݡȤǡRMI쥸ȥ³褦ȤޤRMI쥸ȥ꤬Ĥʤ硢\fI\-p\fR -\fIport\fRץǻꤵ줿ݡȡޤ\fI\-p\fR -\fIport\fRץ󤬾άƤϡǥեRMI쥸ȥ˥Хɤ줿\fIjstatd\fRץꥱˡ1ĤRMI쥸ȥ꤬ޤRMI쥸ȥκϡ\fI\-nr\fRץꤹ뤳ȤˤäߤǤޤ -.SH "ץ" +\fIjstatd\fRサーバーでは、ローカル・ホストにRMIレジストリが必要になります。\fIjstatd\fRサーバーはデフォルト・ポートで、または\fI\-p\fR +\fIport\fRオプションで指定したポートで、RMIレジストリに接続しようとします。RMIレジストリが見つからない場合、\fI\-p\fR +\fIport\fRオプションで指定されたポート、または\fI\-p\fR +\fIport\fRオプションが省略されている場合は、デフォルトRMIレジストリにバインドされた\fIjstatd\fRアプリケーション内に、1つのRMIレジストリが作成されます。内部RMIレジストリの作成は、\fI\-nr\fRオプションを指定することによって中止できます。 +.SH "オプション" .PP \-nr .RS 4 -¸RMI쥸ȥ꤬Ĥʤ硢\fIjstatd\fRץRMI쥸ȥʤ褦ˤޤ +既存のRMIレジストリが見つからない場合、\fIjstatd\fRプロセス内に内部RMIレジストリを作成しないようにします。 .RE .PP \-p \fIport\fR .RS 4 -RMI쥸ȥ꤬ͽۤݡֹǤĤʤϡ\fI\-nr\fRץ󤬻ꤵƤʤкޤ +RMIレジストリがあると予想されるポート番号です。見つからない場合は、\fI\-nr\fRオプションが指定されていなければ作成されます。 .RE .PP \-n \fIrminame\fR .RS 4 -RMI쥸ȥˤơ⡼RMI֥ȤХɤ̾Ǥǥե̾\fIJStatRemoteHost\fRǤʣ\fIjstatd\fRСƱۥȾǵưƤ硢ƥСΥݡȤRMI֥Ȥ̾ϡΥץꤹ뤳Ȥˤäơդ̾ˤ뤳ȤǤޤΥץѤ硢˥󥰡饤Ȥ\fIhostid\fR\fIvmid\fRʸˡΰդΥС̾ޤɬפޤ +RMIレジストリにおいて、リモートRMIオブジェクトがバインドされる名前です。デフォルト名は\fIJStatRemoteHost\fRです。複数の\fIjstatd\fRサーバーが同じホスト上で起動している場合、各サーバーのエクスポートしたRMIオブジェクトの名前は、このオプションを指定することによって、一意の名前にすることができます。ただし、このオプションを使用する場合、モニタリング・クライアントの\fIhostid\fRおよび\fIvmid\fR文字列に、その一意のサーバー名を含める必要があります。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ\fIץ\fR1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されている\fIオプション\fRを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ƥ" +.SH "セキュリティ" .PP -\fIjstatd\fRСϡŬڤʥͥƥ֡JVMΤߤƻǤޤäơ\fIjstatd\fRץϡåJVMƱ桼ʤǼ¹ԤƤɬפޤUNIX١Υƥˤroot桼ʤɤΰΥ桼ʤϡƥǤդJVMˤäƥݡȤ줿󥹥ȥơؤΥäƤޤΤ褦ʻʤǼ¹ԤƤ\fIjstatd\fRץϡƥΤ٤ƤJVMƻǤޤƥ̤꤬ޤ +\fIjstatd\fRサーバーは、適切なネイティブ・アクセス権を持つJVMのみを監視できます。したがって、\fIjstatd\fRプロセスは、ターゲットJVMと同じユーザー資格で実行されている必要があります。UNIXベースのシステムにおけるrootユーザーなどの一部のユーザー資格は、システム上の任意のJVMによってエクスポートされたインストゥルメンテーションへのアクセス権を持っています。このような資格で実行されている\fIjstatd\fRプロセスは、システム上のすべてのJVMを監視できますが、セキュリティ上の別の問題が起こります。 .PP -\fIjstatd\fRСˤϡ⡼ȡ饤Ȥǧڵǽޤ󡣤Τᡢ\fIjstatd\fRСץ¹Ԥȡ\fIjstatd\fRץĤ٤ƤJVMˤ륤󥹥ȥơΥݡȤ򡢥ͥåȥΤ٤ƤΥ桼˸뤳Ȥˤʤޤ̵ʾ֤ϡĶˤäƤ˾ޤʤ礬Τǡä˼²ƯĶޤϰǤʤͥåȥǤϡ\fIjstatd\fRץưˡ롦ƥݥꥷƤɬפޤ +\fIjstatd\fRサーバーには、リモート・クライアントの認証機能がありません。そのため、\fIjstatd\fRサーバー・プロセスを実行すると、\fIjstatd\fRプロセスがアクセス権を持つすべてのJVMによるインストゥルメンテーションのエクスポートを、ネットワーク上のすべてのユーザーに公開することになります。この無防備な状態は、環境によっては望ましくない場合があるので、特に実稼働環境または安全でないネットワークでは、\fIjstatd\fRプロセスを起動する前に、ローカル・セキュリティ・ポリシーを検討する必要があります。 .PP -\fIjstatd\fRСϡ¾Υƥޥ͡㤬󥹥ȡ뤵Ƥʤˤϡ\fIRMISecurityPolicy\fRΥ󥹥󥹤򥤥󥹥ȡ뤷ޤΤᡢƥݥꥷեꤹɬפޤݥꥷեϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlˤ -֥ǥեȤPolicyμȥݥꥷեιʸפ˽򤷤Ƥɬפޤ +\fIjstatd\fRサーバーは、他のセキュリティ・マネージャがインストールされていない場合には、\fIRMISecurityPolicy\fRのインスタンスをインストールします。そのため、セキュリティ・ポリシー・ファイルを指定する必要があります。ポリシー・ファイルは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlにある +「デフォルトのPolicyの実装とポリシー・ファイルの構文」に準拠している必要があります .PP -ΥݥꥷեǤϡƥ㳰ȯ\fIjstatd\fRС¹ԤǤޤΥݥꥷϡ٤ƤΥɡ١ؤΤ륢ǧݥꥷ⼫ͳ٤㤤Ǥ\fIjstatd\fRС¹Ԥ뤿˺ɬפʥΤߤǧݥꥷ⼫ͳ٤⤯ʤäƤޤ +次のポリシー・ファイルでは、セキュリティ例外を発生せずに\fIjstatd\fRサーバーを実行できます。このポリシーは、すべてのコード・ベースへのあらゆるアクセス権を認めるポリシーよりも自由度が低いですが、\fIjstatd\fRサーバーを実行するために最低限必要なアクセス権のみを認めるポリシーよりも自由度が高くなっています。 .sp .if n \{\ .RS 4 @@ -118,7 +118,7 @@ grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { .RE .\} .PP -ΥݥꥷѤˤϡΥƥȤ\fIjstatd\&.all\&.policy\fRȤե˥ԡΤ褦\fIjstatd\fRС¹Ԥޤ +このポリシー設定を使用するには、このテキストを\fIjstatd\&.all\&.policy\fRというファイルにコピーし、次のように\fIjstatd\fRサーバーを実行します。 .sp .if n \{\ .RS 4 @@ -130,16 +130,16 @@ jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy .RE .\} .PP -긷ƥ»ܤ륵Ȥξ硢ࡦݥꥷեѤơοǤۥȤޤϥͥåȥ˥¤뤳ȤǤޤΤ褦ˡϡIPɥ쥹İ䤹ʤޤƥˤĤơޥݥꥷեǤнǤʤϡ\fIjstatd\fRС¹Ԥˡ\fIjstat\fR\fIjps\fRġǻѤ뤳ȤǤˡˤʤޤ -.SH "⡼ȡ󥿥ե" +より厳しいセキュリティを実施するサイトの場合、カスタム・ポリシー・ファイルを使用して、特定の信頼できるホストまたはネットワークにアクセスを制限することができます。ただし、このような方法は、IPアドレスの盗聴攻撃を受けやすくなります。セキュリティの問題について、カスタマイズしたポリシー・ファイルでも対処できない場合は、\fIjstatd\fRサーバーを実行せずに、\fIjstat\fRと\fIjps\fRツールをローカルで使用することが最も安全な方法になります。 +.SH "リモート・インタフェース" .PP -\fIjstatd\fRץݡȤ륤󥿥եϡȼ˳ȯΤǤѹͽǤ桼ӳȯԤϡΥ󥿥եؤνߤԤʤǤ -.SH "" +\fIjstatd\fRプロセスがエクスポートするインタフェースは、独自に開発したものであり変更される予定です。ユーザーおよび開発者は、このインタフェースへの書込みを行わないでください。 +.SH "例" .PP -ˡ\fIjstatd\fRޥɤ򼨤ޤ\fIjstatd\fRץȤˤäơСϥХå饦ɤǼưŪ˵ưޤ -.SS "RMI쥸ȥ" +次に、\fIjstatd\fRコマンドの例を示します。\fIjstatd\fRスクリプトによって、サーバーはバックグラウンドで自動的に起動します。 +.SS "内部RMIレジストリ" .PP -ϡRMI쥸ȥѤۥȤˤ\fIjstatd\fRåεưɽƤޤǤϡǥեȤRMI쥸ȥꡦݡ(ݡ1099)ˤϡ¾ΥСϥХɤƤʤꤷƤޤ +この例は、内部RMIレジストリを使用したホストによる\fIjstatd\fRセッションの起動を表しています。この例では、デフォルトのRMIレジストリ・ポート(ポート1099)には、他のサーバーはバインドされていないと想定しています。 .sp .if n \{\ .RS 4 @@ -150,9 +150,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .if n \{\ .RE .\} -.SS "RMI쥸ȥ" +.SS "外部RMIレジストリ" .PP -ϡRMI쥸ȥѤ\fIjstatd\fRåεưɽƤޤ +この例は、外部RMIレジストリを使用した\fIjstatd\fRセッションの起動を表しています。 .sp .if n \{\ .RS 4 @@ -165,7 +165,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .RE .\} .PP -Ǥϡݡ2020γRMI쥸ȥѤ\fIjstatd\fRåưޤ +この例では、ポート2020の外部RMIレジストリを使用して\fIjstatd\fRセッションを起動します。 .sp .if n \{\ .RS 4 @@ -178,7 +178,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020 .RE .\} .PP -Ǥϡݡ2020γRMI쥸ȥѤơ\fIAlternateJstatdServerName\fR˥ХɤƤ\fIjstatd\fRåưޤ +この例では、ポート2020の外部RMIレジストリを使用して、\fIAlternateJstatdServerName\fRにバインドされている\fIjstatd\fRセッションを起動します。 .sp .if n \{\ .RS 4 @@ -191,9 +191,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020 .if n \{\ .RE .\} -.SS "ץRMI쥸ȥκ" +.SS "インプロセスRMIレジストリの作成の停止" .PP -ǤϡRMI쥸ȥ꤬ʤ˺ʤ\fIjstatd\fRåưޤǤϡRMI쥸ȥ꤬Ǥ˼¹ԤƤꤷƤޤRMI쥸ȥ꤬¹ԤƤʤ硢顼åɽޤ +この例では、外部RMIレジストリがない場合に作成しない\fIjstatd\fRセッションを起動します。この例では、RMIレジストリがすでに実行されていると想定しています。RMIレジストリが実行されていない場合、エラー・メッセージが表示されます。 .sp .if n \{\ .RS 4 @@ -204,9 +204,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr .if n \{\ .RE .\} -.SS "RMI󥰤ͭ" +.SS "RMIロギングの有効化" .PP -ǤϡRMI󥰵ǽͭ\fIjstatd\fRåưޤˡϡȥ֥륷塼ƥ󥰤ޤϥСưΥ˥󥰤Ωޤ +この例では、RMIロギング機能を有効化して\fIjstatd\fRセッションを起動します。この方法は、トラブルシューティングまたはサーバー活動のモニタリングに役立ちます。 .sp .if n \{\ .RS 4 @@ -218,7 +218,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/jvisualvm.1 b/jdk/src/linux/doc/man/ja/jvisualvm.1 index d4d0d519bf6..91f1a90a25d 100644 --- a/jdk/src/linux/doc/man/ja/jvisualvm.1 +++ b/jdk/src/linux/doc/man/ja/jvisualvm.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jvisualvm .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaȥ֥륷塼ƥ󥰡ץե󥰡˥󥰤Ӵġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaトラブルシューティング、プロファイリング、モニタリングおよび管理ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jvisualvm" "1" "2013ǯ1121" "JDK 8" "Javaȥ֥륷塼ƥ󥰡ץե󥰡˥" +.TH "jvisualvm" "1" "2013年11月21日" "JDK 8" "Javaトラブルシューティング、プロファイリング、モニタリン" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jvisualvm \- JavaץꥱŪ˴ƻ롢ȥ֥륷塼Ȥӥץե뤷ޤ -.SH "" +jvisualvm \- Javaアプリケーションを視覚的に監視、トラブルシュートおよびプロファイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ jvisualvm \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -Java VisualVMϡꤵ줿Javaۥޥ(JVM)JavaƥΥ١Υץꥱ(Javaץꥱ)¹ԤƤȤˡJavaץꥱ˴ؤܺ٤ʾ󶡤ľŪʥե롦桼󥿥եǤJava VisualVMȤ̾ϡJava VisualVMJVMեȥ˴ؤŪ󶡤Ȥ¤ͳ褷Ƥޤ +Java VisualVMは、指定されたJava仮想マシン(JVM)でJavaテクノロジ・ベースのアプリケーション(Javaアプリケーション)が実行されているときに、そのJavaアプリケーションに関する詳細な情報を提供する直感的なグラフィカル・ユーザー・インタフェースです。Java VisualVMという名前は、Java VisualVMがJVMソフトウェアに関する情報を視覚的に提供するという事実に由来しています。 .PP -Java VisualVMϡĤΥ˥󥰡ȥ֥륷塼ƥ󥰤ӥץե󥰡桼ƥƥ1ĤΥġ礷ޤȤСɥ󡦥ġ\fIjmap\fR\fIjinfo\fR\fIjstat\fR\fIjstack\fR󶡤Ƥ뵡ǽΤۤȤɤJava VisualVMȤ߹ޤƤޤ\fIjconsole\fRޥɤˤä󶡤εǽʤɡ¾εǽϥץΥץ饰ȤɲäǤޤ +Java VisualVMは、いくつかのモニタリング、トラブルシューティングおよびプロファイリング・ユーティリティを1つのツールに統合します。たとえば、スタンドアロン・ツール\fIjmap\fR、\fIjinfo\fR、\fIjstat\fRおよび\fIjstack\fRで提供されている機能のほとんどが、Java VisualVMに組み込まれています。\fIjconsole\fRコマンドによって提供される一部の機能など、他の機能はオプションのプラグインとして追加できます。 .PP -Java VisualVMϡJavaץꥱγȯԤץꥱΥȥ֥륷塼ƥ󥰤ԤäꡢץꥱΥѥեޥ󥹤ƻ뤪ӲꤹΤΩޤJava VisualVMѤȡȯԤϥҡספӲϡ꡼꡼ꡢ١쥯μ¹ԤӴƻ롢ӥ꡼CPUδʰץץե󥰤μ¹Ԥǽˤʤޤץ饰Java VisualVMεǽĥǤޤȤС\fIjconsole\fRޥɤΤۤȤɤεǽϡMBeanץ֤JConsole Plug\-in Wrapperץ饰𤷤ƻѤǤޤɸJava VisualVMץ饰Υ򤹤ˤϡJava VisualVM˥塼\fB֥ġ\fR\fB֥ץ饰\fR򤷤ޤ +Java VisualVMは、Javaアプリケーションの開発者がアプリケーションのトラブルシューティングを行ったり、アプリケーションのパフォーマンスを監視および改善したりするのに役立ちます。Java VisualVMを使用すると、開発者はヒープ・ダンプの生成および解析、メモリー・リークの特定、ガベージ・コレクションの実行および監視、およびメモリーとCPUの簡易プロファイリングの実行が可能になります。プラグインでJava VisualVMの機能を拡張できます。たとえば、\fIjconsole\fRコマンドのほとんどの機能は、「MBean」タブおよびJConsole Plug\-in Wrapperプラグインを介して使用できます。標準のJava VisualVMプラグインのカタログから選択するには、Java VisualVMメニューの\fB「ツール」\fR、\fB「プラグイン」\fRを選択します。 .PP -Java VisualVMưˤϡΥޥɤ¹Ԥޤ +Java VisualVMを起動するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -85,15 +85,15 @@ Java VisualVM .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -ΥץϡJava VisualVMưȤ˼¹Բǽˤʤޤ +次のオプションは、Java VisualVMを起動したときに実行可能になります。 .PP \-J\fIjvm_option\fR .RS 4 -\fIjvm_option\fRJVMեȥϤޤ +この\fIjvm_option\fRをJVMソフトウェアに渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -103,7 +103,7 @@ Java VisualVM .sp -1 .IP \(bu 2.3 .\} -Java VisualVMȯԤΥ +Java VisualVM開発者のサイト http://visualvm\&.java\&.net/ .RE .sp @@ -115,7 +115,7 @@ http://visualvm\&.java\&.net/ .sp -1 .IP \(bu 2.3 .\} -Java SEɥȤJava VisualVM +Java SEドキュメントのJava VisualVM (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/visualvm/index\&.html) .RE .br diff --git a/jdk/src/linux/doc/man/ja/keytool.1 b/jdk/src/linux/doc/man/ja/keytool.1 index c19d4cf4e45..42f619fb8fe 100644 --- a/jdk/src/linux/doc/man/ja/keytool.1 +++ b/jdk/src/linux/doc/man/ja/keytool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: keytool .\" Language: English -.\" Date: 2013ǯ86 -.\" SectDesc: ƥġ +.\" Date: 2013年8月6日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "keytool" "1" "2013ǯ86" "JDK 8" "ƥġ" +.TH "keytool" "1" "2013年8月6日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -keytool \- Ź沽X\&.509󤪤ӿǤޤ७ȥ(ǡ١)ޤ -.SH "" +keytool \- 暗号化鍵、X\&.509証明書チェーンおよび信頼できる証明書を含むキーストア(データベース)を管理します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,7 +64,7 @@ keytool \- .PP \fIcommands\fR .RS 4 -ޥɤ򻲾ȤƤΥޥɤϡΤ褦˥̤ʬवޤ +コマンドを参照してください。これらのコマンドは、次のようにタスク別に分類されます。 .sp .RS 4 .ie n \{\ @@ -74,7 +74,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ȥؤΥǡκޤɲ +キーストアへのデータの作成または追加 .sp .RS 4 .ie n \{\ @@ -140,7 +140,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -̤ΥȥƤΥݡ +別のキーストアの内容のインポート .sp .RS 4 .ie n \{\ @@ -162,7 +162,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ꥯȤ +証明書リクエストの生成 .sp .RS 4 .ie n \{\ @@ -184,7 +184,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ǡΥݡ +データのエクスポート .sp .RS 4 .ie n \{\ @@ -206,7 +206,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ǡɽ +データの表示 .sp .RS 4 .ie n \{\ @@ -261,7 +261,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ȥδ +キーストアの管理 .sp .RS 4 .ie n \{\ @@ -316,7 +316,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -إפɽ +ヘルプの表示 .sp .RS 4 .ie n \{\ @@ -330,18 +330,18 @@ keytool \- .RE .RE .RE -.SH "" +.SH "説明" .PP -\fIkeytool\fRޥɤϡȾ뤿Υ桼ƥƥǤˤꡢ桼ϼʬθ̩ΥڥӴϢǥ̾Ѥǧ(¾Υ桼ޤϥӥФƼʬȤǧڤ뤳)䡢ǡȾ˴ؤ륵ӥѤ뤳ȤǤޤ\fIkeytool\fRޥɤǤϡ̿Ƥԥθ򥭥å夹뤳ȤǤޤ(Υե) +\fIkeytool\fRコマンドは、鍵と証明書を管理するためのユーティリティです。これにより、ユーザーは自分の公開鍵と秘密鍵のペアおよび関連する証明書を管理し、デジタル署名を使用した自己認証(他のユーザーまたはサービスに対して自分自身を認証すること)や、データの整合性と証明書に関するサービスを利用することができます。\fIkeytool\fRコマンドでは、通信しているピアの公開鍵をキャッシュすることもできます(証明書のフォームで)。 .PP -Ȥϡ륨ƥƥ(ʪҤʤ)Υǥ̾դʸΤȤǤˤϡ¾Τ륨ƥƥθ(Ӥ¾ξ)̤ͤäƤ뤳Ȥ񤫤Ƥޤ(򻲾ȤƤ)ǡ˥ǥ̾դƤϡǥ̾򸡾ڤ뤳ȤǡǡӥǡʪǤ뤳ȤåǤޤǡȤϡǡѹ줿ꡢѤ줿ꤷƤʤȤ̣ޤޤǡʪǤȤϡΥǡǡƽ̾ȾΤʪϤ줿ǡǤ뤳Ȥ̣ޤ +証明書とは、あるエンティティ(人物、会社など)からのデジタル署名付きの文書のことです。証明書には、他のあるエンティティの公開鍵(およびその他の情報)が特別な値を持っていることが書かれています。(証明書を参照してください。)データにデジタル署名が付いている場合は、デジタル署名を検証することで、データの整合性およびデータが本物であることをチェックできます。データの整合性とは、データが変更されたり、改変されたりしていないことを意味します。また、データが本物であるとは、そのデータが、データを作成して署名したと称する人物から渡されたデータであることを意味します。 .PP -ޤ\fIkeytool\fRޥɤѤСоΰŹ沽/沽(DES)ǻѤ̩ӥѥե졼뤳ȤǤޤ +また、\fIkeytool\fRコマンドを使用すれば、対称暗号化/復号化(DES)で使用される秘密鍵およびパスフレーズを管理することもできます。 .PP -\fIkeytool\fRޥɤϡȾ򥭡ȥ˳Ǽޤȥ̾򻲾ȤƤ -.SH "ޥɤȥץ˴ؤ" +\fIkeytool\fRコマンドは、鍵と証明書をキーストアに格納します。キーストアの別名を参照してください。 +.SH "コマンドとオプションに関する注意" .PP -͡ʥޥɤȤˤĤƤϡޥɤ򻲾ȤƤ +様々なコマンドとその説明については、コマンドを参照してください。 .sp .RS 4 .ie n \{\ @@ -351,7 +351,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ɤΥޥ̾ӥץ̾ˤƬ˥ޥʥ(\-)դޤ +どのコマンド名およびオプション名にも先頭にマイナス記号(\-)が付きます。 .RE .sp .RS 4 @@ -362,7 +362,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ƥޥɤΥץǤդνǻǤޤ +各コマンドのオプションは任意の順序で指定できます。 .RE .sp .RS 4 @@ -373,7 +373,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -åΤˤʤäƤʤ٤Ƥιܡޤ楫åѥåǰϤޤƤ뤹٤ƤιܤϡΤȤ˻ꤹɬפޤ +イタリック体になっていないすべての項目、または中カッコか角カッコで囲まれているすべての項目は、そのとおりに指定する必要があります。 .RE .sp .RS 4 @@ -384,7 +384,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץϤ楫åϡΥץ򥳥ޥɥ饤ǻꤷʤäˡǥեͤѤ뤳Ȥ̣ޤץΥǥեͤ򻲾ȤƤ楫åϡ\fI\-v\fR\fI\-rfc\fR\fI\-J\fRץϤिˤѤޤΥץϥޥɥ饤ǻꤵ줿ˤΤ̣߰ޤꤵƤʤʳǥեͤϤޤ +オプションを囲む中カッコは、そのオプションをコマンドラインで指定しなかった場合に、デフォルト値が使用されることを意味します。オプションのデフォルト値を参照してください。中カッコは、\fI\-v\fR、\fI\-rfc\fRおよび\fI\-J\fRオプションを囲むためにも使用されますが、これらのオプションはコマンドラインで指定された場合にのみ意味を持ちます。指定されていない場合以外、デフォルト値はありません。 .RE .sp .RS 4 @@ -395,7 +395,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץϤѥåϡΥץ򥳥ޥɥ饤ǻꤷʤäˡͤϤ뤳Ȥ̣ޤ\fI\-keypass\fRץξ硢ץ򥳥ޥɥ饤ǻꤷʤäϡ\fIkeytool\fRޥɤޤȥΥѥɤѤ/̩ߤޤλߤԤ硢\fIkeytool\fRޥɤˤꡢ/̩ΥѥɤϤޤ +オプションを囲む角カッコは、そのオプションをコマンドラインで指定しなかった場合に、値の入力を求められることを意味します。\fI\-keypass\fRオプションの場合、オプションをコマンドラインで指定しなかった場合は、\fIkeytool\fRコマンドがまずキーストアのパスワードを使用して非公開/秘密鍵の復元を試みます。この試みが失敗した場合、\fIkeytool\fRコマンドにより、非公開/秘密鍵のパスワードの入力を求められます。 .RE .sp .RS 4 @@ -406,11 +406,11 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -åΤιܤμºݤ(ץ)ϡꤹɬפޤȤС\fI\-printcert\fRޥɤηϼΤȤǤ +イタリック体の項目の実際の値(オプションの値)は、指定する必要があります。たとえば、\fI\-printcert\fRコマンドの形式は次のとおりです。 .sp \fIkeytool \-printcert {\-file cert_file} {\-v}\fR .sp -\fI\-printcert\fRޥɤꤹϡ\fIcert_file\fRºݤΥե֤̾ޤ: +\fI\-printcert\fRコマンドを指定する場合は、\fIcert_file\fRを実際のファイル名で置き換えます。例: \fIkeytool \-printcert \-file VScert\&.cer\fR .RE .sp @@ -422,7 +422,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץͤ˶(ڡ)ޤޤƤϡͤǰϤɬפޤ +オプションの値に空白(スペース)が含まれている場合は、値を引用符で囲む必要があります。 .RE .sp .RS 4 @@ -433,11 +433,11 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -\fI\-help\fRץ󤬥ǥեȤǤ\fIkeytool\fRޥɤϡ\fIkeytool \-help\fRƱǤ +\fI\-help\fRオプションがデフォルトです。\fIkeytool\fRコマンドは、\fIkeytool \-help\fRと同じです。 .RE -.SH "ץΥǥե" +.SH "オプションのデフォルト値" .PP -ǡ͡ʥץͤΥǥեͤ򼨤ޤ +次の例で、様々なオプション値のデフォルト値を示します。 .sp .if n \{\ .RS 4 @@ -474,7 +474,7 @@ keytool \- .RE .\} .PP -/̩ڥˤơ̾르ꥺ(\fI\-sigalg\fRץ)ϡˤʤ̩Υ르ꥺफޤ +公開/秘密鍵ペアの生成において、署名アルゴリズム(\fI\-sigalg\fRオプション)は、基になる秘密鍵のアルゴリズムから派生します。 .sp .RS 4 .ie n \{\ @@ -484,7 +484,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩DSAפǤϡ\fI\-sigalg\fRץΥǥեͤSHA1withDSAˤʤޤ +基になる秘密鍵がDSAタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA1withDSAになります。 .RE .sp .RS 4 @@ -495,7 +495,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩RSAפǤϡ\fI\-sigalg\fRץΥǥեͤSHA256withRSAˤʤޤ +基になる秘密鍵がRSAタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA256withRSAになります。 .RE .sp .RS 4 @@ -506,40 +506,40 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩ECפǤϡ\fI\-sigalg\fRץΥǥեͤSHA256withECDSAˤʤޤ +基になる秘密鍵がECタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA256withECDSAになります。 .RE .PP -\fI\-keyalg\fR\fI\-sigalg\fRδʥꥹȤˤĤƤϡ -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAΡJava Cryptography Architecture (JCA) Reference Guideפ򻲾ȤƤ -.SH "̥ץ" +\fI\-keyalg\fRおよび\fI\-sigalg\fR引数の完全なリストについては、 +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAの「Java Cryptography Architecture (JCA) Reference Guide」を参照してください。 +.SH "一般オプション" .PP -\fI\-v\fRץϡ\fI\-help\fRޥɤ٤ƤΥޥɤǻѤǤޤ\fI\-v\fRץꤷ硢ޥɤϾĹ⡼ɤǼ¹Ԥ졢ܺ٤ʾ󤬽Ϥޤ +\fI\-v\fRオプションは、\fI\-help\fRコマンドを除くすべてのコマンドで使用できます。\fI\-v\fRオプションを指定した場合、コマンドは冗長モードで実行され、詳細な情報が出力されます。 .PP -ǤդΥޥɤǻǤ\fI\-Jjavaoption\fR⤢ޤ\fI\-Jjavaoption\fRꤷ硢ꤵ줿\fIjavaoption\fRʸJava󥿥ץ꥿ľϤޤΥץˤϡޤ뤳ȤϤǤޤ󡣤Υץϡ¹ԴĶޤϥ꡼ѤĴǤǤ륤󥿥ץ꥿ץɽˤϡޥɥ饤\fIjava \-h\fRޤ\fIjava \-X\fRϤƤ +任意のコマンドで指定できる\fI\-Jjavaoption\fR引数もあります。\fI\-Jjavaoption\fRを指定した場合、指定された\fIjavaoption\fR文字列がJavaインタプリタに直接渡されます。このオプションには、空白を含めることはできません。このオプションは、実行環境またはメモリー使用を調整する場合に便利です。指定できるインタプリタ・オプションを一覧表示するには、コマンドラインで\fIjava \-h\fRまたは\fIjava \-X\fRと入力してください。 .PP -ΥץϡȥФԤ٤ƤΥޥɤǻǤޤ +次のオプションは、キーストアに対する操作を行うすべてのコマンドで指定できます。 .PP \-storetype \fIstoretype\fR .RS 4 -νҤϡ󥹥󥹤륭ȥΥפꤷޤ +この修飾子は、インスタンスを生成するキーストアのタイプを指定します。 .RE .PP \-keystore \fIkeystore\fR .RS 4 -ȥξꤷޤ +キーストアの場所を指定します。 .sp -\fIkeytool\fRޥɤ¹ԤݤˡJKS -\fIstoretype\fRѤ졢ĥȥե뤬ޤ¸ߤƤʤä硢ȥե뤬ޤȤС\fIkeytool \-genkeypair\fRθƽФ\fI\-keystore\fRץ󤬻ꤵʤä硢\fI\&.keystore\fRȤ̾Υǥեȡȥե뤬桼Υۡࡦǥ쥯ȥˤޤ¸ߤƤʤС˺ޤƱͤˡ\fI\-keystore ks_file\fRȤץ󤬻ꤵƤ⤽ks_file¸ߤʤä硢Υե뤬ޤJKS -\fIstoretype\fRξܺ٤ϡ\fI\fRKeyStoreμȥ̾˴ؤ򻲾ȤƤ +特定の\fIkeytool\fRコマンドを実行する際に、JKS +\fIstoretype\fRが使用され、かつキーストア・ファイルがまだ存在していなかった場合、新しいキーストア・ファイルが作成されます。たとえば、\fIkeytool \-genkeypair\fRの呼出し時に\fI\-keystore\fRオプションが指定されなかった場合、\fI\&.keystore\fRという名前のデフォルト・キーストア・ファイルがユーザーのホーム・ディレクトリ内にまだ存在していなければ、そこに作成されます。同様に、\fI\-keystore ks_file\fRというオプションが指定されてもそのks_fileが存在しなかった場合、そのファイルが作成されます。JKS +\fIstoretype\fRの詳細は、\fIの\fRKeyStoreの実装キーストアの別名に関する項を参照してください。 .sp -\fI\-keystore\fRץ󤫤ϥȥ꡼ϡ\fIKeyStore\&.load\fR᥽åɤϤޤURLȤ\fINONE\fRꤵƤϡnullΥȥ꡼ब\fIKeyStore\&.load\fR᥽åɤϤޤ\fINONE\fRϡKeyStoreե١ǤϤʤ˻ꤷƤȤСϡɥȡ󡦥ǥХ¸ߤƤʤɤǤ +\fI\-keystore\fRオプションからの入力ストリームは、\fIKeyStore\&.load\fRメソッドに渡されます。URLとして\fINONE\fRが指定されている場合は、nullのストリームが\fIKeyStore\&.load\fRメソッドに渡されます。\fINONE\fRは、KeyStoreがファイルベースではない場合に指定してください。たとえば、ハードウェア・トークン・デバイス上に存在している場合などです。 .RE .PP \-storepass[:\fIenv\fR| :\fIfile\fR] argument .RS 4 -ȥݸ뤿˻Ѥѥɤꤷޤ +キーストアの整合性を保護するために使用するパスワードを指定します。 .sp -\fIenv\fRޤ\fIfile\fRꤷʤ硢ѥɤͤ\fIargument\fRˤʤޤͤϡ6ʸʾˤɬפޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRを指定しない場合、パスワードの値は\fIargument\fRになります。この値は、6文字以上にする必要があります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -550,7 +550,7 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/Crypto .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -561,119 +561,119 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/Crypto .sp -1 .IP \(bu 2.3 .\} -\fIfile\fR: argumentȤ̾Υե뤫ѥɤޤ +\fIfile\fR: argumentという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -\fI\-keypass\fR\fI\-srckeypass\fR\-\fIdestkeypass\fR\fI\-srcstorepass\fR\fI\-deststorepass\fRʤɤΥѥɤɬפȤ뤽¾ΥץϤ٤ơ\fIenv\fR\fIfile\fRҤդޤѥɡץȽҤϡɬ(:)ǶڤäƤ +\fB注意:\fR +\fI\-keypass\fR、\fI\-srckeypass\fR、\-\fIdestkeypass\fR、\fI\-srcstorepass\fR、\fI\-deststorepass\fRなどのパスワードを必要とするその他のオプションはすべて、\fIenv\fRおよび\fIfile\fR修飾子を受け付けます。パスワード・オプションと修飾子は、必ずコロン(:)で区切ってください。 .sp -ѥɤϡȥƤ˥뤹٤ƤΥޥɤǻѤޤμΥޥɤ¹ԤȤˡޥɥ饤\fI\-storepass\fRץꤷʤäϡѥɤϤޤ +パスワードは、キーストアの内容にアクセスするすべてのコマンドで使用されます。この種のコマンドを実行するときに、コマンドラインで\fI\-storepass\fRオプションを指定しなかった場合は、パスワードの入力を求められます。 .sp -ȥ硢ѥɤϾάǽǤѥɤꤵƤʤϡ򸡾ڤǤٹɽޤ +キーストアから情報を取得する場合、パスワードは省略可能です。パスワードが指定されていない場合は、取得した情報の整合性を検証できず、警告が表示されます。 .RE .PP \-providerName \fIprovider_name\fR .RS 4 -ƥץѥƥե˴ޤޤŹ沽ӥץХ̾ꤹ뤿˻Ѥޤ +セキュリティ・プロパティ・ファイル内に含まれる暗号化サービス・プロバイダ名を特定するために使用されます。 .RE .PP \-providerClass \fIprovider_class_name\fR .RS 4 -Ź沽ӥץХƥץѥƥե˻ꤵƤʤȤϡΥޥ饹ե̾ꤹȤ˻Ѥޤ +暗号化サービス・プロバイダがセキュリティ・プロパティ・ファイルに指定されていないときは、そのマスター・クラス・ファイルの名前を指定するときに使用されます。 .RE .PP \-providerArg \fIprovider_arg\fR .RS 4 -\fI\-providerClass\fRץȤȤ˻Ѥ졢\fIprovider_class_name\fRΥ󥹥ȥ饯Υץʸϰɽޤ +\fI\-providerClass\fRオプションとともに使用され、\fIprovider_class_name\fRのコンストラクタのオプションの文字列入力引数を表します。 .RE .PP \-protected .RS 4 -\fItrue\fRޤ\fIfalse\fRΤ줫ѥɤPIN꡼ʤɤݸ줿ǧڥѥͳǻꤹɬפϡͤ\fItrue\fR˻ꤹɬפޤ\fI\-importkeystore\fRޥɤˤ2ĤΥȥϢƤ뤿ᡢȥȰ襭ȥˤ줾켡2ĤΥץ\fI\-srcprotected\fR\-\fIdestprotected\fRѰդƤޤ +\fItrue\fRまたは\fIfalse\fRのいずれか。パスワードを専用PINリーダーなどの保護された認証パス経由で指定する必要がある場合は、この値を\fItrue\fRに指定する必要があります。\fI\-importkeystore\fRコマンドには2つのキーストアが関連しているため、ソース・キーストアと宛先キーストアにそれぞれ次の2つのオプション、\fI\-srcprotected\fRと\-\fIdestprotected\fRが用意されています。 .RE .PP \-ext \fI{name{:critical} {=value}}\fR .RS 4 -X\&.509񥨥ƥ󥷥򼨤ޤΥץ\fI\-genkeypair\fR\fI\-gencert\fRǻѤơޤ\fI\-certreq\fR˥ƥ󥷥ߡꥯȤǥꥯȤ륨ƥ󥷥򼨤ȤǤޤΥץʣǤޤ\fIname\fRˤϡݡȤƤ륨ƥ󥷥̾(̾դƥ󥷥򻲾)ޤǤդOIDֹǤޤꤵƤ硢\fIvalue\fRϥƥ󥷥ΰؤޤ\fIvalue\fRά硢ƥ󥷥Υǥեͤޤϥƥ󥷥󤬰ɬפȤʤȤ򼨤ޤ\fI:critical\fRҤꤵ줿硢ƥ󥷥\fIisCritical\fR°\fItrue\fRǡꤵʤ\fIfalse\fRǤ\fI:critical\fRΤ\fI:c\fRѤǤޤ +X\&.509証明書エクステンションを示します。このオプションを\fI\-genkeypair\fRおよび\fI\-gencert\fRで使用して、生成される証明書または\fI\-certreq\fRにエクステンションを埋め込み、証明書リクエストでリクエストされるエクステンションを示すことができます。このオプションは複数回指定できます。\fIname\fR引数には、サポートされているエクステンション名(名前付きエクステンションを参照)または任意のOID番号を指定できます。指定されている場合、\fIvalue\fR引数はエクステンションの引数を指します。\fIvalue\fRを省略した場合、エクステンションのデフォルト値またはエクステンションが引数を必要としないことを示します。\fI:critical\fR修飾子が指定された場合、エクステンションの\fIisCritical\fR属性は\fItrue\fRで、指定されない場合は\fIfalse\fRです。\fI:critical\fRのかわりに\fI:c\fRを使用できます。 .RE -.SH "̾դƥ󥷥" +.SH "名前付きエクステンション" .PP -\fIkeytool\fRޥɤϡ̾Υƥ󥷥򥵥ݡȤƤޤ̾/ʸ϶̤ޤ +\fIkeytool\fRコマンドは、次の名前のエクステンションをサポートしています。名前の大/小文字は区別されません。 .PP -BCޤBasicContraints +BCまたはBasicContraints .RS 4 -\fB\fR: ʷϼΤȤǤ: -\fIca:{true|false}[,pathlen:<len>]\fRޤ\fI<len>\fR(ϡ\fIca:true,pathlen:<len>\fRû̷Ǥ)<\fIlen\fR>άȡ\fIca:true\fRΰ̣ˤʤޤ +\fB値\fR: 完全な形式は次のとおりです: +\fIca:{true|false}[,pathlen:<len>]\fRまたは\fI<len>\fR(これは、\fIca:true,pathlen:<len>\fRの短縮形です)。<\fIlen\fR>を省略すると、\fIca:true\fRの意味になります。 .RE .PP -KUޤKeyUsage +KUまたはKeyUsage .RS 4 -\fB\fR: -\fIusage\fR(\fIusage\fR)*\fIusage\fRˤ\fIdigitalSignature\fR\fInonRepudiation\fR -(contentCommitment)\fIkeyEncipherment\fR\fIdataEncipherment\fR\fIkeyAgreement\fR\fIkeyCertSign\fR\fIcRLSign\fR\fIencipherOnly\fR\fIdecipherOnly\fRΤ줫Ǥޤ\fIusage\fRϡΤˤʤʤꡢǽοʸ(\fIdigitalSignature\fRξ\fIdig\fR)ޤϥ륱(\fIdigitalSignature\fRξ\fIdS\fR\fIcRLSign\fRξ\fIcRLS\fR)ǾάɽǤޤ\fIusage\fRͤϡʸȾʸ̤ޤ +\fB値\fR: +\fIusage\fR(\fIusage\fR)*、\fIusage\fRには\fIdigitalSignature\fR、\fInonRepudiation\fR +(contentCommitment)、\fIkeyEncipherment\fR、\fIdataEncipherment\fR、\fIkeyAgreement\fR、\fIkeyCertSign\fR、\fIcRLSign\fR、\fIencipherOnly\fR、\fIdecipherOnly\fRのいずれかを指定できます。\fIusage\fR引数は、不明確にならないかぎり、最初の数文字(\fIdigitalSignature\fRの場合は\fIdig\fR)またはキャメルケース・スタイル(\fIdigitalSignature\fRの場合は\fIdS\fR、\fIcRLSign\fRの場合は\fIcRLS\fR)で省略表記できます。\fIusage\fR値は、大文字と小文字が区別されます。 .RE .PP -EKUޤExtendedKeyUsage +EKUまたはExtendedKeyUsage .RS 4 -\fB\fR: -\fIusage\fR(\fIusage\fR)*\fIusage\fRˤ\fIanyExtendedKeyUsage\fR\fIserverAuth\fR\fIclientAuth\fR\fIcodeSigning\fR\fIemailProtection\fR\fItimeStamping\fR\fIOCSPSigning\fRޤǤդ\fIOIDʸ\fRΤ줫Ǥޤ\fIusage\fRϡΤˤʤʤꡢǽοʸޤϥ륱ǾάɽǤޤ\fIusage\fRͤϡʸȾʸ̤ޤ +\fB値\fR: +\fIusage\fR(\fIusage\fR)*、\fIusage\fRには\fIanyExtendedKeyUsage\fR、\fIserverAuth\fR、\fIclientAuth\fR、\fIcodeSigning\fR、\fIemailProtection\fR、\fItimeStamping\fR、\fIOCSPSigning\fRまたは任意の\fIOID文字列\fRのいずれかを指定できます。\fIusage\fR引数は、不明確にならないかぎり、最初の数文字またはキャメルケース・スタイルで省略表記できます。\fIusage\fR値は、大文字と小文字が区別されます。 .RE .PP -SANޤSubjectAlternativeName +SANまたはSubjectAlternativeName .RS 4 -\fB\fR: +\fB値\fR: \fItype\fR:\fIvalue\fR -(t\fIype:value\fR)*\fItype\fRˤ\fIEMAIL\fR\fIURI\fR\fIDNS\fR\fIIP\fRޤ\fIOID\fRǤޤ\fIvalue\fRϡ\fItype\fRʸͤǤ +(t\fIype:value\fR)*、\fItype\fRには\fIEMAIL\fR、\fIURI\fR、\fIDNS\fR、\fIIP\fRまたは\fIOID\fRを指定できます。\fIvalue\fR引数は、\fItype\fRの文字列形式の値です。 .RE .PP -IANޤIssuerAlternativeName +IANまたはIssuerAlternativeName .RS 4 -\fB\fR: -\fISubjectAlternativeName\fRƱǤ +\fB値\fR: +\fISubjectAlternativeName\fRと同じです。 .RE .PP -SIAޤSubjectInfoAccess +SIAまたはSubjectInfoAccess .RS 4 -\fB\fR: +\fB値\fR: \fImethod\fR:\fIlocation\-type\fR:\fIlocation\-value\fR -(\fImethod:location\-type\fR:\fIlocation\-value\fR)*\fImethod\fRˤ\fItimeStamping\fR\fIcaRepository\fRޤǤդOIDǤޤ\fIlocation\-type\fR\fIlocation\-value\fRˤϡ\fISubjectAlternativeName\fRƥ󥷥ǥݡȤǤդ\fItype\fR:\fIvalue\fRǤޤ +(\fImethod:location\-type\fR:\fIlocation\-value\fR)*、\fImethod\fRには\fItimeStamping\fR、\fIcaRepository\fRまたは任意のOIDを指定できます。\fIlocation\-type\fRおよび\fIlocation\-value\fR引数には、\fISubjectAlternativeName\fRエクステンションでサポートされる任意の\fItype\fR:\fIvalue\fRを指定できます。 .RE .PP -AIAޤAuthorityInfoAccess +AIAまたはAuthorityInfoAccess .RS 4 -\fB\fR: -\fISubjectInfoAccess\fRƱǤ\fImethod\fRˤϡ\fIocsp\fR\fIcaIssuers\fRޤǤդOIDǤޤ +\fB値\fR: +\fISubjectInfoAccess\fRと同じです。\fImethod\fR引数には、\fIocsp\fR、\fIcaIssuers\fRまたは任意のOIDを指定できます。 .RE .PP -\fIname\fROIDξ硢OCTET STRINGפĹΥХȤƥ󥷥ˤĤƤϡͤ\fIextnValue\fR16ʥפDER󥳡ǥ󥰤ǤHEXʸǤϡɸ16ʿ(0\-9a\-fA\-F)ʳʸ̵뤵ޤäơ01:02:03:0401020304ξȤƱͤȤƼդޤͤʤ硢ƥ󥷥ͥեɤ϶ˤʤޤ +\fIname\fRがOIDの場合、OCTET STRINGタイプと長さのバイトを除外したエクステンションについては、値は\fIextnValue\fRの16進ダンプのDERエンコーディングです。HEX文字列では、標準の16進数(0\-9、a\-f、A\-F)以外の文字は無視されます。したがって、01:02:03:04と01020304の両方とも同一の値として受け付けられます。値がない場合、エクステンションの値フィールドは空になります。 .PP -\fI\-gencert\fRǤΤ߻Ѥ\fIhonored\fRȤ̤̾ϡꥯȤ˴ޤޤ륨ƥ󥷥ͥ褹ˡ򼨤ޤ̾ͤϡ\fIall\fR(ꥯȤ뤹٤ƤΥƥ󥷥ͥ褵)\fIname{:[critical|non\-critical]}\fR(̾դΥƥ󥷥ͥ褵뤬̤\fIisCritical\fR°Ѥ)\fI\-name\fR(\fIall\fRȤȤ˻Ѥ㳰򼨤)Υ޶ڤꥹȤǤǥեȤǤϡꥯȤ륨ƥ󥷥ͥ褵ޤ +\fI\-gencert\fRでのみ使用する\fIhonored\fRという特別な名前は、証明書リクエストに含まれるエクステンションを優先する方法を示します。この名前の値は、\fIall\fR(リクエストされるすべてのエクステンションが優先される)、\fIname{:[critical|non\-critical]}\fR(名前付きのエクステンションが優先されるが、別の\fIisCritical\fR属性を使用する)、および\fI\-name\fR(\fIall\fRとともに使用し、例外を示す)のカンマ区切りリストです。デフォルトでは、リクエストされるエクステンションは優先されません。 .PP -\fI\-ext honored\fRץ˲ä̤̾ΡޤOID -\fI\-ext\fRΥץꤷϡΥƥ󥷥󤬡Ǥͥ褵Ƥ륨ƥ󥷥ɲäޤ̾(ޤOID)ͥ褵ͤǤѤϡͤȽꥯȤ˴ޤޤΤ򥪡С饤ɤޤ +\fI\-ext honored\fRオプションに加え、別の名前の、またはOID +\fI\-ext\fRのオプションを指定した場合は、このエクステンションが、すでに優先されているエクステンションに追加されます。ただし、この名前(またはOID)を優先される値でも使用した場合は、その値と重要性がリクエストに含まれるものをオーバーライドします。 .PP -\fIsubjectKeyIdentifier\fRƥ󥷥Ͼ˺ޤʽ̾Ǥʤξϡ\fIauthorityKeyIdentifier\fRޤ +\fIsubjectKeyIdentifier\fRエクステンションは常に作成されます。自己署名でない証明書の場合は、\fIauthorityKeyIdentifier\fRが作成されます。 .PP -\fB:\fR -桼ϡƥ󥷥(Ӿ¾Υե)ȹ礻ˤäƤϡ󥿡ͥåȤɸ˽򤷤ʤ礬뤳ȤդƤν˴ؤٹ򻲾ȤƤ -.SH "ޥ" +\fB注意:\fR +ユーザーは、エクステンション(および証明書の他のフィールド)の組合せによっては、インターネットの標準に準拠しない場合があることに注意してください。証明書の準拠に関する警告を参照してください。 +.SH "コマンド" .PP \-gencert .RS 4 \fI{\-rfc} {\-infile infile} {\-outfile outfile} {\-alias alias} {\-sigalg sigalg} {\-dname dname} {\-startdate startdate {\-ext ext}* {\-validity valDays} [\-keypass keypass] {\-keystore keystore} [\-storepass storepass] {\-storetype storetype} {\-providername provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ꥯȡե(\fIkeytool\fR -\fI\-certreq\fRޥɤǺǽ)Ф쥹ݥ󥹤ȤƾޤΥޥɤϡ\fIinfile\fR(άϡɸϤ)ꥯȤɤ߹ߡ̩̾ѤƤΥꥯȤ˽̾ơX\&.509\fIoutfile\fR(άϡɸϤ)Ϥޤ\fI\-rfc\fRꤷ硢ϷBASE64沽PEMˤʤޤʳξϡХʥDERޤ +証明書リクエスト・ファイル(\fIkeytool\fR +\fI\-certreq\fRコマンドで作成可能)に対するレスポンスとして証明書を生成します。このコマンドは、\fIinfile\fRから(省略した場合は、標準入力から)リクエストを読み込み、別名の秘密鍵を使用してそのリクエストに署名して、X\&.509証明書を\fIoutfile\fRに(省略した場合は、標準出力に)出力します。\fI\-rfc\fRを指定した場合、出力形式はBASE64符号化のPEMになります。それ以外の場合は、バイナリDERが作成されます。 .sp -\fIsigalg\fRͤˤϡ˽̾դȤ˻Ѥ륢르ꥺꤷޤ\fIstartdate\fRϡͭǤ\fIvalDays\fRϡͭ򼨤ޤ +\fIsigalg\fR値には、証明書に署名を付けるときに使用するアルゴリズムを指定します。\fIstartdate\fR引数は、証明書の有効開始日時です。\fIvalDays\fR引数は、証明書の有効日数を示します。 .sp -\fIdname\fRꤹȡμΤȤƻѤޤʳξϡꥯȤ̾Ѥޤ +\fIdname\fRを指定すると、生成される証明書の主体として使用されます。それ以外の場合は、証明書リクエストからの名前が使用されます。 .sp -\fIext\fRͤϡޤX\&.509ƥ󥷥򼨤ޤ\fI\-ext\fRιʸˤĤƤϡ̥ץ򻲾ȤƤ +\fIext\fR値は、証明書に埋め込まれるX\&.509エクステンションを示します。\fI\-ext\fRの構文については、一般オプションを参照してください。 .sp -\fI\-gencert\fRץѤȡǤޤǤϡ\fIe1\fRȤޤξξˤϡ3Ĥξ񤬴ޤޤƤޤ +\fI\-gencert\fRオプションを使用すると、証明書チェーンを作成できます。次の例では、\fIe1\fRという証明書を作成します。この証明書の証明書チェーンには、3つの証明書が含まれています。 .sp -Υޥɤϡ\fIca\fR\fIca1\fR\fIca2\fR\fIe1\fR4Ĥθڥޤ +次のコマンドは、\fIca\fR、\fIca1\fR、\fIca2\fRおよび\fIe1\fRの4つの鍵ペアを作成します。 .sp .if n \{\ .RS 4 @@ -687,7 +687,7 @@ keytool \-alias e1 \-dname CN=E1 \-genkeypair .if n \{\ .RE .\} -2ĤΥޥɤϡ̾դΥޤ\fIca\fR\fIca1\fR˽̾\fIca1\fR\fIca2\fR˽̾ޤ٤ƼȯԤǤ +次の2つのコマンドは、署名付き証明書のチェーンを作成します。\fIca\fRは\fIca1\fRに署名し、\fIca1\fRは\fIca2\fRに署名します。すべて自己発行です。 .sp .if n \{\ .RS 4 @@ -704,7 +704,7 @@ keytool \-alias ca2 \-certreq | .if n \{\ .RE .\} -Υޥɤϡ\fIe1\fRƥե\fIe1\&.cert\fR˳Ǽޤξ\fIca2\fRˤäƽ̾ޤη̡\fIe1\fRξˤ\fIca\fR\fIca1\fR\fIca2\fRޤޤ뤳Ȥˤʤޤ +次のコマンドは、証明書\fIe1\fRを作成してファイル\fIe1\&.cert\fRに格納します。この証明書は\fIca2\fRによって署名されます。その結果、\fIe1\fRの証明書チェーンには\fIca\fR、\fIca1\fRおよび\fIca2\fRが含まれることになります。 .sp .if n \{\ .RS 4 @@ -721,23 +721,23 @@ keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert .RS 4 \fI{\-alias alias} {\-keyalg keyalg} {\-keysize keysize} {\-sigalg sigalg} [\-dname dname] [\-keypass keypass] {\-startdate value} {\-ext ext}* {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -Υڥ(ӴϢ̩)ޤX\&.509 v3ʽ̾ǥåפޤϡñǤľȤƳǼޤξ̩ϡaliasꤵ뿷ȥȥ˳Ǽޤ +鍵のペア(公開鍵および関連する秘密鍵)を生成します。公開鍵はX\&.509 v3自己署名証明書でラップされます。証明書は、単一の要素を持つ証明書チェーンとして格納されます。この証明書チェーンと秘密鍵は、aliasで特定される新しいキーストア・エントリに格納されます。 .sp -\fIkeyalg\fRͤϸڥ˻Ѥ륢르ꥺ\fIkeysize\fRͤƸΥ򡢤줾ꤷޤ\fIsigalg\fRͤϡʽ̾˽̾դ뤿˻Ѥ륢르ꥺꤷޤΥ르ꥺ\fIkeyalg\fRͤȸߴɬפޤ +\fIkeyalg\fR値は鍵ペアの生成に使用するアルゴリズムを、\fIkeysize\fR値は生成する各鍵のサイズを、それぞれ指定します。\fIsigalg\fR値は、自己署名証明書に署名を付けるために使用するアルゴリズムを指定します。このアルゴリズムは\fIkeyalg\fR値と互換性がある必要があります。 .sp -\fIdname\fRͤˤϡ\fIalias\fRͤ˴Ϣդʽ̾issuerեɤsubjectեɤȤƻѤX\&.500̾ꤷޤޥɥ饤Ǽ̾ꤷʤäϡ̾Ϥޤ +\fIdname\fR値には、\fIalias\fR値に関連付け、自己署名証明書のissuerフィールドとsubjectフィールドとして使用するX\&.500識別名を指定します。コマンドラインで識別名を指定しなかった場合は、識別名の入力を求められます。 .sp -\fIkeypass\fRͤˤϡ븰ΥڥΤ̩ݸΤ˻ѤѥɤꤷޤѥɤꤷʤäϡѥɤϤޤΤȤ\fI[Return]\fR򲡤ȡȥΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRͤϡ6ʸʾˤɬפޤ +\fIkeypass\fR値には、生成される鍵のペアのうち、秘密鍵を保護するのに使用するパスワードを指定します。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、\fI[Return]キー\fRを押すと、キーストアのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fR値は、6文字以上にする必要があります。 .sp -\fIstartdate\fRͤˤϡȯԻꤷޤϡX\&.509ΡValidityץեɤΡNot BeforeͤȤƤФޤ +\fIstartdate\fR値には、証明書の発行時刻を指定します。これは、X\&.509証明書の「Validity」フィールドの「Not Before」値とも呼ばれます。 .sp -ץͤϡ2ĤηΤ줫Ǥޤ +オプションの値は、次の2つの形式のいずれかで設定できます。 .sp \fI([+\-]nnn[ymdHMS])+\fR .sp \fI[yyyy/mm/dd] [HH:MM:SS]\fR .sp -ǽηǤϡȯԻϡꤵͤʬߤλ狼ܤޤꤵͤϡϢβ̤ͤϢ뤷Τˤʤޤ̤γͤǡץ饹(+)ϻ֤ʤळȤ򡢥ޥʥ(\-)ϻ֤뤳Ȥ̣Ƥޤܤ֤\fInnn\fRǡñ̤ǯ֡ʬޤäǤ(줾졢1ʸ\fIy\fR\fIm\fR\fId\fR\fIH\fR\fIM\fRޤ\fIS\fRפǼƤޤ)̤γͤ\fIjava\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR᥽åɤѤ뤳ȤǡȯԻɲäͤ鱦ط׻ޤȤСꤹȡȯԻϼΤ褦ˤʤޤ +最初の形式では、発行時刻は、指定される値の分、現在の時刻から移ります。指定される値は、一連の下位の値を連結したものになります。下位の各値で、プラス記号(「+」)は時間が進むことを、マイナス記号(「\-」)は時間が戻ることを意味しています。移る時間は\fInnn\fRで、単位は年、月、日、時間、分または秒です(それぞれ、1文字の\fIy\fR、\fIm\fR、\fId\fR、\fIH\fR、\fIM\fRまたは\fIS\fR」で示されています)。下位の各値で\fIjava\&.util\&.GregorianCalendar\&.add(int field, int amount)\fRメソッドを使用することで、発行時刻の追加の値が左から右へ計算されます。たとえば、指定すると、発行時刻は次のようになります。 .sp .if n \{\ .RS 4 @@ -752,182 +752,182 @@ return c\&.getTime() .if n \{\ .RE .\} -2ܤηǤϡ桼ϡǯ//Ȼ:ʬ:ä2ĤʬǸ̩ʳϻꤷޤ(ϸλӤ)桼ϡ1ĤʬΤߤǤޤϡ⤦1Ĥʬϸߤ(ޤϻ)ƱˤʤȤȤǤ桼ϡ˼Ƥ褦ˡ̩˻ꤹɬפޤ(û0ޤ)դȻξꤵ줿֤ǡ2Ĥʬδ֤˶ʸ1(1ĤΤ)ޤ֤Ͼ24ַǻꤷƤ +2番目の形式では、ユーザーは、年/月/日と時間:分:秒の2つの部分で厳密な開始時刻を設定します(地元の時間帯を使用)。ユーザーは、1つの部分のみを指定できます。これは、もう1つの部分は現在の日付(または時刻)と同じになるということです。ユーザーは、形式の定義に示されているように、桁数を厳密に指定する必要があります(短い場合は0で埋めます)。日付と時刻の両方が指定された状態で、2つの部分の間に空白文字が1つ(1つのみ)あります。時間は常に24時間形式で指定してください。 .sp -ץꤷʤȡդϸߤλˤʤޤץϡ1Ǥޤ +オプションを指定しないと、開始日付は現在の時刻になります。オプションは、最大で1回指定できます。 .sp -\fIvalDays\fRͤˤϡͭꤷޤ(\fI\-startdate\fRǻꤵ줿աޤ\fI\-startdate\fRꤵƤʤϸߤդϤޤޤ) +\fIvalDays\fRの値には、証明書の有効日数を指定します(\fI\-startdate\fRで指定された日付、または\fI\-startdate\fRが指定されていない場合は現在の日付から始まります)。 .sp -ΥޥɤϡΥ꡼Ǥ\fI\-genkey\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-genkeypair\fRͥ褵ޤ +このコマンドは、以前のリリースでは\fI\-genkey\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-genkeypair\fRが優先されます。 .RE .PP \-genseckey .RS 4 \fI\-genseckey {\-alias alias} {\-keyalg keyalg} {\-keysize keysize} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -̩򿷤\fIKeyStore\&.SecretKeyEntry\fR(\fIalias\fRꤵ)˳Ǽޤ +秘密鍵を生成し、それを新しい\fIKeyStore\&.SecretKeyEntry\fR(\fIalias\fRで特定される)内に格納します。 .sp -\fIkeyalg\fRͤϸڥ˻Ѥ륢르ꥺ\fIkeysize\fRͤƸΥ򡢤줾ꤷޤ\fIkeypass\fRͤϡ̩ݸѥɤǤѥɤꤷʤäϡѥɤϤޤΤȤ[Return]򲡤ȡ\fIkeystore\fRΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRͤϡ6ʸʾˤɬפޤ +\fIkeyalg\fR値は鍵ペアの生成に使用するアルゴリズムを、\fIkeysize\fR値は生成する各鍵のサイズを、それぞれ指定します。\fIkeypass\fR値は、秘密鍵を保護するパスワードです。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、[Return]キーを押すと、\fIkeystore\fRのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fR値は、6文字以上にする必要があります。 .RE .PP \-importcert .RS 4 \fI\-importcert {\-alias alias} {\-file cert_file} [\-keypass keypass] {\-noprompt} {\-trustcacerts} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ե\fIcert_file\fRޤϾ(ξϡPKCS#7αޤϰϢX\&.509󶡤)ɤ߹ߡ\fIalias\fRˤäꤵ\fIkeystore\fRȥ˳Ǽޤե뤬ꤵƤʤϡ\fIstdin\fRޤϾɤ߹ߤޤ +ファイル\fIcert_file\fRから証明書または証明書チェーン(証明書チェーンの場合は、PKCS#7形式の応答または一連のX\&.509証明書で提供されるもの)を読み込み、\fIalias\fRによって特定される\fIkeystore\fRエントリに格納します。ファイルが指定されていない場合は、\fIstdin\fRから証明書または証明書チェーンを読み込みます。 .sp -\fIkeytool\fRޥɤǤϡX\&.509 v1v2v3ξ񡢤PKCS#7ξ񤫤鹽ƤPKCS#7ξ򥤥ݡȤǤޤݡȤǡϡХʥ沽ޤϽϲǽ沽(Base64沽ȤƤФ)Τɤ餫󶡤ɬפޤϲǽ沽ϡ󥿡ͥåRFC 1421沽ʤƤޤ沽ξ硢\fI\-\fR\fI\-\-\-\-BEGIN\fRǻϤޤʸdzϤ졢\fI\-\-\-\-\-END\fRǻϤޤʸǽλɬפޤ +\fIkeytool\fRコマンドでは、X\&.509 v1、v2、v3の証明書、およびPKCS#7形式の証明書から構成されているPKCS#7形式の証明書チェーンをインポートできます。インポートするデータは、バイナリ符号化方式、または出力可能符号化方式(Base64符号化とも呼ばれる)のどちらかで提供する必要があります。出力可能符号化方式は、インターネットRFC 1421証明書符号化規格で定義されています。この符号化方式の場合、証明書は\fI\-\fR\fI\-\-\-\-BEGIN\fRで始まる文字列で開始され、\fI\-\-\-\-\-END\fRで始まる文字列で終了する必要があります。 .sp -ϡǤΥꥹȤɲä뤿ᡢǧڶ(CA)˾̾ꥯȤ̤ȤCA򥤥ݡȤ뤿(ޥɤ\fI\-certreq\fRץ򻲾)Ȥ2ĤͳǥݡȤޤ +証明書は、信頼できる証明書のリストに追加するため、および認証局(CA)に証明書署名リクエストを送信した結果としてCAから受信した証明書応答をインポートするため(コマンドの\fI\-certreq\fRオプションを参照)という2つの理由でインポートします。 .sp -ɤΥפΥݡȤԤϡ\fI\-alias\fRץͤˤäƻꤷޤ̾ȥݥȤʤ硢\fIkeytool\fRޥɤϥ桼Ǥ񥨥ȥɲä褦ȤƤΤȤߤʤޤξ硢̾ȥ¸ߤƤʤȤɬפǤ̾Ǥ¸ߤƤ硢̾οǤ񤬤Ǥ¸ߤ뤳ȤˤʤΤǡ\fIkeytool\fRޥɤϥ顼ϤΥݡȤԤޤ̾ȥݥȤ硢\fIkeytool\fRޥɤϥ桼򥤥ݡȤ褦ȤƤΤȤߤʤޤ +どちらのタイプのインポートを行うかは、\fI\-alias\fRオプションの値によって指定します。別名がキー・エントリをポイントしない場合、\fIkeytool\fRコマンドはユーザーが信頼できる証明書エントリを追加しようとしているものとみなします。この場合、別名がキーストア内に存在していないことが必要です。別名がすでに存在している場合、その別名の信頼できる証明書がすでに存在することになるので、\fIkeytool\fRコマンドはエラーを出力し、証明書のインポートを行いません。別名がキー・エントリをポイントする場合、\fIkeytool\fRコマンドはユーザーが証明書応答をインポートしようとしているものとみなします。 .RE .PP \-importpassword .RS 4 \fI{\-alias alias} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ѥե졼򥤥ݡȤ\fIalias\fRǼ̤뿷\fIKeyStore\&.SecretKeyEntry\fR˳Ǽޤѥե졼ϡɸϥȥ꡼𤷤󶡤Ǥޤޤϡ桼ˤΥץץȤɽޤ\fIkeypass\fRϡݡȤѥե졼ݸ˻ѤѥɤǤѥɤꤷʤäϡѥɤϤޤΤȤ[Return]򲡤ȡ\fIkeystore\fRΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRϡ6ʸʾˤɬפޤ +パスフレーズをインポートし、\fIalias\fRで識別される新規\fIKeyStore\&.SecretKeyEntry\fRに格納します。パスフレーズは、標準入力ストリームを介して提供できます。または、ユーザーにそのプロンプトが表示されます。\fIkeypass\fRは、インポートされるパスフレーズの保護に使用されるパスワードです。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、[Return]キーを押すと、\fIkeystore\fRのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fRは、6文字以上にする必要があります。 .RE .PP \-importkeystore .RS 4 \fI{\-srcstoretype srcstoretype} {\-deststoretype deststoretype} [\-srcstorepass srcstorepass] [\-deststorepass deststorepass] {\-srcprotected} {\-destprotected} {\-srcalias srcalias {\-destalias destalias} [\-srckeypass srckeypass] } [\-destkeypass destkeypass] {\-noprompt} {\-srcProviderName src_provider_name} {\-destProviderName dest_provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ȥ饿åȡȥءñΥȥޤϤ٤ƤΥȥ򥤥ݡȤޤ +ソース・キーストアからターゲット・キーストアへ、単一のエントリまたはすべてのエントリをインポートします。 .sp -\fI\-srcalias\fRץ󤬻ꤵ줿硢Υޥɤϡ̾ꤵñΥȥ򥿡åȡȥ˥ݡȤޤ\fIdestalias\fRͳǥå̾ꤵʤä硢\fIsrcalias\fRå̾ȤƻѤޤΥȥ꤬ѥɤݸƤ硢\fIsrckeypass\fRѤƤΥȥ꤬ޤ\fIsrckeypass\fRꤵʤä硢\fIkeytool\fRޥɤ\fIsrcstorepass\fRѤƤΥȥ褦Ȥޤ\fIsrcstorepass\fRꤵʤäʤä硢桼ϥѥɤϤޤåȤΥȥ\fIdestkeypass\fRˤäݸޤ\fIdestkeypass\fRꤵʤä硢åȡȥϥȥΥѥɤˤäݸޤȤСۤȤɤΥɡѡƥġǤϡPKCS #12ȥ\fIstorepass\fR\fIkeypass\fRƱǤɬפޤΥġPKCS #12ȥϡ\fI\-destkeypass\fR\fI\-deststorepass\fRƱˤʤ褦˻ꤷޤ +\fI\-srcalias\fRオプションが指定された場合、このコマンドは、その別名で特定される単一のエントリをターゲット・キーストアにインポートします。\fIdestalias\fR経由でターゲット別名が指定されなかった場合、\fIsrcalias\fRがターゲット別名として使用されます。ソースのエントリがパスワードで保護されていた場合、\fIsrckeypass\fRを使用してそのエントリが回復されます。\fIsrckeypass\fRが指定されなかった場合、\fIkeytool\fRコマンドは\fIsrcstorepass\fRを使用してそのエントリを回復しようとします。\fIsrcstorepass\fRが指定されなかったか正しくなかった場合、ユーザーはパスワードの入力を求められます。ターゲットのエントリは\fIdestkeypass\fRによって保護されます。\fIdestkeypass\fRが指定されなかった場合、ターゲット・エントリはソース・エントリのパスワードによって保護されます。たとえば、ほとんどのサード・パーティ・ツールでは、PKCS #12キーストアで\fIstorepass\fRと\fIkeypass\fRが同じである必要があります。これらのツールのPKCS #12キーストアを作成する場合は、常に\fI\-destkeypass\fRと\fI\-deststorepass\fRが同じになるように指定します。 .sp -\fI\-srcalias\fRץ󤬻ꤵʤä硢ȥΤ٤ƤΥȥ꤬åȡȥ˥ݡȤޤƥåȡȥб륽ȥ̾β˳ǼޤΥȥ꤬ѥɤݸƤ硢\fIsrcstorepass\fRѤƤΥȥ꤬ޤ\fIsrcstorepass\fRꤵʤäʤä硢桼ϥѥɤϤޤȥΤ륨ȥꡦפåȡȥǥݡȤƤʤ䡢륨ȥ򥿡åȡȥ˳Ǽݤ˥顼ȯ硢桼ϤΥȥ򥹥åפƽ³Ԥ뤫뤤ϽǤ뤫ޤåȡȥϥȥΥѥɤˤäݸޤ +\fI\-srcalias\fRオプションが指定されなかった場合、ソース・キーストア内のすべてのエントリがターゲット・キーストア内にインポートされます。各ターゲット・エントリは対応するソース・エントリの別名の下に格納されます。ソースのエントリがパスワードで保護されていた場合、\fIsrcstorepass\fRを使用してそのエントリが回復されます。\fIsrcstorepass\fRが指定されなかったか正しくなかった場合、ユーザーはパスワードの入力を求められます。ソース・キーストア内のあるエントリ・タイプがターゲット・キーストアでサポートされていない場合や、あるエントリをターゲット・キーストアに格納する際にエラーが発生した場合、ユーザーはそのエントリをスキップして処理を続行するか、あるいは処理を中断するかの選択を求められます。ターゲット・エントリはソース・エントリのパスワードによって保護されます。 .sp -å̾åȡȥˤǤ¸ߤƤ硢桼ϡΥȥ񤭤뤫뤤ϰۤʤ̾βǿȥ뤫ޤ +ターゲット別名がターゲット・キーストア内にすでに存在していた場合、ユーザーは、そのエントリを上書きするか、あるいは異なる別名の下で新しいエントリを作成するかの選択を求められます。 .sp -\fI\-noprompt\fRץꤷ硢桼Ͽå̾Ϥޤ󡣴¸Υȥ꤬Υå̾Ǿ񤭤ޤݡȤǤʤȥϥåפ졢ٹ𤬽Ϥޤ +\fI\-noprompt\fRオプションを指定した場合、ユーザーは新しいターゲット別名の入力を求められません。既存のエントリがそのターゲット別名で上書きされます。インポートできないエントリはスキップされ、警告が出力されます。 .RE .PP \-printcertreq .RS 4 \fI{\-file file}\fR .sp -PKCS#10ξꥯȤƤϤޤΥꥯȤϡ\fIkeytool\fR -\fI\-certreq\fRޥɤǤޤΥޥɤϡե뤫ꥯȤɤ߼ޤե뤬¸ߤʤ硢ꥯȤɸϤɤ߼ޤ +PKCS#10形式の証明書リクエストの内容を出力します。このリクエストは、\fIkeytool\fR +\fI\-certreq\fRコマンドで生成できます。このコマンドは、ファイルからリクエストを読み取ります。ファイルが存在しない場合、リクエストは標準入力から読み取られます。 .RE .PP \-certreq .RS 4 \fI{\-alias alias} {\-dname dname} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -PKCS#10Ѥƾ̾ꥯ(CSR)ޤ +PKCS#10形式を使用して証明書署名リクエスト(CSR)を生成します。 .sp -CSRϡȯԶ(CA)뤳ȤŪȤΤǤCAϡ׵Ԥ(̾ϥե饤)ǧڤޤϾ֤ޤξޤϾϡȥδ¸ξ(ǽ1Ĥμʽ̾񤫤鹽)֤ƻѤޤ +CSRは、証明書発行局(CA)に送信することを目的としたものです。CAは、証明書要求者を(通常はオフラインで)認証し、証明書または証明書チェーンを送り返します。この証明書または証明書チェーンは、キーストア内の既存の証明書チェーン(最初は1つの自己署名証明書から構成される)に置き換えて使用します。 .sp -alias˴Ϣդ줿̩ϡPKCS#10ꥯȤΤ˻Ѥޤ̩˥ˤϡѥɤꤹɬפޤޥɥ饤\fIkeypass\fRꤷƤ餺̩ΥѥɤȥΥѥɤȰۤʤϡ̩ΥѥɤϤޤ\fIdname\fRꤵƤϡ줬CSRǼΤȤƻѤޤʳξϡ̾˴Ϣդ줿X\&.500̾Ѥޤ +aliasに関連付けられた秘密鍵は、PKCS#10証明書リクエストを作成するのに使用されます。秘密鍵にアクセスするには、正しいパスワードを指定する必要があります。コマンドラインで\fIkeypass\fRを指定しておらず、秘密鍵のパスワードがキーストアのパスワードと異なる場合は、秘密鍵のパスワードの入力を求められます。\fIdname\fRが指定されている場合は、それがCSRで主体として使用されます。それ以外の場合は、別名に関連付けられたX\&.500識別名が使用されます。 .sp -\fIsigalg\fRͤˤϡCSR˽̾դȤ˻Ѥ륢르ꥺꤷޤ +\fIsigalg\fR値には、CSRに署名を付けるときに使用するアルゴリズムを指定します。 .sp -CSRϡեcertreq_file˳Ǽޤե뤬ꤵƤʤϡ\fIstdout\fRCSRϤޤ +CSRは、ファイルcertreq_fileに格納されます。ファイルが指定されていない場合は、\fIstdout\fRにCSRが出力されます。 .sp -CAΥ쥹ݥ󥹤򥤥ݡȤˤϡ\fIimportcert\fRޥɤѤޤ +CAからのレスポンスをインポートするには、\fIimportcert\fRコマンドを使用します。 .RE .PP \-exportcert .RS 4 \fI{\-alias alias} {\-file cert_file} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fR˴Ϣդ줿򥭡ȥɤ߹ߡեcert_file˳Ǽޤե뤬ꤵƤʤϡ\fIstdout\fR˾񤬽Ϥޤ +\fIalias\fRに関連付けられた証明書をキーストアから読み込み、ファイルcert_fileに格納します。ファイルが指定されていない場合は、\fIstdout\fRに証明書が出力されます。 .sp -ǥեȤǤϡϥХʥ沽ǽϤޤ\fI\-rfc\fRץ󤬻ꤵƤ硢ϲǽ沽νϤϥ󥿡ͥåRFC 1421沽ʤޤ +デフォルトでは、証明書はバイナリ符号化で出力されます。\fI\-rfc\fRオプションが指定されている場合、出力可能符号化方式の出力はインターネットRFC 1421証明書符号化規格で定義されます。 .sp -\fIalias\fRǤ򻲾ȤƤϡ񤬽Ϥޤʳξ硢\fIalias\fRϡϢդ줿ĸȥ򻲾Ȥޤξϡκǽξ֤ޤξϡ\fIalias\fRˤäɽ륨ƥƥθǧڤǤ +\fIalias\fRが、信頼できる証明書を参照している場合は、該当する証明書が出力されます。それ以外の場合、\fIalias\fRは、関連付けられた証明書チェーンを持つ鍵エントリを参照します。この場合は、チェーン内の最初の証明書が返されます。この証明書は、\fIalias\fRによって表されるエンティティの公開鍵を認証する証明書です。 .sp -ΥޥɤϡΥ꡼Ǥ\fI\-export\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-exportcert\fRͥ褵ޤ +このコマンドは、以前のリリースでは\fI\-export\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-exportcert\fRが優先されます。 .RE .PP \-list .RS 4 \fI{\-alias alias} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v | \-rfc} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fRꤵ륭ȥȥƤ\fIstdout\fR˽Ϥޤ\fIalias\fRꤵƤʤϡȥΤƤɽޤ +\fIalias\fRで特定されるキーストア・エントリの内容を\fIstdout\fRに出力します。\fIalias\fRが指定されていない場合は、キーストア全体の内容が表示されます。 .sp -ΥޥɤϡǥեȤǤϾSHA1ե󥬡ץȤɽޤ -\fI\-v\fRץ󤬻ꤵƤϡͭԡȯԼԡꥢֹ桢ĥǽʤɤղŪʾȤȤˡʹ֤ɤळȤΤǤǾɽޤ\fI\-rfc\fRץ󤬻ꤵƤϡϲǽ沽ǾƤϤޤϲǽ沽ϡ󥿡ͥåRFC 1421沽ʤƤޤ +このコマンドは、デフォルトでは証明書のSHA1フィンガープリントを表示します。 +\fI\-v\fRオプションが指定されている場合は、所有者、発行者、シリアル番号、拡張機能などの付加的な情報とともに、人間が読むことのできる形式で証明書が表示されます。\fI\-rfc\fRオプションが指定されている場合は、出力可能符号化方式で証明書の内容が出力されます。出力可能符号化方式は、インターネットRFC 1421証明書符号化規格で定義されています。 .sp -\fI\-v\fRץ\fI\-rfc\fRץƱ˻ꤹ뤳ȤϤǤޤ +\fI\-v\fRオプションと\fI\-rfc\fRオプションを同時に指定することはできません。 .RE .PP \-printcert .RS 4 \fI{\-file cert_file | \-sslserver host[:port]} {\-jarfile JAR_file {\-rfc} {\-v} {\-Jjavaoption}\fR .sp -եcert_filehost:portˤSSLСޤϽ̾դJARե\fIJAR_file\fR(\fI\-jarfile\fRץ)ɤ߹ߡʹ֤ɤळȤΤǤǾƤɽޤݡȤꤵƤʤϡɸHTTPSݡ443ꤵޤ\fI\-sslserver\fR\-fileץƱ˻ꤹ뤳ȤϤǤޤ󡣤ȿ硢顼𤵤ޤץ󤬻ꤵƤʤϡ\fIstdin\fRɤ߹ߤޤ +ファイルcert_file、host:portにあるSSLサーバー、または署名付きJARファイル\fIJAR_file\fR(\fI\-jarfile\fRオプションを指定)から証明書を読み込み、人間が読むことのできる形式で証明書の内容を表示します。ポートが指定されていない場合は、標準のHTTPSポート443が想定されます。\fI\-sslserver\fRおよび\-fileオプションを同時に指定することはできません。これに反する場合、エラーが報告されます。オプションが指定されていない場合は、\fIstdin\fRから証明書を読み込みます。 .sp -\fI\-rfc\fRꤵƤ硢\fIkeytool\fRޥɤϡ󥿡ͥåRFC 1421沽ɸƤ褦ˡPEM⡼ɤǾϤޤ󥿡ͥåRFC 1421沽ʤ򻲾ȤƤ +\fI\-rfc\fRが指定されている場合、\fIkeytool\fRコマンドは、インターネットRFC 1421証明書符号化標準で定義されているように、PEMモードで証明書を出力します。インターネットRFC 1421証明書符号化規格を参照してください。 .sp -եޤ\fIstdin\fRɤ߹硢ξϡ󥿡ͥåRFC 1421沽ɸƤ褦ˡХʥ沽ޤϽϲǽ沽ɽǤޤ +ファイルまたは\fIstdin\fRから証明書を読み込む場合、その証明書は、インターネットRFC 1421証明書符号化標準で定義されているように、バイナリ符号化方式または出力可能符号化方式で表示できます。 .sp -SSLСեظˤϡ\fI\-J\-Dhttps\&.proxyHost=proxyhost\fR\fI\-J\-Dhttps\&.proxyPort=proxyport\fRץ򥳥ޥɥ饤ǻꤷơץȥͥ󥰤ѤǤޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html -Java Secure Socket Extension (JSSE) Reference Guideפ򻲾ȤƤ +SSLサーバーがファイアウォールの背後にある場合は、\fI\-J\-Dhttps\&.proxyHost=proxyhost\fRおよび\fI\-J\-Dhttps\&.proxyPort=proxyport\fRオプションをコマンドラインで指定して、プロキシ・トンネリングを使用できます。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.htmlの +「Java Secure Socket Extension (JSSE) Reference Guide」を参照してください .sp -\fB:\fR -ΥץϥȥȤϴطʤѤǤޤ +\fB注意:\fR +このオプションはキーストアとは関係なく使用できます。 .RE .PP \-printcrl .RS 4 \fI\-file crl_ {\-v}\fR .sp -ե\fIcrl_\fR񼺸ꥹ(CRL)ɤ߹ߤޤCRLϡȯԤCAˤäƼ줿ǥΥꥹȤǤCAϡ\fIcrl_\fRޤ +ファイル\fIcrl_\fRから証明書失効リスト(CRL)を読み込みます。CRLは、発行したCAによって失効されたデジタル証明書のリストです。CAは、\fIcrl_\fRを生成します。 .sp -\fB:\fR -ΥץϥȥȤϴطʤѤǤޤ +\fB注意:\fR +このオプションはキーストアとは関係なく使用できます。 .RE .PP \-storepasswd .RS 4 \fI[\-new new_storepass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-Jjavaoption}\fR .sp -ȥƤݸ뤿˻Ѥѥɤѹޤ\fInew_storepass\fRˤϡѥɤꤷޤnew_storepassϡ6ʸʾǤɬפޤ +キーストアの内容の整合性を保護するために使用するパスワードを変更します。\fInew_storepass\fRには、新しいパスワードを指定します。new_storepassは、6文字以上である必要があります。 .RE .PP \-keypasswd .RS 4 \fI{\-alias alias} [\-keypass old_keypass] [\-new new_keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-Jjavaoption}\fR .sp -\fIalias\fRˤäꤵ/̩ݸ뤿Υѥɤ\fIold_keypass\fR\fInew_keypass\fRѹޤnew_keypassϡ6ʸʾǤɬפޤ +\fIalias\fRによって特定される非公開/秘密鍵を保護するためのパスワードを、\fIold_keypass\fRから\fInew_keypass\fRに変更します。new_keypassは、6文字以上である必要があります。 .sp -ޥɥ饤\fI\-keypass\fRץꤷƤ餺ΥѥɤȥΥѥɤȰۤʤϡΥѥɤϤޤ +コマンドラインで\fI\-keypass\fRオプションを指定しておらず、鍵のパスワードがキーストアのパスワードと異なる場合は、鍵のパスワードの入力を求められます。 .sp -ޥɥ饤\fI\-new\fRץꤷʤäϡѥɤϤޤ +コマンドラインで\fI\-new\fRオプションを指定しなかった場合は、新しいパスワードの入力を求められます。 .RE .PP \-delete .RS 4 \fI[\-alias alias] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fRˤäꤵ륨ȥ򥭡ȥޤޥɥ饤̾ꤷʤäϡ̾Ϥޤ +\fIalias\fRによって特定されるエントリをキーストアから削除します。コマンドラインで別名を指定しなかった場合は、別名の入力を求められます。 .RE .PP \-changealias .RS 4 \fI{\-alias alias} [\-destalias destalias] [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ꤵ줿\fIalias\fR鿷̾\fIdestalias\fRء¸Υȥȥưޤå̾ꤷʤä硢å̾ϤޤΥȥ꤬ȥꡦѥɤݸƤ硢\fI\-keypass\fRץǤΥѥɤǤޤѥɤꤵʤä硢\fIstorepass\fR(ꤵ줿)ޤߤޤλߤԤȡ桼ϥѥɤϤޤ +指定された\fIalias\fRから新しい別名\fIdestalias\fRへ、既存のキーストア・エントリを移動します。ターゲット別名を指定しなかった場合、ターゲット別名の入力を求められます。元のエントリがエントリ・パスワードで保護されていた場合、\fI\-keypass\fRオプションでそのパスワードを指定できます。鍵パスワードが指定されなかった場合、\fIstorepass\fR(指定された場合)がまず試みられます。その試みが失敗すると、ユーザーはパスワードの入力を求められます。 .RE .PP \-help .RS 4 -ŪʥޥɤȤΥץΰɽޤ +基本的なコマンドとそのオプションの一覧を表示します。 .sp -Υޥɤξܺ٤򻲾ȤˤϡΤ褦ϤƤ: -\fIkeytool \-command_name \-help\fR\fIcommand_name\fRϥޥɤ̾Ǥ +特定のコマンドの詳細を参照するには、次のように入力してください: +\fIkeytool \-command_name \-help\fR。\fIcommand_name\fRはコマンドの名前です。 .RE -.SH "" +.SH "例" .PP -Ǥϡ/̩ΥڥӿǤ륨ƥƥξ뤿Υȥ򼨤ޤ -.SS "Υڥ" +この例では、公開/秘密鍵のペアおよび信頼できるエンティティからの証明書を管理するためのキーストアを作成する手順を示します。 +.SS "鍵のペアの生成" .PP -ޤȥƸΥڥޤñԤϤ롢Τ褦ʥޥɤѤǤޤ +まず、キーストアを作成して鍵のペアを生成します。単一行に入力する、次のようなコマンドを使用できます。 .sp .if n \{\ .RS 4 @@ -942,11 +942,11 @@ keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US" .RE .\} .PP -ޥɤϡworkingǥ쥯ȥ\fImykeystore\fRȤ̾Υȥ(ȥϤޤ¸ߤƤʤȲ)ȥˡ\fI<new password for keystore>\fRǻꤷѥɤƤޤ̩Υڥб륨ƥƥΡּ̾פϡ̾ΤMark Jonesȿñ̤JavaȿOracle2ʸιֹ椬USǤ̩ΥϤɤ1024ӥåȤǡκˤϥǥեȤDSA르ꥺѤޤ +コマンドは、workingディレクトリに\fImykeystore\fRという名前のキーストアを作成し(キーストアはまだ存在していないと仮定)、作成したキーストアに、\fI<new password for keystore>\fRで指定したパスワードを割り当てます。生成する公開鍵と秘密鍵のペアに対応するエンティティの「識別名」は、通称がMark Jones、組織単位がJava、組織がOracle、2文字の国番号がUSです。公開鍵と秘密鍵のサイズはどちらも1024ビットで、鍵の作成にはデフォルトのDSA鍵生成アルゴリズムを使用します。 .PP -ΥޥɤϡǥեȤSHA1withDSA̾르ꥺѤơȼ̾ޤ༫ʽ̾ޤ֤ͭ180Ǥϡ̾\fIbusiness\fRꤵ륭ȥȥ̩˴Ϣդޤ̩ˤϡ\fI<new password for private key>\fRǻꤷѥɤƤޤ +このコマンドは、デフォルトのSHA1withDSA署名アルゴリズムを使用して、公開鍵と識別名情報を含む自己署名証明書を作成します。証明書の有効期間は180日です。証明書は、別名\fIbusiness\fRで特定されるキーストア・エントリ内の秘密鍵に関連付けられます。秘密鍵には、\fI<new password for private key>\fRで指定したパスワードが割り当てられます。 .PP -ץΥǥեͤѤ硢ޥɤûʤޤξ硢ץפǤǥեͤĥץǤϡץꤷʤХǥեͤѤޤɬͤϤޤѲǽͤϼΤȤǤ +オプションのデフォルト値を使用する場合、コマンドは大幅に短くなります。この場合、オプションは不要です。デフォルト値を持つオプションでは、オプションを指定しなければデフォルト値が使用されます。必須値の入力を求められます。使用可能な値は次のとおりです。 .sp .if n \{\ .RS 4 @@ -958,12 +958,12 @@ keytool \-genkeypair .RE .\} .PP -ξϡ\fImykey\fRȤ̾ǥȥȥ꤬졢줿Υڥ90ͭʾ񤬤Υȥ˳ǼޤΥȥϡۡࡦǥ쥯ȥ\fI\&.keystore\fRȤ̾Υȥ֤ޤȥϡޤ¸ߤƤʤ˺ޤ̾󡢥ȥΥѥɤ̩ΥѥɤϤޤ +この場合は、\fImykey\fRという別名でキーストア・エントリが作成され、新しく生成された鍵のペア、および90日間有効な証明書がこのエントリに格納されます。このエントリは、ホーム・ディレクトリ内の\fI\&.keystore\fRという名前のキーストアに置かれます。キーストアは、まだ存在していない場合に作成されます。識別名情報、キーストアのパスワードおよび秘密鍵のパスワードの入力を求められます。 .PP -ʹߤǤϡץꤷʤ\fI\-genkeypair\fRޥɤ¹ԤΤȤ򼨤ޤϤ줿ϡǽ˼\fI\-genkeypair\fRޥɤͤϤΤȤޤȤм̾ˤ\fIcn=Mark Jones\fR\fIou=Java\fR\fIo=Oracle\fR\fIc=US\fRȻꤷޤ -.SS "CAν̾դΥꥯ" +以降では、オプションを指定しないで\fI\-genkeypair\fRコマンドを実行したものとして例を示します。情報の入力を求められた場合は、最初に示した\fI\-genkeypair\fRコマンドの値を入力したものとします。たとえば識別名には\fIcn=Mark Jones\fR、\fIou=Java\fR、\fIo=Oracle\fR、\fIc=US\fRと指定します。 +.SS "CAからの署名付き証明書のリクエスト" .PP -ʽ̾븰Υڥ˾ȯԶ(CA)ν̾դƤС¾Υ桼񤬿ꤵǽ⤯ʤޤCAν̾ˤϡޤ̾ꥯ(CSR)ޤȤСΤ褦ˤޤ +自己署名証明書を作成する鍵のペアの生成。証明書に証明書発行局(CA)の署名が付いていれば、他のユーザーから証明書が信頼される可能性も高くなります。CAの署名を取得するには、まず、証明書署名リクエスト(CSR)を生成します。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -975,12 +975,12 @@ keytool \-certreq \-file MarkJ\&.csr .RE .\} .PP -CSR(ǥե̾\fImykey\fRˤäꤵ륨ƥƥCSR)졢MarkJ\&.csrȤ̾Υե֤ޤΥեCA (VeriSignʤ)ФޤCA׵Ԥ(̾ϥե饤)ǧڤ׵Ԥθǧڤ̾դξ֤ޤˤäƤϡCAΥ֤Ȥ⤢ޤΥǤϡƾ񤬥Τν̾Ԥθǧڤޤ -.SS "CAξΥݡ" +CSR(デフォルト別名\fImykey\fRによって特定されるエンティティのCSR)が作成され、MarkJ\&.csrという名前のファイルに置かれます。このファイルをCA (VeriSignなど)に提出します。CAは要求者を(通常はオフラインで)認証し、要求者の公開鍵を認証した署名付きの証明書を送り返します。場合によっては、CAが証明書のチェーンを返すこともあります。証明書のチェーンでは、各証明書がチェーン内のその前の署名者の公開鍵を認証します。 +.SS "CAからの証明書のインポート" .PP -ʽ̾ϡ֤ɬפޤǤϡƾ񤬡֥롼ȡCAȤμξν̾Ԥθǧڤޤ +作成した自己署名証明書は、証明書チェーンで置き換える必要があります。証明書チェーンでは、各証明書が、「ルート」CAを起点とするチェーン内の次の証明書の署名者の公開鍵を認証します。 .PP -CAξ򥤥ݡȤˤϡȥ\fIcacerts\fRȥե1İʾοǤ񤬤ɬפޤ\fI\fR\-importcertޥɤ򻲾ȤƤ +CAからの証明書応答をインポートするには、キーストアか、\fIcacerts\fRキーストア・ファイル内に1つ以上の信頼できる証明書がある必要があります。\fIの\fR\-importcertコマンドを参照してください。 .sp .RS 4 .ie n \{\ @@ -990,7 +990,7 @@ CA .sp -1 .IP \(bu 2.3 .\} -ξϡκǾ̾ɬפǤCAθǧڤ롼CA +証明応答が証明書チェーンの場合は、チェーンの最上位証明書が必要です。CAの公開鍵を認証するルートCA証明書。 .RE .sp .RS 4 @@ -1001,14 +1001,14 @@ CA .sp -1 .IP \(bu 2.3 .\} -ñξξϡȯCA(̾)ξɬפǤξ񤬼ʽ̾Ǥʤϡν̾ԤξɬפǤꡢΤ褦ˤƼʽ̾롼Ⱦɬפˤʤޤ +証明書応答が単一の証明書の場合は、発行CA(署名した)の証明書が必要です。その証明書が自己署名でない場合は、その署名者の証明書が必要であり、このようにして自己署名ルート証明書が必要になります。 .RE .PP -\fIcacerts\fRȥեϡĤVeriSign롼CAޤ֤ǽв٤ƤΤǡVeriSignξ򡢿ǤȤƥȥ˥ݡȤɬפʤ礬ޤ¾CAФƽ̾դꥯȤƤơCAθǧڤ񤬡\fIcacerts\fRˤޤɲäƤʤϡCAξ򡢡ֿǤפȤƥݡȤɬפޤ +\fIcacerts\fRキーストア・ファイルは、いくつかのVeriSignルートCA証明書を含んだ状態で出荷されているので、VeriSignの証明書を、信頼できる証明書としてキーストア内にインポートする必要がない場合があります。ただし、他のCAに対して署名付き証明書をリクエストしていて、このCAの公開鍵を認証する証明書が、\fIcacerts\fRにまだ追加されていない場合は、該当するCAからの証明書を、「信頼できる証明書」としてインポートする必要があります。 .PP -̾CAξϡʽ̾񡢤ޤ¾CAˤäƽ̾줿Ǥ(Ԥξϡ¾CAθǧڤɬ)ABC, Inc\&.,CAǡABC鼫ʽ̾ǤA\fIBCCA\&.cer\fRȤ̾ΥեȤޤ(ξCAθǧڤޤ)ǤȤƾ򥤥ݡȤȤϡͭǤ뤳Ȥǧɬפޤޤ\fIkeytool \-printcert\fRޥɤޤ\fI\-noprompt\fRץʤ\fIkeytool \-importcert\fRޥɤǤɽɽ줿Υե󥬡ץȤԤΤȰפ뤫ɤǧޤʪϢοʪ󼨤(ޤϰʸΥݥȥˤä󼨤)ե󥬡ץȤȡΥޥɤɽ줿ե󥬡ץȤȤӤޤե󥬡ץȤפС¾βԤ(Ԥʤ)ˤΤؤԤƤʤȤǧǤޤǤμι⤬ԤƤ硢åԤ鷺˾򥤥ݡȤȡԤˤäƽ̾줿٤ƤΤΤꤹ뤳Ȥˤʤޤ +通常、CAからの証明書は、自己署名証明書、または他のCAによって署名された証明書です(後者の場合は、該当する他のCAの公開鍵を認証する証明書が必要)。ABC, Inc\&.,がCAで、ABCから自己署名証明書であるA\fIBCCA\&.cer\fRという名前のファイルを取得したとします(この証明書はCAの公開鍵を認証します)。信頼できる証明書として証明書をインポートするときは、証明書が有効であることを確認する必要があります。まず、\fIkeytool \-printcert\fRコマンドまたは\fI\-noprompt\fRオプションなしの\fIkeytool \-importcert\fRコマンドでそれを表示し、表示された証明書のフィンガープリントが期待されるものと一致するかどうかを確認します。証明書を送信した人物に連絡し、この人物が提示した(または安全な公開鍵のリポジトリによって提示される)フィンガープリントと、上のコマンドで表示されたフィンガープリントとを比較します。フィンガープリントが一致すれば、送信途中で他の何者か(攻撃者など)による証明書のすり替えが行われていないことを確認できます。送信途中でこの種の攻撃が行われていた場合、チェックを行わずに証明書をインポートすると、攻撃者によって署名されたすべてのものを信頼することになります。 .PP -ͭǤȿꤹϡΥޥɤǥȥɲäǤޤ +証明書が有効であると信頼する場合は、次のコマンドでキーストアに追加できます。 .sp .if n \{\ .RS 4 @@ -1020,12 +1020,12 @@ keytool \-importcert \-alias abc \-file ABCCA\&.cer .RE .\} .PP -ABCCA\&.cerեΥǡޤ࿮ǤΥȥ꤬ȥ˺졢륨ȥ\fIabc\fRȤ̾Ƥޤ -.SS "CAξΥݡ" +ABCCA\&.cerファイルのデータを含む信頼できる証明書のエントリがキーストア内に作成され、該当するエントリに\fIabc\fRという別名が割り当てられます。 +.SS "CAからの証明書応答のインポート" .PP -̾ꥯȤCAθǧڤ򥤥ݡȤ(ޤƱξ񤬤Ǥcacertsե¸ߤƤ)򥤥ݡȤʽ֤̾뤳ȤǤޤΥϡCAαξˡꥯȤФ쥹ݥ󥹤ȤCA֤줿ǤޤCAαñξξϡξȡݡΥȥޤ\fIcacerts\fRȥեˤǤ¸ߤ뿮ǤȤѤƹۤǤ +証明書署名リクエストの提出先のCAの公開鍵を認証する証明書をインポートした後は(または同種の証明書がすでにcacertsファイル内に存在している場合は)、証明応答をインポートし、自己署名証明書を証明書チェーンで置き換えることができます。このチェーンは、CAの応答がチェーンの場合に、リクエストに対するレスポンスとしてCAから送り返された証明書チェーンです。また、CAの応答が単一の証明書の場合は、この証明応答と、インポート先のキーストア内または\fIcacerts\fRキーストアファイル内にすでに存在する信頼できる証明書とを使用して構築した証明書チェーンです。 .PP -ȤС̾ꥯȤVeriSign硢֤줿̾VSMarkJ\&.cerȤȡΤ褦ˤƱ򥤥ݡȤǤޤ +たとえば、証明書署名リクエストをVeriSignに送信する場合、送り返された証明書の名前がVSMarkJ\&.cerだとすると、次のようにして応答をインポートできます。 .sp .if n \{\ .RS 4 @@ -1036,11 +1036,11 @@ keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer .if n \{\ .RE .\} -.SS "ǧڤΥݡ" +.SS "公開鍵を認証する証明書のエクスポート" .PP -\fIjarsigner\fRޥɤѤJava Archive (JAR)ե˽̾硢ΥեѤ륯饤ȤϽ̾ǧڤɬפޤ饤Ȥ̾ǧڤˡ1ĤˡޤʬθξǤ륨ȥȤƥ饤ȤΥȥ˥ݡȤˡޤ +\fIjarsigner\fRコマンドを使用してJava Archive (JAR)ファイルに署名する場合、このファイルを使用するクライアントは署名を認証する必要があります。クライアントが署名を認証する方法の1つに、まず自分の公開鍵の証明書を信頼できるエントリとしてクライアントのキーストアにインポートする方法があります。 .PP -Τˤϡ򥨥ݡȤơ饤Ȥ󶡤ޤȤơΥޥɤѤơMJ\&.cerȤ̾Υե˾򥳥ԡǤޤΥޥɤǤϡȥ̾\fImykey\fRȲꤷƤޤ +そのためには、証明書をエクスポートして、クライアントに提供します。例として、次のコマンドを使用して、MJ\&.cerという名前のファイルに証明書をコピーできます。このコマンドでは、エントリに別名\fImykey\fRがあると仮定しています。 .sp .if n \{\ .RS 4 @@ -1052,12 +1052,12 @@ keytool \-exportcert \-alias mykey \-file MJ\&.cer .RE .\} .PP -Ƚ̾դJARեꤷ饤Ȥϡ\fIjarsigner\fRޥɤѤƽ̾ǧڤǤޤ -.SS "ȥΥݡ" +証明書と署名付きJARファイルを入手したクライアントは、\fIjarsigner\fRコマンドを使用して署名を認証できます。 +.SS "キーストアのインポート" .PP -ޥ\fIimportkeystore\fRѤС륭ȥΤ̤Υȥ˥ݡȤǤޤϡȤäȥΤ٤ƤΥȥ꤬ñΥޥɤѤƥåȥȥ˥ݡȤ뤳Ȥ̣ޤΥޥɤѤСۤʤ륿פΥȥ˴ޤޤ륨ȥ򥤥ݡȤ뤳ȤǤޤݡȻˤϡåȡȥοȥϤ٤ơƱ̾(̩̩ξ)ݸѥѥɤޤȥ/̩ꥫХǤʤ硢\fIkeytool\fRޥɤϥ桼˥ѥɤϤޤΥޥɤϡ̾νʣ򸡽Фȡ桼˿̾Ϥޤ桼ϡ̾ꤹ뤳Ȥ⡢ñ˴¸̾ξ񤭤\fIkeytool\fRޥɤ˵Ĥ뤳ȤǤޤ +コマンド\fIimportkeystore\fRを使用すれば、あるキーストアの全体を別のキーストア内にインポートできます。これは、鍵や証明書といったソースキーストア内のすべてのエントリが、単一のコマンドを使用してターゲットキーストア内にインポートされることを意味します。このコマンドを使用すれば、異なるタイプのキーストア内に含まれるエントリをインポートすることができます。インポート時には、ターゲット・キーストア内の新しいエントリはすべて、元と同じ別名および(秘密鍵や秘密鍵の場合は)保護用パスワードを持ちます。ソースキーストア内の非公開/秘密鍵をリカバリできない場合、\fIkeytool\fRコマンドはユーザーにパスワードの入力を求めます。このコマンドは、別名の重複を検出すると、ユーザーに新しい別名の入力を求めます。ユーザーは、新しい別名を指定することも、単純に既存の別名の上書きを\fIkeytool\fRコマンドに許可することもできます。 .PP -ȤС̾JKSפΥȥkey\&.jksΥȥPKCS#11פΥϡɥ١Υȥ˥ݡȤˤϡΥޥɤѤޤ +たとえば、通常のJKSタイプのキーストアkey\&.jks内のエントリをPKCS#11タイプのハードウェア・ベースのキーストア内にインポートするには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -1073,7 +1073,7 @@ keytool \-importkeystore .RE .\} .PP -ޤ\fIimportkeystore\fRޥɤѤС륽ȥñΥȥ򥿡åȡȥ˥ݡȤ뤳ȤǤޤξϡΥץ˲äơݡȤ̾ꤹɬפޤ\fI\-srcalias\fRץꤹˤϡå̾⥳ޥɥ饤󤫤Ǥ̩ۤ/̩ݸѥѥɤ䥿åݸѥѥɤǤޤˡ򼨤ޥɤ򼡤˼ޤ +また、\fIimportkeystore\fRコマンドを使用すれば、あるソース・キーストア内の単一のエントリをターゲット・キーストアにインポートすることもできます。この場合は、前例のオプションに加えて、インポートする別名を指定する必要があります。\fI\-srcalias\fRオプションを指定する場合には、ターゲット別名もコマンドラインから指定できるほか、秘密/秘密鍵の保護用パスワードやターゲット保護用パスワードも指定できます。その方法を示すコマンドを次に示します。 .sp .if n \{\ .RS 4 @@ -1092,9 +1092,9 @@ keytool \-importkeystore .if n \{\ .RE .\} -.SS "SSLСξ" +.SS "SSLサーバーの証明書の生成" .PP -ˡ3ĤΥƥƥĤޤ롼CA(\fIroot\fR)CA(\fIca\fR)SSLС(\fIserver\fR)ѤθڥȾ\fIkeytool\fRޥɤ򼨤ޤ٤ƤξƱȥ˳Ǽ褦ˤƤǤϡRSA侩븰Υ르ꥺǤ +次に、3つのエンティティ、つまりルートCA(\fIroot\fR)、中間CA(\fIca\fR)およびSSLサーバー(\fIserver\fR)用の鍵ペアと証明書を生成する\fIkeytool\fRコマンドを示します。すべての証明書を同じキーストアに格納するようにしてください。これらの例では、RSAが推奨される鍵のアルゴリズムです。 .sp .if n \{\ .RS 4 @@ -1120,30 +1120,30 @@ cat root\&.pem ca\&.pem server\&.pem | .if n \{\ .RE .\} -.SH "Ѹ" +.SH "用語" .PP -ȥ +キーストア .RS 4 -ȥϡŹ沽θȾǼ뤿εǽǤ +キーストアは、暗号化の鍵と証明書を格納するための機能です。 .RE .PP -ȥΥȥ +キーストアのエントリ .RS 4 -ȥˤϰۤʤ륿פΥȥޤ뤳ȤǤޤ\fIkeytool\fRޥɤǺǤŬϰϤιȥꡦפϡ2ĤǤ +キーストアには異なるタイプのエントリを含めることができます。\fIkeytool\fRコマンドで最も適用範囲の広いエントリ・タイプは、次の2つです。 .sp -\fBΥȥ\fR -\- ƥȥϡ˽פʰŹ沽θξݻޤξϡĤƤʤɤˡݸ줿dzǼޤ̤ˡμΥȥȤƳǼ븰ϡ̩бξȼ̩Ǥ򻲾ȤƤ\fIkeytool\fRޥɤξΥפΥȥǤΤФ\fIjarsigner\fRġϸԤΥפΥȥꡢĤޤ̩Ȥ˴Ϣդ줿Τߤޤ +\fB鍵のエントリ\fR +\- 各エントリは、非常に重要な暗号化の鍵の情報を保持します。この情報は、許可していないアクセスを防ぐために、保護された形で格納されます。一般に、この種のエントリとして格納される鍵は、秘密鍵か、対応する公開鍵の証明書チェーンを伴う秘密鍵です。証明書チェーンを参照してください。\fIkeytool\fRコマンドがこの両方のタイプのエントリを処理できるのに対し、\fIjarsigner\fRツールは後者のタイプのエントリ、つまり秘密鍵とそれに関連付けられた証明書チェーンのみを処理します。 .sp -\fBǤΥȥ\fR: ƥȥϡ軰Ԥθ1ĴޤǤޤΥȥϡǤȸƤФޤϡθSubject(ͭ)ˤäꤵ륢ǥƥƥͳ褹ΤǤ뤳Ȥ򡢥ȥνͭԤꤹ뤫ǤȯԼԤϡ˽̾դ뤳ȤˤäơƤݾڤޤ +\fB信頼できる証明書のエントリ\fR: 各エントリは、第三者からの公開鍵証明書を1つ含んでいます。このエントリは、信頼できる証明書と呼ばれます。それは、証明書内の公開鍵が、証明書のSubject(所有者)によって特定されるアイデンティティに由来するものであることを、キーストアの所有者が信頼するからです。証明書の発行者は、証明書に署名を付けることによって、その内容を保証します。 .RE .PP -ȥ̾ +キーストアの別名 .RS 4 -ȥΤ٤ƤΥȥ(ӿǤ񥨥ȥ)ϡդ̾𤷤ƥޤ +キーストアのすべてのエントリ(鍵および信頼できる証明書エントリ)は、一意の別名を介してアクセスされます。 .sp -̾ꤹΤϡ\fI\-genseckey\fRޥɤѤ̩ꡢ\fI\-genkeypair\fRޥɤѤƸڥ(̩)ꡢ\fI\-importcert\fRޥɤѤƾޤϾǤΥꥹȤɲäʤɡΥƥƥ򥭡ȥɲäǤʸ塢\fIkeytool\fRޥɤǥƥƥ򻲾ȤϡΤȤ˻ꤷ̾Ѥɬפޤ +別名を指定するのは、\fI\-genseckey\fRコマンドを使用して秘密鍵を生成したり、\fI\-genkeypair\fRコマンドを使用して鍵ペア(公開鍵と秘密鍵)を生成したり、\fI\-importcert\fRコマンドを使用して証明書または証明書チェーンを信頼できる証明書のリストに追加するなど、特定のエンティティをキーストアに追加する場合です。これ以後、\fIkeytool\fRコマンドでエンティティを参照する場合は、このときに指定した別名を使用する必要があります。 .sp -ȤС\fIduke\fRȤ̾Ѥƿ̩Υڥ򼫸ʽ̾ǥåפȤޤξϡΥޥɤ¹Ԥޤ򻲾ȤƤ +たとえば、\fIduke\fRという別名を使用して新しい公開鍵と秘密鍵のペアを生成し、公開鍵を自己署名証明書でラップするとします。この場合は、次のコマンドを実行します。証明書チェーンを参照してください。 .sp .if n \{\ .RS 4 @@ -1154,7 +1154,7 @@ keytool \-genkeypair \-alias duke \-keypass dukekeypasswd .if n \{\ .RE .\} -ǤϡѥɤȤ\fIdukekeypasswd\fRꤷƤޤʸ塢̾\fIduke\fR˴Ϣդ줿̩˥륳ޥɤ¹ԤȤϡΥѥɤɬפˤʤޤDuke̩Υѥɤ򤢤ȤѹˤϡΥޥɤ¹Ԥޤ +この例では、初期パスワードとして\fIdukekeypasswd\fRを指定しています。以後、別名\fIduke\fRに関連付けられた秘密鍵にアクセスするコマンドを実行するときは、このパスワードが必要になります。Dukeの秘密鍵のパスワードをあとから変更するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -1165,29 +1165,29 @@ keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass .if n \{\ .RE .\} -ѥɤ\fIdukekeypasswd\fR\fInewpass\fRѹޤƥȤŪȤ硢ޤϰǤ뤳Ȥ狼äƤ륷ƥǼ¹Ԥʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤɬפʥѥɤΥץ򥳥ޥɥ饤ǻꤷʤäϡѥɤϤޤ +パスワードが、\fIdukekeypasswd\fRから\fInewpass\fRに変更されます。テストを目的とする場合、または安全であることがわかっているシステムで実行する場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。必要なパスワードのオプションをコマンドラインで指定しなかった場合は、パスワードの入力を求められます。 .RE .PP -ȥμ +キーストアの実装 .RS 4 -\fIjava\&.security\fRѥå󶡤Ƥ\fIKeyStore\fR饹ϡȥξؤΥӾѹԤΡΤ줿󥿥ե󶡤ޤȥθȤƤϡ줾줬ΥפΥȥоݤȤʣΰۤʤ¸߲ǽǤ +\fIjava\&.security\fRパッケージで提供されている\fIKeyStore\fRクラスは、キーストア内の情報へのアクセスおよび情報の変更を行うための、明確に定義されたインタフェースを提供します。キーストアの固定実装としては、それぞれが特定のタイプのキーストアを対象とする複数の異なる実装が存在可能です。 .sp -ߡ\fIkeytool\fR\fIjarsigner\fR2ĤΥޥɥ饤󡦥ġȡPolicy ToolȤ̾GUI١Υġ뤬ȥμѤƤޤ\fIKeyStore\fR饹\fIpublic\fRǤ뤿ᡢ桼KeyStoreѤ¾ΥƥץꥱǤޤ +現在、\fIkeytool\fRと\fIjarsigner\fRの2つのコマンドライン・ツールと、Policy Toolという名前のGUIベースのツールが、キーストアの実装を使用しています。\fIKeyStore\fRクラスは\fIpublic\fRであるため、ユーザーはKeyStoreを使用した他のセキュリティ・アプリケーションも作成できます。 .sp -ȥˤϡOracle󶡤ȹߤΥǥեȤμޤϡJKSȤ̾ȼΥȥ()ѤΤǡȥեȤƼƤޤμǤϡġ̩ϸ̤Υѥɤˤäݸ졢ȥΤ(̩Ȥ̤)ѥɤˤäݸޤ +キーストアには、Oracleが提供する組込みのデフォルトの実装があります。これは、JKSという名前の独自のキーストア・タイプ(形式)を利用するもので、キーストアをファイルとして実装しています。この実装では、個々の秘密鍵は個別のパスワードによって保護され、キーストア全体の整合性も(秘密鍵とは別の)パスワードによって保護されます。 .sp -ȥμϡץХ١ǤŪˤϡ\fIKeyStore\fRˤä󶡤륢ץꥱ󡦥󥿥եӥץХ󥿥ե(SPI)˴ŤƼޤĤޤꡢб\fIKeystoreSpi\fRݥ饹(\fIjava\&.security\fRѥå˴ޤޤƤޤ)ꡢΥ饹ץХɬפΤService Provider InterfaceΥ᥽åɤƤޤǡ\fIץХ\fRȤϡJava Security APIˤäƥǽʥӥΥ֥åȤФθ󶡤ѥåޤϥѥåνΤȤǤȥμ󶡤ˤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlˤ -JavaŹ沽ƥΥץХμˡƤ褦ˡ饤ȤϥץХ\fIKeystoreSpi\fR֥饹μ󶡤ɬפޤ +キーストアの実装は、プロバイダベースです。具体的には、\fIKeyStore\fRによって提供されるアプリケーション・インタフェースがサービス・プロバイダ・インタフェース(SPI)に基づいて実装されます。つまり、対応する\fIKeystoreSpi\fR抽象クラス(これも\fIjava\&.security\fRパッケージに含まれています)があり、このクラスが、プロバイダが実装する必要のあるService Provider Interfaceのメソッドを定義しています。ここで、\fIプロバイダ\fRとは、Java Security APIによってアクセス可能なサービスのサブセットに対し、その固定実装を提供するパッケージまたはパッケージの集合のことです。キーストアの実装を提供するには、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlにある +Java暗号化アーキテクチャのプロバイダの実装方法で説明しているように、クライアントはプロバイダを実装し、\fIKeystoreSpi\fRサブクラスの実装を提供する必要があります。 .sp -ץꥱǤϡ\fIKeyStore\fR饹󶡤\fIgetInstance\fRեȥꡦ᥽åɤѤ뤳Ȥǡ͡ʥץХۤʤ륿פΥȥμǤޤȥΥפϡȥγǼȥǡȤȤˡȥ/̩ȥȥݸ뤿˻Ѥ륢르ꥺޤۤʤ륿פΥȥμˤϡߴϤޤ +アプリケーションでは、\fIKeyStore\fRクラスが提供する\fIgetInstance\fRファクトリ・メソッドを使用することで、様々なプロバイダから異なるタイプのキーストアの実装を選択できます。キーストアのタイプは、キーストア情報の格納形式とデータ形式を定義するとともに、キーストア内の非公開/秘密鍵とキーストアの整合性を保護するために使用されるアルゴリズムを定義します。異なるタイプのキーストアの実装には、互換性はありません。 .sp -\fIkeytool\fRޥɤϡǤդΥե١Υȥưޤޥɡ饤Ϥ줿ȥξե̾Ȥưäơ\fIFileInputStream\fRѴ饭ȥɤޤ\fIjarsigner\fR\fIpolicytool\fRޥɤϡURLǻǤǤդξ꤫饭ȥɤ߼뤳ȤǤޤ +\fIkeytool\fRコマンドは、任意のファイルベースのキーストア実装で動作します。コマンド・ラインで渡されたキーストアの場所をファイル名として扱って、\fIFileInputStream\fRに変換し、ここからキーストア情報をロードします。\fIjarsigner\fRおよび\fIpolicytool\fRコマンドは、URLで指定できる任意の場所からキーストアを読み取ることができます。 .sp -\fIkeytool\fR\fIjarsigner\fRξ硢\fI\-storetype\fRץѤƥޥɥ饤ǥȥΥפǤޤPolicy Toolξϡ֥ȥץ˥塼ˤäƥȥΥפǤޤ +\fIkeytool\fRと\fIjarsigner\fRの場合、\fI\-storetype\fRオプションを使用してコマンドラインでキーストアのタイプを指定できます。Policy Toolの場合は、「キーストア」メニューによってキーストアのタイプを指定できます。 .sp -桼ȥΥפŪ˻ꤷʤä硢ƥץѥƥեǻꤵ줿\fIkeystore\&.type\fRץѥƥͤ˴Ťơġˤäƥȥμ򤵤ޤΥƥץѥƥե\fIjava\&.security\fRȸƤФ졢WindowsǤϥƥץѥƥǥ쥯ȥ\fIjava\&.home\elib\esecurity\fROracle SolarisǤ\fIjava\&.home/lib/security\fRˤޤ\fIjava\&.home\fRϡ¹ԻĶΥǥ쥯ȥǤ\fIjre\fRǥ쥯ȥϡSDKޤJava Runtime Environment (JRE)κǾ̤Υǥ쥯ȥˤޤ +ユーザーがキーストアのタイプを明示的に指定しなかった場合、セキュリティ・プロパティ・ファイルで指定された\fIkeystore\&.type\fRプロパティの値に基づいて、ツールによってキーストアの実装が選択されます。このセキュリティ・プロパティ・ファイルは\fIjava\&.security\fRと呼ばれ、Windowsではセキュリティ・プロパティ・ディレクトリ\fIjava\&.home\elib\esecurity\fR、Oracle Solarisでは\fIjava\&.home/lib/security\fRにあります。\fIjava\&.home\fRは、実行時環境のディレクトリです。\fIjre\fRディレクトリは、SDKまたはJava Runtime Environment (JRE)の最上位のディレクトリにあります。 .sp -ƥġϡ\fIkeystore\&.type\fRͤͤǻꤵ줿פΥȥƤץХĤޤǡߥ󥹥ȡ뤵Ƥ뤹٤ƤΥץХĴ٤ޤΥץХΥȥμѤޤ\fIKeyStore\fR饹Ƥstatic᥽å\fIgetDefaultType\fRѤȡץꥱ䥢ץåȤ\fIkeystore\&.type\fRץѥƥͤǤޤΥɤϡǥեȤΥȥ(\fIkeystore\&.type\fRץѥƥǻꤵ줿)Υ󥹥󥹤ޤ +各ツールは、\fIkeystore\&.type\fRの値を取得し、この値で指定されたタイプのキーストアを実装しているプロバイダが見つかるまで、現在インストールされているすべてのプロバイダを調べます。そのプロバイダからのキーストアの実装を使用します。\fIKeyStore\fRクラスに定義されているstaticメソッド\fIgetDefaultType\fRを使用すると、アプリケーションやアプレットから\fIkeystore\&.type\fRプロパティの値を取得できます。次のコードは、デフォルトのキーストア・タイプ(\fIkeystore\&.type\fRプロパティで指定されたタイプ)のインスタンスを生成します。 .sp .if n \{\ .RS 4 @@ -1198,7 +1198,7 @@ KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType()); .if n \{\ .RE .\} -ǥեȤΥȥפ\fIjks\fRǡOracle󶡤ȼΥפΥȥμǤϡƥץѥƥեμιԤˤäƻꤵƤޤ +デフォルトのキーストア・タイプは\fIjks\fRで、これはOracleが提供する独自のタイプのキーストアの実装です。これは、セキュリティ・プロパティ・ファイル内の次の行によって指定されています。 .sp .if n \{\ .RS 4 @@ -1209,7 +1209,7 @@ keystore\&.type=jks .if n \{\ .RE .\} -ƥġǥǥեȰʳΥȥμѤˤϡιԤѹ̤ΥȥΥפꤷޤȤС\fIpkcs12\fRȸƤФ륭ȥΥפΥȥμ󶡤ץХѥå硢Ԥ򼡤Τ褦ѹޤ +各ツールでデフォルト以外のキーストアの実装を使用するには、上の行を変更して別のキーストアのタイプを指定します。たとえば、\fIpkcs12\fRと呼ばれるキーストアのタイプのキーストアの実装を提供するプロバイダ・パッケージがある場合、行を次のように変更します。 .sp .if n \{\ .RS 4 @@ -1220,56 +1220,56 @@ keystore\&.type=pkcs12 .if n \{\ .RE .\} -\fB:\fR -ȥΥפλǤϡʸȾʸ϶̤ޤ󡣤ȤСJKSjksƱΤȤưޤ +\fB注意:\fR +キーストアのタイプの指定では、大文字と小文字は区別されません。たとえば、JKSとjksは同じものとして扱われます。 .RE .PP - +証明書 .RS 4 -()Ȥϡ륨ƥƥ(ȯԼ)Υǥ̾դʸΤȤǤˤϡ¾Τ륨ƥƥ(̾)θ(Ӥ¾ξ)̤ͤäƤ뤳Ȥ񤫤ƤޤѸϡ˴ϢƤޤ +証明書(公開鍵証明書)とは、あるエンティティ(発行者)からのデジタル署名付きの文書のことです。証明書には、他のあるエンティティ(署名者)の公開鍵(およびその他の情報)が特別な値を持っていることが書かれています。次の用語は、証明書に関連しています。 .sp -\fB\fR: ϡΥƥƥ˴Ϣդ줿Ǥϡ륨ƥƥȤδ֤˿Ǥطɬפ뤹٤ƤοͤФƸ뤳ȤտޤΤǤϡ̾򸡾ڤΤ˻Ѥޤ +\fB公開鍵\fR: 公開鍵は、特定のエンティティに関連付けられた数です。公開鍵は、該当するエンティティとの間に信頼できる関係を持つ必要があるすべての人に対して公開することを意図したものです。公開鍵は、署名を検証するのに使用されます。 .sp -\fBǥ̾\fR: ǡǥ̾ȡΥǡϡƥƥΥǥƥƥȡΥƥƥǡƤˤĤΤäƤ뤳Ȥ񤹤̾ȤȤ˳Ǽޤƥƥ̩Ѥƥǡ˽̾դȡǡε¤Բǽˤʤޤ +\fBデジタル署名\fR: データがデジタル署名されると、そのデータは、エンティティのアイデンティティと、そのエンティティがデータの内容について知っていることを証明書する署名とともに格納されます。エンティティの秘密鍵を使用してデータに署名を付けると、データの偽造は不可能になります。 .sp -\fBǥƥƥ\fR: ƥƥ򥢥ɥ쥹ꤹΤˡƥˤäƤϡ򥢥ǥƥƥˤΤޤ¾ˤ⡢Oracle Solaris UIDŻҥ᡼롦ɥ쥹X\&.509̾ʤɡ͡ʤΤ򥢥ǥƥƥȤ뤳ȤǤޤ +\fBアイデンティティ\fR: エンティティをアドレス指定する既知の方法。システムによっては、公開鍵をアイデンティティにするものがあります。公開鍵の他にも、Oracle Solaris UIDや電子メール・アドレス、X\&.509識別名など、様々なものをアイデンティティとすることができます。 .sp -\fB̾\fR: ̾ϡʤ餫Υǡ˥ƥƥ̩ѤƷ׻ޤ̾ԡξȯԼԤȤƤФޤ +\fB署名\fR: 署名は、なんらかのデータを基にエンティティの秘密鍵を使用して計算されます。署名者、証明書の場合は発行者とも呼ばれます。 .sp -\fB̩\fR: ̩ΥƥƥΤߤΤäƤΤȤǡοΤȤ򡢤Υƥƥ̩Ȥޤ̩ϡ¾Τʤ褦̩ˤƤȤˤʤäƤޤ̩ȸϡ٤ƤθŹ沽ƥФˤʤä¸ߤƤޤDSAʤɤŵŪʸŹ沽ƥξ硢1Ĥ̩Τ1Ĥθбޤ̩ϡ̾׻Τ˻Ѥޤ +\fB秘密鍵\fR: 秘密鍵は特定のエンティティのみが知っている数のことで、この数のことを、そのエンティティの秘密鍵といいます。秘密鍵は、他に知られないように秘密にしておくことが前提になっています。秘密鍵と公開鍵は、すべての公開鍵暗号化システムで対になって存在しています。DSAなどの典型的な公開鍵暗号化システムの場合、1つの秘密鍵は正確に1つの公開鍵に対応します。秘密鍵は、署名を計算するのに使用されます。 .sp -\fBƥƥ\fR: ƥƥϡ͡ȿץࡢԥ塼ȡԤʤɡٹ礤ǿоݤȤʤ͡ʤΤؤޤ +\fBエンティティ\fR: エンティティは、人、組織、プログラム、コンピュータ、企業、銀行など、一定の度合いで信頼の対象となる様々なものを指します。 .sp -Ź沽Ǥϡ桼θ˥ɬפޤ絬ϤʥͥåȥĶǤϡߤ̿Ƥ륨ƥƥ֤ǰδط³ΩƤȲꤷꡢѤƤ뤹٤Ƥθ᤿Ǥݥȥ꤬¸ߤȲꤷꤹ뤳ȤԲǽǤΤ褦ʸۤ˴ؤ褹뤿˾񤬹ͰƤޤߤǤϡȯԶ(CA)Ǥ軰ԤȤƵǽޤCAϡ¾Υƥƥξ˽̾(ȯԤ)԰٤򡢿ꤷǤƤ륨ƥƥ(Ȥʤ)ǤCAˡΧη˹«ΤǡͭĿǤΤߤΤȤưޤVeriSignThawteEntrustϤᡢ¿θŪʾȯԶɤ¸ߤޤ +公開鍵暗号化では、ユーザーの公開鍵にアクセスする必要があります。大規模なネットワーク環境では、互いに通信しているエンティティ間で以前の関係が引続き確立されていると仮定したり、使用されているすべての公開鍵を収めた信頼できるリポジトリが存在すると仮定したりすることは不可能です。このような公開鍵の配布に関する問題を解決するために証明書が考案されました。現在では、証明書発行局(CA)が信頼できる第三者として機能します。CAは、他のエンティティの証明書に署名する(発行する)行為を、信頼して任されているエンティティ(企業など)です。CAは法律上の契約に拘束されるので、有効かつ信頼できる証明書のみを作成するものとして扱われます。VeriSign、Thawte、Entrustをはじめ、多くの公的な証明書発行局が存在します。 .sp -MicrosoftǧڥСEntrustCAʤʤɤ°ȿѤСȼξȯԶɤ򱿱Ĥ뤳ȤǽǤ\fIkeytool\fRޥɤѤȡɽݡȤӥݡȤԤȤǤޤޤʽ̾뤳ȤǤޤ +Microsoftの認証サーバー、EntrustのCA製品などを所属組織内で利用すれば、独自の証明書発行局を運営することも可能です。\fIkeytool\fRコマンドを使用すると、証明書の表示、インポートおよびエクスポートを行うことができます。また、自己署名証明書を生成することもできます。 .sp -ߡ\fIkeytool\fRޥɤX\&.509оݤˤƤޤ +現在、\fIkeytool\fRコマンドはX\&.509証明書を対象にしています。 .RE .PP -X\&.509 +X\&.509証明書 .RS 4 -X\&.509ʤǤϡ˴ޤƤꡢξ˽񤭹ˡ(ǡ)ˤĤƤ⵭ҤƤޤΤ٤ƤΥǡϡASN\&.1/DERȸƤФ2ĤδϢʤѤ沽ޤAbstract Syntax Notation 1ϥǡˤĤƵҤƤޤDefinite Encoding Rulesϡǡ¸žˡˤĤƵҤƤޤ +X\&.509規格では、証明書に含める情報が定義されており、この情報を証明書に書き込む方法(データ形式)についても記述されています。証明書のすべてのデータは、ASN\&.1/DERと呼ばれる2つの関連規格を使用して符号化されます。Abstract Syntax Notation 1はデータについて記述しています。Definite Encoding Rulesは、データの保存および転送の方法について記述しています。 .sp -٤ƤX\&.509ϡ̾¾˼ΥǡޤǤޤ +すべてのX\&.509証明書は、署名の他に次のデータを含んでいます。 .sp -\fBС\fR: ŬѤX\&.509ʤΥСꤷޤ˻ǤϡСˤäưۤʤޤΤȤ3ĤΥСƤޤ\fIkeytool\fRޥɤǤϡv1v2v3ξ򥤥ݡȤӥݡȤǤޤv3ξޤ +\fBバージョン\fR: 証明書に適用されるX\&.509規格のバージョンを特定します。証明書に指定できる情報は、バージョンによって異なります。今のところ、3つのバージョンが定義されています。\fIkeytool\fRコマンドでは、v1、v2、v3の証明書をインポートおよびエクスポートできます。v3の証明書を生成します。 .sp -X\&.509 Version 1ϡ1988ǯѤƹڤƤꡢǤŪǤ +X\&.509 Version 1は、1988年から利用されて広く普及しており、最も一般的です。 .sp -X\&.509 Version 2ǤϡSubjectȯԼԤ̾򤢤ȤǺѤǤ褦ˤ뤿ˡSubjectȯԼԤΰռ̻ҤγǰƳޤۤȤɤξץեʸǤϡ̾ƻѤʤȤȡǰդμ̻ҤѤʤȤ侩ƤޤVersion 2ξϡϻѤƤޤ +X\&.509 Version 2では、Subjectや発行者の名前をあとで再利用できるようにするために、Subjectと発行者の一意識別子の概念が導入されました。ほとんどの証明書プロファイル文書では、名前を再使用しないことと、証明書で一意の識別子を使用しないことが、強く推奨されています。Version 2の証明書は、広くは使用されていません。 .sp -X\&.509 Version 3ϺǤ⿷(1996ǯ)ʤǡƥ󥷥γǰ򥵥ݡȤƤޤƥ󥷥ïǤ뤳ȤǤ˴ޤ뤳ȤǤޤŪʥƥ󥷥ȤƤϡKeyUsage(\fI̾\fRʤɡλѤŪ¤)AlternativeNames(DNS̾Żҥ᡼롦ɥ쥹IPɥ쥹ʤɡ¾Υǥƥƥ˴Ϣդ뤳ȤǤ)ʤɤޤƥ󥷥ˤϡcriticalȤޡդơΥƥ󥷥ΥåȻѤ̳Ť뤳ȤǤޤȤСcriticalȥޡ졢\fIkeyCertSign\fRꤵ줿KeyUsageƥ󥷥󤬾˴ޤޤƤ硢ξSSL̿󼨤ȡ񤬵ݤޤϡΥƥ󥷥ˤäơϢ̩ν̾ѤȤƻꤵƤꡢSSLǤϻѤǤʤǤ +X\&.509 Version 3は最も新しい(1996年)規格で、エクステンションの概念をサポートしています。エクステンションは誰でも定義することができ、証明書に含めることができます。一般的なエクステンションとしては、KeyUsage(\fI署名専用\fRなど、鍵の使用を特定の目的に制限する)、AlternativeNames(DNS名、電子メール・アドレス、IPアドレスなど、他のアイデンティティを公開鍵に関連付けることができる)などがあります。エクステンションには、criticalというマークを付けて、そのエクステンションのチェックと使用を義務づけることができます。たとえば、criticalとマークされ、\fIkeyCertSign\fRが設定されたKeyUsageエクステンションが証明書に含まれている場合、この証明書をSSL通信中に提示すると、証明書が拒否されます。これは、証明書のエクステンションによって、関連する秘密鍵が証明書の署名専用として指定されており、SSLでは使用できないためです。 .sp -\fBꥢֹ\fR: ƥƥϡΥƥƥȯԤ¾ξȶ̤뤿ˡ˥ꥢֹƤޤξϡ͡ˡǻѤޤȤС񤬼äȡꥢֹ椬񼺸ꥹ(CRL)˳Ǽޤ +\fBシリアル番号\fR: 証明書を作成したエンティティは、そのエンティティが発行する他の証明書と区別するために、証明書にシリアル番号を割り当てます。この情報は、様々な方法で使用されます。たとえば、証明書が取り消されると、シリアル番号が証明書失効リスト(CRL)に格納されます。 .sp -\fB񥢥르ꥺ༱̻\fR: ˽̾դȤCAѤ르ꥺꤷޤ +\fB証明書アルゴリズム識別子\fR: 証明書に署名を付けるときにCAが使用したアルゴリズムを特定します。 .sp -\fBȯԼ̾\fR: ˽̾դƥƥX\&.500̾ǤX\&.500̾򻲾ȤƤ̾CAǤξѤ뤳Ȥϡ˽̾դƥƥꤹ뤳Ȥ̣ޤ롼ȤĤޤȥåץ٥CAξʤɡˤäƤȯԼԤȤξ˽̾դ뤳Ȥޤ +\fB発行者名\fR: 証明書に署名を付けたエンティティのX\&.500識別名です。X\&.500識別名を参照してください。通常はCAです。この証明書を使用することは、証明書に署名を付けたエンティティを信頼することを意味します。ルートつまりトップレベルのCAの証明書など、場合によっては発行者が自身の証明書に署名を付けることがあります。 .sp -\fBͭ\fR: ƾϸ¤줿֤ΤͭǤδ֤ϳϤȽλˤäƻꤵ졢äû֤100ǯȤĹˤ錄뤳Ȥ⤢ޤ򤵤֤ͭϡؤν̾˻Ѥ̩ζ٤˻ʧۤʤɡ͡װǰۤʤޤ֤ͭϡϢ̩»ʤˡƥƥǤȴԤ֤Ǥ +\fB有効期間\fR: 各証明書は限られた期間のみ有効です。この期間は開始の日時と終了の日時によって指定され、数秒の短い期間から100年という長期にわたることもあります。選択される有効期間は、証明書への署名に使用される秘密鍵の強度や証明書に支払う金額など、様々な要因で異なります。有効期間は、関連する秘密鍵が損われない場合に、エンティティが公開鍵を信頼できると期待される期間です。 .sp -\fB̾\fR: Ǹǧڤ륨ƥƥ̾̾X\&.500ɸѤΤǡ󥿡ͥåΤǰդʤΤꤵޤϡƥƥX\&.500̾(DN)ǤX\&.500̾򻲾ȤƤ򼨤ޤ +\fB主体名\fR: 証明書で公開鍵を認証するエンティティの名前。この名前はX\&.500標準を使用するので、インターネット全体で一意なものと想定されます。これは、エンティティのX\&.500識別名(DN)です。X\&.500識別名を参照してください。次に例を示します。 .sp .if n \{\ .RS 4 @@ -1280,33 +1280,33 @@ CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US .if n \{\ .RE .\} -Ϥ줾Τ̾(CN)ȿñ(OU)ȿ(O)(C)ɽޤ +これらはそれぞれ主体の通称(CN)、組織単位(OU)、組織(O)、国(C)を表します。 .sp -\fBΤθ\fR: ̾դ줿ƥƥθȥ르ꥺ༱̻ҤǤ르ꥺ༱̻ҤǤϡФƻѤƤŹ沽ƥपӴϢ븰ѥ᡼ꤵƤޤ +\fB主体の公開鍵情報\fR: 名前を付けられたエンティティの公開鍵とアルゴリズム識別子です。アルゴリズム識別子では、公開鍵に対して使用されている公開鍵暗号化システムおよび関連する鍵パラメータが指定されています。 .RE .PP - +証明書チェーン .RS 4 -\fIkeytool\fRޥɤǤϡ̩ӴϢޤ७ȥθȥ뤳ȤǤޤΤ褦ʥȥǤϡ̩бϡκǽξ˴ޤޤƤޤ +\fIkeytool\fRコマンドでは、秘密鍵および関連する証明書チェーンを含むキーストアの鍵エントリを作成し、管理することができます。このようなエントリでは、秘密鍵に対応する公開鍵は、チェーンの最初の証明書に含まれています。 .sp -ƺȡʽ̾Ȥ1ĤǤΤߤޤ󤬳Ϥޤ\fI\fR\-genkeypairޥɤ򻲾ȤƤʽ̾ȯԼ(̾)ΤƱǤΤϡθˤäǧڤ륨ƥƥǤ\fI\-genkeypair\fRޥɤƤӽФƿ̩ΥڥȡϾ˼ʽ̾ǥåפޤ +鍵を初めて作成すると、自己署名証明書という1つの要素のみを含むチェーンが開始されます。\fIの\fR\-genkeypairコマンドを参照してください。自己署名証明書は発行者(署名者)が主体と同じです。主体は、その公開鍵が証明書によって認証されるエンティティです。\fI\-genkeypair\fRコマンドを呼び出して新しい公開鍵と秘密鍵のペアを作成すると、公開鍵は常に自己署名証明書でラップされます。 .sp -θ塢̾ꥯ(CSR)\fI\-certreq\fRޥɤơCSRȯԶ(CA)ȡCAΥ쥹ݥ󥹤\fI\-importcert\fRǥݡȤ졢μʽ̾Ͼˤä֤ޤޥɤ\fI\-certreq\fR\fI\-importcert\fRץ򻲾ȤƤκǸˤΤϡSubjectθǧڤCAȯԤ()ǤΤξϡCAθǧڤǤ +この後、証明書署名リクエスト(CSR)が\fI\-certreq\fRコマンドで生成されて、CSRが証明書発行局(CA)に送信されると、CAからのレスポンスが\fI\-importcert\fRでインポートされ、元の自己署名証明書は証明書チェーンによって置き換えられます。コマンドの\fI\-certreq\fRおよび\fI\-importcert\fRオプションを参照してください。チェーンの最後にあるのは、Subjectの公開鍵を認証したCAが発行した証明書(応答)です。チェーン内のその前の証明書は、CAの公開鍵を認証する証明書です。 .sp -CAθǧڤϡ¿ξ硢ʽ̾(ĤޤCAȤθǧڤ)ǤꡢϥκǽξˤʤޤˤäƤϡCAΥ֤Ȥ⤢ޤξ硢κǸξ(CAˤäƽ̾졢ȥθǧڤ)ѤϤޤ󤬡ΤξϡCSRCAȤ̤CAˤäƽ̾졢CSRCAθǧڤˤʤޤΤξϡCAθǧڤˤʤޤʲƱͤˡʽ̾줿֥롼ȡ׾ãޤǥ³ޤäơ(ǽξʸ)ƾǤϡμξν̾ԤθǧڤƤ뤳Ȥˤʤޤ +CAの公開鍵を認証する証明書は、多くの場合、自己署名証明書(つまりCAが自身の公開鍵を認証した証明書)であり、これはチェーンの最初の証明書になります。場合によっては、CAが証明書のチェーンを返すこともあります。この場合、チェーン内の最後の証明書(CAによって署名され、鍵エントリの公開鍵を認証する証明書)に変わりはありませんが、チェーン内のその前の証明書は、CSRの送信先のCAとは別のCAによって署名され、CSRの送信先のCAの公開鍵を認証する証明書になります。チェーン内のその前の証明書は、次のCAの鍵を認証する証明書になります。以下同様に、自己署名された「ルート」証明書に達するまでチェーンが続きます。したがって、チェーン内の(最初の証明書以後の)各証明書では、チェーン内の次の証明書の署名者の公開鍵が認証されていることになります。 .sp -¿CAϡ򥵥ݡȤȯԺѤξΤߤ֤ޤäˡ֤CA¸ߤʤեåȤʳع¤ξϡηǤΤ褦ʾϡȥˤǤ˳ǼƤ뿮Ǥ󤫤顢Ωɬפޤ +多くのCAは、チェーンをサポートせずに発行済の証明書のみを返します。特に、中間のCAが存在しないフラットな階層構造の場合は、その傾向が顕著です。このような場合は、キーストアにすでに格納されている信頼できる証明書情報から、証明書チェーンを確立する必要があります。 .sp -̤α(PKCS#7Ƥ)ǤϡȯԺѾ˲äΥݡȤޤޤƤޤ\fIkeytool\fRޥɤǤϡɤαⰷȤǤޤ +別の応答形式(PKCS#7で定義されている形式)では、発行済証明書に加え、証明書チェーンのサポートが含まれています。\fIkeytool\fRコマンドでは、どちらの応答形式も扱うことができます。 .sp -ȥåץ٥(롼)CAξϡʽ̾Ǥ롼Ȥθؤοϡ롼ȾΤǤϤʤʹʤ¾ΥޤϡVeriSign롼CAʤɤμ̾ѤơïǤ⼫ʽ̾Ǥ뤿Ǥ롼CAθϹΤƤޤ롼CAθ˳ǼͳϡȤˤ뤳Ȥ¿Υġ뤫ѤǤ褦ˤʤ뤫ˤޤ󡣤Ĥޤꡢϡ롼CAθ򱿤֡ΡפȤѤΤߤǤ롼CAξ򥭡ȥɲäȤϡ\fI\-printcert\fRץѤơ˾Ƥɽɽ줿ե󥬡ץȤȡʹ롼CAWebڡʤɤꤷΤΥե󥬡ץȤȤӤɬפޤ +トップレベル(ルート)CAの証明書は、自己署名証明書です。ただし、ルートの公開鍵への信頼は、ルート証明書自体からではなく、新聞など他のソースから取得されます。これは、VeriSignルートCAなどの識別名を使用して、誰でも自己署名型証明書を生成できるためです。ルートCAの公開鍵は広く知られています。ルートCAの公開鍵を証明書に格納する理由は、証明書という形式にすることで多くのツールから利用できるようになるからにすぎません。つまり、証明書は、ルートCAの公開鍵を運ぶ「媒体」として利用されるのみです。ルートCAの証明書をキーストアに追加するときは、\fI\-printcert\fRオプションを使用して、その前に証明書の内容を表示し、表示されたフィンガープリントと、新聞やルートCAのWebページなどから入手した既知のフィンガープリントとを比較する必要があります。 .RE .PP -cacertsե +cacerts証明書ファイル .RS 4 -\fIcacerts\fRȤ̾ξեϡWindowsǤϥƥץѥƥǥ쥯ȥ\fIjava\&.home\elib\esecurity\fROracle SolarisǤ\fIjava\&.home/lib/security\fR֤Ƥޤ\fIjava\&.home\fRϡ¹ԴĶΥǥ쥯ȥ(SDK\fIjre\fRǥ쥯ȥޤJREκǾ̥ǥ쥯ȥ)Ǥ +\fIcacerts\fRという名前の証明書ファイルは、Windowsではセキュリティ・プロパティ・ディレクトリ\fIjava\&.home\elib\esecurity\fR、Oracle Solarisでは\fIjava\&.home/lib/security\fRに置かれています。\fIjava\&.home\fRは、実行環境のディレクトリ(SDKの\fIjre\fRディレクトリまたはJREの最上位ディレクトリ)です。 .sp -\fIcacerts\fRեϡCAξޤࡢƥΤΥȥǤƥԤϡȥפ\fIjks\fRꤹ뤳Ȥǡ\fIkeytool\fRޥɤѤƤΥեιȴԤȤǤޤ\fIcacerts\fRȥեϡ롼CAΥǥեȡåȤޤ֤ǽв٤ƤޤǥեȤξɽˤϡΥޥɤѤޤ +\fIcacerts\fRファイルは、CAの証明書を含む、システム全体のキーストアです。システム管理者は、キーストア・タイプに\fIjks\fRを指定することで、\fIkeytool\fRコマンドを使用してこのファイルの構成と管理を行うことができます。\fIcacerts\fRキーストア・ファイルは、ルートCA証明書のデフォルト・セットを含んだ状態で出荷されています。デフォルトの証明書を一覧表示するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -1317,23 +1317,23 @@ keytool \-list \-keystore java\&.home/lib/security/cacerts .if n \{\ .RE .\} -\fIcacerts\fRȥեνѥɤϡ\fIchangeit\fRǤƥԤϡSDKΥ󥹥ȡ塢ΥեΥѥɤȥǥեȡѹɬפޤ +\fIcacerts\fRキーストア・ファイルの初期パスワードは、\fIchangeit\fRです。システム管理者は、SDKのインストール後、このファイルのパスワードとデフォルト・アクセス権を変更する必要があります。 .sp -\fB:\fR -\fIcacerts\fRեǧ뤳ȤפǤ\fIcacerts\fRեCAϡ̾¾ΥƥƥؤξȯԤΤΥƥƥȤƿꤵ뤿ᡢ\fIcacerts\fRեδϿŤ˹Ԥɬפޤ\fIcacerts\fRեˤϡꤹCAξΤߤޤޤƤɬפޤ桼ϡȤǤˤơ\fIcacerts\fRե˥Хɥ뤵Ƥ뿮Ǥ롼CA򸡾ڤ˴ؤȼηԤޤ +\fB注意:\fR +\fIcacerts\fRファイルを確認することが重要です。\fIcacerts\fRファイル内のCAは、署名および他のエンティティへの証明書発行のためのエンティティとして信頼されるため、\fIcacerts\fRファイルの管理は慎重に行う必要があります。\fIcacerts\fRファイルには、信頼するCAの証明書のみが含まれている必要があります。ユーザーは、自身の責任において、\fIcacerts\fRファイルにバンドルされている信頼できるルートCA証明書を検証し、信頼性に関する独自の決定を行います。 .sp -ǤʤCA\fIcacerts\fRե뤫ˤϡ\fIkeytool\fRޥɤ\fIdelete\fRץѤޤ\fIcacerts\fRեJREΥ󥹥ȡ롦ǥ쥯ȥˤޤΥեԽ륢ʤϡƥԤϢƤ +信頼できないCA証明書を\fIcacerts\fRファイルから削除するには、\fIkeytool\fRコマンドの\fIdelete\fRオプションを使用します。\fIcacerts\fRファイルはJREのインストール・ディレクトリにあります。このファイルを編集するアクセス権がない場合は、システム管理者に連絡してください .RE .PP -󥿡ͥåRFC 1421沽 +インターネットRFC 1421証明書符号化規格 .RS 4 -¿ξ硢ϡХʥ沽ǤϤʤ󥿡ͥåRFC 1421ʤƤϲǽ沽ѤƳǼޤBase 64沽ȤƤФ뤳ξǤϡŻҥ᡼䤽¾ε̤ơ¾Υץꥱ˾ưפ˥ݡȤǤޤ +多くの場合、証明書は、バイナリ符号化ではなく、インターネットRFC 1421規格で定義されている出力可能符号化方式を使用して格納されます。Base 64符号化とも呼ばれるこの証明書形式では、電子メールやその他の機構を通じて、他のアプリケーションに証明書を容易にエクスポートできます。 .sp -\fI\-importcert\fR\fI\-printcert\fRޥɤǤϡηξȥХʥ沽ξɤ߹ळȤǤޤ\fI\-exportcert\fRޥɤǤϡǥեȤǥХʥ沽ξ񤬽Ϥޤ\fI\-rfc\fRץꤷϡϲǽ沽ξ񤬽Ϥޤ +\fI\-importcert\fRと\fI\-printcert\fRコマンドでは、この形式の証明書とバイナリ符号化の証明書を読み込むことができます。\fI\-exportcert\fRコマンドでは、デフォルトでバイナリ符号化の証明書が出力されます。ただし、\fI\-rfc\fRオプションを指定した場合は、出力可能符号化方式の証明書が出力されます。 .sp -\fI\-list\fRޥɤǤϡǥեȤǾSHA1ե󥬡ץȤϤޤ\fI\-v\fRץ󤬻ꤵƤ硢ϿͤǤǽϤޤ\fI\-rfc\fRץ󤬻ꤵƤ硢Ͻϲǽ沽ǽϤޤ +\fI\-list\fRコマンドでは、デフォルトで証明書のSHA1フィンガープリントが出力されます。\fI\-v\fRオプションが指定されている場合、証明書は人が理解できる形式で出力されます。\fI\-rfc\fRオプションが指定されている場合、証明書は出力可能符号化方式で出力されます。 .sp -ϲǽ沽沽줿ϡΥƥȤǻϤޤꡢΥƥȤǽλޤ +出力可能符号化方式で符号化された証明書は、次のテキストで始まり、次のテキストで終了します。 .sp .if n \{\ .RS 4 @@ -1350,21 +1350,21 @@ encoded certificate goes here\&. .\} .RE .PP -X\&.500̾ +X\&.500識別名 .RS 4 -X\&.500̾ϡƥƥꤹ뤿˻ѤޤȤСX\&.509\fIsubject\fRեɤ\fIissuer\fR(̾)եɤǻꤵ̾ϡX\&.500̾Ǥ\fIkeytool\fRޥɤϡΥ֥ѡȤ򥵥ݡȤƤޤ +X\&.500識別名は、エンティティを特定するために使用されます。たとえば、X\&.509証明書の\fIsubject\fRフィールドと\fIissuer\fR(署名者)フィールドで指定される名前は、X\&.500識別名です。\fIkeytool\fRコマンドは、次のサブパートをサポートしています。 .sp -\fBcommonName\fR: Susan Jonesʤɡͤ̾Ρ +\fBcommonName\fR: Susan Jonesなど、人の通称。 .sp -\fBorganizationUnit\fR: ȿ(ݤʤ)̾ΡPurchasingʤɤǤ +\fBorganizationUnit\fR: 小さな組織(部、課など)の名称。Purchasingなどです。 .sp -\fBlocalityName\fR: ϰ(Ի)̾Palo Altoʤɡ +\fBlocalityName\fR: 地域(都市)名。Palo Altoなど。 .sp -\fBstateName\fR: ̾ޤ̾Californiaʤɡ +\fBstateName\fR: 州名または地方名。Californiaなど。 .sp -\fBcountry\fR: 2ʸι񥳡ɡCHʤɡ +\fBcountry\fR: 2文字の国コード。CHなど。 .sp -̾ʸ\fI\-dname\fRץͤȤƻꤹ(Ȥ\fI\-genkeypair\fRޥɤ)ʸϼηˤɬפޤ +識別名文字列を\fI\-dname\fRオプションの値として指定する場合(たとえば\fI\-genkeypair\fRコマンドに)、文字列は次の形式にする必要があります。 .sp .if n \{\ .RS 4 @@ -1375,7 +1375,7 @@ CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode .if n \{\ .RE .\} -åΤιܤϡºݤ˻ꤹͤɽޤû̷Υɤΰ̣ϡΤȤǤ +イタリック体の項目は、実際に指定する値を表します。短縮形のキーワードの意味は、次のとおりです。 .sp .if n \{\ .RS 4 @@ -1391,7 +1391,7 @@ C=country .if n \{\ .RE .\} -˼Τϡ̾ʸǤ +次に示すのは、識別名文字列の例です。 .sp .if n \{\ .RS 4 @@ -1402,7 +1402,7 @@ CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US .if n \{\ .RE .\} -ʸѤޥɤǤ +この文字列を使用したコマンドの例です。 .sp .if n \{\ .RS 4 @@ -1414,9 +1414,9 @@ S=California, C=US" \-alias mark .if n \{\ .RE .\} -ɤû̷ǤϡʸȾʸ϶̤ޤ󡣤ȤСCNcnCnϡɤƱΤȤưޤ +キーワードの短縮形では、大文字と小文字は区別されません。たとえば、CN、cnおよびCnは、どれも同じものとして扱われます。 .sp -ɤλˤϰ̣ꡢƥ֥ݡͥȤϾ˼ǻꤹɬפޤ֥ݡͥȤ򤹤٤ƻꤹɬפϤޤ󡣤ȤСΤ褦˰Υ֥ݡͥȤΤߤǤޤ +一方、キーワードの指定順序には意味があり、各サブコンポーネントは上に示した順序で指定する必要があります。ただし、サブコンポーネントをすべて指定する必要はありません。たとえば、次のように一部のサブコンポーネントのみを指定できます。 .sp .if n \{\ .RS 4 @@ -1427,7 +1427,7 @@ CN=Steve Meier, OU=Java, O=Oracle, C=US .if n \{\ .RE .\} -̾ʸͤ˥ޤޤޤˡޥɥ饤ʸꤹȤˤϡΤ褦˥ޤХååʸ(\e)ǥפɬפޤ +識別名文字列の値にカンマが含まれる場合に、コマンドラインで文字列を指定するときには、次のようにカンマをバックスラッシュ文字(\e)でエスケープする必要があります。 .sp .if n \{\ .RS 4 @@ -1438,14 +1438,14 @@ cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US .if n \{\ .RE .\} -̾ʸ򥳥ޥɥ饤ǻꤹɬפϤޤ󡣼̾ɬפȤ륳ޥɤ¹ԤȤˡޥɥ饤Ǽ̾ꤷʤäϡƥ֥ݡͥȤϤޤξϡޤХåå(\e)ǥפɬפϤޤ +識別名文字列をコマンドラインで指定する必要はありません。識別名を必要とするコマンドを実行するときに、コマンドラインで識別名を指定しなかった場合は、各サブコンポーネントの入力を求められます。この場合は、カンマをバックスラッシュ(\e)でエスケープする必要はありません。 .RE -.SH "ٹ" -.SS "ǤΥݡȷٹ" +.SH "警告" +.SS "信頼できる証明書のインポート警告" .PP -\fB\fR: ǤȤƾ򥤥ݡȤˡƤ򿵽ŤĴ٤Ƥ -Windows:.PP -ޤ\fI\-noprompt\fRץꤻ\fI\-printcert\fRޥɤޤ\fI\-importcert\fRޥɤѤơɽޤɽ줿Υե󥬡ץȤԤե󥬡ץȤȰפ뤳ȤǧޤȤСƤơξ\fI\etmp\ecert\fRȤ̾ǥե˳ǼƤȤޤξϡǤΥꥹȤˤξɲäˡ\fI\-printcert\fRޥɤ¹Ԥƥե󥬡ץȤɽǤޤȤСΤ褦ˤޤ +\fB重要\fR: 信頼できる証明書として証明書をインポートする前に、証明書の内容を慎重に調べてください。 +Windowsの例:.PP +まず、\fI\-noprompt\fRオプションを指定せずに\fI\-printcert\fRコマンドまたは\fI\-importcert\fRコマンドを使用して、証明書を表示します。表示された証明書のフィンガープリントが、期待されるフィンガープリントと一致することを確認します。たとえば、証明書が送られてきて、この証明書を\fI\etmp\ecert\fRという名前でファイルに格納しているとします。この場合は、信頼できる証明書のリストにこの証明書を追加する前に、\fI\-printcert\fRコマンドを実行してフィンガープリントを表示できます。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -1465,8 +1465,8 @@ Windows .if n \{\ .RE .\} -Oracle Solaris:.PP -ޤ\fI\-noprompt\fRץꤻ\fI\-printcert\fRޥɤޤ\fI\-importcert\fRޥɤѤơɽޤɽ줿Υե󥬡ץȤԤե󥬡ץȤȰפ뤳ȤǧޤȤС桼Ƥơξ\fI/tmp/cert\fRȤ̾ǥե˳ǼƤȤޤξϡǤΥꥹȤˤξɲäˡ\fI\-printcert\fRޥɤ¹Ԥƥե󥬡ץȤɽǤޤȤСΤ褦ˤޤ +Oracle Solarisの例:.PP +まず、\fI\-noprompt\fRオプションを指定せずに\fI\-printcert\fRコマンドまたは\fI\-importcert\fRコマンドを使用して、証明書を表示します。表示された証明書のフィンガープリントが、期待されるフィンガープリントと一致することを確認します。たとえば、あるユーザーから証明書が送られてきて、この証明書を\fI/tmp/cert\fRという名前でファイルに格納しているとします。この場合は、信頼できる証明書のリストにこの証明書を追加する前に、\fI\-printcert\fRコマンドを実行してフィンガープリントを表示できます。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -1487,32 +1487,32 @@ Oracle Solaris .RE .\} .PP -ˡʪϢοʪ󼨤ե󥬡ץȤȡΥޥɤɽ줿ե󥬡ץȤȤӤޤե󥬡ץȤפС¾βԤ(Ԥʤ)ˤΤؤԤƤʤȤǧǤޤǤμι⤬ԤƤ硢åԤ鷺˾򥤥ݡȤȡԤˤäƽ̾줿٤ƤΤ(Ūտޤĥ饹եޤJARեʤ)ꤹ뤳Ȥˤʤޤ +次に、証明書を送信した人物に連絡し、この人物が提示したフィンガープリントと、上のコマンドで表示されたフィンガープリントとを比較します。フィンガープリントが一致すれば、送信途中で他の何者か(攻撃者など)による証明書のすり替えが行われていないことを確認できます。送信途中でこの種の攻撃が行われていた場合、チェックを行わずに証明書をインポートすると、攻撃者によって署名されたすべてのもの(攻撃的意図を持つクラス・ファイルを含んだJARファイルなど)を信頼することになります。 .PP -\fB:\fR -򥤥ݡȤ\fI\-printcert\fRޥɤ¹ԤɬפϤޤ󡣥ȥοǤΥꥹȤ˾ɲäˡ\fI\-importcert\fRޥɤˤäƾξɽ졢ǧåɽ뤿Ǥ桼ϥݡߤǤޤ¹ԤǤΤϡ\fI\-noprompt\fRץꤻ\fI\-importcert\fRޥɤƤӽФΤߤǤ\fI\-noprompt\fRץ󤬻ꤵƤ硢桼ȤäϹԤޤ -.SS "ѥɷٹ" +\fB注意:\fR +証明書をインポートする前に\fI\-printcert\fRコマンドを実行する必要はありません。キーストア内の信頼できる証明書のリストに証明書を追加する前に、\fI\-importcert\fRコマンドによって証明書の情報が表示され、確認を求めるメッセージが表示されるためです。ユーザーはインポート操作を停止できます。ただし、これを実行できるのは、\fI\-noprompt\fRオプションを指定せずに\fI\-importcert\fRコマンドを呼び出す場合のみです。\fI\-noprompt\fRオプションが指定されている場合、ユーザーとの対話は行われません。 +.SS "パスワード警告" .PP -ȥФԤۤȤɤΥޥɤǤϡȥΥѥɤɬפǤޤΥޥɤǤϡ/̩Υѥɤɬפˤʤ뤳Ȥޤѥɤϥޥɥ饤ǻǤޤ(\fI\-storepass\fRץ\fI\-keypass\fRץ)ƥȤŪȤ硢ޤϰǤ뤳Ȥ狼äƤ륷ƥǼ¹Ԥʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤɬפʥѥɤΥץ򥳥ޥɥ饤ǻꤷʤäϡѥɤϤޤ -.SS "ν˴ؤٹ" +キーストアに対する操作を行うほとんどのコマンドでは、ストアのパスワードが必要です。また、一部のコマンドでは、非公開/秘密鍵のパスワードが必要になることがあります。パスワードはコマンドラインで指定できます(\fI\-storepass\fRオプションと\fI\-keypass\fRオプションを使用)。ただし、テストを目的とする場合、または安全であることがわかっているシステムで実行する場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。必要なパスワードのオプションをコマンドラインで指定しなかった場合は、パスワードの入力を求められます。 +.SS "証明書の準拠に関する警告" .PP -󥿡ͥåɸRFC 5280ǤϡX\&.509ν˴ؤץե뤬ƤꡢΥեɤӥƥ󥷥ͭͤͤȹ礻ܤƤޤɸˤĤƤϡ -http://tools\&.ietf\&.org/rfc/rfc5280\&.txt򻲾ȤƤ +インターネット標準RFC 5280では、X\&.509証明書の準拠に関するプロファイルが定義されており、証明書のフィールドおよびエクステンションに有効な値および値の組合せが記載されています。標準については、 +http://tools\&.ietf\&.org/rfc/rfc5280\&.txtを参照してください .PP -\fIkeytool\fRޥɤǤϡΥ롼뤹٤ƤŬѤ櫓ǤϤʤᡢɸ˽򤷤ʤǤޤɸ˽򤷤ʤϡJRE¾Υץꥱǵݤ뤳Ȥޤ桼ϡ\fI\-dname\fR\fI\-ext\fRʤɤŬʥץꤹ褦ˤƤ -.SH "" -.SS "ǤΥݡ" +\fIkeytool\fRコマンドでは、これらのルールすべてが適用されるわけではないため、標準に準拠しない証明書を生成できます。標準に準拠しない証明書は、JREや他のアプリケーションで拒否されることがあります。ユーザーは、\fI\-dname\fRや\fI\-ext\fRなどで適正なオプションを指定するようにしてください。 +.SH "注意" +.SS "新しい信頼できる証明書のインポート" .PP -\fIkeytool\fRޥɤϡȥ˾ɲäˡȥˤǤ¸ߤ뿮ǤѤơݡȤ񤫤(롼CA)ʽ̾˻ޤǤοΥιۤߤޤ +\fIkeytool\fRコマンドは、キーストアに証明書を追加する前に、キーストア内にすでに存在する信頼できる証明書を使用して、インポートする証明書から(ルートCAの)自己署名証明書に至るまでの信頼のチェーンの構築を試みます。 .PP -\fI\-trustcacerts\fRץꤷ硢ɲäξϿǤ뤹ʤ\fIcacerts\fRȤ̾Υե˴ޤޤΥȤߤʤޤ +\fI\-trustcacerts\fRオプションを指定した場合、追加の証明書は信頼できるすなわち\fIcacerts\fRという名前のファイルに含まれる証明書のチェーンとみなされます。 .PP -\fIkeytool\fRޥɤݡȤ񤫤鼫ʽ̾(ȥޤ\fIcacerts\fRե˴ޤޤƤ뼫ʽ̾)˻ޤǤοΥѥιۤ˼ԤϡݡȤξɽ桼˳ǧޤξϡɽ줿Υե󥬡ץȤȡ¾Τʤ餫(Ǥ)(νͭԤʤ)ꤷե󥬡ץȤȤӤޤǤȤƾ򥤥ݡȤȤϡͭǤ뤳Ȥ򿵽Ť˳ǧɬפޤǤΥݡȷٹ򻲾ȤƤݡϡǧߤǤޤ\fI\-noprompt\fRץ󤬻ꤵƤ硢桼ȤäϹԤޤ -.SS "Υݡ" +\fIkeytool\fRコマンドが、インポートする証明書から自己署名証明書(キーストアまたは\fIcacerts\fRファイルに含まれている自己署名証明書)に至るまでの信頼のパスの構築に失敗した場合は、インポートする証明書の情報を表示し、ユーザーに確認を求めます。この場合は、表示された証明書のフィンガープリントと、他のなんらかの(信頼できる)情報源(証明書の所有者など)から入手したフィンガープリントとを比較します。信頼できる証明書として証明書をインポートするときは、証明書が有効であることを慎重に確認する必要があります。信頼できる証明書のインポート警告を参照してください。インポート操作は、証明書を確認する時点で中止できます。\fI\-noprompt\fRオプションが指定されている場合、ユーザーとの対話は行われません。 +.SS "証明書応答のインポート" .PP -򥤥ݡȤȤϡȥοǤ񡢤(\fI\-trustcacert\fR\fIs\fRץ󤬻ꤵƤ)\fIcacerts\fRȥեǹ줿Ѥƾޤcacertsե򻲾ȤƤ +証明書応答をインポートするときは、キーストア内の信頼できる証明書、および(\fI\-trustcacert\fR\fIs\fRオプションが指定されている場合は)\fIcacerts\fRキーストア・ファイルで構成された証明書を使用して証明書応答が検査されます。cacerts証明書ファイルを参照してください。 .PP -Ǥ뤫ɤꤹˡϼΤȤǤ +証明書応答が信頼できるかどうかを決定する方法は次のとおりです。 .sp .RS 4 .ie n \{\ @@ -1522,7 +1522,7 @@ http://tools\&.ietf\&.org/rfc/rfc5280\&.txt .sp -1 .IP \(bu 2.3 .\} -ñX\&.509Ǥ硢\fIkeytool\fRޥɤϡ(롼CA)ʽ̾˻ޤǤογΩߤޤȡǧڤ˻Ѥγع¤ϡaliasοޤ󤬳Ωʤ硢ϥݡȤޤ󡣤ξ硢\fIkeytool\fRޥɤϾϤ桼˸ڤץץȤɽޤ桼οȽǤΤ񤷤Ǥ +証明書応答が単一のX\&.509証明書である場合、\fIkeytool\fRコマンドは、証明書応答から(ルートCAの)自己署名証明書に至るまでの信頼チェーンの確立を試みます。証明書応答と、証明書応答の認証に使用される証明書の階層構造は、aliasの新しい証明書チェーンを形成します。信頼チェーンが確立されない場合、証明書応答はインポートされません。この場合、\fIkeytool\fRコマンドは証明書を出力せず、ユーザーに検証を求めるプロンプトを表示します。ユーザーが証明書応答の信頼性を判断するのは非常に難しいためです。 .RE .sp .RS 4 @@ -1533,13 +1533,13 @@ http://tools\&.ietf\&.org/rfc/rfc5280\&.txt .sp -1 .IP \(bu 2.3 .\} -PKCS#7ξޤϰϢX\&.509Ǥ硢ϡ桼ξ񤬺ǽˡ0ʾCA񤬤μˤ褦¤٤ޤ󤬼ʽ̾Υ롼CAǽꡢ\fI \-trustcacerts\fRץ󤬻ꤵƤ硢\fIkeytool\fRޥɤϡξȡȥޤ\fIcacerts\fRȥեοǤ뤹٤Ƥξȹ礷褦Ȥޤ󤬼ʽ̾Υ롼CAǽäƤ餺\fI\-trustcacerts\fRץ󤬻ꤵƤ硢\fIkeytool\fRޥɤϡȥޤ\fIcacerts\fRȥեοǤ񤫤鼫ʽ̾Υ롼CA򸫤ĤƤɲä褦Ȥޤξ񤬸Ĥ餺\fI\-noprompt\fRץ󤬻ꤵƤʤϡκǸξξ󤬽Ϥ졢桼ϳǧޤ +証明書応答がPKCS#7形式の証明書チェーンまたは一連のX\&.509証明書である場合、チェーンは、ユーザーの証明書が最初に、0以上のCA証明書がその次にくるように並べられます。チェーンが自己署名のルートCA証明書で終わり、\fI \-trustcacerts\fRオプションが指定されている場合、\fIkeytool\fRコマンドは、その証明書と、キーストア内または\fIcacerts\fRキーストア・ファイル内の信頼できるすべての証明書を照合しようとします。チェーンが自己署名のルートCA証明書で終わっておらず、\fI\-trustcacerts\fRオプションが指定されている場合、\fIkeytool\fRコマンドは、キーストア内または\fIcacerts\fRキーストア・ファイル内の信頼できる証明書から自己署名のルートCA証明書を見つけてそれをチェーンの末尾に追加しようとします。その証明書が見つからず、\fI\-noprompt\fRオプションが指定されていない場合は、チェーン内の最後の証明書の情報が出力され、ユーザーは確認を求められます。 .RE .PP -θ\fIalias\fRǤǤ˳ǼƤ桼θ˰פ硢Ť󤬱ο֤ޤξͭ\fIkeypass\fR֤뤳ȤǤΤϡȥ̩ݸ뤿ΥѥɤꤷΤߤǤѥɤꤷƤ餺̩ΥѥɤȥΥѥɤȰۤʤϡ̩ΥѥɤϤޤ +証明書応答内の公開鍵が\fIalias\fRですでに格納されているユーザーの公開鍵に一致した場合、古い証明書チェーンが応答内の新しい証明書チェーンで置き換えられます。以前の証明書チェーンを有効な\fIkeypass\fRで置き換えることができるのは、エントリの秘密鍵を保護するためのパスワードを指定した場合のみです。パスワードを指定しておらず、秘密鍵のパスワードがキーストアのパスワードと異なる場合は、秘密鍵のパスワードの入力を求められます。 .PP -ΥޥɤϡΥ꡼Ǥ\fI\-import\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-importcert\fRͥ褵ޤ -.SH "Ϣ" +このコマンドは、以前のリリースでは\fI\-import\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-importcert\fRが優先されます。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -1571,8 +1571,8 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlˤ -֥: Java SEΥƥǽ +http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlにある +「コース: Java SEのセキュリティ機能」 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/native2ascii.1 b/jdk/src/linux/doc/man/ja/native2ascii.1 index f8bdb8ebd49..4ac8a594815 100644 --- a/jdk/src/linux/doc/man/ja/native2ascii.1 +++ b/jdk/src/linux/doc/man/ja/native2ascii.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: native2ascii .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ݲġ +.\" Date: 2013年11月21日 +.\" SectDesc: 国際化ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "native2ascii" "1" "2013ǯ1121" "JDK 8" "ݲġ" +.TH "native2ascii" "1" "2013年11月21日" "JDK 8" "国際化ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -native2ascii \- ݡȤƤǤդʸ󥳡ǥ󥰤ʸޤեASCIIUnicodeǥפ줿եѴ(ޤϤε)饤ǽʥץꥱޤ -.SH "" +native2ascii \- サポートされている任意の文字エンコーディングの文字を含むファイルを、ASCIIおよびUnicodeでエスケープされたファイルに変換して(またはその逆)、ローカライズ可能なアプリケーションを作成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,34 +64,34 @@ native2ascii \- .PP \fIinputfile\fR .RS 4 -ASCIIѴ륨󥳡ɤ줿ե롣 +ASCIIに変換するエンコードされたファイル。 .RE .PP \fIoutputfile\fR .RS 4 -Ѵ줿ASCIIե롣 +変換されたASCIIファイル。 .RE -.SH "" +.SH "説明" .PP -\fInative2ascii\fRޥɤϡASCII饯åȤ˴ޤޤʤ٤ƤʸUnicode(\fI\eu\fR\fIxxxx\fR)ɽˡѤơJava Runtime Environment (JRE)ǥݡȤƤ륨󥳡ɤ줿եASCIIǥ󥳡ɤ줿եѴޤΥץϡISO\-8859\-1ʸåȤ˴ޤޤʤʸޤޤƤץѥƥեɬפǤΥġϡεդѴ¹Ԥ뤳ȤǤޤ +\fInative2ascii\fRコマンドは、ASCIIキャラクタ・セットに含まれないすべての文字にUnicodeエスケープ(\fI\eu\fR\fIxxxx\fR)表記法を使用して、Java Runtime Environment (JRE)でサポートされているエンコードされたファイルを、ASCIIでエンコードされたファイルに変換します。このプロセスは、ISO\-8859\-1文字セットに含まれない文字が含まれているプロパティ・ファイルで必要です。このツールは、その逆の変換を実行することもできます。 .PP -\fIoutputfile\fRͤά硢ɸϤ˽Ϥޤˡ\fIinputfile\fRͤά硢ɸϤϤޤ -.SH "ץ" +\fIoutputfile\fR値を省略した場合、標準出力に出力されます。さらに、\fIinputfile\fR値を省略した場合、標準入力から入力されます。 +.SH "オプション" .PP \-reverse .RS 4 -դνԤޤĤޤꡢISO\-8859\-1UnicodeפѤƥ󥳡ɤ줿եJREǥݡȤʸ󥳡ǥ󥰤ΥեѴޤ +逆の処理を行います。つまり、ISO\-8859\-1でUnicodeエスケープを使用してエンコードされたファイルを、JREでサポートされる文字エンコーディングのファイルに変換します。 .RE .PP \-encoding \fIencoding_name\fR .RS 4 -ѴǻѤʸ󥳡ǥ󥰤̾ꤷޤΥץ¸ߤʤϡǥեȤʸ󥳡ǥ(\fIjava\&.nio\&.charset\&.Charset\&.defaultCharset\fR᥽åɤ줿)Ѥޤ\fIencoding_name\fRʸϡJREǥݡȤƤʸ󥳡ǥ󥰤̾ˤɬפޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.htmlˤ -֥ݡȤƤ륨󥳡ǥ󥰡פ򻲾ȤƤ +変換処理で使用する文字エンコーディングの名前を指定します。このオプションが存在しない場合は、デフォルトの文字エンコーディング(\fIjava\&.nio\&.charset\&.Charset\&.defaultCharset\fRメソッドで定義された)が使用されます。\fIencoding_name\fR文字列は、JREでサポートされている文字エンコーディングの名前にする必要があります。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.htmlにある +「サポートされているエンコーディング」を参照してください .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ(JVM)\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/orbd.1 b/jdk/src/linux/doc/man/ja/orbd.1 index 849257b14e2..8e184781bd0 100644 --- a/jdk/src/linux/doc/man/ja/orbd.1 +++ b/jdk/src/linux/doc/man/ja/orbd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: orbd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "orbd" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "orbd" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -orbd \- CORBAĶΥСˤ³֥Ȥ򥯥饤Ȥ鸡ƸƤӽФ褦ˤޤ -.SH "" +orbd \- CORBA環境のサーバーにある永続オブジェクトをクライアントから検索して呼び出せるようにします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,11 +64,11 @@ orbd \- CORBA .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIorbd\fRޥɤѤȡCORBAĶΥСˤ³֥Ȥ򥯥饤ȤƩŪ˸ƸƤӽФȤǤޤorbdġ˴ޤޤ륵Сޥ͡Ѥȡ饤ȤCORBAĶǥСˤ³֥ȤƩŪ˸ƸƤӽФȤǤޤ³Сϡ͡ߥ󥰡ӥ˱³֥ȻȤȯԤݡСΥݡֹΤORBDΥݡֹ򥪥֥ȻȤ˴ޤޤ³֥ȻȤΥ֥ȻȤORBDݡֹޤ뤳ȤˤϡΤ褦ޤ +\fIorbd\fRコマンドを使用すると、CORBA環境のサーバーにある永続オブジェクトをクライアントから透過的に検索して呼び出すことができます。orbdツールに含まれるサーバー・マネージャを使用すると、クライアントはCORBA環境でサーバー上にある永続オブジェクトを透過的に検索して呼び出すことができます。永続サーバーは、ネーミング・サービスに永続オブジェクト参照を発行する際、サーバーのポート番号のかわりにORBDのポート番号をオブジェクト参照に含めます。永続オブジェクト参照のオブジェクト参照にORBDポート番号を含めることには、次のような利点があります。 .sp .RS 4 .ie n \{\ @@ -78,7 +78,7 @@ orbd \- CORBA .sp -1 .IP \(bu 2.3 .\} -͡ߥ󥰡ӥˤ륪֥ȻȤСΥ饤ա̵طˤʤޤȤС֥ȻȤϡƥ󥹥ȡ뤵줿Ȥϥ͡ߥ󥰡ӥΥСˤäƥ͡ߥ󥰡ӥȯԤޤθϡСγϤޤϥåȥβˤ餺ƤӽФ饤ȤORBD֥ȻȤ֤ޤ +ネーミング・サービスにあるオブジェクト参照が、サーバーのライフ・サイクルと無関係になります。たとえば、オブジェクト参照は、初めてインストールされたときはネーミング・サービスのサーバーによってネーミング・サービスに発行されますが、その後は、サーバーの開始またはシャットダウンの回数にかかわらず、呼び出したクライアントにORBDが正しいオブジェクト参照を返します。 .RE .sp .RS 4 @@ -89,57 +89,57 @@ orbd \- CORBA .sp -1 .IP \(bu 2.3 .\} -饤Ȥϰ٤Τߥ͡ߥ󥰡ӥΥ֥ȻȤååפɬפޤθϥСΥ饤աˤѹȤ̵طˤλȤѤ뤳ȤǤޤ +クライアントは一度のみネーミング・サービスのオブジェクト参照をルックアップする必要がありますが、その後はサーバーのライフ・サイクルによる変更とは無関係にこの参照を利用することができます。 .RE .PP -ORBDΥСޥ͡˥ˤϡ\fIservertool\fRѤƥСưɬפޤservertoolϡץꥱ󡦥ץޤ³СϿϿưߤԤΥޥɥ饤󡦥󥿥եǤСޥ͡ξܺ٤ϡСޥ͡򻲾ȤƤ +ORBDのサーバー・マネージャにアクセスするには、\fIservertool\fRを使用してサーバーを起動する必要があります。servertoolは、アプリケーション・プログラマが、永続サーバーの登録、登録解除、起動および停止を行うためのコマンドライン・インタフェースです。サーバー・マネージャの詳細は、サーバー・マネージャを参照してください。 .PP -\fIorbd\fRưȡ͡ߥ󥰡ӥⵯưޤ͡ߥ󥰡ӥξܺ١͡ߥ󥰡ӥεưߤ򻲾ȤƤ -.SH "ץ" +\fIorbd\fRを起動すると、ネーミング・サービスも起動されます。ネーミング・サービスの詳細。ネーミング・サービスの起動と停止を参照してください。 +.SH "オプション" .PP \-ORBInitialPort \fInameserverport\fR .RS 4 -ɬܡ͡ࡦСưݡȤֹꤷޤ\fIorbd\fRϡưȡΥݡȾ忮ꥯȤꥹ˥󥰤ޤOracle SolarisեȥǤϡ1024꾮ݡȤǥץ򳫻Ϥ硢root桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ +必須。ネーム・サーバーを起動するポートの番号を指定します。\fIorbd\fRは、起動されると、このポート上で着信リクエストをリスニングします。Oracle Solarisソフトウェアでは、1024より小さいポートでプロセスを開始する場合、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。 .RE -.SS "ɬܤǤʤץ" +.SS "必須でないオプション" .PP \-port \fIport\fR .RS 4 -ORBDưݡȤꤷޤΥݡȤǡ³֥ȤФꥯȤORBDޤΥݡȤΥǥեͤ1049ǤΥݡֹϡ³Interoperable Object References (IOR)Υݡȡեɤɲäޤ +ORBDを起動するポートを指定します。このポートで、永続オブジェクトに対するリクエストをORBDが受け取ります。このポートのデフォルト値は1049です。このポート番号は、永続Interoperable Object References (IOR)のポート・フィールドに追加されます。 .RE .PP \-defaultdb \fIdirectory\fR .RS 4 -ORBD³Ǽǥ쥯ȥ\fIorb\&.db\fR١ǥ쥯ȥꤷޤΥץ󤬻ꤵƤʤ硢ǥեͤ\fI\&./orb\&.db\fRˤʤޤ +ORBD永続格納ディレクトリ\fIorb\&.db\fRが作成されるベース・ディレクトリを指定します。このオプションが指定されていない場合、デフォルト値は\fI\&./orb\&.db\fRになります。 .RE .PP \-serverPollingTime \fImilliseconds\fR .RS 4 -\fIservertool\fRѤϿ줿³СΥإ륹֤ORBDåֳ֤ꤷޤǥեͤ1000ߥäǤ\fImilliseconds\fR˻ꤹͤϡͭˤɬפޤ +\fIservertool\fRを使用して登録された永続サーバーのヘルス状態をORBDがチェックする間隔を指定します。デフォルト値は1000ミリ秒です。\fImilliseconds\fRに指定する値は、有効な正の整数にする必要があります。 .RE .PP \-serverStartupDelay milliseconds .RS 4 -\fIservertool\fRѤϿ줿³СƵưƤ顢ž㳰ޤǤORBDԵ֤ꤷޤǥեͤ1000ߥäǤ\fImilliseconds\fR˻ꤹͤϡͭˤɬפޤ +\fIservertool\fRを使用して登録された永続サーバーを再起動してから、位置転送の例外を送信するまでのORBDの待機時間を指定します。デフォルト値は1000ミリ秒です。\fImilliseconds\fRに指定する値は、有効な正の整数にする必要があります。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SS "͡ߥ󥰡ӥεư" +.SS "ネーミング・サービスの起動と停止" .PP -͡ߥ󥰡ӥϡCORBA֥Ȥ˥͡ߥ󥰤ǽˤCORBAӥǤ͡ߥ󥰤̾򥪥֥ȻȤ˥Хɤ뤳Ȥˤǽˤʤޤ͡ࡦХǥ󥰤͡ߥ󥰡ӥ˳ǼС饤Ȥ̾ꤷŪΥ֥ȻȤǤ褦ˤʤޤ +ネーミング・サービスは、CORBAオブジェクトにネーミングを可能にするCORBAサービスです。ネーミングは名前をオブジェクト参照にバインドすることにより可能になります。ネーム・バインディングをネーミング・サービスに格納すれば、クライアントが名前を指定して目的のオブジェクト参照を取得できるようになります。 .PP -饤ȤޤϥС¹ԤˡORBDưޤORBDˤϡ³͡ߥ󥰡ӥӰ͡ߥ󥰡ӥȤ߹ޤƤޤϤɤCOS͡ߥ󥰡ӥμǤ +クライアントまたはサーバーを実行する前に、ORBDを起動します。ORBDには、永続ネーミング・サービスおよび一時ネーミング・サービスが組み込まれています。これらはどちらもCOSネーミング・サービスの実装です。 .PP -³͡ߥ󥰡ӥϡ͡ߥ󥰡ƥȤФƱ³󶡤ޤĤޤꡢξϡӥߤ䵯ưˤݻ졢ӥ˾㳲ȯǤǤޤORBDƵưȡ³͡ߥ󥰡ӥϥ͡ߥ󥰡ƥȤΥդ٤ƤΥ饤ȤȥС̾ΥХǥ󥰤Τޤ(³Ū)ݻ褦ˤޤ +永続ネーミング・サービスは、ネーミング・コンテキストに対して永続性を提供します。つまり、この情報は、サービスの停止や起動後にも維持され、サービスに障害が発生した場合でも回復できます。ORBDを再起動すると、永続ネーミング・サービスはネーミング・コンテキストのグラフを復元し、すべてのクライアントとサーバーの名前のバインディングがそのまま(永続的に)保持されるようにします。 .PP -̸ߴΤᡢ꡼JDKƱƤ͡ߥ󥰡ӥ\fItnameserv\fRΥ꡼Java SEˤƱƤޤ͡ࡦӥǤϡ͡ࡦӥμ¹ˤΤߥ͡ߥ󥰡ƥȤݻޤӥǤȡ͡ߥ󥰡ƥȡդϼޤ +下位互換性のため、旧リリースのJDKに同梱されていた一時ネーミング・サービス\fItnameserv\fRが、今回のリリースのJava SEにも同梱されています。一時ネーム・サービスでは、ネーム・サービスの実行中にのみネーミング・コンテキストが保持されます。サービスが中断されると、ネーミング・コンテキスト・グラフは失われます。 .PP -\fI\-ORBInitialPort\fRϡ\fIorbd\fRɬܤΥޥɥ饤ǡ͡ߥ󥰡ӥ¹ԤݡȤֹꤹ뤿˻ѤޤμǤϡJava IDL Object Request Broker DaemonѤ˥ݡ1050ѤǤ뤳ȤȤƤޤOracle SolarisեȥѤ硢1024꾮ݡȤǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳ȤᤷޤɬפǤ̤ΥݡȤѹƤ +\fI\-ORBInitialPort\fR引数は、\fIorbd\fRの必須のコマンドライン引数で、ネーミング・サービスが実行されるポートの番号を設定するために使用されます。次の手順では、Java IDL Object Request Broker Daemon用にポート1050を使用できることを前提としています。Oracle Solarisソフトウェアを使用する場合、1024より小さいポートでプロセスを開始するには、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。必要であれば別のポートに変更してください。 .PP -UNIXޥɡ\fIorbd\fRưˤϡΤ褦Ϥޤ +UNIXコマンド・シェルで\fIorbd\fRを起動するには、次のように入力します。 .sp .if n \{\ .RS 4 @@ -151,7 +151,7 @@ orbd \-ORBInitialPort 1050& .RE .\} .PP -WindowsMS\-DOSƥࡦץץȤǤϡΤ褦Ϥޤ +WindowsのMS\-DOSシステム・プロンプトでは、次のように入力します。 .sp .if n \{\ .RS 4 @@ -163,7 +163,7 @@ start orbd \-ORBInitialPort 1050 .RE .\} .PP -ORBD¹Ԥ졢Сȥ饤ȤΥץꥱ¹ԤǤ褦ˤʤޤ饤ȤȥСΥץꥱϡ¹Իˡ͡ߥ󥰡ӥ¹ԤƤݡȤֹ(ɬפʾϤ˥ޥ̾)ǧƤɬפޤ¸1ĤˡϡΥɤ򥢥ץꥱɲä뤳ȤǤ +これでORBDが実行され、サーバーとクライアントのアプリケーションを実行できるようになります。クライアントとサーバーのアプリケーションは、実行時に、ネーミング・サービスが実行されているポートの番号(必要な場合はさらにマシン名)を認識している必要があります。これを実現する1つの方法は、次のコードをアプリケーションに追加することです。 .sp .if n \{\ .RS 4 @@ -178,7 +178,7 @@ ORB orb = ORB\&.init(args, props); .RE .\} .PP -Ǥϡ͡ߥ󥰡ӥϡۥ\fIMyHost\fRΥݡ1050Ǽ¹Ԥޤ̤ˡȤơޥɥ饤󤫤饵Сޤϥ饤ȤΥץꥱ¹ԤȤˡݡֹޤϥޥ̾뤤Ϥξꤹˡ⤢ޤȤСΥޥɥ饤󡦥ץѤơ\fIHelloApplication\fRưǤޤ +この例では、ネーミング・サービスは、ホスト\fIMyHost\fRのポート1050上で実行されます。別の方法として、コマンドラインからサーバーまたはクライアントのアプリケーションを実行するときに、ポート番号またはマシン名あるいはその両方を指定する方法もあります。たとえば、次のコマンドライン・オプションを使用して、\fIHelloApplication\fRを起動できます。 .sp .if n \{\ .RS 4 @@ -190,36 +190,36 @@ java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost .RE .\} .PP -͡ߥ󥰡ӥߤˤϡŬڤʥڥ졼ƥ󥰡ƥࡦޥɤѤޤȤСOracle Solaris\fIpkill\fR -\fIorbd\fR¹Ԥꡢ\fIorbd\fRưDOSɥ\fB[Ctrl]+[C]\fR򲡤ޤ͡ߥ󥰡ӥξϡӥλȡ͡ߥ󥰡ӥϿ줿̾õ礬ޤJava IDL͡ࡦӥϡŪߤޤǼ¹Ԥޤ +ネーミング・サービスを停止するには、適切なオペレーティング・システム・コマンドを使用します。たとえば、Oracle Solaris上で\fIpkill\fR +\fIorbd\fRを実行したり、\fIorbd\fRが動作中のDOSウィンドウで\fB[Ctrl]+[C]\fRキーを押します。一時ネーミング・サービスの場合は、サービスが終了されると、ネーミング・サービスに登録された名前が消去される場合があります。Java IDLネーム・サービスは、明示的に停止されるまで実行されます。 .PP -ORBD°͡ߥ󥰡ӥξܺ٤ϡ -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlΡNaming Serviceפ򻲾ȤƤ -.SH "Сޥ͡" +ORBDに付属するネーミング・サービスの詳細は、 +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlの「Naming Service」を参照してください +.SH "サーバー・マネージャ" .PP -ORBDΥСޥ͡˥ơ³С¹Ԥˤϡ\fIservertool\fRѤƥСưɬפޤservertoolϡץꥱ󡦥ץޤ³СϿϿưߤԤΥޥɥ饤󡦥󥿥եǤ\fIservertool\fRѤƥСưϡ\fIorbd\fR¹ԤƤƱݡȤȥۥȤǵưɬפޤСۤʤݡȤǼ¹Ԥȡ롦ƥѤ˥ǡ١¸Ƥ̵ˤʤꡢӥưޤ +ORBDのサーバー・マネージャにアクセスして、永続サーバーを実行するには、\fIservertool\fRを使用してサーバーを起動する必要があります。servertoolは、アプリケーション・プログラマが、永続サーバーの登録、登録解除、起動および停止を行うためのコマンドライン・インタフェースです。\fIservertool\fRを使用してサーバーを起動する場合は、\fIorbd\fRが実行されている場所と同じポートとホストで起動する必要があります。サーバーを異なるポートで実行すると、ローカル・コンテキスト用にデータベースに保存されている情報が無効になり、サービスが正しく動作しません。 .PP -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html -Java IDL: The "Hello World" Exampleפ򻲾ȤƤ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.htmlの +「Java IDL: The "Hello World" Example」を参照してください .PP -Ǥϡ塼ȥꥢμ˽ä\fIidlj\fRѥ\fIjavac\fRѥ¹ԤޤORBDΥСޥ͡¹Ԥˤϡμ˽äƥץꥱ¹Ԥޤ +この例では、チュートリアルの手順に従って\fIidlj\fRコンパイラと\fIjavac\fRコンパイラを実行します。ORBDのサーバー・マネージャを実行するには、次の手順に従ってアプリケーションを実行します。 .PP -\fIorbd\fRưޤ +\fIorbd\fRを起動します。 .PP -UNIXޥɡǼΤ褦Ϥޤ: -\fIorbd \-ORBInitialPort 1050\fR +UNIXコマンド・シェルで次のように入力します: +\fIorbd \-ORBInitialPort 1050\fR。 .PP -MS\-DOSƥࡦץץ(Windows)ǼΤ褦Ϥޤ: +MS\-DOSシステム・プロンプト(Windows)で次のように入力します: \fIs\fR\fItart orbd \-ORBInitialPort 105\fR\fI0\fR .PP -ݡ1050ϥ͡ࡦС¹ԤݡȤǤ\fI\-ORBInitialPort\fRץɬܥޥɥ饤ǤOracle SolarisեȥѤ硢1024꾮ݡȤǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ +ポート1050はネーム・サーバーを実行するポートです。\fI\-ORBInitialPort\fRオプションは必須コマンドライン引数です。Oracle Solarisソフトウェアを使用する場合、1024より小さいポートでプロセスを開始するには、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。 .PP -\fIservertool\fRưޤ: -\fIservertool \-ORBInitialPort 1050\fR +\fIservertool\fRを起動します: +\fIservertool \-ORBInitialPort 1050\fR。 .PP -μȥ͡ࡦС(\fIorbd\fR)ΥݡȤƱǤ뤳ȤǧޤȤ\fI\-ORBInitialPort 1050\&.\fRΤ褦ˤʤޤ\fIservertool\fRϡ͡ࡦСƱݡȾǵưɬפޤ +前回の手順とネーム・サーバー(\fIorbd\fR)のポートが同じであることを確認します。たとえば\fI\-ORBInitialPort 1050\&.\fRのようになります。\fIservertool\fRは、ネーム・サーバーと同じポート上で起動する必要があります。 .PP -\fIservertool\fRޥɥ饤󡦥󥿥եǡ\fIservertool\fRץץȤ\fIHello\fRСưޤ +\fIservertool\fRコマンドライン・インタフェースで、\fIservertool\fRプロンプトから\fIHello\fRサーバーを起動します。 .sp .if n \{\ .RS 4 @@ -232,7 +232,7 @@ servertool > register \-server HelloServer \-classpath \&. \-applicationName .RE .\} .PP -\fIservertool\fRˤäƥСϿơ\fIHelloServerApName\fRȤ̾С˳Ƥ졢ϿƤ뤹٤ƤΥСȤȤ˥СIDɽޤ¾üɥޤϥץץȤ饯饤ȡץꥱ¹Ԥޤ +\fIservertool\fRによってサーバーが登録されて、\fIHelloServerApName\fRという名前がサーバーに割り当てられ、登録されているすべてのサーバー一覧とともにサーバーIDが表示されます。他の端末ウィンドウまたはプロンプトからクライアント・アプリケーションを実行します。 .sp .if n \{\ .RS 4 @@ -244,11 +244,11 @@ java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost .RE .\} .PP -\fI\-ORBInitialHost localhost\fRϾά뤳ȤǤޤ͡ࡦС\fIHello\fR饤ȤȤƱۥȾưƤ뤫Ǥ͡ࡦС̤ΥۥȤǼ¹ԤƤϡ\-\fIORBInitialHost nameserverhost\fRץѤIDL͡ࡦС¹ԤƤۥȤꤷޤμǹԤ줿Ȥ˥͡ࡦС(\fIorbd\fR)ݡȤꤷޤ(: -\fI\-ORBInitialPort 1050\fR)ORBDΥСޥ͡λ顢͡ࡦС(\fIorbd\fR)\fIservertool\fRߤ뤫λƤMS\-DOSץץȤ\fIorbd\fR򥷥åȥ󤹤ˤϡС¹ԤƤ륦ɥ򤷤\fB[Ctrl]+[C]\fR򲡤ޤ +この例の\fI\-ORBInitialHost localhost\fRは省略することができます。ネーム・サーバーが\fIHello\fRクライアントとして同一ホスト上で動作しているからです。ネーム・サーバーが別のホストで実行されている場合は、\-\fIORBInitialHost nameserverhost\fRオプションを使用してIDLネーム・サーバーが実行されているホストを指定します。前の手順で行われたとおりにネーム・サーバー(\fIorbd\fR)ポートを指定します(例: +\fI\-ORBInitialPort 1050\fR)。ORBDのサーバー・マネージャの操作が終了したら、ネーム・サーバー(\fIorbd\fR)と\fIservertool\fRを停止するか終了してください。MS\-DOSプロンプトで\fIorbd\fRをシャットダウンするには、サーバーを実行しているウィンドウを選択して\fB[Ctrl]+[C]\fRキーを押します。 .PP -Oracle Solaris\fIorbd\fR򥷥åȥ󤹤ˤϡץ򸡺ơ\fIkill\fRޥɤǽλޤСŪߤޤǤϡƽФԵ֤³ޤ\fIservertool\fR򥷥åȥ󤹤ˤϡ\fBquit\fRϤƥܡɤ\fB[Enter]\fR򲡤ޤ -.SH "Ϣ" +Oracle Solarisから\fIorbd\fRをシャットダウンするには、プロセスを検索して、\fIkill\fRコマンドで終了します。サーバーを明示的に停止するまでは、呼出し待機状態が続きます。\fIservertool\fRをシャットダウンするには、\fBquit\fRと入力してキーボードの\fB[Enter]\fRキーを押します。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -269,8 +269,8 @@ servertool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html -Naming Service +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlの +「Naming Service」 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/pack200.1 b/jdk/src/linux/doc/man/ja/pack200.1 index e4150ab54dd..388e60d16f1 100644 --- a/jdk/src/linux/doc/man/ja/pack200.1 +++ b/jdk/src/linux/doc/man/ja/pack200.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: pack200 .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaǥץȡġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaデプロイメント・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "pack200" "1" "2013ǯ1121" "JDK 8" "Javaǥץȡġ" +.TH "pack200" "1" "2013年11月21日" "JDK 8" "Javaデプロイメント・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -pack200 \- WebǥץȤΤJARեpack200̥ե˥ѥåޤ -.SH "" +pack200 \- WebデプロイメントのためにJARファイルをpack200圧縮ファイルにパッケージします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -62,27 +62,27 @@ pack200 \- Web .RE .\} .PP -ץǤդνǻǤޤޥɥ饤ޤpropertiesե˻ꤵ줿ǸΥץ󤬡˻ꤵ줿٤ƤΥץͥ褵ޤ +オプションは任意の順序で指定できます。コマンドラインまたはpropertiesファイルに指定された最後のオプションが、それ以前に指定されたすべてのオプションより優先されます。 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIoutput\-file\fR .RS 4 -ϥե̾ +出力ファイルの名前。 .RE .PP \fIJAR\-file\fR .RS 4 -ϥե̾ +入力ファイルの名前。 .RE -.SH "" +.SH "説明" .PP -\fIpack200\fRޥɤϡJava gzipץåѤJARեpack200̥եѴJavaץꥱǤpack200եϹⰵ̤ΥեǡľܥǥץǤӰɻ֤ṳ̂ǽǤ +\fIpack200\fRコマンドは、Java gzipコンプレッサを使用してJARファイルをpack200圧縮ファイルに変換するJavaアプリケーションです。pack200ファイルは高圧縮のファイルで、直接デプロイでき、帯域幅の節約やダウンロード時間の短縮が可能です。 .PP -\fIpack200\fRޥɤˤϡ̥󥸥ĴԤץ󤬤ޤŪʻˡ򼡤˼ޤ\fImyarchive\&.pack\&.gz\fRǥեȤ\fIpack200\fRޥǺޤ +\fIpack200\fRコマンドには、圧縮エンジンの設定や微調整を行うオプションがあります。一般的な使用方法を次の例に示します。\fImyarchive\&.pack\&.gz\fRがデフォルトの\fIpack200\fRコマンド設定で作成されます。 .sp .if n \{\ .RS 4 @@ -93,11 +93,11 @@ pack200 myarchive\&.pack\&.gz myarchive\&.jar .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-r, \-\-repack .RS 4 -JARեѥå奢ѥåơJARեޤ줿ե\fIjarsigner\fR(1)ġϥեȤƻѤǤޤǤϡmyarchive\&.jarեѥå塢ѥåޤ +JARファイルをパックした後アンパックして、JARファイルを生成します。生成されたファイルは\fIjarsigner\fR(1)ツールの入力ファイルとして使用できます。次の例では、myarchive\&.jarファイルをパックした後、アンパックします。 .sp .if n \{\ .RS 4 @@ -109,12 +109,12 @@ pack200 \-\-repack myarchive\&.jar .if n \{\ .RE .\} -ǤϡϥեΥեνݻޤ +次の例では、入力ファイル内のファイルの順序を保持します。 .RE .PP \-g, \-\-no\-gzip .RS 4 -\fIpack200\fRեޤΥץꤹȤϡŬڤʰ̥ġѤɬפޤޤåȡƥǤϡб밵̲ġѤɬפޤ +\fIpack200\fRファイルを生成します。このオプションを指定するときは、適切な圧縮ツールを使用する必要があります。また、ターゲット・システムでは、対応する圧縮解除ツールを使用する必要があります。 .sp .if n \{\ .RS 4 @@ -129,104 +129,104 @@ pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar .PP \-G, \-\-strip\-debug .RS 4 -ϤǥХå°ޤˤϡ\fISourceFile\fR\fILineNumberTable\fR\fILocalVariableTable\fR\fILocalVariableTypeTable\fRޤޤޤ°Сɤȥ󥹥ȡΥϾʤޤǥХåεǽ¤ޤ +出力からデバッグ属性を削除します。これには、\fISourceFile\fR、\fILineNumberTable\fR、\fILocalVariableTable\fR、\fILocalVariableTypeTable\fRが含まれます。これらの属性を削除すれば、ダウンロードとインストールのサイズは小さくなりますが、デバッガの機能は制限されます。 .RE .PP \-\-keep\-file\-order .RS 4 -ϥեΥեνݻޤϡǥեȤưǤ +入力ファイル内のファイルの順序を保持します。これは、デフォルトの動作です。 .RE .PP \-O, \-\-no\-keep\-file\-order .RS 4 -ѥåġϡ٤ƤǤ¤ؤޤѥåġϡJARǥ쥯ȥ̾ƥɡ︺뤳ȤǤޤǥåʤɡJARեκŬǽưʤʤ뤳Ȥޤ +パック・ツールは、すべての要素を並べ替えて送信します。パック・ツールは、JARディレクトリ名を削除してダウンロード・サイズを削減することもできます。ただし、インデックスなど、特定のJARファイルの最適化機能が正常に動作しなくなることがあります。 .RE .PP \-S\fIvalue\fR, \-\-segment\-limit=\fIvalue\fR .RS 4 -ͤϡƥ֡Ȥͽۥåȡ\fIN\fR -(Хñ)Ǥñϥեɬץ\fIN\fRХȤĶȡΩȤƤޤüʥȤơͤ\fI\-1\fRξϡ٤Ƥϥեޤ礭ñΥȤ졢ͤ0ξϡ饹Ȥ˥Ȥ1Ĥޤ֡Ȥ礭ʤȡҲʤʤ갵Ψ⤯ʤޤνˤ¿Υ꡼ɬפǤ +この値は、各アーカイブ・セグメントの予想ターゲット・サイズ\fIN\fR +(バイト単位)です。単一の入力ファイルの必要サイズが\fIN\fRバイトを超えると、独立したセグメントが割り当てられます。特殊なケースとして、値が\fI\-1\fRの場合は、すべての入力ファイルを含む大きな単一のセグメントが生成され、値が0の場合は、クラスごとにセグメントが1つずつ生成されます。アーカイブ・セグメントが大きくなると、断片化が少なくなり圧縮率が高くなりますが、その処理には多くのメモリーが必要です。 .sp -ƥȤΥϡȤѴ뤽줾ϥեΥΤۤ̾¾ץѥƥΥ׻ƿ¬ޤ +各セグメントのサイズは、セグメントに変換されるそれぞれの入力ファイルのサイズのほか、その名前と他の送信されるプロパティのサイズを計算して推測されます。 .sp -ǥեȤ\-1ǤĤޤꡢѥåġñΥȽϥեޤü礭ʽϥե뤬ˤϡϥե򥻥Ȳ(ʬ)Ƥ꾮JARˤ뤳Ȥ򶯤ᤷޤ +デフォルトは\-1です。つまり、パック・ツールは単一のセグメント出力ファイルを作成します。極端に大きな出力ファイルが生成される場合には、入力ファイルをセグメント化(分割)してより小さなJARにすることを強くお薦めします。 .sp -¤ݤƤʤ10 MBJARѥåե̾10%ѥåޤѥåġǤ礭Javaҡ(Ȥ¤10)ɬפȤ⤢ޤ +この制限が課されていない10 MBのJARパック・ファイルは通常、約10%小さくパックされます。しかし、パック・ツールでより大きなJavaヒープ(セグメントの制限の約10倍)を必要とする場合もあります。 .RE .PP \-E\fIvalue\fR, \-\-effort=\fIvalue\fR .RS 4 -ñ10ʿͤꤷ硢ѥåġϡꤵ줿Ψǥ֤򰵽̤ޤ٥1ξϡŪû̻֤¿礭Υե뤬ޤ٥9ξϡĹ֤ΤΡ갵Ψι⤤ե뤬ޤü0ꤷϡ\fIpack200\fRޥɤϸJARե򰵽̤ʤľܥԡޤJSR 200ɸǤϡ٤Ƥβץब̤ʾ򥢡ΤΥѥ롼Ȳ᤹褦˵ꤷƤޤ +単一の10進数値を指定した場合、パック・ツールは、指定された圧縮率でアーカイブを圧縮します。レベル1の場合は、比較的短い圧縮時間で多少大きめのファイルが生成されますが、レベル9の場合は、非常に長い時間がかかるものの、より圧縮率の高いファイルが生成されます。特殊な値0を指定した場合は、\fIpack200\fRコマンドは元のJARファイルを圧縮なしで直接コピーします。JSR 200標準では、すべての解凍プログラムが、この特別な場合をアーカイブ全体のパススルーと解釈するように規定しています。 .sp -ǥեȤ5Ǥξ硢ɸŪʻ֤Ŭڤʰ̤Ԥޤ +デフォルトは5です。この場合、標準的な時間で適切な圧縮が行われます。 .RE .PP \-H\fIvalue\fR, \-\-deflate\-hint=\fIvalue\fR .RS 4 -Ͼ¸Ȥǥեͤ򥪡С饤ɤޤž륢֤Υ礭ʤ礬ޤǽͤϡ\fItrue\fR\fIfalse\fRޤ\fIkeep\fRǤ +入力情報を保存するというデフォルト値をオーバーライドします。転送されるアーカイブのサイズは大きくなる場合があります。指定可能な値は、\fItrue\fR、\fIfalse\fRまたは\fIkeep\fRです。 .sp -\fIvalue\fR\fItrue\fRޤfalseξ硢\fIpacker200\fRޥɤϻ˽äƥǥե졼󡦥ҥȤϥ֤ꤷޤǤθġΥǥե졼󡦥ҥȤžޤ +\fIvalue\fRが\fItrue\fRまたはfalseの場合、\fIpacker200\fRコマンドは指定に従ってデフレーション・ヒントを出力アーカイブに設定します。アーカイブ要素の個々のデフレーション・ヒントは転送されません。 .sp -\fIkeep\fRͤϡJARdzǧ줿ǥե졼󡦥ҥȤݻޤ줬ǥեȤǤ +\fIkeep\fR値は、入力JARで確認されたデフレーション・ヒントを保持します。これがデフォルトです。 .RE .PP \-m\fIvalue\fR, \-\-modification\-time=\fIvalue\fR .RS 4 -ǽͤ\fIlatest\fR\fIkeep\fRǤ +指定可能な値は\fIlatest\fRと\fIkeep\fRです。 .sp -ͤǿξ硢ѥåġϡΥ֤λѲǽʤ٤ƤΥȥΤκǽ狼ΥȤλѲǽʤ٤ƤΥȥκǽꤷ褦ȤޤñͤϥȤΰȤž졢ƥȤȥŬѤޤξ硢٤ƤΥ󥹥ȡ롦եñդꤵȤϤޤ֤ž򾯤뤳ȤǤޤ +値が最新の場合、パック・ツールは、元のアーカイブの使用可能なすべてのエントリのうちの最終更新時刻か、そのセグメントの使用可能なすべてのエントリの最終更新時刻を特定しようとします。この単一の値はセグメントの一部として転送され、各セグメントの全エントリに適用されます。この場合、すべてのインストール・ファイルに単一の日付が設定されるという問題はありますが、アーカイブの転送サイズを少し小さくすることができます。 .sp -ͤ\fIkeep\fRξ硢JARdzǧ줿ѹ֤ݻޤ줬ǥեȤǤ +値が\fIkeep\fRの場合、入力JARで確認された変更時間が保持されます。これがデフォルトです。 .RE .PP \-P\fIfile\fR, \-\-pass\-file=\fIfile\fR .RS 4 -ե򰵽̤Хñ̤ž褦˻ꤷޤΥץ֤ѤơʣΥեǤޤƥࡦե롦ѥ졼JARե롦ѥ졼Υå(/)֤ѥ̾ѴϹԤޤ󡣷̤Ȥե̾ϡʸȤΤJARեǤνиȰפƤɬפޤ\fIfile\fR˥ǥ쥯ȥ̾ꤷ硢Υǥ쥯ȥΤ٤ƤΥե뤬žޤ +ファイルを圧縮せず、バイト単位で転送するように指定します。このオプションを繰返し使用して、複数のファイルを指定できます。システム・ファイル・セパレータがJARファイル・セパレータのスラッシュ(/)に置き換えられる点を除き、パス名の変換は行われません。結果として得られるファイル名は、文字列として正確にJARファイルでの出現と一致している必要があります。\fIfile\fRにディレクトリ名を指定した場合、そのディレクトリ内のすべてのファイルが転送されます。 .RE .PP \-U\fIaction\fR, \-\-unknown\-attribute=\fIaction\fR .RS 4 -ǥեȤư򥪡С饤ɤޤĤޤꡢ°ޤ९饹ե뤬ꤷ\fIaction\fRˤäϤޤȤƻǽͤϡ\fIerror\fR\fIstrip\fRޤ\fIpass\fRǤ +デフォルトの動作をオーバーライドします。つまり、不明な属性を含むクラス・ファイルが、指定した\fIaction\fRによって渡されます。アクションとして指定可能な値は、\fIerror\fR、\fIstrip\fRまたは\fIpass\fRです。 .sp -ͤ\fIerror\fRξ硢\fIpack200\fRޥΤԤŬڤɽޤ +値が\fIerror\fRの場合、\fIpack200\fRコマンド操作全体が失敗して適切な説明が表示されます。 .sp -ͤ\fIstrip\fRξ硢°ϺޤJavaۥޥ(JVM)ɬ°ȡ饹ξ㳲ȯ뤳Ȥޤ +値が\fIstrip\fRの場合、属性は削除されます。Java仮想マシン(JVM)必須属性を削除すると、クラス・ローダーの障害が発生することがあります。 .sp -ͤ\fIpass\fRξ硢饹Τ1ĤΥ꥽Ȥžޤ +値が\fIpass\fRの場合、クラス全体が1つのリソースとして転送されます。 .RE .PP \-C\fIattribute\-name\fR=\fIlayout\fR, \-\-class\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-F\fIattribute\-name\fR=\fIlayout\fR, \-\-field\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-M\fIattribute\-name\fR=\fIlayout\fR, \-\-method\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-D\fIattribute\-name\fR=\fIlayout\fR, \-\-code\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Ҥ4ĤΥץǤϡ饹ƥƥ\fIclass\-attribute\fR\fIfield\-attribute\fR\fImethod\-attribute\fR\fIcode\-attribute\fRʤɤ°Υ쥤ȤǤޤ\fIattribute\-name\fRˤϡ줫쥤Ȥޤϥ°̾ꤷޤ\fIaction\fRȤƻǽͤϡ\fIsome\-layout\-string\fR\fIerror\fR\fIstrip\fR\fIpass\fRǤ +前述の4つのオプションでは、クラス・エンティティに\fIclass\-attribute\fR、\fIfield\-attribute\fR、\fImethod\-attribute\fRおよび\fIcode\-attribute\fRなどの属性のレイアウトを指定できます。\fIattribute\-name\fRには、これからレイアウトまたはアクションを定義する属性の名前を指定します。\fIaction\fRとして指定可能な値は、\fIsome\-layout\-string\fR、\fIerror\fR、\fIstrip\fR、\fIpass\fRです。 .sp -\fIsome\-layout\-string\fR: 쥤ȸJSR 200ͤƤޤ: -\fI\-\-class\-attribute=SourceFile=RUH\fR +\fIsome\-layout\-string\fR: レイアウト言語はJSR 200仕様で定義されています。例: +\fI\-\-class\-attribute=SourceFile=RUH\fR。 .sp -ͤ\fIerror\fRξ硢\fIpack200\fRԤɽޤ +値が\fIerror\fRの場合、\fIpack200\fR操作が失敗して説明が表示されます。 .sp -ͤ\fIstrip\fRξ硢°ϤޤVMɬ°ȥ饹ξ㳲ȯ뤳ȤޤȤС\fI\-\-class\-attribute=CompilationID=pass\fRȤ°ޤ९饹եžޤѥåġϡ¾ΥԤޤ +値が\fIstrip\fRの場合、属性が出力から削除されます。VM必須属性を削除するとクラス・ローダーの障害が発生することがあります。たとえば、\fI\-\-class\-attribute=CompilationID=pass\fRというこの属性を含むクラス・ファイルを転送します。パック・ツールは、その他のアクションを行いません。 .sp -ͤ\fIpass\fRξ硢饹Τ1ĤΥ꥽Ȥžޤ +値が\fIpass\fRの場合、クラス全体が1つのリソースとして転送されます。 .RE .PP \-f \fIpack\&.properties\fR, \-\-config\-file=\fIpack\&.properties\fR .RS 4 -ޥɥ饤ˡѥåġ뤿JavaץѥƥޤޤƤ빽եǤޤ +コマンドラインに、パック・ツールを初期化するためのJavaプロパティが含まれている構成ファイルを指定できます。 .sp .if n \{\ .RS 4 @@ -251,42 +251,42 @@ segment\&.limit=\-1 .PP \-v, \-\-verbose .RS 4 -Ǿ¤ΥåϤޤΥץʣꤹȡĹåޤ +最小限のメッセージを出力します。このオプションを複数指定すると、より長いメッセージが作成されます。 .RE .PP \-q, \-\-quiet .RS 4 -åɽư褦˻ꤷޤ +メッセージを表示せずに動作するように指定します。 .RE .PP \-l\fIfilename\fR, \-\-log\-file=\fIfilename\fR .RS 4 -ϥåΥեꤷޤ +出力メッセージのログ・ファイルを指定します。 .RE .PP \-?, \-h, \-\-help .RS 4 -Υޥɤ˴ؤإ׾Ϥޤ +このコマンドに関するヘルプ情報を出力します。 .RE .PP \-V, \-\-version .RS 4 -Υޥɤ˴ؤСϤޤ +このコマンドに関するバージョン情報を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤵ줿ץJavaۥޥϤޤܺ٤ϡjava(1)ޥɤΥե󥹡ڡ򻲾ȤƤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤ +指定されたオプションをJava仮想マシンに渡します。詳細は、java(1)コマンドのリファレンス・ページを参照してください。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。 .RE -.SH "λơ" +.SH "終了ステータス" .PP -νλ֤ͤޤ: ェλξ0顼ȯ0礭͡ -.SH "" +次の終了値が返されます: 正常終了の場合は0、エラーが発生した場合は0より大きい値。 +.SH "注意" .PP -Υޥɤ\fIpack\fR(1)ƱʤǤ\fIpack\fR\fIpack200\fRޥɤϡ̡ʤǤ +このコマンドと\fIpack\fR(1)を混同しないでください。\fIpack\fRおよび\fIpack200\fRコマンドは、別々の製品です。 .PP -JDK°Java SE APIͤȤ㤬Ĥäˤϡͤͥ褷Ƥ -.SH "Ϣ" +JDKに付属するJava SE API仕様との相違が見つかった場合には、仕様を優先してください。 +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/policytool.1 b/jdk/src/linux/doc/man/ja/policytool.1 index c724f7893be..f311dd65825 100644 --- a/jdk/src/linux/doc/man/ja/policytool.1 +++ b/jdk/src/linux/doc/man/ja/policytool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: policytool .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ƥġ +.\" Date: 2013年11月21日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "policytool" "1" "2013ǯ1121" "JDK 8" "ƥġ" +.TH "policytool" "1" "2013年11月21日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -policytool \- 桼ƥƥGUIͳǼ桼Ϥ˴Ťơץ졼󡦥ƥȤΥݥꥷեɤ߽񤭤ޤ -.SH "" +policytool \- ユーティリティGUI経由で取得したユーザー入力に基づいて、プレーン・テキストのポリシー・ファイルを読み書きします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ policytool \- .PP \-file .RS 4 -ݥꥷեɤ߹褦\fIpolicytool\fR˻ؼޤ +ポリシー・ファイルを読み込むように\fIpolicytool\fRに指示します。 .RE .PP \fIfilename\fR .RS 4 -ɤե̾ +ロードするファイルの名前。 .RE .PP -\fB\fR: +\fB例\fR: .PP -ݥꥷġ桼ƥƥ¹Ԥޤ: +ポリシー・ツール管理ユーティリティを実行します: .sp .if n \{\ .RS 4 @@ -86,7 +86,7 @@ policytool .RE .\} .PP -\fIpolicytool\fRޥɤ¹Ԥꤵ줿եɤޤ: +\fIpolicytool\fRコマンドを実行し、指定されたファイルをロードします: .sp .if n \{\ .RS 4 @@ -97,17 +97,17 @@ policytool\-file mypolicyfile .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIpolicytool\fRޥɤϡԤGUIƤӽФޤˤꡢƥԤϥ롦ݥꥷեƤǤ褦ˤʤޤݥꥷե\fI\&.policy\fRĥҤĥץ졼ƥȡեǡɥᥤ̤˥⡼ȡꥯ򸢸¥֥Ȥ˥ޥåפޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlˤ -Default Policy Implementation and Policy File Syntaxפ򻲾ȤƤ -.SH "ץ" +\fIpolicytool\fRコマンドは、管理者のGUIを呼び出します。これにより、システム管理者はローカル・ポリシー・ファイルの内容を管理できるようになります。ポリシー・ファイルは\fI\&.policy\fR拡張子を持つプレーンテキスト・ファイルで、ドメイン別にリモート・リクエスタを権限オブジェクトにマップします。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlにある +「Default Policy Implementation and Policy File Syntax」を参照してください +.SH "オプション" .PP \-file .RS 4 -ݥꥷեɤ߹褦\fIpolicytool\fR˻ؼޤ +ポリシー・ファイルを読み込むように\fIpolicytool\fRに指示します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -117,7 +117,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Default Policy Implementation and Policy File Syntax +「Default Policy Implementation and Policy File Syntax」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html) .RE .sp @@ -129,7 +129,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Policy File Creation and Management +「Policy File Creation and Management」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html) .RE .sp @@ -141,7 +141,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Permissions in Java SE Development Kit (JDK) +「Permissions in Java SE Development Kit (JDK)」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html) .RE .sp @@ -153,7 +153,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Java Security Overview +「Java Security Overview」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html) .RE .sp @@ -165,7 +165,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Java Cryptography Architecture (JCA) Reference Guide +「Java Cryptography Architecture (JCA) Reference Guide」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html) .RE .br diff --git a/jdk/src/linux/doc/man/ja/rmic.1 b/jdk/src/linux/doc/man/ja/rmic.1 index bca3b844f7b..631c0f7cdc1 100644 --- a/jdk/src/linux/doc/man/ja/rmic.1 +++ b/jdk/src/linux/doc/man/ja/rmic.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmic .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmic" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmic" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmic \- Java Remote Method Protocol (JRMP)ޤInternet Inter\-Orb protocol (IIOP)Ѥ⡼ȡ֥ȤΥ֡ȥ󤪤Tie饹ޤObject Management Group (OMG)󥿥ե(IDL)ޤ -.SH "" +rmic \- Java Remote Method Protocol (JRMP)またはInternet Inter\-Orb protocol (IIOP)を使用するリモート・オブジェクトのスタブ、スケルトンおよびTieクラスを生成します。Object Management Group (OMG)インタフェース定義言語(IDL)も生成します +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,20 +64,20 @@ rmic \- Java Remote Method Protocol (JRMP) .PP \fIoptions\fR .RS 4 -ޥɥ饤\fIץ\fRץ򻲾ȤƤ +コマンドライン・\fIオプション\fR。オプションを参照してください。 .RE .PP \fIpackage\-qualified\-class\-names\fR .RS 4 -ѥåޤ९饹̾: -\fIjava\&.awt\&.Color\fR +パッケージを含むクラス名。例: +\fIjava\&.awt\&.Color\fR。 .RE -.SH "" +.SH "説明" .PP -\fB侩˴ؤ:\fR -Java Remote Method Protocol (JRMP)֤ӥȥŪΥݡȤ侩ˤʤޤưŪJRMP֤򤫤˻ѤơJRMP١ΥץꥱˤΥġѤɬʤȤᤷޤܺ٤ϡ\fIjava\&.rmi\&.server\&.UnicastRemoteObject\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html)򻲾ȤƤ +\fB非推奨に関する注意:\fR +Java Remote Method Protocol (JRMP)スタブおよびスケルトンの静的な生成のサポートは非推奨になりました。動的に生成されるJRMPスタブをかわりに使用して、JRMPベースのアプリケーションにこのツールを使用する必要性をなくすことをお薦めします。詳細は、\fIjava\&.rmi\&.server\&.UnicastRemoteObject\fR仕様(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html)を参照してください。 .PP -\fIrmic\fRѥϡJava Remote Method Protocol (JRMP)ȥ֤Tie饹ե(IIOPץȥ)Ѥơ⡼ȡ֥ȤΥ֤ӥȥ󡦥饹եޤ⡼ȡ֥Ȥμ饹Ǥ뤳Υ饹եϡJavaץߥ󥰸Υ饹򥳥ѥ뤷Ȥޤ⡼ȼ饹ϡ\fIjava\&.rmi\&.Remote\fR󥿥ե륯饹Ǥ\fIrmic\fRޥɤǤΥ饹̾ϡΥ饹\fIjavac\fRޥɤǥѥ뤬ƤơĴѥå̾ǤɬפޤȤС˼饹ե̾\fIHelloImpl\fR\fIrmic\fRޥɤ¹Ԥȡhello֥ǥ쥯ȥ(饹Υѥå̾դ)\fIHelloImpl_Stub\&.class \fRե뤬ޤ +\fIrmic\fRコンパイラは、Java Remote Method Protocol (JRMP)とスタブおよびTieクラス・ファイル(IIOPプロトコル)を使用して、リモート・オブジェクトのスタブおよびスケルトン・クラス・ファイルを生成します。リモート・オブジェクトの実装クラスであるこれらのクラス・ファイルは、Javaプログラミング言語のクラスをコンパイルしたときに生成されます。リモート実装クラスは、\fIjava\&.rmi\&.Remote\fRインタフェースを実装するクラスです。\fIrmic\fRコマンドでのクラス名は、そのクラスが\fIjavac\fRコマンドでコンパイルが成功していて、かつ完全修飾パッケージ名である必要があります。たとえば、次に示すクラス・ファイル名\fIHelloImpl\fRで\fIrmic\fRコマンドを実行すると、helloサブディレクトリ(クラスのパッケージの名前の付いた)に\fIHelloImpl_Stub\&.class \fRファイルが作成されます。 .sp .if n \{\ .RS 4 @@ -89,31 +89,31 @@ rmic hello\&.HelloImpl .RE .\} .PP -⡼ȡ֥ȤΥȥJRMPץȥ롦С¦Υƥƥǡ⡼ȡ֥ȼƤӽФ᥽åɤޤߤޤ +リモート・オブジェクトのスケルトンはJRMPプロトコル・サーバー側のエンティティで、リモート・オブジェクト実装を呼び出すメソッドを含みます。 .PP -⡼ȡ֥ȤTieϡȥƱͤ˥С¦ΥƥƥǤIIOPץȥѤƥ饤Ȥ̿ޤ +リモート・オブジェクトのTieは、スケルトンと同様にサーバー側のエンティティですが、IIOPプロトコルを使用してクライアントと通信します。 .PP -֤Ȥϡ⡼ȡ֥ȤΥ饤¦ǤǤ֤ϡ⡼ȡ֥ȤΥ᥽åɸƽФ򡢼ʪΥ⡼ȡ֥Ȥ󤹤륵С̿ޤäơ饤ȤΥ⡼ȡ֥ȤؤλȤϡºݤϥ롦֤ؤλȤȤʤޤ +スタブとは、リモート・オブジェクトのクライアント側での代理です。スタブは、リモート・オブジェクトのメソッド呼出しを、実物のリモート・オブジェクトが常駐するサーバーと通信する役割を持ちます。したがって、クライアントのリモート・オブジェクトへの参照は、実際はローカル・スタブへの参照となります。 .PP -ǥեȤ\fIrmic\fRޥɤϡ1\&.2 JRMP֡ץȥ롦СΤߤѤ륹֡饹ޤϡ\fI\-v1\&.2\fRץꤷƱưǤ꡼5\&.0Ǥ\fI\-vcompat\fRץ󤬥ǥեȤǤIIOPץȥѤΥ֤Tie饹ˤ\fI\-iiop\fRץѤޤץ򻲾ȤƤ +デフォルトで\fIrmic\fRコマンドは、1\&.2 JRMPスタブ・プロトコル・バージョンのみを使用するスタブ・クラスを生成します。これは、\fI\-v1\&.2\fRオプションを指定した場合と同じ動作です。リリース5\&.0以前では\fI\-vcompat\fRオプションがデフォルトでした。IIOPプロトコル用のスタブおよびTieクラスを生成するには\fI\-iiop\fRオプションを使用します。オプションを参照してください。 .PP -֤ϥ⡼ȡ󥿥եΤߤ⡼ȡ֥Ȥ롦󥿥եϼƤޤJRMP֤ϥ⡼ȡ֥Ȥ⡼ȡ󥿥եƱΤƤΤǡ饤Ȥϡ㥹Ȥ䷿åJavaץߥ󥰸Ȥ߹ޤ줿黻ҤѤ뤳ȤǤޤIIOPξϡ\fIPortableRemoteObject\&.narrow\fR᥽åɤѤɬפޤ -.SH "ץ" +スタブはリモート・インタフェースのみを実装し、リモート・オブジェクトが実装するローカル・インタフェースは実装していません。JRMPスタブはリモート・オブジェクトが実装するリモート・インタフェースと同じものを実装しているので、クライアントは、キャストや型チェックにJavaプログラミング言語に組み込まれた演算子を使用することができます。IIOPの場合は、\fIPortableRemoteObject\&.narrow\fRメソッドを使用する必要があります。 +.SH "オプション" .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹եΰ֤򥪡С饤ɤޤ +ブートストラップ・クラス・ファイルの位置をオーバーライドします。 .RE .PP \-classpath path .RS 4 -\fIrmic\fRޥɤ饹õΥѥꤷޤΥץϡǥեȤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤǥ쥯ȥϥʬ䤷ޤѥΰŪʷ\fI\&.;<your_path>\fRǤ: +\fIrmic\fRコマンドがクラスを探すためのパスを指定します。このオプションは、デフォルトや\fICLASSPATH\fR環境変数設定をオーバーライドします。ディレクトリはコロンで分割します。パスの一般的な形式は\fI\&.;<your_path>\fRです。例: \fI\&.;/usr/local/java/classes\fR .RE .PP \-d \fIdirectory\fR .RS 4 -줿饹ؤνǥ쥯ȥΥ롼ȤꤷޤΥץѤȡ֡ȥ󡢤TieեǼǥ쥯ȥǤޤȤСΥޥɤMyClassƳФ줿֤ӥȥ󡦥饹ǥ쥯ȥ/java/classes/exampleclass˳Ǽޤ +生成されたクラス階層の出力先ディレクトリのルートを指定します。このオプションを使用すると、スタブ、スケルトン、およびTieファイルを格納するディレクトリを指定できます。たとえば、次のコマンドはMyClassから導出されたスタブおよびスケルトン・クラスをディレクトリ/java/classes/exampleclassに格納します。 .sp .if n \{\ .RS 4 @@ -124,25 +124,25 @@ rmic \-d /java/classes exampleclass\&.MyClass .if n \{\ .RE .\} -\fI\-d\fRץ󤬻ꤵƤʤ硢ǥեȤư\fI\-d\fRꤵƤƱǤåȡ饹ΥѥåؤߤΥǥ쥯ȥ˺졢stub/tie/skeletonե뤬ǼޤΥ꡼\fIrmic\fRޥɤǤϡ\fI\-d\fRꤵƤʤϡѥåؤϺ줺ϥեϤ٤ƸߤΥǥ쥯ȥľܳǼƤޤ +\fI\-d\fRオプションが指定されていない場合、デフォルトの動作は\fI\-d\fRが指定されていた場合と同じです。ターゲット・クラスのパッケージ階層が現在のディレクトリに作成され、stub/tie/skeletonファイルが格納されます。以前のリリースの\fIrmic\fRコマンドでは、\fI\-d\fRが指定されていない場合は、パッケージ階層は作成されず、出力ファイルはすべて現在のディレクトリに直接格納されていました。 .RE .PP \-extdirs \fIpath\fR .RS 4 -󥹥ȡѳĥǽΰ֤򥪡С饤ɤޤ +インストール済拡張機能の位置をオーバーライドします。 .RE .PP \-g .RS 4 -ѿޤह٤ƤΥǥХåޤǥեȤǤϡֹΤޤ +ローカル変数を含むすべてのデバッグ情報を生成します。デフォルトでは、行番号情報のみ生成されます。 .RE .PP \-idl .RS 4 -\fIrmic\fRޥɤˤäơꤷ饹ӻȤ줿饹OMG IDLޤIDLǤϡץߥ󥰸˰¸ˡǥ֥ȤAPIꤹ뤳ȤǤޤIDLϡ᥽åɤӥǡλͤȤƻѤޤCORBAХǥ󥰤󶡤Ǥդθǡ᥽åɤӥǡκӸƽФԤȤǤޤθˤϡJavaC++ޤޤƤޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html -Java IDL: IDL to Java Language Mappingפ򻲾ȤƤ +\fIrmic\fRコマンドによって、指定したクラスおよび参照されたクラスのOMG IDLが生成されます。IDLでは、プログラミング言語に依存せずに、宣言するだけでオブジェクトのAPIを指定することができます。IDLは、メソッドおよびデータの仕様として使用します。CORBAバインディングを提供する任意の言語で、メソッドおよびデータの作成および呼出しを行うことができます。これらの言語には、JavaおよびC++が含まれています。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlの +「Java IDL: IDL to Java Language Mapping」を参照してください .sp -\fI\-idl\fRץѤȤˤϡ¾ΥץǤޤ +\fI\-idl\fRオプションを使用するときには、他のオプションも指定できます。 .sp .RS 4 .ie n \{\ @@ -152,7 +152,7 @@ rmic \-d /java/classes exampleclass\&.MyClass .sp -1 .IP \(bu 2.3 .\} -¸Υ/Tie/IDLϥ饹⿷Ǥ⡢\fI\-always\fRޤ\fI\-alwaysgenerate\fRץϺޤ +既存のスタブ/Tie/IDLが入力クラスよりも新しい場合でも、\fI\-always\fRまたは\fI\-alwaysgenerate\fRオプションは再生成を強制します。 .RE .sp .RS 4 @@ -163,7 +163,7 @@ rmic \-d /java/classes exampleclass\&.MyClass .sp -1 .IP \(bu 2.3 .\} -\fI\-factory\fRץϡ줿IDL\fIfactory\fRɤѤޤ +\fI\-factory\fRオプションは、生成されたIDLで\fIfactory\fRキーワードを使用します。 .RE .sp .RS 4 @@ -204,9 +204,9 @@ file mapping, for example: .PP \-iiop .RS 4 -\fIrmic\fRޥɤˤäơJRMPΥ֤ȥȥ󡦥饹ΤˡIIOPΥ֤Tie饹ޤ֡饹ϡ⡼ȡ֥ȤΥ롦ץǡ饤Ȥ饵С˸ƽФȤ˻Ѥޤƥ⡼ȡ󥿥եˤϥ֡饹ɬפǤ֡饹ˤäƥ⡼ȡ󥿥եޤ饤Ȥǥ⡼ȡ֥Ȥ򻲾ȤȤϡ֤򻲾Ȥ뤳Ȥˤʤޤ饹ϡС¦ƤθƽФŬڤʼ饹˥ǥѥåȤ˻ѤޤƼ饹ˤϡ饹ɬפǤ +\fIrmic\fRコマンドによって、JRMPのスタブとスケルトン・クラスのかわりに、IIOPのスタブとTieクラスが生成されます。スタブ・クラスは、リモート・オブジェクトのローカル・プロキシで、クライアントからサーバーに呼出しを送信するときに使用されます。各リモート・インタフェースにはスタブ・クラスが必要です。スタブ・クラスによってリモート・インタフェースが実装されます。クライアントでリモート・オブジェクトを参照するときは、スタブを参照することになります。タイ・クラスは、サーバー側で着呼を処理し、その呼出しを適切な実装クラスにディスパッチするときに使用されます。各実装クラスには、タイ・クラスが必要です。 .sp -\fI\-iiop\fRѤ\fIrmic\fRޥɤƤӽФȡ̿̾§˽򤷤֤Tieޤ +\fI\-iiop\fRを使用して\fIrmic\fRコマンドを呼び出すと、次の命名規則に準拠したスタブとTieが生成されます。 .sp .if n \{\ .RS 4 @@ -227,7 +227,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-iiop\fRץѤȤˤϡ¾ΥץǤޤ +\fI\-iiop\fRオプションを使用するときには、他のオプションも指定できます。 .RE .sp .RS 4 @@ -238,7 +238,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -¸Υ/Tie/IDLϥ饹⿷Ǥ⡢\fI\-always\fRޤ\fI\-alwaysgenerate\fRץϺޤ +既存のスタブ/Tie/IDLが入力クラスよりも新しい場合でも、\fI\-always\fRまたは\fI\-alwaysgenerate\fRオプションは再生成を強制します。 .RE .sp .RS 4 @@ -249,7 +249,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-nolocalstubs\fRץǤϡƱץΥ饤ȤȥС˺Ŭ줿֤Ϻޤ +\fI\-nolocalstubs\fRオプションでは、同じプロセスのクライアントとサーバーに最適化されたスタブは作成されません。 .RE .sp .RS 4 @@ -260,7 +260,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-noValueMethods\fRץ\fI\-idl\fRץȤȤ˻Ѥɬפޤ\fI\-noValueMethods\fRץϡIDL\fIvaluetype\fR᥽åɤӽҤɲäǤʤ褦ˤޤΥ᥽åɤӽҤϡvaluetypeξϥץǤ\fI\-idl\fRץȤȤ\fI\-noValueMethods\fRץꤷʤޤ +\fI\-noValueMethods\fRオプションは\fI\-idl\fRオプションとともに使用する必要があります。\fI\-noValueMethods\fRオプションは、送信されるIDLに\fIvaluetype\fRメソッドおよび初期化子を追加できないようにします。このメソッドおよび初期化子は、valuetypeの場合はオプションです。\fI\-idl\fRオプションとともに\fI\-noValueMethods\fRオプションを指定しないかぎり生成されます。 .RE .sp .RS 4 @@ -271,57 +271,57 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-poa\fRץϷѾ\fIorg\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR\fIorg\&.omg\&.PortableServer\&.Servant\fRѹޤݡ֥롦֥ȡץ(POA)\fIPortableServer\fR⥸塼ϡͥƥ֤\fIServant\fRޤJavaץߥ󥰸Ǥϡ\fIServant\fRJava\fIorg\&.omg\&.PortableServer\&.Servant\fR饹˥ޥåפޤϡ٤ƤPOAХȼΥ١饹ȤƵǽץꥱ󡦥ץޤƤӽФȤΤǤ뤤ĤΥ᥽åɡPOAˤäƸƤӽФ졢ХȤư椹뤿˥桼С饤ɤǤ᥽åɤ󶡤ޤOMG IDL to Java Language Mapping SpecificationCORBA V 2\&.3\&.1 ptc/00\-01\-08\&.pdf˽򤷤Ƥޤ +\fI\-poa\fRオプションは継承を\fIorg\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fRから\fIorg\&.omg\&.PortableServer\&.Servant\fRに変更します。ポータブル・オブジェクト・アダプタ(POA)の\fIPortableServer\fRモジュールは、ネイティブの\fIServant\fR型を定義します。Javaプログラミング言語では、\fIServant\fR型はJavaの\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスにマップされます。これは、すべてのPOAサーバント実装のベース・クラスとして機能し、アプリケーション・プログラマが呼び出すことのできるいくつかのメソッド、およびPOAによって呼び出され、サーバントの動作を制御するためにユーザーがオーバーライドできるメソッドを提供します。OMG IDL to Java Language Mapping Specification、CORBA V 2\&.3\&.1 ptc/00\-01\-08\&.pdfに準拠しています。 .RE .RE .PP \-J .RS 4 -JavaޥɤȤȤ˻Ѥơ\fI\-J\fRץ\fI\-J\fRθ³Java󥿥ץ꥿Ϥޤ(\fI\-J\fRȰδ֤˥ڡޤ) +Javaコマンドとともに使用して、\fI\-J\fRオプションは\fI\-J\fRの後ろに続く引数をJavaインタプリタに渡します(\fI\-J\fRと引数の間にスペースは入れません)。 .RE .PP \-keep or \-keepgenerated .RS 4 -֡ȥ󡢤ޤTie饹Τ줿\fI\&.java\fRեݻ\fI\&.class\fRեƱǥ쥯ȥ˽񤭹ߤޤ +スタブ、スケルトン、またはTieクラスのために生成された\fI\&.java\fRソース・ファイルを保持し、\fI\&.class\fRファイルと同じディレクトリに書き込みます。 .RE .PP \-nowarn .RS 4 -ٹ򥪥դˤޤ\fI\-nowarn\fRץ󤬻Ѥ硣ѥϷٹɽޤ +警告をオフにします。\fI\-nowarn\fRオプションが使用される場合。コンパイラは警告を表示しません。 .RE .PP \-nowrite .RS 4 -ѥ뤷饹ե롦ƥ˽񤭹ߤޤ +コンパイルしたクラスをファイル・システムに書き込みません。 .RE .PP -\-vcompat (侩) +\-vcompat (非推奨) .RS 4 -1\&.11\&.2ξJRMP֡ץȥ롦СȸߴΤ륹֤ӥȥ󡦥饹ޤ5\&.0Υ꡼ǤϤΥץ󤬥ǥեȤǤ줿֡饹ϡJDK 1\&.1ۥޥ˥ɤ1\&.1֡ץȥ롦СѤJDK 1\&.2ʹߤβۥޥ˥ɤ1\&.2֡ץȥ롦СѤޤ줿ȥ󡦥饹Ǥϡ1\&.11\&.2ξΥ֡ץȥ롦С򥵥ݡȤޤ줿饹ξ⡼ɤ򥵥ݡȤ뤿ˡ礭ʤޤ:Υץ侩ˤʤޤ򻲾ȤƤ +1\&.1と1\&.2の両方のJRMPスタブ・プロトコル・バージョンと互換性のあるスタブおよびスケルトン・クラスを作成します。5\&.0以前のリリースではこのオプションがデフォルトでした。生成されたスタブ・クラスは、JDK 1\&.1仮想マシンにロードされると1\&.1スタブ・プロトコル・バージョンを使用し、JDK 1\&.2以降の仮想マシンにロードされると1\&.2スタブ・プロトコル・バージョンを使用します。生成されたスケルトン・クラスでは、1\&.1と1\&.2の両方のスタブ・プロトコル・バージョンをサポートします。生成されたクラスは両方の操作モードをサポートするために、サイズが大きくなります。注意:このオプションは非推奨になりました。説明を参照してください。 .RE .PP \-verbose .RS 4 -ѥ󥫡ѥ뤵Ƥ륯饹ɤƤ륯饹եˤĤƤΥåɽ褦ˤޤ +コンパイラやリンカーが、コンパイルされているクラスやロードされているクラス・ファイルについてのメッセージを表示するようにします。 .RE .PP -\-v1\&.1 (侩) +\-v1\&.1 (非推奨) .RS 4 -1\&.1 JRMP֡ץȥ롦СΤߤΥ֤ӥȥ󡦥饹ޤ\fI\-v1\&.1\fRץѤǤΤϡJDK 1\&.1\fIrmic\fRޥɤ졢åץ졼ɤǤʤ(˥ʥߥå饹ǥ󥰤ѤƤʤ)¸Ūǥץ줿֡饹Фľ󲽸ߴΤ륹֡饹ΤߤǤ:Υץ侩ˤʤޤ򻲾ȤƤ +1\&.1 JRMPスタブ・プロトコル・バージョンのみのスタブおよびスケルトン・クラスを生成します。\fI\-v1\&.1\fRオプションを使用できるのは、JDK 1\&.1から\fIrmic\fRコマンドで生成され、アップグレードできない(さらにダイナミック・クラス・ローディングを使用していない)、既存の静的デプロイされたスタブ・クラスに対し、直列化互換性のあるスタブ・クラスを生成する場合のみです。注意:このオプションは非推奨になりました。説明を参照してください。 .RE .PP -\-v1\&.2 (侩) +\-v1\&.2 (非推奨) .RS 4 -(ǥե)1\&.2 JRMP֡ץȥ롦СΤߤΥ֡饹ޤȥ󡦥饹1\&.2֡ץȥ롦СǻѤǤʤᡢȥ󡦥饹ޤ줿֡饹ϡJDK 1\&.1ۥޥ˥ɤƤưޤ:Υץ侩ˤʤޤ򻲾ȤƤ +(デフォルト)1\&.2 JRMPスタブ・プロトコル・バージョンのみのスタブ・クラスを生成します。スケルトン・クラスは1\&.2スタブ・プロトコル・バージョンで使用できないため、スケルトン・クラスは生成されません。生成されたスタブ・クラスは、JDK 1\&.1仮想マシンにロードされても動作しません。注意:このオプションは非推奨になりました。説明を参照してください。 .RE -.SH "Ķѿ" +.SH "環境変数" .PP CLASSPATH .RS 4 -桼饹ؤΥѥ򥷥ƥ˻ꤷޤǥ쥯ȥϥǶڤޤ: +ユーザー定義クラスへのパスをシステムに指定します。ディレクトリはコロンで区切られます。例: \fI\&.:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/rmid.1 b/jdk/src/linux/doc/man/ja/rmid.1 index 1ee27efb1a9..0a7492ef174 100644 --- a/jdk/src/linux/doc/man/ja/rmid.1 +++ b/jdk/src/linux/doc/man/ja/rmid.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmid .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmid" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmid" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmid \- ưƥࡦǡ򳫻Ϥȡ֥ȤJavaۥޥ(VM)ϿƥƥֲǤ褦ˤʤޤ -.SH "" +rmid \- 起動システム・デーモンを開始すると、オブジェクトをJava仮想マシン(VM)に登録してアクティブ化できるようになります。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,13 +64,13 @@ rmid \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIrmid\fRޥɤϡưƥࡦǡ򳫻Ϥޤưƥࡦǡ򳫻ϤƤǤʤȡƥֲǽ֥Ȥ򥢥ƥֲƥϿꡢJVMǥƥֲꤹ뤳ȤǤޤ󡣥ƥֲǽʥ֥ȤѤץκˡξܺ٤ϡ\fIƥֲλ\fR˴ؤ塼ȥꥢ(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html)򻲾ȤƤ +\fIrmid\fRコマンドは、起動システム・デーモンを開始します。起動システム・デーモンを開始してからでないと、アクティブ化可能オブジェクトをアクティブ化システムに登録したり、JVM内でアクティブ化したりすることができません。アクティブ化可能なオブジェクトを使用するプログラムの作成方法の詳細は、\fIアクティブ化の使用\fRに関するチュートリアル(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html)を参照してください .PP -\fIrmid\fRޥɤ¹ԤΤ褦˥ƥݥꥷեꤷơǡưޤ +\fIrmid\fRコマンドを実行し、次のようにセキュリティ・ポリシー・ファイルを指定して、デーモンを起動します。 .sp .if n \{\ .RS 4 @@ -82,11 +82,11 @@ rmid \-J\-Djava\&.security\&.policy=rmid\&.policy .RE .\} .PP -\fIrmid\fRޥɤOracleμ¹Ԥ硢ǥեȤǤϡƥݥꥷեꤹɬפޤϡ\fIrmid\fRޥɤư롼ѤJVMư뤿˳\fIActivationGroupDesc\fRξѤǤ뤫ɤ򸡾ڤǤ褦ˤ뤿Ǥäˡ\fIActivationGroupDesc\fR󥹥ȥ饯Ϥ\fICommandEnvironment\fRǤդΥץѥƥˤäƻꤵ륳ޥɤӥץϡ\fIrmid\fRޥɤΥƥݥꥷեŪ˵Ĥ뤳Ȥɬפˤʤޤ\fIsun\&.rmi\&.activation\&.execPolicy\fRץѥƥͤϡư롼ѤJVMư뤿\fIActivationGroupDesc\fRξѤǤ뤫ɤȽǤȤ\fIrmid\fRޥɤѤݥꥷꤷޤܺ٤ϡ\-J\-Dsun\&.rmi\&.activation\&.execPolicy=policyץ򻲾ȤƤ +\fIrmid\fRコマンドのOracleの実装を実行する場合、デフォルトでは、セキュリティ・ポリシー・ファイルを指定する必要があります。それは、\fIrmid\fRコマンドが起動グループ用にJVMを起動するために各\fIActivationGroupDesc\fR内の情報を使用できるかどうかを検証できるようにするためです特に、\fIActivationGroupDesc\fRコンストラクタに渡される\fICommandEnvironment\fRや任意のプロパティによって指定されるコマンドおよびオプションは、\fIrmid\fRコマンドのセキュリティ・ポリシー・ファイルの中で明示的に許可することが必要になりました。\fIsun\&.rmi\&.activation\&.execPolicy\fRプロパティの値は、起動グループ用にJVMを起動するために\fIActivationGroupDesc\fR内の情報を使用できるかどうかを判断するときに\fIrmid\fRコマンドが使用するポリシーを決定します。詳細は、\-J\-Dsun\&.rmi\&.activation\&.execPolicy=policyオプションの説明を参照してください。 .PP -\fIrmid\fRޥɤ¹Ԥȡǥեȡݡ1098ǥƥ١쥸ȥ꤬ư졢\fIActivationSystem\fR쥸ȥ̾\fIjava\&.rmi\&.activation\&.ActivationSystem\fR˥Хɤޤ +\fIrmid\fRコマンドを実行すると、デフォルト・ポート1098でアクティベータと内部レジストリが起動され、\fIActivationSystem\fRがこの内部レジストリ内の名前\fIjava\&.rmi\&.activation\&.ActivationSystem\fRにバインドされます。 .PP -쥸ȥ¾ΥݡȤꤹˤϡ\fIrmid\fRޥɤμ¹Ի\fI\-port\fRץꤹɬפޤȤСΥޥɤϡ쥸ȥΥǥեȡݡ1099ǡưƥࡦǡȥ쥸ȥưޤ +レジストリに他のポートを指定するには、\fIrmid\fRコマンドの実行時に\fI\-port\fRオプションを指定する必要があります。たとえば、次のコマンドは、レジストリのデフォルト・ポート1099で、起動システム・デーモンとレジストリを起動します。 .sp .if n \{\ .RS 4 @@ -97,15 +97,15 @@ rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099 .if n \{\ .RE .\} -.SH "ɬפ˱RMID򳫻" +.SH "必要に応じてRMIDを開始" .PP -\fIrmid\fR򥳥ޥɥ饤󤫤鳫Ϥˤϡ\fIinetd\fR -(Oracle Solarisξ)ޤ\fIxinetd\fR -(Linuxξ)\fIrmid\fRɬפ˱ƳϤˡ⤢ޤ +\fIrmid\fRをコマンドラインから開始するには、\fIinetd\fR +(Oracle Solarisの場合)、または\fIxinetd\fR +(Linuxの場合)を構成して\fIrmid\fRを必要に応じて開始する方法もあります。 .PP -RMID򳫻Ϥȡ\fISystem\&.inheritedChannel\fR᥽åɤƤӽФơѾ줿ͥ(\fIinetd\fR/\fIxinetd\fRѾ)褦ȤޤѾ줿ͥ뤬nullǤ뤫\fIjava\&.nio\&.channels\&.ServerSocketChannel\fRΥ󥹥󥹤Ǥʤä硢RMIDϤΥͥ\fIinetd\fR/\fIxinetd\fRˤäƵư줿ΤǤϤʤȽǤҤΤ褦˵ưޤ +RMIDを開始すると、\fISystem\&.inheritedChannel\fRメソッドを呼び出して、継承されたチャンネル(\fIinetd\fR/\fIxinetd\fRから継承)を取得しようとします。継承されたチャンネルがnullであるか、\fIjava\&.nio\&.channels\&.ServerSocketChannel\fRのインスタンスでなかった場合、RMIDはそのチャンネルは\fIinetd\fR/\fIxinetd\fRによって起動されたものではないと判断し、前述のように起動します。 .PP -Ѿ줿ͥ뤬\fIServerSocketChannel\fR󥹥󥹤ǤϡRMIDϥݡȤ⡼ȡ֥ȡĤޤ\fIjava\&.rmi\&.activation\&.ActivationSystem\fRХɤƤ쥸ȥ\fIjava\&.rmi\&.activation\&.Activator\fR⡼ȡ֥ȤФꥯȤ륵СåȤȤơ\fIServerSocketChannel\fR\fIjava\&.net\&.ServerSocket\fRѤޤΥ⡼ɤǤϡRMIDưϡΤȤơޥɥ饤󤫤鵯ưƱǤ +継承されたチャンネルが\fIServerSocketChannel\fRインスタンスである場合は、RMIDはエクスポートするリモート・オブジェクト、つまり\fIjava\&.rmi\&.activation\&.ActivationSystem\fRがバインドされているレジストリと\fIjava\&.rmi\&.activation\&.Activator\fRリモート・オブジェクトに対するリクエストを受信するサーバー・ソケットとして、\fIServerSocketChannel\fRから取得した\fIjava\&.net\&.ServerSocket\fRを使用します。このモードでは、RMIDの動作は、次のことを除いて、コマンドラインから起動した場合と同じです。 .sp .RS 4 .ie n \{\ @@ -115,7 +115,7 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fISystem\&.err\fRФϤϡե˥쥯Ȥ롣Υե\fIjava\&.io\&.tmpdir\fRƥࡦץѥƥǻꤵǥ쥯ȥ(̾\fI/var/tmp\fRޤ\fI/tmp\fR)ˤ롣ե̾Ƭ\fIrmid\-err\fRǡ\fItmp\fRǤ롣 +\fISystem\&.err\fRに対する出力は、ファイルにリダイレクトされる。このファイルは\fIjava\&.io\&.tmpdir\fRシステム・プロパティで指定されるディレクトリ(通常は\fI/var/tmp\fRまたは\fI/tmp\fR)にある。ファイル名の接頭辞は\fIrmid\-err\fRで、接尾辞は\fItmp\fRである。 .RE .sp .RS 4 @@ -126,7 +126,7 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fI\-port\fRץϻѤǤޤ󡣤Υץ󤬻ꤵƤ硢RMIDϥ顼åɽƽλޤ +\fI\-port\fRオプションは使用できません。このオプションが指定されている場合、RMIDはエラー・メッセージが表示されて終了します。 .RE .sp .RS 4 @@ -137,17 +137,17 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fI\-log\fRץɬܡΥץ󤬻ꤵƤʤ硢RMIDϥ顼åɽƽλޤ +\fI\-log\fRオプションは必須。このオプションが指定されていない場合、RMIDはエラー・メッセージが表示されて終了します。 .RE .PP -ɬפ˱ƥӥ򳫻Ϥ褦˹ˡξܺ٤ϡ\fIinetd\fR -(Oracle Solarisξ)ޤ\fIxinetd\fR -(Linux)Υޥ˥奢롦ڡ򻲾ȤƤ -.SH "ץ" +必要に応じてサービスを開始するように構成する方法の詳細は、\fIinetd\fR +(Oracle Solarisの場合)、または\fIxinetd\fR +(Linux)のマニュアル・ページを参照してください。 +.SH "オプション" .PP -\-C\fIץ\fR +\-C\fIオプション\fR .RS 4 -\fIrmid\fRޥɤλҥץ(ư롼)줿Ȥˡ줾λҥץ˥ޥɥ饤ȤϤ륪ץꤷޤȤСΤ褦˻ꤹȡưƥࡦǡˤäƲۥޥ˥ץѥƥϤȤǤޤ +\fIrmid\fRコマンドの子プロセス(起動グループ)が作成されたときに、それぞれの子プロセスにコマンドライン引数として渡されるオプションを指定します。たとえば、次のように指定すると、起動システム・デーモンによって生成される各仮想マシンにプロパティを渡すことができます。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ rmid \-C\-Dsome\&.property=value .if n \{\ .RE .\} -ޥɥ饤ҥץϤǽϡǥХåԤǤȤСΥޥɤǤϡ٤ƤλJVMserver\-call󥰤ǽǤ +コマンドライン引数を子プロセスに渡す機能は、デバッグを行う場合に便利です。たとえば、次のコマンドでは、すべての子JVMでserver\-callロギングが可能です。 .sp .if n \{\ .RS 4 @@ -173,7 +173,7 @@ rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true .PP \-J\fIoption\fR .RS 4 -RMID¹ԤƤJava󥿥ץ꥿ϤץꤷޤȤС\fIrmid\fRޥɤ\fIrmid\&.policy\fRȤ̾ΥݥꥷեѤ褦˻ꤹˤϡ\fIrmid\fRΥޥɥ饤\fI\-J\fRץѤơ\fIjava\&.security\&.policy\fRץѥƥޤ򼨤ޤ +RMIDを実行しているJavaインタプリタに渡すオプションを指定します。たとえば、\fIrmid\fRコマンドが\fIrmid\&.policy\fRという名前のポリシー・ファイルを使用するように指定するには、\fIrmid\fRのコマンドラインで\fI\-J\fRオプションを使用して、\fIjava\&.security\&.policy\fRプロパティを定義します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -188,7 +188,7 @@ rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy .PP \-J\-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR .RS 4 -ư롼פ¹Ԥ뤳ȤˤʤJVMεư˻Ѥ륳ޥɤӥޥɥ饤󡦥ץå뤿ˡRMIDѤݥꥷꤷޤΥץϡJava RMIưǡOracleμΤߤ¸ߤ뤳ȤդƤޥɥ饤ˤΥץѥƥꤷʤ硢̤\fI\-J\-Dsun\&.rmi\&.activation\&.execPolicy=default\fRꤷƱˤʤޤ\fIpolicy\fR˻ǽͤϡ\fIdefault\fR\fIpolicyClassName\fRޤ\fInone\fRǤ +起動グループが実行されることになるJVMの起動に使用するコマンドおよびコマンドライン・オプションをチェックするために、RMIDが採用するポリシーを指定します。このオプションは、Java RMI起動デーモンのOracleの実装のみに存在することに注意してください。コマンドラインにこのプロパティを指定しない場合、結果は\fI\-J\-Dsun\&.rmi\&.activation\&.execPolicy=default\fRを指定した場合と同じになります。\fIpolicy\fRに指定可能な値は、\fIdefault\fR、\fIpolicyClassName\fRまたは\fInone\fRです。 .sp .RS 4 .ie n \{\ @@ -198,35 +198,35 @@ rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy .sp -1 .IP \(bu 2.3 .\} -ǥե +デフォルト .sp -\fIdefault\fRޤ̤ͤ\fIexecPolicy\fRξ硢\fIrmid\fRޥɤ¹ԤǤΤϡ\fIrmid\fRޥɤѤ륻ƥݥꥷեǡ¹Ԥ븢¤\fIrmid\fRͿƤ륳ޥɤӥޥɥ饤󡦥ץΤߤǤǥեȤμ¹ԥݥꥷǻѤǤΤϡǥեȤεư롼׼ΤߤǤ +\fIdefault\fRまたは未指定値の\fIexecPolicy\fRの場合、\fIrmid\fRコマンドが実行できるのは、\fIrmid\fRコマンドが使用するセキュリティ・ポリシー・ファイルの中で、実行する権限が\fIrmid\fRに与えられているコマンドおよびコマンドライン・オプションのみです。デフォルトの実行ポリシーで使用できるのは、デフォルトの起動グループ実装のみです。 .sp -\fIrmid\fRޥɤϡư롼ѤJVMưȤˡΥ롼פˤĤϿ줿ư롼׵һҤǤ\fIActivationGroupDesc\fRξѤޤ롼׵һҤϡ\fIActivationGroupDesc\&.CommandEnvironment\fRꤷޤ(άǽ)ˤϡư롼פ򳫻Ϥ륳ޥɤȡΥޥɥ饤ɲäǤ륳ޥɥ饤󡦥ץ󤬴ޤޤƤޤǥեȤǤϡ\fIrmid\fRޥɤ\fIjava\&.home\fRˤ\fIjava\fRޥɤѤޤ롼׵һҤˤϡޥɥ饤˥ץȤɲäץѥƥС饤ɤޤޤޤ(\fI\-D<property>=<value>\fRȤޤ)\fIcom\&.sun\&.rmi\&.rmid\&.ExecPermission\fR¤\fIrmid\fRޥɤˡư롼פ򳫻Ϥ뤿˥롼׵һҤ\fICommandEnvironment\fRǻꤵ줿ޥɤ¹Ԥ븢¤Ϳޤ\fIcom\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR¤ϵư롼פγϻˡ롼׵һҤǥץѥƥС饤ɤȤơޤ\fICommandEnvironment\fRǥץȤƻꤵ줿ޥɥ饤󡦥ץ\fIrmid\fRޥɤѤ뤳ȤĤޤ\fIrmid\fRޥɤ͡ʥޥɤӥץ¹Ԥ븢¤Ϳ硢\fIExecPermission\fR\fIExecOptionPermission\fR򤹤٤ƤΥɡͿɬפޤ +\fIrmid\fRコマンドは、起動グループ用のJVMを起動するときに、そのグループについて登録された起動グループ記述子である\fIActivationGroupDesc\fR内の情報を使用します。グループ記述子は、\fIActivationGroupDesc\&.CommandEnvironment\fRを指定します(省略可能)。これには、起動グループを開始するコマンドと、そのコマンドラインに追加できるコマンドライン・オプションが含まれています。デフォルトでは、\fIrmid\fRコマンドは\fIjava\&.home\fRにある\fIjava\fRコマンドを使用します。グループ記述子には、コマンドラインにオプションとして追加されるプロパティ・オーバーライドも含まれます(\fI\-D<property>=<value>\fRとして定義されます)。\fIcom\&.sun\&.rmi\&.rmid\&.ExecPermission\fR権限は\fIrmid\fRコマンドに、起動グループを開始するためにグループ記述子の\fICommandEnvironment\fRで指定されたコマンドを実行する権限を付与します。\fIcom\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR権限は起動グループの開始時に、グループ記述子でプロパティ・オーバーライドとして、または\fICommandEnvironment\fRでオプションとして指定されたコマンドライン・オプションを、\fIrmid\fRコマンドが使用することを許可します。\fIrmid\fRコマンドに様々なコマンドおよびオプションを実行する権限を付与する場合、権限\fIExecPermission\fRおよび\fIExecOptionPermission\fRをすべてのコード・ソースに付与する必要があります。 .sp \fBExecPermission\fR .sp -\fIExecPermission\fR饹ϡư롼פ򳫻Ϥ뤿\fIrmid\fRޥɤΥޥɤ¹Ԥ븢¤ɽޤ +\fIExecPermission\fRクラスは、起動グループを開始するために\fIrmid\fRコマンドが特定のコマンドを実行する権限を表します。 .sp -\fBʸ\fR: -\fIExecPermission\fR̾ϡ\fIrmid\fRޥɤ˼¹ԤĤ륳ޥɤΥѥ̾Ǥå(/)ӥꥹ(*)ǽѥ̾ϡΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥե򼨤ޤåϥեڤʸ\fIFile\&.separatorChar\fRǤå(/)ӥޥʥ(\-)ǽѥ̾ϡΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥեȥ֥ǥ쥯ȥ(ƵŪ)򼨤ޤѥ̤̾ʥȡ\fI<<ALL FILES>>\fRꤷϡǤդΥե򼨤ޤ +\fB構文\fR: +\fIExecPermission\fRの名前は、\fIrmid\fRコマンドに実行を許可するコマンドのパス名です。スラッシュ(/)およびアスタリスク(*)で終わるパス名は、そのディレクトリに含まれるすべてのファイルを示します。スラッシュはファイル区切り文字\fIFile\&.separatorChar\fRです。スラッシュ(/)およびマイナス符号(\-)で終わるパス名は、そのディレクトリに含まれるすべてのファイルとサブディレクトリ(再帰的に)を示します。パス名に特別なトークン\fI<<ALL FILES>>\fRを指定した場合は、任意のファイルを示します。 .sp -ѥ̾˥ꥹ(*)ꤷϡߤΥǥ쥯ȥΤ٤ƤΥե򼨤ޤѥ̾˥ޥʥ(\-)ꤷϡߤΥǥ쥯ȥΤ٤ƤΥե뤪(ƵŪ)ߤΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥեȥ֥ǥ쥯ȥ򼨤ޤ +パス名にアスタリスク(*)を指定した場合は、現在のディレクトリ内のすべてのファイルを示します。パス名にマイナス符号(\-)を指定した場合は、現在のディレクトリ内のすべてのファイルおよび(再帰的に)現在のディレクトリに含まれるすべてのファイルとサブディレクトリを示します。 .sp \fBExecOptionPermission\fR .sp -\fIExecOptionPermission\fR饹ϡư롼פ򳫻ϤȤ\fIrmid\fRޥɤΥޥɥ饤󡦥ץѤǤ븢¤ɽޤ\fIExecOptionPermission\fR̾ϡޥɥ饤󡦥ץͤǤ +\fIExecOptionPermission\fRクラスは、起動グループを開始するときに\fIrmid\fRコマンドで特定のコマンドライン・オプションを使用できる権限を表します。\fIExecOptionPermission\fRの名前は、コマンドライン・オプションの値です。 .sp -\fBʸ\fR: ץǤϡ磻ɥɤŪ˥ݡȤޤꥹϡ磻ɥɡޥåɽޤꥹ(*)ϡץ̾ΤΤȤƻѤǤޤĤޤꡢǤդΥץɽȤǤޤޤץ̾˻Ѥ뤳ȤǤޤɥå(\&.)(=)ľ˥ꥹ(*)ꤹɬפޤ +\fB構文\fR: オプションでは、ワイルドカードが限定的にサポートされます。アスタリスクは、ワイルドカード・マッチを表します。アスタリスク(*)は、オプション名そのものとして使用できます。つまり、任意のオプションを表すことができます。また、オプション名の末尾に使用することもできます。ただし、ドット(\&.)か等号(=)の直後にアスタリスク(*)を指定する必要があります。 .sp -: -\fI*\fR\fI\-Dmydir\&.*\fR\fI\-Da\&.b\&.c=*\fRͭǤ\fI*mydir\fR\fI\-Da*b\fR\fIab*\fR̵Ǥ +例: +\fI*\fRや\fI\-Dmydir\&.*\fRや\fI\-Da\&.b\&.c=*\fRは有効ですが、\fI*mydir\fRや\fI\-Da*b\fRや\fIab*\fRは無効です。 .sp -\fBrmidΥݥꥷե\fR +\fBrmidのポリシー・ファイル\fR .sp -\fIrmid\fRޥɤ͡ʥޥɤӥץ¹Ԥ븢¤Ĥϡ\fIExecPermission\fR\fIExecOptionPermission\fR򤹤٤ƤΥɡͿɬפޤ(Ū)θ¤åΤ\fIrmid\fRޥɤΤߤʤΤǡθ¤ŪͿƤǤ +\fIrmid\fRコマンドに様々なコマンドおよびオプションを実行する権限を許可する場合は、権限\fIExecPermission\fRおよび\fIExecOptionPermission\fRをすべてのコード・ソースに付与する必要があります(汎用的に)。これらの権限をチェックするのは\fIrmid\fRコマンドのみなので、これらの権限を汎用的に付与しても安全です。 .sp -\fIrmid\fRޥɤ˳Ƽμ¹Ը¤Ϳݥꥷե򡢼˼ޤ +\fIrmid\fRコマンドに各種の実行権限を付与するポリシー・ファイルの例を、次に示します。 .sp .if n \{\ .RS 4 @@ -252,11 +252,11 @@ grant { .if n \{\ .RE .\} -ǽͿƤ븢¤ϡ\fIrmid\fRޥɤФѥ̾ˤŪ˻ꤵ\fIjava\fRޥɤ1\&.7\&.0꡼μ¹ԤĤޤǥեȤǤϡ\fIjava\&.home\fRˤС\fIjava\fRޥɤѤޤ\fIrmid\fRޥɤѤΤƱС󤬻Ѥ뤿ᡢΥޥɤϡݥꥷեǻꤹɬפϤޤ2ܤθ¤ϡ\fIrmid\fRޥɤФơǥ쥯ȥ\fI/files/apps/rmidcmds\fRǤդΥޥɤμ¹Ը¤Ĥޤ +最初に付与されている権限は、\fIrmid\fRコマンドに対し、パス名により明示的に指定される\fIjava\fRコマンドの1\&.7\&.0リリースの実行を許可します。デフォルトでは、\fIjava\&.home\fRにあるバージョンの\fIjava\fRコマンドを使用します。\fIrmid\fRコマンドが使用するのと同じバージョンが使用されるため、そのコマンドは、ポリシー・ファイルで指定する必要はありません。2番目の権限は、\fIrmid\fRコマンドに対して、ディレクトリ\fI/files/apps/rmidcmds\fR内の任意のコマンドの実行権限を許可します。 .sp -3ܤͿƤ븢\fIExecOptionPermission\fRϡ\fIrmid\fRޥɤФơƥݥꥷե\fI/files/policies/group\&.policy\fRȤƤ뵯ư롼פγϤĤޤθ¤ϡư롼פ\fIjava\&.security\&.debug property\fRѤ뤳ȤĤƤޤǸθ¤ϡư롼פ\fIsun\&.rmi property\fR̾γǤդΥץѥƥѤ뤳ȤĤƤޤ +3番目に付与されている権限\fIExecOptionPermission\fRは、\fIrmid\fRコマンドに対して、セキュリティ・ポリシー・ファイルを\fI/files/policies/group\&.policy\fRとして定義している起動グループの開始を許可します。次の権限は、起動グループが\fIjava\&.security\&.debug property\fRを使用することを許可しています。最後の権限は、起動グループが\fIsun\&.rmi property\fR名の階層内の任意のプロパティを使用することを許可しています。 .sp -ݥꥷեꤷ\fIrmid\fRޥɤưˤϡ\fIrmid\fRΥޥɥ饤\fIjava\&.security\&.policy\fRץѥƥꤹɬפޤ򼨤ޤ +ポリシー・ファイルを指定して\fIrmid\fRコマンドを起動するには、\fIrmid\fRのコマンドラインで\fIjava\&.security\&.policy\fRプロパティを指定する必要があります。次に例を示します。 .sp \fIrmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fR\&. .RE @@ -271,9 +271,9 @@ grant { .\} <policyClassName> .sp -ǥեȤưǤϽʬʽʤ硢Ԥϡ\fIrmid\fRεưˡ\fIcheckExecCommand\fR᥽åɤ°륯饹̾ꤷơ\fIrmid\fRޥɤ¹Ԥ륳ޥɤå뤳ȤǤޤ +デフォルトの動作では十分な柔軟性が得られない場合、管理者は、\fIrmid\fRの起動時に、\fIcheckExecCommand\fRメソッドが所属するクラスの名前を指定して、\fIrmid\fRコマンドが実行するコマンドをチェックすることができます。 .sp -\fIpolicyClassName\fRˤϡʤΥ󥹥ȥ饯Τ褦\fIcheckExecCommand\fR᥽åɤƤpublic饹ꤷޤ +\fIpolicyClassName\fRには、引数なしのコンストラクタを持ち、次のような\fIcheckExecCommand\fRメソッドを実装しているpublicクラスを指定します。 .sp .if n \{\ .RS 4 @@ -285,7 +285,7 @@ grant { .if n \{\ .RE .\} -ư롼פ򳫻Ϥˡ\fIrmid\fRޥɤϡݥꥷ\fIcheckExecCommand\fR᥽åɤƤӽФޤΤȤư롼פεһҤȡư롼פ򳫻Ϥ뤿δʥޥɤޤ򤽤Υ᥽åɤϤޤ\fIcheckExecCommand\fR\fISecurityException\fR򥹥ȡ\fIrmid\fRޥɤϤεư롼פ򳫻Ϥ֥ȤεưԤƤƽФ¦ˤ\fIActivationException\fRޤ +起動グループを開始する前に、\fIrmid\fRコマンドは、ポリシーの\fIcheckExecCommand\fRメソッドを呼び出します。このとき、起動グループの記述子と、起動グループを開始するための完全なコマンドを含む配列をそのメソッドに渡します。\fIcheckExecCommand\fRが\fISecurityException\fRをスローすると、\fIrmid\fRコマンドはその起動グループを開始せず、オブジェクトの起動を試行している呼出し側には\fIActivationException\fRがスローされます。 .RE .sp .RS 4 @@ -298,18 +298,18 @@ grant { .\} none .sp -\fIsun\&.rmi\&.activation\&.execPolicy\fRץѥƥͤ\fInone\fRξ硢\fIrmid\fRޥɤϡư롼פ򳫻Ϥ륳ޥɤޤäڤޤ +\fIsun\&.rmi\&.activation\&.execPolicy\fRプロパティの値が\fInone\fRの場合、\fIrmid\fRコマンドは、起動グループを開始するコマンドをまったく検証しません。 .RE .RE .PP \-log \fIdir\fR .RS 4 -ưƥࡦǡ󤬥ǡ١ӴϢ񤭹Τ˻Ѥǥ쥯ȥ̾ꤷޤǥեȤǤϡ\fIrmid\fRޥɤ¹Ԥǥ쥯ȥˡlogȤǥ쥯ȥ꤬ޤ +起動システム・デーモンがデータベースおよび関連情報を書き込むのに使用するディレクトリの名前を指定します。デフォルトでは、\fIrmid\fRコマンドを実行したディレクトリに、logというログ・ディレクトリが作成されます。 .RE .PP \-port \fIport\fR .RS 4 -쥸ȥ꤬ѤݡȤꤷޤưƥࡦǡϡΥ쥸ȥǡ\fIjava\&.rmi\&.activation\&.ActivationSystem\fRȤ̾\fIActivationSystem\fRХɤޤ롦ޥ\fIActivationSystem\fRϡΤ褦\fINaming\&.lookup\fR᥽åɤƤӽФȤˤäƼǤޤ +レジストリが使用するポートを指定します。起動システム・デーモンは、このレジストリの中で、\fIjava\&.rmi\&.activation\&.ActivationSystem\fRという名前で\fIActivationSystem\fRをバインドします。ローカル・マシン上の\fIActivationSystem\fRは、次のように\fINaming\&.lookup\fRメソッドを呼び出すことによって取得できます。 .sp .if n \{\ .RS 4 @@ -328,16 +328,16 @@ import java\&.rmi\&.*; .PP \-stop .RS 4 -\fI\-port\fRץˤäƻꤵ줿ݡȤΡߤ\fIrmid\fRޥɤθƽФߤޤݡȤꤵƤʤϡΥץϥݡ1098Ǽ¹ԤƤ\fIrmid\fRθƽФߤޤ +\fI\-port\fRオプションによって指定されたポートの、現在の\fIrmid\fRコマンドの呼出しを停止します。ポートが指定されていない場合は、このオプションはポート1098で実行されている\fIrmid\fRの呼出しを停止します。 .RE -.SH "Ķѿ" +.SH "環境変数" .PP CLASSPATH .RS 4 -桼饹ؤΥѥ򥷥ƥ˻ꤷޤǥ쥯ȥϥǶڤޤ: +ユーザー定義クラスへのパスをシステムに指定します。ディレクトリはコロンで区切られます。例: \fI\&.:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/rmiregistry.1 b/jdk/src/linux/doc/man/ja/rmiregistry.1 index 2786a5b1a3c..ab4e85d5caf 100644 --- a/jdk/src/linux/doc/man/ja/rmiregistry.1 +++ b/jdk/src/linux/doc/man/ja/rmiregistry.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmiregistry .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmiregistry" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmiregistry" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmiregistry \- ߤΥۥȤλꤷݡȾ˥⡼ȡ֥ȡ쥸ȥ򳫻Ϥޤ -.SH "" +rmiregistry \- 現在のホストの指定したポート上にリモート・オブジェクト・レジストリを開始します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,11 +64,11 @@ rmiregistry \- .PP \fIport\fR .RS 4 -⡼ȡ֥ȡ쥸ȥ򳫻Ϥ븽ߤΥۥȾ\fIport\fRο +リモート・オブジェクト・レジストリを開始する現在のホスト上の\fIport\fRの数。 .RE -.SH "" +.SH "説明" .PP -\fIrmiregistry\fRޥɤϡߤΥۥȤλꤷݡȾ˥⡼ȡ֥ȡ쥸ȥϤޤportλά硢쥸ȥϥݡ1099dzϤޤ\fIrmiregistry\fRޥɤˡϵǽϤޤ̾ϥХå饦ɤǼ¹Ԥޤ򼨤ޤ +\fIrmiregistry\fRコマンドは、現在のホストの指定したポート上にリモート・オブジェクト・レジストリを作成し、開始します。portの指定を省略した場合、レジストリはポート1099で開始します。\fIrmiregistry\fRコマンドに、出力機能はありません。通常、これはバックグラウンドで実行されます。次に例を示します。 .sp .if n \{\ .RS 4 @@ -80,20 +80,20 @@ rmiregistry & .RE .\} .PP -⡼ȡ֥ȡ쥸ȥϡ֡ȥȥåפΥ͡ࡦӥǤƱۥȤRMIС⡼ȡ֥Ȥ̾˥Хɤ뤿˻Ѥޤˡ뤪ӥ⡼ȡۥȤΥ饤Ȥϥ⡼ȡ֥Ȥ򸡺⡼ȡ᥽åɤθƽФԤޤ +リモート・オブジェクト・レジストリは、ブートストラップのネーム・サービスです。同一ホストのRMIサーバーが、リモート・オブジェクトを名前にバインドするために使用されます。次に、ローカルおよびリモート・ホストのクライアントはリモート・オブジェクトを検索し、リモート・メソッドの呼出しを行います。 .PP -쥸ȥϡŪˡǽΥ⡼ȡ֥Ȥΰ֤ꤷޤǡץꥱϥ᥽åɤƤӽФɬפޤθ塢Υ֥ȤϥץꥱΥݡȤ󶡤¾Υ֥Ȥõޤ +レジストリは、一般的に、最初のリモート・オブジェクトの位置を指定します。そこで、アプリケーションはメソッドを呼び出す必要があります。その後、そのオブジェクトはアプリケーション指定のサポートを提供し、他のオブジェクトを探します。 .PP -\fIjava\&.rmi\&.registry\&.LocateRegistry\fR饹Υ᥽åɤϡ롦ۥȡޤϥ롦ۥȤȥݡȤư쥸ȥ뤿˻Ѥޤ +\fIjava\&.rmi\&.registry\&.LocateRegistry\fRクラスのメソッドは、ローカル・ホスト、またはローカル・ホストとポートで動作するレジストリを取得するために使用されます。 .PP -\fIjava\&.rmi\&.Naming\fR饹URL١᥽åɤϥ쥸ȥФ¹ԤǤդΥۥȤӥ롦ۥȤǤΥ⡼ȡ֥Ȥθ˻ѤǤޤñ̾(ʸ)⡼ȡ֥Ȥ˥Хɤ̾⡼ȡ֥Ȥ˺ƥХɤ(ŤХɤ򥪡С饤)⡼ȡ֥Ȥ򥢥Хɤ쥸ȥ˥ХɤƤURLꥹɽޤ -.SH "ץ" +\fIjava\&.rmi\&.Naming\fRクラスのURLベース・メソッドはレジストリに対して操作を実行し、任意のホストおよびローカル・ホストでのリモート・オブジェクトの検索に使用できます。単純名(文字列)をリモート・オブジェクトにバインドし、新しい名前をリモート・オブジェクトに再バインドし(古いバインドをオーバーライド)、リモート・オブジェクトをアンバインドし、レジストリにバインドされているURLをリスト表示します。 +.SH "オプション" .PP \-J .RS 4 -JavaץȤȤ˻Ѥơ\fI\-J\fRθ³ץJava󥿥ץ꥿˰Ϥޤ(\fI\-J\fRȥץδ֤˥ڡޤ) +Javaオプションとともに使用して、\fI\-J\fRの後ろに続くオプションをJavaインタプリタに引き渡します(\fI\-J\fRとオプションの間にスペースは入れません)。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -114,7 +114,7 @@ java(1) .sp -1 .IP \(bu 2.3 .\} -\fIjava\&.rmi\&.registry\&.LocateRegistry\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html) +\fI「java\&.rmi\&.registry\&.LocateRegistry」\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html) .RE .sp .RS 4 @@ -125,7 +125,7 @@ java(1) .sp -1 .IP \(bu 2.3 .\} -\fIjava\&.rmi\&.Naming class description\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html) +\fI「java\&.rmi\&.Naming class description」\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html) .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/schemagen.1 b/jdk/src/linux/doc/man/ja/schemagen.1 index 60deab8308d..63a7b4a9f97 100644 --- a/jdk/src/linux/doc/man/ja/schemagen.1 +++ b/jdk/src/linux/doc/man/ja/schemagen.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: schemagen .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "schemagen" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "schemagen" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -schemagen \- Java饹ǻȤƤ͡ॹڡȤ˥ޤޤ -.SH "" +schemagen \- Javaクラス内で参照されているネームスペースごとにスキーマを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,19 +64,19 @@ schemagen \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIjava\-files\fR .RS 4 -Java饹ե롣 +処理するJavaクラス・ファイル。 .RE -.SH "" +.SH "説明" .PP -ޡͥ졼ϡJava饹ǻȤƤ͡ॹڡȤ1ĤΥޡեޤߡ륹ޡե̾Ǥޤ󡣥ޡե̾椹ϡhttp://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.htmlˤ -Using SchemaGen with Antפ򻲾ȤƤ +スキーマ・ジェネレータは、Javaクラス内で参照されているネームスペースごとに1つのスキーマ・ファイルを作成します。現在、生成されるスキーマ・ファイルの名前は制御できません。スキーマ・ファイル名を制御する場合は、http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.htmlにある +「Using SchemaGen with Ant」を参照してください .PP -ץåȥեbinǥ쥯ȥˤŬڤ\fIschemagen\fR롦ץȤѤơޡͥ졼ưޤߤΥޡͥ졼ϡJavaեȥ饹եΤǤޤ +プラットフォームのbinディレクトリにある適切な\fIschemagen\fRシェル・スクリプトを使用して、スキーマ・ジェネレータを起動します。現在のスキーマ・ジェネレータは、Javaソース・ファイルとクラス・ファイルのいずれも処理できます。 .sp .if n \{\ .RS 4 @@ -89,44 +89,44 @@ Note: Writing schema1\&.xsd .RE .\} .PP -javaե뤬¾Υ饹򻲾ȤƤ硢Υ饹˥ƥ\fICLASSPATH\fRĶѿǥǤɬפޤޤϡ饹ѥץꤷ\fIschemagen\fRޥɡ饤ǻꤹɬפޤץ򻲾ȤƤȤե˥ǤʤޤϻȤե뤬ꤵƤʤ硢ޤ˥顼ɽޤ -.SH "ץ" +javaファイルが他のクラスを参照している場合、それらのクラスにシステム\fICLASSPATH\fR環境変数でアクセスできる必要があります。または、クラス・パス・オプションを指定して\fIschemagen\fRコマンド・ラインで指定する必要があります。オプションを参照してください。参照されるファイルにアクセスできない、または参照されるファイルが指定されていない場合、スキーマの生成時にエラーが表示されます。 +.SH "オプション" .PP \-d \fIpath\fR .RS 4 -\fIschemagen\fRޥɤץå\fIjavac\fR饹ե֤ꡣ +\fIschemagen\fRコマンドがプロセッサ生成および\fIjavac\fR生成クラス・ファイルを配置する場所。 .RE .PP \-cp \fIpath\fR .RS 4 -\fIschemagen\fRޥɤ桼ե֤ꡣ +\fIschemagen\fRコマンドがユーザー指定ファイルを配置する場所。 .RE .PP \-classpath \fIpath\fR .RS 4 -\fIschemagen\fRޥɤ桼ե֤ꡣ +\fIschemagen\fRコマンドがユーザー指定ファイルを配置する場所。 .RE .PP \-encoding \fIencoding\fR .RS 4 -\fIapt\fRޤ\fIjavac\fRޥɤθƽФ˻Ѥ륨󥳡ǥ󥰤ꤷޤ +\fIapt\fRまたは\fIjavac\fRコマンドの呼出しに使用するエンコーディングを指定します。 .RE .PP \-episode \fIfile\fR .RS 4 -ѥ뤴Ȥ˥ԥɡեޤ +コンパイルごとにエピソード・ファイルを生成します。 .RE .PP \-version .RS 4 -꡼ɽޤ +リリース情報を表示します。 .RE .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/serialver.1 b/jdk/src/linux/doc/man/ja/serialver.1 index e527c1694f4..bb78803ecdd 100644 --- a/jdk/src/linux/doc/man/ja/serialver.1 +++ b/jdk/src/linux/doc/man/ja/serialver.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: serialver .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "serialver" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "serialver" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -serialver \- ꤷ饹Υꥢ롦СUIDᤷޤ -.SH "" +serialver \- 指定したクラスのシリアル・バージョンUIDを戻します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,35 +64,35 @@ serialver \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassnames\fR .RS 4 -\fIserialVersionUID\fR᤹饹Ǥ +\fIserialVersionUID\fRを戻すクラスです。 .RE -.SH "" +.SH "説明" .PP -\fIserialver\fRޥɤϡ1İʾΥ饹\fIserialVersionUID\fRŸƤ륯饹إԡΤŬ֤ޤʤǸƤӽФ줿硢\fIserialver\fRޥɤϻΨԤϤޤ -.SH "ץ" +\fIserialver\fRコマンドは、1つ以上のクラスの\fIserialVersionUID\fRを、展開しているクラスへコピーするのに適した形式で返します。引数なしで呼び出された場合、\fIserialver\fRコマンドは使用率行を出力します。 +.SH "オプション" .PP \-classpath \fIpath\-files\fR .RS 4 -ץꥱΥ饹ӥ꥽θѥꤷޤ饹ȥ꥽򥳥(:)Ƕڤޤ +アプリケーションのクラスおよびリソースの検索パスを設定します。クラスとリソースをコロン(:)で区切ります。 .RE .PP \-show .RS 4 -ñʥ桼󥿥եɽޤΥ饹̾ϤơEnterɽץܥ򲡤\fIserialVersionUID\fRɽޤ +簡単なユーザー・インタフェースを表示します。完全指定のクラス名を入力して、Enterキーか「表示」ボタンを押し、\fIserialVersionUID\fRを表示します。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" +.SH "注意" .PP -\fIserialver\fRޥɤϡꤵ줿饹򤽤βۥޥɤ߹ǽޤǥեȤǤϥƥޥ͡ϹԤޤ󡣿Ǥʤ饹ȤȤ\fIserialver\fRޥɤ¹ԤˤϡΥץѤƥƥޥ͡Ǥޤ +\fIserialver\fRコマンドは、指定されたクラスをその仮想マシン内に読み込んで初期化しますが、デフォルトではセキュリティ・マネージャの設定は行いません。信頼できないクラスとともに\fIserialver\fRコマンドを実行する場合には、次のオプションを使用してセキュリティ・マネージャを設定できます。 .sp .if n \{\ .RS 4 @@ -104,7 +104,7 @@ Java .RE .\} .PP -ɬפǤСΥץѤƥƥݥꥷǤޤ +必要であれば、次のオプションを使用してセキュリティ・ポリシーを指定できます。 .sp .if n \{\ .RS 4 @@ -115,7 +115,7 @@ Java .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -136,8 +136,8 @@ policytool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.htmlˤ -\fIjava\&.io\&.ObjectStream\fR饹 +http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.htmlにある +\fIjava\&.io\&.ObjectStream\fRクラス記述 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/servertool.1 b/jdk/src/linux/doc/man/ja/servertool.1 index 71ab6b65ed1..fd37f508938 100644 --- a/jdk/src/linux/doc/man/ja/servertool.1 +++ b/jdk/src/linux/doc/man/ja/servertool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: servertool .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "servertool" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "servertool" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -servertool \- ȯԤ³СϿϿưߤ뤿λȤ䤹桼󥿥ե󶡤ޤ -.SH "" +servertool \- 開発者が永続サーバーを登録、登録解除、起動、停止するための使いやすいユーザー・インタフェースを提供します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,35 +64,35 @@ servertool \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP commands .RS 4 -ޥɥ饤󡦥ޥɡޥɤ򻲾ȤƤ +コマンドライン・コマンド。コマンドを参照してください。 .RE .PP \fIservertool\fR\fIservertool >\fR\fIservertool >\fR -.SH "" +.SH "説明" .PP -\fIservertool\fRޥɤϡȯԤ³СϿϿưߤ뤿Υޥɥ饤󡦥󥿥ե󶡤ޤޥɥ饤󡦥ޥɤѤȡС˴ؤ͡׾Ǥޤޥɤ򻲾ȤƤ -.SH "ץ" +\fIservertool\fRコマンドは、開発者が永続サーバーを登録、登録解除、起動、停止するためのコマンドライン・インタフェースを提供します。コマンドライン・コマンドを使用すると、サーバーに関する様々な統計情報を取得できます。コマンドを参照してください。 +.SH "オプション" .PP \-ORBInitialHost \fInameserverhost\fR .RS 4 -ΥץɬܤǤ͡ࡦС¹Ԥ졢忮ꥯȤꥹ˥󥰤ۥȡޥꤷޤ\fInameserverhost\fRͤϡ\fIorb\fR¹Ԥ졢ꥯȤꥹ˥󥰤ƤݡȤꤹɬפޤΥץꤷʤ硢ͤϥǥեȤ\fIlocalhost\fRꤵޤ\fIorbd\fR\fIservertool\fRۤʤޥǼ¹ԤƤϡ\fIorbd\fR¹ԤƤۥȤ̾ޤIPɥ쥹ꤹɬפޤ +このオプションは必須です。ネーム・サーバーが実行され、着信リクエストをリスニングするホスト・マシンを指定します。\fInameserverhost\fR値は、\fIorb\fRが実行され、リクエストをリスニングしているポートを指定する必要があります。このオプションを指定しない場合、値はデフォルトで\fIlocalhost\fRに設定されます。\fIorbd\fRと\fIservertool\fRが異なるマシン上で実行されている場合は、\fIorbd\fRが実行されているホストの名前またはIPアドレスを指定する必要があります。 .sp -\fB:\fR -Oracle SolarisǤϡ1024꾮ݡȾǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤ\fInameserverport\fRͤˤϡ1024ʾΥݡֹѤ뤳Ȥᤷޤ +\fB注意:\fR +Oracle Solarisでは、1024より小さいポート上でプロセスを開始するには、rootユーザーになる必要があります。\fInameserverport\fR値には、1024以上のポート番号を使用することをお薦めします。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ޥ" +.SH "コマンド" .PP -\fIservertool\fRޥɤϡޥɥ饤󡦥ޥɤѤơޤϻѤ˵ưǤޤ +\fIservertool\fRコマンドは、コマンドライン・コマンドを使用して、または使用せずに起動できます。 .sp .RS 4 .ie n \{\ @@ -102,8 +102,8 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIservertool\fRεư˥ޥɤꤷʤä硢ޥɥ饤󡦥ġ˥ޥϤ\fIservertool\fRץץȤɽޤ: -\fIservertool >\fR +\fIservertool\fRの起動時にコマンドを指定しなかった場合、コマンドライン・ツールにコマンド入力を求める\fIservertool\fRプロンプトが表示されます: +\fIservertool >\fR。 .RE .sp .RS 4 @@ -114,75 +114,75 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIservertool\fRεư˥ޥɤꤷ硢Java IDL Server Toolưƥޥɤ¹Ԥλޤ +\fIservertool\fRの起動時にコマンドを指定した場合、Java IDL Server Toolが起動してコマンドを実行し、終了します。 .RE .PP register \-server \fIserver\-class\-name\fR \-classpath \fIclasspath\-to\-server\fR [ \-applicationName \fIapplication\-name\fR \-args \fIargs\-to\-server\fR \-vmargs \fIflags\-for\-JVM\fR ] .RS 4 -Object Request Broker Daemon (ORBD)˿³СϿޤС̤Ͽξ硢ϿƥƥֲޤΥޥɤˤäơ\fI\-server\fRץǼ̤륵С\fIᥤ\fR饹ǥ󥹥ȡ롦᥽åɤƤӽФޤΥ󥹥ȡ롦᥽åɤϡ\fIpublic static void install(org\&.omg\&.CORBA\&.ORB)\fRˤʤäƤɬפޤ󥹥ȡ롦᥽åɤϥץǤꡢȯԤϥǡ١ޤκʤȼΥС󥹥ȡưǤޤ +Object Request Broker Daemon (ORBD)に新規永続サーバーを登録します。サーバーが未登録の場合、登録してアクティブ化します。このコマンドによって、\fI\-server\fRオプションで識別されるサーバーの\fIメイン\fR・クラス内でインストール・メソッドが呼び出されます。このインストール・メソッドは、\fIpublic static void install(org\&.omg\&.CORBA\&.ORB)\fRになっている必要があります。インストール・メソッドはオプションであり、開発者はデータベース・スキーマの作成など独自のサーバー・インストール動作を指定できます。 .RE .PP unregister \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR .RS 4 -СIDޤϥץꥱ̾ǡСORBDϿޤΥޥɤˤäơ\fI\-server\fRץǼ̤륵С\fIᥤ\fR饹ǥ󥤥󥹥ȡ롦᥽åɤƤӽФޤ -\fIuninstall\fR᥽åɤϡ\fIpublic static void uninstall(org\&.omg\&.CORBA\&.ORB)\fRˤʤäƤɬפޤ\fIuninstall\fR᥽åɤϥץǤꡢȯԤ\fIinstall\fR᥽åɤưμäʤɡȼΥС󥤥󥹥ȡưǤޤ +サーバーIDまたはアプリケーション名で、サーバーをORBDから登録解除します。このコマンドによって、\fI\-server\fRオプションで識別されるサーバーの\fIメイン\fR・クラス内でアンインストール・メソッドが呼び出されます。 +\fIuninstall\fRメソッドは、\fIpublic static void uninstall(org\&.omg\&.CORBA\&.ORB)\fRになっている必要があります。\fIuninstall\fRメソッドはオプションであり、開発者は\fIinstall\fRメソッドの動作の取消など、独自のサーバー・アンインストール動作を指定できます。 .RE .PP getserverid \-applicationName \fIapplication\-name\fR .RS 4 -\fIapplication\-name\fRͤб륵СID֤ޤ +\fIapplication\-name\fR値に対応するサーバーIDを返します。 .RE .PP list .RS 4 -ORBDϿƤ뤹٤Ƥα³С˴ؤɽޤ +ORBDに登録されているすべての永続サーバーに関する情報を一覧表示します。 .RE .PP listappnames .RS 4 -ORBDϿƤ뤹٤ƤΥСΥץꥱ̾ɽޤ +現在ORBDに登録されているすべてのサーバーのアプリケーション名を一覧表示します。 .RE .PP listactive .RS 4 -ORBDˤäƵư졢߼¹ԤƤ뤹٤Ƥα³С˴ؤɽޤ +ORBDによって起動され、現在実行されているすべての永続サーバーに関する情報を一覧表示します。 .RE .PP locate \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR [ \-endpointType \fIendpointType\fR ] .RS 4 -Ͽ줿СǺ٤ƤORBΥפˤĤƥɥݥ(ݡ)򸡽ФޤС¹ԤƤʤ硢ƥֲޤ\fIendpointType\fRͤꤵƤʤ硢СORBȤ˴ϢդƤplainפޤnon\-protectedפΥɥݥȤ֤ޤ +登録されたサーバーで作成したすべてのORBの特定のタイプについてエンドポイント(ポート)を検出します。サーバーが実行されていない場合、アクティブ化されます。\fIendpointType\fR値が指定されていない場合、サーバーのORBごとに関連付けられているplainタイプまたはnon\-protectedタイプのエンドポイントが返されます。 .RE .PP locateperorb \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR [ \-orbid \fIORB\-name\fR ] .RS 4 -Ͽ줿СObject Request Broker (ORB)Ͽ줿ɥݥ(ݡ)򸡽ФޤС¹ԤƤʤ硢ƥֲޤ\fIorbid\fRꤵƤʤ硢ǥեͤ\fI""\fR\fIorbid\fR˳ƤޤORBʸ\fIorbid\fRǺƤ硢ϿݡȤ٤֤ޤ +登録されたサーバーの特定のObject Request Broker (ORB)で登録されたエンドポイント(ポート)を検出します。サーバーが実行されていない場合、アクティブ化されます。\fIorbid\fRが指定されていない場合、デフォルト値の\fI""\fRが\fIorbid\fRに割り当てられます。ORBが空文字列の\fIorbid\fRで作成されている場合、登録したポートがすべて返されます。 .RE .PP orblist \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR .RS 4 -С줿ORB\fIORBId\fRɽޤ\fIORBId\fRϥСǺ줿ORBʸ̾ǤС¹ԤƤʤ硢ƥֲޤ +サーバー上に定義されたORBの\fIORBId\fRを一覧表示します。\fIORBId\fRはサーバーで作成されたORBの文字列名です。サーバーが実行されていない場合、アクティブ化されます。 .RE .PP shutdown \-serverid \fIserver\-id\fR | \-applicationName application\-name .RS 4 -ORBDϿ줿ƥ֤ʥСߤޤΥޥɤμ¹ˡ\fI\-serverid\fRѥ᡼ޤ\fI\-applicationName\fRѥ᡼ǻꤵ줿饹줿\fIshutdown\fR᥽åɤƤӽФƥСץߤޤ +ORBDに登録されたアクティブなサーバーを停止します。このコマンドの実行中に、\fI\-serverid\fRパラメータまたは\fI\-applicationName\fRパラメータで指定されたクラス内に定義された\fIshutdown\fRメソッドも呼び出されてサーバー・プロセスを停止します。 .RE .PP startup \-serverid \fIserver\-id\fR | \-applicationName application\-name .RS 4 -ORBDϿ줿СưޤϥƥֲޤС¹ԤƤʤ硢ΥޥɤСưޤСǤ˼¹ԤƤϡ顼åɽޤ +ORBDに登録されたサーバーを起動またはアクティブ化します。サーバーが実行されていない場合、このコマンドがサーバーを起動します。サーバーがすでに実行されている場合は、エラー・メッセージが表示されます。 .RE .PP help .RS 4 -\fIservertool\fRޥɤ𤷤ƥСѤǤ뤹٤ƤΥޥɤꥹȤޤ +\fIservertool\fRコマンドを介してサーバーが利用できるすべてのコマンドをリストします。 .RE .PP quit .RS 4 -\fIservertool\fRޥɤλޤ +\fIservertool\fRコマンドを終了します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/tnameserv.1 b/jdk/src/linux/doc/man/ja/tnameserv.1 index 7a924315f3b..65c2558748b 100644 --- a/jdk/src/linux/doc/man/ja/tnameserv.1 +++ b/jdk/src/linux/doc/man/ja/tnameserv.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: tnameserv .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "tnameserv" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "tnameserv" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -tnameserv \- 󥿥ե(IDL) -.SH "" +tnameserv \- インタフェース定義言語(IDL)。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,27 +64,27 @@ tnameserv \- .PP \-ORBInitialPort \fInameserverport\fR .RS 4 -͡ߥ󥰡ӥORB\fIresolve_initial_references\fR᥽åɤ\fIlist_initial_references\fR᥽åɤμ˻Ѥ֡ȥȥåסץȥꥹ˥󥰤ݡȤǤ +ネーミング・サービスがORBの\fIresolve_initial_references\fRメソッドと\fIlist_initial_references\fRメソッドの実装に使用するブートストラップ・プロトコルをリスニングする初期ポートです。 .RE -.SH "" +.SH "説明" .PP -Java IDLˤϡObject Request Broker Daemon (ORBD)ޤޤޤORBDϡ֡ȥȥåסӥ͡ߥ󥰡ӥ³͡ߥ󥰡ӥӥСޥ͡ޤǡ󡦥ץǤJava IDLΤ٤ƤΥ塼ȥꥢǤORBDѤƤޤ͡ߥ󥰡ӥѤǤϡ\fIorbd\fRΤ\fItnameserv\fRѤǤޤ +Java IDLには、Object Request Broker Daemon (ORBD)が含まれます。ORBDは、ブートストラップ・サービス、一時ネーミング・サービス、永続ネーミング・サービスおよびサーバー・マネージャを含むデーモン・プロセスです。Java IDLのすべてのチュートリアルではORBDを使用していますが、一時ネーミング・サービスを使用する例では、\fIorbd\fRのかわりに\fItnameserv\fRを使用できます。 .PP -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlˤ -orbd(1)ޤϡNaming Serviceפ򻲾ȤƤ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlにある +orbd(1)または「Naming Service」を参照してください。 .PP -CORBACOS (Common Object Services)͡ߥ󥰡ӥϡե롦ƥबեФƥǥ쥯ȥ깽¤󶡤ƤΤƱ褦ˡ֥ȻȤФƥĥ꡼¤Υǥ쥯ȥ󶡤ޤJava IDLΰ͡ࡦӥǤ\fItnameserv\fRϡCOS͡ࡦӥλͤñʷǼΤǤ +CORBAのCOS (Common Object Services)ネーミング・サービスは、ファイル・システムがファイルに対してディレクトリ構造を提供しているのと同じように、オブジェクト参照に対してツリー構造のディレクトリを提供します。Java IDLの一時ネーム・サービスである\fItnameserv\fRは、COSネーム・サービスの仕様を単純な形で実装したものです。 .PP -֥ȻȤϥ͡ॹڡ̾dzǼ졢֥ȻȤ̾Υڥϡ줾͡ࡦХǥ󥰤ȸƤФޤ͡ࡦХǥ󥰤ϥ͡ߥ󥰡ƥȤȤ߹ळȤǤޤ͡ߥ󥰡ƥȤϥ͡ࡦХǥ󥰤Ǥꡢե롦ƥΥ֥ǥ쥯ȥƱǽޤ٤ƤΥХǥ󥰤Ͻ͡ߥ󥰡ƥȤβ˳Ǽޤ͡ߥ󥰡ƥȤϡ͡ॹڡͣα³Хǥ󥰤ǤJava IDL͡ߥ󥰡ӥץߤƺƵưȡĤΥ͡ॹڡϼޤ +オブジェクト参照はネームスペースに名前で格納され、オブジェクト参照と名前のペアは、それぞれネーム・バインディングと呼ばれます。ネーム・バインディングはネーミング・コンテキストに組み込むことができます。ネーミング・コンテキストはネーム・バインディングであり、ファイル・システムのサブディレクトリと同じ編成機能を持ちます。すべてのバインディングは初期ネーミング・コンテキストの下に格納されます。初期ネーミング・コンテキストは、ネームスペースの唯一の永続バインディングです。Java IDLネーミング・サービス・プロセスを停止して再起動すると、残りのネームスペースは失われます。 .PP -ץåȤޤϥץꥱ󤫤COS͡ߥ󥰡ӥѤ뤿ˤϡORB͡ߥ󥰡ӥưƤۥȤΥݡȤΤäƤ뤫Υ͡ߥ󥰡ӥν͡ߥ󥰡ƥʸ˥Ǥɬפޤ͡ࡦӥϡJava IDLΥ͡ࡦӥǤ⤽¾COSΥ͡ࡦӥǤ⤫ޤޤ -.SS "͡ߥ󥰡ӥεư" +アプレットまたはアプリケーションからCOSネーミング・サービスを使用するためには、そのORBがネーミング・サービスが動作しているホストのポートを知っているか、そのネーミング・サービスの初期ネーミング・コンテキスト文字列にアクセスできる必要があります。ネーム・サービスは、Java IDLのネーム・サービスでもその他のCOS準拠のネーム・サービスでもかまいません。 +.SS "ネーミング・サービスの起動" .PP -Java IDL͡ࡦӥϡ͡ࡦӥѤ륢ץꥱޤϥץåȤ˵ưƤɬפޤJava IDLʤ򥤥󥹥ȡ뤹ȡJava IDL͡ߥ󥰡ӥư륹ץ(Oracle Solaris: -\fItnameserv\fR)ޤϼ¹Բǽե(Windows: -\fItnameserv\&.exe\fR)ޤХå饦ɤư褦ˡ͡ࡦӥưƤ +Java IDLネーム・サービスは、ネーム・サービスを使用するアプリケーションまたはアプレットより前に起動しておく必要があります。Java IDL製品をインストールすると、Java IDLネーミング・サービスを起動するスクリプト(Oracle Solaris: +\fItnameserv\fR)または実行可能ファイル(Windows: +\fItnameserv\&.exe\fR)が作成されます。バックグラウンドで動作するように、ネーム・サービスを起動してください。 .PP -ä˻ꤷʤ硢Java IDL͡ߥ󥰡ӥϡORB\fIresolve_initial_references\fR᥽åɤ\fIlist_initial_references methods\fR᥽åɤμ˻Ѥ֡ȥȥåסץȥФƥݡ900ǥꥹ˥󥰤ޤ +特に指定しない場合、Java IDLネーミング・サービスは、ORBの\fIresolve_initial_references\fRメソッドと\fIlist_initial_references methods\fRメソッドの実装に使用するブートストラップ・プロトコルに対してポート900でリスニングします。 .sp .if n \{\ .RS 4 @@ -96,7 +96,7 @@ tnameserv \-ORBInitialPort nameserverport& .RE .\} .PP -͡ࡦСݡȤꤷʤ硢ǥեȤǥݡ900ѤޤOracle Solarisեȥμ¹Ի1024꾮ݡȤǥץ򳫻Ϥϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ1050Τ褦̤ΥݡȤꤷ͡ࡦӥХå饦ɤǼ¹ԤˤϡUNIXޥɡǼΤ褦Ϥޤ +ネーム・サーバー・ポートを指定しない場合、デフォルトでポート900が使用されます。Oracle Solarisソフトウェアの実行時、1024より小さいポートでプロセスを開始する場合は、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。1050のように別のポートを指定し、ネーム・サービスをバックグラウンドで実行するには、UNIXコマンド・シェルで次のように入力します。 .sp .if n \{\ .RS 4 @@ -108,7 +108,7 @@ tnameserv \-ORBInitialPort 1050& .RE .\} .PP -WindowsMS\-DOSƥࡦץץȤǤϡΤ褦Ϥޤ +WindowsのMS\-DOSシステム・プロンプトでは、次のように入力します。 .sp .if n \{\ .RS 4 @@ -120,20 +120,20 @@ start tnameserv \-ORBInitialPort 1050 .RE .\} .PP -͡ࡦСΥ饤ȤˤϡݡֹΤ餻ɬפޤԤˤϡORB֥Ȥκ\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRץѥƥ˿ݡֹꤷޤ -.SS "ۤʤۥȾǤΥСȥ饤Ȥμ¹" +ネーム・サーバーのクライアントには、新しいポート番号を知らせる必要があります。これを行うには、ORBオブジェクトの作成時に\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティに新しいポート番号を設定します。 +.SS "異なるホスト上でのサーバーとクライアントの実行" .PP -Java IDLRMI\-IIOPΤۤȤɤΥ塼ȥꥢǤϡ͡ߥ󥰡ӥСӥ饤ȤϤ٤ƳȯѤΥޥǼ¹Ԥޤºݤ˥ǥץȤˤϡ饤ȤȥС򡢥͡ߥ󥰡ӥȤϰۤʤۥȡޥǼ¹Ԥ뤳Ȥ¿ʤޤ +Java IDLとRMI\-IIOPのほとんどのチュートリアルでは、ネーミング・サービス、サーバーおよびクライアントはすべて開発用のマシン上で実行されます。実際にデプロイメントする場合には、クライアントとサーバーを、ネーミング・サービスとは異なるホスト・マシン上で実行することが多くなります。 .PP -饤ȤȥС͡ࡦӥ򸫤Ĥˤϡ饤ȤȥС͡ࡦӥ¹ԤƤݡȤֹȥۥȤǧƤɬפޤΤˤϡ饤ȤȥСΥե\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRץѥƥ\fIorg\&.omg\&.CORBA\&.ORBInitialHost\fRץѥƥ͡ࡦӥ¹ԤƤݡȤֹȥޥ̾ꤷޤϡGetting Started Using RMI\-IIOP -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi\-iiop/rmiiiopexample\&.html)˼Ƥޤ +クライアントとサーバーがネーム・サービスを見つけるには、クライアントとサーバーが、ネーム・サービスが実行されているポートの番号とホストを認識している必要があります。そのためには、クライアントとサーバーのファイル内の\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティと\fIorg\&.omg\&.CORBA\&.ORBInitialHost\fRプロパティをネーム・サービスが実行されているポートの番号とマシンの名前に設定します。この例は、「Getting Started Using RMI\-IIOP」 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi\-iiop/rmiiiopexample\&.html)に示されています .PP -ޥɥ饤󡦥ץ\fI\-ORBInitialPort nameserverport#\fR\fI\-ORBInitialHost nameserverhostname\fRѤơ饤ȤȥСФƥ͡ߥ󥰡ӥõꤹ뤳ȤǤޤޥɥ饤󡦥ץѤƤԤˡ1Ĥϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.htmlΡJava IDL: The Hello World Example on Two Machines -򻲾ȤƤ +コマンドライン・オプション\fI\-ORBInitialPort nameserverport#\fRと\fI\-ORBInitialHost nameserverhostname\fRを使用して、クライアントとサーバーに対してネーミング・サービスを探す場所を指定することもできます。コマンドライン・オプションを使用してこれを行う方法の1つの例は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.htmlの「Java IDL: The Hello World Example on Two Machines」 +を参照してください .PP -ȤС͡ࡦӥ\fItnameserv\fRۥ\fInameserverhost\fRΥݡ1050Ǽ¹ԤƤȤޤˡ饤Ȥۥ\fIclienthost\fRǼ¹Ԥ졢Сϥۥ\fIserverhost\fRǼ¹ԤƤȤޤ +たとえば、一時ネーム・サービス\fItnameserv\fRが、ホスト\fInameserverhost\fRのポート1050上で実行されているとします。さらに、クライアントがホスト\fIclienthost\fR上で実行され、サーバーはホスト\fIserverhost\fR上で実行されているとします。 .PP -ۥ\fInameserverhost\fR\fItnameserv\fRưޤ +ホスト\fInameserverhost\fR上で\fItnameserv\fRを起動します。 .sp .if n \{\ .RS 4 @@ -145,7 +145,7 @@ tnameserv \-ORBInitialPort 1050 .RE .\} .PP -\fIserverhost\fRǥСưޤ +\fIserverhost\fR上でサーバーを起動します。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost .\} .PP -\fIclienthost\fRǥ饤Ȥưޤ +\fIclienthost\fR上でクライアントを起動します。 .sp .if n \{\ .RS 4 @@ -169,19 +169,19 @@ java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost .if n \{\ .RE .\} -.SS "͡ߥ󥰡ӥ" +.SS "ネーミング・サービスの停止" .PP -Java IDL͡ߥ󥰡ӥߤˤϡUnixξϡ\fIkill\fRʤɤΥڥ졼ƥ󥰡ƥΥޥɤѤWindowsξϡ\fI[Ctrl]+[C]\fRѤޤ͡ߥ󥰡ӥŪߤޤǤϡƽФԵ֤³ޤӥλȡJava IDL͡ࡦӥϿƤ̾ϼޤ -.SH "ץ" +Java IDLネーミング・サービスを停止するには、Unixの場合は、\fIkill\fRなどのオペレーティング・システムのコマンドを使用し、Windowsの場合は、\fI[Ctrl]+[C]\fRキーを使用します。ネーミング・サービスを明示的に停止するまでは、呼出し待機状態が続きます。サービスを終了させると、Java IDLネーム・サービスに登録されている名前は失われます。 +.SH "オプション" .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" -.SS "͡ॹڡؤΥ֥Ȥɲ" +.SH "例" +.SS "ネームスペースへのオブジェクトの追加" .PP -Ǥϡ͡ॹڡ̾ɲäˡ򼨤ޤΥץ롦ץϡΤޤޤξ֤Ǵư͡ࡦӥ饤ȤǡΤ褦ñʥĥ꡼ΤǤ +次の例では、ネームスペースに名前を追加する方法を示します。このサンプル・プログラムは、このままの状態で完全に動作する一時ネーム・サービス・クライアントで、次のような単純なツリーを作成するものです。 .sp .if n \{\ .RS 4 @@ -197,7 +197,7 @@ Initial Naming Context .RE .\} .PP -ǡ\fIplans\fRϥ֥Ȼȡ\fIPersonal\fR\fIcalendar\fR\fIschedule\fR2ĤΥ֥ȻȤޤ͡ߥ󥰡ƥȤǤ +この例で、\fIplans\fRはオブジェクト参照、\fIPersonal\fRは\fIcalendar\fRと\fIschedule\fRの2つのオブジェクト参照を含むネーミング・コンテキストです。 .sp .if n \{\ .RS 4 @@ -217,7 +217,7 @@ public class NameClient { .RE .\} .PP -͡ߥ󥰡ӥεưǡ\fInameserver\fRϥݡ1050ǵưޤΥɤǡΥݡֹ򥯥饤ȡƥΤ餻ޤ +ネーミング・サービスの起動で、\fInameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 .sp .if n \{\ .RS 4 @@ -231,7 +231,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ͡ߥ󥰡ƥȤ\fIctx\fRޤ2ܤǤϡ\fIctx\fRߡΥ֥Ȼ\fIobjref\fR˥ԡޤobjrefˤϡȤ̾͡Ƥƥ͡ॹڡɲäޤ +次のコードでは、初期ネーミング・コンテキストを取得し、それを\fIctx\fRに代入します。2行目では、\fIctx\fRをダミーのオブジェクト参照\fIobjref\fRにコピーします。このobjrefには、あとで様々な名前を割り当ててネームスペースに追加します。 .sp .if n \{\ .RS 4 @@ -246,7 +246,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ\fItext\fRפ̾\fIplans\fRߡΥ֥ȻȤ˥Хɤޤθ塢\fIrebind\fR᥽åɤѤƽ͡ߥ󥰡ƥȤβ\fIplans\fRɲäƤޤ\fIrebind\fR᥽åɤѤС\fIbind\fR᥽åɤѤȯ㳰ȯˡΥץ٤֤ⷫ¹ԤǤޤ +次のコードでは、\fItext\fRタイプの名前\fIplans\fRを作成し、それをダミーのオブジェクト参照にバインドします。その後、\fIrebind\fRメソッドを使用して初期ネーミング・コンテキストの下に\fIplans\fRを追加しています。\fIrebind\fRメソッドを使用すれば、\fIbind\fRメソッドを使用した場合に発生する例外を発生させずに、このプログラムを何度も繰返し実行できます。 .sp .if n \{\ .RS 4 @@ -261,7 +261,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ\fIdirectory\fRפ\fIPersonal\fRȤ͡ߥ󥰡ƥȤޤη륪֥Ȼ\fIctx2\fR\fIname\fR˥Хɤ͡ߥ󥰡ƥȤɲäޤ +次のコードでは、\fIdirectory\fRタイプの\fIPersonal\fRというネーミング・コンテキストを作成します。その結果得られるオブジェクト参照\fIctx2\fRを\fIname\fRにバインドし、初期ネーミング・コンテキストに追加します。 .sp .if n \{\ .RS 4 @@ -276,7 +276,7 @@ public class NameClient { .RE .\} .PP -ĤΥɤǤϡߡΥ֥ȻȤ\fIschedule\fR\fIcalendar\fRȤ̾ǥ͡ߥ󥰡ƥ\fIPersonal\fR(\fIctx2\fR)˥Хɤޤ +残りのコードでは、ダミーのオブジェクト参照を\fIschedule\fRと\fIcalendar\fRという名前でネーミング・コンテキスト\fIPersonal\fR(\fIctx2\fR)にバインドします。 .sp .if n \{\ .RS 4 @@ -300,9 +300,9 @@ public class NameClient { .if n \{\ .RE .\} -.SS "͡ॹڡλ" +.SS "ネームスペースの参照" .PP -Υץ롦ץǤϡ͡ॹڡ֥饦ˡ򼨤ޤ +次のサンプル・プログラムでは、ネームスペースをブラウズする方法を示します。 .sp .if n \{\ .RS 4 @@ -322,7 +322,7 @@ public class NameClientList { .RE .\} .PP -͡ߥ󥰡ӥεưǡ\fInameserver\fRϥݡ1050ǵưޤΥɤǡΥݡֹ򥯥饤ȡƥΤ餻ޤ +ネーミング・サービスの起動で、\fInameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 .sp .if n \{\ .RS 4 @@ -336,7 +336,7 @@ public class NameClientList { .RE .\} .PP -ΥɤǤϡ͡ߥ󥰡ƥȤƤޤ +次のコードでは、初期ネーミング・コンテキストを取得しています。 .sp .if n \{\ .RS 4 @@ -350,7 +350,7 @@ public class NameClientList { .RE .\} .PP -\fIlist\fR᥽åɤϡ͡ߥ󥰡ƥȤΥХǥ󥰤ꥹȤޤξ硢1000ĤޤǤΥХǥ󥰤͡ߥ󥰡ƥȤ\fIBindingListHolder\fR֤ޤĤΥХǥ󥰤ϡ\fIBindingIteratorHolder\fR֤ޤ +\fIlist\fRメソッドは、ネーミング・コンテキストのバインディングをリストします。この場合、最大1000個までのバインディングが初期ネーミング・コンテキストから\fIBindingListHolder\fRに返されます。残りのバインディングは、\fIBindingIteratorHolder\fRに返されます。 .sp .if n \{\ .RS 4 @@ -364,7 +364,7 @@ public class NameClientList { .RE .\} .PP -ΥɤǤϡ֤줿\fIBindingListHolder\fRХǥ󥰤ޤХǥ󥰤ʤϡץबλޤ +次のコードでは、返された\fIBindingListHolder\fRからバインディングの配列を取得します。バインディングがない場合は、プログラムが終了します。 .sp .if n \{\ .RS 4 @@ -377,7 +377,7 @@ public class NameClientList { .RE .\} .PP -ĤΥɤǤϡХǥ󥰤Фƥ롼׽Ԥ̾Ϥޤ +残りのコードでは、バインディングに対してループ処理を行い、名前を出力します。 .sp .if n \{\ .RS 4 @@ -408,7 +408,7 @@ public class NameClientList { .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/linux/doc/man/ja/unpack200.1 b/jdk/src/linux/doc/man/ja/unpack200.1 index 0b940d494d2..b782c674152 100644 --- a/jdk/src/linux/doc/man/ja/unpack200.1 +++ b/jdk/src/linux/doc/man/ja/unpack200.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: unpack200 .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaǥץȡġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaデプロイメント・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "unpack200" "1" "2013ǯ1121" "JDK 8" "Javaǥץȡġ" +.TH "unpack200" "1" "2013年11月21日" "JDK 8" "Javaデプロイメント・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -unpack200 \- pack200(1)Ǻ줿ѥåեWebǥץȤΤJARեѴޤ -.SH "" +unpack200 \- pack200(1)で作成されたパック・ファイルを、WebデプロイメントのためにJARファイルに変換します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,21 +64,21 @@ unpack200 \- pack200(1) .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIinput\-file\fR .RS 4 -ϥե̾pack200 gzipե뤫pack200եǤޤϥեˤϡ\fIpack200\fR(1)Ǻ줿JARեꤹ뤳ȤǤޤ(֤\fI0\fRǤ)ξ硢ϥեƤPack2000ޡǽJARե˥ԡޤ +入力ファイルの名前。pack200 gzipファイルかpack200ファイルを指定できます。入力ファイルには、\fIpack200\fR(1)で作成されたJARファイルを指定することもできます(手間は\fI0\fRです)。この場合、入力ファイルの内容はPack2000マーカーで出力JARファイルにコピーされます。 .RE .PP \fIJAR\-file\fR .RS 4 -JARե̾ +出力JARファイル名。 .RE -.SH "" +.SH "説明" .PP -\fIunpack200\fRޥɤϡ\fIpack200\fR\fI(1)\fRǺ줿ѥåեJARեѴͥƥּǤŪʻˡϼΤȤǤǤϡǥեȤ\fIunpack200\fRޥǡ\fImyarchive\&.jar\fRե뤬\fImyarchive\&.pack\&.gz\fRޤ +\fIunpack200\fRコマンドは、\fIpack200\fR\fI(1)\fRで作成されたパック・ファイルをJARファイルに変換するネイティブ実装です。一般的な使用方法は次のとおりです。次の例では、デフォルトの\fIunpack200\fRコマンド設定で、\fImyarchive\&.jar\fRファイルが\fImyarchive\&.pack\&.gz\fRから作成されます。 .sp .if n \{\ .RS 4 @@ -89,56 +89,56 @@ unpack200 myarchive\&.pack\&.gz myarchive\&.jar .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-Hvalue \-\-deflate\-hint=\fIvalue\fR .RS 4 -JARեΤ٤ƤΥȥ\fItrue\fR\fIfalse\fRޤ\fIkeep\fRΥǥե졼ꤷޤǥեȡ⡼ɤ\fIkeep\fRǤͤ\fItrue\fRޤ\fIfalse\fR硢\fI\-\-deflate=hint\fRץϥǥեȤư򥪡С饤ɤơJARեΤ٤ƤΥȥΥǥե졼󡦥⡼ɤꤵޤ +JARファイル内のすべてのエントリに\fItrue\fR、\fIfalse\fRまたは\fIkeep\fRのデフレーションを設定します。デフォルト・モードは\fIkeep\fRです。値が\fItrue\fRまたは\fIfalse\fR場合、\fI\-\-deflate=hint\fRオプションはデフォルトの動作をオーバーライドして、出力JARファイル内のすべてのエントリのデフレーション・モードが設定されます。 .RE .PP \-r \-\-remove\-pack\-file .RS 4 -ϥѥåեޤ +入力パック・ファイルを削除します。 .RE .PP \-v \-\-verbose .RS 4 -Ǿ¤ΥåɽޤΥץʣλͤˤϡܺ٤ʥåɽޤ +最小限のメッセージが表示されます。このオプションの複数の仕様には、より詳細なメッセージが表示されます。 .RE .PP \-q \-\-quiet .RS 4 -åɽư褦˻ꤷޤ +メッセージを表示せずに動作するように指定します。 .RE .PP \-lfilename \-\-log\-file=\fIfilename\fR .RS 4 -ϥåϿեꤷޤ +出力メッセージが記録されるログ・ファイルを指定します。 .RE .PP \-? \-h \-\-help .RS 4 -\fIunpack200\fRޥɤ˴ؤإ׾Ϥޤ +\fIunpack200\fRコマンドに関するヘルプ情報を出力します。 .RE .PP \-V \-\-version .RS 4 -\fIunpack200\fRޥɤ˴ؤСϤޤ +\fIunpack200\fRコマンドに関するバージョン情報を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -JavaۥޥoptionϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンにoptionを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" +.SH "注意" .PP -Υޥɤ\fIunpack\fRޥɤƱʤǤʤǤ +このコマンドと\fIunpack\fRコマンドを混同しないでください。これらは別製品です。 .PP -JDK°Java SE APIͤȤ㤬Ĥäˤϡͤͥ褷Ƥ -.SH "λơ" +JDKに付属するJava SE API仕様との相違が見つかった場合には、仕様を優先してください。 +.SH "終了ステータス" .PP -νλ֤ͤޤ: ェλξ0顼ȯ0礭͡ -.SH "Ϣ" +次の終了値が返されます: 正常終了の場合は0、エラーが発生した場合は0より大きい値。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -181,7 +181,7 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -Pack200 and Compression +「Pack200 and Compression」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment\-guide/pack200\&.html) .RE .sp @@ -193,7 +193,7 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -Java SE Technical Documentation +「Java SE Technical Documentation」 (http://docs\&.oracle\&.com/javase/) .RE .br diff --git a/jdk/src/linux/doc/man/ja/wsgen.1 b/jdk/src/linux/doc/man/ja/wsgen.1 index 0f50de81de0..a7b0db1d6e5 100644 --- a/jdk/src/linux/doc/man/ja/wsgen.1 +++ b/jdk/src/linux/doc/man/ja/wsgen.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: wsgen .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "wsgen" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "wsgen" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -wsgen \- WebӥΥɥݥȼ(SEI)饹ɼꡢWebӥΥǥץȤȸƽФɬפʤ٤ƤΥƥեȤޤ -.SH "" +wsgen \- Webサービスのエンドポイント実装(SEI)クラスを読取り、Webサービスのデプロイメントと呼出しに必要なすべてのアーティファクトを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,20 +64,20 @@ wsgen \- Web .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fISEI\fR .RS 4 -ɤ߼WebӥΥɥݥȼ饹(SEI)Ǥ +読み取るWebサービスのエンドポイント実装クラス(SEI)です。 .RE -.SH "" +.SH "説明" .PP -\fIwsgen\fRޥɤϡJAX\-WS WebӥǻѤJAX\-WSݡ֥롦ƥեȤޤΥġϡWebӥΥɥݥȡ饹ɼꡢWebӥΥǥץȤȸƽФɬפʤ٤ƤΥƥեȤޤJAXWS 2\&.1\&.1 RIǤ\fIwsgen\fR -Ant󶡤ޤ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlJAX\-WS (wsgen)ڡTools֤򻲾ȤƤ +\fIwsgen\fRコマンドは、JAX\-WS Webサービスで使用されるJAX\-WSポータブル・アーティファクトを生成します。このツールは、Webサービスのエンドポイント・クラスを読取り、Webサービスのデプロイメントと呼出しに必要なすべてのアーティファクトを生成します。JAXWS 2\&.1\&.1 RIでは\fIwsgen\fR +Antタスクも提供されます。 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlのJAX\-WS (wsgen)ページのToolsタブを参照してください。 .PP -\fIwsgen\fRޥɤưˤϡԤޤ +\fIwsgen\fRコマンドを起動するには、次を行います。 .sp .if n \{\ .RS 4 @@ -89,79 +89,79 @@ $JAXWS_HOME/bin/wsgen\&.sh \-help .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-classpath \fIpath\fR .RS 4 -ϥ饹եξꡣ +入力クラス・ファイルの場所。 .RE .PP \-cp \fIpath\fR .RS 4 -ϥ饹եξꡣ +入力クラス・ファイルの場所。 .RE .PP \-d \fIdirectory\fR .RS 4 -줿ϥեǼꡣ +生成された出力ファイルを格納する場所。 .RE .PP \-extension .RS 4 -٥ĥѲǽˤޤĥѤȡץꥱΰܿ줿ꡢ¾μϢȤǤʤʤǽޤ +ベンダー拡張を使用可能にします。拡張を使用すると、アプリケーションの移植性が失われたり、他の実装と連携できなくなる可能性があります。 .RE .PP \-help .RS 4 -\fIwsgen\fRޥɤ˴ؤإסåɽޤ +\fIwsgen\fRコマンドに関するヘルプ・メッセージを表示します。 .RE .PP \-keep .RS 4 -줿ե¸ޤ +生成されたファイルを保存します。 .RE .PP \-r \fIdirectory\fR .RS 4 -Υץ\fI\-wsdl\fRץȤȤ˻ѤơWSDLʤ줿꥽ե֤ꤷޤ +このオプションを\fI\-wsdl\fRオプションとともに使用して、WSDLなど生成されたリソース・ファイルを配置する場所を指定します。 .RE .PP \-s \fIdirectory\fR .RS 4 -줿եǼꡣ +生成されたソース・ファイルを格納する場所。 .RE .PP \-verbose .RS 4 -ѥ顦åɽޤ +コンパイラ・メッセージを表示します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-wsdl [ :protocol ] .RS 4 -ɥݥȤǥץ˳ǧWSDLե륪ץ󡦥ޥɡWSDLեˤϡӥƤӽФˡѥ᡼ɬפ֤͡ǡ¤ˤĤƤΥԥ塼ɼǽʵҤޤޤޤ +エンドポイントをデプロイする前に確認するWSDLファイルを生成するオプション・コマンド。WSDLファイルには、サービスを呼び出す方法、パラメータに必要な値、返されるデータ構造についてのコンピュータで読取り可能な記述が含まれます。 .sp -ǥեȤǤ\fIwsgen\fRޥɤWSDLեޤ\fIprotocol\fRͤϾάǽǤꡢWSDLХǥ(\fIwsdl:binding\fR)ǻѤץȥꤹ뤿˻Ѥޤͭʥץȥϡ\fIsoap1\&.1\fR\fIXsoap1\&.2\fRǤǥեȤ\fIsoap1\&.1\fRǤ\fIXsoap1\&.2\fRץȥɸǤϤʤᡢ\fI\-extension\fRץȤȤˤΤ߻ѲǽǤ +デフォルトでは\fIwsgen\fRコマンドはWSDLファイルを生成しません。\fIprotocol\fR値は省略可能であり、WSDLバインディング(\fIwsdl:binding\fR)で使用するプロトコルを指定するために使用されます。有効なプロトコルは、\fIsoap1\&.1\fRと\fIXsoap1\&.2\fRです。デフォルトは\fIsoap1\&.1\fRです。\fIXsoap1\&.2\fRプロトコルは標準ではないため、\fI\-extension\fRオプションとともにのみ使用可能です。 .RE .PP \-servicename \fIname\fR .RS 4 -\fI\-wsdl\fRץȤȤˤΤ߻ѤơWSDLWSDLӥ(\fIwsdl:service\fR)̾ꤷޤ: -\fI\-servicename "{http://mynamespace/}MyService"\fR +\fI\-wsdl\fRオプションとともにのみ使用して、WSDLで生成される特定のWSDLサービス(\fIwsdl:service\fR)名を指定します。例: +\fI\-servicename "{http://mynamespace/}MyService"\fR。 .RE .PP \-portname \fIname\fR .RS 4 -\fI\-wsdl\fRץȤȤˤΤ߻ѤơWSDLWSDLݡ(\fIwsdl:port\fR)̾ꤷޤ: -\fI\-portname "{http://mynamespace/}MyPort"\fR +\fI\-wsdl\fRオプションとともにのみ使用して、WSDLで生成される特定のWSDLポート(\fIwsdl:port\fR)名を指定します。例: +\fI\-portname "{http://mynamespace/}MyPort"\fR。 .RE -.SH "" +.SH "例" .PP -ǤϡStockǥ쥯ȥ\fI@WebService\fR\fIStockService\fRΥåѡ饹ޤ +次の例では、Stockディレクトリ内に\fI@WebService\fR注釈を持つ\fIStockService\fRのラッパー・クラスを生成します。 .sp .if n \{\ .RS 4 @@ -173,7 +173,7 @@ wsgen \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -ǤϡSOAP 1\&.1 WSDL\fI@WebService\fR\fIstock\&.StockService\fR饹Υޤޤ +次の例では、SOAP 1\&.1 WSDLおよび\fI@WebService\fR注釈を持つ\fIstock\&.StockService\fRクラスのスキーマを生成します。 .sp .if n \{\ .RS 4 @@ -185,7 +185,7 @@ wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -ǤϡSOAP 1\&.2 WSDLޤ +次の例では、SOAP 1\&.2 WSDLを生成します。 .sp .if n \{\ .RS 4 @@ -197,9 +197,9 @@ wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -\fB:\fR -ӥΥǥץJAXWS¹ԻĶWSDL뤿ᡢȯWSDLɬפϤޤ -.SH "Ϣ" +\fB注意:\fR +サービスのデプロイ時にJAXWS実行時環境でWSDLが生成されるため、開発時にWSDLを生成する必要はありません。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -220,8 +220,8 @@ wsimport(1) .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html -JAX\-WS (wsgen)ڡTools֤򻲾ȤƤ +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlの +JAX\-WS (wsgen)ページのToolsタブを参照してください。 .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/wsimport.1 b/jdk/src/linux/doc/man/ja/wsimport.1 index feff3f3acca..00d41d2041e 100644 --- a/jdk/src/linux/doc/man/ja/wsimport.1 +++ b/jdk/src/linux/doc/man/ja/wsimport.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: wsimport .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "wsimport" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "wsimport" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -wsimport \- Webץꥱ󡦥(WAR)ե˥ѥåǤJAX\-WSݡ֥롦ƥեȤơAntꤷޤ -.SH "" +wsimport \- Webアプリケーション・アーカイブ(WAR)ファイルにパッケージできるJAX\-WSポータブル・アーティファクトを生成して、Antタスクを指定します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,18 +64,18 @@ wsimport \- Web .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIwsdl\fR .RS 4 -WebӥƤӽФˡѥ᡼ɬפ֤͡ǡ¤ˤĤƤΥԥ塼ɼǽʵҤޤޤޤեǤ +Webサービスを呼び出す方法、パラメータに必要な値、返されるデータ構造についてのコンピュータで読取り可能な記述が含まれまるファイルです。 .RE -.SH "" +.SH "説明" .PP -\fIwsimport\fRޥɤϡJAX\-WSݡ֥롦ƥեȤޤΥƥեȤϡǥץWSDLӥޡɥȤӥɥݥȼȤȤˡWARե˥ѥåǤޤ\fIwsimport\fRޥɤǤ\fIwsimport\fR -Ant󶡤ޤ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlWsimport Ant TaskڡTools֤򻲾ȤƤ +\fIwsimport\fRコマンドは、次のJAX\-WSポータブル・アーティファクトを生成します。これらのアーティファクトは、デプロイするWSDLおよびスキーマ・ドキュメントおよびエンドポイント実装とともに、WARファイルにパッケージできます。\fIwsimport\fRコマンドでは\fIwsimport\fR +Antタスクも提供されます。 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlのWsimport Ant TaskページのToolsタブを参照してください。 .sp .RS 4 .ie n \{\ @@ -85,7 +85,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -ӥɥݥȡ󥿥ե(SEI) +サービス・エンドポイント・インタフェース(SEI) .RE .sp .RS 4 @@ -96,7 +96,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -ӥ +サービス .RE .sp .RS 4 @@ -107,7 +107,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -㳰饹\fIwsdl:fault\fRޥåפޤ(¸ߤ) +例外クラスは\fIwsdl:fault\fRからマップされます(存在する場合) .RE .sp .RS 4 @@ -118,7 +118,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -Ʊ쥹ݥBeanϥ쥹ݥ\fIwsdl:message\fRޤ(¸ߤ) +非同期レスポンスBeanはレスポンス\fIwsdl:message\fRから派生します(存在する場合) .RE .sp .RS 4 @@ -129,10 +129,10 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -JAXBͥ(ޤΥפޥåפ줿Java饹) +JAXBが生成する値タイプ(スキーマのタイプからマップされたJavaクラス) .RE .PP -\fIwsgen\fRޥɤưˤϡԤޤ +\fIwsgen\fRコマンドを起動するには、次を行います。 .PP \fBOracle Solaris/Linux\fR: .sp @@ -146,7 +146,7 @@ JAXB .RE .\} .PP -\fBWindows\fRξ: +\fBWindows\fRの場合: .sp .if n \{\ .RS 4 @@ -157,118 +157,118 @@ JAXB .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-d \fIdirectory\fR .RS 4 -ϥեǼꤷޤ +生成される出力ファイルを格納する場所を指定します。 .RE .PP \-b \fIpath\fR .RS 4 -JAX\-WSޤJAXBХǥ󥰡եꤷޤ\fI\-b\fRץʣJAX\-WSJAXBХǥ󥰡եǤޤΥեѤơѥå̾Bean̾ʤɤ򥫥ޥǤޤJAX\-WSJAXBХǥ󥰡եξܺ٤ϡ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlWSDL CustomizationUsers Guide֤򻲾ȤƤ +外部JAX\-WSまたはJAXBバインディング・ファイルを指定します。\fI\-b\fRオプションで複数のJAX\-WSおよびJAXBバインディング・ファイルを指定できます。これらのファイルを使用して、パッケージ名、Bean名などをカスタマイズできます。JAX\-WSおよびJAXBバインディング・ファイルの詳細は、 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlのWSDL CustomizationのUsers Guideタブを参照してください .RE .PP \-B \fIjaxbOption\fR .RS 4 -JAXBޡѥ\fIjaxbOption\fRץϤޤ +JAXBスキーマ・コンパイラに\fIjaxbOption\fRオプションを渡します。 .RE .PP \-catalog .RS 4 -ƥƥȤ褹륫եꤷޤ\fI\-catalog\fRץϡTR9401XCatalogOASIS XML CatalogγƷ򥵥ݡȤƤޤhttp://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.html -Catalog SupportڡUsers Guide֤򻲾ȤƤ +外部エンティティ参照を解決するカタログ・ファイルを指定します。\fI\-catalog\fRオプションは、TR9401、XCatalog、OASIS XML Catalogの各形式をサポートしています。http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.htmlの +Catalog SupportページのUsers Guideタブを参照してください。 .RE .PP \-extension .RS 4 -٥ĥѲǽˤޤĥѤȡץꥱΰܿ줿ꡢ¾μϢȤǤʤʤǽޤ +ベンダー拡張を使用可能にします。拡張を使用すると、アプリケーションの移植性が失われたり、他の実装と連携できなくなる可能性があります。 .RE .PP \-help .RS 4 -\fIwsimport\fRޥɤ˴ؤإסåɽޤ +\fIwsimport\fRコマンドに関するヘルプ・メッセージを表示します。 .RE .PP \-httpproxy: \fIhost\fR:\fIport\fR .RS 4 -HTTPץСꤷޤǥեȤ8080Ǥ +HTTPプロキシ・サーバーを指定します。デフォルトは8080です。 .RE .PP \-keep .RS 4 -줿եݻޤ +生成されたファイルを保持します .RE .PP \-p \fIname\fR .RS 4 -åȡѥå\fIname\fRꤷơWSDLӥޡХǥ󥰤Υޥӻ줿ǥեȤΥ르ꥺ򥪡С饤ɤޤ +ターゲット・パッケージ\fIname\fRを指定して、WSDLおよびスキーマ・バインディングのカスタマイズ、および仕様部で定義されたデフォルトのアルゴリズムをオーバーライドします。 .RE .PP \-s \fIdirectory\fR .RS 4 -륽եǼꤷޤ +生成されるソース・ファイルを格納する場所を指定します .RE .PP \-verbose .RS 4 -ѥ顦åɽޤ +コンパイラ・メッセージを表示します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-wsdllocation \fIlocation\fR .RS 4 -\fI@WebServiceClient\&.wsdlLocation\fRͤꤷޤ +\fI@WebServiceClient\&.wsdlLocation\fRの値を指定します。 .RE .PP \-target .RS 4 -ꤵ줿JAX\-WSͥС˽äơɤޤС2\&.0ǤϡJAX\-WS 2\&.0ͤ˽򤷤ɤޤ +指定されたJAX\-WS仕様バージョンに従って、コードを生成します。バージョン2\&.0では、JAX\-WS 2\&.0仕様に準拠したコードを生成します。 .RE .PP \-quiet .RS 4 -\fIwsimport\fRޥɽϤޤ +\fIwsimport\fRコマンド出力を抑制します。 .RE .PP -\fI\-b\fRץѤơʣ\fIJAX\-WS\fR\fIJAXB\fRХǥ󥰡եǤޤΥեѤơѥå̾Bean̾ʤɡ͡ʤΤ򥫥ޥǤޤ\fIJAX\-WS\fR\fIJAXB\fRХǥ󥰡եξܺ٤ϡ -https://jax\-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.htmlJAXB֤򻲾ȤƤ -.SH "ɸ४ץ" +\fI\-b\fRオプションを使用して、複数の\fIJAX\-WS\fRおよび\fIJAXB\fRバインディング・ファイルを指定できます。これらのファイルを使用して、パッケージ名やBean名など、様々なものをカスタマイズできます。\fIJAX\-WS\fRおよび\fIJAXB\fRバインディング・ファイルの詳細は、 +https://jax\-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.htmlのJAXBタブを参照してください +.SH "非標準オプション" .PP \-XadditionalHeaders .RS 4 -ꥯȤޤϥ쥹ݥ󥹡å˥ХɤʤإåJava᥽åɤΥѥ᡼˥ޥåפޤ +リクエストまたはレスポンス・メッセージにバインドされないヘッダーをJavaメソッドのパラメータにマップします .RE .PP \-Xauthfile \fIfile\fR .RS 4 -ǧھޤեꤹWSDL URIǤURIηϼΤȤǤ +認証情報を含むファイルを指定するWSDL URIです。このURIの形式は次のとおりです。 .sp http://\fIuser\-name\fR:\fIpassword\fR@\fIhost\-name\fR/\fIweb\-service\-name\fR>?wsdl .RE .PP \-Xdebug .RS 4 -ǥХåϤޤ +デバッグ情報を出力します .RE .PP \-Xno\-addressing\-databinding .RS 4 -W3C EndpointReferenceTypeJavaΥХǥ󥰤ͭˤޤ +W3C EndpointReferenceTypeとJavaのバインディングを有効にします。 .RE .PP \-Xnocompile .RS 4 -줿Javaե򥳥ѥ뤷ޤ +生成されたJavaファイルをコンパイルしません .RE -.SH "" +.SH "例" .PP -ǤϡJavaƥեȤ\fIhttp://stockquote\&.example\&.com/quote?wsdl\fR򥤥ݡȤƥƥեȤ򥳥ѥ뤷ޤ +次の例では、Javaアーティファクトを生成し、\fIhttp://stockquote\&.example\&.com/quote?wsdl\fRをインポートしてアーティファクトをコンパイルします。 .sp .if n \{\ .RS 4 @@ -279,7 +279,7 @@ wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -300,8 +300,8 @@ wsgen(1) .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -Wsimport Ant TaskڡTools +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlの +Wsimport Ant TaskページのToolsタブ .RE .sp .RS 4 @@ -312,8 +312,8 @@ Wsimport Ant Task .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.html -Catalog SupportڡUsers Guide +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.htmlの +Catalog SupportページのUsers Guideタブ .RE .sp .RS 4 @@ -324,8 +324,8 @@ Catalog Support .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -WSDL CustomizationڡUsers Guide +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlの +WSDL CustomizationページのUsers Guideタブ .RE .br 'pl 8.5i diff --git a/jdk/src/linux/doc/man/ja/xjc.1 b/jdk/src/linux/doc/man/ja/xjc.1 index 17a0efdd9ed..843ddd9475b 100644 --- a/jdk/src/linux/doc/man/ja/xjc.1 +++ b/jdk/src/linux/doc/man/ja/xjc.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: xjc .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "xjc" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "xjc" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -xjc \- XMLޡեդJava饹˥ѥ뤷ޤ -.SH "" +xjc \- XMLスキーマ・ファイルを完全注釈付きのJavaクラスにコンパイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,23 +64,23 @@ xjc \- XML .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP schema \fIfile/URL/dir/jar \&.\&.\&.\fR .RS 4 -XMLޡեξꡣ\fIdir\fRꤵƤϡ٤ƤΥޡե뤬ѥ뤵ޤ\fIjar\fRꤵƤϡ\fI/META\-INF/sun\-jaxb\&.episode\fRХǥ󥰡ե뤬ѥ뤵ޤ +XMLスキーマ・ファイルの場所。\fIdir\fRが指定されている場合は、すべてのスキーマ・ファイルがコンパイルされます。\fIjar\fRが指定されている場合は、\fI/META\-INF/sun\-jaxb\&.episode\fRバインディング・ファイルがコンパイルされます。 .RE .PP \-b \fIbindinfo\fR .RS 4 -Хǥ󥰡եξꡣ +バインディング・ファイルの場所。 .RE -.SH "" +.SH "説明" .PP -ץåȥեbinǥ쥯ȥˤŬڤ\fIxjc\fR롦ץȤѤơХǥ󥰡ѥưޤХǥ󥰡ѥ¹ԤAnt⤢ޤhttp://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html -Using the XJC with Ant򻲾ȤƤ -.SH "ץ" +プラットフォームのbinディレクトリにある適切な\fIxjc\fRシェル・スクリプトを使用して、バインディング・コンパイラを起動します。バインディング・コンパイラを実行するAntタスクもあります。http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.htmlの +Using the XJC with Antを参照してください +.SH "オプション" .sp .RS 4 .ie n \{\ @@ -90,7 +90,7 @@ Using the XJC with Ant .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ⻲ȤƤ +非標準オプションも参照してください .RE .sp .RS 4 @@ -101,167 +101,167 @@ Using the XJC with Ant .sp -1 .IP \(bu 2.3 .\} -侩Ǻ줿ץ⻲ȤƤ +非推奨で削除されたオプションも参照してください .RE .PP \-nv .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡޤ˸̩ʸڤ¹ԤޤΥץѤȡ̩ʥ޸ڤ̵ˤʤޤϡХǥ󥰡ѥ餬ڤڼ¹ԤʤȤȤǤϤޤ󡣤긷̩Ǥʤڤ¹ԤȤȤǤ +デフォルトでは、XJCバインディング・コンパイラは、ソース・スキーマを処理する前に厳密な検証を実行します。このオプションを使用すると、厳密なスキーマ検証か無効になります。これは、バインディング・コンパイラが検証を一切実行しないということではありません。より厳密でない検証を実行するということです。 .RE .PP \-extension .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJAXBͤCompatibilityξϤƤ롼̩˶ޤϿE\&.2ˤϡJAXB v1\&.0ǴˤϥݡȤƤʤϢW3C XML޵ǽƤޤˤäƤϡΥåͭˤʤ\fI\-extension\fR⡼ɤǤεǽѤǤ礬ޤޤǥեȤθ̩ʥ⡼ɤǤϡͤƤХǥ󥰡ޥΤߤѤǤޤ\fI\-extension\fRåꤹСJAXB Vendor ExtensionѤǤޤ +デフォルトでは、XJCバインディング・コンパイラは、JAXB仕様のCompatibilityの章で説明されているルールを厳密に強制します。付録E\&.2には、JAXB v1\&.0で完全にはサポートされていない一連のW3C XMLスキーマ機能が定義されています。場合によっては、このスイッチで有効になる\fI\-extension\fRモードでそれらの機能が使用できる場合があります。また、デフォルトの厳密なモードでは、仕様に定義されているバインディング・カスタマイズのみが使用できます。\fI\-extension\fRスイッチを指定すれば、JAXB Vendor Extensionを使用できます。 .RE .PP \-b \fIfile\fR .RS 4 -볰Хǥ󥰡ե1ĤޤʣꤷޤХǥ󥰡ե뤴Ȥ\fI\-b\fRåꤹɬפޤХǥ󥰡եιʸϽǤʣΥޤΥޥޤޤ1ĤΥХǥ󥰡եѤꡢΥޥʣΥХǥ󥰡եʬ䤷Ǥޤ򼨤ޤ\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings123\&.xjb\fR -\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings1\&.xjb \-b bindings2\&.xjb \-b bindings3\&.xjb\fRޤޥɥ饤˥ޡեȥХǥ󥰡եꤹ֤ǤդǤ +処理する外部バインディング・ファイルを1つまたは複数指定します。バインディング・ファイルごとに\fI\-b\fRスイッチを指定する必要があります。外部バインディング・ファイルの構文は柔軟です。複数のスキーマのカスタマイズが含まれる1つのバインディング・ファイルを使用したり、それらのカスタマイズを複数のバインディング・ファイルに分割したりできます。次に例を示します。\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings123\&.xjb\fR +\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings1\&.xjb \-b bindings2\&.xjb \-b bindings3\&.xjb\fRまた、コマンドラインにスキーマ・ファイルとバインディング・ファイルを指定する順番は任意です。 .RE .PP \-d \fIdir\fR .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJavaƥġ饹򸽺ߤΥǥ쥯ȥޤΥץѤȡؽϥǥ쥯ȥǤޤϥǥ쥯ȥϤǤ¸ߤƤɬפޤXJCХǥ󥰡ѥǤϺޤ +デフォルトでは、XJCバインディング・コンパイラは、Javaコンテンツ・クラスを現在のディレクトリに生成します。このオプションを使用すると、代替出力ディレクトリを指定できます。出力ディレクトリはすでに存在している必要があります。XJCバインディング・コンパイラでは作成されません。 .RE .PP \-p \fIpkg\fR .RS 4 -Υޥɥ饤󡦥ץǥåȡѥåꤷ硢λƤϡѥå̾Ф뤹٤ƤΥХǥ󥰡ޥ䡢ͤǵꤵƤǥեȤΥѥå̾르ꥺͥ褵ޤ +このコマンドライン・オプションでターゲット・パッケージを指定した場合、その指定内容は、パッケージ名に対するすべてのバインディング・カスタマイズや、仕様で規定されているデフォルトのパッケージ名アルゴリズムよりも優先されます。 .RE .PP \-httpproxy \fIproxy\fR .RS 4 -\fI[user[:password]@]proxyHost[:proxyPort]\fRHTTPޤHTTPSץꤷޤŤ\fI\-host\fR\fI\-port\fRץϡ̸ߴΤ˰³RIǥݡȤޤ侩ȤʤޤΥץǻꤵ줿ѥɤϡtopޥɤѤ¾Υ桼ɽǤǤƥˤϡ\fI\-httpproxyfile\fRѤƤ +\fI[user[:password]@]proxyHost[:proxyPort]\fR形式でHTTPまたはHTTPSプロキシを指定します。古い\fI\-host\fRおよび\fI\-port\fRオプションは、下位互換性のために引き続きRIでサポートされますが、非推奨となりました。このオプションで指定されたパスワードは、topコマンドを使用する他のユーザーが表示できる引数です。セキュリティを高めるには、\fI\-httpproxyfile\fRを使用してください。 .RE .PP \-httpproxyfile file .RS 4 -եѤơHTTPޤHTTPSץꤷޤ\fI\-httpproxy\fRץƱǤΥե˻ꤵ줿ѥɤ¾Υ桼ɽ뤳ȤϤǤޤ +ファイルを使用して、HTTPまたはHTTPSプロキシを指定します。形式は\fI\-httpproxy\fRオプションと同じですが、このファイル内に指定されたパスワードを他のユーザーが表示することはできません。 .RE .PP \-classpath arg .RS 4 -\fIjxb:javaType\fRxjc:\fIsuperClass\fRޥѤ륯饤ȡץꥱΥ饹եθꤷޤ +\fIjxb:javaType\fRおよびxjc:\fIsuperClass\fRカスタマイズが使用するクライアント・アプリケーションのクラス・ファイルの検索場所を指定します。 .RE .PP \-catalog file .RS 4 -ƥƥȤ褹륫եꤷޤTR9401XCatalogOASIS XML CatalogγƷݡȤޤhttp://xerces\&.apache\&.org/xml\-commons/components/resolver/resolver\-article\&.html -XML Entity and URI Resolvers򻲾ȤƤ +外部エンティティ参照を解決するカタログ・ファイルを指定します。TR9401、XCatalogおよびOASIS XML Catalogの各形式がサポートされます。http://xerces\&.apache\&.org/xml\-commons/components/resolver/resolver\-article\&.htmlの +XML Entity and URI Resolversを参照してください .RE .PP \-readOnly .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJavaեߤݸޤ󡣤ΥץѤȡXJCХǥ󥰡ѥJavaŪɼѤˤޤ +デフォルトでは、XJCバインディング・コンパイラは、生成するJavaソース・ファイルを書込みから保護しません。このオプションを使用すると、XJCバインディング・コンパイラは生成されるJavaソースを強制的に読取り専用にします。 .RE .PP \-npa .RS 4 -\fI**/package\-info\&.java\fRؤΥѥå٥ޤΥåѤ륳ɤǤϡ᤬¾ѥ饹ޤ +\fI**/package\-info\&.java\fRへのパッケージ・レベルの注釈の生成を抑制します。このスイッチを使用して生成するコードでは、これらの注釈が他の生成済クラスに内部化されます。 .RE .PP \-no\-header .RS 4 -¿Υȥॹפޤե롦إåȤޤѤȡ줿ɤ\fIdiff\fRޥɤȤθߴ궯ʤޤ +多少のメモとタイムスタンプを含むファイル・ヘッダー・コメントの生成を抑制します。これを使用すると、生成されたコードと\fIdiff\fRコマンドとの互換性がより強くなります。 .RE .PP \-target 2\&.0 .RS 4 -JAXB 2\&.1ǽ˰¸륳ɤʤ褦ˤޤˤꡢ줿ɤJAXB 2\&.0󥿥Ķ(Java SE 6ʤ)Ǽ¹ԤǤ褦ˤʤޤ +JAXB 2\&.1機能に依存するコードを生成しないようにします。これにより、生成されたコードをJAXB 2\&.0ランタイム環境(Java SE 6など)で実行できるようになります。 .RE .PP \-xmlschema .RS 4 -ϥޤW3C XMLޤȤưޤ(ǥե)Υåꤷʤ硢ϥޤW3C XMLޤƱ褦˰ޤ +入力スキーマをW3C XMLスキーマとして扱います(デフォルト)。このスイッチを指定しない場合、入力スキーマはW3C XMLスキーマと同じように扱われます。 .RE .PP \-relaxing .RS 4 -ϥޤRELAX NGȤưޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをRELAX NGとして扱います(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-relaxing\-compact .RS 4 -ϥޤRELAX NG̹ʸȤƽޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをRELAX NG圧縮構文として処理します(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-dtd .RS 4 -ϥޤXML DTDȤưޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをXML DTDとして扱います(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-wsdl .RS 4 -ϤWSDLȤưΥޤ򥳥ѥ뤷ޤ(Ṳ̄ݡ) +入力をWSDLとして扱い、その内部のスキーマをコンパイルします(試験的および未サポート)。 .RE .PP \-quiet .RS 4 -ĽٹʤɡѥνϤޤ +進捗情報や警告など、コンパイラの出力を抑制します。 .RE .PP \-verbose .RS 4 -åϤΥ顼ȯ˥åȥ졼ɽꤹʤɡƾĹˤʤޤ +情報メッセージを出力したり特定のエラー発生時にスタック・トレースを表示したりするなど、きわめて冗長になります。 .RE .PP \-help .RS 4 -ѥ顦åΥޥ꡼ɽޤ +コンパイラ・スイッチのサマリーを表示します。 .RE .PP \-version .RS 4 -ѥΥСɽޤ +コンパイラのバージョン情報を表示します。 .RE .PP \fIschema file/URL/dir\fR .RS 4 -ѥоݤȤʤ1ĤޤʣΥޡեꤷޤǥ쥯ȥꤹ硢\fIxjc\fRޥɤϤ٤ƤΥޡե򥹥󤷤ƥѥ뤷ޤ +コンパイル対象となる1つまたは複数のスキーマ・ファイルを指定します。ディレクトリを指定する場合、\fIxjc\fRコマンドはすべてのスキーマ・ファイルをスキャンしてコンパイルします。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP \-XLocator .RS 4 -줿ɤǤϡ󲽤θJava Bean󥹥󥹤˴ޤޤ륽XML˴ؤSAX Locator󤬸ޤ +生成されたコードでは、非整列化の後にJava Beanインスタンスに含まれるソースXMLに関するSAX Locator情報が公開されます。 .RE .PP \-Xsync\-methods .RS 4 -줿٤ƤΥ᥽åɡ˥\fIsynchronized\fRɤޤޤ +生成されたすべてのメソッド・シグニチャに\fIsynchronized\fRキーワードが含められます。 .RE .PP \-mark\-generated .RS 4 -줿ɤ\fI@javax\&.annotation\&.Generated\fRդޤ +生成されたコードに注釈\fI@javax\&.annotation\&.Generated\fRを付けます。 .RE .PP \-episode file .RS 4 -ѥ뤴Ȥ˻ꤵ줿ԥɡեޤ +コンパイルごとに指定されたエピソード・ファイルを生成します。 .RE -.SS "侩Ǻ줿ץ" +.SS "非推奨で削除されたオプション" .PP \-host & \-port .RS 4 -Υץ\fI\-httpproxy\fRץ֤ޤΥץϡ̸ߴݤ뤿˥ݡȤޤɥȤˤϵܤ줺Υ꡼Ǻǽ⤢ޤ +これらのオプションは\fI\-httpproxy\fRオプションで置き換えられました。これらのオプションは、下位互換性を確保するためにサポートされますが、ドキュメントには記載されず、将来のリリースで削除される可能性もあります。 .RE .PP \-use\-runtime .RS 4 -JAXB 2\&.0ͤǤϡܿΤ󥿥Ķ줿ᡢJAXB RI\fI**/impl/runtime \fRѥåɬפʤʤޤΤᡢΥåפȤʤꡢޤ +JAXB 2\&.0仕様では、移植性のあるランタイム環境が定義されたため、JAXB RIが\fI**/impl/runtime \fRパッケージを生成する必要がなくなりました。このため、このスイッチは不要となり、削除されました。 .RE .PP \-source .RS 4 -\fI\-source\fRߴåϡJAXB 2\&.0κǽEarly AccessǤƳޤΥåJAXB 2\&.0κΥ꡼ޤ1\&.0\&.xɤɬפϡ1\&.0\&.xɡ١Υ󥹥ȡѤƤ +\fI\-source\fR互換性スイッチは、JAXB 2\&.0の最初のEarly Access版で導入されました。このスイッチはJAXB 2\&.0の今後のリリースから削除されます。1\&.0\&.xコードを生成する必要がある場合は、1\&.0\&.xコード・ベースのインストールを使用してください。 .RE -.SH "ѥ" +.SH "コンパイラの制限" .PP -̾ϡϢ뤹٤ƤΥޤƱХǥ󥰡ѥ顦åꤷ1Ĥñ̤Ȥƥѥ뤹ΤǤǤ\fIxjc\fRޥɤμ¹Իˤϡ¥ꥹȤαդƤΤۤȤɤϡ\fIxjc\fRޥɤ٤ƤӽФʣΥޤ򥳥ѥ뤹ˤΤƤϤޤޤ +通常は、関連するすべてのスキーマを、同じバインディング・コンパイラ・スイッチを指定して1つの単位としてコンパイルするのが最も安全です。\fIxjc\fRコマンドの実行時には、次の制限リストに留意してください。これらの問題のほとんどは、\fIxjc\fRコマンドを何度か呼び出して複数のスキーマをコンパイルする場合にのみ当てはまります。 .PP -ʣΥޤƱ˥ѥ뤹ϡåȤJavaѥå̾˼̤ͥΥ롼뤬ŬѤ뤳ȤդƤ +複数のスキーマを同時にコンパイルする場合は、ターゲットのJavaパッケージ名に次の優先順位のルールが適用されることに注意してください。 .sp .RS 4 .ie n \{\ @@ -271,7 +271,7 @@ JAXB 2\&.0 .sp -1 .IP " 1." 4.2 .\} -\fI\-p\fRץ󤬺Ǥͥ褵ޤ +\fI\-p\fRオプションが最も優先されます。 .RE .sp .RS 4 @@ -282,7 +282,7 @@ JAXB 2\&.0 .sp -1 .IP " 2." 4.2 .\} -\fIjaxb:package\fRΥޥ +\fIjaxb:package\fRのカスタマイズ。 .RE .sp .RS 4 @@ -293,7 +293,7 @@ JAXB 2\&.0 .sp -1 .IP " 3." 4.2 .\} -\fItargetNamespace\fRƤϡ\fIt\fR\fIargetNamespace\fRͤƤJavaѥå̾Υ르ꥺŬѤޤ +\fItargetNamespace\fRが宣言されている場合は、\fIt\fR\fIargetNamespace\fRを仕様で定義されているJavaパッケージ名のアルゴリズムに適用します。 .RE .sp .RS 4 @@ -304,15 +304,15 @@ JAXB 2\&.0 .sp -1 .IP " 4." 4.2 .\} -\fItargetNamespace\fRƤʤϡ\fIgenerated\fRȤ̾Υϡɥɤ줿ѥåѤޤ +\fItargetNamespace\fRが宣言されていない場合は、\fIgenerated\fRという名前のハードコードされたパッケージを使用します。 .RE .PP -1ĤΥ͡ॹڡʣ\fIjaxb:schemaBindings\fRĤȤϤǤʤᡢۤʤJavaѥå˥ѥ餵Ʊ쥿åȡ͡ॹڡ2ĤΥޤĤȤϤǤޤ +1つのネームスペースが複数の\fIjaxb:schemaBindings\fRを持つことはできないため、異なるJavaパッケージにコンパイラされる同一ターゲット・ネームスペースが2つのスキーマを持つことはできません。 .PP -ƱJavaѥå˥ѥ餵륹ޤϤ٤ơƱXJCХǥ󥰡ѥɬפޤ̡˥ѥ뤹ȡͽۤɤ˵ǽޤ +同じJavaパッケージにコンパイラされるスキーマはすべて、同時にXJCバインディング・コンパイラに送信される必要があります。別々にコンパイルすると、予想どおりに機能しません。 .PP -ʣΥޡեˤޤִ롼פϡƱ˥ѥ뤹ɬפޤ -.SH "Ϣ" +複数のスキーマ・ファイルにまたがる要素置換グループは、同時にコンパイルする必要があります。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -322,7 +322,7 @@ JAXB 2\&.0 .sp -1 .IP \(bu 2.3 .\} -http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html +http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.htmlの Binding Compiler (xjc) .RE .sp @@ -334,7 +334,7 @@ Binding Compiler (xjc) .sp -1 .IP \(bu 2.3 .\} -http://www\&.oracle\&.com/technetwork/articles/javase/index\-140168\&.html +http://www\&.oracle\&.com/technetwork/articles/javase/index\-140168\&.htmlの Java Architecture for XML Binding (JAXB) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 b/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 index 76609bfd263..e85be92d09f 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: appletviewer .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "appletviewer" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "appletviewer" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -appletviewer \- Web֥饦γ¦ǥץåȤ¹Ԥޤ -.SH "" +appletviewer \- Webブラウザの外側でアプレットを実行します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,39 +64,39 @@ appletviewer \- Web .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fIurl\fR .RS 4 -ɽɥȤޤϥ꥽ξꡣǶڤ줿ʣURLǤޤ +表示するドキュメントまたはリソースの場所。空白で区切られた複数のURLを指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIappletviewer\fRޥɤ\fIurls\fR˻ꤵ줿ɥȤ뤤ϥ꥽³ơΥɥȤȤ뤽줾ΥץåȤȼΥɥɽޤurlsˤäƻȤ줿ɥȤ\fIOBJECT\fR\fIEMBED\fRޤ\fIAPPLET\fRǤɤΥץåȤ⻲ȤƤʤ硢\fIappletviewer\fRޥɤϲԤޤ\fIappletviewer\fRޥɤǥݡȤHTMLξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.htmlˤ -ץåȡӥ塼򻲾ȤƤ +\fIappletviewer\fRコマンドは\fIurls\fRに指定されたドキュメントあるいはリソースと接続して、そのドキュメントが参照するそれぞれのアプレットを独自のウィンドウで表示します。urlsによって参照されたドキュメントが、\fIOBJECT\fR、\fIEMBED\fRまたは\fIAPPLET\fRタグでどのアプレットも参照していない場合、\fIappletviewer\fRコマンドは何も行いません。\fIappletviewer\fRコマンドでサポートされるHTMLタグの詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/appletviewertags\&.htmlにある +アプレット・ビューア・タグを参照してください。 .PP -\fIappletviewer\fRޥɤϡRFC2396줿סᥫ˥˽äƥ󥳡ɤ줿URLɬפȤޤݡȤΤϡ󥳡ɤ줿URLΤߤǤե̾ˤĤƤϡRFC2396λͤ˽äƥ󥳡ɤƤɬפޤ +\fIappletviewer\fRコマンドは、RFC2396で定義されたエスケープ・メカニズムに従ってエンコードされたURLを必要とします。サポートされるのは、エンコードされたURLのみです。ただし、ファイル名については、RFC2396の仕様に従ってエンコードを解除しておく必要があります。 .PP -\fB:\fR +\fB注意:\fR The -\fIappletviewer\fRޥɤϳȯѤǤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.htmlˤ -ץ/ƥȡץꥱ󤪤ӥɤˤĤƤ򻲾ȤƤ -.SH "ץ" +\fIappletviewer\fRコマンドは開発専用です。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/aboutCodeSamples\&.htmlにある +サンプル/テスト・アプリケーションおよびコードについてを参照してください。 +.SH "オプション" .PP \-debug .RS 4 -\fIjdb\fRޥɤѤJavaǥХåǥץåȡӥ塼򳫻ϤơɥΥץåȤǥХåޤ +\fIjdb\fRコマンドを使用してJavaデバッガでアプレット・ビューアを開始して、ドキュメント中のアプレットをデバッグします。 .RE .PP \-encoding \fIencoding\-name\fR .RS 4 -HTMLեΥ󥳡ǥ̾ꤷޤ +入力HTMLファイルのエンコーディング名を指定します。 .RE .PP \-J\fIjavaoption\fR .RS 4 -ʸ\fIjavaoption\fRϡץåȡӥ塼¹ԤJava󥿥ץ꥿1ĤΰȤϤޤ˥ڡޤʤǤʣΰϡ٤ƤƬ\fI\-J\fRǻϤޤɬפޤϡѥμ¹ԴĶޤϥ꡼ѤĴͭǤ +文字列\fIjavaoption\fRは、アプレット・ビューアを実行するJavaインタプリタに1つの引数として渡されます。引数にスペースを含めないでください。複数の引数は、すべてが接頭辞\fI\-J\fRで始まる必要があります。これは、コンパイラの実行環境またはメモリー使用の調整に有効です。 .RE .PP diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 b/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 index 92b10e2e57d..f18c3f137f3 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: idlj .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "idlj" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "idlj" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -idlj \- ꤵ줿󥿥ե(IDL)եФJavaХǥ󥰤ޤ -.SH "" +idlj \- 指定されたインタフェース定義言語(IDL)ファイルに対してJavaバインディングを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,22 +64,22 @@ idlj \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤoptionsν֤ǤդǤ\fIidlfile\fR˻ꤹɬפޤ +コマンドライン・オプション。オプションを参照してください。optionsの順番は任意ですが、\fIidlfile\fRよりも前に指定する必要があります。 .RE .PP \fIidlfile\fR .RS 4 -󥿥ե(IDL)ˤޤޤե̾ +インタフェース定義言語(IDL)による定義が含まれるファイルの名前。 .RE -.SH "" +.SH "説明" .PP -IDL\-to\-Javaѥϡꤵ줿IDLեФJavaХǥ󥰤ޤХǥ󥰤ξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlˤ -Java IDL: Javaޥåԥ󥰤ؤIDL򻲾ȤƤ +IDL\-to\-Javaコンパイラは、指定されたIDLファイルに対してJavaバインディングを生成します。バインディングの詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlにある +Java IDL: Java言語マッピングへのIDLを参照してください。 .PP -IDL\-to\-JavaѥΰΥ꡼ˤϡ\fIidltojava\fRȤ̾äΤޤ -.SS "饤ȡХǥ󥰤ӥСХǥ󥰤ȯ" +IDL\-to\-Javaコンパイラの以前のリリースの中には、\fIidltojava\fRという名前だったものがあります。 +.SS "クライアント・バインディングおよびサーバー・バインディングの発行" .PP -\fIidlj\fRޥɤϡ饤¦Хǥ󥰤ޤ\fIMy\&.idl\fRȤ̾IDLեޤ +次の\fIidlj\fRコマンドは、クライアント側バインディングを含む\fIMy\&.idl\fRという名前のIDLファイルを生成します。 .sp .if n \{\ .RS 4 @@ -91,7 +91,7 @@ idlj My\&.idl .RE .\} .PP -ιʸϼƱǤ +前の構文は次と同等です。 .sp .if n \{\ .RS 4 @@ -103,7 +103,7 @@ idlj \-fclient My\&.idl .RE .\} .PP -ǤϡС¦Хǥ󥰤饤¦Хǥ󥰤ӥȥޤƤꡢϤ٤ơPOA (Ѿǥ)Ǥ +次の例では、サーバー側バインディングを生成し、クライアント側バインディングおよびスケルトンを含めており、これらはすべて、POA (継承モデル)です。 .sp .if n \{\ .RS 4 @@ -115,7 +115,7 @@ idlg \-fserver My\&.idl .RE .\} .PP -饤¦ȥС¦ξΥХǥ󥰤ϡΥޥ(ɤ)Τ1ĤѤޤ +クライアント側とサーバー側の両方のバインディングを生成する場合は、次のコマンド(どれも等価)のうちの1つを使用します。 .sp .if n \{\ .RS 4 @@ -128,7 +128,7 @@ idlj \-fall My\&.idl .RE .\} .PP -С¦Dzǽʥǥ2ĤޤܿǽХȷѾǥTieǥǤTieѾǥ򻲾ȤƤ +サーバー側で可能なモデルは2つあります。移殖可能サーバント継承モデルとTieモデルです。Tie委譲モデルを参照してください。 .if n \{\ .sp .\} @@ -138,21 +138,21 @@ idlj \-fall My\&.idl .nr an-break-flag 1 .br .ps +1 -\fBܿǽХȷѾǥ\fR +\fB移殖可能サーバント継承モデル\fR .ps -1 .br .PP -ǥեȤΥС¦ΥǥϡܿǽХȷѾǥǤ\fIMy\&.idl\fR\fIMy\fR󥿥եƤϡ\fIMyPOA\&.java\fRȤե뤬ޤ\fIMy\fR󥿥եμ󶡤ɬפꡢ\fIMy\fR󥿥ե\fIMyPOA\fR饹Ѿɬפޤ\fIMyPOA\&.java\fRϡhttp://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.htmlˤ -\fIorg\&.omg\&.PortableServer\&.Servant\fR饹ĥ륹ȥ꡼١ΥȥǤ +デフォルトのサーバー側のモデルは、移殖可能サーバント継承モデルです。\fIMy\&.idl\fR内で\fIMy\fRインタフェースが定義されている場合は、\fIMyPOA\&.java\fRというファイルが生成されます。\fIMy\fRインタフェースの実装を提供する必要があり、\fIMy\fRインタフェースは\fIMyPOA\fRクラスから継承する必要があります。\fIMyPOA\&.java\fRは、http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.htmlにある +\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスを拡張するストリームベースのスケルトンです。 .PP -\fIMy\fR󥿥եϡȥ󤬼IDL󥿥ե˴ϢդƤ\fIcallHandler\fR󥿥ե󥿥եޤ +\fIMy\fRインタフェースは、スケルトンが実装するIDLインタフェースに関連付けられている\fIcallHandler\fRインタフェースと操作インタフェースを実装します。 .PP -ݡ֥롦֥ȡץ(POA)\fIPortableServer\fR⥸塼ϡͥƥ֤\fIServant\fRޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.htmlˤ -ݡ֥롦֥ȡץ(POA)򻲾ȤƤ +ポータブル・オブジェクト・アダプタ(POA)の\fIPortableServer\fRモジュールは、ネイティブの\fIServant\fR型を定義します。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.htmlにある +ポータブル・オブジェクト・アダプタ(POA)を参照してください。 .PP -Javaץߥ󥰸Ǥϡ\fIServant\fRJava\fIorg\&.omg\&.PortableServer\&.Servant\fR饹˥ޥåפޤϡ٤ƤPOAХȼΥ١饹ȤƵǽץꥱ󡦥ץޤƤӽФȤΤǤ뤤ĤΥ᥽åɡPOAˤäƸƤӽФ졢ХȤư椹뤿˥桼С饤ɤǤ᥽åɤ󶡤ޤ +Javaプログラミング言語では、\fIServant\fR型はJavaの\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスにマップされます。これは、すべてのPOAサーバント実装のベース・クラスとして機能し、アプリケーション・プログラマが呼び出すことのできるいくつかのメソッド、およびPOAによって呼び出され、サーバントの動作を制御するためにユーザーがオーバーライドできるメソッドを提供します。 .PP -ѾǥΤ⤦1ĤΥץϡ\fI\-oldImplBase\fRե饰ѤơJava SE 1\&.4Υ꡼Javaץߥ󥰸ȸߴΤ륵С¦Хǥ󥰤뤳ȤǤ\-\fIoldImplBase\fRե饰ɸǡAPI侩ǤΥե饰ѤΤϡJava SE 1\&.3ǵҤ줿¸ΥСȤθߴɬפʾΤߤǤξ硢¸makeեѹơ\fI\-oldImplBase\fRե饰\fIidlj\fRѥɲäɬפޤʳξ硢POA١ΥС¦ޥåԥ󥰤ޤ̸ߴΤ륵С¦Хǥ󥰤ˤϡ¹Ԥޤ +継承モデルのもう1つのオプションは、\fI\-oldImplBase\fRフラグを使用して、Java SE 1\&.4より前のリリースのJavaプログラミング言語と互換性のあるサーバー側バインディングを生成することです。\-\fIoldImplBase\fRフラグは非標準で、これらのAPIは非推奨です。このフラグを使用するのは、Java SE 1\&.3で記述された既存のサーバーとの互換性が必要な場合のみです。その場合、既存のmakeファイルを変更して、\fI\-oldImplBase\fRフラグを\fIidlj\fRコンパイラに追加する必要があります。それ以外の場合、POAベースのサーバー側マッピングが生成されます。下位互換性のあるサーバー側バインディングを生成するには、次を実行します。 .sp .5v .RE .sp @@ -167,7 +167,7 @@ idlj \-fall \-oldImplBase My\&.idl .RE .\} .PP -\fIMy\&.idl\fR\fIMy\fR󥿥եƤϡ\fI_MyImplBase\&.java\fRȤե뤬ޤ\fIMy\fR󥿥եμ󶡤ɬפꡢ\fIMy\fR󥿥ե\fI_MyImplBase\fR饹Ѿɬפޤ +\fIMy\&.idl\fR内で\fIMy\fRインタフェースが定義されている場合は、\fI_MyImplBase\&.java\fRというファイルが生成されます。\fIMy\fRインタフェースの実装を提供する必要があり、\fIMy\fRインタフェースは\fI_MyImplBase\fRクラスから継承する必要があります。 .if n \{\ .sp .\} @@ -177,11 +177,11 @@ idlj \-fall \-oldImplBase My\&.idl .nr an-break-flag 1 .br .ps +1 -\fBTieѾǥ\fR +\fBTie委譲モデル\fR .ps -1 .br .PP -⤦1ĤΥС¦ǥϡTieǥȸƤФΤǤΥС¦ǥϡѾǥǤTieȥȥƱ뤳ȤϤǤʤᡢ̡ɬפޤΥޥɤˤäơTieǥѤΥХǥ󥰤ޤ +もう1つのサーバー側モデルは、Tieモデルと呼ばれるものです。このサーバー側モデルは、委譲モデルです。Tieとスケルトンを同時に生成することはできないため、それらは別々に生成する必要があります。次のコマンドによって、Tieモデル用のバインディングが生成されます。 .sp .5v .RE .sp @@ -196,7 +196,7 @@ idlj \-fallTIE My\&.idl .RE .\} .PP -\fIMy\fR󥿥եξ硢2ܤΥޥɤˤꡢ\fIMyPOATie\&.java\fRޤ\fIMyPOATie\fR饹ؤΥ󥹥ȥ饯ϡdelegateޤǤϡǥեȤPOAǥѤƤ뤿ᡢ󥹥ȥ饯ˤPOAɬפǤdelegateФƼ󶡤ɬפޤμ\fIMyOperations\fR󥿥եѾɬפΤߤǡ¾Υ饹ѾɬפϤޤ󡣤ORBȰ˻ѤˤϡȤмΤ褦\fIMyPOATie\fR饹Ǽåפɬפޤ +\fIMy\fRインタフェースの場合、2番目のコマンドにより、\fIMyPOATie\&.java\fRが生成されます。\fIMyPOATie\fRクラスへのコンストラクタは、delegateを取ります。この例では、デフォルトのPOAモデルを使用しているため、コンストラクタにもPOAが必要です。delegateに対して実装を提供する必要がありますが、この実装は\fIMyOperations\fRインタフェースから継承する必要があるのみで、その他のクラスから継承する必要はありません。これをORBと一緒に使用するには、たとえば次のように\fIMyPOATie\fRクラス内で実装をラップする必要があります。 .sp .if n \{\ .RS 4 @@ -222,9 +222,9 @@ My ref = tie\&._this(orb); .RE .\} .PP -¾μѾɬפ硢ɸηѾǥǤϤʤTieǥѤ뤳ȤǤޤJavaξϡ󥿥եηѾθĿ¤Ϥޤ󤬡饹ηѾ˻ѤǤ륹åȤ1ĤΤߤǤѾǥѤϡΥåȤͭޤTieǥѤȡΥåȤѤ줺桼ȼŪǻѤǤޤˡˤϡΥ٥뤬1ƳȤû꤬ޤ᥽åɤƤӽФȤˡ;ʬʥ᥽åɸƽФ1ȯޤ +他の実装から継承する必要がある場合、標準の継承モデルではなくTieモデルを使用することもできます。Javaの場合は、インタフェースの継承の個数に制限はありませんが、クラスの継承に使用できるスロットは1つのみです。継承モデルを使用した場合は、そのスロットが占有されます。Tieモデルを使用すると、そのスロットが使用されず、ユーザーが独自の目的で使用できます。この方法には、間接性のレベルが1つ導入されるという短所があります。メソッドを呼び出すときに、余分なメソッド呼出しが1回発生します。 .PP -С¦ξ硢Java SE 1\&.4ΥСJava˥ޥåԥ󥰤IDLΥСȸߴΤ롢TieǥΥХǥ󥰤Ǥ +サーバー側の生成の場合、Java SE 1\&.4より前のバージョンのJava言語にマッピングするIDLのバージョンと互換性のある、Tieモデルのバインディングです。 .sp .if n \{\ .RS 4 @@ -237,7 +237,7 @@ idlj \-oldImplBase \-fallTIE My\&.idl .RE .\} .PP -\fIMy\fR󥿥եξ硢ˤꡢ\fIMy_Tie\&.java\fRޤ\fIMy_Tie\fR饹ؤΥ󥹥ȥ饯ϡ\fIimpl\fR֥Ȥޤ\fIimpl\fRФƼ󶡤ɬפޤμ\fIHelloOperations\fR󥿥եѾɬפΤߤǡ¾Υ饹ѾɬפϤޤ󡣤ORBȰ˻ѤˤϡȤмΤ褦\fIMy_Tie\fRǼåפɬפޤ +\fIMy\fRインタフェースの場合、これにより、\fIMy_Tie\&.java\fRが生成されます。\fIMy_Tie\fRクラスへのコンストラクタは、\fIimpl\fRオブジェクトを取ります。\fIimpl\fRに対して実装を提供する必要がありますが、その実装は\fIHelloOperations\fRインタフェースから継承する必要があるのみで、その他のクラスから継承する必要はありません。しかし、これをORBと一緒に使用するには、たとえば次のように\fIMy_Tie\fR内で実装をラップする必要があります。 .sp .if n \{\ .RS 4 @@ -258,15 +258,15 @@ My ref = tie\&._this(orb); .if n \{\ .RE .\} -.SS "ȯԤ줿եذ֤λ" +.SS "発行されたファイルの代替位置の指定" .PP -ȯԤ줿ե򸽺ߤΥǥ쥯ȥʳΥǥ쥯ȥ֤ˤϡ\fIi\fR\fIdlj \-td /altdir My\&.idl\fRΥޥɤǥѥƤӽФޤ +発行されたファイルを現在のディレクトリ以外のディレクトリに置くには、\fIi\fR\fIdlj \-td /altdir My\&.idl\fRのコマンドでコンパイラを呼び出します。 .PP -\fIMy\fR󥿥եξ硢Хǥ󥰤ϡ\fI\&./My\&.java\fRǤϤʤ\fI/altdir/My\&.java\fRʤɤȯԤޤ -.SS "󥯥롼ɡեذ֤λ" +\fIMy\fRインタフェースの場合、バインディングは、\fI\&./My\&.java\fRではなく、\fI/altdir/My\&.java\fRなどに発行されます。 +.SS "インクルード・ファイルの代替位置の指定" .PP -\fIMy\&.idl\fRե뤬̤\fIidl\fRեǤ\fIMyOther\&.idl\fR򥤥󥯥롼ɤ硢ѥǤϡ\fIMyOther\&.idl\fRե뤬롦ǥ쥯ȥ¸ߤ뤳ȤȤƤޤȤС줬\fI/includes\fRˤϡΤ褦ʥޥɤǥѥƤӽФޤ +\fIMy\&.idl\fRファイルが別の\fIidl\fRファイルである\fIMyOther\&.idl\fRをインクルードする場合、コンパイラでは、\fIMyOther\&.idl\fRファイルがローカル・ディレクトリに存在することを前提としています。たとえば、それが\fI/includes\fRにある場合は、次のようなコマンドでコンパイラを呼び出します。 .sp .if n \{\ .RS 4 @@ -278,7 +278,7 @@ idlj \-i /includes My\&.idl .RE .\} .PP -ȤС\fI/moreIncludes\fRˤ\fIAnother\&.idl\fR\fIMy\&.idl\fR˥󥯥롼ɤƤΤǤСΤ褦ʥޥɤǥѥƤӽФޤ +たとえば、\fI/moreIncludes\fRにある\fIAnother\&.idl\fRも\fIMy\&.idl\fRにインクルードされているのであれば、次のようなコマンドでコンパイラを呼び出します。 .sp .if n \{\ .RS 4 @@ -290,7 +290,7 @@ idlj \-i /includes \-i /moreIncludes My\&.idl .RE .\} .PP -Τ褦ʷ\fIinclude\fRĹʤ뤿ᡢ󥯥롼ɡե򸡺򥳥ѥ˻ؼ뤿̤ˡѰդƤޤˡϡĶѿιͤȻƤޤ\fICLASSPATH\fRѿ˰ɽƤǥ쥯ȥidl\&.configȤ̾Υեޤ\fIidl\&.config\fRˡΤ褦ʷιԤޤ +このような形式の\fIinclude\fRは長くなるため、インクルード・ファイルを検索する場所をコンパイラに指示するための別の方法が用意されています。この方法は、環境変数の考え方と似ています。\fICLASSPATH\fR変数に一覧表示されているディレクトリ内にidl\&.configという名前のファイルを作成します。その\fIidl\&.config\fRの中に、次のような形式の行を入れます。 .sp .if n \{\ .RS 4 @@ -302,10 +302,10 @@ includes=/includes;/moreIncludes .RE .\} .PP -ѥϡΥե򸡺󥯥롼ɡꥹȤɤ߹ߤޤǤϡǥ쥯ȥδ֤ζڤʸϥߥ(;)ˤʤäƤޤζڤʸϡץåȥեˤäưۤʤޤWindowsץåȥեǤϥߥѤUNIXץåȥեǤϥѤʤɤǤ -.SS "󥯥롼ɡեФХǥ󥰤ȯ" +コンパイラは、このファイルを検索し、インクルード・リストを読み込みます。この例では、ディレクトリの間の区切り文字はセミコロン(;)になっています。この区切り文字は、プラットフォームによって異なります。Windowsプラットフォームではセミコロンを使用し、UNIXプラットフォームではコロンを使用するなどです。 +.SS "インクルード・ファイルに対するバインディングの発行" .PP -ǥեȤǤϡޥɥ饤˻ꤷ\fIidl\fRեƤ륤󥿥ե乽¤ΤʤɤˤĤƤΤߡJavaХǥ󥰤ޤ󥯥롼ɤ줿եƤ뷿ˤĤƤޤ󡣤ȤС2Ĥ\fIidl\fRեˤĤƹͤƤߤޤ +デフォルトでは、コマンドラインに指定した\fIidl\fRファイルで定義されているインタフェースや構造体などについてのみ、Javaバインディングが生成されます。インクルードされたファイルで定義されている型については生成されません。たとえば、次の2つの\fIidl\fRファイルについて考えてみます。 .sp .if n \{\ .RS 4 @@ -328,7 +328,7 @@ interface MyOther .RE .\} .PP -ǥեȤΥ롼˴ؤƷٹ𤬤ޤХ롦פɽ\fI#include\fRʸϡҤΤȤ˽ޤ\fI#include\fRʸϡݡʸȸʤȤǤޤϤޤ줿ɽ\fI#include\fRʸϡΰ̣Ǥ\fI#include\fRʸȤƽޤĤޤꡢ󥯥롼ɤ줿եˤ륳ɤΥեˤΤޤɽƤ뤫Τ褦˽졢ФJavaХǥ󥰤ȯԤޤϤǤ +デフォルトのルールに関して警告があります。グローバル・スコープに表示される\fI#include\fR文は、前述のとおりに処理されます。これらの\fI#include\fR文は、インポート文と見なすことができます。囲まれたスコープ内に表示される\fI#include\fR文は、本当の意味での\fI#include\fR文として処理されます。つまり、インクルードされたファイルにあるコードが、元のファイルにそのまま表示されているかのように処理され、それに対してJavaバインディングが発行されます。次はその例です。 .sp .if n \{\ .RS 4 @@ -356,7 +356,7 @@ enum E {one, two, three}; .RE .\} .PP -\fI idlj My\&.idl \fR¹ԤơJavaեμΥꥹȤޤݡʸȤߤʤ\fI#include\fRƤᡢ\fIMyOther\&.java\fRޤǤΰ̣Ǥ\fI#include\fRƤᡢ\fIE\&.java\fRޤ\fIEmbedded\&.idl\fRե뤬\fIMy\fR󥿥եΥ˥󥯥롼ɤƤ뤿ᡢ\fIMy\fRΥ(Ĥޤꡢ\fIMyPackage\fR)Ƥޤ\fI\-emitAll\fRե饰Ѥ硢󥯥롼ɤ줿٤ƤΥեˤ뤹٤ƤηȯԤޤ +\fI idlj My\&.idl \fRを実行して、Javaファイルの次のリストを生成します。インポート文とみなされる\fI#include\fRに定義されていたため、\fIMyOther\&.java\fRは生成されませんでした。ただし、本当の意味での\fI#include\fRで定義されていたため、\fIE\&.java\fRは生成されました。\fIEmbedded\&.idl\fRファイルが\fIMy\fRインタフェースのスコープ内にインクルードされているため、\fIMy\fRのスコープ内(つまり、\fIMyPackage\fR内)に生成されています。\fI\-emitAll\fRフラグを使用した場合、インクルードされたすべてのファイルにあるすべての型が発行されます。 .sp .if n \{\ .RS 4 @@ -374,9 +374,9 @@ enum E {one, two, three}; .if n \{\ .RE .\} -.SS "ѥåƬ" +.SS "パッケージの接頭辞の挿入" .PP -ABCȤ̾βҤΤ˺ȤƤơΤ褦IDLեۤȤޤ礦 +ABCという名前の会社のために作業していて、次のようなIDLファイルを構築したとしましょう。 .sp .if n \{\ .RS 4 @@ -394,7 +394,7 @@ module Widgets .RE .\} .PP -IDL\-to\-Javaѥ𤷤ƤΥե¹Ԥ硢W1W2ФJavaХǥ󥰤ϡ\fIWidgets\fRѥå˳ǼޤȳδˤȡҤΥѥåϡ\fIcom\&.<company name>\fRȤ̾Υѥå֤ȤˤʤäƤޤδ˽ˤϡѥå̾\fIcom\&.abc\&.Widgets\fRˤɬפޤΥѥåƬWidgets⥸塼ղäˤϡΥޥɤ¹Ԥޤ +IDL\-to\-Javaコンパイラを介してこのファイルを実行した場合、W1およびW2に対するJavaバインディングは、\fIWidgets\fRパッケージ内に格納されます。業界の慣例によると、会社のパッケージは、\fIcom\&.<company name>\fRという名前のパッケージ内に置くことになっています。この慣例に従うには、パッケージ名を\fIcom\&.abc\&.Widgets\fRにする必要があります。このパッケージ接頭辞をWidgetsモジュールに付加するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -406,30 +406,30 @@ idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl .RE .\} .PP -Widgets\&.idl򥤥󥯥롼ɤƤIDLե뤬ϡΥޥɤˤ\fI\-pkgPrefix\fRե饰ɬפǤΥե饰ꤷʤȡIDLեϡ\fIcom\&.abc\&.Widgets\fRѥåǤϤʤ\fIWidgets\fRѥå򸡺뤳Ȥˤʤޤ +Widgets\&.idlをインクルードしているIDLファイルがある場合は、そのコマンドにも\fI\-pkgPrefix\fRフラグが必要です。このフラグを指定しないと、そのIDLファイルは、\fIcom\&.abc\&.Widgets\fRパッケージではなく、\fIWidgets\fRパッケージを検索することになります。 .PP -ƬɬפʥѥåĤ⤢ϡҤidl\&.configեƬꤹΤñǤѥåƬγƹԤϡ\fIPkgPrefix\&.<type>=<prefix>\fRηǤɬפޤҤιԤǤϡ\fIPkgPrefix\&.Widgets=com\&.abc\fRˤʤޤΥץϡݥȥIDˤϱƶޤ -.SS "ѥΥܥ" +接頭辞が必要なパッケージがいくつもある場合は、前述のidl\&.configファイルで接頭辞を指定するのが簡単です。パッケージ接頭辞の各行は、\fIPkgPrefix\&.<type>=<prefix>\fRの形式である必要があります。前述の例の行では、\fIPkgPrefix\&.Widgets=com\&.abc\fRになります。このオプションは、リポジトリIDには影響しません。 +.SS "コンパイル前のシンボルの定義" .PP -ѥѤΥܥ뤬IDLեƤʤϡΥܥɬפޤϡȤСХǥ˥ǥХåɤȤȤ˻Ѥޤޥ\fIidlj \-d MYDEF My\&.idl \fRϡMy\&.idl˹\fI#define MYDEF\fR֤Ʊˤʤޤ -.SS "¸ΥХǥ󥰤ݻ" +コンパイル用のシンボルがIDLファイル内で定義されていない場合は、そのシンボルを定義する必要があります。これは、たとえば、バインディング内にデバッグ・コードを組み入れるときに使用します。コマンド\fIidlj \-d MYDEF My\&.idl \fRは、My\&.idl内に行\fI#define MYDEF\fRを配置した場合と同等になります。 +.SS "既存のバインディングの保持" .PP -JavaХǥ󥰡ե뤬Ǥ¸ߤϡ\fI\-keep\fRե饰ꤹȡѥˤ񤭤ǤޤǥեȤǤϡǤ¸ߤ뤫ɤˤ餺٤ƤΥե뤬ޤΥե򥫥ޥ(ƤΤǤȤʳϥޥ򤱤)\fI\-keep\fRץͭѤǤޥ\fIidlj \-keep My\&.idl\fRϡǤ¸ߤʤ٤ƤΥ饤¦Хǥ󥰤ȯԤޤ -.SS "ѥοĽɽ" +Javaバインディング・ファイルがすでに存在する場合は、\fI\-keep\fRフラグを指定すると、コンパイラによる上書きを回避できます。デフォルトでは、すでに存在するかどうかにかかわらず、すべてのファイルが生成されます。これらのファイルをカスタマイズした場合(ただし、それらの内容が正確であるとき以外はカスタマイズは避ける)、\fI\-keep\fRオプションは有用です。コマンド\fIidlj \-keep My\&.idl\fRは、すでに存在しないすべてのクライアント側バインディングを発行します。 +.SS "コンパイルの進捗状況の表示" .PP -IDL\-to\-Javaѥϡ¹ԤγʳǾ֥åޤ\fI\-v\fRץѤơ\fIidlj \-v My\&.idl\fRΤ褦ʾĹ⡼ɤ򥢥ƥֲޤ +IDL\-to\-Javaコンパイラは、実行の各段階で状態メッセージを生成します。\fI\-v\fRオプションを使用して、\fIidlj \-v My\&.idl\fRのような冗長モードをアクティブ化します。 .PP -ǥեȤǤϡѥϾĹ⡼ɤǤϼ¹Ԥޤ -.SS "Сɽ" +デフォルトでは、コンパイラは冗長モードでは実行されません。 +.SS "バージョン情報の表示" .PP -IDL\-to\-JavaѥΥӥɡСɽˤϡޥɥ饤\fIidlj \-version\fR\fI\-version\fRץꤷޤ +IDL\-to\-Javaコンパイラのビルド・バージョンを表示するには、コマンドライン\fIidlj \-version\fRで\fI\-version\fRオプションを指定します。 .PP -Сϡѥˤä줿Хǥˤ񤭹ޤƤޤΥץ򥳥ޥɥ饤˻ꤹȡʳΥץꤷƤ⡢٤̵뤵ޤ -.SH "ץ" +バージョン情報は、コンパイラによって生成されたバインディング内にも書き込まれています。このオプションをコマンドラインに指定すると、それ以外のオプションを指定しても、すべて無視されます。 +.SH "オプション" .PP \-d \fIsymbol\fR .RS 4 -ΥץϡIDLե˼Τ褦ʹԤɲäǤ +このオプションは、IDLファイルに次のような行を追加した場合と等価です。 .sp .if n \{\ .RS 4 @@ -444,46 +444,46 @@ IDL\-to\-Java .PP \-demitAll .RS 4 -\fI#include\fRեƤΤޤơ٤ƤηȯԤޤ +\fI#include\fRファイル内で定義されているものも含めて、すべての型を発行します。 .RE .PP \-fside .RS 4 -ȯԤХǥ󥰤ޤ\fIside\fRѥ᡼ˤϡ\fIclient\fR\fIserver\fR\fIserverTIE\fR\fIall\fRޤ\fIallTIE\fRǤޤ\fI\-fserverTIE\fRޤ\fI\-fallTIE\fRץꤹȡѾǥ롦ȥȯԤޤե饰ꤷʤ硢\fI\-fclient\fR˥ǥեꤵޤ +発行するバインディングを定義します。\fIside\fRパラメータには、\fIclient\fR、\fIserver\fR、\fIserverTIE\fR、\fIall\fRまたは\fIallTIE\fRを指定できます。\fI\-fserverTIE\fRまたは\fI\-fallTIE\fRオプションを指定すると、委譲モデル・スケルトンが発行されます。フラグを指定しない場合、\fI\-fclient\fRにデフォルト設定されます。 .RE .PP \-i \fIinclude\-path\fR .RS 4 -ǥեȤǤϡ󥯥롼ɡեϸߤΥǥ쥯ȥ꤫鸡ޤΥץꤹȡ¾Υǥ쥯ȥɲäǤޤ +デフォルトでは、インクルード・ファイルは現在のディレクトリから検索されます。このオプションを指定すると、他のディレクトリを追加できます。 .RE .PP \-i \fIkeep\fR .RS 4 -ե뤬Ǥ¸ߤƤϡΥե뤬񤭤ޤ󡣥ǥեȤǤϡ񤭤ޤ +生成されるファイルがすでに存在している場合は、そのファイルが上書きされません。デフォルトでは、上書きされます。 .RE .PP \-noWarn .RS 4 -ٹåɽʤ褦ˤޤ +警告メッセージを表示しないようにします。 .RE .PP \-oldImplBase .RS 4 -1\&.4JDK ORBȸߴΤ륹ȥޤǥեȤǤϡPOAѾǥΥС¦Хǥ󥰤ޤΥץꤹȡ\fIImplBase\fRѾǥΥ饹Ǥ륵С¦Хǥ󥰤ΤǡΥ꡼Javaץߥ󥰸Ȥβ̸ߴޤ +1\&.4より前のJDK ORBと互換性のあるスケルトンを生成します。デフォルトでは、POA継承モデルのサーバー側バインディングが生成されます。このオプションを指定すると、\fIImplBase\fR継承モデルのクラスであるサーバー側バインディングが生成されるので、以前のリリースのJavaプログラミング言語との下位互換性が得られます。 .RE .PP \-pkgPrefix \fItype\fR \fIprefix\fR .RS 4 -\fItype\fRե롦פǸФ줿ϡηФ뤹٤ƤΥեˤĤơJavaѥå̾\fIprefix\fRȤƬղäޤtypeϡȥåץ٥롦⥸塼ñ̾ɤΥ⥸塼⳰¦줿IDLñ̾Τɤ餫Ǥ +\fItype\fRがファイル・スコープで検出された場合は、その型に対して生成されるすべてのファイルについて、生成されるJavaパッケージ名に\fIprefix\fRという接頭辞が付加されます。typeは、トップレベル・モジュールの単純名か、どのモジュールよりも外側で定義されたIDL型の単純名のどちらかです。 .RE .PP \-pkgTranslate \fItype\fR \fIpackage\fR .RS 4 -̻Ҥ˥⥸塼̾typeФȡJavaѥåΤ٤ƤΥեˤĤơ̻ҤΤ̾package֤ޤǽ\fIpkgPrefix\fRѹԤޤtypeͤϡȥåץ٥Υ⥸塼ñ̾ޤϤ٤ƤΥ⥸塼γ줿IDLñ̾ǡʥѥå̾Τ˰פɬפޤ +識別子の中にモジュール名typeが検出されると、生成されるJavaパッケージ内のすべてのファイルについて、識別子の中のその名前がpackageで置き換えられます。最初に\fIpkgPrefix\fRの変更が行われます。typeの値は、トップレベルのモジュールの単純名、またはすべてのモジュールの外部で定義されたIDL型の単純名で、完全なパッケージ名に正確に一致する必要があります。 .sp -ʣѴ̻Ҥ˰פ硢˼褦ˡǤĹפ򤵤ޤ +複数の変換が識別子に一致する場合、次の例に示すように、最も長い一致が選択されます。 .sp -\fBޥ\fR: +\fBコマンド\fR: .sp .if n \{\ .RS 4 @@ -494,7 +494,7 @@ pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz .if n \{\ .RE .\} -\fB̤Ѵ\fR: +\fB結果の変換\fR: .sp .if n \{\ .RS 4 @@ -508,47 +508,47 @@ type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg .if n \{\ .RE .\} -ѥå̾\fIorg\fR\fIorg\fR\&.o\fImg\fRޤ\fIorg\&.omg\fRΥ֥ѥåϡѴǤޤ󡣤Υѥå̾Ѵ褦ȤȡߴΤʤɤ졢\fI\-pkgTranslate\fRθκǽΰȤƤΥѥåѤȡ顼Ȥưޤ +パッケージ名\fIorg\fR、\fIorg\fR\&.o\fImg\fR、または\fIorg\&.omg\fRのサブパッケージは、変換できません。これらのパッケージ名を変換しようとすると、互換性のないコードが生成され、\fI\-pkgTranslate\fRの後の最初の引数としてそれらのパッケージを使用すると、エラーとして扱われます。 .RE .PP \-skeletonName \fIxxx%yyy\fR .RS 4 -\fIxxx%yyy\fRȥ̾դѥȤƻѤޤǥեȤϼΤȤǤ\fIPOA\fR١饹ξ\fI%POA\fR -(\fI\-fserver\fRޤ\fI\-fall\fR)\fIoldImplBase\fR饹ξ\fI_%ImplBase\fR -(\-\fIoldImplBase\fR)(\fI\-fserver\fRޤ\fI\-fall\fR)) +\fIxxx%yyy\fRが、スケルトンに名前を付けるパターンとして使用されます。デフォルトは次のとおりです。\fIPOA\fRベース・クラスの場合は\fI%POA\fR +(\fI\-fserver\fRまたは\fI\-fall\fR)、\fIoldImplBase\fRクラスの場合は\fI_%ImplBase\fR +(\-\fIoldImplBase\fR)および(\fI\-fserver\fRまたは\fI\-fall\fR))。 .RE .PP \-td \fIdir\fR .RS 4 -ϥǥ쥯ȥȤơߤΥǥ쥯ȥǤϤʤ\fIdir\fRѤޤ +出力ディレクトリとして、現在のディレクトリではなく、\fIdir\fRが使用されます。 .RE .PP \-tieName \fIxxx%yyy\fR .RS 4 -ѥ˽äơ\fIxxx%yyy\fRѤޤǥեȤϼΤȤǤ\fIPOA\fR١饹ξ\fI%POA\fR -(\fI\-fserverTieޤ\-fallTie\fR)\fIoldImplBase\fR -tie饹ξ\fI_%Tie\fR -(\-\fIoldImplBase\fR)(\fI\-fserverTie\fRޤ\fI\-fallTie\fR)) +パターンに従って、\fIxxx%yyy\fRを使用します。デフォルトは次のとおりです。\fIPOA\fRベース・クラスの場合は\fI%POA\fR +(\fI\-fserverTieまたは\-fallTie\fR)、\fIoldImplBase\fR +tieクラスの場合は\fI_%Tie\fR +(\-\fIoldImplBase\fR)および(\fI\-fserverTie\fRまたは\fI\-fallTie\fR))。 .RE .PP -\-nowarn\-verbose +\-nowarn、\-verbose .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE .PP \-version .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE -.SH "»" +.SH "制限事項" .PP -Х롦Υפ줿̻ҤϡIDLץߥƥַ\fIObject\fRޤ\fIValueBase\fRƱ֤ˤʤǤϡܥɽμ̻ҤǥץɤƤ뤿ǤκĤȡ񤭤ޤϡ餯ŪǤ +グローバル・スコープ内のエスケープされた識別子は、IDLプリミティブ型の\fIObject\fRまたは\fIValueBase\fRと同じ綴りにしないでください。これは、シンボル表がこれらの識別子でプリロードされているためです。これらの再定義を許可すると、元の定義が上書きされます。これは、おそらく恒久的な制約です。 .PP -\fIfixed\fRȤIDLϥݡȤƤޤ -.SH "Τ" +\fIfixed\fRというIDL型はサポートされていません。 +.SH "既知の問題" .PP -Х뼱̻ҤˤĤƥݡȤޤͽʤ\fIimpl\fR֥ȤƤӽФȡ㳰ޤθϡ\fIServerDelegate\fR -DSI\fINullPointerException\fRˤ褦Ǥ +グローバル識別子についてインポートが生成されません。予期されないローカル\fIimpl\fRオブジェクトを呼び出すと、例外を受け取ります。しかし、その原因は、\fIServerDelegate\fR +DSIコード内の\fINullPointerException\fRにあるようです。 .br 'pl 8.5i 'bp diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jar.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jar.1 index dc1fc5869f7..d04f76e1c3b 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jar.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jar.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jar .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jar" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jar" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,9 +49,9 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jar \- Java Archive (JAR)եޤ -.SH "" -JARեκ +jar \- Java Archive (JAR)ファイルを操作します。 +.SH "概要" +JARファイルの作成 .sp .if n \{\ .RS 4 @@ -62,7 +62,7 @@ JAR .if n \{\ .RE .\} -JARեι +JARファイルの更新 .sp .if n \{\ .RS 4 @@ -73,7 +73,7 @@ JAR .if n \{\ .RE .\} -JARե +JARファイルの抽出 .sp .if n \{\ .RS 4 @@ -84,7 +84,7 @@ JAR .if n \{\ .RE .\} -JARեΥƥĤΥꥹ +JARファイルのコンテンツのリスト .sp .if n \{\ .RS 4 @@ -95,7 +95,7 @@ JAR .if n \{\ .RE .\} -JARեؤκɲ +JARファイルへの索引の追加 .sp .if n \{\ .RS 4 @@ -106,48 +106,48 @@ JAR .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIjar\fRޥɤϡZIPZLIB̷˴ŤѤΥ֤Ӱ̥ġǤ\fIjar\fRޥɤϡˤĤJavaץåȤ䥢ץꥱñΥ֤˥ѥå褦߷פޤץåȤ䥢ץꥱΥݡͥ(ե롢᡼ӥ)1ĤΥ֤˷礵ƤȡJava(֥饦ʤ)ϡΥݡͥȤ1HTTPȥ󥶥ǥɤ뤳ȤǤݡͥȤȤ˿³פˤʤޤˤꡢɻ֤ṳ̂ޤޤ\fIjar\fRޥɤϥեΰ̤Ԥᡢɻ֤ṳ̂ޤޤ\fIjar\fRޥɤˤäơեθġΥȥ˥ץåȺԤˤ̾񤭹뤿ᡢ۸ǧڤǽˤʤޤJARեϡ̤Ƥ뤫ɤˤ餺饹ѥΥȥȤƻѤǤޤ +\fIjar\fRコマンドは、ZIPおよびZLIB圧縮形式に基づく汎用のアーカイブおよび圧縮ツールです。ただし、\fIjar\fRコマンドは、主にいくつかのJavaアプレットやアプリケーションを単一のアーカイブにパッケージ化するように設計されました。アプレットやアプリケーションのコンポーネント(ファイル、イメージ、およびサウンド)が1つのアーカイブに結合されていると、Javaエージェント(ブラウザなど)は、それらのコンポーネントを1回のHTTPトランザクションでダウンロードすることができ、コンポーネントごとに新しい接続が不要になります。これにより、ダウンロード時間が大幅に短縮されます。また、\fIjar\fRコマンドはファイルの圧縮も行うため、ダウンロード時間がさらに短縮されます。また、\fIjar\fRコマンドによって、ファイル内の個々のエントリにアプレット作成者による署名を書き込めるため、配布元の認証が可能になります。JARファイルは、圧縮されているかどうかにかかわらず、クラス・パスのエントリとして使用できます。 .PP -\fIjar\fRޥɤιʸϡ\fItar\fRޥɤιʸ˻Ƥޤɬܤ\fIΰ\fR1Ĥ줿ʣ⡼ɤޤ¾ΰϡưѹ\fIץ\fRޤ¹Ԥ뤿ɬפ\fIڥ\fRѤޤ -.SH "ΰ" +\fIjar\fRコマンドの構文は、\fItar\fRコマンドの構文に似ています。必須の\fI操作の引数\fRの1つで定義された複数の操作モードがあります。他の引数は、操作の動作を変更する\fIオプション\fR、または操作を実行するために必要な\fIオペランド\fRを使用します。 +.SH "操作の引数" .PP -\fIjar\fRޥɤѤϡΰΤ줫ꤷƼ¹Ԥ򤹤ɬפޤޥɥ饤¾1ʸΥץȺߤ뤳ȤǤޤ̾ΰϻꤵǽΰǤ +\fIjar\fRコマンドを使用する場合は、次の操作の引数のいずれかを指定して実行される操作を選択する必要があります。コマンドラインで他の1文字のオプションと混在させることができますが、通常、操作の引数は指定される最初の引数です。 .PP c .RS 4 -JAR֤ޤ +新しいJARアーカイブを作成します。 .RE .PP i .RS 4 -JAR֤κޤ +JARアーカイブの索引情報を生成します。 .RE .PP t .RS 4 -JAR֤ΥƥĤꥹȤޤ +JARアーカイブのコンテンツをリストします。 .RE .PP u .RS 4 -JAR֤򹹿ޤ +JARアーカイブを更新します。 .RE .PP x .RS 4 -JAR֤եФޤ +JARアーカイブからファイルを抽出します。 .RE -.SH "ץ" +.SH "オプション" .PP -ΥץѤơJARեФޤɽˡ򥫥ޥޤ +次のオプションを使用して、JARファイルを作成、更新、抽出または表示する方法をカスタマイズします。 .PP e .RS 4 -\fIentrypoint\fRڥɤǻꤵ륯饹򡢼¹ԲǽJARե˥Хɥ뤵륹ɥJavaץꥱΥȥꡦݥȤꤷޤΥץѤȡޥ˥եȡե\fIMain\-Class\fR°ͤޤϥС饤ɤޤ\fIe\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +\fIentrypoint\fRオペランドで指定されるクラスを、実行可能JARファイルにバンドルされるスタンドアロンJavaアプリケーションのエントリ・ポイントに設定します。このオプションを使用すると、マニフェスト・ファイル内の\fIMain\-Class\fR属性値が作成またはオーバーライドされます。\fIe\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .sp -ȤСΥޥɤǤϡ\fIMain\&.jar\fR֤\fIMain\&.class\fRեȤȤ˺ޤκݡޥ˥ե\fIMain\-Class\fR°ͤ\fIMain\fRꤵޤ +たとえば、次のコマンドでは、\fIMain\&.jar\fRアーカイブが\fIMain\&.class\fRファイルとともに作成されますが、その際、マニフェスト内の\fIMain\-Class\fR属性値は\fIMain\fRに設定されます。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ jar cfe Main\&.jar Main Main\&.class .if n \{\ .RE .\} -Java Runtime Environment (JRE)ϡΥޥɤ¹ԤơΥץꥱľܸƤӽФȤǤޤ +Java Runtime Environment (JRE)は、次のコマンドを実行して、このアプリケーションを直接呼び出すことができます。 .sp .if n \{\ .RS 4 @@ -169,7 +169,7 @@ java \-jar Main\&.jar .if n \{\ .RE .\} -ѥå˥ȥꡦݥȤΥ饹̾ޤޤƤ硢ɥå(\&.)ޤϥå(/)Τ줫ڤʸȤƻѤǤޤȤС\fIMain\&.class\fR\fImydir\fRȤ̾Υѥå˴ޤޤƤ硢ȥꡦݥȤϼΤ줫ˡǻǤޤ +あるパッケージ内にエントリ・ポイントのクラス名が含まれている場合、ドット(\&.)またはスラッシュ(/)のいずれかを区切り文字として使用できます。たとえば、\fIMain\&.class\fRが\fImydir\fRという名前のパッケージに含まれている場合、エントリ・ポイントは次のいずれかの方法で指定できます。 .sp .if n \{\ .RS 4 @@ -197,8 +197,8 @@ jar \-cfe Main\&.jar mydir\&.Main mydir/Main\&.class allbox tab(:); l. T{ - -Υޥ˥եȤˤ\fIMain\-Class\fR°ޤޤƤ\fIm\fRץ\fIe\fRץξƱ˻ꤹȡ\fIMain\-Class\fRλ꤬ޤˤʤޤΤޤˤäƥ顼ȯ\fIjar\fRޥɤκ乹λޤ +注意 +特定のマニフェストにも\fIMain\-Class\fR属性が含まれている場合に\fIm\fRオプションと\fIe\fRオプションの両方を同時に指定すると、\fIMain\-Class\fRの指定があいまいになります。このあいまいさによってエラーが発生し、\fIjar\fRコマンドの作成や更新の操作が終了します。 T} .TE .sp 1 @@ -208,42 +208,42 @@ T} .PP f .RS 4 -\fIjarfile\fRڥɤǻꤵ줿ե򡢺(\fIc\fR)(\fIu\fR)(\fIx\fR)ޤɽ(\fIt\fR)JARե̾ꤷޤ\fIf\fRץ󤪤\fIjarfile\fRڥɤάȡ\fIjar\fRޥɤˡ\fIstdin\fRJARե̾뤫(\fIx\fR\fIt\fRξ)JARե\fIstdout\fR뤳(\fIc\fR\fIu\fRξ)ؼޤ +\fIjarfile\fRオペランドで指定されたファイルを、作成(\fIc\fR)、更新(\fIu\fR)、抽出(\fIx\fR)または表示(\fIt\fR)されるJARファイルの名前に設定します。\fIf\fRオプションおよび\fIjarfile\fRオペランドを省略すると、\fIjar\fRコマンドに、\fIstdin\fRからのJARファイル名を受け入れるか(\fIx\fRおよび\fIt\fRの場合)、JARファイルを\fIstdout\fRに送信すること(\fIc\fRおよび\fIu\fRの場合)が指示されます。 .RE .PP m .RS 4 -(\fIMETA\-INF/MANIFEST\&.MF\fRΥ֤ˤ) -\fIjar\fRޥɤΥޥ˥եȡե\fImanifest\fRڥɤǻꤵ줿ե뤫顢°̾ͤΥڥޤޤ\fIjar\fRޥɤϡƱ̾Υȥ꤬Ǥ¸ߤ°̾ͤJARեɲäޤƱ̾Υȥ꤬Ǥ¸ߤ硢\fIjar\fRޥɤ°ͤ򹹿ޤ\fIm\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +(\fIMETA\-INF/MANIFEST\&.MF\fRのアーカイブにある) +\fIjar\fRコマンドのマニフェスト・ファイルの\fImanifest\fRオペランドで指定されたファイルから、属性の名前と値のペアを含めます。\fIjar\fRコマンドは、同じ名前のエントリがすでに存在する場合を除き、属性の名前と値をJARファイルに追加します。同じ名前のエントリがすでに存在する場合、\fIjar\fRコマンドは属性の値を更新します。\fIm\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .sp -ǥեȤΥޥ˥եȡեˤϴޤޤʤޥ˥եȤˡ̤Ū̾\-ͤ°ڥɲäǤޤȤС٥󡢥꡼󡢥ѥå󥰤ꤹ°ޤJAR˥Хɥ뤵줿ץꥱ¹Բǽˤ뤿°ɲäǤޤ\fIm\fRץλϡhttp://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -ץΥѥå˴ؤ򻲾ȤƤ +デフォルトのマニフェスト・ファイルには含まれないマニフェストに、特別な目的の名前\-値の属性ペアを追加できます。たとえば、ベンダー情報、リリース情報、パッケージ・シーリングを指定する属性、またはJARにバンドルされたアプリケーションを実行可能にするための属性を追加できます。\fIm\fRオプションの使用例は、http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +プログラムのパッケージ化に関する項を参照してください。 .RE .PP M .RS 4 -ޥ˥եȡե롦ȥʤ(\fIc\fR\fIu\fRξ)ޤϥޥ˥եȡե롦ȥ꤬¸ߤϺޤ(\fIu\fRξ)\fIM\fRץϡJARեκ(\fIc\fR)ޤϹ(\fIu\fR)˻ѤǤޤ +マニフェスト・ファイル・エントリを作成しない(\fIc\fRおよび\fIu\fRの場合)か、またはマニフェスト・ファイル・エントリが存在する場合は削除します(\fIu\fRの場合)。\fIM\fRオプションは、JARファイルの作成時(\fIc\fR)または更新時(\fIu\fR)に使用できます。 .RE .PP n .RS 4 -JARեκ(\fIc\fR)ˡΥץϡƥĤpack200(1)ޥɤΥѥåӥѥåαƶʤ褦˥֤ޤѤʤ硢̾դJARν̵̾ˤʤޤ +JARファイルの作成(\fIc\fR)時に、このオプションは、コンテンツがpack200(1)コマンドのパックおよびアンパック操作の影響を受けないようにアーカイブを正規化します。この正規化を使用しない場合、署名付きJARの署名は無効になります。 .RE .PP v .RS 4 -ܺ٤ʽϤɸϤޤ򻲾ȤƤ +詳細な出力を標準出力に生成します。例を参照してください。 .RE .PP 0 .RS 4 -() ZIP̤ѤʤJARե(\fIc\fR)ޤϹ(\fIu\fR)ޤ +(ゼロ) ZIP圧縮を使用しないでJARファイルを作成(\fIc\fR)または更新(\fIu\fR)します。 .RE .PP \-C \fIdir\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡΥץ\fIfile\fRڥɤǻꤵ줿եν˥ǥ쥯ȥŪѹޤϡUNIX -\fItar\fR桼ƥƥ\fI\-C\fRץƱͤˤʤ뤳ȤŪȤƤޤȤСΥޥɤˤäơ\fIclasses\fRǥ쥯ȥѹ졢Υǥ쥯ȥ꤫\fImy\&.jar\fR\fIBar\&.class\fRե뤬ɲäޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、このオプションは\fIfile\fRオペランドで指定されたファイルの処理中にディレクトリを一時的に変更します。この操作は、UNIX +\fItar\fRユーティリティの\fI\-C\fRオプションと同様になることを目的としています。たとえば、次のコマンドによって、\fIclasses\fRディレクトリに変更され、そのディレクトリから\fImy\&.jar\fRに\fIBar\&.class\fRファイルが追加されます。 .sp .if n \{\ .RS 4 @@ -254,7 +254,7 @@ jar uf my\&.jar \-C classes Bar\&.class .if n \{\ .RE .\} -ΥޥɤǤϡ\fIclasses\fRǥ쥯ȥ˰ưclassesǥ쥯ȥΤ٤ƤΥե\fImy\&.jar\fRɲäޤ(JARեˤ\fIclasses\fRǥ쥯ȥޤ)˸Υǥ쥯ȥäƤ顢\fIbin\fRǥ쥯ȥ˰ư\fIXyz\&.class\fR\fImy\&.jar\fRɲäޤ +次のコマンドでは、\fIclasses\fRディレクトリに移動し、classesディレクトリ内のすべてのファイルを\fImy\&.jar\fRに追加します(JARファイルには\fIclasses\fRディレクトリを作成しません)。次に元のディレクトリに戻ってから、\fIbin\fRディレクトリに移動し、\fIXyz\&.class\fRを\fImy\&.jar\fRに追加します。 .sp .if n \{\ .RS 4 @@ -265,7 +265,7 @@ jar uf my\&.jar \-C classes \&. \-C bin Xyz\&.class .if n \{\ .RE .\} -\fIclasses\fR\fIbar1\fRե\fIbar2\fRե뤬ޤޤƤ硢ҤΥޥɤ¹Ԥ塢JARեˤϼΤΤޤޤޤ +\fIclasses\fRに\fIbar1\fRファイルと\fIbar2\fRファイルが含まれている場合、前述のコマンドを実行した後、JARファイルには次のものが含まれます。 .sp .if n \{\ .RS 4 @@ -285,41 +285,41 @@ Xyz\&.class .PP \-J\fIoption\fR .RS 4 -ꤷJVMץJREJARե¹Ԥݤ˻Ѥ褦ꤷޤJVMץϡjava(1)ޥɤΥե󥹡ڡƤޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤ +指定したJVMオプションを、JREがJARファイルを実行する際に使用するように設定します。JVMオプションは、java(1)コマンドのリファレンス・ページで説明されています。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。 .RE -.SH "ڥ" +.SH "オペランド" .PP -Υڥɤϡ\fIjar\fRޥɤǧޤ +次のオペランドは、\fIjar\fRコマンドで認識されます。 .PP \fIfile\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fIfile\fRڥɤϡ֤ɲäɬפΤեޤϥǥ쥯ȥΥѥ̾ޤJARե(\fIx\fR)ޤϥƥĤΥꥹ(\fIt\fR)ˡ\fIfile\fRڥɤФޤϥꥹȤեΥѥ̾ޤʤȤ1Ĥͭʥեޤϥǥ쥯ȥꤹɬפޤʣ\fIfile\fRڥɤǶڤޤ\fIentrypoint\fR\fIjarfile\fRޤ\fImanifest\fRڥɤѤϡθ\fIfile\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fIfile\fRオペランドは、アーカイブに追加する必要のあるファイルまたはディレクトリのパスと名前を定義します。JARファイルの抽出(\fIx\fR)またはコンテンツのリスト(\fIt\fR)時に、\fIfile\fRオペランドは抽出またはリストするファイルのパスと名前を定義します。少なくとも1つの有効なファイルまたはディレクトリを指定する必要があります。複数の\fIfile\fRオペランドを空白で区切ります。\fIentrypoint\fR、\fIjarfile\fRまたは\fImanifest\fRオペランドが使用される場合は、その後に\fIfile\fRオペランドを指定する必要があります。 .RE .PP \fIentrypoint\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fIentrypoint\fRڥɤϡ¹ԲǽJARե˥Хɥ뤵Ƥ륹ɥJavaץꥱΥȥꡦݥȤȤʤ륯饹̾ޤ\fIe\fRץ¸ߤ\fIentrypoint\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fIentrypoint\fRオペランドは、実行可能JARファイルにバンドルされているスタンドアロンJavaアプリケーションのエントリ・ポイントとなるクラスの名前を定義します。\fIe\fRオプションが存在する場合は\fIentrypoint\fRオペランドを指定する必要があります。 .RE .PP \fIjarfile\fR .RS 4 -(\fIc\fR)(\fIu\fR)(\fIx\fR)ޤɽ(\fIt\fR)ե̾ޤ\fIf\fRץ¸ߤ\fIjarfile\fRڥɤꤹɬפޤ\fIf\fRץ󤪤\fIjarfile\fRڥɤάȡ\fIjar\fRޥɤˡ\fIstdin\fRJARե̾뤫(\fIx\fR\fIt\fRξ)JARե\fIstdout\fR뤳(\fIc\fR\fIu\fRξ)ؼޤ +作成(\fIc\fR)、更新(\fIu\fR)、抽出(\fIx\fR)または表示(\fIt\fR)するファイルの名前を定義します。\fIf\fRオプションが存在する場合は\fIjarfile\fRオペランドを指定する必要があります。\fIf\fRオプションおよび\fIjarfile\fRオペランドを省略すると、\fIjar\fRコマンドに、\fIstdin\fRからのJARファイル名を受け入れるか(\fIx\fRおよび\fIt\fRの場合)、JARファイルを\fIstdout\fRに送信すること(\fIc\fRおよび\fIu\fRの場合)が指示されます。 .sp -JARեդ(\fIi\fR)ϡ\fIf\fRץꤷʤ\fIjarfile\fRڥɤꤷޤ +JARファイルを索引付け(\fIi\fR)する場合は、\fIf\fRオプションを指定しないで\fIjarfile\fRオペランドを指定します。 .RE .PP \fImanifest\fR .RS 4 -JARեκ(\fIc\fR)ޤϹ(\fIu\fR)ˡ\fImanifest\fRڥɤJARե\fIMANIFEST\&.MF\fR˴ޤ°̾ͤĴ¸Υޥ˥եȡեޤ\fIf\fRץ¸ߤ\fImanifest\fRڥɤꤹɬפޤ +JARファイルの作成(\fIc\fR)または更新(\fIu\fR)時に、\fImanifest\fRオペランドはJARファイルの\fIMANIFEST\&.MF\fRに含める属性の名前と値を持つ既存のマニフェスト・ファイルを定義します。\fIf\fRオプションが存在する場合は\fImanifest\fRオペランドを指定する必要があります。 .RE .PP \fI@arg\-file\fR .RS 4 -\fIjar\fRޥɤṳ̂ޤϴDzˤϡ̤ΥƥȡեΰꤷƬȤƥåȥޡ(@)դ\fIjar\fRޥɤϤȤǤޤ\fIjar\fRޥɤϡåȥޡʸǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjar\fRコマンドを短縮または簡素化するには、別のテキスト・ファイル内の引数を指定し、接頭辞としてアットマーク(@)を付けて\fIjar\fRコマンドに渡すことができます。\fIjar\fRコマンドは、アットマーク文字で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .sp -եˤϡ\fIjar\fRޥɤΥץȰ(ե򥵥ݡȤʤưġϤ\fI\-J\fRץ)ޤ뤳ȤǤޤեΰϡޤϲʸǶڤ뤳ȤǤޤեΥե̾ϡ\fIjar\fRޥɤ¹ԤǤ븽ߤΥǥ쥯ȥФŪǤꡢեξФƤŪǤϤޤ̾ϥڥ졼ƥ󥰡ƥࡦˤäŸ륢ꥹ(*)ʤɤΥ磻ɥɤŸޤ +引数ファイルには、\fIjar\fRコマンドのオプションと引数(引数ファイルをサポートしない起動ツールに渡される\fI\-J\fRオプションを除く)を含めることができます。ファイル内の引数は、空白または改行文字で区切ることができます。引数ファイル内のファイル名は、\fIjar\fRコマンドを実行できる現在のディレクトリに対して相対的であり、引数ファイルの場所に対しては相対的ではありません。通常はオペレーティング・システム・シェルによって展開されるアスタリスク(*)などのワイルドカードは展開されません。 .sp -ϡ\fIfind\fRޥɤˤ븽ߤΥǥ쥯ȥϤΥե̾\fIclasses\&.list\fRեˡ򼨤ޤ +次の例は、\fIfind\fRコマンドによる現在のディレクトリ出力からのファイル名で\fIclasses\&.list\fRファイルを作成する方法を示します。 .sp .if n \{\ .RS 4 @@ -330,7 +330,7 @@ find \&. \-name \*(Aq*\&.class\*(Aq \-print > classes\&.list .if n \{\ .RE .\} -\fIjar\fRޥɤ¹Ԥ\fI@arg\-file\fRʸѤ\fIclasses\&.list\fRեϤȤǤޤ +\fIjar\fRコマンドを実行し、\fI@arg\-file\fR構文を使用して\fIclasses\&.list\fRファイルを渡すことができます。 .sp .if n \{\ .RS 4 @@ -341,7 +341,7 @@ jar cf my\&.jar @classes\&.list .if n \{\ .RE .\} -եϥѥǤޤХѥҤ줿եΤ٤ƤΥե̾ϡϤ줿ѥФŪǤϤʤ\fIjar\fRޥɤθߤκȥǥ쥯ȥŪȤʤޤȤСΤ褦ˤʤޤ +引数ファイルはパスを指定できますが、相対パスが記述された引数ファイル内のすべてのファイル名は、渡されたパスに対して相対的ではなく、\fIjar\fRコマンドの現在の作業ディレクトリに相対的となります。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -353,9 +353,9 @@ jar @dir/classes\&.list .RE .\} .RE -.SH "" +.SH "注意" .PP -\fIe\fR\fIf\fR\fIm\fRץϡ\fIentrypoint\fR\fIjarfile\fR\fImanifest\fRڥɤƱǥޥɥ饤˽иɬפޤ +\fIe\fR、\fIf\fRおよび\fIm\fRオプションは、\fIentrypoint\fR、\fIjarfile\fRおよび\fImanifest\fRオペランドと同じ順序でコマンドラインに出現する必要があります。 .sp .if n \{\ .RS 4 @@ -366,9 +366,9 @@ jar cmef myManifestFile MyMainClass myFile\&.jar *\&.class .if n \{\ .RE .\} -.SH "" +.SH "例" .PP -\fBExample 1\fR, ĹʽϤˤ븽ߤΥǥ쥯ȥ꤫Τ٤ƤΥեɲ +\fBExample 1\fR, 冗長な出力による現在のディレクトリからのすべてのファイルの追加 .RS 4 .sp .if n \{\ @@ -396,7 +396,7 @@ adding: spacemusic\&.au(in = 3079) (out= 73)(deflated 97%) .\} .RE .PP -\fBExample 2\fR, ֥ǥ쥯ȥ꤫Υեɲ +\fBExample 2\fR, サブディレクトリからのファイルの追加 .RS 4 .sp .if n \{\ @@ -427,7 +427,7 @@ audio/ bundle\&.jar classes/ images/ .\} .RE .PP -\fBExample 3\fR, JARΥƥĤΥꥹ +\fBExample 3\fR, JARのコンテンツのリスト .RS 4 .sp .if n \{\ @@ -460,9 +460,9 @@ images/at_work\&.gif .\} .RE .PP -\fBExample 4\fR, ɲ +\fBExample 4\fR, 索引の追加 .RS 4 -Υץꥱ߰¸饹\fImain\&.jar\fR\fIbuy\&.jar\fR\fIsell\&.jar\fR3ĤJARեʬ䤹硢\fIi\fRץѤޤ\fImain\&.jar\fRޥ˥ե\fIClass\-Path\fR°ꤹ硢\fIi\fRץѤơץꥱΥ饹ɤ®٤Ǥޤ +株式取引のアプリケーションの相互依存クラスを、\fImain\&.jar\fR、\fIbuy\&.jar\fRおよび\fIsell\&.jar\fRの3つのJARファイルに分割する場合、\fIi\fRオプションを使用します。\fImain\&.jar\fRマニフェスト内の\fIClass\-Path\fR属性を指定する場合、\fIi\fRオプションを使用して、アプリケーションのクラス・ロードの速度を向上できます。 .sp .if n \{\ .RS 4 @@ -474,9 +474,9 @@ jar i main\&.jar .if n \{\ .RE .\} -\fIINDEX\&.LIST\fRե뤬\fIMETA\-INF\fRǥ쥯ȥޤˤꡢץꥱΥ饹ˤäƥ饹ޤϥ꥽θԤȤˡꤷJARե뤬ɤ褦ˤʤޤ +\fIINDEX\&.LIST\fRファイルが\fIMETA\-INF\fRディレクトリに挿入されます。これにより、アプリケーションのクラス・ローダーによってクラスまたはリソースの検索が行われるときに、指定したJARファイルがダウンロードされるようになります。 .sp -ץꥱΥ饹ϡΥե˳ǼƤѤơΨŪ˥饹ɤޤǥ쥯ȥ򥳥ԡˤϡǽ\fIdir1\fRΥե\fIstdout\fR˰̤Ƥ顢\fIstdin\fR\fIdir2\fR˥ѥץ饤Фޤ(\fI\-f\fRץξ\fIjar\fRޥɤǾάޤ) +アプリケーションのクラス・ローダーは、このファイルに格納されている情報を使用して、効率的にクラスをロードします。ディレクトリをコピーするには、最初に\fIdir1\fR内のファイルを\fIstdout\fRに圧縮してから、\fIstdin\fRから\fIdir2\fRにパイプラインを作成して抽出します(\fI\-f\fRオプションは両方の\fIjar\fRコマンドで省略します)。 .sp .if n \{\ .RS 4 @@ -488,7 +488,7 @@ jar i main\&.jar .RE .\} .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -509,8 +509,8 @@ pack200(1)\&. .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -Java塼ȥꥢJAR˴ؤ +http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +JavaチュートリアルのJARに関する項 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 index fa0799a8c60..4642c958add 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jarsigner .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ƥġ +.\" Date: 2013年11月21日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jarsigner" "1" "2013ǯ1121" "JDK 8" "ƥġ" +.TH "jarsigner" "1" "2013年11月21日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jarsigner \- Java(JAR)եФƽ̾ӸڤԤޤ -.SH "" +jarsigner \- Javaアーカイブ(JAR)ファイルに対して署名および検証を行います。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,30 +74,30 @@ jarsigner \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \-verify .RS 4 -\fI\-verify\fRץǤϡJARե̾θ0İʾΥȥ̾Ǥޤ\fI\-verify\fRץ󤬻ꤵ줿硢\fIjarsigner\fRޥɤǤϡJARեγƽ̾դƥƥθڤ˻Ѥ񤬡줫Υȥ̾˰פ뤳Ȥåޤ̾ϡ\fI\-keystore\fRǻꤵ줿ȥޤϥǥեȤΥȥޤ +\fI\-verify\fRオプションでは、JARファイル名の後に0個以上のキーストア別名を指定できます。\fI\-verify\fRオプションが指定された場合、\fIjarsigner\fRコマンドでは、JARファイル内の各署名付きエンティティの検証に使用される証明書が、いずれかのキーストア別名に一致することをチェックします。別名は、\fI\-keystore\fRで指定されたキーストア内またはデフォルトのキーストア内に定義されます。 .sp -\fI\-strict\fRץꤷ硢\fIjarsigner\fRޥɤˤʷٹ𤬸Фȡåjarڤޤ̾ԥ顼פɽޤ +\fI\-strict\fRオプションも指定した場合、\fIjarsigner\fRコマンドにより重大な警告が検出されると、メッセージ「jarが検証されました。署名者エラー」が表示されます。 .RE .PP \fIjar\-file\fR .RS 4 -̾JARե롣 +署名されるJARファイル。 .sp -\fI\-strict\fRץꤷ硢\fIjarsigner\fRޥɤˤʷٹ𤬸ФȡåjarϽ̾ޤ \- ̾ԥ顼ޤפȤåɽޤ +\fI\-strict\fRオプションも指定した場合、\fIjarsigner\fRコマンドにより重大な警告が検出されると、メッセージ「jarは署名されました \- 署名者エラーがあります。」というメッセージが表示されます。 .RE .PP \fIalias\fR .RS 4 -̾ϡ\fI\-keystore\fRǻꤵ줿ȥޤϥǥեȤΥȥޤ +別名は、\fI\-keystore\fRで指定されたキーストア内またはデフォルトのキーストア内に定義されます。 .RE -.SH "" +.SH "説明" .PP -\fIjarsigner\fRġˤϡ2ĤŪޤ +\fIjarsigner\fRツールには、次の2つの目的があります。 .sp .RS 4 .ie n \{\ @@ -107,7 +107,7 @@ jarsigner \- Java .sp -1 .IP \(bu 2.3 .\} -Java(JAR)ե˽̾Ū +Javaアーカイブ(JAR)ファイルに署名する目的。 .RE .sp .RS 4 @@ -118,12 +118,12 @@ Java .sp -1 .IP \(bu 2.3 .\} -̾դJARեν̾򸡾ڤŪ +署名付きJARファイルの署名と整合性を検証する目的。 .RE .PP -JARǽѤȡ饹ե롢᡼ɤӤ¾Υǥ롦ǡñΥե˥ѥåǤΤǡե®ưפۤǤޤ\fIjar\fRȤ̾ΥġѤơȯԤJARեǤޤ(ŪʴС٤ƤZIPեJARեȤߤʤȤǤޤ\fIjar\fRޥɤˤäƺ줿JARե롢ޤ\fIjarsigner\fRޥɤˤäƽ줿JARեˤϡ\fIMETA\-INF/MANIFEST\&.MF\fRեޤޤƤޤ) +JAR機能を使用すると、クラス・ファイル、イメージ、サウンドおよびその他のデジタル・データを単一のファイルにパッケージ化できるので、ファイルを迅速かつ容易に配布できます。\fIjar\fRという名前のツールを使用して、開発者はJARファイルを作成できます。(技術的な観点から言えば、すべてのZIPファイルもJARファイルとみなすことができます。ただし、\fIjar\fRコマンドによって作成されたJARファイル、または\fIjarsigner\fRコマンドによって処理されたJARファイルには、\fIMETA\-INF/MANIFEST\&.MF\fRファイルも含まれています。) .PP -ǥ̾ϡʤ餫Υǡ(̾оݤȤʤǡ)ӥƥƥ(͡Ҥʤ)̩׻ӥåȤʸǤ񤭤ν̾Ʊ͡ǥ̾ˤ¿ޤ +デジタル署名は、なんらかのデータ(署名の対象となるデータ)、およびエンティティ(人、会社など)の秘密鍵から計算されるビットの文字列です。手書きの署名同様、デジタル署名には多くの利点があります。 .sp .RS 4 .ie n \{\ @@ -133,7 +133,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̾˻Ѥ줿̩бѤ׻ˤäơ줬ʪǤ뤳Ȥ򸡾ڤǤޤ +署名の生成に使用された秘密鍵に対応する公開鍵を使用する計算によって、それが本物であることを検証できます。 .RE .sp .RS 4 @@ -144,7 +144,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̩¾ͤΤʤ¤ꡢǥ̾ε¤ԲǽǤ +秘密鍵が他人に知られない限り、デジタル署名の偽造は不可能です。 .RE .sp .RS 4 @@ -155,7 +155,7 @@ JAR .sp -1 .IP \(bu 2.3 .\} -ϡ̾դǡεǽǤꡢ¾Υǡν̾Ȥʤ褦׵Ǥޤ +これは、署名が付いたデータの機能であり、他のデータの署名となるように要求できません。 .RE .sp .RS 4 @@ -166,27 +166,27 @@ JAR .sp -1 .IP \(bu 2.3 .\} -̾դǡѹǤޤ󡣥ǡѹ줿硢̾ˤäʪǤȸڤǤޤ +署名付きデータは変更できません。データが変更された場合、署名によって本物であると検証できません。 .RE .PP -եФƥƥƥν̾ˤϡޤƥƥϡΥƥƥ˴Ϣ/̩Υڥȡǧڤ1İʾξɬפޤȤϡ륨ƥƥΥǥ̾դʸǡ̤ΥƥƥθͤĤȤ򼨤Ƥޤ +ファイルに対してエンティティの署名を生成するには、まず、エンティティは、そのエンティティに関連する公開鍵/秘密鍵のペアと、公開鍵を認証する1つ以上の証明書を持つ必要があります。証明書とは、あるエンティティからのデジタル署名付きの文書で、別のエンティティの公開鍵が特定の値を持つことを示しています。 .PP -\fIjarsigner\fRޥɤϡȥθȾѤơJARեΥǥ̾ޤȥϡ̩бǧڤ롢̩˴ϢX\&.509Υǡ١Ǥ\fIkeytool\fRޥɤѤơȥӴޤ +\fIjarsigner\fRコマンドは、キーストアからの鍵と証明書情報を使用して、JARファイルのデジタル署名を生成します。キーストアは、秘密鍵、および対応する公開鍵を認証する、秘密鍵に関連したX\&.509証明書チェーンのデータベースです。\fIkeytool\fRコマンドを使用して、キーストアを作成および管理します。 .PP -\fIjarsigner\fRޥɤǤϡƥƥ̩Ѥƽ̾ޤ̾դJARեˤϡäˡեؤν̾˻Ѥ̩бΥȥξΥԡޤޤޤ\fIjarsigner\fRޥɤǤϡ(֥̾åե)ξѤơ̾դJARեΥǥ̾򸡾ڤǤޤ +\fIjarsigner\fRコマンドでは、エンティティの秘密鍵を使用して署名を生成します。署名付きJARファイルには、特に、ファイルへの署名に使用する秘密鍵に対応する公開鍵のキーストアからの証明書のコピーが含まれます。\fIjarsigner\fRコマンドでは、内部(署名ブロック・ファイル内)の証明書を使用して、署名付きJARファイルのデジタル署名を検証できます。 .PP -\fIjarsigner\fRޥɤǤϡ̾ͭJARե뤬̾줿줿ɤ򥷥ƥǥץ(Java Plug\-inޤ)åǤ롢ॹפޤ̾ǤޤˡAPIѤȡץꥱǥॹ׾Ǥޤ +\fIjarsigner\fRコマンドでは、署名証明書の有効期間中にJARファイルが署名されたされたかどうかをシステムやデプロイヤ(Java Plug\-inを含む)がチェックできる、タイムスタンプを含む署名を生成できます。さらに、APIを使用すると、アプリケーションでタイムスタンプ情報を取得できます。 .PP -Ǥϡ\fIjarsigner\fRޥɤǤϡ\fIjar\fRޥɤޤZIPեˤäƺ줿JARեΤߤ˽̾ǤޤJARեZIPեƱǤJARեˤ\fIMETA\-INF/MANIFEST\&.MF\fRեޤޤƤۤʤޤ\fIMETA\-INF/MANIFEST\&.MF\fRեϡ\fIjarsigner\fRޥɤˤäZIPե˽̾ݤ˺ޤ +現時点では、\fIjarsigner\fRコマンドでは、\fIjar\fRコマンドまたはZIPファイルによって作成されたJARファイルのみに署名できます。JARファイルはZIPファイルと同じですが、JARファイルには\fIMETA\-INF/MANIFEST\&.MF\fRファイルも含まれている点が異なります。\fIMETA\-INF/MANIFEST\&.MF\fRファイルは、\fIjarsigner\fRコマンドによってZIPファイルに署名する際に作成されます。 .PP -ǥեȤ\fIjarsigner\fRޥɤưǤϡJARޤZIPե˽̾ޤ\fI\-verify\fRץѤơ̾դJARե򸡾ڤޤ +デフォルトの\fIjarsigner\fRコマンドの動作では、JARまたはZIPファイルに署名します。\fI\-verify\fRオプションを使用して、署名付きJARファイルを検証します。 .PP -\fIjarsigner\fRޥɤϡ̾ޤϸڤθ˽̾ԤξθڤԤޤڥ顼ޤϤ¾꤬ȯȡޥɤˤٹåޤ\fI\-strict\fRץꤷ硢ޥɤˤʷٹ𤬥顼Ȥƽޤ顼ȷٹ򻲾ȤƤ -.SS "ȥ̾" +\fIjarsigner\fRコマンドは、署名または検証の後に署名者の証明書の検証も試行します。検証エラーまたはその他の問題が発生すると、コマンドにより警告メッセージが生成されます。\fI\-strict\fRオプションを指定した場合、コマンドにより重大な警告がエラーとして処理されます。エラーと警告を参照してください。 +.SS "キーストアの別名" .PP -ȥΤ٤ƤΥƥƥϡդ̾Ѥƥޤ +キーストアのすべてのエンティティは、一意の別名を使用してアクセスされます。 .PP -\fIjarsigner\fRޥɤѤJARե˽̾Ȥϡ̾ɬפ̩ޤ७ȥȥ̾ꤹɬפޤȤСΥޥɤǤϡ\fIworking\fRǥ쥯ȥ\fImystore\fRȤ̾Υȥ˴ޤޤ̾\fIduke\fR˴Ϣդ줿̩Ѥơ\fIMyJARFile\&.jar\fRȤ̾JARե˽̾ޤϥեϻꤵƤʤᡢ\fIMyJARFile\&.jar\fRϽ̾դJARեˤäƾ񤭤ޤ +\fIjarsigner\fRコマンドを使用してJARファイルに署名するときは、署名の生成に必要な秘密鍵を含むキーストア・エントリの別名を指定する必要があります。たとえば、次のコマンドでは、\fIworking\fRディレクトリの\fImystore\fRという名前のキーストアに含まれる別名\fIduke\fRに関連付けられた秘密鍵を使用して、\fIMyJARFile\&.jar\fRという名前のJARファイルに署名します。出力ファイルは指定されていないため、\fIMyJARFile\&.jar\fRは署名付きのJARファイルによって上書きされます。 .sp .if n \{\ .RS 4 @@ -199,36 +199,36 @@ jarsigner \-keystore /working/mystore \-storepass <keystore password> .RE .\} .PP -ȥϥѥɤݸƤΤǡȥΥѥɤꤹɬפޤޥɥ饤ǻꤷʤȡϤޤƱͤˡ̩⥭ȥǥѥɤˤäݸƤ뤿ᡢ̩Υѥɤꤹɬפޤޥɥ饤ǥѥɤꤷƤʤ硢ޤϻꤷѥȤ¸ƤѥɤƱǤϤʤϡѥɤϤޤ -.SS "ȥξ" +キーストアはパスワードで保護されているので、ストアのパスワードを指定する必要があります。コマンドラインで指定しないと、入力を求められます。同様に、秘密鍵もキーストア内でパスワードによって保護されているため、秘密鍵のパスワードを指定する必要があります。コマンドラインでパスワードを指定していない場合、または指定したパスワートが保存されているパスワードと同じではない場合は、パスワードの入力を求められます。 +.SS "キーストアの場所" .PP -\fIjarsigner\fRޥɤˤϡѤ륭ȥURLꤹ\fI\-keystore\fRץ󤬤ޤȥϥǥեȤǡ\fIuser\&.home\fRƥࡦץѥƥǷޤ桼Υۡࡦǥ쥯ȥ\fI\&.keystore\fRȤ̾Υե˳Ǽޤ +\fIjarsigner\fRコマンドには、使用するキーストアのURLを指定する\fI\-keystore\fRオプションがあります。キーストアはデフォルトで、\fIuser\&.home\fRシステム・プロパティで決まるユーザーのホーム・ディレクトリの\fI\&.keystore\fRという名前のファイル内に格納されます。 .PP -Oracle Solarisƥξ硢\fIuser\&.home\fRϡ桼Υۡࡦǥ쥯ȥ˥ǥեꤵޤ +Oracle Solarisシステムの場合、\fIuser\&.home\fRは、ユーザーのホーム・ディレクトリにデフォルト設定されます。 .PP -\fI\-keystore\fRץ󤫤ϥȥ꡼ϡ\fIKeyStore\&.load\fR᥽åɤϤޤURLȤ\fINONE\fRꤵƤϡnullΥȥ꡼ब\fIKeyStore\&.load\fR᥽åɤϤޤ\fINONE\fRϡ\fIKeyStore\fR饹ե١ǤϤʤ硢ȤСϡɥȡ󡦥ǥХ֤Ƥ˻ꤷޤ -.SS "ȥμ" +\fI\-keystore\fRオプションからの入力ストリームは、\fIKeyStore\&.load\fRメソッドに渡されます。URLとして\fINONE\fRが指定されている場合は、nullのストリームが\fIKeyStore\&.load\fRメソッドに渡されます。\fINONE\fRは、\fIKeyStore\fRクラスがファイルベースではない場合、たとえば、ハードウェア・トークン・デバイスに置かれている場合に指定します。 +.SS "キーストアの実装" .PP -\fIjava\&.security package\fR󶡤Ƥ\fIKeyStore\fR饹ϡȥξؤΥӾѹԤΡΤ줿¿Υ󥿥ե󶡤ޤʣΰۤʤꤹ뤳ȤǤƼΥפΥȥоݤȤޤ +\fIjava\&.security package\fRで提供されている\fIKeyStore\fRクラスは、キーストア内の情報へのアクセスおよび情報の変更を行うための、明確に定義された多くのインタフェースを提供します。複数の異なる固定実装を指定することができ、各実装は特定のタイプのキーストアを対象とします。 .PP -ߡȥμѤ2ĤΥޥɥ饤󡦥ġ(\fIkeytool\fR\fIjarsigner\fR)ӥݥꥷġȤ̾1ĤGUI١Υġ뤬ޤ\fIKeyStore\fR饹ϸƤ뤿ᡢJDK桼ϡѤ¾Υƥץꥱ񤭹ळȤǤޤ +現在、キーストアの実装を使用する2つのコマンドライン・ツール(\fIkeytool\fRと\fIjarsigner\fR)、およびポリシー・ツールという名前の1つのGUIベースのツールがあります。\fIKeyStore\fRクラスは公開されているため、JDKユーザーは、それを使用する他のセキュリティ・アプリケーションを書き込むことができます。 .PP -Oracle󶡤ȹߤΥǥեȤμޤϡJKSȤ̾ȼΥȥ()ѤΤǡȥեȤƼƤޤȹߤμǤϡ̩ϸ̤Υѥɤˤäݸ졢ȥΤ(̩Ȥ̤)ѥɤˤäݸޤ +Oracleが提供する組込みのデフォルトの実装があります。これは、JKSという名前の独自のキーストア・タイプ(形式)を使用するもので、キーストアをファイルとして実装しています。組込みの実装では、各秘密鍵は個別のパスワードによって保護され、キーストア全体の整合性は(秘密鍵とは別の)パスワードによって保護されます。 .PP -ȥμϥץХ١ǡĤޤꡢ\fIKeyStore\fR饹ˤ󶡤륢ץꥱ󡦥󥿥եϡӥץХ󥿥ե(SPI)˴ؤƼޤб\fIKeystoreSpi\fRݥ饹ꡢ\fIjava\&.security package\fR˴ޤޤƤޤΥ饹ץХɬפΤ륵ӥץХ󥿥եΥ᥽åɤƤޤǡץХȤϡJava Security APIˤäƥǽʥӥΥ֥åȤФθ󶡤ѥåޤϥѥåνΤȤǤȥμ󶡤ˤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlˤ -JavaŹ沽ƥΥץХμˡƤ褦ˡ饤ȤϥץХ\fIKeystoreSpi\fR֥饹μ󶡤ɬפޤ +キーストアの実装はプロバイダベースで、つまり、\fIKeyStore\fRクラスにより提供されるアプリケーション・インタフェースは、サービス・プロバイダ・インタフェース(SPI)に関して実装されます。対応する\fIKeystoreSpi\fR抽象クラスがあり、これも\fIjava\&.security package\fRに含まれています。このクラスが、プロバイダが実装する必要のあるサービス・プロバイダ・インタフェースのメソッドを定義しています。ここで、プロバイダとは、Java Security APIによってアクセス可能なサービスのサブセットに対し、その固定実装を提供するパッケージまたはパッケージの集合のことです。キーストアの実装を提供するには、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlにある +Java暗号化アーキテクチャのプロバイダの実装方法で説明しているように、クライアントはプロバイダを実装し、\fIKeystoreSpi\fRサブクラスの実装を提供する必要があります。 .PP -ץꥱǤϡ\fIKeyStore\fR饹\fIgetInstance\fRեȥꡦ᥽åɤѤơ͡ʥץХۤʤ륿פΥȥμǤޤȥΥפϡȥγǼȥǡȤȤˡȥ̩ȥȥΤݸ뤿˻Ѥ륢르ꥺޤۤʤ륿פΥȥμˤϡߴϤޤ +アプリケーションでは、\fIKeyStore\fRクラスの\fIgetInstance\fRファクトリ・メソッドを使用して、様々なプロバイダから異なるタイプのキーストアの実装を選択できます。キーストアのタイプは、キーストア情報の格納形式とデータ形式を定義するとともに、キーストア内の秘密鍵とキーストア自体の整合性を保護するために使用されるアルゴリズムを定義します。異なるタイプのキーストアの実装には、互換性はありません。 .PP -\fIjarsigner\fR\fIpolicytool\fRޥɤϡURLѤƻǤǤդξ꤫ե١Υȥɤ߼뤳ȤǤޤޤΥޥɤϡWindowsMSCAPIӤ٤ƤΥץåȥեPKCS11󶡤褦ե١Υȥɤ߼뤳ȤǤޤ +\fIjarsigner\fRおよび\fIpolicytool\fRコマンドは、URLを使用して指定できる任意の場所からファイルベースのキーストアを読み取ることができます。また、これらのコマンドは、Windows上のMSCAPIおよびすべてのプラットフォーム上のPKCS11で提供されるような非ファイルベースのキーストアを読み取ることができます。 .PP -\fIjarsigner\fRޥɤ\fIkeytool\fRޥɤξ硢\fI\-storetype\fRץѤơޥɥ饤ǥȥΥפǤޤݥꥷġξ硢\fB֥ȥ\fR˥塼\fBԽ\fRޥɤѤơȥΥפǤޤ +\fIjarsigner\fRコマンドおよび\fIkeytool\fRコマンドの場合、\fI\-storetype\fRオプションを使用して、コマンドラインでキーストアのタイプを指定できます。ポリシー・ツールの場合、\fB「キーストア」\fRメニューの\fB「編集」\fRコマンドを使用して、キーストアのタイプを指定できます。 .PP -桼ȥΥפŪ˻ꤷʤä硢ƥץѥƥեǻꤵ줿\fIkeystore\&.type\fRץѥƥͤ˴Ťơġˤäƥȥμ򤵤ޤΥƥץѥƥե\fIjava\&.security\fRȸƤФ졢JDKƥץѥƥǥ쥯ȥ\fIjava\&.home/lib/security\fR¸ߤƤޤǡ\fIjava\&.home\fRϼ¹ԻĶΥǥ쥯ȥǤ\fIjre\fRǥ쥯ȥϡJDKޤJava Runtime Environment (JRE)κǾ̤Υǥ쥯ȥˤޤ +ユーザーがキーストアのタイプを明示的に指定しなかった場合、セキュリティ・プロパティ・ファイルで指定された\fIkeystore\&.type\fRプロパティの値に基づいて、ツールによってキーストアの実装が選択されます。このセキュリティ・プロパティ・ファイルは\fIjava\&.security\fRと呼ばれ、JDKセキュリティ・プロパティ・ディレクトリ\fIjava\&.home/lib/security\fR内に存在しています。ここで、\fIjava\&.home\fRは実行時環境のディレクトリです。\fIjre\fRディレクトリは、JDKまたはJava Runtime Environment (JRE)の最上位のディレクトリにあります。 .PP -ƥġϡ\fIkeystore\&.type\fRͤΥפΥȥƤץХĤޤǡ󥹥ȡ뤵Ƥ뤹٤ƤΥץХĴ٤ޤŪΥץХĤȡΥץХΥȥμѤޤ +各ツールは、\fIkeystore\&.type\fRの値を取得し、そのタイプのキーストアを実装しているプロバイダが見つかるまで、インストールされているすべてのプロバイダを調べます。目的のプロバイダが見つかると、そのプロバイダからのキーストアの実装を使用します。 .PP -\fIKeyStore\fR饹Ƥstatic᥽å\fIgetDefaultType\fRѤȡץꥱ䥢ץåȤ\fIkeystore\&.type\fRץѥƥͤǤޤΥɤιԤǤϡ\fIkeystore\&.type property\fRǻꤵ줿ǥեȤΥȥפΥ󥹥󥹤ޤ +\fIKeyStore\fRクラスに定義されているstaticメソッド\fIgetDefaultType\fRを使用すると、アプリケーションやアプレットから\fIkeystore\&.type\fRプロパティの値を取得できます。次のコードの行では、\fIkeystore\&.type property\fRで指定された、デフォルトのキーストア・タイプのインスタンスを作成します。 .sp .if n \{\ .RS 4 @@ -240,8 +240,8 @@ KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType()); .RE .\} .PP -ǥեȤΥȥפϡ\fIjks\fR -(Oracle󶡤ȼΥפΥȥμ)ǤϡƥץѥƥեμιԤˤäƻꤵƤޤ +デフォルトのキーストア・タイプは、\fIjks\fR +(Oracleが提供する独自のタイプのキーストアの実装)です。これは、セキュリティ・プロパティ・ファイル内の次の行によって指定されています。 .sp .if n \{\ .RS 4 @@ -253,9 +253,9 @@ keystore\&.type=jks .RE .\} .PP -ȥΥפλǤϡʸȾʸ϶̤ޤ󡣤ȤС\fIJKS\fR\fIjks\fRƱˤʤޤ +キーストアのタイプの指定では、大文字と小文字は区別されません。たとえば、\fIJKS\fRは\fIjks\fRと同じになります。 .PP -ġǥǥեȰʳΥȥμѤˤϡιԤѹ̤ΥȥΥפꤷޤȤС\fIpkcs12\fRȸƤФ륭ȥΥפΥȥμ󶡤ץХѥå硢Ԥ򼡤Τ褦ѹޤ +ツールでデフォルト以外のキーストアの実装を使用するには、その行を変更して別のキーストアのタイプを指定します。たとえば、\fIpkcs12\fRと呼ばれるキーストアのタイプのキーストアの実装を提供するプロバイダ・パッケージがある場合、行を次のように変更します。 .sp .if n \{\ .RS 4 @@ -267,12 +267,12 @@ keystore\&.type=pkcs12 .RE .\} .PP -\fB:\fR -PKCS 11ץХѥåѤ硢http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.htmlˤ -Java PKCS #11ե󥹡ɤΡKeyToolפӡJarSignerפ򻲾ȤƤ -.SS "ݡȤ륢르ꥺ" +\fB注意:\fR +PKCS 11プロバイダ・パッケージを使用する場合、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/p11guide\&.htmlにある +Java PKCS #11リファレンス・ガイドの「KeyTool」および「JarSigner」を参照してください。 +.SS "サポートされるアルゴリズム" .PP -ǥեȤǡ\fIjarsigner\fRޥɤǤϼΤ줫Υ르ꥺѤJARե˽̾ޤ +デフォルトで、\fIjarsigner\fRコマンドでは次のいずれかのアルゴリズムを使用してJARファイルに署名します。 .sp .RS 4 .ie n \{\ @@ -282,7 +282,7 @@ Java PKCS #11 .sp -1 .IP \(bu 2.3 .\} -SHA1ȡ르ꥺѤǥ̾르ꥺ(DSA) +SHA1ダイジェスト・アルゴリズムを使用したデジタル署名アルゴリズム(DSA) .RE .sp .RS 4 @@ -293,7 +293,7 @@ SHA1 .sp -1 .IP \(bu 2.3 .\} -SHA256ȡ르ꥺѤRSA르ꥺࡣ +SHA256ダイジェスト・アルゴリズムを使用したRSAアルゴリズム。 .RE .sp .RS 4 @@ -304,15 +304,15 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -SHA256ʱ߶ǥ̾르ꥺ(ECDSA)Ѥʱ߶(EC)Ź르ꥺ +SHA256と楕円曲線デジタル署名アルゴリズム(ECDSA)を使用した楕円曲線(EC)暗号方式アルゴリズム .RE .PP -̾Ԥθ̩DSAǤ硢\fIjarsigner\fR\fISHA1withDSA\fR르ꥺѤJARե˽̾ޤ̾ԤθRSAǤ硢\fIjarsigner\fR\fISHA256withRSA\fR르ꥺѤJARե˽̾褦Ȥޤ̾ԤθECǤ硢\fIjarsigner\fR\fISHA256withECDSA\fR르ꥺѤJARե˽̾ޤ +署名者の公開鍵と秘密鍵がDSA鍵である場合、\fIjarsigner\fRは\fISHA1withDSA\fRアルゴリズムを使用してJARファイルに署名します。署名者の鍵がRSA鍵である場合、\fIjarsigner\fRは\fISHA256withRSA\fRアルゴリズムを使用してJARファイルに署名しようとします。署名者の鍵がEC鍵である場合、\fIjarsigner\fRは\fISHA256withECDSA\fRアルゴリズムを使用してJARファイルに署名します。 .PP -ΥǥեȤν̾르ꥺϡ\fI\-sigalg\fRץѤƥС饤ɤǤޤ -.SS "̾դJARե" +これらのデフォルトの署名アルゴリズムは、\fI\-sigalg\fRオプションを使用してオーバーライドできます。 +.SS "署名付きJARファイル" .PP -\fIjarsigner\fRޥɤѤJARե˽̾硢Ϥ̾դJARեJARեƱǤ2Ĥɲåե뤬META\-INFǥ쥯ȥ֤ۤʤޤ +\fIjarsigner\fRコマンドを使用してJARファイルに署名する場合、出力される署名付きJARファイルは入力JARファイルと同じですが、次の2つの追加ファイルがMETA\-INFディレクトリに置かれる点が異なります。 .sp .RS 4 .ie n \{\ @@ -322,7 +322,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -\fI\&.SF\fRĥҤդ̾ե +\fI\&.SF\fR拡張子の付いた署名ファイル .RE .sp .RS 4 @@ -333,14 +333,14 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -\fI\&.DSA\fR\fI\&.RSA\fRޤ\fI\&.EC\fRĥҤդ֥̾åե +\fI\&.DSA\fR、\fI\&.RSA\fRまたは\fI\&.EC\fR拡張子の付いた署名ブロック・ファイル .RE .PP -2ĤΥեΥ١ե̾ϡ\fI\-sigFile\fRץͤޤȤСץ\fI\-sigFile MKSIGN\fRξ硢ե\fIMKSIGN\&.SF\fR\fIMKSIGN\&.DSA\fRȤ̾ˤʤޤ +これら2つのファイルのベース・ファイル名は、\fI\-sigFile\fRオプションの値から作成されます。たとえば、オプションが\fI\-sigFile MKSIGN\fRの場合、ファイルは\fIMKSIGN\&.SF\fRおよび\fIMKSIGN\&.DSA\fRという名前になります。 .PP -ޥɥ饤\fI\-sigfile\fRץꤷʤä硢\fI\&.SF\fRե\fI\&.DSA\fRեΥ١ե̾ϡޥɥ饤ǻꤵ줿̾Ƭ8ʸ򤹤٤ʸѴΤˤʤޤ̾8ʸ̤ξϡ̾Τޤ޻Ѥޤ̾ˡ̾ե̾ǻѤǤʤʸޤޤƤ硢ե̾κˡʸ(_)ʸѴޤͭʸϡե٥åȡӥϥեǤ -̾ե.PP -̾ե(\fI\&.SF\fRե)ϡ\fIjarsigner\fRޥɤѤƥե˽̾ݤJARե˾˴ޤޤޥ˥եȡեȻƤޤJARե˴ޤޤƤ륽ե뤴Ȥˡ\fI\&.SF\fRեˤϡޥ˥եȡեˤ褦ʡ˼3ĤιԤޤ +コマンドラインで\fI\-sigfile\fRオプションを指定しなかった場合、\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルのベース・ファイル名は、コマンドラインで指定された別名の先頭の8文字をすべて大文字に変換したものになります。別名が8文字未満の場合は、別名がそのまま使用されます。別名に、署名ファイル名で使用できない文字が含まれている場合、ファイル名の作成時に、該当する文字が下線(_)文字に変換されます。有効な文字は、アルファベット、数字、下線およびハイフンです。 +署名ファイル.PP +署名ファイル(\fI\&.SF\fRファイル)は、\fIjarsigner\fRコマンドを使用してファイルに署名する際にJARファイルに常に含まれるマニフェスト・ファイルと似ています。JARファイルに含まれているソース・ファイルごとに、\fI\&.SF\fRファイルには、マニフェスト・ファイルにあるような、次に示す3つの行があります。 .sp .RS 4 .ie n \{\ @@ -350,7 +350,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -ե̾ +ファイル名 .RE .sp .RS 4 @@ -361,7 +361,7 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -ȡ르ꥺ(SHA)̾ +ダイジェスト・アルゴリズム(SHA)の名前 .RE .sp .RS 4 @@ -372,17 +372,17 @@ SHA256 .sp -1 .IP \(bu 2.3 .\} -SHAȤ +SHAダイジェストの値 .RE .PP -ޥ˥եȡեǤϡƥեSHAȤͤϡեΥХʥꡦǡΥ(ϥå)ˤʤޤ\fI\&.SF\fRեǤϡꤵ줿եΥȤͤϡեΥޥ˥եȡեΤ3ԤΥϥåˤʤޤ +マニフェスト・ファイルでは、各ソース・ファイルのSHAダイジェストの値は、ソース・ファイルのバイナリ・データのダイジェスト(ハッシュ)になります。\fI\&.SF\fRファイルでは、指定されたソース・ファイルのダイジェストの値は、ソース・ファイルのマニフェスト・ファイル内のその3行のハッシュになります。 .PP -̾եˤϡǥեȤǡޥ˥եȡեΤΥϥå夬Ǽ줿إåޤޤƤޤإåˤϥޥ˥եȡإåΥϥåޤޤƤޤإå¸ߤȡڤκŬͭˤʤޤJARեθڤ򻲾ȤƤ -֥̾åե.PP -\fI\&.SF\fRեˤϽ̾դ졢̾Ͻ֥̾åե֤ޤΥեˤϡ̾˻Ѥ줿̩бǧڤ륭ȥξޤϾ⡢ǥ󥳡ɤƴޤޤƤޤեγĥҤϡѤȡ르ꥺ˱ơ\fI\&.DSA\fR\fI\&.RSA\fRޤ\fI\&.EC\fRˤʤޤ -.SS "̾ॹ" +署名ファイルには、デフォルトで、マニフェスト・ファイル全体のハッシュが格納されたヘッダーが含まれています。ヘッダーにはマニフェスト・ヘッダーのハッシュも含まれています。ヘッダーが存在すると、検証の最適化が有効になります。JARファイルの検証を参照してください。 +署名ブロック・ファイル.PP +\fI\&.SF\fRファイルには署名が付けられ、署名は署名ブロック・ファイルに置かれます。このファイルには、署名に使用された秘密鍵に対応する公開鍵を認証するキーストアからの証明書または証明書チェーンも、内部でエンコードされて含まれています。ファイルの拡張子は、使用されるダイジェスト・アルゴリズムに応じて、\fI\&.DSA\fR、\fI\&.RSA\fRまたは\fI\&.EC\fRになります。 +.SS "署名タイムスタンプ" .PP -\fIjarsigner\fRޥɤǤϡJARեν̾˽̾ॹפ¸Ǥޤˡ\fIjarsigner\fRؽ̾򥵥ݡȤޤưϾάǽǡ̾˼γƥץˤä椵ޤץ򻲾ȤƤ +\fIjarsigner\fRコマンドでは、JARファイルの署名時に署名タイムスタンプを生成および保存できます。さらに、\fIjarsigner\fRは代替署名機構をサポートします。この動作は省略可能で、署名時に次の各オプションによって制御されます。オプションを参照してください。 .sp .if n \{\ .RS 4 @@ -397,9 +397,9 @@ SHA .if n \{\ .RE .\} -.SS "JARեθ" +.SS "JARファイルの検証" .PP -JARեθڤΤϡ̾ͭǤꡢĽ̾ʹߤJARեΤɤΥեѹƤʤǤJARեθڤϡμǹԤޤ +JARファイルの検証が成功するのは、署名が有効であり、かつ署名の生成以降にJARファイル内のどのファイルも変更されていない場合です。JARファイルの検証は、次の手順で行われます。 .sp .RS 4 .ie n \{\ @@ -409,9 +409,9 @@ JAR .sp -1 .IP " 1." 4.2 .\} -\fI\&.SF\fRեν̾򸡾ڤޤ +\fI\&.SF\fRファイルの署名を検証します。 .sp -ڤǤϡƽ֥̾å(\fI\&.DSA\fR)ե˳Ǽ줿̾(ޤϾ)\fI\&.DSA\fRե˼б̩Ѥ줿Ȥǧޤޤ̾б̾(\fI\&.SF\fR)եͭʽ̾Ǥ뤳Ȥǧ졢ˤꡢ\fI\&.SF\fRե뤬󤵤ƤʤȤǧޤ +検証では、各署名ブロック(\fI\&.DSA\fR)ファイルに格納された署名が、証明書(または証明書チェーン)も\fI\&.DSA\fRファイルに示される公開鍵に対応する秘密鍵を使用して生成されたことを確認します。また、署名が対応する署名(\fI\&.SF\fR)ファイルの有効な署名であることが確認され、それにより、\fI\&.SF\fRファイルが改ざんされていないことも確認されます。 .RE .sp .RS 4 @@ -422,13 +422,13 @@ JAR .sp -1 .IP " 2." 4.2 .\} -\fI\&.SF\fRեγƥȥ˼Ȥ򡢥ޥ˥եбƥͤ碌Ƹڤޤ +\fI\&.SF\fRファイル内の各エントリに示されるダイジェストを、マニフェスト内の対応する各セクションと突きあわせて検証します。 .sp -\fI\&.SF\fRեˤϡޥ˥եȡեΤΥϥå夬Ǽ줿إåǥեȤǴޤޤƤޤإå¸ߤ硢ڤǤϡإåΥϥå夬ޥ˥եȡեΥϥåȰפ뤫ɤǧ뤿˥åǤޤפ硢ڤϼμ˿ʤߤޤ +\fI\&.SF\fRファイルには、マニフェスト・ファイル全体のハッシュが格納されたヘッダーがデフォルトで含まれています。ヘッダーが存在する場合、検証では、ヘッダー内のハッシュがマニフェスト・ファイルのハッシュと一致するかどうかを確認するためにチェックできます。一致する場合、検証は次の手順に進みます。 .sp -פʤ硢\fI\&.SF\fRեγƥե󥻥Υϥå夬ޥ˥եȡեб륻ΥϥåȰפ뤳Ȥǧ뤿ˡޤŬƤʤڤɬפˤʤޤ̾ե򻲾ȤƤ +一致しない場合、\fI\&.SF\fRファイル内の各ソース・ファイル情報セクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致することを確認するために、あまり最適化されていない検証が必要になります。署名ファイルを参照してください。 .sp -\fI\&.SF\fRեΥإå˳Ǽ줿ޥ˥եȡեΥϥå夬ߤΥޥ˥եȡեΥϥå˰פʤͳ1Ĥϡ̾\fI\&.SF\fRեˡ(\fIjar\fRġѤ)1İʾΥե뤬JARեɲä줿ȤǤ\fIjar\fRġѤƥեɲä硢եѤΥɲä뤳Ȥˤꡢޥ˥եȡեѹޤ\fI\&.SF\fRեѹޤ󡣸ڤޤƤȤߤʤΤϡ̾ʹߤJARեΤɤΥեѹƤʤǤ줬ȯΤϡ\fI\&.SF\fRեΥإåʳΥΥϥå夬ޥ˥եȡեб륻ΥϥåȰפǤ +\fI\&.SF\fRファイルのヘッダーに格納されたマニフェスト・ファイルのハッシュが、現在のマニフェスト・ファイルのハッシュに一致しない理由の1つは、署名および\fI\&.SF\fRファイルの生成後に、(\fIjar\fRツールを使用して)1つ以上のファイルがJARファイルに追加されたことです。\fIjar\fRツールを使用してファイルを追加した場合、新しいファイル用のセクションが追加されることにより、マニフェスト・ファイルは変更されますが、\fI\&.SF\fRファイルは変更されません。検証がまだ成功しているとみなされるのは、署名の生成以降にJARファイル内のどのファイルも変更されていない場合です。これが発生するのは、\fI\&.SF\fRファイルのヘッダー以外のセクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致する場合です。 .RE .sp .RS 4 @@ -439,16 +439,16 @@ JAR .sp -1 .IP " 3." 4.2 .\} -\fI\&.SF\fRե˥ȥJARեγƥեɤ߼ޤɼ˥եΥȤ׻̤ޥ˥եȡΤΥեΥȤӤޤȤƱǤɬפꡢǤʤϸڤԤޤ +\fI\&.SF\fRファイル内にエントリを持つJARファイル内の各ファイルを読み取ります。読取り中にファイルのダイジェストを計算し、結果をマニフェスト・セクション内のこのファイルのダイジェストと比較します。ダイジェストは同じである必要があり、そうでない場合は検証が失敗します。 .sp -ڥץˤʤ餫νʸڥ顼ȯ硢Υץߤ졢ƥ㳰ޤ\fIjarsigner\fRޥɤǤϡ㳰ªɽޤ +検証プロセス中になんらかの重大な検証エラーが発生した場合、そのプロセスは停止され、セキュリティ例外がスローされます。\fIjarsigner\fRコマンドでは、例外を捕捉および表示します。 .RE .PP -\fB:\fR -ɲäηٹ(ޤϡ\fI\-strict\fRץꤷϥ顼)Ϥ٤ɤɬפޤƱͤˡǤ뤫ꤹ뤿ˡ(\fI\-verbose\fR\fI\-certs\fRץꤷ)Ƥɤɬפޤ -.SS "1ĤJARեоݤȤʣν̾" +\fB注意:\fR +追加の警告(または、\fI\-strict\fRオプションを指定した場合はエラー)はすべて読む必要があります。同様に、証明が信頼できるかを決定するために、(\fI\-verbose\fRおよび\fI\-certs\fRオプションを指定して)証明書の内容も読む必要があります。 +.SS "1つのJARファイルを対象とする複数の署名" .PP -Τ褦ˡ\fIjarsigner\fRޥɤեʣ¹Ԥ¹ԤΤӤ˰ۤʤ桼̾ꤹ뤳Ȥˤäơ1ĤJARեʣΥ桼ν̾դ뤳ȤǤޤ +次のように、\fIjarsigner\fRコマンドをファイルで複数回実行し、実行のたびに異なるユーザーの別名を指定することによって、1つのJARファイルに複数のユーザーの署名を付けることができます。 .sp .if n \{\ .RS 4 @@ -461,7 +461,7 @@ jarsigner myBundle\&.jar kevin .RE .\} .PP -JARե뤬ʣ̾Ƥ硢JARեˤϡʣ\fI\&.SF\fRե\fI\&.DSA\fRե뤬ޤޤƤꡢ1ν̾Ф1ĤΥڥȤʤޤҤǤϡJARեˤϡ̾Υե뤬ޤޤƤޤ +JARファイルが複数回署名されている場合、そのJARファイルには、複数の\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルが含まれており、1回の署名に対して1つのペアとなります。前述の例では、出力JARファイルには、次の名前のファイルが含まれています。 .sp .if n \{\ .RS 4 @@ -475,9 +475,9 @@ KEVIN\&.DSA .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -γƹǤϡ͡\fIjarsigner\fRץˤĤޤɸդƤ +次の各項では、様々な\fIjarsigner\fRオプションについて説明します。次の標準に注意してください。 .sp .RS 4 .ie n \{\ @@ -487,7 +487,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -ɤΥץ̾ˤƬ˥ޥʥ(\-)դޤ +どのオプション名にも先頭にマイナス記号(\-)が付きます。 .RE .sp .RS 4 @@ -498,7 +498,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -ץǤդνǻǤޤ +オプションは任意の順序で指定できます。 .RE .sp .RS 4 @@ -509,7 +509,7 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -åΤޤϲդι(ץ)μºݤͤϡꤹɬפޤ +イタリック体または下線付きの項目(オプションの値)の実際の値は、指定する必要があります。 .RE .sp .RS 4 @@ -520,18 +520,18 @@ KEVIN\&.DSA .sp -1 .IP \(bu 2.3 .\} -\fI\-storepass\fR\fI\-keypass\fR\fI\-sigfile\fR\fI\-sigalg\fR\fI\-digestalg\fR\fI\-signedjar\fRTSAϢΥץѤǤΤϡJARե˽̾ΤߤǤ̾դJARե򸡾ڤǤϤޤ\fI\-keystore \fRץϡJARեν̾Ӹڤ˴Ϣޤޤ̾ϡJARեν̾Ӹڻ˻ꤷޤ +\fI\-storepass\fR、\fI\-keypass\fR、\fI\-sigfile\fR、\fI\-sigalg\fR、\fI\-digestalg\fR、\fI\-signedjar\fRおよびTSA関連のオプションを使用できるのは、JARファイルに署名する場合のみです。署名付きJARファイルを検証する場合ではありません。\fI\-keystore \fRオプションは、JARファイルの署名および検証に関連します。また、別名は、JARファイルの署名および検証時に指定します。 .RE .PP \-keystore \fIurl\fR .RS 4 -ȥξ򼨤URLꤷޤˤꡢ\fIuser\&.home\fRƥࡦץѥƥǷꤵ줿桼Υۡࡦǥ쥯ȥΥե\fI\&.keystore\fR˥ǥեꤵޤ +キーストアの場所を示すURLを指定します。これにより、\fIuser\&.home\fRシステム・プロパティで決定されたユーザーのホーム・ディレクトリ内のファイル\fI\&.keystore\fRにデフォルト設定されます。 .sp -ȥϽ̾ˤɬפǤǥեȤΥȥ¸ߤʤ硢ޤϥǥեȰʳΥȥѤϡȥŪ˻ꤹɬפޤ +キーストアは署名時には必要です。デフォルトのキーストアが存在しない場合、またはデフォルト以外のキーストアを使用する場合は、キーストアを明示的に指定する必要があります。 .sp -ڤȤϥȥɬפޤ󡣤ȥꤵƤ뤫뤤ϥǥեȤΥȥ¸ߤƤơ\fI\-verbose\fRץꤵƤ硢JARեθڤ˻Ѥ񤬤Υȥ1ĤǤޤޤƤ뤫ɤ˴ؤɲþ󤬽Ϥޤ +検証するときはキーストアは必要ありません。ただし、キーストアが指定されているか、あるいはデフォルトのキーストアが存在していて、さらに\fI\-verbose\fRオプションも指定されていた場合、JARファイルの検証に使用される証明書がそのキーストアに1つでも含まれているかどうかに関する追加情報が出力されます。 .sp -\fI\-keystore\fRˤϡURLǤϤʤե̾ȥѥǤξ硢ե: URLƱ褦˽ޤȤСˤ褦˻ꤹƱˤʤޤ +\fI\-keystore\fR引数には、URLではなくファイル名とパスを指定でき、この場合、ファイル: URLと同じように処理されます。たとえば、次にように指定すると同等になります。 .sp .if n \{\ .RS 4 @@ -543,8 +543,8 @@ KEVIN\&.DSA .if n \{\ .RE .\} -(JRE\fI$JAVA_HOME/lib/security directory\fRˤ) -\fIjava\&.security\fRƥץѥƥեSun PKCS #11ץХ줿硢\fIkeytool\fR\fIjarsigner\fRġPKCS#11ȡ˴ŤưǤޤΥץꤷޤ +(JREの\fI$JAVA_HOME/lib/security directory\fRにある) +\fIjava\&.security\fRセキュリティ・プロパティ・ファイル内でSun PKCS #11プロバイダが構成された場合、\fIkeytool\fRおよび\fIjarsigner\fRツールはPKCS#11トークンに基づいて動作できます。次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -556,7 +556,7 @@ KEVIN\&.DSA .if n \{\ .RE .\} -ȤСΥޥɤϡ줿PKCS#11ȡƤɽޤ +たとえば、次のコマンドは、構成されたPKCS#11トークンの内容を一覧表示します。 .sp .if n \{\ .RS 4 @@ -571,17 +571,17 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .PP \-storetype \fIstoretype\fR .RS 4 -󥹥󥹤륭ȥΥפꤷޤǥեȤΥȥפϡƥץѥƥե\fIkeystore\&.type\fRץѥƥͤǻꤵ줿פǤͤϡ\fIjava\&.security\&.KeyStore\fRstatic -\fIgetDefaultType\fR᥽åɤˤä֤ޤ +インスタンスを生成するキーストアのタイプを指定します。デフォルトのキーストア・タイプは、セキュリティ・プロパティ・ファイル内の\fIkeystore\&.type\fRプロパティの値で指定されたタイプです。この値は、\fIjava\&.security\&.KeyStore\fRのstatic +\fIgetDefaultType\fRメソッドによって返されます。 .sp -\fI\-storepass\fRץѤơPCKS #11ȡPINꤹ뤳ȤǤޤꤷʤ硢\fIkeytool\fR\fIjarsigner\fRޥɤˤäơȡPINλޤȡݸ줿ǧڥѥ(ѤPINѥåɤɼ굡ʤ)硢\fI\-protected\fRץꤹɬפޤѥɡץϻǤޤ +\fI\-storepass\fRオプションを使用して、PCKS #11トークンのPINを指定することもできます。何も指定しない場合、\fIkeytool\fRおよび\fIjarsigner\fRコマンドによって、トークンPINの指定を求められます。トークンに保護された認証パス(専用のPINパッドや生体読取り機など)がある場合、\fI\-protected\fRオプションを指定する必要がありますが、パスワード・オプションは指定できません。 .RE .PP \-storepass[:env | :file] \fIargument\fR .RS 4 -ȥ˥Τɬפʥѥɤꤷޤ줬ɬפʤΤϡJARե˽̾դȤΤߤǤ(ڤȤˤפǤ)ξ硢\fI\-storepass\fRץ򥳥ޥɥ饤ǻꤷʤȡѥɤϤޤ +キーストアにアクセスするのに必要なパスワードを指定します。これが必要なのは、JARファイルに署名を付けるときのみです(検証するときには不要です)。その場合、\fI\-storepass\fRオプションをコマンドラインで指定しないと、パスワードの入力を求められます。 .sp -\fIenv\fRޤ\fIfile\fRꤵƤʤ硢ѥɤͤ\fIargument\fRˤʤޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRが指定されていない場合、パスワードの値は\fIargument\fRになります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -592,7 +592,7 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -604,18 +604,18 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIfile\fR: -\fIargument\fRȤ̾Υե뤫ѥɤޤ +\fIargument\fRという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -ƥȤŪȤޤϥƥݸ줿ƥѤƤʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤ +\fB注意:\fR +テストを目的とする場合またはセキュリティ保護されたシステムを使用している場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。 .RE .PP \-keypass [:env | :file] \fIargument\fR .RS 4 -ޥɥ饤ǻꤵ줿̾б륭ȥȥ̩ݸΤ˻Ѥѥɤꤷޤ\fIjarsigner\fRѤJARե˽̾դȤϡѥɤɬפǤޥɥ饤ǥѥɤꤵƤ餺ɬפʥѥɤȥΥѥɤȰۤʤϡѥɤϤޤ +コマンドラインで指定された別名に対応するキーストア・エントリの秘密鍵を保護するのに使用するパスワードを指定します。\fIjarsigner\fRを使用してJARファイルに署名を付けるときは、パスワードが必要です。コマンドラインでパスワードが指定されておらず、必要なパスワードがストアのパスワードと異なる場合は、パスワードの入力を求められます。 .sp -\fIenv\fRޤ\fIfile\fRꤵƤʤ硢ѥɤͤ\fIargument\fRˤʤޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRが指定されていない場合、パスワードの値は\fIargument\fRになります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -626,7 +626,7 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -638,84 +638,84 @@ keytool \-keystore NONE \-storetype PKCS11 \-list .IP \(bu 2.3 .\} \fIfile\fR: -\fIargument\fRȤ̾Υե뤫ѥɤޤ +\fIargument\fRという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -ƥȤŪȤޤϥƥݸ줿ƥѤƤʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤ +\fB注意:\fR +テストを目的とする場合またはセキュリティ保護されたシステムを使用している場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。 .RE .PP \-sigfile \fIfile\fR .RS 4 -줿\fI\&.SF\fRե뤪\fI\&.DSA\fRե˻Ѥ١ե̾ꤷޤȤСե뤬\fIDUKESIGN\fRξ硢\fI\&.SF\fR\fI\&.DSA\fRեϡ\fIDUKESIGN\&.SF\fR\fIDUKESIGN\&.DSA\fRȤ̾ǡ̾դJARե\fIMETA\-INF\fRǥ쥯ȥ˳Ǽޤ +生成された\fI\&.SF\fRファイルおよび\fI\&.DSA\fRファイルに使用するベース・ファイル名を指定します。たとえば、ファイルが\fIDUKESIGN\fRの場合、生成される\fI\&.SF\fRおよび\fI\&.DSA\fRファイルは、\fIDUKESIGN\&.SF\fRおよび\fIDUKESIGN\&.DSA\fRという名前で、署名付きJARファイルの\fIMETA\-INF\fRディレクトリに格納されます。 .sp -եʸϡå\fIa\-zA\-Z0\-9_\-\fRꤵɬפޤե٥åȡӥϥեʸΤߤѤǤޤ\fI\&.SF\fR\fI\&.DSA\fRΥե̾ǤϡʸϤ٤ʸѴޤ +ファイル内の文字は、セット\fIa\-zA\-Z0\-9_\-\fRから指定される必要があります。アルファベット、数字、下線およびハイフン文字のみを使用できます。\fI\&.SF\fRおよび\fI\&.DSA\fRのファイル名では、小文字はすべて大文字に変換されます。 .sp -ޥɥ饤\fI\-sigfile\fRץꤷʤä硢\fI\&.SF\fRե\fI\&.DSA\fRեΥ١ե̾ϡޥɥ饤ǻꤵ줿̾Ƭ8ʸ򤹤٤ʸѴΤˤʤޤ̾8ʸ̤ξϡ̾Τޤ޻Ѥޤ̾ˡ̾ե̵̾ʸޤޤƤ硢ե̾뤿ˡʸ(_)ʸѴޤ +コマンドラインで\fI\-sigfile\fRオプションを指定しなかった場合、\fI\&.SF\fRファイルと\fI\&.DSA\fRファイルのベース・ファイル名は、コマンドラインで指定された別名の先頭の8文字をすべて大文字に変換したものになります。別名が8文字未満の場合は、別名がそのまま使用されます。別名に、署名ファイル名で無効な文字が含まれている場合、ファイル名を作成するために、該当する文字が下線(_)文字に変換されます。 .RE .PP \-sigalg \fIalgorithm\fR .RS 4 -JARեν̾˻Ѥ̾르ꥺ̾ꤷޤ +JARファイルの署名に使用する署名アルゴリズムの名前を指定します。 .sp -ɸŪʽ̾르ꥺ̾ΥꥹȤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAˤ -Java Cryptography Architecture (JCA)ե󥹡ɤΡϿA: ɸ̾פ򻲾ȤƤ +標準的な署名アルゴリズム名のリストは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAにある +Java Cryptography Architecture (JCA)リファレンス・ガイドの「付録A: 標準名」を参照してください。 .sp -Υ르ꥺˤϡJARեν̾˻Ѥ̩ȤθߴɬפǤΥץꤷʤ硢̩Υפ˱ơ\fISHA1withDSA\fR\fISHA256withRSA\fRޤ\fISHA256withECDSA\fRѤޤꤵ줿르ꥺμ󶡤ץХŪ˥󥹥ȡ뤵Ƥ뤫\fI\-providerClass\fRץѤƤΤ褦ʥץХ桼ꤹɬפޤǤʤ硢ޥɤϼԤޤ +このアルゴリズムには、JARファイルの署名に使用する秘密鍵との互換性が必要です。このオプションを指定しない場合、秘密鍵のタイプに応じて、\fISHA1withDSA\fR、\fISHA256withRSA\fRまたは\fISHA256withECDSA\fRが使用されます。指定されたアルゴリズムの実装を提供するプロバイダが静的にインストールされているか、\fI\-providerClass\fRオプションを使用してそのようなプロバイダをユーザーが指定する必要があります。そうでない場合、コマンドは失敗します。 .RE .PP \-digestalg \fIalgorithm\fR .RS 4 -JARեΥȥȤݤ˻Ѥåȡ르ꥺ̾ꤷޤ +JARファイルのエントリをダイジェストする際に使用するメッセージ・ダイジェスト・アルゴリズムの名前を指定します。 .sp -ɸŪʥåȡ르ꥺ̾ΥꥹȤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAˤ -Java Cryptography Architecture (JCA)ե󥹡ɤΡϿA: ɸ̾פ򻲾ȤƤ +標準的なメッセージ・ダイジェスト・アルゴリズム名のリストは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAにある +Java Cryptography Architecture (JCA)リファレンス・ガイドの「付録A: 標準名」を参照してください。 .sp -Υץꤷʤ硢\fISHA256\fRѤޤꤵ줿르ꥺμ󶡤ץХŪ˥󥹥ȡ뤵Ƥ뤫\fI\-providerClass\fRץѤƤΤ褦ʥץХ桼ꤹɬפޤǤʤ硢ޥɤϼԤޤ +このオプションを指定しない場合、\fISHA256\fRが使用されます。指定されたアルゴリズムの実装を提供するプロバイダが静的にインストールされているか、\fI\-providerClass\fRオプションを使用してそのようなプロバイダをユーザーが指定する必要があります。そうでない場合、コマンドは失敗します。 .RE .PP \-certs .RS 4 -ޥɥ饤ǡ\fI\-certs\fRץ\fI\-verify\fR\fI\-verbose\fRץȤȤ˻ꤷ硢JARեγƽ̾Ԥξ󤬽Ϥ˴ޤޤޤξˤϡ̾Ԥθ(\fI\&.DSA\fRե˳Ǽ)Υפ̾ޤޤ졢X\&.509(\fIjava\&.security\&.cert\&.X509Certificate\fRΥ󥹥)ξ硢̾Ԥμ̾ޤޤޤ +コマンドラインで、\fI\-certs\fRオプションを\fI\-verify\fRおよび\fI\-verbose\fRオプションとともに指定した場合、JARファイルの各署名者の証明書情報が出力に含まれます。この情報には、署名者の公開鍵を証明する証明書(\fI\&.DSA\fRファイルに格納)のタイプの名前が含まれ、証明書がX\&.509証明書(\fIjava\&.security\&.cert\&.X509Certificate\fRのインスタンス)の場合、署名者の識別名が含まれます。 .sp -ȥγǧԤޤޥɥ饤ǥȥͤꤵƤʤ硢ǥեȤΥȥե()åޤ̾Ԥθξ񤬥ȥΥȥȰפ硢ν̾ԤΥȥΥȥ̾ݥåɽޤ +キーストアの確認も行われます。コマンドラインでキーストアの値が指定されていない場合、デフォルトのキーストア・ファイル(ある場合)がチェックされます。署名者の公開鍵の証明書がキーストア内のエントリと一致する場合、その署名者のキーストアのエントリの別名が丸カッコ内に表示されます。 .RE .PP \-certchain \fIfile\fR .RS 4 -ޥɥ饤ǻꤷ̾ˤäɽ륭ȥȥ̩˴Ϣդ줿󤬴ǤϤʤˡѤꤷޤϡΤݻΤ˽ʬΰ褬ʤϡɥȡ˥ȥǼƤȯޤΥեϰϢϢ뤵줿X\&.509PKCS#7ñǡ֥åΤ줫ȤʤꡢΥ󥳡ǥ󥰷ϥХʥꡦ󥳡ǥ󥰷Internet RFC 1421ɸǵꤵǽ󥳡ǥ󥰷(Base64󥳡ǥ󥰤ȤƤФ)Τ줫ˤʤޤ󥿡ͥåRFC 1421沽ʤhttp://tools\&.ietf\&.org/html/rfc1421򻲾ȤƤ +コマンドラインで指定した別名によって表されるキーストア・エントリの秘密鍵に関連付けられた証明書チェーンが完全ではない場合に、使用する証明書チェーンを指定します。これは、証明書チェーン全体を保持するのに十分な領域がないハードウェア・トークン上にキーストアが格納されている場合に発生します。このファイルは一連の連結されたX\&.509証明書、PKCS#7形式の単一データ・ブロックのいずれかとなり、そのエンコーディング形式はバイナリ・エンコーディング形式、Internet RFC 1421標準で規定される印刷可能エンコーディング形式(Base64エンコーディングとも呼ばれる)のいずれかになります。インターネットRFC 1421証明書符号化規格およびhttp://tools\&.ietf\&.org/html/rfc1421を参照してください。 .RE .PP \-verbose .RS 4 -ޥɥ饤\fI\-verbose\fRץꤷ硢Ĺ⡼ɤưΥ⡼ɤǤϡ\fIjarsigner\fRϡJARν̾ޤϸڤοʹԾ˴ؤɲþϤޤ +コマンドラインで\fI\-verbose\fRオプションを指定した場合、冗長モードで動作し、このモードでは、\fIjarsigner\fRは、JARの署名または検証の進行状況に関する追加情報を出力します。 .RE .PP \-internalsf .RS 4 -ϡJARեν̾줿\fI\&.DSA\fR -(֥̾å)եˡ줿\fI\&.SF\fRե(̾ե)Υ󥳡ɤ줿ʥԡޤޤƤޤ ưѹޤJARեΤΥ򾮤뤿ˡǥեȤǤ\fI\&.DSA\fRեˤ\fI\&.SF\fRեΥԡޤޤʤ褦ˤʤäƤޤޥɥ饤\fI\-internalsf\fRꤷ硢Ʊ褦ưޤΥץϡƥȤԤǤºݤˤϡ\fI\-internalsf\fRץϡСإåɤ礭ʤ뤿ᡢѤʤǤ +以前は、JARファイルの署名時に生成された\fI\&.DSA\fR +(署名ブロック)ファイルに、生成された\fI\&.SF\fRファイル(署名ファイル)のエンコードされた完全なコピーが含まれていました。 この動作は変更されました。出力JARファイル全体のサイズを小さくするために、デフォルトでは\fI\&.DSA\fRファイルには\fI\&.SF\fRファイルのコピーが含まれないようになっています。コマンドラインで\fI\-internalsf\fRを指定した場合、以前と同じように動作します。このオプションは、テストを行う場合に便利です。実際には、\fI\-internalsf\fRオプションは、オーバーヘッドが大きくなるため、使用しないでください。 .RE .PP \-sectionsonly .RS 4 -ޥɥ饤\fI\-sectionsonly\fRץꤷ硢JARեν̾\fI\&.SF\fRե(̾ե)ˤϡޥ˥եȡեΤΥϥåޤإåϴޤޤޤ󡣤˴ޤޤΤϡJARեγƥե˴Ϣ󤪤ӥϥåΤߤǤ̾ե򻲾ȤƤ +コマンドラインで\fI\-sectionsonly\fRオプションを指定した場合、JARファイルの署名時に生成される\fI\&.SF\fRファイル(署名ファイル)には、マニフェスト・ファイル全体のハッシュを含むヘッダーは含まれません。これに含まれるのは、JARファイル内の各ソース・ファイルに関連する情報およびハッシュのみです。署名ファイルを参照してください。 .sp -ǥեȤǤϡŬΤˡΥإåɲäޤإå¸ߤ硢JARե򸡾ڤ뤿ӤˡڤǤϡޤإåΥϥå夬ޥ˥եȡեΤΥϥåȰפ뤫ɤǧ뤿˥åǤޤפ硢ڤϼμ˿ʤߤޤפʤ硢\fI\&.SF\fRեγƥե󥻥Υϥå夬ޥ˥եȡեб륻ΥϥåȰפȤޤŬƤʤڤ¹ԤɬפޤJARեθڤ򻲾ȤƤ +デフォルトでは、最適化のために、このヘッダーが追加されます。ヘッダーが存在する場合、JARファイルを検証するたびに、検証では、まずヘッダー内のハッシュがマニフェスト・ファイル全体のハッシュと一致するかどうかを確認するためにチェックできます。一致する場合、検証は次の手順に進みます。一致しない場合、\fI\&.SF\fRファイル内の各ソース・ファイル情報セクションのハッシュが、マニフェスト・ファイル内の対応するセクションのハッシュと一致するという、あまり最適化されていない検証を実行する必要があります。JARファイルの検証を参照してください。 .sp -\fI\-sectionsonly\fRץϡ˥ƥѤ˻ѤޤѤȥСإåɤ礭ʤ뤿ᡢƥѰʳǤϻѤʤǤ +\fI\-sectionsonly\fRオプションは、主にテスト用に使用されます。これを使用するとオーバーヘッドが大きくなるため、テスト用以外では使用しないでください。 .RE .PP \-protected .RS 4 -\fItrue\fRޤ\fIfalse\fRΤ줫ͤǤޤPIN꡼ʤɤݸ줿ǧڥѥˤäƥѥɤꤹɬפ硢\fItrue\fRꤷޤ +\fItrue\fRまたは\fIfalse\fRのいずれかの値を指定できます。専用PINリーダーなどの保護された認証パスによってパスワードを指定する必要がある場合、\fItrue\fRを指定します。 .RE .PP \-providerClass \fIprovider\-class\-name\fR .RS 4 -Ź沽ӥץХ\fIjava\&.security\fRƥץѥƥե˻ꤵƤʤȤϡΥޥ饹ե̾ꤹȤ˻Ѥޤ +暗号化サービス・プロバイダが\fIjava\&.security\fRセキュリティ・プロパティ・ファイルに指定されていないときは、そのマスター・クラス・ファイルの名前を指定するときに使用されます。 .sp -\fI\-providerArg ConfigFilePath\fRץȤȤ˻Ѥ\fIkeytool\fR\fIjarsigner\fRġϡץХưŪ˥󥹥ȡ뤷ȡեؤΥѥ\fIConfigFilePath\fRѤޤϡOracle PKCS #11ץХƥץѥƥե˹Ƥʤä\fIPKCS #11\fRȥɽ륳ޥɤ򼨤Ƥޤ +\fI\-providerArg ConfigFilePath\fRオプションとともに使用し、\fIkeytool\fRおよび\fIjarsigner\fRツールは、プロバイダを動的にインストールし、トークン構成ファイルへのパスに\fIConfigFilePath\fRを使用します。次の例は、Oracle PKCS #11プロバイダがセキュリティ・プロパティ・ファイルに構成されていなかった場合に\fIPKCS #11\fRキーストアを一覧表示するコマンドを示しています。 .sp .if n \{\ .RS 4 @@ -733,9 +733,9 @@ jarsigner \-keystore NONE \-storetype PKCS11 \e .PP \-providerName \fIproviderName\fR .RS 4 -\fIjava\&.security\fRƥץѥƥե2İʾΥץХ줿硢\fI\-providerName\fRץѤơΥץХ󥹥󥹤оݤˤ뤳ȤǤޤΥץΰϡץХ̾Ǥ +\fIjava\&.security\fRセキュリティ・プロパティ・ファイル内で2つ以上のプロバイダが構成された場合、\fI\-providerName\fRオプションを使用して、特定のプロバイダ・インスタンスを対象にすることができます。このオプションの引数は、プロバイダの名前です。 .sp -Oracle PKCS #11ץХξ硢\fIproviderName\fR\fISunPKCS11\-\fR\fITokenName\fRȤˤʤޤǡ°ɽǾܺ٤Ƥ褦ˡ\fITokenName\fRϡץХ󥹥󥹤줿̾ǤȤСΥޥɤϡ̾\fISmartCard\fR\fIPKCS #11\fRȥץХ󥹥󥹤Ƥɽޤ +Oracle PKCS #11プロバイダの場合、\fIproviderName\fRは\fISunPKCS11\-\fR\fITokenName\fRという形式になります。ここで、構成属性の表で詳細に説明されているように、\fITokenName\fRは、プロバイダ・インスタンスが構成された名前の接尾辞です。たとえば、次のコマンドは、名前接尾辞\fISmartCard\fRの\fIPKCS #11\fRキーストア・プロバイダ・インスタンスの内容を一覧表示します。 .sp .if n \{\ .RS 4 @@ -752,45 +752,45 @@ jarsigner \-keystore NONE \-storetype PKCS11 \e .PP \-J\fIjavaoption\fR .RS 4 -ꤵ줿\fIjavaoption\fRʸJava󥿥ץ꥿ľϤޤ\fIjarsigner\fRޥɤϡ󥿥ץ꥿ФåѡǤΥץˤϡޤ뤳ȤϤǤޤ󡣤Υץϡ¹ԴĶޤϥ꡼ѤĴǤǤ륤󥿥ץ꥿ץɽˤϡޥɥ饤\fIjava \-h\fRޤ\fIjava \-X\fRϤƤ +指定された\fIjavaoption\fR文字列をJavaインタプリタに直接渡します。\fIjarsigner\fRコマンドは、インタプリタに対するラッパーです。このオプションには、空白を含めることはできません。このオプションは、実行環境またはメモリー使用を調整する場合に便利です。指定できるインタプリタ・オプションを一覧表示するには、コマンドラインで\fIjava \-h\fRまたは\fIjava \-X\fRと入力してください。 .RE .PP \-tsa \fIurl\fR .RS 4 -\fI\-tsa http://example\&.tsa\&.url\fRJARեν̾˥ޥɥ饤ˤ硢̾ΥॹפޤURL -\fIhttp://example\&.tsa\&.url\fRϡTime Stamping Authority (TSA)ξꤷ\fI\-tsacert\fRץꤷƸФ줿URL򥪡С饤ɤޤ\fI\-tsa\fRץǤϡTSAθ򥭡ȥ֤ɬפϤޤ +\fI\-tsa http://example\&.tsa\&.url\fRがJARファイルの署名時にコマンドラインにある場合、署名のタイムスタンプが生成されます。URL +\fIhttp://example\&.tsa\&.url\fRは、Time Stamping Authority (TSA)の場所を特定し、\fI\-tsacert\fRオプションを指定して検出されたURLをオーバーライドします。\fI\-tsa\fRオプションでは、TSAの公開鍵証明書をキーストアに配置する必要はありません。 .sp -ॹפ뤿ˡ\fIjarsigner\fRϡRFC 3161Ƥ륿ॹסץȥ(TSP)ѤTSA̿ޤȡTSAˤä֤줿ॹסȡϡ֥̾åեν̾ȤȤ¸ޤ +タイムスタンプを生成するために、\fIjarsigner\fRは、RFC 3161で定義されているタイムスタンプ・プロトコル(TSP)を使用してTSAと通信します。成功すると、TSAによって返されたタイムスタンプ・トークンは、署名ブロック・ファイルの署名とともに保存されます。 .RE .PP \-tsacert \fIalias\fR .RS 4 -\fI\-tsacert alias\fRJARեν̾˥ޥɥ饤ˤ硢̾Υॹפޤ̾ϡȥͭTSAθꤷޤȥξǡTSAξꤹURLޤSubject Information Accessĥǽǧޤ +\fI\-tsacert alias\fRがJARファイルの署名時にコマンドラインにある場合、署名のタイムスタンプが生成されます。別名は、キーストア内の有効なTSAの公開鍵証明書を特定します。エントリの証明書で、TSAの場所を特定するURLを含むSubject Information Access拡張機能が確認されます。 .sp -\fI\-tsacert\fRץѤϡTSAθ񤬥ȥ֤Ƥɬפޤ +\fI\-tsacert\fRオプションを使用する場合は、TSAの公開鍵証明書がキーストアに配置されている必要があります。 .RE .PP \-tsapolicyid \fIpolicyid\fR .RS 4 -TSAСݥꥷID̤륪֥ȼ̻(OID)ꤷޤΥץꤷʤ硢ݥꥷID줺TSAСϥǥեȤΥݥꥷID򤷤ޤ +TSAサーバーに送信するポリシーIDを識別するオブジェクト識別子(OID)を指定します。このオプションを指定しない場合、ポリシーIDは送信されず、TSAサーバーはデフォルトのポリシーIDを選択します。 .sp -֥ȼ̻ҤϡITU Telecommunication Standardization Sector (ITU\-T)ɸǤX\&.696ˤäޤμ̻Ҥϡ̾\fI1\&.2\&.3\&.4\fRʤɤΡǤϤʤΥԥꥪɶڤΥåȤǤ +オブジェクト識別子は、ITU Telecommunication Standardization Sector (ITU\-T)標準であるX\&.696によって定義されます。これらの識別子は、通常、\fI1\&.2\&.3\&.4\fRなどの、負ではない数字のピリオド区切りのセットです。 .RE .PP \-altsigner \fIclass\fR .RS 4 -Υץϡؽ̾ᥫ˥ꤷޤ饹̾ϡ\fIcom\&.sun\&.jarsigner\&.ContentSigner\fRݥ饹ĥ륯饹ե̤ޤΥ饹եؤΥѥϡ\fI\-altsignerpath\fRץˤäޤ\fI\-altsigner\fRץѤ硢\fIjarsigner\fRޥɤǤϡꤵ줿饹ˤä󶡤̾ᥫ˥Ѥޤʳξ硢\fIjarsigner\fRޥɤϥǥեȤν̾ᥫ˥Ѥޤ +このオプションは、代替署名メカニズムを指定します。完全修飾クラス名は、\fIcom\&.sun\&.jarsigner\&.ContentSigner\fR抽象クラスを拡張するクラス・ファイルを識別します。このクラス・ファイルへのパスは、\fI\-altsignerpath\fRオプションによって定義されます。\fI\-altsigner\fRオプションを使用した場合、\fIjarsigner\fRコマンドでは、指定されたクラスによって提供される署名メカニズムを使用します。それ以外の場合、\fIjarsigner\fRコマンドはデフォルトの署名メカニズムを使用します。 .sp -ȤС\fIcom\&.sun\&.sun\&.jarsigner\&.AuthSigner\fRȤ̾Υ饹󶡤̾ᥫ˥ѤˤϡjarsignerΥץ\fI\-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fRѤޤ +たとえば、\fIcom\&.sun\&.sun\&.jarsigner\&.AuthSigner\fRという名前のクラスが提供する署名メカニズムを使用するには、jarsignerのオプション\fI\-altsigner com\&.sun\&.jarsigner\&.AuthSigner\fRを使用します。 .RE .PP \-altsignerpath \fIclasspathlist\fR .RS 4 -饹ե뤪Ӥ줬¸JARեؤΥѥꤷޤ\fI\-altsigner\fRץѤơ饹ե̾ꤷޤ饹ե뤬JARեˤ硢ΥץǤϡJARեؤΥѥꤷޤ +クラス・ファイルおよびそれが依存するJARファイルへのパスを指定します。\fI\-altsigner\fRオプションを使用して、クラス・ファイル名を指定します。クラス・ファイルがJARファイル内にある場合、このオプションでは、そのJARファイルへのパスを指定します。 .sp -ХѥޤϸߤΥǥ쥯ȥؤХѥǤޤ\fIclasspathlist\fRʣΥѥJARե뤬ޤޤ硢Oracle Solarisξϥ(:)ǡWindowsξϥߥ(;)ǡ줾ڤޤŪΥ饹Ǥ˸ѥˤϡΥץפǤ +絶対パスまたは現在のディレクトリへの相対パスを指定できます。\fIclasspathlist\fRに複数のパスやJARファイルが含まれる場合、それらを、Oracle Solarisの場合はコロン(:)で、Windowsの場合はセミコロン(;)で、それぞれ区切ります。目的のクラスがすでに検索パス内にある場合は、このオプションは不要です。 .sp -Ǥϡ饹եޤJARեؤΥѥꤹˡ򼨤ޤJARե̾ޤޤ +次の例では、クラス・ファイルを含むJARファイルへのパスを指定する方法を示します。JARファイル名を含めます。 .sp .if n \{\ .RS 4 @@ -801,7 +801,7 @@ TSA .if n \{\ .RE .\} -Ǥϡ饹եޤJARեؤΥѥꤹˡ򼨤ޤJARե̾άޤ +次の例では、クラス・ファイルを含むJARファイルへのパスを指定する方法を示します。JARファイル名を省略します。 .sp .if n \{\ .RS 4 @@ -816,101 +816,101 @@ TSA .PP \-strict .RS 4 -̾ޤϸڽˡޥɤˤٹåȯԤ礬ޤΥץꤹȡޥɤˤ긡Ф줿ʷٹåġνλɤȿǤޤ顼ȷٹ򻲾ȤƤ +署名または検証処理中に、コマンドにより警告メッセージが発行される場合があります。このオプションを指定すると、コマンドにより検出された重大な警告メッセージがツールの終了コードに反映されます。エラーと警告を参照してください。 .RE .PP \-verbose \fIsuboptions\fR .RS 4 -ڽξ硢\fI\-verbose\fRץˤϡɽ̤ꤹ륵֥ץꤷޤ\fI\-certs\fRץꤷ硢ǥեȡ⡼(ޤϥ֥ץ\fIall\fR)Ǥϡȥ꤬뤿Ӥ˳ƥȥ꤬ɽ졢θJARեγƽ̾Ԥξɽޤ\fI\-certs\fR\fI\-verbose:grouped\fR֥ץꤷ硢Ʊ̾Ծĥȥ꤬ξȤȤˡ롼ײɽޤ\fI\-certs\fR\fI\-verbose:summary\fR֥ץꤷ硢Ʊ̾Ծĥȥ꤬ξȤȤˡ롼ײɽޤƥȥξܺ٤ϡ\fI1ĤΥȥ(ʾ)\fRˤޤȤɽޤ򻲾ȤƤ +検証処理の場合、\fI\-verbose\fRオプションには、表示する情報の量を決定するサブオプションを指定します。\fI\-certs\fRオプションも指定した場合、デフォルト・モード(またはサブオプション\fIall\fR)では、エントリが処理されるたびに各エントリが表示され、その後にJARファイルの各署名者の証明書情報も表示されます。\fI\-certs\fRおよび\fI\-verbose:grouped\fRサブオプションを指定した場合、同じ署名者情報を持つエントリが、その証明書情報とともに、グループ化されて表示されます。\fI\-certs\fRおよび\fI\-verbose:summary\fRサブオプションを指定した場合、同じ署名者情報を持つエントリが、その証明書情報とともに、グループ化されて表示されます。各エントリの詳細は、\fI1つのエントリ(以上)\fRにまとめられて表示されます。例を参照してください。 .RE -.SH "顼ȷٹ" +.SH "エラーと警告" .PP -̾ޤϸڥץˡ\fIjarsigner\fRޥɤǡ͡ʥ顼ޤϷٹȯԤǽޤ +署名または検証プロセス中に、\fIjarsigner\fRコマンドで、様々なエラーまたは警告が発行される可能性があります。 .PP -㳲硢\fIjarsigner\fRޥɤϥ1ǽλޤ㳲Ϥʤ1İʾνʷٹ𤬤硢\fI\-strict\fRץ󤬻ꤵ\fBʤ\fRϡ\fIjarsigner\fRޥɤϥ0ǽλ\fI\-strict\fRꤵƤϷٹ𥳡ɤORͤǽλޤٹΤߤ롢ޤϷٹ𤬤ޤäʤ硢ޥɤϾ˥0ǽλޤ +障害がある場合、\fIjarsigner\fRコマンドはコード1で終了します。障害はないが、1つ以上の重大な警告がある場合、\fI\-strict\fRオプションが指定されて\fBいない\fR場合は、\fIjarsigner\fRコマンドはコード0で終了し、\fI\-strict\fRが指定されている場合は警告コードのOR値で終了します。情報警告のみがある、または警告がまったくない場合、コマンドは常にコード0で終了します。 .PP -ȤСȥν̾˻Ѥ񤬴ڤǡեν̾ĤʤKeyUsageĥǽѤƤ硢\fI\-strict\fRץ󤬻ꤵƤȡ\fIjarsigner\fRޥɤϥ12 (=4+8)ǽλޤ +たとえば、エントリの署名に使用される証明書が期限切れで、ファイルの署名を許可しないKeyUsage拡張機能を使用している場合、\fI\-strict\fRオプションが指定されていると、\fIjarsigner\fRコマンドはコード12 (=4+8)で終了します。 .PP -\fB:\fR -UNIX١Υڥ졼ƥ󥰡ƥǤ0255ޤǤͤΤߤͭΤᡢλɤϺѤޤ +\fB注意:\fR +UNIXベースのオペレーティング・システムでは0から255までの値のみが有効のため、終了コードは再利用されます。 .PP -ΥǤϡ\fIjarsigner\fRޥɤˤȯԤǤ륨顼ӷٹ̾ɡ򵭽Ҥޤ -.SS "㳲" +次のセクションでは、\fIjarsigner\fRコマンドにより発行できるエラーおよび警告の名前、コード、説明を記述します。 +.SS "障害" .PP -ޥɥ饤ϥ顼JARե˽̾븰ڥ򸡺ǤʤޤϽ̾դJARեθڼԤʤ(ꤵޤ)\fIjarsigner\fRޥɤμͳ +コマンドライン解析エラー、JARファイルに署名する鍵ペアを検索できない、または署名付きJARファイルの検証失敗など(限定されません)、\fIjarsigner\fRコマンドの失敗理由。 .PP failure .RS 4 -1̾ޤϸڤԤޤ +コード1。署名または検証が失敗します。 .RE -.SS "ʷٹ" +.SS "重大な警告" .PP -\fB:\fR -\fI\-strict\fRץꤷ硢ʷٹϥ顼Ȥ𤵤ޤ +\fB注意:\fR +\fI\-strict\fRオプションを指定した場合、重大な警告はエラーとして報告されます。 .PP -JARեν̾˻Ѥ˥顼롢ޤϽ̾դJARե¾꤬ʤɡ\fIjarsigner\fRޥɤʷٹȯԤͳ +JARファイルの署名に使用する証明書にエラーがある、または署名付きJARファイルに他の問題があるなど、\fIjarsigner\fRコマンドが重大な警告を発行する理由。 .PP hasExpiredCert .RS 4 -4jarˤϡ̾Ծ񤬴ڤΥȥ꤬ޤޤƤޤ +コード4。このjarには、署名者証明書が期限切れのエントリが含まれています。 .RE .PP notYetValidCert .RS 4 -4jarˤϡ̾Ծ񤬤ޤͭˤʤäƤʤȥ꤬ޤޤƤޤ +コード4。このjarには、署名者証明書がまだ有効になっていないエントリが含まれています。 .RE .PP chainNotValidated .RS 4 -4jarˤϡڤǤʤȥ꤬ޤޤƤޤ +コード4。このjarには、証明書チェーンが正しく検証できないエントリが含まれています。 .RE .PP badKeyUsage .RS 4 -8JARˤϡ̾ԾKeyUsageĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このJARには、署名者証明書のKeyUsage拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP badExtendedKeyUsage .RS 4 -8jarˤϡ̾ԾExtendedKeyUsageĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このjarには、署名者証明書のExtendedKeyUsage拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP badNetscapeCertType .RS 4 -8jarˤϡ̾ԾNetscapeCertTypeĥǽɽ̾Ĥʤȥ꤬ޤޤƤޤ +コード8。このjarには、署名者証明書のNetscapeCertType拡張機能がコード署名を許可しないエントリが含まれています。 .RE .PP hasUnsignedEntry .RS 4 -16jarˤϡå򤷤Ƥʤ̤̾Υȥ꤬ޤޤƤޤ +コード16。このjarには、整合性チェックをしていない未署名のエントリが含まれています。 .RE .PP notSignedByAlias .RS 4 -32jarˤϡꤵ줿̾ˤäƽ̾Ƥʤ̾ѥȥ꤬ޤޤƤޤ +コード32。このjarには、指定された別名によって署名されていない署名済エントリが含まれています。 .RE .PP aliasNotInStore .RS 4 -32jarˤϡΥȥ̾ˤäƽ̾Ƥʤ̾ѥȥ꤬ޤޤޤ +コード32。このjarには、このキーストア内の別名によって署名されていない署名済エントリが含まれます。 .RE -.SS "ٹ" +.SS "情報警告" .PP -ٹˤϡ顼ǤϤʤŬڤȤߤʤΤޤޤޤɤϤޤ +情報警告には、エラーではないが不適切とみなされるものが含まれます。コードはありません。 .PP hasExpiringCert .RS 4 -jarˤϡ̾Ծ6˴ڤȤʤ륨ȥ꤬ޤޤƤޤ +このjarには、署名者証明書が6か月以内に期限切れとなるエントリが含まれています。 .RE .PP noTimestamp .RS 4 -jarˤϡॹפޤޤʤ̾ޤޤƤޤॹפʤǤϡ̾Ծͭ(\fIYYYY\-MM\-DD\fR)ޤϾμ塢桼ϤJARե򸡾ڤǤʤ礬ޤ +このjarには、タイムスタンプを含まない署名が含まれています。タイムスタンプなしでは、署名者証明書の有効期限(\fIYYYY\-MM\-DD\fR)後または将来の取消日後、ユーザーはこのJARファイルを検証できない場合があります。 .RE -.SH "" -.SS "JARեν̾" +.SH "例" +.SS "JARファイルの署名" .PP -ΥޥɤѤơȥ̾\fIworking\fRǥ쥯ȥ\fImystore\fRȤ̾Υȥˤ\fIjane\fRǤ桼̩bundle\&.jar˽̾̾դJARե\fIsbundle\&.jar\fRȤ̾դޤ +次のコマンドを使用して、キーストア別名が\fIworking\fRディレクトリの\fImystore\fRという名前のキーストアにある\fIjane\fRであるユーザーの秘密鍵でbundle\&.jarに署名し、署名付きJARファイルに\fIsbundle\&.jar\fRという名前を付けます。 .sp .if n \{\ .RS 4 @@ -925,9 +925,9 @@ jarsigner \-keystore /working/mystore .RE .\} .PP -ҤΥޥɤǤ\fI\-sigfile\fRꤵƤʤᡢ̾դJARե˳Ǽ줿\fI\&.SF\fRե뤪\fI\&.DSA\fRե̾ϡ̾˴ŤǥեȤ̾ˤʤޤϡ̾դ\fIJANE\&.SF\fR\fIJANE\&.DSA\fRǤ +前述のコマンドでは\fI\-sigfile\fRが指定されていないため、署名付きJARファイルに格納される生成された\fI\&.SF\fRファイルおよび\fI\&.DSA\fRファイルの名前は、別名に基づいたデフォルトの名前になります。これらは、名前付きの\fIJANE\&.SF\fRおよび\fIJANE\&.DSA\fRです。 .PP -ȥΥѥɤ̩Υѥɤ硢ҤΥޥɤṳ̂ơΤȤ¹ԤǤޤ +ストアのパスワードおよび秘密鍵のパスワードを求められる場合、前述のコマンドを短縮して、次のことを実行できます。 .sp .if n \{\ .RS 4 @@ -940,7 +940,7 @@ jarsigner \-keystore /working/mystore .RE .\} .PP -ȥǥեȤΥȥ(ۡࡦǥ쥯ȥ\&.keystore)Ǥ硢˼褦ˡȥꤹɬפޤ +キーストアがデフォルトのキーストア(ホーム・ディレクトリ内の\&.keystore)である場合、次に示すように、キーストアを指定する必要がありません。 .sp .if n \{\ .RS 4 @@ -952,7 +952,7 @@ jarsigner \-signedjar sbundle\&.jar bundle\&.jar jane .RE .\} .PP -JARե(bundle\&.jar)̾դJARեǾ񤭤硢Τ褦\fI\-signedjar\fRץꤹɬפϤޤ +入力JARファイル(bundle\&.jar)を署名付きJARファイルで上書きする場合、次のように\fI\-signedjar\fRオプションを指定する必要はありません。 .sp .if n \{\ .RS 4 @@ -963,9 +963,9 @@ jarsigner bundle\&.jar jane .if n \{\ .RE .\} -.SS "̾դJARեθ" +.SS "署名付きJARファイルの検証" .PP -̾դJARե򸡾ڤơ̾ͭJARե뤬󤵤ʤäȤǧˤϡΤ褦ʥޥɤѤޤ +署名付きJARファイルを検証して、署名が有効でJARファイルが改ざんされなかったことを確認するには、次のようなコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -977,7 +977,7 @@ jarsigner \-verify sbundle\&.jar .RE .\} .PP -ڤȡ\fIjar verified\fRɽޤǤʤϡ顼åɽޤ\fI\-verbose\fRץѤȡܺپǤޤ\fIjarsigner\fR\fI\-verbose\fRץȤȤ˻Ѥ륵ץ򡢼˼ޤ +検証が成功すると、\fIjar verified\fRが表示されます。そうでない場合は、エラー・メッセージが表示されます。\fI\-verbose\fRオプションを使用すると、詳細情報を取得できます。\fIjarsigner\fRを\fI\-verbose\fRオプションとともに使用するサンプルを、次に示します。 .sp .if n \{\ .RS 4 @@ -1000,9 +1000,9 @@ jarsigner \-verify \-verbose sbundle\&.jar .if n \{\ .RE .\} -.SS "Ѥ" +.SS "証明書情報を使用した検証" .PP -\fI\-certs\fRץ\fI\-verify\fR\fI\-verbose\fRץȤȤ˻ꤷ硢JARեγƽ̾Ԥξ󤬽Ϥ˴ޤޤޤξˤϡ񥿥ס̾Ԥμ̾(X\&.509ξ)ޤޤ졢ݥåˤϡJARեθ񤬥ȥȥθ˰פν̾ԤΥȥ̾ޤޤޤȤСΤ褦ˤʤޤ +\fI\-certs\fRオプションを\fI\-verify\fRおよび\fI\-verbose\fRオプションとともに指定した場合、JARファイルの各署名者の証明書情報が出力に含まれます。この情報には、証明書タイプ、署名者の識別名情報(X\&.509証明書の場合)が含まれ、丸カッコ内には、JARファイルの公開鍵証明書がキーストア・エントリの公開鍵証明書に一致する場合の署名者のキーストア別名が含まれます。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1030,8 +1030,8 @@ jarsigner \-keystore /working/mystore \-verify \-verbose \-certs myTest\&.jar .RE .\} .PP -̾ԤξX\&.509ǤϤʤ硢̾ɽޤ󡣤ξˤϡΥפ̾ΤߤɽޤȤСPGPǡ̾\fIbob\fRǤ硢\fIPGP, (bob)\fRޤ -.SH "Ϣ" +署名者の証明書がX\&.509証明書ではない場合、識別名情報は表示されません。その場合には、証明書のタイプと別名のみが表示されます。たとえば、証明書がPGP証明書で、別名が\fIbob\fRである場合、\fIPGP, (bob)\fRを取得します。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -1063,8 +1063,8 @@ keytool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlˤ -֥: Java SEΥƥǽ +http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlにある +「コース: Java SEのセキュリティ機能」 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/java.1 b/jdk/src/solaris/doc/sun/man/man1/ja/java.1 index f134a028e6c..15e9bb78246 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/java.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/java.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: java .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "java" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "java" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -java \- Javaץꥱưޤ -.SH "" +java \- Javaアプリケーションを起動します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,26 +74,26 @@ java \- Java .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassname\fR .RS 4 -ư륯饹̾ +起動するクラスの名前。 .RE .PP \fIfilename\fR .RS 4 -ƤӽФJava(JAR)ե̾\fI\-jar\fRץȰˤΤ߻Ѥޤ +呼び出されるJavaアーカイブ(JAR)ファイルの名前。\fI\-jar\fRオプションと一緒にのみ使用します。 .RE .PP \fIargs\fR .RS 4 -Ƕڤ줿\fImain()\fR᥽åɤϤ +空白で区切られた\fImain()\fRメソッドに渡される引数。 .RE -.SH "" +.SH "説明" .PP -\fIjava\fRޥɤJavaץꥱ򳫻ϤޤJava Runtime Environment (JRE)ư塢ꤷ饹ɤΥ饹\fImain()\fR᥽åɤƤӽФȤˤꡢԤޤΥ᥽åɤϡ\fIpublic\fR\fIstatic\fRȤɬפޤޤ֤ͤޤ󡣤ˡ\fIString\fRѥ᡼ȤƻǤɬפޤ᥽åϼηޤߤޤ +\fIjava\fRコマンドはJavaアプリケーションを開始します。Java Runtime Environment (JRE)を起動した後、指定したクラスをロードし、そのクラスの\fImain()\fRメソッドを呼び出すことにより、これを行います。このメソッドは、\fIpublic\fRおよび\fIstatic\fRとして宣言する必要があります。また、値は返せません。さらに、\fIString\fR配列をパラメータとして指定できる必要があります。メソッド宣言は次の形式を含みます。 .sp .if n \{\ .RS 4 @@ -105,16 +105,16 @@ public static void main(String[] args) .RE .\} .PP -\fIjava\fRޥɤѤơ\fImain()\fR᥽åɤ뤫\fIjavafx\&.application\&.Application\fRĥ륯饹ɤ뤳ȤǡJavaFXץꥱưǤޤԤξ硢ưġ\fIApplication\fR饹Υ󥹥󥹤\fIinit()\fR᥽åɤ򥳡뤷\fIstart(javafx\&.stage\&.Stage)\fR᥽åɤ򥳡뤷ޤ +\fIjava\fRコマンドを使用して、\fImain()\fRメソッドがあるか\fIjavafx\&.application\&.Application\fRを拡張するクラスをロードすることで、JavaFXアプリケーションを起動できます。後者の場合、起動ツールは\fIApplication\fRクラスのインスタンスを構成し、その\fIinit()\fRメソッドをコールし、\fIstart(javafx\&.stage\&.Stage)\fRメソッドをコールします。 .PP -ǥեȤǤϡ\fIjava\fRޥɤΥץǤϤʤǽΰϡƤӽФ륯饹δ̾Ǥ\fI\-jar\fRץꤷ硢ΰϡץꥱΥ饹եȥ꥽եޤJARե̾ˤʤޤư饹ϡɤ\fIMain\-Class\fRޥ˥եȡإåˤäƻꤵɬפޤ +デフォルトでは、\fIjava\fRコマンドのオプションではない最初の引数は、呼び出されるクラスの完全修飾名です。\fI\-jar\fRオプションを指定した場合、その引数は、アプリケーションのクラス・ファイルとリソース・ファイルを含むJARファイルの名前になります。起動クラスは、ソース・コードの\fIMain\-Class\fRマニフェスト・ヘッダーによって指定される必要があります。 .PP -JREϡ֡ȥȥåס饹ѥ󥹥ȡѳĥǽӥ桼Υ饹ѥ3ս꤫顢ư饹(ӥץꥱǻѤƤ¾Υ饹)򸡺ޤ +JREは、ブートストラップ・クラス・パス、インストール済拡張機能およびユーザーのクラス・パスの3箇所から、起動クラス(およびアプリケーションで使用されている他のクラス)を検索します。 .PP -饹ե̾ޤJARե̾θΰϡ\fImain()\fR᥽åɤϤޤ -.SH "ץ" +クラス・ファイル名またはJARファイル名の後の引数は、\fImain()\fRメソッドに渡されます。 +.SH "オプション" .PP -\fIjava\fRޥɤϡΥƥʬǤ빭Ϥʥץ򥵥ݡȤƤޤ +\fIjava\fRコマンドは、次のカテゴリに分類できる広範なオプションをサポートしています。 .sp .RS 4 .ie n \{\ @@ -124,7 +124,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ +標準オプション .RE .sp .RS 4 @@ -135,7 +135,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ +非標準オプション .RE .sp .RS 4 @@ -146,7 +146,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥ󥿥ࡦץ +高度なランタイム・オプション .RE .sp .RS 4 @@ -157,7 +157,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤JITѥ顦ץ +高度なJITコンパイラ・オプション .RE .sp .RS 4 @@ -168,7 +168,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥӥӥƥץ +高度なサービスアビリティ・オプション .RE .sp .RS 4 @@ -179,31 +179,31 @@ JRE .sp -1 .IP \(bu 2.3 .\} -٤ʥ١쥯󡦥ץ +高度なガベージ・コレクション・オプション .RE .PP -ɸΥץϡJava Virtual Machine (JVM)Τ٤ƤμǥݡȤ뤳ȤݾڤޤϡJREΥСγǧ饹ѥꡢĹʽϤͭʤɤΰŪʥ˻Ѥޤ +標準のオプションは、Java Virtual Machine (JVM)のすべての実装でサポートすることが保証されます。これらは、JREのバージョンの確認、クラス・パスの設定、冗長な出力の有効化などの一般的なアクションに使用されます。 .PP -ɸʳΥץϡJava HotSpotۥޥ˸ͭѥץǤ뤿ᡢ٤ƤJVMǥݡȤ뤳Ȥݾڤ줺ѹǽޤΥץ\fI\-X\fRdzϤޤ +標準以外のオプションは、Java HotSpot仮想マシンに固有の汎用オプションであるため、すべてのJVM実装でサポートされることは保証されず、変更される可能性があります。これらのオプションは\fI\-X\fRで開始します。 .PP -ĥץϡѰդ˻ѤʤȤᤷޤϡΥƥ׷ĤȤ¿ƥ๽ѥ᡼ؤøɬפʾ礬Java HotSpotۥޥΰĴ뤿˻Ѥ볫ȯԥץǤϡ٤ƤJVMǥݡȤ뤳Ȥݾڤ줺ѹǽޤĥץ\fI\-XX\fRǻϤޤޤ +拡張オプションは、不用意に使用しないことをお薦めします。これらは、特定のシステム要件を持つことが多く、システム構成パラメータへの特権アクセスが必要な場合があるJava HotSpot仮想マシン操作の特定の領域を調整するために使用される開発者オプションです。これらは、すべてのJVM実装でサポートされることは保証されず、変更される可能性があります。拡張オプションは\fI\-XX\fRで始まります。 .PP -ǿ꡼侩ޤϺ륪ץפ뤿ˡɥȤκǸ侩Ǻ줿ץȤ̾Υ󤬤ޤ +最新リリースで非推奨または削除されるオプションを追跡するために、ドキュメントの最後に非推奨で削除されたオプションという名前のセクションがあります。 .PP -֡롦ץϡǥեȤ̵ˤʤäƤ뵡ǽͭˤꡢǥեȤͭˤʤäƤ뵡ǽ̵ˤ뤿˻ѤޤΤ褦ʥץϡѥ᡼ɬפȤޤ󡣥֡\fI\-XX\fRץϡץ饹(\fI\-XX:+\fR\fIOptionName\fR)Ѥͭˤޥʥ(\fI\-XX:\-\fR\fIOptionName\fR)Ѥ̵ˤޤ +ブール・オプションは、デフォルトで無効になっている機能を有効にしたり、デフォルトで有効になっている機能を無効にするために使用されます。このようなオプションは、パラメータを必要としません。ブール値\fI\-XX\fRオプションは、プラス記号(\fI\-XX:+\fR\fIOptionName\fR)を使用して有効にし、マイナス記号(\fI\-XX:\-\fR\fIOptionName\fR)を使用して無効にします。 .PP -ɬפʥץξ硢ϡץ̾򡢥(:)ޤ(=)ǶڤäΤˤʤ뤫뤤ϰץθľ³⤢ޤ(Τʹʸϳƥץˤäưۤʤޤ)Хñ̤ǻꤹ褦Ƥ硢Ѥʤ뤤ϥХ(KB)ˤ\fIk\fRޤ\fIK\fRᥬХ(MB)ˤ\fIm\fRޤ\fIM\fRХ(GB)ˤ\fIg\fRޤ\fIG\fRѤޤȤС8GBꤹˤϡ\fI8g\fR\fI8192m\fR\fI8388608k\fRޤ\fI8589934592\fRΤ줫ȤƻǤޤѡȤλ꤬ɬפʾϡ01οͤѤޤ(ȤС25%ξ\fI0\&.25\fRꤷޤ) -.SS "ɸ४ץ" +引数が必要なオプションの場合、引数は、オプション名を空白、コロン(:)または等号(=)で区切ったものになるか、あるいは引数がオプションの後に直接続く場合もあります(正確な構文は各オプションによって異なります)。サイズをバイト単位で指定するよう求められている場合、接尾辞を使用しないか、あるいはキロバイト(KB)には接尾辞\fIk\fRまたは\fIK\fR、メガバイト(MB)には接尾辞\fIm\fRまたは\fIM\fR、ギガバイト(GB)には接尾辞\fIg\fRまたは\fIG\fRを使用します。たとえば、サイズを8GBに設定するには、\fI8g\fR、\fI8192m\fR、\fI8388608k\fRまたは\fI8589934592\fRのいずれかを引数として指定できます。パーセントの指定が必要な場合は、0から1の数値を使用します(たとえば、25%の場合は\fI0\&.25\fRを指定します)。 +.SS "標準オプション" .PP -ϡJVMΤ٤ƤμǥݡȤǤŪ˻Ѥ륪ץǤ +これらは、JVMのすべての実装でサポートされる最も一般的に使用されるオプションです。 .PP \-agentlib:\fIlibname\fR[=\fIoptions\fR] .RS 4 -ꤷͥƥ֡ȡ饤֥ɤޤ饤֥̾θˡ饤֥˸ͭΥץΥ޶ڤꥹȤѤǤޤ +指定したネイティブ・エージェント・ライブラリをロードします。ライブラリ名の後に、ライブラリに固有のオプションのカンマ区切りリストを使用できます。 .sp -ץ\fI\-agentlib:foo\fRꤷ硢JVMϡ\fILD_LIBRARY_PATH\fRƥѿ(OS XǤϡѿ\fIDYLD_LIBRARY_PATH\fRˤʤޤ)ǻꤵ줿\fIlibfoo\&.so\fRȤ̾Υ饤֥ɤ褦Ȥޤ +オプション\fI\-agentlib:foo\fRを指定した場合、JVMは、\fILD_LIBRARY_PATH\fRシステム変数(OS Xでは、この変数は\fIDYLD_LIBRARY_PATH\fRになります)で指定された場所に\fIlibfoo\&.so\fRという名前のライブラリをロードしようとします。 .sp -Ǥϡåο3ǡ20ߥäȤ˥ҡסץե󥰡ġ(HPROF)饤֥ɤơץCPUˡ򼨤ޤ +次の例では、スタックの深さ3で、20ミリ秒ごとにヒープ・プロファイリング・ツール(HPROF)ライブラリをロードして、サンプルのCPU情報を取得する方法を示します。 .sp .if n \{\ .RS 4 @@ -214,7 +214,7 @@ JRE .if n \{\ .RE .\} -Ǥϡᥤ󡦥饹ΥJVMߤơJavaǥХå磻䡦ץȥ(JDWP)饤֥ɤơݡ8000ǤΥå³Ѥ˥ꥹ˥󥰤ˡ򼨤ޤ +次の例では、メイン・クラスのロード前にJVMを一時停止して、Javaデバッグ・ワイヤ・プロトコル(JDWP)ライブラリをロードして、ポート8000でのソケット接続用にリスニングする方法を示します。 .sp .if n \{\ .RS 4 @@ -225,7 +225,7 @@ JRE .if n \{\ .RE .\} -ͥƥ֡ȡ饤֥ξܺ٤ϡ򻲾ȤƤ +ネイティブ・エージェント・ライブラリの詳細は、次を参照してください。 .sp .RS 4 .ie n \{\ @@ -235,7 +235,7 @@ JRE .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlˤ\fIjava\&.lang\&.instrument\fRѥå +http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlにある\fIjava\&.lang\&.instrument\fRパッケージの説明 .RE .sp .RS 4 @@ -246,54 +246,54 @@ http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summa .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#startingˤJVMġ롦󥿥եɤΥȤΥޥɥ饤󡦥ץ˴ؤ +http://docs\&.oracle\&.com/javase/8/docs/platform/jvmti/jvmti\&.html#startingにあるJVMツール・インタフェース・ガイドのエージェントのコマンドライン・オプションに関する項 .RE .RE .PP \-agentpath:\fIpathname\fR[=\fIoptions\fR] .RS 4 -Хѥ̾ǻꤵ줿ͥƥ֡ȡ饤֥ɤޤΥץ\fI\-agentlib\fRƱǤ饤֥Υե롦ѥӥե̾Ѥޤ +絶対パス名で指定されたネイティブ・エージェント・ライブラリをロードします。このオプションは\fI\-agentlib\fRと同等ですが、ライブラリのフル・パスおよびファイル名を使用します。 .RE .PP \-client .RS 4 -Java HotSpot Client VM򤷤ޤ64ӥåȡСJava SE Development Kit (JDK)ǤϡߡΥץ̵뤵졢Server JVMѤޤ +Java HotSpot Client VMを選択します。64ビット・バージョンのJava SE Development Kit (JDK)では、現在、このオプションは無視され、かわりにServer JVMが使用されます。 .sp -ǥեȤJVMϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlˤ -С饹ޥθФ򻲾ȤƤ +デフォルトのJVM選択は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlにある +サーバークラス・マシンの検出を参照してください。 .RE .PP \-D\fIproperty\fR=\fIvalue\fR .RS 4 -ƥࡦץѥƥͤꤷޤ\fIproperty\fRѿϡץѥƥ̾ɽΤʤʸǤ\fIvalue\fRѿϡץѥƥͤɽʸǤ\fIvalue\fRޤʸξ硢ǰϤߤޤ(: -\fI\-Dfoo="foo bar"\fR) +システム・プロパティの値を設定します。\fIproperty\fR変数は、プロパティの名前を表す、空白のない文字列です。\fIvalue\fR変数は、プロパティの値を表す文字列です。\fIvalue\fRが空白を含む文字列の場合、それを引用符で囲みます(例: +\fI\-Dfoo="foo bar"\fR)。 .RE .PP \-d32 .RS 4 -ץꥱ32ӥåȴĶǼ¹Ԥޤ32ӥåȴĶ󥹥ȡ뤵ƤʤݡȤƤʤϡ顼𤵤ޤǥեȤǤϡ64ӥåȡƥबѤƤץꥱ32ӥåȴĶǼ¹Ԥޤ +アプリケーションを32ビット環境で実行します。32ビット環境がインストールされていないかサポートされていない場合は、エラーが報告されます。デフォルトでは、64ビット・システムが使用されている場合を除き、アプリケーションは32ビット環境で実行されます。 .RE .PP \-d64 .RS 4 -ץꥱ64ӥåȴĶǼ¹Ԥޤ64ӥåȴĶ󥹥ȡ뤵ƤʤݡȤƤʤϡ顼𤵤ޤǥեȤǤϡ64ӥåȡƥबѤƤץꥱ32ӥåȴĶǼ¹Ԥޤ +アプリケーションを64ビット環境で実行します。64ビット環境がインストールされていないかサポートされていない場合は、エラーが報告されます。デフォルトでは、64ビット・システムが使用されている場合を除き、アプリケーションは32ビット環境で実行されます。 .sp -ߤΤȤJava HotSpot Server VMΤߤ64ӥåȤ򥵥ݡȤƤ뤿ᡢ\fI\-d64\fRѻˤ\fI\-server\fRץ󤬰Ū˻Ѥޤ\fI\-d64\fRѻˤϡ\fI\-client\fRץ̵뤵ޤλͤϡΥ꡼Ǥѹˤʤǽޤ +現在のところ、Java HotSpot Server VMのみが64ビットの操作をサポートしているため、\fI\-d64\fR使用時には\fI\-server\fRオプションが暗黙的に使用されます。\fI\-d64\fR使用時には、\fI\-client\fRオプションは無視されます。この仕様は、将来のリリースでは変更になる可能性があります。 .RE .PP \-disableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], \-da[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR] .RS 4 -̵ˤޤǥեȤǤϡϤ٤ƤΥѥåӥ饹̵ˤʤäƤޤ +アサーションを無効にします。デフォルトでは、アサーションはすべてのパッケージおよびクラスで無効になっています。 .sp -ʤ\fI\-disableassertions\fR -(\fI\-da\fR)ꤹȡ٤ƤΥѥåӥ饹ǥ̵ˤʤޤ\fI\&.\&.\&.\fRǽ\fIpackagename\fRꤹȡꤷѥåȤΥ֥ѥåǥ̵ˤʤޤȤ\fI\&.\&.\&.\fRΤߤꤹȡߤκȥǥ쥯ȥˤ̾Τʤѥåǥ̵ˤʤޤ\fIclassname\fRꤹȡؤˤäơꤷ饹ǥ̵ˤʤޤ +引数なしの\fI\-disableassertions\fR +(\fI\-da\fR)を指定すると、すべてのパッケージおよびクラスでアサーションが無効になります。\fI\&.\&.\&.\fRで終わる\fIpackagename\fR引数を指定すると、指定したパッケージとそのサブパッケージ内でアサーションが無効になります。引数として\fI\&.\&.\&.\fRのみを指定すると、現在の作業ディレクトリにある名前のないパッケージ内でアサーションが無効になります。\fIclassname\fR引数を指定すると、切替えによって、指定したクラス内でアサーションが無効になります。 .sp \fI\-disableassertions\fR -(\fI\-da\fR)ץϡ٤ƤΥ饹ӥƥࡦ饹ŬѤޤ(ƥࡦ饹ˤϥ饹Ϥޤ)Υ롼ˤ1㳰ޤץΰꤵƤʤϡƥࡦ饹ŬѤޤ󡣤ˤꡢƥࡦ饹٤ƤΥ饹ǥñ̵ˤ뤳ȤǤޤ\fI\-disablesystemassertions\fRץѤȡ٤ƤΥƥࡦ饹ǥ̵ˤ뤳ȤǤޤ +(\fI\-da\fR)オプションは、すべてのクラス・ローダーおよびシステム・クラスに適用されます(システム・クラスにはクラス・ローダーはありません)。このルールには1つ例外があります。オプションの引数が指定されていない場合は、システム・クラスに適用されません。これにより、システム・クラスを除くすべてのクラスでアサーションを簡単に無効にすることができます。\fI\-disablesystemassertions\fRオプションを使用すると、すべてのシステム・クラスでアサーションを無効にすることができます。 .sp -Υѥå䥯饹ǥŪͭˤˤϡ\fI\-enableassertions\fR -(\fI\-ea\fR)ץѤޤξΥץƱ˻ѤǤޤȤСѥå\fIcom\&.wombat\&.fruitbat\fR -(ӤΥ֥ѥå)Ǥϥͭˤơ饹\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRǤϥ̵ˤơ\fIMyClass\fRץꥱ¹ԤˤϡΥޥɤѤޤ +特定のパッケージやクラスでアサーションを明示的に有効にするには、\fI\-enableassertions\fR +(\fI\-ea\fR)オプションを使用します。両方のオプションを同時に使用できます。たとえば、パッケージ\fIcom\&.wombat\&.fruitbat\fR +(およびそのサブパッケージ)ではアサーションを有効にして、クラス\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRではアサーションを無効にして、\fIMyClass\fRアプリケーションを実行するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -308,22 +308,22 @@ java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickb .PP \-disablesystemassertions, \-dsa .RS 4 -٤ƤΥƥࡦ饹ǥ̵ˤޤ +すべてのシステム・クラス内でアサーションを無効にします。 .RE .PP \-enableassertions[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR], \-ea[:[\fIpackagename\fR]\&.\&.\&.|:\fIclassname\fR] .RS 4 -ͭˤޤǥեȤǤϡϤ٤ƤΥѥåӥ饹̵ˤʤäƤޤ +アサーションを有効にします。デフォルトでは、アサーションはすべてのパッケージおよびクラスで無効になっています。 .sp -ʤ\fI\-enableassertions\fR -(\fI\-ea\fR)ꤹȡ٤ƤΥѥåӥ饹ǥͭˤʤޤ\fI\&.\&.\&.\fRǽ\fIpackagename\fRꤹȡꤷѥåȤΥ֥ѥåǥͭˤʤޤȤ\fI\&.\&.\&.\fRΤߤꤹȡߤκȥǥ쥯ȥˤ̾Τʤѥåǥͭˤʤޤ\fIclassname\fRꤹȡؤˤäơꤷ饹ǥͭˤʤޤ +引数なしの\fI\-enableassertions\fR +(\fI\-ea\fR)を指定すると、すべてのパッケージおよびクラスでアサーションが有効になります。\fI\&.\&.\&.\fRで終わる\fIpackagename\fR引数を指定すると、指定したパッケージとそのサブパッケージ内でアサーションが有効になります。引数として\fI\&.\&.\&.\fRのみを指定すると、現在の作業ディレクトリにある名前のないパッケージ内でアサーションが有効になります。\fIclassname\fR引数を指定すると、切替えによって、指定したクラス内でアサーションが有効になります。 .sp \fI\-enableassertions\fR -(\fI\-ea\fR)ץϡ٤ƤΥ饹ӥƥࡦ饹ŬѤޤ(ƥࡦ饹ˤϥ饹Ϥޤ)Υ롼ˤ1㳰ޤץΰꤵƤʤϡƥࡦ饹ŬѤޤ󡣤ˤꡢƥࡦ饹٤ƤΥ饹ǥñͭˤ뤳ȤǤޤ\fI\-enablesystemassertions\fRץϡ٤ƤΥƥࡦ饹ǥͭˤ̤Υå󶡤ޤ +(\fI\-ea\fR)オプションは、すべてのクラス・ローダーおよびシステム・クラスに適用されます(システム・クラスにはクラス・ローダーはありません)。このルールには1つ例外があります。オプションの引数が指定されていない場合は、システム・クラスに適用されません。これにより、システム・クラスを除くすべてのクラスでアサーションを簡単に有効にすることができます。\fI\-enablesystemassertions\fRオプションは、すべてのシステム・クラスでアサーションを有効にする別のスイッチを提供します。 .sp -Υѥå䥯饹ǥŪ̵ˤˤϡ\fI\-disableassertions\fR -(\fI\-da\fR)ץѤޤñ쥳ޥɤˤΥåΥ󥹥󥹤ʣꤷϡꤷå֤˽Ƥ饯饹ɤޤȤСѥå\fIcom\&.wombat\&.fruitbat\fR -(ӤΥ֥ѥå)ǤΤߥͭˤơ饹\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRǤϥ̵ˤơ\fIMyClass\fRץꥱ¹ԤˤϡΥޥɤѤޤ +特定のパッケージやクラスでアサーションを明示的に無効にするには、\fI\-disableassertions\fR +(\fI\-da\fR)オプションを使用します。単一コマンドにこれらのスイッチのインスタンスを複数指定した場合は、指定したスイッチが順番に処理されてからクラスがロードされます。たとえば、パッケージ\fIcom\&.wombat\&.fruitbat\fR +(およびそのサブパッケージ)でのみアサーションを有効にして、クラス\fIcom\&.wombat\&.fruitbat\&.Brickbat\fRではアサーションを無効にして、\fIMyClass\fRアプリケーションを実行するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -338,21 +338,21 @@ java \-ea:com\&.wombat\&.fruitbat\&.\&.\&. \-da:com\&.wombat\&.fruitbat\&.Brickb .PP \-enablesystemassertions, \-esa .RS 4 -٤ƤΥƥࡦ饹ǥͭˤޤ +すべてのシステム・クラス内でアサーションを有効にします。 .RE .PP \-help, \-? .RS 4 -ºݤJVM¹Ԥˡ\fIjava\fRޥɤλѾɽޤ +実際にJVMを実行せずに、\fIjava\fRコマンドの使用状況情報を表示します。 .RE .PP \-jar \fIfilename\fR .RS 4 -JARե˥ץ벽줿ץ¹Ԥޤ\fIfilename\fRϡѤ륢ץꥱγȤƵǽ\fIpublic static void main(String[] args)\fR᥽åɤ롢\fIMain\-Class:\fR\fIclassname\fRȤ1Ԥޤޥ˥եȤJARե̾Ǥ +JARファイルにカプセル化されたプログラムを実行します。\fIfilename\fR引数は、使用するアプリケーションの開始点として機能する\fIpublic static void main(String[] args)\fRメソッドを定義する、\fIMain\-Class:\fR\fIclassname\fRという形式の1行を含むマニフェストを持つJARファイルの名前です。 .sp -\fI\-jar\fRץѤȡꤷJARե뤬٤ƤΥ桼饹Υˤʤꡢ饹ѥ¾̵뤵ޤ +\fI\-jar\fRオプションを使用すると、指定したJARファイルがすべてのユーザー・クラスのソースになり、クラス・パスの他の設定は無視されます。 .sp -JARեξܺ٤ϡΥ꥽򻲾ȤƤ +JARファイルの詳細は、次のリソースを参照してください。 .sp .RS 4 .ie n \{\ @@ -373,7 +373,7 @@ jar(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.htmlˤJava(JAR)եΥ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.htmlにあるJavaアーカイブ(JAR)ファイルのガイド .RE .sp .RS 4 @@ -384,42 +384,42 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jar/index\&.html .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlˤ -֥å: JARեΥץΥѥå +http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.htmlにある +「レッスン: JARファイルのプログラムのパッケージ化」 .RE .RE .PP \-javaagent:\fIjarpath\fR[=\fIoptions\fR] .RS 4 -ꤷJavaץߥ󥰸쥨ȤɤޤJavaץꥱΥ󥹥ȥȤξܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlˤJava APIɥȤ\fIjava\&.lang\&.instrument\fRѥå򻲾ȤƤ +指定したJavaプログラミング言語エージェントをロードします。Javaアプリケーションのインストゥルメントの詳細は、http://docs\&.oracle\&.com/javase/8/docs/api/java/lang/instrument/package\-summary\&.htmlにあるJava APIドキュメントの\fIjava\&.lang\&.instrument\fRパッケージの説明を参照してください。 .RE .PP \-jre\-restrict\-search .RS 4 -桼ץ饤١ȤJREС󸡺˴ޤޤ +ユーザー・プライベートなJREをバージョン検索に含めます。 .RE .PP \-no\-jre\-restrict\-search .RS 4 -桼ץ饤١ȤJREС󸡺ޤ +ユーザー・プライベートなJREをバージョン検索から除外します。 .RE .PP \-server .RS 4 -Java HotSpot Server VM򤷤ޤ64ӥåȡСJDKǤϡServer VMΤߤ򥵥ݡȤƤ뤿ᡢξ硢ΥץϰŪǤ +Java HotSpot Server VMを選択します。64ビット・バージョンのJDKでは、Server VMのみをサポートしているため、その場合、このオプションは暗黙的です。 .sp -ǥեȤJVMϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlˤ -С饹ޥθФ򻲾ȤƤ +デフォルトのJVM選択は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/server\-class\&.htmlにある +サーバークラス・マシンの検出を参照してください。 .RE .PP \-showversion .RS 4 -Сɽץꥱμ¹Ԥ³ԤޤΥץ\fI\-version\fRץƱǤ\-versionϥСɽJVM˽λؼۤʤޤ +バージョン情報を表示し、アプリケーションの実行を続行します。このオプションは\fI\-version\fRオプションと同等ですが、\-versionはバージョン情報の表示後にJVMに終了を指示する点が異なります。 .RE .PP \-splash:\fIimgname\fR .RS 4 -\fIimgname\fRǻꤵ줿᡼ޤॹץå̤ɽޤȤСץꥱεư\fIimages\fRǥ쥯ȥ\fIsplash\&.gif\fRեɽˤϡΥץѤޤ +\fIimgname\fRで指定されたイメージを含むスプラッシュ画面を表示します。たとえば、アプリケーションの起動時に\fIimages\fRディレクトリの\fIsplash\&.gif\fRファイルを表示するには、次のオプションを使用します。 .sp .if n \{\ .RS 4 @@ -434,31 +434,31 @@ Java HotSpot Server VM .PP \-verbose:class .RS 4 -ɤ줿ƥ饹˴ؤɽޤ +ロードされた各クラスに関する情報を表示します。 .RE .PP \-verbose:gc .RS 4 -ƥ١쥯(GC)٥Ȥ˴ؤɽޤ +各ガベージ・コレクション(GC)イベントに関する情報を表示します。 .RE .PP \-verbose:jni .RS 4 -ͥƥ֡᥽åɤλѤӤ¾Java Native Interface (JNI)ƥӥƥ˴ؤɽޤ +ネイティブ・メソッドの使用およびその他のJava Native Interface (JNI)アクティビティに関する情報を表示します。 .RE .PP \-version .RS 4 -СɽƤ齪λޤΥץ\fI\-showversion\fRץƱǤ\-showversionϥСɽJVM˽λؼʤۤʤޤ +バージョン情報を表示してから終了します。このオプションは\fI\-showversion\fRオプションと同等ですが、\-showversionはバージョン情報の表示後にJVMに終了を指示しない点が異なります。 .RE .PP \-version:\fIrelease\fR .RS 4 -ץꥱμ¹Ԥ˻Ѥ꡼Сꤷޤ뤵줿\fIjava\fRޥɤΥС󤬤λƤŬڤʼƥǸĤäˤϡŬڤʼѤޤ +アプリケーションの実行に使用するリリース・バージョンを指定します。コールされた\fIjava\fRコマンドのバージョンがこの指定内容を満たさず、かつ適切な実装がシステム上で見つかった場合には、その適切な実装が使用されます。 .sp -\fIrelease\fRϡΤʥСʸ󡢤ޤ϶Ƕڤ줿СʸȥСϰϤΥꥹȤꤷޤ\fIСʸ\fRϡηǡȯԤΥСֹꤷޤ: +\fIrelease\fR引数は、正確なバージョン文字列、または空白で区切られたバージョン文字列とバージョン範囲のリストを指定します。\fIバージョン文字列\fRは、次の形式で、開発者のバージョン番号を指定します: \fI1\&.\fR\fIx\fR\fI\&.0_\fR\fIu\fR -(\fIx\fRϥ᥸㡼Сֹ桢\fIu\fRϹСֹǤ)\fIСϰ\fRϡΥСʹߤꤹˤϥСʸθ˥ץ饹(\fI+\fR)³ΡޤϰפƬޤǤդΥСʸꤹˤϰΥСʸθ˥ꥹ(\fI*\fR)³Τǹޤ\fIOR\fRȹ礻ˤ϶2ĤΥСʸ/ϰϤ\fIAND\fRȹ礻ˤϥѥ(\fI&\fR)ѤơСʸȥСϰϤȤ߹礻뤳ȤǤޤȤС饹ޤJARեμ¹ԤJRE 6u13 (1\&.6\&.0_13)ޤ6u10 (1\&.6\&.0_10)ʹߤǤդJRE 6Τ줫ɬפȤ硢ꤷޤ +(\fIx\fRはメジャー・バージョン番号、\fIu\fRは更新バージョン番号です)。\fIバージョン範囲\fRは、このバージョン以降を指定するにはバージョン文字列の後にプラス記号(\fI+\fR)を続けたもの、または一致する接頭辞を含む任意のバージョン文字列を指定するには一部のバージョン文字列の後にアスタリスク(\fI*\fR)を続けたもので構成されます。論理\fIOR\fRの組合せには空白、2つのバージョンの文字列/範囲の論理\fIAND\fRの組合せにはアンパサンド(\fI&\fR)を使用して、バージョン文字列とバージョン範囲を組み合せることができます。たとえば、クラスまたはJARファイルの実行にJRE 6u13 (1\&.6\&.0_13)または6u10 (1\&.6\&.0_10)以降の任意のJRE 6のいずれかを必要とする場合、次を指定します。 .sp .if n \{\ .RS 4 @@ -469,99 +469,99 @@ Java HotSpot Server VM .if n \{\ .RE .\} -䤬ɬפʤΤϡ\fIrelease\fRѥ᡼˶򤬤ΤߤǤ +引用符が必要なのは、\fIrelease\fRパラメータに空白がある場合のみです。 .sp -JARեξϡС׷򥳥ޥɥ饤˻ꤹ⡢JARեΥޥ˥ե˻ꤹ뤳Ȥ侩Ƥޤ +JARファイルの場合は、バージョン要件をコマンドラインに指定するよりも、JARファイルのマニフェスト内に指定することが推奨されています。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP -ΥץϡJava HotSpotۥޥ˸ͭѥץǤ +これらのオプションは、Java HotSpot仮想マシンに固有の汎用オプションです。 .PP \-X .RS 4 -Ѳǽʤ٤Ƥ\fI\-X\fRץΥإפɽޤ +使用可能なすべての\fI\-X\fRオプションのヘルプを表示します。 .RE .PP \-Xbatch .RS 4 -Хå饦ɡѥ̵ˤޤǥեȤǤϡJVMǤϡХå饦ɡѥ뤬λޤǡ᥽åɤХå饦ɡȤƥѥ뤷󥿥ץ꥿⡼ɤǥ᥽åɤ¹Ԥޤ\fI\-Xbatch\fRե饰ꤹȡХå饦ɡѥ뤬̵ˤʤꡢ٤ƤΥ᥽åɤΥѥ뤬λޤǥե饦ɡȤƽޤ +バックグラウンド・コンパイルを無効にします。デフォルトでは、JVMでは、バックグラウンド・コンパイルが終了するまで、メソッドをバックグラウンド・タスクとしてコンパイルし、インタプリタ・モードでメソッドを実行します。\fI\-Xbatch\fRフラグを指定すると、バックグラウンド・コンパイルが無効になり、すべてのメソッドのコンパイルが完了するまでフォアグラウンド・タスクとして処理されます。 .sp -Υץ\fI\-XX:\-BackgroundCompilation\fRƱǤ +このオプションは\fI\-XX:\-BackgroundCompilation\fRと同等です。 .RE .PP \-Xbootclasspath:\fIpath\fR .RS 4 -֡ȡ饹ե򸡺ǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤϡJDK˴ޤޤ֡ȡ饹եΤ˻Ѥޤ +ブート・クラス・ファイルを検索するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。これらは、JDKに含まれるブート・クラス・ファイルのかわりに使用されます。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xbootclasspath/a:\fIpath\fR .RS 4 -ǥեȤΥ֡ȥȥåס饹ѥκǸɲäǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤ +デフォルトのブートストラップ・クラス・パスの最後に追加するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xbootclasspath/p:\fIpath\fR .RS 4 -ǥեȤΥ֡ȥȥåס饹ѥƬɲäǥ쥯ȥꡢJARե뤪ZIP֤Ρ(:)Ƕڤ줿ꥹȤꤷޤ +デフォルトのブートストラップ・クラス・パスの先頭に追加するディレクトリ、JARファイルおよびZIPアーカイブの、コロン(:)で区切られたリストを指定します。 .sp -JREХʥꡦɡ饤󥹤˰ȿ뤿ᡢ\fIrt\&.jar\fRǥ饹򥪡С饤ɤŪǡΥץѤ륢ץꥱǥץʤǤ +JREバイナリ・コード・ライセンスに違反するため、\fIrt\&.jar\fRでクラスをオーバーライドする目的で、このオプションを使用するアプリケーションをデプロイしないでください。 .RE .PP \-Xboundthreads .RS 4 -桼٥Υåɤ򥫡ͥ롦åɤ˥Хɤޤ +ユーザー・レベルのスレッドをカーネル・スレッドにバインドします。 .RE .PP \-Xcheck:jni .RS 4 -Java Native Interface (JNI)ǽФɲååԤޤŪˤϡϡJNIꥯȤˡJNIؿϤѥ᡼ȼ¹ԴĶΥǡ򸡾ڤޤ̵ʥǡĤäϡͥƥ֡ɤ꤬뤳Ȥ򼨤Ƥ뤿ᡢJVMϥꥫХǽʥ顼ȯƽλޤΥץѤȡѥեޥ㲼ͽۤޤ +Java Native Interface (JNI)機能に対して追加チェックを行います。具体的には、これは、JNIリクエストを処理する前に、JNI関数に渡されるパラメータと実行環境のデータを検証します。無効なデータが見つかった場合は、ネイティブ・コードに問題があることを示しているため、JVMはリカバリ不能なエラーを発生して終了します。このオプションを使用すると、パフォーマンス低下が予想されます。 .RE .PP \-Xcomp .RS 4 -ǽθƽФJavaɤӥѥ롦᥽åɤβ̵ˤޤǥեȤǤϡJITѥϡ10,000βᤵ줿᥽åɸƽФ¹ԤơΨŪʥѥΤξޤΨˤƥѥΥѥեޥ󥹤夵ˤϡ\fI\-Xcomp\fRե饰Ѥơᤵ줿᥽åɸƽФ̵ˤޤ +最初の呼出しでJavaコードおよびコンパイル・メソッドの解釈を無効にします。デフォルトでは、JITコンパイラは、10,000の解釈されたメソッド呼出しを実行して、効率的なコンパイルのための情報を収集します。効率を犠牲にしてコンパイルのパフォーマンスを向上させるには、\fI\-Xcomp\fRフラグを使用して、解釈されたメソッド呼出しを無効にします。 .sp -\fI\-XX:CompileThreshold\fRץѤơѥˡᤵ줿᥽åɸƽФοѹ뤳ȤǤޤ +\fI\-XX:CompileThreshold\fRオプションを使用して、コンパイルの前に、解釈されたメソッド呼出しの数を変更することもできます。 .RE .PP \-Xdebug .RS 4 -Ԥޤ󡣲̸ߴΤѰդƤޤ +何も行いません。下位互換性のために用意されています。 .RE .PP \-Xdiag .RS 4 -ɲäοǥåɽޤ +追加の診断メッセージを表示します。 .RE .PP \-Xfuture .RS 4 -饹եλͤؤν򶯲롢̩ʥ饹եΥåͭˤʤޤΥ꡼Ǥϡ긷̩ʥåǥեȤˤʤ뤿ᡢɤȯȤˤϡȯԤϤΥե饰Ѥ뤳Ȥᤷޤ +クラス・ファイル形式の仕様への準拠を強化する、厳密なクラス・ファイル形式のチェックが有効になります。将来のリリースでは、より厳密なチェックがデフォルトになるため、新しいコードを開発するときには、開発者はこのフラグを使用することをお薦めします。 .RE .PP \-Xincgc .RS 4 -ʬGCͭˤޤ +増分GCを有効にします。 .RE .PP \-Xint .RS 4 -󥿥ץ꥿ѥ⡼ɤǥץꥱ¹Ԥޤͥƥ֡ɤؤΥѥ̵ˤʤꡢ٤ƤΥХȥɤ󥿥ץ꥿ˤäƼ¹Ԥޤ㥹ȡ󡦥(JIT)ѥ餬󶡤ѥեޥ󥹾ϡΥ⡼ɤǤϼ¸ޤ +インタプリタ専用モードでアプリケーションを実行します。ネイティブ・コードへのコンパイルは無効になり、すべてのバイトコードがインタプリタによって実行されます。ジャスト・イン・タイム(JIT)コンパイラが提供するパフォーマンス上の利点は、このモードでは実現されません。 .RE .PP \-Xinternalversion .RS 4 -\fI\-version\fRץܺ٤JVMСɽƤ齪λޤ +\fI\-version\fRオプションより詳細なJVMバージョン情報を表示してから終了します。 .RE .PP \-Xloggc:\fIfilename\fR .RS 4 -ܺ٤GC٥ȾѤ˥쥯ȤեꤷޤΥե˽񤭹ޤϡϿ줿ƥ٥Ȥ˹ԤǽGC٥Ȱʹߤ˷вᤷ֤ꤷ\fI\-verbose:gc\fRνϤƤޤ\fI\-Xloggc\fRץ\fI\-verbose:gc\fR򥪡С饤ɤޤ(ξƱ\fIjava\fRޥɤǻꤵ줿) +詳細なGCイベント情報をロギング用にリダイレクトするファイルを設定します。このファイルに書き込まれる情報は、記録された各イベントの前に行われる最初のGCイベント以降に経過した時間を指定した\fI\-verbose:gc\fRの出力と類似しています。\fI\-Xloggc\fRオプションは\fI\-verbose:gc\fRをオーバーライドします(これらの両方が同じ\fIjava\fRコマンドで指定された場合)。 .sp -: +例: .sp .if n \{\ .RS 4 @@ -576,7 +576,7 @@ Java Native Interface (JNI) .PP \-Xmaxjitcodesize=\fIsize\fR .RS 4 -JITѥ뤵줿ɤκ祳ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡͤ48MBꤵƤޤ +JITコンパイルされたコードの最大コード・キャッシュ・サイズ(バイト単位)を指定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、この値は48MBに設定されています。 .sp .if n \{\ .RS 4 @@ -587,21 +587,21 @@ JIT .if n \{\ .RE .\} -Υץ\fI\-XX:ReservedCodeCacheSize\fRƱǤ +このオプションは\fI\-XX:ReservedCodeCacheSize\fRと同等です。 .RE .PP \-Xmixed .RS 4 -ͥƥ֡ɤ˥ѥ뤵줿ۥåȡ᥽åɤ󥿥ץ꥿ˤäƤ٤ƤΥХȥɤ¹Ԥޤ +ネイティブ・コードにコンパイルされたホット・メソッドを除き、インタプリタによってすべてのバイトコードを実行します。 .RE .PP \-Xmn\fIsize\fR .RS 4 -㤤(ʡ)ΥҡפνӺ祵(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +若い世代(ナーサリ)のヒープの初期サイズおよび最大サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ҡפμ㤤꡼Ͽ֥Ȥ˻ѤޤGCϡ¾Υ꡼ꤳΥ꡼ǡˤ˼¹Ԥޤ㤤Υ硢¿Υޥʡ١쥯󤬼¹Ԥޤ礭硢ե롦١쥯Τߤ¹ԤޤλޤǤ˻֤뤳Ȥޤ㤤ΥϡΤΥҡסȾʬ4ʬ1δ֤ˤƤȤᤷޤ +ヒープの若い世代リージョンは新しいオブジェクトに使用されます。GCは、他のリージョンよりこのリージョンで、より頻繁に実行されます。若い世代のサイズが小さすぎる場合、多数のマイナー・ガベージ・コレクションが実行されます。サイズが大きすぎる場合、フル・ガベージ・コレクションのみが実行されますが、完了までに時間がかかることがあります。若い世代のサイズは、全体のヒープ・サイズの半分から4分の1の間にしておくことをお薦めします。 .sp -Ǥϡ㤤νӺ祵͡ñ̤Ѥ256MBꤹˡ򼨤ޤ +次の例では、若い世代の初期サイズおよび最大サイズを様々な単位を使用して256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -614,14 +614,14 @@ JIT .if n \{\ .RE .\} -㤤ΥҡפνȺ祵ξꤹ\fI\-Xmn\fRץΤˡˤ\fI\-XX:NewSize\fR򡢺祵ˤ\fI\-XX:MaxNewSize\fRѤǤޤ +若い世代のヒープの初期サイズと最大サイズの両方を設定する\fI\-Xmn\fRオプションのかわりに、初期サイズの設定には\fI\-XX:NewSize\fRを、最大サイズの設定には\fI\-XX:MaxNewSize\fRを使用できます。 .RE .PP \-Xms\fIsize\fR .RS 4 -ҡפν(Хñ)ꤷޤꤹͤϡ1MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +ヒープの初期サイズ(バイト単位)を設定します。指定する値は、1MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ǤϡƤ줿꡼Υ͡ñ̤Ѥ6MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーのサイズを様々な単位を使用して6MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -634,14 +634,14 @@ JIT .if n \{\ .RE .\} -Υץꤷʤ硢ϡŤȼ㤤˳Ƥ줿ιפȤꤵޤ㤤Υҡפνϡ\fI\-Xmn\fRץޤ\fI\-XX:NewSize\fRץѤǤޤ +このオプションを設定しない場合、初期サイズは、古い世代と若い世代に割り当てられたサイズの合計として設定されます。若い世代のヒープの初期サイズは、\fI\-Xmn\fRオプションまたは\fI\-XX:NewSize\fRオプションを使用して設定できます。 .RE .PP \-Xmx\fIsize\fR .RS 4 -꡼ƥסκ祵(Хñ)ꤷޤꤹͤϡ2MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤСǥץȤǤϡ\fI\-Xms\fR\fI\-Xmx\fR̾Ʊͤꤵޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの最大サイズ(バイト単位)を指定します。指定する値は、2MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。サーバー・デプロイメントでは、\fI\-Xms\fRおよび\fI\-Xmx\fRは通常同じ値に設定されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼εĤ祵͡ñ̤Ѥ80MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーの許可される最大サイズを様々な単位を使用して80MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -654,34 +654,34 @@ JIT .if n \{\ .RE .\} -\fI\-Xmx\fRץ\fI\-XX:MaxHeapSize\fRƱǤ +\fI\-Xmx\fRオプションは\fI\-XX:MaxHeapSize\fRと同等です。 .RE .PP \-Xnoclassgc .RS 4 -饹Υ١쥯(GC)̵ˤޤˤꡢGC֤Ǥץꥱ¹Ǥṳ̂ޤ +クラスのガベージ・コレクション(GC)を無効にします。これにより、GC時間を節約でき、アプリケーション実行中の中断が短縮されます。 .sp -ư\fI\-Xnoclassgc\fRꤹȡץꥱΥ饹֥ȤϡGCδ֤ϤΤޤ޻Ĥꡢ˥饤֤ǤȤߤʤޤˤꡢ¿Υ꡼ʵפͭ뤳ȤˤʤꡢդƻѤʤȡ꡼­㳰ޤ +起動時に\fI\-Xnoclassgc\fRを指定すると、アプリケーション内のクラス・オブジェクトは、GCの間はそのまま残り、常にライブであるとみなされます。これにより、より多くのメモリーが永久に占有されることになり、注意して使用しないと、メモリー不足の例外がスローされます。 .RE .PP \-Xprof .RS 4 -¹ΥץΥץեץե롦ǡɸϤޤΥץϡץ೫ȯѤΥ桼ƥƥȤ󶡤ƤޤֲƯƥǤλѤŪȤΤǤϤޤ +実行中のプログラムのプロファイルを生成し、プロファイル・データを標準出力に送信します。このオプションは、プログラム開発用のユーティリティとして提供されています。本番稼働システムでの使用を目的としたものではありません。 .RE .PP \-Xrs .RS 4 -JVMˤ륪ڥ졼ƥ󥰡ƥࡦʥλѤ򸺤餷ޤ +JVMによるオペレーティング・システム・シグナルの使用を減らします。 .sp -åȥ󡦥եåϡJVMλǤ⡢åȥ˥桼꡼󥢥åס(ǡ١³Υʤ)¹Ԥ뤳ȤˤäơJavaץꥱΥåȥ֤ͭˤޤ +シャットダウン・フックは、JVMが突然終了した場合でも、シャットダウン時にユーザー・クリーンアップ・コード(データベース接続のクローズなど)を実行することによって、Javaアプリケーションのシャットダウンを順番に有効にします。 .sp -JVMϡͽʤλΥåȥ󡦥եå뤿˥ʥ򥭥åޤJVMϡ\fISIGHUP\fR\fISIGINT\fR\fISIGTERM\fRѤơåȥ󡦥եåμ¹Ԥ򳫻Ϥޤ +JVMは、予期しない終了のシャットダウン・フックを実装するためにシグナルをキャッチします。JVMは、\fISIGHUP\fR、\fISIGINT\fRおよび\fISIGTERM\fRを使用して、シャットダウン・フックの実行を開始します。 .sp -JVMϡǥХåŪǥåɡåפȤǽ¸뤿ˡƱͤΥᥫ˥ѤޤJVMϡåɡפ¹Ԥ뤿\fISIGQUIT\fRѤޤ +JVMは、デバッグの目的でスレッド・スタックをダンプするという機能を実現するために、同様のメカニズムを使用します。JVMは、スレッド・ダンプを実行するために\fISIGQUIT\fRを使用します。 .sp -JVMǤ륢ץꥱϡ\fISIGINT\fR\fISIGTERM\fRʤɤΥʥˤ˥ȥåפɬפꡢη̡JVMΥʥ롦ϥɥȾͤǽޤ\fI\-Xrs\fRץϡн褹뤿˻ѤǤޤ\fI\-Xrs\fRѤƤ硢\fISIGINT\fR\fISIGTERM\fR\fISIGHUP\fR\fISIGQUIT\fRΥʥ롦ޥJVMˤäѹ줺ΥʥΥʥ롦ϥɥϥ󥹥ȡ뤵ޤ +JVMを埋め込んでいるアプリケーションは、\fISIGINT\fRや\fISIGTERM\fRなどのシグナルを頻繁にトラップする必要があり、その結果、JVMのシグナル・ハンドラと衝突する可能性があります。\fI\-Xrs\fRオプションは、この問題に対処するために使用できます。\fI\-Xrs\fRが使用されている場合、\fISIGINT\fR、\fISIGTERM\fR、\fISIGHUP\fRおよび\fISIGQUIT\fRのシグナル・マスクはJVMによって変更されず、これらのシグナルのシグナル・ハンドラはインストールされません。 .sp -\fI\-Xrs\fRꤹȡ2Ĥη̤ޤ: +\fI\-Xrs\fRを指定すると、次の2つの結果が生じます: .sp .RS 4 .ie n \{\ @@ -691,7 +691,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -\fISIGQUIT\fRˤ륹åɡפϻѤǤޤ +\fISIGQUIT\fRによるスレッド・ダンプは使用できません。 .RE .sp .RS 4 @@ -702,63 +702,63 @@ JVM .sp -1 .IP \(bu 2.3 .\} -åȥ󡦥եåμ¹ԤϡJVMλ褦ȤƤ\fISystem\&.exit()\fRƤӽФʤɤơ桼¦ǹԤɬפޤ +シャットダウン・フック処理の実行は、JVMが終了しようとしている時点で\fISystem\&.exit()\fRを呼び出すなどして、ユーザー・コード側で行う必要があります。 .RE .RE .PP \-Xshare:\fImode\fR .RS 4 -饹ǡͭ⡼ɤꤷޤΥץǻѲǽ\fImode\fRϼΤȤǤ +クラス・データ共有モードを設定します。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP auto .RS 4 -ǽʾ硢ͭ饹ΥǡѤޤϡJava HotSpot 32\-Bit Client VMξΥǥեͤǤ +可能な場合、共有クラスのデータを使用します。これは、Java HotSpot 32\-Bit Client VMの場合のデフォルト値です。 .RE .PP on .RS 4 -饹ǡͭλѤɬפǤ饹ǡͭѤǤʤ硢顼åϤƽλޤ +クラス・データ共有の使用が必要です。クラス・データ共有を使用できない場合、エラー・メッセージを出力して終了します。 .RE .PP off .RS 4 -ͭ饹ǡѤޤ󡣤ϡJava HotSpot 32\-Bit Server VMJava HotSpot 64\-Bit Client VMJava HotSpot 64\-Bit Server VMξΥǥեͤǤ +共有クラス・データを使用しません。これは、Java HotSpot 32\-Bit Server VM、Java HotSpot 64\-Bit Client VMおよびJava HotSpot 64\-Bit Server VMの場合のデフォルト値です。 .RE .PP dump .RS 4 -饹ǡ֤ͭưޤ +クラス・データ共有アーカイブを手動で生成します。 .RE .RE .PP \-XshowSettings:\fIcategory\fR .RS 4 -ɽ³ԤޤΥץǻѲǽ\fIcategory\fRϼΤȤǤ +設定を表示して続行します。このオプションで使用可能な\fIcategory\fR引数は次のとおりです。 .PP all .RS 4 -Τ٤ƤΥƥɽޤ줬ǥեͤǤ +設定のすべてのカテゴリを表示します。これがデフォルト値です。 .RE .PP locale .RS 4 -˴Ϣɽޤ +ロケールに関連する設定を表示します。 .RE .PP properties .RS 4 -ƥࡦץѥƥ˴Ϣɽޤ +システム・プロパティに関連する設定を表示します。 .RE .PP vm .RS 4 -JVMɽޤ +JVMの設定を表示します。 .RE .RE .PP \-Xss\fIsize\fR .RS 4 -åɤΥå(Хñ)ꤷޤKB򼨤ʸ\fIk\fRޤ\fIK\fRMB򼨤ʸ\fIm\fRޤ\fIM\fRGB򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϥץåȥեˤäưۤʤޤ +スレッドのスタック・サイズ(バイト単位)を設定します。KBを示す場合は文字\fIk\fRまたは\fIK\fR、MBを示す場合は文字\fIm\fRまたは\fIM\fR、GBを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値はプラットフォームによって異なります。 .sp .RS 4 .ie n \{\ @@ -768,7 +768,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -Linux/ARM (32ӥå): 320KB +Linux/ARM (32ビット): 320KB .RE .sp .RS 4 @@ -779,7 +779,7 @@ Linux/ARM (32 .sp -1 .IP \(bu 2.3 .\} -Linux/i386 (32ӥå): 320KB +Linux/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -790,7 +790,7 @@ Linux/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Linux/x64 (64ӥå): 1024KB +Linux/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -801,7 +801,7 @@ Linux/x64 (64 .sp -1 .IP \(bu 2.3 .\} -OS X (64ӥå): 1024KB +OS X (64ビット): 1024KB .RE .sp .RS 4 @@ -812,7 +812,7 @@ OS X (64 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/i386 (32ӥå): 320KB +Oracle Solaris/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -823,7 +823,7 @@ Oracle Solaris/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/x64 (64ӥå): 1024KB +Oracle Solaris/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -834,10 +834,10 @@ Oracle Solaris/x64 (64 .sp -1 .IP \(bu 2.3 .\} -Windows: ۥ꡼ˤäưۤʤޤ +Windows: 仮想メモリーによって異なります。 .RE .sp -Ǥϡåɡåۤʤñ̤1024KBꤷޤ +次の例では、スレッド・スタック・サイズを異なる単位で1024KBに設定します。 .sp .if n \{\ .RS 4 @@ -850,46 +850,46 @@ Windows: .if n \{\ .RE .\} -Υץ\fI\-XX:ThreadStackSize\fRƱǤ +このオプションは\fI\-XX:ThreadStackSize\fRと同等です。 .RE .PP \-Xusealtsigs .RS 4 -JVMʥ\fISIGUSR1\fR\fISIGUSR2\fRΤˡإʥѤޤΥץ\fI\-XX:+UseAltSigs\fRƱǤ +JVM内部シグナルの\fISIGUSR1\fRおよび\fISIGUSR2\fRのかわりに、代替シグナルを使用します。このオプションは\fI\-XX:+UseAltSigs\fRと同等です。 .RE .PP \-Xverify:\fImode\fR .RS 4 -Хȥɡ٥եΥ⡼ɤꤷޤХȥɤθڤϰΥȥ֥륷塼ƥ󥰤Ωޤ¹ΥץꥱؤΥСإåɤ礵ޤΥץǻѲǽ\fImode\fRϼΤȤǤ +バイトコード・ベリファイアのモードを設定します。バイトコードの検証は一部の問題のトラブルシューティングに役立ちますが、実行中のアプリケーションへのオーバーヘッドを増大させます。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP none .RS 4 -Хȥɤ򸡾ڤޤ󡣤ˤꡢư֤ṳ̂졢Javaˤä󶡤ݸڸޤ +バイトコードを検証しません。これにより、起動時間が短縮され、Javaによって提供される保護も軽減されます。 .RE .PP remote .RS 4 -ͥåȥ𤷤ƥ⡼Ȥǥɤ륯饹Τߤ򸡾ڤޤϡ\fI\-Xverify\fRץꤷʤΥǥեȤưǤ +ネットワークを介してリモートでロードされるクラスのみを検証します。これは、\fI\-Xverify\fRオプションを指定しない場合のデフォルトの動作です。 .RE .PP all .RS 4 -٤ƤΥ饹򸡾ڤޤ +すべてのクラスを検証します。 .RE .RE -.SS "٤ʥ󥿥ࡦץ" +.SS "高度なランタイム・オプション" .PP -ΥץϡJava HotSpot VMμ¹Իư椷ޤ +これらのオプションは、Java HotSpot VMの実行時の動作を制御します。 .PP \-XX:+DisableAttachMechanism .RS 4 -JVM˥ġ򥢥åᥫ˥̵ˤ륪ץͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢϡåᥫ˥ͭˤȡ\fIjcmd\fR\fIjstack\fR\fIjmap\fR\fIjinfo\fRʤɤΥġѤǤ뤳Ȥ̣ޤ +JVMにツールをアタッチするメカニズムを無効にするオプションを有効にします。デフォルトでは、このオプションは無効になっており、これは、アタッチ・メカニズムを有効にすると、\fIjcmd\fR、\fIjstack\fR、\fIjmap\fR、\fIjinfo\fRなどのツールを使用できることを意味します。 .RE .PP \-XX:ErrorFile=\fIfilename\fR .RS 4 -ꥫХǽʥ顼ȯ˥顼ǡ񤭹ޤѥӥե̾ꤷޤǥեȤǤϡΥեϡߤκȥǥ쥯ȥ˺졢̾\fIhs_err_pid\fR\fIpid\fR\fI\&.log\fR -(\fIpid\fRϥ顼θȤʤäץμ̻)ˤʤޤǤϡǥեȤΥեꤹˡ򼨤ޤ(ץμ̻Ҥ\fI%p\fRȤƻꤵޤ) +リカバリ不能なエラーが発生した場合にエラー・データが書き込まれるパスおよびファイル名を指定します。デフォルトでは、このファイルは、現在の作業ディレクトリに作成され、名前は\fIhs_err_pid\fR\fIpid\fR\fI\&.log\fR +(\fIpid\fRはエラーの原因となったプロセスの識別子)になります。次の例では、デフォルトのログ・ファイルを設定する方法を示します(プロセスの識別子は\fI%p\fRとして指定されます)。 .sp .if n \{\ .RS 4 @@ -900,7 +900,7 @@ JVM .if n \{\ .RE .\} -Ǥϡ顼\fI/var/log/java/java_error\&.log\fRꤹˡ򼨤ޤ +次の例では、エラー・ログを\fI/var/log/java/java_error\&.log\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -911,14 +911,14 @@ JVM .if n \{\ .RE .\} -(ΰ­¤ޤ̤ˤ)ꤷǥ쥯ȥ˥եǤʤ硢եϥڥ졼ƥ󥰡ƥΰǥ쥯ȥ˺ޤǥ쥯ȥ\fI/tmp\fRǤ +(領域不足、権限の問題または別の問題により)指定したディレクトリにファイルを作成できない場合、ファイルはオペレーティング・システムの一時ディレクトリに作成されます。一時ディレクトリは\fI/tmp\fRです。 .RE .PP \-XX:LargePageSizeInBytes=\fIsize\fR .RS 4 -Javaҡפ˻Ѥ礭ڡκ祵(Хñ)ꤷޤ\fIsize\fRϡ2߾(24816\&.\&.\&.)ǤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ0ꤵ졢ϡJVMǤ礭ڡΥưŪ򤵤Ƥ뤳Ȥ̣ޤ +Javaヒープに使用される大きいページの最大サイズ(バイト単位)を設定します。\fIsize\fR引数は、2の累乗(2、4、8、16、\&.\&.\&.)である必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、サイズは0に設定され、これは、JVMでは大きいページのサイズが自動的に選択されていることを意味します。 .sp -Ǥϡ礭ڡΥ4ᥬХ(MB)ꤹˡ򼨤ޤ +次の例では、大きいページのサイズを4メガバイト(MB)に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -933,9 +933,9 @@ Java .PP \-XX:MaxDirectMemorySize=\fIsize\fR .RS 4 -I/O (\fIjava\&.nio\fRѥå)ľܥХåեƤκץ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ0ꤵ졢ϡJVMǤNIOľܥХåեƤΥưŪ򤵤Ƥ뤳Ȥ̣ޤ +新規I/O (\fIjava\&.nio\fRパッケージ)の直接バッファ割当ての最大合計サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、サイズは0に設定され、これは、JVMではNIOの直接バッファ割当てのサイズが自動的に選択されていることを意味します。 .sp -ǤϡNIOۤʤñ̤1024KBꤹˡ򼨤ޤ +次の例では、NIOサイズを異なる単位で1024KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -952,30 +952,30 @@ Java .PP \-XX:NativeMemoryTracking=\fImode\fR .RS 4 -JVMΥͥƥ֡꡼ѾΥȥå󥰤Υ⡼ɤꤷޤΥץǻѲǽ\fImode\fRϼΤȤǤ +JVMのネイティブ・メモリー使用状況のトラッキングのモードを指定します。このオプションで使用可能な\fImode\fR引数は次のとおりです。 .PP off .RS 4 -JVMΥͥƥ֡꡼Ѿפޤ󡣤ϡ\fI\-XX:NativeMemoryTracking\fRץꤷʤΥǥեȤưǤ +JVMのネイティブ・メモリー使用状況を追跡しません。これは、\fI\-XX:NativeMemoryTracking\fRオプションを指定しない場合のデフォルトの動作です。 .RE .PP summary .RS 4 -JVM֥ƥ(Javaҡס饹ɡåɤʤ)ˤ꡼ѾΤפޤ +JVMサブシステム(Javaヒープ、クラス、コード、スレッドなど)によるメモリー使用状況のみ追跡します。 .RE .PP detail .RS 4 -JVM֥ƥˤ꡼ѾΥȥå󥰤˲äơġ\fICallSite\fR -(ġβۥ꡼꡼󤪤ӤΥߥåȺѥ꡼)ˤ꡼Ѿפޤ +JVMサブシステムによるメモリー使用状況のトラッキングに加えて、個々の\fICallSite\fR +(個々の仮想メモリー・リージョンおよびそのコミット済リージョン)によるメモリー使用状況を追跡します。 .RE .RE .PP \-XX:OnError=\fIstring\fR .RS 4 -ꥫХǽʥ顼ȯȤ˼¹Ԥ롢ࡦޥɤޤϰϢΥߥڤΥޥɤꤷޤʸ˶򤬴ޤޤƤϡǰϤɬפޤ +リカバリ不能なエラーが発生したときに実行する、カスタム・コマンドまたは一連のセミコロン区切りのコマンドを設定します。文字列に空白が含まれている場合は、引用符で囲む必要があります。 .sp -Ǥϡ\fI\-XX:OnError\fRץѤƥ᡼뤿\fIgcore\fRޥɤ¹ԤˡӥꥫХǽʥ顼ξ˥ǥХåưƥץ³ˡ򼨤ޤ(\fI%p\fRϸߤΥץꤷޤ) +次の例では、\fI\-XX:OnError\fRオプションを使用してコア・イメージを作成するために\fIgcore\fRコマンドを実行する方法、およびリカバリ不能なエラーの場合にデバッガを起動してプロセスに接続する方法を示します(\fI%p\fRは現在のプロセスを指定します)。 .sp .if n \{\ .RS 4 @@ -990,27 +990,27 @@ JVM .PP \-XX:OnOutOfMemoryError=\fIstring\fR .RS 4 -\fIOutOfMemoryError\fR㳰ǽ˥줿Ȥ˼¹Ԥ롢ࡦޥɤޤϰϢΥߥڤΥޥɤꤷޤʸ˶򤬴ޤޤƤϡǰϤɬפޤޥʸϡ\fI\-XX:OnError\fRץ򻲾ȤƤ +\fIOutOfMemoryError\fR例外が最初にスローされたときに実行する、カスタム・コマンドまたは一連のセミコロン区切りのコマンドを設定します。文字列に空白が含まれている場合は、引用符で囲む必要があります。コマンド文字列の例は、\fI\-XX:OnError\fRオプションの説明を参照してください。 .RE .PP \-XX:+PrintCommandLineFlags .RS 4 -ޥɥ饤ɽ줿ʹֹŪ򤷤JVMե饰ΰͭˤޤϡҡΰ襵򤵤줿١쥯ʤɡJVMˤäꤵ줿르ΥߥåͤǧΩޤǥեȤǤϡΥץ̵Ǥꡢե饰ϰޤ +コマンドラインに表示された、人間工学的に選択したJVMフラグの印刷を有効にします。これは、ヒープ領域サイズや選択されたガベージ・コレクタなど、JVMによって設定されたエルゴノミック値を確認する場合に役立ちます。デフォルトでは、このオプションは無効であり、フラグは印刷されません。 .RE .PP \-XX:+PrintNMTStatistics .RS 4 -ͥƥ֡꡼Υȥå󥰤ͭʾˡJVMνλ˼줿ͥƥ֡꡼Υȥå󥰡ǡΰͭˤޤ(\fI\-XX:NativeMemoryTracking\fR򻲾ȤƤ)ǥեȤǤϡΥץ̵Ǥꡢͥƥ֡꡼Υȥå󥰡ǡϰޤ +ネイティブ・メモリーのトラッキングが有効な場合に、JVMの終了時に収集されたネイティブ・メモリーのトラッキング・データの印刷を有効にします(\fI\-XX:NativeMemoryTracking\fRを参照してください)。デフォルトでは、このオプションは無効であり、ネイティブ・メモリーのトラッキング・データは印刷されません。 .RE .PP \-XX:+ShowMessageBoxOnError .RS 4 -JVMǥꥫХǽʥ顼ȯ硢ܥåɽͭˤޤˤꡢJVM˥ǥХå³ƥ顼θĴǤ褦ˡJVMλʤ褦ˤơץ򥢥ƥ֤ʤޤޤˤޤǥեȤǤϡΥץ̵Ǥ +JVMでリカバリ不能なエラーが発生した場合、ダイアログ・ボックスの表示を有効にします。これにより、JVMにデバッガを接続してエラーの原因を調査できるように、JVMを終了しないようにして、プロセスをアクティブなままにします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:ThreadStackSize=\fIsize\fR .RS 4 -åɤΥå(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϥץåȥեˤäưۤʤޤ +スレッドのスタック・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値はプラットフォームによって異なります。 .sp .RS 4 .ie n \{\ @@ -1020,7 +1020,7 @@ JVM .sp -1 .IP \(bu 2.3 .\} -Linux/ARM (32ӥå): 320KB +Linux/ARM (32ビット): 320KB .RE .sp .RS 4 @@ -1031,7 +1031,7 @@ Linux/ARM (32 .sp -1 .IP \(bu 2.3 .\} -Linux/i386 (32ӥå): 320KB +Linux/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -1042,7 +1042,7 @@ Linux/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Linux/x64 (64ӥå): 1024KB +Linux/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -1053,7 +1053,7 @@ Linux/x64 (64 .sp -1 .IP \(bu 2.3 .\} -OS X (64ӥå): 1024KB +OS X (64ビット): 1024KB .RE .sp .RS 4 @@ -1064,7 +1064,7 @@ OS X (64 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/i386 (32ӥå): 320KB +Oracle Solaris/i386 (32ビット): 320KB .RE .sp .RS 4 @@ -1075,7 +1075,7 @@ Oracle Solaris/i386 (32 .sp -1 .IP \(bu 2.3 .\} -Oracle Solaris/x64 (64ӥå): 1024KB +Oracle Solaris/x64 (64ビット): 1024KB .RE .sp .RS 4 @@ -1086,10 +1086,10 @@ Oracle Solaris/x64 (64 .sp -1 .IP \(bu 2.3 .\} -Windows: ۥ꡼ˤäưۤʤޤ +Windows: 仮想メモリーによって異なります。 .RE .sp -Ǥϡåɡåۤʤñ̤1024KBꤹˡ򼨤ޤ +次の例では、スレッド・スタック・サイズを異なる単位で1024KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1102,86 +1102,86 @@ Windows: .if n \{\ .RE .\} -Υץ\fI\-Xss\fRƱǤ +このオプションは\fI\-Xss\fRと同等です。 .RE .PP \-XX:+TraceClassLoading .RS 4 -饹ɤȤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスがロードされるときのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceClassLoadingPreorder .RS 4 -饹Ȥǡɤ줿٤ƤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスが参照される順序で、ロードされたすべてのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceClassResolution .RS 4 -סβΥȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢסβϥȥ졼ޤ +定数プールの解決のトレースを有効にします。デフォルトでは、このオプションは無効であり、定数プールの解決はトレースされません。 .RE .PP \-XX:+TraceClassUnloading .RS 4 -饹ɤȤΥ饹Υȥ졼ͭˤޤǥեȤǤϡΥץ̵Ǥꡢ饹ϥȥ졼ޤ +クラスがアンロードされるときのクラスのトレースを有効にします。デフォルトでは、このオプションは無効であり、クラスはトレースされません。 .RE .PP \-XX:+TraceLoaderConstraints .RS 4 -εϿΥȥ졼ͭˤޤǥեȤǤϡΥץ̵ǤꡢεϿפޤ +ローダー制約の記録のトレースを有効にします。デフォルトでは、このオプションは無効であり、ローダー制約の記録は追跡されません。 .RE .PP \-XX:+UseAltSigs .RS 4 -JVMʥ\fISIGUSR1\fR\fISIGUSR2\fRΤˡإʥλѤͭˤޤǥեȤǤϡΥץ̵ǤꡢإʥϻѤޤ󡣤Υץ\fI\-Xusealtsigs\fRƱǤ +JVM内部シグナルの\fISIGUSR1\fRおよび\fISIGUSR2\fRのかわりに、代替シグナルの使用を有効にします。デフォルトでは、このオプションは無効であり、代替シグナルは使用されません。このオプションは\fI\-Xusealtsigs\fRと同等です。 .RE .PP \-XX:+UseBiasedLocking .RS 4 -ХåλѤͭˤޤʤ̤󶥹ƱΥץꥱϡΥե饰ͭˤʹ®¸ޤΥѥΥå륢ץꥱϡ®٤㲼뤳ȤޤХåˡξܺ٤ϡhttp://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5ˤJava塼˥󥰤Υۥ磻ȡڡѡ򻲾ȤƤ +バイアス・ロックの使用を有効にします。かなりの量の非競合の同期化がある一部のアプリケーションは、このフラグを有効にすると大幅な高速化が実現しますが、特定のパターンのロックがあるアプリケーションは、速度が低下することがあります。バイアス・ロックの方法の詳細は、http://www\&.oracle\&.com/technetwork/java/tuning\-139912\&.html#section4\&.2\&.5にあるJavaチューニングのホワイト・ペーパーの例を参照してください。 .sp -ǥեȤǤϡΥץ̵ǤꡢХåϻѤޤ +デフォルトでは、このオプションは無効であり、バイアス・ロックは使用されません。 .RE .PP \-XX:+UseCompressedOops .RS 4 -̤줿ݥ󥿤λѤͭˤޤΥץͭˤȡ֥ȻȤϡ64ӥåȤΥݥ󥿤ǤϤʤ32ӥåȤΥեåȤȤɽ졢ˤꡢ32GB꾮JavaҡסΥץꥱμ¹Իˡ̾ѥեޥ󥹤夷ޤΥץϡ64ӥåȤJVMǤΤߵǽޤ +圧縮されたポインタの使用を有効にします。このオプションを有効にすると、オブジェクト参照は、64ビットのポインタではなく32ビットのオフセットとして表され、これにより、32GBより小さいJavaヒープ・サイズのアプリケーションの実行時に、通常、パフォーマンスが向上します。このオプションは、64ビットのJVMでのみ機能します。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ̥ݥ󥿤ϻѤޤ +デフォルトでは、このオプションは無効であり、圧縮ポインタは使用されません。 .RE .PP \-XX:+UseLargePages .RS 4 -礭ڡΥ꡼λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤ礭ڡΥ꡼λѤ̵ˤˤϡ\fI\-XX:\-UseLargePages\fRꤷޤ +大きいページのメモリーの使用を有効にします。このオプションはデフォルトで有効になっています。大きいページのメモリーの使用を無効にするには、\fI\-XX:\-UseLargePages\fRを指定します。 .sp -ܺ٤ϡhttp://www\&.oracle\&.com/technetwork/java/javase/tech/largememory\-jsp\-137182\&.htmlˤ礭꡼ڡѤJavaݡȤ򻲾ȤƤ +詳細は、http://www\&.oracle\&.com/technetwork/java/javase/tech/largememory\-jsp\-137182\&.htmlにある大きいメモリー・ページ用のJavaサポートを参照してください。 .RE .PP \-XX:+UseMembar .RS 4 -åɤξ֤ܤǥСȯԤͭˤޤΥץϡͭˤʤäƤPower PCARMС٤ƤΥץåȥեǡǥեȤǤ̵ˤʤäƤޤPower PCARMΥåɾܤФСȯԤ̵ˤˤϡ\fI\-XX:\-UseMembar\fRꤷޤ +スレッドの状態の遷移でメンバーの発行を有効にします。このオプションは、有効になっているPower PCおよびARMサーバーを除くすべてのプラットフォーム上で、デフォルトでは無効になっています。Power PCとARMのスレッド状態遷移に対するメンバーの発行を無効にするには、\fI\-XX:\-UseMembar\fRを指定します。 .RE .PP \-XX:+UsePerfData .RS 4 -\fIperfdata\fRǽͭˤޤΥץϥǥեȤͭˤʤäƤꡢJVMΥ˥󥰤ӥѥեޥ󥹡ƥȤǽˤʤޤ̵ˤȡ\fIhsperfdata_userid\fRǥ쥯ȥκޤ\fIperfdata\fRǽ̵ˤˤϡ\fI\-XX:\-UsePerfData\fRꤷޤ +\fIperfdata\fR機能を有効にします。このオプションはデフォルトで有効になっており、JVMのモニタリングおよびパフォーマンス・テストが可能になります。これを無効にすると、\fIhsperfdata_userid\fRディレクトリの作成を抑制します。\fIperfdata\fR機能を無効にするには、\fI\-XX:\-UsePerfData\fRを指定します。 .RE .PP \-XX:+AllowUserSignalHandlers .RS 4 -ץꥱˤ륷ʥ롦ϥɥΥ󥹥ȡͭˤޤǥեȤǤϡΥץ̵Ǥꡢץꥱϥʥ롦ϥɥ򥤥󥹥ȡ뤹뤳ȤϵĤƤޤ +アプリケーションによるシグナル・ハンドラのインストールを有効にします。デフォルトでは、このオプションは無効であり、アプリケーションはシグナル・ハンドラをインストールすることは許可されていません。 .RE -.SS "٤JITѥ顦ץ" +.SS "高度なJITコンパイラ・オプション" .PP -ΥץϡJava HotSpot VMǼ¹ԤưŪjust\-in\-time (JIT)ѥ椷ޤ +これらのオプションは、Java HotSpot VMで実行される動的なjust\-in\-time (JIT)コンパイラを制御します。 .PP \-XX:+AggressiveOpts .RS 4 -ѶŪʥѥեޥ󥹺ŬǽλѤͭˤޤϺΥ꡼ǥǥեȤˤʤͽǤǥեȤǤϡΥץ̵ǤꡢŪʥѥեޥ󥹵ǽϻѤޤ +積極的なパフォーマンス最適化機能の使用を有効にします。これは今後のリリースでデフォルトになる予定です。デフォルトでは、このオプションは無効であり、試験的なパフォーマンス機能は使用されません。 .RE .PP \-XX:AllocateInstancePrefetchLines=\fIlines\fR .RS 4 -󥹥󥹳ƥݥ󥿤˥ץեåԿꤷޤǥեȤǤϡץեåԿ1ꤵƤޤ +インスタンス割当てポインタの前にプリフェッチする行数を設定します。デフォルトでは、プリフェッチする行数は1に設定されています。 .sp .if n \{\ .RS 4 @@ -1196,7 +1196,7 @@ JVM .PP \-XX:AllocatePrefetchInstr=\fIinstruction\fR .RS 4 -ƥݥ󥿤˥ץեåץեå̿ꤷޤѲǽͤ03ޤǤǤͤظˤºݤ̿ϡץåȥեˤäưۤʤޤǥեȤǤϡץեå̿0ꤵƤޤ +割当てポインタの前にプリフェッチするプリフェッチ命令を設定します。使用可能な値は0から3までです。値の背後にある実際の命令は、プラットフォームによって異なります。デフォルトでは、プリフェッチ命令は0に設定されています。 .sp .if n \{\ .RS 4 @@ -1211,7 +1211,7 @@ JVM .PP \-XX:AllocatePrefetchStepSize=\fIsize\fR .RS 4 -缡ץեå̿Υƥåס(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡƥåס16ХȤꤵƤޤ +順次プリフェッチ命令のステップ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、ステップ・サイズは16バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1226,12 +1226,12 @@ JVM .PP \-XX:+BackgroundCompilation .RS 4 -Хå饦ɡѥͭˤޤΥץϥǥեȤͭˤʤäƤޤХå饦ɡѥ̵ˤˤϡ\fI\-XX:\-BackgroundCompilation\fRꤷޤ(\fI\-Xbatch\fRꤹΤƱǤ) +バックグラウンド・コンパイルを有効にします。このオプションはデフォルトで有効になっています。バックグラウンド・コンパイルを無効にするには、\fI\-XX:\-BackgroundCompilation\fRを指定します(これは\fI\-Xbatch\fRを指定するのと同等です)。 .RE .PP \-XX:CICompilerCount=\fIthreads\fR .RS 4 -ѥ˻Ѥ륳ѥ顦åɤοꤷޤǥեȤǤϡåɿϡСJVMξ2饤JVMξ1ꤵƤꡢإѥ뤬ѤƤ硢˹礻ޤǤϡåɤο2ꤹˡ򼨤ޤ +コンパイルに使用するコンパイラ・スレッドの数を設定します。デフォルトでは、スレッド数は、サーバーJVMの場合は2、クライアントJVMの場合は1に設定されており、層コンパイルが使用されている場合、コア数に合せて増減します。次の例では、スレッドの数を2に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1246,7 +1246,7 @@ JVM .PP \-XX:CodeCacheMinimumFreeSpace=\fIsize\fR .RS 4 -ѥɬפʺǾΰ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǾΰ꾯ʤΰ褷ĤäƤʤ硢ѥߤޤǥեȤǤϡΥץ500KBꤵƤޤǤϡǾΰ1024MBꤹˡ򼨤ޤ +コンパイルに必要な最小空き領域(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。最小空き領域より少ない領域しか残っていない場合、コンパイルは停止します。デフォルトでは、このオプションは500KBに設定されています。次の例では、最小空き領域を1024MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1261,7 +1261,7 @@ JVM .PP \-XX:CompileCommand=\fIcommand\fR,\fImethod\fR[,\fIoption\fR] .RS 4 -᥽åɤǼ¹Ԥ륳ޥɤꤷޤȤСѥ븵\fIString\fR饹\fIindexOf()\fR᥽åɤ¹ԤˤϡѤޤ +メソッドで実行するコマンドを指定します。たとえば、コンパイル元から\fIString\fRクラスの\fIindexOf()\fRメソッドを実行するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1272,7 +1272,7 @@ JVM .if n \{\ .RE .\} -å(\fI/\fR)Ƕڤ줿٤ƤΥѥåӥ֥ѥåޤࡢ饹̾ꤷޤڼŽդưפˤ뤿ˡ\fI\-XX:+PrintCompilation\fRץ󤪤\fI\-XX:+LogCompilation\fRץˤä᥽å̾ηѤ뤳ȤǤޤ +スラッシュ(\fI/\fR)で区切られたすべてのパッケージおよびサブパッケージを含む、完全クラス名を指定します。切取りと貼付けの操作を容易にするために、\fI\-XX:+PrintCompilation\fRオプションおよび\fI\-XX:+LogCompilation\fRオプションによって生成されるメソッド名の形式を使用することもできます。 .sp .if n \{\ .RS 4 @@ -1283,7 +1283,7 @@ JVM .if n \{\ .RE .\} -̾ʤǥ᥽åɤꤹȡޥɤϻꤷ̾Ĥ٤ƤΥ᥽åɤŬѤޤ饹եǥ᥽åɤν̾ꤹ뤳ȤǤޤȤСѥ븵\fIString\fR饹\fIindexOf(String)\fR᥽åɤΤ߽ˤϡѤޤ +署名なしでメソッドを指定すると、コマンドは指定した名前を持つすべてのメソッドに適用されます。ただし、クラス・ファイル形式でメソッドの署名を指定することもできます。たとえば、コンパイル元から\fIString\fRクラスの\fIindexOf(String)\fRメソッドのみ除外するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1294,7 +1294,7 @@ JVM .if n \{\ .RE .\} -ޤ饹̾ӥ᥽å̾˥磻ɥɤȤƥꥹ(*)ѤǤޤȤСѥ븵餹٤ƤΥ饹Τ٤Ƥ\fIindexOf()\fR᥽åɤˤϡѤޤ +また、クラス名およびメソッド名にワイルドカードとしてアスタリスク(*)を使用できます。たとえば、コンパイル元からすべてのクラスのすべての\fIindexOf()\fRメソッドを除外するには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1305,7 +1305,7 @@ JVM .if n \{\ .RE .\} -ޤȥԥꥪɤ϶̾ǡˤꡢ𤷤ƥѥ顦ޥɤϤȤưפˤʤޤǰϤळȤǡ򥻥ѥ졼ȤƻѤ\fI\-XX:CompileCommand\fR˰ϤȤǤޤ +カンマとピリオドは空白の別名で、これにより、シェルを介してコンパイラ・コマンドを渡すことが容易になります。引数を引用符で囲むことで、空白をセパレータとして使用して\fI\-XX:CompileCommand\fRに引数を渡すことができます。 .sp .if n \{\ .RS 4 @@ -1316,48 +1316,48 @@ JVM .if n \{\ .RE .\} -\fI\-XX:CompileCommand\fRץѤƥޥɥ饤Ϥ줿ޥɤϤˡJITѥ\fI\&.hotspot_compiler\fRե뤫饳ޥɤɤ߼ޤΥե˥ޥɤɲä뤫ޤ\fI\-XX:CompileCommandFile\fRץѤ̤Υեꤹ뤳ȤǤޤ +\fI\-XX:CompileCommand\fRオプションを使用してコマンドラインで渡されたコマンドを解析した後に、JITコンパイラは\fI\&.hotspot_compiler\fRファイルからコマンドを読み取ります。このファイルにコマンドを追加するか、または\fI\-XX:CompileCommandFile\fRオプションを使用して別のファイルを指定することができます。 .sp -ʣΥޥɤɲäˤϡ\fI\-XX:CompileCommand\fRץʣꤹ뤫ޤϲԥѥ졼(\fI\en\fR)ѤƳưڤޤΥޥɤѤǤޤ +複数のコマンドを追加するには、\fI\-XX:CompileCommand\fRオプションを複数回指定するか、または改行セパレータ(\fI\en\fR)を使用して各引数を区切ります。次のコマンドを使用できます。 .PP break .RS 4 -ꤷ᥽åɤΥѥκǽߤ뤿ˡJVMΥǥХåΥ֥졼ݥȤꤷޤ +指定したメソッドのコンパイルの最初に停止するために、JVMのデバッグ時のブレークポイントを設定します。 .RE .PP compileonly .RS 4 -ꤷ᥽åɤ٤ƤΥ᥽åɤ򡢥ѥ뤫ޤ̤ˡȤơ\fI\-XX:CompileOnly\fRץѤʣΥ᥽åɤǤޤ +指定したメソッドを除いたすべてのメソッドを、コンパイルから除外します。別の方法として、\fI\-XX:CompileOnly\fRオプションを使用して複数のメソッドを指定できます。 .RE .PP dontinline .RS 4 -ꤷ᥽åɤ򥤥饤󲽤ʤ褦ˤޤ +指定したメソッドをインライン化しないようにします。 .RE .PP exclude .RS 4 -ꤷ᥽åɤ򥳥ѥ뤫ޤ +指定したメソッドをコンパイルから除外します。 .RE .PP help .RS 4 -\fI\-XX:CompileCommand\fRץΥإסåޤ +\fI\-XX:CompileCommand\fRオプションのヘルプ・メッセージを印刷します。 .RE .PP inline .RS 4 -ꤷ᥽åɤ򥤥饤󲽤褦Ȥޤ +指定したメソッドをインライン化しようとします。 .RE .PP log .RS 4 -ꤷ᥽åɤ٤ƤΥ᥽åɤФơ(\fI\-XX:+LogCompilation\fRץѤ)ѥ롦󥰤ޤǥեȤǤϡѥ뤵줿٤ƤΥ᥽åɤ˥󥰤¹Ԥޤ +指定したメソッドを除くすべてのメソッドに対して、(\fI\-XX:+LogCompilation\fRオプションを使用して)コンパイル・ロギングを除外します。デフォルトでは、コンパイルされたすべてのメソッドにロギングが実行されます。 .RE .PP option .RS 4 -ΥޥɤϡǸΰ(\fIoption\fR)Τˡꤷ᥽åɤJITѥ롦ץϤ˻ѤǤޤѥ롦ץϡ᥽å̾θꤵޤȤС\fIStringBuffer\fR饹\fIappend()\fR᥽åɤФ\fIBlockLayoutByFrequency\fRץͭˤˤϡѤޤ +このコマンドは、最後の引数(\fIoption\fR)のかわりに、指定したメソッドにJITコンパイル・オプションを渡すために使用できます。コンパイル・オプションは、メソッド名の後の末尾に設定されます。たとえば、\fIStringBuffer\fRクラスの\fIappend()\fRメソッドに対して\fIBlockLayoutByFrequency\fRオプションを有効にするには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1368,17 +1368,17 @@ option .if n \{\ .RE .\} -ޤޤ϶ǶڤäơʣΥѥ롦ץǤޤ +カンマまたは空白で区切って、複数のコンパイル・オプションを指定できます。 .RE .PP print .RS 4 -ꤷ᥽åɤΥѥ줿֥顦ɤϤޤ +指定したメソッドのコンパイル後に生成されたアセンブラ・コードを出力します。 .RE .PP quiet .RS 4 -ѥ롦ޥɤϤޤ󡣥ǥեȤǤϡ\fI\-XX:CompileCommand\fRץѤƻꤷޥɤϤޤȤС\fIString\fR饹\fIindexOf()\fR᥽åɤΥѥ뤫硢ɸϤ˽Ϥޤ +コンパイル・コマンドを出力しません。デフォルトでは、\fI\-XX:CompileCommand\fRオプションを使用して指定したコマンドが出力されます。たとえば、\fIString\fRクラスの\fIindexOf()\fRメソッドのコンパイルから除外する場合、次が標準出力に出力されます。 .sp .if n \{\ .RS 4 @@ -1389,15 +1389,15 @@ CompilerOracle: exclude java/lang/String\&.indexOf .if n \{\ .RE .\} -¾\fI\-XX:CompileCommand\fRץ\fI\-XX:CompileCommand=quiet\fRץꤹ뤳ȤˤäơǤޤ +他の\fI\-XX:CompileCommand\fRオプションの前に\fI\-XX:CompileCommand=quiet\fRオプションを指定することによって、これを抑制できます。 .RE .RE .PP \-XX:CompileCommandFile=\fIfilename\fR .RS 4 -JITѥ顦ޥɤɼ긵ΥեꤷޤǥեȤǤϡJITѥˤäƼ¹Ԥ륳ޥɤǼ뤿ˡ\fI\&.hotspot_compiler\fRե뤬Ѥޤ +JITコンパイラ・コマンドの読取り元のファイルを設定します。デフォルトでは、JITコンパイラによって実行されるコマンドを格納するために、\fI\&.hotspot_compiler\fRファイルが使用されます。 .sp -ޥɡեγƹԤϡޥɤѤ륳ޥɡ饹̾ӥ᥽å̾ɽޤȤСιԤϡ\fIString\fR饹\fItoString()\fR᥽åɤФƥ֥ꡦɤϤޤ +コマンド・ファイルの各行は、コマンドが使用されるコマンド、クラス名およびメソッド名を表します。たとえば、次の行は、\fIString\fRクラスの\fItoString()\fRメソッドに対してアセンブリ・コードを出力します。 .sp .if n \{\ .RS 4 @@ -1408,12 +1408,12 @@ print java/lang/String toString .if n \{\ .RE .\} -᥽åɤǼ¹ԤJITѥΥޥɤλξܺ٤ϡ\fI\-XX:CompileCommand\fRץ򻲾ȤƤ +メソッドで実行するJITコンパイラのコマンドの指定の詳細は、\fI\-XX:CompileCommand\fRオプションを参照してください。 .RE .PP \-XX:CompileOnly=\fImethods\fR .RS 4 -ѥ¤(ޤǶڤ줿)᥽åɤΥꥹȤꤷޤꤷ᥽åɤΤߤѥ뤵ޤ饹̾(ѥåӥ֥ѥåޤ)dzƥ᥽åɤꤷޤȤС\fIString\fR饹\fIlength()\fR᥽åɤ\fIList\fR饹\fIsize()\fR᥽åɤΤߤ򥳥ѥ뤹ˤϡѤޤ +コンパイルを制限する(カンマで区切られた)メソッドのリストを設定します。指定したメソッドのみがコンパイルされます。完全クラス名(パッケージおよびサブパッケージを含む)で各メソッドを指定します。たとえば、\fIString\fRクラスの\fIlength()\fRメソッドおよび\fIList\fRクラスの\fIsize()\fRメソッドのみをコンパイルするには、次を使用します。 .sp .if n \{\ .RS 4 @@ -1424,7 +1424,7 @@ print java/lang/String toString .if n \{\ .RE .\} -å(\fI/\fR)Ƕڤ줿٤ƤΥѥåӥ֥ѥåޤࡢ饹̾ꤷޤڼŽդưפˤ뤿ˡ\fI\-XX:+PrintCompilation\fRץ󤪤\fI\-XX:+LogCompilation\fRץˤä᥽å̾ηѤ뤳ȤǤޤ +スラッシュ(\fI/\fR)で区切られたすべてのパッケージおよびサブパッケージを含む、完全クラス名を指定します。切取りと貼付けの操作を容易にするために、\fI\-XX:+PrintCompilation\fRオプションおよび\fI\-XX:+LogCompilation\fRオプションによって生成されるメソッド名の形式を使用することもできます。 .sp .if n \{\ .RS 4 @@ -1435,7 +1435,7 @@ print java/lang/String toString .if n \{\ .RE .\} -磻ɥɤϥݡȤƤޤ󤬡饹̾ޤϥѥå̾ꤷƥ饹ޤϥѥåΤ٤ƤΥ᥽åɤ򥳥ѥ뤹뤳Ȥ⡢᥽åɤꤷǤդΥ饹Τ̾ĥ᥽åɤ򥳥ѥ뤹뤳ȤǤޤ +ワイルドカードはサポートされていませんが、クラス名またはパッケージ名だけを指定してクラスまたはパッケージのすべてのメソッドをコンパイルすることも、メソッドだけを指定して任意のクラスのこの名前を持つメソッドをコンパイルすることもできます。 .sp .if n \{\ .RS 4 @@ -1452,7 +1452,7 @@ print java/lang/String toString .PP \-XX:CompileThreshold=\fIinvocations\fR .RS 4 -ѥ˲ᤵ줿᥽åɸƽФοꤷޤǥեȤǤϡСJVMǤϡJITѥϡ10,000βᤵ줿᥽åɸƽФ¹ԤơΨŪʥѥΤξޤ饤JVMξ硢ǥե1,500ƽФǤǤϡᤵ줿᥽åɸƽФο5,000ꤹˡ򼨤ޤ +コンパイル前に解釈されたメソッド呼出しの数を設定します。デフォルトでは、サーバーJVMでは、JITコンパイラは、10,000の解釈されたメソッド呼出しを実行して、効率的なコンパイルのための情報を収集します。クライアントJVMの場合、デフォルト設定は1,500呼出しです。次の例では、解釈されたメソッド呼出しの数を5,000に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1463,22 +1463,22 @@ print java/lang/String toString .if n \{\ .RE .\} -\fI\-Xcomp\fRץꤷơѥˡJava᥽åɤβ̵ˤ뤳ȤǤޤ +\fI\-Xcomp\fRオプションを指定して、コンパイルの前に、Javaメソッドの解釈を完全に無効にすることができます。 .RE .PP \-XX:+DoEscapeAnalysis .RS 4 -ʬϤλѤͭˤޤΥץϥǥեȤͭˤʤäƤޤʬϤλѤ̵ˤˤϡ\fI\-XX:\-DoEscapeAnalysis\fRꤷޤ +エスケープ分析の使用を有効にします。このオプションはデフォルトで有効になっています。エスケープ分析の使用を無効にするには、\fI\-XX:\-DoEscapeAnalysis\fRを指定します。 .RE .PP \-XX:+FailOverToOldVerifier .RS 4 -סåԤΡŤ٥եؤμưե륪СͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢǶΥХȥɡСѤ饹ˤϡ̵뤵ޤ(Ĥޤꡢ̵Ȥƽޤ)ŤСΥХȥɤѤ饹ˤϡͭǤޤ +新しいタイプ・チェッカが失敗した場合の、古いベリファイアへの自動フェイルオーバーを有効にします。デフォルトでは、このオプションは無効になっており、最近のバイトコード・バージョンを使用したクラスには、これは無視されます(つまり、無効として処理されます)。古いバージョンのバイトコードを使用したクラスには、これを有効化できます。 .RE .PP \-XX:InitialCodeCacheSize=\fIsize\fR .RS 4 -ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤ500KBꤵƤޤǤϡɡå塦32KBꤹˡ򼨤ޤ +初期コード・キャッシュ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は500KBに設定されています。次の例では、初期コード・キャッシュ・サイズを32KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1493,12 +1493,12 @@ print java/lang/String toString .PP \-XX:+Inline .RS 4 -᥽åɤΥ饤󲽤ͭˤޤΥץϡѥեޥ󥹤夵뤿˥ǥեȤͭˤʤäƤޤ᥽åɤΥ饤󲽤̵ˤˤϡ\fI\-XX:\-Inline\fRꤷޤ +メソッドのインライン化を有効にします。このオプションは、パフォーマンスを向上させるためにデフォルトで有効になっています。メソッドのインライン化を無効にするには、\fI\-XX:\-Inline\fRを指定します。 .RE .PP \-XX:InlineSmallCode=\fIsize\fR .RS 4 -饤󲽤ɬפʥѥ뤵줿᥽åɤκ祳ɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤꤷ꾮Υѥ뤵줿᥽åɤΤߤ饤󲽤ޤǥեȤǤϡ祳ɡ1000ХȤꤵƤޤ +インライン化が必要なコンパイルされたメソッドの最大コード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。指定したサイズより小さいサイズのコンパイルされたメソッドのみが、インライン化されます。デフォルトでは、最大コード・サイズは1000バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1513,16 +1513,16 @@ print java/lang/String toString .PP \-XX:+LogCompilation .RS 4 -ߤκȥǥ쥯ȥˤ\fIhotspot\&.log\fRȤ̾ΥեؤΥѥ롦ƥӥƥΥ󥰤ͭˤޤ\fI\-XX:LogFile\fRץѤơۤʤե롦ѥ̾Ǥޤ +現在の作業ディレクトリにある\fIhotspot\&.log\fRという名前のファイルへのコンパイル・アクティビティのロギングを有効にします。\fI\-XX:LogFile\fRオプションを使用して、異なるログ・ファイル・パスと名前を指定できます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢѥ롦ƥӥƥϵϿޤ\fI\-XX:+LogCompilation\fRץϡJVMץΥå\fI\-XX:UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、コンパイル・アクティビティは記録されません。\fI\-XX:+LogCompilation\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .sp -\fI\-XX:+PrintCompilation\fRץѤơ᥽åɤ򥳥ѥ뤹뤿Ӥˡ󥽡˽Ϥ줿åޤܺ٤ʿǽϤͭǤޤ +\fI\-XX:+PrintCompilation\fRオプションを使用して、メソッドをコンパイルするたびに、コンソールに出力されたメッセージを含む詳細な診断出力を有効化できます。 .RE .PP \-XX:MaxInlineSize=\fIsize\fR .RS 4 -饤󲽤᥽åɤκХȥɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡХȥɡ35ХȤꤵƤޤ +インライン化するメソッドの最大バイトコード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、最大バイトコード・サイズは35バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1537,7 +1537,7 @@ print java/lang/String toString .PP \-XX:MaxNodeLimit=\fInodes\fR .RS 4 -ñΥ᥽åɤΥѥ˻ѤΡɤκꤷޤǥեȤǤϡΡɤκ65,000ꤵƤޤ +単一のメソッドのコンパイル時に使用されるノードの最大数を設定します。デフォルトでは、ノードの最大数は65,000に設定されています。 .sp .if n \{\ .RS 4 @@ -1552,7 +1552,7 @@ print java/lang/String toString .PP \-XX:MaxTrivialSize=\fIsize\fR .RS 4 -饤󲽤ñ᥽åɤκХȥɡ(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡñ᥽åɤκХȥɡ6ХȤꤵƤޤ +インライン化する単純メソッドの最大バイトコード・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、単純メソッドの最大バイトコード・サイズは6バイトに設定されています。 .sp .if n \{\ .RS 4 @@ -1567,77 +1567,77 @@ print java/lang/String toString .PP \-XX:+OptimizeStringConcat .RS 4 -\fIString\fRϢκŬͭˤޤΥץϥǥեȤͭˤʤäƤޤ\fIString\fRϢκŬ̵ˤˤϡ\fI\-XX:\-OptimizeStringConcat\fRꤷޤ +\fIString\fR連結操作の最適化を有効にします。このオプションはデフォルトで有効になっています。\fIString\fR連結操作の最適化を無効にするには、\fI\-XX:\-OptimizeStringConcat\fRを指定します。 .RE .PP \-XX:+PrintAssembly .RS 4 -\fIdisassembler\&.so\fR饤֥ѤơХȥɲ줿ͥƥ֤Υ᥽åɤΥ֥ꡦɤνϤͭˤޤˤꡢ줿ɤɽ뤳ȤǤѥեޥ󥹤οǤΩޤ +外部の\fIdisassembler\&.so\fRライブラリを使用して、バイトコード化されたネイティブのメソッドのアセンブリ・コードの出力を有効にします。これにより、生成されたコードを表示することができ、パフォーマンスの問題の診断に役立ちます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ֥ꡦɤϰޤ\fI\-XX:+PrintAssembly\fRץϡJVMץΥå\fI\-XX:UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、アセンブリ・コードは印刷されません。\fI\-XX:+PrintAssembly\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .RE .PP \-XX:+PrintCompilation .RS 4 -᥽åɤ򥳥ѥ뤹뤿Ӥˡ󥽡˥åϤ뤳ȤˤäơJVMξܺ٤ʿǽϤͭˤޤˤꡢºݤ˥ѥ뤵᥽åɤǧǤޤǥեȤǤϡΥץ̵ǤꡢǽϤϰޤ +メソッドをコンパイルするたびに、コンソールにメッセージを出力することによって、JVMからの詳細な診断出力を有効にします。これにより、実際にコンパイルされるメソッドを確認できます。デフォルトでは、このオプションは無効であり、診断出力は印刷されません。 .sp -\fI\-XX:+LogCompilation\fRץѤơѥ롦ƥӥƥե˵Ͽ뤳ȤǤޤ +\fI\-XX:+LogCompilation\fRオプションを使用して、コンパイル・アクティビティをファイルに記録することもできます。 .RE .PP \-XX:+PrintInlining .RS 4 -饤󲽤ηƤνϤͭˤޤˤꡢ饤󲽤᥽åɤǧǤޤ +インライン化の決定内容の出力を有効にします。これにより、インライン化されるメソッドを確認できます。 .sp -ǥեȤǤϡΥץ̵Ǥꡢ饤󲽾ϽϤޤ\fI\-XX:+PrintInlining\fRץϡJVMץΥå\fI\-XX:+UnlockDiagnosticVMOptions\fRץȤȤ˻Ѥɬפޤ +デフォルトでは、このオプションは無効であり、インライン化情報は出力されません。\fI\-XX:+PrintInlining\fRオプションは、診断JVMオプションのロックを解除する\fI\-XX:+UnlockDiagnosticVMOptions\fRオプションとともに使用する必要があります。 .RE .PP \-XX:+RelaxAccessControlCheck .RS 4 -٥եΥå̤򸺤餷ޤǥեȤǤϡΥץ̵ˤʤäƤꡢǶΥХȥɡСѤ饹ˤϡ̵뤵ޤ(Ĥޤꡢ̵Ȥƽޤ)ŤСΥХȥɤѤ饹ˤϡͭǤޤ +ベリファイア内のアクセス制御チェックの量を減らします。デフォルトでは、このオプションは無効になっており、最近のバイトコード・バージョンを使用したクラスには、これは無視されます(つまり、無効として処理されます)。古いバージョンのバイトコードを使用したクラスには、これを有効化できます。 .RE .PP \-XX:ReservedCodeCacheSize=\fIsize\fR .RS 4 -JITѥ뤵줿ɤκ祳ɡå塦(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤΥץ\fI\-Xmaxjitcodesize\fRƱǤ +JITコンパイルされたコードの最大コード・キャッシュ・サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。このオプションは\fI\-Xmaxjitcodesize\fRと同等です。 .RE .PP \-XX:+TieredCompilation .RS 4 -إѥλѤͭˤޤǥեȤǤϡΥץ̵ǤꡢإѥϻѤޤ +層コンパイルの使用を有効にします。デフォルトでは、このオプションは無効であり、層コンパイルは使用されません。 .RE .PP \-XX:+UseCodeCacheFlushing .RS 4 -ѥ򥷥åȥ󤹤ˡɡåΥեåͭˤޤΥץϥǥեȤͭˤʤäƤޤѥ򥷥åȥ󤹤˥ɡåΥեå̵ˤˤ\fI\-XX:\-UseCodeCacheFlushing\fRꤷޤ +コンパイラをシャットダウンする前に、コード・キャッシュのフラッシュを有効にします。このオプションはデフォルトで有効になっています。コンパイラをシャットダウンする前にコード・キャッシュのフラッシュを無効にするには\fI\-XX:\-UseCodeCacheFlushing\fRを指定します。 .RE .PP \-XX:+UseCondCardMark .RS 4 -ɽιˡɤǤ˥ޡƤ뤫ɤΥåͭˤޤΥץϡǥեȤǤ̵ˤʤäƤꡢʣΥåȤĥޥǤΤ߻ѤɬפޤˤꡢƱˤʤ¸ƤJavaץꥱΥѥեޥ󥹤夷ޤ +カード表の更新前に、カードがすでにマークされているかどうかのチェックを有効にします。このオプションは、デフォルトでは無効になっており、複数のソケットを持つマシン上でのみ使用する必要があります。これにより、同時操作にかなり依存しているJavaアプリケーションのパフォーマンスが向上します。 .RE .PP \-XX:+UseSuperWord .RS 4 -顼黻Υѡɱ黻ؤѴͭˤޤΥץϥǥեȤͭˤʤäƤޤ顼黻Υѡɱ黻ؤѴ̵ˤˤϡ\fI\-XX:\-UseSuperWord\fRꤷޤ +スカラー演算のスーパーワード演算への変換を有効にします。このオプションはデフォルトで有効になっています。スカラー演算のスーパーワード演算への変換を無効にするには、\fI\-XX:\-UseSuperWord\fRを指定します。 .RE -.SS "٤ʥӥӥƥץ" +.SS "高度なサービスアビリティ・オプション" .PP -Υץϡƥܺ٤ʥǥХå¹Ԥ뵡ǽ󶡤ޤ +これらのオプションは、システム情報を収集し、詳細なデバッグを実行する機能を提供します。 .PP \-XX:+ExtendedDTraceProbes .RS 4 -ѥեޥ󥹤˱ƶͿɲä\fIdtrace\fRġ롦ץ֤ͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢ\fIdtrace\fRɸץ֤Τߤ¹Ԥޤ +パフォーマンスに影響を与える追加の\fIdtrace\fRツール・プローブを有効にします。デフォルトでは、このオプションは無効になっており、\fIdtrace\fRは標準プローブのみを実行します。 .RE .PP \-XX:+HeapDumpOnOutOfMemory .RS 4 -\fIjava\&.lang\&.OutOfMemoryError\fR㳰줿ˡҡסץե(HPROF)ѤơߤΥǥ쥯ȥΥեؤJavaҡפΥפͭˤޤ\fI\-XX:HeapDumpPath\fRץѤơҡססեΥѥ̾ŪǤޤǥեȤǤϡΥץ̵Ǥꡢ\fIOutOfMemoryError\fR㳰줿˥ҡפϥפޤ +\fIjava\&.lang\&.OutOfMemoryError\fR例外がスローされた場合に、ヒープ・プロファイラ(HPROF)を使用して、現在のディレクトリ内のファイルへのJavaヒープのダンプを有効にします。\fI\-XX:HeapDumpPath\fRオプションを使用して、ヒープ・ダンプ・ファイルのパスおよび名前を明示的に設定できます。デフォルトでは、このオプションは無効であり、\fIOutOfMemoryError\fR例外がスローされた場合にヒープはダンプされません。 .RE .PP \-XX:HeapDumpPath=\fIpath\fR .RS 4 -\fI\-XX:+HeapDumpOnOutOfMemoryError\fRץꤵƤ硢ҡסץե(HPROF)󶡤ҡספ񤭹ѥӥե̾ꤷޤǥեȤǤϡΥեϡߤκȥǥ쥯ȥ˺졢̾\fIjava_pid\fR\fIpid\fR\fI\&.hprof\fR -(\fIpid\fRϥ顼θȤʤäץμ̻)ˤʤޤǤϡǥեȤΥեŪꤹˡ򼨤ޤ(\fI%p\fRϸߤΥץμ̻Ҥɽޤ) +\fI\-XX:+HeapDumpOnOutOfMemoryError\fRオプションが設定されている場合、ヒープ・プロファイラ(HPROF)が提供するヒープ・ダンプを書き込むパスおよびファイル名を設定します。デフォルトでは、このファイルは、現在の作業ディレクトリに作成され、名前は\fIjava_pid\fR\fIpid\fR\fI\&.hprof\fR +(\fIpid\fRはエラーの原因となったプロセスの識別子)になります。次の例では、デフォルトのファイルを明示的に設定する方法を示します(\fI%p\fRは現在のプロセスの識別子を表します)。 .sp .if n \{\ .RS 4 @@ -1648,7 +1648,7 @@ JIT .if n \{\ .RE .\} -Ǥϡҡססե\fI/var/log/java/java_heapdump\&.hprof\fRꤹˡ򼨤ޤ +次の例では、ヒープ・ダンプ・ファイルを\fI/var/log/java/java_heapdump\&.hprof\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1663,9 +1663,9 @@ JIT .PP \-XX:LogFile=\fIpath\fR .RS 4 -ǡ񤭹ޤѥӥե̾ꤷޤǥեȤǤϡեϸߤκȥǥ쥯ȥ˺졢̾\fIhotspot\&.log\fRǤ +ログ・データが書き込まれるパスおよびファイル名を設定します。デフォルトでは、ファイルは現在の作業ディレクトリに作成され、名前は\fIhotspot\&.log\fRです。 .sp -Ǥϡե\fI/var/log/java/hotspot\&.log\fRꤹˡ򼨤ޤ +次の例では、ログ・ファイルを\fI/var/log/java/hotspot\&.log\fRに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1680,39 +1680,39 @@ JIT .PP \-XX:+PrintClassHistogram .RS 4 -\fI[Control]+[C]\fR٥(\fISIGTERM\fR)˥饹󥹥󥹤ΥҥȥΰͭˤޤǥեȤǤϡΥץ̵Ǥ +\fI[Control]+[C]\fRイベント(\fISIGTERM\fR)後にクラス・インスタンスのヒストグラムの印刷を有効にします。デフォルトでは、このオプションは無効です。 .sp -Υץꤹȡ\fIjmap \-histo\fRޥɡޤ\fIjcmd \fR\fIpid\fR\fI GC\&.class_histogram\fRޥ(\fIpid\fRϸߤJavaץμ̻)¹ԤƱˤʤޤ +このオプションを設定すると、\fIjmap \-histo\fRコマンド、または\fIjcmd \fR\fIpid\fR\fI GC\&.class_histogram\fRコマンド(\fIpid\fRは現在のJavaプロセスの識別子)を実行する場合と同じになります。 .RE .PP \-XX:+PrintConcurrentLocks .RS 4 .sp -\fI[Control]+[C]\fR٥(\fISIGTERM\fR)\fIjava\&.util\&.concurrent\fRåΰͭˤޤǥեȤǤϡΥץ̵Ǥ +\fI[Control]+[C]\fRイベント(\fISIGTERM\fR)後に\fIjava\&.util\&.concurrent\fRロックの印刷を有効にします。デフォルトでは、このオプションは無効です。 .sp -Υץꤹȡ\fIjstack \-l\fRޥɡޤ\fIjcmd \fR\fIpid\fR\fI Thread\&.print \-l\fRޥ(\fIpid\fRϸߤJavaץμ̻)¹ԤƱˤʤޤ +このオプションを設定すると、\fIjstack \-l\fRコマンド、または\fIjcmd \fR\fIpid\fR\fI Thread\&.print \-l\fRコマンド(\fIpid\fRは現在のJavaプロセスの識別子)を実行する場合と同じになります。 .RE .PP \-XX:+UnlockDiagnosticVMOptions .RS 4 -JVMοǤŪȤץ򥢥åޤǥեȤǤϡΥץ̵ǤꡢǥץϻѤǤޤ +JVMの診断を目的としたオプションをアンロックします。デフォルトでは、このオプションは無効であり、診断オプションは使用できません。 .RE -.SS "٤ʥ١쥯󡦥ץ" +.SS "高度なガベージ・コレクション・オプション" .PP -Υץϡ١쥯(GC)Java HotSpot VMˤäƤɤΤ褦˼¹Ԥ뤫椷ޤ +これらのオプションは、ガベージ・コレクション(GC)がJava HotSpot VMによってどのように実行されるかを制御します。 .PP \-XX:+AggressiveHeap .RS 4 -JavaҡפκŬͭˤޤˤꡢԥ塼ι(RAMCPU)˴Ťơ͡ʥѥ᡼꡼Ƥ椷Ĺּ¹ԥ֤˺Ŭˤʤ褦ꤵޤǥեȤǤϡΥץ̵ǤꡢҡפϺŬޤ +Javaヒープの最適化を有効にします。これにより、コンピュータの構成(RAMおよびCPU)に基づいて、様々なパラメータが、メモリー割当てが集中した長時間実行ジョブに最適になるように設定されます。デフォルトでは、このオプションは無効であり、ヒープは最適化されません。 .RE .PP \-XX:AllocatePrefetchDistance=\fIsize\fR .RS 4 -֥ȳƤΥץեåΥΥ(Хñ)ꤷޤ֥Ȥͤǽ񤭹⤦Ȥ꡼ϡǸ˳Ƥ줿֥ȤΥɥ쥹顢εΥޤǥץեåޤJavaåɤˤȼγƥݥȤޤ +オブジェクト割当てのプリフェッチ距離のサイズ(バイト単位)を設定します。新規オブジェクトの値で書き込もうとするメモリーは、最後に割り当てられたオブジェクトのアドレスから、この距離までプリフェッチされます。各Javaスレッドには独自の割当てポイントがあります。 .sp -ͤϡץեåΥϥץåȥե˴Ť򤵤뤳Ȥ򼨤ޤͤϡץեåХȿǤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤ\-1ꤵƤޤ +負の値は、プリフェッチ距離はプラットフォームに基づいて選択されることを示します。正の値は、プリフェッチするバイト数です。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は\-1に設定されています。 .sp -ǤϡץեåΥ1024ХȤꤹˡ򼨤ޤ +次の例では、プリフェッチ距離を1024バイトに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1727,9 +1727,9 @@ Java .PP \-XX:AllocatePrefetchLines=\fIlines\fR .RS 4 -ѥ뤵줿ɤץեå̿ѤơǸΥ֥ȳƸ˥ɤ륭åԿꤷޤǸ˳Ƥ줿֥Ȥ󥹥󥹤ξϡǥեͤ1ˤʤꡢξ3ˤʤޤ +コンパイルされたコードで生成されるプリフェッチ命令を使用して、最後のオブジェクト割当て後にロードするキャッシュ行数を設定します。最後に割り当てられたオブジェクトがインスタンスの場合は、デフォルト値は1になり、配列の場合は3になります。 .sp -Ǥϡɤ륭åԿ5ꤹˡ򼨤ޤ +次の例では、ロードされるキャッシュ行数を5に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1744,42 +1744,42 @@ Java .PP \-XX:AllocatePrefetchStyle=\fIstyle\fR .RS 4 -ץեå̿륳ɡꤷޤ\fIstyle\fRϡ03ޤǤǤ +プリフェッチ命令に生成されるコード・スタイルを設定します。\fIstyle\fR引数は、0から3までの整数です。 .PP 0 .RS 4 -ץեå̿ޤ +プリフェッチ命令を生成しません。 .RE .PP 1 .RS 4 -ƳƤθǡץեå̿¹ԤޤϥǥեȤΥѥ᡼Ǥ +各割当ての後で、プリフェッチ命令を実行します。これはデフォルトのパラメータです。 .RE .PP 2 .RS 4 -åɡʳƥ֥å(TLAB)ޡݥ󥿤Ѥơץեå̿¹Ԥ륿ߥ󥰤ꤷޤ +スレッド・ローカルな割当てブロック(TLAB)ウォーターマーク・ポインタを使用して、プリフェッチ命令を実行するタイミングを決定します。 .RE .PP 3 .RS 4 -ƥץեåѤSPARCBIS̿Ѥޤ +割当てプリフェッチ用のSPARCでBIS命令を使用します。 .RE .RE .PP \-XX:+AlwaysPreTouch .RS 4 -JVMνJavaҡ׾Τ٤ƤΥڡΥåͭˤޤˤꡢ\fImain()\fR᥽åɤˡ٤ƤΥڡ꡼˼ޤΥץϡʪ꡼˥ޥåפ줿٤Ƥβۥ꡼ޤĹּ¹ԤΥƥ򥷥ߥ졼ȤƥȤǻѤǤޤǥեȤǤϡΥץ̵ˤʤäƤꡢJVMҡΰ褬äѤˤʤȡ٤ƤΥڡߥåȤޤ +JVMの初期化中にJavaヒープ上のすべてのページのタッチを有効にします。これにより、\fImain()\fRメソッドの入力前に、すべてのページがメモリーに取得されます。このオプションは、物理メモリーにマップされたすべての仮想メモリーを含む長時間実行のシステムをシミュレートするテストで使用できます。デフォルトでは、このオプションは無効になっており、JVMヒープ領域がいっぱいになると、すべてのページがコミットされます。 .RE .PP \-XX:+CMSClassUnloadingEnabled .RS 4 -¹ԥޡ(CMS)١쥯Ѥˡɤ륯饹ͭˤޤΥץϥǥեȤͭˤʤäƤޤCMS١쥯Υ饹ɤ̵ˤˤϡ\fI\-XX:\-CMSClassUnloadingEnabled\fRꤷޤ +並行マークスイープ(CMS)ガベージ・コレクタを使用する場合に、アンロードするクラスを有効にします。このオプションはデフォルトで有効になっています。CMSガベージ・コレクタのクラス・アンロードを無効にするには、\fI\-XX:\-CMSClassUnloadingEnabled\fRを指定します。 .RE .PP \-XX:CMSExpAvgFactor=\fIpercent\fR .RS 4 -¹ԥ쥯פλؿʿѤ׻ݤˡߤΥץŤդ뤿˻Ѥ֤γ(0100ޤ)ꤷޤǥեȤǤϡؿʿѷ25%ꤵƤޤǤϡ15%ꤹˡ򼨤ޤ +並行コレクション統計の指数平均を計算する際に、現在のサンプルを重み付けするために使用される時間の割合(0から100まで)を設定します。デフォルトでは、指数平均係数は25%に設定されています。次の例では、係数を15%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1794,9 +1794,9 @@ JVM .PP \-XX:CMSIncrementalDutyCycle=\fIpercent\fR .RS 4 -¹ԥ쥯μ¹ԤĤƤޥʡ쥯֤λ֤γ(0100ޤ)ꤷޤ\fI\-XX:+CMSIncrementalPacing\fRͭʾ硢ǥ塼ƥ뤬ưŪꤵ졢ΥץϽͤΤߤꤷޤ +並行コレクタの実行が許可されているマイナー・コレクション間の時間の割合(0から100まで)を設定します。\fI\-XX:+CMSIncrementalPacing\fRが有効な場合、デューティ・サイクルが自動的に設定され、このオプションは初期値のみを設定します。 .sp -ǥեȤǤϡǥ塼ƥ10%ꤵƤޤǤϡǥ塼ƥ20%ꤹˡ򼨤ޤ +デフォルトでは、デューティ・サイクルは10%に設定されています。次の例では、デューティ・サイクルを20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1811,7 +1811,7 @@ JVM .PP \-XX:CMSIncrementalDutyCycleMin=\fIpercent\fR .RS 4 -\fI\-XX:+CMSIncrementalPacing\fRͭʾ˥ǥ塼ƥβ¤Ǥޥʡ쥯֤λ֤γ(0100ޤ)ꤷޤǥեȤǤϡǥ塼ƥβ¤0%ꤵƤޤǤϡ¤10%ꤹˡ򼨤ޤ +\fI\-XX:+CMSIncrementalPacing\fRが有効な場合にデューティ・サイクルの下限であるマイナー・コレクション間の時間の割合(0から100まで)を設定します。デフォルトでは、デューティ・サイクルの下限は0%に設定されています。次の例では、下限を10%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1826,12 +1826,12 @@ JVM .PP \-XX:+CMSIncrementalMode .RS 4 -CMS쥯ʬ⡼ɤͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ2İʲGCåɤĹˤΤͭˤɬפޤ\fICMSIncremental\fRǻϤޤ뤹٤ƤΥץϡΥץͭʾΤߡŬѤޤ +CMSコレクタの増分モードを有効にします。このオプションはデフォルトで無効になっており、2つ以下のGCスレッドを持つ構成にのみ有効にする必要があります。\fICMSIncremental\fRで始まるすべてのオプションは、このオプションが有効な場合のみ、適用されます。 .RE .PP \-XX:CMSIncrementalOffset=\fIpercent\fR .RS 4 -ʬ⡼ɤΥǥ塼ƥޥʡ쥯֤Ǵ˱˰ư֤γ(0100ޤ)ꤷޤǥեȤǤϡեåȤ0%ꤵƤޤǤϡǥ塼ƥΥեåȤ25%ꤹˡ򼨤ޤ +増分モードのデューティ・サイクルをマイナー・コレクション間で期間内に右に移動する時間の割合(0から100まで)を設定します。デフォルトでは、オフセットは0%に設定されています。次の例では、デューティ・サイクルのオフセットを25%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1846,12 +1846,12 @@ CMS .PP \-XX:+CMSIncrementalPacing .RS 4 -JVMμ¹˼줿פ˴Ťơʬ⡼ɤΥǥ塼ƥμưĴͭˤޤΥץϥǥեȤͭˤʤäƤޤʬ⡼ɡǥ塼ƥμưĴ̵ˤˤϡ\fI\-XX:\-CMSIncrementalPacing\fRꤷޤ +JVMの実行中に収集された統計に基づいて、増分モードのデューティ・サイクルの自動調整を有効にします。このオプションはデフォルトで有効になっています。増分モード・デューティ・サイクルの自動調整を無効にするには、\fI\-XX:\-CMSIncrementalPacing\fRを指定します。 .RE .PP \-XX:CMSIncrementalSafetyFactor=\fIpercent\fR .RS 4 -ǥ塼ƥ׻ݤˡݼɲä뤿˻Ѥ֤γ(0100ޤ)ꤷޤǥեȤǤϡ10%ꤵƤޤǤϡ5%ꤹˡ򼨤ޤ +デューティ・サイクルを計算する際に、保守を追加するために使用される時間の割合(0から100まで)を設定します。デフォルトでは、安全係数は10%に設定されています。次の例では、安全係数を5%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1866,9 +1866,9 @@ JVM .PP \-XX:CMSInitiatingOccupancyFraction=\fIpercent\fR .RS 4 -CMS򳫻ϤŤͭΨ(0100ޤ)ꤷޤǥեͤ\-1ꤵƤޤ(ǥեȤޤ)ϡ\fI\-XX:CMSTriggerRatio\fRͭΨͤ뤿˻Ѥ뤳Ȥ̣ޤ +CMS収集サイクルを開始する古い世代の占有率(0から100まで)を設定します。デフォルト値は\-1に設定されています。負の値(デフォルトを含む)は、\fI\-XX:CMSTriggerRatio\fRが開始占有率の値を定義するために使用されることを意味します。 .sp -ǤϡͭΨ20%ꤹˡ򼨤ޤ +次の例では、占有率を20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1883,14 +1883,14 @@ CMS .PP \-XX:+CMSScavengeBeforeRemark .RS 4 -CMSȡƥåפ˥٥󥸤λԤͭˤޤǥեȤǤϡΥץ̵Ǥ +CMSコメント・ステップの前にスカベンジの試行を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:CMSTriggerRatio=\fIpercent\fR .RS 4 -CMS뤬Ϥ˳Ƥ\fI\-XX:MinHeapFreeRatio\fRˤäƻꤵͤγ(0100ޤ)ꤷޤǥեͤ80%ꤵƤޤ +CMS収集サイクルが開始する前に割り当てられる\fI\-XX:MinHeapFreeRatio\fRによって指定される値の割合(0から100まで)を設定します。デフォルト値は80%に設定されています。 .sp -ǤϡͭΨ75%ꤹˡ򼨤ޤ +次の例では、占有率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1905,9 +1905,9 @@ CMS .PP \-XX:ConcGCThreads=\fIthreads\fR .RS 4 -¹GC˻Ѥ륹åɤοꤷޤǥեͤϡJVM˻ѤǤCPUοˤäưۤʤޤ +並行GCに使用されるスレッドの数を設定します。デフォルト値は、JVMに使用できるCPUの数によって異なります。 .sp -ȤС¹GCΥåɿ2ꤹˤϡΥץꤷޤ +たとえば、並行GCのスレッド数を2に設定するには、次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -1922,24 +1922,24 @@ CMS .PP \-XX:+DisableExplicitGC .RS 4 -\fISystem\&.gc()\fRθƽФν̵ˤ륪ץͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fISystem\&.gc()\fRؤθƽФ뤳Ȥ̣ޤ\fISystem\&.gc()\fRθƽФν̵ˤʤäƤ硢JVMɬפ˱GC¹Ԥޤ +\fISystem\&.gc()\fRの呼出しの処理を無効にするオプションを有効にします。このオプションはデフォルトで無効になっており、これは\fISystem\&.gc()\fRへの呼出しが処理されることを意味します。\fISystem\&.gc()\fRの呼出しの処理が無効になっている場合、JVMは必要に応じてGCを実行します。 .RE .PP \-XX:+ExplicitGCInvokesConcurrent .RS 4 -\fISystem\&.gc()\fRꥯȤѤ뤳Ȥˤäơ¹GCθƽФͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fI\-XX:+UseConcMarkSweepGC\fRץȤȤ˻ѤΤߡͭˤ뤳ȤǤޤ +\fISystem\&.gc()\fRリクエストを使用することによって、並行GCの呼出しを有効にします。このオプションはデフォルトで無効になっており、\fI\-XX:+UseConcMarkSweepGC\fRオプションとともに使用する場合のみ、有効にすることができます。 .RE .PP \-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses .RS 4 -\fISystem\&.gc()\fRꥯȤѤ¹GC˥饹򥢥ɤ뤳Ȥˤäơ¹GCθƽФͭˤޤΥץϥǥեȤ̵ˤʤäƤꡢ\fI\-XX:+UseConcMarkSweepGC\fRץȤȤ˻ѤΤߡͭˤ뤳ȤǤޤ +\fISystem\&.gc()\fRリクエストを使用し、並行GCサイクル中にクラスをアンロードすることによって、並行GCの呼出しを有効にします。このオプションはデフォルトで無効になっており、\fI\-XX:+UseConcMarkSweepGC\fRオプションとともに使用する場合のみ、有効にすることができます。 .RE .PP \-XX:G1HeapRegionSize=\fIsize\fR .RS 4 -١ե(G1)쥯ѤݤJavaҡפʬ꡼Υꤷޤͤˤϡ1MB32MBޤǤǤޤǥեȤΥ꡼󡦥ϡҡס˴ŤƿʹֹŪ˷ꤵޤ +ガベージファースト(G1)コレクタを使用する際にJavaヒープを細分化するリージョンのサイズを設定します。値には、1MBから32MBまでを指定できます。デフォルトのリージョン・サイズは、ヒープ・サイズに基づいて人間工学的に決定されます。 .sp -Ǥϡʬ줿16MBꤹˡ򼨤ޤ +次の例では、細分化されたサイズを16MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1954,14 +1954,14 @@ CMS .PP \-XX:+G1PrintHeapRegions .RS 4 -Ƥ줿꡼󤪤G1쥯ˤäƺ׵ᤵ줿Τ˴ؤΰͭˤޤǥեȤǤϡΥץ̵Ǥ +割り当てられたリージョンおよびG1コレクタによって再要求されたものに関する情報の印刷を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:G1ReservePercent=\fIpercent\fR .RS 4 -G1쥯ξʤԤǽ򸺤餹falseξ¤Ȥͽ󤵤줿ҡפγ(050ޤ)ꤷޤǥեȤǤϡΥץ10%ꤵƤޤ +G1コレクタの昇格が失敗する可能性を減らすためのfalseの上限として予約されたヒープの割合(0から50まで)を設定します。デフォルトでは、このオプションは10%に設定されています。 .sp -Ǥϡͽ󤵤줿ҡפ20%ꤹˡ򼨤ޤ +次の例では、予約されたヒープを20%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1976,9 +1976,9 @@ G1 .PP \-XX:InitialHeapSize=\fIsize\fR .RS 4 -꡼ƥסν(Хñ)ꤷޤꤹͤϡ0ޤ1MB礭1024ܿΤ줫ˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの初期サイズ(バイト単位)を設定します。指定する値は、0、または1MBより大きい1024の倍数のいずれかにする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼Υ͡ñ̤Ѥ6MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーのサイズを様々な単位を使用して6MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -1991,14 +1991,14 @@ G1 .if n \{\ .RE .\} -Υץ0ꤷ硢ϡŤȼ㤤˳Ƥ줿ιפȤꤵޤ㤤ΥҡפΥϡ\fI\-XX:NewSize\fRץѤǤޤ +このオプションを0に設定した場合、初期サイズは、古い世代と若い世代に割り当てられたサイズの合計として設定されます。若い世代のヒープのサイズは、\fI\-XX:NewSize\fRオプションを使用して設定できます。 .RE .PP \-XX:InitialSurvivorRatio=\fIratio\fR .RS 4 -롼ץåȡ١쥯Ѥ륵Хΰνꤷޤ(\fI\-XX:+UseParallelGC\fR/ޤ\fI\-XX:+UseParallelOldGC\fRץˤäͭˤʤޤ)\fI\-XX:+UseParallelGC\fRץ󤪤\fI\-XX:+UseParallelOldGC\fRץѤ뤳Ȥˤäơ롼ץåȡ١쥯ŬǥեȤͭˤޤͤϤơץꥱư˽äơХΰ褬ѹޤ(\fI\-XX:\-UseAdaptiveSizePolicy\fRץѤ)Ŭ̵ˤ硢\fI\-XX:SurvivorRatio\fRץѤơץꥱμ¹ΤΥХΰΥꤹɬפޤ +スループット・ガベージ・コレクタが使用するサバイバ領域の初期比を設定します(\fI\-XX:+UseParallelGC\fRおよび/または\fI\-XX:+UseParallelOldGC\fRオプションによって有効になります)。\fI\-XX:+UseParallelGC\fRオプションおよび\fI\-XX:+UseParallelOldGC\fRオプションを使用することによって、スループット・ガベージ・コレクタで適応サイズ指定をデフォルトで有効にします。初期値から始めて、アプリケーションの動作に従って、サバイバ領域がサイズ変更されます。(\fI\-XX:\-UseAdaptiveSizePolicy\fRオプションを使用して)適応サイズ指定を無効にした場合、\fI\-XX:SurvivorRatio\fRオプションを使用して、アプリケーションの実行全体のサバイバ領域のサイズを設定する必要があります。 .sp -μѤơ㤤Υ(Y)ӥХΰν(R)˴ŤơХΰν(S)׻Ǥޤ +次の式を使用して、若い世代のサイズ(Y)およびサバイバ領域の初期比(R)に基づいて、サバイバ領域の初期サイズ(S)を計算できます。 .sp .if n \{\ .RS 4 @@ -2009,11 +2009,11 @@ S=Y/(R+2) .if n \{\ .RE .\} -2ϡ2ĤΥХΰ򼨤ޤХΰν˻ꤹͤ礭ȡХΰνϾʤޤ +等式内の2は、2つのサバイバ領域を示します。サバイバ領域の初期比に指定する値を大きくすると、サバイバ領域の初期サイズは小さくなります。 .sp -ǥեȤǤϡХΰν8ꤵƤޤ㤤ΰ襵Υǥե(2MB)Ѥ硢Хΰν0\&.2MBˤʤޤ +デフォルトでは、サバイバ領域の初期比は8に設定されています。若い世代の領域サイズのデフォルト値(2MB)を使用した場合、サバイバ領域の初期サイズは0\&.2MBになります。 .sp -ǤϡХΰν4ꤹˡ򼨤ޤ +次の例では、サバイバ領域の初期比を4に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2028,9 +2028,9 @@ S=Y/(R+2) .PP \-XX:InitiatingHeapOccupancyPercent=\fIpercent\fR .RS 4 -¹GC򳫻ϤҡͭΨ(0100ޤ)ꤷޤϡ1ĤΤ(ȤG1١쥯ʤ)ǤϤʤҡΤͭ˴Ť¹GCȥꥬ륬١쥯ˤäƻѤޤ +並行GCサイクルを開始するヒープ占有率(0から100まで)を設定します。これは、1つの世代のみ(たとえばG1ガベージ・コレクタなど)ではなく、ヒープ全体の占有に基づいて並行GCサイクルをトリガーするガベージ・コレクタによって使用されます。 .sp -ǥեȤǤϡͤ45%ꤵƤޤ0ϡGC뤬ߤʤȤ̣ޤǤϡϥҡͭΨ75%ꤹˡ򼨤ޤ +デフォルトでは、開始値は45%に設定されています。値0は、GCサイクルが停止しないことを意味します。次の例では、開始ヒープ占有率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2045,9 +2045,9 @@ S=Y/(R+2) .PP \-XX:MaxGCPauseMillis=\fItime\fR .RS 4 -GCٻ߻(ߥñ)ΥåȤꤷޤϥեȡΤᡢJVMϼ¸Τ˺Ϥ򤷤ޤǥեȤǤϡٻ߻֤κͤϤޤ +最大GC休止時間(ミリ秒単位)のターゲットを設定します。これはソフト・ゴールのため、JVMは実現のために最善の努力をします。デフォルトでは、休止時間の最大値はありません。 .sp -Ǥϡ祿åȵٻ߻֤500ߥäꤹˡ򼨤ޤ +次の例では、最大ターゲット休止時間を500ミリ秒に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2062,9 +2062,9 @@ S=Y/(R+2) .PP \-XX:MaxHeapSize=\fIsize\fR .RS 4 -꡼ƥסκ祵(Хñ)ꤷޤꤹͤϡ2MB礭1024ܿˤɬפޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤǥեͤϡ¹Ի˥ƥ๽˴Ť򤵤ޤСǥץȤǤϡ\fI\-XX:InitialHeapSize\fR\fI\-XX:MaxHeapSize\fR̾Ʊͤꤵޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlˤ륬١쥯르Υߥå򻲾ȤƤ +メモリー割当てプールの最大サイズ(バイト単位)を設定します。指定する値は、2MBより大きい1024の倍数にする必要があります。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。デフォルト値は、実行時にシステム構成に基づいて選択されます。サーバー・デプロイメントでは、\fI\-XX:InitialHeapSize\fRおよび\fI\-XX:MaxHeapSize\fRは通常同じ値に設定されます。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/vm/gc\-ergonomics\&.htmlにあるガベージ・コレクタ・エルゴノミックを参照してください。 .sp -ǤϡƤ줿꡼εĤ祵͡ñ̤Ѥ80MBꤹˡ򼨤ޤ +次の例では、割り当てられたメモリーの許可される最大サイズを様々な単位を使用して80MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2077,16 +2077,16 @@ S=Y/(R+2) .if n \{\ .RE .\} -Oracle Solaris 7Oracle Solaris 8 SPARCץåȥեξΤͤξ¤ϡ褽4,000MB饪Сإåɤ̤ΤǤOracle Solaris 2\&.6x86ץåȥեξξ¤ϡ褽2,000MB饪Сإåɤ̤ΤǤLinuxץåȥեξξ¤ϡ褽2,000MB饪Сإåɤ̤ΤǤ +Oracle Solaris 7およびOracle Solaris 8 SPARCプラットフォームの場合のこの値の上限は、およそ4,000MBからオーバーヘッドの量を引いたものです。Oracle Solaris 2\&.6およびx86プラットフォームの場合の上限は、およそ2,000MBからオーバーヘッドの量を引いたものです。Linuxプラットフォームの場合の上限は、およそ2,000MBからオーバーヘッドの量を引いたものです。 .sp -\fI\-XX:MaxHeapSize\fRץ\fI\-Xmx\fRƱǤ +\fI\-XX:MaxHeapSize\fRオプションは\fI\-Xmx\fRと同等です。 .RE .PP \-XX:MaxHeapFreeRatio=\fIpercent\fR .RS 4 -GC٥ȸζҡΰεĤƤγ(0100ޤ)ꤷޤҡΰ褬ͤĶƳ礷硢ΥҡפϽ̾ޤǥեȤǤϡͤ70%ꤵƤޤ +GCイベント後の空きヒープ領域の許可されている最大の割合(0から100まで)を設定します。空きヒープ領域がこの値を超えて拡大した場合、そのヒープは縮小します。デフォルトでは、この値は70%に設定されています。 .sp -ǤϡҡפκΨ75%ꤹˡ򼨤ޤ +次の例では、空きヒープの最大比率を75%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2101,9 +2101,9 @@ GC .PP \-XX:MaxMetaspaceSize=\fIsize\fR .RS 4 -饹᥿ǡ˳Ƥ뤳ȤǤͥƥ֡꡼κ̤ꤷޤǥեȤǤϡΥ¤Ƥޤ󡣥ץꥱΥ᥿ǡ̤ϡץꥱΡ¾μ¹楢ץꥱ󡢤ӥƥǻѲǽʥ꡼̤ˤäưۤʤޤ +クラス・メタデータに割り当てることができるネイティブ・メモリーの最大量を設定します。デフォルトでは、このサイズは制限されていません。アプリケーションのメタデータの量は、アプリケーション自体、他の実行中アプリケーション、およびシステムで使用可能なメモリーの量によって異なります。 .sp -Ǥϡ饹᥿ǡκ祵256MBꤹˡ򼨤ޤ +次の例では、クラス・メタデータの最大サイズを256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2118,14 +2118,14 @@ GC .PP \-XX:MaxNewSize=\fIsize\fR .RS 4 -㤤(ʡ)Υҡפκ祵(Хñ)ꤷޤǥեͤϿʹֹŪꤵޤ +若い世代(ナーサリ)のヒープの最大サイズ(バイト単位)を設定します。デフォルト値は人間工学的に設定されます。 .RE .PP \-XX:MaxTenuringThreshold=\fIthreshold\fR .RS 4 -ŬGCǻѤƲꤷͤꤷޤͤ15Ǥǥեͤϡѥ(롼ץå)쥯ξ15CMS쥯ξ6Ǥ +適応GCサイズ指定で使用する最大殿堂入りしきい値を設定します。最大値は15です。デフォルト値は、パラレル(スループット)コレクタの場合は15、CMSコレクタの場合は6です。 .sp -ǤϡƲꤷͤ10ꤹˡ򼨤ޤ +次の例では、最大殿堂入りしきい値を10に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2140,14 +2140,14 @@ GC .PP \-XX:MetaspaceSize=\fIsize\fR .RS 4 -ǽĶȤ˥١쥯ȥꥬ롢Ƥ줿饹᥿ǡΰΥꤷޤΥ١쥯ΤͤϡѤ᥿ǡ̤ˤääޤϸޤǥեȤΥϥץåȥեˤäưۤʤޤ +最初に超えたときにガベージ・コレクションをトリガーする、割り当てられたクラス・メタデータ領域のサイズを設定します。このガベージ・コレクションのしきい値は、使用されるメタデータの量によって増加または減少します。デフォルトのサイズはプラットフォームによって異なります。 .RE .PP \-XX:MinHeapFreeRatio=\fIpercent\fR .RS 4 -GC٥ȸζҡΰεĤƤǾγ(0100ޤ)ꤷޤҡΰ褬ͤ򲼲ä硢Υҡפϳ礷ޤǥեȤǤϡͤ40%ꤵƤޤ +GCイベント後の空きヒープ領域の許可されている最小の割合(0から100まで)を設定します。空きヒープ領域がこの値を下回った場合、そのヒープは拡大します。デフォルトでは、この値は40%に設定されています。 .sp -ǤϡҡפκǾΨ25%ꤹˡ򼨤ޤ +次の例では、空きヒープの最小比率を25%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2162,7 +2162,7 @@ GC .PP \-XX:NewRatio=\fIratio\fR .RS 4 -㤤ΥȸŤΥȤΨꤷޤǥեȤǤϡΥץ2ꤵƤޤǤϡ㤤/ŤΨ1ꤹˡ򼨤ޤ +若い世代のサイズと古い世代のサイズとの比率を設定します。デフォルトでは、このオプションは2に設定されています。次の例では、若い/古いの比率を1に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2177,11 +2177,11 @@ GC .PP \-XX:NewSize=\fIsize\fR .RS 4 -㤤(ʡ)Υҡפν(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤ +若い世代(ナーサリ)のヒープの初期サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。 .sp -ҡפμ㤤꡼Ͽ֥Ȥ˻ѤޤGCϡ¾Υ꡼ꤳΥ꡼ǡˤ˼¹Ԥޤ㤤Υ硢¿ΥޥʡGC¹Ԥޤ礭硢եGCΤߤ¹ԤޤλޤǤ˻֤뤳Ȥޤ㤤ΥϡΤΥҡסȾʬ4ʬ1δ֤ˤƤȤᤷޤ +ヒープの若い世代リージョンは新しいオブジェクトに使用されます。GCは、他のリージョンよりこのリージョンで、より頻繁に実行されます。若い世代のサイズが小さすぎる場合、多数のマイナーGCが実行されます。サイズが大きすぎる場合、フルGCのみが実行されますが、完了までに時間がかかることがあります。若い世代のサイズは、全体のヒープ・サイズの半分から4分の1の間にしておくことをお薦めします。 .sp -Ǥϡ㤤ν͡ñ̤Ѥ256MBꤹˡ򼨤ޤ +次の例では、若い世代の初期サイズを様々な単位を使用して256MBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2194,14 +2194,14 @@ GC .if n \{\ .RE .\} -\fI\-XX:NewSize\fRץ\fI\-Xmn\fRƱǤ +\fI\-XX:NewSize\fRオプションは\fI\-Xmn\fRと同等です。 .RE .PP \-XX:ParallelGCThreads=\fIthreads\fR .RS 4 -㤤ȸŤǥѥ롦١쥯˻Ѥ륹åɤοꤷޤǥեͤϡJVM˻ѤǤCPUοˤäưۤʤޤ +若い世代と古い世代でパラレル・ガベージ・コレクションに使用するスレッドの数を設定します。デフォルト値は、JVMに使用できるCPUの数によって異なります。 .sp -ȤСѥGCΥåɿ2ꤹˤϡΥץꤷޤ +たとえば、パラレルGCのスレッド数を2に設定するには、次のオプションを指定します。 .sp .if n \{\ .RS 4 @@ -2216,52 +2216,52 @@ GC .PP \-XX:+ParallelRefProcEnabled .RS 4 -ѥ뻲ȽͭˤޤǥեȤǤϡΥץ̵Ǥ +パラレル参照処理を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintAdaptiveSizePolicy .RS 4 -Ŭ奵˴ؤνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +適応世代サイズ指定に関する情報の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGC .RS 4 -GCȤΥåνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとのメッセージの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCApplicationConcurrentTime .RS 4 -Ǹεٻ(ȤGCٻߤʤ)ʹߤ˷вᤷ֤νϤͭˤޤǥեȤǤϡΥץ̵Ǥ +最後の休止(たとえばGC休止など)以降に経過した時間の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCApplicationStoppedTime .RS 4 -ٻ(ȤGCٻߤʤ)³֤νϤͭˤޤǥեȤǤϡΥץ̵Ǥ +休止(たとえばGC休止など)が継続した時間の出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX+PrintGCDateStamp .RS 4 -GCȤեפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとの日付スタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCDetails .RS 4 -GCȤξܺ٥åνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとの詳細メッセージの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCTaskTimeStamps .RS 4 -ġGCåɡȤΥॹפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +個々のGCワーカー・スレッド・タスクごとのタイムスタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintGCTimeStamp .RS 4 -GCȤΥॹפνϤͭˤޤǥեȤǤϡΥץ̵Ǥ +GCごとのタイムスタンプの出力を有効にします。デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+PrintTenuringDistribution .RS 4 -Ʋ־νϤͭˤޤˡϤ򼨤ޤ +殿堂入り期間情報の出力を有効にします。次に、出力の例を示します。 .sp .if n \{\ .RS 4 @@ -2276,23 +2276,23 @@ Desired survivor size 48286924 bytes, new threshold 10 (max 10) .if n \{\ .RE .\} -1֥ȤϡǤ㤤ХФǤ(Υ٥󥸤θ˺졢ǿΥ٥󥸤¸³Edenΰ褫饵Хΰ˰ưޤ)2֥Ȥϡ2ĤΥ٥󥸤¸³ޤ(2ܤΥ٥ˡ륵Хΰ褫鼡ΰ˥ԡޤ)Τ褦³ޤ +期間1オブジェクトは、最も若いサバイバです(前のスカベンジの後に作成され、最新のスカベンジで存続し、Eden領域からサバイバ領域に移動しました)。期間2オブジェクトは、2つのスカベンジで存続します(2番目のスカベンジ中に、あるサバイバ領域から次の領域にコピーされました)。このように続きます。 .sp -ҤǤϡ28,992,024ХȤ1ĤΥ٥󥸤¸³Edenΰ褫饵Хΰ˥ԡޤ1,366,864ХȤϴ2֥ȤʤɤˤͭƤޤƹԤ3ܤͤϡnʲΥ֥ȤѥǤ +前述の例では、28,992,024バイトが1つのスカベンジで存続し、Eden領域からサバイバ領域にコピーされました。1,366,864バイトは期間2オブジェクトなどにより占有されています。各行の3番目の値は、期間n以下のオブジェクトの累積サイズです。 .sp -ǥեȤǤϡΥץ̵Ǥ +デフォルトでは、このオプションは無効です。 .RE .PP \-XX:+ScavengeBeforeFullGC .RS 4 -줾ΥեGC˼㤤GCͭˤޤΥץϥǥեȤͭˤʤäƤޤեGC˼㤤Υ٥󥸤ԤȡŤΰ褫㤤ΰؤΥǽʥ֥Ȥο򸺤餹ȤǤ뤿ᡢ̵\fIʤ\fRȤᤷޤƥեGC˼㤤GC̵ˤˤϡ\fI\-XX:\-ScavengeBeforeFullGC\fRꤷޤ +それぞれのフルGCの前に若い世代のGCを有効にします。このオプションはデフォルトで有効になっています。フルGCの前に若い世代のスカベンジを行うと、古い世代領域から若い世代領域へのアクセスが可能なオブジェクトの数を減らすことができるため、これを無効に\fIしない\fRことをお薦めします。各フルGCの前に若い世代のGCを無効にするには、\fI\-XX:\-ScavengeBeforeFullGC\fRを指定します。 .RE .PP \-XX:SoftRefLRUPolicyMSPerMB=\fItime\fR .RS 4 -եȡǽʥ֥ȤǸ˻ȤƤҡ׾ǥƥ֤ʤޤޤˤʤäƤ(ߥñ)ꤷޤǥեͤϡҡζᥬХ1丳֤Ǥ\fI\-XX:SoftRefLRUPolicyMSPerMB\fRץϡߤΥҡס(Java HotSpot Client VM)ޤϺǽҡס(Java HotSpot Server VM)1ᥬХΥߥäɽͤޤΰ㤤ϡClient VMϡҡפ礭ΤǤϤʤեȻȤեå夹뷹ΤФServer VMϡեȻȤեå夹ΤǤϤʤҡפ礭뷹뤳Ȥ̣ޤԤξ硢\fI\-Xmx\fRץͤϡեȻȤɤΤ餤®˥١쥯󤵤뤫˽פʱƶڤܤޤ +ソフト・アクセスが可能なオブジェクトが最後に参照されてからヒープ上でアクティブなままになっている時間(ミリ秒単位)を設定します。デフォルト値は、ヒープ内の空きメガバイト当たりで1秒の存続期間です。\fI\-XX:SoftRefLRUPolicyMSPerMB\fRオプションは、現在のヒープ・サイズ(Java HotSpot Client VM用)または最大可能ヒープ・サイズ(Java HotSpot Server VM用)の1メガバイト当たりのミリ秒を表す整数値を受け入れます。この違いは、Client VMは、ヒープを大きくするのではなく、ソフト参照をフラッシュする傾向があるのに対し、Server VMは、ソフト参照をフラッシュするのではなく、ヒープを大きくする傾向があることを意味します。後者の場合、\fI\-Xmx\fRオプションの値は、ソフト参照がどのくらい迅速にガベージ・コレクションされるかに重要な影響を及ぼします。 .sp -Ǥϡͤ2\&.5äꤹˡ򼨤ޤ +次の例では、値を2\&.5秒に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2307,7 +2307,7 @@ Desired survivor size 48286924 bytes, new threshold 10 (max 10) .PP \-XX:SurvivorRatio=\fIratio\fR .RS 4 -EdenΰΥȥХΰΥȤΨꤷޤǥեȤǤϡΥץ8ꤵƤޤǤϡEden/ХΰΨ4ꤹˡ򼨤ޤ +Eden領域のサイズとサバイバ領域のサイズとの比率を設定します。デフォルトでは、このオプションは8に設定されています。次の例では、Eden/サバイバ領域の比率を4に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2322,9 +2322,9 @@ Eden .PP \-XX:TargetSurvivorRatio=\fIpercent\fR .RS 4 -㤤١쥯θ˻Ѥ륵ХΰŪγ(0100ޤ)ꤷޤǥեȤǤϡΥץ50%ꤵƤޤ +若いガベージ・コレクションの後に使用されるサバイバ領域の目的の割合(0から100まで)を設定します。デフォルトでは、このオプションは50%に設定されています。 .sp -ǤϡåȤΥХΰΨ30%ꤹˡ򼨤ޤ +次の例では、ターゲットのサバイバ領域の比率を30%に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2339,9 +2339,9 @@ Eden .PP \-XX:TLABSize=\fIsize\fR .RS 4 -åɡʳƥХåե(TLAB)ν(Хñ)ꤷޤХȤ򼨤ʸ\fIk\fRޤ\fIK\fRᥬХȤ򼨤ʸ\fIm\fRޤ\fIM\fRХȤ򼨤ʸ\fIg\fRޤ\fIG\fRɲäޤΥץ0ꤵƤ硢JVMǤϽưŪ򤵤ޤ +スレッド・ローカルな割当てバッファ(TLAB)の初期サイズ(バイト単位)を設定します。キロバイトを示す場合は文字\fIk\fRまたは\fIK\fR、メガバイトを示す場合は文字\fIm\fRまたは\fIM\fR、ギガバイトを示す場合は文字\fIg\fRまたは\fIG\fRを追加します。このオプションが0に設定されている場合、JVMでは初期サイズが自動的に選択されます。 .sp -ǤϡTLABν512KBꤹˡ򼨤ޤ +次の例では、TLABの初期サイズを512KBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -2356,102 +2356,102 @@ Eden .PP \-XX:+UseAdaptiveSizePolicy .RS 4 -Ŭ奵λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤŬ奵̵ˤˤϡ\fI\-XX:\-UseAdaptiveSizePolicy\fRꤷ꡼ƥסΥŪꤷޤ(\fI\-XX:SurvivorRatio\fRץ򻲹ͤˤƤ) +適応世代サイズ指定の使用を有効にします。このオプションはデフォルトで有効になっています。適応世代サイズ指定を無効にするには、\fI\-XX:\-UseAdaptiveSizePolicy\fRを指定し、メモリー割当てプールのサイズを明示的に設定します(\fI\-XX:SurvivorRatio\fRオプションを参考にしてください)。 .RE .PP \-XX:+UseCMSInitiatingOccupancyOnly .RS 4 -CMS쥯γϤΤͣδȤƤͭͤλѤͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢ¾δबѤޤ +CMSコレクタの開始のための唯一の基準としての占有値の使用を有効にします。デフォルトでは、このオプションは無効になっており、他の基準が使用されます。 .RE .PP \-XX:+UseConcMarkSweepGC .RS 4 -ŤؤCMS١쥯λѤͭˤޤץꥱԵ֤׷򡢥롼ץå(\fI\-XX:+UseParallelGC\fR)١쥯ˤäȤǤʤ硢CMS١쥯Ѥ뤳ȤᤷޤG1١쥯(\fI\-XX:+UseG1GC\fR)̤ؤȤʤޤ +古い世代へのCMSガベージ・コレクタの使用を有効にします。アプリケーションの待機時間の要件を、スループット(\fI\-XX:+UseParallelGC\fR)ガベージ・コレクタによって満たすことができない場合、CMSガベージ・コレクタを使用することをお薦めします。G1ガベージ・コレクタ(\fI\-XX:+UseG1GC\fR)は別の代替となります。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤΥץͭˤȡ\fI\-XX:+UseParNewGC\fRץ󤬼ưŪꤵޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。このオプションを有効にすると、\fI\-XX:+UseParNewGC\fRオプションが自動的に設定されます。 .RE .PP \-XX:+UseG1GC .RS 4 -G1١쥯λѤͭˤޤϥСΥ١쥯ǡ̤RAMĥޥץåޥоݤȤƤޤ⤤ΨGCٻ߻֤ɸãƱŬڤʥ롼ץåȤݻޤG1쥯ϡGCԵ֤θꤵ줿׷(ꤷͽ¬ǽ0\&.5̤εٻ߻)ġ礭ҡ(6GBʾΥ)ɬפʥץꥱ˿侩ޤ +G1ガベージ・コレクタの使用を有効にします。これはサーバー形式のガベージ・コレクタで、大量のRAMを持つマルチプロセッサ・マシンを対象としています。高い確率でGC休止時間の目標を達成し、同時に適切なスループットも維持します。G1コレクタは、GC待機時間の限定された要件(安定した予測可能な0\&.5秒未満の休止時間)を持つ、大きいヒープ(約6GB以上のサイズ)が必要なアプリケーションに推奨されます。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。 .RE .PP \-XX:+UseGCOverheadLimit .RS 4 -\fIOutOfMemoryError\fR㳰ޤǤˡGCJVMˤäפ֤γ¤ݥꥷλѤͭˤޤǥեȤǤϡΥץͭˤʤäƤꡢ١쥯˹׻֤98%¿䤵졢ҡפΥꥫХ꤬2%̤Ǥ硢ѥGCˤä\fIOutOfMemoryError\fRޤҡפ硢εǽϡץꥱĹ֤ۤȤɤޤϤޤäĽʤ¹ԤƤ֤򤹤뤿˻ѤǤޤΥץ̵ˤˤϡ\fI\-XX:\-UseGCOverheadLimit\fRꤷޤ +\fIOutOfMemoryError\fR例外がスローされるまでに、GCでJVMによって要した時間の割合を制限するポリシーの使用を有効にします。デフォルトでは、このオプションは有効になっており、ガベージ・コレクションに合計時間の98%より多く費やされ、ヒープのリカバリが2%未満である場合、パラレルGCによって\fIOutOfMemoryError\fRがスローされます。ヒープが小さい場合、この機能は、アプリケーションが長期間ほとんどまたはまったく進捗なく実行している状態を回避するために使用できます。このオプションを無効にするには、\fI\-XX:\-UseGCOverheadLimit\fRを指定します。 .RE .PP \-XX:+UseNUMA .RS 4 -ץꥱûԵ֤Υ꡼λѤä뤳ȤǡԶѰʥ꡼ƥ(NUMA)ѤޥΥץꥱΥѥեޥ󥹺ŬͭˤޤǥեȤǤϡΥץ̵ˤʤäƤꡢNUMAФŬϹԤޤ󡣤Υץϡѥ롦١쥯(\fI\-XX:+UseParallelGC\fR)ѤƤΤ߻ѲǽǤ +アプリケーションで短い待機時間のメモリーの使用を増加させることで、不均一なメモリー・アーキテクチャ(NUMA)を使用したマシン上のアプリケーションのパフォーマンス最適化を有効にします。デフォルトでは、このオプションは無効になっており、NUMAに対する最適化は行われません。このオプションは、パラレル・ガベージ・コレクタ(\fI\-XX:+UseParallelGC\fR)が使用されている場合のみ使用可能です。 .RE .PP \-XX:+UseParallelGC .RS 4 -ʣΥץåѤƥץꥱΥѥեޥ󥹤夵롢ѥ롦٥󥸡١쥯(롼ץåȡ쥯ȤƤФ)λѤͭˤޤ +複数のプロセッサを利用してアプリケーションのパフォーマンスを向上させる、パラレル・スカベンジ・ガベージ・コレクタ(スループット・コレクタとも呼ばれる)の使用を有効にします。 .sp -ǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤͭˤ硢Ū̵ˤʤꡢ\fI\-XX:+UseParallelOldGC\fRץ󤬼ưŪͭˤʤޤ +デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。これを有効にした場合、明示的に無効にしないかぎり、\fI\-XX:+UseParallelOldGC\fRオプションが自動的に有効になります。 .RE .PP \-XX:+UseParallelOldGC .RS 4 -եGCؤΥѥ롦١쥯λѤͭˤޤǥեȤǤϡΥץ̵Ǥͭˤȡ\fI\-XX:+UseParallelGC\fRץ󤬼ưŪͭˤʤޤ +フルGCへのパラレル・ガベージ・コレクタの使用を有効にします。デフォルトでは、このオプションは無効です。これを有効にすると、\fI\-XX:+UseParallelGC\fRオプションが自動的に有効になります。 .RE .PP \-XX:+UseParNewGC .RS 4 -㤤ǤΥ쥯ؤΥѥ롦åɤλѤͭˤޤǥեȤǤϡΥץ̵Ǥ\fI\-XX:+UseConcMarkSweepGC\fRץꤹȡϼưŪͭˤʤޤ +若い世代でのコレクションへのパラレル・スレッドの使用を有効にします。デフォルトでは、このオプションは無効です。\fI\-XX:+UseConcMarkSweepGC\fRオプションを設定すると、これは自動的に有効になります。 .RE .PP \-XX:+UseSerialGC .RS 4 -ꥢ롦١쥯λѤͭˤޤ١쥯󤫤̤ʵǽɬפȤʤϤñʥץꥱξˤϡϰ̤˺ŬǤǥեȤǤϡΥץ̵ˤʤäƤꡢ쥯ϡޥιJVMΥפ˴ŤơưŪ򤵤ޤ +シリアル・ガベージ・コレクタの使用を有効にします。ガベージ・コレクションから特別な機能を必要としない、小規模で単純なアプリケーションの場合には、これは一般に最適な選択です。デフォルトでは、このオプションは無効になっており、コレクタは、マシンの構成およびJVMのタイプに基づいて、自動的に選択されます。 .RE .PP \-XX:+UseTLAB .RS 4 -㤤ΰǤΥåɡʳƥ֥å(TLAB)λѤͭˤޤΥץϥǥեȤͭˤʤäƤޤTLABλѤ̵ˤˤϡ\fI\-XX:\-UseTLAB\fRꤷޤ +若い世代の領域でのスレッド・ローカルな割当てブロック(TLAB)の使用を有効にします。このオプションはデフォルトで有効になっています。TLABの使用を無効にするには、\fI\-XX:\-UseTLAB\fRを指定します。 .RE -.SS "侩Ǻ줿ץ" +.SS "非推奨で削除されたオプション" .PP -ΥץϡΥ꡼ˤϴޤޤƤޤʹߤפȤߤʤƤޤ +これらのオプションは、以前のリリースには含まれていましたが、以降は不要とみなされています。 .PP \-Xrun\fIlibname\fR .RS 4 -ꤷǥХå/ץեΥ饤֥ɤޤΥץϡ\fI\-agentlib\fRץ˼äޤ +指定したデバッグ/プロファイルのライブラリをロードします。このオプションは、\fI\-agentlib\fRオプションに取って代わられました。 .RE .PP \-XX:CMSInitiatingPermOccupancyFraction=\fIpercent\fR .RS 4 -GC򳫻ϤʵͭΨ(0100ޤ)ꤷޤΥץJDK 8Ǥ侩ǡΤϤޤ +GCを開始する永久世代占有率(0から100まで)を設定します。このオプションはJDK 8では非推奨で、それに代わるものはありません。 .RE .PP \-XX:MaxPermSize=\fIsize\fR .RS 4 -ʵΰκ祵(Хñ)ꤷޤΥץϡJDK 8侩ˤʤꡢ\fI\-XX:MaxMetaspaceSize\fRץ˼äޤ +永久世代領域の最大サイズ(バイト単位)を設定します。このオプションは、JDK 8で非推奨になり、\fI\-XX:MaxMetaspaceSize\fRオプションに取って代わられました。 .RE .PP \-XX:PermSize=\fIsize\fR .RS 4 -Ķˤϥ١쥯ȥꥬ롢ʵ˳Ƥ줿ΰ(Хñ)ꤷޤΥץϡJDK 8侩ˤʤꡢ\fI\-XX:MetaspaceSize\fRץ˼äޤ +超えた場合にはガベージ・コレクションをトリガーする、永久世代に割り当てられた領域(バイト単位)を設定します。このオプションは、JDK 8で非推奨になり、\fI\-XX:MetaspaceSize\fRオプションに取って代わられました。 .RE .PP \-XX:+UseSplitVerifier .RS 4 -ڥץʬͭˤޤǥեȤǤϡΥץϰΥ꡼ǤͭˤʤäƤꡢڤϡ׻(ѥˤäƼ¹)ȡסå(JVM󥿥ˤäƼ¹)2ĤΥեʬ䤵ƤޤΥץJDK 8侩ȤʤꡢڤϥǥեȤʬ䤵졢̵ˤˡϤޤ +検証プロセスの分割を有効にします。デフォルトでは、このオプションは以前のリリースでは有効になっており、検証は、タイプ参照(コンパイラによって実行)と、タイプ・チェック(JVMランタイムによって実行)の2つのフェーズに分割されていました。このオプションはJDK 8で非推奨となり、検証はデフォルトで分割され、無効にする方法はありません。 .RE .PP \-XX:+UseStringCache .RS 4 -̤˳Ƥ줿ʸΥå󥰤ͭˤޤΥץJDK 8졢ΤϤޤ +一般に割り当てられた文字列のキャッシングを有効にします。このオプションはJDK 8から削除され、それに代わるものはありません。 .RE -.SH "ѥեޥ󥹡塼˥󥰤" +.SH "パフォーマンス・チューニングの例" .PP -Ǥϡ롼ץåȤκŬޤϥ쥹ݥ󥹻֤û̲Τ줫ԤΡŪʥ塼˥󥰡ե饰λˡ򼨤ޤ +次の例では、スループットの最適化またはレスポンス時間の短縮化のいずれかを行うための、試験的なチューニング・フラグの使用方法を示します。 .PP -\fBExample 1\fR, 롼ץåȤ夹뤿Υ塼˥ +\fBExample 1\fR, スループットを向上するためのチューニング .RS 4 .sp .if n \{\ @@ -2465,7 +2465,7 @@ java \-d64 \-server \-XX:+AggressiveOpts \-XX:+UseLargePages \-Xmn10g \-Xms26g .\} .RE .PP -\fBExample 2\fR, 쥹ݥ󥹻֤®뤿Υ塼˥ +\fBExample 2\fR, レスポンス時間を速くするためのチューニング .RS 4 .sp .if n \{\ @@ -2478,9 +2478,9 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .RE .\} .RE -.SH "λơ" +.SH "終了ステータス" .PP -̾νλͤưġ뤫֤ΤϡưʰǸƤӽФ줿ʥ顼ȯ뤤JVMˤ㳰줿ǤJavaץꥱϡAPIƽФ\fISystem\&.exit(exitValue)\fRѤǤդ֤ͤȤ򤹤뤳ȤǤޤͤϼΤȤǤ +通常、次の終了値が起動ツールから返されるのは、起動元が不正な引数で呼び出されたか、深刻なエラーが発生したか、あるいはJVMにより例外がスローされた場合です。ただし、Javaアプリケーションは、API呼出し\fISystem\&.exit(exitValue)\fRを使用して任意の値を返すことを選択することもできます。値は次のとおりです。 .sp .RS 4 .ie n \{\ @@ -2490,7 +2490,7 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .sp -1 .IP \(bu 2.3 .\} -\fI0\fR: ェλ +\fI0\fR: 正常終了 .RE .sp .RS 4 @@ -2501,9 +2501,9 @@ java \-d64 \-XX:+UseG1GC \-Xms26g Xmx26g \-XX:MaxGCPauseMillis=500 \-XX:+PrintGC .sp -1 .IP \(bu 2.3 .\} -\fI>0\fR: 顼ȯ +\fI>0\fR: エラー発生 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/javac.1 b/jdk/src/solaris/doc/sun/man/man1/ja/javac.1 index 5d829a38a81..c4c16f7f1e3 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/javac.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/javac.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javac .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javac" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javac" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javac \- Java饹ӥ󥿥եɤ߼ꡢХȥɤӥ饹ե˥ѥ뤷ޤ -.SH "" +javac \- Javaクラスおよびインタフェースの定義を読み取り、バイトコードおよびクラス・ファイルにコンパイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -62,32 +62,32 @@ javac \- Java .RE .\} .PP -ꤹǤդǤ +引数を指定する順序は任意です。 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIsourcefiles\fR .RS 4 -ѥ뤵1İʾΥե(\fIMyClass\&.java\fRʤ) +コンパイルされる1つ以上のソース・ファイル(\fIMyClass\&.java\fRなど)。 .RE .PP \fIclasses\fR .RS 4 -νоݤȤʤ1İʾΥ饹(\fIMyPackage\&.MyClass\fRʤ) +注釈の処理対象となる1つ以上のクラス(\fIMyPackage\&.MyClass\fRなど)。 .RE .PP \fI@argfiles\fR .RS 4 -ץȥեɽ1İʾΥե롣ΥեǤ\fI\-J\fRץϻǤޤ󡣥ޥɥ饤ե򻲾ȤƤ +オプションとソース・ファイルを一覧表示する1つ以上のファイル。このファイルの中では\fI\-J\fRオプションは指定できません。コマンドライン引数ファイルを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjavac\fRޥɤϡJavaץߥ󥰸ǵҤ줿饹ȥ󥿥եɤ߼ꡢХȥɤΥ饹ե˥ѥ뤷ޤ\fIjavac\fRޥɤǤϡJavaե뤪ӥ饹νǤޤ +\fIjavac\fRコマンドは、Javaプログラミング言語で記述されたクラスとインタフェースの定義を読み取り、バイトコードのクラス・ファイルにコンパイルします。\fIjavac\fRコマンドでは、Javaソース・ファイルおよびクラス内の注釈の処理もできます。 .PP -ɤΥե̾\fIjavac\fRϤˤϡ2Ĥˡޤ +ソース・コードのファイル名を\fIjavac\fRに渡すには、2つの方法があります。 .sp .RS 4 .ie n \{\ @@ -97,7 +97,7 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -եοʤϡե̾򥳥ޥɥ饤ǻꤷޤ +ソース・ファイルの数が少ない場合は、ファイル名をコマンドラインで指定します。 .RE .sp .RS 4 @@ -108,19 +108,19 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -եο¿ϡեΥե̾ޤϲԤǶڤäƻꤷޤ\fIjavac\fRޥɤǡꥹȡե̾Ƭ˥åȥޡ(@)Ѥޤ +ソース・ファイルの数が多い場合は、ファイル内のファイル名を空白または改行で区切って指定します。\fIjavac\fRコマンドで、リスト・ファイル名の先頭にアットマーク(@)を使用します。 .RE .PP -ɤΥե̾\&.javaĥҤ򡢥饹Υե̾\&.classĥҤäƤɬפޤޤեȥ饹եΤɤ⡢륯饹б롼̾äƤɬפޤȤС\fIMyClass\fRȤ̾Υ饹ϡ\fIMyClass\&.java\fRȤ̾Υե˵ҤޤΥեϡ\fIMyClass\&.class\fRȤ̾ΥХȥɡ饹ե˥ѥ뤵ޤ +ソース・コードのファイル名は\&.java拡張子を、クラスのファイル名は\&.class拡張子を持っている必要があります。また、ソース・ファイルとクラス・ファイルのどちらも、該当するクラスに対応するルート名を持っている必要があります。たとえば、\fIMyClass\fRという名前のクラスは、\fIMyClass\&.java\fRという名前のソース・ファイルに記述されます。このソース・ファイルは、\fIMyClass\&.class\fRという名前のバイトコード・クラス・ファイルにコンパイルされます。 .PP -饹ƤȡɲäΥ饹ե뤬ޤΥ饹ե̾ϡ\fIMyClass$MyInnerClass\&.class\fRΤ褦ˡ饹̾ȳ饹̾Ȥ߹礻Τˤʤޤ +内部クラスが定義されていると、追加のクラス・ファイルが生成されます。これらのクラス・ファイルの名前は、\fIMyClass$MyInnerClass\&.class\fRのように、内部クラス名と外部クラス名を組み合せたものになります。 .PP -եϡѥåĥ꡼ȿǤǥ쥯ȥꡦĥ꡼֤ޤȤС٤ƤΥե뤬\fI/workspace\fRˤ硢\fIcom\&.mysoft\&.mypack\&.MyClass\fRΥɤ\fI/workspace/com/mysoft/mypack/MyClass\&.java\fR˳Ǽޤ +ソース・ファイルは、パッケージ・ツリーを反映したディレクトリ・ツリーに配置します。たとえば、すべてのソース・ファイルが\fI/workspace\fRにある場合、\fIcom\&.mysoft\&.mypack\&.MyClass\fRのソース・コードを、\fI/workspace/com/mysoft/mypack/MyClass\&.java\fRに格納します。 .PP -ǥեȤǤϡѥϡƥ饹եб륽եƱǥ쥯ȥ˳Ǽޤ\fI\-d\fRץѤơ̤νǥ쥯ȥǤޤ -.SH "ץ" +デフォルトでは、コンパイラは、各クラス・ファイルを対応するソース・ファイルと同じディレクトリに格納します。\fI\-d\fRオプションを使用して、別の出力先ディレクトリを指定できます。 +.SH "オプション" .PP -ѥˤϡߤγȯĶǥݡȤɸ४ץΥåȤޤʳɸ४ץϡߤβۥޥ󤪤ӥѥμ˸ͭΥץǡ衢ѹǽޤɸ४ץϡ\fI\-X\fRץǻϤޤޤ +コンパイラには、現在の開発環境でサポートされる標準オプションのセットがあります。これ以外の非標準オプションは、現在の仮想マシンおよびコンパイラの実装に固有のオプションで、将来、変更される可能性があります。非標準オプションは、\fI\-X\fRオプションで始まります。 .sp .RS 4 .ie n \{\ @@ -130,7 +130,7 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -ѥ롦ץ򻲾ȤƤ +クロスコンパイル・オプションを参照してください。 .RE .sp .RS 4 @@ -141,230 +141,230 @@ javac \- Java .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ򻲾ȤƤ +非標準オプションを参照してください。 .RE -.SS "ɸ४ץ" +.SS "標準オプション" .PP \-A\fIkey\fR[\fI=value\fR] .RS 4 -ץåϤץꤷޤΥץϡ\fIjavac\fRľ᤹ܲΤǤϤʤ줾ΥץåǻѤǤ褦ˤʤޤ\fIkey\fRͤϡ1Ĥޤʣμ̻Ҥɥå(\&.)Ƕڤɬפޤ +注釈プロセッサに渡すオプションを指定します。これらのオプションは、\fIjavac\fRが直接解釈するのではなく、それぞれのプロセッサで使用できるようになります。\fIkey\fRの値は、1つまたは複数の識別子をドット(\&.)で区切る必要があります。 .RE .PP \-cp \fIpath\fR or \-classpath \fIpath\fR .RS 4 -桼饹ե롢(ץ)ץåȥե򸡺ꤷޤΥ饹ѥ\fICLASSPATH\fRĶѿΥ桼饹ѥ򥪡С饤ɤޤ\fICLASSPATH\fR\fI\-cp\fR\fI\-classpath\fRΤꤵƤʤ硢桼\fI饹ѥ\fRϡߤΥǥ쥯ȥˤʤޤSetting the Class Path 򻲾ȤƤ +ユーザー・クラス・ファイル、および(オプションで)注釈プロセッサとソース・ファイルを検索する場所を指定します。このクラス・パスは\fICLASSPATH\fR環境変数のユーザー・クラス・パスをオーバーライドします。\fICLASSPATH\fR、\fI\-cp\fR、\fI\-classpath\fRのいずれも指定されていない場合、ユーザーの\fIクラス・パス\fRは、現在のディレクトリになります。Setting the Class Path を参照してください。 .sp -\fI\-sourcepath\fRץ󤬻ꤵƤʤ硢ե桼饹ѥ鸡ޤ +\fI\-sourcepath\fRオプションが指定されていない場合、ソース・ファイルもユーザー・クラス・パスから検索されます。 .sp -\fI\-processorpath\fRץ󤬻ꤵƤʤ硢ץå⥯饹ѥ鸡ޤ +\fI\-processorpath\fRオプションが指定されていない場合、注釈プロセッサもクラス・パスから検索されます。 .RE .PP \-Djava\&.ext\&.dirs=\fIdirectories\fR .RS 4 -󥹥ȡѳĥǽΰ֤򥪡С饤ɤޤ +インストール済拡張機能の位置をオーバーライドします。 .RE .PP \-Djava\&.endorsed\&.dirs=\fIdirectories\fR .RS 4 -ǧ줿ɸѥΰ֤򥪡С饤ɤޤ +承認された標準パスの位置をオーバーライドします。 .RE .PP \-d \fIdirectory\fR .RS 4 -饹եνǥ쥯ȥꤷޤΥǥ쥯ȥ\fIjavac\fRǤϺʤᡢǤ¸ߤƤɬפޤ饹ѥåΰǤ硢\fIjavac\fRϡѥå̾ȿǤ֥ǥ쥯ȥ˥饹եǼɬפ˱ƥǥ쥯ȥޤ +クラス・ファイルの出力先ディレクトリを設定します。そのディレクトリは\fIjavac\fRでは作成されないため、すでに存在している必要があります。クラスがパッケージの一部である場合、\fIjavac\fRは、パッケージ名を反映したサブディレクトリ内にクラス・ファイルを格納し、必要に応じてディレクトリを作成します。 .sp \fI\-d\fR -\fI/home/myclasses\fRȻꤷ饹̾\fIcom\&.mypackage\&.MyClass\fRǤ硢饹ե\fI/home/myclasses/com/mypackage/MyClass\&.class\fRˤʤޤ +\fI/home/myclasses\fRと指定し、クラスの名前が\fIcom\&.mypackage\&.MyClass\fRである場合、クラス・ファイルは\fI/home/myclasses/com/mypackage/MyClass\&.class\fRになります。 .sp -\fI\-d\fRץ󤬻ꤵʤä硢\fIjavac\fRϡƥ饹ե򡢤Ȥʤ륽եƱǥ쥯ȥ˳Ǽޤ +\fI\-d\fRオプションが指定されなかった場合、\fIjavac\fRは、各クラス・ファイルを、その生成元となるソース・ファイルと同じディレクトリ内に格納します。 .sp -\fB:\fR -\fI\-d\fRץˤäƻꤵ줿ǥ쥯ȥϡ桼饹ѥ˼ưŪɲäޤ +\fB注意:\fR +\fI\-d\fRオプションによって指定されたディレクトリは、ユーザー・クラス・パスに自動的に追加されません。 .RE .PP \-deprecation .RS 4 -侩ΥСޤϥ饹ѤޤϥС饤ɤ뤿Ӥˡɽޤ\fI\-deprecation\fRץ󤬻ꤵƤʤ硢\fIjavac\fRϡ侩ΥСޤϥ饹ѤޤϥС饤ɤƤ륽եΥޥ꡼ɽޤ\fI\-deprecation\fRץϡ\fI\-Xlint:deprecation\fRξάɽǤ +非推奨のメンバーまたはクラスが使用またはオーバーライドされるたびに、説明を表示します。\fI\-deprecation\fRオプションが指定されていない場合、\fIjavac\fRは、非推奨のメンバーまたはクラスを使用またはオーバーライドしているソース・ファイルのサマリーを表示します。\fI\-deprecation\fRオプションは、\fI\-Xlint:deprecation\fRの省略表記です。 .RE .PP \-encoding \fIencoding\fR .RS 4 -եΥ󥳡ǥ̾(EUC\-JPUTF\-8ʤ)ꤷޤ\fI\-encoding\fRץ󤬻ꤵƤʤϡץåȥեΥǥեȡСѤޤ +ソース・ファイルのエンコーディング名(EUC\-JPやUTF\-8など)を設定します。\fI\-encoding\fRオプションが指定されていない場合は、プラットフォームのデフォルト・コンバータが使用されます。 .RE .PP \-endorseddirs \fIdirectories\fR .RS 4 -ǧ줿ɸѥΰ֤򥪡С饤ɤޤ +承認された標準パスの位置をオーバーライドします。 .RE .PP \-extdirs \fIdirectories\fR .RS 4 -\fIext\fRǥ쥯ȥΰ֤򥪡С饤ɤޤdirectoriesѿˤϡǶڤäǥ쥯ȥΥꥹȤꤷޤꤷǥ쥯ȥγJARե뤫顢饹ե뤬ޤФ줿٤ƤJARեϡ饹ѥΰˤʤޤ +\fIext\fRディレクトリの位置をオーバーライドします。directories変数には、コロンで区切ったディレクトリのリストを指定します。指定したディレクトリ内の各JARファイルから、クラス・ファイルが検索されます。検出されたすべてのJARファイルは、クラス・パスの一部になります。 .sp -ѥ(ۤʤJavaץåȥե˼줿֡ȥȥåס饹ĥǽ饹ФƥѥԤ)¹Ԥ硢Υץˤϳĥǽ饹ޤǥ쥯ȥꤷޤܺ٤ϥѥ롦ץ򻲾ȤƤ +クロスコンパイル(異なるJavaプラットフォームに実装されたブートストラップ・クラスや拡張機能クラスに対してコンパイルを行う)を実行する場合、このオプションには拡張機能クラスを含むディレクトリを指定します。詳細はクロスコンパイル・オプションを参照してください。 .RE .PP \-g .RS 4 -ѿޤह٤ƤΥǥХåޤǥեȤǤϡֹ椪ӥեΤߤޤ +ローカル変数を含むすべてのデバッグ情報を生成します。デフォルトでは、行番号およびソース・ファイル情報のみが生成されます。 .RE .PP \-g:none .RS 4 -ǥХåޤ +デバッグ情報を生成しません。 .RE .PP \-g:[\fIkeyword list\fR] .RS 4 -ޤǶڤ줿ɡꥹȤˤꤵ줿μΥǥХåΤߤޤΥɤͭǤ +カンマで区切られたキーワード・リストにより指定された、特定の種類のデバッグ情報のみを生成します。次のキーワードが有効です。 .PP source .RS 4 -եΥǥХå +ソース・ファイルのデバッグ情報。 .RE .PP lines .RS 4 -ֹΥǥХå +行番号のデバッグ情報。 .RE .PP vars .RS 4 -ѿΥǥХå +ローカル変数のデバッグ情報。 .RE .RE .PP \-help .RS 4 -ɸ४ץγפϤޤ +標準オプションの概要を出力します。 .RE .PP \-implicit:[\fIclass, none\fR] .RS 4 -Ū˥ɤ줿եФ륯饹ե椷ޤ饹եưˤϡ\fI\-implicit:class\fRѤޤ饹եˤϡ\fI\-implicit:none\fRѤޤΥץ󤬻ꤵʤäΥǥեưϡ饹եμưˤʤޤξ硢Τ褦ʥ饹ե뤬줿¹Ԥȡѥ餫ٹȯԤޤ\fI\-implicit\fRץŪꤵ줿硢ٹȯԤޤ󡣷θ򻲾ȤƤ +暗黙的にロードされたソース・ファイルに対するクラス・ファイルの生成を制御します。クラス・ファイルを自動生成するには、\fI\-implicit:class\fRを使用します。クラス・ファイルの生成を抑制するには、\fI\-implicit:none\fRを使用します。このオプションが指定されなかった場合のデフォルト動作は、クラス・ファイルの自動生成になります。その場合、そのようなクラス・ファイルが生成された時に注釈処理も実行されると、コンパイラから警告が発行されます。\fI\-implicit\fRオプションが明示的に設定された場合、警告は発行されません。型の検索を参照してください。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ(JVM)\fIoption\fRϤޤoptionˤϡJavaưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Java起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .sp -\fB:\fR -\fICLASSPATH\fR\fI\-classpath\fR\fI\-bootclasspath\fR\fI\-extdirs\fRץϡ\fIjavac\fRμ¹Ԥ˻Ѥ륯饹ꤷޤ󡣤Υץ󤪤ѿѤƥѥμ򥫥ޥ褦Ȥȡꥹ⤯¿ξ硢ɬפʽ¹Ԥޤ󡣥ѥμ򥫥ޥɬפ硢\fI\-J\fRץѤơäȤʤJavaưġ˥ץϤޤ +\fB注意:\fR +\fICLASSPATH\fR、\fI\-classpath\fR、\fI\-bootclasspath\fRおよび\fI\-extdirs\fRオプションは、\fIjavac\fRの実行に使用されるクラスを指定しません。これらのオプションおよび変数を使用してコンパイラの実装をカスタマイズしようとすると、リスクが高く、多くの場合、必要な処理が実行されません。コンパイラの実装をカスタマイズする必要がある場合、\fI\-J\fRオプションを使用して、基礎となるJava起動ツールにオプションを渡します。 .RE .PP \-nowarn .RS 4 -ٹå̵ˤޤΥץϡ\fI\-Xlint:none\fRץƱ褦ưޤ +警告メッセージを無効にします。このオプションは、\fI\-Xlint:none\fRオプションと同じように動作します。 .RE .PP \-parameters .RS 4 -ե쥯APIΥ᥽å\fIjava\&.lang\&.reflect\&.Executable\&.getParameters\fRǤ褦ˡ륯饹եΥ󥹥ȥ饯ȥ᥽åɤβѥ᡼̾Ǽޤ +リフレクションAPIのメソッド\fIjava\&.lang\&.reflect\&.Executable\&.getParameters\fRが取得できるように、生成されるクラス・ファイル内のコンストラクタとメソッドの仮パラメータ名を格納します。 .RE .PP \-proc: [\fInone\fR, \fIonly\fR] .RS 4 -ӥѥ¹Ԥ뤫椷ޤ\fI\-proc:none\fRϡʤǥѥ뤬¹Ԥ뤳Ȥ̣ޤ\fI\-proc:only\fRϡΤߤ¹Ԥ졢³ΥѥϤޤä¹ԤʤȤ̣ޤ +注釈処理およびコンパイルを実行するかを制御します。\fI\-proc:none\fRは、注釈処理なしでコンパイルが実行されることを意味します。\fI\-proc:only\fRは、注釈処理のみが実行され、後続のコンパイルはまったく実行されないことを意味します。 .RE .PP \-processor \fIclass1\fR [,\fIclass2\fR,\fIclass3\fR\&.\&.\&.] .RS 4 -¹Ԥץå̾ꤷ硢ǥեȤθϾάޤ +実行する注釈プロセッサの名前。これを指定した場合、デフォルトの検索処理は省略されます。 .RE .PP \-processorpath \fIpath\fR .RS 4 -ץå򸡺ꤷޤΥץ󤬻Ѥʤ硢饹ѥΥץåޤ +注釈プロセッサを検索する場所を指定します。このオプションが使用されない場合、クラス・パスのプロセッサが検索されます。 .RE .PP \-s \fIdir\fR .RS 4 -줿եγǼȤʤǥ쥯ȥꤷޤΥǥ쥯ȥ\fIjavac\fRǤϺʤᡢǤ¸ߤƤɬפޤ饹ѥåΰǤ硢ѥϡѥå̾ȿǤ֥ǥ쥯ȥ˥եǼɬפ˱ƥǥ쥯ȥޤ +生成されたソース・ファイルの格納先となるディレクトリを指定します。そのディレクトリは\fIjavac\fRでは作成されないため、すでに存在している必要があります。クラスがパッケージの一部である場合、コンパイラは、パッケージ名を反映したサブディレクトリ内にソース・ファイルを格納し、必要に応じてディレクトリを作成します。 .sp -\fI\-s /home/mysrc\fRȻꤷ饹̾\fIcom\&.mypackage\&.MyClass\fRǤ硢ե\fI/home/mysrc/com/mypackage/MyClass\&.java\fR˳Ǽޤ +\fI\-s /home/mysrc\fRと指定し、クラスの名前が\fIcom\&.mypackage\&.MyClass\fRである場合、ソース・ファイルは\fI/home/mysrc/com/mypackage/MyClass\&.java\fRに格納されます。 .RE .PP \-source \fIrelease\fR .RS 4 -դ륽ɤΥСꤷޤ\fIrelease\fRˤϼͤǤޤ +受け付けるソース・コードのバージョンを指定します。\fIrelease\fRには次の値を指定できます。 .PP 1\&.3 .RS 4 -ΥѥǤϡJava SE 1\&.3ʹߤƳ줿Τޤ¾θ쵡ǽ򥵥ݡȤޤ +このコンパイラでは、Java SE 1\&.3以降に導入されたアサーション、総称または他の言語機能をサポートしません。 .RE .PP 1\&.4 .RS 4 -Java SE 1\&.4Ƴ줿ޤॳɤդޤ +Java SE 1\&.4で導入された、アサーションを含むコードを受け付けます。 .RE .PP 1\&.5 .RS 4 -Java SE 5Ƴ줿Τ¾θ쵡ǽޤɤդޤ +Java SE 5で導入された総称および他の言語機能を含んだコードを受け付けます。 .RE .PP 5 .RS 4 -1\&.5ƱǤ +1\&.5と同義です。 .RE .PP 1\&.6 .RS 4 -Java SE 6ǤϸФѹƳޤǤեΥ󥳡ǥ󥰡顼Java Platform, Standard EditionΰΥ꡼褦ʷٹǤϤʤ顼Ȥ𤵤褦ˤʤޤ +Java SE 6では言語に対する変更は導入されませんでした。しかし、ソース・ファイル内のエンコーディング・エラーが、Java Platform, Standard Editionの以前のリリースような警告ではなく、エラーとして報告されるようになりました。 .RE .PP 6 .RS 4 -1\&.6ƱǤ +1\&.6と同義です。 .RE .PP 1\&.7 .RS 4 -줬ǥեͤǤJava SE 7Ƴ줿ǽޤॳɤդޤ +これがデフォルト値です。Java SE 7で導入された機能を含むコードを受け付けます。 .RE .PP 7 .RS 4 -1\&.7ƱǤ +1\&.7と同義です。 .RE .RE .PP \-sourcepath \fIsourcepath\fR .RS 4 -饹ޤϥ󥿥ե򸡺륽ɡѥꤷޤ桼饹ѥƱͤˡѥΥȥϡOracle SolarisǤϥ(:)ǡWindowsǤϥߥǶڤꡢˤϡǥ쥯ȥꡢJAR֤ޤZIP֤ǤޤѥåѤƤϡǥ쥯ȥޤϥΥ롦ѥ̾ѥå̾ȿǤƤɬפޤ +クラスまたはインタフェースの定義を検索するソース・コード・パスを指定します。ユーザー・クラス・パスと同様に、ソース・パスのエントリは、Oracle Solarisではコロン(:)で、Windowsではセミコロンで区切り、ここには、ディレクトリ、JARアーカイブまたはZIPアーカイブを指定できます。パッケージを使用している場合は、ディレクトリまたはアーカイブ内のローカル・パス名がパッケージ名を反映している必要があります。 .sp -\fB:\fR -ե⸫Ĥä硢饹ѥˤ긫Ĥä饹Ϻƥѥ뤵ǽޤθ򻲾ȤƤ +\fB注意:\fR +ソース・ファイルも見つかった場合、クラス・パスにより見つかったクラスは再コンパイルされる可能性があります。型の検索を参照してください。 .RE .PP \-verbose .RS 4 -ɤ륯饹ӥѥ뤵륽ե뤴Ȥξ󤬽Ϥ롢ܺٽϤѤޤ +ロードされるクラスおよびコンパイルされるソース・ファイルごとの情報が出力される、詳細出力を使用します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-werror .RS 4 -ٹȯ˥ѥλޤ +警告が発生した場合にコンパイルを終了します。 .RE .PP \-X .RS 4 -ɸ४ץ˴ؤɽƽλޤ +非標準オプションに関する情報を表示して終了します。 .RE -.SS "ѥ롦ץ" +.SS "クロスコンパイル・オプション" .PP -ǥեȤǤϡ饹Υѥϡ\fIjavac\fRźդƤץåȥեΥ֡ȥȥåס饹ӳĥǽ饹ФƹԤޤ\fIjavac\fRϡۤʤJavaץåȥե˼줿֡ȥȥåס饹ӳĥǽ饹ФƥѥԤѥ⥵ݡȤƤޤѥԤϡ\fI\-bootclasspath\fR\fI\-extdirs\fRץѤ뤳ȤפǤ +デフォルトでは、クラスのコンパイルは、\fIjavac\fRが添付されているプラットフォームのブートストラップ・クラスおよび拡張機能クラスに対して行われます。ただし、\fIjavac\fRは、異なるJavaプラットフォームに実装されたブートストラップ・クラスおよび拡張機能クラスに対してコンパイルを行うクロスコンパイルもサポートしています。クロスコンパイルを行う場合は、\fI\-bootclasspath\fRおよび\fI\-extdirs\fRオプションを使用することが重要です。 .PP \-target \fIversion\fR .RS 4 -ۥޥλꤵ줿꡼оݤȤ륯饹եޤ饹եϡꤵ줿åȰʹߤΥ꡼ǤưޤΥ꡼JVMǤưޤͭʥåȤϡ1\&.11\&.21\&.31\&.41\&.5 (5)1\&.6 (6)1\&.7 (7)Ǥ +仮想マシンの指定されたリリースを対象とするクラス・ファイルを生成します。クラス・ファイルは、指定されたターゲット以降のリリースでは動作しますが、それより前のリリースのJVMでは動作しません。有効なターゲットは、1\&.1、1\&.2、1\&.3、1\&.4、1\&.5 (5も可)、1\&.6 (6も可)および1\&.7 (7も可)です。 .sp -\fI\-target\fRץΥǥեȤϡ\fI\-source\fRץͤˤäưۤʤޤ +\fI\-target\fRオプションのデフォルトは、\fI\-source\fRオプションの値によって異なります。 .sp .RS 4 .ie n \{\ @@ -374,7 +374,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ󤬻ꤵƤʤ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが指定されていない場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -385,7 +385,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.2ξ硢\fI\-target\fRץͤ1\&.4Ǥ +\fI\-source\fRオプションが1\&.2の場合、\fI\-target\fRオプションの値は1\&.4です。 .RE .sp .RS 4 @@ -396,7 +396,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.3ξ硢\fI\-target\fRץͤ1\&.4Ǥ +\fI\-source\fRオプションが1\&.3の場合、\fI\-target\fRオプションの値は1\&.4です。 .RE .sp .RS 4 @@ -407,7 +407,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.5ξ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが1\&.5の場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -418,7 +418,7 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ1\&.6ξ硢\fI\-target\fRץͤ1\&.7Ǥ +\fI\-source\fRオプションが1\&.6の場合、\fI\-target\fRオプションの値は1\&.7です。 .RE .sp .RS 4 @@ -429,23 +429,23 @@ Java SE 6 .sp -1 .IP \(bu 2.3 .\} -\fI\-source\fRץ¾Τ٤Ƥͤξ硢\fI\-target\fRץͤϡ\fI\-source\fRץͤˤʤޤ +\fI\-source\fRオプションの他のすべての値の場合、\fI\-target\fRオプションの値は、\fI\-source\fRオプションの値になります。 .RE .RE .PP \-bootclasspath \fIbootclasspath\fR .RS 4 -ꤵ줿ϢΥ֡ȡ饹ФƥѥԤޤ桼饹ѥƱͤˡ֡ȡ饹ѥΥȥϥ(:)Ƕڤꡢˤϡǥ쥯ȥꡢJAR֤ޤZIP֤Ǥޤ +指定された一連のブート・クラスに対してクロスコンパイルを行います。ユーザー・クラス・パスと同様に、ブート・クラス・パスのエントリはコロン(:)で区切り、ここには、ディレクトリ、JARアーカイブまたはZIPアーカイブを指定できます。 .RE -.SS "ѥȡץե롦ץ" +.SS "コンパクト・プロファイル・オプション" .PP -JDK 8ʹߤ顢\fIjavac\fRѥϥѥȡץե򥵥ݡȤޤѥȡץեѤȡJavaץåȥեΤɬפȤʤץꥱϡǥץǽǡեåȥץȤǼ¹ԤǤޤѥȡץե뵡ǽϡץꥱ󡦥ȥΥץꥱΥɻ֤ṳ̂Τ˻ѤǤޤεǽϡJREХɥ뤹JavaץꥱΡꥳѥȤʥǥץȤΩޤεǽϡǥХǤΩޤ +JDK 8以降から、\fIjavac\fRコンパイラはコンパクト・プロファイルをサポートします。コンパクト・プロファイルを使用すると、Javaプラットフォーム全体を必要としないアプリケーションは、デプロイ可能で、小さいフットプリントで実行できます。コンパクト・プロファイル機能は、アプリケーション・ストアからのアプリケーションのダウンロード時間を短縮するのに使用できます。この機能は、JREをバンドルするJavaアプリケーションの、よりコンパクトなデプロイメントに役立ちます。この機能は、小さいデバイスでも役立ちます。 .PP -ݡȤƤץեͤϡ\fIcompact1\fR\fIcompact2\fR\fIcompact3\fRǤϡɲäΥ쥤䡼Ǥ礭ֹγƥѥȡץեˤϡֹ̾ΥץեΤ٤ƤAPIޤޤޤ +サポートされているプロファイル値は、\fIcompact1\fR、\fIcompact2\fRおよび\fIcompact3\fRです。これらは、追加のレイヤーです。大きい番号の各コンパクト・プロファイルには、小さい番号の名前のプロファイル内のすべてのAPIが含まれます。 .PP \-profile .RS 4 -ѥȡץեѤ硢Υץϡѥ˥ץե̾ꤷޤ򼨤ޤ +コンパクト・プロファイルを使用する場合、このオプションは、コンパイル時にプロファイル名を指定します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -456,7 +456,7 @@ javac \-profile compact1 Hello\&.java .if n \{\ .RE .\} -javacϡꤵ줿ץեˤʤǤդJava SE APIѤ륽ɤ򥳥ѥ뤷ޤ󡣤ϡΤ褦ʥɤ򥳥ѥ뤷褦Ȥ뤳Ȥˤä륨顼åǤ +javacは、指定されたプロファイルにない任意のJava SE APIを使用するソース・コードをコンパイルしません。これは、そのようなソース・コードをコンパイルしようとすることによって生じるエラー・メッセージの例です。 .sp .if n \{\ .RS 4 @@ -470,32 +470,32 @@ import java\&.applet\&.Applet; .if n \{\ .RE .\} -Ǥϡ\fIApplet\fR饹Ѥʤ褦˥ѹ뤳Ȥˤäơ顼Ǥޤ\-profileץꤻ˥ѥ뤹뤳Ȥˤäơ顼뤳ȤǤޤѥϡJava SE APIδʥåȤФƼ¹Ԥޤ(ɤΥѥȡץեˤ⡢\fIApplet\fR饹ϴޤޤƤޤ) +この例では、\fIApplet\fRクラスを使用しないようにソースを変更することによって、エラーを修正できます。\-profileオプションを指定せずにコンパイルすることによって、エラーを修正することもできます。コンパイルは、Java SE APIの完全なセットに対して実行されます。(どのコンパクト・プロファイルにも、\fIApplet\fRクラスは含まれていません。) .sp -ѥȡץեѤƥѥ뤹뤿̤ˡȤơ\fI\-bootclasspath\fRץѤơץեΥ᡼ꤹ\fIrt\&.jar\fRեؤΥѥꤷޤ\fI\-profile\fRץѤȡץե롦᡼ϡѥ˥ƥ¸ߤɬפޤ󡣤ϡѥΩޤ +コンパクト・プロファイルを使用してコンパイルするための別の方法として、\fI\-bootclasspath\fRオプションを使用して、プロファイルのイメージを指定する\fIrt\&.jar\fRファイルへのパスを指定します。かわりに\fI\-profile\fRオプションを使用すると、プロファイル・イメージは、コンパイル時にシステム上に存在する必要がありません。これは、クロスコンパイル時に役立ちます。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP \-Xbootclasspath/p:\fIpath\fR .RS 4 -֡ȥȥåס饹ѥɲäޤ +ブートストラップ・クラス・パスに接尾辞を追加します。 .RE .PP \-Xbootclasspath/a:\fIpath\fR .RS 4 -֡ȥȥåס饹ѥƬɲäޤ +ブートストラップ・クラス・パスに接頭辞を追加します。 .RE .PP \-Xbootclasspath/:\fIpath\fR .RS 4 -֡ȥȥåס饹եΰ֤򥪡С饤ɤޤ +ブートストラップ・クラス・ファイルの位置をオーバーライドします。 .RE .PP \-Xdoclint:[\-]\fIgroup\fR [\fI/access\fR] .RS 4 -\fIgroup\fRͤ\fIaccessibility\fR\fIsyntax\fR\fIreference\fR\fIhtml\fRޤ\fImissing\fRΤ줫ǤΥå롼פͭޤ̵ˤޤΥå롼פξܺ٤ϡ\fIjavadoc\fRޥɤ\fI\-Xdoclint\fRץ򻲾ȤƤ\fI\-Xdoclint\fRץϡ\fIjavac\fRޥɤǤϥǥեȤ̵ˤʤޤ +\fIgroup\fRの値が\fIaccessibility\fR、\fIsyntax\fR、\fIreference\fR、\fIhtml\fRまたは\fImissing\fRのいずれかである特定のチェック・グループを有効または無効にします。これらのチェック・グループの詳細は、\fIjavadoc\fRコマンドの\fI\-Xdoclint\fRオプションを参照してください。\fI\-Xdoclint\fRオプションは、\fIjavac\fRコマンドではデフォルトで無効になります。 .sp -ѿ\fIaccess\fRϡ\fI\-Xdoclint\fRץ󤬥å륯饹ȥСκǾβĻ٥ꤷޤ\fIpublic\fR\fIprotected\fR\fIpackage\fR\fIprivate\fR(Ļι⤤)1ĤĤȤǤޤȤСΥץϡ(protectedpackagepublicޤ) protectedʾΥ٥ĥ饹ӥС(٤ƤΥå롼פ)åޤ +変数\fIaccess\fRは、\fI\-Xdoclint\fRオプションがチェックするクラスとメンバーの最小の可視性レベルを指定します。\fIpublic\fR、\fIprotected\fR、\fIpackage\fRおよび\fIprivate\fRの値(可視性の高い順)の1つを持つことができます。たとえば、次のオプションは、(protected、package、publicを含む) protected以上のアクセス・レベルを持つクラスおよびメンバーを(すべてのチェック・グループで)チェックします。 .sp .if n \{\ .RS 4 @@ -506,7 +506,7 @@ import java\&.applet\&.Applet; .if n \{\ .RE .\} -ΥץϡpackageʾΥ(packagepublicޤ)ĥ饹ӥСФHTML顼åʤȤ٤ƤΥ٥ФƤ٤ƤΥå롼פͭˤޤ +次のオプションは、package以上のアクセス権(packageおよびpublicを含む)を持つクラスおよびメンバーに対するHTMLエラーをチェックしないことを除き、すべてのアクセス・レベルに対してすべてのチェック・グループを有効にします。 .sp .if n \{\ .RS 4 @@ -521,103 +521,103 @@ import java\&.applet\&.Applet; .PP \-Xdoclint:none .RS 4 -٤ƤΥå롼פ̵ˤޤ +すべてのチェック・グループを無効にします。 .RE .PP \-Xdoclint:all[\fI/access\fR] .RS 4 -٤ƤΥå롼פͭˤޤ +すべてのチェック・グループを有効にします。 .RE .PP \-Xlint .RS 4 -侩뤹٤ƤηٹͭˤޤΥ꡼ǤϡѲǽʤ٤Ƥηٹͭˤ뤳Ȥᤷޤ +推奨されるすべての警告を有効にします。このリリースでは、利用可能なすべての警告を有効にすることをお薦めします。 .RE .PP \-Xlint:all .RS 4 -侩뤹٤ƤηٹͭˤޤΥ꡼ǤϡѲǽʤ٤Ƥηٹͭˤ뤳Ȥᤷޤ +推奨されるすべての警告を有効にします。このリリースでは、利用可能なすべての警告を有効にすることをお薦めします。 .RE .PP \-Xlint:none .RS 4 -٤Ƥηٹ̵ˤޤ +すべての警告を無効にします。 .RE .PP \-Xlint:\fIname\fR .RS 4 -ٹ̵̾ˤޤΥץ̵ˤǤٹΥꥹȤϡ\-XlintץѤٹͭޤ̵򻲾ȤƤ +警告名を無効にします。このオプションで無効にできる警告のリストは、\-Xlintオプションを使用した警告の有効化または無効化を参照してください。 .RE .PP \-Xlint:\fI\-name\fR .RS 4 -ٹ̵̾ˤޤΥץ̵ˤǤٹΥꥹȤˤϡ\-XlintץѤٹͭޤ̵\-Xlint\fIץѤ\fR򻲾ȤƤ +警告名を無効にします。このオプションで無効にできる警告のリストを取得するには、\-Xlintオプションを使用した警告の有効化または無効化\-Xlint\fIオプションを使用した\fRを参照してください。 .RE .PP \-Xmaxerrs \fInumber\fR .RS 4 -륨顼κꤷޤ +印刷するエラーの最大数を設定します。 .RE .PP \-Xmaxwarns \fInumber\fR .RS 4 -ٹκꤷޤ +印刷する警告の最大数を設定します。 .RE .PP \-Xstdout \fIfilename\fR .RS 4 -ѥΥå򡢻ꤵ줿եޤǥեȤǤϡѥΥå\fISystem\&.err\fRޤ +コンパイラのメッセージを、指定されたファイルに送信します。デフォルトでは、コンパイラのメッセージは\fISystem\&.err\fRに送られます。 .RE .PP \-Xprefer:[\fInewer,source\fR] .RS 4 -뷿Фƥեȥ饹եξĤä硢ΤɤΥեɤ߼뤫ꤷޤ(θ򻲾ȤƤ)\fI\-Xprefer:newer\fRץѤ硢뷿Ф륽եȥ饹եΤɤ߼ޤ(ǥե)\fI\-Xprefer:source\fRץѤ硢ե뤬ɤ߼ޤ\fISOURCE\fR¸ݥꥷѤ줿ǤդץåǤ褦ˤϡ\fI\-Xprefer:source\fRѤƤ +ある型に対してソース・ファイルとクラス・ファイルの両方が見つかった場合、そのどちらのファイルを読み取るかを指定します。(型の検索を参照してください)。\fI\-Xprefer:newer\fRオプションを使用した場合、ある型に対するソース・ファイルとクラス・ファイルのうち新しい方が読み取られます(デフォルト)。\fI\-Xprefer:source\fRオプションを使用した場合、ソース・ファイルが読み取られます。\fISOURCE\fRの保存ポリシーを使用して宣言された注釈に任意の注釈プロセッサがアクセスできるようにする場合は、\fI\-Xprefer:source\fRを使用してください。 .RE .PP \-Xpkginfo:[\fIalways\fR,\fIlegacy\fR,\fInonempty\fR] .RS 4 -javacpackage\-info\&.javaե뤫\fIpackage\-info\&.class\fRե뤫ɤ椷ޤΥץǻѲǽmodeϼΤȤǤ +javacがpackage\-info\&.javaファイルから\fIpackage\-info\&.class\fRファイルを生成するかどうかを制御します。このオプションで使用可能なmode引数は次のとおりです。 .PP always .RS 4 -٤Ƥ\fIpackage\-info\&.java\fRե\fIpackage\-info\&.class\fRեޤΥץϡ\fI\&.java\fRեб\fI\&.class\fRե뤬뤳ȤǧAntʤɤΥӥɡƥѤΩĤȤޤ +すべての\fIpackage\-info\&.java\fRファイルの\fIpackage\-info\&.class\fRファイルを常に生成します。このオプションは、各\fI\&.java\fRファイルに対応する\fI\&.class\fRファイルがあることを確認するAntなどのビルド・システムを使用する場合に役立つことがあります。 .RE .PP legacy .RS 4 -package\-info\&.java᤬ޤޤˤΤ\fIpackage\-info\&.class\fRեޤpackage\-info\&.java˥ȤΤߴޤޤ\fIpackage\-info\&.class\fRեޤ +package\-info\&.javaに注釈が含まれる場合にのみ\fIpackage\-info\&.class\fRファイルを生成します。package\-info\&.javaにコメントのみ含まれる場合に\fIpackage\-info\&.class\fRファイルを生成しません。 .sp -\fB:\fR -\fIpackage\-info\&.class\fRեǤޤpackage\-info\&.javaեΤ٤Ƥ\fIRetentionPolicy\&.SOURCE\fR϶ˤʤޤ +\fB注意:\fR +\fIpackage\-info\&.class\fRファイルは生成できますが、package\-info\&.javaファイル内のすべての注釈に\fIRetentionPolicy\&.SOURCE\fRがある場合は空になります。 .RE .PP nonempty .RS 4 -package\-info\&.java\fIRetentionPolicy\&.CLASS\fRޤ\fIRetentionPolicy\&.RUNTIME\fRȤȤ᤬ޤޤˤΤ\fIpackage\-info\&.class\fRեޤ +package\-info\&.javaに\fIRetentionPolicy\&.CLASS\fRまたは\fIRetentionPolicy\&.RUNTIME\fRとともに注釈が含まれる場合にのみ\fIpackage\-info\&.class\fRファイルを生成します。 .RE .RE .PP \-Xprint .RS 4 -ǥХåŪǻꤷΥƥɽϤޤ⥳ѥ¹Ԥޤ󡣽Ϸѹǽޤ +デバッグ目的で指定した型のテキスト表示を出力します。注釈処理もコンパイルも実行されません。出力形式は変更される可能性があります。 .RE .PP \-XprintProcessorInfo .RS 4 -ΥץåꤵƤ˴ؤϤޤ +ある特定のプロセッサが処理を依頼されている注釈に関する情報を出力します。 .RE .PP \-XprintRounds .RS 4 -󤪤Ӹ³饦ɤ˴ؤϤޤ +初回および後続の注釈処理ラウンドに関する情報を出力します。 .RE -.SH "-XLINTץѤٹͭޤ̵" +.SH "-XLINTオプションを使用した警告の有効化または無効化" .PP -\fI\-Xlint:name\fRץѤƷٹ\fIname\fRͭˤޤǡ\fIname\fRϼηٹ̾Τ줫ˤʤޤ\fI\-Xlint:\-name:\fRץѤơٹ̵Ǥޤ +\fI\-Xlint:name\fRオプションを使用して警告\fIname\fRを有効にします。ここで、\fIname\fRは次の警告名のいずれかになります。\fI\-Xlint:\-name:\fRオプションを使用して、警告を無効化できます。 .PP cast .RS 4 -פǾĹʥ㥹ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +不要で冗長なキャストについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -632,12 +632,12 @@ String s = (String) "Hello!" .PP classfile .RS 4 -饹եƤ˴ϢˤĤƷٹ𤷤ޤ +クラス・ファイルの内容に関連した問題について警告します。 .RE .PP deprecation .RS 4 -侩ιܤλѤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +非推奨の項目の使用について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -649,13 +649,13 @@ int currentDay = myDate\&.getDay(); .if n \{\ .RE .\} -᥽å\fIjava\&.util\&.Date\&.getDay\fRJDK 1\&.1ʹߤ侩ˤʤޤ +メソッド\fIjava\&.util\&.Date\&.getDay\fRはJDK 1\&.1以降は非推奨になりました。 .RE .PP dep\-ann .RS 4 \fI@deprecated\fR -JavadocȤǥɥȲƤ뤬\fI@Deprecated\fR᤬դƤʤܤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +Javadocコメントでドキュメント化されているが、\fI@Deprecated\fR注釈が付いていない項目について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -674,7 +674,7 @@ public static void newMethod() { } .PP divzero .RS 4 -0ǽ뤳ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +定整数0で除算されることについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -689,7 +689,7 @@ int divideByZero = 42 / 0; .PP empty .RS 4 -\fIif \fRʸʹߤʸǤ뤳ȤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +\fIif \fR文以降が空の文であることについて警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -708,7 +708,7 @@ class E { .PP fallthrough .RS 4 -fall\-throughswitch֥ååФ줿ΤФƷٹåɽޤFall\-throughϡswitch֥åκǸΥǤΥɤˤbreakʸϴޤޤޤ󡣥ɤμ¹Ԥ򤽤Υ鼡ΥذưޤȤСswitch֥åcase 1٥³ɤϡbreakʸǽäƤޤ +fall\-throughケースのswitchブロックをチェックし、検出されたものに対して警告メッセージを表示します。Fall\-throughケースは、switchブロック内の最後のケースを除くケースです。このコードにはbreak文は含まれません。コードの実行をそのケースから次のケースへ移動します。たとえば、このswitchブロック内のcase 1ラベルに続くコードは、break文で終わっていません。 .sp .if n \{\ .RS 4 @@ -725,12 +725,12 @@ case 2: .if n \{\ .RE .\} -ΥɤΥѥ\fI\-Xlint:fallthrough\fRץ󤬻ѤƤ硢ѥϡˤʤäƤ륱ιֹȤȤˡcasefall\-throughǽ뤳Ȥ򼨤ٹȯԤޤ +このコードのコンパイル時に\fI\-Xlint:fallthrough\fRオプションが使用されていた場合、コンパイラは、問題になっているケースの行番号とともに、caseにfall\-throughする可能性があることを示す警告を発行します。 .RE .PP finally .RS 4 -˴λǤʤ\fIfinally\fRˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +正常に完了できない\fIfinally\fR句について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -750,17 +750,17 @@ public static int m() { .if n \{\ .RE .\} -Ǥϡѥ\fIfinally\fR֥å˴ؤٹޤ\fIint\fR᥽åɤƤӽФȡ0֤ޤ\fIfinally\fR֥åϡ\fItry\fR֥åλȼ¹ԤޤǤϡ椬\fIcatch\fR֥å˰ܤ줿硢\fIint\fR᥽åɤϽλޤ\fIfinally\fR֥åϼ¹Ԥɬפ뤿ᡢ椬᥽åɤγ˰ܤƤƤ⡢Υ֥åϼ¹Ԥޤ +この例では、コンパイラは\fIfinally\fRブロックに関する警告を生成します。\fIint\fRメソッドが呼び出されると、値0が返されます。\fIfinally\fRブロックは、\fItry\fRブロックが終了すると実行されます。この例では、制御が\fIcatch\fRブロックに移された場合、\fIint\fRメソッドは終了します。ただし、\fIfinally\fRブロックは実行される必要があるため、制御がメソッドの外部に移されていても、このブロックは実行されます。 .RE .PP options .RS 4 -ޥɥ饤󡦥ץλѤ˴ؤˤĤƷٹ𤷤ޤѥ롦ץ򻲾ȤƤ +コマンドライン・オプションの使用に関する問題について警告します。クロスコンパイル・オプションを参照してください。 .RE .PP overrides .RS 4 -᥽åɤΥС饤ɤ˴ؤˤĤƷٹ𤷤ޤȤС2ĤΥ饹Ȥޤ +メソッドのオーバーライドに関する問題について警告します。たとえば、次の2つのクラスがあるとします。 .sp .if n \{\ .RS 4 @@ -778,7 +778,7 @@ public class ClassWithOverridingMethod extends ClassWithVarargsMethod { .if n \{\ .RE .\} -ѥϡΤ褦ʷٹޤ +コンパイラは、次のような警告を生成します。 .sp .if n \{\ .RS 4 @@ -791,12 +791,12 @@ method is missing \*(Aq\&.\&.\&.\*(Aq .if n \{\ .RE .\} -ѥϡ\fIvarargs\fR᥽åɤ򸡽Фȡ\fIvarargs\fRβѥ᡼Ѵޤ᥽å\fIClassWithVarargsMethod\&.varargsMethod\fRǤϡѥ\fIvarargs\fRβѥ᡼\fIString\&.\&.\&. s\fR򲾥ѥ᡼\fIString[] s\fRѴޤϡ᥽å\fIClassWithOverridingMethod\&.varargsMethod\fRβѥ᡼бǤη̡Ǥϥѥ뤬Ԥޤ +コンパイラは、\fIvarargs\fRメソッドを検出すると、\fIvarargs\fRの仮パラメータを配列に変換します。メソッド\fIClassWithVarargsMethod\&.varargsMethod\fRでは、コンパイラは\fIvarargs\fRの仮パラメータ\fIString\&.\&.\&. s\fRを仮パラメータ\fIString[] s\fRに変換します。これは、メソッド\fIClassWithOverridingMethod\&.varargsMethod\fRの仮パラメータに対応する配列です。その結果、この例ではコンパイルが行われます。 .RE .PP path .RS 4 -ޥɥ饤Ǥ̵ʥѥǤ¸ߤʤѥǥ쥯ȥˤĤƷٹ𤷤ޤ(饹ѥѥʤɤΥѥϢ)Τ褦ʷٹ\fI@SuppressWarnings\fR뤳ȤϤǤޤ󡣤ȤСΤ褦ˤʤޤ +コマンドラインでの無効なパス要素と存在しないパス・ディレクトリについて警告します(クラス・パス、ソース・パスなどのパス関連)。このような警告を\fI@SuppressWarnings\fR注釈で抑制することはできません。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -811,9 +811,9 @@ javac \-Xlint:path \-classpath /nonexistentpath Example\&.java .PP processing .RS 4 -˴ؤˤĤƷٹ𤷤ޤѥ餬ηٹΤϡޤ९饹ȤˡѤƤץåǤΥפ㳰ǤʤǤȤСñץå򼡤˼ޤ +注釈処理に関する問題について警告します。コンパイラがこの警告を生成するのは、注釈を含むクラスがあるときに、使用している注釈プロセッサでそのタイプの例外を処理できない場合です。たとえば、単純な注釈プロセッサを次に示します。 .sp -\fBեAnnocProc\&.java\fR: +\fBソース・ファイルAnnocProc\&.java\fR: .sp .if n \{\ .RS 4 @@ -838,7 +838,7 @@ public class AnnoProc extends AbstractProcessor { .if n \{\ .RE .\} -\fBեAnnosWithoutProcessors\&.java\fR: +\fBソース・ファイルAnnosWithoutProcessors\&.java\fR: .sp .if n \{\ .RS 4 @@ -852,7 +852,7 @@ class AnnosWithoutProcessors { } .if n \{\ .RE .\} -Υޥɤϡץå\fIAnnoProc\fR򥳥ѥ뤷ץå򥽡ե\fIAnnosWithoutProcessors\&.java\fRФƼ¹Ԥޤ +次のコマンドは、注釈プロセッサ\fIAnnoProc\fRをコンパイルし、この注釈プロセッサをソース・ファイル\fIAnnosWithoutProcessors\&.java\fRに対して実行します。 .sp .if n \{\ .RS 4 @@ -864,7 +864,7 @@ javac \-cp \&. \-Xlint:processing \-processor AnnoProc \-proc:only AnnosWithoutP .if n \{\ .RE .\} -ѥ餬ե\fIAnnosWithoutProcessors\&.java\fRФץå¹Ԥȡηٹޤ +コンパイラがソース・ファイル\fIAnnosWithoutProcessors\&.java\fRに対して注釈プロセッサを実行すると、次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -876,12 +876,12 @@ warning: [processing] No processor claimed any of these annotations: Anno .if n \{\ .RE .\} -褹뤿ˡ饹\fIAnnosWithoutProcessors\fRӻѤ̾\fIAnno\fR\fINotAnno\fRѹǤޤ +この問題を解決するために、クラス\fIAnnosWithoutProcessors\fRで定義および使用される注釈の名前を、\fIAnno\fRから\fINotAnno\fRに変更できます。 .RE .PP rawtypes .RS 4 -rawФ̤ˤĤƷٹ𤷤ޤʸǤϡ\fIrawtypes\fRٹޤ +raw型に対する未検査操作について警告します。次の文では、\fIrawtypes\fR警告が生成されます。 .sp .if n \{\ .RS 4 @@ -892,7 +892,7 @@ void countElements(List l) { \&.\&.\&. } .if n \{\ .RE .\} -Ǥϡ\fIrawtypes\fRٹޤ +次の例では、\fIrawtypes\fR警告は生成されません。 .sp .if n \{\ .RS 4 @@ -903,12 +903,12 @@ void countElements(List<?> l) { \&.\&.\&. } .if n \{\ .RE .\} -\fIList\fRrawǤ\fIList<?>\fRϡХɷΥ磻ɥɤΥѥ᡼줿Ǥ\fIList\fRϥѥ᡼줿󥿥եǤ뤿ᡢˤηꤷޤǤϡ\fIList\fRβϥХɷΥ磻ɥ(\fI?\fR)ѤƤβѥ᡼ȤƻꤵޤĤޤꡢ\fIcountElements\fR᥽åɤ\fIList\fR󥿥եΤɤΥ󥹥󥹲դ뤳ȤǤޤ +\fIList\fRはraw型です。ただし、\fIList<?>\fRは、アンバウンド形式のワイルドカードのパラメータ化された型です。\fIList\fRはパラメータ化されたインタフェースであるため、常にその型引数を指定します。この例では、\fIList\fRの仮引数はアンバウンド形式のワイルドカード(\fI?\fR)を使用してその仮型パラメータとして指定されます。つまり、\fIcountElements\fRメソッドは\fIList\fRインタフェースのどのインスタンス化も受け付けることができます。 .RE .PP Serial .RS 4 -ľ󲽲ǽ饹\fIserialVersionUID\fRʤȤٹ𤷤ޤȤСΤ褦ˤʤޤ +直列化可能クラスに\fIserialVersionUID\fR定義がないことを警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -930,7 +930,7 @@ public class PersistentTime implements Serializable .if n \{\ .RE .\} -ѥϼηٹޤ +コンパイラは次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -942,12 +942,12 @@ serialVersionUID .if n \{\ .RE .\} -ľ󲽲ǽ饹\fIserialVersionUID\fRȤ̾ΥեɤŪʤ硢ľ󲽥󥿥ĶǤϡJava֥ľ󲽻͡פƤ褦ˡ饹͡¦̤˴Ťơ饹\fIserialVersionUID\fRΥǥեͤ׻ޤ٤Ƥľ󲽲ǽ饹\fIserialVersionUID\fRͤŪ뤳Ȥ򶯤ᤷޤ ϡ\fIserialVersionUID\fRͤ׻ǥեȤΥץѥμˤäưۤʤǽΤ륯饹ξܺ٤ˤƱƶ䤹η̡ľͽʤ\fIInvalidClassExceptions\fRȯǽ뤿ǤJavaѥμۤʤäƤ\fIserialVersionUID\fRͤΰݤˤˤϡľ󲽲ǽ饹\fIserialVersionUID\fRͤŪɬפޤ +直列化可能クラスが\fIserialVersionUID\fRという名前のフィールドを明示的に宣言しない場合、直列化ランタイム環境では、「Javaオブジェクト直列化仕様」で説明されているように、クラスの様々な側面に基づいて、クラスの\fIserialVersionUID\fRのデフォルト値を計算します。ただし、すべての直列化可能クラスが\fIserialVersionUID\fR値を明示的に宣言することを強くお薦めします。 これは、\fIserialVersionUID\fR値を計算するデフォルトのプロセスが、コンパイラの実装によって異なる可能性のあるクラスの詳細にきわめて影響を受けやすく、その結果、直列化復元中に予期しない\fIInvalidClassExceptions\fRが発生する可能性があるためです。Javaコンパイラの実装が異なっても\fIserialVersionUID\fR値の一貫性を確保にするには、直列化可能クラスが\fIserialVersionUID\fR値を明示的に宣言する必要があります。 .RE .PP static .RS 4 -staticλѤ˴ؤˤĤƷٹ𤷤ޤȤСΤ褦ˤʤޤ +staticの使用に関する問題について警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -961,7 +961,7 @@ class XLintStatic { .if n \{\ .RE .\} -ѥϼηٹޤ +コンパイラは次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -973,7 +973,7 @@ XLintStatic, instead of by an expression .if n \{\ .RE .\} -褹뤿ˡΤ褦\fIstatic\fR᥽å\fIm1\fRƤӽФȤǤޤ +この問題を解決するために、次のように\fIstatic\fRメソッド\fIm1\fRを呼び出すことができます。 .sp .if n \{\ .RS 4 @@ -984,12 +984,12 @@ XLintStatic\&.m1(); .if n \{\ .RE .\} -뤤ϡ\fIstatic\fRɤ᥽å\fIm1\fR뤳ȤǤޤ +あるいは、\fIstatic\fRキーワードをメソッド\fIm1\fRの宣言から削除することもできます。 .RE .PP try .RS 4 -try\-with\-resourcesʸޤࡢ\fItry\fR֥åλѤ˴ؤˤĤƷٹ𤷤ޤȤС\fItry\fR֥å줿꥽\fIac\fRѤʤˡʸФƷٹޤ +try\-with\-resources文を含む、\fItry\fRブロックの使用に関する問題について警告します。たとえば、\fItry\fRブロックで宣言されたリソース\fIac\fRが使用されないために、次の文に対して警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1004,7 +1004,7 @@ try ( AutoCloseable ac = getResource() ) { // do nothing} .PP unchecked .RS 4 -JavaͤǻꤵƤ̤Ѵٹξܺ٤򼨤ޤȤСΤ褦ˤʤޤ +Java言語仕様で指定されている未検査変換警告の詳細を示します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1016,19 +1016,19 @@ List<String> ls = l; // unchecked warning .if n \{\ .RE .\} -ξõˡ\fIArrayList<Number>\fR\fIList<String>\fRϡ줾\fIArrayList\fR\fIList\fRˤʤޤ +型の消去中に、型\fIArrayList<Number>\fRおよび\fIList<String>\fRは、それぞれ\fIArrayList\fRおよび\fIList\fRになります。 .sp -\fIls\fRޥɤˤϡѥ᡼줿\fIList<String>\fRꤵƤޤ\fIl\fRˤäƻȤ\fIList\fR\fIls\fR˳Ƥ줿硢ѥ̤ٹޤѥˡѥ餪JVMϡ\fIl\fR\fIList<String>\fR򻲾Ȥ뤫ɤȽ̤Ǥޤ󡣤ξ硢\fIl\fRϡ\fIList<String>\fR򻲾Ȥޤ󡣤η̡ҡױȯޤ +\fIls\fRコマンドには、パラメータ化された型\fIList<String>\fRが指定されています。\fIl\fRによって参照される\fIList\fRが\fIls\fRに割り当てられた場合、コンパイラは未検査警告を生成します。コンパイル時に、コンパイラおよびJVMは、\fIl\fRが\fIList<String>\fR型を参照するかどうかを判別できません。この場合、\fIl\fRは、\fIList<String>\fR型を参照しません。その結果、ヒープ汚染が発生します。 .sp -ҡױ֤ȯΤϡ\fIList\fR֥\fIl\fR -(static\fIList<Number>\fR)̤\fIList\fR֥\fIls\fR -(ۤʤstatic\fIList<String>\fR)ǤѥǤϤ򤤤ޤ˵ĤƤޤΤ򥵥ݡȤʤJava SEΥ꡼Ȥβ̸ߴݤ뤿ˡĤɬפޤõˤꡢ\fIList<Number>\fR\fIList<String>\fRϡξȤ\fIList\fRˤʤޤη̡ѥϥ֥\fIl\fR -(\fIList\fRȤraw)򥪥֥\fIls\fR뤳ȤĤޤ +ヒープ汚染状態が発生するのは、\fIList\fRオブジェクト\fIl\fR +(そのstatic型は\fIList<Number>\fR)が別の\fIList\fRオブジェクト\fIls\fR +(異なるstatic型\fIList<String>\fRを持つ)に代入される場合です。しかし、コンパイラではこの代入をいまだに許可しています。総称をサポートしないJava SEのリリースとの下位互換性を確保するために、この代入を許可する必要があります。型消去により、\fIList<Number>\fRおよび\fIList<String>\fRは、両方とも\fIList\fRになります。その結果、コンパイラはオブジェクト\fIl\fR +(\fIList\fRというraw型を持つ)をオブジェクト\fIls\fRに代入することを許可します。 .RE .PP varargs .RS 4 -Ѱ(\fIvarargs\fR)᥽åɡäݲǽޤΤλѤǤʤȤٹ𤷤ޤȤСΤ褦ˤʤޤ +可変引数(\fIvarargs\fR)メソッド、特に非具象化可能引数を含むものの使用が安全でないことを警告します。たとえば、次のようになります。 .sp .if n \{\ .RS 4 @@ -1045,10 +1045,10 @@ public class ArrayBuilder { .if n \{\ .RE .\} -\fB:\fR -ݲǽϡ󤬼¹Ի˴˻ԲǽʷǤ +\fB注意:\fR +非具象化可能型は、型情報が実行時に完全に使用不可能な型です。 .sp -ѥϡ᥽å\fIArrayBuilder\&.addToList\fR˴ؤ뼡ηٹޤ +コンパイラは、メソッド\fIArrayBuilder\&.addToList\fRの定義に関する次の警告を生成します。 .sp .if n \{\ .RS 4 @@ -1059,21 +1059,21 @@ warning: [varargs] Possible heap pollution from parameterized vararg type T .if n \{\ .RE .\} -ѥϡvarargs᥽åɤ򸡽Фȡ\fIvarargs\fRβѥ᡼ѴޤJavaץߥ󥰸Ǥϡѥ᡼줿κĤƤޤ󡣥᥽å\fIArrayBuilder\&.addToList\fRǤϡѥ\fIvarargs\fRβѥ᡼\fIT\&.\&.\&.\fRǤ򲾥ѥ᡼\fIT[]\fR()Ѵޤõˤꡢѥ\fIvarargs\fRβѥ᡼\fIObject[]\fRǤѴޤη̡ҡױȯǽޤ +コンパイラは、varargsメソッドを検出すると、\fIvarargs\fRの仮パラメータを配列に変換します。しかし、Javaプログラミング言語では、パラメータ化された型の配列の作成を許可していません。メソッド\fIArrayBuilder\&.addToList\fRでは、コンパイラは\fIvarargs\fRの仮パラメータ\fIT\&.\&.\&.\fR要素を仮パラメータ\fIT[]\fR要素(配列)に変換します。しかし、型消去により、コンパイラは\fIvarargs\fRの仮パラメータを\fIObject[]\fR要素に変換します。その結果、ヒープ汚染が発生する可能性があります。 .RE -.SH "ޥɥ饤ե" +.SH "コマンドライン引数ファイル" .PP -\fIjavac\fRޥɤûʷˤꤹ뤿ˡ\fIjavac\fRޥɤФ(\fI\-J\fRץ)ޤ1İʾΥեꤹ뤳ȤǤޤˤꡢɤΥڥ졼ƥ󥰡ƥǤ⡢ǤդĹ\fIjavac\fRޥɤǤޤ +\fIjavac\fRコマンドを短くしたり簡潔にしたりするために、\fIjavac\fRコマンドに対する引数(\fI\-J\fRオプションを除く)を含む1つ以上のファイルを指定することができます。これにより、どのオペレーティング・システム上でも、任意の長さの\fIjavac\fRコマンドを作成できます。 .PP -եˤϡ\fIjavac\fRΥץȥե̾ͳȤ߹礻ƵҤǤޤեΰϡޤϲʸǶڤ뤳ȤǤޤե̾ޤ줿򤬤硢ե̾ΤŰǰϤߤޤ +引数ファイルには、\fIjavac\fRのオプションとソース・ファイル名を自由に組み合せて記述できます。ファイル内の引数は、空白または改行文字で区切ることができます。ファイル名に埋め込まれた空白がある場合、ファイル名全体を二重引用符で囲みます。 .PP -եΥե̾ϡեΰ֤ǤϤʤߤΥǥ쥯ȥŪȤʤޤΥꥹȤǤϡ磻ɥ(*)ϻѤǤޤ(ȤС\fI*\&.java\fRȤϻǤޤ)åȥޡ(@)ѤեκƵŪʲϥݡȤƤޤ󡣤ޤ\fI\-J\fRץ⥵ݡȤƤޤ󡣤ΥץϵưġϤޤưġǤϰե򥵥ݡȤƤʤǤ +引数ファイル内のファイル名は、引数ファイルの位置ではなく、現在のディレクトリに相対的となります。これらのリストでは、ワイルドカード(*)は使用できません(たとえば、\fI*\&.java\fRとは指定できません)。アットマーク(@)を使用したファイルの再帰的な解釈はサポートされていません。また、\fI\-J\fRオプションもサポートされていません。このオプションは起動ツールに渡されますが、起動ツールでは引数ファイルをサポートしていないからです。 .PP -\fIjavac\fRޥɤ¹ԤȤˡưեΥѥ̾Ƭ˥åȥޡ(@)ʸդϤޤ\fIjavac\fRޥɤϡåȥޡ(@)ǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjavac\fRコマンドを実行するときに、各引数ファイルのパスと名前の先頭にアットマーク(@)文字を付けて渡します。\fIjavac\fRコマンドは、アットマーク(@)で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .PP -\fBExample 1\fR, ñΰե +\fBExample 1\fR, 単一の引数ファイル .RS 4 -\fIargfile\fRȤ̾ñΰեѤơ٤Ƥ\fIjavac\fRǼϡΤ褦˻ꤷޤ +\fIargfile\fRという名前の単一の引数ファイルを使用して、すべての\fIjavac\fR引数を格納する場合は、次のように指定します。 .sp .if n \{\ .RS 4 @@ -1084,14 +1084,14 @@ javac @argfile .if n \{\ .RE .\} -ΰեˤϡ2ǼƤξΥեƤ뤳ȤǤޤ +この引数ファイルには、例2で示されている両方のファイルの内容を入れることができます。 .RE .PP -\fBExample 2\fR, 2Ĥΰե +\fBExample 2\fR, 2つの引数ファイル .RS 4 -\fIjavac\fRץѤȥե̾Ѥˡ2ĤΰեǤޤΥꥹȤˤϡԤη³ʸϤޤ +\fIjavac\fRオプション用とソース・ファイル名用に、2つの引数ファイルを作成できます。次のリストには、行の継続文字はありません。 .sp -ޤoptionsȤ̾Υեޤ +次を含むoptionsという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -1113,7 +1113,7 @@ javac @argfile .if n \{\ .RE .\} -ޤclassesȤ̾Υեޤ +次を含むclassesという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -1126,7 +1126,7 @@ MyClass3\&.java .if n \{\ .RE .\} -줫顢Τ褦\fIjavac\fRޥɤ¹Ԥޤ +それから、次のように\fIjavac\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -1139,9 +1139,9 @@ javac @options @classes .\} .RE .PP -\fBExample 3\fR, ѥѤե +\fBExample 3\fR, パスを使用した引数ファイル .RS 4 -եϥѥǤޤեΤ٤ƤΥե̾ϡ(\fIpath1\fR\fIpath2\fRǤϤʤ)Τ褦˸ߤκȥǥ쥯ȥŪȤʤޤ +引数ファイルはパスを指定できますが、ファイル内のすべてのファイル名は、(\fIpath1\fRや\fIpath2\fRではなく)次のように現在の作業ディレクトリに相対的となります。 .sp .if n \{\ .RS 4 @@ -1153,46 +1153,46 @@ javac @path1/options @path2/classes .RE .\} .RE -.SH "" +.SH "注釈処理" .PP -\fIjavac\fRޥɤľܥݡȤƤ뤿ᡢΩޥɤǤ\fIapt\fRѤɬפʤʤޤ +\fIjavac\fRコマンドが注釈処理を直接サポートしているため、独立した注釈処理コマンドである\fIapt\fRを使用する必要がなくなりました。 .PP -ץåAPIϡ\fIjavax\&.annotation\&.processing\fR\fIjavax\&.lang\&.model\fRѥåȤΥ֥ѥåƤޤ -.SS "Ԥˡ" +注釈プロセッサのAPIは、\fIjavax\&.annotation\&.processing\fRおよび\fIjavax\&.lang\&.model\fRパッケージとそのサブパッケージ内に定義されています。 +.SS "注釈処理を行う方法" .PP -\fI\-proc:none\fRץˤä̵ʤ¤ꡢѥϻѲǽʤ٤Ƥץå򸡺ޤѥϡ\fI\-processorpath\fRץѤƻǤޤѥꤷʤ硢桼饹ѥѤޤץåθϡѥ\fIMETA\-INF/services/javax\&.annotation\&.processing\fR\&.ProcessorȤ̾ΥӥץХե˴ŤƹԤޤΤ褦ʥեˤϡѤ뤹٤Ƥץå̾1Ԥ1ĤĴޤƤޤ̤ˡȤơ\fI\-processor\fRץѤƥץåŪ˻ꤹ뤳ȤǤޤ +\fI\-proc:none\fRオプションによって注釈処理が無効化されない限り、コンパイラは使用可能なすべての注釈プロセッサを検索します。検索パスは、\fI\-processorpath\fRオプションを使用して指定できます。パスを指定しない場合、ユーザー・クラス・パスが使用されます。プロセッサの検索は、検索パス上の\fIMETA\-INF/services/javax\&.annotation\&.processing\fR\&.Processorという名前のサービス・プロバイダ構成ファイルに基づいて行われます。このようなファイルには、使用するすべての注釈プロセッサの名前を、1行に1つずつ含めてください。また、別の方法として、\fI\-processor\fRオプションを使用してプロセッサを明示的に指定することもできます。 .PP -ѥϡޥɥ饤Υե䥯饹뤳ȤǡɤΤ褦᤬¸ߤƤ뤫ǧȡץåФ礻ԤΥץåɤǤΤǧޤפΤĤä硢ΥץåƤӽФޤƥץåϡȤ׵Ǥޤξ硢Ф̤Υץå򸫤ĤߤϹԤޤ󡣤٤Ƥ᤬׵ᤵȡѥϤʾץåθԤޤ +コンパイラは、コマンドラインのソース・ファイルやクラスを走査することで、どのような注釈が存在しているかを確認し終わると、プロセッサに対して問合せを行い、それらのプロセッサがどの注釈を処理できるのかを確認します。一致するものが見つかった場合、そのプロセッサが呼び出されます。各プロセッサは、自身が処理する注釈を要求できます。その場合、それらの注釈に対する別のプロセッサを見つける試みは行われません。すべての注釈が要求されると、コンパイラはそれ以上プロセッサの検索を行いません。 .PP -줫Υץåˤäƿե뤬ȡ2ܤΥ饦ɤϤޤ줿٤ƤΥե뤬󤵤졢Ʊͤ᤬ޤΥ饦ɤǸƤӽФ줿ץåϤ٤ơ³ΤɤΥ饦ɤǤƤӽФޤ줬ե뤬ʤʤޤ³ޤ +いずれかのプロセッサによって新しいソース・ファイルが生成されると、注釈処理の2回目のラウンドが開始されます。新しく生成されたすべてのソース・ファイルがスキャンされ、前回と同様に注釈が処理されます。以前のラウンドで呼び出されたプロセッサはすべて、後続のどのラウンドでも呼び出されます。これが、新しいソース・ファイルが生成されなくなるまで続きます。 .PP -饦ɤǿե뤬ʤä硢ץå1Τ߸ƤӽФ졢Ĥν¹Ԥ뵡ͿޤǸˡ\fI\-proc:only\fRץ󤬻ѤʤꡢѥϡΥե줿٤ƤΥե򥳥ѥ뤷ޤ -.SS "Ū˥ɤ줿ե" +あるラウンドで新しいソース・ファイルが生成されなかった場合、注釈プロセッサがあと1回のみ呼び出され、残りの処理を実行する機会が与えられます。最後に、\fI\-proc:only\fRオプションが使用されないかぎり、コンパイラは、元のソース・ファイルと生成されたすべてのソース・ファイルをコンパイルします。 +.SS "暗黙的にロードされたソース・ファイル" .PP -ѥϡϢΥե򥳥ѥ뤹ݤˡ̤ΥեŪ˥ɤ뤳Ȥɬפʾ礬ޤθ򻲾ȤƤΤ褦ʥեϡǤоݤˤʤޤ󡣥ǥեȤǤϡ¹Ԥ졢İŪ˥ɤ줿ǤդΥե뤬ѥ뤵줿硢ѥϷٹȯԤޤ\fI\-implicit\fRץǤϡٹˡ󶡤ޤ -.SH "θ" +コンパイラは、一連のソース・ファイルをコンパイルする際に、別のソース・ファイルを暗黙的にロードすることが必要な場合があります。型の検索を参照してください。そのようなファイルは、現時点では注釈処理の対象になりません。デフォルトでは、注釈処理が実行され、かつ暗黙的にロードされた任意のソース・ファイルがコンパイルされた場合、コンパイラは警告を発行します。\fI\-implicit\fRオプションでは、警告を抑制する方法が提供されます。 +.SH "型の検索" .PP -ե򥳥ѥ뤹뤿ˡѥ̾˴ؤɬפȤޤηϥޥɥ饤ǻꤷեˤޤ󡣥ѥϡեǻѤƤ륯饹ޤϥ󥿥եĥƤ륯饹ޤϥ󥿥ե뤤ϼƤ륯饹ޤϥ󥿥ե٤ƤˤĤơξɬפȤޤˤϡեŪˤϸڤƤʤƤ⡢Ѿ̤ƾ󶡤륯饹ȥ󥿥եޤޤޤ +ソース・ファイルをコンパイルするために、コンパイラは通常、型に関する情報を必要としますが、その型の定義はコマンドラインで指定したソース・ファイルにありません。コンパイラは、ソース・ファイルで使用されているクラスまたはインタフェース、拡張されているクラスまたはインタフェース、あるいは実装されているクラスまたはインタフェースすべてについて、型の情報を必要とします。これには、ソース・ファイルで明示的には言及されていなくても、継承を通じて情報を提供するクラスとインタフェースも含まれます。 .PP -ȤС֥饹\fIjava\&.applet\&.Applet\fRȡ\fIץå\fRΥ饹(\fIjava\&.awt\&.Panel\fR\fIjava\&.awt\&.Container\fR\fIjava\&.awt\&.Component\fR\fIjava\&.lang\&.Object\fR)ѤƤ뤳Ȥˤʤޤ +たとえば、サブクラス\fIjava\&.applet\&.Applet\fRを作成すると、\fIアプレット\fRの祖先のクラス(\fIjava\&.awt\&.Panel\fR、\fIjava\&.awt\&.Container\fR、\fIjava\&.awt\&.Component\fRおよび\fIjava\&.lang\&.Object\fR)を使用していることにもなります。 .PP -ѥϡξɬפˤʤȡηƤ륽եޤϥ饹ե򸡺ޤޤ֡ȥȥåס饹ȳĥǽ饹򸡺³ƥ桼饹ѥ(ǥեȤǤϸߤΥǥ쥯ȥ)򸡺ޤ桼饹ѥϡ\fICLASSPATH\fRĶѿꤷ뤫ޤ\fI\-classpath\fRץѤޤ +コンパイラは、型の情報が必要になると、その型を定義しているソース・ファイルまたはクラス・ファイルを検索します。まず、ブートストラップ・クラスと拡張機能クラスを検索し、続いてユーザー・クラス・パス(デフォルトでは現在のディレクトリ)を検索します。ユーザー・クラス・パスは、\fICLASSPATH\fR環境変数を設定して定義するか、または\fI\-classpath\fRオプションを使用して定義します。 .PP -\fI\-sourcepath\fRץꤵƤ硢ѥϡꤵ줿ѥ饽ե򸡺ޤʳξ硢ѥϡ桼饹ѥ饯饹եȥեξ򸡺ޤ +\fI\-sourcepath\fRオプションが設定されている場合、コンパイラは、指定されたパスからソース・ファイルを検索します。それ以外の場合、コンパイラは、ユーザー・クラス・パスからクラス・ファイルとソース・ファイルの両方を検索します。 .PP -\fI\-bootclasspath\fRץ󤪤\fI\-extdirs\fRץѤơ̤Υ֡ȥȥåס饹ĥǽ饹Ǥޤѥ롦ץ򻲾ȤƤ +\fI\-bootclasspath\fRオプションおよび\fI\-extdirs\fRオプションを使用して、別のブートストラップ・クラスや拡張機能クラスを指定できます。クロスコンパイル・オプションを参照してください。 .PP -θȤ̤ϡ饹ե롢ե롢ޤϤξǤ礬ޤξĤä硢ΤɤѤ뤫\fI\-Xprefer\fRץǥѥ˻ؼǤޤ\fInewer\fRꤵ줿硢ѥ2ĤΥեΤѤޤ\fIsource\fRꤵ줿硢ѥϥեѤޤǥեȤ\fInewer\fRǤ +型の検索に成功したときに得られる結果は、クラス・ファイル、ソース・ファイル、またはその両方である場合があります。両方が見つかった場合、そのどちらを使用するかを\fI\-Xprefer\fRオプションでコンパイラに指示できます。\fInewer\fRが指定された場合、コンパイラは2つのファイルのうち新しい方を使用します。\fIsource\fRが指定された場合、コンパイラはソース・ファイルを使用します。デフォルトは\fInewer\fRです。 .PP -θΤˤäơޤ\fI\-Xprefer\fRץꤵ줿̤ȤɬפʷΥե뤬Ĥä硢ѥϤΥեɤ߼ꡢɬפʾޤǥեȤǤϡѥϥեΥѥԤޤ\fI\-implicit\fRץѤƤưǤޤ\fInone\fRꤵ줿硢եФƥ饹եޤ\fIclass\fRꤵ줿硢եФƥ饹ե뤬ޤ +型の検索自体によって、または\fI\-Xprefer\fRオプションが設定された結果として必要な型のソース・ファイルが見つかった場合、コンパイラはそのソース・ファイルを読み取り、必要な情報を取得します。デフォルトでは、コンパイラはソース・ファイルのコンパイルも行います。\fI\-implicit\fRオプションを使用してその動作を指定できます。\fInone\fRが指定された場合、ソース・ファイルに対してクラス・ファイルは生成されません。\fIclass\fRが指定された場合、ソース・ファイルに対してクラス・ファイルが生成されます。 .PP -ѥϡλޤǡ뷿ɬǧʤ礬ޤ󤬥ե˸Ĥꡢ\fI\-implicit\fRץ󤬻ꤵƤʤ硢ѥˤäơΥե뤬оݤȤʤ餺˥ѥ뤵뤳Ȥٹ𤵤ޤηٹ̵ˤˤϡ(Υե뤬оݤȤʤ褦)Υե򥳥ޥɥ饤˻ꤹ뤫뤤ϤΤ褦ʥեФƥ饹եɬפ뤫ɤ\fI\-implicit\fRץѤƻꤷޤ -.SH "ץޥƥå󥿥ե" +コンパイラは、注釈処理が完了するまで、ある型情報の必要性を認識しない場合があります。型情報がソース・ファイル内に見つかり、かつ\fI\-implicit\fRオプションが指定されていない場合、コンパイラによって、そのファイルが注釈処理の対象とならずにコンパイルされることが警告されます。この警告を無効にするには、(そのファイルが注釈処理の対象となるように)そのファイルをコマンドラインに指定するか、あるいはそのようなソース・ファイルに対してクラス・ファイルを生成する必要があるかどうかを\fI\-implicit\fRオプションを使用して指定します。 +.SH "プログラマティック・インタフェース" .PP -\fIjavac\fRޥɤϡ\fIjavax\&.tools\fRѥåΥ饹ȥ󥿥եˤä뿷Java Compiler API򥵥ݡȤޤ -.SS "" +\fIjavac\fRコマンドは、\fIjavax\&.tools\fRパッケージ内のクラスとインタフェースによって定義される新しいJava Compiler APIをサポートします。 +.SS "例" .PP -ޥɥ饤ꤹ褦˥ѥ뤹ˤϡιʸѤޤ +コマンドライン引数を指定するようにコンパイルするには、次の構文を使用します。 .sp .if n \{\ .RS 4 @@ -1205,15 +1205,15 @@ JavaCompiler javac = ToolProvider\&.getSystemJavaCompiler(); .RE .\} .PP -ǤϡǤɸϥȥ꡼˽񤭹ߡޥɥ饤󤫤θƽФ\fIjavac\fRꤹ뽪λɤ֤ޤ +例では、診断を標準出力ストリームに書き込み、コマンドラインからの呼出し時に\fIjavac\fRが指定する終了コードを返します。 .PP -\fIjavax\&.tools\&.JavaCompiler\fR󥿥ե¾Υ᥽åɤѤȡǤνեɼ긵/ʤɤԤȤǤޤ -.SS "켰Υ󥿥ե" +\fIjavax\&.tools\&.JavaCompiler\fRインタフェースの他のメソッドを使用すると、診断の処理やファイルの読取り元/書込み先の制御などを行うことができます。 +.SS "旧式のインタフェース" .PP -\fB:\fR -APIϡ̸ߴΤˤΤݻƤޤ٤ƤοɤϡJava Compiler APIѤɬפޤ +\fB注意:\fR +このAPIは、下位互換性のためにのみ保持されています。すべての新しいコードは、新しいJava Compiler APIを使用する必要があります。 .PP -Τ褦ˡ\fIcom\&.sun\&.tools\&.javac\&.Main\fR饹ˤϡץफ饳ѥƤӽФstatic᥽åɤ2ѰդƤޤ +次のように、\fIcom\&.sun\&.tools\&.javac\&.Main\fRクラスには、プログラムからコンパイラを呼び出すためのstaticメソッドが2つ用意されています。 .sp .if n \{\ .RS 4 @@ -1226,21 +1226,21 @@ public static int compile(String[] args, PrintWriter out); .RE .\} .PP -\fIargs\fRѥ᡼ϡ̾拾ѥϤǤդΥޥɥ饤ɽƤޤ +\fIargs\fRパラメータは、通常コンパイラに渡される任意のコマンドライン引数を表しています。 .PP -\fIout\fRѥ᡼ϡѥοǽϤΰ򼨤ޤ +\fIout\fRパラメータは、コンパイラの診断出力の宛先を示します。 .PP -\fIreturn\fRͤϡ\fIjavac\fR\fIexit\fRͤƱǤ +\fIreturn\fR値は、\fIjavac\fRの\fIexit\fR値と同じです。 .PP -\fB:\fR -̾\fIcom\&.sun\&.tools\&.javac\fRǻϤޤѥå(\fIcom\&.sun\&.tools\&.javac\fRΥ֥ѥå)ǸФ¾Τ٤ƤΥ饹ӥ᥽åɤϡѤǤꡢĤǤѹǽޤ -.SH "" +\fB注意:\fR +名前が\fIcom\&.sun\&.tools\&.javac\fRで始まるパッケージ(\fIcom\&.sun\&.tools\&.javac\fRのサブパッケージ)で検出される他のすべてのクラスおよびメソッドは、完全に内部用であり、いつでも変更される可能性があります。 +.SH "例" .PP -\fBExample 1\fR, ñʥץΥѥ +\fBExample 1\fR, 簡単なプログラムのコンパイル .RS 4 -Ǥϡgreetingsǥ쥯ȥ\fIHello\&.java\fRե򥳥ѥ뤹ˡ򼨤Ƥޤ\fIHello\&.java\fR줿饹ϡ\fIgreetings\&.Hello\fRȸƤФޤgreetingsǥ쥯ȥϡեȥ饹եξѥåǥ쥯ȥǡߤΥǥ쥯ȥΤˤޤˤꡢǥեȤΥ桼饹ѥѤǤ褦ˤʤޤޤ\fI\-d\fRץѤ̤νǥ쥯ȥꤹɬפ⤢ޤ +この例では、greetingsディレクトリで\fIHello\&.java\fRソース・ファイルをコンパイルする方法を示しています。\fIHello\&.java\fRで定義されたクラスは、\fIgreetings\&.Hello\fRと呼ばれます。greetingsディレクトリは、ソース・ファイルとクラス・ファイルの両方があるパッケージ・ディレクトリで、現在のディレクトリのすぐ下にあります。これにより、デフォルトのユーザー・クラス・パスを使用できるようになります。また、\fI\-d\fRオプションを使用して別の出力先ディレクトリを指定する必要もありません。 .sp -\fIHello\&.java\fRΥɤϼΤȤǤ +\fIHello\&.java\fR内のソース・コードは次のとおりです。 .sp .if n \{\ .RS 4 @@ -1259,7 +1259,7 @@ public class Hello { .if n \{\ .RE .\} -greetings\&.HelloΥѥ: +greetings\&.Helloのコンパイル: .sp .if n \{\ .RS 4 @@ -1270,7 +1270,7 @@ javac greetings/Hello\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hello\fRμ¹: +\fIgreetings\&.Hello\fRの実行: .sp .if n \{\ .RS 4 @@ -1286,9 +1286,9 @@ Hello Everyone .\} .RE .PP -\fBExample 2\fR, ʣΥեΥѥ +\fBExample 2\fR, 複数のソース・ファイルのコンパイル .RS 4 -Ǥϡ\fIgreetings\fRѥåΥե\fIAloha\&.java\fR\fIGutenTag\&.java\fR\fIHello\&.java\fR\fIHi\&.java\fR򥳥ѥ뤷ޤ +この例では、\fIgreetings\fRパッケージのソース・ファイル\fIAloha\&.java\fR、\fIGutenTag\&.java\fR、\fIHello\&.java\fRおよび\fIHi\&.java\fRをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1304,9 +1304,9 @@ Aloha\&.java GutenTag\&.java Hello\&.java Hi\&.java .\} .RE .PP -\fBExample 3\fR, 桼饹ѥλ +\fBExample 3\fR, ユーザー・クラス・パスの指定 .RS 4 -ҤΥեΤ1ĤѹˡΥեƥѥ뤷ޤ +前述の例のソース・ファイルのうち1つを変更した後に、そのファイルを再コンパイルします。 .sp .if n \{\ .RS 4 @@ -1319,7 +1319,7 @@ javac greetings/Hi\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hi\fR\fIgreetings\fRѥå¾Υ饹򻲾ȤƤ뤿ᡢѥϤ¾Υ饹õɬפޤǥեȤΥ桼饹ѥϥѥåǥ쥯ȥޤǥ쥯ȥǤ뤿ᡢҤưޤߤΥǥ쥯ȥ򵤤ˤˤΥեƥѥ뤹硢\fICLASSPATH\fRꤷơ桼饹ѥΥǥ쥯ȥɲäޤǤϡ\fI\-classpath\fRץѤƤޤ +\fIgreetings\&.Hi\fRは\fIgreetings\fRパッケージ内の他のクラスを参照しているため、コンパイラはこれらの他のクラスを探す必要があります。デフォルトのユーザー・クラス・パスはパッケージ・ディレクトリを含むディレクトリであるため、前述の例は動作します。現在のディレクトリを気にせずにこのファイルを再コンパイルする場合、\fICLASSPATH\fRを設定して、ユーザー・クラス・パスに例のディレクトリを追加します。この例では、\fI\-classpath\fRオプションを使用しています。 .sp .if n \{\ .RS 4 @@ -1330,7 +1330,7 @@ javac \-classpath /examples /examples/greetings/Hi\&.java .if n \{\ .RE .\} -\fIgreetings\&.Hi\fRѹƥХʡ桼ƥƥѤ褦ˤ硢 Υ桼ƥƥ桼饹ѥ̤ƥǤ褦ˤʤäƤɬפޤ +\fIgreetings\&.Hi\fRを変更してバナー・ユーティリティを使用するようにした場合、 そのユーティリティもユーザー・クラス・パスを通じてアクセスできるようになっている必要があります。 .sp .if n \{\ .RS 4 @@ -1342,7 +1342,7 @@ javac \-classpath /examples:/lib/Banners\&.jar \e .if n \{\ .RE .\} -\fIgreetings\fRѥåǥ饹¹Ԥˤϡץ\fIgreetings\fRѥå\fIgreetings\fR饹Ѥ륯饹˥ɬפޤ +\fIgreetings\fRパッケージでクラスを実行するには、プログラムは\fIgreetings\fRパッケージ、および\fIgreetings\fRクラスが使用するクラスにアクセスする必要があります。 .sp .if n \{\ .RS 4 @@ -1355,9 +1355,9 @@ java \-classpath /examples:/lib/Banners\&.jar greetings\&.Hi .\} .RE .PP -\fBExample 4\fR, եȥ饹եʬΥ +\fBExample 4\fR, ソース・ファイルとクラス・ファイルの分離 .RS 4 -Ǥϡ\fIjavac\fRѤơJVM 1\&.6Ǽ¹Ԥ륳ɤ򥳥ѥ뤷ޤ +次の例では、\fIjavac\fRを使用して、JVM 1\&.6上で実行するコードをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1369,9 +1369,9 @@ javac \-source 1\&.6 \-target 1\&.6 \-bootclasspath jdk1\&.6\&.0/lib/rt\&.jar \e .if n \{\ .RE .\} -\fI\-source 1\&.6\fRץˤꡢ\fIOldCode\&.java\fRΥѥˤϥ꡼1\&.6(ޤ6)Javaץߥ󥰸줬Ѥޤ\fI\-target 1\&.6\fRץˤꡢJVM 1\&.6ȸߴΤ륯饹ե뤬ޤۤȤɤξ硢\fI\-target\fRץͤ\fI\-source\fRץͤˤʤޤǤϡ\fI\-target\fRץάǤޤ +\fI\-source 1\&.6\fRオプションにより、\fIOldCode\&.java\fRのコンパイルにはリリース1\&.6(または6)のJavaプログラミング言語が使用されます。\fI\-target 1\&.6\fRオプションにより、JVM 1\&.6と互換性のあるクラス・ファイルが生成されます。ほとんどの場合、\fI\-target\fRオプションの値は\fI\-source\fRオプションの値になります。この例では、\fI\-target\fRオプションを省略できます。 .sp -\fI\-bootclasspath\fRץѤơŬڤʥСΥ֡ȥȥåס饹(\fIrt\&.jar\fR饤֥)ꤹɬפޤꤷʤϡѥˤäƼηٹޤ +\fI\-bootclasspath\fRオプションを使用して、適切なバージョンのブートストラップ・クラス(\fIrt\&.jar\fRライブラリ)を指定する必要があります。指定しない場合は、コンパイラによって次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1384,12 +1384,12 @@ warning: [options] bootstrap class path not set in conjunction with .if n \{\ .RE .\} -ŬڤʥСΥ֡ȥȥåס饹ꤷʤ硢ѥϸŤ(ǤϡС1\&.6Javaץߥ󥰸)򿷤֡ȥȥåס饹Ȥ߹礻ƻѤޤη̡¸ߤʤ᥽åɤؤλȤޤޤƤ뤳Ȥ뤿ᡢ饹ե뤬Ťץåȥե(ξJava SE 6)ưʤǽޤ +適切なバージョンのブートストラップ・クラスを指定しない場合、コンパイラは古い言語仕様(この例では、バージョン1\&.6のJavaプログラミング言語)を新しいブートストラップ・クラスと組み合せて使用します。その結果、存在しないメソッドへの参照が含まれていることがあるため、クラス・ファイルが古いプラットフォーム(この場合はJava SE 6)で動作しない可能性があります。 .RE .PP -\fBExample 5\fR, ѥ +\fBExample 5\fR, クロス・コンパイル .RS 4 -Ǥϡ\fIjavac\fRѤơJVM 1\&.6Ǽ¹Ԥ륳ɤ򥳥ѥ뤷ޤ +この例では、\fIjavac\fRを使用して、JVM 1\&.6上で実行するコードをコンパイルします。 .sp .if n \{\ .RS 4 @@ -1401,9 +1401,9 @@ javac \-source 1\&.6 \-target 1\&.6 \-bootclasspath jdk1\&.6\&.0/lib/rt\&.jar \e .if n \{\ .RE .\} -The\fI \-source 1\&.6\fRץˤꡢOldCode\&.javaΥѥˤϥ꡼1\&.6(ޤ6)Javaץߥ󥰸줬Ѥޤ\fI\-target 1\&.6\fRץˤꡢJVM 1\&.6ȸߴΤ륯饹ե뤬ޤۤȤɤξ硢\fI\-target\fRͤ\fI\-source\fRͤˤʤޤǤϡ\fI\-target\fRץϾάޤ +The\fI \-source 1\&.6\fRオプションにより、OldCode\&.javaのコンパイルにはリリース1\&.6(または6)のJavaプログラミング言語が使用されます。\fI\-target 1\&.6\fRオプションにより、JVM 1\&.6と互換性のあるクラス・ファイルが生成されます。ほとんどの場合、\fI\-target\fRの値は\fI\-source\fRの値になります。この例では、\fI\-target\fRオプションは省略されます。 .sp -\fI\-bootclasspath\fRץѤơŬڤʥСΥ֡ȥȥåס饹(\fIrt\&.jar\fR饤֥)ꤹɬפޤꤷʤϡѥˤäƼηٹޤ +\fI\-bootclasspath\fRオプションを使用して、適切なバージョンのブートストラップ・クラス(\fIrt\&.jar\fRライブラリ)を指定する必要があります。指定しない場合は、コンパイラによって次の警告が生成されます。 .sp .if n \{\ .RS 4 @@ -1415,9 +1415,9 @@ warning: [options] bootstrap class path not set in conjunction with \-source 1\& .if n \{\ .RE .\} -ŬڤʥСΥ֡ȥȥåס饹ꤷʤ硢ѥϸŤͤ򿷤֡ȥȥåס饹Ȥ߹礻ƻѤޤȹ礻ϡ¸ߤʤ᥽åɤؤλȤޤޤƤ뤳Ȥ뤿ᡢ饹ե뤬Ťץåȥե(ξJava SE 6)ưʤǽޤǤϡѥJavaץߥ󥰸Υ꡼1\&.6Ѥޤ +適切なバージョンのブートストラップ・クラスを指定しない場合、コンパイラは古い言語仕様を新しいブートストラップ・クラスと組み合せて使用します。この組合せは、存在しないメソッドへの参照が含まれていることがあるため、クラス・ファイルが古いプラットフォーム(この場合はJava SE 6)で動作しない可能性があります。この例では、コンパイラはJavaプログラミング言語のリリース1\&.6を使用します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 b/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 index 74cdf8f655b..5c1e8683918 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javadoc .\" Language: English -.\" Date: 2011ǯ510 -.\" SectDesc: ܥġ +.\" Date: 2011年5月10日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javadoc" "1" "2011ǯ510" "JDK 8" "ܥġ" +.TH "javadoc" "1" "2011年5月10日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javadoc \- Javaե뤫顢APIɥȤHTMLڡޤ -.SH "" +javadoc \- Javaソース・ファイルから、APIドキュメントのHTMLページを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,33 +64,33 @@ javadoc \- Java .PP \fIpackages\fR .RS 4 -\fIjava\&.lang java\&.lang\&.reflect java\&.awt\fRʤɡǶڤäƥɥȲѥå֥̾ѥåɥȲϡ\fI\-subpackages\fRץѤƥѥåꤷޤ +\fIjava\&.lang java\&.lang\&.reflect java\&.awt\fRなど、空白で区切ってドキュメント化するパッケージの名前。サブパッケージもドキュメント化する場合は、\fI\-subpackages\fRオプションを使用してパッケージを指定します。 .sp -ǥեȤǤϡ\fIjavadoc\fRϡߤΥǥ쥯ȥꤪӥ֥ǥ쥯ȥǻꤵ줿ѥåõޤ\fI\-sourcepath\fRץѤơѥåõǥ쥯ȥΥꥹȤꤷޤ +デフォルトでは、\fIjavadoc\fRは、現在のディレクトリおよびサブディレクトリで指定されたパッケージを探します。\fI\-sourcepath\fRオプションを使用して、パッケージを探すディレクトリのリストを指定します。 .RE .PP \fIsource\-files\fR .RS 4 -\fIClass\&.java Object\&.java Button\&.java\fRΤ褦˶ǶڤäɥȲJavaե̾ǥեȤǤϡ\fIjavadoc\fRϡߤΥǥ쥯ȥǻꤵ줿饹õޤ\fI/home/src/java/awt/Graphics*\&.java\fRΤ褦ˡ饹եΥեѥꤷ磻ɥʸѤǤޤߤΥǥ쥯ȥ꤫ХѥǤޤ +\fIClass\&.java Object\&.java Button\&.java\fRのように空白で区切った、ドキュメント化するJavaソース・ファイルの名前。デフォルトでは、\fIjavadoc\fRは、現在のディレクトリで指定されたクラスを探します。ただし、\fI/home/src/java/awt/Graphics*\&.java\fRのように、クラス・ファイルのフルパスを指定し、ワイルドカード文字を使用できます。現在のディレクトリからの相対パスも指定できます。 .RE .PP \fIoptions\fR .RS 4 -Ƕڤ줿ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +空白で区切られたコマンドライン・オプション。オプションを参照してください。 .RE .PP \fI@argfiles\fR .RS 4 -\fIjavadoc\fRޥɡץ󡢥ѥå̾ӥե̾ΥꥹȤǤդνǴޤե̾ +\fIjavadoc\fRコマンド・オプション、パッケージ名およびソース・ファイル名のリストを任意の順序で含むファイルの名前。 .RE -.SH "" +.SH "説明" .PP -\fIjavadoc\fRޥɤϡϢJavaեˤӥɥơ󡦥ȤϤǥեȤǤϡpublic饹protected饹ͥȤ줿饹(ƿ̾饹Ͻ)󥿥ե󥹥ȥ饯᥽åɡӥեɤˤĤƵҤϢHTMLڡޤ\fIjavadoc\fRޥɤϡAPIɥȤ䡢ϢΥեμɥȤ˻ѤǤޤ +\fIjavadoc\fRコマンドは、一連のJavaソース・ファイルにある宣言およびドキュメンテーション・コメントを解析し、デフォルトでは、publicクラス、protectedクラス、ネストされたクラス(匿名の内部クラスは除く)、インタフェース、コンストラクタ、メソッド、およびフィールドについて記述した一連のHTMLページを生成します。\fIjavadoc\fRコマンドは、APIドキュメントの生成や、一連のソース・ファイルの実装ドキュメントの生成に使用できます。 .PP -\fIjavadoc\fRޥɤϡѥåΡġΥե롢ޤϤξФƼ¹ԤǤޤѥåΤΥɥȲԤˤϡ\fI\-subpackages\fRץѤƥǥ쥯ȥꤪӤΥ֥ǥ쥯ȥƵŪˤɤ뤫ѥå̾ŪʥꥹȤϤޤġΥեɥȲˤϡJavaե̾ΥꥹȤϤޤñ򻲾ȤƤ -.SS "եν" +\fIjavadoc\fRコマンドは、パッケージ全体、個々のソース・ファイル、またはその両方に対して実行できます。パッケージ全体のドキュメント化を行うには、\fI\-subpackages\fRオプションを使用してディレクトリおよびそのサブディレクトリを再帰的にたどるか、パッケージ名の明示的なリストを渡します。個々のソース・ファイルをドキュメント化するには、Javaソース・ファイル名のリストを渡します。簡単な例を参照してください。 +.SS "ソース・ファイルの処理" .PP -\fIjavadoc\fRޥɤϡǽե롢ӥեƤ뤽¾ΥեޤġΥե̾Ϥ\fIjavadoc\fR¹Ԥ硢ɤΥե뤫Τ˻Ǥޤ¿γȯԤϤˡǤϺȤޤ󡣥ѥå̾ϤۤñǤե̾Ū˻ꤷʤƤ⡢\fIjavadoc\fRޥɤ3ĤˡǼ¹ԤǤޤѥå̾Ϥ\fI\-subpackages\fRץѤ뤫ޤϥե̾˥磻ɥɤѤ뤳ȤǤޤξ硢\fIjavadoc\fRޥɤեνԤΤϡΥե뤬Τ٤Ƥ׷ΤߤǤ +\fIjavadoc\fRコマンドは、ソースで終わるファイル、およびソース・ファイルで説明しているその他のファイルを処理します。個々のソース・ファイル名を渡して\fIjavadoc\fRを実行する場合、どのソース・ファイルを処理するかを正確に指定できます。ただし、多くの開発者はこの方法では作業しません。パッケージ名を渡すほうが簡単だからです。ソース・ファイル名を明示的に指定しなくても、\fIjavadoc\fRコマンドは3つの方法で実行できます。パッケージ名を渡し、\fI\-subpackages\fRオプションを使用するか、またはソース・ファイル名にワイルドカードを使用することができます。これらの場合、\fIjavadoc\fRコマンドがソース・ファイルの処理を行うのは、そのファイルが次のすべての要件を満たす場合のみです。 .sp .RS 4 .ie n \{\ @@ -100,7 +100,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ե̾Ƭ(\fI\&.java\fR)ͭʥ饹̾Ǥ롣 +ファイル名の接頭辞(\fI\&.java\fRを削除)が有効なクラス名である。 .RE .sp .RS 4 @@ -111,7 +111,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ĥ꡼Υ롼ȤŪʥѥ̾ڤʸɥåȤѴȡͭʥѥå̾ˤʤ롣 +ソース・ツリーのルートからの相対的なパス名が、区切り文字をドットに変換すると、有効なパッケージ名になる。 .RE .sp .RS 4 @@ -122,10 +122,10 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥåʸͭʥѥå̾ޤޤƤ롣 +パッケージ文に有効なパッケージ名が含まれている。 .RE -󥯤ν.PP -μ¹ˡ\fIjavadoc\fRޥɤϡμ¹ԤǥɥȲѥå饹ӥС̾Фơ߻ȥ󥯤ɲäޤ󥯤ϡξɽޤ@ˤĤƤϡjavadoc򻲾ȤƤ +リンクの処理.PP +処理の実行中に、\fIjavadoc\fRコマンドは、その実行でドキュメント化されるパッケージ、クラス、およびメンバーの名前に対して、相互参照リンクを追加します。リンクは、次の場所に表示されます。@タグの説明については、javadocタグを参照してください。 .sp .RS 4 .ie n \{\ @@ -135,7 +135,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -(ͤηηեɤη) +宣言(戻り値の型、引数の型、フィールドの型)。 .RE .sp .RS 4 @@ -146,7 +146,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI@see\fR줿\fIϢ\fRץ +\fI@see\fRタグから生成された「\fI関連項目\fR」セクション。 .RE .sp .RS 4 @@ -157,7 +157,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI{@link}\fR줿饤󡦥ƥȡ +\fI{@link}\fRタグから生成されたインライン・テキスト。 .RE .sp .RS 4 @@ -168,7 +168,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fI@throws\fR줿㳰̾ +\fI@throws\fRタグから生成された例外の名前。 .RE .sp .RS 4 @@ -179,7 +179,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -󥿥եΥСФ\fI\fRץ󥯤ȡ饹ΥСФ\fIС饤\fRץ󥯡᥽åɡȤηѾ򻲾ȤƤ +インタフェースのメンバーに対する「\fI定義\fR」リンクと、クラスのメンバーに対する「\fIオーバーライド\fR」リンク。メソッド・コメントの継承を参照してください。 .RE .sp .RS 4 @@ -190,7 +190,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥå饹ӥСꥹȤƤ륵ޥ꡼ɽ +パッケージ、クラス、およびメンバーをリストしているサマリー表。 .RE .sp .RS 4 @@ -201,7 +201,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -ѥåӥ饹ηѾĥ꡼ +パッケージおよびクラスの継承ツリー。 .RE .sp .RS 4 @@ -212,42 +212,42 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} - +索引。 .RE .PP -ޥɥ饤ǻꤷʤä饹ˤĤƤδ¸Υƥ(̤ƥ)Фƥ󥯤ɲäˤϡ\fI\-link\fR\fI\-linkoffline\fRץѤǤޤ -ξܺ.PP -\fIjavadoc\fRޥɤϼ¹Ԥ뤿Ӥ1ĤδʥɥȤޤμ¹Ԥη̤ѹޤľܼࡢʬӥɤԤޤ󡣤\fIjavadoc\fRޥɤϡ¾μ¹Ԥη̤˥󥯤Ǥޤ +コマンドラインで指定しなかったクラスについての既存のテキスト(別に生成したテキスト)に対してリンクを追加するには、\fI\-link\fRおよび\fI\-linkoffline\fRオプションを利用できます。 +処理の詳細.PP +\fIjavadoc\fRコマンドは実行するたびに1つの完全なドキュメントを生成します。前の実行の結果を変更または直接取り込む、増分ビルドを行いません。ただし、\fIjavadoc\fRコマンドは、他の実行の結果にリンクできます。 .PP -\fIjavadoc\fRޥɤμˤJavaѥ餬ɬפǡJavaѥ˰¸Ƥޤ\fIjavadoc\fRޥɤ\fIjavac\fRޥɤΰƤӽФ򥳥ѥ뤷ơСμ̵뤷ޤ\fIjavadoc\fRޥɤϡ饹ؤޤ९饹˭٤ɽȥ饹Ρֻѡ״طۤHTMLޤˡJ\fIjavadoc\fRޥɤϡɤΥɥơ󡦥Ȥ顢桼󶡤ɥȤޤɥơ󡦥Ȥ򻲾ȤƤ +\fIjavadoc\fRコマンドの実装にはJavaコンパイラが必要で、Javaコンパイラに依存しています。\fIjavadoc\fRコマンドは\fIjavac\fRコマンドの一部を呼び出し、宣言をコンパイルして、メンバーの実装を無視します。\fIjavadoc\fRコマンドは、クラス階層を含むクラスの豊富な内部表現とクラスの「使用」関係を構築し、HTMLを生成します。さらに、J\fIjavadoc\fRコマンドは、ソース・コードのドキュメンテーション・コメントから、ユーザーの提供したドキュメントも取得します。ドキュメンテーション・コメントを参照してください。 .PP -\fIjavadoc\fRޥɤϡ᥽åΤʤʥ֡եǤ륽եФƼ¹ԤǤޤäơAPIμ߷פᤤʳǡɥơ󡦥Ȥ򵭽Ҥ\fIjavadoc\fRȤ¹ԤǤޤ +\fIjavadoc\fRコマンドは、メソッド本体を持たない純粋なスタブ・ファイルであるソース・ファイルに対して実行できます。したがって、APIの実装前の設計の早い段階で、ドキュメンテーション・コメントを記述して\fIjavadoc\fRコメントを実行できます。 .PP -ѥ˰¸뤳ȤˤäơHTMLϤϡºݤμΤбޤºݤμϡŪʥɤˤǤϤʤۤΥɤ˰¸礬ޤȤС\fIjavadoc\fRޥɤϡѥѥ饹եˤ¸ߤ뤬ɤˤ¸ߤʤǥեȡ󥹥ȥ饯ɥȲޤ +コンパイラに依存することによって、HTML出力は、実際の実装に正確に対応します。実際の実装は、明示的なソース・コードにではなく、暗黙のソース・コードに依存する場合があります。たとえば、\fIjavadoc\fRコマンドは、コンパイル済クラス・ファイルには存在するがソース・コードには存在しないデフォルト・コンストラクタをドキュメント化します。 .PP -¿ξ硢\fIjavadoc\fRޥɤǤϡեΥɤԴޤϥ顼ޤǤǤɥȤǤޤ٤ƤΥǥХåȥ֥륷塼ƥ󥰤λ˥ɥȤǤޤ\fIjavadoc\fRޥɤϥɥơ󡦥ȤδŪʥåԤޤ +多くの場合、\fIjavadoc\fRコマンドでは、ソース・ファイルのコードが不完全またはエラーを含んでいる場合でもドキュメントを生成できます。すべてのデバッグやトラブルシューティングを完了する前にドキュメントを生成できます。\fIjavadoc\fRコマンドはドキュメンテーション・コメントの基本的なチェックを行います。 .PP -\fIjavadoc\fRޥɤϡɥȤ¤ۤݡȥ饹򤹤٤ƥɤޤΤᡢ -\fIjavadoc\fRޥɤϡ֡ȥȥåס饹ĥǽޤϥ桼饹ˤ餺٤Ƥλȥ饹򸡺Ǥɬפޤ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +\fIjavadoc\fRコマンドは、ドキュメントの内部構造を構築する際、参照クラスをすべてロードします。このため、 +\fIjavadoc\fRコマンドは、ブートストラップ・クラス、拡張機能、またはユーザー・クラスにかかわらず、すべての参照クラスを検索できる必要があります。クラスの検出方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください .PP -̾륯饹ϡĥ饹Ȥơޤ\fIjavadoc\fRޥɤΥ饹ѥǥɤɬפޤ -.SS "JavadocΥɥåå" +通常、作成するクラスは、拡張クラスとして、または\fIjavadoc\fRコマンドのクラス・パスでロードされる必要があります。 +.SS "Javadocのドックレット" .PP -\fIjavadoc\fRޥɤνϤƤȷϡɥååȤѤƥޥǤޤ\fIjavadoc\fRޥɤˤϡɸɥååȤȸƤФǥեȤȹߥɥååȤޤɸɥååȤϡHTMLAPIɥȤޤɸɥååȤޤϥ֥饹뤳Ȥ䡢HTMLXMLMIFRTFʤɤιߤνϷȼΥɥååȤ򵭽Ҥ뤳ȤǽǤ +\fIjavadoc\fRコマンドの出力の内容と形式は、ドックレットを使用してカスタマイズできます。\fIjavadoc\fRコマンドには、標準ドックレットと呼ばれるデフォルトの組込みドックレットがあります。標準ドックレットは、HTML形式のAPIドキュメントを生成します。標準ドックレットを修正またはサブクラスを作成することや、HTML、XML、MIF、RTFなどの好みの出力形式を生成する独自のドックレットを記述することも可能です。 .PP -\fI\-doclet\fRץǥࡦɥååȤꤵƤʤ硢\fIjavadoc\fRޥɤϡǥեȤɸɥååȤѤޤ\fIjavadoc\fRޥɤˤϡѤƤɥååȤ˴طʤѤǤ뤤ĤΥץ󤬤ޤɸɥååȤǤϡ¾ˡĤΥޥɥ饤󡦥ץɲäޤץ򻲾ȤƤ -.SH "ե" +\fI\-doclet\fRオプションでカスタム・ドックレットが指定されていない場合、\fIjavadoc\fRコマンドは、デフォルトの標準ドックレットを使用します。\fIjavadoc\fRコマンドには、使用されているドックレットに関係なく使用できるいくつかのオプションがあります。標準ドックレットでは、これらの他に、いくつかのコマンドライン・オプションが追加されます。オプションを参照してください。 +.SH "ソース・ファイル" .PP -\fIjavadoc\fRޥɤϡΥפΥե뤫ϤޤΥեϡ饹Java쥽ե(\fI\&.java\fR)ѥåȡե롢ץȡե롢Ӥ¾̤ΥեǤǤϡɥȲʤĥ꡼¸ߤ礬ƥȡեƥץ졼ȡեˤĤƤޤ -.SS "饹Υե" +\fIjavadoc\fRコマンドは、次のタイプのソース・ファイルから出力を生成します。そのファイルは、クラスのJava言語ソース・ファイル(\fI\&.java\fR)、パッケージ・コメント・ファイル、概要コメント・ファイル、およびその他の未処理のファイルです。ここでは、ドキュメント化しないがソース・ツリーに存在する場合があるテスト・ファイルやテンプレート・ファイルについても説明します。 +.SS "クラスのソース・ファイル" .PP -줾Υ饹ޤϥ󥿥եӤΥСϡȼΥɥơ󡦥ȤĤȤǤ򥽡եݻޤɥơ󡦥Ȥ򻲾ȤƤ -.SS "ѥåȡե" +それぞれのクラスまたはインタフェース、およびそのメンバーは、独自のドキュメンテーション・コメントを持つことができ、それをソース・ファイル内に保持します。ドキュメンテーション・コメントを参照してください。 +.SS "パッケージ・コメント・ファイル" .PP -줾ΥѥåϡȼΥɥơ󡦥ȤĤȤǤѤΥեݻޤƤϡ\fIjavadoc\fRޥɤˤäѥåΥޥ꡼ڡȤ߹ޤޤΥȤˤϡ̾ΥѥåΤƤϤޤɥȤ򵭽Ҥޤ +それぞれのパッケージは、独自のドキュメンテーション・コメントを持つことができ、それを専用のソース・ファイルに保持します。その内容は、\fIjavadoc\fRコマンドによって生成されるパッケージのサマリー・ページに組み込まれます。このコメントには、通常、そのパッケージ全体に当てはまるドキュメントを記述します。 .PP -ѥåȡեˤϡΤ줫Υե˥ȤǼǤޤ +パッケージ・コメント・ファイルを作成するには、次のいずれかのファイルにコメントを格納できます。 .sp .RS 4 .ie n \{\ @@ -257,7 +257,7 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fIpackage\-info\&.java\fRեˤϡѥåѥåᡢѥåȡJavadocǼǤޤΥե뤬ͥ褵ޤ +\fIpackage\-info\&.java\fRファイルには、パッケージ宣言、パッケージ注釈、パッケージ・コメント、およびJavadocタグを格納できます。このファイルが優先されます。 .RE .sp .RS 4 @@ -268,15 +268,15 @@ javadoc \- Java .sp -1 .IP \(bu 2.3 .\} -\fIpackage\&.html\fRեˤϡѥåȤJavadocΤߤǼǤޤѥåϳǼǤޤ +\fIpackage\&.html\fRファイルには、パッケージ・コメントとJavadocタグのみを格納できます。パッケージ注釈は格納できません。 .RE .PP -ƥѥåϡ\fIpackage\&.html\fRեޤ\fIpackage\-info\&.java\fRեΤ줫1ĻĤȤǤޤξĤȤϤǤޤ󡣤Τɤ餫Υե򥽡եȤȤˡĥ꡼ΤΥѥåǥ쥯ȥ֤Ƥ -package\-info\&.javaե.PP -\fIpackage\-info\&.java\fRեˤϡι¤ΥѥåȤޤ뤳ȤǤޤȤϡѥå֤ޤ +各パッケージは、\fIpackage\&.html\fRファイルまたは\fIpackage\-info\&.java\fRファイルのいずれかを1つ持つことができますが、その両方を持つことはできません。このどちらかのファイルをソース・ファイルとともに、ソース・ツリー内のそのパッケージ・ディレクトリ内に配置してください。 +package\-info\&.javaファイル.PP +\fIpackage\-info\&.java\fRファイルには、次の構造のパッケージ・コメントを含めることができます。コメントは、パッケージ宣言の前に配置されます。 .PP -\fB:\fR -ȶڤʸǤ\fI/**\fR\fI*/\fR¸ߤɬפޤ֤ιԤƬΥꥹϾάǽǤ +\fB注意:\fR +コメント区切り文字である\fI/**\fRおよび\fI*/\fRが存在する必要がありますが、中間の行の先頭のアスタリスクは省略可能です。 .sp .if n \{\ .RS 4 @@ -302,10 +302,10 @@ package java\&.lang\&.applet; .if n \{\ .RE .\} -package\&.htmlե.PP -\fIpackage\&.html\fRեˤϡι¤ΥѥåȤޤ뤳ȤǤޤȤϡ\fI<body>\fRǤ֤ޤ +package\&.htmlファイル.PP +\fIpackage\&.html\fRファイルには、次の構造のパッケージ・コメントを含めることができます。コメントは、\fI<body>\fR要素に配置されます。 .PP -ե: +ファイル: \fIjava/applet/package\&.html\fR .sp .if n \{\ @@ -332,9 +332,9 @@ initialize, start, and stop the applet\&. .RE .\} .PP -\fIpackage\&.html\fRե̾HTMLեǤꡢѥåޤǤޤ󡣥ѥåȡեƤHTMLǵҤޤ㳰1ĤޤΥɥơ󡦥ȤˤϡȶڤʸǤ\fI/**\fR\fI*/\fRޤϹƬΥꥹޤʤȤǤȤ񤯾ϡǽʸѥåΥޥ꡼Ȥ\fI<body>\fRȺǽʸδ֤˥ȥ䤽¾ΥƥȤޤʤ褦ˤޤѥåޤ뤳ȤǤޤ٤ƤΥ֥åϡθ֤ɬפޤ\fI@see\fRѥåȡեɲäˤϡ̾Ѥɬפޤ -ȡեν.PP -\fIjavadoc\fRȤ¹Ԥȡѥåȡե뤬ޤѥåȡե뤬Ĥäϡ\fIjavadoc\fRޥɤϼμ¹Ԥޤ +\fIpackage\&.html\fRファイルは通常のHTMLファイルであり、パッケージ宣言を含んでいません。パッケージ・コメント・ファイルの内容はHTMLで記述しますが、例外が1つあります。このドキュメンテーション・コメントには、コメント区切り文字である\fI/**\fRと\fI*/\fR、または行頭のアスタリスクを含めない、という点です。コメントを書く場合は、最初の文をパッケージのサマリーとし、\fI<body>\fRタグと最初の文の間にタイトルやその他のテキストを含めないようにします。パッケージ・タグを含めることができます。すべてのブロック・タグは、主説明の後に配置する必要があります。\fI@see\fRタグをパッケージ・コメント・ファイルに追加する場合には、完全修飾名を使用する必要があります。 +コメント・ファイルの処理.PP +\fIjavadoc\fRコメントを実行すると、パッケージ・コメント・ファイルが検索されます。パッケージ・コメント・ファイルが見つかった場合は、\fIjavadoc\fRコマンドは次の手順を実行します。 .sp .RS 4 .ie n \{\ @@ -344,8 +344,8 @@ initialize, start, and stop the applet\&. .sp -1 .IP \(bu 2.3 .\} -Ǥ褦˥Ȥ򥳥ԡޤpackage\&.htmlξ硢\fIjavadoc\fRޥɤϡ\fI<body>\fR\fI</body>\fR -HTML֤Τ٤ƤƤ򥳥ԡޤ\fI<head>\fRޤᡢ\fI<title>\fR䥽եҤʤɤξ֤뤳ȤǤޤ줿ɥȤˤϤϰɽޤ +処理できるようにコメントをコピーします。package\&.htmlの場合、\fIjavadoc\fRコマンドは、\fI<body>\fRと\fI</body>\fR +HTMLタグ間のすべての内容をコピーします。\fI<head>\fRセクションを含め、そこに\fI<title>\fRタグやソース・ファイルの著作権記述などの情報を配置することもできますが、生成されたドキュメントにはそれらは一切表示されません。 .RE .sp .RS 4 @@ -356,7 +356,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ѥåޤѥå򻲾ȤƤ +パッケージ・タグを処理します。パッケージ・タグを参照してください。 .RE .sp .RS 4 @@ -367,8 +367,8 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ƥȤ줿ѥåΥޥ꡼ڡβޤJavaץåȥեࡢStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +処理したテキストを生成されたパッケージのサマリー・ページの下部に挿入します。Javaプラットフォーム、Standard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .RE .sp .RS 4 @@ -379,24 +379,24 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ѥåΥޥ꡼ڡƬˡѥåȤκǽʸ򥳥ԡޤˡ\fIjavadoc\fRޥɤϡץڡΥѥåꥹȤˡѥå̾ȥѥåȤκǽʸɲäޤJavaץåȥեࡢStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +パッケージのサマリー・ページの先頭に、パッケージ・コメントの最初の文をコピーします。さらに、\fIjavadoc\fRコマンドは、概要ページのパッケージ・リストに、パッケージ名とパッケージ・コメントの最初の文を追加します。Javaプラットフォーム、Standard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .sp -ʸνϡ饹СμκǽʸνƱ롼ˤäȽǤޤ +文の終わりは、クラスやメンバーの主説明の最初の文の終わりと同じルールによって判断されます。 .RE -.SS "ץȡե" +.SS "概要コメント・ファイル" .PP -ɥȲƥץꥱޤϥѥååȤϡȼγץɥơ󡦥ȤĤȤǤѤΥեݻޤƤϡ\fIjavadoc\fRޥɤˤä복ץڡȤ߹ޤޤΥȤˤϡ̾ץꥱޤϥѥååΤƤϤޤɥȤ򵭽Ҥޤ +ドキュメント化する各アプリケーションまたはパッケージ・セットは、独自の概要ドキュメンテーション・コメントを持つことができ、それは専用のソース・ファイルに保持されます。その内容は、\fIjavadoc\fRコマンドによって生成される概要ページに組み込まれます。このコメントには、通常、アプリケーションまたはパッケージ・セット全体に当てはまるドキュメントを記述します。 .PP -Υեˤoverview\&.htmlʤɤ̾դ뤳ȤǤɤ֤Ƥ⤫ޤޤ󡣰Ūʾϡĥ꡼κǾǤ +このファイルにはoverview\&.htmlなどの名前を付けることができ、どこに配置してもかまいません。一般的な場所は、ソース・ツリーの最上部です。 .PP -ȤС\fIjava\&.applet\fRѥåΥե뤬/home/user/src/java/appletǥ쥯ȥ˳ǼƤ硢ץȡե/home/user/src/overview\&.html˺Ǥޤ +たとえば、\fIjava\&.applet\fRパッケージのソース・ファイルが/home/user/src/java/appletディレクトリに格納されている場合、概要コメント・ファイルは/home/user/src/overview\&.htmlに作成できます。 .PP -ۤʤѥåΥåȤФ\fIjavadoc\fRޥɤʣ¹ԤϡƱ1ĤΥեΥåȤФʣγץȡեǤޤȤСɥѤ\fI\-private\fRꤷ\fIjavadoc\fRޥɤ1¹Ԥ塢ɥѤˤΥץꤷʤǺټ¹Ԥ뤳ȤǤޤξ硢Ƴץȡե1ʸܤǡΥɥȤѤޤѤȤƵҤǤޤ +異なるパッケージのセットに対して\fIjavadoc\fRコマンドを複数回実行する場合は、同じ1つのソース・ファイルのセットに対して複数の概要コメント・ファイルを作成できます。たとえば、内部ドキュメント用に\fI\-private\fRを指定して\fIjavadoc\fRコマンドを1回実行した後、公開ドキュメント用にそのオプションを指定しないで再度実行することができます。この場合、各概要コメント・ファイルの1文目で、そのドキュメントを公開用または内部用として記述できます。 .PP -ץȡեƤϡHTMLǵҤ줿1Ĥ礭ʥɥơ󡦥ȤǤǽʸϥץꥱޤϥѥåΥåȤΥޥ꡼Ȥޤ\fI<body>\fRȺǽʸδ֤˥ȥ䤽¾ΥƥȤޤʤ褦ˤޤ{\fI@link}\fRʤɤΥ饤󡦥٤ƤΥϡθ֤ɬפޤ\fI@see\fRɲäˤϡ̾Ѥɬפޤ +概要コメント・ファイルの内容は、HTMLで記述された1つの大きなドキュメンテーション・コメントです。最初の文はアプリケーションまたはパッケージのセットのサマリーとします。\fI<body>\fRタグと最初の文の間にタイトルやその他のテキストを含めないようにします。{\fI@link}\fRなどのインライン・タグを除くすべてのタグは、主説明の後に配置する必要があります。\fI@see\fRタグを追加する場合には、完全修飾名を使用する必要があります。 .PP -\fIjavadoc\fRޥɤμ¹Իˡ\fI\-overview\fRץѤƳץȡե̾ꤷޤΥեϡѥåȡեƱ褦˽ޤ\fIjavadoc\fRޥɤϼμ¹Ԥޤ +\fIjavadoc\fRコマンドの実行時に、\fI\-overview\fRオプションを使用して概要コメント・ファイル名を指定します。このファイルは、パッケージ・コメント・ファイルと同じように処理されます。\fIjavadoc\fRコマンドは次の手順を実行します。 .sp .RS 4 .ie n \{\ @@ -406,7 +406,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fI<body>\fR\fI</body>\fRδ֤ˤƤ򤹤٤ƽоݤȤƥԡޤ +\fI<body>\fRと\fI</body>\fRタグの間にある内容をすべて処理対象としてコピーします。 .RE .sp .RS 4 @@ -417,7 +417,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ץнޤץ򻲾ȤƤ +概要タグがあれば処理します。概要タグを参照してください。 .RE .sp .RS 4 @@ -428,8 +428,8 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ƥȤ줿ץڡβޤJavaץåȥեStandard Edition APIͤγ -(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)򻲾ȤƤ +処理したテキストを生成された概要ページの下部に挿入します。JavaプラットフォームStandard Edition API仕様の概要 +(http://docs\&.oracle\&.com/javase/8/docs/api/overview\-summary\&.html)を参照してください .RE .sp .RS 4 @@ -440,17 +440,17 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ץޥ꡼ڡƬˡץȤκǽʸ򥳥ԡޤ +概要サマリー・ページの先頭に、概要コメントの最初の文をコピーします。 .RE -.SS "̤Υե" +.SS "未処理のファイル" .PP -եˤϡ\fIjavadoc\fRޥɤˤäưǥ쥯ȥ˥ԡ롢ǤդΥեޤ뤳ȤǤޤΤ褦ʥեˤϡ̾եåե롢ץJavaӥ饹ե롢ŪJavaեΥɥơ󡦥Ȥαƶʤ¿ƤޤΩHTMLեʤɤޤ +ソース・ファイルには、\fIjavadoc\fRコマンドによって宛先ディレクトリにコピーされる、任意のファイルを含めることができます。このようなファイルには、通常、グラフィック・ファイル、サンプルのJavaソースおよびクラス・ファイル、一般的なJavaソース・ファイルのドキュメンテーション・コメントの影響を受けない多くの内容を含む独立したHTMLファイルなどがあります。 .PP -̤Υեޤˤϡdoc\-filesȤǥ쥯ȥ˥ե֤ޤdoc\-filesǥ쥯ȥϡեޤǤդΥѥåǥ쥯ȥΥ֥ǥ쥯ȥˤʤ뤳ȤǤޤdoc\-files֥ǥ쥯ȥϡѥåȤ1ѰդǤޤ +未処理のファイルを含めるには、doc\-filesというディレクトリにファイルを配置します。doc\-filesディレクトリは、ソース・ファイルを含む任意のパッケージ・ディレクトリのサブディレクトリになることができます。doc\-filesサブディレクトリは、パッケージごとに1つ用意できます。 .PP -ȤСܥΥ᡼\fIjava\&.awt\&.Button\fR饹ΥɥȤ˴ޤˤϡΥ᡼ե/home/user/src/java/awt/doc\-files/ǥ쥯ȥ֤ޤdoc\-filesǥ쥯ȥ/home/user/src/java/doc\-files֤ʤǤjavaϥѥåǤϤʤǤեޤ뤳ȤǤޤ +たとえば、ボタンのイメージを\fIjava\&.awt\&.Button\fRクラスのドキュメントに含める場合には、そのイメージ・ファイルを/home/user/src/java/awt/doc\-files/ディレクトリに置きます。doc\-filesディレクトリを/home/user/src/java/doc\-filesに置かないでください。javaはパッケージではないからです。ソース・ファイルを含めることもできません。 .PP -\fIjavadoc\fRޥɤϥե򻲾ȤʤΤǡ̤ΥեؤΤ٤ƤΥ󥯤ϡɤ˴ޤޤƤɬפޤ\fIjavadoc\fRޥɤϥǥ쥯ȥȤΤ٤ƤƤ˥ԡޤǤϡButton\&.javaɥơ󡦥ȤΥ󥯤ɤΤ褦˸뤫򼨤Ƥޤ +\fIjavadoc\fRコマンドはファイルを参照しないので、未処理のファイルへのすべてのリンクは、コードに含まれている必要があります。\fIjavadoc\fRコマンドはディレクトリとそのすべての内容を宛先にコピーします。次の例では、Button\&.javaドキュメンテーション・コメントのリンクがどのように見えるかを示しています。 .sp .if n \{\ .RS 4 @@ -464,13 +464,13 @@ HTML .if n \{\ .RE .\} -.SS "ƥȤӥƥץ졼ȡե" +.SS "テストおよびテンプレート・ファイル" .PP -ĥ꡼ΥƥȤӥƥץ졼ȡե򡢥ե뤬¸ߤǥ쥯ȥޤϥ֥ǥ쥯ȥƱǥ쥯ȥ˳ǼǤޤƥȤӥƥץ졼ȡե뤬Τɤˤϡ\fIjavadoc\fRޥɤ¹ԤŪ˸̤Υե̾Ϥޤ +ソース・ツリーのテストおよびテンプレート・ファイルを、ソース・ファイルが存在するディレクトリまたはサブディレクトリと同じディレクトリに格納できます。テストおよびテンプレート・ファイルが処理されるのを防ぐには、\fIjavadoc\fRコマンドを実行し、明示的に個別のソース・ファイル名を渡します。 .PP -ƥȡեϡͭʡѥǽʥեǤƥץ졼ȡեϡͭʡߴΤ륽եǤϤޤ󤬡¿ξ硢\fI\&.java\fRäƤޤ -ƥȡե.PP -ƥȡե̾ʤѥå䡢ե뤬¸ߤѥåȤ̤Υѥå°褦ˤ硢ƥȡե򥽡եβΥ֥ǥ쥯ȥ֤Υǥ쥯ȥ̵̾դޤƥȡե򥽡Ʊǥ쥯ȥ֤ѥå̾򼨤ޥɥ饤ꤷ\fIjavadoc\fRޥɤƤӽФȡƥȡեϷٹޤϥ顼ޤե뤬̵̾ĥ֥ǥ쥯ȥ¸ߤ硢ƥȡե롦ǥ쥯ȥϥåפ졢顼ޤϷٹȯԤޤ󡣤ȤСեΥƥȡեcom\&.package1ɲäˤϡ̵ʥѥå̾Υ֥ǥ쥯ȥ֤ޤΥǥ쥯ȥ̾ˤϥϥե󤬴ޤޤƤ뤿̵Ǥ +テスト・ファイルは、有効な、コンパイル可能なソース・ファイルです。テンプレート・ファイルは、有効な、互換性のあるソース・ファイルではありませんが、多くの場合、\fI\&.java\fR接尾辞を持っています。 +テスト・ファイル.PP +テスト・ファイルを、名前なしパッケージや、ソース・ファイルが存在するパッケージとは別のパッケージに属するようにする場合、テスト・ファイルをソース・ファイルの下のサブディレクトリに配置し、そのディレクトリに無効な名前を付けます。テスト・ファイルをソースと同じディレクトリに配置し、パッケージ名を示すコマンドライン引数を指定して\fIjavadoc\fRコマンドを呼び出すと、テスト・ファイルは警告またはエラーを引き起こします。ファイルが無効な名前を持つサブディレクトリ内に存在する場合、テスト・ファイル・ディレクトリはスキップされ、エラーまたは警告は発行されません。たとえば、ソース・ファイルのテスト・ファイルをcom\&.package1に追加するには、無効なパッケージ名のサブディレクトリに配置します。次のディレクトリ名にはハイフンが含まれているため無効です。 .sp .if n \{\ .RS 4 @@ -482,13 +482,13 @@ com/package1/test\-files/ .RE .\} .PP -ƥȡե˥ɥơ󡦥Ȥޤޤ硢\fIjavadoc\fRޥɤθ̤μ¹Ԥǡ磻ɥɤޤƥȡե̾(\fIcom/package1/test\-files/*\&.java\fRʤ)ϤơƥȡեΥɥȤ褦Ǥޤ -ƥץ졼ȡե.PP -ƥץ졼ȡե򥽡ǥ쥯ȥ֤뤬\fIjavadoc\fRޥɤ¹ԤȤ˥顼ʤ硢ե\fIBuffer\-Template\&.java\fRʤɤ̵̾դơʤ褦ˤޤ\fIjavadoc\fRޥɤϡ\fI\&.java\fRͭʥ饹̾ˤʤ̾ĥեΤߤޤ -.SH "ե" +テスト・ファイルにドキュメンテーション・コメントが含まれる場合、\fIjavadoc\fRコマンドの個別の実行で、ワイルドカードを含んだテスト・ソース・ファイル名(\fIcom/package1/test\-files/*\&.java\fRなど)を渡して、テスト・ファイルのドキュメントを生成するように設定できます。 +テンプレート・ファイル.PP +テンプレート・ファイルをソース・ディレクトリに配置するが、\fIjavadoc\fRコマンドを実行するときにエラーを生成しない場合、ファイルに\fIBuffer\-Template\&.java\fRなどの無効な名前を付けて、処理させないようにします。\fIjavadoc\fRコマンドは、接尾辞の\fI\&.java\fRが削除されると有効なクラス名になる名前を持つソース・ファイルのみを処理します。 +.SH "生成されるファイル" .PP -ǥեȤǤϡ\fIjavadoc\fRޥɤϡHTMLΥɥȤɸɥååȤѤޤɸɥååȤϡ롢ƥڡ߻ȥڡݡȡڡޤHTMLڡϸ̤Υեбޤ\fIjavadoc\fRޥɤϡ2ĤΥפΥեޤǽΥפˤϡ饹ӥ󥿥ե˱̾դޤ2ܤΥפˤϡǽΥפΥեȤζɤˡϥե󤬴ޤޤޤ(package\-summary\&.htmlʤ) -.SS "ƥڡ" +デフォルトでは、\fIjavadoc\fRコマンドは、HTML形式のドキュメントを生成する標準ドックレットを使用します。標準ドックレットは、ここで説明する、基本内容ページ、相互参照ページ、サポート・ページを生成します。各HTMLページは個別のファイルに対応します。\fIjavadoc\fRコマンドは、2つのタイプのファイルを生成します。最初のタイプには、クラスおよびインタフェースに応じた名前が付けられます。2番目のタイプには、最初のタイプのファイルとの競合を防ぐために、ハイフンが含まれます(package\-summary\&.htmlなど)。 +.SS "基本内容ページ" .sp .RS 4 .ie n \{\ @@ -498,7 +498,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ܤƤ륯饹ޤϥ󥿥եȤ1ĤΥ饹ޤϥ󥿥եڡ(classname\&.html) +記載されているクラスまたはインタフェースごとに1つのクラスまたはインタフェース・ページ(classname\&.html)。 .RE .sp .RS 4 @@ -509,7 +509,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ܤƤѥåȤ1ĤΥѥåڡ(package\-summary\&.html)\fIjavadoc\fRޥɤϡĥ꡼Υѥåǥ쥯ȥˤpackage\&.htmlޤpackage\-info\&.javaȤ̾ΥեHTMLƥȤ򤹤٤Ȥޤ +記載されているパッケージごとに1つのパッケージ・ページ(package\-summary\&.html)。\fIjavadoc\fRコマンドは、ソース・ツリーのパッケージ・ディレクトリ内にあるpackage\&.htmlまたはpackage\-info\&.javaという名前のファイル内のHTMLテキストをすべて組み入れます。 .RE .sp .RS 4 @@ -520,9 +520,9 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåΥåΤФ1Ĥγץڡ(overview\-summary\&.html)ץڡϡɥȤƬڡˤʤޤ\fIjavadoc\fRޥɤϡ\fI\-overview\fRץǻꤵ줿եHTMLƥȤ򤹤٤ȤޤץڡΤϡ\fIjavadoc\fRޥɤʣΥѥå̾ϤΤߤǤHTMLե졼पӥץ򻲾ȤƤ +パッケージのセット全体に対して1つの概要ページ(overview\-summary\&.html)。概要ページは、生成ドキュメントの先頭ページになります。\fIjavadoc\fRコマンドは、\fI\-overview\fRオプションで指定されたファイル内のHTMLテキストをすべて組み入れます。概要ページが作成されるのは、\fIjavadoc\fRコマンドに複数のパッケージ名を渡した場合のみです。HTMLフレームおよびオプションを参照してください。 .RE -.SS "߻ȥڡ" +.SS "相互参照ページ" .sp .RS 4 .ie n \{\ @@ -532,7 +532,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåΥåΤФ1ĤΥ饹إڡ(overview\-tree\&.html)إڡɽˤϡʥӥ󡦥СΡֳספ򥯥åƤ顢ֳإĥ꡼פ򥯥åޤ +パッケージのセット全体に対して1つのクラス階層ページ(overview\-tree\&.html)。階層ページを表示するには、ナビゲーション・バーの「概要」をクリックしてから、「階層ツリー」をクリックします。 .RE .sp .RS 4 @@ -543,7 +543,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåȤ1ĤΥ饹إڡ(package\-tree\&.html)إڡɽˤϡΥѥå饹ޤϥ󥿥եΥڡ˰ưֳإĥ꡼פ򥯥åƤΥѥåγؤɽޤ +パッケージごとに1つのクラス階層ページ(package\-tree\&.html)。階層ページを表示するには、特定のパッケージ、クラス、またはインタフェースのページに移動し、「階層ツリー」をクリックしてそのパッケージの階層を表示します。 .RE .sp .RS 4 @@ -554,7 +554,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ѥåȤ1Ĥλѥڡ(package\-use\&.html)ȡ饹ӥ󥿥եȤ1ĤĤλѥڡ(class\-use/classname\&.html)ѥڡǤϡꤷ饹󥿥եޤϥѥåΰѤƤѥå饹᥽åɡ󥹥ȥ饯ӥեɤˤĤƵҤޤȤС饹ޤϥ󥿥եAˤȡλѥڡˤϡAΥ֥饹AȤ줿եɡA֤᥽åɡAΥѥ᡼ĥ᥽åɤӥ󥹥ȥ饯Ȥ߹ޤޤѥڡɽˤϡѥå饹ޤϥ󥿥ե˰ưʥӥ󡦥СΡֻѡץ󥯤򥯥åޤ +パッケージごとに1つの使用ページ(package\-use\&.html)と、クラスおよびインタフェースごとに1つずつの使用ページ(class\-use/classname\&.html)。使用ページでは、指定したクラス、インタフェース、またはパッケージの一部を使用しているパッケージ、クラス、メソッド、コンストラクタ、およびフィールドについて記述されます。たとえば、クラスまたはインタフェースAを例にすると、その使用ページには、Aのサブクラス、Aとして宣言されたフィールド、Aを返すメソッド、A型のパラメータを持つメソッドおよびコンストラクタが組み込まれます。使用ページを表示するには、パッケージ、クラス、またはインタフェースに移動し、ナビゲーション・バーの「使用」リンクをクリックします。 .RE .sp .RS 4 @@ -565,7 +565,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -٤Ƥ侩APIȤο侩ؤꥹȤ侩APIڡ(deprecated\-list\&.html)侩APIϾμǺǽΤǻѤʤǤ +すべての非推奨APIとその推奨する代替をリストする非推奨APIページ(deprecated\-list\&.html)。非推奨APIは将来の実装で削除される可能性があるので使用しないでください。 .RE .sp .RS 4 @@ -576,7 +576,7 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -եɤѤեͥڡ(constant\-values\&.html) +定数フィールドの値用の定数フィールド値ページ(constant\-values\&.html)。 .RE .sp .RS 4 @@ -587,9 +587,9 @@ com/package1/test\-files/ .sp -1 .IP \(bu 2.3 .\} -ľ󲽤줿ڡ(serialized\-form\&.html)եɤӥ᥽åɤޤࡢľ󲽲ǽijǽʥ饹˴ؤѤΥڡǤΥڡξϡAPIѤ볫ȯԤǤϤʤƼԤɬפʾǤľ󲽤줿ڡإˤϡľ󲽤줿饹˰ươΥ饹ȤˤִϢܡץǡľ󲽤줿פ򥯥åޤɸɥååȤľ󲽤줿ڡޤΥڡˤϡSerializable뤹٤ƤΥ饹(publicޤpublic)\fIreadObject\fR\fIwriteObject\fR᥽åɡľ󲽤줿եɡ\fI@serial\fR\fI@serialField\fR\fI@serialData\fRΥɥơ󡦥ȤȤȤ˥ꥹȤޤľ󲽲ǽpublic饹ˤϡΥ饹(ޤϤΥѥå)\fI@serial\fR -excludeǥޡޤľ󲽲ǽpackage\-private饹ޤˤϡΥ饹(ޤϤΥѥå)\fI@serial\fR -includeǥޡޤ꡼1\&.4Ǥϡ\fI\-private\fRץꤻ\fIjavadoc\fRޥɤ¹Ԥ뤳Ȥˤꡢpublic饹private饹δľ󲽤줿Ǥޤץ򻲾ȤƤ +直列化された形式ページ(serialized\-form\&.html)。フィールドおよびメソッドの説明を含む、直列化可能かつ外部化可能なクラスに関する情報用のページです。このページ内の情報は、APIを使用する開発者ではなく、再実装者に必要な情報です。直列化された形式ページへアクセスするには、直列化されたクラスに移動して、そのクラス・コメントにある「関連項目」セクションで「直列化された形式」をクリックします。標準ドックレットは直列化された形式ページを生成します。このページには、Serializableを実装するすべてのクラス(publicまたは非public)が、その\fIreadObject\fRや\fIwriteObject\fRメソッド、直列化されたフィールド、および\fI@serial\fR、\fI@serialField\fR、\fI@serialData\fRタグからのドキュメンテーション・コメントとともにリストされます。直列化可能なpublicクラスを除外するには、そのクラス(またはそのパッケージ)を\fI@serial\fR +excludeでマークします。直列化可能なpackage\-privateクラスを含めるには、そのクラス(またはそのパッケージ)を\fI@serial\fR +includeでマークします。リリース1\&.4では、\fI\-private\fRオプションを指定せずに\fIjavadoc\fRコマンドを実行することにより、publicクラスおよびprivateクラスの完全に直列化された形式を生成できます。オプションを参照してください。 .RE .sp .RS 4 @@ -600,9 +600,9 @@ include .sp -1 .IP \(bu 2.3 .\} -ڡ(\fIindex\-*\&.html\fR)٤ƤΥ饹̾󥿥ե̾󥹥ȥ饯̾ե̾ӥ᥽å̾ե٥åȽ¤ǤޤڡϡUnicode򰷤褦˹ݲƤޤ1ĤΥեȤ뤳Ȥ⡢Ƭʸ(ѸξA\(enZ)Ȥ̡ΥեȤ뤳ȤǤޤ +索引ページ(\fIindex\-*\&.html\fR)。すべてのクラス名、インタフェース名、コンストラクタ名、フィールド名、およびメソッド名がアルファベット順に並んでいます。索引ページは、Unicodeを扱えるように国際化されています。1つのファイルとして生成することも、先頭文字(英語の場合A\(enZ)ごとに別々のファイルとして生成することもできます。 .RE -.SS "ݡȡڡ" +.SS "サポート・ページ" .sp .RS 4 .ie n \{\ @@ -612,7 +612,7 @@ include .sp -1 .IP \(bu 2.3 .\} -إסڡ(help\-doc\&.html)ʥӥ󡦥СҤγƥڡ˴ؤܤƤޤǥեȤΥإסեȼΥࡦإסեǥС饤ɤˤϡ\fI\-helpfile\fRѤޤ +ヘルプ・ページ(help\-doc\&.html)。ナビゲーション・バーや前述の各ページに関する説明が記載されています。デフォルトのヘルプ・ファイルを独自のカスタム・ヘルプ・ファイルでオーバーライドするには、\fI\-helpfile\fRを使用します。 .RE .sp .RS 4 @@ -623,7 +623,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ɽѤHTMLե졼1Ĥindex\&.htmlե롣ե졼դƬڡɽˤϤΥեɤޤindex\&.htmlեˤϡƥȡƥĤϴޤޤƤޤ +表示用のHTMLフレームを作成する1つのindex\&.htmlファイル。フレーム付きの先頭ページを表示するにはこのファイルをロードします。index\&.htmlファイルには、テキスト・コンテンツは含まれていません。 .RE .sp .RS 4 @@ -634,7 +634,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ʣΥե졼ࡦե(\fI*\-frame\&.html\fR)ѥå饹ӥ󥿥եΥꥹȤޤޤƤޤե졼ࡦեHTMLե졼ɽޤ +複数のフレーム・ファイル(\fI*\-frame\&.html\fR)。パッケージ、クラス、およびインタフェースのリストが含まれています。フレーム・ファイルはHTMLフレームを表示します。 .RE .sp .RS 4 @@ -645,7 +645,7 @@ include .sp -1 .IP \(bu 2.3 .\} -ѥåꥹȡե(package\-list)\fI\-link\fR\fI\-linkoffline\fRץǻѤޤѥåꥹȡեϥƥȡեǤꡢɤΥ󥯤⥢Ǥޤ +パッケージ・リスト・ファイル(package\-list)。\fI\-link\fRおよび\fI\-linkoffline\fRオプションで使用されます。パッケージ・リスト・ファイルはテキスト・ファイルであり、どのリンクからもアクセスできません。 .RE .sp .RS 4 @@ -656,7 +656,7 @@ include .sp -1 .IP \(bu 2.3 .\} -륷ȡե(stylesheet\&.css)ڡΰǤˤĤƿեȡեߥꡢեȡեȡ롢֤椷ޤ +スタイルシート・ファイル(stylesheet\&.css)。生成されるページの一部の要素について色、フォント・ファミリ、フォント・サイズ、フォント・スタイル、および配置を制御します。 .RE .sp .RS 4 @@ -667,22 +667,22 @@ include .sp -1 .IP \(bu 2.3 .\} -doc\-filesǥ쥯ȥꡣǥ쥯ȥ˥ԡ륤᡼ץ롦ɡɤʤɤΥե뤬ǼޤΥեϡ\fIjavadoc\fRޥɤˤäƽޤ󡣤Υǥ쥯ȥϡĥ꡼¸ߤˤΤ߽ޤ +doc\-filesディレクトリ。宛先ディレクトリにコピーするイメージ、サンプル・コード、ソース・コードなどのファイルが格納されます。これらのファイルは、\fIjavadoc\fRコマンドによって処理されません。このディレクトリは、ソース・ツリーの中に存在する場合にのみ処理されます。 .RE .PP -ץ򻲾ȤƤ -.SS "HTMLե졼" +オプションを参照してください。 +.SS "HTMLフレーム" .PP -\fIjavadoc\fRޥɤϡޥɤϤ줿ͤ˴ŤǾɬפʿ(2ޤ3)Υե졼ޤ\fIjavadoc\fRޥɤ˰Ȥ1ĤΥѥå̾ޤ1ĤΥѥå˴ޤޤ륽եϤϡѥåΥꥹȤάޤΤˡ\fIjavadoc\fRޥɤϺ¦1ĤΥե졼饹ΥꥹȤɽޤʣΥѥå̾Ϥϡ\fIjavadoc\fRޥɤϡ٤ƤΥѥåꥹȤ3Υե졼ȳץڡ(overview\-summary\&.html)ޤե졼άˤϡ֥ե졼ʤץ󥯤򥯥å뤫overview\-summary\&.htmlڡڡåȤɽޤ -.SS "եι¤" +\fIjavadoc\fRコマンドは、コマンドに渡された値に基づき、最小限必要な数(2または3)のフレームを生成します。\fIjavadoc\fRコマンドに引数として1つのパッケージ名または1つのパッケージに含まれるソース・ファイルを渡す場合は、パッケージのリストが省略されます。そのかわりに、\fIjavadoc\fRコマンドは左側の列に1つのフレームを作成し、クラスのリストを表示します。複数のパッケージ名を渡した場合は、\fIjavadoc\fRコマンドは、すべてのパッケージをリストする第3のフレームと概要ページ(overview\-summary\&.html)を作成します。フレームを省略するには、「フレームなし」リンクをクリックするか、overview\-summary\&.htmlページからページ・セットを表示します。 +.SS "生成されるファイルの構造" .PP -륯饹ե뤪ӥ󥿥եեϡJavaե뤪ӥ饹եƱǥ쥯ȥ곬ؤޤ1ĤΥ֥ѥåˤĤ1ĤΥǥ쥯ȥꡢȤ¤ˤʤޤ +生成されるクラス・ファイルおよびインタフェース・ファイルは、Javaソース・ファイルおよびクラス・ファイルと同じディレクトリ階層に編成されます。1つのサブパッケージにつき1つのディレクトリ、という構造になります。 .PP -ȤС\fIjava\&.applet\&.Applet\fR饹ѤɥȤϡjava/applet/Applet\&.html˳Ǽޤ +たとえば、\fIjava\&.applet\&.Applet\fRクラス用に生成されるドキュメントは、java/applet/Applet\&.htmlに格納されます。 .PP -ǥ쥯ȥ̾\fIapidocs\fRȤȡ\fIjava\&.applet\fRѥåΥեι¤ϡΤȤǤҤΤ褦ˡ\fIframe\fRȤ̾˴ޤեϡ٤ƺޤϺΥե졼ɽޤʳHTMLեϡ٤Ʊ¦Υե졼ɽޤ +生成先ディレクトリの名前が\fIapidocs\fRだとすると、\fIjava\&.applet\fRパッケージのファイルの構造は、次のとおりです。前述のように、\fIframe\fRという語を名前に含むファイルは、すべて左上または左下のフレームに表示されます。それ以外のHTMLファイルは、すべて右側のフレームに表示されます。 .PP -ǥ쥯ȥǤꥹ(*)ϡ\fIjavadoc\fRޥɤؤΰѥå̾ǤϤʤե̾Ǥ˾άե뤪ӥǥ쥯ȥ򼨤Ƥޤե̾ξ硢ΥѥåꥹȤޤdoc\-filesǥ쥯ȥϡĥ꡼¸ߤˤΤߡ˺ޤե򻲾ȤƤ +ディレクトリは太字です。アスタリスク(*)は、\fIjavadoc\fRコマンドへの引数がパッケージ名ではなくソース・ファイル名である場合に省略されるファイルおよびディレクトリを示しています。引数がソース・ファイル名の場合、空のパッケージ・リストが作成されます。doc\-filesディレクトリは、ソース・ツリー内に存在する場合にのみ、生成先に作成されます。生成されるファイルを参照してください。 .sp .RS 4 .ie n \{\ @@ -692,7 +692,7 @@ doc\-files .sp -1 .IP \(bu 2.3 .\} -\fBapidocs\fR: Ǿ̥٥롦ǥ쥯ȥ +\fBapidocs\fR: 最上位レベル・ディレクトリ .sp .RS 4 .ie n \{\ @@ -702,7 +702,7 @@ doc\-files .sp -1 .IP \(bu 2.3 .\} -index\&.html: HTMLե졼ꤹڡ +index\&.html: HTMLフレームを設定する初期ページ .RE .sp .RS 4 @@ -713,7 +713,7 @@ index\&.html: HTML .sp -1 .IP \(bu 2.3 .\} -*overview\-summary\&.html: ѥåꥹȤȥޥ꡼ +*overview\-summary\&.html: パッケージ・リストとサマリー .RE .sp .RS 4 @@ -724,7 +724,7 @@ index\&.html: HTML .sp -1 .IP \(bu 2.3 .\} -overview\-tree\&.html: ٤ƤΥѥåΥ饹 +overview\-tree\&.html: すべてのパッケージのクラス階層 .RE .sp .RS 4 @@ -735,7 +735,7 @@ overview\-tree\&.html: .sp -1 .IP \(bu 2.3 .\} -deprecated\-list\&.html: ٤ƤΥѥå侩API +deprecated\-list\&.html: すべてのパッケージの非推奨API .RE .sp .RS 4 @@ -746,7 +746,7 @@ deprecated\-list\&.html: .sp -1 .IP \(bu 2.3 .\} -constant\-values\&.html: ٤ƤΥѥåŪե +constant\-values\&.html: すべてのパッケージの静的フィールド値 .RE .sp .RS 4 @@ -757,7 +757,7 @@ constant\-values\&.html: .sp -1 .IP \(bu 2.3 .\} -serialized\-form\&.html: ٤ƤΥѥåľ󲽤줿ե +serialized\-form\&.html: すべてのパッケージの直列化されたフォーム .RE .sp .RS 4 @@ -768,7 +768,7 @@ serialized\-form\&.html: .sp -1 .IP \(bu 2.3 .\} -*overview\-frame\&.html: Υե졼ɽ뤹٤ƤΥѥå +*overview\-frame\&.html: 左上のフレームに表示するすべてのパッケージ .RE .sp .RS 4 @@ -779,7 +779,7 @@ serialized\-form\&.html: .sp -1 .IP \(bu 2.3 .\} -allclasses\-frame\&.html: Υե졼ɽ뤹٤ƤΥ饹 +allclasses\-frame\&.html: 左下のフレームに表示するすべてのクラス .RE .sp .RS 4 @@ -790,7 +790,7 @@ allclasses\-frame\&.html: .sp -1 .IP \(bu 2.3 .\} -help\-doc\&.html: Javadocڡ˴ؤإ +help\-doc\&.html: Javadocページの編成に関するヘルプ .RE .sp .RS 4 @@ -802,7 +802,7 @@ help\-doc\&.html: Javadoc .IP \(bu 2.3 .\} index\-all\&.html: -\fI\-splitindex\fRץʤǺ줿ǥեȤκ +\fI\-splitindex\fRオプションなしで作成されたデフォルトの索引 .RE .sp .RS 4 @@ -814,7 +814,7 @@ index\-all\&.html: .IP \(bu 2.3 .\} \fBindex\-files\fR: -\fI\-splitindex\fRץꤷƺ줿ǥ쥯ȥ +\fI\-splitindex\fRオプションを指定して作成されたディレクトリ .sp .RS 4 .ie n \{\ @@ -825,7 +825,7 @@ index\-all\&.html: .IP \(bu 2.3 .\} index\-<number>\&.html: -\fI\-splitindex\fRץꤷƺ줿ե +\fI\-splitindex\fRオプションを指定して作成された索引ファイル .RE .RE .sp @@ -837,7 +837,7 @@ index\-<number>\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-list: Ȥ褹뤿Υѥå̾ +package\-list: 外部参照を解決するためのパッケージ名 .RE .sp .RS 4 @@ -848,7 +848,7 @@ package\-list: .sp -1 .IP \(bu 2.3 .\} -stylesheet\&.css: եȡ֤ʤɤޤ +stylesheet\&.css: フォント、色、位置などを定義します .RE .RE .sp @@ -860,7 +860,7 @@ stylesheet\&.css: .sp -1 .IP \(bu 2.3 .\} -\fBjava\fR: ѥåǥ쥯ȥ +\fBjava\fR: パッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -870,7 +870,7 @@ stylesheet\&.css: .sp -1 .IP \(bu 2.3 .\} -\fBapplet\fR: ֥ѥåǥ쥯ȥ +\fBapplet\fR: サブパッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -881,7 +881,7 @@ stylesheet\&.css: .IP \(bu 2.3 .\} Applet\&.html: -\fIApplet\fR饹ڡ +\fIApplet\fRクラス・ページ .RE .sp .RS 4 @@ -893,7 +893,7 @@ Applet\&.html: .IP \(bu 2.3 .\} AppletContext\&.html: -\fIAppletContext\fR󥿥ե +\fIAppletContext\fRインタフェース .RE .sp .RS 4 @@ -905,7 +905,7 @@ AppletContext\&.html: .IP \(bu 2.3 .\} AppletStub\&.html: -\fIAppletStub\fR󥿥ե +\fIAppletStub\fRインタフェース .RE .sp .RS 4 @@ -917,7 +917,7 @@ AppletStub\&.html: .IP \(bu 2.3 .\} AudioClip\&.html: -\fIAudioClip\fR󥿥ե +\fIAudioClip\fRインタフェース .RE .sp .RS 4 @@ -928,7 +928,7 @@ AudioClip\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-summary\&.html: 饹ȥޥ꡼ +package\-summary\&.html: クラスとサマリー .RE .sp .RS 4 @@ -939,7 +939,7 @@ package\-summary\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-frame\&.html: Υե졼ɽѥå饹 +package\-frame\&.html: 左下のフレームに表示するパッケージ・クラス .RE .sp .RS 4 @@ -950,7 +950,7 @@ package\-frame\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-tree\&.html: ΥѥåΥ饹 +package\-tree\&.html: このパッケージのクラス階層 .RE .sp .RS 4 @@ -961,7 +961,7 @@ package\-tree\&.html: .sp -1 .IP \(bu 2.3 .\} -package\-use\&.html: ΥѥåѤ +package\-use\&.html: このパッケージが使用される場所 .RE .sp .RS 4 @@ -972,7 +972,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBdoc\-files\fR: ᡼ӥץ롦եΥǥ쥯ȥ +\fBdoc\-files\fR: イメージおよびサンプル・ファイルのディレクトリ .RE .sp .RS 4 @@ -983,18 +983,18 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBclass\-use\fR: ᡼ӥץ롦եξ +\fBclass\-use\fR: イメージおよびサンプル・ファイルの場所 .sp -\- Applet\&.html: Applet饹λ +\- Applet\&.html: Appletクラスの使用 .sp \- AppletContext\&.html: -\fIAppletContext\fR󥿥եλ +\fIAppletContext\fRインタフェースの使用 .sp \- AppletStub\&.html: -\fIAppletStub\fR󥿥եλ +\fIAppletStub\fRインタフェースの使用 .sp \- AudioClip\&.html: -\fIAudioClip\fR󥿥եλ +\fIAudioClip\fRインタフェースの使用 .RE .RE .RE @@ -1007,7 +1007,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBsrc\-html\fR: ɡǥ쥯ȥ +\fBsrc\-html\fR: ソース・コード・ディレクトリ .sp .RS 4 .ie n \{\ @@ -1017,7 +1017,7 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBjava\fR: ѥåǥ쥯ȥ +\fBjava\fR: パッケージ・ディレクトリ .sp .RS 4 .ie n \{\ @@ -1027,24 +1027,24 @@ package\-use\&.html: .sp -1 .IP \(bu 2.3 .\} -\fBapplet\fR: ֥ѥåǥ쥯ȥ +\fBapplet\fR: サブパッケージ・ディレクトリ .sp -\- Applet\&.html: Applet +\- Applet\&.html: Appletソース・コード .sp \- AppletContext\&.html: -\fIAppletContext\fR +\fIAppletContext\fRソース・コード .sp \- AppletStub\&.html: -\fIAppletStub\fR +\fIAppletStub\fRソース・コード .sp \- AudioClip\&.html: -\fIAudioClip\fR +\fIAudioClip\fRソース・コード .RE .RE .RE -.SS "API" +.SS "生成されるAPI宣言" .PP -\fIjavadoc\fRޥɤϡ줾Υ饹󥿥եեɡ󥹥ȥ饯ӥ᥽åɤεҤκǽˡAPIѤޤȤС\fIBoolean\fR饹ϡΤ褦ˤʤޤ +\fIjavadoc\fRコマンドは、それぞれのクラス、インタフェース、フィールド、コンストラクタ、およびメソッドの記述の最初に、そのAPI用の宣言を生成します。たとえば、\fIBoolean\fRクラスの宣言は、次のようになります。 .sp .if n \{\ .RS 4 @@ -1058,7 +1058,7 @@ implements Serializable .RE .\} .PP -\fIBoolean\&.valueOf\fR᥽åɤϼΤȤǤ +\fIBoolean\&.valueOf\fRメソッドの宣言は次のとおりです。 .sp .if n \{\ .RS 4 @@ -1070,15 +1070,15 @@ public static Boolean valueOf(String s) .RE .\} .PP -\fIjavadoc\fRޥɤϡ\fIpublic\fR\fIprotected\fR\fIprivate\fR\fIabstract\fR\fIfinal\fR\fIstatic\fR\fItransient\fR\fIvolatile\fRޤ뤳ȤǤޤ\fIsynchronized\fR\fInative\fRϤǤޤ\fIsynchronized\fR\fInative\fRҤϡξܺ٤ȤߤʤƤ뤿ᡢAPIͤˤϴޤޤޤ +\fIjavadoc\fRコマンドは、修飾子\fIpublic\fR、\fIprotected\fR、\fIprivate\fR、\fIabstract\fR、\fIfinal\fR、\fIstatic\fR、\fItransient\fR、および\fIvolatile\fRを含めることができますが、\fIsynchronized\fRおよび\fInative\fRはできません。\fIsynchronized\fRおよび\fInative\fR修飾子は、実装の詳細とみなされているため、API仕様には含まれません。 .PP -APIǤϡ¹ޥƥˤĤơ\fIsynchronized\fR˰¸ΤǤϤʤȤμȤƥɥȲɬפޤȤС1ĤenumerationʣΥåɤ¹ԤƻѤ뤳ȤϤǤʤפΤ褦˵ҤޤɥȤˤϡΥޥƥ¸ˡ򵭽ҤʤǤȤС\fIHashtable\fRץϥåɥդǤɬפޤ֥ݡȤ뤹٤ƤΥ᥽åɤƱƤ¸פΤ褦˻ꤹ뺬Ϥޤ󡣤٤¹ΤˡХåȡ٥ŪƱ븢¤ͭƤȤᤷޤ -.SH "ɥơ󡦥" +APIでは、並行性セマンティクスについて、キーワード\fIsynchronized\fRに依存するのではなく、コメントの主説明としてドキュメント化する必要があります。たとえば、「1つのenumerationを複数のスレッドから並行して使用することはできない」のように記述します。ドキュメントには、これらのセマンティクスを実現する方法を記述しないでください。たとえば、\fIHashtable\fRオプションはスレッドセーフである必要がありますが、「エクスポートされるすべてのメソッドを同期化してそれを実現する」のように指定する根拠はありません。より高度な並行性のために、バケット・レベルで内部的に同期化する権限を保有しておくことをお薦めします。 +.SH "ドキュメンテーション・コメント" .PP -ΥǤϡɤΥȤȥȤηѾˤĤޤ -.SS "ɡ" +このセクションでは、ソース・コードのコメントとコメントの継承について説明します。 +.SS "ソース・コード・コメント" .PP -ɤǤդΥ饹󥿥ե᥽åɡ󥹥ȥ饯ޤϥեɤˡɥơ󡦥Ȥ򵭽Ҥ뤳ȤǤޤƥѥåˤɥơ󡦥ȤǤޤʸϼ㴳ۤʤޤפˤɥơ󡦥ȤǤޤɥơ󡦥Ȥϡ\fI/**\fRȡɽ\fI*/\fRδ֤ˤʸ鹽ޤƬΥꥹϳƹԤǻѤǤιǾܤޤȤΥƥȤϡʣԤˤ錄äƵҤǤޤ +ソース・コードの任意のクラス、インタフェース、メソッド、コンストラクタ、またはフィールドの宣言の前に、ドキュメンテーション・コメントを記述することができます。各パッケージにもドキュメンテーション・コメントを作成できます。構文は若干異なりますが、概要にもドキュメンテーション・コメントを作成できます。ドキュメンテーション・コメントは、\fI/**\fRと、終わりを表す\fI*/\fRの間にある文字から構成されます。先頭のアスタリスクは各行で使用でき、次の項で詳しく説明します。コメントのテキストは、複数行にわたって記述できます。 .sp .if n \{\ .RS 4 @@ -1093,7 +1093,7 @@ API .RE .\} .PP -ڡ󤹤ˤϡȤ1Ԥޤ +スペースを節約するには、コメントを1行に入れます。 .sp .if n \{\ .RS 4 @@ -1104,10 +1104,10 @@ API .if n \{\ .RE .\} -Ȥ.PP -ɥơ󡦥Ȥϡ饹󥿥ե󥹥ȥ饯᥽åɡޤϥեľ֤ˤΤǧޤ᥽åɤΤ֤Ƥɥơ󡦥Ȥ̵뤵ޤ\fIjavadoc\fRޥɤϡʸȤ1ĤΥɥơ󡦥Ȥǧޤ󡣥ѤǤ򻲾ȤƤ +コメントの配置.PP +ドキュメンテーション・コメントは、クラス、インタフェース、コンストラクタ、メソッド、またはフィールド宣言の直前に配置される場合にのみ認識されます。メソッドの本体に置かれているドキュメンテーション・コメントは無視されます。\fIjavadoc\fRコマンドは、宣言文ごとに1つのドキュメンテーション・コメントしか認識しません。タグを使用できる場所を参照してください。 .PP -褯ְ㤤ϡ饹Ȥȥ饹δ֤\fIimport\fRʸ֤ƤޤȤǤ\fIjavadoc\fRޥɤϥ饹Ȥ̵뤹Τǡ\fIimport\fRʸ򤳤ξ֤ʤǤ +よくある間違いは、クラス・コメントとクラス宣言の間に\fIimport\fR文を置いてしまうことです。\fIjavadoc\fRコマンドはクラス・コメントを無視するので、\fIimport\fR文をこの場所に配置しないでください。 .sp .if n \{\ .RS 4 @@ -1124,8 +1124,8 @@ public class Whatever{ } .if n \{\ .RE .\} -ȤΥѡ.PP -ɥơ󡦥ȤˤϡȤθ³󤬴ޤޤޤϡ϶ڤʸ\fI/**\fRǻϤޤꡢޤ³ޤϡƬʸ\fI@\fRιԤǽΥ֥åϤޤޤ(ƬΥꥹʸƬζڤʸ\fI/**\fRϽ)򵭽ҤΤߤΥȤ򵭽Ҥ뤳ȤǤޤϡʹߤ³뤳ȤϤǤޤ󡣥ΰϡʣԤˤ錄äƵҤǤޤο¤Ϥޤ󡣲⵭ҤǤ륿ȡ1󤷤ҤǤʤޤȤС\fI@see\fR饿ϻϤޤޤ +コメントのパーツ.PP +ドキュメンテーション・コメントには、主説明とその後に続くタグ・セクションが含まれます。主説明は、開始区切り文字\fI/**\fRで始まり、タグ・セクションまで続きます。タグ・セクションは、先頭文字が\fI@\fRの行で定義される最初のブロック・タグから始まります(先頭のアスタリスク、空白文字、先頭の区切り文字\fI/**\fRは除く)。主説明を記述せず、タグ・セクションのみのコメントを記述することもできます。主説明は、タグ・セクション以降に続けることはできません。タグの引数は、複数行にわたって記述できます。タグの数に制限はありません。何回も記述できるタグと、1回しか記述できないタグがあります。たとえば、次の\fI@see\fRタグからタグ・セクションは始まります。 .sp .if n \{\ .RS 4 @@ -1139,8 +1139,8 @@ public class Whatever{ } .if n \{\ .RE .\} -֥åӥ饤󡦥.PP -ϡ\fIjavadoc\fRޥɤɥơ󡦥üʥɤǤˤ2ĤΥפޤ1Ĥ\fI@tag\fRΤ褦ɽ֥å(ɥ󡦥ȤƤФ)⤦1Ĥ\fI{@tag}\fRΤ褦楫åǰϤɽ륤饤󡦥Ǥ֥åᤵˤϡƬΥꥹʸڤʸ(\fI/**\fR)ơԤƬ֤ɬפޤϡ\fI@\fRʸƥ̤ξǻѤƤ⡢γϤȤƲᤵʤȤ̣Ƥޤ\fI@\fRʸѤƹԤ򳫻ϤƤ⡢줬ᤵʤ褦ˤˤϡHTMLƥƥ\fI@\fRѤޤ줾Υ֥åˤϡϢդ줿ƥȤޤΥƥȤϡθ夫顢Υޤϥɥơ󡦥ȤκǸޤǤδ֤˵Ҥ줿ƥȤǤ(ޤϥȶڤʸ)δϢƥȤϡʣԤˤ錄äƵҤǤޤ饤󡦥ϡƥȤ򵭽ҤǤǤФɤˤǤ֤ȤǤᤵޤˤϥ֥å\fI@deprecated\fRȥ饤󡦥\fI{@link}\fRޤޤƤޤjavadoc򻲾ȤƤ +ブロックおよびインライン・タグ.PP +タグは、\fIjavadoc\fRコマンドが処理するドキュメンテーション・コメント内の特殊なキーワードです。タグには2つのタイプがあります。1つは\fI@tag\fRタグのように表記されるブロック・タグ(スタンドアロン・タグとも呼ばれる)、もう1つは\fI{@tag}\fRタグのように中カッコで囲んで表記されるインライン・タグです。ブロック・タグが解釈されるには、行頭のアスタリスク、空白文字、区切り文字(\fI/**\fR)を除いて、行の先頭に置く必要があります。これは、\fI@\fR文字をテキスト内の別の場所で使用しても、タグの開始として解釈されないことを意味しています。\fI@\fR文字を使用して行を開始しても、それが解釈されないようにするには、HTMLエンティティ\fI@\fRを使用します。それぞれのブロック・タグには、関連付けられたテキストがあります。このテキストは、タグの後から、次のタグの前、またはドキュメンテーション・コメントの最後までの間に記述されたテキストです(タグまたはコメント区切り文字を除く)。この関連テキストは、複数行にわたって記述できます。インライン・タグは、テキストを記述できる場所であればどこにでも置くことができ、解釈されます。次の例にはブロック・タグ\fI@deprecated\fRとインライン・タグ\fI{@link}\fRが含まれています。javadocタグを参照してください。 .sp .if n \{\ .RS 4 @@ -1153,10 +1153,10 @@ public class Whatever{ } .if n \{\ .RE .\} -HTMLǤΥȤε.PP -ƥȤHTMLƥƥHTMLѤHTMLǵҤɬפޤѤ֥饦ݡȤǤդHTMLΥСѤǤޤɸɥååȤϡǥ󥰡롦Ȥӥե졼ޤᡢɥơ󡦥ȰʳʬHTML 3\&.2˽򤷤ɤޤե졼ࡦåȤΤᡢ줿եˤHTML 4\&.0侩ޤ +HTMLでのコメントの記述.PP +テキストはHTMLエンティティとHTMLタグを使用してHTMLで記述される必要があります。使用するブラウザがサポートする任意のHTMLのバージョンを使用できます。標準ドックレットは、カスケーディング・スタイル・シートおよびフレームを含め、ドキュメンテーション・コメント以外の部分でHTML 3\&.2に準拠したコードを生成します。フレーム・セットのため、生成されたファイルにはHTML 4\&.0が推奨されます。 .PP -ȤС꾮(<)Ӥ礭(>)Υƥƥϡ\fI<\fR\fI>\fRȵҤɬפޤƱͤˡѥ(&)\fI&\fRȵҤɬפޤǤϡHTML\fI<b>\fRѤƤޤ +たとえば、より小さい記号(<)およびより大きい記号(>)のエンティティは、\fI<\fRおよび\fI>\fRと記述する必要があります。同様に、アンパサンド(&)は\fI&\fRと記述する必要があります。次の例では、太字のHTMLタグ\fI<b>\fRを使用しています。 .sp .if n \{\ .RS 4 @@ -1170,12 +1170,12 @@ HTML .if n \{\ .RE .\} -ƬΥꥹ.PP -\fIjavadoc\fRޥɤˤɥơ󡦥ȤβϻˡƹԤƬˤ륢ꥹ(*)ʸ˴ޤǽΥꥹ(*)ʸˤ䥿֤˴ޤƬΥꥹά硢ǥȤݻޤޤǥץ롦ɤ\fI<PRE>\fRΥɥơ󡦥ȤľŽդ褦ˡƬζʸϺʤʤޤ֥饦ϡʸ򥿥֤Χ˲ᤷޤǥȤε(ڤʸ\fI/**\fRޤ\fI<PRE>\fRǤϤʤ)ޡˤʤޤ -ǽʸ.PP -ƥɥơ󡦥ȤκǽʸϡƤ륨ƥƥ˴ؤʷ餫Ĵʥޥ꡼ʸǤɬפޤʸϡ򡢥֡ޤϹԽλʸ³ǽΥԥꥪɡޤϺǽΥ֥å֤ǽޤǽʸϡ\fIjavadoc\fRޥɤˤäHTMLڡƬˤСΥޥ꡼ʬ˥ԡޤ -ʣեɤ.PP -JavaץåȥեǤϡ1ĤʸʣΥեɤǤޤʸˤϡ1ĤΥɥơ󡦥ȤҤǤޤ󡣤ΥȤ٤ƤΥեɤФƥԡޤեɤȤ˥ɥơ󡦥Ȥ򵭽Ҥɬפϡƥեɤ̡ʸɬפޤȤСΥɥơ󡦥Ȥϡ1ĤȤƵҤŬڤǤξϡ2Ĥʬ뤳Ȥᤷޤ +先頭のアスタリスク.PP +\fIjavadoc\fRコマンドによるドキュメンテーション・コメントの解析時に、各行の先頭にあるアスタリスク(*)文字は破棄されます。最初のアスタリスク(*)文字より前にある空白やタブも破棄されます。行頭のアスタリスクを省略した場合、インデントを保持したままでサンプル・コードを\fI<PRE>\fRタグ内のドキュメンテーション・コメントに直接貼り付けられるように、先頭の空白文字は削除されなくなります。ブラウザは、空白文字をタブよりも一律に解釈します。インデントの起点は(区切り文字\fI/**\fRまたは\fI<PRE>\fRタグではなく)左マージンになります。 +最初の文.PP +各ドキュメンテーション・コメントの最初の文は、宣言されているエンティティに関する簡潔かつ完全なサマリー文である必要があります。この文は、空白、タブ、または行終了文字が続く最初のピリオド、または最初のブロック・タグがある位置で終わります。最初の文は、\fIjavadoc\fRコマンドによってHTMLページの先頭にあるメンバーのサマリーの部分にコピーされます。 +複数フィールドの宣言.PP +Javaプラットフォームでは、1つの文で複数のフィールドを宣言できます。ただし、この文には、1つのドキュメンテーション・コメントしか記述できません。そのコメントが、すべてのフィールドに対してコピーされます。フィールドごとにドキュメンテーション・コメントを記述する必要がある場合は、各フィールドを別々の文で宣言する必要があります。たとえば、次のドキュメンテーション・コメントは、1つの宣言として記述すると不適切です。この場合は、宣言を2つに分けることをお薦めします。 .sp .if n \{\ .RS 4 @@ -1191,7 +1191,7 @@ public int x, y; // Avoid this .RE .\} .PP -\fIjavadoc\fRޥɤϡΥɤ鼡Τ褦ʥɥȤޤ +\fIjavadoc\fRコマンドは、上のコードから次のようなドキュメントを生成します。 .sp .if n \{\ .RS 4 @@ -1216,27 +1216,27 @@ public int y .\} .PP The horizontal and vertical distances of point (x, y)\&. -إåλ.PP -СФƥɥơ󡦥Ȥ򵭽ҤȤˤϡ\fI<H1>\fR\fI<H2>\fRʤɤHTMLФѤʤȤᤷޤ\fIjavadoc\fRޥɤϡʹ¤ɥȤΤǡΤ褦ʹ¤ѤƤȡɥȤηƶ뤳Ȥޤ饹ѥåΥȤǤϡθФѤȼι¤ꤷƤޤޤ -.SS "᥽åɡȤηѾ" +ヘッダー・タグの使用.PP +メンバーに対してドキュメンテーション・コメントを記述するときには、\fI<H1>\fRや\fI<H2>\fRなどのHTML見出しタグを使用しないことをお薦めします。\fIjavadoc\fRコマンドは、完全な構造化ドキュメントを作成するので、このような構造化タグが使用されていると、生成ドキュメントの形式が悪影響を受けることがあります。ただし、クラスやパッケージのコメントでは、これらの見出しを使用して独自の構造を指定してかまいません。 +.SS "メソッド・コメントの継承" .PP -\fIjavadoc\fRޥɤǤϡ饹ӥ󥿥եǥ᥽åɡȤѾơƥȤϤꡢŪ˥᥽åɡȤѾ뤳ȤǤޤ󥹥ȥ饯եɡӥͥȤ줿饹ϡɥơ󡦥ȤѾޤ +\fIjavadoc\fRコマンドでは、クラスおよびインタフェースでメソッド・コメントを継承して、欠落したテキストを入力したり、明示的にメソッド・コメントを継承することができます。コンストラクタ、フィールド、およびネストされたクラスは、ドキュメンテーション・コメントを継承しません。 .PP -\fB:\fR -ɥơ󡦥Ȥ򥳥ԡѤˤϡѾ᥽åɤΥե뤬\fI\-sourcepath\fRץǻꤷѥΤߤ֤Ƥɬפޤޥɥ饤ǡ饹ѥåϤɬפϤޤ󡣤ϥ꡼1\&.3\&.\fIn\fRȤоŪǤޤǤϡ饹ɥȲ륯饹Ǥ뤳ȤɬפǤ -ƥȤ.PP -ޤ\fI@return\fR\fI@param\fR\fI@throws\fR᥽åɡȤƤ硢\fIjavadoc\fRޥɤϡбޤϥȤ򡢤줬С饤ɤޤϼƤ᥽å()饳ԡޤ᥽åɡȤηѾ򻲾ȤƤ +\fB注意:\fR +ドキュメンテーション・コメントをコピーに利用するには、継承したメソッドのソース・ファイルが\fI\-sourcepath\fRオプションで指定したパスのみに置かれている必要があります。コマンドラインで、クラスもパッケージも渡す必要はありません。この点はリリース1\&.3\&.\fIn\fR以前とは対照的です。これまでは、クラスがドキュメント化されるクラスであることが必要でした。 +欠落テキストの入力.PP +主説明、または\fI@return\fR、\fI@param\fR、\fI@throws\fRタグがメソッド・コメントから欠落している場合、\fIjavadoc\fRコマンドは、対応する主説明またはタグ・コメントを、それがオーバーライドまたは実装しているメソッド(ある場合)からコピーします。メソッド・コメントの継承を参照してください。 .PP -Υѥ᡼\fI@param\fRĤʤ硢Υѥ᡼ΥȤ̤ηѾؤΥ᥽åɤ饳ԡޤ㳰\fI@throws\fRĤʤ硢㳰Ƥˤꡢ\fI@throws\fRԡޤ +特定のパラメータの\fI@param\fRタグが見つからない場合、そのパラメータのコメントが、上位の継承階層のメソッドからコピーされます。特定の例外の\fI@throws\fRタグが見つからない場合、その例外が宣言されている場合にかぎり、\fI@throws\fRタグがコピーされます。 .PP -ưϥ꡼1\&.3ưȤоŪǤޤǤΥСǤϡޤϥ¸ߤСȤϰڷѾޤǤ +この動作はリリース1\&.3以前の動作とは対照的です。これまでのバージョンでは、主説明またはタグが存在すれば、コメントは一切継承されませんでした。 .PP -javadocӥץ򻲾ȤƤ -ŪʷѾ.PP -\fI{@inheritDoc}\fR饤󡦥᥽åɤμޤ\fI@return\fR\fI@param\fR\fI@throws\fRȤޤбѾ줿ޤϥȤϡξ˥ԡޤ -.SS "饹ӥ󥿥եηѾ" +javadocタグおよびオプションを参照してください。 +明示的な継承.PP +\fI{@inheritDoc}\fRインライン・タグをメソッドの主説明または\fI@return\fR、\fI@param\fR、\fI@throws\fRタグ・コメントに挿入します。対応する継承された主説明またはタグ・コメントは、その場所にコピーされます。 +.SS "クラスおよびインタフェースの継承" .PP -ȤηѾϡ饹ӥ󥿥եηѾΡͤ뤹٤Ƥξȯޤ +コメントの継承は、クラスおよびインタフェースからの継承の、考えられるすべての場合に発生します。 .sp .RS 4 .ie n \{\ @@ -1246,7 +1246,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饹Υ᥽åɤѡ饹Υ᥽åɤ򥪡С饤ɤƤ +クラスのメソッドがスーパークラスのメソッドをオーバーライドしている場合 .RE .sp .RS 4 @@ -1257,7 +1257,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -󥿥եΥ᥽åɤѡ󥿥եΥ᥽åɤ򥪡С饤ɤƤ +インタフェースのメソッドがスーパーインタフェースのメソッドをオーバーライドしている場合 .RE .sp .RS 4 @@ -1268,15 +1268,15 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饹Υ᥽åɤ󥿥եΥ᥽åɤƤ +クラスのメソッドがインタフェースのメソッドを実装している場合 .RE .PP -ǽ2ĤΥǤϡ\fIjavadoc\fRޥɤϡС饤ɤƤ᥽åɤΥɥ\fI֥С饤ɡ\fRȤФޤȤѾƤ뤫ɤˤ餺С饤ɤƤ᥽åɤؤΥ󥯤ޤޤޤ +最初の2つのケースでは、\fIjavadoc\fRコマンドは、オーバーライドしているメソッドのドキュメント内に\fI「オーバーライド」\fRという小見出しを生成します。コメントが継承されているかどうかにかかわらず、オーバーライドされているメソッドへのリンクが含まれます。 .PP -3ܤΥ(Υ饹Υ᥽åɤ󥿥եΥ᥽åɤƤ)Ǥϡ\fIjavadoc\fRޥɤϡС饤ɤƤ᥽åɤΥɥ\fI\fRȤФޤȤѾƤ뤫ɤˤ餺Ƥ᥽åɤؤΥ󥯤ޤޤޤ -.SS "᥽åɡȤΥ르ꥺ" +3つ目のケース(特定のクラスのメソッドがインタフェースのメソッドを実装している場合)では、\fIjavadoc\fRコマンドは、オーバーライドしているメソッドのドキュメント内に\fI「定義」\fRという小見出しを生成します。コメントが継承されているかどうかにかかわらず、実装されているメソッドへのリンクが含まれます。 +.SS "メソッド・コメントのアルゴリズム" .PP -᥽åɤ˥ɥơ󡦥Ȥʤޤ\fI{@inheritDoc}\fR硢\fIjavadoc\fRޥɤϼΥ르ꥺѤŬѤǤ륳Ȥ򸡺ޤ르ꥺϡǤꤵŬѲǽʥɥơ󡦥Ȥõѡ饹⥤󥿥եͥ褹褦߷פƤޤ +メソッドにドキュメンテーション・コメントがない、または\fI{@inheritDoc}\fRタグがある場合、\fIjavadoc\fRコマンドは次のアルゴリズムを使用して適用できるコメントを検索します。アルゴリズムは、最も特定される適用可能なドキュメンテーション・コメントを探し、スーパークラスよりもインタフェースを優先するように設計されています。 .sp .RS 4 .ie n \{\ @@ -1286,7 +1286,7 @@ javadoc .sp -1 .IP " 1." 4.2 .\} -ľܤ˼Ƥ(ޤϡĥƤ)󥿥ե򡢥᥽åɤ\fIimplements\fR(ޤ\fIextends\fR)Ȥθ˽иǡ1ĤĴ٤ޤΥ᥽åɤˤĤƺǽ˸Ĥäɥơ󡦥ȤѤޤ +直接に実装されている(または、拡張されている)インタフェースを、メソッドの宣言で\fIimplements\fR(または\fIextends\fR)という語の後に出現する順序で、1つずつ調べます。このメソッドについて最初に見つかったドキュメンテーション・コメントを採用します。 .RE .sp .RS 4 @@ -1297,7 +1297,7 @@ javadoc .sp -1 .IP " 2." 4.2 .\} -1ǥɥơ󡦥ȤĤʤäϡľܼƤ(ޤϡĥƤ)󥿥եΤ줾ФơΥ르ꥺΤƵŪŬѤޤ(κݤνϡ1ǥ󥿥եĴ٤ȤνƱ) +手順1でドキュメンテーション・コメントが見つからなかった場合は、直接実装されている(または、拡張されている)インタフェースのそれぞれに対して、このアルゴリズム全体を再帰的に適用します(その際の順序は、手順1でインタフェースを調べたときの順序と同じ)。 .RE .sp .RS 4 @@ -1308,7 +1308,7 @@ javadoc .sp -1 .IP " 3." 4.2 .\} -2ǥɥơ󡦥ȤĤʤäǡΥ饹\fIObject\fRʳΥ饹Ǥ뤬󥿥եǤϤʤϡΤ褦˽ޤ +手順2でドキュメンテーション・コメントが見つからなかった場合で、このクラスが\fIObject\fR以外のクラスであるが、インタフェースではない場合は、次のように処理します。 .sp .RS 4 .ie n \{\ @@ -1318,7 +1318,7 @@ javadoc .sp -1 .IP " 1." 4.2 .\} -ѡ饹ˤΥ᥽åɤˤĤƤΥɥơ󡦥ȤҤƤϡΥȤѤޤ +スーパークラスにこのメソッドについてのドキュメンテーション・コメントが記述されている場合は、そのコメントを採用します。 .RE .sp .RS 4 @@ -1329,14 +1329,14 @@ javadoc .sp -1 .IP " 2." 4.2 .\} -3aǥɥơ󡦥ȤĤʤäϡѡ饹ФơΥ르ꥺΤƵŪŬѤޤ +手順3aでドキュメンテーション・コメントが見つからなかった場合は、スーパークラスに対して、このアルゴリズム全体を再帰的に適用します。 .RE .RE -.SH "JAVADOC" +.SH "JAVADOCタグ" .PP -\fIjavadoc\fRޥɤϡJavaΥɥơ󡦥ޤ줿̤ʥϤޤ\fIjavadoc\fRѤȡAPI򥽡ɤ鼫ưŪǤޤϥåȥޡ(\fI@\fR)ǻϤޤꡢʸȾʸ̤ޤΥϡɽƤȤʸȾʸѤϤɬפޤϡԤƬ(ƬζʸȾάǽʥꥹθ)֤ɬפޤʤȡƥȤȤưޤȤơƱ̾Υ1սˤޤȤޤȤС\fI@see\fRʣϡ٤ƱˤޤȤ֤ޤܺ٤ϡѤǤ򻲾ȤƤ +\fIjavadoc\fRコマンドは、Javaのドキュメンテーション・コメント内に埋め込まれた特別なタグを解析します。\fIjavadoc\fRタグを使用すると、完全な整形式のAPIをソース・コードから自動的に生成できます。タグはアットマーク記号(\fI@\fR)で始まり、大文字と小文字が区別されます。これらのタグは、表示されているとおりに大文字と小文字を使用して入力する必要があります。タグは、行の先頭(先頭の空白文字と省略可能なアスタリスクの後)に置く必要があります。そうしないと、テキストとして扱われます。慣例として、同じ名前のタグは1箇所にまとめます。たとえば、\fI@see\fRタグが複数ある場合は、すべて同じ場所にまとめて配置します。詳細は、タグを使用できる場所を参照してください。 .PP -ˤϡΥפޤ +タグには、次のタイプがあります。 .sp .RS 4 .ie n \{\ @@ -1346,7 +1346,7 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -֥å: ֥åϼ³ˤΤ֤ޤ֥åϡ\fI@tag\fRηȤޤ +ブロック・タグ: ブロック・タグは主説明に続くタグ・セクション内にのみ配置します。ブロック・タグは、\fI@tag\fRの形式をとります。 .RE .sp .RS 4 @@ -1357,52 +1357,52 @@ javadoc .sp -1 .IP \(bu 2.3 .\} -饤󡦥: 饤󡦥ϼޤϥ֥åΥǤդξ֤ޤ饤󡦥\fI{@tag}\fRΤ褦楫åǰϤߤޤ +インライン・タグ: インライン・タグは主説明内またはブロック・タグのコメント内の任意の場所に配置します。インライン・タグは\fI{@tag}\fRのように中カッコで囲みます。 .RE .PP -ࡦˤĤƤϡ\-tag tagname:Xaoptcmf:"taghead"򻲾ȤƤѤǤ⻲ȤƤ -.SS "" +カスタム・タグについては、\-tag tagname:Xaoptcmf:"taghead"を参照してください。タグを使用できる場所も参照してください。 +.SS "タグの説明" .PP @author \fIname\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI\-author\fRץ󤬻ѤƤ硢ꤷ̾ΥƥȤκԥȥɥȤɲäޤ1ĤΥɥơ󡦥Ȥʣ\fI@author\fRޤ뤳ȤǤޤ1Ĥ\fI@author\fR1Ĥ̾ꤹ뤳Ȥ⡢ʣ̾ꤹ뤳ȤǤޤԤξϡ\fIjavadoc\fRޥɤˤä̾̾δ֤˥(,)ȶʸޤԤξϡƥΤϤ뤳ȤʤɥȤ˥ԡޤäơޤǤϤʤƸб̾ڤʸѤɬפȤˡ1Ԥʣ̾ǤޤJavadocġǤDocȤεˡ@author˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@author)򻲾ȤƤ +\fI\-author\fRオプションが使用されている場合、指定した名前のテキストの作成者エントリを生成されるドキュメントに追加します。1つのドキュメンテーション・コメントに複数の\fI@author\fRタグを含めることができます。1つの\fI@author\fRタグに1つの名前を指定することも、複数の名前を指定することもできます。前者の場合は、\fIjavadoc\fRコマンドによって名前と名前の間にカンマ(,)と空白文字が挿入されます。後者の場合は、テキスト全体が解析されることなく、生成ドキュメントにコピーされます。したがって、カンマではなく、各言語に対応した名前区切り文字を使用する必要があるときに、1行に複数の名前を指定できます。JavadocツールでのDocコメントの記述方法の@authorに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@author)を参照してください。 .RE .PP {@code \fItext\fR} .RS 4 -JDK 1\&.5Ƴ +JDK 1\&.5で導入 .sp -\fI<code>{@literal}</code>\fRƱǤ +\fI<code>{@literal}</code>\fRと同等です。 .sp -ƥȤHTMLޡåפޤϥͥȤ줿JavadocȤƲ᤻ˡtext򥳡ɡեȤɽޤˤꡢɥơ󡦥ȤǤϡѥ᡼η(\fI<Object>\fR)(\fI3 < 4\fR)(\fI<\-\fR)ʤɤǡ̾λå(<>)HTMLƥƥ(\fI<\fR\fI>\fR)Τ˻ѤǤޤȤСɥơ󡦥\fI{@code A<B>C}\fR\fIA<B>C\fRȤѹ줺줿HTMLڡɽޤĤޤꡢ\fI<B>\fRȤƲᤵ줺ΥեȤϥɡեȤˤʤޤɡեȤʤƱǽ¸ˤϡ\fI{@literal}\fRѤޤ +テキストをHTMLマークアップまたはネストされたJavadocタグとして解釈せずに、textをコード・フォントで表示します。これにより、ドキュメンテーション・コメントでは、パラメータの型(\fI<Object>\fR)、不等号(\fI3 < 4\fR)、矢印(\fI<\-\fR)などで、通常の山カッコ(<および>)をHTMLエンティティ(\fI<\fRおよび\fI>\fR)のかわりに使用できます。たとえば、ドキュメンテーション・コメント\fI{@code A<B>C}\fRは\fIA<B>C\fRとして変更されずに生成されたHTMLページに表示されます。つまり、\fI<B>\fRが太字として解釈されず、そのフォントはコード・フォントになります。コード・フォントなしで同じ機能を実現するには、\fI{@literal}\fRタグを使用します。 .RE .PP @deprecated \fIdeprecated\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -APIư³ޤAPIѤʤȤ륳Ȥɲäޤ\fIjavadoc\fRޥɤϡ\fIdeprecated\-text\fR˰ưƥåˤηٹֿ侩Ƥޤ󡣡פɲäޤΥϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤ +このAPIは動作し続けますが、このAPIを使用しないことを薦めるコメントを追加します。\fIjavadoc\fRコマンドは、\fIdeprecated\-text\fRを主説明の前に移動してイタリックにし、その前に太字の警告「推奨されていません。」を追加します。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。 .sp -侩ƥȤκǽʸǤϡAPI侩ʤʤäȡؤȤƻѤAPI桼󼨤ɬפޤ\fIjavadoc\fRޥɤϡκǽʸ򡢥ޥ꡼Ⱥ˥ԡޤθʸ侩ˤʤäͳ뤳ȤǤޤAPIؤ\fI{@link}\fR(Javadoc 1\&.2ʹߤξ)ޤɬפޤ +非推奨テキストの最初の文では、そのAPIが推奨されなくなった時期と、代替として使用するAPIをユーザーに提示する必要があります。\fIjavadoc\fRコマンドは、この最初の文を、サマリー・セクションと索引にコピーします。その後の文で非推奨になった理由を説明することもできます。代替APIを指し示す\fI{@link}\fRタグ(Javadoc 1\&.2以降の場合)を含める必要があります。 .sp -\fI@deprecated annotation\fRѤƥץǤ侩ˤޤAPI侩ˤˡȻ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html)򻲾ȤƤ +\fI@deprecated annotation\fRタグを使用してプログラム要素を非推奨にします。APIを非推奨にする方法と時期 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/deprecation/deprecation\&.html)を参照してください。 .sp -JavadocġǤDocȤεˡ@deprecated˴ؤ +JavadocツールでのDocコメントの記述方法の@deprecatedに関する項 -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@deprecated)⻲ȤƤ +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@deprecated)も参照してください。 .RE .PP {@docRoot} .RS 4 -JDK 1\&.3Ƴ +JDK 1\&.3で導入 .sp -ڡΡɥȤ()롼ȡǥ쥯ȥؤХѥɽޤΥϡΥڡҤΥʤɡ뤹٤ƤΥڡ黲ȤեȤ߹ȤǤ̾ϡƥڡκDzΥڡ˥󥯤ޤ +生成されるページからの、生成ドキュメントの(生成先)ルート・ディレクトリへの相対パスを表します。このタグは、著作権のページや会社のロゴなど、生成されるすべてのページから参照するファイルを組み込むときに便利です。通常は、各ページの最下部から著作権のページにリンクします。 .sp -\fI{@docRoot}\fRϡޥɥ饤Ǥɥơ󡦥ǤѤǤޤΥϡǤդΥ(\fI@return\fR\fI@param\fR\fI@deprecated\fRʤ)Υƥʬޤࡢ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤ +この\fI{@docRoot}\fRタグは、コマンドラインでもドキュメンテーション・コメント内でも使用できます。このタグは、任意のタグ(\fI@return\fR、\fI@param\fRおよび\fI@deprecated\fRタグなど)のテキスト部分を含む、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。 .sp .RS 4 .ie n \{\ @@ -1412,9 +1412,9 @@ JDK 1\&.3 .sp -1 .IP \(bu 2.3 .\} -ޥɥ饤ǡإåեåޤϺDzΤ褦ޤ\fIjavadoc \-bottom \*(Aq<a href="{@docRoot}/copyright\&.html">Copyright</a>\*(Aq\fR +コマンドラインで、ヘッダー、フッターまたは最下部が次のように定義されます。\fIjavadoc \-bottom \*(Aq<a href="{@docRoot}/copyright\&.html">Copyright</a>\*(Aq\fR .sp -\fI{@docRoot}\fRmakefileǤΤ褦Ѥ硢\fImakefile\fRץǤϡ楫å\fI{}\fRʸ̤˥פɬפޤȤСInprise MAKEС5\&.2WindowsǼ¹Ԥϡ\fI{{@docRoot}}\fRΤ褦ˡ楫åŤˤɬפޤ\fI\-bottom\fRץʤɤΥץؤΰϤΤˡ(ŤǤϤʤ)ɬפǤ(\fIhref\fRϤϾά) +\fI{@docRoot}\fRタグをmakefile内でこのように利用する場合、一部の\fImakefile\fRプログラムでは、中カッコ\fI{}\fR文字を特別にエスケープする必要があります。たとえば、Inprise MAKEバージョン5\&.2をWindows上で実行する場合は、\fI{{@docRoot}}\fRのように、中カッコを二重にする必要があります。\fI\-bottom\fRオプションなどのオプションへの引数を囲むのに、二重(一重ではなく)引用符も必要です(\fIhref\fR引数を囲む引用符は省略)。 .RE .sp .RS 4 @@ -1425,7 +1425,7 @@ JDK 1\&.3 .sp -1 .IP \(bu 2.3 .\} -ɥơ󡦥ȤǤ +ドキュメンテーション・コメントでは .sp .if n \{\ .RS 4 @@ -1438,24 +1438,24 @@ JDK 1\&.3 .if n \{\ .RE .\} -ΥɬפͳϡɥȤ֥ѥåƱijع¤Υǥ쥯ȥ˳Ǽ뤫Ǥ\fI<a href="{@docRoot}/copyright\&.html">\fRϡ\fIjava/lang/Object\&.java\fRФƤ\fI<a href="\&.\&./\&.\&./copyright\&.html">\fR˲褵졢\fIjava/lang/ref/Reference\&.java\fRФƤ\fI<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fR˲褵ޤ +このタグが必要な理由は、生成ドキュメントが、サブパッケージと同じ深さを持つ階層構造のディレクトリに格納されるからです。式\fI<a href="{@docRoot}/copyright\&.html">\fRは、\fIjava/lang/Object\&.java\fRに対しては\fI<a href="\&.\&./\&.\&./copyright\&.html">\fRに解決され、\fIjava/lang/ref/Reference\&.java\fRに対しては\fI<a href="\&.\&./\&.\&./\&.\&./copyright\&.html">\fRに解決されます。 .RE .RE .PP @exception \fIclass\-name description\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI@throws\fRƱǤ@throws class\-name description򻲾ȤƤ +\fI@throws\fRタグと同じです。@throws class\-name descriptionを参照してください。 .RE .PP {@inheritDoc} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -ǤᤤѾǽʥ饹ޤϼǽʥ󥿥ե顢Υΰ֤ˤ븽ߤΥɥơ󡦥ȤˡɥȤѾ(ԡ)ޤˤꡢŪʥȤѾĥ꡼ξ̤˵ҤԡƥȤѤƵҤ뤳ȤǤޤ +最も近い継承可能なクラスまたは実装可能なインタフェースから、このタグの位置にある現在のドキュメンテーション・コメントに、ドキュメントを継承(コピー)します。これにより、より汎用的なコメントを継承ツリーの上位に記述し、コピーしたテキストを使用して記述することができます。 .sp -Υϡɥơ󡦥Ȥμΰ֤ǤΤͭǤ +このタグは、ドキュメンテーション・コメントの次の位置でのみ有効です。 .sp .RS 4 .ie n \{\ @@ -1465,7 +1465,7 @@ JDK 1\&.4 .sp -1 .IP \(bu 2.3 .\} -᥽åɤμ֥å⡣ξ硢ϡ̳ؤΥ饹ޤϥ󥿥ե饳ԡޤ +メソッドの主説明ブロック内。この場合、主説明は、上位階層のクラスまたはインタフェースからコピーされます。 .RE .sp .RS 4 @@ -1476,24 +1476,24 @@ JDK 1\&.4 .sp -1 .IP \(bu 2.3 .\} -᥽åɤ\fI@return\fR\fI@param\fR\fI@throws\fRΥƥȰ⡣ξ硢ƥȤϡ̳ؤб륿饳ԡޤ +メソッドの\fI@return\fR、\fI@param\fR、\fI@throws\fRタグのテキスト引数内。この場合、タグ・テキストは、上位階層の対応するタグからコピーされます。 .RE .sp -ѾؤǥȤ򸫤Ĥˡ˴ؤϡ᥽åɡȤηѾ򻲾ȤƤΥĤʤ硢Ȥϡι롼˱ơưŪ˷Ѿ뤫ɤޤޤ +継承階層でコメントを見つける方法に関する説明は、メソッド・コメントの継承を参照してください。このタグが見つからない場合、コメントは、この項で説明するルールに応じて、自動的に継承されるかどうかが決まります。 .RE .PP {@link \fIpackage\&.class#member label\fR} .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ɽƥlabelȤȤ˥饤󡦥󥯤ޤlabelϡȥ饹λꤵ줿ѥå饹ޤϥС̾ΥɥȤؤޤΥϡ\fI@return\fR\fI@param\fR\fI@deprecated\fRʤɤǤդΥΥƥʬޤࡢ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡӥեɤͭǤJavadocġǤDocȤεˡ@link˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#{@link)򻲾ȤƤ +表示テキストlabelとともにインライン・リンクを挿入します。labelは、参照クラスの指定されたパッケージ、クラス、またはメンバーの名前のドキュメントを指し示します。このタグは、\fI@return\fR、\fI@param\fRおよび\fI@deprecated\fRタグなどの任意のタグのテキスト部分を含む、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、およびフィールドで有効です。JavadocツールでのDocコメントの記述方法の@linkに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#{@link)を参照してください。 .sp -Υ\fI@see\fR˻ƤޤɤΥ⡢\fIpackage\&.class#member\fR\fIlabel\fRλˡȡͭʹʸƱǤʰ㤤ϡ\fI{@link}\fRǤϡִϢܡץ˥󥯤֤뤫ˡ饤󡦥󥯤ȤǤ饤󡦥ƥȤ¾ʬȶ̤뤿ˡ\fI{@link}\fRκǽȺǸ楫å򵭽Ҥޤ٥DZ楫å(\fI}\fR)Ѥɬפ硢HTMLƥƥˡ\fI}\fRѤޤ +このタグは\fI@see\fRタグに似ています。どちらのタグも、\fIpackage\&.class#member\fRと\fIlabel\fRの参照方法と、有効な構文が同じです。主な違いは、\fI{@link}\fRタグでは、「関連項目」セクションにリンクが配置されるかわりに、インライン・リンクが生成されるという点です。インライン・テキストの他の部分と区別するために、\fI{@link}\fRタグの最初と最後に中カッコを記述します。ラベル内で右中カッコ(\fI}\fR)を使用する必要がある場合、HTMLエンティティ記法\fI}\fRを使用します。 .sp -1ʸǻѤǤ\fI{@link}\fRο¤Ϥޤ󡣤Υϡɥơ󡦥Ȥμʬޤ\fI@deprecated\fR\fI@return\fR\fI@param\fRʤɤǤդΥΥƥʬǻѤǤޤ +1つ文の中で使用できる\fI{@link}\fRタグの数に制限はありません。このタグは、ドキュメンテーション・コメントの主説明部分、または\fI@deprecated\fR、\fI@return\fR、\fI@param\fRタグなどの任意のタグのテキスト部分で使用できます。 .sp -ȤСΥȤǤ\fIgetComponentAt(int,int)\fR᥽åɤ򻲾ȤƤޤ +たとえば、次のコメントでは\fIgetComponentAt(int,int)\fRメソッドを参照しています。 .sp .if n \{\ .RS 4 @@ -1504,7 +1504,7 @@ Use the {@link #getComponentAt(int, int) getComponentAt} method\&. .if n \{\ .RE .\} -ɸɥååȤǤϡΥɤ鼡HTMLޤ(ΥȤƱѥå̤Υ饹򻲾ȤƤ) +標準ドックレットでは、このコードから次のHTMLが生成されます(このコメントが同じパッケージの別のクラスを参照している場合)。 .sp .if n \{\ .RS 4 @@ -1515,7 +1515,7 @@ Use the <a href="Component\&.html#getComponentAt(int, int)">getComponentAt</a> m .if n \{\ .RE .\} -ιԤϡΤ褦Webڡɽޤ +前の行は、次のようにWebページに表示されます。 .sp .if n \{\ .RS 4 @@ -1530,28 +1530,28 @@ Use the getComponentAt method\&. .PP {@linkplain \fIpackage\&.class#member label\fR} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -\fI{@link}\fRƱư򤷤ޤ󥯡٥뤬ɡեȤǤϤʤץ졼󡦥ƥȤɽۤʤޤ٥뤬ץ졼󡦥ƥȤǵҤƤǤȤС\fIRefer to {@linkplain add() the overridden method}\fR\&.פϡRefer to the overridden methodפɽޤ +\fI{@link}\fRタグと同じ動作をしますが、リンク・ラベルがコード・フォントではなくプレーン・テキストで表示される点が異なります。ラベルがプレーン・テキストで記述されていると便利です。たとえば、「\fIRefer to {@linkplain add() the overridden method}\fR\&.」は「Refer to the overridden method」と表示されます。 .RE .PP {@literal \fItext\fR} .RS 4 -JDK 1\&.5Ƴ +JDK 1\&.5で導入 .sp -ƥȤHTMLޡåפޤϥͥȤ줿JavadocȤƲ᤻ˡtextɽޤˤꡢɥơ󡦥ȤǤϡѥ᡼η(\fI<Object>\fR)(\fI3 < 4\fR)(<\-)ʤɤǡå(\fI<>\fR)HTMLƥƥ(\fI<\fR\fI>\fR)Τ˻ѤǤޤȤСɥơ󡦥ȤΥƥ\fI{@literal A<B>C}\fR\fIA<B>C\fRȤơ֥饦줿HTMLڡѹ줺ɽޤ\fI<B>\fRȤƲᤵޤ(ɡեȤˤʤޤ)ɡեȤƱǽ¸ˤϡ\fI{@code}\fRѤޤ +テキストをHTMLマークアップまたはネストされたJavadocタグとして解釈せずに、textを表示します。これにより、ドキュメンテーション・コメントでは、パラメータの型(\fI<Object>\fR)、不等号(\fI3 < 4\fR)、矢印(<\-)などで、山カッコ(\fI<および>\fR)をHTMLエンティティ(\fI<\fRおよび\fI>\fR)のかわりに使用できます。たとえば、ドキュメンテーション・コメントのテキスト\fI{@literal A<B>C}\fRは\fIA<B>C\fRとして、ブラウザの生成されたHTMLページに変更されずに表示されます。\fI<B>\fRは太字として解釈されません(コード・フォントになりません)。コード・フォントで同じ機能を実現するには、\fI{@code}\fRタグを使用します。 .RE .PP @param \fIparameter\-name description\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -֥ѥ᡼ץˡꤵ줿\fIparameter\-name\fRθ˻ꤵ줿description³ƥѥ᡼ɲäޤɥơ󡦥Ȥ򵭽ҤȤˤϡdescriptionʣԤˤ錄äƵҤ뤳ȤǤޤΥϡ᥽åɡ󥹥ȥ饯ޤϥ饹Υɥơ󡦥ǤΤͭǤJavadocġǤDocȤεˡ@param˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@param)򻲾ȤƤ +「パラメータ」セクションに、指定された\fIparameter\-name\fRの後に指定されたdescriptionを続けてパラメータを追加します。ドキュメンテーション・コメントを記述するときには、descriptionを複数行にわたって記述することもできます。このタグは、メソッド、コンストラクタ、またはクラスのドキュメンテーション・コメント内でのみ有効です。JavadocツールでのDocコメントの記述方法の@paramに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@param)を参照してください。 .sp -\fIparameter\-name\fRϡ᥽åɤޤϥ󥹥ȥ饯ǤΥѥ᡼̾饹᥽åɤޤϥ󥹥ȥ饯ηѥ᡼̾ˤʤޤåǤΥѥ᡼̾Ϥߡѥ᡼Ѥ뤳Ȥꤷޤ +\fIparameter\-name\fRは、メソッドまたはコンストラクタでのパラメータの名前か、クラス、メソッドまたはコンストラクタの型パラメータの名前になります。山カッコでこのパラメータ名を囲み、型パラメータを使用することを指定します。 .sp -饹ηѥ᡼: +クラスの型パラメータの例: .sp .if n \{\ .RS 4 @@ -1566,7 +1566,7 @@ public interface List<E> extends Collection<E> { .if n \{\ .RE .\} -᥽åɤηѥ᡼: +メソッドの型パラメータの例: .sp .if n \{\ .RS 4 @@ -1588,35 +1588,35 @@ public interface List<E> extends Collection<E> { .PP @return \fIdescription\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -͡ץɲäơdescriptionΥƥȤ񤭹ߤޤΥƥȤǤϡͤηȡͤϰϤˤĤƵҤɬפޤΥϡ᥽åɤΥɥơ󡦥ȤǤΤͭǤJavadocġǤDocȤεˡ@return˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@return)򻲾ȤƤ +「戻り値」セクションを追加して、descriptionのテキストを書き込みます。このテキストでは、戻り値の型と、取り得る値の範囲について記述する必要があります。このタグは、メソッドのドキュメンテーション・コメントでのみ有効です。JavadocツールでのDocコメントの記述方法の@returnに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@return)を参照してください。 .RE .PP @see \fIreference\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fIִϢܡ\fRФɲäơreferenceؤ󥯡ޤϥƥȡȥ񤭹ߤޤ1ĤΥɥơ󡦥ȤˤǤդο\fI@see\fRޤ뤳ȤǤޤϤ٤ƱФβ˥롼ײޤ\fI@see\fRˤϡ3ĤΥפηޤηǤŪǤΥϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤͭǤѥå饹ޤϥСФ륤饤󡦥󥯤ʸˡϡ\fI{@link}\fR򻲾ȤƤ +\fI「関連項目」\fR見出しを追加して、referenceを指すリンク、またはテキスト・エントリを書き込みます。1つのドキュメンテーション・コメントには任意の数の\fI@see\fRタグを含めることができますが、それらはすべて同じ見出しの下にグループ化されます。\fI@see\fRタグには、3つのタイプの形式があります。この形式が最も一般的です。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドで有効です。パッケージ、クラス、またはメンバーに対するインライン・リンクを文中に挿入する方法は、\fI{@link}\fRを参照してください。 .sp -\fB1\fR@see -\fIstring\fRϡ\fIstring\fRΥƥȡȥɲäޤ󥯤ޤstringϡҤޤURLǤϥǤʤλǤ\fIjavadoc\fRޥɤϡǽʸȤŰ(")򸡺ơηҤηȶ̤ޤȤС\fI@see "The Java Programming Language"\fRϼΥƥȤޤ +\fB形式1\fR。@see +\fIstring\fRタグ形式は、\fIstring\fRのテキスト・エントリを追加します。リンクは生成されません。stringは、書籍またはURLではアクセスできない情報の参照先です。\fIjavadoc\fRコマンドは、最初の文字として二重引用符(")を検索して、この形式を前述の形式と区別します。たとえば、\fI@see "The Java Programming Language"\fRは次のテキストを生成します。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp "The Java Programming Language" .sp -\fB2\fR\fI@see <a href="URL#value">label</a>\fRϡ\fIURL#value\fRˤ줿󥯤ɲäޤ\fIURL#value\fRѥ᡼ϡURLޤURLǤ\fIjavadoc\fRޥɤϡǽʸȤơ֤꾮׵(\fI<\fR)򸡺ơη¾ηȶ̤ޤȤС\fI@see <a href="spec\&.html#section">Java Spec</a>\fRϼΥ󥯤ޤ +\fB形式2\fR。\fI@see <a href="URL#value">label</a>\fR形式は、\fIURL#value\fRにより定義されたリンクを追加します。\fIURL#value\fRパラメータは、相対URLまたは絶対URLです。\fIjavadoc\fRコマンドは、最初の文字として「より小さい」記号(\fI<\fR)を検索して、この形式を他の形式と区別します。たとえば、\fI@see <a href="spec\&.html#section">Java Spec</a>\fRは次のリンクを生成します。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp Java Spec .sp -\fB3\fR\fI@see package\&.class#member label\fRϡɽƥȡ٥ȤȤ˥󥯤ɲäޤΥ٥ϻȤƤJavaλꤵ줿̾ΥɥȤؤޤ٥ϥץǤ٥άϡɽƥȤΤˡ̾Ŭڤṳ̂ɽޤ\fI\-noqualifier\fRץѤȡɽƥȤѥå̾Ū˺ޤ٥ϡưɽƥȤȤϰۤʤɽƥȤˤ˻Ѥޤ̾ɽˡפ򻲾ȤƤ +\fB形式3\fR。\fI@see package\&.class#member label\fR形式は、表示テキスト・ラベルとともにリンクを追加します。このラベルは参照されているJava言語の指定された名前のドキュメントを指し示します。ラベルはオプションです。ラベルを省略した場合は、表示テキストのかわりに、名前が適切に短縮されて表示されます。\fI\-noqualifier\fRオプションを使用すると、この表示テキストからパッケージ名が全体的に削除されます。ラベルは、自動生成される表示テキストとは異なる表示テキストにする場合に使用します。「名前が表示される方法」を参照してください。 .sp -Java SE 1\&.2ϡ٥ǤϤʤ̾\fI<code>\fR -HTML˼ưŪɽޤJava SE 1\&.2\&.2ϡ٥Ѥ뤫ʤˤ餺\fI<code>\fRϾɽƥȤϤफǴޤޤޤ +Java SE 1\&.2だけは、ラベルではなく名前が\fI<code>\fR +HTMLタグ内に自動的に表示されます。Java SE 1\&.2\&.2からは、ラベルを使用するかしないかにかかわらず、\fI<code>\fRタグは常に表示テキストを囲むかたちで含まれます。 .sp .RS 4 .ie n \{\ @@ -1626,10 +1626,10 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fIpackage\&.class#member\fRˤϡȤƤǤդͭʥץǤ̾ꤷޤĤޤꡢѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤ̾ǤС̾ʸϡ㡼׵(\fI#\fR)ˤɬפޤclassϡǤդΥȥåץ٥ޤϥͥȤ줿饹󥿥եɽޤmemberϡǤդΥ󥹥ȥ饯᥽åɤޤϥեɤɽޤ(ͥȤ줿饹ޤϥ󥿥եǤϤޤ)̾ɥȲ륯饹˴ޤޤƤ硢\fIjavadoc\fRޥɤϡ̾ؤΥ󥯤ޤȥ饹ؤΥ󥯤ˤϡ\fI\-link\fRץѤޤȥ饹°Ƥʤ̾ΥɥȤ򻲾Ȥˤϡ¾2Ĥ\fI@see\fRΤɤ餫Ѥޤ̾λפ򻲾ȤƤ +\fIpackage\&.class#member\fRには、参照されている任意の有効なプログラム要素の名前を指定します。つまり、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドの名前です。ただし、メンバー名の前の文字は、シャープ記号(\fI#\fR)にする必要があります。classは、任意のトップレベルまたはネストされたクラスか、インタフェースを表します。memberは、任意のコンストラクタ、メソッドまたはフィールドを表します(ネストされたクラスまたはインタフェースではありません)。この名前が、ドキュメント化されるクラスに含まれている場合、\fIjavadoc\fRコマンドは、その名前へのリンクを作成します。外部参照クラスへのリンクを作成するには、\fI\-link\fRオプションを使用します。参照クラスに属していない名前のドキュメントを参照するには、他の2つの\fI@see\fRタグ形式のどちらかを使用します。「名前の指定」を参照してください。 .sp -\fB:\fR -ȥ饹ϡޥɥ饤\fIjavadoc\fRޥɤϤʤ饹Ǥɥdzȥ饹˥󥯤ƤսϡȤޤϳ󥯤ȸƤФޤȤС\fIjava\&.awt package\fRФƤΤ\fIjavadoc\fRޥɤ¹Ԥ硢\fIObject\fRʤɤ\fIjava\&.lang\fRΤ٤ƤΥ饹ȥ饹ˤʤޤ\fI\-link\fR\fI\-linkoffline\fRץѤơȥ饹إ󥯤ޤȥ饹ΥȤ\fIjavadoc\fRޥɤμ¹ԤˤϻѤǤޤ +\fB注意:\fR +外部参照クラスは、コマンドラインで\fIjavadoc\fRコマンドに渡されないクラスです。生成ドキュメント内で外部参照クラスにリンクしている箇所は、外部参照または外部リンクと呼ばれます。たとえば、\fIjava\&.awt package\fRに対してのみ\fIjavadoc\fRコマンドを実行した場合、\fIObject\fRなどの\fIjava\&.lang\fR内のすべてのクラスが外部参照クラスになります。\fI\-link\fRおよび\fI\-linkoffline\fRオプションを使用して、外部参照クラスへリンクします。外部参照クラスのソース・コメントは\fIjavadoc\fRコマンドの実行には使用できません。 .RE .sp .RS 4 @@ -1640,7 +1640,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -\fIlabel\fRϡάǽʥƥȤǡ󥯤Υ٥Ȥɽޤ٥ˤ϶ޤ뤳ȤǤޤ\fIlabel\fRάȡ\fIpackage\&.class\&.member\fRߤΥ饹ӥѥå˱Ŭڤṳ̂ɽޤ̾ɽˡפ򻲾ȤƤ +\fIlabel\fRは、省略可能なテキストで、リンクのラベルとして表示されます。ラベルには空白を含めることができます。\fIlabel\fRを省略すると、\fIpackage\&.class\&.member\fRが、現在のクラスおよびパッケージに応じて適切に短縮されて表示されます。「名前が表示される方法」を参照してください。 .RE .sp .RS 4 @@ -1651,10 +1651,10 @@ HTML .sp -1 .IP \(bu 2.3 .\} -ʸ\fIpackage\&.class#member\fR\fIlabel\fRδ֤ζڤʸˤʤޤå¦ζʸϥ٥ƬȤϲᤵʤᡢ᥽åɤΥѥ᡼֤˶ʸƤ⤫ޤޤ +空白文字が、\fIpackage\&.class#member\fRと\fIlabel\fRの間の区切り文字になります。カッコの内側の空白文字はラベルの先頭とは解釈されないため、メソッドのパラメータ間に空白文字を入れてもかまいません。 .RE .sp -Ǥϡ\fI@see\fR(\fICharacter\fR饹)\fIString\fR饹equals᥽åɤ򻲾ȤƤޤˤϡ̾\fIString#equals(Object)\fRȥ٥\fIequals\fRξΰޤޤƤޤ +この例では、\fI@see\fRタグ(\fICharacter\fRクラス内)が、\fIString\fRクラスのequalsメソッドを参照しています。タグには、名前\fIString#equals(Object)\fRとラベル\fIequals\fRの両方の引数が含まれています。 .sp .if n \{\ .RS 4 @@ -1667,7 +1667,7 @@ HTML .if n \{\ .RE .\} -ɸɥååȤϡΤ褦HTMLޤ +標準ドックレットは、次のようなHTMLを生成します。 .sp .if n \{\ .RS 4 @@ -1681,14 +1681,14 @@ HTML .if n \{\ .RE .\} -ҤΥɤϡ֥饦˼Τ褦ɽ졢٥ɽ󥯡ƥȤˤʤäƤޤ +前述のコードは、ブラウザに次のように表示され、ラベルは表示リンク・テキストになっています。 .sp -\fBϢ\fR: +\fB関連項目\fR: .sp equals .RE -̾λ.PP -\fIpackage\&.class#member\fRȤ̾ϡ\fIjava\&.lang\&.String#toUpperCase()\fRΤ褦ʴ̾ˤ뤳Ȥ⡢\fIString#toUpperCase()\fR\fI#toUpperCase()\fRΤ褦̾ˤ뤳ȤǤޤ̾ûϡ\fIjavadoc\fRޥɤϡɸJavaѥθѤõޤ@seeθפ򻲾ȤƤ̾ϡ᥽åɰδ֤ʤɡåΥڡޤ뤳ȤǤޤʬŪ˽û̾ꤹ뤳ȤϡϤʸ뤳Ȥ䡢ɤɤߤ䤹ʤ뤳ȤǤΥꥹȤ͡ʷ̾򼨤ޤǡ\fIClass\fRˤϥ饹ޤϥ󥿥եTypeˤϥ饹󥿥ե󡢤ޤϥץߥƥ֤methodˤϥ᥽åɤޤϥ󥹥ȥ饯򡢤줾Ǥޤ +名前の指定.PP +この\fIpackage\&.class#member\fRという名前は、\fIjava\&.lang\&.String#toUpperCase()\fRのような完全修飾名にすることも、\fIString#toUpperCase()\fRや\fI#toUpperCase()\fRのような非完全修飾名にすることもできます。名前が完全修飾より短い場合は、\fIjavadoc\fRコマンドは、標準のJavaコンパイラの検索順序を使用して探します。「@seeタグの検索順序」を参照してください。名前は、メソッド引数の間など、カッコ内のスペースを含めることができます。部分的に修飾した短い名前を指定することの利点は、入力する文字数が減ることや、ソース・コードが読みやすくなることです。次のリストに様々な形式の名前を示します。ここで、\fIClass\fRにはクラスまたはインタフェースを、Typeにはクラス、インタフェース、配列、またはプリミティブを、methodにはメソッドまたはコンストラクタを、それぞれ指定できます。 .sp .if n \{\ .RS 4 @@ -1725,7 +1725,7 @@ equals .RE .\} .PP -ΥꥹȤ˴ؤ: +前のリストに関するメモ: .sp .RS 4 .ie n \{\ @@ -1735,7 +1735,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -ǽΥפη(ѥåȥ饹ά)ξ硢\fIjavadoc\fRޥɤϡߤΥ饹γؤΤߤ򸡺ޤĤޤꡢߤΥ饹󥿥եΥѡ饹ѡ󥿥եޤϤγ¦ϤǤ륯饹󥿥եС򸡺ޤ(1\(en3)ߤΥѥå¾ʬ䡢¾Υѥåϸޤ(4\(en5)@seeθפ򻲾ȤƤ +最初のタイプの形式(パッケージとクラスを省略)の場合、\fIjavadoc\fRコマンドは、現在のクラスの階層のみを検索します。つまり、現在のクラスかインタフェース、そのスーパークラスかスーパーインタフェース、またはその外側を囲んでいるクラスかインタフェースからメンバーを検索します(検索項目1\(en3)。現在のパッケージの他の部分や、他のパッケージは検索しません(検索項目4\(en5)。「@seeタグの検索順序」を参照してください。 .RE .sp .RS 4 @@ -1746,7 +1746,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -᥽åɤޤϥ󥹥ȥ饯ϻˡ\fIgetValue\fRΤ褦˥åʤ̾Ѥ硢Ʊ̾Υեɤ¸ߤƤʤС\fIjavadoc\fRޥɤϤΥ᥽åɤؤΥ󥯤ޤΥ᥽åɤСɤƤ硢\fIjavadoc\fRޥɤϡǺǽ˸Ĥä᥽åɤ˥󥯤ޤ̤äǤޤ +メソッドまたはコンストラクタの入力時に、\fIgetValue\fRのようにカッコなしの名前を使用した場合、同じ名前のフィールドが存在していなければ、\fIjavadoc\fRコマンドはそのメソッドへのリンクを作成します。このメソッドがオーバーロードされている場合、\fIjavadoc\fRコマンドは、検索で最初に見つかったメソッドにリンクします。結果は前もって特定できません。 .RE .sp .RS 4 @@ -1757,7 +1757,7 @@ equals .sp -1 .IP \(bu 2.3 .\} -ͥȤ줿饹ϡ٤ƤηˤĤơ\fIouter\&.inner\fRȤƻꤹɬפޤñ\fIinner\fRȤϤʤǤ +ネストされたクラスは、すべての形式について、\fIouter\&.inner\fRとして指定する必要があります。単純に\fIinner\fRとはしないでください。 .RE .sp .RS 4 @@ -1768,12 +1768,12 @@ equals .sp -1 .IP \(bu 2.3 .\} -Ǥ˽Ҥ٤褦ˡ饹ȥСȤδ֤ζڤʸȤƤϡɥå(\fI\&.\fR)ǤϤʤ㡼׵(\fI#\fR)ѤޤΤ褦˻ꤹȡ\fIjavadoc\fRޥɤϡޤǤޤɥåȤϡ饹ͥȤ줿饹ѥåӥ֥ѥåڤ뤿ˤѤ뤫Ǥ\fIjavadoc\fRޥɤǤϡޤʤХɥåȤϤޤٹɽޤ +すでに述べたように、クラスとメンバーとの間の区切り文字としては、ドット(\fI\&.\fR)ではなくシャープ記号(\fI#\fR)を使用します。このように指定すると、\fIjavadoc\fRコマンドは、あいまいさを解決できます。ドットは、クラス、ネストされたクラス、パッケージ、およびサブパッケージを区切るためにも使用されるからです。ただし、\fIjavadoc\fRコマンドでは、あいまいさがなければドットは正しく解析されますが、警告は表示されます。 .RE -@seeθ.PP -\fIjavadoc\fRޥɤϡե롢ѥåե롢ץեɽ\fI@see\fRޤԤ2ĤΥեǤϡ̾\fI@see\fR˻ꤹɬפޤեǤϡ̾ޤʬ̾Ǥޤ +@seeタグの検索順序.PP +\fIjavadoc\fRコマンドは、ソース・ファイル、パッケージ・ファイル、概要ファイルに表示される\fI@see\fRタグを処理します。後者の2つのファイルでは、完全修飾の名前を\fI@see\fRタグに指定する必要があります。ソース・ファイルでは、完全修飾の名前、または部分修飾の名前を指定できます。 .PP -ˡ\fI@see\fRθ򼨤ޤ +次に、\fI@see\fRタグの検索順序を示します。 .sp .RS 4 .ie n \{\ @@ -1783,7 +1783,7 @@ equals .sp -1 .IP " 1." 4.2 .\} -ߤΥ饹ޤϥ󥿥ե +現在のクラスまたはインタフェース。 .RE .sp .RS 4 @@ -1794,7 +1794,7 @@ equals .sp -1 .IP " 2." 4.2 .\} -¦ϤǤ륯饹ȥ󥿥ե(ǤᤤΤ鸡) +外側を囲んでいるクラスとインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1805,7 +1805,7 @@ equals .sp -1 .IP " 3." 4.2 .\} -ѡ饹ȥѡ󥿥ե(ǤᤤΤ鸡) +スーパークラスとスーパーインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1816,7 +1816,7 @@ equals .sp -1 .IP " 4." 4.2 .\} -ߤΥѥå +現在のパッケージ。 .RE .sp .RS 4 @@ -1827,12 +1827,12 @@ equals .sp -1 .IP " 5." 4.2 .\} -ݡȤƤѥå饹ӥ󥿥ե(\fIimport\fRʸν˽äƸ) +インポートされているパッケージ、クラス、およびインタフェース(\fIimport\fR文の順序に従って検索)。 .RE .PP -\fIjavadoc\fRޥɤϡƥ饹ˤĤƹ1\-3ƵŪŬѤʤ顢פ̾ĤޤǸ³ޤĤޤꡢޤߤΥ饹򸡺ˤγ¦ϤǤ륯饹E򸡺塢EΥѡ饹򸡺Ƥ顢EϤǤ륯饹򸡺ޤ45Ǥϡ\fIjavadoc\fRޥɤ1ĤΥѥåΥ饹ޤϥ󥿥ե򸡺ϷޤäƤޤ(νϡġΥѥˤäưۤʤޤ)5Ǥϡ\fIjavadoc\fRޥɤϡ\fIjava\&.lang\fR򸡺ޤΥѥåϡ٤ƤΥץ˼ưŪ˥ݡȤ뤫Ǥ +\fIjavadoc\fRコマンドは、各クラスについて項目1\-3を再帰的に適用しながら、一致する名前が見つかるまで検索を続けます。つまり、まず現在のクラスを検索し、次にその外側を囲んでいるクラスEを検索した後、Eのスーパークラスを検索してから、Eを囲んでいるクラスを検索します。項目4と5では、\fIjavadoc\fRコマンドが1つのパッケージ内のクラスまたはインタフェースを検索する順序は決まっていません(その順序は、個々のコンパイラによって異なります)。項目5では、\fIjavadoc\fRコマンドは、\fIjava\&.lang\fRを検索します。このパッケージは、すべてのプログラムに自動的にインポートされるからです。 .PP -\fIjavadoc\fRޥɤϡǤʤե\fI@see\fR򸫤ĤȡJavaѥƱǻꤵ줿̾򸡺ޤ(\fIjavadoc\fRޥɤϡ֤̾Τޤ򸡽Фޤ󡣤ϡɤˤΥ顼¸ߤƤʤȤȤƤ뤿Ǥ)θϡJavaͤƤޤ\fIjavadoc\fRޥɤϡϢ륯饹ȥѥåӥݡȤ줿饹ȥѥåΤ٤Ƥ餽̾򸡺ޤŪˤϡνǸޤ +\fIjavadoc\fRコマンドは、完全修飾でないソース・ファイルで\fI@see\fRタグを見つけると、Javaコンパイラと同じ順序で指定された名前を検索します(ただし、\fIjavadoc\fRコマンドは、特定の名前空間のあいまいさを検出しません。これは、ソース・コードにこれらのエラーが存在していないことを前提としているためです)。この検索順序は、Java言語仕様で正式に定義されています。\fIjavadoc\fRコマンドは、関連するクラスとパッケージ、およびインポートされたクラスとパッケージのすべてからその名前を検索します。具体的には、次の順序で検索します。 .sp .RS 4 .ie n \{\ @@ -1842,7 +1842,7 @@ equals .sp -1 .IP " 1." 4.2 .\} -ߤΥ饹ޤϥ󥿥ե +現在のクラスまたはインタフェース。 .RE .sp .RS 4 @@ -1853,7 +1853,7 @@ equals .sp -1 .IP " 2." 4.2 .\} -¦ϤǤ륯饹ȥ󥿥ե(ǤᤤΤ鸡) +外側を囲んでいるクラスとインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1864,7 +1864,7 @@ equals .sp -1 .IP " 3." 4.2 .\} -ѡ饹ȥѡ󥿥ե(ǤᤤΤ鸡) +スーパークラスとスーパーインタフェース(最も近いものから検索)。 .RE .sp .RS 4 @@ -1875,7 +1875,7 @@ equals .sp -1 .IP " 4." 4.2 .\} -ߤΥѥå +現在のパッケージ。 .RE .sp .RS 4 @@ -1886,48 +1886,48 @@ equals .sp -1 .IP " 5." 4.2 .\} -ݡȤƤѥå饹ӥ󥿥ե(\fIimport\fRʸν˽äƸ) +インポートされているパッケージ、クラス、およびインタフェース(\fIimport\fR文の順序に従って検索)。 .RE .PP -\fIjavadoc\fRޥɤϡɬ⥵֥饹򸡺Ȥϸ¤ޤ󡣤ޤ¹¾ΥѥåΥɥȤǤ⡢¾Υѥå򸡺ޤ󡣤ȤС\fI@see\fR\fIjava\&.awt\&.event\&.KeyEvent\fR饹˴ޤޤƤơ\fIjava\&.awt package\fRΤ̾򻲾ȤƤƤ⡢Υ饹ݡȤʤ\fIjavadoc\fRޥɤϤΥѥå򸡺ޤ -̾ɽˡ.PP -\fIlabel\fRάȡ\fIpackage\&.class\&.member\fRɽޤ̤ˡϸߤΥ饹ӥѥå˱Ŭڤṳ̂ޤṳ̂Ȥϡ\fIjavadoc\fRޥɤˤɬ׺Ǿ¤̾ΤߤɽȤȤǤȤС\fIString\&.toUpperCase()\fR᥽åɤˡƱ饹ΥСؤλȤ¾Υ饹ΥСؤλȤޤޤƤ硢饹̾ɽΤϸԤΥΤߤǤ(ΥꥹȤ򻲾)ѥå̾Ū˺ˤϡ\fI\-noqualifier\fRץѤޤ +\fIjavadoc\fRコマンドは、必ずしもサブクラスを検索するとは限りません。また、実行中に他のパッケージのドキュメントが生成される場合でも、他のパッケージを検索しません。たとえば、\fI@see\fRタグが\fIjava\&.awt\&.event\&.KeyEvent\fRクラス内に含まれていて、\fIjava\&.awt package\fR内のある名前を参照していても、そのクラスがインポートしないかぎり\fIjavadoc\fRコマンドはそのパッケージを検索しません。 +名前が表示される方法.PP +\fIlabel\fRを省略すると、\fIpackage\&.class\&.member\fRが表示されます。一般に、これは現在のクラスおよびパッケージに応じて適切に短縮されます。短縮されるとは、\fIjavadoc\fRコマンドにより必要最小限の名前のみが表示されるということです。たとえば、\fIString\&.toUpperCase()\fRメソッドに、同じクラスのメンバーへの参照と他のクラスのメンバーへの参照が含まれている場合、クラス名が表示されるのは後者のケースのみです(次のリストを参照)。パッケージ名を全体的に削除するには、\fI\-noqualifier\fRオプションを使用します。 .RS 4 -\fBȤΥ\fR: \fI@see\fRƱ饹ƱѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは同じクラス、同じパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see String#toLowerCase()\fR +\fB例\fR: \fI@see String#toLowerCase()\fR .RE .RS 4 -\fBɽ\fR: \fItoLowerCase()\fR \- ѥåӥ饹̾άޤ +\fB表示\fR: \fItoLowerCase()\fR \- パッケージおよびクラス名を省略します .RE .RS 4 .RE .RS 4 -\fBȤΥ\fR: \fI@see\fR̤Υ饹ƱѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは別のクラス、同じパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see Character#toLowerCase(char)\fR +\fB例\fR: \fI@see Character#toLowerCase(char)\fR .RE .RS 4 -\fBɽ\fR: \fICharacter\&.toLowerCase(char)\fR \- ѥå̾ά饹̾ޤߤޤ +\fB表示\fR: \fICharacter\&.toLowerCase(char)\fR \- パッケージ名を省略し、クラス名を含みます .RE .RS 4 .RE .RS 4 -\fBȤΥ\fR: \fI@see\fRϰۤʤ륯饹ۤʤѥåΥС򻲾Ȥޤ +\fB参照のタイプ\fR: \fI@see\fRタグは異なるクラス、異なるパッケージのメンバーを参照します .RE .RS 4 -\fB\fR: \fI@see java\&.io\&.File#exists()\fR +\fB例\fR: \fI@see java\&.io\&.File#exists()\fR .RE .RS 4 -\fBɽ\fR: \fIjava\&.io\&.File\&.exists()\fR \- ѥåӥ饹̾ޤߤޤ +\fB表示\fR: \fIjava\&.io\&.File\&.exists()\fR \- パッケージおよびクラス名を含みます .RE .RS 4 .RE -@see.PP -¦ΥȤϡ\fI@see\fR\fIjava\&.applet\&.Applet\fRʤɤ̤ΥѥåΥ饹ˤˡ̾ɤΤ褦ɽ뤫򼨤ƤޤJavadocġǤDocȤεˡ@see˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@see)򻲾ȤƤ +@seeタグの例.PP +右側のコメントは、\fI@see\fRタグが\fIjava\&.applet\&.Applet\fRなどの別のパッケージのクラス内にある場合に、名前がどのように表示されるかを示しています。JavadocツールでのDocコメントの記述方法の@seeに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@see)を参照してください。 .sp .if n \{\ .RS 4 @@ -1948,24 +1948,24 @@ equals .RE .\} .PP -\fB:\fR -\fI@se\fR\fIe\fRĥƥɥȲʤ饹˥󥯤ˤϡ\fI\-link\fRץѤޤ +\fB注意:\fR +\fI@se\fR\fIe\fRタグを拡張してドキュメント化されないクラスにリンクするには、\fI\-link\fRオプションを使用します。 .PP @serial \fIfield\-description\fR | include | exclude .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ǥեȤľ󲽲ǽեɤΥɥơ󡦥ȤǻѤޤ饹ľ󲽲ǽʥեɤӥǡʸ -(http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial\-arch\&.html#5251)򻲾ȤƤ +デフォルトの直列化可能フィールドのドキュメンテーション・コメントで使用します。クラスの直列化可能なフィールドおよびデータの文書化 +(http://docs\&.oracle\&.com/javase/8/docs/platform/serialization/spec/serial\-arch\&.html#5251)を参照してください .sp -Oracleľ󲽤줿λͤ˥饹ޤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized\-criteria\-137781\&.html)⻲ȤƤ +Oracleの直列化された形式の仕様にクラスを含める基準 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/serialized\-criteria\-137781\&.html)も参照してください .sp -\fIfield\-description\fR(άǽ)Ǥϡեɤΰ̣ͤΥꥹȤ򼨤ɬפޤɬפʾϡʣιԤϤä򵭽ҤǤޤɸɥååȤϡξľ󲽤줿ڡɲäޤ߻ȥڡ򻲾ȤƤ +\fIfield\-description\fR(省略可能)では、フィールドの意味を説明し、取り得る値のリストを示す必要があります。必要な場合は、複数の行に渡って説明を記述できます。標準ドックレットは、この情報を、直列化された形式ページに追加します。相互参照ページを参照してください。 .sp -饹ľ󲽤ľ󲽲ǽեɤ򥯥饹ɲä硢ˡɲäС̤ʸɲäɬפޤ +クラスを直列化した後に直列化可能フィールドをクラスに追加した場合、主説明に、追加したバージョンを識別する文を追加する必要があります。 .sp -\fIinclude\fR\fIexclude\fRϡľ󲽤줿ڡ˥饹ޤϥѥåޤ뤫뤫򼨤ޤΤ褦˵ǽޤ +\fIinclude\fRおよび\fIexclude\fR引数は、直列化された形式ページにクラスまたはパッケージを含めるか除外するかを示します。次のように機能します。 .sp .RS 4 .ie n \{\ @@ -1975,7 +1975,7 @@ Oracle .sp -1 .IP \(bu 2.3 .\} -\fISerializable\fRƤpublicޤprotected饹ϡΥ饹(ޤϤΥ饹°ѥå)\fI@serial exclude\fRǥޡƤʤꡢޤޤ +\fISerializable\fRを実装しているpublicまたはprotectedクラスは、そのクラス(またはそのクラスが属するパッケージ)が\fI@serial exclude\fRタグでマークされていないかぎり、含められます。 .RE .sp .RS 4 @@ -1986,59 +1986,59 @@ Oracle .sp -1 .IP \(bu 2.3 .\} -\fISerializable\fRƤprivateޤpackage\-private饹ϡΥ饹(ޤϤΥ饹°ѥå)\fI@serial include\fRǥޡƤʤꡢޤ +\fISerializable\fRを実装しているprivateまたはpackage\-privateクラスは、そのクラス(またはそのクラスが属するパッケージ)が\fI@serial include\fRタグでマークされていないかぎり、除外されます。 .RE .sp -ȤС\fIjavax\&.swing\fRѥåpackage\&.htmlޤpackage\-info\&.java\fI@serial\fR -\fIexclude\fRǥޡƤޤpublic饹\fIjava\&.security\&.BasicPermission\fR\fI@serial exclude\fRǥޡƤޤpackage\-private饹\fIjava\&.util\&.PropertyPermissionCollection\fR\fI@serial include\fRǥޡƤޤ +たとえば、\fIjavax\&.swing\fRパッケージはpackage\&.htmlまたはpackage\-info\&.java内で\fI@serial\fR +\fIexclude\fRタグでマークされています。publicクラス\fIjava\&.security\&.BasicPermission\fRは\fI@serial exclude\fRタグでマークされています。package\-privateクラス\fIjava\&.util\&.PropertyPermissionCollection\fRは\fI@serial include\fRタグでマークされています。 .sp -饹٥\fI@serial\fRϥѥå٥\fI@serial\fR򥪡С饤ɤޤ +クラス・レベルの\fI@serial\fRタグはパッケージ・レベルの\fI@serial\fRタグをオーバーライドします。 .RE .PP @serialData \fIdata\-description\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -ǡͤѤơľ󲽤줿ǤΥǡηȽɥȲޤΥǡˤϡ\fIwriteObject\fR᥽åɤˤäƽ񤭹ޤάǽʥǡ\fIExternalizable\&.writeExternal\fR᥽åɤˤäƽ񤭹ޤ뤹٤ƤΥǡ(١饹ޤ)ޤޤޤ +データの説明値を使用して、直列化された形式でのデータの型と順序をドキュメント化します。このデータには、\fIwriteObject\fRメソッドによって書き込まれる省略可能なデータ、および\fIExternalizable\&.writeExternal\fRメソッドによって書き込まれるすべてのデータ(ベース・クラスを含む)が含まれます。 .sp -\fI@serialData\fRϡ\fIwriteObject\fR\fIreadObject\fR\fIwriteExternal\fR\fIreadExternal\fR\fIwriteReplace\fR\fIreadResolve\fR᥽åɤΥɥơ󡦥ȤǻѤǤޤ +\fI@serialData\fRタグは、\fIwriteObject\fR、\fIreadObject\fR、\fIwriteExternal\fR、\fIreadExternal\fR、\fIwriteReplace\fRおよび\fIreadResolve\fRメソッドのドキュメンテーション・コメントで使用できます。 .RE .PP @serialField \fIfield\-name\fR \fIfield\-type\fR \fIfield\-description\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -\fISerializable\fR饹\fIserialPersistentFields\fRС\fIObjectStreamField\fRݡͥȤɥȲޤ\fIObjectStreamField\fRݡͥȤȤ1Ĥ\fI@serialField\fRѤޤ +\fISerializable\fRクラスの\fIserialPersistentFields\fRメンバーの\fIObjectStreamField\fRコンポーネントをドキュメント化します。\fIObjectStreamField\fRコンポーネントごとに1つの\fI@serialField\fRタグを使用します。 .RE .PP @since \fIsince\-text\fR .RS 4 -JDK 1\&.1Ƴ +JDK 1\&.1で導入 .sp -ɥȤˡꤵ줿\fIsince\-text\fRͤ\fIƳ줿С\fRФɲäޤΥƥȤˤϡ̤¤Ϥޤ󡣤Υϡ٤ƤΥɥơ󡦥ȡĤޤ공סѥå饹󥿥ե󥹥ȥ饯᥽åɡޤϥեɤͭǤΥϡѹޤϵǽ\fIsince\-text\fRͤˤäƻꤵ줿եȥ꡼ʹߡ¸ߤƤ뤳Ȥ̣ޤȤС\fI@since 1\&.5\fRǤ +生成ドキュメントに、指定された\fIsince\-text\fRの値の\fI「導入されたバージョン」\fR見出しを追加します。このテキストには、特別な内部構造はありません。このタグは、すべてのドキュメンテーション・コメント、つまり概要、パッケージ、クラス、インタフェース、コンストラクタ、メソッド、またはフィールドで有効です。このタグは、特定の変更または機能が、\fIsince\-text\fRの値によって指定されたソフトウェア・リリース以降、存在していることを意味します。たとえば、\fI@since 1\&.5\fRです。 .sp -JavaץåȥեΥɤξ硢\fI@since\fRϡJavaץåȥեAPIͤΥС򼨤ޤɤե󥹼ɲä줿򼨤Ȥϸ¤ޤʣ\fI@since\fRѤǤʣ\fI@author\fRΤ褦˰ޤץǤʣAPIǻѤ硢ʣΥѤǤޤ +Javaプラットフォームのソース・コードの場合、\fI@since\fRタグは、JavaプラットフォームAPI仕様のバージョンを示します。ソース・コードがリファレンス実装に追加された時期を示すとは限りません。複数の\fI@since\fRタグを使用でき、複数の\fI@author\fRタグのように扱われます。プログラム要素が複数のAPIで使用される場合、複数のタグを使用できます。 .RE .PP @throws \fIclass\-name\fR \fIdescription\fR .RS 4 -JDK 1\&.2Ƴ +JDK 1\&.2で導入 .sp -\fI@exception\fRƱư򤷤ޤJavadocġǤDocȤεˡ@throws˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@exception)򻲾ȤƤ +\fI@exception\fRタグと同じ動作をします。JavadocツールでのDocコメントの記述方法の@throwsに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@exception)を参照してください .sp -\fI@throws\fRϡɥȤ\fIThrows\fRФɲäơ\fIclass\-name\fR\fIdescription\fRƥȤ񤭹ߤޤ\fIclass\-name\fRϡΥ᥽åɤ饹ǽΤ㳰̾ǤΥϡ᥽åɡ󥹥ȥ饯Υɥơ󡦥ǤΤͭǤΥ饹̾ǵҤƤʤ硢\fIjavadoc\fRޥɤϡ˽äƥ饹õޤʣ\fI@throws\fRƱ㳰ޤϰ㤦㳰λꤷɥơ󡦥ȤǻѤǤޤ@seeθפ򻲾ȤƤ +\fI@throws\fRタグは、生成ドキュメントに\fIThrows\fR小見出しを追加して、\fIclass\-name\fRおよび\fIdescription\fRテキストを書き込みます。\fIclass\-name\fRは、そのメソッドからスローされる可能性のある例外の名前です。このタグは、メソッド、コンストラクタのドキュメンテーション・コメント内でのみ有効です。このクラスが完全指定の名前で記述されていない場合、\fIjavadoc\fRコマンドは、検索順序に従ってクラスを探します。複数の\fI@throws\fRタグを、同じ例外または違う例外の指定したドキュメンテーション・コメントで使用できます。「@seeタグの検索順序」を参照してください。 .sp -٤ƤΥå㳰ɥȲ褦ˤ뤿ˡ\fI@throws\fRthrows㳰Ѥ¸ߤʤϡ\fI@throws\fRǥɥȲ줿Τ褦ˡ\fIjavadoc\fRޥɤˤä㳰HTMLϤʤɲäޤ +すべてのチェック済例外がドキュメント化されるようにするために、\fI@throws\fRタグがthrows節内の例外用に存在しない場合は、\fI@throws\fRタグでドキュメント化されたかのように、\fIjavadoc\fRコマンドによって例外がHTML出力に説明なしで追加されます。 .sp -С饤ɤ᥽å㳰ŪƤΤߡ\fI@throws\fRΥɥȤΥ᥽åɤ饵֥饹˥ԡޤ󥿥ե᥽åɤ᥽åɤ˥ԡƱͤǤ\fI{@inheritDoc}\fRѤơ\fI@throws\fRɥơѾ褦˶Ǥޤ +オーバーライドされるメソッド内で例外が明示的に宣言されている場合のみ、\fI@throws\fRのドキュメントがそのメソッドからサブクラスにコピーされます。インタフェース・メソッドから実装メソッドにコピーされる場合も同様です。\fI{@inheritDoc}\fRタグを使用して、\fI@throws\fRタグがドキュメンテーションを継承するように強制できます。 .RE .PP {@value \fIpackage\&.class#field\fR} .RS 4 -JDK 1\&.4Ƴ +JDK 1\&.4で導入 .sp -ͤɽޤ\fI{@value}\fRŪեɤΥɥơ󡦥ȤǰʤǻѤƤ硢ͤɽޤ +定数の値を表示します。\fI{@value}\fRタグが静的フィールドのドキュメンテーション・コメントで引数なしで使用されている場合、その定数の値を表示します。 .sp .if n \{\ .RS 4 @@ -2052,7 +2052,7 @@ public static final String SCRIPT_START = "<script>" .if n \{\ .RE .\} -ǤդΥɥơ󡦥ǰ\fIpackage\&.class#field\fRǻѤ줿硢\fI{@value}\fRϻꤵ줿ͤɽޤ +任意のドキュメンテーション・コメント内で引数\fIpackage\&.class#field\fRありで使用された場合、\fI{@value}\fRタグは指定された定数の値を表示します。 .sp .if n \{\ .RS 4 @@ -2066,48 +2066,48 @@ public String evalScript(String script) {} .if n \{\ .RE .\} -\fIpackage\&.class#field\fRϡ\fI@see\fRƱηˤʤޤСŪեɤǤɬפޤ +引数\fIpackage\&.class#field\fRは、\fI@see\fRタグ引数と同一の形式になります。ただし、メンバーは静的フィールドである必要があります。 .sp -ͤϡե͡ -(http://docs\&.oracle\&.com/javase/8/docs/api/constant\-values\&.html)ˤɽޤ +これらの定数の値は「定数フィールド値」 +(http://docs\&.oracle\&.com/javase/8/docs/api/constant\-values\&.html)にも表示されます .RE .PP @version \fIversion\-text\fR .RS 4 -JDK 1\&.0Ƴ +JDK 1\&.0で導入 .sp -\fI\-version\fRץ󤬻ѤƤ硢ɥȤ\fI֥С\fRФɲäơꤵ줿\fIversion\-text\fRͤ񤭹ߤޤΥϤΥɤޤޤ륽եȥθߤΥ꡼ֹݻ뤿ΤΤǤΤФ\fI@since\fRϡΥɤƳ줿꡼ֹݻޤ\fIversion\-text\fRͤˤϡ̤¤ϤޤJavadocġǤDocȤεˡ@version˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@version)򻲾ȤƤ +\fI\-version\fRオプションが使用されている場合、生成ドキュメントに\fI「バージョン」\fR小見出しを追加して、指定された\fIversion\-text\fRの値を書き込みます。このタグはこのコードが含まれるソフトウェアの現在のリリース番号を保持するためのものであるのに対し、\fI@since\fRタグは、このコードが導入されたリリース番号を保持します。\fIversion\-text\fRの値には、特別な内部構造はありません。JavadocツールでのDocコメントの記述方法の@versionに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#@version)を参照してください .sp -1ĤΥɥơ󡦥Ȥʣ\fI@version\fRޤ뤳ȤǤޤɬפ˱ơ1Ĥ\fI@version\fR1ĤΥ꡼ֹꤹ뤳Ȥ⡢ʣΥ꡼ֹꤹ뤳ȤǤޤԤξϡ\fIjavadoc\fRޥɤˤä̾̾δ֤˥(,)ȶʸޤԤξϡƥΤϤ뤳ȤʤɥȤ˥ԡޤäơޤǤϤʤƸб̾ڤʸѤɬפȤˡ1Ԥʣ̾Ǥޤ +1つのドキュメンテーション・コメントに複数の\fI@version\fRタグを含めることができます。必要に応じて、1つの\fI@version\fRタグに1つのリリース番号を指定することも、複数のリリース番号を指定することもできます。前者の場合は、\fIjavadoc\fRコマンドによって名前と名前の間にカンマ(,)と空白文字が挿入されます。後者の場合は、テキスト全体が解析されることなく、生成ドキュメントにコピーされます。したがって、カンマではなく、各言語に対応した名前区切り文字を使用する必要があるときに、1行に複数の名前を指定できます。 .RE -.SH "ѤǤ" +.SH "タグを使用できる場所" .PP -ǤϡѤǤˤĤޤΥ٤ƤΥɥơ󡦥ȤǻѤǤޤ\fI@see\fR\fI@since\fR\fI@deprecated\fR\fI{@link}\fR\fI{@linkplain}\fR\fI{@docroot}\fR -.SS "ץ" +ここでは、タグを使用できる場所について説明します。次のタグがすべてのドキュメンテーション・コメントで使用できます。\fI@see\fR、\fI@since\fR、\fI@deprecated\fR、\fI{@link}\fR、\fI{@linkplain}\fRおよび\fI{@docroot}\fR。 +.SS "概要タグ" .PP -ץϡץڡΥɥơ󡦥ȤǻѤǤ륿Ǥ(Υɥơ󡦥Ȥϡ̾overview\&.htmlȤ̾Υեˤޤ)¾Υɥơ󡦥ȤξƱͤˡΥϡθǻѤɬפޤ +概要タグは、概要ページのドキュメンテーション・コメントで使用できるタグです(このドキュメンテーション・コメントは、通常overview\&.htmlという名前のソース・ファイル内にあります)。他のドキュメンテーション・コメントの場合と同様に、これらのタグは、主説明の後で使用する必要があります。 .PP -\fB:\fR -Java SE 1\&.2Ǥϡץɥ\fI{@link}\fRԶ礬ޤƥȤɽޤ󥯤ꤵޤ󡣸ߤΤȤ\fI{@docRoot}\fRϡץɥǤϵǽޤ +\fB注意:\fR +Java SE 1\&.2では、概要ドキュメント内の\fI{@link}\fRタグに不具合があります。テキストは正しく表示されますが、リンクが設定されません。現在のところ、\fI{@docRoot}\fRタグは、概要ドキュメント内では機能しません。 .PP -ץϡΤȤǤ +概要タグは、次のとおりです。 .PP @see reference || @since since\-text || @serialField field\-name field\-type field\-description || @author name\-text || @version version\-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || -.SS "ѥå" +.SS "パッケージ・タグ" .PP -ѥåϡѥåΥɥơ󡦥ȤǻѤǤ륿ǡɥơ󡦥Ȥpackage\&.htmlޤpackage\-info\&.javaȤ̾ΥեˤޤǻѤǤ\fI@serial\fRϡ\fIinclude\fRޤ\fIexclude\fRꤷΤΤߤǤ +パッケージ・タグは、パッケージのドキュメンテーション・コメントで使用できるタグで、ドキュメンテーション・コメントはpackage\&.htmlまたはpackage\-info\&.javaという名前のソース・ファイル内にあります。ここで使用できる\fI@serial\fRタグは、\fIinclude\fRまたは\fIexclude\fR引数を指定したもののみです。 .PP -ѥåϡΤȤǤ +パッケージ・タグは、次のとおりです。 .PP @see reference || @since since\-text || @serial field\-description | include | exclude || @author name\-text || @version version\-text || {@linkplain package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || -.SS "饹ӥ󥿥ե" +.SS "クラスおよびインタフェース・タグ" .PP -ˡ饹ޤϥ󥿥եΥɥơ󡦥ȤǻѤǤ륿򼨤ޤ\fI@serial\fRϡ\fIinclude\fRޤ\fIexclude\fRꤷơ饹ޤϥ󥿥եΥɥơǤΤ߻ѤǤޤ +次に、クラスまたはインタフェースのドキュメンテーション・コメントで使用できるタグを示します。\fI@serial\fRタグは、\fIinclude\fRまたは\fIexclude\fR引数を指定して、クラスまたはインタフェースのドキュメンテーション内でのみ使用できます。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @serial field\-description | include | exclude || @author name\-text || @version version\-text || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || .PP -饹Ȥ: +クラス・コメントの例: .sp .if n \{\ .RS 4 @@ -2133,13 +2133,13 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SS "եɡ" +.SS "フィールド・タグ" .PP -ΥϡեɤɽǤޤ +これらのタグは、フィールドに表示できます。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @serial field\-description | include | exclude || @serialField field\-name field\-type field\-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@docRoot} || {@value package\&.class#field} .PP -եɡȤ: +フィールド・コメントの例: .sp .if n \{\ .RS 4 @@ -2155,17 +2155,17 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SS "󥹥ȥ饯ȥ᥽åɡ" +.SS "コンストラクタとメソッド・タグ" .PP -ˡ󥹥ȥ饯ޤϥ᥽åɤΥɥơ󡦥ȤǻѤǤ륿򼨤ޤ\fI@return\fRϥ󥹥ȥ饯ǤϻѤǤ -\fI{@inheritDoc}\fRˤ¤ޤ +次に、コンストラクタまたはメソッドのドキュメンテーション・コメントで使用できるタグを示します。ただし、\fI@return\fRはコンストラクタでは使用できず、 +\fI{@inheritDoc}\fRには制限があります。 .PP @see reference || @since since\-text || @deprecated deprecated\-text || @param parameter\-name description || @return description || @throws class\-name description || @exception class\-name description || @serialData data\-description || {@link package\&.class#member label} || {@linkplain package\&.class#member label} || {@inheritDoc} || {@docRoot} .PP -\fB:\fR -\fI@serialData\fRϡ\fIwriteObject\fR\fIreadObject\fR\fIwriteExternal\fR\fIreadExternal\fR\fIwriteReplace\fR\fIreadResolve\fR᥽åɤΥɥơ󡦥ȤǤΤ߻ѤǤޤ +\fB注意:\fR +\fI@serialData\fRタグは、\fIwriteObject\fR、\fIreadObject\fR、\fIwriteExternal\fR、\fIreadExternal\fR、\fIwriteReplace\fRおよび\fIreadResolve\fRメソッドのドキュメンテーション・コメントでのみ使用できます。 .PP -᥽åɡȤ: +メソッド・コメントの例: .sp .if n \{\ .RS 4 @@ -2189,9 +2189,9 @@ class Window extends BaseWindow { .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -\fIjavadoc\fRޥɤϡɥååȤѤƽϤꤷޤ\fIjavadoc\fRޥɤϡ\fI\-doclet\fRץǥࡦɥååȤꤵƤʳϡǥեȤɸɥååȤѤޤ\fIjavadoc\fRޥɤˤϡǤդΥɥååȤȤȤ˻ѤǤ륳ޥɥ饤󡦥ץ󤬤ޤΥץˤĤƤϡJavadocץޤɸɥååȤǤϡ¾ˡĤɲäΥޥɥ饤󡦥ץ󶡤ޤΥץˤĤƤϡɸɥååȤΥץޤɤΥץ̾⡢ʸȾʸ̤ޤ󡣤ץΰǤϡʸȾʸ̤ޤ +\fIjavadoc\fRコマンドは、ドックレットを使用して出力を決定します。\fIjavadoc\fRコマンドは、\fI\-doclet\fRオプションでカスタム・ドックレットが指定されている場合以外は、デフォルトの標準ドックレットを使用します。\fIjavadoc\fRコマンドには、任意のドックレットとともに使用できるコマンドライン・オプションがあります。これらのオプションについては、Javadocオプションで説明します。標準ドックレットでは、この他に、いくつかの追加のコマンドライン・オプションが提供されます。これらのオプションについては、標準ドックレットのオプションで説明します。どのオプション名も、大文字と小文字が区別されません。ただし、オプションの引数では、大文字と小文字が区別されます。 .sp .RS 4 .ie n \{\ @@ -2201,7 +2201,7 @@ class Window extends BaseWindow { .sp -1 .IP \(bu 2.3 .\} -Javadocץ⻲ȤƤ +Javadocオプションも参照してください .RE .sp .RS 4 @@ -2212,45 +2212,45 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -ɸɥååȤΥץ⻲ȤƤ +標準ドックレットのオプションも参照してください .RE .PP -ץϼΤȤǤ +オプションは次のとおりです。 .PP \-1\&.1 || \-author || \-bootclasspath classpathlist || \-bottom text || \-breakiterator || \-charset name || \-classpath classpathlist || \-d directory || \-docencoding name || \-docfilesubdirs || \-doclet class || \-docletpath classpathlist || \-doctitle title || \-encoding || \-exclude packagename1:packagename2:\&.\&.\&. || \-excludedocfilessubdir name1:name2 || \-extdirs dirist || \-footer footer || \-group groupheading packagepattern:packagepattern || \-header header || \-help || \-helpfile path\efilename || \-Jflag || \-keywords || \-link extdocURL || \-linkoffline extdocURL packagelistLoc || \-linksource || \-locale language_country_variant || \-nocomment || \-nodeprecated || \-nodeprecatedlist || \-nohelp || \-noindex || \-nonavbar || \-noqualifier all | packagename1:packagename2\&.\&.\&. || \-nosince || \-notimestamp || \-notree || \fI\-overview path/filename || \fR\-package || \-private || \-protected || \-public || \-quiet || \-serialwarn || \-source release || \-sourcepath sourcepathlist || \-sourcetab tablength || \-splitindex || \fI\-stylesheet path/filename || \fR\-subpackages package1:package2:\&.\&.\&. || \-tag tagname:Xaoptcmf:"taghead" || \-taglet class || \-tagletpath tagletpathlist || \-title title || \-top || \-use || \-verbose || \-version || \-windowtitle title .PP -Υץϡ٤ƤΥɥååȤ˻ѲǽʥJavadocץǤɸɥååȤǤϡɥååȤ¾ʬ󶡤ޤ\fI\-bootclasspath\fR\fI\-breakiterator\fR\fI\-classpath\fR\fI\-doclet\fR\fI\-docletpath\fR\fI\-encoding\fR\-\fIexclude\fR\fI\-extdirs\fR\fI\-help\fR\fI\-locale\fR\fI\-\fR\fIoverview\fR\fI\-package\fR\fI\-private\fR\fI\-protected\fR\fI\-public\fR\fI\-quiet\fR\fI\-source\fR\fI\-sourcepath\fR\fI\-subpackages\fR\fI\-verbose\fR -.SS "Javadocץ" +次のオプションは、すべてのドックレットに使用可能なコアのJavadocオプションです。標準ドックレットでは、ドックレットの他の部分を提供します。\fI\-bootclasspath\fR、\fI\-breakiterator\fR、\fI\-classpath\fR、\fI\-doclet\fR、\fI\-docletpath\fR、\fI\-encoding\fR、\-\fIexclude\fR、\fI\-extdirs\fR、\fI\-help\fR、\fI\-locale\fR、\fI\-\fR\fIoverview\fR、\fI\-package\fR、\fI\-private\fR、\fI\-protected\fR、\fI\-public\fR、\fI\-quiet\fR、\fI\-source\fR、\fI\-sourcepath\fR、\fI\-subpackages\fRおよび\fI\-verbose\fR。 +.SS "Javadocオプション" .PP \-overview \fIpath/filename \fR .RS 4 -\fIjavadoc\fRޥɤФơ\fIpath/filename \fRǻꤵ줿ե뤫鳵ץɥѤΥƥȤΥƥȤץڡ(overview\-summary\&.html)֤褦˻ꤷޤ\fIpath/filename\fRϡߤΥǥ쥯ȥ꤫ХѥǤ +\fIjavadoc\fRコマンドに対して、\fIpath/filename \fRで指定されたソース・ファイルから概要ドキュメント用のテキストを取得し、そのテキストを概要ページ(overview\-summary\&.html)に配置するように指定します。\fIpath/filename\fRは、現在のディレクトリからの相対パスです。 .sp -\fIfilename\fRͤǤդ̾ѤpathǤդǤޤ̾overview\&.htmlȤ̾դĥ꡼κǾ̥ѥåǥ쥯ȥޤǥ쥯ȥ֤ޤξ֤ȡѥåɥȲȤpathꤹɬפʤʤޤϡ\fI\-sourcepath\fRץˤäƤΥե뤬ؤ뤫Ǥ +\fIfilename\fRの値で任意の名前を使用し、pathで任意の配置先を指定できますが、通常はoverview\&.htmlという名前を付け、ソース・ツリー内の最上位パッケージ・ディレクトリを含むディレクトリに配置します。この場所に配置すると、パッケージをドキュメント化するときにpathを指定する必要がなくなります。これは、\fI\-sourcepath\fRオプションによってこのファイルが指し示されるからです。 .sp -ȤС\fIjava\&.lang\fRѥåΥĥ꡼/src/classes/java/lang/ξ硢ץե/src/classes/overview\&.html֤Ǥޤ +たとえば、\fIjava\&.lang\fRパッケージのソース・ツリーが/src/classes/java/lang/の場合、概要ファイルを/src/classes/overview\&.htmlに配置できます .sp -ºݤ򻲾ȤƤ +実際の例を参照してください。 .sp -\fIpath/filename\fRǻꤹեˤĤƤϡץȡե򻲾ȤƤ +\fIpath/filename\fRで指定するファイルについては、概要コメント・ファイルを参照してください。 .sp -ץڡΤϡ\fIjavadoc\fRޥɤʣΥѥå̾ϤΤߤǤܺ٤ϡHTMLե졼򻲾ȤƤץڡΥȥϡ\fI\-doctitle\fRˤäꤵޤ +概要ページが作成されるのは、\fIjavadoc\fRコマンドに複数のパッケージ名を渡した場合のみです。詳細は、HTMLフレームを参照してください。概要ページのタイトルは、\fI\-doctitle\fRによって設定されます。 .RE .PP \-Xdoclint:(all|none|[\-]\fI<group>\fR) .RS 4 -ʻȡӥƥηJavadocȤ­ηٹݡȤ̵Javadocʸ­ƤHTMLΥ顼ݡȤޤ +不正な参照、アクセシビリティの欠落およびJavadocコメントの不足の警告をレポートし、無効なJavadoc構文および不足しているHTMLタグのエラーをレポートします。 .sp -Υץˤꡢ\fIjavadoc\fRޥɤ줿Ϥ˴ޤޤ뤹٤ƤΥɥȡȤåޤ̾ɤꡢɸ४ץ\fI\-public\fR\fI\-protected\fR\fI\-package\fR\fI\-private\fR줿Ϥ˴ޤܤǤޤ +このオプションにより、\fIjavadoc\fRコマンドは生成された出力に含まれるすべてのドキュメント・コメントをチェックします。通常どおり、標準オプション\fI\-public\fR、\fI\-protected\fR、\fI\-package\fRおよび\fI\-private\fRで生成された出力に含む項目を選択できます。 .sp -\fI\-Xdoclint\fRͭˤʤäƤϡ\fIjavac\fRޥɤƱͤ˥å꤬ݡȤޤ\fIjavadoc\fRޥɤϡåեΥԡӥ顼Ф줿Τʰ֤ؤåȤϤޤåϡ١줿ɥȤХǡѤƼ¹Ԥ줿˥顼ȯǽ˱ơٹޤϥ顼ˤʤޤȤСʻȤޤJavadocȤηϡ\fIjavadoc\fRޥɤ̵HTML븶ˤʤʤᡢϷٹȤƥݡȤޤʸ顼ޤHTMLληϡ\fIjavadoc\fRޥɤ̵HTML븶ˤʤ뤿ᡢϥ顼ȤƥݡȤޤ +\fI\-Xdoclint\fRが有効になっている場合は、\fIjavac\fRコマンドと同様にメッセージで問題がレポートされます。\fIjavadoc\fRコマンドは、メッセージ、ソース・ファイルのコピーおよびエラーが検出された正確な位置を指すキャレットを出力します。メッセージは、重大度、および生成されたドキュメントがバリデータを使用して実行された場合にエラーが発生する可能性に応じて、警告またはエラーになります。たとえば、不正な参照またはJavadocコメントの欠落は、\fIjavadoc\fRコマンドが無効なHTMLを生成する原因にならないため、これらの問題は警告としてレポートされます。構文エラーまたはHTML終了タグの欠落は、\fIjavadoc\fRコマンドが無効なHTMLを生成する原因になるため、これらの問題はエラーとしてレポートされます。 .sp -ǥեȤǤϡ\fI\-Xdoclint\fRץͭˤʤäƤޤץ\fI\-Xdoclint:none\fR̵ˤޤ +デフォルトでは、\fI\-Xdoclint\fRオプションは有効になっています。オプション\fI\-Xdoclint:none\fRで無効にします。 .sp -\fI\-Xdoclint\fRץǥݡȤƤϼΥץѹޤ +\fI\-Xdoclint\fRオプションでレポートされる内容は次のオプションで変更します。 .sp .RS 4 .ie n \{\ @@ -2261,7 +2261,7 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI none\fR: -\fI\-Xdoclint\fRץ̵ˤޤ +\fI\-Xdoclint\fRオプションを無効にします。 .RE .sp .RS 4 @@ -2273,7 +2273,7 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI \fR\fIgroup\fR: -\fIgroup\fRåͭˤޤ +\fIgroup\fRチェックを有効にします。 .RE .sp .RS 4 @@ -2284,7 +2284,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fI\-Xdoclint\fR\fI\fR\fI all\fR: ٤ƤΥå롼פͭˤޤ +\fI\-Xdoclint\fR\fI\fR\fI all\fR: すべてのチェック・グループを有効にします。 .RE .sp .RS 4 @@ -2296,10 +2296,10 @@ Javadoc .IP \(bu 2.3 .\} \fI\-Xdoclint\fR\fI\fR\fI all,\fR\fI\-group\fR: -\fIgroup\fRåʳΤ٤Ƥͭˤޤ +\fIgroup\fRチェック以外のすべてを有効にします。 .RE .sp -ѿ\fIgroup\fRϼΤ줫ͤޤ +変数\fIgroup\fRは次のいずれかの値を持ちます。 .sp .RS 4 .ie n \{\ @@ -2309,7 +2309,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIaccessibility\fR: ӥƥåǸФåޤ(ȤС\fI<table>\fRǻꤵno captionޤsummary°) +\fIaccessibility\fR: アクセシビリティ・チェッカで検出する問題をチェックします(たとえば、\fI<table>\fRタグで指定されるno captionまたはsummary属性)。 .RE .sp .RS 4 @@ -2320,7 +2320,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIhtml\fR: 饤ǤؤΥ֥åǤ佪λɬפȤǤλʤʤɡ̥٥HTML򸡽Фޤ롼ϡHTML 4\&.01ͤƳФޤΥפΥåϡ\fIjavadoc\fRޥɤͭˤơ֥饦ǽΤHTML򸡽Фޤ +\fIhtml\fR: インライン要素へのブロック要素の挿入や終了タグを必要とする要素を終了しないなど、上位レベルHTMLの問題を検出します。ルールは、HTML 4\&.01仕様から導出されます。このタイプのチェックは、\fIjavadoc\fRコマンドを有効にして、ブラウザが受け入れる可能性のあるHTMLの問題を検出します。 .RE .sp .RS 4 @@ -2331,7 +2331,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fImissing\fR: ƤJavadocȤޤϥåޤ(ȤСƤ륳Ȥ䥯饹ޤϷƤ\fI@return\fR᥽åɾƱͤΥ) +\fImissing\fR: 欠落しているJavadocコメントまたはタグをチェックします(たとえば、欠落しているコメントやクラス、または欠落している\fI@return\fRタグやメソッド上の同様のタグ)。 .RE .sp .RS 4 @@ -2342,7 +2342,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIreference\fR: JavadocJava APIǤλȤ˴Ϣåޤ(ȤС\fI@see\fRǸĤʤܡޤ\fI@param\fRθ̾) +\fIreference\fR: JavadocタグのJava API要素の参照に関連する問題をチェックします(たとえば、\fI@see\fRで見つからない項目、または\fI@param\fRの後の不正な名前)。 .RE .sp .RS 4 @@ -2353,10 +2353,10 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -\fIsyntax\fR: פƤʤå(\fI<\fR\fI>\fR)䥢ѥ(\fI&\fR)̵Javadocʤɤβ̥٥ǧޤ +\fIsyntax\fR: エスケープされていない山カッコ(\fI<\fRおよび\fI>\fR)やアンパサンド(\fI&\fR)、無効なJavadocタグなどの下位レベルの問題を確認します。 .RE .sp -\fI\-Xdoclint\fRץʣꤷơʣΥƥΥ顼ȷٹå륪ץͭˤǤޤޤϡΥץѤơʣΥ顼ӷٹ𥫥ƥǤޤȤСΥޥɤΤ줫Ѥơ\fIfilename\fRեHTMLʸӥӥƥåޤ +\fI\-Xdoclint\fRオプションを複数回指定して、複数のカテゴリのエラーと警告をチェックするオプションを有効にできます。または、前のオプションを使用して、複数のエラーおよび警告カテゴリを指定できます。たとえば、次のコマンドのいずれかを使用して、\fIfilename\fRファイル内のHTML、構文およびアクセシビリティの問題をチェックします。 .sp .if n \{\ .RS 4 @@ -2368,57 +2368,57 @@ javadoc \-Xdoclint:html,syntax,accessibility \fIfilename\fR .if n \{\ .RE .\} -\fB:\fR -\fIjavadoc\fRޥɤǤϡΥåδݾڤޤ󡣶ŪˤϡHTMLץ饤󥹡åǤϤޤ\-\fIXdoclint\fRץŪϡ\fIjavadoc\fRޥɤͭˤưŪʥ顼ȾݡȤ뤳ȤǤ +\fB注意:\fR +\fIjavadoc\fRコマンドでは、これらのチェックの完全性は保証されません。具体的には、完全なHTMLコンプライアンス・チェッカではありません。\-\fIXdoclint\fRオプションの目的は、\fIjavadoc\fRコマンドを有効にして一般的なエラーの大半をレポートすることです。 .sp -\fIjavadoc\fRޥɤϡ̵ϤνԤݡȤΤ߹Ԥޤ +\fIjavadoc\fRコマンドは、無効な入力の修正を試行せず、レポートのみ行います。 .RE .PP \-public .RS 4 -public饹ӥСΤɽޤ +publicクラスおよびメンバーのみ表示します。 .RE .PP \-protected .RS 4 -protectedpublicΥ饹ȥСΤߤɽޤ줬ǥեȤǤ +protectedおよびpublicのクラスとメンバーのみを表示します。これがデフォルトです。 .RE .PP \-package .RS 4 -packageprotectedpublicΥ饹ȥСΤɽޤ +package、protected、およびpublicのクラスとメンバーのみ表示します。 .RE .PP \-private .RS 4 -٤ƤΥ饹ȥСɽޤ +すべてのクラスとメンバーを表示します。 .RE .PP \-help .RS 4 -饤󡦥إפɽޤ\fIjavadoc\fR\fIɥåå\fRΥޥɥ饤󡦥ץ󤬥ꥹȤޤ +オンライン・ヘルプを表示します。\fIjavadoc\fRと\fIドックレット\fRのコマンドライン・オプションがリストされます。 .RE .PP \-doclet \fIclass\fR .RS 4 -ɥȤ˻ѤɥååȤư뤿Υ饹եꤷޤ̾ѤޤΥɥååȤˤꡢϤƤȷޤ\fI\-doclet\fRץ󤬻ѤƤʤ硢\fIjavadoc\fRޥɤϡɸɥååȤѤƥǥեȤHTMLޤΥ饹ˤ\fIstart(Root)\fR᥽åɤޤޤƤɬפޤεư饹ؤΥѥ\fI\-docletpath\fRץˤäޤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ +ドキュメントの生成に使用するドックレットを起動するためのクラス・ファイルを指定します。完全修飾名を使用します。このドックレットにより、出力の内容と形式が定義されます。\fI\-doclet\fRオプションが使用されていない場合、\fIjavadoc\fRコマンドは、標準ドックレットを使用してデフォルトのHTML形式を生成します。このクラスには\fIstart(Root)\fRメソッドが含まれている必要があります。この起動クラスへのパスは\fI\-docletpath\fRオプションによって定義されます。ドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください .RE .PP \-docletpath \fIclasspathlist\fR .RS 4 -\fI\-doclet\fRץǻꤵ줿ɥååȳϥ饹ե롢ӤΥ饹¸뤹٤ƤJARեؤΥѥꤷޤϥ饹ե뤬JARեˤ硢ΥץJARեؤΥѥꤷޤХѥޤϸߤΥǥ쥯ȥ꤫ХѥǤޤ\fIclasspathlist\fRʣΥѥJARե뤬ޤޤˤϡSolarisξϥ(:)ǡWindowsξϥߥ(;)Ǥ줾ڤޤŪΥɥååȳϥ饹Ǥ˸ѥˤϡΥץפǤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ +\fI\-doclet\fRオプションで指定されたドックレット開始クラス・ファイル、およびそのクラスが依存するすべてのJARファイルへのパスを指定します。開始クラス・ファイルがJARファイル内にある場合、このオプションでJARファイルへのパスを指定します。絶対パスまたは現在のディレクトリからの相対パスを指定できます。\fIclasspathlist\fRに複数のパスやJARファイルが含まれる場合には、それらをSolarisの場合はコロン(:)で、Windowsの場合はセミコロン(;)でそれぞれ区切ります。目的のドックレット開始クラスがすでに検索パス内にある場合は、このオプションは不要です。ドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください .RE .PP \-1\&.1 .RS 4 -Javadoc 1\&.4졢ؤϤޤ󡣤ΥץϡJavadoc 1\&.1ˤäΤƱȵǽĥɥȤ뤿ΤΤǤ(ͥȤ줿饹ϥݡȤƤޤ)ΥץɬפʾϡJavadoc 1\&.2ޤ1\&.3򤫤˻ѤƤ +Javadoc 1\&.4から削除され、代替はありません。このオプションは、Javadoc 1\&.1によって生成されるのと同じ外見と機能を持つドキュメントを作成するためのものでした(ネストされたクラスはサポートされていません)。このオプションが必要な場合は、Javadoc 1\&.2または1\&.3をかわりに使用してください。 .RE .PP \-source \fIrelease\fR .RS 4 -դ륽ɤΥ꡼ꤷޤ\fIrelease\fRѥ᡼ˤϼͤǤޤ\fIjavac\fRޥɤǥɤ򥳥ѥ뤹Ȥ˻Ѥͤб\fI꡼\fRͤѤޤ +受け付けるソース・コードのリリースを指定します。\fIrelease\fRパラメータには次の値を指定できます。\fIjavac\fRコマンドでコードをコンパイルするときに使用する値に対応する\fIリリース\fRの値を使用します。 .sp .RS 4 .ie n \{\ @@ -2428,7 +2428,7 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.5\fR\fIjavadoc\fRޥɤϡJDK 1\&.5Ƴ줿Τ¾θ쵡ǽޤॳɤդޤ\fI\-source\fRץ󤬻ѤʤäΥѥΥǥեưϡ1\&.5ΤΤˤʤޤ +\fBリリース値: 1\&.5\fR。\fIjavadoc\fRコマンドは、JDK 1\&.5で導入された総称および他の言語機能を含むコードを受け付けます。\fI\-source\fRオプションが使用されなかった場合のコンパイラのデフォルト動作は、1\&.5のものになります。 .RE .sp .RS 4 @@ -2439,7 +2439,7 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.4\fR\fIjavadoc\fRޥɤϡJDK 1\&.4Ƴ줿ޤॳɤդޤ +\fBリリース値: 1\&.4\fR。\fIjavadoc\fRコマンドは、JDK 1\&.4で導入されたアサーションを含むコードを受け付けます。 .RE .sp .RS 4 @@ -2450,20 +2450,20 @@ Javadoc 1\&.4 .sp -1 .IP \(bu 2.3 .\} -\fB꡼: 1\&.3\fR\fIjavadoc\fRޥɤϡJDK 1\&.3ʹߤƳ줿Ρޤ¾θ쵡ǽ򥵥ݡȤޤ +\fBリリース値: 1\&.3\fR。\fIjavadoc\fRコマンドは、JDK 1\&.3以降に導入されたアサーション、総称、または他の言語機能をサポートしません。 .RE .RE .PP \-sourcepath \fIsourcepathlist\fR .RS 4 -ѥå̾ޤ\fI\-subpackages\fRץ\fIjavadoc\fRޥɤϤȤˡե򸫤Ĥ뤿θѥꤷޤ -\fIʣΥѥϥ(:)Ƕڤޤ\fR\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤΥץѤơɥȲ륽եΰ֤ΤߤǤʤ켫ΤϥɥȲʤɥȲ륽ե뤫Ѿ줿Ȥĥեΰ֤ǧǤޤ +パッケージ名または\fI\-subpackages\fRオプションを\fIjavadoc\fRコマンドに渡すときに、ソース・ファイルを見つけるための検索パスを指定します。 +\fI複数のパスはコロン(:)で区切ります。\fR\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。このオプションを使用して、ドキュメント化されるソース・ファイルの位置のみでなく、それ自体はドキュメント化されないがドキュメント化されるソース・ファイルから継承されたコメントを持つソース・ファイルの位置も確認できます。 .sp -\fI\-sourcepath\fRץѤǤΤϡ\fIjavadoc\fRޥɤ˥ѥå̾ϤΤߤǤ\fIjavadoc\fRޥɤϤ륽եϸޤ󡣥եꤹˤϡΥǥ쥯ȥ˰ư뤫1İʾΥ饹ΥɥȲפ˼褦˳ƥե˥ѥޤޤ\fI\-sourcepath\fRά줿硢\fIjavadoc\fRޥɤϡ饹ѥѤƥե򸡺ޤ(\fI\-classpath\fR򻲾)ǥեȤ\fI\-sourcepath\fRϡ饹ѥͤǤ\fI\-classpath\fRάƥѥå̾\fIjavadoc\fRޥɤϤȡ\fIjavadoc\fRޥɤϸߤΥǥ쥯ȥ(ӤΥ֥ǥ쥯ȥ)饽ե򸡺ޤ +\fI\-sourcepath\fRオプションを使用できるのは、\fIjavadoc\fRコマンドにパッケージ名を渡す場合のみです。\fIjavadoc\fRコマンドに渡されるソース・ファイルは検索されません。ソース・ファイルを特定するには、そのディレクトリに移動するか、「1つ以上のクラスのドキュメント化」に示すように各ファイルの前にパスを含めます。\fI\-sourcepath\fRが省略された場合、\fIjavadoc\fRコマンドは、クラス・パスを使用してソース・ファイルを検索します(\fI\-classpath\fRを参照)。デフォルトの\fI\-sourcepath\fRは、クラス・パスの値です。\fI\-classpath\fRを省略してパッケージ名を\fIjavadoc\fRコマンドに渡すと、\fIjavadoc\fRコマンドは現在のディレクトリ(およびそのサブディレクトリ)からソース・ファイルを検索します。 .sp -\fIsourcepathlist\fRˤϡɥȲѥåΥĥ꡼Υ롼ȡǥ쥯ȥꤷޤ +\fIsourcepathlist\fRには、ドキュメント化するパッケージのソース・ツリーのルート・ディレクトリを設定します。 .sp -ȤС\fIcom\&.mypackage\fRȤ̾ΥѥåɥȲˡΥե뤬/home/user/src/com/mypackage/*\&.javaˤȤޤѥcom\emypackageޤޤǥ쥯ȥ/home/user/src˻ꤷƤ顢Τ褦ˡѥå̾ꤷޤ +たとえば、\fIcom\&.mypackage\fRという名前のパッケージをドキュメント化する場合に、そのソース・ファイルが/home/user/src/com/mypackage/*\&.javaにあるとします。ソース・パスをcom\emypackageが含まれるディレクトリ/home/user/srcに指定してから、次のように、パッケージ名を指定します。 .sp .if n \{\ .RS 4 @@ -2474,11 +2474,11 @@ javadoc \-sourcepath /home/user/src/ com\&.mypackage .if n \{\ .RE .\} -ѥͤȥѥå̾Ϣ뤷ơɥåȤ򥹥å(/)ѹȡΤ褦ˡѥåΥեѥˤʤޤ +ソース・パスの値とパッケージ名を連結して、ドットをスラッシュ(/)に変更すると、次のように、パッケージのフルパスになります。 .sp /home/user/src/com/mypackage .sp -2ĤΥѥꤹˤϡΤ褦ˤޤ +2つのソース・パスを設定するには、次のようにします。 .sp .if n \{\ .RS 4 @@ -2493,12 +2493,12 @@ javadoc \-sourcepath /home/user1/src:/home/user2/src com\&.mypackage .PP \-classpath \fIclasspathlist\fR .RS 4 -\fIjavadoc\fRޥɤȥ饹θԤȤ˻Ѥѥꤷޤȥ饹ȤϡɥȲ륯饹ȡΥ饹ˤäƻȤ뤹٤ƤΥ饹ΤȤǤ -\fIʣΥѥϥ(:)Ƕڤޤ\fR\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤ\fIclasspathlist\fRͤꤹȤϡ饹ѥΥɥȤˤؼ˽äƤ +\fIjavadoc\fRコマンドが参照クラスの検索を行うときに使用するパスを指定します。参照クラスとは、ドキュメント化されるクラスと、それらのクラスによって参照されるすべてのクラスのことです。 +\fI複数のパスはコロン(:)で区切ります。\fR\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。\fIclasspathlist\fRの値を指定するときは、クラス・パスのドキュメントにある指示に従ってください。 .sp -\fI\-sourcepath\fRά줿硢\fIjavadoc\fRޥɤ\fI\-classpath\fRѤơե뤪ӥ饹ե򸡺ޤ(̸ߴΤ)եȥ饹ե̡Υѥ鸡ɬפϡ\fI\-sourcepath\fR\fI\-classpath\fRξѤޤ +\fI\-sourcepath\fRが省略された場合、\fIjavadoc\fRコマンドは\fI\-classpath\fRを使用して、ソース・ファイルおよびクラス・ファイルを検索します(下位互換性のため)。ソース・ファイルとクラス・ファイルを別々のパスから検索する必要がある場合は、\fI\-sourcepath\fRと\fI\-classpath\fRの両方を使用します。 .sp -ȤС\fIcom\&.mypackage\fRɥȲˡΥե뤬ǥ쥯ȥ/home/user/src/com/mypackageˤꡢΥѥå/home/user/libthenΥ饤֥˰¸ƤȤΤ褦˻ꤷޤ +たとえば、\fIcom\&.mypackage\fRをドキュメント化する場合に、そのソース・ファイルがディレクトリ/home/user/src/com/mypackageにあり、このパッケージが/home/user/libthen内のライブラリに依存しているとき、次のように指定します。 .sp .if n \{\ .RS 4 @@ -2509,21 +2509,21 @@ javadoc \-sourcepath /home/user/lib \-classpath /home/user/src com\&.mypackage .if n \{\ .RE .\} -¾ΥġƱͤˡ\fI\-classpath\fRꤵƤʤ硢\fICLASSPATH\fRĶѿꤵƤС\fIjavadoc\fRޥɤϤδĶѿѤޤɤꤵƤʤ硢\fIjavadoc\fRޥɤϸߤΥǥ쥯ȥ꤫饯饹򸡺ޤ +他のツールと同様に、\fI\-classpath\fRが指定されていない場合、\fICLASSPATH\fR環境変数が設定されていれば、\fIjavadoc\fRコマンドはその環境変数を使用します。どちらも設定されていない場合、\fIjavadoc\fRコマンドは現在のディレクトリからクラスを検索します。 .sp -\fIjavadoc\fRޥɤ\fI\-classpath\fRѤƥ桼饹򸡺ˡˤĤƤΡĥǽ饹֡ȥȥåס饹˴Ϣܺ٤ϡ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +\fIjavadoc\fRコマンドが\fI\-classpath\fRを使用してユーザー・クラスを検索する方法についての、拡張機能クラスやブートストラップ・クラスに関連した詳細は、クラスの検索方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください。 .sp -*Υ١̾ޤ९饹ѥǤϡ\fI\&.jar\fRޤ\fI\&.JAR\fRĥҤ˻ĥǥ쥯ȥΤ٤ƤΥեΥꥹȤꤹΤƱȤߤʤޤ +*のベース名を含むクラス・パス要素は、\fI\&.jar\fRまたは\fI\&.JAR\fRを拡張子に持つディレクトリ内のすべてのファイルのリストを指定するのと同等とみなされます。 .sp -ȤСǥ쥯ȥ\fImydir\fR\fIa\&.jar\fR\fIb\&.JA\fRRޤޤƤ硢饹ѥ\fIfoo/*\fR\fIA\&.jar:b\&.JAR\fRŸޤJARեν֤̤ȤʤޤɽΥեޤࡢꤷǥ쥯ȥΤ٤ƤJARե뤬ꥹȤ˴ޤޤޤ*ʤ륯饹ѥȥϡߤΥǥ쥯ȥΤ٤ƤJARեΥꥹȤŸޤ\fICLASSPATH\fRĶѿƱͤŸޤ饹ѥΥ磻ɥɤŸϡJavaۥޥ(JVM)γ˹ԤޤJavaץϡSystem\&.getenv(\fI"CLASSPATH"\fR)θƤӽФˤäƤʤɡĶ䤤礻ŸƤʤ磻ɥɤ򻲾Ȥޤ +たとえば、ディレクトリ\fImydir\fRに\fIa\&.jar\fRと\fIb\&.JA\fRRが含まれている場合、クラス・パス要素\fIfoo/*\fRは\fIA\&.jar:b\&.JAR\fRに展開されますが、JARファイルの順番は未指定となります。非表示のファイルを含む、指定したディレクトリ内のすべてのJARファイルがリストに含まれます。*からなるクラス・パス・エントリは、現在のディレクトリ内のすべてのJARファイルのリストに展開されます。\fICLASSPATH\fR環境変数も同様に展開されます。クラス・パスのワイルドカードの展開は、Java仮想マシン(JVM)の開始前に行われます。Javaプログラムは、System\&.getenv(\fI"CLASSPATH"\fR)の呼び出しによってなど、環境を問い合せる場合を除き、展開されていないワイルドカードを参照しません。 .RE .PP \-subpackages \fIpackage1:package2:\&.\&.\&.\fR .RS 4 -ե뤫ꤵ줿ѥåӤΥ֥ѥå˺ƵŪ˥ɥȤޤΥץϡɤ˿֥ѥåɲäݤǤ֥ѥåưŪȤ߹ޤ뤫ǤpackageϡǤդκǾ̥֥ѥå(\fIjava\fRʤ)ޤϴѥå(\fIjavax\&.swing\fRʤ)ˤʤޤեޤɬפϤޤ󡣰ϡ٤ƤΥڥ졼ƥ󥰡ƥǡǶڤޤ磻ɥɤϻѤǤޤ󡣥ѥåθꤹˤϡ\fI\-sourcepath\fRѤޤΥץǤϡĥ꡼¸ߤ뤬ѥå˴ޤޤʤեޤ󡣥եν򻲾ȤƤ +ソース・ファイルから指定されたパッケージおよびそのサブパッケージ内に再帰的にドキュメントを生成します。このオプションは、ソース・コードに新しいサブパッケージを追加する際に便利です。新しいサブパッケージが自動的に組み込まれるからです。各package引数は、任意の最上位サブパッケージ(\fIjava\fRなど)または完全修飾パッケージ(\fIjavax\&.swing\fRなど)になります。ソース・ファイルを含める必要はありません。引数は、すべてのオペレーティング・システムで、コロンで区切られます。ワイルドカードは使用できません。パッケージの検索場所を指定するには、\fI\-sourcepath\fRを使用します。このオプションでは、ソース・ツリー内に存在するがパッケージに含まれないソース・ファイルを処理しません。ソース・ファイルの処理を参照してください。 .sp -ȤСΥޥɤϡ\fIjava\fR\fIjavax\&.swing\fRȤ̾ΥѥåȤΥ֥ѥåΥɥȤޤ +たとえば、次のコマンドは、\fIjava\fRおよび\fIjavax\&.swing\fRという名前のパッケージとこれらのサブパッケージ全部のドキュメントを生成します。 .sp .if n \{\ .RS 4 @@ -2538,9 +2538,9 @@ javadoc \-d docs \-sourcepath /home/user/src \-subpackages java:javax\&.swing .PP \-exclude \fIpackagename1:packagename2:\&.\&.\&.\fR .RS 4 -ꤵ줿ѥåȤΥ֥ѥå\fI\-subpackages\fRˤäƺ줿ꥹȤ̵˽ޤޤϾ\fI\-subpackages\fRץλˤäȤ߹ޤѥåоݤȤʤޤ +指定されたパッケージとそのサブパッケージを\fI\-subpackages\fRによって作成されたリストから無条件に除外します。過去または将来の\fI\-subpackages\fRオプションの指定によって組み込まれるパッケージも除外の対象となります。 .sp -Ǥϡ\fIjava\&.io\fR\fIjava\&.util\fR\fIjava\&.math\fRʤɤȤ߹ޤޤ\fIjava\&.net\fR\fIjava\&.lang\fR롼Ȥ˻ĥѥåϽޤ\fIjava\&.lang\fRΥ֥ѥåǤ\fIjava\&.lang\&.ref\fRդƤ +次の例では、\fIjava\&.io\fR、\fIjava\&.util\fR、\fIjava\&.math\fRなどは組み込まれますが、\fIjava\&.net\fRと\fIjava\&.lang\fRをルートに持つパッケージは除外されます。\fIjava\&.lang\fRのサブパッケージである\fIjava\&.lang\&.ref\fRが除外される点に注意してください。 .sp .if n \{\ .RS 4 @@ -2556,30 +2556,30 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .PP \-bootclasspath \fIclasspathlist\fR .RS 4 -֡ȡ饹¸ߤѥꤷޤ֡ȡ饹Ȥϡ̾Javaץåȥեࡦ饹ΤȤǤ\fIbootclasspath\fRϡ\fIjavadoc\fRޥɤեȥ饹եõȤ˻Ѥ븡ѥΰǤܺ٤ϡ饹θˡ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)򻲾ȤƤ +ブート・クラスが存在するパスを指定します。ブート・クラスとは、通常、Javaプラットフォーム・クラスのことです。\fIbootclasspath\fRは、\fIjavadoc\fRコマンドがソース・ファイルとクラス・ファイルを探すときに使用する検索パスの一部です。詳細は、クラスの検出方法 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html)を参照してください .sp -\fIclasspathlist\fRѥ᡼Υǥ쥯ȥϡߥ(;)Ƕڤ(Windowsξ)(:)Ƕڤޤ(Oracle Solarisξ) +\fIclasspathlist\fRパラメータ内のディレクトリは、セミコロン(;)で区切る(Windowsの場合)か、コロン(:)で区切ります(Oracle Solarisの場合)。 .RE .PP \-extdirs \fIdirist\fR .RS 4 -ĥǽ饹¸ߤǥ쥯ȥꤷޤĥǽ饹ȤϡJavaĥǽѤ뤹٤ƤΥ饹Ǥ\fIextdirs\fRץϡ\fIjavadoc\fRޥɤեȥ饹եõȤ˻Ѥ븡ѥΰǤܺ٤ϡ\fI\-classpath\fRץ򻲾ȤƤ\fIdirlist\fRΥǥ쥯ȥϡߥ(;)Ƕڤ(Windowsξ)(:)Ƕڤޤ(Oracle Solarisξ) +拡張機能クラスが存在するディレクトリを指定します。拡張機能クラスとは、Java拡張機能機構を使用するすべてのクラスです。\fIextdirs\fRオプションは、\fIjavadoc\fRコマンドがソース・ファイルとクラス・ファイルを探すときに使用する検索パスの一部です。詳細は、\fI\-classpath\fRオプションを参照してください。\fIdirlist\fR内のディレクトリは、セミコロン(;)で区切る(Windowsの場合)か、コロン(:)で区切ります(Oracle Solarisの場合)。 .RE .PP \-verbose .RS 4 -\fIjavadoc\fRޥɤμ¹˾ܺ٤ʥåɽޤ\fIverbose\fRץꤷʤȡեΥɻɥȤ(ե뤴Ȥ1ĤΥå)ӥȻ˥åɽޤverboseץꤹȡJavaեβϤפ(ߥñ)򼨤ɲäΥåɽޤ +\fIjavadoc\fRコマンドの実行中に詳細なメッセージを表示します。\fIverbose\fRオプションを指定しないと、ソース・ファイルのロード時、ドキュメントの生成時(ソース・ファイルごとに1つのメッセージ)、およびソート時にメッセージが表示されます。verboseオプションを指定すると、各Javaソース・ファイルの解析に要した時間(ミリ秒単位)を示す追加のメッセージが表示されます。 .RE .PP \-quiet .RS 4 -åٹȥ顼Τߤɽ褦ˤơǧ䤹ޤ\fIversion\fRʸ޻ߤޤ +メッセージを抑制し、警告とエラーのみが表示されるようにして、これらを確認しやすくします。\fIversion\fR文字列も抑止します。 .RE .PP \-breakiterator .RS 4 -Ѹξ硢ѥå饹ޤϥСμκǽʸνȽǤݤˡ\fIjava\&.text\&.BreakIterator\fRιݲ줿ʸѤޤ¾Τ٤ƤΥϡѸȤͭΥ르ꥺǤϤʤǤ\fIBreakIterator\fR饹ѤƤޤǽʸϡѥå饹ޤϥСΥޥ꡼˥ԡ졢ե٥åȽκ˥ԡޤJDK 1\&.2ʹߡ\fIBreakIterator\fR饹ϡѸ٤ƤθʸνȽǤ뤿ˡǤ˻ѤƤޤäơ\fI\-breakiterator\fRץϡ1\&.2ʹߤǤϱʸʳˤϸ̤ޤ󡣱ʸˤϡΤ褦ȼΥǥեȤΥ르ꥺबޤ +英語の場合、パッケージ、クラスまたはメンバーの主説明の最初の文の終わりを判断する際に、\fIjava\&.text\&.BreakIterator\fRの国際化された文境界を使用します。他のすべてのロケールは、英語言語というロケール固有のアルゴリズムではなく、すでに\fIBreakIterator\fRクラスを使用しています。最初の文は、パッケージ、クラス、またはメンバーのサマリーにコピーされ、アルファベット順の索引にコピーされます。JDK 1\&.2以降、\fIBreakIterator\fRクラスは、英語を除くすべての言語の文の終わりを判断するために、すでに使用されています。したがって、\fI\-breakiterator\fRオプションは、1\&.2以降では英文以外には効果がありません。英文には、次のような独自のデフォルトのアルゴリズムがあります。 .sp .RS 4 .ie n \{\ @@ -2589,7 +2589,7 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .sp -1 .IP \(bu 2.3 .\} -ʸΥǥեȤʸڤꥢ르ꥺࡣʸޤHTML֥å(\fI<P>\fRʤ)³ԥꥪɤߤޤ +英文のデフォルトの文区切りアルゴリズム。空白文字またはHTMLブロック・タグ(\fI<P>\fRなど)が続くピリオドで停止します。 .RE .sp .RS 4 @@ -2600,36 +2600,36 @@ javadoc \-sourcepath /home/user/src \-subpackages java \-exclude .sp -1 .IP \(bu 2.3 .\} -breakiteratorʸڤꥢ르ꥺࡣθ줬ʸǻϤޤ硢ʸ³ԥꥪɡ䡢ޤϴòߤޤΥ르ꥺǤϡThe serial no\&. is validפʤɡۤȤɤξάɽޤMr\&. SmithפϽޤ\fI\-breakiterator\fRץǤϡHTML䡢ޤϵǻϤޤʸǤߤޤHTMLޤƤǤ⡢\&.\&./filenameפκǸΥԥꥪɤߤޤ +breakiterator文区切りアルゴリズム。次の語が大文字で始まる場合、空白文字が続くピリオド、疑問符、または感嘆符で停止します。このアルゴリズムでは「The serial no\&. is valid」など、ほとんどの省略表記が処理されますが、「Mr\&. Smith」は処理されません。\fI\-breakiterator\fRオプションでは、HTMLタグや、数字または記号で始まる文では停止しません。HTMLタグに埋め込まれている場合でも、「\&.\&./filename」の最後のピリオドで停止します。 .RE .sp -Java SE 1\&.5Ǥ\fI\-breakiterator\fRٹå졢ǥեȤʸڤꥢ르ꥺѹƤޤ󡣥ɤѹSE 1\&.4\&.xǤ\fI\-breakiterator\fRץηٹƤʤǤ⡢⤹ɬפϤޤJava SE 1\&.5\&.0ϷٹϾǤƤޤ +Java SE 1\&.5では\fI\-breakiterator\fR警告メッセージが削除され、デフォルトの文区切りアルゴリズムは変更されていません。ソース・コードを変更せず、SE 1\&.4\&.xでの\fI\-breakiterator\fRオプションの警告を除去していない場合でも、何もする必要はありません。Java SE 1\&.5\&.0からは警告は消滅しています。 .RE .PP \-locale \fIlanguage_country_variant\fR .RS 4 -\fIjavadoc\fRޥɤɥȤȤ˻Ѥꤷޤΰϡ\fIj\fR\fIava\&.util\&.Locale\fRɥȤƤ褦ˡ\fIen_US\fR -(Ѹ졢ƹ)ޤ\fIen_US_WIN\fR -(WindowsХꥢ)ʤɤΥ̾Ǥ +\fIjavadoc\fRコマンドがドキュメントを生成するときに使用するロケールを指定します。この引数は、\fIj\fR\fIava\&.util\&.Locale\fRドキュメントで説明しているように、\fIen_US\fR +(英語、米国)または\fIen_US_WIN\fR +(Windowsバリアント)などのロケールの名前です。 .sp -\fB:\fR -\fI\-locale\fRץϡɸɥååȤ󶡤뤹٤ƤΥץ󡢤ޤϤ¾ǤդΥɥååȤ󶡤뤹٤ƤΥץ(¦)˻ꤹɬפޤʤȡʥӥ󡦥СѸɽޤΥޥɥ饤󡦥ץΤߡꤹ˰¸ޤɸɥååȤΥץ򻲾ȤƤ +\fB注意:\fR +\fI\-locale\fRオプションは、標準ドックレットが提供するすべてのオプション、またはその他の任意のドックレットが提供するすべてのオプションより前(左側)に指定する必要があります。そうしないと、ナビゲーション・バーが英語で表示されます。このコマンドライン・オプションのみ、指定する順序に依存します。標準ドックレットのオプションを参照してください。 .sp -ꤹȡꤷΥ꥽ե뤬\fIjavadoc\fRޥɤˤä򤵤ơå(ʥӥ󡦥СꥹȤɽθФإסեܼstylesheet\&.cssΥȤʤɤʸ)Τ˻Ѥޤޤե٥åȽ˥ȤꥹȤΥȽ硢ӺǽʸνȽǤ뤿ʸζڤʸ⡢ꤷˤäƷޤޤ\fI\-locale\fRץϡɥȲ륯饹ΥեǻꤵƤɥơ󡦥ȤΥƥȤΥꤹΤǤϤޤ +ロケールを指定すると、指定したロケールのリソース・ファイルが\fIjavadoc\fRコマンドによって選択されて、メッセージ(ナビゲーション・バー、リストと表の見出し、ヘルプ・ファイルの目次、stylesheet\&.cssのコメントなどの文字列)のために使用されます。また、アルファベット順にソートされるリストのソート順、および最初の文の終わりを判断するための文の区切り文字も、指定したロケールによって決まります。\fI\-locale\fRオプションは、ドキュメント化されるクラスのソース・ファイル内で指定されているドキュメンテーション・コメントのテキストのロケールを決定するものではありません。 .RE .PP \-encoding .RS 4 -եΥ󥳡ǥ󥰤̾(\fIEUCJIS/SJIS\fRʤ)ꤷޤΥץ󤬻ꤵƤʤϡץåȥեΥǥեȡСѤޤӥץ⻲ȤƤ +ソース・ファイルのエンコーディングの名前(\fIEUCJIS/SJIS\fRなど)を指定します。このオプションが指定されていない場合は、プラットフォームのデフォルト・コンバータが使用されます。およびオプションも参照してください。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjavadoc\fRޥɤ¹ԤJava Runtime Environment (JRE)ˡ\fIflag\fRľϤޤȤСɥȤ뤿˥ƥ32MBΥ꡼ݤƤɬפϡ\fI\-Xmx\fRץ򼡤Τ褦˸ƤӽФޤ\fIjavadoc \-J\-Xmx32m \-J\-Xms32m com\&.mypackage\fR\fI\-Xms\fRϾάǽǡϽ꡼ΥꤹΤߤΥץǡɬפʥ꡼κǾ̤狼äƤǤ +\fIjavadoc\fRコマンドを実行するJava Runtime Environment (JRE)に、\fIflag\fRを直接渡します。たとえば、生成ドキュメントを処理するためにシステムで32MBのメモリーを確保しておく必要がある場合は、\fI\-Xmx\fRオプションを次のように呼び出します。\fIjavadoc \-J\-Xmx32m \-J\-Xms32m com\&.mypackage\fR。\fI\-Xms\fRは省略可能で、これは初期メモリーのサイズを設定するのみのオプションで、必要なメモリーの最小量がわかっている場合に便利です。 .sp -\fIJ\fR\fIflag\fRδ֤˶ʸϤޤ +\fIJ\fRと\fIflag\fRの間に空白文字はありません。 .sp -ѤƤ\fIjavadoc\fRޥɤΥСǧˤ\fI\-version\fRץѤޤϥȥ꡼ˤɸɥååȤΥСֹ椬ޤޤޤJavadocޥɤμ¹Ԥ򻲾ȤƤ +使用している\fIjavadoc\fRコマンドのバージョンを確認するには\fI\-version\fRオプションを使用します。出力ストリームには標準ドックレットのバージョン番号が含まれます。Javadocコマンドの実行を参照してください。 .sp .if n \{\ .RS 4 @@ -2644,76 +2644,76 @@ Java HotSpot(TM) 64\-Bit Server VM (build 23\&.5\-b02, mixed mode) .RE .\} .RE -.SS "ɸɥååȤΥץ" +.SS "標準ドックレットのオプション" .PP \-d \fIdirectory\fR .RS 4 -\fIjavadoc\fRޥɤ줿HTMLե¸ǥ쥯ȥꤷޤ\fI\-d\fRץάȡեϸߤΥǥ쥯ȥ¸ޤ\fIdirectory\fRͤˤϡХǥ쥯ȥꡢޤϸߤκȥǥ쥯ȥ꤫Хǥ쥯ȥǤޤJava SE 1\&.4Ǥϡ\fIjavadoc\fRޥɤ¹Ԥǥ쥯ȥ꤬ưŪ˺ޤ +\fIjavadoc\fRコマンドが生成されたHTMLファイルを保存する生成先ディレクトリを指定します。\fI\-d\fRオプションを省略すると、ファイルは現在のディレクトリに保存されます。\fIdirectory\fRの値には、絶対ディレクトリ、または現在の作業ディレクトリからの相対ディレクトリを指定できます。Java SE 1\&.4では、\fIjavadoc\fRコマンドを実行すると生成先ディレクトリが自動的に作成されます。 .sp -ȤСǤϡ\fIcom\&.mypackage\fRѥåΥɥȤ졢η̤\fI/user/doc/ \fRǥ쥯ȥ¸ޤ\fIjavadoc \-d \fR\fI/user/doc/ \fR\fIcom\&.mypackage\fR +たとえば、次の例では、\fIcom\&.mypackage\fRパッケージのドキュメントが生成され、その結果が\fI/user/doc/ \fRディレクトリに保存されます。\fIjavadoc \-d \fR\fI/user/doc/ \fR\fIcom\&.mypackage\fR .RE .PP \-use .RS 4 -ɥȲ륯饹ӥѥåȤ1ĤλѥڡȤ߹ߤޤΥڡˤϡΥ饹ޤϥѥåAPIѤƤѥå饹᥽åɡ󥹥ȥ饯ӥեɤҤޤȤС饹CˤȤȡ饹CѤƤΤȤƤϡCΥ֥饹CȤƤեɡC֤᥽åɡӷCΥѥ᡼ĥ᥽åɤȥ󥹥ȥ饯ޤȤС\fIString\fRѤλѥڡɽǤޤ\fIjava\&.awt\&.Font\fR饹\fIgetName\fR᥽åɤ\fIString\fR᤹Τǡ\fIgetName\fR᥽åɤ\fIString\fRѤ\fIgetName\fR᥽åɤ\fIString\fRѤλѥڡɽޤϼǤϤʤAPIλѤΤߤɥȲޤ᥽åɤμ\fIString\fRѤ뤬Ȥʸʤޤʸ֤ʤ硢\fIString\fRλѤȤϤߤʤޤ줿ѥڡ˥ˤϡ饹ޤϥѥå˰ưʥӥ󡦥С\fB󥯤λ\fR򥯥åޤ +ドキュメント化されるクラスおよびパッケージごとに1つの使用ページを組み込みます。このページには、その特定のクラスまたはパッケージのAPIを使用しているパッケージ、クラス、メソッド、コンストラクタ、およびフィールドが記述されます。たとえば、クラスCを例にとると、クラスCを使用しているものとしては、Cのサブクラス、Cとして宣言されているフィールド、Cを返すメソッド、および型Cのパラメータを持つメソッドとコンストラクタがあります。たとえば、\fIString\fR型用の使用ページを表示できます。\fIjava\&.awt\&.Font\fRクラスの\fIgetName\fRメソッドは\fIString\fR型を戻すので、\fIgetName\fRメソッドは\fIString\fRを使用し、\fIgetName\fRメソッドが\fIString\fR用の使用ページに表示されます。これは実装ではなくAPIの使用のみをドキュメント化します。メソッドがその実装で\fIString\fRを使用するが、引数として文字列を取らない、または文字列を返さない場合、それは\fIString\fRの使用とはみなされません。生成された使用ページにアクセスするには、クラスまたはパッケージに移動し、ナビゲーション・バーの\fBリンクの使用\fRをクリックします。 .RE .PP \-version .RS 4 -ɥȤˡ@versionΥƥȤȤ߹ߤޤΥƥȤϡǥեȤǤϾάޤѤƤ\fIjavadoc\fRޥɤΥСǧˤ\fI\-J\-version\fRץѤޤ +生成ドキュメントに、@versionのテキストを組み込みます。このテキストは、デフォルトでは省略されます。使用している\fIjavadoc\fRコマンドのバージョンを確認するには\fI\-J\-version\fRオプションを使用します。 .RE .PP \-author .RS 4 -ɥȤˡ\fI@author\fRΥƥȤȤ߹ߤޤ +生成ドキュメントに、\fI@author\fRのテキストを組み込みます。 .RE .PP \-splitindex .RS 4 -ե򥢥ե٥åȤȤʣΥեʬ䤷ʸȤ1ĤΥեȡե٥åȰʳεǻϤޤȥѤ1ĤΥեޤ +索引ファイルをアルファベットごとに複数のファイルに分割し、文字ごとに1つのファイルと、アルファベット以外の記号で始まる索引エントリ用に1つのファイルを作成します。 .RE .PP \-windowtitle \fItitle\fR .RS 4 -HTML\fI<title>\fR֤륿ȥꤷޤ\fItitle\fR˻ꤷƥȤϡɥΥȥ䡢ΥڡФƺ줿֥饦Υ֥åޡ()ɽޤΥȥˤHTMLޤʤǤȥHTMLޤޤƤȡ֥饦Ǥޤ\fItitle\fRŰϥʸѤƥޡޤ\fI\-windowtitle\fRץάȡ\fIjavadoc\fRޥɤϡ\fI\-windowtitle\fRץΤˡ\fI\-doctitle\fRץͤѤޤȤС\fIjavadoc \-windowtitle "Java SE Platform" com\&.mypackage\fRǤ +HTMLの\fI<title>\fRタグに配置するタイトルを指定します。\fItitle\fRタグに指定したテキストは、ウィンドウのタイトルや、このページに対して作成されたブラウザのブックマーク(お気に入り)に表示されます。このタイトルにはHTMLタグを含めないでください。タイトルにHTMLタグが含まれていると、ブラウザがタグを正しく解釈できません。\fItitle\fRタグ内の内部の二重引用符はエスケープ文字を使用してマークします。\fI\-windowtitle\fRオプションを省略すると、\fIjavadoc\fRコマンドは、\fI\-windowtitle\fRオプションのかわりに、\fI\-doctitle\fRオプションの値を使用します。たとえば、\fIjavadoc \-windowtitle "Java SE Platform" com\&.mypackage\fRです。 .RE .PP \-doctitle \fItitle\fR .RS 4 -ץޥ꡼եκǾζ᤯֤륿ȥꤷޤ\fItitle\fR˻ꤷƥȤ·ˤʤꡢ٥1θФȤơʥӥ󡦥СΤ֤ޤ\fItitle\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢ȥǰϤɬפޤ\fItitle\fRǰѤϡפɬפޤȤС\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRǤ +概要サマリー・ファイルの最上部の近くに配置するタイトルを指定します。\fItitle\fRタグに指定したテキストは中央揃えになり、レベル1の見出しとして、上部ナビゲーション・バーのすぐ下に置かれます。\fItitle\fRタグにはHTMLタグおよび空白文字を含めることができますが、その場合、タイトルを引用符で囲む必要があります。\fItitle\fRタグの内部で引用符を使用する場合は、エスケープする必要があります。たとえば、\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRです。 .RE .PP \-title \fItitle\fR .RS 4 -Ǥ¸ߤޤJavadoc 1\&.2Υ١Ǥˤ¸ߤƤޤǤΥץϡ\fI\-doctitle\fRȤ̾ѹޤ̾ѹͳϡΥץ󤬡ɥΥȥǤϤʤɥȤΥȥ뤳ȤΤˤ뤿Ǥ +すでに存在しません。Javadoc 1\&.2のベータ版にしか存在していませんでした。このオプションは、\fI\-doctitle\fRという名前に変更されました。名前を変更した理由は、このオプションが、ウィンドウのタイトルではなくドキュメントのタイトルを定義することを明確にするためです。 .RE .PP \-header \fIheader\fR .RS 4 -ƽϥեκǾ֤إåƥȤꤷޤإåϡʥӥ󡦥Сα֤ޤ\fIheader\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢\fIheader\fRǰϤɬפޤإåΰˤϥʸѤޤȤС\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRǤ +各出力ファイルの最上部に配置するヘッダー・テキストを指定します。ヘッダーは、ナビゲーション・バーの右上に配置されます。\fIheader\fRにはHTMLタグおよび空白文字を含めることができますが、その場合、\fIheader\fRを引用符で囲む必要があります。ヘッダー内部の引用符にはエスケープ文字を使用します。たとえば、\fIjavadoc \-header "<b>Java Platform </b><br>v1\&.4" com\&.mypackage\fRです。 .RE .PP \-footer \fIfooter\fR .RS 4 -ƽϥեκDz֤եåƥȤꤷޤ\fIfooter\fRͤϡʥӥ󡦥Сα֤ޤ\fIfooter\fRˤHTMLӶʸޤ뤳ȤǤޤξ硢\fIfooter\fRǰϤɬפޤեåΰˤϥʸѤޤ +各出力ファイルの最下部に配置するフッター・テキストを指定します。\fIfooter\fRの値は、ナビゲーション・バーの右下に配置されます。\fIfooter\fRにはHTMLタグおよび空白文字を含めることができますが、その場合、\fIfooter\fRを引用符で囲む必要があります。フッター内部の引用符にはエスケープ文字を使用します。 .RE .PP \-top .RS 4 -ƽϥեκǾ֤ƥȤꤷޤ +各出力ファイルの最上部に配置するテキストを指定します。 .RE .PP \-bottom \fItext\fR .RS 4 -ƽϥեκDz֤ƥȤꤷޤΥƥȤϡʥӥ󡦥С겼ΡڡκDz֤ޤƥȤˤHTMLӶʸޤ뤳ȤǤޤξ硢ƥȤǰϤɬפޤƥΰˤϥʸѤޤ +各出力ファイルの最下部に配置するテキストを指定します。このテキストは、下部ナビゲーション・バーより下の、ページの最下部に配置されます。テキストにはHTMLタグおよび空白文字を含めることができますが、その場合、テキストを引用符で囲む必要があります。テキスト内部の引用符にはエスケープ文字を使用します。 .RE .PP \-link \fIextdocURL\fR .RS 4 -¸Javadocˤ줿ȥ饹ΥɥȤؤΥ󥯤ޤ\fIextdocURL\fRϡȤƻꤹ롢Javadocˤ줿ɥȤޤǥ쥯ȥURLޤURLǤꤷ\fIjavadoc\fRޥɤμ¹Ԥǡʣ\fI\-link\fRץꤷʣΥɥȤؤΥ󥯤Ǥޤ +既存のJavadocにより生成された外部参照クラスのドキュメントへのリンクを作成します。\fIextdocURL\fR引数は、リンク先として指定する、Javadocにより生成された外部ドキュメントを含むディレクトリの絶対URLまたは相対URLです。指定した\fIjavadoc\fRコマンドの実行で、複数の\fI\-link\fRオプションを指定して複数のドキュメントへのリンクを作成できます。 .sp -Υǥ쥯ȥpackage\-listե뤬¸ߤɬפޤ(¸ߤʤϡ\fI\-linkoffline\fRץѤޤ)\fIjavadoc\fRޥɤϡpackage\-listե뤫ѥå̾ɤ߼ä塢URLǤΥѥå˥󥯤ޤ\fIjavadoc\fRޥɤμ¹Իˡ\fIextdocURL\fRͤ줿\fI<A HREF>\fR˥ԡޤäơ\fIextdocURL\fRϥեǤϤʤǥ쥯ȥؤURLǤɬפޤ\fIextdocURL\fRХ󥯤Ѥȡ桼ΥɥȤǤդWebȾΥɥȤ˥󥯤Ǥޤа֤إ󥯤ΤߤξХ󥯤ѤǤޤХ󥯤Ѥ硢Ϥͤϰǥ쥯ȥ꤫顢󥯤Ƥѥåޤǥ쥯ȥؤǤɬפޤ(\fI\-d\fRץǻ)Х󥯤ꤹ硢̾HTTP󥯤ѤޤWebСʤե롦ƥ˥󥯤ϡե롦󥯤ѤǤޤ줿ɥơ˥Ʊե롦ƥͭˤΤߥե롦󥯤Ѥޤɤξ⡢ɤΥڥ졼ƥ󥰡ƥǤ⡢URLФޤФΤǤ⡢ޤ\fIh\fR\fIttp:\fRޤ\fIf\fR\fIile:\fRΤǤ⡢URL: Uniform Resource Locators -(http://www\&.ietf\&.org/rfc/rfc1738\&.txt)˻ꤵƤȤꡢڤʸȤƥåѤޤ +このディレクトリ内にpackage\-listファイルが存在する必要があります(存在しない場合は、\fI\-linkoffline\fRオプションを使用します)。\fIjavadoc\fRコマンドは、package\-listファイルからパッケージ名を読み取った後、そのURLでこれらのパッケージにリンクします。\fIjavadoc\fRコマンドの実行時に、\fIextdocURL\fRの値が、作成された\fI<A HREF>\fRリンク内にコピーされます。したがって、\fIextdocURL\fRはファイルではなくディレクトリへのURLである必要があります。\fIextdocURL\fRに絶対リンクを使用すると、ユーザーのドキュメントを任意のWebサイト上のドキュメントにリンクできます。相対位置へリンクするのみの場合は相対リンクを使用できます。相対リンクを使用する場合、渡す値は宛先ディレクトリから、リンクされているパッケージを含むディレクトリへである必要があります(\fI\-d\fRオプションで指定)。絶対リンクを指定する場合、通常、HTTPリンクを使用します。ただし、Webサーバーを持たないファイル・システムにリンクする場合は、ファイル・リンクを使用できます。生成されたドキュメンテーションにアクセスする全員が同じファイル・システムを共有する場合にのみファイル・リンクを使用します。どの場合も、どのオペレーティング・システムでも、URLが絶対または相対のいずれでも、また\fIh\fR\fIttp:\fRまたは\fIf\fR\fIile:\fRのいずれでも、URLメモ: Uniform Resource Locators +(http://www\&.ietf\&.org/rfc/rfc1738\&.txt)に指定されているとおり、区切り文字としてスラッシュを使用します。 .sp .if n \{\ .RS 4 @@ -2727,8 +2727,8 @@ HTML .RE .\} .RE -\-linkoffline\-linkץΰ㤤.PP -ξˡ\fI\-link\fRץѤޤ +\-linkofflineおよび\-linkオプションの違い.PP +次の場合に、\fI\-link\fRオプションを使用します。 .sp .RS 4 .ie n \{\ @@ -2738,7 +2738,7 @@ HTML .sp -1 .IP \(bu 2.3 .\} -APIɥȤؤХѥѤ硣 +外部APIドキュメントへの相対パスを使用する場合。 .RE .sp .RS 4 @@ -2749,14 +2749,14 @@ HTML .sp -1 .IP \(bu 2.3 .\} -APIɥȤؤURLѤ(URL³ɼԤȤˤäƵĤƤ) +外部APIドキュメントへの絶対URLを使用する場合(そのURLに接続し、読取りを行うことがシェルによって許可されている場合)。 .RE .PP -APIɥȤؤURLѤ(URL³ɼԤȤˤäƵĤƤʤ)\fI\-linkoffline\fRץѤޤΤ褦ʾϡե¦եγ¦ˤɥȤ˥󥯤褦Ȥȯޤ +外部APIドキュメントへの絶対URLを使用する場合(そのURLに接続し、読取りを行うことがシェルによって許可されていない場合)は\fI\-linkoffline\fRオプションを使用します。このような状況は、ファイアウォールの内側からファイアウォールの外側にあるドキュメントにリンクしようとする場合に発生します。 .PP -\fBExample 1\fR, ɥȤؤХ +\fBExample 1\fR, 外部ドキュメントへの絶対リンク .RS 4 -http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html˼褦ʡ\fIjava\&.lang\fR\fIjava\&.io\fRӤ¾Javaץåȥեࡦѥå˥󥯤硢ΥޥɤѤޤ +http://docs\&.oracle\&.com/javase/8/docs/api/index\&.htmlに示すような、\fIjava\&.lang\fR、\fIjava\&.io\fRおよびその他のJavaプラットフォーム・パッケージにリンクする場合、次のコマンドを使用します .sp .if n \{\ .RS 4 @@ -2767,37 +2767,37 @@ javadoc \-link http://docs\&.oracle\&.com/javase/8/docs/api/ com\&.mypackage .if n \{\ .RE .\} -ΥޥɤϡJava SEץåȥեࡦѥåؤΥ󥯻\fIcom\&.mypackage\fRѥåΥɥȤޤɥȤˤϡȤХ饹\fItrees\fR\fIObject\fR饹ؤΥ󥯤ޤޤƤޤ\fI\-sourcepath\fR\fI\-d\fRʤɤ¾Υץɽޤ +このコマンドは、Java SEプラットフォーム・パッケージへのリンク持つ\fIcom\&.mypackage\fRパッケージのドキュメントを生成します。生成ドキュメントには、たとえばクラス\fItrees\fR内の\fIObject\fRクラスへのリンクが含まれています。\fI\-sourcepath\fRや\fI\-d\fRなどの他のオプションは表示されません。 .RE .PP -\fBExample 2\fR, ɥȤؤХ +\fBExample 2\fR, 外部ドキュメントへの相対リンク .RS 4 -Ǥϡ2ĤΥѥåꡢΥɥȤ\fIjavadoc\fRޥɤʣ¹Ԥ줿ΤǤˡΥɥȤХѥʬ䤵ƤޤѥåϡAPIǤ\fIcom\&.apipackage\fRȡSPI(ӥץХ󥿥ե)Ǥc\fIom\&.spipackage\fRǤɥȤγǼϡdocs/api/com/apipackagedocs/spi/com/spipackageǤAPIѥåΥɥȤϤǤƤơdocsߤΥǥ쥯ȥǤ硢APIɥȤؤΥ󥯤SPIѥåɥȲˤϡΥޥɤ¹Ԥޤ\fIjavadoc \-d \&./spi \-link \&.\&./api com\&.spipackage\fR +この例では、2つのパッケージがあり、そのドキュメントは\fIjavadoc\fRコマンドを複数回実行した結果生成されたものです。さらに、これらのドキュメントは相対パスで分割されています。パッケージは、APIである\fIcom\&.apipackage\fRと、SPI(サービス・プロバイダ・インタフェース)であるc\fIom\&.spipackage\fRです。ドキュメントの格納先は、docs/api/com/apipackageとdocs/spi/com/spipackageです。APIパッケージのドキュメントはすでに生成されていて、docsが現在のディレクトリである場合、APIドキュメントへのリンクを持つSPIパッケージをドキュメント化するには、次のコマンドを実行します。\fIjavadoc \-d \&./spi \-link \&.\&./api com\&.spipackage\fR .sp -\fI\-link\fRץϡǥ쥯ȥ(docs/spi)ХѥǤ +\fI\-link\fRオプションは、宛先ディレクトリ(docs/spi)からの相対パスです。 .RE -.PP -\fI\-link\fRץѤȡɤϻȤƤƤ⡢\fIjavadoc\fRμ¹ԤǤϥɥȲʤ饹˥󥯤Ǥ褦ˤʤޤ󥯤ͭʥڡ˰ưǤ褦ˤˤϡHTMLڡĴ١ξ\fIextdocURL\fR˻ꤹɬפޤˤꡢɥѡƥΥɥơjava\&.*ɥơ(http://docs\&.oracle\&.com)إ󥯤뤳ȤǤޤ\fIjavadoc\fRޥɤǡߤμ¹ԤƤɥơAPIؤΥ󥯤Τߤˤϡ\fI\-link\fRץάޤ\fI\-link\fRץꤷʤȡ\fIjavadoc\fRޥɤϳȤΤΥɥơؤΥ󥯤ޤ󡣥ɥơ¸ߤΤɤޤϤɤ¸ߤΤ狼ʤǤ\fI\-link\fRץǤϡɥơʣξ˥󥯤Ǥޤեν򻲾ȤƤ⤦1ĤӤϡѥååȤδ֤˥󥯤뤳ȤǤΥѥååȤФ\fIjavadoc\fRޥɤ¹Ԥ塢¾ΥѥååȤФ\fIjavadoc\fRޥɤټ¹Ԥȡξåȴ֤Υ󥯤Ǥޤ -饹λˡ.PP -ɽ볰ȥ饹ؤΥ󥯤ξ(ӤΥƥȡ٥ǤϤʤ)饹ϼˡǻȤɬפޤ᥽åɤΤǥ饹򻲾ȤΤߤǤϽʬǤϤޤ\fIimport\fRʸΤ줫ǻȤɬפޤˡ饹\fIjava\&.io\&.File\fR򻲾Ȥˡ򼨤ޤ +注意.PP +\fI\-link\fRオプションを使用すると、コードからは参照されていても、今回の\fIjavadoc\fRの実行ではドキュメント化されないクラスにリンクできるようになります。リンクから有効なページに移動できるようにするには、それらのHTMLページがある場所を調べ、その場所を\fIextdocURL\fRに指定する必要があります。これにより、サードパーティのドキュメンテーションがjava\&.*ドキュメンテーション(http://docs\&.oracle\&.com)へリンクすることができます。\fIjavadoc\fRコマンドで、現在の実行で生成しているドキュメンテーション内のAPIへのリンクのみを作成する場合には、\fI\-link\fRオプションを省略します。\fI\-link\fRオプションを指定しないと、\fIjavadoc\fRコマンドは外部参照のためのドキュメンテーションへのリンクを作成しません。ドキュメンテーションが存在するのかどうか、またはどこに存在するのかがわからないからです。\fI\-link\fRオプションでは、生成ドキュメンテーション内の複数の場所にリンクを作成できます。ソース・ファイルの処理を参照してください。もう1つの用途は、パッケージ・セットの間にクロスリンクを作成することです。一方のパッケージ・セットに対して\fIjavadoc\fRコマンドを実行した後、他方のパッケージ・セットに対して\fIjavadoc\fRコマンドを再度実行すると、両セット間に双方向のリンクを作成できます。 +クラスの参照方法.PP +表示される外部参照クラスへのリンクの場合(およびそのテキスト・ラベルだけではなく)、クラスは次の方法で参照される必要があります。メソッドの本体でクラスを参照するのみでは十分ではありません。\fIimport\fR文、宣言のいずれかで参照する必要があります。次に、クラス\fIjava\&.io\&.File\fRを参照する方法の例を示します。 .PP -٤ƤΥפimportʸξ硣磻ɥɤˤ륤ݡȡ̾ˤŪʥݡȡޤ\fIjava\&.lang\&.*\fRФ뼫ưݡȡ +すべてのタイプのimport文の場合。ワイルドカードによるインポート、名前による明示的なインポート、または\fIjava\&.lang\&.*\fRに対する自動インポート。 .PP -Java SE 1\&.3\&.\fIn\fR1\&.2\&.\fIn\fRǤϡ̾ˤŪʥݡȤΤߵǽޤ磻ɥɤˤ\fIimport\fRʸ⡢\fIimport java\&.lang\&.*\fRμưݡȤⵡǽޤ +Java SE 1\&.3\&.\fIn\fRおよび1\&.2\&.\fIn\fRでは、名前による明示的なインポートのみ機能します。ワイルドカードによる\fIimport\fR文も、\fIimport java\&.lang\&.*\fRの自動インポートも機能しません。 .PP -ξ: +宣言の場合: \fIvoid mymethod(File f) {}\fR .PP -Ȥϡ᥽åɡ󥹥ȥ饯եɡ饹ޤϥ󥿥ե귿ޤϥѥ᡼ס뤤ϼĥޤϥʸˤޤ +参照は、メソッド、コンストラクタ、フィールド、クラスまたはインタフェースの戻り型またはパラメータ・タイプ、あるいは実装、拡張またはスロー文にあります。 .PP -פʷ̤Ȥơ\fI\-link\fRץѤƤ⡢¤Τ˸äɽʤ󥯤¿ȯǽޤƥȤϥϥѡƥȡ󥯤դ줺ɽޤ󥯤ɽٹ𤫤顢Υ󥯤ǧǤޤ饹Ȥˤäƥ󥯤ɲä뤿κǤñˡϤΥ饹򥤥ݡȤ뤳ȤǤ -ѥåꥹ.PP -\fI\-link\fRץˤϡ\fIjavadoc\fRޥɤˤäpackage\-listȤ̾Υե뤬\fI\-link\fRץ˻ꤷURL¸ߤƤ뤳ȤɬפǤpackage\-listեϡξˤɥȲ줿ѥå̾ΥꥹȤäñʥƥȡեǤҤǤϡ\fIjavadoc\fRޥɤϡꤷURLpackage\-listȤ̾Υե򸡺ѥå̾ɤ߼äơURLǤΥѥå˥󥯤ޤ +重要な結果として、\fI\-link\fRオプションを使用しても、この制限のために誤って表示されないリンクが多数発生する可能性があります。テキストはハイパーテキスト・リンクが付けられずに表示されます。リンクが表示する警告から、これらのリンクを認識できます。クラスを正しく参照し、それによってリンクを追加するための最も簡単な方法はそのクラスをインポートすることです。 +パッケージ・リスト.PP +\fI\-link\fRオプションには、\fIjavadoc\fRコマンドによって生成されるpackage\-listという名前のファイルが、\fI\-link\fRオプションに指定したURLに存在していることが必要です。package\-listファイルは、その場所にあるドキュメント化されたパッケージの名前のリストが入った単純なテキスト・ファイルです。前述の例では、\fIjavadoc\fRコマンドは、指定したURLでpackage\-listという名前のファイルを検索し、パッケージ名を読み取って、そのURLでこれらのパッケージにリンクします。 .PP -ȤСJava SE APIΥѥåꥹȤ -http://docs\&.oracle\&.com/javase/8/docs/api/package\-listˤޤ +たとえば、Java SE APIのパッケージ・リストは +http://docs\&.oracle\&.com/javase/8/docs/api/package\-listにあります。 .PP -ΥѥåꥹȤϼΤ褦ƤǻϤޤäƤޤ +このパッケージ・リストは次のような内容で始まっています。 .sp .if n \{\ .RS 4 @@ -2816,20 +2816,20 @@ and so on \&.\&.\&.\&. .RE .\} .PP -\fI\-link\fRץꤻ\fIjavadoc\fR¹Ԥ硢ȥ饹°̾򸫤Ĥȡ̾󥯤ʤǽϤޤ\fI\-link\fRץꤷ硢\fIjavadoc\fRޥɤϡꤵ줿\fIextdocURL\fRξˤpackage\-listեǤΥѥå̾򸡺ޤѥå̾Ĥȡ\fIextdocURL\fR̾ղäޤ +\fI\-link\fRオプションを指定せずに\fIjavadoc\fRを実行した場合、外部参照クラスに属する名前を見つけると、その名前をリンクなしで出力します。一方、\fI\-link\fRオプションを指定した場合、\fIjavadoc\fRコマンドは、指定された\fIextdocURL\fRの場所にあるpackage\-listファイルでそのパッケージ名を検索します。パッケージ名が見つかると、\fIextdocURL\fRが名前の前に付加されます。 .PP -٤ƤΥ󥯤ǽ뤿ˤϡȤΤ٤ƤΥɥȤꤷURL¸ߤɬפޤ\fIjavadoc\fRޥɤϡꤵ줿package\-list¸ߤ뤫ɤΤߤåΥڡ¸ߤ뤫ɤϥåޤ -ʣΥ.PP -ʣ\fI\-link\fRץꤹȡǤդογɥȤؤΥ󥯤ǤޤJavadoc 1\&.2ˤϡʣ\fI\-link\fRץǤʤȤΤԶ礬ޤJavadoc 1\&.2\&.2ǽޤ󥯤볰ɥȤȤˡΤ褦̡Υ󥯡ץꤷޤ\fIjavadoc \-link extdocURL1 \-link extdocURL2 \&.\&.\&. \-link extdocURLn com\&.mypackage\fR -\fIextdocURL1\fR\fIextdocURL2\fR\&.\fI\&.\&. extdocURLn\fRϡ줾쳰ɥȤΥ롼Ȥؤƥ롼Ȥˤϡpackage\-listȤ̾Υե뤬äƤޤ -.PP -˺줿ʣΥɥȤ򥯥󥯤硢֡ȥȥåפɬפˤʤ뤳ȤޤɤΥɥȤˤĤƤpackage\-list¸ߤƤʤϡǽΥɥȤФ\fIjavadoc\fRޥɤ¹Ԥǡ2ܤΥɥȤpackage\-listϤޤ¸ߤƤޤ󡣤äơ󥯤ˤϡ2ܤΥɥȤǡǽΥɥȤʤɬפޤ +すべてのリンクが正しく機能するためには、外部参照のすべてのドキュメントが、指定したURLに存在する必要があります。\fIjavadoc\fRコマンドは、指定されたpackage\-listが存在するかどうかのみをチェックし、これらのページが存在するかどうかはチェックしません。 +複数のリンク.PP +複数の\fI\-link\fRオプションを指定すると、任意の数の外部生成ドキュメントへのリンクを作成できます。Javadoc 1\&.2には、複数の\fI\-link\fRオプションを指定できないという既知の不具合があります。これはJavadoc 1\&.2\&.2で修正されました。リンクする外部ドキュメントごとに、次のように別々のリンク・オプションを指定します。\fIjavadoc \-link extdocURL1 \-link extdocURL2 \&.\&.\&. \-link extdocURLn com\&.mypackage\fR +\fIextdocURL1\fR、\fIextdocURL2\fR、\&.\fI\&.\&. extdocURLn\fRは、それぞれ外部ドキュメントのルートを指し、各ルートには、package\-listという名前のファイルが入っています。 +クロスリンク.PP +以前に作成された複数のドキュメントをクロスリンクする場合、ブートストラップが必要になることがあります。どのドキュメントについてもpackage\-listが存在していない場合は、最初のドキュメントに対して\fIjavadoc\fRコマンドを実行する時点で、2番目のドキュメントのpackage\-listはまだ存在していません。したがって、外部リンクを作成するには、2番目のドキュメントを生成した後で、最初のドキュメントを生成しなおす必要があります。 .PP -ξ硢ǽΥɥŪϡpackage\-list뤳ȤǤ(ѥå̾İƤϼưǺƤ⤫ޤޤ)ˡ2ܤΥɥȤȤγ󥯤ޤɬפʳpackage\-listե뤬¸ߤʤϡ\fIjavadoc\fRޥɤٹ𤬽Ϥޤ +この場合、最初のドキュメント生成の目的は、package\-listを作成することです(パッケージ名を把握している場合は手動で作成してもかまいません)。次に、2番目のドキュメントとその外部リンクを生成します。必要な外部のpackage\-listファイルが存在しない場合は、\fIjavadoc\fRコマンドから警告が出力されます。 .PP \-linkoffline \fIextdocURL packagelistLoc\fR .RS 4 -Υץ\fI\-link\fRץΥХꥨǤξȤ⡢Javadocˤ줿ȥ饹ΥɥȤؤΥ󥯤ޤ\fIjavadoc\fRޥɤWeb³ѤƥɥȤ˥ǤʤȤWebΥɥȤ˥󥯤ˤϡ\fI\-link\fRo\fIffline\fRץѤޤɥȤpackage\-listե˥ǤʤȤޤϤΥե뤬\fIextdocURL\fRǻꤵ줿ˤ¸ߤ\fIpackageListLoc\fRǻǤ̤ξ(̾)¸ߤȤ\fI\-linkoffline\fRץѤޤ\fIextdocURL\fRWorld Wide WebǤǤʤϡ\fI\-linkoffline\fRץꤹ뤳ȤˤꡢɥȤ\fIjavadoc\fRޥɤWeb³ɬפȤ󤬤ʤʤޤ⤦1ĤӤϡɥȤ򹹿뤿βȤƻѤ뤳ȤǤѥåΥåΤФ\fIjavadoc\fRޥɤ¹Ԥ塢ѹΥѥåФƤΤ\fIjavadoc\fRޥɤټ¹Ԥơ줿ե򡢥ꥸʥΥåȤǤ褦ˤޤ򼨤ޤ\fI\-linkoffline\fRץϰ2ļޤ1\fI<a href>\fR󥯤Ȥ߹ޤʸꤷ2package\-listθ\fI\-linkoffline\fRޤ +このオプションは\fI\-link\fRオプションのバリエーションです。両方とも、Javadocにより生成された外部参照クラスのドキュメントへのリンクを作成します。\fIjavadoc\fRコマンドがWeb接続を使用してドキュメントにアクセスできないとき、Web上のドキュメントにリンクするには、\fI\-link\fRo\fIffline\fRオプションを使用します。外部ドキュメントのpackage\-listファイルにアクセスできないとき、またはこのファイルが\fIextdocURL\fRで指定された場所には存在せず、\fIpackageListLoc\fRで指定できる別の場所(通常ローカル)に存在するとき、\fI\-linkoffline\fRオプションを使用します。\fIextdocURL\fRにWorld Wide Web上でしかアクセスできない場合は、\fI\-linkoffline\fRオプションを指定することにより、ドキュメントの生成時に\fIjavadoc\fRコマンドがWebに接続する必要があるという制約がなくなります。もう1つの用途は、ドキュメントを更新するための回避策として使用することです。パッケージのセット全体に対して\fIjavadoc\fRコマンドを実行した後、変更した一部のパッケージに対してのみ\fIjavadoc\fRコマンドを再度実行して、更新されたファイルを、オリジナルのセットに挿入できるようにします。次に例を示します。\fI\-linkoffline\fRオプションは引数を2つ取ります。第1引数は\fI<a href>\fRリンクに組み込まれる文字列を指定し、第2引数はpackage\-listの検索場所を\fI\-linkoffline\fRに伝えます。 .sp .RS 4 .ie n \{\ @@ -2839,7 +2839,7 @@ and so on \&.\&.\&.\&. .sp -1 .IP \(bu 2.3 .\} -\fIextdocURL\fRͤϡȤƻꤹ롢Javadocˤ줿ɥȤޤǥ쥯ȥURLޤURLǤURLξ硢ͤϡǥ쥯ȥ(\fI\-d\fRץǻ)ȤʤѥåΥ롼ȤؤХѥˤɬפޤܺ٤ϡ\fI\-link\fRץ\fIextdocURL\fR򻲾ȤƤ +\fIextdocURL\fRの値は、リンク先として指定する、Javadocにより生成された外部ドキュメントを含むディレクトリの絶対URLまたは相対URLです。相対URLの場合、値は、生成先ディレクトリ(\fI\-d\fRオプションで指定)からリンク先となるパッケージのルートへの相対パスにする必要があります。詳細は、\fI\-link\fRオプションの\fIextdocURL\fRを参照してください。 .RE .sp .RS 4 @@ -2850,16 +2850,16 @@ and so on \&.\&.\&.\&. .sp -1 .IP \(bu 2.3 .\} -\fIpackagelistLoc\fRͤϡɥȤpackage\-listեޤǥ쥯ȥؤΥѥޤURLǤϡURL (http:ޤfile:)Ǥե롦ѥǤ⤫ޤޤ󡣤ޤХѥХѥΤɤǤ⤫ޤޤХѥξϡ\fIjavadoc\fRޥɤ¹Ԥ븽ߤΥǥ쥯ȥ꤫ХѥȤƻꤷޤpackage\-listե̾ޤʤǤ +\fIpackagelistLoc\fRの値は、外部ドキュメントのpackage\-listファイルを含むディレクトリへのパスまたはURLです。これは、URL (http:またはfile:)でもファイル・パスでもかまいません。また、絶対パスと相対パスのどちらでもかまいません。相対パスの場合は、\fIjavadoc\fRコマンドが実行される現在のディレクトリからの相対パスとして指定します。package\-listファイル名を含めないでください。 .sp -ꤷ\fIjavadoc\fRޥɤμ¹Ԥǡʣ\fI\-link\fRץǤޤJavadoc 1\&.2\&.2Ǥϡ\fI\-linkfile\fRץ1󤷤ǤޤǤ +指定した\fIjavadoc\fRコマンドの実行で、複数の\fI\-link\fRオプションを指定できます。Javadoc 1\&.2\&.2より前では、\fI\-linkfile\fRオプションは1回しか指定できませんでした。 .RE .RE -ɥȤؤХ.PP -http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html˼褦ʡ\fIjava\&.lang\fR -\fIjava\&.io\fRӤ¾Java SEѥå˥󥯤ɬפ礬ޤ +外部ドキュメントへの絶対リンク.PP +http://docs\&.oracle\&.com/javase/8/docs/api/index\&.htmlに示すような、\fIjava\&.lang\fR、 +\fIjava\&.io\fRおよびその他のJava SEパッケージにリンクする必要がある場合があります。 .PP -ˤWebޤ󡣤ξ硢Ԥޤ +ただし、シェルにはWebアクセス権がありません。この場合、次を行います。 .sp .RS 4 .ie n \{\ @@ -2869,7 +2869,7 @@ http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html .sp -1 .IP " 1." 4.2 .\} -֥饦package\-listե򳫤ޤ(http://docs\&.oracle\&.com/javase/8/docs/api/package\-list) +ブラウザでpackage\-listファイルを開きます(http://docs\&.oracle\&.com/javase/8/docs/api/package\-list) .RE .sp .RS 4 @@ -2880,10 +2880,10 @@ http://docs\&.oracle\&.com/javase/8/docs/api/index\&.html .sp -1 .IP " 2." 4.2 .\} -ե롦ǥ쥯ȥ¸Υ롦ԡ2\fIpackagelistLoc\fRǻꤷޤǤϡѥåꥹȡեϥȡǥ쥯ȥ(\&.)¸Ƥޤ +ファイルをローカル・ディレクトリに保存し、このローカル・コピーを第2引数\fIpackagelistLoc\fRで指定します。この例では、パッケージ・リスト・ファイルはカレント・ディレクトリ(\&.)に保存されています。 .RE .PP -ΥޥɤϡJava SEץåȥեࡦѥåؤΥ󥯤c\fIom\&.mypackage\fRѥåΥɥȤޤɥȤˤϡȤХ饹\fItrees\fR\fIObject\fR饹ؤΥ󥯤ޤޤƤޤ\fI\-sourcepath\fRʤɡ¾ɬפʥץɽޤ +次のコマンドは、Java SEプラットフォーム・パッケージへのリンクを持つc\fIom\&.mypackage\fRパッケージのドキュメントを生成します。生成ドキュメントには、たとえばクラス\fItrees\fR内の\fIObject\fRクラスへのリンクが含まれています。\fI\-sourcepath\fRなど、他の必要なオプションは表示されません。 .sp .if n \{\ .RS 4 @@ -2894,12 +2894,12 @@ javadoc \-linkoffline http://docs\&.oracle\&.com/javase/8/docs/api/ \&. com\&.m .if n \{\ .RE .\} -ɥȤؤХ.PP -\fI\-linkoffline\fRХѥȤȤ˻Ѥ뤳ȤϤޤꤢޤͳñǡ̾\fI\-link\fRǴ֤˹礦Ǥ\fI\-linkoffline\fRץѤ硢̾package\-listեϥǡХ󥯤ѤϥΥեʤΤǡ̾\fI\-linkoffline\fRץ2ĤΰˡۤʤѥꤹɬפϤޤ2ĤΰƱξ硢\fI\-link\fRץѤǤޤ -package\-listեμưǤκ.PP -package\-listե뤬ޤ¸ߤʤƤ⡢ɥȤΥΥѥå̾狼äƤϡΥեΥԡưǺ\fIpackagelistLoc\fRǤΥѥꤹ뤳ȤǤޤ\fIcom\&.apipackage\fRǽ줿\fIcom\&.spipackage\fRΥѥåꥹȤ¸ߤʤȤФΥȤƵ󤲤ޤˡϡѥå̾Ϥ狼äƤΤΡޤƤʤɥȤ˥󥯤ɥȤɬפǤޤpackage\-listե뤬ʤJavadoc 1\&.0ޤ1\&.1줿ѥåѤpackage\-listեˤ⡢ˡѤǤޤƱͤˡ2ĤδȤ̤package\-listեͭǤ뤿ᡢ󥯤ꤷɥȤƱ˥꡼뤳Ȥǽˤʤޤ -ʣɥȤؤΥ.PP -ɥȤȤ1\fI\-linkoffline\fRץޤ뤳ȤǤޤ +外部ドキュメントへの相対リンク.PP +\fI\-linkoffline\fRを相対パスとともに使用することはあまりありません。理由は単純で、通常は\fI\-link\fRで間に合うからです。\fI\-linkoffline\fRオプションを使用する場合、通常、package\-listファイルはローカルで、相対リンクを使用する場合はリンク先のファイルもローカルなので、通常は\fI\-linkoffline\fRオプションの2つの引数に、異なるパスを指定する必要はありません。2つの引数が同一の場合、\fI\-link\fRオプションを使用できます。 +package\-listファイルの手動での作成.PP +package\-listファイルがまだ存在しなくても、ドキュメントのリンク先のパッケージ名がわかっている場合は、このファイルのコピーを手動で作成し、\fIpackagelistLoc\fRでそのパスを指定することができます。\fIcom\&.apipackage\fRが最初に生成された時点で\fIcom\&.spipackage\fRのパッケージ・リストが存在しないという前出のケースが一例として挙げられます。この方法は、パッケージ名はわかっているものの、まだ公開されていない、新しい外部ドキュメントにリンクするドキュメントを生成する必要がある場合に便利です。また、package\-listファイルが生成されないJavadoc 1\&.0または1\&.1で生成されたパッケージ用にpackage\-listファイルを作成する場合にも、この方法が使用できます。同様に、2つの企業が未公開のpackage\-listファイルを共有できるため、クロスリンクを設定したドキュメントを同時にリリースすることも可能になります。 +複数ドキュメントへのリンク.PP +参照先の生成ドキュメントごとに1回、\fI\-linkoffline\fRオプションを含めることができます。 .sp .if n \{\ .RS 4 @@ -2911,10 +2911,10 @@ packagelistLoc2 \&.\&.\&. .if n \{\ .RE .\} -ɥȤι.PP -ץȤ˲ޤϲɴΥѥåޤޤˤ⡢\fI\-linkoffline\fRץѤǤޤĥ꡼ΤǤǤ\fIjavadoc\fRޥɤ¹ԤȤ硢ɥơ󡦥Ȥˤ鷺ѹ®˲äĥ꡼ΰ\fIjavadoc\fRޥɤƼ¹Ԥ뤳ȤǤޤ2ܤμ¹Ԥϡɥơ󡦥ȤѹѹʤˤΤ뤳ȤդƤɤФɲáޤѹϡѥåĥ꡼ѾСΥꥹȡѥڡʤɤξǡ󥯤뤳Ȥޤ +ドキュメントの更新.PP +プロジェクトに何十または何百のパッケージが含まれる場合にも、\fI\-linkoffline\fRオプションを使用できます。ソース・ツリー全体ですでに\fIjavadoc\fRコマンドを実行したことがある場合、ドキュメンテーション・コメントにわずかな変更を迅速に加え、ソース・ツリーの一部で\fIjavadoc\fRコマンドを再実行することができます。2回目の実行は、ドキュメンテーション・コメントを変更し、宣言は変更しない場合にのみ正しく処理されることに注意してください。ソース・コードに対して宣言を追加、削除、または変更した場合は、索引、パッケージ・ツリー、継承されるメンバーのリスト、使用ページなどの場所で、リンクが壊れることがあります。 .PP -ޤοϤʼ¹ԤǻѤ롢ǥ쥯ȥ(updateʤ)ޤǤϡǥ쥯ȥ̾htmlǤǤñǤϡhtmlǥ쥯ȥοƥǥ쥯ȥ˰ưޤ\fI\-linkoffline\fRץ1˥ȡǥ쥯ȥ(\&.)ꤷ2package\-listhtmlؤХѥꤷѥåΥѥå̾ΤߤϤޤ +まず、この新しい小規模な実行で使用する、新しい生成先ディレクトリ(updateなど)を作成します。この例では、元の生成先ディレクトリの名前はhtmlです。最も単純な例では、htmlディレクトリの親ディレクトリに移動します。\fI\-linkoffline\fRオプションの第1引数にカレント・ディレクトリ(\&.)を設定し、第2引数にpackage\-listが検索されるhtmlへの相対パスを設定し、更新するパッケージのパッケージ名のみを渡します。 .sp .if n \{\ .RS 4 @@ -2926,15 +2926,15 @@ javadoc \-d update \-linkoffline \&. html com\&.mypackage .RE .\} .PP -\fIjavadoc\fRޥɤνλ塢update/com/package줿饹Υڡ򥳥ԡ(פϽ)html/com/packageθΥե˾񤭤ޤ +\fIjavadoc\fRコマンドの終了後、update/com/package内の生成されたクラスのページをコピーし(概要や索引は除く)、html/com/package内の元のファイルに上書きします。 .PP \-linksource .RS 4 -ƥե(ֹդ)HTMLСɸHTMLɥȤ饽եؤΥ󥯤ɲäޤ󥯤ϡեƤ륯饹󥿥ե󥹥ȥ饯᥽åɡեɤФƺޤǤʤ硢ȤХǥեȡ󥹥ȥ饯줿饹ФƤϡ󥯤Ϻޤ +各ソース・ファイル(行番号付き)のHTMLバージョンを作成し、標準HTMLドキュメントからソース・ファイルへのリンクを追加します。リンクは、ソース・ファイル内に宣言されているクラス、インタフェース、コンストラクタ、メソッド、フィールドに対して作成されます。そうでない場合、たとえばデフォルト・コンストラクタや生成されたクラスに対しては、リンクは作成されません。 .sp -Υץϡ\fI\-public\fR\fI\-package\fR\fI\-protected\fR\fI\-private\fRγƥץȤϴطʤΥ饹եɡΥ᥽åɤΤϤȤȤ߹ޤ줿եΤ٤Ƥξܺ٤ޤ\fI\-private\fRץ⤢碌ƻꤷʤꡢΥ饹䥤󥿥եΰˤϡ󥯤𤷤ƥǤʤȤޤ +このオプションは、\fI\-public\fR、\fI\-package\fR、\fI\-protected\fRおよび\fI\-private\fRの各オプションとは関係なく、非公開のクラス、フィールド、非公開のメソッドの本体をはじめとする組み込まれたソース・ファイル内のすべての非公開実装の詳細を公開します。\fI\-private\fRオプションもあわせて指定しないかぎり、非公開のクラスやインタフェースの一部には、リンクを介してアクセスできないことがあります。 .sp -ƥ󥯤ϡμ̻̾ξ˺ޤȤС\fIButton\fR饹ΥɤؤΥ󥯤ϡ\fIButton\fRȤξ˺ޤ +各リンクは、その宣言内の識別子名の上に作成されます。たとえば、\fIButton\fRクラスのソース・コードへのリンクは、\fIButton\fRという語の上に作成されます。 .sp .if n \{\ .RS 4 @@ -2945,7 +2945,7 @@ public class Button extends Component implements Accessible .if n \{\ .RE .\} -\fIButton\fR饹\fIgetLabel\fR᥽åɤΥɤؤΥ󥯤ϡ\fIgetLabel\fRȤξ˺ޤ +\fIButton\fRクラスの\fIgetLabel\fRメソッドのソース・コードへのリンクは、\fIgetLabel\fRという語の上に作成されます。 .sp .if n \{\ .RS 4 @@ -2960,7 +2960,7 @@ public String getLabel() .PP \-group groupheading \fIpackagepattern:packagepattern\fR .RS 4 -ץڡʣΥѥå򡢻ꤷ롼פʬơ롼פȤɽޤƥ롼פϡ줾̤\fI\-group\fRץǻꤷޤ롼פϡޥɹԤǻꤵ줿ǥڡɽޤѥåϡ롼ǥե٥åȽˤʤäƤޤꤷ\fI\-group\fRץǤϡ\fIpackagepattern\fRΥꥹȤ˰פѥåФȤ\fIgroupheading\fR1Ĥɽɽޤ +概要ページの複数のパッケージを、指定したグループに分けて、グループごとに表を作成します。各グループは、それぞれ別の\fI\-group\fRオプションで指定します。グループは、コマンド行で指定された順序でページに表示されます。パッケージは、グループ内でアルファベット順になっています。指定した\fI\-group\fRオプションでは、\fIpackagepattern\fR式のリストに一致するパッケージが、見出しとして\fIgroupheading\fRを持つ1つの表に表示されます。 .sp .RS 4 .ie n \{\ @@ -2970,7 +2970,7 @@ public String getLabel() .sp -1 .IP \(bu 2.3 .\} -\fIgroupheading\fRˤϡǤդΥƥȤǤޤ뤳ȤǤޤꤷƥȤϡ롼פɽФˤʤޤ +\fIgroupheading\fRには、任意のテキストを指定でき、空白を含めることができます。指定したテキストは、グループの表見出しになります。 .RE .sp .RS 4 @@ -2981,12 +2981,12 @@ public String getLabel() .sp -1 .IP \(bu 2.3 .\} -\fIpackagepattern\fRͤˤϡǤդΥѥå̾ƬʬȤ³1ĤΥꥹ(*)ǤդΥѥå̾ǤޤꥹϻѤǤͣΥ磻ɥɤǡǤդʸ˰פ롢Ȥ̣Ǥ1ĤΥ롼פˤϡ(:)ǶڤäʣΥѥޤ뤳ȤǤޤѥޤϥѥ󡦥ꥹȤǥꥹѤ硢ѥ󡦥ꥹȤ\fI"java\&.lang*:java\&.util"\fRΤ褦˰ǰϤɬפޤ +\fIpackagepattern\fRの値には、任意のパッケージ名の先頭部分とそれに続く1つのアスタリスク(*)で任意のパッケージ名を指定できます。アスタリスクは使用できる唯一のワイルドカードで、任意の文字に一致する、という意味です。1つのグループには、コロン(:)で区切って複数のパターンを含めることができます。パターンまたはパターン・リストでアスタリスクを使用する場合、パターン・リストは\fI"java\&.lang*:java\&.util"\fRのように引用符で囲む必要があります。 .RE .sp -\fI\-group\fRץꤷʤϡФ\fIPackages\fRŬڤʾФ1ĤΥ롼פ֤ޤФˤ٤ƤΥɥȲѥå(٤ƤΥ롼)ޤޤ櫓ǤϤʤ硢ĤΥѥåϡ֤¾ΥѥåפȤָФΩ롼פޤ +\fI\-group\fRオプションを指定しない場合は、見出し\fIPackages\fRおよび適切な小見出しを持つ1つのグループに配置されます。小見出しにすべてのドキュメント化されるパッケージ(すべてのグループ)が含まれるわけではない場合、残りのパッケージは「その他のパッケージ」というサブ見出しを持つ独立したグループに入れられます。 .sp -ȤС\fIjavadoc\fRޥɤǤϡ3ĤΥɥȲ줿ѥå\fI֥\fR\fIֳĥ\fR\fI֤¾Υѥå\fRʬޤ\fIjava\&.lang*\fRǤϡǸΥɥå(\&.)ꤷƤޤ\fIjava\&.lang\&.*\fRΤ褦˥ɥåȤȡ\fI java\&.lang\fRѥåϽ뤳Ȥˤʤޤ +たとえば、次の\fIjavadoc\fRコマンドでは、3つのドキュメント化されたパッケージが\fI「コア」\fR、\fI「拡張」\fRおよび\fI「その他のパッケージ」\fRに分けられます。\fIjava\&.lang*\fRでは、最後のドット(\&.)を指定していません。\fIjava\&.lang\&.*\fRのようにドットを入れると、\fI java\&.lang\fRパッケージは除外されることになります。 .sp .if n \{\ .RS 4 @@ -2999,7 +2999,7 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .if n \{\ .RE .\} -\fBѥå\fR +\fBコア・パッケージ\fR .sp \fIjava\&.lang\fR .sp @@ -3007,7 +3007,7 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .sp \fIjava\&.util\fR .sp -\fBĥǽѥå\fR +\fB拡張機能パッケージ\fR .sp \fIjavax\&.servlet\fR .sp @@ -3018,42 +3018,42 @@ javadoc \-group "Core Packages" "java\&.lang*:java\&.util" .PP \-nodeprecated .RS 4 -侩APIɥȤʤ褦ˤޤΥץꤹȡ\fI\-nodeprecatedlist\fRץꤷƱ̤ꡢɥȤ¾ʬΤǤ⡢侩APIޤ󡣤Υץϡɤ򵭽ҤƤȤ侩ΥɤˤäƵ򻶤餵줿ʤǤ +非推奨のAPIをドキュメントに生成しないようにします。このオプションを指定すると、\fI\-nodeprecatedlist\fRオプションを指定した場合と同じ効果があり、ドキュメントの他の部分全体でも、非推奨のAPIが生成されません。このオプションは、コードを記述しているとき、非推奨のコードによって気を散らされたくない場合に便利です。 .RE .PP \-nodeprecatedlist .RS 4 -侩APIΥꥹȤޤե(deprecated\-list\&.html)ӥʥӥ󡦥СΤΥڡؤΥ󥯤ʤ褦ˤޤ\fIjavadoc\fRޥɤǤϡ³ɥȤ¾ʬǤϡ侩APIޤΥץϡ侩APIɤ˴ޤޤƤ餺ʥӥ󡦥С򤹤äȸǤ +非推奨のAPIのリストを含むファイル(deprecated\-list\&.html)、およびナビゲーション・バーのそのページへのリンクが生成されないようにします。\fIjavadoc\fRコマンドでは、引き続き、ドキュメントの他の部分では、非推奨のAPIが生成されます。このオプションは、非推奨のAPIがソース・コードに含まれておらず、ナビゲーション・バーをすっきりと見せる場合に便利です。 .RE .PP \-nosince .RS 4 -ɥȤ顢\fI@since\fR˴Ϣդ줿\fIƳ줿С\fRάޤ +生成ドキュメントから、\fI@since\fRタグに関連付けられた\fI「導入されたバージョン」\fRセクションを省略します。 .RE .PP \-notree .RS 4 -ɥȤ顢饹ӥ󥿥եγإڡάޤΥڡˤϡʥӥ󡦥СΡֳإĥ꡼ץܥ󤫤饢ǤޤǥեȤǤϡؤޤ +生成ドキュメントから、クラスおよびインタフェースの階層ページを省略します。これらのページには、ナビゲーション・バーの「階層ツリー」ボタンからアクセスできます。デフォルトでは、階層が生成されます。 .RE .PP \-noindex .RS 4 -ɥȤ顢άޤǥեȤǤϡޤ +生成ドキュメントから、索引を省略します。デフォルトでは、索引が生成されます。 .RE .PP \-nohelp .RS 4 -ϤγƥڡκǾȺDzˤʥӥ󡦥С֥إסץ󥯤άޤ +出力の各ページの最上部と最下部にあるナビゲーション・バーから「ヘルプ」リンクを省略します。 .RE .PP \-nonavbar .RS 4 -̾ڡκǾȺDzɽʥӥ󡦥Сإåӥեåʤ褦ˤޤ\fI\-nonavbar\fRץ\fI\-bottom\fRץ˱ƶͿޤ\fI\-nonavbar\fRץϡ뤿ˤΤߥեPostScriptPDFѴʤɡƤΤߤפǡʥӥɬפʤǤ +通常、生成されるページの最上部と最下部に表示されるナビゲーション・バー、ヘッダー、およびフッターを生成しないようにします。\fI\-nonavbar\fRオプションは\fI\-bottom\fRオプションに影響を与えません。\fI\-nonavbar\fRオプションは、印刷するためにのみファイルをPostScriptやPDFに変換する場合など、内容のみが重要で、ナビゲーションの必要がない場合に便利です。 .RE .PP \-helpfile \fIpath\efilename\fR .RS 4 -ǾӺDzΥʥӥ󡦥СΡ֥إסץ󥯤ΥȤʤإإסեpath\efilenameΥѥꤷޤΥץ󤬻ꤵƤʤȡ\fIjavadoc\fRޥɤϡ\fIjavadoc\fRޥǥϡɥɤƤإסեhelp\-doc\&.htmlưޤΥץѤȡǥեȤ򥪡С饤ɤǤޤե̾ˤϤɤ̾ǤǤhelp\-doc\&.html˸ꤵޤ\fIjavadoc\fRޥɤϡΤ褦ˡʥӥ󡦥СΥ󥯤ɬפ˱Ĵޤ +最上部および最下部のナビゲーション・バーの「ヘルプ」リンクのリンク先となる代替ヘルプ・ファイルpath\efilenameのパスを指定します。このオプションが指定されていないと、\fIjavadoc\fRコマンドは、\fIjavadoc\fRコマンド内でハードコードされているヘルプ・ファイルhelp\-doc\&.htmlを自動作成します。このオプションを使用すると、デフォルトをオーバーライドできます。ファイル名にはどんな名前でも指定でき、help\-doc\&.htmlに限定されません。\fIjavadoc\fRコマンドは、次の例のように、ナビゲーション・バー内のリンクを必要に応じて調整します。 .sp .if n \{\ .RS 4 @@ -3068,7 +3068,7 @@ javadoc \-helpfile /home/user/myhelp\&.html java\&.awt\&. .PP \-stylesheet \fIpath/filename \fR .RS 4 -HTML륷ȡեΥѥꤷޤΥץ󤬻ꤵƤʤȡ\fIjavadoc\fRޥɤϡ\fIjavadoc\fRޥǥϡɥɤƤ륹륷ȡեstylesheet\&.cssưޤΥץѤȡǥեȤ򥪡С饤ɤǤޤե̾ˤϤɤ̾ǤǤstylesheet\&.css˸ꤵޤ +代替HTMLスタイルシート・ファイルのパスを指定します。このオプションが指定されていないと、\fIjavadoc\fRコマンドは、\fIjavadoc\fRコマンド内でハードコードされているスタイルシート・ファイルstylesheet\&.cssを自動作成します。このオプションを使用すると、デフォルトをオーバーライドできます。ファイル名にはどんな名前でも指定でき、stylesheet\&.cssに限定されません。 .sp .if n \{\ .RS 4 @@ -3083,15 +3083,15 @@ javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage .PP \-serialwarn .RS 4 -\fI@serial\fRʤϡѥ˷ٹޤǥեȤǤϡJavadoc 1\&.2\&.2ʹߤǤϡľ󲽤ηٹޤ󡣰Υ꡼ȤϵդưǤΥץѤȡľ󲽤ηٹɽΤǡǥեȤľ󲽲ǽեɤ\fIwriteExternal\fR᥽åɤŬڤ˥ɥȲΤΩޤ +\fI@serial\fRタグがない場合は、コンパイル時に警告を生成します。デフォルトでは、Javadoc 1\&.2\&.2以降では、直列化の警告は生成されません。以前のリリースとは逆の動作です。このオプションを使用すると、直列化の警告が表示されるので、デフォルトの直列化可能フィールドと\fIwriteExternal\fRメソッドを適切にドキュメント化するのに役立ちます。 .RE .PP \-charset \fIname\fR .RS 4 -ΥɥѤHTMLʸåȤꤷޤ̾ϡIANA RegistryCharacter Sets -(http://www\&.iana\&.org/assignments/character\-sets)˼줿ͥMIME̾Ǥɬפޤ +このドキュメント用のHTML文字セットを指定します。この名前は、IANA RegistryのCharacter Sets +(http://www\&.iana\&.org/assignments/character\-sets)に示された、優先MIME名である必要があります。 .sp -ȤС\fIjavadoc \-charset "iso\-8859\-1" mypackage\fRϼιԤ줿ƥڡΥإåޤ +たとえば、\fIjavadoc \-charset "iso\-8859\-1" mypackage\fRは次の行を生成された各ページのヘッダーに挿入します。 .sp .if n \{\ .RS 4 @@ -3102,24 +3102,24 @@ javadoc \-stylesheet file /home/user/mystylesheet\&.css com\&.mypackage .if n \{\ .RE .\} -\fIMETA\fRϡHTMLɸ(41972654137321)HTML Document Representation -(http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2)˵ܤƤޤ +この\fIMETA\fRタグは、HTML標準(4197265および4137321)のHTML Document Representation +(http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2)に記載されています。 .sp -ӥץ⻲ȤƤ +およびオプションも参照してください。 .RE .PP \-docencoding \fIname\fR .RS 4 -HTMLեΥ󥳡ǥ󥰤ꤷޤ̾ϡIANA RegistryCharacter Sets -(http://www\&.iana\&.org/assignments/character\-sets)˼줿ͥMIME̾Ǥɬפޤ +生成されるHTMLファイルのエンコーディングを指定します。この名前は、IANA RegistryのCharacter Sets +(http://www\&.iana\&.org/assignments/character\-sets)に示された、優先MIME名である必要があります。 .sp -\fI\-docencoding\fRץά\fI\-encoding\fRץѤȡ줿HTMLեΰŹ沽\fI\-encoding\fRץꤵޤ: -\fIjavadoc \-docencoding"iso\-8859\-1" mypackage\fRӥץ⻲ȤƤ +\fI\-docencoding\fRオプションを省略し、\fI\-encoding\fRオプションを使用すると、生成されたHTMLファイルの暗号化は\fI\-encoding\fRオプションで特定されます。例: +\fIjavadoc \-docencoding"iso\-8859\-1" mypackage\fRおよびオプションも参照してください。 .RE .PP \-keywords .RS 4 -HTML<META>򡢥饹ȤեɲäޤΥϡ<META>򸡺륵󥸥󤬥ڡ򸫤ĤΩޤ󥿡ͥåΤ򸡺븡󥸥ΤۤȤɤ<META>򻲾Ȥޤ󡣥ڡѤƤǽ뤫ǤȤWebȤؤθ¤롢Ȥˤ󶡤븡󥸥ϡ<META>򻲾Ȥ뤳ȤDzä뤳ȤǤޤ<META>ˤϡ饹δ̾ȡեɤӥ᥽åɤνƤʤ̾ޤޤޤ󥹥ȥ饯ϡ饹̾ƱǤ뤿ޤޤޤ󡣤ȤС饹\fIString\fRϼΥɤdzϤޤ +HTMLキーワード<META>タグを、クラスごとに生成されるファイルに追加します。これらのタグは、<META>タグを検索するサーチ・エンジンがページを見つける場合に役立ちます。インターネット全体を検索する検索エンジンのほとんどは<META>タグを参照しません。ページが誤用している可能性があるからです。自身のWebサイトへの検索を制限する、企業により提供される検索エンジンは、<META>タグを参照することで恩恵を受けることができます。<META>タグには、クラスの完全修飾名と、フィールドおよびメソッドの修飾されていない名前が含まれます。コンストラクタは、クラス名と同じであるため含まれません。たとえば、クラス\fIString\fRは次のキーワードで開始します。 .sp .if n \{\ .RS 4 @@ -3137,42 +3137,42 @@ HTML .PP \-tag \fItagname\fR:Xaoptcmf:"\fItaghead\fR" .RS 4 -\fIjavadoc\fRޥɤɥơ󡦥ΰ1ļñʥࡦ֥å\fI@tagname\fRǤ褦ˤޤˤꡢ\fIjavadoc\fRޥɤϥ̾ΥڥåԤȤǤΤǡ¸ߤ뤹٤ƤΥࡦˤĤơ\fI\-tag\fRץȤ߹ळȤפǤμ¹ԤǤϽϤʤϡ\fIX\fRդ̵ˤޤ\fI\-tag\fRץϡθФ\fItaghead\fRǽϤޤμιԤˤϡΥץ1ĤΰǻꤷƥȤ³ޤ֥åƱ͡ΰΥƥȤˤϥ饤󡦥ޤ뤳ȤǤޤΥ饤󡦥ᤵޤϤϡ1ļɸΥ(\fI@return\fR\fI@author\fRʤ)νϤȤ褯Ƥޤ\fItaghead\fRͤάȡ\fItagname\fRФȤɽޤ +\fIjavadoc\fRコマンドがドキュメンテーション・コメント内の引数を1つ取る単純なカスタム・ブロック・タグ\fI@tagname\fRを解釈できるようにします。これにより、\fIjavadoc\fRコマンドはタグ名のスペルチェックを行うことができるので、ソース・コード内に存在するすべてのカスタム・タグについて、\fI\-tag\fRオプションを組み込むことが重要です。今回の実行では出力されないタグは、\fIX\fRを付けて無効にします。\fI\-tag\fRオプションは、タグの見出し\fItaghead\fRを太字で出力します。その次の行には、このオプションの1つの引数で指定したテキストが続きます。ブロック・タグと同様、この引数のテキストにはインライン・タグを含めることができます。このインライン・タグも解釈されます。出力は、引数を1つ取る標準のタグ(\fI@return\fRや\fI@author\fRなど)の出力とよく似ています。\fItaghead\fRの値を省略すると、\fItagname\fRが見出しとして表示されます。 .sp -\fB\fR: -\fIXaoptcmf\fRˤꡢǥ֤Ǥ꤬ޤꡢ̵ˤǤ뤫ɤ(\fIX\fRѤ)ޤޤְ֤¤ʤ\fIa\fRꤷޤʳʸȹ礻ǽǤ +\fBタグの配置\fR: +\fIXaoptcmf\fR引数により、ソース・コード内でタグを配置できる場所が決まり、タグを無効にできるかどうか(\fIX\fRを使用して)が決まります。タグの配置位置を制限しない場合は\fIa\fRを指定します。それ以外の文字の組合せも可能です。 .sp \fIX\fR -(̵) +(タグの無効化) .sp \fIa\fR -(٤) +(すべて) .sp \fIo\fR -() +(概要) .sp \fIp\fR -(ѥå) +(パッケージ) .sp \fIt\fR -(סĤޤꥯ饹ȥ󥿥ե) +(タイプ、つまりクラスとインタフェース) .sp \fIc\fR -(󥹥ȥ饯) +(コンストラクタ) .sp \fIm\fR -(᥽å) +(メソッド) .sp \fIf\fR -(ե) +(フィールド) .sp -\fB󥰥롦\fR: Ǥդΰ֤ǻѤǤ륿Υץ򼨤ޤ\fI\-tag todo:a:"To Do:"\fR +\fBシングル・タグの例\fR: ソース・コード内の任意の位置で使用できるタグのタグ・オプションの例を示します。\fI\-tag todo:a:"To Do:"\fR .sp -\fI@todo\fR򥳥󥹥ȥ饯᥽åɤӥեɤȤΤ߻Ѥ硢\fI\-tag todo:cmf:"To Do:"\fRѤޤ +\fI@todo\fRタグをコンストラクタ、メソッドおよびフィールドとのみ使用する場合、\fI\-tag todo:cmf:"To Do:"\fRを使用します。 .sp -ǸΥ(:)ϡѥ᡼ڤʸǤϤʤФƥȤΰˤʤäƤޤ\fI@todo\fRޤࡢѤΤ줫ΥץѤޤȤС\fI@todo The documentation for this method needs work\fRǤ +最後のコロン(:)は、パラメータ区切り文字ではなく、見出しテキストの一部になっています。\fI@todo\fRタグを含む、ソース・コード用のいずれかのタグ・オプションを使用します。たとえば、\fI@todo The documentation for this method needs work\fRです。 .sp -\fB̾Υ\fR: ̾ǥѤϥХååѤƥפޤΥɥơ󡦥Ȥˤϡ\fI\-tag ejb\e\e:bean:a:"EJB Bean:"\fRץѤޤ +\fBタグ名内のコロン\fR: タグ名内でコロンを使用する場合はバックスラッシュを使用してエスケープします。次のドキュメンテーション・コメントには、\fI\-tag ejb\e\e:bean:a:"EJB Bean:"\fRオプションを使用します。 .sp .if n \{\ .RS 4 @@ -3185,12 +3185,12 @@ HTML .if n \{\ .RE .\} -\fB̾Υڥå\fR: γȯԤɬϤʤࡦ򥽡֤뤳Ȥޤξ硢Τ٤ƤΥꥹȤϤ륿ͭˤϤʤ̵ˤɬפޤ\fIX\fRꤹȥ̵ˤʤޤꤷʤȡͭˤʤޤˤꡢ\fIjavadoc\fRޥɤϡФϥߥʤɤˤǤ뤫ɤǤޤΤ褦ʾˡ\fIjavadoc\fRޥɤٹ𤬽ϤޤǤ֤Ƥͤ\fIX\fRɲäǤޤƤС\fIX\fRΤߤǥͭˤ뤳ȤǤޤȤС\fI@todo\fRϤ硢\fI\-tag todo:Xcmf:"To Do:"\fRѤޤ˴ñˤ硢\fI\-tag todo:X\fRѤޤʸ\fI\-tag todo:X\fRϡ\fI@todo\fRåȤƤƤⵡǽޤ +\fBタグ名のスペルチェック\fR: 一部の開発者が必ずしも出力しないカスタム・タグをソース・コード内に配置することがあります。この場合、ソース・コード内のすべてのタグをリストし、出力するタグを有効にし、出力しないタグを無効にする必要があります。\fIX\fRを指定するとタグは無効になります。指定しないと、タグは有効になります。これにより、\fIjavadoc\fRコマンドは、検出したタグが入力ミスなどによる不明タグであるかどうかを特定できます。このような場合に、\fIjavadoc\fRコマンドから警告が出力されます。すでに配置されている値に\fIX\fRを追加できます。こうしておけば、\fIX\fRを削除するのみでタグを有効にすることができます。たとえば、\fI@todo\fRタグを出力で抑制する場合、\fI\-tag todo:Xcmf:"To Do:"\fRを使用します。さらに簡単にする場合、\fI\-tag todo:X\fRを使用します。構文\fI\-tag todo:X\fRは、\fI@todo\fRタグがタグレットで定義されていても機能します。 .sp -\fBν\fR: -\fI\-ta\fR\fIg\fR\fI\-taglet\fRץνˤäơνϽ礬ޤޤࡦɸॿȤ߹礻ƻѤ뤳ȤǤޤɸॿΥץϡꤹ뤿Υץ졼ۥǤɸॿ̾ΤߤޤɸॿξФѹǤޤ󡣤򼡤˼ޤ\fI\-tag\fRץꤷʤȡ\fI\-tagle\fR\fIt\fRץΰ֤ˤꡢޤޤξȤ¸ߤ硢ޥɥ饤κǸˤνꤷޤϡ䥿åȤޥɥ饤˻ꤵ줿֤˽뤿ǤȤС\fI\-taglet\fR\fI\-tag\fRץ̾\fItodo\fRͤľ硢ޥɥ饤˺Ǹ˻ꤵ줿Τꤷޤ +\fBタグの順序\fR: +\fI\-ta\fR\fIg\fRおよび\fI\-taglet\fRオプションの順序によって、タグの出力順が決まります。カスタム・タグと標準タグを組み合せて使用することもできます。標準タグのタグ・オプションは、順序を決定するためだけのプレースホルダです。標準タグの名前のみを取ります。標準タグの小見出しは変更できません。これを次の例に示します。\fI\-tag\fRオプションを指定しないと、\fI\-tagle\fR\fIt\fRオプションの位置により、順序が決まります。タグが両方とも存在する場合、コマンドラインの最後にある方がその順序を決定します。これは、タグやタグレットがコマンドラインに指定された順番に処理されるためです。たとえば、\fI\-taglet\fRおよび\fI\-tag\fRオプションが名前\fItodo\fR値を持つ場合、コマンドラインに最後に指定されたものが順序を決定します。 .sp -\fBδåȤ\fR: ǤϡϤParametersThrowsδ֤To Doޤ\fIX\fRѤơ\fI@example\fRκμ¹ԤǤϽϤʤǤ뤳Ȥꤷޤ\fI@argfile\fRѤϡΤ褦ˡե̡ιԤ˥֤Ǥޤ(Ԥη³򼨤ʸ) +\fBタグの完全セットの例\fR: この例では、出力のParametersとThrowsの間にTo Doを挿入します。\fIX\fRを使用して、\fI@example\fRタグが、ソース・コード内の今回の実行では出力されないタグであることも指定します。\fI@argfile\fRタグを使用する場合は、次のように、引数ファイル内の別々の行にタグを配置できます(行の継続を示す文字は不要)。 .sp .if n \{\ .RS 4 @@ -3206,24 +3206,24 @@ HTML .if n \{\ .RE .\} -\fIjavadoc\fRޥɤɥơ󡦥ȤϤݤ˸줿ΤɸॿǤ⡢\fI\-tag\fR\fI\-taglet\fRץϤ줿ǤʤΤϤ٤Ȥߤʤ졢ٹ𤬥ޤ +\fIjavadoc\fRコマンドがドキュメンテーション・コメントを解析する際に検索されたタグのうち、標準タグでも、\fI\-tag\fRや\fI\-taglet\fRオプションで渡されたタグでもないものはすべて不明タグとみなされ、警告がスローされます。 .sp -ɸॿϡǽ顢ǥեȤνǥꥹŪ˳Ǽޤ\fI\-tag\fRץѤȡΥϤΥꥹȤɲäޤɸॿϡǥեȤΰ֤ưޤΤᡢɸॿ\fI\-tag\fRץάȡϥǥեȤΰ֤֤줿ޤޤˤʤޤ +標準タグは、最初、デフォルトの順序でリスト内に内部的に格納されます。\fI\-tag\fRオプションを使用すると、それらのタグはこのリストに追加されます。標準タグは、デフォルトの位置から移動されます。そのため、標準タグの\fI\-tag\fRオプションを省略すると、それはデフォルトの位置に配置されたままになります。 .sp -\fBβ\fR: ֤ͭ̾ˤϡѥå˻ѤƤ\fIcom\&.mycompany\&.todo\fRȤ̾Τ褦ˡɥåȤǶڤ줿̾ѤޤOracleϡ̾˥ɥåȤޤޤʤɸॿޤ桼ϡOracleƱ̾Υư򥪡С饤ɤޤ\fI@todo\fRȤ̾ΥޤϥåȤ桼硢θOracleƱ̾ɸॿƤ⡢ΥޤϥåȤϾ˥桼ΤƱưݻޤ +\fB競合の回避\fR: 固有の名前空間を作成するには、パッケージに使用されている\fIcom\&.mycompany\&.todo\fRという名前のように、ドットで区切られた名前を使用します。Oracleは、今後も名前にドットを含まない標準タグを作成します。ユーザーが作成したタグは、Oracleが定義する同じ名前のタグの動作をオーバーライドします。\fI@todo\fRという名前のタグまたはタグレットをユーザーが作成した場合、その後にOracleが同じ名前の標準タグを作成しても、そのタグまたはタグレットは常にユーザーが定義したのと同じ動作を保持します。 .sp -\fBvs\&. Javadoc\fR: ̤ˡɲäɬפΤޡåפɥȤ˱ƶͿɥȤꤹ뤿ΤΤǤ硢ΥޡåפJavadocˤޤʳξˤޤJavadocġǤDocȤεˡΥࡦ˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#annotations)򻲾ȤƤ +\fB注釈vs\&. Javadocタグ\fR: 一般に、追加する必要のあるマークアップが、ドキュメントに影響を与えたりドキュメントを生成したりするためのものである場合、そのマークアップはJavadocタグにします。それ以外の場合は注釈にします。JavadocツールでのDocコメントの記述方法のカスタム・タグと注釈に関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html#annotations)を参照してください。 .sp -\fI\-taglet\fRץѤơʣʥ֥å䥫ࡦ饤󡦥Ǥޤ +\fI\-taglet\fRオプションを使用して、より複雑なブロック・タグやカスタム・インライン・タグも作成できます。 .RE .PP \-taglet \fIclass\fR .RS 4 -ΥΥɥȤ˻ѤɥååȤư뤿Υ饹եꤷޤ\fIclass\fRͤδ̾ѤޤΥåȤϡࡦΥƥȰοޤåȤϡΰդϤޤåȤѤ˭٤ʥɥȤˤĤƤϡåȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html)򻲾ȤƤ +そのタグのドキュメントの生成に使用するドックレットを起動するためのクラス・ファイルを指定します。\fIclass\fR値の完全修飾名を使用します。このタグレットは、カスタム・タグのテキスト引数の数も定義します。タグレットは、これらの引数を受け付け、処理し、出力を生成します。タグレットの例を使用した豊富なドキュメントについては、タグレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/taglet/overview\&.html)を参照してください。 .sp -åȤϡ֥åޤϥ饤󡦥ǤåȤǤդοΰȤ뤳ȤǤޤޤƥȤˤ롢վ񤭤롢ƥȤե˽񤭽Ф¾Υץ򳫻ϤʤɤΥưǤޤåȤǻǤΤϡ־ַΤߤǤ¾Τ٤ƤηϡɥååȤˤäƹԤޤåȤѤƤ⡢ޥ饹ΥꥹȤ饯饹̾ʤɤνϼ¹ԤǤޤ󡣤ΥƥȤե˽Ϥꡢ̤ΥץȥꥬʤɤѤޤåȤؤΥѥꤹˤϡ\fI\-tagletpath\fRץѤޤˡڡParametersThrowsδ֤To DoåȤ򼨤ޤޤϡ\fI\-taglet\fRץ򤽤\fI\-tag\fRץΤ˻Ѥ뤳ȤǤޤɤ߼꤬ˤʤǽޤ +タグレットは、ブロックタグまたはインライン・タグで便利です。タグレットは任意の数の引数をとることができます。また、テキストを太字にする、箇条書きを作成する、テキストをファイルに書き出す、その他のプロセスを開始するなどのカスタム動作を実装できます。タグレットで指定できるのは、タグの配置場所と配置形式のみです。その他のすべての決定は、ドックレットによって行われます。タグレットを使用しても、包含クラスのリストからクラス名を削除するなどの処理は実行できません。ただし、タグのテキストをファイルに出力したり、別のプロセスをトリガーするなどの副作用は得られます。タグレットへのパスを指定するには、\fI\-tagletpath\fRオプションを使用します。次に、生成されるページのParametersとThrowsの間にTo Doタグレットを挿入する例を示します。または、\fI\-taglet\fRオプションをその\fI\-tag\fRオプションのかわりに使用することができますが、読み取りが困難になる可能性があります。 .sp .if n \{\ .RS 4 @@ -3244,67 +3244,67 @@ HTML .PP \-tagletpath \fItagletpathlist\fR .RS 4 -taglet饹ե򸡺뤿θѥꤷޤ\fItagletpathlist\fRˤϡ(:)ǶڤäʣΥѥޤ뤳ȤǤޤ\fIjavadoc\fRޥɤϡꤵ줿ѥʲΤ٤ƤΥ֥ǥ쥯ȥ򸡺ޤ +tagletクラス・ファイルを検索するための検索パスを指定します。\fItagletpathlist\fRには、コロン(:)で区切って複数のパスを含めることができます。\fIjavadoc\fRコマンドは、指定されたパス以下のすべてのサブディレクトリを検索します。 .RE .PP \-docfilesubdirs .RS 4 -doc\-filesǥ쥯ȥΥǥסԡͭˤޤˤϡ֥ǥ쥯ȥȤΤ٤ƤƵŪ˥ԡޤȤСǥ쥯ȥoc\-files/example/imagesȤƤ٤ƥԡޤǤ⡢֥ǥ쥯ȥ꤬ǽǤ +doc\-filesディレクトリのディープ・コピーを有効にします。宛先には、サブディレクトリとそのすべて内容が再帰的にコピーされます。たとえば、ディレクトリoc\-files/example/imagesとその内容がすべてコピーされます。ここでも、サブディレクトリを除外する指定が可能です。 .RE .PP \-excludedocfilessubdir \fIname1:name2\fR .RS 4 -ꤵ줿̾doc\-files֥ǥ쥯ȥ򤹤٤ƽޤˤꡢSCCSȤ¾Υ極֥ǥ쥯ȥΥԡɤޤ +指定された名前のdoc\-filesサブディレクトリをすべて除外します。これにより、SCCSとその他のソース・コード制御サブディレクトリのコピーを防ぎます。 .RE .PP \-noqualifier all | \fIpackagename1\fR:\fIpackagename2\&.\&.\&.\fR .RS 4 -Ϥ륯饹̾齤ѥå̾άޤ\fI\-noqualifier\fRץΰϡ\fIall\fR(٤ƤΥѥåҤά)ޤϽҤȤƺѥåΥڤꥹ(磻ɥɤ)Τ줫Ȥʤޤ饹ޤϥ󥿥ե̾ɽ֤ѥå̾ޤեν򻲾ȤƤ +出力されるクラス名から修飾パッケージ名を省略します。\fI\-noqualifier\fRオプションの引数は、\fIall\fR(すべてのパッケージ修飾子を省略)、または修飾子として削除するパッケージのコロン区切りリスト(ワイルドカードも可)、のいずれかとなります。クラスまたはインタフェース名が表示される位置からパッケージ名が削除されます。ソース・ファイルの処理を参照してください。 .sp -Ǥϡ٤ƤΥѥåҤάޤ\fI\-noqualifier all\fR +次の例では、すべてのパッケージ修飾子を省略します。\fI\-noqualifier all\fR .sp -Ǥϡ\fIjava\&.lang\fR\fIjava\&.io\fRѥåҤάޤ: -\fI\-noqualifier java\&.lang:java\&.io\fR +次の例では、\fIjava\&.lang\fRおよび\fIjava\&.io\fRパッケージ修飾子を省略します: +\fI\-noqualifier java\&.lang:java\&.io\fR。 .sp -Ǥϡ\fIjava\fRǻϤޤѥåҤ\fIcom\&.sun\fR֥ѥåάޤ\fIjavax\fRϾάޤ\fI\-noqualifier java\&.*:com\&.sun\&.*\fR +次の例では、\fIjava\fRで始まるパッケージ修飾子および\fIcom\&.sun\fRサブパッケージを省略しますが、\fIjavax\fRは省略しません。\fI\-noqualifier java\&.*:com\&.sun\&.*\fR .sp -ѥåҤҤư˽äɽ硢̾Ŭڤṳ̂ޤ̾ɽˡפ򻲾ȤƤΥ롼ϡ\fI\-noqualifier\fRץѤ뤫ɤˤ餺ͭǤ +パッケージ修飾子が前述の動作に従って表示される場合、名前は適切に短縮されます。「名前が表示される方法」を参照してください。このルールは、\fI\-noqualifier\fRオプションを使用するかどうかにかかわらず有効です。 .RE .PP \-notimestamp .RS 4 -ॹפޤƥڡƬ᤯ˤ롢줿HTMLHTMLȤǥॹפޤ\fI\-notimestamp\fRץϡ\fIjavadoc\fRޥɤ2ĤΥ١Ǽ¹Ԥδ֤κʬ\fIdiff\fRΩޤॹפˤ\fIdiff\fRȯɤǤ(ǤʤȤ٤ƤΥڡ\fIdiff\fRˤʤޤ)ॹפˤ\fIjavadoc\fRޥɤΥ꡼ֹ椬ޤޤ졢ߤǤϡ\fI<!\-\- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 \-\->\fRΤ褦ɽޤ +タイムスタンプが抑制されます。各ページの先頭近くにある、生成されたHTML内のHTMLコメントでタイムスタンプが隠されます。\fI\-notimestamp\fRオプションは、\fIjavadoc\fRコマンドを2つのソース・ベースで実行し、それらの間の差分\fIdiff\fRを取得する場合に役立ちます。タイムスタンプによる\fIdiff\fRの発生を防ぐからです(そうでないとすべてのページで\fIdiff\fRになります)。タイムスタンプには\fIjavadoc\fRコマンドのリリース番号が含まれ、現在では、\fI<!\-\- Generated by javadoc (build 1\&.5\&.0_01) on Thu Apr 02 14:04:52 IST 2009 \-\->\fRのように表示されます。 .RE .PP \-nocomment .RS 4 -Ӥ٤ƤΥޤॳʸΤΤߤޤΥץˤꡢϰۤʤŪΤäեѤץȤᤤʳǥȥHTMLɥȤǤ褦ˤʤޤ +主説明およびすべてのタグを含むコメント本文全体を抑制し、宣言のみを生成します。このオプションにより、元は異なる目的のためだったソース・ファイルを再利用し、新しいプロジェクトの早い段階でスケルトンHTMLドキュメントを作成できるようになります。 .RE .PP \-sourcetab \fItablength\fR .RS 4 -dzƥ֤Ѥʸοꤷޤ +ソース内で各タブが使用する空白文字の数を指定します。 .RE -.SH "ޥɥ饤ե" +.SH "コマンドライン引数ファイル" .PP -\fIjavadoc\fRޥɤûʷˤꤹ뤿ˡ\fIjavadoc\fRޥɤФ(\fI\-J\fRץ)ä1İʾΥեꤹ뤳ȤǤޤΤȤѤСɤΥڥ졼ƥ󥰡ƥǤ⡢ǤդĹ\fIjavadoc\fRޥɤǤޤ +\fIjavadoc\fRコマンドを短くしたり簡潔にしたりするために、\fIjavadoc\fRコマンドに対する引数(\fI\-J\fRオプションを除く)が入った1つ以上のファイルを指定することができます。このことを利用すれば、どのオペレーティング・システム上でも、任意の長さの\fIjavadoc\fRコマンドを作成できます。 .PP -եˤϡ\fIjavac\fRΥץȥե̾ͳȤ߹礻ƵҤǤޤեγưϡڡޤϲԤǶڤޤե̾ޤ줿򤬤硢ե̾ΤŰǰϤߤޤ +引数ファイルには、\fIjavac\fRのオプションとソース・ファイル名を自由に組み合せて記述できます。ファイル内の各引数は、スペースまたは改行で区切ります。ファイル名に埋め込まれた空白がある場合、ファイル名全体を二重引用符で囲みます。 .PP -եΥե̾ϡեΰ֤ǤϤʤߤΥǥ쥯ȥŪȤʤޤΥꥹȤǤϡ磻ɥ(\fI*\fR)ϻѤǤޤ󡣤ȤС*\&.javaȤϻǤޤ󡣥åȥޡ(@)ѤơեƵŪ˲᤹뤳ȤϤǤޤ󡣤ޤ\fI\-J\fRץ⥵ݡȤƤޤ󡣤ΥץϵưġϤޤưġǤϰե򥵥ݡȤƤʤǤ +引数ファイル内のファイル名は、引数ファイルの位置ではなく、現在のディレクトリに相対的となります。これらのリストでは、ワイルドカード(\fI*\fR)は使用できません。たとえば、*\&.javaとは指定できません。アットマーク(@)を使用して、ファイルを再帰的に解釈することはできません。また、\fI\-J\fRオプションもサポートされていません。このオプションは起動ツールに渡されますが、起動ツールでは引数ファイルをサポートしていないからです。 .PP -\fIjavadoc\fR¹ԤȤˡưեΥѥȥե̾Ƭ@ʸդϤޤ\fIjavadoc\fRޥɤϡåȥޡ(@)ʸǻϤޤ򸫤ĤȡΥեƤŸưꥹȤޤ +\fIjavadoc\fRを実行するときに、各引数ファイルのパスとファイル名の先頭に@文字を付けて渡します。\fIjavadoc\fRコマンドは、アットマーク(@)文字で始まる引数を見つけると、そのファイルの内容を展開して引数リストに挿入します。 .PP -\fBExample 1\fR, ñΰե +\fBExample 1\fR, 単一の引数ファイル .RS 4 -\fIargfile\fRȤ̾1ĤΰեѤơ٤Ƥ\fIjavadoc\fRޥɰݻǤޤ\fIjavadoc @argfile\fR˼褦ˡΰեˤξΥեƤޤޤƤޤ +\fIargfile\fRという名前の1つの引数ファイルを使用して、すべての\fIjavadoc\fRコマンド引数を保持できます。\fIjavadoc @argfile\fR次の例に示すように、この引数ファイルには両方のファイルの内容が含まれています。 .RE .PP -\fBExample 2\fR, 2Ĥΰե +\fBExample 2\fR, 2つの引数ファイル .RS 4 -Τ褦ˡ2ĤΰեǤޤ\fIjavadoc\fRޥɤΥץѤ1ġѥå̾ޤϥե̾Ѥ1ĤǤΥꥹȤǤϹԷ³ʸѤƤޤ +次のように、2つの引数ファイルを作成できます。\fIjavadoc\fRコマンドのオプション用に1つ、パッケージ名またはソース・ファイル名用に1つです。次のリストでは行継続文字を使用していません。 .sp -ƤޤࡢoptionsȤ̾Υեޤ +次の内容を含む、optionsという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -3324,7 +3324,7 @@ doc\-files .if n \{\ .RE .\} -ƤޤࡢpackagesȤ̾Υեޤ +次の内容を含む、packagesという名前のファイルを作成します。 .sp .if n \{\ .RS 4 @@ -3337,7 +3337,7 @@ com\&.mypackage3 .if n \{\ .RE .\} -Τ褦ˡ\fIjavadoc\fRޥɤ¹Ԥޤ +次のように、\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3350,9 +3350,9 @@ javadoc @options @packages .\} .RE .PP -\fBExample 3\fR, ѥѤե +\fBExample 3\fR, パスを使用した引数ファイル .RS 4 -եϥѥǤޤեΤ٤ƤΥե̾ϡ(\fIpath1\fR\fIpath2\fRǤϤʤ)Τ褦˸ߤκȥǥ쥯ȥŪȤʤޤ +引数ファイルはパスを指定できますが、ファイル内のすべてのファイル名は、(\fIpath1\fRや\fIpath2\fRではなく)次のように現在の作業ディレクトリに相対的となります。 .sp .if n \{\ .RS 4 @@ -3365,9 +3365,9 @@ javadoc @path1/options @path2/packages .\} .RE .PP -\fBExample 4\fR, ץ +\fBExample 4\fR, オプション引数 .RS 4 -ˡ\fIjavadoc\fRޥɤΥץФե˳Ǽ򼨤ޤĹǤΤǡ\fI\-bottom\fRץѤޤΤ褦ʥƥȰޤࡢbottomȤ̾ΥեǤޤ +次に、\fIjavadoc\fRコマンドのオプションに対する引数を引数ファイルに格納する例を示します。長い引数を指定できるので、\fI\-bottom\fRオプションを使用します。次のようなテキスト引数を含む、bottomという名前のファイルを作成できます。 .sp .if n \{\ .RS 4 @@ -3382,37 +3382,37 @@ javadoc @path1/options @path2/packages .if n \{\ .RE .\} -\fIjavadoc\fRޥɤ򼡤Τ褦˼¹Ԥޤ\fI javadoc \-bottom @bottom @packages\fR +\fIjavadoc\fRコマンドを次のように実行します。\fI javadoc \-bottom @bottom @packages\fR .sp -\fI\-bottom\fRץեκǽ˴ޤơΤ褦\fIjavadoc\fRޥɤ¹Ԥ뤳ȤǤޤ\fIjavadoc @bottom @packages\fR +\fI\-bottom\fRオプションを引数ファイルの最初に含めて、次のように\fIjavadoc\fRコマンドを実行することもできます。\fIjavadoc @bottom @packages\fR .RE -.SH "JAVADOCޥɤμ¹" +.SH "JAVADOCコマンドの実行" .PP -\fIjavadoc\fRޥɤΥ꡼ֹ\fIjavadoc \-J\-version\fRץǤޤϥȥ꡼ˤɸɥååȤΥ꡼ֹ椬ޤޤޤ\fI\-quiet\fRץ̵ˤǤޤ +\fIjavadoc\fRコマンドのリリース番号は\fIjavadoc \-J\-version\fRオプションで特定できます。出力ストリームには標準ドックレットのリリース番号が含まれます。\fI\-quiet\fRオプションで無効にできます。 .PP -JavaǵҤ줿ץफ\fIjavadoc\fRޥɤưˤϸץޥƥå󥿥եѤޤΥ󥿥ե\fIcom\&.sun\&.tools\&.javadoc\&.Main\fRˤޤ(ޤ\fIjavadoc\fRޥɤϺǽǤ)ܺ٤ϡɸɥåå -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard\-doclet\&.html#runningprogrammatically)򻲾ȤƤ +Java言語で記述されたプログラムから\fIjavadoc\fRコマンドを起動するには公開プログラマティック・インタフェースを使用します。このインタフェースは\fIcom\&.sun\&.tools\&.javadoc\&.Main\fRにあります(また\fIjavadoc\fRコマンドは再入可能です)。詳細は、標準ドックレット +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/standard\-doclet\&.html#runningprogrammatically)を参照してください。 .PP -μǤϡɸHTMLɥååȤƤӽФޤࡦɥååȤƤӽФˤϡ\fI\-doclet\fR\fI\-docletpath\fRץѤޤɥååȤγ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)򻲾ȤƤ -.SS "ñ" +次の手順では、標準HTMLドックレットを呼び出します。カスタム・ドックレットを呼び出すには、\fI\-doclet\fRおよび\fI\-docletpath\fRオプションを使用しますドックレットの概要 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/doclet/overview\&.html)を参照してください +.SS "簡単な例" .PP -\fIjavadoc\fRޥɤϡѥåΤФƼ¹Ԥ뤳Ȥ⡢ġΥեФƼ¹Ԥ뤳ȤǤޤƥѥå̾ϡ줾Υѥå̾бǥ쥯ȥ̾ޤ +\fIjavadoc\fRコマンドは、パッケージ全体に対して実行することも、個々のソース・ファイルに対して実行することもできます。各パッケージ名は、それぞれのパッケージ名に対応するディレクトリ名を持ちます。 .PP -Ǥϡե/home/src/java/awt/*\&.javaˤޤǥ쥯ȥ/home/htmlǤ -1İʾΥѥåΥɥȲ.PP -ѥåɥȲˤϡΥѥåΥե򡢤ΥѥåƱ̾Υǥ쥯ȥ˳Ǽɬפޤ +次の例では、ソース・ファイルは/home/src/java/awt/*\&.javaにあります。生成先ディレクトリは/home/htmlです。 +1つ以上のパッケージのドキュメント化.PP +パッケージをドキュメント化するには、そのパッケージのソース・ファイルを、そのパッケージと同じ名前のディレクトリ内に格納する必要があります。 .PP -ѥå̾(\fIjava\&.awt\&.color\fRΤ褦˥ɥåȤǶڤ줿)ʣμ̻Ҥ鹽Ƥ硢³γƼ̻Ҥ̤Υ֥ǥ쥯ȥ(ava/awt/colorʤ)бƤɬפޤ +パッケージ名が(\fIjava\&.awt\&.color\fRのようにドットで区切られた)複数の識別子から構成されている場合、後続の各識別子が下位のサブディレクトリ(ava/awt/colorなど)に対応している必要があります。 .PP -1ĤΥѥåΤʣΥե򡢰ۤʤˤ뤽Τ褦2ĤΥǥ쥯ȥꡦĥ꡼ʬƳǼ뤳ȤǤޤξ\fI\-sourcepath\fRˤäƤξξꤹɬפޤȤСsrc1/java/awt/colorsrc2/java/awt/color +1つのパッケージのための複数のソース・ファイルを、異なる場所にあるそのような2つのディレクトリ・ツリーに分けて格納することもできます。ただし、その場合は\fI\-sourcepath\fRによってその両方の場所を指定する必要があります。たとえば、src1/java/awt/colorとsrc2/java/awt/color。 .PP -ǥ쥯ȥѹ(\fIcd\fRޥɤ)ޤ\fI\-sourcepath\fRץˤꡢ\fIjavadoc\fRޥɤ¹ԤǤޤξ򼨤ޤ +ディレクトリの変更(\fIcd\fRコマンドを使用)または\fI\-sourcepath\fRオプションにより、\fIjavadoc\fRコマンドを実行できます。次の例で両方の選択肢を示します。 .PP -\fBExample 1\fR, 1İʾΥѥåƵŪ˼¹ +\fBExample 1\fR, 1つ以上のパッケージから再帰的に実行 .RS 4 -Ǥ\fIjavadoc\fRޥɤǤդΥǥ쥯ȥ꤫¹ԤǤ褦ˡ\fI\-sourcepath\fRѤƵŪΤ\fI\-subpackages\fR -(1\&.4οץ)Ѥޤϡjavaǥ쥯ȥΥ֥ѥå򤿤ɤޤ\fIjava\&.net\fR\fIjava\&.lang\fR롼Ȥ˻ĥѥåϽޤ\fIjava\&.lang\fRΥ֥ѥåǤ\fIjava\&.lang\&.ref\fRդƤޤ¾Υѥåĥ꡼ˤɤˤϡ\fIjava:javax:org\&.xml\&.sax\fRΤ褦ˡΥѥå̾\fI\-subpackages\fRΰɲäޤ +この例では\fIjavadoc\fRコマンドが任意のディレクトリから実行できるように、\fI\-sourcepath\fRを使用し、再帰的処理のために\fI\-subpackages\fR +(1\&.4の新オプション)を使用します。これは、javaディレクトリのサブパッケージをたどりますが、\fIjava\&.net\fRと\fIjava\&.lang\fRをルートに持つパッケージは除外されます。\fIjava\&.lang\fRのサブパッケージである\fIjava\&.lang\&.ref\fRが除外される点に注意してください。また、他のパッケージ・ツリーを下方にたどるには、\fIjava:javax:org\&.xml\&.sax\fRのように、それらのパッケージの名前を\fI\-subpackages\fRの引数に追加します。 .sp .if n \{\ .RS 4 @@ -3425,9 +3425,9 @@ javadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude .\} .RE .PP -\fBExample 2\fR, 롼ȤؤΰưŪʥѥåμ¹ +\fBExample 2\fR, ルートへの移動および明示的なパッケージの実行 .RS 4 -줿ѥåοƥǥ쥯ȥ˰ưޤˡɥȲ1İʾΥѥå̾ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +完全修飾されたパッケージの親ディレクトリに移動します。次に、ドキュメント化する1つ以上のパッケージの名前を指定して\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3439,12 +3439,12 @@ javadoc \-d /home/html java\&.awt java\&.awt\&.event .if n \{\ .RE .\} -ޤ¾Υѥåĥ꡼ˤɤˤϡj\fIava:javax:org\&.xml\&.sax\fRΤ褦ˡΥѥå̾\fI\-subpackages\fRΰɲäޤ +また、他のパッケージ・ツリーを下方にたどるには、j\fIava:javax:org\&.xml\&.sax\fRのように、それらのパッケージの名前を\fI\-subpackages\fRの引数に追加します。 .RE .PP -\fBExample 3\fR, 1ĤΥĥ꡼ŪʥѥåǤդΥǥ쥯ȥ꤫¹ +\fBExample 3\fR, 1つのツリーの明示的なパッケージの任意のディレクトリから実行 .RS 4 -ξ硢ߤΥǥ쥯ȥ꤬ɤǤϤޤ\fIjavadoc\fRޥɤ¹ԤǾ̥ѥåοƥǥ쥯ȥꤷ\fI\-sourcepath\fRץѤޤɥȲ1İʾΥѥå̾ꤷޤ +この場合、現在のディレクトリがどこかは問題ではありません。\fIjavadoc\fRコマンドを実行し、最上位パッケージの親ディレクトリを指定して\fI\-sourcepath\fRオプションを使用します。ドキュメント化する1つ以上のパッケージの名前を指定します。 .sp .if n \{\ .RS 4 @@ -3457,9 +3457,9 @@ javadoc \-d /home/html \-sourcepath /home/src java\&.awt java\&.awt\&.event .\} .RE .PP -\fBExample 4\fR, ʣΥĥ꡼ŪʥѥåǤդΥǥ쥯ȥ꤫¹ +\fBExample 4\fR, 複数のツリーの明示的なパッケージの任意のディレクトリから実行 .RS 4 -\fIjavadoc\fRޥɤ¹Ԥƥĥ꡼Υ롼ȤؤΥѥΥڤꥹȤꤷ\fI\-sourcepath\fRץѤޤɥȲ1İʾΥѥå̾ꤷޤꤷѥåΤ٤ƤΥե뤬1ĤΥ롼ȡǥ쥯ȥβ¸ߤɬפϤޤ󤬡ѥǻꤵ줿ΤɤǸĤɬפޤ +\fIjavadoc\fRコマンドを実行し、各ツリーのルートへのパスのコロン区切りリストを指定して\fI\-sourcepath\fRオプションを使用します。ドキュメント化する1つ以上のパッケージの名前を指定します。指定したパッケージのすべてのソース・ファイルが、1つのルート・ディレクトリの下に存在する必要はありませんが、ソース・パスで指定された場所のどこかで見つかる必要があります。 .sp .if n \{\ .RS 4 @@ -3470,16 +3470,16 @@ javadoc \-d /home/html \-sourcepath /home/src1:/home/src2 java\&.awt java\&.awt\ .if n \{\ .RE .\} -٤ƤΥj\fIava\&.awt\fR\fIjava\&.awt\&.even\fRtѥå\fIpublic\fR\fIprotected\fR饹ȥ󥿥եˤĤơHTMLΥɥȤ졢ꤵ줿ǥ쥯ȥHTMLե뤬¸ޤ2İʾΥѥåƤΤǡɥȤϡѥåΥꥹȡ饹ΥꥹȡӥᥤΥ饹ڡȤ3ĤHTMLե졼ĤȤˤʤޤ +すべてのケースでj\fIava\&.awt\fRおよび\fIjava\&.awt\&.even\fRtパッケージ内の\fIpublic\fRおよび\fIprotected\fRクラスとインタフェースについて、HTML形式のドキュメントが生成され、指定された生成先ディレクトリにHTMLファイルが保存されます。2つ以上のパッケージが生成されているので、ドキュメントは、パッケージのリスト、クラスのリスト、およびメインのクラス・ページという3つのHTMLフレームを持つことになります。 .RE -1İʾΥ饹ΥɥȲ.PP -ޤ1İʾΥեϤơ\fIjavadoc\fRޥɤ¹Ԥ뤳ȤǤޤ\fIjavadoc\fRϡ2ĤˡΤ줫Ǽ¹ԤǤޤ1Ĥϥǥ쥯ȥѹˡ(\fIcd\fR)⤦1ĤϥեؤΥѥ˻ꤹˡǤХѥϡߤΥǥ쥯ȥȤޤեϤȤϡ\fI\-sourcepath\fRץ̵뤵ޤꥹ(*)Τ褦ʥޥɥ饤󡦥磻ɥɤѤȡ饹Υ롼פǤޤ +1つ以上のクラスのドキュメント化.PP +また、1つ以上のソース・ファイルを渡して、\fIjavadoc\fRコマンドを実行することもできます。\fIjavadoc\fRは、次の2つの方法のいずれかで実行できます。1つはディレクトリを変更する方法(\fIcd\fRを使用)、もう1つはソース・ファイルへのパスを完全に指定する方法です。相対パスは、現在のディレクトリを起点とします。ソース・ファイルを渡すときは、\fI\-sourcepath\fRオプションは無視されます。アスタリスク(*)のようなコマンドライン・ワイルドカードを使用すると、クラスのグループを指定できます。 .PP -\fBExample 1\fR, ǥ쥯ȥѹ +\fBExample 1\fR, ソース・ディレクトリに変更 .RS 4 -ݻǥ쥯ȥѹޤˡɥȲ1İʾΥե̾ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +ソースを保持するディレクトリに変更します。次に、ドキュメント化する1つ以上のソース・ファイルの名前を指定して\fIjavadoc\fRコマンドを実行します。 .sp -Ǥϡ\fIButton\fR饹\fICanvas\fR饹̾\fIGraphics\fRǻϤޤ륯饹ˤĤơHTMLΥɥȤޤѥå̾ǤϤʤե뤬\fIjavadoc\fRޥɤ˰ȤϤƤΤǡɥȤϡ饹ΥꥹȤȥᥤ󡦥ڡȤ2ĤΥե졼ĤȤˤʤޤ +この例では、\fIButton\fRクラスと\fICanvas\fRクラス、および名前が\fIGraphics\fRで始まるクラスについて、HTML形式のドキュメントが生成されます。パッケージ名ではなくソース・ファイルが\fIjavadoc\fRコマンドに引数として渡されているので、ドキュメントは、クラスのリストとメイン・ページという2つのフレームを持つことになります。 .sp .if n \{\ .RS 4 @@ -3493,9 +3493,9 @@ javadoc \-d /home/html Button\&.java Canvas\&.java Graphics*\&.java .\} .RE .PP -\fBExample 2\fR, ѥåΥ롼ȡǥ쥯ȥѹ +\fBExample 2\fR, パッケージのルート・ディレクトリに変更 .RS 4 -ϡƱ롼Ȥ̤Υ֥ѥåθġΥեɥȲΤΩޤѥåΥ롼ȡǥ쥯ȥ˰ܤꡢƥե򡢥롼ȤΥѥȤȤ˻ꤷޤ +これは、同じルートからの別のサブパッケージの個々のソース・ファイルをドキュメント化するのに役立ちます。パッケージのルート・ディレクトリに移り、各ソース・ファイルを、ルートからのパスとともに指定します。 .sp .if n \{\ .RS 4 @@ -3509,9 +3509,9 @@ javadoc \-d /home/html java/awt/Button\&.java java/applet/Applet\&.java .\} .RE .PP -\fBExample 3\fR, ǤդΥǥ쥯ȥ꤫ΥեΥɥȲ +\fBExample 3\fR, 任意のディレクトリからのファイルのドキュメント化 .RS 4 -ξ硢ߤΥǥ쥯ȥ꤬ɤǤϤޤ󡣥ɥȲ륽եؤХѥ(ޤϸߤΥǥ쥯ȥ꤫Хѥ)ꤷ\fIjavadoc\fRޥɤ¹Ԥޤ +この場合、現在のディレクトリがどこかは問題ではありません。ドキュメント化するソース・ファイルへの絶対パス(または現在のディレクトリからの相対パス)を指定して\fIjavadoc\fRコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -3524,8 +3524,8 @@ javadoc \-d /home/html /home/src/java/awt/Button\&.java .RE .\} .RE -ѥåӥ饹ΥɥȲ.PP -ѥåΤȸġΥ饹Ʊ˻ꤷƥɥȲ뤳ȤǤޤˡҤ2ĤȤ߹礻򼨤ޤ\fI\-sourcepath\fRץϡѥåؤΥѥФƤϻѤǤޤġΥ饹ؤΥѥФƤϻѤǤޤ +パッケージおよびクラスのドキュメント化.PP +パッケージ全体と個々のクラスを同時に指定してドキュメント化することもできます。次に、前述の2つの例を組み合せた例を示します。\fI\-sourcepath\fRオプションは、パッケージへのパスに対しては使用できますが、個々のクラスへのパスに対しては使用できません。 .sp .if n \{\ .RS 4 @@ -3537,14 +3537,14 @@ javadoc \-d /home/html \-sourcepath /home/src java\&.awt .if n \{\ .RE .\} -.SS "ºݤ" +.SS "実際の例" .PP -Υޥɥ饤󤪤\fImakefile\fRС\fIjavadoc\fRޥɤJavaץåȥեAPIǼ¹ԤޤJava SE 1\&.21500Ĥpublicprotected饹ΥɥȤˤϡ180MBΥ꡼Ѥޤɤ⥪ץΰХѥѤƤ뤿ᡢǤդΥǥ쥯ȥ꤫Ʊ\fIjavadoc\fRޥɤ¹ԤǤޤ -ޥɥ饤.PP -ΥޥɤϡΥФĹǽޤ¤򤹤ˤϡޥɥ饤եѤޤޤϡ롦ץȤ򵭽Ҥޤ +次のコマンドラインおよび\fImakefile\fRバージョンの\fIjavadoc\fRコマンドをJavaプラットフォームAPIで実行します。Java SE 1\&.2で約1500個のpublicおよびprotectedクラスのドキュメントを生成するには、180MBのメモリーを使用します。どちらの例もオプションの引数で絶対パスが使用されているため、任意のディレクトリから同じ\fIjavadoc\fRコマンドを実行できます。 +コマンドラインの例.PP +次のコマンドは、一部のシェルに対して長すぎる可能性があります。この制限を回避するには、コマンドライン引数ファイルを使用します。または、シェル・スクリプトを記述します。 .PP -Ǥϡ\fIpackages\fRϽѥåޤ̾ǡ\fIjava\&.applet\fR -\fIjava\&.lang\fRʤɤǤƥץΡŰǰϤޤ줿¦ˤϡʸǤޤ󡣤ȤС򥳥ԡɡڡȤϡ\fI\-bottom\fRץ󤫤ʸƤ +この例では、\fIpackages\fRは処理するパッケージを含む名前で、\fIjava\&.applet\fR +\fIjava\&.lang\fRなどです。各オプションの、一重引用符で囲まれた引数の内側には、改行文字を挿入できません。たとえば、この例をコピー・アンド・ペーストする場合は、\fI\-bottom\fRオプションから改行文字を削除してください。 .sp .if n \{\ .RS 4 @@ -3571,10 +3571,10 @@ Other names may be trademarks of their respective owners\&.</font>\*(Aq \e .if n \{\ .RE .\} -ץޥƥå󥿥ե.PP -Javadoc Access APIǤϡץ¹ԤʤƤ⡢JavadocġJavaץꥱ󤫤ľܵưǤޤ +プログラマティック・インタフェース.PP +Javadoc Access APIでは、新しいプロセスを実行しなくても、JavadocツールをJavaアプリケーションから直接起動できます。 .PP -ȤСʸϥޥ\fIjavadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude java\&.net:java\&.lang com\&.example\fRƱǤ +たとえば、次の文はコマンド\fIjavadoc \-d /home/html \-sourcepath /home/src \-subpackages java \-exclude java\&.net:java\&.lang com\&.example\fRと同等です。 .sp .if n \{\ .RS 4 @@ -3599,13 +3599,13 @@ public class JavaAccessSample{ .RE .\} .PP -\fIrun\fR᥽åɤκǽ3Ĥΰϡϡɸϡɸ२顼ȥ꡼ꤷޤ\fINull\fR\fISystem\&.in\fR\fISystem\&.out\fR\fISystem\&.err\fR줾ΥǥեͤǤ -.SS "makefile" +\fIrun\fRメソッドの最初の3つの引数は、入力、標準出力、および標準エラー・ストリームを指定します。\fINull\fRは\fISystem\&.in\fR、\fISystem\&.out\fRおよび\fISystem\&.err\fRそれぞれのデフォルト値です。 +.SS "makefileの例" .PP -ǤϡGNU -\fImakefile\fR򼨤ޤ\fImakefile\fRΰϡŰǰϤߤޤWindows -\fImakefile\fRˤĤƤϡJavadoc FAQ\fImakefiles\fR˴ؤ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html#makefiles)򻲾ȤƤ +ここでは、GNU +\fImakefile\fRの例を示します。\fImakefile\fRの引数は、一重引用符で囲みます。Windows +\fImakefile\fRの例については、Javadoc FAQの\fImakefiles\fRに関する項 +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html#makefiles)を参照してください .sp .if n \{\ .RS 4 @@ -3642,7 +3642,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .if n \{\ .RE .\} -.SS "" +.SS "注意" .sp .RS 4 .ie n \{\ @@ -3652,7 +3652,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fI\-windowtitle\fRץάȡ\fIjavadoc\fRޥɤˤäƥɥȡȥ뤬ɥȥ˥ԡޤ\fI\-windowtitle\fRץΥƥȤϡ\fI\-doctitle\fRץƱǤHTMLϴޤޤޤ󡣤ϡHTMLɥȥˤΤޤޤΥƥȤȤɽΤɤǤ +\fI\-windowtitle\fRオプションを省略すると、\fIjavadoc\fRコマンドによってドキュメント・タイトルがウィンドウ・タイトルにコピーされます。\fI\-windowtitle\fRオプションのテキストは、\fI\-doctitle\fRオプションと同じですが、HTMLタグは含まれません。これは、HTMLタグが、ウィンドウ・タイトル内にそのままのテキストとして表示されるのを防ぐためです。 .RE .sp .RS 4 @@ -3663,7 +3663,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fI\-footer\fRץάȡ\fIjavadoc\fRޥɤˤäƥإåƥȤեå˥ԡޤ +\fI\-footer\fRオプションを省略すると、\fIjavadoc\fRコマンドによってヘッダー・テキストがフッターにコピーされます。 .RE .sp .RS 4 @@ -3674,9 +3674,9 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -Ǥɬפޤ󤬡\fI\-classpath\fR\fI\-link\fRפʥץǤ +この例では必要ありませんが、\fI\-classpath\fRと\fI\-link\fRも重要なオプションです。 .RE -.SH "Ūʥȥ֥륷塼ƥ" +.SH "一般的なトラブルシューティング" .sp .RS 4 .ie n \{\ @@ -3686,7 +3686,7 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -\fIjavadoc\fRޥɤͭʥ饹̾ޤեΤߤɤ߼ޤ\fIjavadoc\fRޥɤեƤɤ߼äƤʤϡ饹̾ͭǤ뤳Ȥǧޤեν򻲾ȤƤ +\fIjavadoc\fRコマンドは有効なクラス名を含むファイルのみを読み取ります。\fIjavadoc\fRコマンドがファイルの内容を正しく読み取っていない場合は、クラス名が有効であることを確認します。ソース・ファイルの処理を参照してください。 .RE .sp .RS 4 @@ -3697,27 +3697,27 @@ SRCDIR = \*(Aq/java/jdk/1\&.7\&.0/src/share/classes\*(Aq .sp -1 .IP \(bu 2.3 .\} -̤Զ礪ӥȥ֥륷塼ƥ󥰤ΥҥȤˤĤƤϡJavadoc FAQ -(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html)򻲾ȤƤ +共通の不具合およびトラブルシューティングのヒントについては、Javadoc FAQ +(http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137483\&.html)を参照してください。 .RE -.SH "顼ȷٹ" +.SH "エラーと警告" .PP -顼ӷٹåˤϡե̾(ɥơ󡦥ιԤǤϤʤ)ιֹ椬ޤޤޤ +エラーおよび警告メッセージには、ファイル名と宣言行(ドキュメンテーション・コメント内の特定の行ではない)の行番号が含まれます。 .PP -ȤСå\fI֥顼: Class1\&.javaɤ߹ޤ\fRϡ\fIjavadoc\fRޥɤ\fIClass1\&.jav\fR\fIa\fR򸽺ߤΥǥ쥯ȥ˥ɤ褦ȤƤ뤳Ȥ̣ޤ饹̾ϤΥѥ(Фޤ)ɽޤ -.SH "Ķ" +たとえば、メッセージ\fI「エラー: Class1\&.javaを読み込めません」\fRは、\fIjavadoc\fRコマンドが\fIClass1\&.jav\fR\fIa\fRを現在のディレクトリにロードしようとしていることを意味します。クラス名はそのパス(絶対または相対)で表示されます。 +.SH "環境" .PP CLASSPATH .RS 4 -\fICLASSPATH\fRϡ\fIjavadoc\fRޥɤ桼饹եθФ˻Ѥѥ󶡤ĶѿǤδĶѿϡ\fI\-classpath\fRץˤäƥС饤ɤޤǥ쥯ȥϥߥ(Windowsξ)ޤϥ(Oracle Solarisξ)Ƕڤޤ +\fICLASSPATH\fRは、\fIjavadoc\fRコマンドがユーザー・クラス・ファイルの検出に使用するパスを提供する環境変数です。この環境変数は、\fI\-classpath\fRオプションによってオーバーライドされます。ディレクトリはセミコロン(Windowsの場合)またはコロン(Oracle Solarisの場合)で区切ります。 .sp -\fBWindows\fR: +\fBWindowsの例\fR: \fI\&.;C:\eclasses;C:\ehome\ejava\eclasses\fR .sp -\fBOracle Solaris\fR: +\fBOracle Solarisの例\fR: \fI\&.:/home/classes:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -3773,7 +3773,7 @@ javah(1) .\} javap(1) .RE -.SH "Ϣɥ" +.SH "関連ドキュメント" .sp .RS 4 .ie n \{\ @@ -3783,7 +3783,7 @@ javap(1) .sp -1 .IP \(bu 2.3 .\} -JavadocƥΥ +Javadocテクノロジ (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/javadoc/index\&.html) .RE .sp @@ -3795,7 +3795,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -饹θˡ +クラスの検出方法 (http://docs\&.oracle\&.com/javase/8/docs/technotes/tools/findingclasses\&.html) .RE .sp @@ -3807,7 +3807,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -JavadocġǤDocȤεˡ +JavadocツールでのDocコメントの記述方法 (http://www\&.oracle\&.com/technetwork/java/javase/documentation/index\-137868\&.html) .RE .sp @@ -3819,7 +3819,7 @@ Javadoc .sp -1 .IP \(bu 2.3 .\} -URL⡢Uniform Resource Locators +URLメモ、Uniform Resource Locators (http://www\&.ietf\&.org/rfc/rfc1738\&.txt) .RE .sp @@ -3831,7 +3831,7 @@ URL .sp -1 .IP \(bu 2.3 .\} -HTMLɸࡢHTML Document Representation (41972654137321) +HTML標準、HTML Document Representation (4197265および4137321) (http://www\&.w3\&.org/TR/REC\-html40/charset\&.html#h\-5\&.2\&.2) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/javah.1 b/jdk/src/solaris/doc/sun/man/man1/ja/javah.1 index e88dfbfaabd..056a1092e2e 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/javah.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/javah.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javah .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javah" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javah" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javah \- Java饹Cإåȥեޤ -.SH "" +javah \- JavaクラスからCヘッダーとソース・ファイルを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,102 +64,102 @@ javah \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIfully\-qualified\-class\-name\fR .RS 4 -CإåȥեѴ륯饹δ줿ꡣ +Cヘッダーとソース・ファイルに変換されるクラスの完全修飾された場所。 .RE -.SH "" +.SH "説明" .PP -\fIjavah\fRޥɤϡͥƥ֡᥽åɤ뤿ɬפCإåȥեޤ줿إåȥեϡͥƥ֡ɤ饪֥ȤΥ󥹥ѿ򻲾Ȥ뤿CץˤäƻѤޤ\fI\&.h\fRեϡб륯饹Ȱפ֤\fIstruct\fRޤߤޤ\fIstruct\fRΥեɤϡ饹Υ󥹥ѿбޤ +\fIjavah\fRコマンドは、ネイティブ・メソッドを実装するために必要なCヘッダーとソース・ファイルを生成します。作成されたヘッダーとソース・ファイルは、ネイティブ・ソース・コードからオブジェクトのインスタンス変数を参照するためにCプログラムによって使用されます。\fI\&.h\fRファイルは、対応するクラスと一致する配置を持つ\fIstruct\fR定義を含みます。\fIstruct\fRのフィールドは、クラスのインスタンス変数に対応します。 .PP -إåեȤ빽¤Τ̾ϥ饹̾ޤ\fIjavah\fRޥɤϤ륯饹ѥåˤ硢ѥå̾ϥإåե̾ȹ¤̾ξƬղäޤ(_)̾ζڤʸȤƻѤޤ +ヘッダー・ファイルとその中で宣言される構造体の名前はクラスの名前から派生します。\fIjavah\fRコマンドに渡されるクラスがパッケージの中にある場合、パッケージ名はヘッダー・ファイル名と構造体名の両方の先頭に付加されます。下線(_)が名前の区切り文字として使用されます。 .PP -ǥեȤǤ\fIjavah\fRޥɤϡޥɥ饤˥ꥹȤƥ饹ΥإåեߤΥǥ쥯ȥ˥ե֤ޤեˤϡ\fI\-stubs\fRץѤƤ1ĤΥեˡꥹȤ줿٤ƤΥ饹η̤Ϣ뤹ˤϡ\fI\-o\fRץѤƤ +デフォルトでは\fIjavah\fRコマンドは、コマンドラインにリストされる各クラスのヘッダー・ファイルを作成し、現在のディレクトリにファイルを置きます。ソース・ファイルを作成するには、\fI\-stubs\fRオプションを使用してください。1つのファイルの中に、リストされたすべてのクラスの結果を連結するには、\fI\-o\fRオプションを使用してください。 .PP -Java Native Interface (JNI)ϥإåޤϥ֡եɬפȤޤ\fIjavah\fRޥɤϰ³JNIΥͥƥ֡᥽åɤɬפʥͥƥ֡᥽åɴؿץȥפ˻ѤǤޤ\fIjavah\fRޥɤϥǥեȤJNIνϤη̤\fI\&.h\fRե˳Ǽޤ -.SH "ץ" +Java Native Interface (JNI)はヘッダー情報またはスタブ・ファイルを必要としません。\fIjavah\fRコマンドは引き続きJNI形式のネイティブ・メソッドに必要なネイティブ・メソッド関数プロトタイプの生成に使用できます。\fIjavah\fRコマンドはデフォルトでJNI形式の出力を生成し、その結果を\fI\&.h\fRファイルに格納します。 +.SH "オプション" .PP \-o \fIoutputfile\fR .RS 4 -ޥɥ饤˥ꥹȤ줿٤ƤΥ饹Фơ̤ΥإåޤϥեϢ뤷ƽϥե˳Ǽޤ\fI\-o\fRޤ\fI\-d\fRΤɤ餫Τ߻ѤǤޤ +コマンドラインにリストされたすべてのクラスに対して、結果のヘッダーまたはソース・ファイルを連結して出力ファイルに格納します。\fI\-o\fRまたは\fI\-d\fRのどちらかのみ使用できます。 .RE .PP \-d \fIdirectory\fR .RS 4 -\fIjavah\fRإåեޤϥ֡ե¸롢ǥ쥯ȥꤷޤ\fI\-d\fRޤ\fI\-o\fRΤɤ餫Τ߻ѤǤޤ +\fIjavah\fRがヘッダー・ファイルまたはスタブ・ファイルを保存する、ディレクトリを設定します。\fI\-d\fRまたは\fI\-o\fRのどちらかのみ使用できます。 .RE .PP \-stubs .RS 4 -\fIjavah\fRޥɤJava֥ȡե뤫Cޤ +\fIjavah\fRコマンドが、Javaオブジェクト・ファイルからC宣言を生成します。 .RE .PP \-verbose .RS 4 -ܺٽϤꤷեξ֤˴ؤå\fIjavah\fRޥɤ\fIɸ\fR˽Ϥޤ +詳細出力を指定し、作成ファイルの状態に関するメッセージを、\fIjavah\fRコマンドが\fI標準出力\fRに出力します。 .RE .PP \-help .RS 4 -\fIjavah\fRλˡˤĤƤΥإסåϤޤ +\fIjavah\fRの使用方法についてのヘルプ・メッセージを出力します。 .RE .PP \-version .RS 4 -\fIjavah\fRޥɤΥ꡼Ϥޤ +\fIjavah\fRコマンドのリリース情報を出力します。 .RE .PP \-jni .RS 4 -JNIΥͥƥ֡᥽åɵǽץȥפޤϥե\fIjavah\fRޥɤޤɸϤǤ뤿ᡢ\fI\-jni\fRλѤϥץǤ +JNI形式のネイティブ・メソッド機能プロトタイプを含む出力ファイルを、\fIjavah\fRコマンドが作成します。これは標準出力であるため、\fI\-jni\fRの使用はオプションです。 .RE .PP \-classpath \fIpath\fR .RS 4 -饹õ\fIjavah\fRޥɤѤѥꤷޤǥեȤޤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤǥ쥯ȥOracle SolarisξϥǡWindowsξϥߥǶڤޤѥΰŪʷϼΤ褦ˤʤޤ +クラスを探すために\fIjavah\fRコマンドが使用するパスを指定します。デフォルトまたは\fICLASSPATH\fR環境変数の設定をオーバーライドします。ディレクトリはOracle Solarisの場合はコロンで、Windowsの場合はセミコロンで区切られます。パスの一般的な形式は次のようになります。 .sp -\fBOracle Solaris\fRξ: +\fBOracle Solaris\fRの場合: .sp \&.:\fIyour\-path\fR .sp -: +例: \fI\&.:/home/avh/classes:/usr/local/java/classes\fR .sp -\fBWindows\fRξ: +\fBWindows\fRの場合: .sp \&.;\fIyour\-path\fR .sp -: +例: \fI\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR .sp -ص塢*Υ١̾ޤ९饹ѥǤϡ\fI\&.jar\fRޤ\fI\&.JAR\fRĥҤ˻ĥǥ쥯ȥΤ٤ƤΥեΥꥹȤꤹΤƱȤߤʤޤ +便宜上、*のベース名を含むクラス・パス要素は、\fI\&.jar\fRまたは\fI\&.JAR\fRを拡張子に持つディレクトリ内のすべてのファイルのリストを指定するのと同等とみなされます。 .sp -ȤСǥ쥯ȥ\fImydir\fR\fIa\&.jar\fR\fIb\&.JAR\fRޤޤƤ硢饹ѥ\fImydir/*\fR\fIA\fR\fI\&.jar:b\&.JAR\fRŸޤJARեν֤̤ȤʤޤΥꥹȤˤϡեޤᡢꤵ줿ǥ쥯ȥΤ٤ƤJARե뤬ޤޤޤ*ʤ륯饹ѥȥϡߤΥǥ쥯ȥΤ٤ƤJARեΥꥹȤŸޤ\fICLASSPATH\fRĶѿ⡢ˤƱͤŸޤ饹ѥΥ磻ɥɤŸϡJavaۥޥ(JVM)γ˹ԤޤJavaץϡĶ䤤礻ŸƤʤ磻ɥɤ򻲾Ȥޤ󡣤ȤС\fISystem\&.getenv("CLASSPATH")\fR򥳡뤷䤤礻Ǥ +たとえば、ディレクトリ\fImydir\fRに\fIa\&.jar\fRと\fIb\&.JAR\fRが含まれている場合、クラス・パス要素\fImydir/*\fRは\fIA\fR\fI\&.jar:b\&.JAR\fRに展開されますが、JARファイルの順番は未指定となります。このリストには、隠しファイルも含め、指定されたディレクトリ内のすべてのJARファイルが含まれます。*からなるクラス・パス・エントリは、現在のディレクトリ内のすべてのJARファイルのリストに展開されます。\fICLASSPATH\fR環境変数も、定義時には同様に展開されます。クラス・パスのワイルドカードの展開は、Java仮想マシン(JVM)の開始前に行われます。Javaプログラムは、環境を問い合せる場合を除き、展開されていないワイルドカードを参照しません。たとえば、\fISystem\&.getenv("CLASSPATH")\fRをコールして問い合せる場合です。 .RE .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹ɤѥꤷޤ֡ȥȥåס饹ϡǥեȤǤ\fIjre\elib\ert\&.jar\fR¾ΤĤJARեˤ롢Javaץåȥե륯饹Ǥ +ブートストラップ・クラスをロードするパスを指定します。ブートストラップ・クラスは、デフォルトでは\fIjre\elib\ert\&.jar\fRおよび他のいくつかのJARファイルにある、コアJavaプラットフォームを実装するクラスです。 .RE .PP \-old .RS 4 -ŤJDK 1\&.0Υإåե褦˻ꤷޤ +古いJDK 1\&.0形式のヘッダー・ファイルを生成するように指定します。 .RE .PP \-force .RS 4 -ϥե뤬˽񤭹ޤ褦˻ꤷޤ +出力ファイルが常に書き込まれるように指定します。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/javap.1 b/jdk/src/solaris/doc/sun/man/man1/ja/javap.1 index 152821dfebe..5e115dc6192 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/javap.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/javap.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: javap .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "javap" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "javap" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -javap \- 1İʾΥ饹եե֥뤷ޤ -.SH "" +javap \- 1つ以上のクラス・ファイルを逆アセンブルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,51 +64,51 @@ javap \- 1 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassfile\fR .RS 4 -νоݤȤʤ롢Ƕڤä1İʾΥ饹(DocFooter\&.classʤ)饹ѥǸФǤ륯饹򡢥ե̾ޤURL(\fIfile:///home/user/myproject/src/DocFooter\&.class\fRʤ)ǻǤޤ +注釈の処理対象となる、空白で区切った1つ以上のクラス(DocFooter\&.classなど)。クラス・パスで検出できるクラスを、ファイル名またはURL(\fIfile:///home/user/myproject/src/DocFooter\&.class\fRなど)で指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjavap\fRޥɤϡ1ĤޤʣΥ饹եե֥뤷ޤνϤϻꤹ륪ץˤۤʤޤץꤷʤ硢\fIjavap\fRޥɤϡΥѥåϤ줿饹protectedpublicΥեɤȥ᥽åɤϤޤ\fIjavap\fRޥɤϤνϤ\fIɸ\fRɽޤ -.SH "ץ" +\fIjavap\fRコマンドは、1つまたは複数のクラス・ファイルを逆アセンブルします。その出力は指定するオプションにより異なります。オプションを指定しない場合、\fIjavap\fRコマンドは、そのパッケージ、渡されたクラスのprotectedおよびpublicのフィールドとメソッドを出力します。\fIjavap\fRコマンドはその出力を\fI標準出力\fRに表示します。 +.SH "オプション" .PP \-help, \-\-help, \-? .RS 4 -\fIjavap\fRޥɤˤĤƤΥإסåϤޤ +\fIjavap\fRコマンドについてのヘルプ・メッセージを出力します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-l .RS 4 -ֹȥѿɽϤޤ +行番号とローカル変数表を出力します。 .RE .PP \-public .RS 4 -public饹ӥСΤɽޤ +publicクラスおよびメンバーのみ表示します。 .RE .PP \-protected .RS 4 -protectedpublicΥ饹ȥСΤߤɽޤ +protectedおよびpublicのクラスとメンバーのみを表示します。 .RE .PP \-private, \-p .RS 4 -٤ƤΥ饹ȥСɽޤ +すべてのクラスとメンバーを表示します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤵ줿ץJVMϤޤ򼨤ޤ +指定されたオプションをJVMに渡します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -120,51 +120,51 @@ javap \-J\-Djava\&.security\&.manager \-J\-Djava\&.security\&.policy=MyPolicy My .if n \{\ .RE .\} -JVMץξܺ٤ϡޥɤΥޥ˥奢򻲾ȤƤ +JVMオプションの詳細は、コマンドのマニュアルを参照してください。 .RE .PP \-s .RS 4 -η˥Ϥޤ +内部の型シグニチャを出力します。 .RE .PP \-sysinfo .RS 4 -Υ饹Υƥ(ѥաMD5ϥå)ɽޤ +処理中のクラスのシステム情報(パス、サイズ、日付、MD5ハッシュ)を表示します。 .RE .PP \-constants .RS 4 -\fIstatic final\fRɽޤ +\fIstatic final\fR定数を表示します。 .RE .PP \-c .RS 4 -饹γƥ᥽åɤΤ˵ե֥뤵륳ɡʤJavaХȥɤʤ̿ɽޤ +クラスの各メソッドのために逆アセンブルされるコード、すなわちJavaバイトコードからなる命令を表示します。 .RE .PP \-verbose .RS 4 -᥽åɤΥålocalsargumentsοϤޤ +メソッドのスタック・サイズ、localsとargumentsの数を出力します。 .RE .PP \-classpath \fIpath\fR .RS 4 -饹õ\fIjavap\fRޥɤѤѥꤷޤǥեȤޤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤ +クラスを探すために\fIjavap\fRコマンドが使用するパスを指定します。デフォルトまたは\fICLASSPATH\fR環境変数の設定をオーバーライドします。 .RE .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹ɤѥꤷޤ֡ȥȥåס饹ϡǥեȤǤ\fIjre/lib/rt\&.jar\fR¾ΤĤJARեˤ롢Javaץåȥե륯饹Ǥ +ブートストラップ・クラスをロードするパスを指定します。ブートストラップ・クラスは、デフォルトでは\fIjre/lib/rt\&.jar\fRおよび他のいくつかのJARファイルにある、コアJavaプラットフォームを実装するクラスです。 .RE .PP \-extdir \fIdirs\fR .RS 4 -󥹥ȡ뤵줿ĥǽ򸡺򥪡С饤ɤޤĥǽΥǥեȰ֤\fIjava\&.ext\&.dirs\fRǤ +インストールされた拡張機能を検索する場所をオーバーライドします。拡張機能のデフォルト位置は\fIjava\&.ext\&.dirs\fRです。 .RE -.SH "" +.SH "例" .PP -\fIDocFooter\fR饹򥳥ѥ뤷ޤ +次の\fIDocFooter\fRクラスをコンパイルします。 .sp .if n \{\ .RS 4 @@ -193,7 +193,7 @@ public class DocFooter extends Applet { .RE .\} .PP -\fIjavap DocFooter\&.class\fRޥɤνϤϼޤ +\fIjavap DocFooter\&.class\fRコマンドからの出力は次を生成します。 .sp .if n \{\ .RS 4 @@ -212,7 +212,7 @@ public class DocFooter extends java\&.applet\&.Applet { .RE .\} .PP -\fIjavap \-c DocFooter\&.class\fRޥɤνϤϼޤ +\fIjavap \-c DocFooter\&.class\fRコマンドからの出力は次を生成します。 .sp .if n \{\ .RS 4 @@ -283,7 +283,7 @@ java/awt/Graphics\&.drawString:(Ljava/lang/String;II)V .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 index d79de5a2d19..7dff3400c42 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jcmd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jcmd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jcmd" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jcmd" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jcmd \- ¹Javaۥޥ(JVM)˿ǥޥɡꥯȤޤ -.SH "" +jcmd \- 実行中のJava仮想マシン(JVM)に診断コマンド・リクエストを送信します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -91,53 +91,53 @@ jcmd \- .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIjcmd\fR桼ƥƥϡJVM˿ǥޥɡꥯȤ뤿˻ѤޤJVMƯƤΤƱޥǻѤJVMεư˻ѤΤƱͭ桼ӥ롼׼̻ҤäƤɬפޤ +\fIjcmd\fRユーティリティは、JVMに診断コマンド・リクエストを送信するために使用されます。これはJVMが稼働しているのと同じマシンで使用し、JVMの起動に使用したものと同じ有効ユーザーおよびグループ識別子を持っている必要があります。 .PP -\fB:\fR -⡼ȡޥ󤫤顢ޤ̤μ̻Ҥǿǥޥɤưˤϡ\fIcom\&.sun\&.management\&.DiagnosticCommandMBean\fR󥿥եѤǤޤ\fIDiagnosticCommandMBean\fR󥿥եξܺ٤ϡhttp://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.htmlˤAPIɥȤ򻲾ȤƤ +\fB注意:\fR +リモート・マシンから、または別の識別子で診断コマンドを起動するには、\fIcom\&.sun\&.management\&.DiagnosticCommandMBean\fRインタフェースを使用できます。\fIDiagnosticCommandMBean\fRインタフェースの詳細は、http://download\&.java\&.net/jdk8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean\&.htmlにあるAPIドキュメントを参照してください。 .PP -\fIjcmd\fRʤޤ\fI\- l\fRץꤷƼ¹Ԥϡ¹Javaץ̻ҤΥꥹȤᥤ󡦥饹ӥץεư˻Ѥ줿ޥɥ饤ȤȤ˽Ϥޤ\fI\-h\fRޤ\fI\-help\fRץꤷ\fIjcmd\fR¹ԤȡġΥإסåϤޤ +\fIjcmd\fRを引数なしまたは\fI\- l\fRオプションを指定して実行した場合は、実行中のJavaプロセス識別子のリストが、メイン・クラスおよびプロセスの起動に使用されたコマンドライン引数とともに出力されます。\fI\-h\fRまたは\fI\-help\fRオプションを指定して\fIjcmd\fRを実行すると、ツールのヘルプ・メッセージが出力されます。 .PP -ץ̻(\fIpid\fR)ޤϥᥤ󡦥饹(\fImain\-class\fR)ǽΰȤƻꤷ硢\fIjcmd\fRϡ̻ҤꤷJavaץˡᥤ󡦥饹̾ꤷϤ٤ƤJavaץ˿ǥޥɡꥯȤޤץ̻ҤȤ\fI0\fRꤷơ٤ƤλѲǽJavaץ˿ǥޥɡꥯȤ뤳ȤǤޤǥޥɡꥯȤȤơΤ줫Ѥޤ +プロセス識別子(\fIpid\fR)またはメイン・クラス(\fImain\-class\fR)を最初の引数として指定した場合、\fIjcmd\fRは、識別子を指定した場合はJavaプロセスに、メイン・クラスの名前を指定した場合はすべてのJavaプロセスに診断コマンド・リクエストを送信します。プロセス識別子として\fI0\fRを指定して、すべての使用可能なJavaプロセスに診断コマンド・リクエストを送信することもできます。診断コマンド・リクエストとして、次のいずれかを使用します。 .PP Perfcounter\&.print .RS 4 -ꤷJavaץǻѲǽʥѥեޥ󥹡󥿤Ϥޤѥեޥ󥹡󥿤ΥꥹȤJavaץˤäưۤʤ礬ޤ +指定したJavaプロセスで使用可能なパフォーマンス・カウンタが出力されます。パフォーマンス・カウンタのリストはJavaプロセスによって異なる場合があります。 .RE .PP \-f \fIfilename\fR .RS 4 -ǥޥɤɤ߼ꡢꤷJavaץե̾\fI\-f\fRץǤΤ߻Ѥޤեγƥޥɤϡ1ԤǵҤɬפޤֹ浭(\fI#\fR)ǻϤޤԤ̵뤵ޤ٤ƤιԤɤ߼뤫\fIstop\fRɤޤԤɤ߼ȡեνλޤ +診断コマンドを読み取り、指定したJavaプロセスに送信するファイルの名前。\fI\-f\fRオプションでのみ使用します。ファイル内の各コマンドは、1行で記述する必要があります。番号記号(\fI#\fR)で始まる行は無視されます。すべての行が読み取られるか、\fIstop\fRキーワードを含む行が読み取られると、ファイルの処理が終了します。 .RE .PP \fIcommand\fR [\fIarguments\fR] .RS 4 -ꤵ줿Javaץ륳ޥɡꤷץǻѤǤǥޥɤΥꥹȤϡΥץФ\fIhelp\fRޥɤɽޤƿǥޥɤȼΰåȤޤޥɤʸӻѲǽʰΥꥹȤɽˤϡ\fIhelp\fRޥɤΰȤƥޥ̾Ѥޤ +指定されたJavaプロセスに送信するコマンド。指定したプロセスで使用できる診断コマンドのリストは、このプロセスに対して\fIhelp\fRコマンドを送信すれば表示されます。各診断コマンドに独自の引数セットがあります。コマンドの説明、構文および使用可能な引数のリストを表示するには、\fIhelp\fRコマンドの引数としてコマンド名を使用します。 .sp -\fB:\fR -˥ڡޤޤƤϡŰޤŰ(\fI\*(Aq\fRޤ\fI"\fR)ǰϤɬפޤäơڥ졼ƥ󥰡ƥࡦ뤬ʤ褦ˡХåå(\fI\e\fR)ǰŰޤŰ򥨥פɬפޤޤϡΰŰǰϤǤ顢ŰǰϤळȤǤޤ(ޤŰǰϤǤ顢ŰǰϤ) +\fB注意:\fR +引数にスペースが含まれている場合は、一重引用符または二重引用符(\fI\*(Aq\fRまたは\fI"\fR)で囲む必要があります。加えて、オペレーティング・システム・シェルが引用符を処理しないように、バックスラッシュ(\fI\e\fR)で一重引用符または二重引用符をエスケープする必要があります。または、これらの引数を一重引用符で囲んでから、二重引用符で囲むこともできます(または二重引用符で囲んでから、一重引用符で囲む)。 .RE -.SH "ץ" +.SH "オプション" .PP -ƥץϸߤ¾ŪǤ +各オプションは互いに排他的です。 .PP \-f \fIfilename\fR .RS 4 -ꤵ줿ե뤫饳ޥɤɤ߼ޤΥץϡǽΰȤƥץ̻Ҥޤϥᥤ󡦥饹ꤹˤΤ߻ѤǤޤեγƥޥɤϡ1ԤǵҤɬפޤֹ浭(\fI#\fR)ǻϤޤԤ̵뤵ޤ٤ƤιԤɤ߼뤫\fIstop\fRɤޤԤɤ߼ȡեνλޤ +指定されたファイルからコマンドを読み取ります。このオプションは、最初の引数としてプロセス識別子またはメイン・クラスを指定する場合にのみ使用できます。ファイル内の各コマンドは、1行で記述する必要があります。番号記号(\fI#\fR)で始まる行は無視されます。すべての行が読み取られるか、\fIstop\fRキーワードを含む行が読み取られると、ファイルの処理が終了します。 .RE .PP \-h, \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-l .RS 4 -¹Javaץ̻ҤΥꥹȤᥤ󡦥饹ӥޥɥ饤ȤȤ˽Ϥޤ +実行中のJavaプロセス識別子のリストをメイン・クラスおよびコマンドライン引数とともに出力します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 index 426fb365ba8..1ba103b7db0 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jconsole .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaȥ֥륷塼ƥ󥰡ץե󥰡˥󥰤Ӵġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaトラブルシューティング、プロファイリング、モニタリングおよび管理ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jconsole" "1" "2013ǯ1121" "JDK 8" "Javaȥ֥륷塼ƥ󥰡ץե󥰡˥" +.TH "jconsole" "1" "2013年11月21日" "JDK 8" "Javaトラブルシューティング、プロファイリング、モニタリン" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jconsole \- Javaץꥱƻ뤪Ӵ뤿Υե롦󥽡򳫻Ϥޤ -.SH "" +jconsole \- Javaアプリケーションを監視および管理するためのグラフィカル・コンソールを開始します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,56 +64,56 @@ jconsole \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP connection = \fIpid\fR | \fIhost\fR:\fIport\fR | \fIjmxURL\fR .RS 4 -\fIpid\fRͤϥJavaۥޥ(JVM)ΥץIDǤJVM\fIjconsole\fRޥɤ¹ԤƤ桼IDƱ桼IDǼ¹Ԥɬפޤ\fIhost:port\fRͤJVMưƤۥȡƥ̾ȡJVMϤȤ˥ƥࡦץѥƥ\fIcom\&.sun\&.management\&.jmxremote\&.port\fRǻꤷݡֹǤ\fIjmxUrl\fRͤϡJMXServiceURLǵҤƤ롢³JMXȤΥɥ쥹Ǥ +\fIpid\fR値はローカルのJava仮想マシン(JVM)のプロセスIDです。JVMは\fIjconsole\fRコマンドを実行しているユーザーIDと同じユーザーIDで実行する必要があります。\fIhost:port\fR値はJVMが動作しているホスト・システムの名前と、JVMが開始したときにシステム・プロパティ\fIcom\&.sun\&.management\&.jmxremote\&.port\fRで指定したポート番号です。\fIjmxUrl\fR値は、JMXServiceURLで記述されている、接続されるJMXエージェントのアドレスです。 .sp -\fIconnection\fRѥ᡼ξܺ٤ϡJMXƥΥѤ˥󥰤Ӵ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html)򻲾ȤƤ +\fIconnection\fRパラメータの詳細は、JMXテクノロジを使用したモニタリングおよび管理 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html)を参照してください .sp -\fIJMXServiceURL\fR饹( -http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html)⻲ȤƤ +\fIJMXServiceURL\fRクラスの説明( +http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html)も参照してください .RE -.SH "" +.SH "説明" .PP -\fIjconsole\fRޥɤϡ롦ޥޤϥ⡼ȡޥJavaץꥱȲۥޥδƻȴԤե롦󥽡롦ġưޤ +\fIjconsole\fRコマンドは、ローカル・マシンまたはリモート・マシン上のJavaアプリケーションと仮想マシンの監視と管理を行うグラフィカル・コンソール・ツールを起動します。 .PP -WindowsǤϡ\fIjconsole\fRޥɤϥ󥽡롦ɥȴϢդƤޤ󡣤\fIjconsole\fRޥɤԤȡ顼򼨤ܥåɽޤ -.SH "ץ" +Windows上では、\fIjconsole\fRコマンドはコンソール・ウィンドウと関連付けられていません。ただし、\fIjconsole\fRコマンドが失敗すると、エラー情報を示すダイアログ・ボックスが表示されます。 +.SH "オプション" .PP \-interval\fI=n\fR .RS 4 -ֳ֤\fIn\fRäꤷޤ(ǥեȤ4) +更新間隔を\fIn\fR秒に設定します(デフォルトは4秒)。 .RE .PP \-notile .RS 4 -ǽ˥ɥ򥿥󥰤ޤ(ʣ³ξ) +最初にウィンドウをタイリングしません(複数接続の場合)。 .RE .PP \-pluginpath \fIplugins\fR .RS 4 -\fIJConsole\fRץ饰򸡺ǥ쥯ȥޤJARեΥꥹȤꤷޤ\fIplugins\fRѥˤ\fIMETA\-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRȤ̾ΥץХեޤǤɬפꡢˤϥץ饰󤴤Ȥ1ԤޤޤƤޤιԤ\fIcom\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fR饹Ƥ륯饹δ饹̾ꤷޤ +\fIJConsole\fRプラグインを検索するディレクトリまたはJARファイルのリストを指定します。\fIplugins\fRパスには\fIMETA\-INF/services/com\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRという名前のプロバイダ構成ファイルを含んでいる必要があり、これにはプラグインごとに1行が含まれています。その行は\fIcom\&.sun\&.tools\&.jconsole\&.JConsolePlugin\fRクラスを実装しているクラスの完全修飾クラス名を指定します。 .RE .PP \-version .RS 4 -꡼ɽƽλޤ +リリース情報を表示して終了します。 .RE .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjconsole\fRޥɤ¹ԤJVM\fIflag\fRϤޤ +\fIjconsole\fRコマンドを実行したJVMに\fIflag\fRを渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -123,7 +123,7 @@ Windows .sp -1 .IP \(bu 2.3 .\} -JConsoleλ +JConsoleの使用 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/jconsole\&.html) .RE .sp @@ -135,7 +135,7 @@ JConsole .sp -1 .IP \(bu 2.3 .\} -JMXƥΥѤ˥󥰤Ӵ +JMXテクノロジを使用したモニタリングおよび管理 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/management/agent\&.html) .RE @@ -148,7 +148,7 @@ JMX .sp -1 .IP \(bu 2.3 .\} -\fIJMXServiceURL\fR饹( +\fIJMXServiceURL\fRクラスの説明( http://docs\&.oracle\&.com/javase/8/docs/api/javax/management/remote/JMXServiceURL\&.html) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 index f7bcabdec2f..fe08770ee07 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jdb .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jdb" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jdb" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jdb \- JavaץåȥեࡦץԶ򸡽Фӽޤ -.SH "" +jdb \- Javaプラットフォーム・プログラムの不具合を検出および修正します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,25 +64,25 @@ jdb \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclass\fRname .RS 4 -ǥХåᥤ󡦥饹̾ +デバッグするメイン・クラスの名前。 .RE .PP \fIarguments\fR .RS 4 -class\fImain()\fR᥽åɤϤ +classの\fImain()\fRメソッドに渡す引数。 .RE -.SH "" +.SH "説明" .PP -JavaǥХå(JDB)ϡJava饹Ѥδñʥޥɥ饤󡦥ǥХåǤ\fIjdb\fRޥɤȤΥץJDBƤӽФޤ\fIjdb\fRޥɤϡJDBA (Java Platform Debugger Architecture)Ū˼¹Ԥޤϥ⡼ȤJavaۥޥ(JVM)θȥǥХåԤȤǤޤJava Platform Debugger Architecture (JDBA) -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)򻲾ȤƤ -.SS "JDBåγ" +Javaデバッガ(JDB)は、Javaクラス用の簡単なコマンドライン・デバッガです。\fIjdb\fRコマンドとそのオプションはJDBを呼び出します。\fIjdb\fRコマンドは、JDBA (Java Platform Debugger Architecture)を視覚的に実行し、ローカルまたはリモートのJava仮想マシン(JVM)の検査とデバッグを行うことができます。Java Platform Debugger Architecture (JDBA) +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)を参照してください。 +.SS "JDBセッションの開始" .PP -JDBå򳫻Ϥˤ͡ˡޤǤˤ˻ѤΤϡǥХå륢ץꥱΥᥤ󡦥饹ѤơJDB鿷JVMưˡǤޥɥ饤ǡ\fIjava\fRޥɤΤ\fIjdb\fRޥɤϤޤȤСץꥱΥᥤ󡦥饹\fIMyClass\fRξϡJDBĶǥǥХåȤ˼ΥޥɤѤޤ +JDBセッションを開始するには様々な方法があります。最も頻繁に使用されるのは、デバッグするアプリケーションのメイン・クラスを使用して、JDBから新しいJVMを起動する方法です。コマンドラインで、\fIjava\fRコマンドのかわりに\fIjdb\fRコマンドを入力します。たとえば、アプリケーションのメイン・クラスが\fIMyClass\fRの場合は、JDB環境でデバッグするときに次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -94,9 +94,9 @@ jdb MyClass .RE .\} .PP -ˡǵưȡ\fIjdb\fRޥɤϡꤵ줿ѥ᡼Ѥ2ܤJVMƤӽФޤˡꤵ줿饹ɤơ饹κǽ̿¹ԤJVMߤޤ +この方法で起動すると、\fIjdb\fRコマンドは、指定されたパラメータを使用して2つ目のJVMを呼び出します。次に、指定されたクラスをロードして、クラスの最初の命令を実行する前にJVMを停止させます。 .PP -\fIjdb\fRޥɤΤ⤦1ĤλˡϡǤ˼¹JVMjdb³뤳ȤǤ\fIjdb\fRޥɤ³VM򡢤μ¹˵ư뤿ιʸ򼡤˼ޤϡץǥХåѥ饤֥ɤ³μꤷޤ +\fIjdb\fRコマンドのもう1つの使用方法は、すでに実行中のJVMにjdbを接続することです。\fIjdb\fRコマンドが接続するVMを、その実行中に起動するための構文を次に示します。これは、インプロセス・デバッグ用ライブラリをロードし、接続の種類を指定します。 .sp .if n \{\ .RS 4 @@ -108,7 +108,7 @@ java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass .RE .\} .PP -ΥޥɤѤơ\fIjdb\fRޥɤJVM³Ǥޤ +次のコマンドを使用して、\fIjdb\fRコマンドをJVMに接続できます。 .sp .if n \{\ .RS 4 @@ -120,36 +120,36 @@ jdb \-attach 8000 .RE .\} .PP -ξ硢\fIjdb\fRޥɤϿJVMư뤫˴¸JVM³뤿ᡢ\fIjdb\fRޥɥ饤\fIMyClass\fRϻꤷޤ +この場合、\fIjdb\fRコマンドは新しいJVMを起動するかわりに既存のJVMに接続されるため、\fIjdb\fRコマンドラインに\fIMyClass\fR引数は指定しません。 .PP -ǥХåJVM³ˤ¾ˤ͡ˡꡢ٤\fIjdb\fRޥɤǥݡȤƤޤ³ץˤĤƤϡJava Platform Debugger ArchitectureΥɥȤ򻲾ȤƤ -.SS "jdbޥ" +デバッガをJVMに接続するには他にも様々な方法があり、すべて\fIjdb\fRコマンドでサポートされています。接続オプションについては、Java Platform Debugger Architectureのドキュメントを参照してください。 +.SS "基本jdbコマンド" .PP -Ū\fIjdb\fRޥɤΰ򼨤ޤJDBݡȤ륳ޥɤϤʳˤ⤢ꡢ\fI\-help\fRץѤɽǤޤ +基本的な\fIjdb\fRコマンドの一覧を示します。JDBがサポートするコマンドはこれ以外にもあり、それらは\fI\-help\fRオプションを使用して表示できます。 .PP -helpޤ? +helpまたは? .RS 4 -\fIhelp\fRޤ\fI?\fRޥɤϡǧ줿ޥɤΥꥹȤ˴ʷդɽޤ +\fIhelp\fRまたは\fI?\fRコマンドは、認識されたコマンドのリストに簡潔な説明を付けて表示します。 .RE .PP run .RS 4 -JDBưƥ֥졼ݥȤꤷȤˡ\fIrun\fRޥɤѤơǥХå륢ץꥱμ¹Ԥ򳫻ϤǤޤ\fIrun\fRޥɤϡ¸VM³ƤȤϰۤʤꡢǥХå륢ץꥱ\fIjdb\fR鵯ưȤˤΤ߻ѤǤޤ +JDBを起動してブレークポイントを設定したあとに、\fIrun\fRコマンドを使用して、デバッグするアプリケーションの実行を開始できます。\fIrun\fRコマンドは、既存のVMに接続している場合とは異なり、デバッグするアプリケーションが\fIjdb\fRから起動したときにのみ使用できます。 .RE .PP cont .RS 4 -֥졼ݥȡ㳰ޤϥƥå׼¹ԤθǡǥХå륢ץꥱμ¹Ԥ³ޤ +ブレークポイント、例外、またはステップ実行の後で、デバッグするアプリケーションの実行を継続します。 .RE .PP print .RS 4 -Java֥ȤӥץߥƥͤɽޤץߥƥַѿޤϥեɤξˤϡºݤͤϤޤ֥ȤξˤϡûϤޤ֥Ȥξܺ٤ˡõˤϡdumpޥɤ򻲾ȤƤ +Javaオブジェクトおよびプリミティブ値を表示します。プリミティブ型の変数またはフィールドの場合には、実際の値が出力されます。オブジェクトの場合には、短い説明が出力されます。オブジェクトの詳細を取得する方法を探すには、dumpコマンドを参照してください。 .sp -\fB:\fR -ѿɽˤϡޤǤ륯饹\fIjavac \-g\fRץѤƥѥ뤵Ƥɬפޤ +\fB注意:\fR +ローカル変数を表示するには、含んでいるクラスが\fIjavac \-g\fRオプションを使用してコンパイルされている必要があります。 .sp -\fIprint\fRޥɤϡ˼褦ʡ᥽åɸƽФѤΤʤɡ¿δñJava򥵥ݡȤޤ +\fIprint\fRコマンドは、次に示すような、メソッド呼出しを使用したものなど、多くの簡単なJava式をサポートします。 .sp .if n \{\ .RS 4 @@ -168,12 +168,12 @@ print new java\&.lang\&.String("Hello")\&.length() .PP dump .RS 4 -ץߥƥͤξ硢\fIdump\fRޥɤ\fIprint\fRޥɤƱǤ֥Ȥξ硢\fIdump\fRޥɤǤϡ֥ƤƥեɤθߤͤϤޤstaticեɤinstanceեɤϤޤ\fIdump\fRޥɤǤϡ\fIprint\fRޥɤƱݡȤޤ +プリミティブ値の場合、\fIdump\fRコマンドは\fIprint\fRコマンドと同一です。オブジェクトの場合、\fIdump\fRコマンドでは、オブジェクト内に定義されている各フィールドの現在の値が出力されます。staticフィールドとinstanceフィールドが出力されます。\fIdump\fRコマンドでは、\fIprint\fRコマンドと同じ式がサポートされます。 .RE .PP threads .RS 4 -߼¹ΥåɤɽޤåɤȤˡ̾ȸߤξ֡¾Υޥɤ˻ѤǤ륤ǥåϤޤǤϡåɡǥå4Ǥꡢåɤ\fIjava\&.lang\&.Thread\fRΥ󥹥󥹤ǡåɤ̾\fImain\fRǤꡢ߼¹Ǥ +現在実行中のスレッドを一覧表示します。スレッドごとに、名前と現在の状態、および他のコマンドに使用できるインデックスが出力されます。この例では、スレッド・インデックスは4であり、スレッドは\fIjava\&.lang\&.Thread\fRのインスタンスで、スレッドの名前は\fImain\fRであり、現在実行中です。 .sp .if n \{\ .RS 4 @@ -188,20 +188,20 @@ threads .PP thread .RS 4 -ߤΥåɤˤ륹åɤ򤷤ޤ¿\fIjdb\fRޥɤϡߤΥåɤ˴ŤƼ¹ԤޤåɤϡthreadsޥɤåɡǥåȤȤ˻ꤷޤ +現在のスレッドにするスレッドを選択します。多くの\fIjdb\fRコマンドは、現在のスレッドの設定に基づいて実行されます。スレッドは、threadsコマンドで説明したスレッド・インデックスとともに指定します。 .RE .PP where .RS 4 -ꤷʤ\fIwhere\fRޥɤ¹ԤȡߤΥåɤΥåפޤ\fIwhere\fR -\fIall\fRޥɤϡߤΥåɡ롼פˤ륹åɤΥå򤹤٤ƥפޤ\fIwhere\fR -\fIthreadindex\fRޥɤϡꤵ줿åɤΥåפޤ +引数を指定しないで\fIwhere\fRコマンドを実行すると、現在のスレッドのスタックがダンプされます。\fIwhere\fR +\fIall\fRコマンドは、現在のスレッド・グループにあるスレッドのスタックをすべてダンプします。\fIwhere\fR +\fIthreadindex\fRコマンドは、指定されたスレッドのスタックをダンプします。 .sp -ߤΥåɤ(֥졼ݥȤ\fIsuspend\fRޥɤˤä)ǤƤϡѿȥեɤ\fIprint\fRޥɤ\fIdump\fRޥɤɽǤޤ\fIup\fRޥɤ\fIdown\fRޥɤǡɤΥåե졼򸽺ߤΥåե졼ˤ뤫֤ȤǤޤ +現在のスレッドが(ブレークポイントか\fIsuspend\fRコマンドによって)中断している場合は、ローカル変数とフィールドは\fIprint\fRコマンドと\fIdump\fRコマンドで表示できます。\fIup\fRコマンドと\fIdown\fRコマンドで、どのスタック・フレームを現在のスタック・フレームにするかを選ぶことができます。 .RE -.SS "֥졼ݥ" +.SS "ブレークポイント" .PP -֥졼ݥȤϡֹޤϥ᥽åɤκǽ̿JDBǤޤ򼨤ޤ +ブレークポイントは、行番号またはメソッドの最初の命令でJDBに設定できます。次に例を示します。 .sp .RS 4 .ie n \{\ @@ -211,7 +211,7 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop at MyClass:22\fRϡ\fIMyClass\fRޤޤ륽ե22ܤκǽ̿˥֥졼ݥȤꤷޤ +コマンド\fIstop at MyClass:22\fRは、\fIMyClass\fRが含まれるソース・ファイルの22行目の最初の命令にブレークポイントを設定します。 .RE .sp .RS 4 @@ -222,7 +222,7 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop in java\&.lang\&.String\&.length\fRϡ᥽å\fIjava\&.lang\&.String\&.length\fRƬ˥֥졼ݥȤꤷޤ +コマンド\fIstop in java\&.lang\&.String\&.length\fRは、メソッド\fIjava\&.lang\&.String\&.length\fRの先頭にブレークポイントを設定します。 .RE .sp .RS 4 @@ -233,106 +233,106 @@ where .sp -1 .IP \(bu 2.3 .\} -ޥ\fIstop in MyClass\&.<clinit>\fRϡ\fI<clinit>\fRѤ\fIMyClass\fRŪɤꤷޤ +コマンド\fIstop in MyClass\&.<clinit>\fRは、\fI<clinit>\fRを使用して\fIMyClass\fRの静的初期化コードを特定します。 .RE .PP -᥽åɤСɤƤˤϡ᥽åɤΰηꤷơ֥졼ݥȤФŬڤʥ᥽åɤ򤵤褦ˤɬפޤȤС\fIMyClass\&.myMethod(int,java\&.lang\&.String)\fRޤ\fIMyClass\&.myMethod()\fRȻꤷޤ +メソッドがオーバーロードされている場合には、メソッドの引数の型も指定して、ブレークポイントに対して適切なメソッドが選択されるようにする必要があります。たとえば、\fIMyClass\&.myMethod(int,java\&.lang\&.String)\fRまたは\fIMyClass\&.myMethod()\fRと指定します。 .PP -\fIclear\fRޥɤϡ\fIclear MyClass:45\fRΤ褦ʹʸѤƥ֥졼ݥȤޤ\fIclear\fRѤ뤫ꤷʤ\fIstop\fRޥɤѤȡꤵƤ뤹٤ƤΥ֥졼ݥȤɽޤ\fIcont\fRޥɤϼ¹Ԥ³ޤ -.SS "ƥå׼¹" +\fIclear\fRコマンドは、\fIclear MyClass:45\fRのような構文を使用してブレークポイントを削除します。\fIclear\fRを使用するか、引数を指定しないで\fIstop\fRコマンドを使用すると、現在設定されているすべてのブレークポイントが表示されます。\fIcont\fRコマンドは実行を継続します。 +.SS "ステップ実行" .PP -\fIstep\fRޥɤϡߤΥåե졼ޤϸƤӽФ줿᥽åǡιԤ¹Ԥޤ\fInext\fRޥɤϡߤΥåե졼μιԤ¹Ԥޤ -.SS "㳰" +\fIstep\fRコマンドは、現在のスタック・フレームまたは呼び出されたメソッド内で、次の行を実行します。\fInext\fRコマンドは、現在のスタック・フレームの次の行を実行します。 +.SS "例外" .PP -Ƥ륹åɤθƽФåΤɤˤ\fIcatch\fRʸʤ㳰ȯȡJVM̾㳰ȥ졼ϤƽλޤJDBĶǼ¹ԤƤϡȿΥJDB椬ޤˡ\fIjdb\fRޥɤѤ㳰θǤޤ +スローしているスレッドの呼出しスタック上のどこにも\fIcatch\fR文がない場合に例外が発生すると、JVMは通常、例外トレースを出力して終了します。ただし、JDB環境で実行している場合は、違反のスロー時にJDBに制御が戻ります。次に、\fIjdb\fRコマンドを使用して例外の原因を診断します。 .PP -ȤС\fIcatch java\&.io\&.FileNotFoundException\fRޤ\fIcatch\fR -\fImypackage\&.BigTroubleException\fRΤ褦\fIcatch\fRޥɤѤȡǥХå줿ץꥱϡ¾㳰줿Ȥߤޤ㳰Υ饹ޤϥ֥饹Υ󥹥󥹤ξϡץꥱ㳰줿ߤޤ +たとえば、\fIcatch java\&.io\&.FileNotFoundException\fRまたは\fIcatch\fR +\fImypackage\&.BigTroubleException\fRのように\fIcatch\fRコマンドを使用すると、デバッグされたアプリケーションは、他の例外がスローされたときに停止します。例外が特定のクラスまたはサブクラスのインスタンスの場合は、アプリケーションは例外がスローされた場所で停止します。 .PP -\fIignore\fRޥɤѤȡ\fIcatch\fRޥɤθ̵̤ˤʤޤ\fIignore\fRޥɤǤϡǥХåJVM㳰̵뤻ǥХåΤߤ̵뤷ޤ -.SH "ץ" +\fIignore\fRコマンドを使用すると、以前の\fIcatch\fRコマンドの効果が無効になります。\fIignore\fRコマンドでは、デバッグされるJVMは特定の例外を無視せず、デバッガのみを無視します。 +.SH "オプション" .PP -ޥɥ饤\fIjava\fRޥɤΤ\fIjdb\fRޥɤѤ硢\fIjdb\fRޥɤϡ\fI\-D\fR\fI\-classpath\fR\fI\-X\fRʤɡ\fIjava\fRޥɤƱΥץޤ\fIjdb\fRޥɤϡ¾˼ΥꥹȤˤ륪ץޤ +コマンドラインで\fIjava\fRコマンドのかわりに\fIjdb\fRコマンドを使用する場合、\fIjdb\fRコマンドは、\fI\-D\fR、\fI\-classpath\fR、\fI\-X\fRなど、\fIjava\fRコマンドと同じ数のオプションを受け入れます。\fIjdb\fRコマンドは、その他に次のリストにあるオプションを受け入れます。 .PP -ǥХåԤJVM˥ǥХå³뤿ص󶡤뤿ˡ¾Υץ󤬥ݡȤƤޤ³ؤ˴ؤܺ٤ʥɥȤϡJava Platform Debugger Architecture (JPDA) -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)򻲾ȤƤ +デバッグを行うJVMにデバッガを接続するための代替機構を提供するために、その他のオプションがサポートされています。これらの接続の代替に関する詳細なドキュメントは、Java Platform Debugger Architecture (JPDA) +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html)を参照してください .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-sourcepath \fIdir1:dir2: \&. \&. \&.\fR .RS 4 -ꤵ줿ѥѤơե򸡺ޤΥץ󤬻ꤵƤʤϡǥեȡѥΥɥå(\&.)Ѥޤ +指定されたパスを使用して、ソース・ファイルを検索します。このオプションが指定されていない場合は、デフォルト・パスのドット(\&.)が使用されます。 .RE .PP \-attach \fIaddress\fR .RS 4 -ǥեȤ³Ѥơ¹JVM˥ǥХå³ޤ +デフォルトの接続機構を使用して、実行中のJVMにデバッガを接続します。 .RE .PP \-listen \fIaddress\fR .RS 4 -¹JVMɸΥͥѤƻꤵ줿ɥ쥹³ΤԵޤ +実行中のJVMが標準のコネクタを使用して指定されたアドレスに接続するのを待機します。 .RE .PP \-launch .RS 4 -ǥХå륢ץꥱJDBεư夿˵ưޤ\fI\-launch\fRץˤꡢ\fIrun\fRޥɤɬפʤʤޤǥХå륢ץꥱϡư塢ץꥱ󡦥饹ɤľߤޤλǡɬפʥ֥졼ݥȤꤷ\fIcont\fRޥɤѤƼ¹Ԥ³Ǥޤ +デバッグするアプリケーションをJDBの起動後ただちに起動します。\fI\-launch\fRオプションにより、\fIrun\fRコマンドが必要なくなります。デバッグするアプリケーションは、起動後、初期アプリケーション・クラスがロードされる直前に停止します。その時点で、必要なブレークポイントを設定し、\fIcont\fRコマンドを使用して実行を継続できます。 .RE .PP \-listconnectors .RS 4 -JVMѤǤ륳ͥɽޤ +このJVMで利用できるコネクタを一覧表示します。 .RE .PP \-connect connector\-name:\fIname1=value1\fR .RS 4 -ɽ줿ͤȻΥͥѤƥåJVM³ޤ +一覧表示された引数の値と指定のコネクタを使用してターゲットJVMに接続します。 .RE .PP \-dbgtrace [\fIflags\fR] .RS 4 -\fIjdb\fRޥɤΥǥХåξϤޤ +\fIjdb\fRコマンドのデバッグの情報を出力します。 .RE .PP \-tclient .RS 4 -Java HotSpot VM饤ǥץꥱ¹Ԥޤ +Java HotSpot VMクライアント内でアプリケーションを実行します。 .RE .PP \-tserver .RS 4 -Java HotSpot VMСǥץꥱ¹Ԥޤ +Java HotSpot VMサーバー内でアプリケーションを実行します。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ǥХåоݤΥץž륪ץ" +.SH "デバッグ対象のプロセスに転送されるオプション" .PP \-v \-verbose[:\fIclass\fR|gc|jni] .RS 4 -Ĺ⡼ɤˤޤ +冗長モードにします。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -ƥࡦץѥƥꤷޤ +システム・プロパティを設定します。 .RE .PP \-classpath \fIdir\fR .RS 4 -饹򸡺뤿ΡǶڤäƻꤵ줿ǥ쥯ȥΥꥹȡ +クラスを検索するための、コロンで区切って指定されたディレクトリのリスト。 .RE .PP \-X\fIoption\fR .RS 4 -ɸॿåJVMץǤ +非標準ターゲットJVMオプションです。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 index 9ab6f666e0c..0dd46783822 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jdeps.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jdeps .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jdeps" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jdeps" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jdeps \- Java饹¸ʥ饤 -.SH "" +jdeps \- Javaクラス依存性アナライザ。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,99 +64,99 @@ jdeps \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclasses\fR .RS 4 -ʬϤ륯饹̾饹ѥǸФǤ륯饹򡢥ե̾ǥ쥯ȥޤJARեǻǤޤ +分析するクラスの名前。クラス・パスで検出できるクラスを、ファイル名、ディレクトリまたはJARファイルで指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjdeps\fRޥɤϡJava饹եΥѥå٥ޤϥ饹٥ΰ¸򼨤ޤϥ饹ˤϡ\fI\&.class\fRեΥѥ̾ǥ쥯ȥꡢJARե롢ޤϤ٤ƤΥ饹եʬϤ뤿δ饹̾ǤޤץˤϤꤷޤǥեȤǤϡ\fIjdeps\fRϥƥϤ˰¸طϤޤDOTǰ¸طǤޤ(\fI\-dotoutput\fRץ򻲾) -.SH "ץ" +\fIjdeps\fRコマンドは、Javaクラス・ファイルのパッケージレベルまたはクラスレベルの依存性を示します。入力クラスには、\fI\&.class\fRファイルのパス名、ディレクトリ、JARファイル、またはすべてのクラス・ファイルを分析するための完全修飾クラス名を指定できます。オプションにより出力が決定します。デフォルトでは、\fIjdeps\fRはシステム出力に依存関係を出力します。DOT言語で依存関係を生成できます(\fI\-dotoutput\fRオプションを参照)。 +.SH "オプション" .PP \-dotoutput <\fIdir\fR> .RS 4 -DOTեϤΰǥ쥯ȥꡣꤷ\fIjdeps\fR<\fIarchive\-file\-name\fR>\&.dotȤ̾ʬϺѤߥ֤Ȥ˰¸طꥹȤ1Ĥdotեִ֤ΰ¸طꥹȤsummary\&.dotȤ̾Υޥ꡼եޤ +DOTファイル出力の宛先ディレクトリ。指定した場合は\fIjdeps\fRは<\fIarchive\-file\-name\fR>\&.dotという名前の分析済みアーカイブごとに依存関係をリストする1つのdotファイルを生成し、アーカイブ間の依存関係をリストするsummary\&.dotという名前のサマリー・ファイルも生成します。 .RE .PP \-s, \-summary .RS 4 -¸طΥޥ꡼ΤߤϤޤ +依存関係のサマリーのみを出力します。 .RE .PP \-v, \-verbose .RS 4 -٤ƤΥ饹٥ΰ¸طϤޤ +すべてのクラスレベルの依存関係を出力します。 .RE .PP \-verbose:package .RS 4 -Ʊΰ¸طѥå٥ΰ¸طϤޤ +同じアーカイブ内の依存関係を除き、パッケージレベルの依存関係を出力します。 .RE .PP \-verbose:class .RS 4 -Ʊΰ¸ط饹٥ΰ¸طϤޤ +同じアーカイブ内の依存関係を除き、クラスレベルの依存関係を出力します。 .RE .PP \-cp <\fIpath\fR>, \-classpath <\fIpath\fR> .RS 4 -饹եθꤷޤ +クラス・ファイルの検索場所を指定します。 .sp -Setting the Class Path ⻲ȤƤ +Setting the Class Path も参照してください。 .RE .PP \-p <\fIpkg name\fR>, \-package <\fIpkg name\fR> .RS 4 -ꤷѥåΰ¸ط򸡽ФޤۤʤѥåФƤΥץʣǤޤ\fI\-p\fRץ\fI\-e\fRץƱ˻ꤹ뤳ȤϤǤޤ +指定したパッケージの依存関係を検出します。異なるパッケージに対してこのオプションを複数回指定できます。\fI\-p\fRオプションと\fI\-e\fRオプションを同時に指定することはできません。 .RE .PP \-e <\fIregex\fR>, \-regex <\fIregex\fR> .RS 4 -ꤷɽѥȰפѥåΰ¸ط򸡽Фޤ\fI\-p\fRץ\fI\-e\fRץƱ˻ꤹ뤳ȤϤǤޤ +指定した正規表現パターンと一致するパッケージの依存関係を検出します。\fI\-p\fRオプションと\fI\-e\fRオプションを同時に指定することはできません。 .RE .PP \-include <\fIregex\fR> .RS 4 -ʬϤѥ˰פ륯饹¤ޤΥץϡʬϤ륯饹ΥꥹȤե륿ޤ¸ط˥ѥŬѤ\fI\-p\fR\fI\-e\fRȤȤ˻ѤǤޤ +分析をパターンに一致するクラスに制限します。このオプションは、分析するクラスのリストをフィルタします。依存関係にパターンを適用する\fI\-p\fRおよび\fI\-e\fRとともに使用できます。 .RE .PP \-jdkinternals .RS 4 -JDKAPIΥ饹٥ΰ¸ط򸡽ФޤǥեȤǤϡ\fI\-include\fRץꤷʤꡢ\fI\-classpath\fRץ󤪤ϥե˻ꤵ줿٤ƤΥ饹ʬϤޤΥץϡ\fI\-p\fRץ\fI\-e\fRץ󤪤\fI\-s\fRץȤȤ˻ѤǤޤ +JDKの内部APIのクラスレベルの依存関係を検出します。デフォルトでは、\fI\-include\fRオプションを指定しないかぎり、\fI\-classpath\fRオプションおよび入力ファイルに指定されたすべてのクラスを分析します。このオプションは、\fI\-p\fRオプション、\fI\-e\fRオプションおよび\fI\-s\fRオプションとともに使用できません。 .sp -\fBٹ\fR: JDKAPIϡΥ꡼ǥǤʤʤǽޤ +\fB警告\fR: JDKの内部APIは、今後のリリースでアクセスできなくなる可能性があります。 .RE .PP \-P, \-profile .RS 4 -ѥåޤץեޤϥեɽޤ +パッケージを含むプロファイルまたはファイルを表示します。 .RE .PP \-apionly .RS 4 -եɡס᥽åɡѥ᡼ס꥿סå줿㳰פޤѥ֥å饹\fIpublic\fR\fIprotected\fRСν̾ΰ¸طʤɡʬϤAPI¤ޤ +フィールド・タイプ、メソッド・パラメータ・タイプ、戻りタイプ、チェックされた例外タイプを含むパブリック・クラスの\fIpublic\fRおよび\fIprotected\fRメンバーの署名からの依存関係など、分析をAPIに制限します。 .RE .PP \-R, \-recursive .RS 4 -٤Ƥΰ¸طƵŪޤ +すべての依存関係を再帰的に走査します。 .RE .PP \-version .RS 4 -СϤޤ +バージョン情報を出力します。 .RE .PP \-h, \-?, \-help .RS 4 -\fIjdeps\fR˴ؤإסåϤޤ +\fIjdeps\fRに関するヘルプ・メッセージを出力します。 .RE -.SH "" +.SH "例" .PP -Notepad\&.jarΰ¸طʬϡ +Notepad\&.jarの依存関係の分析。 .sp .if n \{\ .RS 4 @@ -185,7 +185,7 @@ demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\-Pޤ\-profileץѤơĢ¸ץեɽޤ +\-Pまたは\-profileオプションを使用して、メモ帳が依存するプロファイルを表示します。 .sp .if n \{\ .RS 4 @@ -213,7 +213,7 @@ demo/jfc/Notepad/Notepad\&.jar \-> /usr/java/jre/lib/rt\&.jar (Full JRE) .RE .\} .PP -tools\&.jarե\fIcom\&.sun\&.tools\&.jdeps\&.Main\fR饹ʤɡΥ饹ѥΥ饹ľܰ¸طʬϡ +tools\&.jarファイル内の\fIcom\&.sun\&.tools\&.jdeps\&.Main\fRクラスなど、特定のクラスパス内の特定のクラスの直接依存関係の分析。 .sp .if n \{\ .RS 4 @@ -229,7 +229,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\fI\-verbose:class\fRץѤơ饹٥¸ط򸡺뤫\fI\-v\fRޤ\fI\-verbose\fRץѤƱJARե뤫ΰ¸طޤޤ +\fI\-verbose:class\fRオプションを使用して、クラスレベル依存関係を検索するか\fI\-v\fRまたは\fI\-verbose\fRオプションを使用して同じJARファイルからの依存関係を含めます。 .sp .if n \{\ .RS 4 @@ -249,7 +249,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -\fI\-R\fRޤ\fI\-recursive\fRץѤơ\fIcom\&.sun\&.tools\&.jdeps\&.Main\fR饹οŪʰ¸طʬϤޤ +\fI\-R\fRまたは\fI\-recursive\fRオプションを使用して、\fIcom\&.sun\&.tools\&.jdeps\&.Main\fRクラスの推移的な依存関係を分析します。 .sp .if n \{\ .RS 4 @@ -305,7 +305,7 @@ lib/tools\&.jar \-> /usr/java/jre/lib/rt\&.jar .RE .\} .PP -Ģǥΰ¸طdotեޤ +メモ帳デモの依存関係のdotファイルを生成します。 .sp .if n \{\ .RS 4 @@ -317,7 +317,7 @@ $ jdeps \-dotoutput dot demo/jfc/Notepad/Notepad\&.jar .RE .\} .PP -\fIjdeps\fRϡ\fI\-dotoutput\fRץǻꤵ줿dotǥ쥯ȥ<\fIfilename\fR>\&.dotȤ̾dotեJARե뤴Ȥ˺JARե֤ΰ¸طꥹȤsummary\&.dotȤ̾Υޥ꡼եޤ +\fIjdeps\fRは、\fI\-dotoutput\fRオプションで指定されたdotディレクトリに<\fIfilename\fR>\&.dotという名前のdotファイルを特定のJARファイルごとに作成し、JARファイル間の依存関係をリストするsummary\&.dotという名前のサマリー・ファイルも作成します .sp .if n \{\ .RS 4 @@ -350,7 +350,7 @@ digraph "summary" { .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 index 63415d9a6da..71243fa5747 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jhat .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jhat" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jhat" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jhat \- JavaҡפʬϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jhat \- Javaヒープを分析します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,18 +64,18 @@ jhat \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIheap\-dump\-file\fR .RS 4 -֥饦оݤȤʤJavaХʥꡦҡססե롣ʣΥҡספޤסեξ硢\fImyfile\&.hprof#3\fRΤ褦˥ե̾θ\fI#<number>\fRղä뤳ȤǡեΥפǤޤ +ブラウズ対象となるJavaバイナリ・ヒープ・ダンプ・ファイル。複数のヒープ・ダンプを含むダンプ・ファイルの場合、\fImyfile\&.hprof#3\fRのようにファイル名の後に\fI#<number>\fRを付加することで、ファイル内の特定のダンプを指定できます。 .RE -.SH "" +.SH "説明" .PP -\fIjhat\fRޥɤJavaҡססեϤWebС򳫻Ϥޤ\fIjhat\fRޥɤѤơΥ֥饦ǥҡספ򻲾ȤǤޤ\fIjhat\fRޥɤϡΤΥ饹\fIMyClass\fRΤ٤ƤΥ󥹥󥹤ɽʤɤλ߷׺Ѥ礻Object Query Language (OQL)򥵥ݡȤޤҡספ礻OQLSQL˻ƤޤOQLΥإפˤϡ\fIjhat\fRޥɤˤäɽOQLإסڡ饢ǤޤǥեȡݡȤѤ硢OQLΥإפhttp://localhost:7000/oqlhelp/ѲǽǤ +\fIjhat\fRコマンドはJavaヒープ・ダンプ・ファイルを解析し、Webサーバーを開始します。\fIjhat\fRコマンドを使用して、お気に入りのブラウザでヒープ・ダンプを参照できます。\fIjhat\fRコマンドは、既知のクラス\fIMyClass\fRのすべてのインスタンスを表示するなどの事前設計済の問合せやObject Query Language (OQL)をサポートします。ヒープ・ダンプの問合せを除き、OQLはSQLに似ています。OQLのヘルプには、\fIjhat\fRコマンドによって表示されるOQLヘルプ・ページからアクセスできます。デフォルト・ポートを使用する場合、OQLのヘルプはhttp://localhost:7000/oqlhelp/で利用可能です。 .PP -JavaΥҡספˤϡΤĤˡޤ +Javaのヒープ・ダンプを生成するには、次のいくつかの方法があります。 .sp .RS 4 .ie n \{\ @@ -85,7 +85,7 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIjmap \-dump\fRץѤƼ¹Ի˥ҡספޤjmap(1)򻲾ȤƤ +\fIjmap \-dump\fRオプションを使用して実行時にヒープ・ダンプを取得します。jmap(1)を参照してください。 .RE .sp .RS 4 @@ -96,8 +96,8 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIjconsole\fRץѤ\fIHotSpotDiagnosticMXBean\fRͳǼ¹Ի˥ҡספޤjconsole(1)\fIHotSpotDiagnosticMXBean\fRΥ󥿥ե( -http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html)򻲾ȤƤ +\fIjconsole\fRオプションを使用して\fIHotSpotDiagnosticMXBean\fR経由で実行時にヒープ・ダンプを取得します。jconsole(1)および\fIHotSpotDiagnosticMXBean\fRのインタフェースの説明( +http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticMXBean\&.html)を参照してください。 .RE .sp .RS 4 @@ -108,8 +108,8 @@ http://docs\&.oracle\&.com/javase/8/docs/jre/api/management/extension/com/sun/ma .sp -1 .IP \(bu 2.3 .\} -ҡספϡ\fI\-XX:+HeapDumpOnOutOfMemoryError\fR -Javaۥޥ(JVM)ץꤹ뤳Ȥǡ\fIOutOfMemoryError\fR줿Ȥޤ +ヒープ・ダンプは、\fI\-XX:+HeapDumpOnOutOfMemoryError\fR +Java仮想マシン(JVM)オプションを指定することで、\fIOutOfMemoryError\fRがスローされたときに生成されます。 .RE .sp .RS 4 @@ -120,61 +120,61 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIhprof\fRޥɤѤޤHPROF: Heap/CPUץե󥰡ġ -(http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html)򻲾ȤƤ +\fIhprof\fRコマンドを使用します。HPROF: Heap/CPUプロファイリング・ツール +(http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html)を参照してください .RE -.SH "ץ" +.SH "オプション" .PP \-stack false|true .RS 4 -֥ȳƽФåפ̵ˤޤҡסdzȾ󤬻ѤǤʤ硢Υե饰\fIfalse\fRꤹɬפޤǥեȤ\fItrue\fRǤ +オブジェクト割当呼出しスタックの追跡を無効にします。ヒープ・ダンプ内で割当サイト情報が使用できない場合、このフラグを\fIfalse\fRに設定する必要があります。デフォルトは\fItrue\fRです。 .RE .PP \-refs false|true .RS 4 -֥ȤؤλȤפ̵ˤޤǥեȤ\fItrue\fRǤǥեȤǤϡҡΤ٤ƤΥ֥ȤˤĤơХåݥ(ꤵ줿֥ȤݥȤƤ륪֥ȡȼԤޤϼȤȤƤФ)׻ޤ +オブジェクトへの参照の追跡を無効にします。デフォルトは\fItrue\fRです。デフォルトでは、ヒープ内のすべてのオブジェクトについて、バックポインタ(指定されたオブジェクトをポイントしているオブジェクト。参照者または受信参照とも呼ばれる)が計算されます。 .RE .PP \-port \fIport\-number\fR .RS 4 -\fIjhat\fRHTTPСΥݡȤꤷޤǥեȤ7000Ǥ +\fIjhat\fRのHTTPサーバーのポートを設定します。デフォルトは7000です。 .RE .PP \-exclude \fIexclude\-file\fR .RS 4 -ãǽʥ֥Ȥ礻ɬפǡСΰޤեꤷޤȤСΥե\fIjava\&.lang\&.String\&.value\fRޤޤƤ硢Υ֥\fIo\fRãǽʥ֥ȤΥꥹȤ׻ݤˡ\fIjava\&.lang\&.String\&.value\fRեɤ˴Ϣ뻲ȥѥθʤʤޤ +到達可能なオブジェクトの問合せから除外する必要があるデータ・メンバーの一覧を含むファイルを指定します。たとえば、このファイルに\fIjava\&.lang\&.String\&.value\fRが含まれていた場合、特定のオブジェクト\fIo\fRから到達可能なオブジェクトのリストを計算する際に、\fIjava\&.lang\&.String\&.value\fRフィールドに関連する参照パスが考慮されなくなります。 .RE .PP \-baseline \fIexclude\-file\fR .RS 4 -١饤ȤʤҡספꤷޤξΥҡסƱ֥IDĥ֥ȤϿǤϤʤȤƥޡޤ¾Υ֥ȤϿȤƥޡޤϡۤʤ2ĤΥҡספӤݤΩޤ +ベースラインとなるヒープ・ダンプを指定します。両方のヒープ・ダンプ内で同じオブジェクトIDを持つオブジェクトは新規ではないとしてマークされます。他のオブジェクトは新規としてマークされます。これは、異なる2つのヒープ・ダンプを比較する際に役立ちます。 .RE .PP \-debug \fIint\fR .RS 4 -ΥġΥǥХå٥ꤷޤ٥0ϥǥХåϤʤȤ̣ޤ礭ͤꤹȡĹʥ⡼ɤˤʤޤ +このツールのデバッグ・レベルを設定します。レベル0はデバッグ出力がないことを意味します。より大きな値を設定すると、より冗長なモードになります。 .RE .PP \-version .RS 4 -꡼ֹݡȤƽλޤ +リリース番号をレポートして終了します .RE .PP \-h .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-help .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjhat\fRޥɤ¹ԤƤJavaۥޥ\fIflag\fRϤޤȤС512MХȤκҡסѤˤϡ\fI\-J\-Xmx512m\fRȤޤ +\fIjhat\fRコマンドを実行しているJava仮想マシンに\fIflag\fRを渡します。たとえば、512Mバイトの最大ヒープ・サイズを使用するには、\fI\-J\-Xmx512m\fRとします。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -206,7 +206,7 @@ jconsole(1) .sp -1 .IP \(bu 2.3 .\} -HPROF: Heap/CPUץե󥰡ġ +HPROF: Heap/CPUプロファイリング・ツール (http://docs\&.oracle\&.com/javase/8/docs/technotes/samples/hprof\&.html) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 index f4e7ae9c4ec..e86c941c81b 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jinfo .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jinfo" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jinfo" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jinfo \- ޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jinfo \- 構成情報を生成します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -82,83 +82,83 @@ jinfo \- .RE .\} .PP -\fIץ\fR +\fIオプション\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -󤬽ϤץIDץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +構成情報が出力されるプロセスID。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -󤬽Ϥ륳ե롣 +構成情報が出力されるコア・ファイル。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjinfo\fRޥɤϡꤵ줿Javaץ䥳եޤϥ⡼ȡǥХåСJavaϤޤˤϡJavaƥࡦץѥƥJavaۥޥ(JVM)Υޥɥ饤󡦥ե饰ޤޤƤޤꤵ줿ץ64ӥåJVMǼ¹ԤƤ硢\fI\-J\-d64\fRץꤹɬפ礬ޤ򼨤ޤ\fIjinfo\fR -\fI\-J\-d64 \-sysprops pid\fR +\fIjinfo\fRコマンドは、指定されたJavaプロセスやコア・ファイルまたはリモート・デバッグ・サーバーのJava構成情報を出力します。構成情報には、Javaシステム・プロパティとJava仮想マシン(JVM)のコマンドライン・フラグが含まれています。指定されたプロセスが64ビットJVM上で実行されている場合、\fI\-J\-d64\fRオプションを指定する必要がある場合があります。次に例を示します。\fIjinfo\fR +\fI\-J\-d64 \-sysprops pid\fR。 .PP -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fR¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤȤС\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fRǤ -.SH "ץ" +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。たとえば、\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fRです。 +.SH "オプション" .PP no\-option .RS 4 -ޥɥ饤󡦥ե饰򡢥ƥࡦץѥƥ̾ͤΥڥȤȤ˽Ϥޤ +コマンドライン・フラグを、システム・プロパティ名と値のペアとともに出力します。 .RE .PP \-flag \fIname\fR .RS 4 -ꤵ줿ޥɥ饤󡦥ե饰̾ͤϤޤ +指定されたコマンドライン・フラグの名前と値を出力します。 .RE .PP \-flag \fI[+|\-]name\fR .RS 4 -ꤵ줿֡뷿Υޥɥ饤󡦥ե饰ͭޤ̵ˤޤ +指定されたブール型のコマンドライン・フラグを有効または無効にします。 .RE .PP \-flag \fIname=value\fR .RS 4 -ꤵ줿ޥɥ饤󡦥ե饰ꤵ줿ͤꤷޤ +指定されたコマンドライン・フラグを指定された値に設定します。 .RE .PP \-flags .RS 4 -JVMϤ륳ޥɥ饤󡦥ե饰Ϥޤ +JVMに渡されるコマンドライン・フラグを出力します。 .RE .PP \-sysprops .RS 4 -Javaƥࡦץѥƥ̾ͤΥڥȤƽϤޤ +Javaシステム・プロパティを名前と値のペアとして出力します。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 index bcf28254fe2..c6c7d72d7ad 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jjs.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jjs .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ܥġ +.\" Date: 2013年11月21日 +.\" SectDesc: 基本ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jjs" "1" "2013ǯ1121" "JDK 8" "ܥġ" +.TH "jjs" "1" "2013年11月21日" "JDK 8" "基本ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jjs \- Nashorn󥸥ƤӽФޤ -.SH "" +jjs \- Nashornエンジンを呼び出します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,28 +64,28 @@ jjs \- Nashorn .PP \fIoptions\fR .RS 4 -ʸǶڤ줿\fIjjs\fRޥɤ1İʾΥץ󡣾ܺ٤ϡץ򻲾ȤƤ +空白文字で区切られた、\fIjjs\fRコマンドの1つ以上のオプション。詳細は、オプションを参照してください。 .RE .PP \fIscript\-files\fR .RS 4 -ʸǶڤ줿NashornѤƲ᤹1İʾΥץȡե롣ե뤬ꤵʤϡ÷뤬ưޤ +空白文字で区切られた、Nashornを使用して解釈する1つ以上のスクリプト・ファイル。ファイルが指定されない場合は、対話型シェルが起動されます。 .RE .PP \fIarguments\fR .RS 4 -ťϥե󡦥ޡ(\fI\-\-\fR)θΤ٤ƤͤȤƥץȤޤ÷Ϥޤͤˤ\fIarguments\fRץѥƥѤƥǤޤ(Example 3򻲾ȤƤ) +二重ハイフン・マーカー(\fI\-\-\fR)の後のすべての値が、引数としてスクリプトまたは対話型シェルに渡されます。これらの値には\fIarguments\fRプロパティを使用してアクセスできます(Example 3を参照してください)。 .RE -.SH "" +.SH "説明" .PP -\fIjjs\fRޥɥ饤󡦥ġѤNashorn󥸥ƤӽФޤѤơ1ĤޤʣΥץȡեᤷꡢ÷¹Ԥ뤳ȤǤޤ -.SH "ץ" +\fIjjs\fRコマンドライン・ツールを使用してNashornエンジンを呼び出します。これを使用して、1つまたは複数のスクリプト・ファイルを解釈したり、対話型シェルを実行することができます。 +.SH "オプション" .PP -\fIjjs\fRޥɤΥץϥץȤNashornˤäƲᤵ椷ޤ +\fIjjs\fRコマンドのオプションはスクリプトがNashornによって解釈される条件を制御します。 .PP \-ccs=\fIsize\fR, \-\-class\-cache\-size=\fIsize\fR .RS 4 -饹å塦Хñ̤ꤷޤХ(KB)򼨤\fIk\fRޤ\fIK\fRʸɲäᥬХ(MB)򼨤\fIm\fRޤ\fIM\fRʸɲäХ(GB)򼨤\fIg\fRޤ\fIG\fRɲäޤǥեȤǤϡ饹å塦50ХȤꤵޤϡ1024Х(1 KB)ꤹˡ򼨤ޤ +クラス・キャッシュ・サイズをバイト単位で設定します。キロバイト(KB)を示すために\fIk\fRまたは\fIK\fRの文字を追加し、メガバイト(MB)を示すために\fIm\fRまたは\fIM\fRの文字を追加し、ギガバイト(GB)を示すために\fIg\fRまたは\fIG\fRを追加します。デフォルトでは、クラス・キャッシュ・サイズは50バイトに設定されます。次の例は、1024バイト(1 KB)に設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -101,17 +101,17 @@ jjs \- Nashorn .PP \-co, \-\-compile\-only .RS 4 -ץȤ¹Ԥ˥ѥ뤷ޤ +スクリプトを実行せずにコンパイルします。 .RE .PP \-cp \fIpath\fR, \-\-classpath \fIpath\fR .RS 4 -ݡȤ륯饹ؤΥѥꤷޤʣΥѥꤹˤϡΥץ򷫤֤ޤϳƥѥ򥳥(:)Ƕڤޤ +サポートするクラスへのパスを指定します。複数のパスを設定するには、このオプションを繰り返すか、または各パスをコロン(:)で区切ります。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -ץѥƥ̾ͤƤ뤳ȤǡץȤϤƥࡦץѥƥꤷޤǡ÷⡼ɤNashornƤӽФơ\fImyValue\fR\fImyKey\fRȤ̾Υץѥƥ˳Ƥˡ򼨤ޤ +プロパティ名に値を割り当てることで、スクリプトに渡すシステム・プロパティを設定します。次の例で、対話型モードでNashornを呼び出して、\fImyValue\fRを\fImyKey\fRという名前のプロパティに割り当てる方法を示します。 .sp .if n \{\ .RS 4 @@ -125,67 +125,67 @@ jjs> .if n \{\ .RE .\} -Υץ򷫤֤ѤȡʣΥץѥƥǤޤ +このオプションを繰り返し使用すると、複数のプロパティを設定できます。 .RE .PP \-d=\fIpath\fR, \-\-dump\-debug\-dir=\fIpath\fR .RS 4 -饹եפǥ쥯ȥؤΥѥꤷޤ +クラス・ファイルをダンプするディレクトリへのパスを指定します。 .RE .PP \-\-debug\-lines .RS 4 -饹եιֹɽޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-debug\-lines=false\fRꤷޤ +クラス・ファイル内の行番号表を生成します。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-debug\-lines=false\fRを指定します。 .RE .PP \-\-debug\-locals .RS 4 -饹եΥѿޤ +クラス・ファイル内のローカル変数を生成します。 .RE .PP \-doe, \-\-dump\-on\-error .RS 4 -顼ȯȤˡե롦åȥ졼󶡤ޤǥեȤǤϡñʥ顼åΤߤϤޤ +エラーが発生したときに、フル・スタック・トレースを提供します。デフォルトでは、簡単なエラー・メッセージのみが出力されます。 .RE .PP \-\-early\-lvalue\-error .RS 4 -̵ʺͼ顼Ȥ(ĤޤꡢɤϤȤ)𤵤ޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-early\-lvalue\-error=false\fRꤷޤ̵ʾ硢̵ʺͼϥɤ¹Ԥޤ𤵤ޤ +無効な左辺値式が早期エラーとして(つまり、コードが解析されるときに)報告されます。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-early\-lvalue\-error=false\fRを指定します。無効な場合、無効な左辺値式はコードが実行されるまで報告されません。 .RE .PP \-\-empty\-statements .RS 4 -ʸJavaݹʸĥ꡼¸ޤ +空の文をJavaの抽象構文ツリーに保存します。 .RE .PP \-fv, \-\-fullversion .RS 4 -NashornСʸϤޤ +完全なNashornバージョン文字列を出力します。 .RE .PP \-\-function\-statement\-error .RS 4 -ؿʸȤƻѤȥ顼åϤޤ +関数の宣言が文として使用されるとエラー・メッセージが出力されます。 .RE .PP \-\-function\-statement\-warning .RS 4 -ؿʸȤƻѤȷٹåϤޤ +関数の宣言が文として使用されると警告メッセージが出力されます。 .RE .PP \-fx .RS 4 -ץȤJavaFXץꥱȤƵưޤ +スクリプトをJavaFXアプリケーションとして起動します。 .RE .PP \-h, \-help .RS 4 -ץΥꥹȤȤϤޤ +オプションのリストとその説明を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤷ\fIjava\fRưץJVMϤޤǡ÷⡼ɤNashornƤӽФơJVMˤäƻѤ꡼4 GBꤹˡ򼨤ޤ +指定した\fIjava\fR起動オプションをJVMに渡します。次の例で、対話型モードでNashornを呼び出して、JVMによって使用される最大メモリーを4 GBに設定する方法を示します。 .sp .if n \{\ .RS 4 @@ -199,22 +199,22 @@ jjs> .if n \{\ .RE .\} -Υץ򷫤֤Ѥȡʣ\fIjava\fRޥɡץϤȤǤޤ +このオプションを繰り返し使用すると、複数の\fIjava\fRコマンド・オプションを渡すことができます。 .RE .PP \-\-lazy\-compilation .RS 4 -쥤ά(ĤޤꡢץΤ٤˥ѥ뤵ʤ)ͭˤޤΥץϻŪʤΤǤ +レイジー・コード生成戦略(つまり、スクリプト全体が一度にコンパイルされない)を有効にします。このオプションは試験的なものです。 .RE .PP \-\-loader\-per\-compile .RS 4 -ѥ뤴Ȥ˿饹ޤǥեȤǤϡΥץͭˤʤäƤޤ̵ˤˤ\fI\-\-loader\-per\-compile=false\fRꤷޤ +コンパイルごとに新しいクラス・ローダーを作成します。デフォルトでは、このオプションは有効になっています。無効にするには\fI\-\-loader\-per\-compile=false\fRを指定します。 .RE .PP \-\-log=\fIsubsystem\fR:\fIlevel\fR .RS 4 -ꤵ줿֥ƥФơΥ٥ǥ󥰤¹ԤޤޤǶڤäʣΥ֥ƥΥ󥰡٥Ǥޤ򼨤ޤ +指定されたサブシステムに対して、特定のレベルでロギングを実行します。カンマで区切って複数のサブシステムのロギング・レベルを指定できます。次に例を示します。 .sp .if n \{\ .RS 4 @@ -229,116 +229,116 @@ jjs> .PP \-\-package=\fIname\fR .RS 4 -줿饹եɲäѥåꤷޤ +生成されたクラス・ファイルを追加するパッケージを指定します。 .RE .PP \-\-parse\-only .RS 4 -ѥ뤻˥ɤϤޤ +コンパイルせずにコードを解析します。 .RE .PP \-\-print\-ast .RS 4 -ݹʸĥ꡼Ϥޤ +抽象構文ツリーを出力します。 .RE .PP \-\-print\-code .RS 4 -ХȥɤϤޤ +バイトコードを出力します。 .RE .PP \-\-print\-lower\-ast .RS 4 -겼ݹʸĥ꡼Ϥޤ +掘り下げた抽象構文ツリーを出力します。 .RE .PP \-\-print\-lower\-parse .RS 4 -겼ϥĥ꡼Ϥޤ +掘り下げた解析ツリーを出力します。 .RE .PP \-\-print\-no\-newline .RS 4 -¾\fI\-\-print*\fRץǶŪ1ԤǽϤޤ +その他の\fI\-\-print*\fRオプションで強制的に1行で出力します。 .RE .PP \-\-print\-parse .RS 4 -ϥĥ꡼Ϥޤ +解析ツリーを出力します。 .RE .PP \-\-print\-symbols .RS 4 -ɽϤޤ +記号表を出力します。 .RE .PP \-pcs, \-\-profile\-callsites .RS 4 -ƤӽФȤΥץե롦ǡפޤ +呼び出しサイトのプロファイル・データをダンプします。 .RE .PP \-scripting .RS 4 -Υץȵǽͭˤޤ +シェルのスクリプト機能を有効にします。 .RE .PP \-\-stderr=\fIfilename\fR|\fIstream\fR|\fItty\fR .RS 4 -ɸ२顼ȥ꡼ꤷե롢ȥ꡼(Ȥ\fIstdout\fR)ˡޤϥƥü˥쥯Ȥޤ +標準エラー・ストリームを指定したファイル、ストリーム(たとえば\fIstdout\fR)に、またはテキスト端末にリダイレクトします。 .RE .PP \-\-stdout=\fIfilename\fR|\fIstream\fR|\fItty\fR .RS 4 -ɸϥȥ꡼ꤷե롢ȥ꡼(Ȥ\fIstderr\fR)ˡޤϥƥü˥쥯Ȥޤ +標準出力ストリームを指定したファイル、ストリーム(たとえば\fIstderr\fR)に、またはテキスト端末にリダイレクトします。 .RE .PP \-strict .RS 4 -ɸ(ECMAScript Edition 5\&.1)ؤν򶯲strict⡼ɤͭˤˤ궦̤Υǥ󥰡顼ñ˸ФǤ褦ˤʤޤ +標準(ECMAScript Edition 5\&.1)への準拠を強化するstrictモードを有効にし、これにより共通のコーディング・エラーを簡単に検出できるようになります。 .RE .PP \-t=\fIzone\fR, \-timezone=\fIzone\fR .RS 4 -ץȤμ¹ԤФꤷॾꤷޤOSꤵ줿ॾ򥪡С饤ɤ\fIDate\fR֥ȤǻѤޤ +スクリプトの実行に対し指定したタイムゾーンを設定します。OSで設定されたタイムゾーンをオーバーライドし、\fIDate\fRオブジェクトで使用されます。 .RE .PP \-tcs=\fIparameter\fR, \-\-trace\-callsites=\fIparameter\fR .RS 4 -ƽФȤΥȥ졼Υ⡼ɤͭˤޤѲǽʥѥ᡼ϡΤȤǤ +呼出しサイトのトレースのモードを有効にします。使用可能なパラメータは、次のとおりです。 .PP miss .RS 4 -ƽФȤΥߥȥ졼ޤ +呼出しサイトのミスをトレースします。 .RE .PP enterexit .RS 4 -ƽФȤؤνȥ졼ޤ +呼出しサイトへの出入りをトレースします。 .RE .PP objects .RS 4 -֥ȤΥץѥƥϤޤ +オブジェクトのプロパティを出力します。 .RE .RE .PP \-\-verify\-code .RS 4 -Хȥɤ¹Ԥ˸ڤޤ +バイトコードを実行する前に検証します。 .RE .PP \-v, \-version .RS 4 -NashornСʸϤޤ +Nashornバージョン文字列を出力します。 .RE .PP \-xhelp .RS 4 -ޥɥ饤󡦥ץγĥإפϤޤ +コマンドライン・オプションの拡張ヘルプを出力します。 .RE -.SH "" +.SH "例" .PP -\fBExample 1\fR, NashornѤץȤμ¹ +\fBExample 1\fR, Nashornを使用したスクリプトの実行 .RS 4 .sp .if n \{\ @@ -352,7 +352,7 @@ jjs script\&.js .\} .RE .PP -\fBExample 2\fR, ÷⡼ɤǤNashornμ¹ +\fBExample 2\fR, 対話型モードでのNashornの実行 .RS 4 .sp .if n \{\ @@ -370,7 +370,7 @@ jjs> \fBquit()\fR .\} .RE .PP -\fBExample 3\fR, NashornؤΰϤ +\fBExample 3\fR, Nashornへの引数の渡し .RS 4 .sp .if n \{\ @@ -386,7 +386,7 @@ jjs> .RE .\} .RE -.SH "Ϣ" +.SH "関連項目" .PP \fIjrunscript\fR .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 index cc465a08b4e..07b59ddc5cc 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jmap .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jmap" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jmap" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jmap \- ץ䥳եޤϥ⡼ȡǥХåСΡѥ֥ȡ꡼ޥåפޤϥҡס꡼ξܺ٤ϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jmap \- プロセスやコア・ファイルまたはリモート・デバッグ・サーバーの、共用オブジェクト・メモリー・マップまたはヒープ・メモリーの詳細を出力します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -84,93 +84,93 @@ jmap \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -Ϥ꡼ޥåפΥץIDץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +出力するメモリー・マップのプロセスID。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -Ϥ꡼ޥåפΥե롣 +出力するメモリー・マップのコア・ファイル。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjmap\fRޥɤϡꤵ줿ץ䥳եޤϥ⡼ȡǥХåСΡѥ֥ȡ꡼ޥåפޤϥҡס꡼ξܺ٤Ϥޤꤵ줿ץ64ӥåJavaۥޥ(JVM)Ǽ¹ԤƤ硢\fI\-J\-d64\fRץꤹɬפ礬ޤ򼨤ޤ\fIjmap\fR -\fI\-J\-d64 \-heap pid\fR +\fIjmap\fRコマンドは、指定されたプロセスやコア・ファイルまたはリモート・デバッグ・サーバーの、共用オブジェクト・メモリー・マップまたはヒープ・メモリーの詳細を出力します。指定されたプロセスが64ビットJava仮想マシン(JVM)上で実行されている場合、\fI\-J\-d64\fRオプションを指定する必要がある場合があります。次に例を示します。\fIjmap\fR +\fI\-J\-d64 \-heap pid\fR。 .PP -\fB:\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fRե뤬¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤ\fIjvm\&.dll\fRξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ򼨤ޤ\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR -.SH "ץ" +\fB注意:\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRファイルが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用される\fIjvm\&.dll\fRの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。次に例を示します。\fIset PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR。 +.SH "オプション" .PP -<ץʤ> +<オプションなし> .RS 4 -ץѤʤ硢\fIjmap\fRޥɤ϶ѥ֥ȡޥåԥ󥰤ϤޤåJVM˥ɤ줿ѥ֥ȤȤˡϥɥ쥹ޥåԥ󥰤ΥӶѥ֥ȡեΥեѥϤޤưϡOracle Solaris -\fIpmap\fR桼ƥƥƤޤ +オプションを使用しない場合、\fIjmap\fRコマンドは共用オブジェクト・マッピングを出力します。ターゲットJVMにロードされた共用オブジェクトごとに、開始アドレス、マッピングのサイズおよび共用オブジェクト・ファイルのフルパスが出力されます。この動作は、Oracle Solaris +\fIpmap\fRユーティリティと類似しています。 .RE .PP \-dump:[live,] format=b, file=\fIfilename\fR .RS 4 -Javaҡפ\fIhprof\fRХʥ\fIfilename\fR˥פޤ\fIlive\fR֥ץϥץǤꤷ硢ҡΥƥ֤ʥ֥ȤΤߤפޤҡספ򻲾Ȥˤϡjhat(1)ޥɤѤ줿եɤ߼ޤ +Javaヒープを\fIhprof\fRバイナリ形式で\fIfilename\fRにダンプします。\fIlive\fRサブオプションはオプションですが、指定した場合、ヒープ内のアクティブなオブジェクトのみがダンプされます。ヒープ・ダンプを参照するには、jhat(1)コマンドを使用して生成されたファイルを読み取ります。 .RE .PP \-finalizerinfo .RS 4 -եʥ饤ԤäƤ륪֥Ȥ˴ؤϤޤ +ファイナライズを待っているオブジェクトに関する情報を出力します。 .RE .PP \-heap .RS 4 -ѤƤ륬١쥯Υҡסޥ꡼إåϢΥҡ׻ѾϤޤˡintern줿ʸοȥϤޤ +使用されているガベージ・コレクションのヒープ・サマリー、ヘッダー構成、および世代関連のヒープ使用状況を出力します。さらに、internされた文字列の数とサイズも出力されます。 .RE .PP \-histo[:live] .RS 4 -ҡפΥҥȥϤޤJava饹Ȥˡ֥ȤοХñ̤ǤΥ꡼Ӵ饹̾ϤޤJVM饹̾ϥꥹ(*)ƬդƽϤޤ\fIlive\fR֥ץ󤬻ꤵ줿硢ƥ֤ʥ֥ȤΤߤȤޤ +ヒープのヒストグラムを出力します。Javaクラスごとに、オブジェクトの数、バイト単位でのメモリー・サイズ、および完全修飾クラス名が出力されます。JVMの内部クラス名はアスタリスク(*)の接頭辞を付けて出力されます。\fIlive\fRサブオプションが指定された場合、アクティブなオブジェクトのみがカウントされます。 .RE .PP \-clstats .RS 4 -JavaҡפΡ饹ϢץǡϤޤ饹Ȥˡ̾֡ɥ쥹ƥ饹ӥ饹ɤ饹οȥϤޤ +Javaヒープの、クラス・ローダー関連の統計データを出力します。クラス・ローダーごとに、その名前、状態、アドレス、親クラス・ローダー、およびクラス・ローダーがロードしたクラスの数とサイズが出力されます。 .RE .PP \-F .RS 4 -ޤPIDʤȤˡΥץ\fIjmap \-dump\fRޤ\fIjmap \-histo\fRץȤȤ˻ѤޤΥ⡼ɤǤϡ\fIlive\fR֥ץϥݡȤޤ +強制します。PIDが応答しないときに、このオプションを\fIjmap \-dump\fRまたは\fIjmap \-histo\fRオプションとともに使用します。このモードでは、\fIlive\fRサブオプションはサポートされません。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-J\fIflag\fR .RS 4 -\fIjmap\fRޥɤ¹ԤƤJavaۥޥ\fIflag\fRϤޤ +\fIjmap\fRコマンドを実行しているJava仮想マシンに\fIflag\fRを渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jps.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jps.1 index d6a7ae886f9..bef7d60260f 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jps.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jps.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jps .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jps" "1" "2013ǯ1121" "JDK 8" "˥󥰡ġ" +.TH "jps" "1" "2013年11月21日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jps \- åȡƥǷ¬줿Javaۥޥ(JVM)ɽޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jps \- ターゲット・システム上で計測されたJava仮想マシン(JVM)を一覧表示します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,60 +64,60 @@ jps \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIhostid\fR .RS 4 -ץݡȤۥȤμ̻ҡ\fIhostid\fRˤϡ̿ץȥ롢ݡֹ桢˸ͭ¾Υǡꤷץ󡦥ݡͥȤޤ뤳ȤǤޤۥȼ̻Ҥ򻲾ȤƤ +プロセス・レポートを生成するホストの識別子。\fIhostid\fRには、通信プロトコル、ポート番号、実装に固有な他のデータを指定したオプション・コンポーネントを含めることができます。ホスト識別子を参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjps\fRޥɤϡåȡƥǷ¬줿Java HotSpot VMɽޤΥޥɤɽǤݡȾϡäJVM˴ؤΤ˸ꤵޤ +\fIjps\fRコマンドは、ターゲット・システム上で計測されたJava HotSpot VMを一覧表示します。このコマンドで表示できるレポート情報は、アクセス権を持ったJVMに関するものに限定されます。 .PP -\fIhostid\fRꤻ\fIjps\fRޥɤ¹Ԥ硢롦ۥȤǷ¬줿JVMޤ\fIhostid\fRꤷƵư硢ꤵ줿ץȥȥݡȤѤơꤵ줿ۥȾJVM򸡺ޤ\fIjstatd\fRץåȡۥȾǼ¹ԤƤꤵޤ +\fIhostid\fRを指定せずに\fIjps\fRコマンドを実行した場合、ローカル・ホストで計測されたJVMが検索されます。\fIhostid\fRを指定して起動した場合、指定されたプロトコルとポートを使用して、指定されたホスト上のJVMを検索します。\fIjstatd\fRプロセスがターゲット・ホスト上で実行されていると想定されます。 .PP -\fIjps\fRޥɤϡåȡƥǷ¬줿JVMˤĤơVM̻ҡĤޤ\fIlvmid\fRݡȤޤ\fIlvmid\fRϡŪˤJVMץФ륪ڥ졼ƥ󥰡ƥΥץ̻ҤǤɬ⤽ǤȤϸ¤ޤ󡣥ץꤷʤ硢\fIjps\fRˤäơJavaץꥱ\fIlvmid\fRɽ졢줾˥ץꥱΥ饹̾ޤJARե̾ñʷǼޤδñʷΥ饹̾JARե̾Ǥϡ饹ΥѥåޤJARե롦ѥ󤬾άƤޤ +\fIjps\fRコマンドは、ターゲット・システムで計測された各JVMについて、ローカルVM識別子、つまり\fIlvmid\fRをレポートします。\fIlvmid\fRは、一般的にはJVMプロセスに対するオペレーティング・システムのプロセス識別子ですが、必ずしもそうであるとは限りません。オプションを指定しない場合、\fIjps\fRによって、各Javaアプリケーションの\fIlvmid\fRが一覧表示され、それぞれにアプリケーションのクラス名またはJARファイル名が簡単な形式で示されます。この簡単な形式のクラス名とJARファイル名では、クラスのパッケージ情報またはJARファイル・パス情報が省略されています。 .PP -\fIjps\fRޥɤϡJavaưġѤmain᥽åɤϤ륯饹̾Ȱ򸡺ޤȼεưġѤƥåJVMưϡ\fImain\fR᥽åɤϤ륯饹̾ޤJARե̾ȰѤǤޤ󡣤ξ硢\fIjps\fRޥɤϡ\fImain\fR᥽åɤϤ륯饹̾ޤJARե̾ȰФơʸ\fIUnknown\fRϤޤ +\fIjps\fRコマンドは、Java起動ツールを使用してmainメソッドに渡されるクラス名と引数を検索します。独自の起動ツールを使用してターゲットJVMを起動した場合は、\fImain\fRメソッドに渡されるクラス名またはJARファイル名と引数は利用できません。この場合、\fIjps\fRコマンドは、\fImain\fRメソッドに渡されるクラス名またはJARファイル名と引数に対して、文字列\fIUnknown\fRを出力します。 .PP -\fIjps\fRޥɤJVMΥꥹȤϡΥޥɤ¹Ԥץ󥷥ѥͿ줿˴Ť¤礬ޤΥޥɤϡڥ졼ƥ󥰡ƥȼΥ浡ˤ˴Ťơץ󥷥ѥ˥ͿƤJVMΤߤɽޤ -.SH "ץ" +\fIjps\fRコマンドで生成されるJVMのリストは、このコマンドを実行するプリンシパルに与えられたアクセス権に基づき、制限される場合があります。このコマンドは、オペレーティング・システム独自のアクセス制御機構による決定に基づいて、プリンシパルにアクセス権が与えられているJVMのみを一覧表示します。 +.SH "オプション" .PP -\fIjps\fRޥɤǤϡޥɤνϤѹ륪ץ¿ݡȤƤޤ衢Υץϡѹޤѻߤǽޤ +\fIjps\fRコマンドでは、コマンドの出力を変更するオプションが多数サポートされています。将来、これらのオプションは、変更または廃止される可能性があります。 .PP \-q .RS 4 -饹̾JARե̾\fImain\fR᥽åɤϤ줿νϤVM̻ҤΰΤߤޤ +クラス名、JARファイル名、および\fImain\fRメソッドに渡された引数の出力を抑制し、ローカルVM識別子の一覧のみを生成します。 .RE .PP \-m .RS 4 -\fImain\fR᥽åɤϤϤޤνϤϡȤ߹ޤƤJVMФ\fInull\fRˤʤ뤳Ȥ⤢ޤ +\fImain\fRメソッドに渡される引数を出力します。この出力は、組み込まれているJVMに対して\fInull\fRになることもあります。 .RE .PP \-l .RS 4 -ץꥱ\fImain\fR饹Υե롦ѥå̾ޤϥץꥱJARեؤΥեѥ̾Ϥޤ +アプリケーションの\fImain\fRクラスのフル・パッケージ名、またはアプリケーションのJARファイルへのフルパス名を出力します。 .RE .PP \-v .RS 4 -JVMϤɽޤ +JVMに渡される引数を表示します。 .RE .PP \-V .RS 4 -饹̾JARե̾mai᥽åɤϤ줿νϤVM̻ҤΰΤߤޤ +クラス名、JARファイル名、およびmaiメソッドに渡された引数の出力を抑制し、ローカルVM識別子の一覧のみを生成します。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ\fIץ\fR1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されている\fIオプション\fRを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ۥȼ̻" +.SH "ホスト識別子" .PP -ۥȼ̻ҡĤޤ\fIhostid\fRϡåȡƥ򼨤ʸǤ\fIhostid\fRʸιʸϡURIιʸбƤޤ +ホスト識別子、つまり\fIhostid\fRは、ターゲット・システムを示す文字列です。\fIhostid\fR文字列の構文は、URIの構文に対応しています。 .sp .if n \{\ .RS 4 @@ -131,27 +131,27 @@ JVM .PP \fIprotocol\fR .RS 4 -̿ץȥǤ\fIprotocol\fRά졢\fIhostname\fRꤵƤʤ硢ǥեȤΥץȥ뤬ץåȥեͭκŬ줿롦ץȥˤʤޤץȥ뤬ά졢ۥ̾ꤵƤϡǥեȡץȥ\fIrmi\fRˤʤޤ +通信プロトコルです。\fIprotocol\fRが省略され、\fIhostname\fRが指定されていない場合、デフォルトのプロトコルが、プラットフォーム固有の最適化されたローカル・プロトコルになります。プロトコルが省略され、ホスト名が指定されている場合は、デフォルト・プロトコルは\fIrmi\fRになります。 .RE .PP hostname .RS 4 -åȡۥȤ򼨤ۥ̾ޤIPɥ쥹Ǥ\fIhostname\fRѥ᡼άƤϡåȡۥȤϥ롦ۥȤˤʤޤ +ターゲット・ホストを示すホスト名またはIPアドレスです。\fIhostname\fRパラメータが省略されている場合は、ターゲット・ホストはローカル・ホストになります。 .RE .PP port .RS 4 -⡼ȡС̿뤿ΥǥեȡݡȤǤ\fIhostname\fRѥ᡼άƤ뤫\fIprotocol\fRѥ᡼Ŭ줿롦ץȥꤷƤ硢\fIport\fRѥ᡼̵뤵ޤʳξ硢\fIport\fRѥ᡼ΰϡˤäưۤʤޤǥեȤ -\fIrmi\fRץȥξ硢\fIport\fRѥ᡼ϡ⡼ȡۥȾrmiregistryΥݡֹ򼨤ޤ\fIport\fRѥ᡼άƤ뤫\fIprotocol\fRѥ᡼\fIrmi\fR򼨤Ƥ硢ǥեȤrmiregistryݡ(1099)Ѥޤ +リモート・サーバーと通信するためのデフォルト・ポートです。\fIhostname\fRパラメータが省略されているか、\fIprotocol\fRパラメータが、最適化されたローカル・プロトコルを指定している場合、\fIport\fRパラメータは無視されます。それ以外の場合、\fIport\fRパラメータの扱いは、実装によって異なります。デフォルトの +\fIrmi\fRプロトコルの場合、\fIport\fRパラメータは、リモート・ホスト上のrmiregistryのポート番号を示します。\fIport\fRパラメータが省略されているか、\fIprotocol\fRパラメータが\fIrmi\fRを示している場合、デフォルトのrmiregistryポート(1099)が使用されます。 .RE .PP servername .RS 4 -Υѥ᡼ΰϡˤäưۤʤޤŬ줿롦ץȥξ硢Υեɤ̵뤵ޤ\fIrmi\fRץȥξ硢Υѥ᡼ϡ⡼ȡۥȾRMI⡼ȡ֥Ȥ̾򼨤ʸˤʤޤܺ٤ϡ\fIjstatd\fRޥɤ\fI\-n\fRץ򻲾ȤƤ +このパラメータの扱いは、実装によって異なります。最適化されたローカル・プロトコルの場合、このフィールドは無視されます。\fIrmi\fRプロトコルの場合、このパラメータは、リモート・ホスト上のRMIリモート・オブジェクトの名前を示す文字列になります。詳細は、\fIjstatd\fRコマンドの\fI\-n\fRオプションを参照してください。 .RE -.SH "ϥեޥå" +.SH "出力フォーマット" .PP -\fIjps\fRޥɤνϤϡΥѥ˽ޤ +\fIjps\fRコマンドの出力は、次のパターンに従います。 .sp .if n \{\ .RS 4 @@ -163,15 +163,15 @@ lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ] .RE .\} .PP -٤Ƥνϥȡ϶ʸǶڤޤ\fIarg\fRͤǶѤȡºݤ֥ѥ᡼˰ޥåԥ󥰤褦ȤȤˡޤˤʤޤ +すべての出力トークンは空白文字で区切られます。\fIarg\fR値の中で空白を使用すると、実際の定位置パラメータに引数をマッピングしようとするときに、あいまいになります。 .PP -\fB:\fR -Υ꡼Ǥηѹǽ뤿ᡢ\fIjps\fRνϤϤ륹ץȤϺʤȤᤷޤ\fIjps\fRϤϤ륹ץȤȡΥġξΥ꡼ǡץȤѹɬפˤʤǽޤ -.SH "" +\fB注意:\fR +将来のリリースでこの形式は変更される可能性があるため、\fIjps\fRの出力を解析するスクリプトは作成しないことをお薦めします。\fIjps\fR出力を解析するスクリプトを作成すると、このツールの将来のリリースで、作成したスクリプトの変更が必要になる可能性があります。 +.SH "例" .PP -ιǤϡ\fIjps\fRޥɤ򼨤ޤ +この項では、\fIjps\fRコマンドの例を示します。 .PP -롦ۥȾǷ¬줿JVMɽ: +ローカル・ホスト上で計測されたJVMを一覧表示する場合: .sp .if n \{\ .RS 4 @@ -186,7 +186,7 @@ jps .RE .\} .PP -Ǥϡ⡼ȡۥȾǷ¬줿JVMɽޤǤϡ\fIjstat\fRСȡRMI쥸ȥޤ̤γrmiregistryץΤ줫⡼ȡۥȤΥǥեȡݡ(ݡ1099)Ǽ¹ԤƤꤷƤޤޤ롦ۥȤ⡼ȡۥȤؤͭʥäƤ뤳ȤꤷƤޤˤϡ\fI\-l\fRץޤޤ졢饹̾ޤJARե̾ܺ٤ʷǽϤޤ +次の例では、リモート・ホスト上で計測されたJVMを一覧表示します。この例では、\fIjstat\fRサーバーと、その内部RMIレジストリまたは別の外部rmiregistryプロセスのいずれかが、リモート・ホストのデフォルト・ポート(ポート1099)で実行されていると想定しています。また、ローカル・ホストが、リモート・ホストへの有効なアクセス権を持っていることも想定しています。この例には、\fI\-l\fRオプションも含まれ、クラス名またはJARファイル名を詳細な形式で出力します。 .sp .if n \{\ .RS 4 @@ -200,7 +200,7 @@ jps \-l remote\&.domain .RE .\} .PP -ǤϡRMI쥸ȥ˥ǥեȤǤϤʤݡȤѤơ⡼ȡۥȾǷ¬줿JVMɽޤǤϡRMI쥸ȥ꤬ݡ2002˥Хɤ줿\fIjstatd\fRС⡼ȡۥȾǼ¹ԤƤꤷƤޤޤ\fI\-m\fRץѤơɽ줿줾Javaץꥱ\fImain\fR᥽åɤϤȤ߹Ǥޤ +次の例では、RMIレジストリにデフォルトではないポートを使用して、リモート・ホスト上で計測されたJVMを一覧表示します。この例では、内部RMIレジストリがポート2002にバインドされた\fIjstatd\fRサーバーが、リモート・ホスト上で実行されていると想定しています。また、\fI\-m\fRオプションを使用して、一覧表示されたそれぞれのJavaアプリケーションの\fImain\fRメソッドに渡される引数を組み込んでいます。 .sp .if n \{\ .RS 4 @@ -213,7 +213,7 @@ jps \-m remote\&.domain:2002 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 index f53c29f59c7..2c9c82d9022 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jrunscript .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ץƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: スクリプティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jrunscript" "1" "2013ǯ1121" "JDK 8" "ץƥ󥰡ġ" +.TH "jrunscript" "1" "2013年11月21日" "JDK 8" "スクリプティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jrunscript \- ÷⡼ɤȥХå⡼ɤ򥵥ݡȤ륳ޥɥ饤󡦥ץȡ¹ԤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jrunscript \- 対話型モードとバッチ・モードをサポートするコマンドライン・スクリプト・シェルを実行します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,83 +64,83 @@ jrunscript \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIarguments\fR .RS 4 -Ѥ硢ץޤϥޥ̾ľ˵ҤƤ򻲾ȤƤ +引数を使用する場合、オプションまたはコマンド名の直後に記述してください。引数を参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjrunscript\fRޥɤϡ˰¸ʤޥɥ饤󡦥ץȡǤ\fIjrunscript\fRϡ÷(read\-eval\-print)⡼ɤȥХå(\fI\-f\fRץ)⡼ɤξΥץȼ¹Ԥ򥵥ݡȤޤǥեȤλѸJavaScriptǤ\fI\-l\fRץѤ¾θǤޤ\fIjrunscript\fRޥɤϡJavaȥץȸȤ̿ѤõŪʥץߥ󥰡򥵥ݡȤޤ -.SH "ץ" +\fIjrunscript\fRコマンドは、言語に依存しないコマンドライン・スクリプト・シェルです。\fIjrunscript\fRは、対話型(read\-eval\-print)モードとバッチ(\fI\-f\fRオプション)・モードの両方のスクリプト実行をサポートします。デフォルトの使用言語はJavaScriptですが、\fI\-l\fRオプションを使用すれば他の言語も指定できます。\fIjrunscript\fRコマンドは、Javaとスクリプト言語との通信を使用して探求的なプログラミング・スタイルをサポートします。 +.SH "オプション" .PP \-classpath \fIpath\fR .RS 4 -ץȤɬפΤ륯饹եξ򼨤ޤ +スクリプトがアクセスする必要のあるクラス・ファイルの場所を示します。 .RE .PP \-cp \fIpath\fR .RS 4 \fI\-classpath\fR -\fIpath\fRƱǤ +\fIpath\fRと同じです。 .RE .PP \-D\fIname\fR=\fIvalue\fR .RS 4 -JavaΥƥࡦץѥƥꤷޤ +Javaのシステム・プロパティを設定します。 .RE .PP \-J\fIflag\fR .RS 4 -\fIflag\fR\fIjrunscript\fRޥɤ¹ԤƤJavaۥޥľϤޤ +\fIflag\fRを、\fIjrunscript\fRコマンドが実行されているJava仮想マシンに直接渡します。 .RE .PP \-I \fIlanguage\fR .RS 4 -ꤵ줿ץȸѤޤǥեȤǤJavaScriptѤޤ¾ΥץȸѤˤϡ\fI\-cp\fRޤ\fI\-classpath\fRץѤơб륹ץȡ󥸥JARեꤹɬפޤ +指定されたスクリプト言語を使用します。デフォルトではJavaScriptが使用されます。他のスクリプト言語を使用するには、\fI\-cp\fRまたは\fI\-classpath\fRオプションを使用して、対応するスクリプト・エンジンのJARファイルを指定する必要があります。 .RE .PP \-e \fIscript\fR .RS 4 -ꤵ줿ץȤɾޤΥץѤСޥɥ饤ˤ٤Ƥꤵ줿1ԥץȤ¹ԤǤޤ +指定されたスクリプトを評価します。このオプションを使用すれば、コマンドラインにすべてが指定された1行スクリプトを実行できます。 .RE .PP \-encoding \fIencoding\fR .RS 4 -ץȡեɼ˻Ѥʸ󥳡ǥ󥰤ꤷޤ +スクリプト・ファイルの読取り時に使用する文字エンコーディングを指定します。 .RE .PP \-f \fIscript\-file\fR .RS 4 -ꤵ줿ץȡե(Хå⡼)ɾޤ +指定されたスクリプト・ファイル(バッチ・モード)を評価します。 .RE .PP \-f \- .RS 4 -ɸϤ饹ץȤɤ߼ꡢɾޤ(÷⡼) +標準入力からスクリプトを読み取り、それを評価します(対話型モード)。 .RE .PP \-help .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-? .RS 4 -إסåɽƽλޤ +ヘルプ・メッセージを表示して終了します。 .RE .PP \-q .RS 4 -Ѳǽʤ٤ƤΥץȡ󥸥ɽȡλޤ +利用可能なすべてのスクリプト・エンジンを一覧表示したあと、終了します。 .RE -.SH "" +.SH "引数" .PP -arguments¸ߤƤơ\fI\-e\fR\fI\-f\fRΤΥץѤʤä硢ǽΰץȡեȤʤꡢ¾ΰ¸ߤϥץȤϤޤargumentsȡ\fI\-e\fRޤ\fI\-f\fRץ󤬻ѤƤ硢٤ƤargumentsץȤϤޤarguments\fI\-e\fR\fI\-f\fRɤ¸ߤʤäϡ÷⡼ɤѤޤץȤ饹ץȰѤˤϡ\fIarguments\fRȤ̾\fIString\fR󷿤Υ󥸥ѿѤޤ -.SH "" -.SS "饤󡦥ץȤμ¹" +argumentsが存在していて、かつ\fI\-e\fR、\fI\-f\fRのいずれのオプションも使用されなかった場合、最初の引数がスクリプト・ファイルとなり、他の引数が存在する場合はスクリプトに渡されます。argumentsと、\fI\-e\fRまたは\fI\-f\fRオプションが使用されている場合、すべてのargumentsがスクリプトに渡されます。arguments、\fI\-e\fR、\fI\-f\fRがどれも存在しなかった場合は、対話型モードが使用されます。スクリプトからスクリプト引数を使用するには、\fIarguments\fRという名前の\fIString\fR配列型のエンジン変数を使用します。 +.SH "例" +.SS "インライン・スクリプトの実行" .sp .if n \{\ .RS 4 @@ -152,7 +152,7 @@ jrunscript \-e "cat(\*(Aqhttp://www\&.example\&.com\*(Aq)" .if n \{\ .RE .\} -.SS "ꤵ줿λѤӥץȡեɾ" +.SS "指定された言語の使用およびスクリプト・ファイルの評価" .sp .if n \{\ .RS 4 @@ -163,7 +163,7 @@ jrunscript \-l js \-f test\&.js .if n \{\ .RE .\} -.SS "÷⡼" +.SS "対話型モード" .sp .if n \{\ .RS 4 @@ -184,9 +184,9 @@ js> .if n \{\ .RE .\} -.SS "ץȰꤷץȡեμ¹" +.SS "スクリプト引数を指定したスクリプト・ファイルの実行" .PP -test\&.jsեϥץȡեǤ\fIarg1\fR\fIarg2\fR\fIarg3\fRγưץȤϤޤץȤargumentsѤƤΰ˥Ǥޤ +test\&.jsファイルはスクリプト・ファイルです。\fIarg1\fR、\fIarg2\fRおよび\fIarg3\fRの各引数がスクリプトに渡されます。スクリプトはarguments配列を使用してこれらの引数にアクセスできます。 .sp .if n \{\ .RS 4 @@ -197,10 +197,10 @@ jrunscript test\&.js arg1 arg2 arg3 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .PP -JavaScriptѤ硢桼ץȤɾˡ\fIjrunscript\fRޥɤϤĤȹߴؿȹߥ֥ȤޤJavaScriptȹߤˤĤƤϡhttp://code\&.google\&.com/p/jsdoc\-toolkit/ˤ -JsDoc\-Toolkit򻲾ȤƤ +JavaScriptが使用される場合、ユーザー定義スクリプトを評価する前に、\fIjrunscript\fRコマンドはいくつかの組込み関数や組込みオブジェクトを初期化します。これらのJavaScriptの組込みについては、http://code\&.google\&.com/p/jsdoc\-toolkit/にある +JsDoc\-Toolkitを参照してください。 .br 'pl 8.5i 'bp diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 index 0425f1af70a..be8c6bc7756 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jsadebugd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jsadebugd" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jsadebugd" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jsadebugd \- Javaץޤϥե³ǥХåСȤƵǽޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jsadebugd \- Javaプロセスまたはコア・ファイルに接続し、デバッグ・サーバーとして機能します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -74,26 +74,26 @@ jsadebugd \- Java .PP \fIpid\fR .RS 4 -ǥХåС³ץΥץIDǤץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤñΥץ³ǤǥХåСΥ󥹥󥹤ϡ1Ĥ¤ޤ +デバッグ・サーバーが接続するプロセスのプロセスIDです。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。単一のプロセスに接続できるデバッグ・サーバーのインスタンスは、1つに制限されます。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -ǥХåС³륳եǤ +デバッグ・サーバーを接続するコア・ファイルです。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥޥǼ¹ԤƤɬפˤʤ롢ץΰդIDǤIDϡ⡼ȡ饤Ȥ³ΥǥХåСꤹ뤿˻ѤɬפޤIDϡñΥޥǰդˤɬפޤ +複数のデバッグ・サーバーが同一のマシン上で実行されている場合に必要になる、オプションの一意のIDです。このIDは、リモート・クライアントが、接続先のデバッグ・サーバーを特定するために使用する必要があります。このIDは、単一のマシン内で一意にする必要があります。 .RE -.SH "" +.SH "説明" .PP -\fIjsadebugd\fRޥɤϡJavaץޤϥե³ǥХåСȤƵǽޤ\fIjstack\fR\fIjmap\fR\fIjinfo\fRʤɤΥ⡼ȡ饤ȤϡJava Remote Method Invocation (RMI)ѤƤ륵С³Ǥޤ\fIjsadebugd\fRޥɤưˡ\fIrmiregistry\fRޥɤRMI쥸ȥ򼡤Τ褦˵ưޤ\fI$JAVA_HOME\fRJDKΥ󥹥ȡ롦ǥ쥯ȥǤ +\fIjsadebugd\fRコマンドは、Javaプロセスまたはコア・ファイルに接続し、デバッグ・サーバーとして機能します。\fIjstack\fR、\fIjmap\fRおよび\fIjinfo\fRなどのリモート・クライアントは、Java Remote Method Invocation (RMI)を使用しているサーバーに接続できます。\fIjsadebugd\fRコマンドを起動する前に、\fIrmiregistry\fRコマンドでRMIレジストリを次のように起動します。\fI$JAVA_HOME\fRはJDKのインストール・ディレクトリです。 .sp .if n \{\ .RS 4 @@ -105,12 +105,12 @@ rmiregistry \-J\-Xbootclasspath/p:$JAVA_HOME/lib/sajdi\&.jar .RE .\} .PP -RMI쥸ȥ꤬ưƤʤ硢\fIjsadebugd\fRޥɤRMI쥸ȥɸ(1099)ݡȤǵưޤǥХåСϡ\fISIGINT\fR뤳ȤˤߤǤޤSIGINTˤϡ\fB[Ctrl] + [C]\fR򲡤ޤ +RMIレジストリが起動していない場合、\fIjsadebugd\fRコマンドはRMIレジストリを標準(1099)ポートで内部で起動します。デバッグ・サーバーは、\fISIGINT\fRを送信することにより停止できます。SIGINTを送信するには、\fB[Ctrl] + [C]\fRを押します。 .PP -\fB:\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤ\fIdbgeng\&.dll\fR¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ: +\fB注意:\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。\fIdbgeng\&.dll\fRが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。例: \fIs\fR\fIet PATH=%JDK_HOME%\ejre\ebin\eclient;%PATH%\fR -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 index 0afbad29b1d..ce2e8067621 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstack .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ȥ֥륷塼ƥ󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: トラブルシューティング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstack" "1" "2013ǯ1121" "JDK 8" "ȥ֥륷塼ƥ󥰡ġ" +.TH "jstack" "1" "2013年11月21日" "JDK 8" "トラブルシューティング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstack \- Javaץեޤϥ⡼ȡǥХåСФJavaåɤΥåȥ졼ϤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstack \- Javaプロセス、コア・ファイルまたはリモート・デバッグ・サーバーに対するJavaスレッドのスタック・トレースを出力します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -84,40 +84,40 @@ jstack \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIpid\fR .RS 4 -Ϥ륹åȥ졼ΥץIDǤץJavaץǤɬפޤޥǼ¹ԤƤJavaץΰˤϡjps(1)ޥɤѤޤ +出力するスタック・トレースのプロセスIDです。プロセスはJavaプロセスである必要があります。マシン上で実行しているJavaプロセスの一覧を取得するには、jps(1)コマンドを使用します。 .RE .PP -\fI¹Բǽե\fR +\fI実行可能ファイル\fR .RS 4 -פκJava¹Բǽե롣 +コア・ダンプの作成元のJava実行可能ファイル。 .RE .PP -\fI\fR +\fIコア\fR .RS 4 -Ϥ륹åȥ졼ΥեǤ +出力するスタック・トレースのコア・ファイルです。 .RE .PP \fIremote\-hostname\-or\-IP\fR .RS 4 -⡼ȡǥХåС\fIۥ̾\fRޤ\fIIP\fRɥ쥹jsadebugd(1)򻲾ȤƤ +リモート・デバッグ・サーバーの\fIホスト名\fRまたは\fIIP\fRアドレス。jsadebugd(1)を参照してください。 .RE .PP \fIserver\-id\fR .RS 4 -ʣΥǥХåСƱΥ⡼ȡۥȤǼ¹ԤƤΡץͭID +複数のデバッグ・サーバーが同一のリモート・ホストで実行している場合の、オプション固有のID。 .RE -.SH "" +.SH "説明" .PP -\fIjstack\fRޥɤϡꤵ줿Javaץեޤϥ⡼ȡǥХåСФJavaåɤJavaåȥ졼ϤޤJavaե졼ऴȤˡե륯饹̾᥽å̾Хȥɡǥå(bci)ӹֹ(Ѳǽʾ)Ϥޤ\fI\-m\fRץѤȡ\fIjstack\fRޥɤϡ٤ƤΥåɤJavaե졼ȥͥƥ֡ե졼ξ򡢥ץࡦ(PC)ȤȤ˽Ϥޤͥƥ֡ե졼ऴȤˡPC˺Ǥᤤͥƥ֡ܥ(Ѳǽʾ)ϤޤC++ʬ̾ʬޤC++̾ʬˤϡΥޥɤνϤ\fIc++filt\fR˥ѥפޤꤵ줿ץ64ӥåJavaۥޥǼ¹ԤƤϡ\fI\-J\-d64\fRץꤹɬפޤ(: -\fIjstack \-J\-d64 \-m pid\fR) +\fIjstack\fRコマンドは、指定されたJavaプロセス、コア・ファイルまたはリモート・デバッグ・サーバーに対するJavaスレッドのJavaスタック・トレースを出力します。Javaフレームごとに、フルクラス名、メソッド名、バイトコード・インデックス(bci)、および行番号(利用可能な場合)が出力されます。\fI\-m\fRオプションを使用すると、\fIjstack\fRコマンドは、すべてのスレッドのJavaフレームとネイティブ・フレームの両方を、プログラム・カウンタ(PC)とともに出力します。ネイティブ・フレームごとに、PCに最も近いネイティブ・シンボル(利用可能な場合)が出力されます。C++分解名は分解解除されません。C++名を分解解除するには、このコマンドの出力を\fIc++filt\fRにパイプします。指定されたプロセスが64ビットJava仮想マシン上で実行されている場合は、\fI\-J\-d64\fRオプションを指定する必要があります(例: +\fIjstack \-J\-d64 \-m pid\fR)。 .PP -\fB\fR -Υ桼ƥƥϥݡоݳǤꡢJDKΥ꡼ǤѤǤʤʤǽޤdbgeng\&.dllե뤬¸ߤƤʤWindowsƥǤϡDebugging Tools For Windows򥤥󥹥ȡ뤷ʤȤΥġ뤬ưޤ󡣤ޤ\fIPATH\fRĶѿˤϡåȡץˤäƻѤjvm\&.dllξꡢޤϥå塦סե뤬줿꤬ޤޤ褦ˤƤ򼨤ޤ +\fB注意\fR +このユーティリティはサポート対象外であり、将来のJDKのリリースでは利用できなくなる可能性があります。dbgeng\&.dllファイルが存在していないWindowsシステムでは、Debugging Tools For Windowsをインストールしないとこれらのツールが正常に動作しません。また、\fIPATH\fR環境変数には、ターゲット・プロセスによって使用されるjvm\&.dllの場所、またはクラッシュ・ダンプ・ファイルが生成された場所が含まれるようにしてください。次に例を示します。 .sp .if n \{\ .RS 4 @@ -128,39 +128,39 @@ set PATH=<jdk>\ejre\ebin\eclient;%PATH% .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-F .RS 4 \fIjstack\fR [\fI\-l\fR] -\fIpid\fRʤ˥åפޤ +\fIpid\fRが応答しない場合にスタック・ダンプを強制します。 .RE .PP \-l .RS 4 -ĹΥꥹȡͭ\fIjava\&.util\&.concurrent\fRνͭǤ륷󥯥ʥΰʤɡåˤĤƤɲþޤhttp://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.htmlˤ -\fIAbstractOwnableSynchronizer\fR饹Ҥ򻲾ȤƤ +長形式のリスト。所有\fIjava\&.util\&.concurrent\fRの所有できるシンクロナイザの一覧など、ロックについての追加情報を印刷します。http://docs\&.oracle\&.com/javase/8/docs/api/java/util/concurrent/locks/AbstractOwnableSynchronizer\&.htmlにある +\fIAbstractOwnableSynchronizer\fRクラス記述を参照してください .RE .PP \-m .RS 4 -JavaӥͥƥC/C++ե졼ξĺ⡼ɤΥåȥ졼Ϥޤ +JavaおよびネイティブC/C++フレームの両方を持つ混合モードのスタック・トレースを出力します。 .RE .PP \-h .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE .PP \-help .RS 4 -إסåϤޤ +ヘルプ・メッセージが出力されます。 .RE -.SH "ΤԶ" +.SH "既知の不具合" .PP -⡼ɤΥåȥ졼Ǥϡ\fI\-m\fRץϥ⡼ȡǥХåСǤϵǽޤ -.SH "Ϣ" +混合モードのスタック・トレースでは、\fI\-m\fRオプションはリモート・デバッグ・サーバーでは機能しません。 +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 index 046a2f37b7f..cf8321c9d6a 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstat .\" Language: English -.\" Date: 2011ǯ510 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2011年5月10日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstat" "1" "2011ǯ510" "JDK 8" "˥󥰡ġ" +.TH "jstat" "1" "2011年5月10日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstat \- Javaۥޥ(JVM)פƻ뤷ޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstat \- Java仮想マシン(JVM)の統計を監視します。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ jstat \- Java .PP \fIgeneralOption\fR .RS 4 -ñȤǻѤŪʥޥɥ饤󡦥ץǤ(\fI\-help\fRޤ\fI\-options\fR)Ūʥץ򻲾ȤƤ +単独で使用する一般的なコマンドライン・オプションです(\fI\-help\fRまたは\fI\-options\fR)。一般的なオプションを参照してください。 .RE .PP \fIoutputOptions\fR .RS 4 -ñ\fIstatOption\fR\fI\-t\fR\fI\-h\fR\fI\-J\fRΤ줫Υץǹ1İʾνϥץ󡣽ϥץ򻲾ȤƤ +単一の\fIstatOption\fRと\fI\-t\fR、\fI\-h\fRおよび\fI\-J\fRのいずれかのオプションで構成される1つ以上の出力オプション。出力オプションを参照してください。 .RE .PP \fIvmid\fR .RS 4 -åJVM򼨤ʸǤ벾ۥޥ̻ҤǤŪʹʸϼΤȤǤ +ターゲットJVMを示す文字列である仮想マシン識別子です。一般的な構文は次のとおりです。 .sp .if n \{\ .RS 4 @@ -85,24 +85,24 @@ jstat \- Java .if n \{\ .RE .\} -\fIvmid\fRʸιʸϡURIιʸбƤޤ\fIvmid\fRʸϡJVMɽñ顢̿ץȥ롢ݡֹ桢¾μͭͤ򼨤ʣʹ¤ޤǡ͡˰ۤʤޤۥޥ̻Ҥ򻲾ȤƤ +\fIvmid\fR文字列の構文は、URIの構文に対応しています。\fIvmid\fR文字列は、ローカルJVMを表す単純な整数から、通信プロトコル、ポート番号、および他の実装固有の値を示す複雑な構造まで、様々に異なります。仮想マシン識別子を参照してください。 .RE .PP \fIinterval\fR [s|ms] .RS 4 -(s)ޤϥߥ(ms)Τꤷñ̤ǤΥץ󥰴ֳ֤ǤǥեȤñ̤ϥߥäǤˤɬפޤꤷ硢\fIjstat\fRޥɤϳƴֳ֤ǽϤޤ +秒(s)またはミリ秒(ms)のうち指定した単位でのサンプリング間隔です。デフォルトの単位はミリ秒です。正の整数にする必要があります。指定した場合、\fIjstat\fRコマンドは各間隔で出力を生成します。 .RE .PP \fIcount\fR .RS 4 -ɽ륵ץǤǥե̵ͤ¤ǡåJVMλޤǡޤ\fIjstat\fRޥɤλޤǡ\fIjstat\fRޥɤץǡɽޤͤϡǤɬפޤ +表示するサンプル数です。デフォルト値は無限で、ターゲットJVMが終了するまで、または\fIjstat\fRコマンドが終了するまで、\fIjstat\fRコマンドは統計データを表示します。この値は、正の整数である必要があります。 .RE -.SH "" +.SH "説明" .PP -\fIjstat\fRޥɤϡ֤ƤJava HotSpot VMΥѥեޥץǡɽޤåJVMϡۥޥ̻Ҥޤ\fIvmid\fRץˤäƼ̤ޤ -.SH "ۥޥ̻" +\fIjstat\fRコマンドは、設置されているJava HotSpot VMのパフォーマンス統計データを表示します。ターゲットJVMは、仮想マシン識別子または\fIvmid\fRオプションによって識別されます。 +.SH "仮想マシン識別子" .PP -\fIvmid\fRʸιʸϡURIιʸбƤޤ +\fIvmid\fR文字列の構文は、URIの構文に対応しています。 .sp .if n \{\ .RS 4 @@ -116,380 +116,380 @@ jstat \- Java .PP \fIprotocol\fR .RS 4 -̿ץȥǤ\fIprotocol\fRͤά졢ۥ̾ꤵƤʤ硢ǥեȤΥץȥ뤬ץåȥեͭκŬ줿롦ץȥˤʤޤ\fIprotocol\fRͤά졢ۥ̾ꤵƤϡǥեȡץȥ\fIrmi\fRˤʤޤ +通信プロトコルです。\fIprotocol\fR値が省略され、ホスト名が指定されていない場合、デフォルトのプロトコルが、プラットフォーム固有の最適化されたローカル・プロトコルになります。\fIprotocol\fR値が省略され、ホスト名が指定されている場合は、デフォルト・プロトコルは\fIrmi\fRになります。 .RE .PP \fIlvmid\fR .RS 4 -åJVMΥ벾ۥޥ̻ҤǤ\fIlvmid\fRϡƥJVMդ˼̤ץåȥեͭͤǤ\fIlvmid\fRϡۥޥ̻ҤͣɬǤǤ\fIlvmid\fRϡŪˤϥåJVMץФ륪ڥ졼ƥ󥰡ƥΥץ̻ҤǤɬ⤽ǤȤϸ¤ޤ\fIjps\fRޥɤѤơ\fIlvmid\fRǤޤޤUNIXץåȥեǤ\fIps\fRޥɤѤơWindowsǤWindowsޥ͡Ѥơ\fIlvmid\fRǤޤ +ターゲットJVMのローカル仮想マシン識別子です。\fIlvmid\fRは、システム上のJVMを一意に識別するプラットフォーム固有の値です。\fIlvmid\fRは、仮想マシン識別子の唯一の必須要素です。\fIlvmid\fRは、一般的にはターゲットJVMプロセスに対するオペレーティング・システムのプロセス識別子ですが、必ずしもそうであるとは限りません。\fIjps\fRコマンドを使用して、\fIlvmid\fRを特定できます。また、UNIXプラットフォームでは\fIps\fRコマンドを使用して、WindowsではWindowsタスク・マネージャを使用して、\fIlvmid\fRを特定できます。 .RE .PP \fIhostname\fR .RS 4 -åȡۥȤ򼨤ۥ̾ޤIPɥ쥹Ǥ\fIhostname\fRͤάƤϡåȡۥȤϥ롦ۥȤˤʤޤ +ターゲット・ホストを示すホスト名またはIPアドレスです。\fIhostname\fR値が省略されている場合は、ターゲット・ホストはローカル・ホストになります。 .RE .PP \fIport\fR .RS 4 -⡼ȡС̿뤿ΥǥեȡݡȤǤ\fIhostname\fRͤάƤ뤫Ŭ줿롦ץȥ뤬\fIprotocol\fRͤ˻ꤵƤ硢\fIport\fR̵ͤ뤵ޤʳξ硢\fIport\fRѥ᡼ΰϡˤäưۤʤޤǥեȤ\fIrmi\fRץȥξ硢ݡͤϡ⡼ȡۥȾrmiregistryΥݡֹ򼨤ޤ\fIport\fRͤά졢\fIprotocol\fRͤ\fIrmi\fRꤵƤ硢ǥեȤrmiregistryݡ(1099)Ѥޤ +リモート・サーバーと通信するためのデフォルト・ポートです。\fIhostname\fR値が省略されているか、最適化されたローカル・プロトコルが\fIprotocol\fR値に指定されている場合、\fIport\fR値は無視されます。それ以外の場合、\fIport\fRパラメータの扱いは、実装によって異なります。デフォルトの\fIrmi\fRプロトコルの場合、ポート値は、リモート・ホスト上のrmiregistryのポート番号を示します。\fIport\fR値が省略され、\fIprotocol\fR値で\fIrmi\fRが指定されている場合、デフォルトのrmiregistryポート(1099)が使用されます。 .RE .PP \fIservername\fR .RS 4 -\fIservername\fRѥ᡼ΰϡˤäưۤʤޤŬ줿롦ץȥξ硢Υեɤ̵뤵ޤ\fIrmi\fRץȥξ硢ϡ⡼ȡۥȾRMI꥽֥Ȥ̾ɽޤ +\fIservername\fRパラメータの扱いは、実装によって異なります。最適化されたローカル・プロトコルの場合、このフィールドは無視されます。\fIrmi\fRプロトコルの場合、これは、リモート・ホスト上のRMIリソース・オブジェクトの名前を表します。 .RE -.SH "ץ" +.SH "オプション" .PP -\fIjstat\fRޥɤϡŪʥץȽϥץ2ĤΥפΥץ򥵥ݡȤƤޤŪʥץѤ硢\fIjstat\fRޥɤϴñʻΨӥСɽޤϥץˤäơץǡϤƤȷޤޤ +\fIjstat\fRコマンドは、一般的なオプションと出力オプションの2つのタイプのオプションをサポートしています。一般的なオプションを使用した場合、\fIjstat\fRコマンドは簡単な使用率およびバージョン情報を表示します。出力オプションによって、統計データ出力の内容と形式が決まります。 .PP -٤ƤΥץȤεǽϡΥ꡼ѹޤѻߤǽޤ -.SS "Ūʥץ" +すべてのオプションとその機能は、将来のリリースで変更または廃止される可能性があります。 +.SS "一般的なオプション" .PP -줫ΰŪʥץꤷ硢¾Υץޤϥѥ᡼ϰڻǤޤ +いずれかの一般的なオプションを指定した場合、他のオプションまたはパラメータは一切指定できません。 .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE .PP \-options .RS 4 -StaticץΥꥹȤɽޤϥץ򻲾ȤƤ +Staticオプションのリストを表示します。出力オプションを参照してください。 .RE -.SS "ϥץ" +.SS "出力オプション" .PP -ŪʥץꤷʤˡϥץǤޤϥץϡ\fIjstat\fRޥɤνϤƤȷꤷñ\fIstatOption\fRȤ줫νϥץ(\fI\-h\fR\fI\-t\fR\fI\-J\fR)ǹޤ\fIstatOption\fRϺǽ˵Ҥɬפޤ +一般的なオプションを指定しない場合に、出力オプションを指定できます。出力オプションは、\fIjstat\fRコマンドの出力の内容と形式を決定し、単一の\fIstatOption\fRといずれかの出力オプション(\fI\-h\fR、\fI\-t\fRおよび\fI\-J\fR)で構成されます。\fIstatOption\fRは最初に記述する必要があります。 .PP -Ϥϡ󤬶Ƕڤ줿ɽηˤʤޤȥޤإåԤˤäơΰ̣狼ޤإåɽ٤ꤹˤϡ\fI\-h\fRץѤޤΥإå̾ϡ͡ʥץ֤ǰݤƤޤ̤ˡ2ĤΥץƱ̾󤬻ѤƤС2ĤΥǡƱǤ +出力は、各列が空白で区切られた表の形式になります。タイトルを含むヘッダー行によって、各列の意味がわかります。ヘッダーの表示頻度を設定するには、\fI\-h\fRオプションを使用します。列のヘッダー名は、様々なオプション間で一貫性が保たれています。一般に、2つのオプションで同じ名前の列が使用されていれば、2つの列のデータ・ソースは同じです。 .PP -\fI\-t\fRץѤȡTimestampȤ٥դॹפ󤬡ϤκǽȤɽޤTimestampˤϡåJVMεưηв֤ñ̤ɽޤॹפ٤ϡ͡װˤäưۤʤꡢ̤٤ΤäƥǤΥåɡ塼ٱˤưޤ +\fI\-t\fRオプションを使用すると、Timestampというラベルの付いたタイムスタンプの列が、出力の最初の列として表示されます。Timestamp列には、ターゲットJVMの起動からの経過時間が、秒単位で表示されます。タイムスタンプの精度は、様々な要因によって異なり、大量の負荷のかかったシステムでのスレッド・スケジュールの遅延により変動します。 .PP -intervalcountѥ᡼Ѥơ\fIjstat\fRޥɤνϤɽ٤Ȳ򤽤줾ꤷޤ +intervalおよびcountパラメータを使用して、\fIjstat\fRコマンドがその出力を表示する頻度と回数をそれぞれ指定します。 .PP -\fB:\fR -Υ꡼Ǥηѹǽ뤿ᡢ\fIjstat\fRޥɤνϤϤ륹ץȤϺʤǤ\fIjstat\fRޥɤνϤϤ륹ץȤϡΥġξΥ꡼ǡΥץȤѹɬפ뤳ȤαդƤ +\fB注意:\fR +将来のリリースでこの形式は変更される可能性があるため、\fIjstat\fRコマンドの出力を解析するスクリプトは作成しなでください。\fIjstat\fRコマンドの出力を解析するスクリプトを作成する場合は、このツールの将来のリリースで、そのスクリプトを変更する必要があることに留意してください。 .PP \-\fIstatOption\fR .RS 4 -\fIjstat\fRޥɤɽץǡꤷޤˡѲǽʥץΰ򼨤ޤΥץåȥեࡦ󥹥ȡΥץɽˤϡŪʥץ\fI\-options\fRѤޤStatץ󤪤ӽϤ򻲾ȤƤ +\fIjstat\fRコマンドが表示する統計データ情報を指定します。次に、利用可能なオプションの一覧を示します。特定のプラットフォーム・インストールのオプションを一覧表示するには、一般的なオプションの\fI\-options\fRを使用します。Statオプションおよび出力を参照してください。 .sp -\fIclass\fR: 饹ư˴ؤץǡɽޤ +\fIclass\fR: クラス・ローダーの動作に関する統計データを表示します。 .sp -\fIcompiler\fR: Java HotSpot VM Just\-in\-Timeѥư˴ؤץǡɽޤ +\fIcompiler\fR: Java HotSpot VM Just\-in\-Timeコンパイラの動作に関する統計データを表示します。 .sp -\fIgc\fR: ١쥯Ȥ줿ҡפư˴ؤץǡɽޤ +\fIgc\fR: ガベージ・コレクトされたヒープの動作に関する統計データを表示します。 .sp -\fIgccapacity\fR: 头Ȥ̤бΰ˴ؤץǡɽޤ +\fIgccapacity\fR: 世代ごとの容量と対応する領域に関する統計データを表示します。 .sp -\fIgccause\fR: ١쥯ץǡΥޥ꡼(\fI\-gcutil\fRƱ)ȡľӸ(ŬѲǽʾ)Υ١쥯󡦥٥Ȥθɽޤ +\fIgccause\fR: ガベージ・コレクション統計データのサマリー(\fI\-gcutil\fRと同じ)と、直前および現在(適用可能な場合)のガベージ・コレクション・イベントの原因を表示します。 .sp -\fIgcnew\fR: Newư˴ؤץǡɽޤ +\fIgcnew\fR: New世代の動作に関する統計データを表示します。 .sp -\fIgcnewcapacity\fR: NewΥбΰ˴ؤץǡɽޤ +\fIgcnewcapacity\fR: New世代のサイズと対応する領域に関する統計データを表示します。 .sp -\fIgcold\fR: Oldưȥ᥿ڡ˴ؤץǡɽޤ +\fIgcold\fR: Old世代の動作とメタスペースに関する統計データを表示します。 .sp -\fIgcoldcapacity\fR: OldΥ˴ؤץǡɽޤ +\fIgcoldcapacity\fR: Old世代のサイズに関する統計データを表示します。 .sp -\fIgcmetacapacity\fR: ᥿ڡΥ˴ؤץǡɽޤ +\fIgcmetacapacity\fR: メタスペースのサイズに関する統計データを表示します。 .sp -\fIgcutil\fR: ١쥯Υޥ꡼˴ؤץǡɽޤ +\fIgcutil\fR: ガベージ・コレクションのサマリーに関する統計データを表示します。 .sp -\fIprintcompilation\fR: Java HotSpot VMѥ롦᥽åɤץǡɽޤ +\fIprintcompilation\fR: Java HotSpot VMコンパイル・メソッドの統計データを表示します。 .RE .PP \-h \fIn\fR .RS 4 -\fIn\fRץ(Ϲ)Ȥإåɽޤǡ\fIn\fRͤǤǥեͤ0Ǥξ硢ǡκǽιԤξإåɽޤ +\fIn\fRサンプル(出力行)ごとに列ヘッダーを表示します。ここで、\fIn\fRは正の整数値です。デフォルト値は0です。この場合、データの最初の行の上に列ヘッダーが表示されます。 .RE .PP \-t .RS 4 -ॹϤκǽȤɽޤॹפϡåJVMεưηв֤Ǥ +タイムスタンプ列を出力の最初の列として表示します。タイムスタンプは、ターゲットJVMの起動時からの経過時間です。 .RE .PP \-J\fIjavaOption\fR .RS 4 -\fIjavaOption\fRJavaץꥱưġϤޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤץδʥꥹȤˤĤƤϡjava(1)򻲾ȤƤ +\fIjavaOption\fRをJavaアプリケーション起動ツールに渡します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。オプションの完全なリストについては、java(1)を参照してください。 .RE -.SS "Statץ󤪤ӽ" +.SS "Statオプションおよび出力" .PP -ξϡ\fIjstat\fRޥɤ\fIstatOption\fRˤĤƽϤޤȤ᤿ΤǤ +次の情報は、\fIjstat\fRコマンドが各\fIstatOption\fRについて出力する列をまとめたものです。 .PP \-class \fIoption\fR .RS 4 -饹ץǡ +クラス・ローダーの統計データ。 .sp -\fILoaded\fR: ɤ줿饹ο +\fILoaded\fR: ロードされたクラスの数。 .sp -\fIBytes\fR: ɤ줿KBο +\fIBytes\fR: ロードされたKBの数。 .sp -\fIUnloaded\fR: ɤ줿饹ο +\fIUnloaded\fR: アンロードされたクラスの数。 .sp -\fIBytes\fR: ɤ줿KBο +\fIBytes\fR: アンロードされたKBの数。 .sp -\fITime\fR: 饹Υɤ䥢ɽפ֡ +\fITime\fR: クラスのロードやアンロード処理に要した時間。 .RE .PP \-compiler \fIoption\fR .RS 4 -Java HotSpot VM Just\-in\-Timeѥץǡ +Java HotSpot VM Just\-in\-Timeコンパイラの統計データ。 .sp -\fICompiled\fR: ¹Ԥ줿ѥ롦ο +\fICompiled\fR: 実行されたコンパイル・タスクの数。 .sp -\fIFailed\fR: Ԥѥ롦ο +\fIFailed\fR: 失敗したコンパイル・タスクの数。 .sp -\fIInvalid\fR: ̵ˤ줿ѥ롦ο +\fIInvalid\fR: 無効にされたコンパイル・タスクの数。 .sp -\fITime\fR: ѥ롦μ¹Ԥפ֡ +\fITime\fR: コンパイル・タスクの実行に要した時間。 .sp -\fIFailedType\fR: Ǹ˼ԤѥΥѥ롦ס +\fIFailedType\fR: 最後に失敗したコンパイルのコンパイル・タイプ。 .sp -\fIFailedMethod\fR: Ǹ˼ԤѥΥ饹̾ȥ᥽åɡ +\fIFailedMethod\fR: 最後に失敗したコンパイルのクラス名とメソッド。 .RE .PP \-gc \fIoption\fR .RS 4 -١쥯Ȥ줿ҡפץǡ +ガベージ・コレクトされたヒープの統計データ。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIS0U\fR: Survivorΰ0λΨ(KB) +\fIS0U\fR: Survivor領域0の使用率(KB)。 .sp -\fIS1U\fR: Survivorΰ1λΨ(KB) +\fIS1U\fR: Survivor領域1の使用率(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIEU\fR: EdenΰλΨ(KB) +\fIEU\fR: Eden領域の使用率(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIOU\fR: OldΰλΨ(KB) +\fIOU\fR: Old領域の使用率(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIMU\fR: ᥿ڡλΨ(KB) +\fIMU\fR: メタスペースの使用率(KB)。 .sp -\fIYGC\fR: 㤤Υ١쥯󡦥٥Ȥο +\fIYGC\fR: 若い世代のガベージ・コレクション・イベントの数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gccapacity \fIoption\fR .RS 4 -꡼ס太ΰ̡ +メモリー・プール世代および領域容量。 .sp -\fINGCMN\fR: NewκǾ(KB) +\fINGCMN\fR: New世代の最小容量(KB)。 .sp -\fINGCMX\fR: Newκ(KB) +\fINGCMX\fR: New世代の最大容量(KB)。 .sp -\fINGC\fR: Newθߤ(KB) +\fINGC\fR: New世代の現在の容量(KB)。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIOGCMN\fR: OldκǾ(KB) +\fIOGCMN\fR: Old世代の最小容量(KB)。 .sp -\fIOGCMX\fR: Oldκ(KB) +\fIOGCMX\fR: Old世代の最大容量(KB)。 .sp -\fIOGC\fR: Oldθߤ(KB) +\fIOGC\fR: Old世代の現在の容量(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIMCMN\fR: ᥿ڡκǾ(KB) +\fIMCMN\fR: メタスペースの最小容量(KB)。 .sp -\fIMCMX\fR: ᥿ڡκ(KB) +\fIMCMX\fR: メタスペースの最大容量(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .RE .PP \-gccause \fIoption\fR .RS 4 -Υץϡ\fI\-gcutil\fRץƱ١쥯ץǡΥޥ꡼ɽޤǸΥ١쥯󡦥٥Ȥ(ŬѲǽʾ)ߤΥ١쥯󡦥٥Ȥθޤޤޤ\fI\-gcutil\fRǰɽΤۤΥץǤϼɲäޤ +このオプションは、\fI\-gcutil\fRオプションと同じガベージ・コレクション統計データのサマリーを表示しますが、最後のガベージ・コレクション・イベントと(適用可能な場合は)現在のガベージ・コレクション・イベントの原因が含まれます。\fI\-gcutil\fRで一覧表示される列のほか、このオプションでは次の列が追加されます。 .sp -١쥯󡦥٥Ȥޤ६١쥯ץǡ +ガベージ・コレクション・イベントを含むガベージ・コレクション統計データ。 .sp -\fILGCC\fR: ǸΥ١쥯θ +\fILGCC\fR: 最後のガベージ・コレクションの原因。 .sp -\fIGCC\fR: ߤΥ١쥯θ +\fIGCC\fR: 現在のガベージ・コレクションの原因。 .RE .PP \-gcnew \fIoption\fR .RS 4 -Newץǡ +New世代の統計データ。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIS0U\fR: Survivorΰ0λΨ(KB) +\fIS0U\fR: Survivor領域0の使用率(KB)。 .sp -\fIS1U\fR: Survivorΰ1λΨ(KB) +\fIS1U\fR: Survivor領域1の使用率(KB)。 .sp -\fITT\fR: Ʋꤷ͡ +\fITT\fR: 殿堂入りしきい値。 .sp -\fIMTT\fR: Ʋꤷ͡ +\fIMTT\fR: 最大殿堂入りしきい値。 .sp -\fIDSS\fR: ŬڤSurvivor(KB) +\fIDSS\fR: 適切なSurvivorサイズ(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIEU\fR: EdenΰλΨ(KB) +\fIEU\fR: Eden領域の使用率(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .RE .PP \-gcnewcapacity \fIoption\fR .RS 4 -Newΰ襵ץǡ +New世代領域サイズの統計データ。 .sp -NGCMN: NewκǾ(KB) +NGCMN: New世代の最小容量(KB)。 .sp -\fINGCMX\fR: Newκ(KB) +\fINGCMX\fR: New世代の最大容量(KB)。 .sp -\fINGC\fR: Newθߤ(KB) +\fINGC\fR: New世代の現在の容量(KB)。 .sp -\fIS0CMX\fR: Survivorΰ0κ(KB) +\fIS0CMX\fR: Survivor領域0の最大容量(KB)。 .sp -\fIS0C\fR: Survivorΰ0θߤ(KB) +\fIS0C\fR: Survivor領域0の現在の容量(KB)。 .sp -\fIS1CMX\fR: Survivorΰ1κ(KB) +\fIS1CMX\fR: Survivor領域1の最大容量(KB)。 .sp -\fIS1C\fR: Survivorΰ1θߤ(KB) +\fIS1C\fR: Survivor領域1の現在の容量(KB)。 .sp -\fIECMX\fR: Edenΰκ(KB) +\fIECMX\fR: Eden領域の最大容量(KB)。 .sp -\fIEC\fR: Edenΰθߤ(KB) +\fIEC\fR: Eden領域の現在の容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .RE .PP \-gcold \fIoption\fR .RS 4 -OldPermanentץǡ +OldおよびPermanent世代の統計データ。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIMU\fR: ᥿ڡλΨ(KB) +\fIMU\fR: メタスペースの使用率(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIOU\fR: OldΰλΨ(KB) +\fIOU\fR: Old領域の使用率(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcoldcapacity \fIoption\fR .RS 4 -Oldץǡ +Old世代の統計データ。 .sp -\fIOGCMN\fR: OldκǾ(KB) +\fIOGCMN\fR: Old世代の最小容量(KB)。 .sp -\fIOGCMX\fR: Oldκ(KB) +\fIOGCMX\fR: Old世代の最大容量(KB)。 .sp -\fIOGC\fR: Oldθߤ(KB) +\fIOGC\fR: Old世代の現在の容量(KB)。 .sp -\fIOC\fR: Oldΰθߤ(KB) +\fIOC\fR: Old領域の現在の容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcmetacapacity \fIoption\fR .RS 4 -Permanentץǡ +Permanent世代の統計データ。 .sp -\fIMCMN\fR: ᥿ڡκǾ(KB) +\fIMCMN\fR: メタスペースの最小容量(KB)。 .sp -\fIMCMX\fR: ᥿ڡκ(KB) +\fIMCMX\fR: メタスペースの最大容量(KB)。 .sp -\fIMC\fR: ᥿ڡ(KB) +\fIMC\fR: メタスペースの容量(KB)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-gcutil \fIoption\fR .RS 4 -١쥯ץǡΥޥ꡼ +ガベージ・コレクション統計データのサマリー .sp -\fIS0\fR: Survivorΰ0λΨ(ߤ̤Фѡơ) +\fIS0\fR: Survivor領域0の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIS1\fR: Survivorΰ1λΨ(ߤ̤Фѡơ) +\fIS1\fR: Survivor領域1の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIE\fR: EdenΰλΨ(ߤ̤Фѡơ) +\fIE\fR: Eden領域の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIO\fR: OldΰλΨ(ߤ̤Фѡơ) +\fIO\fR: Old領域の使用率(現在の容量に対するパーセンテージ)。 .sp -\fIM\fR: ᥿ڡλΨ(ΰθߤ̤Фѡơ) +\fIM\fR: メタスペースの使用率(領域の現在の容量に対するパーセンテージ)。 .sp -\fIYGC\fR: 㤤GC٥ȿ +\fIYGC\fR: 若い世代のGCイベント数。 .sp -\fIYGCT\fR: 㤤Υ١쥯֡ +\fIYGCT\fR: 若い世代のガベージ・コレクション時間。 .sp -\fIFGC\fR: եGC٥ȿ +\fIFGC\fR: フルGCイベント数。 .sp -\fIFGCT\fR: ե륬١쥯֡ +\fIFGCT\fR: フルガベージ・コレクション時間。 .sp -\fIGCT\fR: ١쥯֡ +\fIGCT\fR: ガベージ・コレクション総時間。 .RE .PP \-printcompilation \fIoption\fR .RS 4 -Java HotSpot VMѥ롦᥽åɤץǡ +Java HotSpot VMコンパイル・メソッドの統計データ。 .sp -\fICompiled\fR: Ƕᥳѥ뤵줿᥽åɤǼ¹Ԥ줿ѥ롦ο +\fICompiled\fR: 最近コンパイルされたメソッドで実行されたコンパイル・タスクの数。 .sp -\fISize\fR: Ƕᥳѥ뤵줿᥽åɤΥХȡɤΥХȿ +\fISize\fR: 最近コンパイルされたメソッドのバイト・コードのバイト数。 .sp -\fIType\fR: Ƕᥳѥ뤵줿᥽åɤΥѥ롦ס +\fIType\fR: 最近コンパイルされたメソッドのコンパイル・タイプ。 .sp -\fIMethod\fR: Ƕᥳѥ뤵줿᥽åɤꤹ륯饹̾ȥ᥽å̾饹̾Ǥϡ֤̾ζڤʸȤơɥå(\&.)Τ˥å(/)Ѥޤ᥽å̾ϡꤵ줿饹Υ᥽åɤǤ2ĤΥեɤηϡHotSpot -\fI\-XX:+PrintComplation\fRץбƤޤ +\fIMethod\fR: 最近コンパイルされたメソッドを特定するクラス名とメソッド名。クラス名では、名前空間の区切り文字として、ドット(\&.)のかわりにスラッシュ(/)が使用されます。メソッド名は、指定されたクラス内のメソッドです。これらの2つのフィールドの形式は、HotSpot +\fI\-XX:+PrintComplation\fRオプションと対応しています。 .RE -.SH "" +.SH "例" .PP -ιǤϡ21891\fIlvmid\fRĥJVM˥󥰤򼨤ޤ -.SS "gcutilץ" +この項では、21891の\fIlvmid\fRを持つローカルJVMをモニタリングする例を示します。 +.SS "gcutilオプション" .PP -Ǥϡlvmid 21891³ơ250ߥôֳ֤7ĤΥץ\-\fIgcutil\fRץǤλ˽äƽϤɽޤ +この例では、lvmid 21891に接続して、250ミリ秒間隔で7つのサンプルを取得し、\-\fIgcutil\fRオプションでの指定に従って出力を表示します。 .PP -νϤϡ㤤Υ쥯3ܤ4ܤΥץ֤ǹԤ줿Ȥ򼨤Ƥޤ쥯ˤ0\&.001ääƤꡢ֥ȤEdenΰ(E)Oldΰ(O)˾ʤᡢOldΰλΨ9\&.49%9\&.51%äƤޤSurvivorΰϡ쥯12\&.44%ѤƤޤ쥯λѤ7\&.74%ΤߤǤ +この例の出力は、若い世代のコレクションが3番目と4番目のサンプル間で行われたことを示しています。コレクションには0\&.001秒かかっており、オブジェクトがEden領域(E)からOld領域(O)に昇格したため、Old領域の使用率は9\&.49%から9\&.51%に増加しています。Survivor領域は、コレクション前は12\&.44%が使用されていましたが、コレクション後の使用は7\&.74%のみです。 .sp .if n \{\ .RS 4 @@ -508,13 +508,13 @@ jstat \-gcutil 21891 250 7 .if n \{\ .RE .\} -.SS "إåʸη֤" +.SS "列ヘッダー文字列の繰返し" .PP -Ǥϡlvmid 21891³ơ250ߥôֳ֤ǥץ\fI\-gcutil\fRץǤλ˽äƽϤɽޤˡ\fI\-h3\fRץѤơǡ3ɽ뤴ȤإåϤޤ +この例では、lvmid 21891に接続して、250ミリ秒間隔でサンプルを取得し、\fI\-gcutil\fRオプションでの指定に従って出力を表示します。さらに、\fI\-h3\fRオプションを使用して、データが3行表示されるごとに列ヘッダーを出力します。 .PP -Ǥϡإåʸη֤ɽƤۤ2ܤ3ܤΥץ֤Young GCԤ줿Ȥ狼ޤη³֤0\&.001äǤΥ쥯ǤϡSurvivorΰ0λΨ(S0U)ŬڤSurvivor(DSS)Ķ᤹뤳Ȥˤʤ륢ƥ֡ǡФޤη̡֥ȤϡOld(νϤˤɽ)ؾʤ졢Ʋꤷ(TT)312ع߳ʤޤ +この例では、ヘッダー文字列の繰返しが表示されているほか、2番目と3番目のサンプル間でYoung GCが行われたことがわかります。この継続時間は0\&.001秒でした。このコレクションでは、Survivor領域0の使用率(S0U)が適切なSurvivorサイズ(DSS)を超過することになるアクティブ・データが検出されました。この結果、オブジェクトは、Old世代(この出力には非表示)へ昇格され、殿堂入りしきい値(TT)が、31から2へ降格されました。 .PP -̤Υ쥯󤬡5ܤ6ܤΥץ֤ǹԤƤޤΥ쥯ǤϡSurvivorۤȤɸ줺Ʋꤷͤ31ᤷޤ +別のコレクションが、5番目と6番目のサンプル間で行われています。このコレクションでは、Survivorがほとんど見られず、殿堂入りしきい値を31に戻しました。 .sp .if n \{\ .RS 4 @@ -535,11 +535,11 @@ jstat \-gcnew \-h3 21891 250 .if n \{\ .RE .\} -.SS "ץ뤴ȤΥॹפ" +.SS "サンプルごとのタイムスタンプの挿入" .PP -Ǥϡlvmid21891³250ߥôֳ֤3ĤΥץƤޤ\fI\-t\fRץѤơǽ˥ץ뤴ȤΥॹפɽƤޤ +この例では、lvmid21891へ接続し、250ミリ秒間隔で3つのサンプルを取得しています。\fI\-t\fRオプションを使用して、最初の列にサンプルごとのタイムスタンプを表示しています。 .PP -TimestampˤϡåJVMεưηв֤ñ̤ǥݡȤƤޤˡ\fI\-gcoldcapacity\fRϤǤϡꥯȤޤϾʥꥯȤ뤤Ϥξ˥ҡפĥ뤿ӤˡOld(OGC)Oldΰ(OC)ȤäƤ뤳Ȥ狼ޤ81ܤΥե롦١쥯(FGC)θ塢Old(OGC)11,696 KB13820 KBäޤ(ΰ)κ̤ϡ60,544 KB (OGCMX)ʤΤǡޤĥǤ;͵ĤƤޤ +Timestamp列には、ターゲットJVMの起動時からの経過時間が、秒単位でレポートされています。さらに、\fI\-gcoldcapacity\fR出力では、割当リクエストまたは昇格リクエストあるいはその両方を満たすためにヒープが拡張するたびに、Old世代の容量(OGC)とOld領域の容量(OC)とが増加していることがわかります。81番目のフル・ガベージ・コレクション(FGC)の後、Old世代の容量(OGC)は11,696 KBから13820 KBに増加しました。この世代(および領域)の最大容量は、60,544 KB (OGCMX)なので、まだ拡張できる余裕が残されています。 .sp .if n \{\ .RS 4 @@ -553,11 +553,11 @@ Timestamp OGCMN OGCMX OGC OC YGC FGC FGCT GCT .if n \{\ .RE .\} -.SS "⡼JVMΥ󥹥ȥơδƻ" +.SS "リモートJVMのインストゥルメンテーションの監視" .PP -ϡ\fI\-gcutil\fRץѤơremote\&.domainȤƥlvmid 40496³ץñ̵̤¤˼Ƥޤ +この例は、\fI\-gcutil\fRオプションを使用して、remote\&.domainというシステム上のlvmid 40496に接続し、サンプルを秒単位で無期限に取得しています。 .PP -lvmidϡ⡼ȡۥȤ̾ȷ礵ơ\fI40496@remote\&.domain\fR\fIvmid\fRƤޤ̤Ȥơvmidϡ\fIrmi\fRץȥѤơ⡼ȡۥȾΥǥեȤ\fIjstatd\fRС̿ޤ\fIjstatd\fRСϡrmiregistryѤơǥեȤrmiregistryݡ(ݡ1099)˥Хɤ줿\fIremote\&.domain\fR֤ޤ +lvmidは、リモート・ホストの名前と結合されて、\fI40496@remote\&.domain\fRの\fIvmid\fRを構成しています。結果として、このvmidは、\fIrmi\fRプロトコルを使用して、リモート・ホスト上のデフォルトの\fIjstatd\fRサーバーと通信します。\fIjstatd\fRサーバーは、rmiregistryを使用して、デフォルトのrmiregistryポート(ポート1099)にバインドされた\fIremote\&.domain\fRに配置されます。 .sp .if n \{\ .RS 4 @@ -569,7 +569,7 @@ jstat \-gcutil 40496@remote\&.domain 1000 .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 index cfd8e4e4b82..e39a21cce5a 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jstatd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ˥󥰡ġ +.\" Date: 2013年11月21日 +.\" SectDesc: モニタリング・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jstatd" "1" "2013ǯ1121" "JDK 8" "˥󥰡ġ" +.TH "jstatd" "1" "2013年11月21日" "JDK 8" "モニタリング・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jstatd \- Javaۥޥ(JVM)˥⡼ȡ˥󥰡ġ뤬JVM³Ǥ褦ˤޤΥޥɤϻŪʤΤǡݡȤƤޤ -.SH "" +jstatd \- Java仮想マシン(JVM)をモニターし、リモート・モニタリング・ツールがJVMに接続できるようにします。このコマンドは試験的なもので、サポートされていません。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,47 +64,47 @@ jstatd \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIjstatd\fRޥɤϡ¬줿Java HotSpot VMκȽλ˥롦ƥǼ¹ԤƤJVMˡ⡼ȡ˥󥰡ġ뤬³Ǥ褦ˤ뤿Υ󥿥ե󶡤RMIСץꥱǤ +\fIjstatd\fRコマンドは、計測されたJava HotSpot VMの作成と終了をモニターし、ローカル・システム上で実行されているJVMに、リモート・モニタリング・ツールが接続できるようにするためのインタフェースを提供するRMIサーバー・アプリケーションです。 .PP -\fIjstatd\fRСǤϡ롦ۥȤRMI쥸ȥ꤬ɬפˤʤޤ\fIjstatd\fRСϥǥեȡݡȤǡޤ\fI\-p\fR -\fIport\fRץǻꤷݡȤǡRMI쥸ȥ³褦ȤޤRMI쥸ȥ꤬Ĥʤ硢\fI\-p\fR -\fIport\fRץǻꤵ줿ݡȡޤ\fI\-p\fR -\fIport\fRץ󤬾άƤϡǥեRMI쥸ȥ˥Хɤ줿\fIjstatd\fRץꥱˡ1ĤRMI쥸ȥ꤬ޤRMI쥸ȥκϡ\fI\-nr\fRץꤹ뤳ȤˤäߤǤޤ -.SH "ץ" +\fIjstatd\fRサーバーでは、ローカル・ホストにRMIレジストリが必要になります。\fIjstatd\fRサーバーはデフォルト・ポートで、または\fI\-p\fR +\fIport\fRオプションで指定したポートで、RMIレジストリに接続しようとします。RMIレジストリが見つからない場合、\fI\-p\fR +\fIport\fRオプションで指定されたポート、または\fI\-p\fR +\fIport\fRオプションが省略されている場合は、デフォルトRMIレジストリにバインドされた\fIjstatd\fRアプリケーション内に、1つのRMIレジストリが作成されます。内部RMIレジストリの作成は、\fI\-nr\fRオプションを指定することによって中止できます。 +.SH "オプション" .PP \-nr .RS 4 -¸RMI쥸ȥ꤬Ĥʤ硢\fIjstatd\fRץRMI쥸ȥʤ褦ˤޤ +既存のRMIレジストリが見つからない場合、\fIjstatd\fRプロセス内に内部RMIレジストリを作成しないようにします。 .RE .PP \-p \fIport\fR .RS 4 -RMI쥸ȥ꤬ͽۤݡֹǤĤʤϡ\fI\-nr\fRץ󤬻ꤵƤʤкޤ +RMIレジストリがあると予想されるポート番号です。見つからない場合は、\fI\-nr\fRオプションが指定されていなければ作成されます。 .RE .PP \-n \fIrminame\fR .RS 4 -RMI쥸ȥˤơ⡼RMI֥ȤХɤ̾Ǥǥե̾\fIJStatRemoteHost\fRǤʣ\fIjstatd\fRСƱۥȾǵưƤ硢ƥСΥݡȤRMI֥Ȥ̾ϡΥץꤹ뤳Ȥˤäơդ̾ˤ뤳ȤǤޤΥץѤ硢˥󥰡饤Ȥ\fIhostid\fR\fIvmid\fRʸˡΰդΥС̾ޤɬפޤ +RMIレジストリにおいて、リモートRMIオブジェクトがバインドされる名前です。デフォルト名は\fIJStatRemoteHost\fRです。複数の\fIjstatd\fRサーバーが同じホスト上で起動している場合、各サーバーのエクスポートしたRMIオブジェクトの名前は、このオプションを指定することによって、一意の名前にすることができます。ただし、このオプションを使用する場合、モニタリング・クライアントの\fIhostid\fRおよび\fIvmid\fR文字列に、その一意のサーバー名を含める必要があります。 .RE .PP \-J\fIoption\fR .RS 4 -JVM\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ\fIץ\fR1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +JVMに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されている\fIオプション\fRを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ƥ" +.SH "セキュリティ" .PP -\fIjstatd\fRСϡŬڤʥͥƥ֡JVMΤߤƻǤޤäơ\fIjstatd\fRץϡåJVMƱ桼ʤǼ¹ԤƤɬפޤUNIX١Υƥˤroot桼ʤɤΰΥ桼ʤϡƥǤդJVMˤäƥݡȤ줿󥹥ȥơؤΥäƤޤΤ褦ʻʤǼ¹ԤƤ\fIjstatd\fRץϡƥΤ٤ƤJVMƻǤޤƥ̤꤬ޤ +\fIjstatd\fRサーバーは、適切なネイティブ・アクセス権を持つJVMのみを監視できます。したがって、\fIjstatd\fRプロセスは、ターゲットJVMと同じユーザー資格で実行されている必要があります。UNIXベースのシステムにおけるrootユーザーなどの一部のユーザー資格は、システム上の任意のJVMによってエクスポートされたインストゥルメンテーションへのアクセス権を持っています。このような資格で実行されている\fIjstatd\fRプロセスは、システム上のすべてのJVMを監視できますが、セキュリティ上の別の問題が起こります。 .PP -\fIjstatd\fRСˤϡ⡼ȡ饤Ȥǧڵǽޤ󡣤Τᡢ\fIjstatd\fRСץ¹Ԥȡ\fIjstatd\fRץĤ٤ƤJVMˤ륤󥹥ȥơΥݡȤ򡢥ͥåȥΤ٤ƤΥ桼˸뤳Ȥˤʤޤ̵ʾ֤ϡĶˤäƤ˾ޤʤ礬Τǡä˼²ƯĶޤϰǤʤͥåȥǤϡ\fIjstatd\fRץưˡ롦ƥݥꥷƤɬפޤ +\fIjstatd\fRサーバーには、リモート・クライアントの認証機能がありません。そのため、\fIjstatd\fRサーバー・プロセスを実行すると、\fIjstatd\fRプロセスがアクセス権を持つすべてのJVMによるインストゥルメンテーションのエクスポートを、ネットワーク上のすべてのユーザーに公開することになります。この無防備な状態は、環境によっては望ましくない場合があるので、特に実稼働環境または安全でないネットワークでは、\fIjstatd\fRプロセスを起動する前に、ローカル・セキュリティ・ポリシーを検討する必要があります。 .PP -\fIjstatd\fRСϡ¾Υƥޥ͡㤬󥹥ȡ뤵Ƥʤˤϡ\fIRMISecurityPolicy\fRΥ󥹥󥹤򥤥󥹥ȡ뤷ޤΤᡢƥݥꥷեꤹɬפޤݥꥷեϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlˤ -֥ǥեȤPolicyμȥݥꥷեιʸפ˽򤷤Ƥɬפޤ +\fIjstatd\fRサーバーは、他のセキュリティ・マネージャがインストールされていない場合には、\fIRMISecurityPolicy\fRのインスタンスをインストールします。そのため、セキュリティ・ポリシー・ファイルを指定する必要があります。ポリシー・ファイルは、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlにある +「デフォルトのPolicyの実装とポリシー・ファイルの構文」に準拠している必要があります .PP -ΥݥꥷեǤϡƥ㳰ȯ\fIjstatd\fRС¹ԤǤޤΥݥꥷϡ٤ƤΥɡ١ؤΤ륢ǧݥꥷ⼫ͳ٤㤤Ǥ\fIjstatd\fRС¹Ԥ뤿˺ɬפʥΤߤǧݥꥷ⼫ͳ٤⤯ʤäƤޤ +次のポリシー・ファイルでは、セキュリティ例外を発生せずに\fIjstatd\fRサーバーを実行できます。このポリシーは、すべてのコード・ベースへのあらゆるアクセス権を認めるポリシーよりも自由度が低いですが、\fIjstatd\fRサーバーを実行するために最低限必要なアクセス権のみを認めるポリシーよりも自由度が高くなっています。 .sp .if n \{\ .RS 4 @@ -118,7 +118,7 @@ grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" { .RE .\} .PP -ΥݥꥷѤˤϡΥƥȤ\fIjstatd\&.all\&.policy\fRȤե˥ԡΤ褦\fIjstatd\fRС¹Ԥޤ +このポリシー設定を使用するには、このテキストを\fIjstatd\&.all\&.policy\fRというファイルにコピーし、次のように\fIjstatd\fRサーバーを実行します。 .sp .if n \{\ .RS 4 @@ -130,16 +130,16 @@ jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy .RE .\} .PP -긷ƥ»ܤ륵Ȥξ硢ࡦݥꥷեѤơοǤۥȤޤϥͥåȥ˥¤뤳ȤǤޤΤ褦ˡϡIPɥ쥹İ䤹ʤޤƥˤĤơޥݥꥷեǤнǤʤϡ\fIjstatd\fRС¹Ԥˡ\fIjstat\fR\fIjps\fRġǻѤ뤳ȤǤˡˤʤޤ -.SH "⡼ȡ󥿥ե" +より厳しいセキュリティを実施するサイトの場合、カスタム・ポリシー・ファイルを使用して、特定の信頼できるホストまたはネットワークにアクセスを制限することができます。ただし、このような方法は、IPアドレスの盗聴攻撃を受けやすくなります。セキュリティの問題について、カスタマイズしたポリシー・ファイルでも対処できない場合は、\fIjstatd\fRサーバーを実行せずに、\fIjstat\fRと\fIjps\fRツールをローカルで使用することが最も安全な方法になります。 +.SH "リモート・インタフェース" .PP -\fIjstatd\fRץݡȤ륤󥿥եϡȼ˳ȯΤǤѹͽǤ桼ӳȯԤϡΥ󥿥եؤνߤԤʤǤ -.SH "" +\fIjstatd\fRプロセスがエクスポートするインタフェースは、独自に開発したものであり変更される予定です。ユーザーおよび開発者は、このインタフェースへの書込みを行わないでください。 +.SH "例" .PP -ˡ\fIjstatd\fRޥɤ򼨤ޤ\fIjstatd\fRץȤˤäơСϥХå饦ɤǼưŪ˵ưޤ -.SS "RMI쥸ȥ" +次に、\fIjstatd\fRコマンドの例を示します。\fIjstatd\fRスクリプトによって、サーバーはバックグラウンドで自動的に起動します。 +.SS "内部RMIレジストリ" .PP -ϡRMI쥸ȥѤۥȤˤ\fIjstatd\fRåεưɽƤޤǤϡǥեȤRMI쥸ȥꡦݡ(ݡ1099)ˤϡ¾ΥСϥХɤƤʤꤷƤޤ +この例は、内部RMIレジストリを使用したホストによる\fIjstatd\fRセッションの起動を表しています。この例では、デフォルトのRMIレジストリ・ポート(ポート1099)には、他のサーバーはバインドされていないと想定しています。 .sp .if n \{\ .RS 4 @@ -150,9 +150,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .if n \{\ .RE .\} -.SS "RMI쥸ȥ" +.SS "外部RMIレジストリ" .PP -ϡRMI쥸ȥѤ\fIjstatd\fRåεưɽƤޤ +この例は、外部RMIレジストリを使用した\fIjstatd\fRセッションの起動を表しています。 .sp .if n \{\ .RS 4 @@ -165,7 +165,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .RE .\} .PP -Ǥϡݡ2020γRMI쥸ȥѤ\fIjstatd\fRåưޤ +この例では、ポート2020の外部RMIレジストリを使用して\fIjstatd\fRセッションを起動します。 .sp .if n \{\ .RS 4 @@ -178,7 +178,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020 .RE .\} .PP -Ǥϡݡ2020γRMI쥸ȥѤơ\fIAlternateJstatdServerName\fR˥ХɤƤ\fIjstatd\fRåưޤ +この例では、ポート2020の外部RMIレジストリを使用して、\fIAlternateJstatdServerName\fRにバインドされている\fIjstatd\fRセッションを起動します。 .sp .if n \{\ .RS 4 @@ -191,9 +191,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020 .if n \{\ .RE .\} -.SS "ץRMI쥸ȥκ" +.SS "インプロセスRMIレジストリの作成の停止" .PP -ǤϡRMI쥸ȥ꤬ʤ˺ʤ\fIjstatd\fRåưޤǤϡRMI쥸ȥ꤬Ǥ˼¹ԤƤꤷƤޤRMI쥸ȥ꤬¹ԤƤʤ硢顼åɽޤ +この例では、外部RMIレジストリがない場合に作成しない\fIjstatd\fRセッションを起動します。この例では、RMIレジストリがすでに実行されていると想定しています。RMIレジストリが実行されていない場合、エラー・メッセージが表示されます。 .sp .if n \{\ .RS 4 @@ -204,9 +204,9 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr .if n \{\ .RE .\} -.SS "RMI󥰤ͭ" +.SS "RMIロギングの有効化" .PP -ǤϡRMI󥰵ǽͭ\fIjstatd\fRåưޤˡϡȥ֥륷塼ƥ󥰤ޤϥСưΥ˥󥰤Ωޤ +この例では、RMIロギング機能を有効化して\fIjstatd\fRセッションを起動します。この方法は、トラブルシューティングまたはサーバー活動のモニタリングに役立ちます。 .sp .if n \{\ .RS 4 @@ -218,7 +218,7 @@ jstatd \-J\-Djava\&.security\&.policy=all\&.policy .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 b/jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 index d4d0d519bf6..91f1a90a25d 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/jvisualvm.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: jvisualvm .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaȥ֥륷塼ƥ󥰡ץե󥰡˥󥰤Ӵġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaトラブルシューティング、プロファイリング、モニタリングおよび管理ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "jvisualvm" "1" "2013ǯ1121" "JDK 8" "Javaȥ֥륷塼ƥ󥰡ץե󥰡˥" +.TH "jvisualvm" "1" "2013年11月21日" "JDK 8" "Javaトラブルシューティング、プロファイリング、モニタリン" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -jvisualvm \- JavaץꥱŪ˴ƻ롢ȥ֥륷塼Ȥӥץե뤷ޤ -.SH "" +jvisualvm \- Javaアプリケーションを視覚的に監視、トラブルシュートおよびプロファイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ jvisualvm \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -Java VisualVMϡꤵ줿Javaۥޥ(JVM)JavaƥΥ١Υץꥱ(Javaץꥱ)¹ԤƤȤˡJavaץꥱ˴ؤܺ٤ʾ󶡤ľŪʥե롦桼󥿥եǤJava VisualVMȤ̾ϡJava VisualVMJVMեȥ˴ؤŪ󶡤Ȥ¤ͳ褷Ƥޤ +Java VisualVMは、指定されたJava仮想マシン(JVM)でJavaテクノロジ・ベースのアプリケーション(Javaアプリケーション)が実行されているときに、そのJavaアプリケーションに関する詳細な情報を提供する直感的なグラフィカル・ユーザー・インタフェースです。Java VisualVMという名前は、Java VisualVMがJVMソフトウェアに関する情報を視覚的に提供するという事実に由来しています。 .PP -Java VisualVMϡĤΥ˥󥰡ȥ֥륷塼ƥ󥰤ӥץե󥰡桼ƥƥ1ĤΥġ礷ޤȤСɥ󡦥ġ\fIjmap\fR\fIjinfo\fR\fIjstat\fR\fIjstack\fR󶡤Ƥ뵡ǽΤۤȤɤJava VisualVMȤ߹ޤƤޤ\fIjconsole\fRޥɤˤä󶡤εǽʤɡ¾εǽϥץΥץ饰ȤɲäǤޤ +Java VisualVMは、いくつかのモニタリング、トラブルシューティングおよびプロファイリング・ユーティリティを1つのツールに統合します。たとえば、スタンドアロン・ツール\fIjmap\fR、\fIjinfo\fR、\fIjstat\fRおよび\fIjstack\fRで提供されている機能のほとんどが、Java VisualVMに組み込まれています。\fIjconsole\fRコマンドによって提供される一部の機能など、他の機能はオプションのプラグインとして追加できます。 .PP -Java VisualVMϡJavaץꥱγȯԤץꥱΥȥ֥륷塼ƥ󥰤ԤäꡢץꥱΥѥեޥ󥹤ƻ뤪ӲꤹΤΩޤJava VisualVMѤȡȯԤϥҡספӲϡ꡼꡼ꡢ١쥯μ¹ԤӴƻ롢ӥ꡼CPUδʰץץե󥰤μ¹Ԥǽˤʤޤץ饰Java VisualVMεǽĥǤޤȤС\fIjconsole\fRޥɤΤۤȤɤεǽϡMBeanץ֤JConsole Plug\-in Wrapperץ饰𤷤ƻѤǤޤɸJava VisualVMץ饰Υ򤹤ˤϡJava VisualVM˥塼\fB֥ġ\fR\fB֥ץ饰\fR򤷤ޤ +Java VisualVMは、Javaアプリケーションの開発者がアプリケーションのトラブルシューティングを行ったり、アプリケーションのパフォーマンスを監視および改善したりするのに役立ちます。Java VisualVMを使用すると、開発者はヒープ・ダンプの生成および解析、メモリー・リークの特定、ガベージ・コレクションの実行および監視、およびメモリーとCPUの簡易プロファイリングの実行が可能になります。プラグインでJava VisualVMの機能を拡張できます。たとえば、\fIjconsole\fRコマンドのほとんどの機能は、「MBean」タブおよびJConsole Plug\-in Wrapperプラグインを介して使用できます。標準のJava VisualVMプラグインのカタログから選択するには、Java VisualVMメニューの\fB「ツール」\fR、\fB「プラグイン」\fRを選択します。 .PP -Java VisualVMưˤϡΥޥɤ¹Ԥޤ +Java VisualVMを起動するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -85,15 +85,15 @@ Java VisualVM .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP -ΥץϡJava VisualVMưȤ˼¹Բǽˤʤޤ +次のオプションは、Java VisualVMを起動したときに実行可能になります。 .PP \-J\fIjvm_option\fR .RS 4 -\fIjvm_option\fRJVMեȥϤޤ +この\fIjvm_option\fRをJVMソフトウェアに渡します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -103,7 +103,7 @@ Java VisualVM .sp -1 .IP \(bu 2.3 .\} -Java VisualVMȯԤΥ +Java VisualVM開発者のサイト http://visualvm\&.java\&.net/ .RE .sp @@ -115,7 +115,7 @@ http://visualvm\&.java\&.net/ .sp -1 .IP \(bu 2.3 .\} -Java SEɥȤJava VisualVM +Java SEドキュメントのJava VisualVM (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/visualvm/index\&.html) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 b/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 index c19d4cf4e45..42f619fb8fe 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: keytool .\" Language: English -.\" Date: 2013ǯ86 -.\" SectDesc: ƥġ +.\" Date: 2013年8月6日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "keytool" "1" "2013ǯ86" "JDK 8" "ƥġ" +.TH "keytool" "1" "2013年8月6日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -keytool \- Ź沽X\&.509󤪤ӿǤޤ७ȥ(ǡ١)ޤ -.SH "" +keytool \- 暗号化鍵、X\&.509証明書チェーンおよび信頼できる証明書を含むキーストア(データベース)を管理します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,7 +64,7 @@ keytool \- .PP \fIcommands\fR .RS 4 -ޥɤ򻲾ȤƤΥޥɤϡΤ褦˥̤ʬवޤ +コマンドを参照してください。これらのコマンドは、次のようにタスク別に分類されます。 .sp .RS 4 .ie n \{\ @@ -74,7 +74,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ȥؤΥǡκޤɲ +キーストアへのデータの作成または追加 .sp .RS 4 .ie n \{\ @@ -140,7 +140,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -̤ΥȥƤΥݡ +別のキーストアの内容のインポート .sp .RS 4 .ie n \{\ @@ -162,7 +162,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ꥯȤ +証明書リクエストの生成 .sp .RS 4 .ie n \{\ @@ -184,7 +184,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ǡΥݡ +データのエクスポート .sp .RS 4 .ie n \{\ @@ -206,7 +206,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ǡɽ +データの表示 .sp .RS 4 .ie n \{\ @@ -261,7 +261,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ȥδ +キーストアの管理 .sp .RS 4 .ie n \{\ @@ -316,7 +316,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -إפɽ +ヘルプの表示 .sp .RS 4 .ie n \{\ @@ -330,18 +330,18 @@ keytool \- .RE .RE .RE -.SH "" +.SH "説明" .PP -\fIkeytool\fRޥɤϡȾ뤿Υ桼ƥƥǤˤꡢ桼ϼʬθ̩ΥڥӴϢǥ̾Ѥǧ(¾Υ桼ޤϥӥФƼʬȤǧڤ뤳)䡢ǡȾ˴ؤ륵ӥѤ뤳ȤǤޤ\fIkeytool\fRޥɤǤϡ̿Ƥԥθ򥭥å夹뤳ȤǤޤ(Υե) +\fIkeytool\fRコマンドは、鍵と証明書を管理するためのユーティリティです。これにより、ユーザーは自分の公開鍵と秘密鍵のペアおよび関連する証明書を管理し、デジタル署名を使用した自己認証(他のユーザーまたはサービスに対して自分自身を認証すること)や、データの整合性と証明書に関するサービスを利用することができます。\fIkeytool\fRコマンドでは、通信しているピアの公開鍵をキャッシュすることもできます(証明書のフォームで)。 .PP -Ȥϡ륨ƥƥ(ʪҤʤ)Υǥ̾դʸΤȤǤˤϡ¾Τ륨ƥƥθ(Ӥ¾ξ)̤ͤäƤ뤳Ȥ񤫤Ƥޤ(򻲾ȤƤ)ǡ˥ǥ̾դƤϡǥ̾򸡾ڤ뤳ȤǡǡӥǡʪǤ뤳ȤåǤޤǡȤϡǡѹ줿ꡢѤ줿ꤷƤʤȤ̣ޤޤǡʪǤȤϡΥǡǡƽ̾ȾΤʪϤ줿ǡǤ뤳Ȥ̣ޤ +証明書とは、あるエンティティ(人物、会社など)からのデジタル署名付きの文書のことです。証明書には、他のあるエンティティの公開鍵(およびその他の情報)が特別な値を持っていることが書かれています。(証明書を参照してください。)データにデジタル署名が付いている場合は、デジタル署名を検証することで、データの整合性およびデータが本物であることをチェックできます。データの整合性とは、データが変更されたり、改変されたりしていないことを意味します。また、データが本物であるとは、そのデータが、データを作成して署名したと称する人物から渡されたデータであることを意味します。 .PP -ޤ\fIkeytool\fRޥɤѤСоΰŹ沽/沽(DES)ǻѤ̩ӥѥե졼뤳ȤǤޤ +また、\fIkeytool\fRコマンドを使用すれば、対称暗号化/復号化(DES)で使用される秘密鍵およびパスフレーズを管理することもできます。 .PP -\fIkeytool\fRޥɤϡȾ򥭡ȥ˳Ǽޤȥ̾򻲾ȤƤ -.SH "ޥɤȥץ˴ؤ" +\fIkeytool\fRコマンドは、鍵と証明書をキーストアに格納します。キーストアの別名を参照してください。 +.SH "コマンドとオプションに関する注意" .PP -͡ʥޥɤȤˤĤƤϡޥɤ򻲾ȤƤ +様々なコマンドとその説明については、コマンドを参照してください。 .sp .RS 4 .ie n \{\ @@ -351,7 +351,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ɤΥޥ̾ӥץ̾ˤƬ˥ޥʥ(\-)դޤ +どのコマンド名およびオプション名にも先頭にマイナス記号(\-)が付きます。 .RE .sp .RS 4 @@ -362,7 +362,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ƥޥɤΥץǤդνǻǤޤ +各コマンドのオプションは任意の順序で指定できます。 .RE .sp .RS 4 @@ -373,7 +373,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -åΤˤʤäƤʤ٤Ƥιܡޤ楫åѥåǰϤޤƤ뤹٤ƤιܤϡΤȤ˻ꤹɬפޤ +イタリック体になっていないすべての項目、または中カッコか角カッコで囲まれているすべての項目は、そのとおりに指定する必要があります。 .RE .sp .RS 4 @@ -384,7 +384,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץϤ楫åϡΥץ򥳥ޥɥ饤ǻꤷʤäˡǥեͤѤ뤳Ȥ̣ޤץΥǥեͤ򻲾ȤƤ楫åϡ\fI\-v\fR\fI\-rfc\fR\fI\-J\fRץϤिˤѤޤΥץϥޥɥ饤ǻꤵ줿ˤΤ̣߰ޤꤵƤʤʳǥեͤϤޤ +オプションを囲む中カッコは、そのオプションをコマンドラインで指定しなかった場合に、デフォルト値が使用されることを意味します。オプションのデフォルト値を参照してください。中カッコは、\fI\-v\fR、\fI\-rfc\fRおよび\fI\-J\fRオプションを囲むためにも使用されますが、これらのオプションはコマンドラインで指定された場合にのみ意味を持ちます。指定されていない場合以外、デフォルト値はありません。 .RE .sp .RS 4 @@ -395,7 +395,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץϤѥåϡΥץ򥳥ޥɥ饤ǻꤷʤäˡͤϤ뤳Ȥ̣ޤ\fI\-keypass\fRץξ硢ץ򥳥ޥɥ饤ǻꤷʤäϡ\fIkeytool\fRޥɤޤȥΥѥɤѤ/̩ߤޤλߤԤ硢\fIkeytool\fRޥɤˤꡢ/̩ΥѥɤϤޤ +オプションを囲む角カッコは、そのオプションをコマンドラインで指定しなかった場合に、値の入力を求められることを意味します。\fI\-keypass\fRオプションの場合、オプションをコマンドラインで指定しなかった場合は、\fIkeytool\fRコマンドがまずキーストアのパスワードを使用して非公開/秘密鍵の復元を試みます。この試みが失敗した場合、\fIkeytool\fRコマンドにより、非公開/秘密鍵のパスワードの入力を求められます。 .RE .sp .RS 4 @@ -406,11 +406,11 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -åΤιܤμºݤ(ץ)ϡꤹɬפޤȤС\fI\-printcert\fRޥɤηϼΤȤǤ +イタリック体の項目の実際の値(オプションの値)は、指定する必要があります。たとえば、\fI\-printcert\fRコマンドの形式は次のとおりです。 .sp \fIkeytool \-printcert {\-file cert_file} {\-v}\fR .sp -\fI\-printcert\fRޥɤꤹϡ\fIcert_file\fRºݤΥե֤̾ޤ: +\fI\-printcert\fRコマンドを指定する場合は、\fIcert_file\fRを実際のファイル名で置き換えます。例: \fIkeytool \-printcert \-file VScert\&.cer\fR .RE .sp @@ -422,7 +422,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ץͤ˶(ڡ)ޤޤƤϡͤǰϤɬפޤ +オプションの値に空白(スペース)が含まれている場合は、値を引用符で囲む必要があります。 .RE .sp .RS 4 @@ -433,11 +433,11 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -\fI\-help\fRץ󤬥ǥեȤǤ\fIkeytool\fRޥɤϡ\fIkeytool \-help\fRƱǤ +\fI\-help\fRオプションがデフォルトです。\fIkeytool\fRコマンドは、\fIkeytool \-help\fRと同じです。 .RE -.SH "ץΥǥե" +.SH "オプションのデフォルト値" .PP -ǡ͡ʥץͤΥǥեͤ򼨤ޤ +次の例で、様々なオプション値のデフォルト値を示します。 .sp .if n \{\ .RS 4 @@ -474,7 +474,7 @@ keytool \- .RE .\} .PP -/̩ڥˤơ̾르ꥺ(\fI\-sigalg\fRץ)ϡˤʤ̩Υ르ꥺफޤ +公開/秘密鍵ペアの生成において、署名アルゴリズム(\fI\-sigalg\fRオプション)は、基になる秘密鍵のアルゴリズムから派生します。 .sp .RS 4 .ie n \{\ @@ -484,7 +484,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩DSAפǤϡ\fI\-sigalg\fRץΥǥեͤSHA1withDSAˤʤޤ +基になる秘密鍵がDSAタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA1withDSAになります。 .RE .sp .RS 4 @@ -495,7 +495,7 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩RSAפǤϡ\fI\-sigalg\fRץΥǥեͤSHA256withRSAˤʤޤ +基になる秘密鍵がRSAタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA256withRSAになります。 .RE .sp .RS 4 @@ -506,40 +506,40 @@ keytool \- .sp -1 .IP \(bu 2.3 .\} -ˤʤ̩ECפǤϡ\fI\-sigalg\fRץΥǥեͤSHA256withECDSAˤʤޤ +基になる秘密鍵がECタイプである場合は、\fI\-sigalg\fRオプションのデフォルト値はSHA256withECDSAになります。 .RE .PP -\fI\-keyalg\fR\fI\-sigalg\fRδʥꥹȤˤĤƤϡ -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAΡJava Cryptography Architecture (JCA) Reference Guideפ򻲾ȤƤ -.SH "̥ץ" +\fI\-keyalg\fRおよび\fI\-sigalg\fR引数の完全なリストについては、 +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html#AppAの「Java Cryptography Architecture (JCA) Reference Guide」を参照してください。 +.SH "一般オプション" .PP -\fI\-v\fRץϡ\fI\-help\fRޥɤ٤ƤΥޥɤǻѤǤޤ\fI\-v\fRץꤷ硢ޥɤϾĹ⡼ɤǼ¹Ԥ졢ܺ٤ʾ󤬽Ϥޤ +\fI\-v\fRオプションは、\fI\-help\fRコマンドを除くすべてのコマンドで使用できます。\fI\-v\fRオプションを指定した場合、コマンドは冗長モードで実行され、詳細な情報が出力されます。 .PP -ǤդΥޥɤǻǤ\fI\-Jjavaoption\fR⤢ޤ\fI\-Jjavaoption\fRꤷ硢ꤵ줿\fIjavaoption\fRʸJava󥿥ץ꥿ľϤޤΥץˤϡޤ뤳ȤϤǤޤ󡣤Υץϡ¹ԴĶޤϥ꡼ѤĴǤǤ륤󥿥ץ꥿ץɽˤϡޥɥ饤\fIjava \-h\fRޤ\fIjava \-X\fRϤƤ +任意のコマンドで指定できる\fI\-Jjavaoption\fR引数もあります。\fI\-Jjavaoption\fRを指定した場合、指定された\fIjavaoption\fR文字列がJavaインタプリタに直接渡されます。このオプションには、空白を含めることはできません。このオプションは、実行環境またはメモリー使用を調整する場合に便利です。指定できるインタプリタ・オプションを一覧表示するには、コマンドラインで\fIjava \-h\fRまたは\fIjava \-X\fRと入力してください。 .PP -ΥץϡȥФԤ٤ƤΥޥɤǻǤޤ +次のオプションは、キーストアに対する操作を行うすべてのコマンドで指定できます。 .PP \-storetype \fIstoretype\fR .RS 4 -νҤϡ󥹥󥹤륭ȥΥפꤷޤ +この修飾子は、インスタンスを生成するキーストアのタイプを指定します。 .RE .PP \-keystore \fIkeystore\fR .RS 4 -ȥξꤷޤ +キーストアの場所を指定します。 .sp -\fIkeytool\fRޥɤ¹ԤݤˡJKS -\fIstoretype\fRѤ졢ĥȥե뤬ޤ¸ߤƤʤä硢ȥե뤬ޤȤС\fIkeytool \-genkeypair\fRθƽФ\fI\-keystore\fRץ󤬻ꤵʤä硢\fI\&.keystore\fRȤ̾Υǥեȡȥե뤬桼Υۡࡦǥ쥯ȥˤޤ¸ߤƤʤС˺ޤƱͤˡ\fI\-keystore ks_file\fRȤץ󤬻ꤵƤ⤽ks_file¸ߤʤä硢Υե뤬ޤJKS -\fIstoretype\fRξܺ٤ϡ\fI\fRKeyStoreμȥ̾˴ؤ򻲾ȤƤ +特定の\fIkeytool\fRコマンドを実行する際に、JKS +\fIstoretype\fRが使用され、かつキーストア・ファイルがまだ存在していなかった場合、新しいキーストア・ファイルが作成されます。たとえば、\fIkeytool \-genkeypair\fRの呼出し時に\fI\-keystore\fRオプションが指定されなかった場合、\fI\&.keystore\fRという名前のデフォルト・キーストア・ファイルがユーザーのホーム・ディレクトリ内にまだ存在していなければ、そこに作成されます。同様に、\fI\-keystore ks_file\fRというオプションが指定されてもそのks_fileが存在しなかった場合、そのファイルが作成されます。JKS +\fIstoretype\fRの詳細は、\fIの\fRKeyStoreの実装キーストアの別名に関する項を参照してください。 .sp -\fI\-keystore\fRץ󤫤ϥȥ꡼ϡ\fIKeyStore\&.load\fR᥽åɤϤޤURLȤ\fINONE\fRꤵƤϡnullΥȥ꡼ब\fIKeyStore\&.load\fR᥽åɤϤޤ\fINONE\fRϡKeyStoreե١ǤϤʤ˻ꤷƤȤСϡɥȡ󡦥ǥХ¸ߤƤʤɤǤ +\fI\-keystore\fRオプションからの入力ストリームは、\fIKeyStore\&.load\fRメソッドに渡されます。URLとして\fINONE\fRが指定されている場合は、nullのストリームが\fIKeyStore\&.load\fRメソッドに渡されます。\fINONE\fRは、KeyStoreがファイルベースではない場合に指定してください。たとえば、ハードウェア・トークン・デバイス上に存在している場合などです。 .RE .PP \-storepass[:\fIenv\fR| :\fIfile\fR] argument .RS 4 -ȥݸ뤿˻Ѥѥɤꤷޤ +キーストアの整合性を保護するために使用するパスワードを指定します。 .sp -\fIenv\fRޤ\fIfile\fRꤷʤ硢ѥɤͤ\fIargument\fRˤʤޤͤϡ6ʸʾˤɬפޤʳξ硢ѥɤϼΤ褦ˤƼޤ +修飾子\fIenv\fRまたは\fIfile\fRを指定しない場合、パスワードの値は\fIargument\fRになります。この値は、6文字以上にする必要があります。それ以外の場合、パスワードは次のようにして取得されます。 .sp .RS 4 .ie n \{\ @@ -550,7 +550,7 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/Crypto .IP \(bu 2.3 .\} \fIenv\fR: -\fIargument\fRȤ̾δĶѿѥɤޤ +\fIargument\fRという名前の環境変数からパスワードを取得します。 .RE .sp .RS 4 @@ -561,119 +561,119 @@ http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/Crypto .sp -1 .IP \(bu 2.3 .\} -\fIfile\fR: argumentȤ̾Υե뤫ѥɤޤ +\fIfile\fR: argumentという名前のファイルからパスワードを取得します。 .RE .sp -\fB:\fR -\fI\-keypass\fR\fI\-srckeypass\fR\-\fIdestkeypass\fR\fI\-srcstorepass\fR\fI\-deststorepass\fRʤɤΥѥɤɬפȤ뤽¾ΥץϤ٤ơ\fIenv\fR\fIfile\fRҤդޤѥɡץȽҤϡɬ(:)ǶڤäƤ +\fB注意:\fR +\fI\-keypass\fR、\fI\-srckeypass\fR、\-\fIdestkeypass\fR、\fI\-srcstorepass\fR、\fI\-deststorepass\fRなどのパスワードを必要とするその他のオプションはすべて、\fIenv\fRおよび\fIfile\fR修飾子を受け付けます。パスワード・オプションと修飾子は、必ずコロン(:)で区切ってください。 .sp -ѥɤϡȥƤ˥뤹٤ƤΥޥɤǻѤޤμΥޥɤ¹ԤȤˡޥɥ饤\fI\-storepass\fRץꤷʤäϡѥɤϤޤ +パスワードは、キーストアの内容にアクセスするすべてのコマンドで使用されます。この種のコマンドを実行するときに、コマンドラインで\fI\-storepass\fRオプションを指定しなかった場合は、パスワードの入力を求められます。 .sp -ȥ硢ѥɤϾάǽǤѥɤꤵƤʤϡ򸡾ڤǤٹɽޤ +キーストアから情報を取得する場合、パスワードは省略可能です。パスワードが指定されていない場合は、取得した情報の整合性を検証できず、警告が表示されます。 .RE .PP \-providerName \fIprovider_name\fR .RS 4 -ƥץѥƥե˴ޤޤŹ沽ӥץХ̾ꤹ뤿˻Ѥޤ +セキュリティ・プロパティ・ファイル内に含まれる暗号化サービス・プロバイダ名を特定するために使用されます。 .RE .PP \-providerClass \fIprovider_class_name\fR .RS 4 -Ź沽ӥץХƥץѥƥե˻ꤵƤʤȤϡΥޥ饹ե̾ꤹȤ˻Ѥޤ +暗号化サービス・プロバイダがセキュリティ・プロパティ・ファイルに指定されていないときは、そのマスター・クラス・ファイルの名前を指定するときに使用されます。 .RE .PP \-providerArg \fIprovider_arg\fR .RS 4 -\fI\-providerClass\fRץȤȤ˻Ѥ졢\fIprovider_class_name\fRΥ󥹥ȥ饯Υץʸϰɽޤ +\fI\-providerClass\fRオプションとともに使用され、\fIprovider_class_name\fRのコンストラクタのオプションの文字列入力引数を表します。 .RE .PP \-protected .RS 4 -\fItrue\fRޤ\fIfalse\fRΤ줫ѥɤPIN꡼ʤɤݸ줿ǧڥѥͳǻꤹɬפϡͤ\fItrue\fR˻ꤹɬפޤ\fI\-importkeystore\fRޥɤˤ2ĤΥȥϢƤ뤿ᡢȥȰ襭ȥˤ줾켡2ĤΥץ\fI\-srcprotected\fR\-\fIdestprotected\fRѰդƤޤ +\fItrue\fRまたは\fIfalse\fRのいずれか。パスワードを専用PINリーダーなどの保護された認証パス経由で指定する必要がある場合は、この値を\fItrue\fRに指定する必要があります。\fI\-importkeystore\fRコマンドには2つのキーストアが関連しているため、ソース・キーストアと宛先キーストアにそれぞれ次の2つのオプション、\fI\-srcprotected\fRと\-\fIdestprotected\fRが用意されています。 .RE .PP \-ext \fI{name{:critical} {=value}}\fR .RS 4 -X\&.509񥨥ƥ󥷥򼨤ޤΥץ\fI\-genkeypair\fR\fI\-gencert\fRǻѤơޤ\fI\-certreq\fR˥ƥ󥷥ߡꥯȤǥꥯȤ륨ƥ󥷥򼨤ȤǤޤΥץʣǤޤ\fIname\fRˤϡݡȤƤ륨ƥ󥷥̾(̾դƥ󥷥򻲾)ޤǤդOIDֹǤޤꤵƤ硢\fIvalue\fRϥƥ󥷥ΰؤޤ\fIvalue\fRά硢ƥ󥷥Υǥեͤޤϥƥ󥷥󤬰ɬפȤʤȤ򼨤ޤ\fI:critical\fRҤꤵ줿硢ƥ󥷥\fIisCritical\fR°\fItrue\fRǡꤵʤ\fIfalse\fRǤ\fI:critical\fRΤ\fI:c\fRѤǤޤ +X\&.509証明書エクステンションを示します。このオプションを\fI\-genkeypair\fRおよび\fI\-gencert\fRで使用して、生成される証明書または\fI\-certreq\fRにエクステンションを埋め込み、証明書リクエストでリクエストされるエクステンションを示すことができます。このオプションは複数回指定できます。\fIname\fR引数には、サポートされているエクステンション名(名前付きエクステンションを参照)または任意のOID番号を指定できます。指定されている場合、\fIvalue\fR引数はエクステンションの引数を指します。\fIvalue\fRを省略した場合、エクステンションのデフォルト値またはエクステンションが引数を必要としないことを示します。\fI:critical\fR修飾子が指定された場合、エクステンションの\fIisCritical\fR属性は\fItrue\fRで、指定されない場合は\fIfalse\fRです。\fI:critical\fRのかわりに\fI:c\fRを使用できます。 .RE -.SH "̾դƥ󥷥" +.SH "名前付きエクステンション" .PP -\fIkeytool\fRޥɤϡ̾Υƥ󥷥򥵥ݡȤƤޤ̾/ʸ϶̤ޤ +\fIkeytool\fRコマンドは、次の名前のエクステンションをサポートしています。名前の大/小文字は区別されません。 .PP -BCޤBasicContraints +BCまたはBasicContraints .RS 4 -\fB\fR: ʷϼΤȤǤ: -\fIca:{true|false}[,pathlen:<len>]\fRޤ\fI<len>\fR(ϡ\fIca:true,pathlen:<len>\fRû̷Ǥ)<\fIlen\fR>άȡ\fIca:true\fRΰ̣ˤʤޤ +\fB値\fR: 完全な形式は次のとおりです: +\fIca:{true|false}[,pathlen:<len>]\fRまたは\fI<len>\fR(これは、\fIca:true,pathlen:<len>\fRの短縮形です)。<\fIlen\fR>を省略すると、\fIca:true\fRの意味になります。 .RE .PP -KUޤKeyUsage +KUまたはKeyUsage .RS 4 -\fB\fR: -\fIusage\fR(\fIusage\fR)*\fIusage\fRˤ\fIdigitalSignature\fR\fInonRepudiation\fR -(contentCommitment)\fIkeyEncipherment\fR\fIdataEncipherment\fR\fIkeyAgreement\fR\fIkeyCertSign\fR\fIcRLSign\fR\fIencipherOnly\fR\fIdecipherOnly\fRΤ줫Ǥޤ\fIusage\fRϡΤˤʤʤꡢǽοʸ(\fIdigitalSignature\fRξ\fIdig\fR)ޤϥ륱(\fIdigitalSignature\fRξ\fIdS\fR\fIcRLSign\fRξ\fIcRLS\fR)ǾάɽǤޤ\fIusage\fRͤϡʸȾʸ̤ޤ +\fB値\fR: +\fIusage\fR(\fIusage\fR)*、\fIusage\fRには\fIdigitalSignature\fR、\fInonRepudiation\fR +(contentCommitment)、\fIkeyEncipherment\fR、\fIdataEncipherment\fR、\fIkeyAgreement\fR、\fIkeyCertSign\fR、\fIcRLSign\fR、\fIencipherOnly\fR、\fIdecipherOnly\fRのいずれかを指定できます。\fIusage\fR引数は、不明確にならないかぎり、最初の数文字(\fIdigitalSignature\fRの場合は\fIdig\fR)またはキャメルケース・スタイル(\fIdigitalSignature\fRの場合は\fIdS\fR、\fIcRLSign\fRの場合は\fIcRLS\fR)で省略表記できます。\fIusage\fR値は、大文字と小文字が区別されます。 .RE .PP -EKUޤExtendedKeyUsage +EKUまたはExtendedKeyUsage .RS 4 -\fB\fR: -\fIusage\fR(\fIusage\fR)*\fIusage\fRˤ\fIanyExtendedKeyUsage\fR\fIserverAuth\fR\fIclientAuth\fR\fIcodeSigning\fR\fIemailProtection\fR\fItimeStamping\fR\fIOCSPSigning\fRޤǤդ\fIOIDʸ\fRΤ줫Ǥޤ\fIusage\fRϡΤˤʤʤꡢǽοʸޤϥ륱ǾάɽǤޤ\fIusage\fRͤϡʸȾʸ̤ޤ +\fB値\fR: +\fIusage\fR(\fIusage\fR)*、\fIusage\fRには\fIanyExtendedKeyUsage\fR、\fIserverAuth\fR、\fIclientAuth\fR、\fIcodeSigning\fR、\fIemailProtection\fR、\fItimeStamping\fR、\fIOCSPSigning\fRまたは任意の\fIOID文字列\fRのいずれかを指定できます。\fIusage\fR引数は、不明確にならないかぎり、最初の数文字またはキャメルケース・スタイルで省略表記できます。\fIusage\fR値は、大文字と小文字が区別されます。 .RE .PP -SANޤSubjectAlternativeName +SANまたはSubjectAlternativeName .RS 4 -\fB\fR: +\fB値\fR: \fItype\fR:\fIvalue\fR -(t\fIype:value\fR)*\fItype\fRˤ\fIEMAIL\fR\fIURI\fR\fIDNS\fR\fIIP\fRޤ\fIOID\fRǤޤ\fIvalue\fRϡ\fItype\fRʸͤǤ +(t\fIype:value\fR)*、\fItype\fRには\fIEMAIL\fR、\fIURI\fR、\fIDNS\fR、\fIIP\fRまたは\fIOID\fRを指定できます。\fIvalue\fR引数は、\fItype\fRの文字列形式の値です。 .RE .PP -IANޤIssuerAlternativeName +IANまたはIssuerAlternativeName .RS 4 -\fB\fR: -\fISubjectAlternativeName\fRƱǤ +\fB値\fR: +\fISubjectAlternativeName\fRと同じです。 .RE .PP -SIAޤSubjectInfoAccess +SIAまたはSubjectInfoAccess .RS 4 -\fB\fR: +\fB値\fR: \fImethod\fR:\fIlocation\-type\fR:\fIlocation\-value\fR -(\fImethod:location\-type\fR:\fIlocation\-value\fR)*\fImethod\fRˤ\fItimeStamping\fR\fIcaRepository\fRޤǤդOIDǤޤ\fIlocation\-type\fR\fIlocation\-value\fRˤϡ\fISubjectAlternativeName\fRƥ󥷥ǥݡȤǤդ\fItype\fR:\fIvalue\fRǤޤ +(\fImethod:location\-type\fR:\fIlocation\-value\fR)*、\fImethod\fRには\fItimeStamping\fR、\fIcaRepository\fRまたは任意のOIDを指定できます。\fIlocation\-type\fRおよび\fIlocation\-value\fR引数には、\fISubjectAlternativeName\fRエクステンションでサポートされる任意の\fItype\fR:\fIvalue\fRを指定できます。 .RE .PP -AIAޤAuthorityInfoAccess +AIAまたはAuthorityInfoAccess .RS 4 -\fB\fR: -\fISubjectInfoAccess\fRƱǤ\fImethod\fRˤϡ\fIocsp\fR\fIcaIssuers\fRޤǤդOIDǤޤ +\fB値\fR: +\fISubjectInfoAccess\fRと同じです。\fImethod\fR引数には、\fIocsp\fR、\fIcaIssuers\fRまたは任意のOIDを指定できます。 .RE .PP -\fIname\fROIDξ硢OCTET STRINGפĹΥХȤƥ󥷥ˤĤƤϡͤ\fIextnValue\fR16ʥפDER󥳡ǥ󥰤ǤHEXʸǤϡɸ16ʿ(0\-9a\-fA\-F)ʳʸ̵뤵ޤäơ01:02:03:0401020304ξȤƱͤȤƼդޤͤʤ硢ƥ󥷥ͥեɤ϶ˤʤޤ +\fIname\fRがOIDの場合、OCTET STRINGタイプと長さのバイトを除外したエクステンションについては、値は\fIextnValue\fRの16進ダンプのDERエンコーディングです。HEX文字列では、標準の16進数(0\-9、a\-f、A\-F)以外の文字は無視されます。したがって、01:02:03:04と01020304の両方とも同一の値として受け付けられます。値がない場合、エクステンションの値フィールドは空になります。 .PP -\fI\-gencert\fRǤΤ߻Ѥ\fIhonored\fRȤ̤̾ϡꥯȤ˴ޤޤ륨ƥ󥷥ͥ褹ˡ򼨤ޤ̾ͤϡ\fIall\fR(ꥯȤ뤹٤ƤΥƥ󥷥ͥ褵)\fIname{:[critical|non\-critical]}\fR(̾դΥƥ󥷥ͥ褵뤬̤\fIisCritical\fR°Ѥ)\fI\-name\fR(\fIall\fRȤȤ˻Ѥ㳰򼨤)Υ޶ڤꥹȤǤǥեȤǤϡꥯȤ륨ƥ󥷥ͥ褵ޤ +\fI\-gencert\fRでのみ使用する\fIhonored\fRという特別な名前は、証明書リクエストに含まれるエクステンションを優先する方法を示します。この名前の値は、\fIall\fR(リクエストされるすべてのエクステンションが優先される)、\fIname{:[critical|non\-critical]}\fR(名前付きのエクステンションが優先されるが、別の\fIisCritical\fR属性を使用する)、および\fI\-name\fR(\fIall\fRとともに使用し、例外を示す)のカンマ区切りリストです。デフォルトでは、リクエストされるエクステンションは優先されません。 .PP -\fI\-ext honored\fRץ˲ä̤̾ΡޤOID -\fI\-ext\fRΥץꤷϡΥƥ󥷥󤬡Ǥͥ褵Ƥ륨ƥ󥷥ɲäޤ̾(ޤOID)ͥ褵ͤǤѤϡͤȽꥯȤ˴ޤޤΤ򥪡С饤ɤޤ +\fI\-ext honored\fRオプションに加え、別の名前の、またはOID +\fI\-ext\fRのオプションを指定した場合は、このエクステンションが、すでに優先されているエクステンションに追加されます。ただし、この名前(またはOID)を優先される値でも使用した場合は、その値と重要性がリクエストに含まれるものをオーバーライドします。 .PP -\fIsubjectKeyIdentifier\fRƥ󥷥Ͼ˺ޤʽ̾Ǥʤξϡ\fIauthorityKeyIdentifier\fRޤ +\fIsubjectKeyIdentifier\fRエクステンションは常に作成されます。自己署名でない証明書の場合は、\fIauthorityKeyIdentifier\fRが作成されます。 .PP -\fB:\fR -桼ϡƥ󥷥(Ӿ¾Υե)ȹ礻ˤäƤϡ󥿡ͥåȤɸ˽򤷤ʤ礬뤳ȤդƤν˴ؤٹ򻲾ȤƤ -.SH "ޥ" +\fB注意:\fR +ユーザーは、エクステンション(および証明書の他のフィールド)の組合せによっては、インターネットの標準に準拠しない場合があることに注意してください。証明書の準拠に関する警告を参照してください。 +.SH "コマンド" .PP \-gencert .RS 4 \fI{\-rfc} {\-infile infile} {\-outfile outfile} {\-alias alias} {\-sigalg sigalg} {\-dname dname} {\-startdate startdate {\-ext ext}* {\-validity valDays} [\-keypass keypass] {\-keystore keystore} [\-storepass storepass] {\-storetype storetype} {\-providername provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ꥯȡե(\fIkeytool\fR -\fI\-certreq\fRޥɤǺǽ)Ф쥹ݥ󥹤ȤƾޤΥޥɤϡ\fIinfile\fR(άϡɸϤ)ꥯȤɤ߹ߡ̩̾ѤƤΥꥯȤ˽̾ơX\&.509\fIoutfile\fR(άϡɸϤ)Ϥޤ\fI\-rfc\fRꤷ硢ϷBASE64沽PEMˤʤޤʳξϡХʥDERޤ +証明書リクエスト・ファイル(\fIkeytool\fR +\fI\-certreq\fRコマンドで作成可能)に対するレスポンスとして証明書を生成します。このコマンドは、\fIinfile\fRから(省略した場合は、標準入力から)リクエストを読み込み、別名の秘密鍵を使用してそのリクエストに署名して、X\&.509証明書を\fIoutfile\fRに(省略した場合は、標準出力に)出力します。\fI\-rfc\fRを指定した場合、出力形式はBASE64符号化のPEMになります。それ以外の場合は、バイナリDERが作成されます。 .sp -\fIsigalg\fRͤˤϡ˽̾դȤ˻Ѥ륢르ꥺꤷޤ\fIstartdate\fRϡͭǤ\fIvalDays\fRϡͭ򼨤ޤ +\fIsigalg\fR値には、証明書に署名を付けるときに使用するアルゴリズムを指定します。\fIstartdate\fR引数は、証明書の有効開始日時です。\fIvalDays\fR引数は、証明書の有効日数を示します。 .sp -\fIdname\fRꤹȡμΤȤƻѤޤʳξϡꥯȤ̾Ѥޤ +\fIdname\fRを指定すると、生成される証明書の主体として使用されます。それ以外の場合は、証明書リクエストからの名前が使用されます。 .sp -\fIext\fRͤϡޤX\&.509ƥ󥷥򼨤ޤ\fI\-ext\fRιʸˤĤƤϡ̥ץ򻲾ȤƤ +\fIext\fR値は、証明書に埋め込まれるX\&.509エクステンションを示します。\fI\-ext\fRの構文については、一般オプションを参照してください。 .sp -\fI\-gencert\fRץѤȡǤޤǤϡ\fIe1\fRȤޤξξˤϡ3Ĥξ񤬴ޤޤƤޤ +\fI\-gencert\fRオプションを使用すると、証明書チェーンを作成できます。次の例では、\fIe1\fRという証明書を作成します。この証明書の証明書チェーンには、3つの証明書が含まれています。 .sp -Υޥɤϡ\fIca\fR\fIca1\fR\fIca2\fR\fIe1\fR4Ĥθڥޤ +次のコマンドは、\fIca\fR、\fIca1\fR、\fIca2\fRおよび\fIe1\fRの4つの鍵ペアを作成します。 .sp .if n \{\ .RS 4 @@ -687,7 +687,7 @@ keytool \-alias e1 \-dname CN=E1 \-genkeypair .if n \{\ .RE .\} -2ĤΥޥɤϡ̾դΥޤ\fIca\fR\fIca1\fR˽̾\fIca1\fR\fIca2\fR˽̾ޤ٤ƼȯԤǤ +次の2つのコマンドは、署名付き証明書のチェーンを作成します。\fIca\fRは\fIca1\fRに署名し、\fIca1\fRは\fIca2\fRに署名します。すべて自己発行です。 .sp .if n \{\ .RS 4 @@ -704,7 +704,7 @@ keytool \-alias ca2 \-certreq | .if n \{\ .RE .\} -Υޥɤϡ\fIe1\fRƥե\fIe1\&.cert\fR˳Ǽޤξ\fIca2\fRˤäƽ̾ޤη̡\fIe1\fRξˤ\fIca\fR\fIca1\fR\fIca2\fRޤޤ뤳Ȥˤʤޤ +次のコマンドは、証明書\fIe1\fRを作成してファイル\fIe1\&.cert\fRに格納します。この証明書は\fIca2\fRによって署名されます。その結果、\fIe1\fRの証明書チェーンには\fIca\fR、\fIca1\fRおよび\fIca2\fRが含まれることになります。 .sp .if n \{\ .RS 4 @@ -721,23 +721,23 @@ keytool \-alias e1 \-certreq | keytool \-alias ca2 \-gencert > e1\&.cert .RS 4 \fI{\-alias alias} {\-keyalg keyalg} {\-keysize keysize} {\-sigalg sigalg} [\-dname dname] [\-keypass keypass] {\-startdate value} {\-ext ext}* {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -Υڥ(ӴϢ̩)ޤX\&.509 v3ʽ̾ǥåפޤϡñǤľȤƳǼޤξ̩ϡaliasꤵ뿷ȥȥ˳Ǽޤ +鍵のペア(公開鍵および関連する秘密鍵)を生成します。公開鍵はX\&.509 v3自己署名証明書でラップされます。証明書は、単一の要素を持つ証明書チェーンとして格納されます。この証明書チェーンと秘密鍵は、aliasで特定される新しいキーストア・エントリに格納されます。 .sp -\fIkeyalg\fRͤϸڥ˻Ѥ륢르ꥺ\fIkeysize\fRͤƸΥ򡢤줾ꤷޤ\fIsigalg\fRͤϡʽ̾˽̾դ뤿˻Ѥ륢르ꥺꤷޤΥ르ꥺ\fIkeyalg\fRͤȸߴɬפޤ +\fIkeyalg\fR値は鍵ペアの生成に使用するアルゴリズムを、\fIkeysize\fR値は生成する各鍵のサイズを、それぞれ指定します。\fIsigalg\fR値は、自己署名証明書に署名を付けるために使用するアルゴリズムを指定します。このアルゴリズムは\fIkeyalg\fR値と互換性がある必要があります。 .sp -\fIdname\fRͤˤϡ\fIalias\fRͤ˴Ϣդʽ̾issuerեɤsubjectեɤȤƻѤX\&.500̾ꤷޤޥɥ饤Ǽ̾ꤷʤäϡ̾Ϥޤ +\fIdname\fR値には、\fIalias\fR値に関連付け、自己署名証明書のissuerフィールドとsubjectフィールドとして使用するX\&.500識別名を指定します。コマンドラインで識別名を指定しなかった場合は、識別名の入力を求められます。 .sp -\fIkeypass\fRͤˤϡ븰ΥڥΤ̩ݸΤ˻ѤѥɤꤷޤѥɤꤷʤäϡѥɤϤޤΤȤ\fI[Return]\fR򲡤ȡȥΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRͤϡ6ʸʾˤɬפޤ +\fIkeypass\fR値には、生成される鍵のペアのうち、秘密鍵を保護するのに使用するパスワードを指定します。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、\fI[Return]キー\fRを押すと、キーストアのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fR値は、6文字以上にする必要があります。 .sp -\fIstartdate\fRͤˤϡȯԻꤷޤϡX\&.509ΡValidityץեɤΡNot BeforeͤȤƤФޤ +\fIstartdate\fR値には、証明書の発行時刻を指定します。これは、X\&.509証明書の「Validity」フィールドの「Not Before」値とも呼ばれます。 .sp -ץͤϡ2ĤηΤ줫Ǥޤ +オプションの値は、次の2つの形式のいずれかで設定できます。 .sp \fI([+\-]nnn[ymdHMS])+\fR .sp \fI[yyyy/mm/dd] [HH:MM:SS]\fR .sp -ǽηǤϡȯԻϡꤵͤʬߤλ狼ܤޤꤵͤϡϢβ̤ͤϢ뤷Τˤʤޤ̤γͤǡץ饹(+)ϻ֤ʤळȤ򡢥ޥʥ(\-)ϻ֤뤳Ȥ̣Ƥޤܤ֤\fInnn\fRǡñ̤ǯ֡ʬޤäǤ(줾졢1ʸ\fIy\fR\fIm\fR\fId\fR\fIH\fR\fIM\fRޤ\fIS\fRפǼƤޤ)̤γͤ\fIjava\&.util\&.GregorianCalendar\&.add(int field, int amount)\fR᥽åɤѤ뤳ȤǡȯԻɲäͤ鱦ط׻ޤȤСꤹȡȯԻϼΤ褦ˤʤޤ +最初の形式では、発行時刻は、指定される値の分、現在の時刻から移ります。指定される値は、一連の下位の値を連結したものになります。下位の各値で、プラス記号(「+」)は時間が進むことを、マイナス記号(「\-」)は時間が戻ることを意味しています。移る時間は\fInnn\fRで、単位は年、月、日、時間、分または秒です(それぞれ、1文字の\fIy\fR、\fIm\fR、\fId\fR、\fIH\fR、\fIM\fRまたは\fIS\fR」で示されています)。下位の各値で\fIjava\&.util\&.GregorianCalendar\&.add(int field, int amount)\fRメソッドを使用することで、発行時刻の追加の値が左から右へ計算されます。たとえば、指定すると、発行時刻は次のようになります。 .sp .if n \{\ .RS 4 @@ -752,182 +752,182 @@ return c\&.getTime() .if n \{\ .RE .\} -2ܤηǤϡ桼ϡǯ//Ȼ:ʬ:ä2ĤʬǸ̩ʳϻꤷޤ(ϸλӤ)桼ϡ1ĤʬΤߤǤޤϡ⤦1Ĥʬϸߤ(ޤϻ)ƱˤʤȤȤǤ桼ϡ˼Ƥ褦ˡ̩˻ꤹɬפޤ(û0ޤ)դȻξꤵ줿֤ǡ2Ĥʬδ֤˶ʸ1(1ĤΤ)ޤ֤Ͼ24ַǻꤷƤ +2番目の形式では、ユーザーは、年/月/日と時間:分:秒の2つの部分で厳密な開始時刻を設定します(地元の時間帯を使用)。ユーザーは、1つの部分のみを指定できます。これは、もう1つの部分は現在の日付(または時刻)と同じになるということです。ユーザーは、形式の定義に示されているように、桁数を厳密に指定する必要があります(短い場合は0で埋めます)。日付と時刻の両方が指定された状態で、2つの部分の間に空白文字が1つ(1つのみ)あります。時間は常に24時間形式で指定してください。 .sp -ץꤷʤȡդϸߤλˤʤޤץϡ1Ǥޤ +オプションを指定しないと、開始日付は現在の時刻になります。オプションは、最大で1回指定できます。 .sp -\fIvalDays\fRͤˤϡͭꤷޤ(\fI\-startdate\fRǻꤵ줿աޤ\fI\-startdate\fRꤵƤʤϸߤդϤޤޤ) +\fIvalDays\fRの値には、証明書の有効日数を指定します(\fI\-startdate\fRで指定された日付、または\fI\-startdate\fRが指定されていない場合は現在の日付から始まります)。 .sp -ΥޥɤϡΥ꡼Ǥ\fI\-genkey\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-genkeypair\fRͥ褵ޤ +このコマンドは、以前のリリースでは\fI\-genkey\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-genkeypair\fRが優先されます。 .RE .PP \-genseckey .RS 4 \fI\-genseckey {\-alias alias} {\-keyalg keyalg} {\-keysize keysize} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -̩򿷤\fIKeyStore\&.SecretKeyEntry\fR(\fIalias\fRꤵ)˳Ǽޤ +秘密鍵を生成し、それを新しい\fIKeyStore\&.SecretKeyEntry\fR(\fIalias\fRで特定される)内に格納します。 .sp -\fIkeyalg\fRͤϸڥ˻Ѥ륢르ꥺ\fIkeysize\fRͤƸΥ򡢤줾ꤷޤ\fIkeypass\fRͤϡ̩ݸѥɤǤѥɤꤷʤäϡѥɤϤޤΤȤ[Return]򲡤ȡ\fIkeystore\fRΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRͤϡ6ʸʾˤɬפޤ +\fIkeyalg\fR値は鍵ペアの生成に使用するアルゴリズムを、\fIkeysize\fR値は生成する各鍵のサイズを、それぞれ指定します。\fIkeypass\fR値は、秘密鍵を保護するパスワードです。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、[Return]キーを押すと、\fIkeystore\fRのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fR値は、6文字以上にする必要があります。 .RE .PP \-importcert .RS 4 \fI\-importcert {\-alias alias} {\-file cert_file} [\-keypass keypass] {\-noprompt} {\-trustcacerts} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ե\fIcert_file\fRޤϾ(ξϡPKCS#7αޤϰϢX\&.509󶡤)ɤ߹ߡ\fIalias\fRˤäꤵ\fIkeystore\fRȥ˳Ǽޤե뤬ꤵƤʤϡ\fIstdin\fRޤϾɤ߹ߤޤ +ファイル\fIcert_file\fRから証明書または証明書チェーン(証明書チェーンの場合は、PKCS#7形式の応答または一連のX\&.509証明書で提供されるもの)を読み込み、\fIalias\fRによって特定される\fIkeystore\fRエントリに格納します。ファイルが指定されていない場合は、\fIstdin\fRから証明書または証明書チェーンを読み込みます。 .sp -\fIkeytool\fRޥɤǤϡX\&.509 v1v2v3ξ񡢤PKCS#7ξ񤫤鹽ƤPKCS#7ξ򥤥ݡȤǤޤݡȤǡϡХʥ沽ޤϽϲǽ沽(Base64沽ȤƤФ)Τɤ餫󶡤ɬפޤϲǽ沽ϡ󥿡ͥåRFC 1421沽ʤƤޤ沽ξ硢\fI\-\fR\fI\-\-\-\-BEGIN\fRǻϤޤʸdzϤ졢\fI\-\-\-\-\-END\fRǻϤޤʸǽλɬפޤ +\fIkeytool\fRコマンドでは、X\&.509 v1、v2、v3の証明書、およびPKCS#7形式の証明書から構成されているPKCS#7形式の証明書チェーンをインポートできます。インポートするデータは、バイナリ符号化方式、または出力可能符号化方式(Base64符号化とも呼ばれる)のどちらかで提供する必要があります。出力可能符号化方式は、インターネットRFC 1421証明書符号化規格で定義されています。この符号化方式の場合、証明書は\fI\-\fR\fI\-\-\-\-BEGIN\fRで始まる文字列で開始され、\fI\-\-\-\-\-END\fRで始まる文字列で終了する必要があります。 .sp -ϡǤΥꥹȤɲä뤿ᡢǧڶ(CA)˾̾ꥯȤ̤ȤCA򥤥ݡȤ뤿(ޥɤ\fI\-certreq\fRץ򻲾)Ȥ2ĤͳǥݡȤޤ +証明書は、信頼できる証明書のリストに追加するため、および認証局(CA)に証明書署名リクエストを送信した結果としてCAから受信した証明書応答をインポートするため(コマンドの\fI\-certreq\fRオプションを参照)という2つの理由でインポートします。 .sp -ɤΥפΥݡȤԤϡ\fI\-alias\fRץͤˤäƻꤷޤ̾ȥݥȤʤ硢\fIkeytool\fRޥɤϥ桼Ǥ񥨥ȥɲä褦ȤƤΤȤߤʤޤξ硢̾ȥ¸ߤƤʤȤɬפǤ̾Ǥ¸ߤƤ硢̾οǤ񤬤Ǥ¸ߤ뤳ȤˤʤΤǡ\fIkeytool\fRޥɤϥ顼ϤΥݡȤԤޤ̾ȥݥȤ硢\fIkeytool\fRޥɤϥ桼򥤥ݡȤ褦ȤƤΤȤߤʤޤ +どちらのタイプのインポートを行うかは、\fI\-alias\fRオプションの値によって指定します。別名がキー・エントリをポイントしない場合、\fIkeytool\fRコマンドはユーザーが信頼できる証明書エントリを追加しようとしているものとみなします。この場合、別名がキーストア内に存在していないことが必要です。別名がすでに存在している場合、その別名の信頼できる証明書がすでに存在することになるので、\fIkeytool\fRコマンドはエラーを出力し、証明書のインポートを行いません。別名がキー・エントリをポイントする場合、\fIkeytool\fRコマンドはユーザーが証明書応答をインポートしようとしているものとみなします。 .RE .PP \-importpassword .RS 4 \fI{\-alias alias} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ѥե졼򥤥ݡȤ\fIalias\fRǼ̤뿷\fIKeyStore\&.SecretKeyEntry\fR˳Ǽޤѥե졼ϡɸϥȥ꡼𤷤󶡤Ǥޤޤϡ桼ˤΥץץȤɽޤ\fIkeypass\fRϡݡȤѥե졼ݸ˻ѤѥɤǤѥɤꤷʤäϡѥɤϤޤΤȤ[Return]򲡤ȡ\fIkeystore\fRΥѥɤƱѥɤΥѥɤꤵޤ\fIkeypass\fRϡ6ʸʾˤɬפޤ +パスフレーズをインポートし、\fIalias\fRで識別される新規\fIKeyStore\&.SecretKeyEntry\fRに格納します。パスフレーズは、標準入力ストリームを介して提供できます。または、ユーザーにそのプロンプトが表示されます。\fIkeypass\fRは、インポートされるパスフレーズの保護に使用されるパスワードです。パスワードを指定しなかった場合は、パスワードの入力を求められます。このとき、[Return]キーを押すと、\fIkeystore\fRのパスワードと同じパスワードが鍵のパスワードに設定されます。\fIkeypass\fRは、6文字以上にする必要があります。 .RE .PP \-importkeystore .RS 4 \fI{\-srcstoretype srcstoretype} {\-deststoretype deststoretype} [\-srcstorepass srcstorepass] [\-deststorepass deststorepass] {\-srcprotected} {\-destprotected} {\-srcalias srcalias {\-destalias destalias} [\-srckeypass srckeypass] } [\-destkeypass destkeypass] {\-noprompt} {\-srcProviderName src_provider_name} {\-destProviderName dest_provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ȥ饿åȡȥءñΥȥޤϤ٤ƤΥȥ򥤥ݡȤޤ +ソース・キーストアからターゲット・キーストアへ、単一のエントリまたはすべてのエントリをインポートします。 .sp -\fI\-srcalias\fRץ󤬻ꤵ줿硢Υޥɤϡ̾ꤵñΥȥ򥿡åȡȥ˥ݡȤޤ\fIdestalias\fRͳǥå̾ꤵʤä硢\fIsrcalias\fRå̾ȤƻѤޤΥȥ꤬ѥɤݸƤ硢\fIsrckeypass\fRѤƤΥȥ꤬ޤ\fIsrckeypass\fRꤵʤä硢\fIkeytool\fRޥɤ\fIsrcstorepass\fRѤƤΥȥ褦Ȥޤ\fIsrcstorepass\fRꤵʤäʤä硢桼ϥѥɤϤޤåȤΥȥ\fIdestkeypass\fRˤäݸޤ\fIdestkeypass\fRꤵʤä硢åȡȥϥȥΥѥɤˤäݸޤȤСۤȤɤΥɡѡƥġǤϡPKCS #12ȥ\fIstorepass\fR\fIkeypass\fRƱǤɬפޤΥġPKCS #12ȥϡ\fI\-destkeypass\fR\fI\-deststorepass\fRƱˤʤ褦˻ꤷޤ +\fI\-srcalias\fRオプションが指定された場合、このコマンドは、その別名で特定される単一のエントリをターゲット・キーストアにインポートします。\fIdestalias\fR経由でターゲット別名が指定されなかった場合、\fIsrcalias\fRがターゲット別名として使用されます。ソースのエントリがパスワードで保護されていた場合、\fIsrckeypass\fRを使用してそのエントリが回復されます。\fIsrckeypass\fRが指定されなかった場合、\fIkeytool\fRコマンドは\fIsrcstorepass\fRを使用してそのエントリを回復しようとします。\fIsrcstorepass\fRが指定されなかったか正しくなかった場合、ユーザーはパスワードの入力を求められます。ターゲットのエントリは\fIdestkeypass\fRによって保護されます。\fIdestkeypass\fRが指定されなかった場合、ターゲット・エントリはソース・エントリのパスワードによって保護されます。たとえば、ほとんどのサード・パーティ・ツールでは、PKCS #12キーストアで\fIstorepass\fRと\fIkeypass\fRが同じである必要があります。これらのツールのPKCS #12キーストアを作成する場合は、常に\fI\-destkeypass\fRと\fI\-deststorepass\fRが同じになるように指定します。 .sp -\fI\-srcalias\fRץ󤬻ꤵʤä硢ȥΤ٤ƤΥȥ꤬åȡȥ˥ݡȤޤƥåȡȥб륽ȥ̾β˳ǼޤΥȥ꤬ѥɤݸƤ硢\fIsrcstorepass\fRѤƤΥȥ꤬ޤ\fIsrcstorepass\fRꤵʤäʤä硢桼ϥѥɤϤޤȥΤ륨ȥꡦפåȡȥǥݡȤƤʤ䡢륨ȥ򥿡åȡȥ˳Ǽݤ˥顼ȯ硢桼ϤΥȥ򥹥åפƽ³Ԥ뤫뤤ϽǤ뤫ޤåȡȥϥȥΥѥɤˤäݸޤ +\fI\-srcalias\fRオプションが指定されなかった場合、ソース・キーストア内のすべてのエントリがターゲット・キーストア内にインポートされます。各ターゲット・エントリは対応するソース・エントリの別名の下に格納されます。ソースのエントリがパスワードで保護されていた場合、\fIsrcstorepass\fRを使用してそのエントリが回復されます。\fIsrcstorepass\fRが指定されなかったか正しくなかった場合、ユーザーはパスワードの入力を求められます。ソース・キーストア内のあるエントリ・タイプがターゲット・キーストアでサポートされていない場合や、あるエントリをターゲット・キーストアに格納する際にエラーが発生した場合、ユーザーはそのエントリをスキップして処理を続行するか、あるいは処理を中断するかの選択を求められます。ターゲット・エントリはソース・エントリのパスワードによって保護されます。 .sp -å̾åȡȥˤǤ¸ߤƤ硢桼ϡΥȥ񤭤뤫뤤ϰۤʤ̾βǿȥ뤫ޤ +ターゲット別名がターゲット・キーストア内にすでに存在していた場合、ユーザーは、そのエントリを上書きするか、あるいは異なる別名の下で新しいエントリを作成するかの選択を求められます。 .sp -\fI\-noprompt\fRץꤷ硢桼Ͽå̾Ϥޤ󡣴¸Υȥ꤬Υå̾Ǿ񤭤ޤݡȤǤʤȥϥåפ졢ٹ𤬽Ϥޤ +\fI\-noprompt\fRオプションを指定した場合、ユーザーは新しいターゲット別名の入力を求められません。既存のエントリがそのターゲット別名で上書きされます。インポートできないエントリはスキップされ、警告が出力されます。 .RE .PP \-printcertreq .RS 4 \fI{\-file file}\fR .sp -PKCS#10ξꥯȤƤϤޤΥꥯȤϡ\fIkeytool\fR -\fI\-certreq\fRޥɤǤޤΥޥɤϡե뤫ꥯȤɤ߼ޤե뤬¸ߤʤ硢ꥯȤɸϤɤ߼ޤ +PKCS#10形式の証明書リクエストの内容を出力します。このリクエストは、\fIkeytool\fR +\fI\-certreq\fRコマンドで生成できます。このコマンドは、ファイルからリクエストを読み取ります。ファイルが存在しない場合、リクエストは標準入力から読み取られます。 .RE .PP \-certreq .RS 4 \fI{\-alias alias} {\-dname dname} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -PKCS#10Ѥƾ̾ꥯ(CSR)ޤ +PKCS#10形式を使用して証明書署名リクエスト(CSR)を生成します。 .sp -CSRϡȯԶ(CA)뤳ȤŪȤΤǤCAϡ׵Ԥ(̾ϥե饤)ǧڤޤϾ֤ޤξޤϾϡȥδ¸ξ(ǽ1Ĥμʽ̾񤫤鹽)֤ƻѤޤ +CSRは、証明書発行局(CA)に送信することを目的としたものです。CAは、証明書要求者を(通常はオフラインで)認証し、証明書または証明書チェーンを送り返します。この証明書または証明書チェーンは、キーストア内の既存の証明書チェーン(最初は1つの自己署名証明書から構成される)に置き換えて使用します。 .sp -alias˴Ϣդ줿̩ϡPKCS#10ꥯȤΤ˻Ѥޤ̩˥ˤϡѥɤꤹɬפޤޥɥ饤\fIkeypass\fRꤷƤ餺̩ΥѥɤȥΥѥɤȰۤʤϡ̩ΥѥɤϤޤ\fIdname\fRꤵƤϡ줬CSRǼΤȤƻѤޤʳξϡ̾˴Ϣդ줿X\&.500̾Ѥޤ +aliasに関連付けられた秘密鍵は、PKCS#10証明書リクエストを作成するのに使用されます。秘密鍵にアクセスするには、正しいパスワードを指定する必要があります。コマンドラインで\fIkeypass\fRを指定しておらず、秘密鍵のパスワードがキーストアのパスワードと異なる場合は、秘密鍵のパスワードの入力を求められます。\fIdname\fRが指定されている場合は、それがCSRで主体として使用されます。それ以外の場合は、別名に関連付けられたX\&.500識別名が使用されます。 .sp -\fIsigalg\fRͤˤϡCSR˽̾դȤ˻Ѥ륢르ꥺꤷޤ +\fIsigalg\fR値には、CSRに署名を付けるときに使用するアルゴリズムを指定します。 .sp -CSRϡեcertreq_file˳Ǽޤե뤬ꤵƤʤϡ\fIstdout\fRCSRϤޤ +CSRは、ファイルcertreq_fileに格納されます。ファイルが指定されていない場合は、\fIstdout\fRにCSRが出力されます。 .sp -CAΥ쥹ݥ󥹤򥤥ݡȤˤϡ\fIimportcert\fRޥɤѤޤ +CAからのレスポンスをインポートするには、\fIimportcert\fRコマンドを使用します。 .RE .PP \-exportcert .RS 4 \fI{\-alias alias} {\-file cert_file} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-rfc} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fR˴Ϣդ줿򥭡ȥɤ߹ߡեcert_file˳Ǽޤե뤬ꤵƤʤϡ\fIstdout\fR˾񤬽Ϥޤ +\fIalias\fRに関連付けられた証明書をキーストアから読み込み、ファイルcert_fileに格納します。ファイルが指定されていない場合は、\fIstdout\fRに証明書が出力されます。 .sp -ǥեȤǤϡϥХʥ沽ǽϤޤ\fI\-rfc\fRץ󤬻ꤵƤ硢ϲǽ沽νϤϥ󥿡ͥåRFC 1421沽ʤޤ +デフォルトでは、証明書はバイナリ符号化で出力されます。\fI\-rfc\fRオプションが指定されている場合、出力可能符号化方式の出力はインターネットRFC 1421証明書符号化規格で定義されます。 .sp -\fIalias\fRǤ򻲾ȤƤϡ񤬽Ϥޤʳξ硢\fIalias\fRϡϢդ줿ĸȥ򻲾Ȥޤξϡκǽξ֤ޤξϡ\fIalias\fRˤäɽ륨ƥƥθǧڤǤ +\fIalias\fRが、信頼できる証明書を参照している場合は、該当する証明書が出力されます。それ以外の場合、\fIalias\fRは、関連付けられた証明書チェーンを持つ鍵エントリを参照します。この場合は、チェーン内の最初の証明書が返されます。この証明書は、\fIalias\fRによって表されるエンティティの公開鍵を認証する証明書です。 .sp -ΥޥɤϡΥ꡼Ǥ\fI\-export\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-exportcert\fRͥ褵ޤ +このコマンドは、以前のリリースでは\fI\-export\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-exportcert\fRが優先されます。 .RE .PP \-list .RS 4 \fI{\-alias alias} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v | \-rfc} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fRꤵ륭ȥȥƤ\fIstdout\fR˽Ϥޤ\fIalias\fRꤵƤʤϡȥΤƤɽޤ +\fIalias\fRで特定されるキーストア・エントリの内容を\fIstdout\fRに出力します。\fIalias\fRが指定されていない場合は、キーストア全体の内容が表示されます。 .sp -ΥޥɤϡǥեȤǤϾSHA1ե󥬡ץȤɽޤ -\fI\-v\fRץ󤬻ꤵƤϡͭԡȯԼԡꥢֹ桢ĥǽʤɤղŪʾȤȤˡʹ֤ɤळȤΤǤǾɽޤ\fI\-rfc\fRץ󤬻ꤵƤϡϲǽ沽ǾƤϤޤϲǽ沽ϡ󥿡ͥåRFC 1421沽ʤƤޤ +このコマンドは、デフォルトでは証明書のSHA1フィンガープリントを表示します。 +\fI\-v\fRオプションが指定されている場合は、所有者、発行者、シリアル番号、拡張機能などの付加的な情報とともに、人間が読むことのできる形式で証明書が表示されます。\fI\-rfc\fRオプションが指定されている場合は、出力可能符号化方式で証明書の内容が出力されます。出力可能符号化方式は、インターネットRFC 1421証明書符号化規格で定義されています。 .sp -\fI\-v\fRץ\fI\-rfc\fRץƱ˻ꤹ뤳ȤϤǤޤ +\fI\-v\fRオプションと\fI\-rfc\fRオプションを同時に指定することはできません。 .RE .PP \-printcert .RS 4 \fI{\-file cert_file | \-sslserver host[:port]} {\-jarfile JAR_file {\-rfc} {\-v} {\-Jjavaoption}\fR .sp -եcert_filehost:portˤSSLСޤϽ̾դJARե\fIJAR_file\fR(\fI\-jarfile\fRץ)ɤ߹ߡʹ֤ɤळȤΤǤǾƤɽޤݡȤꤵƤʤϡɸHTTPSݡ443ꤵޤ\fI\-sslserver\fR\-fileץƱ˻ꤹ뤳ȤϤǤޤ󡣤ȿ硢顼𤵤ޤץ󤬻ꤵƤʤϡ\fIstdin\fRɤ߹ߤޤ +ファイルcert_file、host:portにあるSSLサーバー、または署名付きJARファイル\fIJAR_file\fR(\fI\-jarfile\fRオプションを指定)から証明書を読み込み、人間が読むことのできる形式で証明書の内容を表示します。ポートが指定されていない場合は、標準のHTTPSポート443が想定されます。\fI\-sslserver\fRおよび\-fileオプションを同時に指定することはできません。これに反する場合、エラーが報告されます。オプションが指定されていない場合は、\fIstdin\fRから証明書を読み込みます。 .sp -\fI\-rfc\fRꤵƤ硢\fIkeytool\fRޥɤϡ󥿡ͥåRFC 1421沽ɸƤ褦ˡPEM⡼ɤǾϤޤ󥿡ͥåRFC 1421沽ʤ򻲾ȤƤ +\fI\-rfc\fRが指定されている場合、\fIkeytool\fRコマンドは、インターネットRFC 1421証明書符号化標準で定義されているように、PEMモードで証明書を出力します。インターネットRFC 1421証明書符号化規格を参照してください。 .sp -եޤ\fIstdin\fRɤ߹硢ξϡ󥿡ͥåRFC 1421沽ɸƤ褦ˡХʥ沽ޤϽϲǽ沽ɽǤޤ +ファイルまたは\fIstdin\fRから証明書を読み込む場合、その証明書は、インターネットRFC 1421証明書符号化標準で定義されているように、バイナリ符号化方式または出力可能符号化方式で表示できます。 .sp -SSLСեظˤϡ\fI\-J\-Dhttps\&.proxyHost=proxyhost\fR\fI\-J\-Dhttps\&.proxyPort=proxyport\fRץ򥳥ޥɥ饤ǻꤷơץȥͥ󥰤ѤǤޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.html -Java Secure Socket Extension (JSSE) Reference Guideפ򻲾ȤƤ +SSLサーバーがファイアウォールの背後にある場合は、\fI\-J\-Dhttps\&.proxyHost=proxyhost\fRおよび\fI\-J\-Dhttps\&.proxyPort=proxyport\fRオプションをコマンドラインで指定して、プロキシ・トンネリングを使用できます。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide\&.htmlの +「Java Secure Socket Extension (JSSE) Reference Guide」を参照してください .sp -\fB:\fR -ΥץϥȥȤϴطʤѤǤޤ +\fB注意:\fR +このオプションはキーストアとは関係なく使用できます。 .RE .PP \-printcrl .RS 4 \fI\-file crl_ {\-v}\fR .sp -ե\fIcrl_\fR񼺸ꥹ(CRL)ɤ߹ߤޤCRLϡȯԤCAˤäƼ줿ǥΥꥹȤǤCAϡ\fIcrl_\fRޤ +ファイル\fIcrl_\fRから証明書失効リスト(CRL)を読み込みます。CRLは、発行したCAによって失効されたデジタル証明書のリストです。CAは、\fIcrl_\fRを生成します。 .sp -\fB:\fR -ΥץϥȥȤϴطʤѤǤޤ +\fB注意:\fR +このオプションはキーストアとは関係なく使用できます。 .RE .PP \-storepasswd .RS 4 \fI[\-new new_storepass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-Jjavaoption}\fR .sp -ȥƤݸ뤿˻Ѥѥɤѹޤ\fInew_storepass\fRˤϡѥɤꤷޤnew_storepassϡ6ʸʾǤɬפޤ +キーストアの内容の整合性を保護するために使用するパスワードを変更します。\fInew_storepass\fRには、新しいパスワードを指定します。new_storepassは、6文字以上である必要があります。 .RE .PP \-keypasswd .RS 4 \fI{\-alias alias} [\-keypass old_keypass] [\-new new_keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-Jjavaoption}\fR .sp -\fIalias\fRˤäꤵ/̩ݸ뤿Υѥɤ\fIold_keypass\fR\fInew_keypass\fRѹޤnew_keypassϡ6ʸʾǤɬפޤ +\fIalias\fRによって特定される非公開/秘密鍵を保護するためのパスワードを、\fIold_keypass\fRから\fInew_keypass\fRに変更します。new_keypassは、6文字以上である必要があります。 .sp -ޥɥ饤\fI\-keypass\fRץꤷƤ餺ΥѥɤȥΥѥɤȰۤʤϡΥѥɤϤޤ +コマンドラインで\fI\-keypass\fRオプションを指定しておらず、鍵のパスワードがキーストアのパスワードと異なる場合は、鍵のパスワードの入力を求められます。 .sp -ޥɥ饤\fI\-new\fRץꤷʤäϡѥɤϤޤ +コマンドラインで\fI\-new\fRオプションを指定しなかった場合は、新しいパスワードの入力を求められます。 .RE .PP \-delete .RS 4 \fI[\-alias alias] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -\fIalias\fRˤäꤵ륨ȥ򥭡ȥޤޥɥ饤̾ꤷʤäϡ̾Ϥޤ +\fIalias\fRによって特定されるエントリをキーストアから削除します。コマンドラインで別名を指定しなかった場合は、別名の入力を求められます。 .RE .PP \-changealias .RS 4 \fI{\-alias alias} [\-destalias destalias] [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption}\fR .sp -ꤵ줿\fIalias\fR鿷̾\fIdestalias\fRء¸Υȥȥưޤå̾ꤷʤä硢å̾ϤޤΥȥ꤬ȥꡦѥɤݸƤ硢\fI\-keypass\fRץǤΥѥɤǤޤѥɤꤵʤä硢\fIstorepass\fR(ꤵ줿)ޤߤޤλߤԤȡ桼ϥѥɤϤޤ +指定された\fIalias\fRから新しい別名\fIdestalias\fRへ、既存のキーストア・エントリを移動します。ターゲット別名を指定しなかった場合、ターゲット別名の入力を求められます。元のエントリがエントリ・パスワードで保護されていた場合、\fI\-keypass\fRオプションでそのパスワードを指定できます。鍵パスワードが指定されなかった場合、\fIstorepass\fR(指定された場合)がまず試みられます。その試みが失敗すると、ユーザーはパスワードの入力を求められます。 .RE .PP \-help .RS 4 -ŪʥޥɤȤΥץΰɽޤ +基本的なコマンドとそのオプションの一覧を表示します。 .sp -Υޥɤξܺ٤򻲾ȤˤϡΤ褦ϤƤ: -\fIkeytool \-command_name \-help\fR\fIcommand_name\fRϥޥɤ̾Ǥ +特定のコマンドの詳細を参照するには、次のように入力してください: +\fIkeytool \-command_name \-help\fR。\fIcommand_name\fRはコマンドの名前です。 .RE -.SH "" +.SH "例" .PP -Ǥϡ/̩ΥڥӿǤ륨ƥƥξ뤿Υȥ򼨤ޤ -.SS "Υڥ" +この例では、公開/秘密鍵のペアおよび信頼できるエンティティからの証明書を管理するためのキーストアを作成する手順を示します。 +.SS "鍵のペアの生成" .PP -ޤȥƸΥڥޤñԤϤ롢Τ褦ʥޥɤѤǤޤ +まず、キーストアを作成して鍵のペアを生成します。単一行に入力する、次のようなコマンドを使用できます。 .sp .if n \{\ .RS 4 @@ -942,11 +942,11 @@ keytool \-genkeypair \-dname "cn=Mark Jones, ou=Java, o=Oracle, c=US" .RE .\} .PP -ޥɤϡworkingǥ쥯ȥ\fImykeystore\fRȤ̾Υȥ(ȥϤޤ¸ߤƤʤȲ)ȥˡ\fI<new password for keystore>\fRǻꤷѥɤƤޤ̩Υڥб륨ƥƥΡּ̾פϡ̾ΤMark Jonesȿñ̤JavaȿOracle2ʸιֹ椬USǤ̩ΥϤɤ1024ӥåȤǡκˤϥǥեȤDSA르ꥺѤޤ +コマンドは、workingディレクトリに\fImykeystore\fRという名前のキーストアを作成し(キーストアはまだ存在していないと仮定)、作成したキーストアに、\fI<new password for keystore>\fRで指定したパスワードを割り当てます。生成する公開鍵と秘密鍵のペアに対応するエンティティの「識別名」は、通称がMark Jones、組織単位がJava、組織がOracle、2文字の国番号がUSです。公開鍵と秘密鍵のサイズはどちらも1024ビットで、鍵の作成にはデフォルトのDSA鍵生成アルゴリズムを使用します。 .PP -ΥޥɤϡǥեȤSHA1withDSA̾르ꥺѤơȼ̾ޤ༫ʽ̾ޤ֤ͭ180Ǥϡ̾\fIbusiness\fRꤵ륭ȥȥ̩˴Ϣդޤ̩ˤϡ\fI<new password for private key>\fRǻꤷѥɤƤޤ +このコマンドは、デフォルトのSHA1withDSA署名アルゴリズムを使用して、公開鍵と識別名情報を含む自己署名証明書を作成します。証明書の有効期間は180日です。証明書は、別名\fIbusiness\fRで特定されるキーストア・エントリ内の秘密鍵に関連付けられます。秘密鍵には、\fI<new password for private key>\fRで指定したパスワードが割り当てられます。 .PP -ץΥǥեͤѤ硢ޥɤûʤޤξ硢ץפǤǥեͤĥץǤϡץꤷʤХǥեͤѤޤɬͤϤޤѲǽͤϼΤȤǤ +オプションのデフォルト値を使用する場合、コマンドは大幅に短くなります。この場合、オプションは不要です。デフォルト値を持つオプションでは、オプションを指定しなければデフォルト値が使用されます。必須値の入力を求められます。使用可能な値は次のとおりです。 .sp .if n \{\ .RS 4 @@ -958,12 +958,12 @@ keytool \-genkeypair .RE .\} .PP -ξϡ\fImykey\fRȤ̾ǥȥȥ꤬졢줿Υڥ90ͭʾ񤬤Υȥ˳ǼޤΥȥϡۡࡦǥ쥯ȥ\fI\&.keystore\fRȤ̾Υȥ֤ޤȥϡޤ¸ߤƤʤ˺ޤ̾󡢥ȥΥѥɤ̩ΥѥɤϤޤ +この場合は、\fImykey\fRという別名でキーストア・エントリが作成され、新しく生成された鍵のペア、および90日間有効な証明書がこのエントリに格納されます。このエントリは、ホーム・ディレクトリ内の\fI\&.keystore\fRという名前のキーストアに置かれます。キーストアは、まだ存在していない場合に作成されます。識別名情報、キーストアのパスワードおよび秘密鍵のパスワードの入力を求められます。 .PP -ʹߤǤϡץꤷʤ\fI\-genkeypair\fRޥɤ¹ԤΤȤ򼨤ޤϤ줿ϡǽ˼\fI\-genkeypair\fRޥɤͤϤΤȤޤȤм̾ˤ\fIcn=Mark Jones\fR\fIou=Java\fR\fIo=Oracle\fR\fIc=US\fRȻꤷޤ -.SS "CAν̾դΥꥯ" +以降では、オプションを指定しないで\fI\-genkeypair\fRコマンドを実行したものとして例を示します。情報の入力を求められた場合は、最初に示した\fI\-genkeypair\fRコマンドの値を入力したものとします。たとえば識別名には\fIcn=Mark Jones\fR、\fIou=Java\fR、\fIo=Oracle\fR、\fIc=US\fRと指定します。 +.SS "CAからの署名付き証明書のリクエスト" .PP -ʽ̾븰Υڥ˾ȯԶ(CA)ν̾դƤС¾Υ桼񤬿ꤵǽ⤯ʤޤCAν̾ˤϡޤ̾ꥯ(CSR)ޤȤСΤ褦ˤޤ +自己署名証明書を作成する鍵のペアの生成。証明書に証明書発行局(CA)の署名が付いていれば、他のユーザーから証明書が信頼される可能性も高くなります。CAの署名を取得するには、まず、証明書署名リクエスト(CSR)を生成します。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -975,12 +975,12 @@ keytool \-certreq \-file MarkJ\&.csr .RE .\} .PP -CSR(ǥե̾\fImykey\fRˤäꤵ륨ƥƥCSR)졢MarkJ\&.csrȤ̾Υե֤ޤΥեCA (VeriSignʤ)ФޤCA׵Ԥ(̾ϥե饤)ǧڤ׵Ԥθǧڤ̾դξ֤ޤˤäƤϡCAΥ֤Ȥ⤢ޤΥǤϡƾ񤬥Τν̾Ԥθǧڤޤ -.SS "CAξΥݡ" +CSR(デフォルト別名\fImykey\fRによって特定されるエンティティのCSR)が作成され、MarkJ\&.csrという名前のファイルに置かれます。このファイルをCA (VeriSignなど)に提出します。CAは要求者を(通常はオフラインで)認証し、要求者の公開鍵を認証した署名付きの証明書を送り返します。場合によっては、CAが証明書のチェーンを返すこともあります。証明書のチェーンでは、各証明書がチェーン内のその前の署名者の公開鍵を認証します。 +.SS "CAからの証明書のインポート" .PP -ʽ̾ϡ֤ɬפޤǤϡƾ񤬡֥롼ȡCAȤμξν̾Ԥθǧڤޤ +作成した自己署名証明書は、証明書チェーンで置き換える必要があります。証明書チェーンでは、各証明書が、「ルート」CAを起点とするチェーン内の次の証明書の署名者の公開鍵を認証します。 .PP -CAξ򥤥ݡȤˤϡȥ\fIcacerts\fRȥե1İʾοǤ񤬤ɬפޤ\fI\fR\-importcertޥɤ򻲾ȤƤ +CAからの証明書応答をインポートするには、キーストアか、\fIcacerts\fRキーストア・ファイル内に1つ以上の信頼できる証明書がある必要があります。\fIの\fR\-importcertコマンドを参照してください。 .sp .RS 4 .ie n \{\ @@ -990,7 +990,7 @@ CA .sp -1 .IP \(bu 2.3 .\} -ξϡκǾ̾ɬפǤCAθǧڤ롼CA +証明応答が証明書チェーンの場合は、チェーンの最上位証明書が必要です。CAの公開鍵を認証するルートCA証明書。 .RE .sp .RS 4 @@ -1001,14 +1001,14 @@ CA .sp -1 .IP \(bu 2.3 .\} -ñξξϡȯCA(̾)ξɬפǤξ񤬼ʽ̾Ǥʤϡν̾ԤξɬפǤꡢΤ褦ˤƼʽ̾롼Ⱦɬפˤʤޤ +証明書応答が単一の証明書の場合は、発行CA(署名した)の証明書が必要です。その証明書が自己署名でない場合は、その署名者の証明書が必要であり、このようにして自己署名ルート証明書が必要になります。 .RE .PP -\fIcacerts\fRȥեϡĤVeriSign롼CAޤ֤ǽв٤ƤΤǡVeriSignξ򡢿ǤȤƥȥ˥ݡȤɬפʤ礬ޤ¾CAФƽ̾դꥯȤƤơCAθǧڤ񤬡\fIcacerts\fRˤޤɲäƤʤϡCAξ򡢡ֿǤפȤƥݡȤɬפޤ +\fIcacerts\fRキーストア・ファイルは、いくつかのVeriSignルートCA証明書を含んだ状態で出荷されているので、VeriSignの証明書を、信頼できる証明書としてキーストア内にインポートする必要がない場合があります。ただし、他のCAに対して署名付き証明書をリクエストしていて、このCAの公開鍵を認証する証明書が、\fIcacerts\fRにまだ追加されていない場合は、該当するCAからの証明書を、「信頼できる証明書」としてインポートする必要があります。 .PP -̾CAξϡʽ̾񡢤ޤ¾CAˤäƽ̾줿Ǥ(Ԥξϡ¾CAθǧڤɬ)ABC, Inc\&.,CAǡABC鼫ʽ̾ǤA\fIBCCA\&.cer\fRȤ̾ΥեȤޤ(ξCAθǧڤޤ)ǤȤƾ򥤥ݡȤȤϡͭǤ뤳Ȥǧɬפޤޤ\fIkeytool \-printcert\fRޥɤޤ\fI\-noprompt\fRץʤ\fIkeytool \-importcert\fRޥɤǤɽɽ줿Υե󥬡ץȤԤΤȰפ뤫ɤǧޤʪϢοʪ󼨤(ޤϰʸΥݥȥˤä󼨤)ե󥬡ץȤȡΥޥɤɽ줿ե󥬡ץȤȤӤޤե󥬡ץȤפС¾βԤ(Ԥʤ)ˤΤؤԤƤʤȤǧǤޤǤμι⤬ԤƤ硢åԤ鷺˾򥤥ݡȤȡԤˤäƽ̾줿٤ƤΤΤꤹ뤳Ȥˤʤޤ +通常、CAからの証明書は、自己署名証明書、または他のCAによって署名された証明書です(後者の場合は、該当する他のCAの公開鍵を認証する証明書が必要)。ABC, Inc\&.,がCAで、ABCから自己署名証明書であるA\fIBCCA\&.cer\fRという名前のファイルを取得したとします(この証明書はCAの公開鍵を認証します)。信頼できる証明書として証明書をインポートするときは、証明書が有効であることを確認する必要があります。まず、\fIkeytool \-printcert\fRコマンドまたは\fI\-noprompt\fRオプションなしの\fIkeytool \-importcert\fRコマンドでそれを表示し、表示された証明書のフィンガープリントが期待されるものと一致するかどうかを確認します。証明書を送信した人物に連絡し、この人物が提示した(または安全な公開鍵のリポジトリによって提示される)フィンガープリントと、上のコマンドで表示されたフィンガープリントとを比較します。フィンガープリントが一致すれば、送信途中で他の何者か(攻撃者など)による証明書のすり替えが行われていないことを確認できます。送信途中でこの種の攻撃が行われていた場合、チェックを行わずに証明書をインポートすると、攻撃者によって署名されたすべてのものを信頼することになります。 .PP -ͭǤȿꤹϡΥޥɤǥȥɲäǤޤ +証明書が有効であると信頼する場合は、次のコマンドでキーストアに追加できます。 .sp .if n \{\ .RS 4 @@ -1020,12 +1020,12 @@ keytool \-importcert \-alias abc \-file ABCCA\&.cer .RE .\} .PP -ABCCA\&.cerեΥǡޤ࿮ǤΥȥ꤬ȥ˺졢륨ȥ\fIabc\fRȤ̾Ƥޤ -.SS "CAξΥݡ" +ABCCA\&.cerファイルのデータを含む信頼できる証明書のエントリがキーストア内に作成され、該当するエントリに\fIabc\fRという別名が割り当てられます。 +.SS "CAからの証明書応答のインポート" .PP -̾ꥯȤCAθǧڤ򥤥ݡȤ(ޤƱξ񤬤Ǥcacertsե¸ߤƤ)򥤥ݡȤʽ֤̾뤳ȤǤޤΥϡCAαξˡꥯȤФ쥹ݥ󥹤ȤCA֤줿ǤޤCAαñξξϡξȡݡΥȥޤ\fIcacerts\fRȥեˤǤ¸ߤ뿮ǤȤѤƹۤǤ +証明書署名リクエストの提出先のCAの公開鍵を認証する証明書をインポートした後は(または同種の証明書がすでにcacertsファイル内に存在している場合は)、証明応答をインポートし、自己署名証明書を証明書チェーンで置き換えることができます。このチェーンは、CAの応答がチェーンの場合に、リクエストに対するレスポンスとしてCAから送り返された証明書チェーンです。また、CAの応答が単一の証明書の場合は、この証明応答と、インポート先のキーストア内または\fIcacerts\fRキーストアファイル内にすでに存在する信頼できる証明書とを使用して構築した証明書チェーンです。 .PP -ȤС̾ꥯȤVeriSign硢֤줿̾VSMarkJ\&.cerȤȡΤ褦ˤƱ򥤥ݡȤǤޤ +たとえば、証明書署名リクエストをVeriSignに送信する場合、送り返された証明書の名前がVSMarkJ\&.cerだとすると、次のようにして応答をインポートできます。 .sp .if n \{\ .RS 4 @@ -1036,11 +1036,11 @@ keytool \-importcert \-trustcacerts \-file VSMarkJ\&.cer .if n \{\ .RE .\} -.SS "ǧڤΥݡ" +.SS "公開鍵を認証する証明書のエクスポート" .PP -\fIjarsigner\fRޥɤѤJava Archive (JAR)ե˽̾硢ΥեѤ륯饤ȤϽ̾ǧڤɬפޤ饤Ȥ̾ǧڤˡ1ĤˡޤʬθξǤ륨ȥȤƥ饤ȤΥȥ˥ݡȤˡޤ +\fIjarsigner\fRコマンドを使用してJava Archive (JAR)ファイルに署名する場合、このファイルを使用するクライアントは署名を認証する必要があります。クライアントが署名を認証する方法の1つに、まず自分の公開鍵の証明書を信頼できるエントリとしてクライアントのキーストアにインポートする方法があります。 .PP -Τˤϡ򥨥ݡȤơ饤Ȥ󶡤ޤȤơΥޥɤѤơMJ\&.cerȤ̾Υե˾򥳥ԡǤޤΥޥɤǤϡȥ̾\fImykey\fRȲꤷƤޤ +そのためには、証明書をエクスポートして、クライアントに提供します。例として、次のコマンドを使用して、MJ\&.cerという名前のファイルに証明書をコピーできます。このコマンドでは、エントリに別名\fImykey\fRがあると仮定しています。 .sp .if n \{\ .RS 4 @@ -1052,12 +1052,12 @@ keytool \-exportcert \-alias mykey \-file MJ\&.cer .RE .\} .PP -Ƚ̾դJARեꤷ饤Ȥϡ\fIjarsigner\fRޥɤѤƽ̾ǧڤǤޤ -.SS "ȥΥݡ" +証明書と署名付きJARファイルを入手したクライアントは、\fIjarsigner\fRコマンドを使用して署名を認証できます。 +.SS "キーストアのインポート" .PP -ޥ\fIimportkeystore\fRѤС륭ȥΤ̤Υȥ˥ݡȤǤޤϡȤäȥΤ٤ƤΥȥ꤬ñΥޥɤѤƥåȥȥ˥ݡȤ뤳Ȥ̣ޤΥޥɤѤСۤʤ륿פΥȥ˴ޤޤ륨ȥ򥤥ݡȤ뤳ȤǤޤݡȻˤϡåȡȥοȥϤ٤ơƱ̾(̩̩ξ)ݸѥѥɤޤȥ/̩ꥫХǤʤ硢\fIkeytool\fRޥɤϥ桼˥ѥɤϤޤΥޥɤϡ̾νʣ򸡽Фȡ桼˿̾Ϥޤ桼ϡ̾ꤹ뤳Ȥ⡢ñ˴¸̾ξ񤭤\fIkeytool\fRޥɤ˵Ĥ뤳ȤǤޤ +コマンド\fIimportkeystore\fRを使用すれば、あるキーストアの全体を別のキーストア内にインポートできます。これは、鍵や証明書といったソースキーストア内のすべてのエントリが、単一のコマンドを使用してターゲットキーストア内にインポートされることを意味します。このコマンドを使用すれば、異なるタイプのキーストア内に含まれるエントリをインポートすることができます。インポート時には、ターゲット・キーストア内の新しいエントリはすべて、元と同じ別名および(秘密鍵や秘密鍵の場合は)保護用パスワードを持ちます。ソースキーストア内の非公開/秘密鍵をリカバリできない場合、\fIkeytool\fRコマンドはユーザーにパスワードの入力を求めます。このコマンドは、別名の重複を検出すると、ユーザーに新しい別名の入力を求めます。ユーザーは、新しい別名を指定することも、単純に既存の別名の上書きを\fIkeytool\fRコマンドに許可することもできます。 .PP -ȤС̾JKSפΥȥkey\&.jksΥȥPKCS#11פΥϡɥ١Υȥ˥ݡȤˤϡΥޥɤѤޤ +たとえば、通常のJKSタイプのキーストアkey\&.jks内のエントリをPKCS#11タイプのハードウェア・ベースのキーストア内にインポートするには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -1073,7 +1073,7 @@ keytool \-importkeystore .RE .\} .PP -ޤ\fIimportkeystore\fRޥɤѤС륽ȥñΥȥ򥿡åȡȥ˥ݡȤ뤳ȤǤޤξϡΥץ˲äơݡȤ̾ꤹɬפޤ\fI\-srcalias\fRץꤹˤϡå̾⥳ޥɥ饤󤫤Ǥ̩ۤ/̩ݸѥѥɤ䥿åݸѥѥɤǤޤˡ򼨤ޥɤ򼡤˼ޤ +また、\fIimportkeystore\fRコマンドを使用すれば、あるソース・キーストア内の単一のエントリをターゲット・キーストアにインポートすることもできます。この場合は、前例のオプションに加えて、インポートする別名を指定する必要があります。\fI\-srcalias\fRオプションを指定する場合には、ターゲット別名もコマンドラインから指定できるほか、秘密/秘密鍵の保護用パスワードやターゲット保護用パスワードも指定できます。その方法を示すコマンドを次に示します。 .sp .if n \{\ .RS 4 @@ -1092,9 +1092,9 @@ keytool \-importkeystore .if n \{\ .RE .\} -.SS "SSLСξ" +.SS "SSLサーバーの証明書の生成" .PP -ˡ3ĤΥƥƥĤޤ롼CA(\fIroot\fR)CA(\fIca\fR)SSLС(\fIserver\fR)ѤθڥȾ\fIkeytool\fRޥɤ򼨤ޤ٤ƤξƱȥ˳Ǽ褦ˤƤǤϡRSA侩븰Υ르ꥺǤ +次に、3つのエンティティ、つまりルートCA(\fIroot\fR)、中間CA(\fIca\fR)およびSSLサーバー(\fIserver\fR)用の鍵ペアと証明書を生成する\fIkeytool\fRコマンドを示します。すべての証明書を同じキーストアに格納するようにしてください。これらの例では、RSAが推奨される鍵のアルゴリズムです。 .sp .if n \{\ .RS 4 @@ -1120,30 +1120,30 @@ cat root\&.pem ca\&.pem server\&.pem | .if n \{\ .RE .\} -.SH "Ѹ" +.SH "用語" .PP -ȥ +キーストア .RS 4 -ȥϡŹ沽θȾǼ뤿εǽǤ +キーストアは、暗号化の鍵と証明書を格納するための機能です。 .RE .PP -ȥΥȥ +キーストアのエントリ .RS 4 -ȥˤϰۤʤ륿פΥȥޤ뤳ȤǤޤ\fIkeytool\fRޥɤǺǤŬϰϤιȥꡦפϡ2ĤǤ +キーストアには異なるタイプのエントリを含めることができます。\fIkeytool\fRコマンドで最も適用範囲の広いエントリ・タイプは、次の2つです。 .sp -\fBΥȥ\fR -\- ƥȥϡ˽פʰŹ沽θξݻޤξϡĤƤʤɤˡݸ줿dzǼޤ̤ˡμΥȥȤƳǼ븰ϡ̩бξȼ̩Ǥ򻲾ȤƤ\fIkeytool\fRޥɤξΥפΥȥǤΤФ\fIjarsigner\fRġϸԤΥפΥȥꡢĤޤ̩Ȥ˴Ϣդ줿Τߤޤ +\fB鍵のエントリ\fR +\- 各エントリは、非常に重要な暗号化の鍵の情報を保持します。この情報は、許可していないアクセスを防ぐために、保護された形で格納されます。一般に、この種のエントリとして格納される鍵は、秘密鍵か、対応する公開鍵の証明書チェーンを伴う秘密鍵です。証明書チェーンを参照してください。\fIkeytool\fRコマンドがこの両方のタイプのエントリを処理できるのに対し、\fIjarsigner\fRツールは後者のタイプのエントリ、つまり秘密鍵とそれに関連付けられた証明書チェーンのみを処理します。 .sp -\fBǤΥȥ\fR: ƥȥϡ軰Ԥθ1ĴޤǤޤΥȥϡǤȸƤФޤϡθSubject(ͭ)ˤäꤵ륢ǥƥƥͳ褹ΤǤ뤳Ȥ򡢥ȥνͭԤꤹ뤫ǤȯԼԤϡ˽̾դ뤳ȤˤäơƤݾڤޤ +\fB信頼できる証明書のエントリ\fR: 各エントリは、第三者からの公開鍵証明書を1つ含んでいます。このエントリは、信頼できる証明書と呼ばれます。それは、証明書内の公開鍵が、証明書のSubject(所有者)によって特定されるアイデンティティに由来するものであることを、キーストアの所有者が信頼するからです。証明書の発行者は、証明書に署名を付けることによって、その内容を保証します。 .RE .PP -ȥ̾ +キーストアの別名 .RS 4 -ȥΤ٤ƤΥȥ(ӿǤ񥨥ȥ)ϡդ̾𤷤ƥޤ +キーストアのすべてのエントリ(鍵および信頼できる証明書エントリ)は、一意の別名を介してアクセスされます。 .sp -̾ꤹΤϡ\fI\-genseckey\fRޥɤѤ̩ꡢ\fI\-genkeypair\fRޥɤѤƸڥ(̩)ꡢ\fI\-importcert\fRޥɤѤƾޤϾǤΥꥹȤɲäʤɡΥƥƥ򥭡ȥɲäǤʸ塢\fIkeytool\fRޥɤǥƥƥ򻲾ȤϡΤȤ˻ꤷ̾Ѥɬפޤ +別名を指定するのは、\fI\-genseckey\fRコマンドを使用して秘密鍵を生成したり、\fI\-genkeypair\fRコマンドを使用して鍵ペア(公開鍵と秘密鍵)を生成したり、\fI\-importcert\fRコマンドを使用して証明書または証明書チェーンを信頼できる証明書のリストに追加するなど、特定のエンティティをキーストアに追加する場合です。これ以後、\fIkeytool\fRコマンドでエンティティを参照する場合は、このときに指定した別名を使用する必要があります。 .sp -ȤС\fIduke\fRȤ̾Ѥƿ̩Υڥ򼫸ʽ̾ǥåפȤޤξϡΥޥɤ¹Ԥޤ򻲾ȤƤ +たとえば、\fIduke\fRという別名を使用して新しい公開鍵と秘密鍵のペアを生成し、公開鍵を自己署名証明書でラップするとします。この場合は、次のコマンドを実行します。証明書チェーンを参照してください。 .sp .if n \{\ .RS 4 @@ -1154,7 +1154,7 @@ keytool \-genkeypair \-alias duke \-keypass dukekeypasswd .if n \{\ .RE .\} -ǤϡѥɤȤ\fIdukekeypasswd\fRꤷƤޤʸ塢̾\fIduke\fR˴Ϣդ줿̩˥륳ޥɤ¹ԤȤϡΥѥɤɬפˤʤޤDuke̩Υѥɤ򤢤ȤѹˤϡΥޥɤ¹Ԥޤ +この例では、初期パスワードとして\fIdukekeypasswd\fRを指定しています。以後、別名\fIduke\fRに関連付けられた秘密鍵にアクセスするコマンドを実行するときは、このパスワードが必要になります。Dukeの秘密鍵のパスワードをあとから変更するには、次のコマンドを実行します。 .sp .if n \{\ .RS 4 @@ -1165,29 +1165,29 @@ keytool \-keypasswd \-alias duke \-keypass dukekeypasswd \-new newpass .if n \{\ .RE .\} -ѥɤ\fIdukekeypasswd\fR\fInewpass\fRѹޤƥȤŪȤ硢ޤϰǤ뤳Ȥ狼äƤ륷ƥǼ¹Ԥʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤɬפʥѥɤΥץ򥳥ޥɥ饤ǻꤷʤäϡѥɤϤޤ +パスワードが、\fIdukekeypasswd\fRから\fInewpass\fRに変更されます。テストを目的とする場合、または安全であることがわかっているシステムで実行する場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。必要なパスワードのオプションをコマンドラインで指定しなかった場合は、パスワードの入力を求められます。 .RE .PP -ȥμ +キーストアの実装 .RS 4 -\fIjava\&.security\fRѥå󶡤Ƥ\fIKeyStore\fR饹ϡȥξؤΥӾѹԤΡΤ줿󥿥ե󶡤ޤȥθȤƤϡ줾줬ΥפΥȥоݤȤʣΰۤʤ¸߲ǽǤ +\fIjava\&.security\fRパッケージで提供されている\fIKeyStore\fRクラスは、キーストア内の情報へのアクセスおよび情報の変更を行うための、明確に定義されたインタフェースを提供します。キーストアの固定実装としては、それぞれが特定のタイプのキーストアを対象とする複数の異なる実装が存在可能です。 .sp -ߡ\fIkeytool\fR\fIjarsigner\fR2ĤΥޥɥ饤󡦥ġȡPolicy ToolȤ̾GUI١Υġ뤬ȥμѤƤޤ\fIKeyStore\fR饹\fIpublic\fRǤ뤿ᡢ桼KeyStoreѤ¾ΥƥץꥱǤޤ +現在、\fIkeytool\fRと\fIjarsigner\fRの2つのコマンドライン・ツールと、Policy Toolという名前のGUIベースのツールが、キーストアの実装を使用しています。\fIKeyStore\fRクラスは\fIpublic\fRであるため、ユーザーはKeyStoreを使用した他のセキュリティ・アプリケーションも作成できます。 .sp -ȥˤϡOracle󶡤ȹߤΥǥեȤμޤϡJKSȤ̾ȼΥȥ()ѤΤǡȥեȤƼƤޤμǤϡġ̩ϸ̤Υѥɤˤäݸ졢ȥΤ(̩Ȥ̤)ѥɤˤäݸޤ +キーストアには、Oracleが提供する組込みのデフォルトの実装があります。これは、JKSという名前の独自のキーストア・タイプ(形式)を利用するもので、キーストアをファイルとして実装しています。この実装では、個々の秘密鍵は個別のパスワードによって保護され、キーストア全体の整合性も(秘密鍵とは別の)パスワードによって保護されます。 .sp -ȥμϡץХ١ǤŪˤϡ\fIKeyStore\fRˤä󶡤륢ץꥱ󡦥󥿥եӥץХ󥿥ե(SPI)˴ŤƼޤĤޤꡢб\fIKeystoreSpi\fRݥ饹(\fIjava\&.security\fRѥå˴ޤޤƤޤ)ꡢΥ饹ץХɬפΤService Provider InterfaceΥ᥽åɤƤޤǡ\fIץХ\fRȤϡJava Security APIˤäƥǽʥӥΥ֥åȤФθ󶡤ѥåޤϥѥåνΤȤǤȥμ󶡤ˤϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlˤ -JavaŹ沽ƥΥץХμˡƤ褦ˡ饤ȤϥץХ\fIKeystoreSpi\fR֥饹μ󶡤ɬפޤ +キーストアの実装は、プロバイダベースです。具体的には、\fIKeyStore\fRによって提供されるアプリケーション・インタフェースがサービス・プロバイダ・インタフェース(SPI)に基づいて実装されます。つまり、対応する\fIKeystoreSpi\fR抽象クラス(これも\fIjava\&.security\fRパッケージに含まれています)があり、このクラスが、プロバイダが実装する必要のあるService Provider Interfaceのメソッドを定義しています。ここで、\fIプロバイダ\fRとは、Java Security APIによってアクセス可能なサービスのサブセットに対し、その固定実装を提供するパッケージまたはパッケージの集合のことです。キーストアの実装を提供するには、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider\&.htmlにある +Java暗号化アーキテクチャのプロバイダの実装方法で説明しているように、クライアントはプロバイダを実装し、\fIKeystoreSpi\fRサブクラスの実装を提供する必要があります。 .sp -ץꥱǤϡ\fIKeyStore\fR饹󶡤\fIgetInstance\fRեȥꡦ᥽åɤѤ뤳Ȥǡ͡ʥץХۤʤ륿פΥȥμǤޤȥΥפϡȥγǼȥǡȤȤˡȥ/̩ȥȥݸ뤿˻Ѥ륢르ꥺޤۤʤ륿פΥȥμˤϡߴϤޤ +アプリケーションでは、\fIKeyStore\fRクラスが提供する\fIgetInstance\fRファクトリ・メソッドを使用することで、様々なプロバイダから異なるタイプのキーストアの実装を選択できます。キーストアのタイプは、キーストア情報の格納形式とデータ形式を定義するとともに、キーストア内の非公開/秘密鍵とキーストアの整合性を保護するために使用されるアルゴリズムを定義します。異なるタイプのキーストアの実装には、互換性はありません。 .sp -\fIkeytool\fRޥɤϡǤդΥե١Υȥưޤޥɡ饤Ϥ줿ȥξե̾Ȥưäơ\fIFileInputStream\fRѴ饭ȥɤޤ\fIjarsigner\fR\fIpolicytool\fRޥɤϡURLǻǤǤդξ꤫饭ȥɤ߼뤳ȤǤޤ +\fIkeytool\fRコマンドは、任意のファイルベースのキーストア実装で動作します。コマンド・ラインで渡されたキーストアの場所をファイル名として扱って、\fIFileInputStream\fRに変換し、ここからキーストア情報をロードします。\fIjarsigner\fRおよび\fIpolicytool\fRコマンドは、URLで指定できる任意の場所からキーストアを読み取ることができます。 .sp -\fIkeytool\fR\fIjarsigner\fRξ硢\fI\-storetype\fRץѤƥޥɥ饤ǥȥΥפǤޤPolicy Toolξϡ֥ȥץ˥塼ˤäƥȥΥפǤޤ +\fIkeytool\fRと\fIjarsigner\fRの場合、\fI\-storetype\fRオプションを使用してコマンドラインでキーストアのタイプを指定できます。Policy Toolの場合は、「キーストア」メニューによってキーストアのタイプを指定できます。 .sp -桼ȥΥפŪ˻ꤷʤä硢ƥץѥƥեǻꤵ줿\fIkeystore\&.type\fRץѥƥͤ˴Ťơġˤäƥȥμ򤵤ޤΥƥץѥƥե\fIjava\&.security\fRȸƤФ졢WindowsǤϥƥץѥƥǥ쥯ȥ\fIjava\&.home\elib\esecurity\fROracle SolarisǤ\fIjava\&.home/lib/security\fRˤޤ\fIjava\&.home\fRϡ¹ԻĶΥǥ쥯ȥǤ\fIjre\fRǥ쥯ȥϡSDKޤJava Runtime Environment (JRE)κǾ̤Υǥ쥯ȥˤޤ +ユーザーがキーストアのタイプを明示的に指定しなかった場合、セキュリティ・プロパティ・ファイルで指定された\fIkeystore\&.type\fRプロパティの値に基づいて、ツールによってキーストアの実装が選択されます。このセキュリティ・プロパティ・ファイルは\fIjava\&.security\fRと呼ばれ、Windowsではセキュリティ・プロパティ・ディレクトリ\fIjava\&.home\elib\esecurity\fR、Oracle Solarisでは\fIjava\&.home/lib/security\fRにあります。\fIjava\&.home\fRは、実行時環境のディレクトリです。\fIjre\fRディレクトリは、SDKまたはJava Runtime Environment (JRE)の最上位のディレクトリにあります。 .sp -ƥġϡ\fIkeystore\&.type\fRͤͤǻꤵ줿פΥȥƤץХĤޤǡߥ󥹥ȡ뤵Ƥ뤹٤ƤΥץХĴ٤ޤΥץХΥȥμѤޤ\fIKeyStore\fR饹Ƥstatic᥽å\fIgetDefaultType\fRѤȡץꥱ䥢ץåȤ\fIkeystore\&.type\fRץѥƥͤǤޤΥɤϡǥեȤΥȥ(\fIkeystore\&.type\fRץѥƥǻꤵ줿)Υ󥹥󥹤ޤ +各ツールは、\fIkeystore\&.type\fRの値を取得し、この値で指定されたタイプのキーストアを実装しているプロバイダが見つかるまで、現在インストールされているすべてのプロバイダを調べます。そのプロバイダからのキーストアの実装を使用します。\fIKeyStore\fRクラスに定義されているstaticメソッド\fIgetDefaultType\fRを使用すると、アプリケーションやアプレットから\fIkeystore\&.type\fRプロパティの値を取得できます。次のコードは、デフォルトのキーストア・タイプ(\fIkeystore\&.type\fRプロパティで指定されたタイプ)のインスタンスを生成します。 .sp .if n \{\ .RS 4 @@ -1198,7 +1198,7 @@ KeyStore keyStore = KeyStore\&.getInstance(KeyStore\&.getDefaultType()); .if n \{\ .RE .\} -ǥեȤΥȥפ\fIjks\fRǡOracle󶡤ȼΥפΥȥμǤϡƥץѥƥեμιԤˤäƻꤵƤޤ +デフォルトのキーストア・タイプは\fIjks\fRで、これはOracleが提供する独自のタイプのキーストアの実装です。これは、セキュリティ・プロパティ・ファイル内の次の行によって指定されています。 .sp .if n \{\ .RS 4 @@ -1209,7 +1209,7 @@ keystore\&.type=jks .if n \{\ .RE .\} -ƥġǥǥեȰʳΥȥμѤˤϡιԤѹ̤ΥȥΥפꤷޤȤС\fIpkcs12\fRȸƤФ륭ȥΥפΥȥμ󶡤ץХѥå硢Ԥ򼡤Τ褦ѹޤ +各ツールでデフォルト以外のキーストアの実装を使用するには、上の行を変更して別のキーストアのタイプを指定します。たとえば、\fIpkcs12\fRと呼ばれるキーストアのタイプのキーストアの実装を提供するプロバイダ・パッケージがある場合、行を次のように変更します。 .sp .if n \{\ .RS 4 @@ -1220,56 +1220,56 @@ keystore\&.type=pkcs12 .if n \{\ .RE .\} -\fB:\fR -ȥΥפλǤϡʸȾʸ϶̤ޤ󡣤ȤСJKSjksƱΤȤưޤ +\fB注意:\fR +キーストアのタイプの指定では、大文字と小文字は区別されません。たとえば、JKSとjksは同じものとして扱われます。 .RE .PP - +証明書 .RS 4 -()Ȥϡ륨ƥƥ(ȯԼ)Υǥ̾դʸΤȤǤˤϡ¾Τ륨ƥƥ(̾)θ(Ӥ¾ξ)̤ͤäƤ뤳Ȥ񤫤ƤޤѸϡ˴ϢƤޤ +証明書(公開鍵証明書)とは、あるエンティティ(発行者)からのデジタル署名付きの文書のことです。証明書には、他のあるエンティティ(署名者)の公開鍵(およびその他の情報)が特別な値を持っていることが書かれています。次の用語は、証明書に関連しています。 .sp -\fB\fR: ϡΥƥƥ˴Ϣդ줿Ǥϡ륨ƥƥȤδ֤˿Ǥطɬפ뤹٤ƤοͤФƸ뤳ȤտޤΤǤϡ̾򸡾ڤΤ˻Ѥޤ +\fB公開鍵\fR: 公開鍵は、特定のエンティティに関連付けられた数です。公開鍵は、該当するエンティティとの間に信頼できる関係を持つ必要があるすべての人に対して公開することを意図したものです。公開鍵は、署名を検証するのに使用されます。 .sp -\fBǥ̾\fR: ǡǥ̾ȡΥǡϡƥƥΥǥƥƥȡΥƥƥǡƤˤĤΤäƤ뤳Ȥ񤹤̾ȤȤ˳Ǽޤƥƥ̩Ѥƥǡ˽̾դȡǡε¤Բǽˤʤޤ +\fBデジタル署名\fR: データがデジタル署名されると、そのデータは、エンティティのアイデンティティと、そのエンティティがデータの内容について知っていることを証明書する署名とともに格納されます。エンティティの秘密鍵を使用してデータに署名を付けると、データの偽造は不可能になります。 .sp -\fBǥƥƥ\fR: ƥƥ򥢥ɥ쥹ꤹΤˡƥˤäƤϡ򥢥ǥƥƥˤΤޤ¾ˤ⡢Oracle Solaris UIDŻҥ᡼롦ɥ쥹X\&.509̾ʤɡ͡ʤΤ򥢥ǥƥƥȤ뤳ȤǤޤ +\fBアイデンティティ\fR: エンティティをアドレス指定する既知の方法。システムによっては、公開鍵をアイデンティティにするものがあります。公開鍵の他にも、Oracle Solaris UIDや電子メール・アドレス、X\&.509識別名など、様々なものをアイデンティティとすることができます。 .sp -\fB̾\fR: ̾ϡʤ餫Υǡ˥ƥƥ̩ѤƷ׻ޤ̾ԡξȯԼԤȤƤФޤ +\fB署名\fR: 署名は、なんらかのデータを基にエンティティの秘密鍵を使用して計算されます。署名者、証明書の場合は発行者とも呼ばれます。 .sp -\fB̩\fR: ̩ΥƥƥΤߤΤäƤΤȤǡοΤȤ򡢤Υƥƥ̩Ȥޤ̩ϡ¾Τʤ褦̩ˤƤȤˤʤäƤޤ̩ȸϡ٤ƤθŹ沽ƥФˤʤä¸ߤƤޤDSAʤɤŵŪʸŹ沽ƥξ硢1Ĥ̩Τ1Ĥθбޤ̩ϡ̾׻Τ˻Ѥޤ +\fB秘密鍵\fR: 秘密鍵は特定のエンティティのみが知っている数のことで、この数のことを、そのエンティティの秘密鍵といいます。秘密鍵は、他に知られないように秘密にしておくことが前提になっています。秘密鍵と公開鍵は、すべての公開鍵暗号化システムで対になって存在しています。DSAなどの典型的な公開鍵暗号化システムの場合、1つの秘密鍵は正確に1つの公開鍵に対応します。秘密鍵は、署名を計算するのに使用されます。 .sp -\fBƥƥ\fR: ƥƥϡ͡ȿץࡢԥ塼ȡԤʤɡٹ礤ǿоݤȤʤ͡ʤΤؤޤ +\fBエンティティ\fR: エンティティは、人、組織、プログラム、コンピュータ、企業、銀行など、一定の度合いで信頼の対象となる様々なものを指します。 .sp -Ź沽Ǥϡ桼θ˥ɬפޤ絬ϤʥͥåȥĶǤϡߤ̿Ƥ륨ƥƥ֤ǰδط³ΩƤȲꤷꡢѤƤ뤹٤Ƥθ᤿Ǥݥȥ꤬¸ߤȲꤷꤹ뤳ȤԲǽǤΤ褦ʸۤ˴ؤ褹뤿˾񤬹ͰƤޤߤǤϡȯԶ(CA)Ǥ軰ԤȤƵǽޤCAϡ¾Υƥƥξ˽̾(ȯԤ)԰٤򡢿ꤷǤƤ륨ƥƥ(Ȥʤ)ǤCAˡΧη˹«ΤǡͭĿǤΤߤΤȤưޤVeriSignThawteEntrustϤᡢ¿θŪʾȯԶɤ¸ߤޤ +公開鍵暗号化では、ユーザーの公開鍵にアクセスする必要があります。大規模なネットワーク環境では、互いに通信しているエンティティ間で以前の関係が引続き確立されていると仮定したり、使用されているすべての公開鍵を収めた信頼できるリポジトリが存在すると仮定したりすることは不可能です。このような公開鍵の配布に関する問題を解決するために証明書が考案されました。現在では、証明書発行局(CA)が信頼できる第三者として機能します。CAは、他のエンティティの証明書に署名する(発行する)行為を、信頼して任されているエンティティ(企業など)です。CAは法律上の契約に拘束されるので、有効かつ信頼できる証明書のみを作成するものとして扱われます。VeriSign、Thawte、Entrustをはじめ、多くの公的な証明書発行局が存在します。 .sp -MicrosoftǧڥСEntrustCAʤʤɤ°ȿѤСȼξȯԶɤ򱿱Ĥ뤳ȤǽǤ\fIkeytool\fRޥɤѤȡɽݡȤӥݡȤԤȤǤޤޤʽ̾뤳ȤǤޤ +Microsoftの認証サーバー、EntrustのCA製品などを所属組織内で利用すれば、独自の証明書発行局を運営することも可能です。\fIkeytool\fRコマンドを使用すると、証明書の表示、インポートおよびエクスポートを行うことができます。また、自己署名証明書を生成することもできます。 .sp -ߡ\fIkeytool\fRޥɤX\&.509оݤˤƤޤ +現在、\fIkeytool\fRコマンドはX\&.509証明書を対象にしています。 .RE .PP -X\&.509 +X\&.509証明書 .RS 4 -X\&.509ʤǤϡ˴ޤƤꡢξ˽񤭹ˡ(ǡ)ˤĤƤ⵭ҤƤޤΤ٤ƤΥǡϡASN\&.1/DERȸƤФ2ĤδϢʤѤ沽ޤAbstract Syntax Notation 1ϥǡˤĤƵҤƤޤDefinite Encoding Rulesϡǡ¸žˡˤĤƵҤƤޤ +X\&.509規格では、証明書に含める情報が定義されており、この情報を証明書に書き込む方法(データ形式)についても記述されています。証明書のすべてのデータは、ASN\&.1/DERと呼ばれる2つの関連規格を使用して符号化されます。Abstract Syntax Notation 1はデータについて記述しています。Definite Encoding Rulesは、データの保存および転送の方法について記述しています。 .sp -٤ƤX\&.509ϡ̾¾˼ΥǡޤǤޤ +すべてのX\&.509証明書は、署名の他に次のデータを含んでいます。 .sp -\fBС\fR: ŬѤX\&.509ʤΥСꤷޤ˻ǤϡСˤäưۤʤޤΤȤ3ĤΥСƤޤ\fIkeytool\fRޥɤǤϡv1v2v3ξ򥤥ݡȤӥݡȤǤޤv3ξޤ +\fBバージョン\fR: 証明書に適用されるX\&.509規格のバージョンを特定します。証明書に指定できる情報は、バージョンによって異なります。今のところ、3つのバージョンが定義されています。\fIkeytool\fRコマンドでは、v1、v2、v3の証明書をインポートおよびエクスポートできます。v3の証明書を生成します。 .sp -X\&.509 Version 1ϡ1988ǯѤƹڤƤꡢǤŪǤ +X\&.509 Version 1は、1988年から利用されて広く普及しており、最も一般的です。 .sp -X\&.509 Version 2ǤϡSubjectȯԼԤ̾򤢤ȤǺѤǤ褦ˤ뤿ˡSubjectȯԼԤΰռ̻ҤγǰƳޤۤȤɤξץեʸǤϡ̾ƻѤʤȤȡǰդμ̻ҤѤʤȤ侩ƤޤVersion 2ξϡϻѤƤޤ +X\&.509 Version 2では、Subjectや発行者の名前をあとで再利用できるようにするために、Subjectと発行者の一意識別子の概念が導入されました。ほとんどの証明書プロファイル文書では、名前を再使用しないことと、証明書で一意の識別子を使用しないことが、強く推奨されています。Version 2の証明書は、広くは使用されていません。 .sp -X\&.509 Version 3ϺǤ⿷(1996ǯ)ʤǡƥ󥷥γǰ򥵥ݡȤƤޤƥ󥷥ïǤ뤳ȤǤ˴ޤ뤳ȤǤޤŪʥƥ󥷥ȤƤϡKeyUsage(\fI̾\fRʤɡλѤŪ¤)AlternativeNames(DNS̾Żҥ᡼롦ɥ쥹IPɥ쥹ʤɡ¾Υǥƥƥ˴Ϣդ뤳ȤǤ)ʤɤޤƥ󥷥ˤϡcriticalȤޡդơΥƥ󥷥ΥåȻѤ̳Ť뤳ȤǤޤȤСcriticalȥޡ졢\fIkeyCertSign\fRꤵ줿KeyUsageƥ󥷥󤬾˴ޤޤƤ硢ξSSL̿󼨤ȡ񤬵ݤޤϡΥƥ󥷥ˤäơϢ̩ν̾ѤȤƻꤵƤꡢSSLǤϻѤǤʤǤ +X\&.509 Version 3は最も新しい(1996年)規格で、エクステンションの概念をサポートしています。エクステンションは誰でも定義することができ、証明書に含めることができます。一般的なエクステンションとしては、KeyUsage(\fI署名専用\fRなど、鍵の使用を特定の目的に制限する)、AlternativeNames(DNS名、電子メール・アドレス、IPアドレスなど、他のアイデンティティを公開鍵に関連付けることができる)などがあります。エクステンションには、criticalというマークを付けて、そのエクステンションのチェックと使用を義務づけることができます。たとえば、criticalとマークされ、\fIkeyCertSign\fRが設定されたKeyUsageエクステンションが証明書に含まれている場合、この証明書をSSL通信中に提示すると、証明書が拒否されます。これは、証明書のエクステンションによって、関連する秘密鍵が証明書の署名専用として指定されており、SSLでは使用できないためです。 .sp -\fBꥢֹ\fR: ƥƥϡΥƥƥȯԤ¾ξȶ̤뤿ˡ˥ꥢֹƤޤξϡ͡ˡǻѤޤȤС񤬼äȡꥢֹ椬񼺸ꥹ(CRL)˳Ǽޤ +\fBシリアル番号\fR: 証明書を作成したエンティティは、そのエンティティが発行する他の証明書と区別するために、証明書にシリアル番号を割り当てます。この情報は、様々な方法で使用されます。たとえば、証明書が取り消されると、シリアル番号が証明書失効リスト(CRL)に格納されます。 .sp -\fB񥢥르ꥺ༱̻\fR: ˽̾դȤCAѤ르ꥺꤷޤ +\fB証明書アルゴリズム識別子\fR: 証明書に署名を付けるときにCAが使用したアルゴリズムを特定します。 .sp -\fBȯԼ̾\fR: ˽̾դƥƥX\&.500̾ǤX\&.500̾򻲾ȤƤ̾CAǤξѤ뤳Ȥϡ˽̾դƥƥꤹ뤳Ȥ̣ޤ롼ȤĤޤȥåץ٥CAξʤɡˤäƤȯԼԤȤξ˽̾դ뤳Ȥޤ +\fB発行者名\fR: 証明書に署名を付けたエンティティのX\&.500識別名です。X\&.500識別名を参照してください。通常はCAです。この証明書を使用することは、証明書に署名を付けたエンティティを信頼することを意味します。ルートつまりトップレベルのCAの証明書など、場合によっては発行者が自身の証明書に署名を付けることがあります。 .sp -\fBͭ\fR: ƾϸ¤줿֤ΤͭǤδ֤ϳϤȽλˤäƻꤵ졢äû֤100ǯȤĹˤ錄뤳Ȥ⤢ޤ򤵤֤ͭϡؤν̾˻Ѥ̩ζ٤˻ʧۤʤɡ͡װǰۤʤޤ֤ͭϡϢ̩»ʤˡƥƥǤȴԤ֤Ǥ +\fB有効期間\fR: 各証明書は限られた期間のみ有効です。この期間は開始の日時と終了の日時によって指定され、数秒の短い期間から100年という長期にわたることもあります。選択される有効期間は、証明書への署名に使用される秘密鍵の強度や証明書に支払う金額など、様々な要因で異なります。有効期間は、関連する秘密鍵が損われない場合に、エンティティが公開鍵を信頼できると期待される期間です。 .sp -\fB̾\fR: Ǹǧڤ륨ƥƥ̾̾X\&.500ɸѤΤǡ󥿡ͥåΤǰդʤΤꤵޤϡƥƥX\&.500̾(DN)ǤX\&.500̾򻲾ȤƤ򼨤ޤ +\fB主体名\fR: 証明書で公開鍵を認証するエンティティの名前。この名前はX\&.500標準を使用するので、インターネット全体で一意なものと想定されます。これは、エンティティのX\&.500識別名(DN)です。X\&.500識別名を参照してください。次に例を示します。 .sp .if n \{\ .RS 4 @@ -1280,33 +1280,33 @@ CN=Java Duke, OU=Java Software Division, O=Oracle Corporation, C=US .if n \{\ .RE .\} -Ϥ줾Τ̾(CN)ȿñ(OU)ȿ(O)(C)ɽޤ +これらはそれぞれ主体の通称(CN)、組織単位(OU)、組織(O)、国(C)を表します。 .sp -\fBΤθ\fR: ̾դ줿ƥƥθȥ르ꥺ༱̻ҤǤ르ꥺ༱̻ҤǤϡФƻѤƤŹ沽ƥपӴϢ븰ѥ᡼ꤵƤޤ +\fB主体の公開鍵情報\fR: 名前を付けられたエンティティの公開鍵とアルゴリズム識別子です。アルゴリズム識別子では、公開鍵に対して使用されている公開鍵暗号化システムおよび関連する鍵パラメータが指定されています。 .RE .PP - +証明書チェーン .RS 4 -\fIkeytool\fRޥɤǤϡ̩ӴϢޤ७ȥθȥ뤳ȤǤޤΤ褦ʥȥǤϡ̩бϡκǽξ˴ޤޤƤޤ +\fIkeytool\fRコマンドでは、秘密鍵および関連する証明書チェーンを含むキーストアの鍵エントリを作成し、管理することができます。このようなエントリでは、秘密鍵に対応する公開鍵は、チェーンの最初の証明書に含まれています。 .sp -ƺȡʽ̾Ȥ1ĤǤΤߤޤ󤬳Ϥޤ\fI\fR\-genkeypairޥɤ򻲾ȤƤʽ̾ȯԼ(̾)ΤƱǤΤϡθˤäǧڤ륨ƥƥǤ\fI\-genkeypair\fRޥɤƤӽФƿ̩ΥڥȡϾ˼ʽ̾ǥåפޤ +鍵を初めて作成すると、自己署名証明書という1つの要素のみを含むチェーンが開始されます。\fIの\fR\-genkeypairコマンドを参照してください。自己署名証明書は発行者(署名者)が主体と同じです。主体は、その公開鍵が証明書によって認証されるエンティティです。\fI\-genkeypair\fRコマンドを呼び出して新しい公開鍵と秘密鍵のペアを作成すると、公開鍵は常に自己署名証明書でラップされます。 .sp -θ塢̾ꥯ(CSR)\fI\-certreq\fRޥɤơCSRȯԶ(CA)ȡCAΥ쥹ݥ󥹤\fI\-importcert\fRǥݡȤ졢μʽ̾Ͼˤä֤ޤޥɤ\fI\-certreq\fR\fI\-importcert\fRץ򻲾ȤƤκǸˤΤϡSubjectθǧڤCAȯԤ()ǤΤξϡCAθǧڤǤ +この後、証明書署名リクエスト(CSR)が\fI\-certreq\fRコマンドで生成されて、CSRが証明書発行局(CA)に送信されると、CAからのレスポンスが\fI\-importcert\fRでインポートされ、元の自己署名証明書は証明書チェーンによって置き換えられます。コマンドの\fI\-certreq\fRおよび\fI\-importcert\fRオプションを参照してください。チェーンの最後にあるのは、Subjectの公開鍵を認証したCAが発行した証明書(応答)です。チェーン内のその前の証明書は、CAの公開鍵を認証する証明書です。 .sp -CAθǧڤϡ¿ξ硢ʽ̾(ĤޤCAȤθǧڤ)ǤꡢϥκǽξˤʤޤˤäƤϡCAΥ֤Ȥ⤢ޤξ硢κǸξ(CAˤäƽ̾졢ȥθǧڤ)ѤϤޤ󤬡ΤξϡCSRCAȤ̤CAˤäƽ̾졢CSRCAθǧڤˤʤޤΤξϡCAθǧڤˤʤޤʲƱͤˡʽ̾줿֥롼ȡ׾ãޤǥ³ޤäơ(ǽξʸ)ƾǤϡμξν̾ԤθǧڤƤ뤳Ȥˤʤޤ +CAの公開鍵を認証する証明書は、多くの場合、自己署名証明書(つまりCAが自身の公開鍵を認証した証明書)であり、これはチェーンの最初の証明書になります。場合によっては、CAが証明書のチェーンを返すこともあります。この場合、チェーン内の最後の証明書(CAによって署名され、鍵エントリの公開鍵を認証する証明書)に変わりはありませんが、チェーン内のその前の証明書は、CSRの送信先のCAとは別のCAによって署名され、CSRの送信先のCAの公開鍵を認証する証明書になります。チェーン内のその前の証明書は、次のCAの鍵を認証する証明書になります。以下同様に、自己署名された「ルート」証明書に達するまでチェーンが続きます。したがって、チェーン内の(最初の証明書以後の)各証明書では、チェーン内の次の証明書の署名者の公開鍵が認証されていることになります。 .sp -¿CAϡ򥵥ݡȤȯԺѤξΤߤ֤ޤäˡ֤CA¸ߤʤեåȤʳع¤ξϡηǤΤ褦ʾϡȥˤǤ˳ǼƤ뿮Ǥ󤫤顢Ωɬפޤ +多くのCAは、チェーンをサポートせずに発行済の証明書のみを返します。特に、中間のCAが存在しないフラットな階層構造の場合は、その傾向が顕著です。このような場合は、キーストアにすでに格納されている信頼できる証明書情報から、証明書チェーンを確立する必要があります。 .sp -̤α(PKCS#7Ƥ)ǤϡȯԺѾ˲äΥݡȤޤޤƤޤ\fIkeytool\fRޥɤǤϡɤαⰷȤǤޤ +別の応答形式(PKCS#7で定義されている形式)では、発行済証明書に加え、証明書チェーンのサポートが含まれています。\fIkeytool\fRコマンドでは、どちらの応答形式も扱うことができます。 .sp -ȥåץ٥(롼)CAξϡʽ̾Ǥ롼Ȥθؤοϡ롼ȾΤǤϤʤʹʤ¾ΥޤϡVeriSign롼CAʤɤμ̾ѤơïǤ⼫ʽ̾Ǥ뤿Ǥ롼CAθϹΤƤޤ롼CAθ˳ǼͳϡȤˤ뤳Ȥ¿Υġ뤫ѤǤ褦ˤʤ뤫ˤޤ󡣤Ĥޤꡢϡ롼CAθ򱿤֡ΡפȤѤΤߤǤ롼CAξ򥭡ȥɲäȤϡ\fI\-printcert\fRץѤơ˾Ƥɽɽ줿ե󥬡ץȤȡʹ롼CAWebڡʤɤꤷΤΥե󥬡ץȤȤӤɬפޤ +トップレベル(ルート)CAの証明書は、自己署名証明書です。ただし、ルートの公開鍵への信頼は、ルート証明書自体からではなく、新聞など他のソースから取得されます。これは、VeriSignルートCAなどの識別名を使用して、誰でも自己署名型証明書を生成できるためです。ルートCAの公開鍵は広く知られています。ルートCAの公開鍵を証明書に格納する理由は、証明書という形式にすることで多くのツールから利用できるようになるからにすぎません。つまり、証明書は、ルートCAの公開鍵を運ぶ「媒体」として利用されるのみです。ルートCAの証明書をキーストアに追加するときは、\fI\-printcert\fRオプションを使用して、その前に証明書の内容を表示し、表示されたフィンガープリントと、新聞やルートCAのWebページなどから入手した既知のフィンガープリントとを比較する必要があります。 .RE .PP -cacertsե +cacerts証明書ファイル .RS 4 -\fIcacerts\fRȤ̾ξեϡWindowsǤϥƥץѥƥǥ쥯ȥ\fIjava\&.home\elib\esecurity\fROracle SolarisǤ\fIjava\&.home/lib/security\fR֤Ƥޤ\fIjava\&.home\fRϡ¹ԴĶΥǥ쥯ȥ(SDK\fIjre\fRǥ쥯ȥޤJREκǾ̥ǥ쥯ȥ)Ǥ +\fIcacerts\fRという名前の証明書ファイルは、Windowsではセキュリティ・プロパティ・ディレクトリ\fIjava\&.home\elib\esecurity\fR、Oracle Solarisでは\fIjava\&.home/lib/security\fRに置かれています。\fIjava\&.home\fRは、実行環境のディレクトリ(SDKの\fIjre\fRディレクトリまたはJREの最上位ディレクトリ)です。 .sp -\fIcacerts\fRեϡCAξޤࡢƥΤΥȥǤƥԤϡȥפ\fIjks\fRꤹ뤳Ȥǡ\fIkeytool\fRޥɤѤƤΥեιȴԤȤǤޤ\fIcacerts\fRȥեϡ롼CAΥǥեȡåȤޤ֤ǽв٤ƤޤǥեȤξɽˤϡΥޥɤѤޤ +\fIcacerts\fRファイルは、CAの証明書を含む、システム全体のキーストアです。システム管理者は、キーストア・タイプに\fIjks\fRを指定することで、\fIkeytool\fRコマンドを使用してこのファイルの構成と管理を行うことができます。\fIcacerts\fRキーストア・ファイルは、ルートCA証明書のデフォルト・セットを含んだ状態で出荷されています。デフォルトの証明書を一覧表示するには、次のコマンドを使用します。 .sp .if n \{\ .RS 4 @@ -1317,23 +1317,23 @@ keytool \-list \-keystore java\&.home/lib/security/cacerts .if n \{\ .RE .\} -\fIcacerts\fRȥեνѥɤϡ\fIchangeit\fRǤƥԤϡSDKΥ󥹥ȡ塢ΥեΥѥɤȥǥեȡѹɬפޤ +\fIcacerts\fRキーストア・ファイルの初期パスワードは、\fIchangeit\fRです。システム管理者は、SDKのインストール後、このファイルのパスワードとデフォルト・アクセス権を変更する必要があります。 .sp -\fB:\fR -\fIcacerts\fRեǧ뤳ȤפǤ\fIcacerts\fRեCAϡ̾¾ΥƥƥؤξȯԤΤΥƥƥȤƿꤵ뤿ᡢ\fIcacerts\fRեδϿŤ˹Ԥɬפޤ\fIcacerts\fRեˤϡꤹCAξΤߤޤޤƤɬפޤ桼ϡȤǤˤơ\fIcacerts\fRե˥Хɥ뤵Ƥ뿮Ǥ롼CA򸡾ڤ˴ؤȼηԤޤ +\fB注意:\fR +\fIcacerts\fRファイルを確認することが重要です。\fIcacerts\fRファイル内のCAは、署名および他のエンティティへの証明書発行のためのエンティティとして信頼されるため、\fIcacerts\fRファイルの管理は慎重に行う必要があります。\fIcacerts\fRファイルには、信頼するCAの証明書のみが含まれている必要があります。ユーザーは、自身の責任において、\fIcacerts\fRファイルにバンドルされている信頼できるルートCA証明書を検証し、信頼性に関する独自の決定を行います。 .sp -ǤʤCA\fIcacerts\fRե뤫ˤϡ\fIkeytool\fRޥɤ\fIdelete\fRץѤޤ\fIcacerts\fRեJREΥ󥹥ȡ롦ǥ쥯ȥˤޤΥեԽ륢ʤϡƥԤϢƤ +信頼できないCA証明書を\fIcacerts\fRファイルから削除するには、\fIkeytool\fRコマンドの\fIdelete\fRオプションを使用します。\fIcacerts\fRファイルはJREのインストール・ディレクトリにあります。このファイルを編集するアクセス権がない場合は、システム管理者に連絡してください .RE .PP -󥿡ͥåRFC 1421沽 +インターネットRFC 1421証明書符号化規格 .RS 4 -¿ξ硢ϡХʥ沽ǤϤʤ󥿡ͥåRFC 1421ʤƤϲǽ沽ѤƳǼޤBase 64沽ȤƤФ뤳ξǤϡŻҥ᡼䤽¾ε̤ơ¾Υץꥱ˾ưפ˥ݡȤǤޤ +多くの場合、証明書は、バイナリ符号化ではなく、インターネットRFC 1421規格で定義されている出力可能符号化方式を使用して格納されます。Base 64符号化とも呼ばれるこの証明書形式では、電子メールやその他の機構を通じて、他のアプリケーションに証明書を容易にエクスポートできます。 .sp -\fI\-importcert\fR\fI\-printcert\fRޥɤǤϡηξȥХʥ沽ξɤ߹ळȤǤޤ\fI\-exportcert\fRޥɤǤϡǥեȤǥХʥ沽ξ񤬽Ϥޤ\fI\-rfc\fRץꤷϡϲǽ沽ξ񤬽Ϥޤ +\fI\-importcert\fRと\fI\-printcert\fRコマンドでは、この形式の証明書とバイナリ符号化の証明書を読み込むことができます。\fI\-exportcert\fRコマンドでは、デフォルトでバイナリ符号化の証明書が出力されます。ただし、\fI\-rfc\fRオプションを指定した場合は、出力可能符号化方式の証明書が出力されます。 .sp -\fI\-list\fRޥɤǤϡǥեȤǾSHA1ե󥬡ץȤϤޤ\fI\-v\fRץ󤬻ꤵƤ硢ϿͤǤǽϤޤ\fI\-rfc\fRץ󤬻ꤵƤ硢Ͻϲǽ沽ǽϤޤ +\fI\-list\fRコマンドでは、デフォルトで証明書のSHA1フィンガープリントが出力されます。\fI\-v\fRオプションが指定されている場合、証明書は人が理解できる形式で出力されます。\fI\-rfc\fRオプションが指定されている場合、証明書は出力可能符号化方式で出力されます。 .sp -ϲǽ沽沽줿ϡΥƥȤǻϤޤꡢΥƥȤǽλޤ +出力可能符号化方式で符号化された証明書は、次のテキストで始まり、次のテキストで終了します。 .sp .if n \{\ .RS 4 @@ -1350,21 +1350,21 @@ encoded certificate goes here\&. .\} .RE .PP -X\&.500̾ +X\&.500識別名 .RS 4 -X\&.500̾ϡƥƥꤹ뤿˻ѤޤȤСX\&.509\fIsubject\fRեɤ\fIissuer\fR(̾)եɤǻꤵ̾ϡX\&.500̾Ǥ\fIkeytool\fRޥɤϡΥ֥ѡȤ򥵥ݡȤƤޤ +X\&.500識別名は、エンティティを特定するために使用されます。たとえば、X\&.509証明書の\fIsubject\fRフィールドと\fIissuer\fR(署名者)フィールドで指定される名前は、X\&.500識別名です。\fIkeytool\fRコマンドは、次のサブパートをサポートしています。 .sp -\fBcommonName\fR: Susan Jonesʤɡͤ̾Ρ +\fBcommonName\fR: Susan Jonesなど、人の通称。 .sp -\fBorganizationUnit\fR: ȿ(ݤʤ)̾ΡPurchasingʤɤǤ +\fBorganizationUnit\fR: 小さな組織(部、課など)の名称。Purchasingなどです。 .sp -\fBlocalityName\fR: ϰ(Ի)̾Palo Altoʤɡ +\fBlocalityName\fR: 地域(都市)名。Palo Altoなど。 .sp -\fBstateName\fR: ̾ޤ̾Californiaʤɡ +\fBstateName\fR: 州名または地方名。Californiaなど。 .sp -\fBcountry\fR: 2ʸι񥳡ɡCHʤɡ +\fBcountry\fR: 2文字の国コード。CHなど。 .sp -̾ʸ\fI\-dname\fRץͤȤƻꤹ(Ȥ\fI\-genkeypair\fRޥɤ)ʸϼηˤɬפޤ +識別名文字列を\fI\-dname\fRオプションの値として指定する場合(たとえば\fI\-genkeypair\fRコマンドに)、文字列は次の形式にする必要があります。 .sp .if n \{\ .RS 4 @@ -1375,7 +1375,7 @@ CN=cName, OU=orgUnit, O=org, L=city, S=state, C=countryCode .if n \{\ .RE .\} -åΤιܤϡºݤ˻ꤹͤɽޤû̷Υɤΰ̣ϡΤȤǤ +イタリック体の項目は、実際に指定する値を表します。短縮形のキーワードの意味は、次のとおりです。 .sp .if n \{\ .RS 4 @@ -1391,7 +1391,7 @@ C=country .if n \{\ .RE .\} -˼Τϡ̾ʸǤ +次に示すのは、識別名文字列の例です。 .sp .if n \{\ .RS 4 @@ -1402,7 +1402,7 @@ CN=Mark Smith, OU=Java, O=Oracle, L=Cupertino, S=California, C=US .if n \{\ .RE .\} -ʸѤޥɤǤ +この文字列を使用したコマンドの例です。 .sp .if n \{\ .RS 4 @@ -1414,9 +1414,9 @@ S=California, C=US" \-alias mark .if n \{\ .RE .\} -ɤû̷ǤϡʸȾʸ϶̤ޤ󡣤ȤСCNcnCnϡɤƱΤȤưޤ +キーワードの短縮形では、大文字と小文字は区別されません。たとえば、CN、cnおよびCnは、どれも同じものとして扱われます。 .sp -ɤλˤϰ̣ꡢƥ֥ݡͥȤϾ˼ǻꤹɬפޤ֥ݡͥȤ򤹤٤ƻꤹɬפϤޤ󡣤ȤСΤ褦˰Υ֥ݡͥȤΤߤǤޤ +一方、キーワードの指定順序には意味があり、各サブコンポーネントは上に示した順序で指定する必要があります。ただし、サブコンポーネントをすべて指定する必要はありません。たとえば、次のように一部のサブコンポーネントのみを指定できます。 .sp .if n \{\ .RS 4 @@ -1427,7 +1427,7 @@ CN=Steve Meier, OU=Java, O=Oracle, C=US .if n \{\ .RE .\} -̾ʸͤ˥ޤޤޤˡޥɥ饤ʸꤹȤˤϡΤ褦˥ޤХååʸ(\e)ǥפɬפޤ +識別名文字列の値にカンマが含まれる場合に、コマンドラインで文字列を指定するときには、次のようにカンマをバックスラッシュ文字(\e)でエスケープする必要があります。 .sp .if n \{\ .RS 4 @@ -1438,14 +1438,14 @@ cn=Peter Schuster, ou=Java\e, Product Development, o=Oracle, c=US .if n \{\ .RE .\} -̾ʸ򥳥ޥɥ饤ǻꤹɬפϤޤ󡣼̾ɬפȤ륳ޥɤ¹ԤȤˡޥɥ饤Ǽ̾ꤷʤäϡƥ֥ݡͥȤϤޤξϡޤХåå(\e)ǥפɬפϤޤ +識別名文字列をコマンドラインで指定する必要はありません。識別名を必要とするコマンドを実行するときに、コマンドラインで識別名を指定しなかった場合は、各サブコンポーネントの入力を求められます。この場合は、カンマをバックスラッシュ(\e)でエスケープする必要はありません。 .RE -.SH "ٹ" -.SS "ǤΥݡȷٹ" +.SH "警告" +.SS "信頼できる証明書のインポート警告" .PP -\fB\fR: ǤȤƾ򥤥ݡȤˡƤ򿵽ŤĴ٤Ƥ -Windows:.PP -ޤ\fI\-noprompt\fRץꤻ\fI\-printcert\fRޥɤޤ\fI\-importcert\fRޥɤѤơɽޤɽ줿Υե󥬡ץȤԤե󥬡ץȤȰפ뤳ȤǧޤȤСƤơξ\fI\etmp\ecert\fRȤ̾ǥե˳ǼƤȤޤξϡǤΥꥹȤˤξɲäˡ\fI\-printcert\fRޥɤ¹Ԥƥե󥬡ץȤɽǤޤȤСΤ褦ˤޤ +\fB重要\fR: 信頼できる証明書として証明書をインポートする前に、証明書の内容を慎重に調べてください。 +Windowsの例:.PP +まず、\fI\-noprompt\fRオプションを指定せずに\fI\-printcert\fRコマンドまたは\fI\-importcert\fRコマンドを使用して、証明書を表示します。表示された証明書のフィンガープリントが、期待されるフィンガープリントと一致することを確認します。たとえば、証明書が送られてきて、この証明書を\fI\etmp\ecert\fRという名前でファイルに格納しているとします。この場合は、信頼できる証明書のリストにこの証明書を追加する前に、\fI\-printcert\fRコマンドを実行してフィンガープリントを表示できます。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -1465,8 +1465,8 @@ Windows .if n \{\ .RE .\} -Oracle Solaris:.PP -ޤ\fI\-noprompt\fRץꤻ\fI\-printcert\fRޥɤޤ\fI\-importcert\fRޥɤѤơɽޤɽ줿Υե󥬡ץȤԤե󥬡ץȤȰפ뤳ȤǧޤȤС桼Ƥơξ\fI/tmp/cert\fRȤ̾ǥե˳ǼƤȤޤξϡǤΥꥹȤˤξɲäˡ\fI\-printcert\fRޥɤ¹Ԥƥե󥬡ץȤɽǤޤȤСΤ褦ˤޤ +Oracle Solarisの例:.PP +まず、\fI\-noprompt\fRオプションを指定せずに\fI\-printcert\fRコマンドまたは\fI\-importcert\fRコマンドを使用して、証明書を表示します。表示された証明書のフィンガープリントが、期待されるフィンガープリントと一致することを確認します。たとえば、あるユーザーから証明書が送られてきて、この証明書を\fI/tmp/cert\fRという名前でファイルに格納しているとします。この場合は、信頼できる証明書のリストにこの証明書を追加する前に、\fI\-printcert\fRコマンドを実行してフィンガープリントを表示できます。たとえば、次のようにします。 .sp .if n \{\ .RS 4 @@ -1487,32 +1487,32 @@ Oracle Solaris .RE .\} .PP -ˡʪϢοʪ󼨤ե󥬡ץȤȡΥޥɤɽ줿ե󥬡ץȤȤӤޤե󥬡ץȤפС¾βԤ(Ԥʤ)ˤΤؤԤƤʤȤǧǤޤǤμι⤬ԤƤ硢åԤ鷺˾򥤥ݡȤȡԤˤäƽ̾줿٤ƤΤ(Ūտޤĥ饹եޤJARեʤ)ꤹ뤳Ȥˤʤޤ +次に、証明書を送信した人物に連絡し、この人物が提示したフィンガープリントと、上のコマンドで表示されたフィンガープリントとを比較します。フィンガープリントが一致すれば、送信途中で他の何者か(攻撃者など)による証明書のすり替えが行われていないことを確認できます。送信途中でこの種の攻撃が行われていた場合、チェックを行わずに証明書をインポートすると、攻撃者によって署名されたすべてのもの(攻撃的意図を持つクラス・ファイルを含んだJARファイルなど)を信頼することになります。 .PP -\fB:\fR -򥤥ݡȤ\fI\-printcert\fRޥɤ¹ԤɬפϤޤ󡣥ȥοǤΥꥹȤ˾ɲäˡ\fI\-importcert\fRޥɤˤäƾξɽ졢ǧåɽ뤿Ǥ桼ϥݡߤǤޤ¹ԤǤΤϡ\fI\-noprompt\fRץꤻ\fI\-importcert\fRޥɤƤӽФΤߤǤ\fI\-noprompt\fRץ󤬻ꤵƤ硢桼ȤäϹԤޤ -.SS "ѥɷٹ" +\fB注意:\fR +証明書をインポートする前に\fI\-printcert\fRコマンドを実行する必要はありません。キーストア内の信頼できる証明書のリストに証明書を追加する前に、\fI\-importcert\fRコマンドによって証明書の情報が表示され、確認を求めるメッセージが表示されるためです。ユーザーはインポート操作を停止できます。ただし、これを実行できるのは、\fI\-noprompt\fRオプションを指定せずに\fI\-importcert\fRコマンドを呼び出す場合のみです。\fI\-noprompt\fRオプションが指定されている場合、ユーザーとの対話は行われません。 +.SS "パスワード警告" .PP -ȥФԤۤȤɤΥޥɤǤϡȥΥѥɤɬפǤޤΥޥɤǤϡ/̩Υѥɤɬפˤʤ뤳Ȥޤѥɤϥޥɥ饤ǻǤޤ(\fI\-storepass\fRץ\fI\-keypass\fRץ)ƥȤŪȤ硢ޤϰǤ뤳Ȥ狼äƤ륷ƥǼ¹Ԥʳϡޥɥ饤䥹ץȤǥѥɤꤷʤǤɬפʥѥɤΥץ򥳥ޥɥ饤ǻꤷʤäϡѥɤϤޤ -.SS "ν˴ؤٹ" +キーストアに対する操作を行うほとんどのコマンドでは、ストアのパスワードが必要です。また、一部のコマンドでは、非公開/秘密鍵のパスワードが必要になることがあります。パスワードはコマンドラインで指定できます(\fI\-storepass\fRオプションと\fI\-keypass\fRオプションを使用)。ただし、テストを目的とする場合、または安全であることがわかっているシステムで実行する場合以外は、コマンドラインやスクリプトでパスワードを指定しないでください。必要なパスワードのオプションをコマンドラインで指定しなかった場合は、パスワードの入力を求められます。 +.SS "証明書の準拠に関する警告" .PP -󥿡ͥåɸRFC 5280ǤϡX\&.509ν˴ؤץե뤬ƤꡢΥեɤӥƥ󥷥ͭͤͤȹ礻ܤƤޤɸˤĤƤϡ -http://tools\&.ietf\&.org/rfc/rfc5280\&.txt򻲾ȤƤ +インターネット標準RFC 5280では、X\&.509証明書の準拠に関するプロファイルが定義されており、証明書のフィールドおよびエクステンションに有効な値および値の組合せが記載されています。標準については、 +http://tools\&.ietf\&.org/rfc/rfc5280\&.txtを参照してください .PP -\fIkeytool\fRޥɤǤϡΥ롼뤹٤ƤŬѤ櫓ǤϤʤᡢɸ˽򤷤ʤǤޤɸ˽򤷤ʤϡJRE¾Υץꥱǵݤ뤳Ȥޤ桼ϡ\fI\-dname\fR\fI\-ext\fRʤɤŬʥץꤹ褦ˤƤ -.SH "" -.SS "ǤΥݡ" +\fIkeytool\fRコマンドでは、これらのルールすべてが適用されるわけではないため、標準に準拠しない証明書を生成できます。標準に準拠しない証明書は、JREや他のアプリケーションで拒否されることがあります。ユーザーは、\fI\-dname\fRや\fI\-ext\fRなどで適正なオプションを指定するようにしてください。 +.SH "注意" +.SS "新しい信頼できる証明書のインポート" .PP -\fIkeytool\fRޥɤϡȥ˾ɲäˡȥˤǤ¸ߤ뿮ǤѤơݡȤ񤫤(롼CA)ʽ̾˻ޤǤοΥιۤߤޤ +\fIkeytool\fRコマンドは、キーストアに証明書を追加する前に、キーストア内にすでに存在する信頼できる証明書を使用して、インポートする証明書から(ルートCAの)自己署名証明書に至るまでの信頼のチェーンの構築を試みます。 .PP -\fI\-trustcacerts\fRץꤷ硢ɲäξϿǤ뤹ʤ\fIcacerts\fRȤ̾Υե˴ޤޤΥȤߤʤޤ +\fI\-trustcacerts\fRオプションを指定した場合、追加の証明書は信頼できるすなわち\fIcacerts\fRという名前のファイルに含まれる証明書のチェーンとみなされます。 .PP -\fIkeytool\fRޥɤݡȤ񤫤鼫ʽ̾(ȥޤ\fIcacerts\fRե˴ޤޤƤ뼫ʽ̾)˻ޤǤοΥѥιۤ˼ԤϡݡȤξɽ桼˳ǧޤξϡɽ줿Υե󥬡ץȤȡ¾Τʤ餫(Ǥ)(νͭԤʤ)ꤷե󥬡ץȤȤӤޤǤȤƾ򥤥ݡȤȤϡͭǤ뤳Ȥ򿵽Ť˳ǧɬפޤǤΥݡȷٹ򻲾ȤƤݡϡǧߤǤޤ\fI\-noprompt\fRץ󤬻ꤵƤ硢桼ȤäϹԤޤ -.SS "Υݡ" +\fIkeytool\fRコマンドが、インポートする証明書から自己署名証明書(キーストアまたは\fIcacerts\fRファイルに含まれている自己署名証明書)に至るまでの信頼のパスの構築に失敗した場合は、インポートする証明書の情報を表示し、ユーザーに確認を求めます。この場合は、表示された証明書のフィンガープリントと、他のなんらかの(信頼できる)情報源(証明書の所有者など)から入手したフィンガープリントとを比較します。信頼できる証明書として証明書をインポートするときは、証明書が有効であることを慎重に確認する必要があります。信頼できる証明書のインポート警告を参照してください。インポート操作は、証明書を確認する時点で中止できます。\fI\-noprompt\fRオプションが指定されている場合、ユーザーとの対話は行われません。 +.SS "証明書応答のインポート" .PP -򥤥ݡȤȤϡȥοǤ񡢤(\fI\-trustcacert\fR\fIs\fRץ󤬻ꤵƤ)\fIcacerts\fRȥեǹ줿Ѥƾޤcacertsե򻲾ȤƤ +証明書応答をインポートするときは、キーストア内の信頼できる証明書、および(\fI\-trustcacert\fR\fIs\fRオプションが指定されている場合は)\fIcacerts\fRキーストア・ファイルで構成された証明書を使用して証明書応答が検査されます。cacerts証明書ファイルを参照してください。 .PP -Ǥ뤫ɤꤹˡϼΤȤǤ +証明書応答が信頼できるかどうかを決定する方法は次のとおりです。 .sp .RS 4 .ie n \{\ @@ -1522,7 +1522,7 @@ http://tools\&.ietf\&.org/rfc/rfc5280\&.txt .sp -1 .IP \(bu 2.3 .\} -ñX\&.509Ǥ硢\fIkeytool\fRޥɤϡ(롼CA)ʽ̾˻ޤǤογΩߤޤȡǧڤ˻Ѥγع¤ϡaliasοޤ󤬳Ωʤ硢ϥݡȤޤ󡣤ξ硢\fIkeytool\fRޥɤϾϤ桼˸ڤץץȤɽޤ桼οȽǤΤ񤷤Ǥ +証明書応答が単一のX\&.509証明書である場合、\fIkeytool\fRコマンドは、証明書応答から(ルートCAの)自己署名証明書に至るまでの信頼チェーンの確立を試みます。証明書応答と、証明書応答の認証に使用される証明書の階層構造は、aliasの新しい証明書チェーンを形成します。信頼チェーンが確立されない場合、証明書応答はインポートされません。この場合、\fIkeytool\fRコマンドは証明書を出力せず、ユーザーに検証を求めるプロンプトを表示します。ユーザーが証明書応答の信頼性を判断するのは非常に難しいためです。 .RE .sp .RS 4 @@ -1533,13 +1533,13 @@ http://tools\&.ietf\&.org/rfc/rfc5280\&.txt .sp -1 .IP \(bu 2.3 .\} -PKCS#7ξޤϰϢX\&.509Ǥ硢ϡ桼ξ񤬺ǽˡ0ʾCA񤬤μˤ褦¤٤ޤ󤬼ʽ̾Υ롼CAǽꡢ\fI \-trustcacerts\fRץ󤬻ꤵƤ硢\fIkeytool\fRޥɤϡξȡȥޤ\fIcacerts\fRȥեοǤ뤹٤Ƥξȹ礷褦Ȥޤ󤬼ʽ̾Υ롼CAǽäƤ餺\fI\-trustcacerts\fRץ󤬻ꤵƤ硢\fIkeytool\fRޥɤϡȥޤ\fIcacerts\fRȥեοǤ񤫤鼫ʽ̾Υ롼CA򸫤ĤƤɲä褦Ȥޤξ񤬸Ĥ餺\fI\-noprompt\fRץ󤬻ꤵƤʤϡκǸξξ󤬽Ϥ졢桼ϳǧޤ +証明書応答がPKCS#7形式の証明書チェーンまたは一連のX\&.509証明書である場合、チェーンは、ユーザーの証明書が最初に、0以上のCA証明書がその次にくるように並べられます。チェーンが自己署名のルートCA証明書で終わり、\fI \-trustcacerts\fRオプションが指定されている場合、\fIkeytool\fRコマンドは、その証明書と、キーストア内または\fIcacerts\fRキーストア・ファイル内の信頼できるすべての証明書を照合しようとします。チェーンが自己署名のルートCA証明書で終わっておらず、\fI\-trustcacerts\fRオプションが指定されている場合、\fIkeytool\fRコマンドは、キーストア内または\fIcacerts\fRキーストア・ファイル内の信頼できる証明書から自己署名のルートCA証明書を見つけてそれをチェーンの末尾に追加しようとします。その証明書が見つからず、\fI\-noprompt\fRオプションが指定されていない場合は、チェーン内の最後の証明書の情報が出力され、ユーザーは確認を求められます。 .RE .PP -θ\fIalias\fRǤǤ˳ǼƤ桼θ˰פ硢Ť󤬱ο֤ޤξͭ\fIkeypass\fR֤뤳ȤǤΤϡȥ̩ݸ뤿ΥѥɤꤷΤߤǤѥɤꤷƤ餺̩ΥѥɤȥΥѥɤȰۤʤϡ̩ΥѥɤϤޤ +証明書応答内の公開鍵が\fIalias\fRですでに格納されているユーザーの公開鍵に一致した場合、古い証明書チェーンが応答内の新しい証明書チェーンで置き換えられます。以前の証明書チェーンを有効な\fIkeypass\fRで置き換えることができるのは、エントリの秘密鍵を保護するためのパスワードを指定した場合のみです。パスワードを指定しておらず、秘密鍵のパスワードがキーストアのパスワードと異なる場合は、秘密鍵のパスワードの入力を求められます。 .PP -ΥޥɤϡΥ꡼Ǥ\fI\-import\fRȤ̾ǤΥ꡼Ǥϡ³Ť̾ݡȤƤޤϡ̾\fI\-importcert\fRͥ褵ޤ -.SH "Ϣ" +このコマンドは、以前のリリースでは\fI\-import\fRという名前でした。このリリースでは、引き続き古い名前がサポートされています。今後は、新しい名前\fI\-importcert\fRが優先されます。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -1571,8 +1571,8 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlˤ -֥: Java SEΥƥǽ +http://docs\&.oracle\&.com/javase/tutorial/security/index\&.htmlにある +「コース: Java SEのセキュリティ機能」 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 b/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 index f8bdb8ebd49..4ac8a594815 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: native2ascii .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ݲġ +.\" Date: 2013年11月21日 +.\" SectDesc: 国際化ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "native2ascii" "1" "2013ǯ1121" "JDK 8" "ݲġ" +.TH "native2ascii" "1" "2013年11月21日" "JDK 8" "国際化ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -native2ascii \- ݡȤƤǤդʸ󥳡ǥ󥰤ʸޤեASCIIUnicodeǥפ줿եѴ(ޤϤε)饤ǽʥץꥱޤ -.SH "" +native2ascii \- サポートされている任意の文字エンコーディングの文字を含むファイルを、ASCIIおよびUnicodeでエスケープされたファイルに変換して(またはその逆)、ローカライズ可能なアプリケーションを作成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,34 +64,34 @@ native2ascii \- .PP \fIinputfile\fR .RS 4 -ASCIIѴ륨󥳡ɤ줿ե롣 +ASCIIに変換するエンコードされたファイル。 .RE .PP \fIoutputfile\fR .RS 4 -Ѵ줿ASCIIե롣 +変換されたASCIIファイル。 .RE -.SH "" +.SH "説明" .PP -\fInative2ascii\fRޥɤϡASCII饯åȤ˴ޤޤʤ٤ƤʸUnicode(\fI\eu\fR\fIxxxx\fR)ɽˡѤơJava Runtime Environment (JRE)ǥݡȤƤ륨󥳡ɤ줿եASCIIǥ󥳡ɤ줿եѴޤΥץϡISO\-8859\-1ʸåȤ˴ޤޤʤʸޤޤƤץѥƥեɬפǤΥġϡεդѴ¹Ԥ뤳ȤǤޤ +\fInative2ascii\fRコマンドは、ASCIIキャラクタ・セットに含まれないすべての文字にUnicodeエスケープ(\fI\eu\fR\fIxxxx\fR)表記法を使用して、Java Runtime Environment (JRE)でサポートされているエンコードされたファイルを、ASCIIでエンコードされたファイルに変換します。このプロセスは、ISO\-8859\-1文字セットに含まれない文字が含まれているプロパティ・ファイルで必要です。このツールは、その逆の変換を実行することもできます。 .PP -\fIoutputfile\fRͤά硢ɸϤ˽Ϥޤˡ\fIinputfile\fRͤά硢ɸϤϤޤ -.SH "ץ" +\fIoutputfile\fR値を省略した場合、標準出力に出力されます。さらに、\fIinputfile\fR値を省略した場合、標準入力から入力されます。 +.SH "オプション" .PP \-reverse .RS 4 -դνԤޤĤޤꡢISO\-8859\-1UnicodeפѤƥ󥳡ɤ줿եJREǥݡȤʸ󥳡ǥ󥰤ΥեѴޤ +逆の処理を行います。つまり、ISO\-8859\-1でUnicodeエスケープを使用してエンコードされたファイルを、JREでサポートされる文字エンコーディングのファイルに変換します。 .RE .PP \-encoding \fIencoding_name\fR .RS 4 -ѴǻѤʸ󥳡ǥ󥰤̾ꤷޤΥץ¸ߤʤϡǥեȤʸ󥳡ǥ(\fIjava\&.nio\&.charset\&.Charset\&.defaultCharset\fR᥽åɤ줿)Ѥޤ\fIencoding_name\fRʸϡJREǥݡȤƤʸ󥳡ǥ󥰤̾ˤɬפޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.htmlˤ -֥ݡȤƤ륨󥳡ǥ󥰡פ򻲾ȤƤ +変換処理で使用する文字エンコーディングの名前を指定します。このオプションが存在しない場合は、デフォルトの文字エンコーディング(\fIjava\&.nio\&.charset\&.Charset\&.defaultCharset\fRメソッドで定義された)が使用されます。\fIencoding_name\fR文字列は、JREでサポートされている文字エンコーディングの名前にする必要があります。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/intl/encoding\&.doc\&.htmlにある +「サポートされているエンコーディング」を参照してください .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ(JVM)\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシン(JVM)に\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 b/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 index 849257b14e2..8e184781bd0 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: orbd .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "orbd" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "orbd" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -orbd \- CORBAĶΥСˤ³֥Ȥ򥯥饤Ȥ鸡ƸƤӽФ褦ˤޤ -.SH "" +orbd \- CORBA環境のサーバーにある永続オブジェクトをクライアントから検索して呼び出せるようにします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,11 +64,11 @@ orbd \- CORBA .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIorbd\fRޥɤѤȡCORBAĶΥСˤ³֥Ȥ򥯥饤ȤƩŪ˸ƸƤӽФȤǤޤorbdġ˴ޤޤ륵Сޥ͡Ѥȡ饤ȤCORBAĶǥСˤ³֥ȤƩŪ˸ƸƤӽФȤǤޤ³Сϡ͡ߥ󥰡ӥ˱³֥ȻȤȯԤݡСΥݡֹΤORBDΥݡֹ򥪥֥ȻȤ˴ޤޤ³֥ȻȤΥ֥ȻȤORBDݡֹޤ뤳ȤˤϡΤ褦ޤ +\fIorbd\fRコマンドを使用すると、CORBA環境のサーバーにある永続オブジェクトをクライアントから透過的に検索して呼び出すことができます。orbdツールに含まれるサーバー・マネージャを使用すると、クライアントはCORBA環境でサーバー上にある永続オブジェクトを透過的に検索して呼び出すことができます。永続サーバーは、ネーミング・サービスに永続オブジェクト参照を発行する際、サーバーのポート番号のかわりにORBDのポート番号をオブジェクト参照に含めます。永続オブジェクト参照のオブジェクト参照にORBDポート番号を含めることには、次のような利点があります。 .sp .RS 4 .ie n \{\ @@ -78,7 +78,7 @@ orbd \- CORBA .sp -1 .IP \(bu 2.3 .\} -͡ߥ󥰡ӥˤ륪֥ȻȤСΥ饤ա̵طˤʤޤȤС֥ȻȤϡƥ󥹥ȡ뤵줿Ȥϥ͡ߥ󥰡ӥΥСˤäƥ͡ߥ󥰡ӥȯԤޤθϡСγϤޤϥåȥβˤ餺ƤӽФ饤ȤORBD֥ȻȤ֤ޤ +ネーミング・サービスにあるオブジェクト参照が、サーバーのライフ・サイクルと無関係になります。たとえば、オブジェクト参照は、初めてインストールされたときはネーミング・サービスのサーバーによってネーミング・サービスに発行されますが、その後は、サーバーの開始またはシャットダウンの回数にかかわらず、呼び出したクライアントにORBDが正しいオブジェクト参照を返します。 .RE .sp .RS 4 @@ -89,57 +89,57 @@ orbd \- CORBA .sp -1 .IP \(bu 2.3 .\} -饤Ȥϰ٤Τߥ͡ߥ󥰡ӥΥ֥ȻȤååפɬפޤθϥСΥ饤աˤѹȤ̵طˤλȤѤ뤳ȤǤޤ +クライアントは一度のみネーミング・サービスのオブジェクト参照をルックアップする必要がありますが、その後はサーバーのライフ・サイクルによる変更とは無関係にこの参照を利用することができます。 .RE .PP -ORBDΥСޥ͡˥ˤϡ\fIservertool\fRѤƥСưɬפޤservertoolϡץꥱ󡦥ץޤ³СϿϿưߤԤΥޥɥ饤󡦥󥿥եǤСޥ͡ξܺ٤ϡСޥ͡򻲾ȤƤ +ORBDのサーバー・マネージャにアクセスするには、\fIservertool\fRを使用してサーバーを起動する必要があります。servertoolは、アプリケーション・プログラマが、永続サーバーの登録、登録解除、起動および停止を行うためのコマンドライン・インタフェースです。サーバー・マネージャの詳細は、サーバー・マネージャを参照してください。 .PP -\fIorbd\fRưȡ͡ߥ󥰡ӥⵯưޤ͡ߥ󥰡ӥξܺ١͡ߥ󥰡ӥεưߤ򻲾ȤƤ -.SH "ץ" +\fIorbd\fRを起動すると、ネーミング・サービスも起動されます。ネーミング・サービスの詳細。ネーミング・サービスの起動と停止を参照してください。 +.SH "オプション" .PP \-ORBInitialPort \fInameserverport\fR .RS 4 -ɬܡ͡ࡦСưݡȤֹꤷޤ\fIorbd\fRϡưȡΥݡȾ忮ꥯȤꥹ˥󥰤ޤOracle SolarisեȥǤϡ1024꾮ݡȤǥץ򳫻Ϥ硢root桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ +必須。ネーム・サーバーを起動するポートの番号を指定します。\fIorbd\fRは、起動されると、このポート上で着信リクエストをリスニングします。Oracle Solarisソフトウェアでは、1024より小さいポートでプロセスを開始する場合、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。 .RE -.SS "ɬܤǤʤץ" +.SS "必須でないオプション" .PP \-port \fIport\fR .RS 4 -ORBDưݡȤꤷޤΥݡȤǡ³֥ȤФꥯȤORBDޤΥݡȤΥǥեͤ1049ǤΥݡֹϡ³Interoperable Object References (IOR)Υݡȡեɤɲäޤ +ORBDを起動するポートを指定します。このポートで、永続オブジェクトに対するリクエストをORBDが受け取ります。このポートのデフォルト値は1049です。このポート番号は、永続Interoperable Object References (IOR)のポート・フィールドに追加されます。 .RE .PP \-defaultdb \fIdirectory\fR .RS 4 -ORBD³Ǽǥ쥯ȥ\fIorb\&.db\fR١ǥ쥯ȥꤷޤΥץ󤬻ꤵƤʤ硢ǥեͤ\fI\&./orb\&.db\fRˤʤޤ +ORBD永続格納ディレクトリ\fIorb\&.db\fRが作成されるベース・ディレクトリを指定します。このオプションが指定されていない場合、デフォルト値は\fI\&./orb\&.db\fRになります。 .RE .PP \-serverPollingTime \fImilliseconds\fR .RS 4 -\fIservertool\fRѤϿ줿³СΥإ륹֤ORBDåֳ֤ꤷޤǥեͤ1000ߥäǤ\fImilliseconds\fR˻ꤹͤϡͭˤɬפޤ +\fIservertool\fRを使用して登録された永続サーバーのヘルス状態をORBDがチェックする間隔を指定します。デフォルト値は1000ミリ秒です。\fImilliseconds\fRに指定する値は、有効な正の整数にする必要があります。 .RE .PP \-serverStartupDelay milliseconds .RS 4 -\fIservertool\fRѤϿ줿³СƵưƤ顢ž㳰ޤǤORBDԵ֤ꤷޤǥեͤ1000ߥäǤ\fImilliseconds\fR˻ꤹͤϡͭˤɬפޤ +\fIservertool\fRを使用して登録された永続サーバーを再起動してから、位置転送の例外を送信するまでのORBDの待機時間を指定します。デフォルト値は1000ミリ秒です。\fImilliseconds\fRに指定する値は、有効な正の整数にする必要があります。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SS "͡ߥ󥰡ӥεư" +.SS "ネーミング・サービスの起動と停止" .PP -͡ߥ󥰡ӥϡCORBA֥Ȥ˥͡ߥ󥰤ǽˤCORBAӥǤ͡ߥ󥰤̾򥪥֥ȻȤ˥Хɤ뤳Ȥˤǽˤʤޤ͡ࡦХǥ󥰤͡ߥ󥰡ӥ˳ǼС饤Ȥ̾ꤷŪΥ֥ȻȤǤ褦ˤʤޤ +ネーミング・サービスは、CORBAオブジェクトにネーミングを可能にするCORBAサービスです。ネーミングは名前をオブジェクト参照にバインドすることにより可能になります。ネーム・バインディングをネーミング・サービスに格納すれば、クライアントが名前を指定して目的のオブジェクト参照を取得できるようになります。 .PP -饤ȤޤϥС¹ԤˡORBDưޤORBDˤϡ³͡ߥ󥰡ӥӰ͡ߥ󥰡ӥȤ߹ޤƤޤϤɤCOS͡ߥ󥰡ӥμǤ +クライアントまたはサーバーを実行する前に、ORBDを起動します。ORBDには、永続ネーミング・サービスおよび一時ネーミング・サービスが組み込まれています。これらはどちらもCOSネーミング・サービスの実装です。 .PP -³͡ߥ󥰡ӥϡ͡ߥ󥰡ƥȤФƱ³󶡤ޤĤޤꡢξϡӥߤ䵯ưˤݻ졢ӥ˾㳲ȯǤǤޤORBDƵưȡ³͡ߥ󥰡ӥϥ͡ߥ󥰡ƥȤΥդ٤ƤΥ饤ȤȥС̾ΥХǥ󥰤Τޤ(³Ū)ݻ褦ˤޤ +永続ネーミング・サービスは、ネーミング・コンテキストに対して永続性を提供します。つまり、この情報は、サービスの停止や起動後にも維持され、サービスに障害が発生した場合でも回復できます。ORBDを再起動すると、永続ネーミング・サービスはネーミング・コンテキストのグラフを復元し、すべてのクライアントとサーバーの名前のバインディングがそのまま(永続的に)保持されるようにします。 .PP -̸ߴΤᡢ꡼JDKƱƤ͡ߥ󥰡ӥ\fItnameserv\fRΥ꡼Java SEˤƱƤޤ͡ࡦӥǤϡ͡ࡦӥμ¹ˤΤߥ͡ߥ󥰡ƥȤݻޤӥǤȡ͡ߥ󥰡ƥȡդϼޤ +下位互換性のため、旧リリースのJDKに同梱されていた一時ネーミング・サービス\fItnameserv\fRが、今回のリリースのJava SEにも同梱されています。一時ネーム・サービスでは、ネーム・サービスの実行中にのみネーミング・コンテキストが保持されます。サービスが中断されると、ネーミング・コンテキスト・グラフは失われます。 .PP -\fI\-ORBInitialPort\fRϡ\fIorbd\fRɬܤΥޥɥ饤ǡ͡ߥ󥰡ӥ¹ԤݡȤֹꤹ뤿˻ѤޤμǤϡJava IDL Object Request Broker DaemonѤ˥ݡ1050ѤǤ뤳ȤȤƤޤOracle SolarisեȥѤ硢1024꾮ݡȤǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳ȤᤷޤɬפǤ̤ΥݡȤѹƤ +\fI\-ORBInitialPort\fR引数は、\fIorbd\fRの必須のコマンドライン引数で、ネーミング・サービスが実行されるポートの番号を設定するために使用されます。次の手順では、Java IDL Object Request Broker Daemon用にポート1050を使用できることを前提としています。Oracle Solarisソフトウェアを使用する場合、1024より小さいポートでプロセスを開始するには、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。必要であれば別のポートに変更してください。 .PP -UNIXޥɡ\fIorbd\fRưˤϡΤ褦Ϥޤ +UNIXコマンド・シェルで\fIorbd\fRを起動するには、次のように入力します。 .sp .if n \{\ .RS 4 @@ -151,7 +151,7 @@ orbd \-ORBInitialPort 1050& .RE .\} .PP -WindowsMS\-DOSƥࡦץץȤǤϡΤ褦Ϥޤ +WindowsのMS\-DOSシステム・プロンプトでは、次のように入力します。 .sp .if n \{\ .RS 4 @@ -163,7 +163,7 @@ start orbd \-ORBInitialPort 1050 .RE .\} .PP -ORBD¹Ԥ졢Сȥ饤ȤΥץꥱ¹ԤǤ褦ˤʤޤ饤ȤȥСΥץꥱϡ¹Իˡ͡ߥ󥰡ӥ¹ԤƤݡȤֹ(ɬפʾϤ˥ޥ̾)ǧƤɬפޤ¸1ĤˡϡΥɤ򥢥ץꥱɲä뤳ȤǤ +これでORBDが実行され、サーバーとクライアントのアプリケーションを実行できるようになります。クライアントとサーバーのアプリケーションは、実行時に、ネーミング・サービスが実行されているポートの番号(必要な場合はさらにマシン名)を認識している必要があります。これを実現する1つの方法は、次のコードをアプリケーションに追加することです。 .sp .if n \{\ .RS 4 @@ -178,7 +178,7 @@ ORB orb = ORB\&.init(args, props); .RE .\} .PP -Ǥϡ͡ߥ󥰡ӥϡۥ\fIMyHost\fRΥݡ1050Ǽ¹Ԥޤ̤ˡȤơޥɥ饤󤫤饵Сޤϥ饤ȤΥץꥱ¹ԤȤˡݡֹޤϥޥ̾뤤Ϥξꤹˡ⤢ޤȤСΥޥɥ饤󡦥ץѤơ\fIHelloApplication\fRưǤޤ +この例では、ネーミング・サービスは、ホスト\fIMyHost\fRのポート1050上で実行されます。別の方法として、コマンドラインからサーバーまたはクライアントのアプリケーションを実行するときに、ポート番号またはマシン名あるいはその両方を指定する方法もあります。たとえば、次のコマンドライン・オプションを使用して、\fIHelloApplication\fRを起動できます。 .sp .if n \{\ .RS 4 @@ -190,36 +190,36 @@ java HelloApplication \-ORBInitialPort 1050 \-ORBInitialHost MyHost .RE .\} .PP -͡ߥ󥰡ӥߤˤϡŬڤʥڥ졼ƥ󥰡ƥࡦޥɤѤޤȤСOracle Solaris\fIpkill\fR -\fIorbd\fR¹Ԥꡢ\fIorbd\fRưDOSɥ\fB[Ctrl]+[C]\fR򲡤ޤ͡ߥ󥰡ӥξϡӥλȡ͡ߥ󥰡ӥϿ줿̾õ礬ޤJava IDL͡ࡦӥϡŪߤޤǼ¹Ԥޤ +ネーミング・サービスを停止するには、適切なオペレーティング・システム・コマンドを使用します。たとえば、Oracle Solaris上で\fIpkill\fR +\fIorbd\fRを実行したり、\fIorbd\fRが動作中のDOSウィンドウで\fB[Ctrl]+[C]\fRキーを押します。一時ネーミング・サービスの場合は、サービスが終了されると、ネーミング・サービスに登録された名前が消去される場合があります。Java IDLネーム・サービスは、明示的に停止されるまで実行されます。 .PP -ORBD°͡ߥ󥰡ӥξܺ٤ϡ -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlΡNaming Serviceפ򻲾ȤƤ -.SH "Сޥ͡" +ORBDに付属するネーミング・サービスの詳細は、 +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlの「Naming Service」を参照してください +.SH "サーバー・マネージャ" .PP -ORBDΥСޥ͡˥ơ³С¹Ԥˤϡ\fIservertool\fRѤƥСưɬפޤservertoolϡץꥱ󡦥ץޤ³СϿϿưߤԤΥޥɥ饤󡦥󥿥եǤ\fIservertool\fRѤƥСưϡ\fIorbd\fR¹ԤƤƱݡȤȥۥȤǵưɬפޤСۤʤݡȤǼ¹Ԥȡ롦ƥѤ˥ǡ١¸Ƥ̵ˤʤꡢӥưޤ +ORBDのサーバー・マネージャにアクセスして、永続サーバーを実行するには、\fIservertool\fRを使用してサーバーを起動する必要があります。servertoolは、アプリケーション・プログラマが、永続サーバーの登録、登録解除、起動および停止を行うためのコマンドライン・インタフェースです。\fIservertool\fRを使用してサーバーを起動する場合は、\fIorbd\fRが実行されている場所と同じポートとホストで起動する必要があります。サーバーを異なるポートで実行すると、ローカル・コンテキスト用にデータベースに保存されている情報が無効になり、サービスが正しく動作しません。 .PP -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.html -Java IDL: The "Hello World" Exampleפ򻲾ȤƤ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlExample\&.htmlの +「Java IDL: The "Hello World" Example」を参照してください .PP -Ǥϡ塼ȥꥢμ˽ä\fIidlj\fRѥ\fIjavac\fRѥ¹ԤޤORBDΥСޥ͡¹Ԥˤϡμ˽äƥץꥱ¹Ԥޤ +この例では、チュートリアルの手順に従って\fIidlj\fRコンパイラと\fIjavac\fRコンパイラを実行します。ORBDのサーバー・マネージャを実行するには、次の手順に従ってアプリケーションを実行します。 .PP -\fIorbd\fRưޤ +\fIorbd\fRを起動します。 .PP -UNIXޥɡǼΤ褦Ϥޤ: -\fIorbd \-ORBInitialPort 1050\fR +UNIXコマンド・シェルで次のように入力します: +\fIorbd \-ORBInitialPort 1050\fR。 .PP -MS\-DOSƥࡦץץ(Windows)ǼΤ褦Ϥޤ: +MS\-DOSシステム・プロンプト(Windows)で次のように入力します: \fIs\fR\fItart orbd \-ORBInitialPort 105\fR\fI0\fR .PP -ݡ1050ϥ͡ࡦС¹ԤݡȤǤ\fI\-ORBInitialPort\fRץɬܥޥɥ饤ǤOracle SolarisեȥѤ硢1024꾮ݡȤǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ +ポート1050はネーム・サーバーを実行するポートです。\fI\-ORBInitialPort\fRオプションは必須コマンドライン引数です。Oracle Solarisソフトウェアを使用する場合、1024より小さいポートでプロセスを開始するには、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。 .PP -\fIservertool\fRưޤ: -\fIservertool \-ORBInitialPort 1050\fR +\fIservertool\fRを起動します: +\fIservertool \-ORBInitialPort 1050\fR。 .PP -μȥ͡ࡦС(\fIorbd\fR)ΥݡȤƱǤ뤳ȤǧޤȤ\fI\-ORBInitialPort 1050\&.\fRΤ褦ˤʤޤ\fIservertool\fRϡ͡ࡦСƱݡȾǵưɬפޤ +前回の手順とネーム・サーバー(\fIorbd\fR)のポートが同じであることを確認します。たとえば\fI\-ORBInitialPort 1050\&.\fRのようになります。\fIservertool\fRは、ネーム・サーバーと同じポート上で起動する必要があります。 .PP -\fIservertool\fRޥɥ饤󡦥󥿥եǡ\fIservertool\fRץץȤ\fIHello\fRСưޤ +\fIservertool\fRコマンドライン・インタフェースで、\fIservertool\fRプロンプトから\fIHello\fRサーバーを起動します。 .sp .if n \{\ .RS 4 @@ -232,7 +232,7 @@ servertool > register \-server HelloServer \-classpath \&. \-applicationName .RE .\} .PP -\fIservertool\fRˤäƥСϿơ\fIHelloServerApName\fRȤ̾С˳Ƥ졢ϿƤ뤹٤ƤΥСȤȤ˥СIDɽޤ¾üɥޤϥץץȤ饯饤ȡץꥱ¹Ԥޤ +\fIservertool\fRによってサーバーが登録されて、\fIHelloServerApName\fRという名前がサーバーに割り当てられ、登録されているすべてのサーバー一覧とともにサーバーIDが表示されます。他の端末ウィンドウまたはプロンプトからクライアント・アプリケーションを実行します。 .sp .if n \{\ .RS 4 @@ -244,11 +244,11 @@ java HelloClient \-ORBInitialPort 1050 \-ORBInitialHost localhost .RE .\} .PP -\fI\-ORBInitialHost localhost\fRϾά뤳ȤǤޤ͡ࡦС\fIHello\fR饤ȤȤƱۥȾưƤ뤫Ǥ͡ࡦС̤ΥۥȤǼ¹ԤƤϡ\-\fIORBInitialHost nameserverhost\fRץѤIDL͡ࡦС¹ԤƤۥȤꤷޤμǹԤ줿Ȥ˥͡ࡦС(\fIorbd\fR)ݡȤꤷޤ(: -\fI\-ORBInitialPort 1050\fR)ORBDΥСޥ͡λ顢͡ࡦС(\fIorbd\fR)\fIservertool\fRߤ뤫λƤMS\-DOSץץȤ\fIorbd\fR򥷥åȥ󤹤ˤϡС¹ԤƤ륦ɥ򤷤\fB[Ctrl]+[C]\fR򲡤ޤ +この例の\fI\-ORBInitialHost localhost\fRは省略することができます。ネーム・サーバーが\fIHello\fRクライアントとして同一ホスト上で動作しているからです。ネーム・サーバーが別のホストで実行されている場合は、\-\fIORBInitialHost nameserverhost\fRオプションを使用してIDLネーム・サーバーが実行されているホストを指定します。前の手順で行われたとおりにネーム・サーバー(\fIorbd\fR)ポートを指定します(例: +\fI\-ORBInitialPort 1050\fR)。ORBDのサーバー・マネージャの操作が終了したら、ネーム・サーバー(\fIorbd\fR)と\fIservertool\fRを停止するか終了してください。MS\-DOSプロンプトで\fIorbd\fRをシャットダウンするには、サーバーを実行しているウィンドウを選択して\fB[Ctrl]+[C]\fRキーを押します。 .PP -Oracle Solaris\fIorbd\fR򥷥åȥ󤹤ˤϡץ򸡺ơ\fIkill\fRޥɤǽλޤСŪߤޤǤϡƽФԵ֤³ޤ\fIservertool\fR򥷥åȥ󤹤ˤϡ\fBquit\fRϤƥܡɤ\fB[Enter]\fR򲡤ޤ -.SH "Ϣ" +Oracle Solarisから\fIorbd\fRをシャットダウンするには、プロセスを検索して、\fIkill\fRコマンドで終了します。サーバーを明示的に停止するまでは、呼出し待機状態が続きます。\fIservertool\fRをシャットダウンするには、\fBquit\fRと入力してキーボードの\fB[Enter]\fRキーを押します。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -269,8 +269,8 @@ servertool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.html -Naming Service +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlの +「Naming Service」 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 b/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 index e4150ab54dd..388e60d16f1 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: pack200 .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaǥץȡġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaデプロイメント・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "pack200" "1" "2013ǯ1121" "JDK 8" "Javaǥץȡġ" +.TH "pack200" "1" "2013年11月21日" "JDK 8" "Javaデプロイメント・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -pack200 \- WebǥץȤΤJARեpack200̥ե˥ѥåޤ -.SH "" +pack200 \- WebデプロイメントのためにJARファイルをpack200圧縮ファイルにパッケージします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -62,27 +62,27 @@ pack200 \- Web .RE .\} .PP -ץǤդνǻǤޤޥɥ饤ޤpropertiesե˻ꤵ줿ǸΥץ󤬡˻ꤵ줿٤ƤΥץͥ褵ޤ +オプションは任意の順序で指定できます。コマンドラインまたはpropertiesファイルに指定された最後のオプションが、それ以前に指定されたすべてのオプションより優先されます。 .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIoutput\-file\fR .RS 4 -ϥե̾ +出力ファイルの名前。 .RE .PP \fIJAR\-file\fR .RS 4 -ϥե̾ +入力ファイルの名前。 .RE -.SH "" +.SH "説明" .PP -\fIpack200\fRޥɤϡJava gzipץåѤJARեpack200̥եѴJavaץꥱǤpack200եϹⰵ̤ΥեǡľܥǥץǤӰɻ֤ṳ̂ǽǤ +\fIpack200\fRコマンドは、Java gzipコンプレッサを使用してJARファイルをpack200圧縮ファイルに変換するJavaアプリケーションです。pack200ファイルは高圧縮のファイルで、直接デプロイでき、帯域幅の節約やダウンロード時間の短縮が可能です。 .PP -\fIpack200\fRޥɤˤϡ̥󥸥ĴԤץ󤬤ޤŪʻˡ򼡤˼ޤ\fImyarchive\&.pack\&.gz\fRǥեȤ\fIpack200\fRޥǺޤ +\fIpack200\fRコマンドには、圧縮エンジンの設定や微調整を行うオプションがあります。一般的な使用方法を次の例に示します。\fImyarchive\&.pack\&.gz\fRがデフォルトの\fIpack200\fRコマンド設定で作成されます。 .sp .if n \{\ .RS 4 @@ -93,11 +93,11 @@ pack200 myarchive\&.pack\&.gz myarchive\&.jar .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-r, \-\-repack .RS 4 -JARեѥå奢ѥåơJARեޤ줿ե\fIjarsigner\fR(1)ġϥեȤƻѤǤޤǤϡmyarchive\&.jarեѥå塢ѥåޤ +JARファイルをパックした後アンパックして、JARファイルを生成します。生成されたファイルは\fIjarsigner\fR(1)ツールの入力ファイルとして使用できます。次の例では、myarchive\&.jarファイルをパックした後、アンパックします。 .sp .if n \{\ .RS 4 @@ -109,12 +109,12 @@ pack200 \-\-repack myarchive\&.jar .if n \{\ .RE .\} -ǤϡϥեΥեνݻޤ +次の例では、入力ファイル内のファイルの順序を保持します。 .RE .PP \-g, \-\-no\-gzip .RS 4 -\fIpack200\fRեޤΥץꤹȤϡŬڤʰ̥ġѤɬפޤޤåȡƥǤϡб밵̲ġѤɬפޤ +\fIpack200\fRファイルを生成します。このオプションを指定するときは、適切な圧縮ツールを使用する必要があります。また、ターゲット・システムでは、対応する圧縮解除ツールを使用する必要があります。 .sp .if n \{\ .RS 4 @@ -129,104 +129,104 @@ pack200 \-\-no\-gzip myarchive\&.pack myarchive\&.jar .PP \-G, \-\-strip\-debug .RS 4 -ϤǥХå°ޤˤϡ\fISourceFile\fR\fILineNumberTable\fR\fILocalVariableTable\fR\fILocalVariableTypeTable\fRޤޤޤ°Сɤȥ󥹥ȡΥϾʤޤǥХåεǽ¤ޤ +出力からデバッグ属性を削除します。これには、\fISourceFile\fR、\fILineNumberTable\fR、\fILocalVariableTable\fR、\fILocalVariableTypeTable\fRが含まれます。これらの属性を削除すれば、ダウンロードとインストールのサイズは小さくなりますが、デバッガの機能は制限されます。 .RE .PP \-\-keep\-file\-order .RS 4 -ϥեΥեνݻޤϡǥեȤưǤ +入力ファイル内のファイルの順序を保持します。これは、デフォルトの動作です。 .RE .PP \-O, \-\-no\-keep\-file\-order .RS 4 -ѥåġϡ٤ƤǤ¤ؤޤѥåġϡJARǥ쥯ȥ̾ƥɡ︺뤳ȤǤޤǥåʤɡJARեκŬǽưʤʤ뤳Ȥޤ +パック・ツールは、すべての要素を並べ替えて送信します。パック・ツールは、JARディレクトリ名を削除してダウンロード・サイズを削減することもできます。ただし、インデックスなど、特定のJARファイルの最適化機能が正常に動作しなくなることがあります。 .RE .PP \-S\fIvalue\fR, \-\-segment\-limit=\fIvalue\fR .RS 4 -ͤϡƥ֡Ȥͽۥåȡ\fIN\fR -(Хñ)Ǥñϥեɬץ\fIN\fRХȤĶȡΩȤƤޤüʥȤơͤ\fI\-1\fRξϡ٤Ƥϥեޤ礭ñΥȤ졢ͤ0ξϡ饹Ȥ˥Ȥ1Ĥޤ֡Ȥ礭ʤȡҲʤʤ갵Ψ⤯ʤޤνˤ¿Υ꡼ɬפǤ +この値は、各アーカイブ・セグメントの予想ターゲット・サイズ\fIN\fR +(バイト単位)です。単一の入力ファイルの必要サイズが\fIN\fRバイトを超えると、独立したセグメントが割り当てられます。特殊なケースとして、値が\fI\-1\fRの場合は、すべての入力ファイルを含む大きな単一のセグメントが生成され、値が0の場合は、クラスごとにセグメントが1つずつ生成されます。アーカイブ・セグメントが大きくなると、断片化が少なくなり圧縮率が高くなりますが、その処理には多くのメモリーが必要です。 .sp -ƥȤΥϡȤѴ뤽줾ϥեΥΤۤ̾¾ץѥƥΥ׻ƿ¬ޤ +各セグメントのサイズは、セグメントに変換されるそれぞれの入力ファイルのサイズのほか、その名前と他の送信されるプロパティのサイズを計算して推測されます。 .sp -ǥեȤ\-1ǤĤޤꡢѥåġñΥȽϥեޤü礭ʽϥե뤬ˤϡϥե򥻥Ȳ(ʬ)Ƥ꾮JARˤ뤳Ȥ򶯤ᤷޤ +デフォルトは\-1です。つまり、パック・ツールは単一のセグメント出力ファイルを作成します。極端に大きな出力ファイルが生成される場合には、入力ファイルをセグメント化(分割)してより小さなJARにすることを強くお薦めします。 .sp -¤ݤƤʤ10 MBJARѥåե̾10%ѥåޤѥåġǤ礭Javaҡ(Ȥ¤10)ɬפȤ⤢ޤ +この制限が課されていない10 MBのJARパック・ファイルは通常、約10%小さくパックされます。しかし、パック・ツールでより大きなJavaヒープ(セグメントの制限の約10倍)を必要とする場合もあります。 .RE .PP \-E\fIvalue\fR, \-\-effort=\fIvalue\fR .RS 4 -ñ10ʿͤꤷ硢ѥåġϡꤵ줿Ψǥ֤򰵽̤ޤ٥1ξϡŪû̻֤¿礭Υե뤬ޤ٥9ξϡĹ֤ΤΡ갵Ψι⤤ե뤬ޤü0ꤷϡ\fIpack200\fRޥɤϸJARե򰵽̤ʤľܥԡޤJSR 200ɸǤϡ٤Ƥβץब̤ʾ򥢡ΤΥѥ롼Ȳ᤹褦˵ꤷƤޤ +単一の10進数値を指定した場合、パック・ツールは、指定された圧縮率でアーカイブを圧縮します。レベル1の場合は、比較的短い圧縮時間で多少大きめのファイルが生成されますが、レベル9の場合は、非常に長い時間がかかるものの、より圧縮率の高いファイルが生成されます。特殊な値0を指定した場合は、\fIpack200\fRコマンドは元のJARファイルを圧縮なしで直接コピーします。JSR 200標準では、すべての解凍プログラムが、この特別な場合をアーカイブ全体のパススルーと解釈するように規定しています。 .sp -ǥեȤ5Ǥξ硢ɸŪʻ֤Ŭڤʰ̤Ԥޤ +デフォルトは5です。この場合、標準的な時間で適切な圧縮が行われます。 .RE .PP \-H\fIvalue\fR, \-\-deflate\-hint=\fIvalue\fR .RS 4 -Ͼ¸Ȥǥեͤ򥪡С饤ɤޤž륢֤Υ礭ʤ礬ޤǽͤϡ\fItrue\fR\fIfalse\fRޤ\fIkeep\fRǤ +入力情報を保存するというデフォルト値をオーバーライドします。転送されるアーカイブのサイズは大きくなる場合があります。指定可能な値は、\fItrue\fR、\fIfalse\fRまたは\fIkeep\fRです。 .sp -\fIvalue\fR\fItrue\fRޤfalseξ硢\fIpacker200\fRޥɤϻ˽äƥǥե졼󡦥ҥȤϥ֤ꤷޤǤθġΥǥե졼󡦥ҥȤžޤ +\fIvalue\fRが\fItrue\fRまたはfalseの場合、\fIpacker200\fRコマンドは指定に従ってデフレーション・ヒントを出力アーカイブに設定します。アーカイブ要素の個々のデフレーション・ヒントは転送されません。 .sp -\fIkeep\fRͤϡJARdzǧ줿ǥե졼󡦥ҥȤݻޤ줬ǥեȤǤ +\fIkeep\fR値は、入力JARで確認されたデフレーション・ヒントを保持します。これがデフォルトです。 .RE .PP \-m\fIvalue\fR, \-\-modification\-time=\fIvalue\fR .RS 4 -ǽͤ\fIlatest\fR\fIkeep\fRǤ +指定可能な値は\fIlatest\fRと\fIkeep\fRです。 .sp -ͤǿξ硢ѥåġϡΥ֤λѲǽʤ٤ƤΥȥΤκǽ狼ΥȤλѲǽʤ٤ƤΥȥκǽꤷ褦ȤޤñͤϥȤΰȤž졢ƥȤȥŬѤޤξ硢٤ƤΥ󥹥ȡ롦եñդꤵȤϤޤ֤ž򾯤뤳ȤǤޤ +値が最新の場合、パック・ツールは、元のアーカイブの使用可能なすべてのエントリのうちの最終更新時刻か、そのセグメントの使用可能なすべてのエントリの最終更新時刻を特定しようとします。この単一の値はセグメントの一部として転送され、各セグメントの全エントリに適用されます。この場合、すべてのインストール・ファイルに単一の日付が設定されるという問題はありますが、アーカイブの転送サイズを少し小さくすることができます。 .sp -ͤ\fIkeep\fRξ硢JARdzǧ줿ѹ֤ݻޤ줬ǥեȤǤ +値が\fIkeep\fRの場合、入力JARで確認された変更時間が保持されます。これがデフォルトです。 .RE .PP \-P\fIfile\fR, \-\-pass\-file=\fIfile\fR .RS 4 -ե򰵽̤Хñ̤ž褦˻ꤷޤΥץ֤ѤơʣΥեǤޤƥࡦե롦ѥ졼JARե롦ѥ졼Υå(/)֤ѥ̾ѴϹԤޤ󡣷̤Ȥե̾ϡʸȤΤJARեǤνиȰפƤɬפޤ\fIfile\fR˥ǥ쥯ȥ̾ꤷ硢Υǥ쥯ȥΤ٤ƤΥե뤬žޤ +ファイルを圧縮せず、バイト単位で転送するように指定します。このオプションを繰返し使用して、複数のファイルを指定できます。システム・ファイル・セパレータがJARファイル・セパレータのスラッシュ(/)に置き換えられる点を除き、パス名の変換は行われません。結果として得られるファイル名は、文字列として正確にJARファイルでの出現と一致している必要があります。\fIfile\fRにディレクトリ名を指定した場合、そのディレクトリ内のすべてのファイルが転送されます。 .RE .PP \-U\fIaction\fR, \-\-unknown\-attribute=\fIaction\fR .RS 4 -ǥեȤư򥪡С饤ɤޤĤޤꡢ°ޤ९饹ե뤬ꤷ\fIaction\fRˤäϤޤȤƻǽͤϡ\fIerror\fR\fIstrip\fRޤ\fIpass\fRǤ +デフォルトの動作をオーバーライドします。つまり、不明な属性を含むクラス・ファイルが、指定した\fIaction\fRによって渡されます。アクションとして指定可能な値は、\fIerror\fR、\fIstrip\fRまたは\fIpass\fRです。 .sp -ͤ\fIerror\fRξ硢\fIpack200\fRޥΤԤŬڤɽޤ +値が\fIerror\fRの場合、\fIpack200\fRコマンド操作全体が失敗して適切な説明が表示されます。 .sp -ͤ\fIstrip\fRξ硢°ϺޤJavaۥޥ(JVM)ɬ°ȡ饹ξ㳲ȯ뤳Ȥޤ +値が\fIstrip\fRの場合、属性は削除されます。Java仮想マシン(JVM)必須属性を削除すると、クラス・ローダーの障害が発生することがあります。 .sp -ͤ\fIpass\fRξ硢饹Τ1ĤΥ꥽Ȥžޤ +値が\fIpass\fRの場合、クラス全体が1つのリソースとして転送されます。 .RE .PP \-C\fIattribute\-name\fR=\fIlayout\fR, \-\-class\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-F\fIattribute\-name\fR=\fIlayout\fR, \-\-field\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-M\fIattribute\-name\fR=\fIlayout\fR, \-\-method\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Υץ򻲾ȤƤ +次のオプションを参照してください。 .RE .PP \-D\fIattribute\-name\fR=\fIlayout\fR, \-\-code\-attribute=\fIattribute\-name\fR=\fIaction\fR .RS 4 -Ҥ4ĤΥץǤϡ饹ƥƥ\fIclass\-attribute\fR\fIfield\-attribute\fR\fImethod\-attribute\fR\fIcode\-attribute\fRʤɤ°Υ쥤ȤǤޤ\fIattribute\-name\fRˤϡ줫쥤Ȥޤϥ°̾ꤷޤ\fIaction\fRȤƻǽͤϡ\fIsome\-layout\-string\fR\fIerror\fR\fIstrip\fR\fIpass\fRǤ +前述の4つのオプションでは、クラス・エンティティに\fIclass\-attribute\fR、\fIfield\-attribute\fR、\fImethod\-attribute\fRおよび\fIcode\-attribute\fRなどの属性のレイアウトを指定できます。\fIattribute\-name\fRには、これからレイアウトまたはアクションを定義する属性の名前を指定します。\fIaction\fRとして指定可能な値は、\fIsome\-layout\-string\fR、\fIerror\fR、\fIstrip\fR、\fIpass\fRです。 .sp -\fIsome\-layout\-string\fR: 쥤ȸJSR 200ͤƤޤ: -\fI\-\-class\-attribute=SourceFile=RUH\fR +\fIsome\-layout\-string\fR: レイアウト言語はJSR 200仕様で定義されています。例: +\fI\-\-class\-attribute=SourceFile=RUH\fR。 .sp -ͤ\fIerror\fRξ硢\fIpack200\fRԤɽޤ +値が\fIerror\fRの場合、\fIpack200\fR操作が失敗して説明が表示されます。 .sp -ͤ\fIstrip\fRξ硢°ϤޤVMɬ°ȥ饹ξ㳲ȯ뤳ȤޤȤС\fI\-\-class\-attribute=CompilationID=pass\fRȤ°ޤ९饹եžޤѥåġϡ¾ΥԤޤ +値が\fIstrip\fRの場合、属性が出力から削除されます。VM必須属性を削除するとクラス・ローダーの障害が発生することがあります。たとえば、\fI\-\-class\-attribute=CompilationID=pass\fRというこの属性を含むクラス・ファイルを転送します。パック・ツールは、その他のアクションを行いません。 .sp -ͤ\fIpass\fRξ硢饹Τ1ĤΥ꥽Ȥžޤ +値が\fIpass\fRの場合、クラス全体が1つのリソースとして転送されます。 .RE .PP \-f \fIpack\&.properties\fR, \-\-config\-file=\fIpack\&.properties\fR .RS 4 -ޥɥ饤ˡѥåġ뤿JavaץѥƥޤޤƤ빽եǤޤ +コマンドラインに、パック・ツールを初期化するためのJavaプロパティが含まれている構成ファイルを指定できます。 .sp .if n \{\ .RS 4 @@ -251,42 +251,42 @@ segment\&.limit=\-1 .PP \-v, \-\-verbose .RS 4 -Ǿ¤ΥåϤޤΥץʣꤹȡĹåޤ +最小限のメッセージを出力します。このオプションを複数指定すると、より長いメッセージが作成されます。 .RE .PP \-q, \-\-quiet .RS 4 -åɽư褦˻ꤷޤ +メッセージを表示せずに動作するように指定します。 .RE .PP \-l\fIfilename\fR, \-\-log\-file=\fIfilename\fR .RS 4 -ϥåΥեꤷޤ +出力メッセージのログ・ファイルを指定します。 .RE .PP \-?, \-h, \-\-help .RS 4 -Υޥɤ˴ؤإ׾Ϥޤ +このコマンドに関するヘルプ情報を出力します。 .RE .PP \-V, \-\-version .RS 4 -Υޥɤ˴ؤСϤޤ +このコマンドに関するバージョン情報を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -ꤵ줿ץJavaۥޥϤޤܺ٤ϡjava(1)ޥɤΥե󥹡ڡ򻲾ȤƤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤ +指定されたオプションをJava仮想マシンに渡します。詳細は、java(1)コマンドのリファレンス・ページを参照してください。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。 .RE -.SH "λơ" +.SH "終了ステータス" .PP -νλ֤ͤޤ: ェλξ0顼ȯ0礭͡ -.SH "" +次の終了値が返されます: 正常終了の場合は0、エラーが発生した場合は0より大きい値。 +.SH "注意" .PP -Υޥɤ\fIpack\fR(1)ƱʤǤ\fIpack\fR\fIpack200\fRޥɤϡ̡ʤǤ +このコマンドと\fIpack\fR(1)を混同しないでください。\fIpack\fRおよび\fIpack200\fRコマンドは、別々の製品です。 .PP -JDK°Java SE APIͤȤ㤬Ĥäˤϡͤͥ褷Ƥ -.SH "Ϣ" +JDKに付属するJava SE API仕様との相違が見つかった場合には、仕様を優先してください。 +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 b/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 index c724f7893be..f311dd65825 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: policytool .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: ƥġ +.\" Date: 2013年11月21日 +.\" SectDesc: セキュリティ・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "policytool" "1" "2013ǯ1121" "JDK 8" "ƥġ" +.TH "policytool" "1" "2013年11月21日" "JDK 8" "セキュリティ・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -policytool \- 桼ƥƥGUIͳǼ桼Ϥ˴Ťơץ졼󡦥ƥȤΥݥꥷեɤ߽񤭤ޤ -.SH "" +policytool \- ユーティリティGUI経由で取得したユーザー入力に基づいて、プレーン・テキストのポリシー・ファイルを読み書きします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,17 +64,17 @@ policytool \- .PP \-file .RS 4 -ݥꥷեɤ߹褦\fIpolicytool\fR˻ؼޤ +ポリシー・ファイルを読み込むように\fIpolicytool\fRに指示します。 .RE .PP \fIfilename\fR .RS 4 -ɤե̾ +ロードするファイルの名前。 .RE .PP -\fB\fR: +\fB例\fR: .PP -ݥꥷġ桼ƥƥ¹Ԥޤ: +ポリシー・ツール管理ユーティリティを実行します: .sp .if n \{\ .RS 4 @@ -86,7 +86,7 @@ policytool .RE .\} .PP -\fIpolicytool\fRޥɤ¹Ԥꤵ줿եɤޤ: +\fIpolicytool\fRコマンドを実行し、指定されたファイルをロードします: .sp .if n \{\ .RS 4 @@ -97,17 +97,17 @@ policytool\-file mypolicyfile .if n \{\ .RE .\} -.SH "" +.SH "説明" .PP -\fIpolicytool\fRޥɤϡԤGUIƤӽФޤˤꡢƥԤϥ롦ݥꥷեƤǤ褦ˤʤޤݥꥷե\fI\&.policy\fRĥҤĥץ졼ƥȡեǡɥᥤ̤˥⡼ȡꥯ򸢸¥֥Ȥ˥ޥåפޤܺ٤ϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlˤ -Default Policy Implementation and Policy File Syntaxפ򻲾ȤƤ -.SH "ץ" +\fIpolicytool\fRコマンドは、管理者のGUIを呼び出します。これにより、システム管理者はローカル・ポリシー・ファイルの内容を管理できるようになります。ポリシー・ファイルは\fI\&.policy\fR拡張子を持つプレーンテキスト・ファイルで、ドメイン別にリモート・リクエスタを権限オブジェクトにマップします。詳細は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.htmlにある +「Default Policy Implementation and Policy File Syntax」を参照してください +.SH "オプション" .PP \-file .RS 4 -ݥꥷեɤ߹褦\fIpolicytool\fR˻ؼޤ +ポリシー・ファイルを読み込むように\fIpolicytool\fRに指示します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -117,7 +117,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Default Policy Implementation and Policy File Syntax +「Default Policy Implementation and Policy File Syntax」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html) .RE .sp @@ -129,7 +129,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Policy File Creation and Management +「Policy File Creation and Management」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html) .RE .sp @@ -141,7 +141,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Permissions in Java SE Development Kit (JDK) +「Permissions in Java SE Development Kit (JDK)」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html) .RE .sp @@ -153,7 +153,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Java Security Overview +「Java Security Overview」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html) .RE .sp @@ -165,7 +165,7 @@ policytool\-file mypolicyfile .sp -1 .IP \(bu 2.3 .\} -Java Cryptography Architecture (JCA) Reference Guide +「Java Cryptography Architecture (JCA) Reference Guide」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 b/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 index bca3b844f7b..631c0f7cdc1 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmic .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmic" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmic" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmic \- Java Remote Method Protocol (JRMP)ޤInternet Inter\-Orb protocol (IIOP)Ѥ⡼ȡ֥ȤΥ֡ȥ󤪤Tie饹ޤObject Management Group (OMG)󥿥ե(IDL)ޤ -.SH "" +rmic \- Java Remote Method Protocol (JRMP)またはInternet Inter\-Orb protocol (IIOP)を使用するリモート・オブジェクトのスタブ、スケルトンおよびTieクラスを生成します。Object Management Group (OMG)インタフェース定義言語(IDL)も生成します +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,20 +64,20 @@ rmic \- Java Remote Method Protocol (JRMP) .PP \fIoptions\fR .RS 4 -ޥɥ饤\fIץ\fRץ򻲾ȤƤ +コマンドライン・\fIオプション\fR。オプションを参照してください。 .RE .PP \fIpackage\-qualified\-class\-names\fR .RS 4 -ѥåޤ९饹̾: -\fIjava\&.awt\&.Color\fR +パッケージを含むクラス名。例: +\fIjava\&.awt\&.Color\fR。 .RE -.SH "" +.SH "説明" .PP -\fB侩˴ؤ:\fR -Java Remote Method Protocol (JRMP)֤ӥȥŪΥݡȤ侩ˤʤޤưŪJRMP֤򤫤˻ѤơJRMP١ΥץꥱˤΥġѤɬʤȤᤷޤܺ٤ϡ\fIjava\&.rmi\&.server\&.UnicastRemoteObject\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html)򻲾ȤƤ +\fB非推奨に関する注意:\fR +Java Remote Method Protocol (JRMP)スタブおよびスケルトンの静的な生成のサポートは非推奨になりました。動的に生成されるJRMPスタブをかわりに使用して、JRMPベースのアプリケーションにこのツールを使用する必要性をなくすことをお薦めします。詳細は、\fIjava\&.rmi\&.server\&.UnicastRemoteObject\fR仕様(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/server/UnicastRemoteObject\&.html)を参照してください。 .PP -\fIrmic\fRѥϡJava Remote Method Protocol (JRMP)ȥ֤Tie饹ե(IIOPץȥ)Ѥơ⡼ȡ֥ȤΥ֤ӥȥ󡦥饹եޤ⡼ȡ֥Ȥμ饹Ǥ뤳Υ饹եϡJavaץߥ󥰸Υ饹򥳥ѥ뤷Ȥޤ⡼ȼ饹ϡ\fIjava\&.rmi\&.Remote\fR󥿥ե륯饹Ǥ\fIrmic\fRޥɤǤΥ饹̾ϡΥ饹\fIjavac\fRޥɤǥѥ뤬ƤơĴѥå̾ǤɬפޤȤС˼饹ե̾\fIHelloImpl\fR\fIrmic\fRޥɤ¹Ԥȡhello֥ǥ쥯ȥ(饹Υѥå̾դ)\fIHelloImpl_Stub\&.class \fRե뤬ޤ +\fIrmic\fRコンパイラは、Java Remote Method Protocol (JRMP)とスタブおよびTieクラス・ファイル(IIOPプロトコル)を使用して、リモート・オブジェクトのスタブおよびスケルトン・クラス・ファイルを生成します。リモート・オブジェクトの実装クラスであるこれらのクラス・ファイルは、Javaプログラミング言語のクラスをコンパイルしたときに生成されます。リモート実装クラスは、\fIjava\&.rmi\&.Remote\fRインタフェースを実装するクラスです。\fIrmic\fRコマンドでのクラス名は、そのクラスが\fIjavac\fRコマンドでコンパイルが成功していて、かつ完全修飾パッケージ名である必要があります。たとえば、次に示すクラス・ファイル名\fIHelloImpl\fRで\fIrmic\fRコマンドを実行すると、helloサブディレクトリ(クラスのパッケージの名前の付いた)に\fIHelloImpl_Stub\&.class \fRファイルが作成されます。 .sp .if n \{\ .RS 4 @@ -89,31 +89,31 @@ rmic hello\&.HelloImpl .RE .\} .PP -⡼ȡ֥ȤΥȥJRMPץȥ롦С¦Υƥƥǡ⡼ȡ֥ȼƤӽФ᥽åɤޤߤޤ +リモート・オブジェクトのスケルトンはJRMPプロトコル・サーバー側のエンティティで、リモート・オブジェクト実装を呼び出すメソッドを含みます。 .PP -⡼ȡ֥ȤTieϡȥƱͤ˥С¦ΥƥƥǤIIOPץȥѤƥ饤Ȥ̿ޤ +リモート・オブジェクトのTieは、スケルトンと同様にサーバー側のエンティティですが、IIOPプロトコルを使用してクライアントと通信します。 .PP -֤Ȥϡ⡼ȡ֥ȤΥ饤¦ǤǤ֤ϡ⡼ȡ֥ȤΥ᥽åɸƽФ򡢼ʪΥ⡼ȡ֥Ȥ󤹤륵С̿ޤäơ饤ȤΥ⡼ȡ֥ȤؤλȤϡºݤϥ롦֤ؤλȤȤʤޤ +スタブとは、リモート・オブジェクトのクライアント側での代理です。スタブは、リモート・オブジェクトのメソッド呼出しを、実物のリモート・オブジェクトが常駐するサーバーと通信する役割を持ちます。したがって、クライアントのリモート・オブジェクトへの参照は、実際はローカル・スタブへの参照となります。 .PP -ǥեȤ\fIrmic\fRޥɤϡ1\&.2 JRMP֡ץȥ롦СΤߤѤ륹֡饹ޤϡ\fI\-v1\&.2\fRץꤷƱưǤ꡼5\&.0Ǥ\fI\-vcompat\fRץ󤬥ǥեȤǤIIOPץȥѤΥ֤Tie饹ˤ\fI\-iiop\fRץѤޤץ򻲾ȤƤ +デフォルトで\fIrmic\fRコマンドは、1\&.2 JRMPスタブ・プロトコル・バージョンのみを使用するスタブ・クラスを生成します。これは、\fI\-v1\&.2\fRオプションを指定した場合と同じ動作です。リリース5\&.0以前では\fI\-vcompat\fRオプションがデフォルトでした。IIOPプロトコル用のスタブおよびTieクラスを生成するには\fI\-iiop\fRオプションを使用します。オプションを参照してください。 .PP -֤ϥ⡼ȡ󥿥եΤߤ⡼ȡ֥Ȥ롦󥿥եϼƤޤJRMP֤ϥ⡼ȡ֥Ȥ⡼ȡ󥿥եƱΤƤΤǡ饤Ȥϡ㥹Ȥ䷿åJavaץߥ󥰸Ȥ߹ޤ줿黻ҤѤ뤳ȤǤޤIIOPξϡ\fIPortableRemoteObject\&.narrow\fR᥽åɤѤɬפޤ -.SH "ץ" +スタブはリモート・インタフェースのみを実装し、リモート・オブジェクトが実装するローカル・インタフェースは実装していません。JRMPスタブはリモート・オブジェクトが実装するリモート・インタフェースと同じものを実装しているので、クライアントは、キャストや型チェックにJavaプログラミング言語に組み込まれた演算子を使用することができます。IIOPの場合は、\fIPortableRemoteObject\&.narrow\fRメソッドを使用する必要があります。 +.SH "オプション" .PP \-bootclasspath \fIpath\fR .RS 4 -֡ȥȥåס饹եΰ֤򥪡С饤ɤޤ +ブートストラップ・クラス・ファイルの位置をオーバーライドします。 .RE .PP \-classpath path .RS 4 -\fIrmic\fRޥɤ饹õΥѥꤷޤΥץϡǥեȤ\fICLASSPATH\fRĶѿ򥪡С饤ɤޤǥ쥯ȥϥʬ䤷ޤѥΰŪʷ\fI\&.;<your_path>\fRǤ: +\fIrmic\fRコマンドがクラスを探すためのパスを指定します。このオプションは、デフォルトや\fICLASSPATH\fR環境変数設定をオーバーライドします。ディレクトリはコロンで分割します。パスの一般的な形式は\fI\&.;<your_path>\fRです。例: \fI\&.;/usr/local/java/classes\fR .RE .PP \-d \fIdirectory\fR .RS 4 -줿饹ؤνǥ쥯ȥΥ롼ȤꤷޤΥץѤȡ֡ȥ󡢤TieեǼǥ쥯ȥǤޤȤСΥޥɤMyClassƳФ줿֤ӥȥ󡦥饹ǥ쥯ȥ/java/classes/exampleclass˳Ǽޤ +生成されたクラス階層の出力先ディレクトリのルートを指定します。このオプションを使用すると、スタブ、スケルトン、およびTieファイルを格納するディレクトリを指定できます。たとえば、次のコマンドはMyClassから導出されたスタブおよびスケルトン・クラスをディレクトリ/java/classes/exampleclassに格納します。 .sp .if n \{\ .RS 4 @@ -124,25 +124,25 @@ rmic \-d /java/classes exampleclass\&.MyClass .if n \{\ .RE .\} -\fI\-d\fRץ󤬻ꤵƤʤ硢ǥեȤư\fI\-d\fRꤵƤƱǤåȡ饹ΥѥåؤߤΥǥ쥯ȥ˺졢stub/tie/skeletonե뤬ǼޤΥ꡼\fIrmic\fRޥɤǤϡ\fI\-d\fRꤵƤʤϡѥåؤϺ줺ϥեϤ٤ƸߤΥǥ쥯ȥľܳǼƤޤ +\fI\-d\fRオプションが指定されていない場合、デフォルトの動作は\fI\-d\fRが指定されていた場合と同じです。ターゲット・クラスのパッケージ階層が現在のディレクトリに作成され、stub/tie/skeletonファイルが格納されます。以前のリリースの\fIrmic\fRコマンドでは、\fI\-d\fRが指定されていない場合は、パッケージ階層は作成されず、出力ファイルはすべて現在のディレクトリに直接格納されていました。 .RE .PP \-extdirs \fIpath\fR .RS 4 -󥹥ȡѳĥǽΰ֤򥪡С饤ɤޤ +インストール済拡張機能の位置をオーバーライドします。 .RE .PP \-g .RS 4 -ѿޤह٤ƤΥǥХåޤǥեȤǤϡֹΤޤ +ローカル変数を含むすべてのデバッグ情報を生成します。デフォルトでは、行番号情報のみ生成されます。 .RE .PP \-idl .RS 4 -\fIrmic\fRޥɤˤäơꤷ饹ӻȤ줿饹OMG IDLޤIDLǤϡץߥ󥰸˰¸ˡǥ֥ȤAPIꤹ뤳ȤǤޤIDLϡ᥽åɤӥǡλͤȤƻѤޤCORBAХǥ󥰤󶡤Ǥդθǡ᥽åɤӥǡκӸƽФԤȤǤޤθˤϡJavaC++ޤޤƤޤhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html -Java IDL: IDL to Java Language Mappingפ򻲾ȤƤ +\fIrmic\fRコマンドによって、指定したクラスおよび参照されたクラスのOMG IDLが生成されます。IDLでは、プログラミング言語に依存せずに、宣言するだけでオブジェクトのAPIを指定することができます。IDLは、メソッドおよびデータの仕様として使用します。CORBAバインディングを提供する任意の言語で、メソッドおよびデータの作成および呼出しを行うことができます。これらの言語には、JavaおよびC++が含まれています。http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.htmlの +「Java IDL: IDL to Java Language Mapping」を参照してください .sp -\fI\-idl\fRץѤȤˤϡ¾ΥץǤޤ +\fI\-idl\fRオプションを使用するときには、他のオプションも指定できます。 .sp .RS 4 .ie n \{\ @@ -152,7 +152,7 @@ rmic \-d /java/classes exampleclass\&.MyClass .sp -1 .IP \(bu 2.3 .\} -¸Υ/Tie/IDLϥ饹⿷Ǥ⡢\fI\-always\fRޤ\fI\-alwaysgenerate\fRץϺޤ +既存のスタブ/Tie/IDLが入力クラスよりも新しい場合でも、\fI\-always\fRまたは\fI\-alwaysgenerate\fRオプションは再生成を強制します。 .RE .sp .RS 4 @@ -163,7 +163,7 @@ rmic \-d /java/classes exampleclass\&.MyClass .sp -1 .IP \(bu 2.3 .\} -\fI\-factory\fRץϡ줿IDL\fIfactory\fRɤѤޤ +\fI\-factory\fRオプションは、生成されたIDLで\fIfactory\fRキーワードを使用します。 .RE .sp .RS 4 @@ -204,9 +204,9 @@ file mapping, for example: .PP \-iiop .RS 4 -\fIrmic\fRޥɤˤäơJRMPΥ֤ȥȥ󡦥饹ΤˡIIOPΥ֤Tie饹ޤ֡饹ϡ⡼ȡ֥ȤΥ롦ץǡ饤Ȥ饵С˸ƽФȤ˻Ѥޤƥ⡼ȡ󥿥եˤϥ֡饹ɬפǤ֡饹ˤäƥ⡼ȡ󥿥եޤ饤Ȥǥ⡼ȡ֥Ȥ򻲾ȤȤϡ֤򻲾Ȥ뤳Ȥˤʤޤ饹ϡС¦ƤθƽФŬڤʼ饹˥ǥѥåȤ˻ѤޤƼ饹ˤϡ饹ɬפǤ +\fIrmic\fRコマンドによって、JRMPのスタブとスケルトン・クラスのかわりに、IIOPのスタブとTieクラスが生成されます。スタブ・クラスは、リモート・オブジェクトのローカル・プロキシで、クライアントからサーバーに呼出しを送信するときに使用されます。各リモート・インタフェースにはスタブ・クラスが必要です。スタブ・クラスによってリモート・インタフェースが実装されます。クライアントでリモート・オブジェクトを参照するときは、スタブを参照することになります。タイ・クラスは、サーバー側で着呼を処理し、その呼出しを適切な実装クラスにディスパッチするときに使用されます。各実装クラスには、タイ・クラスが必要です。 .sp -\fI\-iiop\fRѤ\fIrmic\fRޥɤƤӽФȡ̿̾§˽򤷤֤Tieޤ +\fI\-iiop\fRを使用して\fIrmic\fRコマンドを呼び出すと、次の命名規則に準拠したスタブとTieが生成されます。 .sp .if n \{\ .RS 4 @@ -227,7 +227,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-iiop\fRץѤȤˤϡ¾ΥץǤޤ +\fI\-iiop\fRオプションを使用するときには、他のオプションも指定できます。 .RE .sp .RS 4 @@ -238,7 +238,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -¸Υ/Tie/IDLϥ饹⿷Ǥ⡢\fI\-always\fRޤ\fI\-alwaysgenerate\fRץϺޤ +既存のスタブ/Tie/IDLが入力クラスよりも新しい場合でも、\fI\-always\fRまたは\fI\-alwaysgenerate\fRオプションは再生成を強制します。 .RE .sp .RS 4 @@ -249,7 +249,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-nolocalstubs\fRץǤϡƱץΥ饤ȤȥС˺Ŭ줿֤Ϻޤ +\fI\-nolocalstubs\fRオプションでは、同じプロセスのクライアントとサーバーに最適化されたスタブは作成されません。 .RE .sp .RS 4 @@ -260,7 +260,7 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-noValueMethods\fRץ\fI\-idl\fRץȤȤ˻Ѥɬפޤ\fI\-noValueMethods\fRץϡIDL\fIvaluetype\fR᥽åɤӽҤɲäǤʤ褦ˤޤΥ᥽åɤӽҤϡvaluetypeξϥץǤ\fI\-idl\fRץȤȤ\fI\-noValueMethods\fRץꤷʤޤ +\fI\-noValueMethods\fRオプションは\fI\-idl\fRオプションとともに使用する必要があります。\fI\-noValueMethods\fRオプションは、送信されるIDLに\fIvaluetype\fRメソッドおよび初期化子を追加できないようにします。このメソッドおよび初期化子は、valuetypeの場合はオプションです。\fI\-idl\fRオプションとともに\fI\-noValueMethods\fRオプションを指定しないかぎり生成されます。 .RE .sp .RS 4 @@ -271,57 +271,57 @@ _<interfaceName>_tie\&.class .sp -1 .IP \(bu 2.3 .\} -\fI\-poa\fRץϷѾ\fIorg\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fR\fIorg\&.omg\&.PortableServer\&.Servant\fRѹޤݡ֥롦֥ȡץ(POA)\fIPortableServer\fR⥸塼ϡͥƥ֤\fIServant\fRޤJavaץߥ󥰸Ǥϡ\fIServant\fRJava\fIorg\&.omg\&.PortableServer\&.Servant\fR饹˥ޥåפޤϡ٤ƤPOAХȼΥ١饹ȤƵǽץꥱ󡦥ץޤƤӽФȤΤǤ뤤ĤΥ᥽åɡPOAˤäƸƤӽФ졢ХȤư椹뤿˥桼С饤ɤǤ᥽åɤ󶡤ޤOMG IDL to Java Language Mapping SpecificationCORBA V 2\&.3\&.1 ptc/00\-01\-08\&.pdf˽򤷤Ƥޤ +\fI\-poa\fRオプションは継承を\fIorg\&.omg\&.CORBA_2_3\&.portable\&.ObjectImpl\fRから\fIorg\&.omg\&.PortableServer\&.Servant\fRに変更します。ポータブル・オブジェクト・アダプタ(POA)の\fIPortableServer\fRモジュールは、ネイティブの\fIServant\fR型を定義します。Javaプログラミング言語では、\fIServant\fR型はJavaの\fIorg\&.omg\&.PortableServer\&.Servant\fRクラスにマップされます。これは、すべてのPOAサーバント実装のベース・クラスとして機能し、アプリケーション・プログラマが呼び出すことのできるいくつかのメソッド、およびPOAによって呼び出され、サーバントの動作を制御するためにユーザーがオーバーライドできるメソッドを提供します。OMG IDL to Java Language Mapping Specification、CORBA V 2\&.3\&.1 ptc/00\-01\-08\&.pdfに準拠しています。 .RE .RE .PP \-J .RS 4 -JavaޥɤȤȤ˻Ѥơ\fI\-J\fRץ\fI\-J\fRθ³Java󥿥ץ꥿Ϥޤ(\fI\-J\fRȰδ֤˥ڡޤ) +Javaコマンドとともに使用して、\fI\-J\fRオプションは\fI\-J\fRの後ろに続く引数をJavaインタプリタに渡します(\fI\-J\fRと引数の間にスペースは入れません)。 .RE .PP \-keep or \-keepgenerated .RS 4 -֡ȥ󡢤ޤTie饹Τ줿\fI\&.java\fRեݻ\fI\&.class\fRեƱǥ쥯ȥ˽񤭹ߤޤ +スタブ、スケルトン、またはTieクラスのために生成された\fI\&.java\fRソース・ファイルを保持し、\fI\&.class\fRファイルと同じディレクトリに書き込みます。 .RE .PP \-nowarn .RS 4 -ٹ򥪥դˤޤ\fI\-nowarn\fRץ󤬻Ѥ硣ѥϷٹɽޤ +警告をオフにします。\fI\-nowarn\fRオプションが使用される場合。コンパイラは警告を表示しません。 .RE .PP \-nowrite .RS 4 -ѥ뤷饹ե롦ƥ˽񤭹ߤޤ +コンパイルしたクラスをファイル・システムに書き込みません。 .RE .PP -\-vcompat (侩) +\-vcompat (非推奨) .RS 4 -1\&.11\&.2ξJRMP֡ץȥ롦СȸߴΤ륹֤ӥȥ󡦥饹ޤ5\&.0Υ꡼ǤϤΥץ󤬥ǥեȤǤ줿֡饹ϡJDK 1\&.1ۥޥ˥ɤ1\&.1֡ץȥ롦СѤJDK 1\&.2ʹߤβۥޥ˥ɤ1\&.2֡ץȥ롦СѤޤ줿ȥ󡦥饹Ǥϡ1\&.11\&.2ξΥ֡ץȥ롦С򥵥ݡȤޤ줿饹ξ⡼ɤ򥵥ݡȤ뤿ˡ礭ʤޤ:Υץ侩ˤʤޤ򻲾ȤƤ +1\&.1と1\&.2の両方のJRMPスタブ・プロトコル・バージョンと互換性のあるスタブおよびスケルトン・クラスを作成します。5\&.0以前のリリースではこのオプションがデフォルトでした。生成されたスタブ・クラスは、JDK 1\&.1仮想マシンにロードされると1\&.1スタブ・プロトコル・バージョンを使用し、JDK 1\&.2以降の仮想マシンにロードされると1\&.2スタブ・プロトコル・バージョンを使用します。生成されたスケルトン・クラスでは、1\&.1と1\&.2の両方のスタブ・プロトコル・バージョンをサポートします。生成されたクラスは両方の操作モードをサポートするために、サイズが大きくなります。注意:このオプションは非推奨になりました。説明を参照してください。 .RE .PP \-verbose .RS 4 -ѥ󥫡ѥ뤵Ƥ륯饹ɤƤ륯饹եˤĤƤΥåɽ褦ˤޤ +コンパイラやリンカーが、コンパイルされているクラスやロードされているクラス・ファイルについてのメッセージを表示するようにします。 .RE .PP -\-v1\&.1 (侩) +\-v1\&.1 (非推奨) .RS 4 -1\&.1 JRMP֡ץȥ롦СΤߤΥ֤ӥȥ󡦥饹ޤ\fI\-v1\&.1\fRץѤǤΤϡJDK 1\&.1\fIrmic\fRޥɤ졢åץ졼ɤǤʤ(˥ʥߥå饹ǥ󥰤ѤƤʤ)¸Ūǥץ줿֡饹Фľ󲽸ߴΤ륹֡饹ΤߤǤ:Υץ侩ˤʤޤ򻲾ȤƤ +1\&.1 JRMPスタブ・プロトコル・バージョンのみのスタブおよびスケルトン・クラスを生成します。\fI\-v1\&.1\fRオプションを使用できるのは、JDK 1\&.1から\fIrmic\fRコマンドで生成され、アップグレードできない(さらにダイナミック・クラス・ローディングを使用していない)、既存の静的デプロイされたスタブ・クラスに対し、直列化互換性のあるスタブ・クラスを生成する場合のみです。注意:このオプションは非推奨になりました。説明を参照してください。 .RE .PP -\-v1\&.2 (侩) +\-v1\&.2 (非推奨) .RS 4 -(ǥե)1\&.2 JRMP֡ץȥ롦СΤߤΥ֡饹ޤȥ󡦥饹1\&.2֡ץȥ롦СǻѤǤʤᡢȥ󡦥饹ޤ줿֡饹ϡJDK 1\&.1ۥޥ˥ɤƤưޤ:Υץ侩ˤʤޤ򻲾ȤƤ +(デフォルト)1\&.2 JRMPスタブ・プロトコル・バージョンのみのスタブ・クラスを生成します。スケルトン・クラスは1\&.2スタブ・プロトコル・バージョンで使用できないため、スケルトン・クラスは生成されません。生成されたスタブ・クラスは、JDK 1\&.1仮想マシンにロードされても動作しません。注意:このオプションは非推奨になりました。説明を参照してください。 .RE -.SH "Ķѿ" +.SH "環境変数" .PP CLASSPATH .RS 4 -桼饹ؤΥѥ򥷥ƥ˻ꤷޤǥ쥯ȥϥǶڤޤ: +ユーザー定義クラスへのパスをシステムに指定します。ディレクトリはコロンで区切られます。例: \fI\&.:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 b/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 index 1ee27efb1a9..0a7492ef174 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmid .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmid" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmid" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmid \- ưƥࡦǡ򳫻Ϥȡ֥ȤJavaۥޥ(VM)ϿƥƥֲǤ褦ˤʤޤ -.SH "" +rmid \- 起動システム・デーモンを開始すると、オブジェクトをJava仮想マシン(VM)に登録してアクティブ化できるようになります。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,13 +64,13 @@ rmid \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE -.SH "" +.SH "説明" .PP -\fIrmid\fRޥɤϡưƥࡦǡ򳫻Ϥޤưƥࡦǡ򳫻ϤƤǤʤȡƥֲǽ֥Ȥ򥢥ƥֲƥϿꡢJVMǥƥֲꤹ뤳ȤǤޤ󡣥ƥֲǽʥ֥ȤѤץκˡξܺ٤ϡ\fIƥֲλ\fR˴ؤ塼ȥꥢ(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html)򻲾ȤƤ +\fIrmid\fRコマンドは、起動システム・デーモンを開始します。起動システム・デーモンを開始してからでないと、アクティブ化可能オブジェクトをアクティブ化システムに登録したり、JVM内でアクティブ化したりすることができません。アクティブ化可能なオブジェクトを使用するプログラムの作成方法の詳細は、\fIアクティブ化の使用\fRに関するチュートリアル(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi/activation/overview\&.html)を参照してください .PP -\fIrmid\fRޥɤ¹ԤΤ褦˥ƥݥꥷեꤷơǡưޤ +\fIrmid\fRコマンドを実行し、次のようにセキュリティ・ポリシー・ファイルを指定して、デーモンを起動します。 .sp .if n \{\ .RS 4 @@ -82,11 +82,11 @@ rmid \-J\-Djava\&.security\&.policy=rmid\&.policy .RE .\} .PP -\fIrmid\fRޥɤOracleμ¹Ԥ硢ǥեȤǤϡƥݥꥷեꤹɬפޤϡ\fIrmid\fRޥɤư롼ѤJVMư뤿˳\fIActivationGroupDesc\fRξѤǤ뤫ɤ򸡾ڤǤ褦ˤ뤿Ǥäˡ\fIActivationGroupDesc\fR󥹥ȥ饯Ϥ\fICommandEnvironment\fRǤդΥץѥƥˤäƻꤵ륳ޥɤӥץϡ\fIrmid\fRޥɤΥƥݥꥷեŪ˵Ĥ뤳Ȥɬפˤʤޤ\fIsun\&.rmi\&.activation\&.execPolicy\fRץѥƥͤϡư롼ѤJVMư뤿\fIActivationGroupDesc\fRξѤǤ뤫ɤȽǤȤ\fIrmid\fRޥɤѤݥꥷꤷޤܺ٤ϡ\-J\-Dsun\&.rmi\&.activation\&.execPolicy=policyץ򻲾ȤƤ +\fIrmid\fRコマンドのOracleの実装を実行する場合、デフォルトでは、セキュリティ・ポリシー・ファイルを指定する必要があります。それは、\fIrmid\fRコマンドが起動グループ用にJVMを起動するために各\fIActivationGroupDesc\fR内の情報を使用できるかどうかを検証できるようにするためです特に、\fIActivationGroupDesc\fRコンストラクタに渡される\fICommandEnvironment\fRや任意のプロパティによって指定されるコマンドおよびオプションは、\fIrmid\fRコマンドのセキュリティ・ポリシー・ファイルの中で明示的に許可することが必要になりました。\fIsun\&.rmi\&.activation\&.execPolicy\fRプロパティの値は、起動グループ用にJVMを起動するために\fIActivationGroupDesc\fR内の情報を使用できるかどうかを判断するときに\fIrmid\fRコマンドが使用するポリシーを決定します。詳細は、\-J\-Dsun\&.rmi\&.activation\&.execPolicy=policyオプションの説明を参照してください。 .PP -\fIrmid\fRޥɤ¹Ԥȡǥեȡݡ1098ǥƥ١쥸ȥ꤬ư졢\fIActivationSystem\fR쥸ȥ̾\fIjava\&.rmi\&.activation\&.ActivationSystem\fR˥Хɤޤ +\fIrmid\fRコマンドを実行すると、デフォルト・ポート1098でアクティベータと内部レジストリが起動され、\fIActivationSystem\fRがこの内部レジストリ内の名前\fIjava\&.rmi\&.activation\&.ActivationSystem\fRにバインドされます。 .PP -쥸ȥ¾ΥݡȤꤹˤϡ\fIrmid\fRޥɤμ¹Ի\fI\-port\fRץꤹɬפޤȤСΥޥɤϡ쥸ȥΥǥեȡݡ1099ǡưƥࡦǡȥ쥸ȥưޤ +レジストリに他のポートを指定するには、\fIrmid\fRコマンドの実行時に\fI\-port\fRオプションを指定する必要があります。たとえば、次のコマンドは、レジストリのデフォルト・ポート1099で、起動システム・デーモンとレジストリを起動します。 .sp .if n \{\ .RS 4 @@ -97,15 +97,15 @@ rmid \-J\-Djava\&.security\&.policy=rmid\&.policy \-port 1099 .if n \{\ .RE .\} -.SH "ɬפ˱RMID򳫻" +.SH "必要に応じてRMIDを開始" .PP -\fIrmid\fR򥳥ޥɥ饤󤫤鳫Ϥˤϡ\fIinetd\fR -(Oracle Solarisξ)ޤ\fIxinetd\fR -(Linuxξ)\fIrmid\fRɬפ˱ƳϤˡ⤢ޤ +\fIrmid\fRをコマンドラインから開始するには、\fIinetd\fR +(Oracle Solarisの場合)、または\fIxinetd\fR +(Linuxの場合)を構成して\fIrmid\fRを必要に応じて開始する方法もあります。 .PP -RMID򳫻Ϥȡ\fISystem\&.inheritedChannel\fR᥽åɤƤӽФơѾ줿ͥ(\fIinetd\fR/\fIxinetd\fRѾ)褦ȤޤѾ줿ͥ뤬nullǤ뤫\fIjava\&.nio\&.channels\&.ServerSocketChannel\fRΥ󥹥󥹤Ǥʤä硢RMIDϤΥͥ\fIinetd\fR/\fIxinetd\fRˤäƵư줿ΤǤϤʤȽǤҤΤ褦˵ưޤ +RMIDを開始すると、\fISystem\&.inheritedChannel\fRメソッドを呼び出して、継承されたチャンネル(\fIinetd\fR/\fIxinetd\fRから継承)を取得しようとします。継承されたチャンネルがnullであるか、\fIjava\&.nio\&.channels\&.ServerSocketChannel\fRのインスタンスでなかった場合、RMIDはそのチャンネルは\fIinetd\fR/\fIxinetd\fRによって起動されたものではないと判断し、前述のように起動します。 .PP -Ѿ줿ͥ뤬\fIServerSocketChannel\fR󥹥󥹤ǤϡRMIDϥݡȤ⡼ȡ֥ȡĤޤ\fIjava\&.rmi\&.activation\&.ActivationSystem\fRХɤƤ쥸ȥ\fIjava\&.rmi\&.activation\&.Activator\fR⡼ȡ֥ȤФꥯȤ륵СåȤȤơ\fIServerSocketChannel\fR\fIjava\&.net\&.ServerSocket\fRѤޤΥ⡼ɤǤϡRMIDưϡΤȤơޥɥ饤󤫤鵯ưƱǤ +継承されたチャンネルが\fIServerSocketChannel\fRインスタンスである場合は、RMIDはエクスポートするリモート・オブジェクト、つまり\fIjava\&.rmi\&.activation\&.ActivationSystem\fRがバインドされているレジストリと\fIjava\&.rmi\&.activation\&.Activator\fRリモート・オブジェクトに対するリクエストを受信するサーバー・ソケットとして、\fIServerSocketChannel\fRから取得した\fIjava\&.net\&.ServerSocket\fRを使用します。このモードでは、RMIDの動作は、次のことを除いて、コマンドラインから起動した場合と同じです。 .sp .RS 4 .ie n \{\ @@ -115,7 +115,7 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fISystem\&.err\fRФϤϡե˥쥯Ȥ롣Υե\fIjava\&.io\&.tmpdir\fRƥࡦץѥƥǻꤵǥ쥯ȥ(̾\fI/var/tmp\fRޤ\fI/tmp\fR)ˤ롣ե̾Ƭ\fIrmid\-err\fRǡ\fItmp\fRǤ롣 +\fISystem\&.err\fRに対する出力は、ファイルにリダイレクトされる。このファイルは\fIjava\&.io\&.tmpdir\fRシステム・プロパティで指定されるディレクトリ(通常は\fI/var/tmp\fRまたは\fI/tmp\fR)にある。ファイル名の接頭辞は\fIrmid\-err\fRで、接尾辞は\fItmp\fRである。 .RE .sp .RS 4 @@ -126,7 +126,7 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fI\-port\fRץϻѤǤޤ󡣤Υץ󤬻ꤵƤ硢RMIDϥ顼åɽƽλޤ +\fI\-port\fRオプションは使用できません。このオプションが指定されている場合、RMIDはエラー・メッセージが表示されて終了します。 .RE .sp .RS 4 @@ -137,17 +137,17 @@ RMID .sp -1 .IP \(bu 2.3 .\} -\fI\-log\fRץɬܡΥץ󤬻ꤵƤʤ硢RMIDϥ顼åɽƽλޤ +\fI\-log\fRオプションは必須。このオプションが指定されていない場合、RMIDはエラー・メッセージが表示されて終了します。 .RE .PP -ɬפ˱ƥӥ򳫻Ϥ褦˹ˡξܺ٤ϡ\fIinetd\fR -(Oracle Solarisξ)ޤ\fIxinetd\fR -(Linux)Υޥ˥奢롦ڡ򻲾ȤƤ -.SH "ץ" +必要に応じてサービスを開始するように構成する方法の詳細は、\fIinetd\fR +(Oracle Solarisの場合)、または\fIxinetd\fR +(Linux)のマニュアル・ページを参照してください。 +.SH "オプション" .PP -\-C\fIץ\fR +\-C\fIオプション\fR .RS 4 -\fIrmid\fRޥɤλҥץ(ư롼)줿Ȥˡ줾λҥץ˥ޥɥ饤ȤϤ륪ץꤷޤȤСΤ褦˻ꤹȡưƥࡦǡˤäƲۥޥ˥ץѥƥϤȤǤޤ +\fIrmid\fRコマンドの子プロセス(起動グループ)が作成されたときに、それぞれの子プロセスにコマンドライン引数として渡されるオプションを指定します。たとえば、次のように指定すると、起動システム・デーモンによって生成される各仮想マシンにプロパティを渡すことができます。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ rmid \-C\-Dsome\&.property=value .if n \{\ .RE .\} -ޥɥ饤ҥץϤǽϡǥХåԤǤȤСΥޥɤǤϡ٤ƤλJVMserver\-call󥰤ǽǤ +コマンドライン引数を子プロセスに渡す機能は、デバッグを行う場合に便利です。たとえば、次のコマンドでは、すべての子JVMでserver\-callロギングが可能です。 .sp .if n \{\ .RS 4 @@ -173,7 +173,7 @@ rmid \-C\-Djava\&.rmi\&.server\&.logCalls=true .PP \-J\fIoption\fR .RS 4 -RMID¹ԤƤJava󥿥ץ꥿ϤץꤷޤȤС\fIrmid\fRޥɤ\fIrmid\&.policy\fRȤ̾ΥݥꥷեѤ褦˻ꤹˤϡ\fIrmid\fRΥޥɥ饤\fI\-J\fRץѤơ\fIjava\&.security\&.policy\fRץѥƥޤ򼨤ޤ +RMIDを実行しているJavaインタプリタに渡すオプションを指定します。たとえば、\fIrmid\fRコマンドが\fIrmid\&.policy\fRという名前のポリシー・ファイルを使用するように指定するには、\fIrmid\fRのコマンドラインで\fI\-J\fRオプションを使用して、\fIjava\&.security\&.policy\fRプロパティを定義します。次に例を示します。 .sp .if n \{\ .RS 4 @@ -188,7 +188,7 @@ rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy .PP \-J\-Dsun\&.rmi\&.activation\&.execPolicy=\fIpolicy\fR .RS 4 -ư롼פ¹Ԥ뤳ȤˤʤJVMεư˻Ѥ륳ޥɤӥޥɥ饤󡦥ץå뤿ˡRMIDѤݥꥷꤷޤΥץϡJava RMIưǡOracleμΤߤ¸ߤ뤳ȤդƤޥɥ饤ˤΥץѥƥꤷʤ硢̤\fI\-J\-Dsun\&.rmi\&.activation\&.execPolicy=default\fRꤷƱˤʤޤ\fIpolicy\fR˻ǽͤϡ\fIdefault\fR\fIpolicyClassName\fRޤ\fInone\fRǤ +起動グループが実行されることになるJVMの起動に使用するコマンドおよびコマンドライン・オプションをチェックするために、RMIDが採用するポリシーを指定します。このオプションは、Java RMI起動デーモンのOracleの実装のみに存在することに注意してください。コマンドラインにこのプロパティを指定しない場合、結果は\fI\-J\-Dsun\&.rmi\&.activation\&.execPolicy=default\fRを指定した場合と同じになります。\fIpolicy\fRに指定可能な値は、\fIdefault\fR、\fIpolicyClassName\fRまたは\fInone\fRです。 .sp .RS 4 .ie n \{\ @@ -198,35 +198,35 @@ rmid \-J\-Djava\&.security\&.policy\-rmid\&.policy .sp -1 .IP \(bu 2.3 .\} -ǥե +デフォルト .sp -\fIdefault\fRޤ̤ͤ\fIexecPolicy\fRξ硢\fIrmid\fRޥɤ¹ԤǤΤϡ\fIrmid\fRޥɤѤ륻ƥݥꥷեǡ¹Ԥ븢¤\fIrmid\fRͿƤ륳ޥɤӥޥɥ饤󡦥ץΤߤǤǥեȤμ¹ԥݥꥷǻѤǤΤϡǥեȤεư롼׼ΤߤǤ +\fIdefault\fRまたは未指定値の\fIexecPolicy\fRの場合、\fIrmid\fRコマンドが実行できるのは、\fIrmid\fRコマンドが使用するセキュリティ・ポリシー・ファイルの中で、実行する権限が\fIrmid\fRに与えられているコマンドおよびコマンドライン・オプションのみです。デフォルトの実行ポリシーで使用できるのは、デフォルトの起動グループ実装のみです。 .sp -\fIrmid\fRޥɤϡư롼ѤJVMưȤˡΥ롼פˤĤϿ줿ư롼׵һҤǤ\fIActivationGroupDesc\fRξѤޤ롼׵һҤϡ\fIActivationGroupDesc\&.CommandEnvironment\fRꤷޤ(άǽ)ˤϡư롼פ򳫻Ϥ륳ޥɤȡΥޥɥ饤ɲäǤ륳ޥɥ饤󡦥ץ󤬴ޤޤƤޤǥեȤǤϡ\fIrmid\fRޥɤ\fIjava\&.home\fRˤ\fIjava\fRޥɤѤޤ롼׵һҤˤϡޥɥ饤˥ץȤɲäץѥƥС饤ɤޤޤޤ(\fI\-D<property>=<value>\fRȤޤ)\fIcom\&.sun\&.rmi\&.rmid\&.ExecPermission\fR¤\fIrmid\fRޥɤˡư롼פ򳫻Ϥ뤿˥롼׵һҤ\fICommandEnvironment\fRǻꤵ줿ޥɤ¹Ԥ븢¤Ϳޤ\fIcom\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR¤ϵư롼פγϻˡ롼׵һҤǥץѥƥС饤ɤȤơޤ\fICommandEnvironment\fRǥץȤƻꤵ줿ޥɥ饤󡦥ץ\fIrmid\fRޥɤѤ뤳ȤĤޤ\fIrmid\fRޥɤ͡ʥޥɤӥץ¹Ԥ븢¤Ϳ硢\fIExecPermission\fR\fIExecOptionPermission\fR򤹤٤ƤΥɡͿɬפޤ +\fIrmid\fRコマンドは、起動グループ用のJVMを起動するときに、そのグループについて登録された起動グループ記述子である\fIActivationGroupDesc\fR内の情報を使用します。グループ記述子は、\fIActivationGroupDesc\&.CommandEnvironment\fRを指定します(省略可能)。これには、起動グループを開始するコマンドと、そのコマンドラインに追加できるコマンドライン・オプションが含まれています。デフォルトでは、\fIrmid\fRコマンドは\fIjava\&.home\fRにある\fIjava\fRコマンドを使用します。グループ記述子には、コマンドラインにオプションとして追加されるプロパティ・オーバーライドも含まれます(\fI\-D<property>=<value>\fRとして定義されます)。\fIcom\&.sun\&.rmi\&.rmid\&.ExecPermission\fR権限は\fIrmid\fRコマンドに、起動グループを開始するためにグループ記述子の\fICommandEnvironment\fRで指定されたコマンドを実行する権限を付与します。\fIcom\&.sun\&.rmi\&.rmid\&.ExecOptionPermission\fR権限は起動グループの開始時に、グループ記述子でプロパティ・オーバーライドとして、または\fICommandEnvironment\fRでオプションとして指定されたコマンドライン・オプションを、\fIrmid\fRコマンドが使用することを許可します。\fIrmid\fRコマンドに様々なコマンドおよびオプションを実行する権限を付与する場合、権限\fIExecPermission\fRおよび\fIExecOptionPermission\fRをすべてのコード・ソースに付与する必要があります。 .sp \fBExecPermission\fR .sp -\fIExecPermission\fR饹ϡư롼פ򳫻Ϥ뤿\fIrmid\fRޥɤΥޥɤ¹Ԥ븢¤ɽޤ +\fIExecPermission\fRクラスは、起動グループを開始するために\fIrmid\fRコマンドが特定のコマンドを実行する権限を表します。 .sp -\fBʸ\fR: -\fIExecPermission\fR̾ϡ\fIrmid\fRޥɤ˼¹ԤĤ륳ޥɤΥѥ̾Ǥå(/)ӥꥹ(*)ǽѥ̾ϡΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥե򼨤ޤåϥեڤʸ\fIFile\&.separatorChar\fRǤå(/)ӥޥʥ(\-)ǽѥ̾ϡΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥեȥ֥ǥ쥯ȥ(ƵŪ)򼨤ޤѥ̤̾ʥȡ\fI<<ALL FILES>>\fRꤷϡǤդΥե򼨤ޤ +\fB構文\fR: +\fIExecPermission\fRの名前は、\fIrmid\fRコマンドに実行を許可するコマンドのパス名です。スラッシュ(/)およびアスタリスク(*)で終わるパス名は、そのディレクトリに含まれるすべてのファイルを示します。スラッシュはファイル区切り文字\fIFile\&.separatorChar\fRです。スラッシュ(/)およびマイナス符号(\-)で終わるパス名は、そのディレクトリに含まれるすべてのファイルとサブディレクトリ(再帰的に)を示します。パス名に特別なトークン\fI<<ALL FILES>>\fRを指定した場合は、任意のファイルを示します。 .sp -ѥ̾˥ꥹ(*)ꤷϡߤΥǥ쥯ȥΤ٤ƤΥե򼨤ޤѥ̾˥ޥʥ(\-)ꤷϡߤΥǥ쥯ȥΤ٤ƤΥե뤪(ƵŪ)ߤΥǥ쥯ȥ˴ޤޤ뤹٤ƤΥեȥ֥ǥ쥯ȥ򼨤ޤ +パス名にアスタリスク(*)を指定した場合は、現在のディレクトリ内のすべてのファイルを示します。パス名にマイナス符号(\-)を指定した場合は、現在のディレクトリ内のすべてのファイルおよび(再帰的に)現在のディレクトリに含まれるすべてのファイルとサブディレクトリを示します。 .sp \fBExecOptionPermission\fR .sp -\fIExecOptionPermission\fR饹ϡư롼פ򳫻ϤȤ\fIrmid\fRޥɤΥޥɥ饤󡦥ץѤǤ븢¤ɽޤ\fIExecOptionPermission\fR̾ϡޥɥ饤󡦥ץͤǤ +\fIExecOptionPermission\fRクラスは、起動グループを開始するときに\fIrmid\fRコマンドで特定のコマンドライン・オプションを使用できる権限を表します。\fIExecOptionPermission\fRの名前は、コマンドライン・オプションの値です。 .sp -\fBʸ\fR: ץǤϡ磻ɥɤŪ˥ݡȤޤꥹϡ磻ɥɡޥåɽޤꥹ(*)ϡץ̾ΤΤȤƻѤǤޤĤޤꡢǤդΥץɽȤǤޤޤץ̾˻Ѥ뤳ȤǤޤɥå(\&.)(=)ľ˥ꥹ(*)ꤹɬפޤ +\fB構文\fR: オプションでは、ワイルドカードが限定的にサポートされます。アスタリスクは、ワイルドカード・マッチを表します。アスタリスク(*)は、オプション名そのものとして使用できます。つまり、任意のオプションを表すことができます。また、オプション名の末尾に使用することもできます。ただし、ドット(\&.)か等号(=)の直後にアスタリスク(*)を指定する必要があります。 .sp -: -\fI*\fR\fI\-Dmydir\&.*\fR\fI\-Da\&.b\&.c=*\fRͭǤ\fI*mydir\fR\fI\-Da*b\fR\fIab*\fR̵Ǥ +例: +\fI*\fRや\fI\-Dmydir\&.*\fRや\fI\-Da\&.b\&.c=*\fRは有効ですが、\fI*mydir\fRや\fI\-Da*b\fRや\fIab*\fRは無効です。 .sp -\fBrmidΥݥꥷե\fR +\fBrmidのポリシー・ファイル\fR .sp -\fIrmid\fRޥɤ͡ʥޥɤӥץ¹Ԥ븢¤Ĥϡ\fIExecPermission\fR\fIExecOptionPermission\fR򤹤٤ƤΥɡͿɬפޤ(Ū)θ¤åΤ\fIrmid\fRޥɤΤߤʤΤǡθ¤ŪͿƤǤ +\fIrmid\fRコマンドに様々なコマンドおよびオプションを実行する権限を許可する場合は、権限\fIExecPermission\fRおよび\fIExecOptionPermission\fRをすべてのコード・ソースに付与する必要があります(汎用的に)。これらの権限をチェックするのは\fIrmid\fRコマンドのみなので、これらの権限を汎用的に付与しても安全です。 .sp -\fIrmid\fRޥɤ˳Ƽμ¹Ը¤Ϳݥꥷե򡢼˼ޤ +\fIrmid\fRコマンドに各種の実行権限を付与するポリシー・ファイルの例を、次に示します。 .sp .if n \{\ .RS 4 @@ -252,11 +252,11 @@ grant { .if n \{\ .RE .\} -ǽͿƤ븢¤ϡ\fIrmid\fRޥɤФѥ̾ˤŪ˻ꤵ\fIjava\fRޥɤ1\&.7\&.0꡼μ¹ԤĤޤǥեȤǤϡ\fIjava\&.home\fRˤС\fIjava\fRޥɤѤޤ\fIrmid\fRޥɤѤΤƱС󤬻Ѥ뤿ᡢΥޥɤϡݥꥷեǻꤹɬפϤޤ2ܤθ¤ϡ\fIrmid\fRޥɤФơǥ쥯ȥ\fI/files/apps/rmidcmds\fRǤդΥޥɤμ¹Ը¤Ĥޤ +最初に付与されている権限は、\fIrmid\fRコマンドに対し、パス名により明示的に指定される\fIjava\fRコマンドの1\&.7\&.0リリースの実行を許可します。デフォルトでは、\fIjava\&.home\fRにあるバージョンの\fIjava\fRコマンドを使用します。\fIrmid\fRコマンドが使用するのと同じバージョンが使用されるため、そのコマンドは、ポリシー・ファイルで指定する必要はありません。2番目の権限は、\fIrmid\fRコマンドに対して、ディレクトリ\fI/files/apps/rmidcmds\fR内の任意のコマンドの実行権限を許可します。 .sp -3ܤͿƤ븢\fIExecOptionPermission\fRϡ\fIrmid\fRޥɤФơƥݥꥷե\fI/files/policies/group\&.policy\fRȤƤ뵯ư롼פγϤĤޤθ¤ϡư롼פ\fIjava\&.security\&.debug property\fRѤ뤳ȤĤƤޤǸθ¤ϡư롼פ\fIsun\&.rmi property\fR̾γǤդΥץѥƥѤ뤳ȤĤƤޤ +3番目に付与されている権限\fIExecOptionPermission\fRは、\fIrmid\fRコマンドに対して、セキュリティ・ポリシー・ファイルを\fI/files/policies/group\&.policy\fRとして定義している起動グループの開始を許可します。次の権限は、起動グループが\fIjava\&.security\&.debug property\fRを使用することを許可しています。最後の権限は、起動グループが\fIsun\&.rmi property\fR名の階層内の任意のプロパティを使用することを許可しています。 .sp -ݥꥷեꤷ\fIrmid\fRޥɤưˤϡ\fIrmid\fRΥޥɥ饤\fIjava\&.security\&.policy\fRץѥƥꤹɬפޤ򼨤ޤ +ポリシー・ファイルを指定して\fIrmid\fRコマンドを起動するには、\fIrmid\fRのコマンドラインで\fIjava\&.security\&.policy\fRプロパティを指定する必要があります。次に例を示します。 .sp \fIrmid \-J\-Djava\&.security\&.policy=rmid\&.policy\fR\&. .RE @@ -271,9 +271,9 @@ grant { .\} <policyClassName> .sp -ǥեȤưǤϽʬʽʤ硢Ԥϡ\fIrmid\fRεưˡ\fIcheckExecCommand\fR᥽åɤ°륯饹̾ꤷơ\fIrmid\fRޥɤ¹Ԥ륳ޥɤå뤳ȤǤޤ +デフォルトの動作では十分な柔軟性が得られない場合、管理者は、\fIrmid\fRの起動時に、\fIcheckExecCommand\fRメソッドが所属するクラスの名前を指定して、\fIrmid\fRコマンドが実行するコマンドをチェックすることができます。 .sp -\fIpolicyClassName\fRˤϡʤΥ󥹥ȥ饯Τ褦\fIcheckExecCommand\fR᥽åɤƤpublic饹ꤷޤ +\fIpolicyClassName\fRには、引数なしのコンストラクタを持ち、次のような\fIcheckExecCommand\fRメソッドを実装しているpublicクラスを指定します。 .sp .if n \{\ .RS 4 @@ -285,7 +285,7 @@ grant { .if n \{\ .RE .\} -ư롼פ򳫻Ϥˡ\fIrmid\fRޥɤϡݥꥷ\fIcheckExecCommand\fR᥽åɤƤӽФޤΤȤư롼פεһҤȡư롼פ򳫻Ϥ뤿δʥޥɤޤ򤽤Υ᥽åɤϤޤ\fIcheckExecCommand\fR\fISecurityException\fR򥹥ȡ\fIrmid\fRޥɤϤεư롼פ򳫻Ϥ֥ȤεưԤƤƽФ¦ˤ\fIActivationException\fRޤ +起動グループを開始する前に、\fIrmid\fRコマンドは、ポリシーの\fIcheckExecCommand\fRメソッドを呼び出します。このとき、起動グループの記述子と、起動グループを開始するための完全なコマンドを含む配列をそのメソッドに渡します。\fIcheckExecCommand\fRが\fISecurityException\fRをスローすると、\fIrmid\fRコマンドはその起動グループを開始せず、オブジェクトの起動を試行している呼出し側には\fIActivationException\fRがスローされます。 .RE .sp .RS 4 @@ -298,18 +298,18 @@ grant { .\} none .sp -\fIsun\&.rmi\&.activation\&.execPolicy\fRץѥƥͤ\fInone\fRξ硢\fIrmid\fRޥɤϡư롼פ򳫻Ϥ륳ޥɤޤäڤޤ +\fIsun\&.rmi\&.activation\&.execPolicy\fRプロパティの値が\fInone\fRの場合、\fIrmid\fRコマンドは、起動グループを開始するコマンドをまったく検証しません。 .RE .RE .PP \-log \fIdir\fR .RS 4 -ưƥࡦǡ󤬥ǡ١ӴϢ񤭹Τ˻Ѥǥ쥯ȥ̾ꤷޤǥեȤǤϡ\fIrmid\fRޥɤ¹Ԥǥ쥯ȥˡlogȤǥ쥯ȥ꤬ޤ +起動システム・デーモンがデータベースおよび関連情報を書き込むのに使用するディレクトリの名前を指定します。デフォルトでは、\fIrmid\fRコマンドを実行したディレクトリに、logというログ・ディレクトリが作成されます。 .RE .PP \-port \fIport\fR .RS 4 -쥸ȥ꤬ѤݡȤꤷޤưƥࡦǡϡΥ쥸ȥǡ\fIjava\&.rmi\&.activation\&.ActivationSystem\fRȤ̾\fIActivationSystem\fRХɤޤ롦ޥ\fIActivationSystem\fRϡΤ褦\fINaming\&.lookup\fR᥽åɤƤӽФȤˤäƼǤޤ +レジストリが使用するポートを指定します。起動システム・デーモンは、このレジストリの中で、\fIjava\&.rmi\&.activation\&.ActivationSystem\fRという名前で\fIActivationSystem\fRをバインドします。ローカル・マシン上の\fIActivationSystem\fRは、次のように\fINaming\&.lookup\fRメソッドを呼び出すことによって取得できます。 .sp .if n \{\ .RS 4 @@ -328,16 +328,16 @@ import java\&.rmi\&.*; .PP \-stop .RS 4 -\fI\-port\fRץˤäƻꤵ줿ݡȤΡߤ\fIrmid\fRޥɤθƽФߤޤݡȤꤵƤʤϡΥץϥݡ1098Ǽ¹ԤƤ\fIrmid\fRθƽФߤޤ +\fI\-port\fRオプションによって指定されたポートの、現在の\fIrmid\fRコマンドの呼出しを停止します。ポートが指定されていない場合は、このオプションはポート1098で実行されている\fIrmid\fRの呼出しを停止します。 .RE -.SH "Ķѿ" +.SH "環境変数" .PP CLASSPATH .RS 4 -桼饹ؤΥѥ򥷥ƥ˻ꤷޤǥ쥯ȥϥǶڤޤ: +ユーザー定義クラスへのパスをシステムに指定します。ディレクトリはコロンで区切られます。例: \fI\&.:/usr/local/java/classes\fR .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 b/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 index 2786a5b1a3c..ab4e85d5caf 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: rmiregistry .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "rmiregistry" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "rmiregistry" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -rmiregistry \- ߤΥۥȤλꤷݡȾ˥⡼ȡ֥ȡ쥸ȥ򳫻Ϥޤ -.SH "" +rmiregistry \- 現在のホストの指定したポート上にリモート・オブジェクト・レジストリを開始します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,11 +64,11 @@ rmiregistry \- .PP \fIport\fR .RS 4 -⡼ȡ֥ȡ쥸ȥ򳫻Ϥ븽ߤΥۥȾ\fIport\fRο +リモート・オブジェクト・レジストリを開始する現在のホスト上の\fIport\fRの数。 .RE -.SH "" +.SH "説明" .PP -\fIrmiregistry\fRޥɤϡߤΥۥȤλꤷݡȾ˥⡼ȡ֥ȡ쥸ȥϤޤportλά硢쥸ȥϥݡ1099dzϤޤ\fIrmiregistry\fRޥɤˡϵǽϤޤ̾ϥХå饦ɤǼ¹Ԥޤ򼨤ޤ +\fIrmiregistry\fRコマンドは、現在のホストの指定したポート上にリモート・オブジェクト・レジストリを作成し、開始します。portの指定を省略した場合、レジストリはポート1099で開始します。\fIrmiregistry\fRコマンドに、出力機能はありません。通常、これはバックグラウンドで実行されます。次に例を示します。 .sp .if n \{\ .RS 4 @@ -80,20 +80,20 @@ rmiregistry & .RE .\} .PP -⡼ȡ֥ȡ쥸ȥϡ֡ȥȥåפΥ͡ࡦӥǤƱۥȤRMIС⡼ȡ֥Ȥ̾˥Хɤ뤿˻Ѥޤˡ뤪ӥ⡼ȡۥȤΥ饤Ȥϥ⡼ȡ֥Ȥ򸡺⡼ȡ᥽åɤθƽФԤޤ +リモート・オブジェクト・レジストリは、ブートストラップのネーム・サービスです。同一ホストのRMIサーバーが、リモート・オブジェクトを名前にバインドするために使用されます。次に、ローカルおよびリモート・ホストのクライアントはリモート・オブジェクトを検索し、リモート・メソッドの呼出しを行います。 .PP -쥸ȥϡŪˡǽΥ⡼ȡ֥Ȥΰ֤ꤷޤǡץꥱϥ᥽åɤƤӽФɬפޤθ塢Υ֥ȤϥץꥱΥݡȤ󶡤¾Υ֥Ȥõޤ +レジストリは、一般的に、最初のリモート・オブジェクトの位置を指定します。そこで、アプリケーションはメソッドを呼び出す必要があります。その後、そのオブジェクトはアプリケーション指定のサポートを提供し、他のオブジェクトを探します。 .PP -\fIjava\&.rmi\&.registry\&.LocateRegistry\fR饹Υ᥽åɤϡ롦ۥȡޤϥ롦ۥȤȥݡȤư쥸ȥ뤿˻Ѥޤ +\fIjava\&.rmi\&.registry\&.LocateRegistry\fRクラスのメソッドは、ローカル・ホスト、またはローカル・ホストとポートで動作するレジストリを取得するために使用されます。 .PP -\fIjava\&.rmi\&.Naming\fR饹URL١᥽åɤϥ쥸ȥФ¹ԤǤդΥۥȤӥ롦ۥȤǤΥ⡼ȡ֥Ȥθ˻ѤǤޤñ̾(ʸ)⡼ȡ֥Ȥ˥Хɤ̾⡼ȡ֥Ȥ˺ƥХɤ(ŤХɤ򥪡С饤)⡼ȡ֥Ȥ򥢥Хɤ쥸ȥ˥ХɤƤURLꥹɽޤ -.SH "ץ" +\fIjava\&.rmi\&.Naming\fRクラスのURLベース・メソッドはレジストリに対して操作を実行し、任意のホストおよびローカル・ホストでのリモート・オブジェクトの検索に使用できます。単純名(文字列)をリモート・オブジェクトにバインドし、新しい名前をリモート・オブジェクトに再バインドし(古いバインドをオーバーライド)、リモート・オブジェクトをアンバインドし、レジストリにバインドされているURLをリスト表示します。 +.SH "オプション" .PP \-J .RS 4 -JavaץȤȤ˻Ѥơ\fI\-J\fRθ³ץJava󥿥ץ꥿˰Ϥޤ(\fI\-J\fRȥץδ֤˥ڡޤ) +Javaオプションとともに使用して、\fI\-J\fRの後ろに続くオプションをJavaインタプリタに引き渡します(\fI\-J\fRとオプションの間にスペースは入れません)。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -114,7 +114,7 @@ java(1) .sp -1 .IP \(bu 2.3 .\} -\fIjava\&.rmi\&.registry\&.LocateRegistry\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html) +\fI「java\&.rmi\&.registry\&.LocateRegistry」\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/registry/LocateRegistry\&.html) .RE .sp .RS 4 @@ -125,7 +125,7 @@ java(1) .sp -1 .IP \(bu 2.3 .\} -\fIjava\&.rmi\&.Naming class description\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html) +\fI「java\&.rmi\&.Naming class description」\fR(http://docs\&.oracle\&.com/javase/8/docs/api/java/rmi/Naming\&.html) .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 b/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 index 60deab8308d..63a7b4a9f97 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: schemagen .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "schemagen" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "schemagen" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -schemagen \- Java饹ǻȤƤ͡ॹڡȤ˥ޤޤ -.SH "" +schemagen \- Javaクラス内で参照されているネームスペースごとにスキーマを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,19 +64,19 @@ schemagen \- Java .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIjava\-files\fR .RS 4 -Java饹ե롣 +処理するJavaクラス・ファイル。 .RE -.SH "" +.SH "説明" .PP -ޡͥ졼ϡJava饹ǻȤƤ͡ॹڡȤ1ĤΥޡեޤߡ륹ޡե̾Ǥޤ󡣥ޡե̾椹ϡhttp://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.htmlˤ -Using SchemaGen with Antפ򻲾ȤƤ +スキーマ・ジェネレータは、Javaクラス内で参照されているネームスペースごとに1つのスキーマ・ファイルを作成します。現在、生成されるスキーマ・ファイルの名前は制御できません。スキーマ・ファイル名を制御する場合は、http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/schemagenTask\&.htmlにある +「Using SchemaGen with Ant」を参照してください .PP -ץåȥեbinǥ쥯ȥˤŬڤ\fIschemagen\fR롦ץȤѤơޡͥ졼ưޤߤΥޡͥ졼ϡJavaեȥ饹եΤǤޤ +プラットフォームのbinディレクトリにある適切な\fIschemagen\fRシェル・スクリプトを使用して、スキーマ・ジェネレータを起動します。現在のスキーマ・ジェネレータは、Javaソース・ファイルとクラス・ファイルのいずれも処理できます。 .sp .if n \{\ .RS 4 @@ -89,44 +89,44 @@ Note: Writing schema1\&.xsd .RE .\} .PP -javaե뤬¾Υ饹򻲾ȤƤ硢Υ饹˥ƥ\fICLASSPATH\fRĶѿǥǤɬפޤޤϡ饹ѥץꤷ\fIschemagen\fRޥɡ饤ǻꤹɬפޤץ򻲾ȤƤȤե˥ǤʤޤϻȤե뤬ꤵƤʤ硢ޤ˥顼ɽޤ -.SH "ץ" +javaファイルが他のクラスを参照している場合、それらのクラスにシステム\fICLASSPATH\fR環境変数でアクセスできる必要があります。または、クラス・パス・オプションを指定して\fIschemagen\fRコマンド・ラインで指定する必要があります。オプションを参照してください。参照されるファイルにアクセスできない、または参照されるファイルが指定されていない場合、スキーマの生成時にエラーが表示されます。 +.SH "オプション" .PP \-d \fIpath\fR .RS 4 -\fIschemagen\fRޥɤץå\fIjavac\fR饹ե֤ꡣ +\fIschemagen\fRコマンドがプロセッサ生成および\fIjavac\fR生成クラス・ファイルを配置する場所。 .RE .PP \-cp \fIpath\fR .RS 4 -\fIschemagen\fRޥɤ桼ե֤ꡣ +\fIschemagen\fRコマンドがユーザー指定ファイルを配置する場所。 .RE .PP \-classpath \fIpath\fR .RS 4 -\fIschemagen\fRޥɤ桼ե֤ꡣ +\fIschemagen\fRコマンドがユーザー指定ファイルを配置する場所。 .RE .PP \-encoding \fIencoding\fR .RS 4 -\fIapt\fRޤ\fIjavac\fRޥɤθƽФ˻Ѥ륨󥳡ǥ󥰤ꤷޤ +\fIapt\fRまたは\fIjavac\fRコマンドの呼出しに使用するエンコーディングを指定します。 .RE .PP \-episode \fIfile\fR .RS 4 -ѥ뤴Ȥ˥ԥɡեޤ +コンパイルごとにエピソード・ファイルを生成します。 .RE .PP \-version .RS 4 -꡼ɽޤ +リリース情報を表示します。 .RE .PP \-help .RS 4 -إסåɽޤ +ヘルプ・メッセージを表示します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 b/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 index e527c1694f4..bb78803ecdd 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: serialver .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Remote Method Invocation (RMI)ġ +.\" Date: 2013年11月21日 +.\" SectDesc: Remote Method Invocation (RMI)ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "serialver" "1" "2013ǯ1121" "JDK 8" "Remote Method Invocation (RMI)" +.TH "serialver" "1" "2013年11月21日" "JDK 8" "Remote Method Invocation (RMI)" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -serialver \- ꤷ饹Υꥢ롦СUIDᤷޤ -.SH "" +serialver \- 指定したクラスのシリアル・バージョンUIDを戻します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,35 +64,35 @@ serialver \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIclassnames\fR .RS 4 -\fIserialVersionUID\fR᤹饹Ǥ +\fIserialVersionUID\fRを戻すクラスです。 .RE -.SH "" +.SH "説明" .PP -\fIserialver\fRޥɤϡ1İʾΥ饹\fIserialVersionUID\fRŸƤ륯饹إԡΤŬ֤ޤʤǸƤӽФ줿硢\fIserialver\fRޥɤϻΨԤϤޤ -.SH "ץ" +\fIserialver\fRコマンドは、1つ以上のクラスの\fIserialVersionUID\fRを、展開しているクラスへコピーするのに適した形式で返します。引数なしで呼び出された場合、\fIserialver\fRコマンドは使用率行を出力します。 +.SH "オプション" .PP \-classpath \fIpath\-files\fR .RS 4 -ץꥱΥ饹ӥ꥽θѥꤷޤ饹ȥ꥽򥳥(:)Ƕڤޤ +アプリケーションのクラスおよびリソースの検索パスを設定します。クラスとリソースをコロン(:)で区切ります。 .RE .PP \-show .RS 4 -ñʥ桼󥿥եɽޤΥ饹̾ϤơEnterɽץܥ򲡤\fIserialVersionUID\fRɽޤ +簡単なユーザー・インタフェースを表示します。完全指定のクラス名を入力して、Enterキーか「表示」ボタンを押し、\fIserialVersionUID\fRを表示します。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤoptionˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。optionには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" +.SH "注意" .PP -\fIserialver\fRޥɤϡꤵ줿饹򤽤βۥޥɤ߹ǽޤǥեȤǤϥƥޥ͡ϹԤޤ󡣿Ǥʤ饹ȤȤ\fIserialver\fRޥɤ¹ԤˤϡΥץѤƥƥޥ͡Ǥޤ +\fIserialver\fRコマンドは、指定されたクラスをその仮想マシン内に読み込んで初期化しますが、デフォルトではセキュリティ・マネージャの設定は行いません。信頼できないクラスとともに\fIserialver\fRコマンドを実行する場合には、次のオプションを使用してセキュリティ・マネージャを設定できます。 .sp .if n \{\ .RS 4 @@ -104,7 +104,7 @@ Java .RE .\} .PP -ɬפǤСΥץѤƥƥݥꥷǤޤ +必要であれば、次のオプションを使用してセキュリティ・ポリシーを指定できます。 .sp .if n \{\ .RS 4 @@ -115,7 +115,7 @@ Java .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -136,8 +136,8 @@ policytool(1) .sp -1 .IP \(bu 2.3 .\} -http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.htmlˤ -\fIjava\&.io\&.ObjectStream\fR饹 +http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.htmlにある +\fIjava\&.io\&.ObjectStream\fRクラス記述 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 b/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 index 71ab6b65ed1..fd37f508938 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: servertool .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "servertool" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "servertool" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -servertool \- ȯԤ³СϿϿưߤ뤿λȤ䤹桼󥿥ե󶡤ޤ -.SH "" +servertool \- 開発者が永続サーバーを登録、登録解除、起動、停止するための使いやすいユーザー・インタフェースを提供します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,35 +64,35 @@ servertool \- .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP commands .RS 4 -ޥɥ饤󡦥ޥɡޥɤ򻲾ȤƤ +コマンドライン・コマンド。コマンドを参照してください。 .RE .PP \fIservertool\fR\fIservertool >\fR\fIservertool >\fR -.SH "" +.SH "説明" .PP -\fIservertool\fRޥɤϡȯԤ³СϿϿưߤ뤿Υޥɥ饤󡦥󥿥ե󶡤ޤޥɥ饤󡦥ޥɤѤȡС˴ؤ͡׾Ǥޤޥɤ򻲾ȤƤ -.SH "ץ" +\fIservertool\fRコマンドは、開発者が永続サーバーを登録、登録解除、起動、停止するためのコマンドライン・インタフェースを提供します。コマンドライン・コマンドを使用すると、サーバーに関する様々な統計情報を取得できます。コマンドを参照してください。 +.SH "オプション" .PP \-ORBInitialHost \fInameserverhost\fR .RS 4 -ΥץɬܤǤ͡ࡦС¹Ԥ졢忮ꥯȤꥹ˥󥰤ۥȡޥꤷޤ\fInameserverhost\fRͤϡ\fIorb\fR¹Ԥ졢ꥯȤꥹ˥󥰤ƤݡȤꤹɬפޤΥץꤷʤ硢ͤϥǥեȤ\fIlocalhost\fRꤵޤ\fIorbd\fR\fIservertool\fRۤʤޥǼ¹ԤƤϡ\fIorbd\fR¹ԤƤۥȤ̾ޤIPɥ쥹ꤹɬפޤ +このオプションは必須です。ネーム・サーバーが実行され、着信リクエストをリスニングするホスト・マシンを指定します。\fInameserverhost\fR値は、\fIorb\fRが実行され、リクエストをリスニングしているポートを指定する必要があります。このオプションを指定しない場合、値はデフォルトで\fIlocalhost\fRに設定されます。\fIorbd\fRと\fIservertool\fRが異なるマシン上で実行されている場合は、\fIorbd\fRが実行されているホストの名前またはIPアドレスを指定する必要があります。 .sp -\fB:\fR -Oracle SolarisǤϡ1024꾮ݡȾǥץ򳫻Ϥˤϡroot桼ˤʤɬפޤ\fInameserverport\fRͤˤϡ1024ʾΥݡֹѤ뤳Ȥᤷޤ +\fB注意:\fR +Oracle Solarisでは、1024より小さいポート上でプロセスを開始するには、rootユーザーになる必要があります。\fInameserverport\fR値には、1024以上のポート番号を使用することをお薦めします。 .RE .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "ޥ" +.SH "コマンド" .PP -\fIservertool\fRޥɤϡޥɥ饤󡦥ޥɤѤơޤϻѤ˵ưǤޤ +\fIservertool\fRコマンドは、コマンドライン・コマンドを使用して、または使用せずに起動できます。 .sp .RS 4 .ie n \{\ @@ -102,8 +102,8 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIservertool\fRεư˥ޥɤꤷʤä硢ޥɥ饤󡦥ġ˥ޥϤ\fIservertool\fRץץȤɽޤ: -\fIservertool >\fR +\fIservertool\fRの起動時にコマンドを指定しなかった場合、コマンドライン・ツールにコマンド入力を求める\fIservertool\fRプロンプトが表示されます: +\fIservertool >\fR。 .RE .sp .RS 4 @@ -114,75 +114,75 @@ Java .sp -1 .IP \(bu 2.3 .\} -\fIservertool\fRεư˥ޥɤꤷ硢Java IDL Server Toolưƥޥɤ¹Ԥλޤ +\fIservertool\fRの起動時にコマンドを指定した場合、Java IDL Server Toolが起動してコマンドを実行し、終了します。 .RE .PP register \-server \fIserver\-class\-name\fR \-classpath \fIclasspath\-to\-server\fR [ \-applicationName \fIapplication\-name\fR \-args \fIargs\-to\-server\fR \-vmargs \fIflags\-for\-JVM\fR ] .RS 4 -Object Request Broker Daemon (ORBD)˿³СϿޤС̤Ͽξ硢ϿƥƥֲޤΥޥɤˤäơ\fI\-server\fRץǼ̤륵С\fIᥤ\fR饹ǥ󥹥ȡ롦᥽åɤƤӽФޤΥ󥹥ȡ롦᥽åɤϡ\fIpublic static void install(org\&.omg\&.CORBA\&.ORB)\fRˤʤäƤɬפޤ󥹥ȡ롦᥽åɤϥץǤꡢȯԤϥǡ١ޤκʤȼΥС󥹥ȡưǤޤ +Object Request Broker Daemon (ORBD)に新規永続サーバーを登録します。サーバーが未登録の場合、登録してアクティブ化します。このコマンドによって、\fI\-server\fRオプションで識別されるサーバーの\fIメイン\fR・クラス内でインストール・メソッドが呼び出されます。このインストール・メソッドは、\fIpublic static void install(org\&.omg\&.CORBA\&.ORB)\fRになっている必要があります。インストール・メソッドはオプションであり、開発者はデータベース・スキーマの作成など独自のサーバー・インストール動作を指定できます。 .RE .PP unregister \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR .RS 4 -СIDޤϥץꥱ̾ǡСORBDϿޤΥޥɤˤäơ\fI\-server\fRץǼ̤륵С\fIᥤ\fR饹ǥ󥤥󥹥ȡ롦᥽åɤƤӽФޤ -\fIuninstall\fR᥽åɤϡ\fIpublic static void uninstall(org\&.omg\&.CORBA\&.ORB)\fRˤʤäƤɬפޤ\fIuninstall\fR᥽åɤϥץǤꡢȯԤ\fIinstall\fR᥽åɤưμäʤɡȼΥС󥤥󥹥ȡưǤޤ +サーバーIDまたはアプリケーション名で、サーバーをORBDから登録解除します。このコマンドによって、\fI\-server\fRオプションで識別されるサーバーの\fIメイン\fR・クラス内でアンインストール・メソッドが呼び出されます。 +\fIuninstall\fRメソッドは、\fIpublic static void uninstall(org\&.omg\&.CORBA\&.ORB)\fRになっている必要があります。\fIuninstall\fRメソッドはオプションであり、開発者は\fIinstall\fRメソッドの動作の取消など、独自のサーバー・アンインストール動作を指定できます。 .RE .PP getserverid \-applicationName \fIapplication\-name\fR .RS 4 -\fIapplication\-name\fRͤб륵СID֤ޤ +\fIapplication\-name\fR値に対応するサーバーIDを返します。 .RE .PP list .RS 4 -ORBDϿƤ뤹٤Ƥα³С˴ؤɽޤ +ORBDに登録されているすべての永続サーバーに関する情報を一覧表示します。 .RE .PP listappnames .RS 4 -ORBDϿƤ뤹٤ƤΥСΥץꥱ̾ɽޤ +現在ORBDに登録されているすべてのサーバーのアプリケーション名を一覧表示します。 .RE .PP listactive .RS 4 -ORBDˤäƵư졢߼¹ԤƤ뤹٤Ƥα³С˴ؤɽޤ +ORBDによって起動され、現在実行されているすべての永続サーバーに関する情報を一覧表示します。 .RE .PP locate \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR [ \-endpointType \fIendpointType\fR ] .RS 4 -Ͽ줿СǺ٤ƤORBΥפˤĤƥɥݥ(ݡ)򸡽ФޤС¹ԤƤʤ硢ƥֲޤ\fIendpointType\fRͤꤵƤʤ硢СORBȤ˴ϢդƤplainפޤnon\-protectedפΥɥݥȤ֤ޤ +登録されたサーバーで作成したすべてのORBの特定のタイプについてエンドポイント(ポート)を検出します。サーバーが実行されていない場合、アクティブ化されます。\fIendpointType\fR値が指定されていない場合、サーバーのORBごとに関連付けられているplainタイプまたはnon\-protectedタイプのエンドポイントが返されます。 .RE .PP locateperorb \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR [ \-orbid \fIORB\-name\fR ] .RS 4 -Ͽ줿СObject Request Broker (ORB)Ͽ줿ɥݥ(ݡ)򸡽ФޤС¹ԤƤʤ硢ƥֲޤ\fIorbid\fRꤵƤʤ硢ǥեͤ\fI""\fR\fIorbid\fR˳ƤޤORBʸ\fIorbid\fRǺƤ硢ϿݡȤ٤֤ޤ +登録されたサーバーの特定のObject Request Broker (ORB)で登録されたエンドポイント(ポート)を検出します。サーバーが実行されていない場合、アクティブ化されます。\fIorbid\fRが指定されていない場合、デフォルト値の\fI""\fRが\fIorbid\fRに割り当てられます。ORBが空文字列の\fIorbid\fRで作成されている場合、登録したポートがすべて返されます。 .RE .PP orblist \-serverid \fIserver\-id\fR | \-applicationName \fIapplication\-name\fR .RS 4 -С줿ORB\fIORBId\fRɽޤ\fIORBId\fRϥСǺ줿ORBʸ̾ǤС¹ԤƤʤ硢ƥֲޤ +サーバー上に定義されたORBの\fIORBId\fRを一覧表示します。\fIORBId\fRはサーバーで作成されたORBの文字列名です。サーバーが実行されていない場合、アクティブ化されます。 .RE .PP shutdown \-serverid \fIserver\-id\fR | \-applicationName application\-name .RS 4 -ORBDϿ줿ƥ֤ʥСߤޤΥޥɤμ¹ˡ\fI\-serverid\fRѥ᡼ޤ\fI\-applicationName\fRѥ᡼ǻꤵ줿饹줿\fIshutdown\fR᥽åɤƤӽФƥСץߤޤ +ORBDに登録されたアクティブなサーバーを停止します。このコマンドの実行中に、\fI\-serverid\fRパラメータまたは\fI\-applicationName\fRパラメータで指定されたクラス内に定義された\fIshutdown\fRメソッドも呼び出されてサーバー・プロセスを停止します。 .RE .PP startup \-serverid \fIserver\-id\fR | \-applicationName application\-name .RS 4 -ORBDϿ줿СưޤϥƥֲޤС¹ԤƤʤ硢ΥޥɤСưޤСǤ˼¹ԤƤϡ顼åɽޤ +ORBDに登録されたサーバーを起動またはアクティブ化します。サーバーが実行されていない場合、このコマンドがサーバーを起動します。サーバーがすでに実行されている場合は、エラー・メッセージが表示されます。 .RE .PP help .RS 4 -\fIservertool\fRޥɤ𤷤ƥСѤǤ뤹٤ƤΥޥɤꥹȤޤ +\fIservertool\fRコマンドを介してサーバーが利用できるすべてのコマンドをリストします。 .RE .PP quit .RS 4 -\fIservertool\fRޥɤλޤ +\fIservertool\fRコマンドを終了します。 .RE -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 b/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 index 7a924315f3b..65c2558748b 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: tnameserv .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java IDLRMI-IIOPġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java IDLおよびRMI-IIOPツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "tnameserv" "1" "2013ǯ1121" "JDK 8" "Java IDLRMI-IIOPġ" +.TH "tnameserv" "1" "2013年11月21日" "JDK 8" "Java IDLおよびRMI-IIOPツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -tnameserv \- 󥿥ե(IDL) -.SH "" +tnameserv \- インタフェース定義言語(IDL)。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,27 +64,27 @@ tnameserv \- .PP \-ORBInitialPort \fInameserverport\fR .RS 4 -͡ߥ󥰡ӥORB\fIresolve_initial_references\fR᥽åɤ\fIlist_initial_references\fR᥽åɤμ˻Ѥ֡ȥȥåסץȥꥹ˥󥰤ݡȤǤ +ネーミング・サービスがORBの\fIresolve_initial_references\fRメソッドと\fIlist_initial_references\fRメソッドの実装に使用するブートストラップ・プロトコルをリスニングする初期ポートです。 .RE -.SH "" +.SH "説明" .PP -Java IDLˤϡObject Request Broker Daemon (ORBD)ޤޤޤORBDϡ֡ȥȥåסӥ͡ߥ󥰡ӥ³͡ߥ󥰡ӥӥСޥ͡ޤǡ󡦥ץǤJava IDLΤ٤ƤΥ塼ȥꥢǤORBDѤƤޤ͡ߥ󥰡ӥѤǤϡ\fIorbd\fRΤ\fItnameserv\fRѤǤޤ +Java IDLには、Object Request Broker Daemon (ORBD)が含まれます。ORBDは、ブートストラップ・サービス、一時ネーミング・サービス、永続ネーミング・サービスおよびサーバー・マネージャを含むデーモン・プロセスです。Java IDLのすべてのチュートリアルではORBDを使用していますが、一時ネーミング・サービスを使用する例では、\fIorbd\fRのかわりに\fItnameserv\fRを使用できます。 .PP -http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlˤ -orbd(1)ޤϡNaming Serviceפ򻲾ȤƤ +http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/jidlNaming\&.htmlにある +orbd(1)または「Naming Service」を参照してください。 .PP -CORBACOS (Common Object Services)͡ߥ󥰡ӥϡե롦ƥबեФƥǥ쥯ȥ깽¤󶡤ƤΤƱ褦ˡ֥ȻȤФƥĥ꡼¤Υǥ쥯ȥ󶡤ޤJava IDLΰ͡ࡦӥǤ\fItnameserv\fRϡCOS͡ࡦӥλͤñʷǼΤǤ +CORBAのCOS (Common Object Services)ネーミング・サービスは、ファイル・システムがファイルに対してディレクトリ構造を提供しているのと同じように、オブジェクト参照に対してツリー構造のディレクトリを提供します。Java IDLの一時ネーム・サービスである\fItnameserv\fRは、COSネーム・サービスの仕様を単純な形で実装したものです。 .PP -֥ȻȤϥ͡ॹڡ̾dzǼ졢֥ȻȤ̾Υڥϡ줾͡ࡦХǥ󥰤ȸƤФޤ͡ࡦХǥ󥰤ϥ͡ߥ󥰡ƥȤȤ߹ळȤǤޤ͡ߥ󥰡ƥȤϥ͡ࡦХǥ󥰤Ǥꡢե롦ƥΥ֥ǥ쥯ȥƱǽޤ٤ƤΥХǥ󥰤Ͻ͡ߥ󥰡ƥȤβ˳Ǽޤ͡ߥ󥰡ƥȤϡ͡ॹڡͣα³Хǥ󥰤ǤJava IDL͡ߥ󥰡ӥץߤƺƵưȡĤΥ͡ॹڡϼޤ +オブジェクト参照はネームスペースに名前で格納され、オブジェクト参照と名前のペアは、それぞれネーム・バインディングと呼ばれます。ネーム・バインディングはネーミング・コンテキストに組み込むことができます。ネーミング・コンテキストはネーム・バインディングであり、ファイル・システムのサブディレクトリと同じ編成機能を持ちます。すべてのバインディングは初期ネーミング・コンテキストの下に格納されます。初期ネーミング・コンテキストは、ネームスペースの唯一の永続バインディングです。Java IDLネーミング・サービス・プロセスを停止して再起動すると、残りのネームスペースは失われます。 .PP -ץåȤޤϥץꥱ󤫤COS͡ߥ󥰡ӥѤ뤿ˤϡORB͡ߥ󥰡ӥưƤۥȤΥݡȤΤäƤ뤫Υ͡ߥ󥰡ӥν͡ߥ󥰡ƥʸ˥Ǥɬפޤ͡ࡦӥϡJava IDLΥ͡ࡦӥǤ⤽¾COSΥ͡ࡦӥǤ⤫ޤޤ -.SS "͡ߥ󥰡ӥεư" +アプレットまたはアプリケーションからCOSネーミング・サービスを使用するためには、そのORBがネーミング・サービスが動作しているホストのポートを知っているか、そのネーミング・サービスの初期ネーミング・コンテキスト文字列にアクセスできる必要があります。ネーム・サービスは、Java IDLのネーム・サービスでもその他のCOS準拠のネーム・サービスでもかまいません。 +.SS "ネーミング・サービスの起動" .PP -Java IDL͡ࡦӥϡ͡ࡦӥѤ륢ץꥱޤϥץåȤ˵ưƤɬפޤJava IDLʤ򥤥󥹥ȡ뤹ȡJava IDL͡ߥ󥰡ӥư륹ץ(Oracle Solaris: -\fItnameserv\fR)ޤϼ¹Բǽե(Windows: -\fItnameserv\&.exe\fR)ޤХå饦ɤư褦ˡ͡ࡦӥưƤ +Java IDLネーム・サービスは、ネーム・サービスを使用するアプリケーションまたはアプレットより前に起動しておく必要があります。Java IDL製品をインストールすると、Java IDLネーミング・サービスを起動するスクリプト(Oracle Solaris: +\fItnameserv\fR)または実行可能ファイル(Windows: +\fItnameserv\&.exe\fR)が作成されます。バックグラウンドで動作するように、ネーム・サービスを起動してください。 .PP -ä˻ꤷʤ硢Java IDL͡ߥ󥰡ӥϡORB\fIresolve_initial_references\fR᥽åɤ\fIlist_initial_references methods\fR᥽åɤμ˻Ѥ֡ȥȥåסץȥФƥݡ900ǥꥹ˥󥰤ޤ +特に指定しない場合、Java IDLネーミング・サービスは、ORBの\fIresolve_initial_references\fRメソッドと\fIlist_initial_references methods\fRメソッドの実装に使用するブートストラップ・プロトコルに対してポート900でリスニングします。 .sp .if n \{\ .RS 4 @@ -96,7 +96,7 @@ tnameserv \-ORBInitialPort nameserverport& .RE .\} .PP -͡ࡦСݡȤꤷʤ硢ǥեȤǥݡ900ѤޤOracle Solarisեȥμ¹Ի1024꾮ݡȤǥץ򳫻Ϥϡroot桼ˤʤɬפޤΤᡢ1024ʾΥݡֹѤ뤳Ȥᤷޤ1050Τ褦̤ΥݡȤꤷ͡ࡦӥХå饦ɤǼ¹ԤˤϡUNIXޥɡǼΤ褦Ϥޤ +ネーム・サーバー・ポートを指定しない場合、デフォルトでポート900が使用されます。Oracle Solarisソフトウェアの実行時、1024より小さいポートでプロセスを開始する場合は、rootユーザーになる必要があります。このため、1024以上のポート番号を使用することをお薦めします。1050のように別のポートを指定し、ネーム・サービスをバックグラウンドで実行するには、UNIXコマンド・シェルで次のように入力します。 .sp .if n \{\ .RS 4 @@ -108,7 +108,7 @@ tnameserv \-ORBInitialPort 1050& .RE .\} .PP -WindowsMS\-DOSƥࡦץץȤǤϡΤ褦Ϥޤ +WindowsのMS\-DOSシステム・プロンプトでは、次のように入力します。 .sp .if n \{\ .RS 4 @@ -120,20 +120,20 @@ start tnameserv \-ORBInitialPort 1050 .RE .\} .PP -͡ࡦСΥ饤ȤˤϡݡֹΤ餻ɬפޤԤˤϡORB֥Ȥκ\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRץѥƥ˿ݡֹꤷޤ -.SS "ۤʤۥȾǤΥСȥ饤Ȥμ¹" +ネーム・サーバーのクライアントには、新しいポート番号を知らせる必要があります。これを行うには、ORBオブジェクトの作成時に\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティに新しいポート番号を設定します。 +.SS "異なるホスト上でのサーバーとクライアントの実行" .PP -Java IDLRMI\-IIOPΤۤȤɤΥ塼ȥꥢǤϡ͡ߥ󥰡ӥСӥ饤ȤϤ٤ƳȯѤΥޥǼ¹Ԥޤºݤ˥ǥץȤˤϡ饤ȤȥС򡢥͡ߥ󥰡ӥȤϰۤʤۥȡޥǼ¹Ԥ뤳Ȥ¿ʤޤ +Java IDLとRMI\-IIOPのほとんどのチュートリアルでは、ネーミング・サービス、サーバーおよびクライアントはすべて開発用のマシン上で実行されます。実際にデプロイメントする場合には、クライアントとサーバーを、ネーミング・サービスとは異なるホスト・マシン上で実行することが多くなります。 .PP -饤ȤȥС͡ࡦӥ򸫤Ĥˤϡ饤ȤȥС͡ࡦӥ¹ԤƤݡȤֹȥۥȤǧƤɬפޤΤˤϡ饤ȤȥСΥե\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRץѥƥ\fIorg\&.omg\&.CORBA\&.ORBInitialHost\fRץѥƥ͡ࡦӥ¹ԤƤݡȤֹȥޥ̾ꤷޤϡGetting Started Using RMI\-IIOP -(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi\-iiop/rmiiiopexample\&.html)˼Ƥޤ +クライアントとサーバーがネーム・サービスを見つけるには、クライアントとサーバーが、ネーム・サービスが実行されているポートの番号とホストを認識している必要があります。そのためには、クライアントとサーバーのファイル内の\fIorg\&.omg\&.CORBA\&.ORBInitialPort\fRプロパティと\fIorg\&.omg\&.CORBA\&.ORBInitialHost\fRプロパティをネーム・サービスが実行されているポートの番号とマシンの名前に設定します。この例は、「Getting Started Using RMI\-IIOP」 +(http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/rmi\-iiop/rmiiiopexample\&.html)に示されています .PP -ޥɥ饤󡦥ץ\fI\-ORBInitialPort nameserverport#\fR\fI\-ORBInitialHost nameserverhostname\fRѤơ饤ȤȥСФƥ͡ߥ󥰡ӥõꤹ뤳ȤǤޤޥɥ饤󡦥ץѤƤԤˡ1Ĥϡhttp://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.htmlΡJava IDL: The Hello World Example on Two Machines -򻲾ȤƤ +コマンドライン・オプション\fI\-ORBInitialPort nameserverport#\fRと\fI\-ORBInitialHost nameserverhostname\fRを使用して、クライアントとサーバーに対してネーミング・サービスを探す場所を指定することもできます。コマンドライン・オプションを使用してこれを行う方法の1つの例は、http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/tutorial/jidl2machines\&.htmlの「Java IDL: The Hello World Example on Two Machines」 +を参照してください .PP -ȤС͡ࡦӥ\fItnameserv\fRۥ\fInameserverhost\fRΥݡ1050Ǽ¹ԤƤȤޤˡ饤Ȥۥ\fIclienthost\fRǼ¹Ԥ졢Сϥۥ\fIserverhost\fRǼ¹ԤƤȤޤ +たとえば、一時ネーム・サービス\fItnameserv\fRが、ホスト\fInameserverhost\fRのポート1050上で実行されているとします。さらに、クライアントがホスト\fIclienthost\fR上で実行され、サーバーはホスト\fIserverhost\fR上で実行されているとします。 .PP -ۥ\fInameserverhost\fR\fItnameserv\fRưޤ +ホスト\fInameserverhost\fR上で\fItnameserv\fRを起動します。 .sp .if n \{\ .RS 4 @@ -145,7 +145,7 @@ tnameserv \-ORBInitialPort 1050 .RE .\} .PP -\fIserverhost\fRǥСưޤ +\fIserverhost\fR上でサーバーを起動します。 .sp .if n \{\ .RS 4 @@ -158,7 +158,7 @@ java Server \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost .\} .PP -\fIclienthost\fRǥ饤Ȥưޤ +\fIclienthost\fR上でクライアントを起動します。 .sp .if n \{\ .RS 4 @@ -169,19 +169,19 @@ java Client \-ORBInitialPort 1050 \-ORBInitialHost nameserverhost .if n \{\ .RE .\} -.SS "͡ߥ󥰡ӥ" +.SS "ネーミング・サービスの停止" .PP -Java IDL͡ߥ󥰡ӥߤˤϡUnixξϡ\fIkill\fRʤɤΥڥ졼ƥ󥰡ƥΥޥɤѤWindowsξϡ\fI[Ctrl]+[C]\fRѤޤ͡ߥ󥰡ӥŪߤޤǤϡƽФԵ֤³ޤӥλȡJava IDL͡ࡦӥϿƤ̾ϼޤ -.SH "ץ" +Java IDLネーミング・サービスを停止するには、Unixの場合は、\fIkill\fRなどのオペレーティング・システムのコマンドを使用し、Windowsの場合は、\fI[Ctrl]+[C]\fRキーを使用します。ネーミング・サービスを明示的に停止するまでは、呼出し待機状態が続きます。サービスを終了させると、Java IDLネーム・サービスに登録されている名前は失われます。 +.SH "オプション" .PP \-J\fIoption\fR .RS 4 -Javaۥޥ\fIoption\fRϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンに\fIoption\fRを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" -.SS "͡ॹڡؤΥ֥Ȥɲ" +.SH "例" +.SS "ネームスペースへのオブジェクトの追加" .PP -Ǥϡ͡ॹڡ̾ɲäˡ򼨤ޤΥץ롦ץϡΤޤޤξ֤Ǵư͡ࡦӥ饤ȤǡΤ褦ñʥĥ꡼ΤǤ +次の例では、ネームスペースに名前を追加する方法を示します。このサンプル・プログラムは、このままの状態で完全に動作する一時ネーム・サービス・クライアントで、次のような単純なツリーを作成するものです。 .sp .if n \{\ .RS 4 @@ -197,7 +197,7 @@ Initial Naming Context .RE .\} .PP -ǡ\fIplans\fRϥ֥Ȼȡ\fIPersonal\fR\fIcalendar\fR\fIschedule\fR2ĤΥ֥ȻȤޤ͡ߥ󥰡ƥȤǤ +この例で、\fIplans\fRはオブジェクト参照、\fIPersonal\fRは\fIcalendar\fRと\fIschedule\fRの2つのオブジェクト参照を含むネーミング・コンテキストです。 .sp .if n \{\ .RS 4 @@ -217,7 +217,7 @@ public class NameClient { .RE .\} .PP -͡ߥ󥰡ӥεưǡ\fInameserver\fRϥݡ1050ǵưޤΥɤǡΥݡֹ򥯥饤ȡƥΤ餻ޤ +ネーミング・サービスの起動で、\fInameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 .sp .if n \{\ .RS 4 @@ -231,7 +231,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ͡ߥ󥰡ƥȤ\fIctx\fRޤ2ܤǤϡ\fIctx\fRߡΥ֥Ȼ\fIobjref\fR˥ԡޤobjrefˤϡȤ̾͡Ƥƥ͡ॹڡɲäޤ +次のコードでは、初期ネーミング・コンテキストを取得し、それを\fIctx\fRに代入します。2行目では、\fIctx\fRをダミーのオブジェクト参照\fIobjref\fRにコピーします。このobjrefには、あとで様々な名前を割り当ててネームスペースに追加します。 .sp .if n \{\ .RS 4 @@ -246,7 +246,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ\fItext\fRפ̾\fIplans\fRߡΥ֥ȻȤ˥Хɤޤθ塢\fIrebind\fR᥽åɤѤƽ͡ߥ󥰡ƥȤβ\fIplans\fRɲäƤޤ\fIrebind\fR᥽åɤѤС\fIbind\fR᥽åɤѤȯ㳰ȯˡΥץ٤֤ⷫ¹ԤǤޤ +次のコードでは、\fItext\fRタイプの名前\fIplans\fRを作成し、それをダミーのオブジェクト参照にバインドします。その後、\fIrebind\fRメソッドを使用して初期ネーミング・コンテキストの下に\fIplans\fRを追加しています。\fIrebind\fRメソッドを使用すれば、\fIbind\fRメソッドを使用した場合に発生する例外を発生させずに、このプログラムを何度も繰返し実行できます。 .sp .if n \{\ .RS 4 @@ -261,7 +261,7 @@ public class NameClient { .RE .\} .PP -ΥɤǤϡ\fIdirectory\fRפ\fIPersonal\fRȤ͡ߥ󥰡ƥȤޤη륪֥Ȼ\fIctx2\fR\fIname\fR˥Хɤ͡ߥ󥰡ƥȤɲäޤ +次のコードでは、\fIdirectory\fRタイプの\fIPersonal\fRというネーミング・コンテキストを作成します。その結果得られるオブジェクト参照\fIctx2\fRを\fIname\fRにバインドし、初期ネーミング・コンテキストに追加します。 .sp .if n \{\ .RS 4 @@ -276,7 +276,7 @@ public class NameClient { .RE .\} .PP -ĤΥɤǤϡߡΥ֥ȻȤ\fIschedule\fR\fIcalendar\fRȤ̾ǥ͡ߥ󥰡ƥ\fIPersonal\fR(\fIctx2\fR)˥Хɤޤ +残りのコードでは、ダミーのオブジェクト参照を\fIschedule\fRと\fIcalendar\fRという名前でネーミング・コンテキスト\fIPersonal\fR(\fIctx2\fR)にバインドします。 .sp .if n \{\ .RS 4 @@ -300,9 +300,9 @@ public class NameClient { .if n \{\ .RE .\} -.SS "͡ॹڡλ" +.SS "ネームスペースの参照" .PP -Υץ롦ץǤϡ͡ॹڡ֥饦ˡ򼨤ޤ +次のサンプル・プログラムでは、ネームスペースをブラウズする方法を示します。 .sp .if n \{\ .RS 4 @@ -322,7 +322,7 @@ public class NameClientList { .RE .\} .PP -͡ߥ󥰡ӥεưǡ\fInameserver\fRϥݡ1050ǵưޤΥɤǡΥݡֹ򥯥饤ȡƥΤ餻ޤ +ネーミング・サービスの起動で、\fInameserver\fRはポート1050で起動されました。次のコードで、このポート番号をクライアント・システムに知らせます。 .sp .if n \{\ .RS 4 @@ -336,7 +336,7 @@ public class NameClientList { .RE .\} .PP -ΥɤǤϡ͡ߥ󥰡ƥȤƤޤ +次のコードでは、初期ネーミング・コンテキストを取得しています。 .sp .if n \{\ .RS 4 @@ -350,7 +350,7 @@ public class NameClientList { .RE .\} .PP -\fIlist\fR᥽åɤϡ͡ߥ󥰡ƥȤΥХǥ󥰤ꥹȤޤξ硢1000ĤޤǤΥХǥ󥰤͡ߥ󥰡ƥȤ\fIBindingListHolder\fR֤ޤĤΥХǥ󥰤ϡ\fIBindingIteratorHolder\fR֤ޤ +\fIlist\fRメソッドは、ネーミング・コンテキストのバインディングをリストします。この場合、最大1000個までのバインディングが初期ネーミング・コンテキストから\fIBindingListHolder\fRに返されます。残りのバインディングは、\fIBindingIteratorHolder\fRに返されます。 .sp .if n \{\ .RS 4 @@ -364,7 +364,7 @@ public class NameClientList { .RE .\} .PP -ΥɤǤϡ֤줿\fIBindingListHolder\fRХǥ󥰤ޤХǥ󥰤ʤϡץबλޤ +次のコードでは、返された\fIBindingListHolder\fRからバインディングの配列を取得します。バインディングがない場合は、プログラムが終了します。 .sp .if n \{\ .RS 4 @@ -377,7 +377,7 @@ public class NameClientList { .RE .\} .PP -ĤΥɤǤϡХǥ󥰤Фƥ롼׽Ԥ̾Ϥޤ +残りのコードでは、バインディングに対してループ処理を行い、名前を出力します。 .sp .if n \{\ .RS 4 @@ -408,7 +408,7 @@ public class NameClientList { .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 b/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 index 0b940d494d2..b782c674152 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: unpack200 .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Javaǥץȡġ +.\" Date: 2013年11月21日 +.\" SectDesc: Javaデプロイメント・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "unpack200" "1" "2013ǯ1121" "JDK 8" "Javaǥץȡġ" +.TH "unpack200" "1" "2013年11月21日" "JDK 8" "Javaデプロイメント・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -unpack200 \- pack200(1)Ǻ줿ѥåեWebǥץȤΤJARեѴޤ -.SH "" +unpack200 \- pack200(1)で作成されたパック・ファイルを、WebデプロイメントのためにJARファイルに変換します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,21 +64,21 @@ unpack200 \- pack200(1) .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIinput\-file\fR .RS 4 -ϥե̾pack200 gzipե뤫pack200եǤޤϥեˤϡ\fIpack200\fR(1)Ǻ줿JARեꤹ뤳ȤǤޤ(֤\fI0\fRǤ)ξ硢ϥեƤPack2000ޡǽJARե˥ԡޤ +入力ファイルの名前。pack200 gzipファイルかpack200ファイルを指定できます。入力ファイルには、\fIpack200\fR(1)で作成されたJARファイルを指定することもできます(手間は\fI0\fRです)。この場合、入力ファイルの内容はPack2000マーカーで出力JARファイルにコピーされます。 .RE .PP \fIJAR\-file\fR .RS 4 -JARե̾ +出力JARファイル名。 .RE -.SH "" +.SH "説明" .PP -\fIunpack200\fRޥɤϡ\fIpack200\fR\fI(1)\fRǺ줿ѥåեJARեѴͥƥּǤŪʻˡϼΤȤǤǤϡǥեȤ\fIunpack200\fRޥǡ\fImyarchive\&.jar\fRե뤬\fImyarchive\&.pack\&.gz\fRޤ +\fIunpack200\fRコマンドは、\fIpack200\fR\fI(1)\fRで作成されたパック・ファイルをJARファイルに変換するネイティブ実装です。一般的な使用方法は次のとおりです。次の例では、デフォルトの\fIunpack200\fRコマンド設定で、\fImyarchive\&.jar\fRファイルが\fImyarchive\&.pack\&.gz\fRから作成されます。 .sp .if n \{\ .RS 4 @@ -89,56 +89,56 @@ unpack200 myarchive\&.pack\&.gz myarchive\&.jar .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-Hvalue \-\-deflate\-hint=\fIvalue\fR .RS 4 -JARեΤ٤ƤΥȥ\fItrue\fR\fIfalse\fRޤ\fIkeep\fRΥǥե졼ꤷޤǥեȡ⡼ɤ\fIkeep\fRǤͤ\fItrue\fRޤ\fIfalse\fR硢\fI\-\-deflate=hint\fRץϥǥեȤư򥪡С饤ɤơJARեΤ٤ƤΥȥΥǥե졼󡦥⡼ɤꤵޤ +JARファイル内のすべてのエントリに\fItrue\fR、\fIfalse\fRまたは\fIkeep\fRのデフレーションを設定します。デフォルト・モードは\fIkeep\fRです。値が\fItrue\fRまたは\fIfalse\fR場合、\fI\-\-deflate=hint\fRオプションはデフォルトの動作をオーバーライドして、出力JARファイル内のすべてのエントリのデフレーション・モードが設定されます。 .RE .PP \-r \-\-remove\-pack\-file .RS 4 -ϥѥåեޤ +入力パック・ファイルを削除します。 .RE .PP \-v \-\-verbose .RS 4 -Ǿ¤ΥåɽޤΥץʣλͤˤϡܺ٤ʥåɽޤ +最小限のメッセージが表示されます。このオプションの複数の仕様には、より詳細なメッセージが表示されます。 .RE .PP \-q \-\-quiet .RS 4 -åɽư褦˻ꤷޤ +メッセージを表示せずに動作するように指定します。 .RE .PP \-lfilename \-\-log\-file=\fIfilename\fR .RS 4 -ϥåϿեꤷޤ +出力メッセージが記録されるログ・ファイルを指定します。 .RE .PP \-? \-h \-\-help .RS 4 -\fIunpack200\fRޥɤ˴ؤإ׾Ϥޤ +\fIunpack200\fRコマンドに関するヘルプ情報を出力します。 .RE .PP \-V \-\-version .RS 4 -\fIunpack200\fRޥɤ˴ؤСϤޤ +\fIunpack200\fRコマンドに関するバージョン情報を出力します。 .RE .PP \-J\fIoption\fR .RS 4 -JavaۥޥoptionϤޤ\fIoption\fRˤϡJavaץꥱưġΥե󥹡ڡ˵ܤƤ륪ץ1ĻꤷޤȤС\fI\-J\-Xms48m\fRȻꤹȡȥåס꡼48MBꤵޤjava(1)򻲾ȤƤ +Java仮想マシンにoptionを渡します。\fIoption\fRには、Javaアプリケーション起動ツールのリファレンス・ページに記載されているオプションを1つ指定します。たとえば、\fI\-J\-Xms48m\fRと指定すると、スタートアップ・メモリーは48MBに設定されます。java(1)を参照してください。 .RE -.SH "" +.SH "注意" .PP -Υޥɤ\fIunpack\fRޥɤƱʤǤʤǤ +このコマンドと\fIunpack\fRコマンドを混同しないでください。これらは別製品です。 .PP -JDK°Java SE APIͤȤ㤬Ĥäˤϡͤͥ褷Ƥ -.SH "λơ" +JDKに付属するJava SE API仕様との相違が見つかった場合には、仕様を優先してください。 +.SH "終了ステータス" .PP -νλ֤ͤޤ: ェλξ0顼ȯ0礭͡ -.SH "Ϣ" +次の終了値が返されます: 正常終了の場合は0、エラーが発生した場合は0より大きい値。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -181,7 +181,7 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -Pack200 and Compression +「Pack200 and Compression」 (http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/deployment/deployment\-guide/pack200\&.html) .RE .sp @@ -193,7 +193,7 @@ jarsigner(1) .sp -1 .IP \(bu 2.3 .\} -Java SE Technical Documentation +「Java SE Technical Documentation」 (http://docs\&.oracle\&.com/javase/) .RE .br diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 b/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 index 0f50de81de0..a7b0db1d6e5 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: wsgen .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "wsgen" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "wsgen" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -wsgen \- WebӥΥɥݥȼ(SEI)饹ɼꡢWebӥΥǥץȤȸƽФɬפʤ٤ƤΥƥեȤޤ -.SH "" +wsgen \- Webサービスのエンドポイント実装(SEI)クラスを読取り、Webサービスのデプロイメントと呼出しに必要なすべてのアーティファクトを生成します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,20 +64,20 @@ wsgen \- Web .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fISEI\fR .RS 4 -ɤ߼WebӥΥɥݥȼ饹(SEI)Ǥ +読み取るWebサービスのエンドポイント実装クラス(SEI)です。 .RE -.SH "" +.SH "説明" .PP -\fIwsgen\fRޥɤϡJAX\-WS WebӥǻѤJAX\-WSݡ֥롦ƥեȤޤΥġϡWebӥΥɥݥȡ饹ɼꡢWebӥΥǥץȤȸƽФɬפʤ٤ƤΥƥեȤޤJAXWS 2\&.1\&.1 RIǤ\fIwsgen\fR -Ant󶡤ޤ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlJAX\-WS (wsgen)ڡTools֤򻲾ȤƤ +\fIwsgen\fRコマンドは、JAX\-WS Webサービスで使用されるJAX\-WSポータブル・アーティファクトを生成します。このツールは、Webサービスのエンドポイント・クラスを読取り、Webサービスのデプロイメントと呼出しに必要なすべてのアーティファクトを生成します。JAXWS 2\&.1\&.1 RIでは\fIwsgen\fR +Antタスクも提供されます。 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlのJAX\-WS (wsgen)ページのToolsタブを参照してください。 .PP -\fIwsgen\fRޥɤưˤϡԤޤ +\fIwsgen\fRコマンドを起動するには、次を行います。 .sp .if n \{\ .RS 4 @@ -89,79 +89,79 @@ $JAXWS_HOME/bin/wsgen\&.sh \-help .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-classpath \fIpath\fR .RS 4 -ϥ饹եξꡣ +入力クラス・ファイルの場所。 .RE .PP \-cp \fIpath\fR .RS 4 -ϥ饹եξꡣ +入力クラス・ファイルの場所。 .RE .PP \-d \fIdirectory\fR .RS 4 -줿ϥեǼꡣ +生成された出力ファイルを格納する場所。 .RE .PP \-extension .RS 4 -٥ĥѲǽˤޤĥѤȡץꥱΰܿ줿ꡢ¾μϢȤǤʤʤǽޤ +ベンダー拡張を使用可能にします。拡張を使用すると、アプリケーションの移植性が失われたり、他の実装と連携できなくなる可能性があります。 .RE .PP \-help .RS 4 -\fIwsgen\fRޥɤ˴ؤإסåɽޤ +\fIwsgen\fRコマンドに関するヘルプ・メッセージを表示します。 .RE .PP \-keep .RS 4 -줿ե¸ޤ +生成されたファイルを保存します。 .RE .PP \-r \fIdirectory\fR .RS 4 -Υץ\fI\-wsdl\fRץȤȤ˻ѤơWSDLʤ줿꥽ե֤ꤷޤ +このオプションを\fI\-wsdl\fRオプションとともに使用して、WSDLなど生成されたリソース・ファイルを配置する場所を指定します。 .RE .PP \-s \fIdirectory\fR .RS 4 -줿եǼꡣ +生成されたソース・ファイルを格納する場所。 .RE .PP \-verbose .RS 4 -ѥ顦åɽޤ +コンパイラ・メッセージを表示します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-wsdl [ :protocol ] .RS 4 -ɥݥȤǥץ˳ǧWSDLե륪ץ󡦥ޥɡWSDLեˤϡӥƤӽФˡѥ᡼ɬפ֤͡ǡ¤ˤĤƤΥԥ塼ɼǽʵҤޤޤޤ +エンドポイントをデプロイする前に確認するWSDLファイルを生成するオプション・コマンド。WSDLファイルには、サービスを呼び出す方法、パラメータに必要な値、返されるデータ構造についてのコンピュータで読取り可能な記述が含まれます。 .sp -ǥեȤǤ\fIwsgen\fRޥɤWSDLեޤ\fIprotocol\fRͤϾάǽǤꡢWSDLХǥ(\fIwsdl:binding\fR)ǻѤץȥꤹ뤿˻Ѥޤͭʥץȥϡ\fIsoap1\&.1\fR\fIXsoap1\&.2\fRǤǥեȤ\fIsoap1\&.1\fRǤ\fIXsoap1\&.2\fRץȥɸǤϤʤᡢ\fI\-extension\fRץȤȤˤΤ߻ѲǽǤ +デフォルトでは\fIwsgen\fRコマンドはWSDLファイルを生成しません。\fIprotocol\fR値は省略可能であり、WSDLバインディング(\fIwsdl:binding\fR)で使用するプロトコルを指定するために使用されます。有効なプロトコルは、\fIsoap1\&.1\fRと\fIXsoap1\&.2\fRです。デフォルトは\fIsoap1\&.1\fRです。\fIXsoap1\&.2\fRプロトコルは標準ではないため、\fI\-extension\fRオプションとともにのみ使用可能です。 .RE .PP \-servicename \fIname\fR .RS 4 -\fI\-wsdl\fRץȤȤˤΤ߻ѤơWSDLWSDLӥ(\fIwsdl:service\fR)̾ꤷޤ: -\fI\-servicename "{http://mynamespace/}MyService"\fR +\fI\-wsdl\fRオプションとともにのみ使用して、WSDLで生成される特定のWSDLサービス(\fIwsdl:service\fR)名を指定します。例: +\fI\-servicename "{http://mynamespace/}MyService"\fR。 .RE .PP \-portname \fIname\fR .RS 4 -\fI\-wsdl\fRץȤȤˤΤ߻ѤơWSDLWSDLݡ(\fIwsdl:port\fR)̾ꤷޤ: -\fI\-portname "{http://mynamespace/}MyPort"\fR +\fI\-wsdl\fRオプションとともにのみ使用して、WSDLで生成される特定のWSDLポート(\fIwsdl:port\fR)名を指定します。例: +\fI\-portname "{http://mynamespace/}MyPort"\fR。 .RE -.SH "" +.SH "例" .PP -ǤϡStockǥ쥯ȥ\fI@WebService\fR\fIStockService\fRΥåѡ饹ޤ +次の例では、Stockディレクトリ内に\fI@WebService\fR注釈を持つ\fIStockService\fRのラッパー・クラスを生成します。 .sp .if n \{\ .RS 4 @@ -173,7 +173,7 @@ wsgen \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -ǤϡSOAP 1\&.1 WSDL\fI@WebService\fR\fIstock\&.StockService\fR饹Υޤޤ +次の例では、SOAP 1\&.1 WSDLおよび\fI@WebService\fR注釈を持つ\fIstock\&.StockService\fRクラスのスキーマを生成します。 .sp .if n \{\ .RS 4 @@ -185,7 +185,7 @@ wsgen \-wsdl \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -ǤϡSOAP 1\&.2 WSDLޤ +次の例では、SOAP 1\&.2 WSDLを生成します。 .sp .if n \{\ .RS 4 @@ -197,9 +197,9 @@ wsgen \-wsdl:Xsoap1\&.2 \-d stock \-cp myclasspath stock\&.StockService .RE .\} .PP -\fB:\fR -ӥΥǥץJAXWS¹ԻĶWSDL뤿ᡢȯWSDLɬפϤޤ -.SH "Ϣ" +\fB注意:\fR +サービスのデプロイ時にJAXWS実行時環境でWSDLが生成されるため、開発時にWSDLを生成する必要はありません。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -220,8 +220,8 @@ wsimport(1) .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.html -JAX\-WS (wsgen)ڡTools֤򻲾ȤƤ +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsgenant\&.htmlの +JAX\-WS (wsgen)ページのToolsタブを参照してください。 .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 b/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 index feff3f3acca..00d41d2041e 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: wsimport .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "wsimport" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "wsimport" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -wsimport \- Webץꥱ󡦥(WAR)ե˥ѥåǤJAX\-WSݡ֥롦ƥեȤơAntꤷޤ -.SH "" +wsimport \- Webアプリケーション・アーカイブ(WAR)ファイルにパッケージできるJAX\-WSポータブル・アーティファクトを生成して、Antタスクを指定します。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,18 +64,18 @@ wsimport \- Web .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP \fIwsdl\fR .RS 4 -WebӥƤӽФˡѥ᡼ɬפ֤͡ǡ¤ˤĤƤΥԥ塼ɼǽʵҤޤޤޤեǤ +Webサービスを呼び出す方法、パラメータに必要な値、返されるデータ構造についてのコンピュータで読取り可能な記述が含まれまるファイルです。 .RE -.SH "" +.SH "説明" .PP -\fIwsimport\fRޥɤϡJAX\-WSݡ֥롦ƥեȤޤΥƥեȤϡǥץWSDLӥޡɥȤӥɥݥȼȤȤˡWARե˥ѥåǤޤ\fIwsimport\fRޥɤǤ\fIwsimport\fR -Ant󶡤ޤ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlWsimport Ant TaskڡTools֤򻲾ȤƤ +\fIwsimport\fRコマンドは、次のJAX\-WSポータブル・アーティファクトを生成します。これらのアーティファクトは、デプロイするWSDLおよびスキーマ・ドキュメントおよびエンドポイント実装とともに、WARファイルにパッケージできます。\fIwsimport\fRコマンドでは\fIwsimport\fR +Antタスクも提供されます。 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlのWsimport Ant TaskページのToolsタブを参照してください。 .sp .RS 4 .ie n \{\ @@ -85,7 +85,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -ӥɥݥȡ󥿥ե(SEI) +サービス・エンドポイント・インタフェース(SEI) .RE .sp .RS 4 @@ -96,7 +96,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -ӥ +サービス .RE .sp .RS 4 @@ -107,7 +107,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -㳰饹\fIwsdl:fault\fRޥåפޤ(¸ߤ) +例外クラスは\fIwsdl:fault\fRからマップされます(存在する場合) .RE .sp .RS 4 @@ -118,7 +118,7 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -Ʊ쥹ݥBeanϥ쥹ݥ\fIwsdl:message\fRޤ(¸ߤ) +非同期レスポンスBeanはレスポンス\fIwsdl:message\fRから派生します(存在する場合) .RE .sp .RS 4 @@ -129,10 +129,10 @@ http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html .sp -1 .IP \(bu 2.3 .\} -JAXBͥ(ޤΥפޥåפ줿Java饹) +JAXBが生成する値タイプ(スキーマのタイプからマップされたJavaクラス) .RE .PP -\fIwsgen\fRޥɤưˤϡԤޤ +\fIwsgen\fRコマンドを起動するには、次を行います。 .PP \fBOracle Solaris/Linux\fR: .sp @@ -146,7 +146,7 @@ JAXB .RE .\} .PP -\fBWindows\fRξ: +\fBWindows\fRの場合: .sp .if n \{\ .RS 4 @@ -157,118 +157,118 @@ JAXB .if n \{\ .RE .\} -.SH "ץ" +.SH "オプション" .PP \-d \fIdirectory\fR .RS 4 -ϥեǼꤷޤ +生成される出力ファイルを格納する場所を指定します。 .RE .PP \-b \fIpath\fR .RS 4 -JAX\-WSޤJAXBХǥ󥰡եꤷޤ\fI\-b\fRץʣJAX\-WSJAXBХǥ󥰡եǤޤΥեѤơѥå̾Bean̾ʤɤ򥫥ޥǤޤJAX\-WSJAXBХǥ󥰡եξܺ٤ϡ -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlWSDL CustomizationUsers Guide֤򻲾ȤƤ +外部JAX\-WSまたはJAXBバインディング・ファイルを指定します。\fI\-b\fRオプションで複数のJAX\-WSおよびJAXBバインディング・ファイルを指定できます。これらのファイルを使用して、パッケージ名、Bean名などをカスタマイズできます。JAX\-WSおよびJAXBバインディング・ファイルの詳細は、 +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlのWSDL CustomizationのUsers Guideタブを参照してください .RE .PP \-B \fIjaxbOption\fR .RS 4 -JAXBޡѥ\fIjaxbOption\fRץϤޤ +JAXBスキーマ・コンパイラに\fIjaxbOption\fRオプションを渡します。 .RE .PP \-catalog .RS 4 -ƥƥȤ褹륫եꤷޤ\fI\-catalog\fRץϡTR9401XCatalogOASIS XML CatalogγƷ򥵥ݡȤƤޤhttp://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.html -Catalog SupportڡUsers Guide֤򻲾ȤƤ +外部エンティティ参照を解決するカタログ・ファイルを指定します。\fI\-catalog\fRオプションは、TR9401、XCatalog、OASIS XML Catalogの各形式をサポートしています。http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.htmlの +Catalog SupportページのUsers Guideタブを参照してください。 .RE .PP \-extension .RS 4 -٥ĥѲǽˤޤĥѤȡץꥱΰܿ줿ꡢ¾μϢȤǤʤʤǽޤ +ベンダー拡張を使用可能にします。拡張を使用すると、アプリケーションの移植性が失われたり、他の実装と連携できなくなる可能性があります。 .RE .PP \-help .RS 4 -\fIwsimport\fRޥɤ˴ؤإסåɽޤ +\fIwsimport\fRコマンドに関するヘルプ・メッセージを表示します。 .RE .PP \-httpproxy: \fIhost\fR:\fIport\fR .RS 4 -HTTPץСꤷޤǥեȤ8080Ǥ +HTTPプロキシ・サーバーを指定します。デフォルトは8080です。 .RE .PP \-keep .RS 4 -줿եݻޤ +生成されたファイルを保持します .RE .PP \-p \fIname\fR .RS 4 -åȡѥå\fIname\fRꤷơWSDLӥޡХǥ󥰤Υޥӻ줿ǥեȤΥ르ꥺ򥪡С饤ɤޤ +ターゲット・パッケージ\fIname\fRを指定して、WSDLおよびスキーマ・バインディングのカスタマイズ、および仕様部で定義されたデフォルトのアルゴリズムをオーバーライドします。 .RE .PP \-s \fIdirectory\fR .RS 4 -륽եǼꤷޤ +生成されるソース・ファイルを格納する場所を指定します .RE .PP \-verbose .RS 4 -ѥ顦åɽޤ +コンパイラ・メッセージを表示します。 .RE .PP \-version .RS 4 -꡼Ϥޤ +リリース情報を出力します。 .RE .PP \-wsdllocation \fIlocation\fR .RS 4 -\fI@WebServiceClient\&.wsdlLocation\fRͤꤷޤ +\fI@WebServiceClient\&.wsdlLocation\fRの値を指定します。 .RE .PP \-target .RS 4 -ꤵ줿JAX\-WSͥС˽äơɤޤС2\&.0ǤϡJAX\-WS 2\&.0ͤ˽򤷤ɤޤ +指定されたJAX\-WS仕様バージョンに従って、コードを生成します。バージョン2\&.0では、JAX\-WS 2\&.0仕様に準拠したコードを生成します。 .RE .PP \-quiet .RS 4 -\fIwsimport\fRޥɽϤޤ +\fIwsimport\fRコマンド出力を抑制します。 .RE .PP -\fI\-b\fRץѤơʣ\fIJAX\-WS\fR\fIJAXB\fRХǥ󥰡եǤޤΥեѤơѥå̾Bean̾ʤɡ͡ʤΤ򥫥ޥǤޤ\fIJAX\-WS\fR\fIJAXB\fRХǥ󥰡եξܺ٤ϡ -https://jax\-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.htmlJAXB֤򻲾ȤƤ -.SH "ɸ४ץ" +\fI\-b\fRオプションを使用して、複数の\fIJAX\-WS\fRおよび\fIJAXB\fRバインディング・ファイルを指定できます。これらのファイルを使用して、パッケージ名やBean名など、様々なものをカスタマイズできます。\fIJAX\-WS\fRおよび\fIJAXB\fRバインディング・ファイルの詳細は、 +https://jax\-ws\&.dev\&.java\&.net/nonav/2\&.1\&.1/docs/customizations\&.htmlのJAXBタブを参照してください +.SH "非標準オプション" .PP \-XadditionalHeaders .RS 4 -ꥯȤޤϥ쥹ݥ󥹡å˥ХɤʤإåJava᥽åɤΥѥ᡼˥ޥåפޤ +リクエストまたはレスポンス・メッセージにバインドされないヘッダーをJavaメソッドのパラメータにマップします .RE .PP \-Xauthfile \fIfile\fR .RS 4 -ǧھޤեꤹWSDL URIǤURIηϼΤȤǤ +認証情報を含むファイルを指定するWSDL URIです。このURIの形式は次のとおりです。 .sp http://\fIuser\-name\fR:\fIpassword\fR@\fIhost\-name\fR/\fIweb\-service\-name\fR>?wsdl .RE .PP \-Xdebug .RS 4 -ǥХåϤޤ +デバッグ情報を出力します .RE .PP \-Xno\-addressing\-databinding .RS 4 -W3C EndpointReferenceTypeJavaΥХǥ󥰤ͭˤޤ +W3C EndpointReferenceTypeとJavaのバインディングを有効にします。 .RE .PP \-Xnocompile .RS 4 -줿Javaե򥳥ѥ뤷ޤ +生成されたJavaファイルをコンパイルしません .RE -.SH "" +.SH "例" .PP -ǤϡJavaƥեȤ\fIhttp://stockquote\&.example\&.com/quote?wsdl\fR򥤥ݡȤƥƥեȤ򥳥ѥ뤷ޤ +次の例では、Javaアーティファクトを生成し、\fIhttp://stockquote\&.example\&.com/quote?wsdl\fRをインポートしてアーティファクトをコンパイルします。 .sp .if n \{\ .RS 4 @@ -279,7 +279,7 @@ wsimport \-p stockquote http://stockquote\&.example\&.com/quote?wsdl .if n \{\ .RE .\} -.SH "Ϣ" +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -300,8 +300,8 @@ wsgen(1) .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -Wsimport Ant TaskڡTools +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlの +Wsimport Ant TaskページのToolsタブ .RE .sp .RS 4 @@ -312,8 +312,8 @@ Wsimport Ant Task .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.html -Catalog SupportڡUsers Guide +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/catalog\-support\&.htmlの +Catalog SupportページのUsers Guideタブ .RE .sp .RS 4 @@ -324,8 +324,8 @@ Catalog Support .sp -1 .IP \(bu 2.3 .\} -http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.html -WSDL CustomizationڡUsers Guide +http://jax\-ws\&.java\&.net/nonav/2\&.1\&.1/docs/wsimportant\&.htmlの +WSDL CustomizationページのUsers Guideタブ .RE .br 'pl 8.5i diff --git a/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 b/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 index 17a0efdd9ed..843ddd9475b 100644 --- a/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 +++ b/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1 @@ -2,10 +2,10 @@ .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. .\" Title: xjc .\" Language: English -.\" Date: 2013ǯ1121 -.\" SectDesc: Java Webӥġ +.\" Date: 2013年11月21日 +.\" SectDesc: Java Webサービス・ツール .\" Software: JDK 8 -.\" Arch: +.\" Arch: 汎用 .\" .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -28,7 +28,7 @@ .\" questions. .\" .pl 99999 -.TH "xjc" "1" "2013ǯ1121" "JDK 8" "Java Webӥġ" +.TH "xjc" "1" "2013年11月21日" "JDK 8" "Java Webサービス・ツール" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -49,8 +49,8 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -xjc \- XMLޡեդJava饹˥ѥ뤷ޤ -.SH "" +xjc \- XMLスキーマ・ファイルを完全注釈付きのJavaクラスにコンパイルします。 +.SH "概要" .sp .if n \{\ .RS 4 @@ -64,23 +64,23 @@ xjc \- XML .PP \fIoptions\fR .RS 4 -ޥɥ饤󡦥ץ󡣥ץ򻲾ȤƤ +コマンドライン・オプション。オプションを参照してください。 .RE .PP schema \fIfile/URL/dir/jar \&.\&.\&.\fR .RS 4 -XMLޡեξꡣ\fIdir\fRꤵƤϡ٤ƤΥޡե뤬ѥ뤵ޤ\fIjar\fRꤵƤϡ\fI/META\-INF/sun\-jaxb\&.episode\fRХǥ󥰡ե뤬ѥ뤵ޤ +XMLスキーマ・ファイルの場所。\fIdir\fRが指定されている場合は、すべてのスキーマ・ファイルがコンパイルされます。\fIjar\fRが指定されている場合は、\fI/META\-INF/sun\-jaxb\&.episode\fRバインディング・ファイルがコンパイルされます。 .RE .PP \-b \fIbindinfo\fR .RS 4 -Хǥ󥰡եξꡣ +バインディング・ファイルの場所。 .RE -.SH "" +.SH "説明" .PP -ץåȥեbinǥ쥯ȥˤŬڤ\fIxjc\fR롦ץȤѤơХǥ󥰡ѥưޤХǥ󥰡ѥ¹ԤAnt⤢ޤhttp://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html -Using the XJC with Ant򻲾ȤƤ -.SH "ץ" +プラットフォームのbinディレクトリにある適切な\fIxjc\fRシェル・スクリプトを使用して、バインディング・コンパイラを起動します。バインディング・コンパイラを実行するAntタスクもあります。http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.htmlの +Using the XJC with Antを参照してください +.SH "オプション" .sp .RS 4 .ie n \{\ @@ -90,7 +90,7 @@ Using the XJC with Ant .sp -1 .IP \(bu 2.3 .\} -ɸ४ץ⻲ȤƤ +非標準オプションも参照してください .RE .sp .RS 4 @@ -101,167 +101,167 @@ Using the XJC with Ant .sp -1 .IP \(bu 2.3 .\} -侩Ǻ줿ץ⻲ȤƤ +非推奨で削除されたオプションも参照してください .RE .PP \-nv .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡޤ˸̩ʸڤ¹ԤޤΥץѤȡ̩ʥ޸ڤ̵ˤʤޤϡХǥ󥰡ѥ餬ڤڼ¹ԤʤȤȤǤϤޤ󡣤긷̩Ǥʤڤ¹ԤȤȤǤ +デフォルトでは、XJCバインディング・コンパイラは、ソース・スキーマを処理する前に厳密な検証を実行します。このオプションを使用すると、厳密なスキーマ検証か無効になります。これは、バインディング・コンパイラが検証を一切実行しないということではありません。より厳密でない検証を実行するということです。 .RE .PP \-extension .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJAXBͤCompatibilityξϤƤ롼̩˶ޤϿE\&.2ˤϡJAXB v1\&.0ǴˤϥݡȤƤʤϢW3C XML޵ǽƤޤˤäƤϡΥåͭˤʤ\fI\-extension\fR⡼ɤǤεǽѤǤ礬ޤޤǥեȤθ̩ʥ⡼ɤǤϡͤƤХǥ󥰡ޥΤߤѤǤޤ\fI\-extension\fRåꤹСJAXB Vendor ExtensionѤǤޤ +デフォルトでは、XJCバインディング・コンパイラは、JAXB仕様のCompatibilityの章で説明されているルールを厳密に強制します。付録E\&.2には、JAXB v1\&.0で完全にはサポートされていない一連のW3C XMLスキーマ機能が定義されています。場合によっては、このスイッチで有効になる\fI\-extension\fRモードでそれらの機能が使用できる場合があります。また、デフォルトの厳密なモードでは、仕様に定義されているバインディング・カスタマイズのみが使用できます。\fI\-extension\fRスイッチを指定すれば、JAXB Vendor Extensionを使用できます。 .RE .PP \-b \fIfile\fR .RS 4 -볰Хǥ󥰡ե1ĤޤʣꤷޤХǥ󥰡ե뤴Ȥ\fI\-b\fRåꤹɬפޤХǥ󥰡եιʸϽǤʣΥޤΥޥޤޤ1ĤΥХǥ󥰡եѤꡢΥޥʣΥХǥ󥰡եʬ䤷Ǥޤ򼨤ޤ\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings123\&.xjb\fR -\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings1\&.xjb \-b bindings2\&.xjb \-b bindings3\&.xjb\fRޤޥɥ饤˥ޡեȥХǥ󥰡եꤹ֤ǤդǤ +処理する外部バインディング・ファイルを1つまたは複数指定します。バインディング・ファイルごとに\fI\-b\fRスイッチを指定する必要があります。外部バインディング・ファイルの構文は柔軟です。複数のスキーマのカスタマイズが含まれる1つのバインディング・ファイルを使用したり、それらのカスタマイズを複数のバインディング・ファイルに分割したりできます。次に例を示します。\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings123\&.xjb\fR +\fIxjc schema1\&.xsd schema2\&.xsd schema3\&.xsd \-b bindings1\&.xjb \-b bindings2\&.xjb \-b bindings3\&.xjb\fRまた、コマンドラインにスキーマ・ファイルとバインディング・ファイルを指定する順番は任意です。 .RE .PP \-d \fIdir\fR .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJavaƥġ饹򸽺ߤΥǥ쥯ȥޤΥץѤȡؽϥǥ쥯ȥǤޤϥǥ쥯ȥϤǤ¸ߤƤɬפޤXJCХǥ󥰡ѥǤϺޤ +デフォルトでは、XJCバインディング・コンパイラは、Javaコンテンツ・クラスを現在のディレクトリに生成します。このオプションを使用すると、代替出力ディレクトリを指定できます。出力ディレクトリはすでに存在している必要があります。XJCバインディング・コンパイラでは作成されません。 .RE .PP \-p \fIpkg\fR .RS 4 -Υޥɥ饤󡦥ץǥåȡѥåꤷ硢λƤϡѥå̾Ф뤹٤ƤΥХǥ󥰡ޥ䡢ͤǵꤵƤǥեȤΥѥå̾르ꥺͥ褵ޤ +このコマンドライン・オプションでターゲット・パッケージを指定した場合、その指定内容は、パッケージ名に対するすべてのバインディング・カスタマイズや、仕様で規定されているデフォルトのパッケージ名アルゴリズムよりも優先されます。 .RE .PP \-httpproxy \fIproxy\fR .RS 4 -\fI[user[:password]@]proxyHost[:proxyPort]\fRHTTPޤHTTPSץꤷޤŤ\fI\-host\fR\fI\-port\fRץϡ̸ߴΤ˰³RIǥݡȤޤ侩ȤʤޤΥץǻꤵ줿ѥɤϡtopޥɤѤ¾Υ桼ɽǤǤƥˤϡ\fI\-httpproxyfile\fRѤƤ +\fI[user[:password]@]proxyHost[:proxyPort]\fR形式でHTTPまたはHTTPSプロキシを指定します。古い\fI\-host\fRおよび\fI\-port\fRオプションは、下位互換性のために引き続きRIでサポートされますが、非推奨となりました。このオプションで指定されたパスワードは、topコマンドを使用する他のユーザーが表示できる引数です。セキュリティを高めるには、\fI\-httpproxyfile\fRを使用してください。 .RE .PP \-httpproxyfile file .RS 4 -եѤơHTTPޤHTTPSץꤷޤ\fI\-httpproxy\fRץƱǤΥե˻ꤵ줿ѥɤ¾Υ桼ɽ뤳ȤϤǤޤ +ファイルを使用して、HTTPまたはHTTPSプロキシを指定します。形式は\fI\-httpproxy\fRオプションと同じですが、このファイル内に指定されたパスワードを他のユーザーが表示することはできません。 .RE .PP \-classpath arg .RS 4 -\fIjxb:javaType\fRxjc:\fIsuperClass\fRޥѤ륯饤ȡץꥱΥ饹եθꤷޤ +\fIjxb:javaType\fRおよびxjc:\fIsuperClass\fRカスタマイズが使用するクライアント・アプリケーションのクラス・ファイルの検索場所を指定します。 .RE .PP \-catalog file .RS 4 -ƥƥȤ褹륫եꤷޤTR9401XCatalogOASIS XML CatalogγƷݡȤޤhttp://xerces\&.apache\&.org/xml\-commons/components/resolver/resolver\-article\&.html -XML Entity and URI Resolvers򻲾ȤƤ +外部エンティティ参照を解決するカタログ・ファイルを指定します。TR9401、XCatalogおよびOASIS XML Catalogの各形式がサポートされます。http://xerces\&.apache\&.org/xml\-commons/components/resolver/resolver\-article\&.htmlの +XML Entity and URI Resolversを参照してください .RE .PP \-readOnly .RS 4 -ǥեȤǤϡXJCХǥ󥰡ѥϡJavaեߤݸޤ󡣤ΥץѤȡXJCХǥ󥰡ѥJavaŪɼѤˤޤ +デフォルトでは、XJCバインディング・コンパイラは、生成するJavaソース・ファイルを書込みから保護しません。このオプションを使用すると、XJCバインディング・コンパイラは生成されるJavaソースを強制的に読取り専用にします。 .RE .PP \-npa .RS 4 -\fI**/package\-info\&.java\fRؤΥѥå٥ޤΥåѤ륳ɤǤϡ᤬¾ѥ饹ޤ +\fI**/package\-info\&.java\fRへのパッケージ・レベルの注釈の生成を抑制します。このスイッチを使用して生成するコードでは、これらの注釈が他の生成済クラスに内部化されます。 .RE .PP \-no\-header .RS 4 -¿Υȥॹפޤե롦إåȤޤѤȡ줿ɤ\fIdiff\fRޥɤȤθߴ궯ʤޤ +多少のメモとタイムスタンプを含むファイル・ヘッダー・コメントの生成を抑制します。これを使用すると、生成されたコードと\fIdiff\fRコマンドとの互換性がより強くなります。 .RE .PP \-target 2\&.0 .RS 4 -JAXB 2\&.1ǽ˰¸륳ɤʤ褦ˤޤˤꡢ줿ɤJAXB 2\&.0󥿥Ķ(Java SE 6ʤ)Ǽ¹ԤǤ褦ˤʤޤ +JAXB 2\&.1機能に依存するコードを生成しないようにします。これにより、生成されたコードをJAXB 2\&.0ランタイム環境(Java SE 6など)で実行できるようになります。 .RE .PP \-xmlschema .RS 4 -ϥޤW3C XMLޤȤưޤ(ǥե)Υåꤷʤ硢ϥޤW3C XMLޤƱ褦˰ޤ +入力スキーマをW3C XMLスキーマとして扱います(デフォルト)。このスイッチを指定しない場合、入力スキーマはW3C XMLスキーマと同じように扱われます。 .RE .PP \-relaxing .RS 4 -ϥޤRELAX NGȤưޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをRELAX NGとして扱います(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-relaxing\-compact .RS 4 -ϥޤRELAX NG̹ʸȤƽޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをRELAX NG圧縮構文として処理します(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-dtd .RS 4 -ϥޤXML DTDȤưޤ(Ṳ̄ݡ)RELAX NGޤΥݡȤJAXB Vendor ExtensionȤ󶡤Ƥޤ +入力スキーマをXML DTDとして扱います(試験的および未サポート)。RELAX NGスキーマのサポートはJAXB Vendor Extensionとして提供されています。 .RE .PP \-wsdl .RS 4 -ϤWSDLȤưΥޤ򥳥ѥ뤷ޤ(Ṳ̄ݡ) +入力をWSDLとして扱い、その内部のスキーマをコンパイルします(試験的および未サポート)。 .RE .PP \-quiet .RS 4 -ĽٹʤɡѥνϤޤ +進捗情報や警告など、コンパイラの出力を抑制します。 .RE .PP \-verbose .RS 4 -åϤΥ顼ȯ˥åȥ졼ɽꤹʤɡƾĹˤʤޤ +情報メッセージを出力したり特定のエラー発生時にスタック・トレースを表示したりするなど、きわめて冗長になります。 .RE .PP \-help .RS 4 -ѥ顦åΥޥ꡼ɽޤ +コンパイラ・スイッチのサマリーを表示します。 .RE .PP \-version .RS 4 -ѥΥСɽޤ +コンパイラのバージョン情報を表示します。 .RE .PP \fIschema file/URL/dir\fR .RS 4 -ѥоݤȤʤ1ĤޤʣΥޡեꤷޤǥ쥯ȥꤹ硢\fIxjc\fRޥɤϤ٤ƤΥޡե򥹥󤷤ƥѥ뤷ޤ +コンパイル対象となる1つまたは複数のスキーマ・ファイルを指定します。ディレクトリを指定する場合、\fIxjc\fRコマンドはすべてのスキーマ・ファイルをスキャンしてコンパイルします。 .RE -.SS "ɸ४ץ" +.SS "非標準オプション" .PP \-XLocator .RS 4 -줿ɤǤϡ󲽤θJava Bean󥹥󥹤˴ޤޤ륽XML˴ؤSAX Locator󤬸ޤ +生成されたコードでは、非整列化の後にJava Beanインスタンスに含まれるソースXMLに関するSAX Locator情報が公開されます。 .RE .PP \-Xsync\-methods .RS 4 -줿٤ƤΥ᥽åɡ˥\fIsynchronized\fRɤޤޤ +生成されたすべてのメソッド・シグニチャに\fIsynchronized\fRキーワードが含められます。 .RE .PP \-mark\-generated .RS 4 -줿ɤ\fI@javax\&.annotation\&.Generated\fRդޤ +生成されたコードに注釈\fI@javax\&.annotation\&.Generated\fRを付けます。 .RE .PP \-episode file .RS 4 -ѥ뤴Ȥ˻ꤵ줿ԥɡեޤ +コンパイルごとに指定されたエピソード・ファイルを生成します。 .RE -.SS "侩Ǻ줿ץ" +.SS "非推奨で削除されたオプション" .PP \-host & \-port .RS 4 -Υץ\fI\-httpproxy\fRץ֤ޤΥץϡ̸ߴݤ뤿˥ݡȤޤɥȤˤϵܤ줺Υ꡼Ǻǽ⤢ޤ +これらのオプションは\fI\-httpproxy\fRオプションで置き換えられました。これらのオプションは、下位互換性を確保するためにサポートされますが、ドキュメントには記載されず、将来のリリースで削除される可能性もあります。 .RE .PP \-use\-runtime .RS 4 -JAXB 2\&.0ͤǤϡܿΤ󥿥Ķ줿ᡢJAXB RI\fI**/impl/runtime \fRѥåɬפʤʤޤΤᡢΥåפȤʤꡢޤ +JAXB 2\&.0仕様では、移植性のあるランタイム環境が定義されたため、JAXB RIが\fI**/impl/runtime \fRパッケージを生成する必要がなくなりました。このため、このスイッチは不要となり、削除されました。 .RE .PP \-source .RS 4 -\fI\-source\fRߴåϡJAXB 2\&.0κǽEarly AccessǤƳޤΥåJAXB 2\&.0κΥ꡼ޤ1\&.0\&.xɤɬפϡ1\&.0\&.xɡ١Υ󥹥ȡѤƤ +\fI\-source\fR互換性スイッチは、JAXB 2\&.0の最初のEarly Access版で導入されました。このスイッチはJAXB 2\&.0の今後のリリースから削除されます。1\&.0\&.xコードを生成する必要がある場合は、1\&.0\&.xコード・ベースのインストールを使用してください。 .RE -.SH "ѥ" +.SH "コンパイラの制限" .PP -̾ϡϢ뤹٤ƤΥޤƱХǥ󥰡ѥ顦åꤷ1Ĥñ̤Ȥƥѥ뤹ΤǤǤ\fIxjc\fRޥɤμ¹Իˤϡ¥ꥹȤαդƤΤۤȤɤϡ\fIxjc\fRޥɤ٤ƤӽФʣΥޤ򥳥ѥ뤹ˤΤƤϤޤޤ +通常は、関連するすべてのスキーマを、同じバインディング・コンパイラ・スイッチを指定して1つの単位としてコンパイルするのが最も安全です。\fIxjc\fRコマンドの実行時には、次の制限リストに留意してください。これらの問題のほとんどは、\fIxjc\fRコマンドを何度か呼び出して複数のスキーマをコンパイルする場合にのみ当てはまります。 .PP -ʣΥޤƱ˥ѥ뤹ϡåȤJavaѥå̾˼̤ͥΥ롼뤬ŬѤ뤳ȤդƤ +複数のスキーマを同時にコンパイルする場合は、ターゲットのJavaパッケージ名に次の優先順位のルールが適用されることに注意してください。 .sp .RS 4 .ie n \{\ @@ -271,7 +271,7 @@ JAXB 2\&.0 .sp -1 .IP " 1." 4.2 .\} -\fI\-p\fRץ󤬺Ǥͥ褵ޤ +\fI\-p\fRオプションが最も優先されます。 .RE .sp .RS 4 @@ -282,7 +282,7 @@ JAXB 2\&.0 .sp -1 .IP " 2." 4.2 .\} -\fIjaxb:package\fRΥޥ +\fIjaxb:package\fRのカスタマイズ。 .RE .sp .RS 4 @@ -293,7 +293,7 @@ JAXB 2\&.0 .sp -1 .IP " 3." 4.2 .\} -\fItargetNamespace\fRƤϡ\fIt\fR\fIargetNamespace\fRͤƤJavaѥå̾Υ르ꥺŬѤޤ +\fItargetNamespace\fRが宣言されている場合は、\fIt\fR\fIargetNamespace\fRを仕様で定義されているJavaパッケージ名のアルゴリズムに適用します。 .RE .sp .RS 4 @@ -304,15 +304,15 @@ JAXB 2\&.0 .sp -1 .IP " 4." 4.2 .\} -\fItargetNamespace\fRƤʤϡ\fIgenerated\fRȤ̾Υϡɥɤ줿ѥåѤޤ +\fItargetNamespace\fRが宣言されていない場合は、\fIgenerated\fRという名前のハードコードされたパッケージを使用します。 .RE .PP -1ĤΥ͡ॹڡʣ\fIjaxb:schemaBindings\fRĤȤϤǤʤᡢۤʤJavaѥå˥ѥ餵Ʊ쥿åȡ͡ॹڡ2ĤΥޤĤȤϤǤޤ +1つのネームスペースが複数の\fIjaxb:schemaBindings\fRを持つことはできないため、異なるJavaパッケージにコンパイラされる同一ターゲット・ネームスペースが2つのスキーマを持つことはできません。 .PP -ƱJavaѥå˥ѥ餵륹ޤϤ٤ơƱXJCХǥ󥰡ѥɬפޤ̡˥ѥ뤹ȡͽۤɤ˵ǽޤ +同じJavaパッケージにコンパイラされるスキーマはすべて、同時にXJCバインディング・コンパイラに送信される必要があります。別々にコンパイルすると、予想どおりに機能しません。 .PP -ʣΥޡեˤޤִ롼פϡƱ˥ѥ뤹ɬפޤ -.SH "Ϣ" +複数のスキーマ・ファイルにまたがる要素置換グループは、同時にコンパイルする必要があります。 +.SH "関連項目" .sp .RS 4 .ie n \{\ @@ -322,7 +322,7 @@ JAXB 2\&.0 .sp -1 .IP \(bu 2.3 .\} -http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html +http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.htmlの Binding Compiler (xjc) .RE .sp @@ -334,7 +334,7 @@ Binding Compiler (xjc) .sp -1 .IP \(bu 2.3 .\} -http://www\&.oracle\&.com/technetwork/articles/javase/index\-140168\&.html +http://www\&.oracle\&.com/technetwork/articles/javase/index\-140168\&.htmlの Java Architecture for XML Binding (JAXB) .RE .br diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index fb8d79c7b5e..474047a1d69 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -136,13 +136,6 @@ java/lang/instrument/BootClassPath/BootClassPathTest.sh macosx-all ############################################################################ -# jdk_management - -# 8058492 -java/lang/management/ThreadMXBean/FindDeadlocks.java generic-all - -############################################################################ - # jdk_jmx # 8030957 @@ -353,9 +346,6 @@ com/sun/jdi/RedefinePop.sh generic-all # 8068645 com/sun/jdi/CatchPatternTest.sh generic-all -# 8069402 -com/sun/jdi/ConnectedVMs.java generic-all - # 8067354 com/sun/jdi/GetLocalVariables4Test.sh windows-all @@ -380,13 +370,7 @@ sun/tools/jcmd/TestJcmdSanity.java windows-all # 8072131 sun/tools/jmap/heapconfig/JMapHeapConfigTest.java macosx-all -# 8027668 -sun/tools/jstatd/TestJstatdDefaults.java generic-all -sun/tools/jstatd/TestJstatdServer.java generic-all -sun/tools/jstatd/TestJstatdPort.java generic-all -sun/tools/jstatd/TestJstatdPortAndServer.java generic-all - -# 8046285 8027668 +# 8046285 sun/tools/jstatd/TestJstatdExternalRegistry.java generic-all # 6456333 diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT index 76e0c407cba..04b93eb694f 100644 --- a/jdk/test/TEST.ROOT +++ b/jdk/test/TEST.ROOT @@ -20,5 +20,5 @@ exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote su # Group definitions groups=TEST.groups [closed/TEST.groups] -# Tests using jtreg 4.1 b10 features -requiredVersion=4.1 b10 +# Tests using jtreg 4.1 b11 features +requiredVersion=4.1 b11 diff --git a/jdk/test/com/sun/jdi/AcceptTimeout.java b/jdk/test/com/sun/jdi/AcceptTimeout.java index 42ffbeab9f8..313a2812035 100644 --- a/jdk/test/com/sun/jdi/AcceptTimeout.java +++ b/jdk/test/com/sun/jdi/AcceptTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6198277 * @summary Test that each ListeningConnector that supports a "timeout" argument will * timeout with TransportTimeoutException + * @modules jdk.jdi */ import com.sun.jdi.Bootstrap; import com.sun.jdi.connect.Connector; diff --git a/jdk/test/com/sun/jdi/AccessSpecifierTest.java b/jdk/test/com/sun/jdi/AccessSpecifierTest.java index 7811227ef57..d1c6e143395 100644 --- a/jdk/test/com/sun/jdi/AccessSpecifierTest.java +++ b/jdk/test/com/sun/jdi/AccessSpecifierTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g AccessSpecifierTest.java * @run driver AccessSpecifierTest diff --git a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java index c822b3bb5ab..93c21e6bc46 100644 --- a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java +++ b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g AfterThreadDeathTest.java * @run driver AfterThreadDeathTest diff --git a/jdk/test/com/sun/jdi/AllLineLocations.java b/jdk/test/com/sun/jdi/AllLineLocations.java index 7340307ec38..ef85878e3f3 100644 --- a/jdk/test/com/sun/jdi/AllLineLocations.java +++ b/jdk/test/com/sun/jdi/AllLineLocations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Gordon Hirsch * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g RefTypes.java * @run build AllLineLocations diff --git a/jdk/test/com/sun/jdi/ArrayRangeTest.java b/jdk/test/com/sun/jdi/ArrayRangeTest.java index 83b4c5b225f..c7df22fabbd 100644 --- a/jdk/test/com/sun/jdi/ArrayRangeTest.java +++ b/jdk/test/com/sun/jdi/ArrayRangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ArrayRangeTest.java * @run driver ArrayRangeTest diff --git a/jdk/test/com/sun/jdi/BacktraceFieldTest.java b/jdk/test/com/sun/jdi/BacktraceFieldTest.java index f915e44accd..b993a68ecb1 100644 --- a/jdk/test/com/sun/jdi/BacktraceFieldTest.java +++ b/jdk/test/com/sun/jdi/BacktraceFieldTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g BacktraceFieldTest.java * @run driver BacktraceFieldTest diff --git a/jdk/test/com/sun/jdi/BadHandshakeTest.java b/jdk/test/com/sun/jdi/BadHandshakeTest.java index 2a1108f5910..20f0ba559ed 100644 --- a/jdk/test/com/sun/jdi/BadHandshakeTest.java +++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +44,8 @@ import jdk.testlibrary.ProcessTools; * @summary Check that a bad handshake doesn't cause a debuggee to abort * @library /lib/testlibrary * + * @modules java.management + * jdk.jdi * @build jdk.testlibrary.* VMConnection BadHandshakeTest Exit0 * @run driver BadHandshakeTest */ diff --git a/jdk/test/com/sun/jdi/BreakpointTest.java b/jdk/test/com/sun/jdi/BreakpointTest.java index 40b36057863..55f0b0d2219 100644 --- a/jdk/test/com/sun/jdi/BreakpointTest.java +++ b/jdk/test/com/sun/jdi/BreakpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g BreakpointTest.java * @run driver BreakpointTest @@ -44,7 +45,7 @@ import java.util.*; // the debuggee, waits a bit, and enables the bkpt again. class BreakpointTarg { - public final static int BKPT_LINE = 54; + public final static int BKPT_LINE = 55; // LINE NUMBER SENSITIVE public static long count; diff --git a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java index 60277c83dc9..a4f8450b7d0 100644 --- a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java +++ b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ClassLoaderClassesTest.java * @run driver ClassLoaderClassesTest diff --git a/jdk/test/com/sun/jdi/ClassesByName.java b/jdk/test/com/sun/jdi/ClassesByName.java index a6a9459511c..420b1cb703b 100644 --- a/jdk/test/com/sun/jdi/ClassesByName.java +++ b/jdk/test/com/sun/jdi/ClassesByName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @author Robert Field * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g HelloWorld.java * @run build ClassesByName diff --git a/jdk/test/com/sun/jdi/ClassesByName2Test.java b/jdk/test/com/sun/jdi/ClassesByName2Test.java index 7b002a222eb..f7bd695bbf5 100644 --- a/jdk/test/com/sun/jdi/ClassesByName2Test.java +++ b/jdk/test/com/sun/jdi/ClassesByName2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * * @author Tim Bell (based on ClassesByName by Robert Field) * + * @modules java.corba + * jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ClassesByName2Test.java * @run driver ClassesByName2Test diff --git a/jdk/test/com/sun/jdi/CompatibleConnectors.java b/jdk/test/com/sun/jdi/CompatibleConnectors.java index b1425217868..189e1b2a6d0 100644 --- a/jdk/test/com/sun/jdi/CompatibleConnectors.java +++ b/jdk/test/com/sun/jdi/CompatibleConnectors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * * This test checks that VirtualMachineManager creates Connectors that * are "compatible" those created by 1.4 or earilier releases. + * @modules jdk.jdi */ import com.sun.jdi.*; diff --git a/jdk/test/com/sun/jdi/ConnectedVMs.java b/jdk/test/com/sun/jdi/ConnectedVMs.java index 0205d64dd70..7e41bb17d99 100644 --- a/jdk/test/com/sun/jdi/ConnectedVMs.java +++ b/jdk/test/com/sun/jdi/ConnectedVMs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4329140 * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g InstTarg.java * @run driver ConnectedVMs Kill diff --git a/jdk/test/com/sun/jdi/ConstantPoolInfo.java b/jdk/test/com/sun/jdi/ConstantPoolInfo.java index 0ef27a65f27..540d26e381d 100644 --- a/jdk/test/com/sun/jdi/ConstantPoolInfo.java +++ b/jdk/test/com/sun/jdi/ConstantPoolInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Swamy Venkataramanappa * + * @modules jdk.jdi * @run build TestScaffold VMConnection * @run compile -g ConstantPoolInfo.java * @run driver ConstantPoolInfo diff --git a/jdk/test/com/sun/jdi/CountEvent.java b/jdk/test/com/sun/jdi/CountEvent.java index a1166baa3d1..40086b3bfa6 100644 --- a/jdk/test/com/sun/jdi/CountEvent.java +++ b/jdk/test/com/sun/jdi/CountEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetAdapter TargetListener * @run compile -g CountEvent.java * @run driver CountEvent diff --git a/jdk/test/com/sun/jdi/CountFilterTest.java b/jdk/test/com/sun/jdi/CountFilterTest.java index 07c823600e2..e71de811a3e 100644 --- a/jdk/test/com/sun/jdi/CountFilterTest.java +++ b/jdk/test/com/sun/jdi/CountFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g CountFilterTest.java * @run driver CountFilterTest diff --git a/jdk/test/com/sun/jdi/DebuggerThreadTest.java b/jdk/test/com/sun/jdi/DebuggerThreadTest.java index 7bb1b168f54..182c232e19a 100644 --- a/jdk/test/com/sun/jdi/DebuggerThreadTest.java +++ b/jdk/test/com/sun/jdi/DebuggerThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g DebuggerThreadTest.java * @run driver DebuggerThreadTest diff --git a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java index 833a2acae31..a37cbb33133 100644 --- a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java +++ b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author jjh * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g DeleteAllBkptsTest.java * @run driver DeleteAllBkptsTest diff --git a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java index 0b6b9756f5e..7d4d8078798 100644 --- a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java +++ b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g DeleteEventRequestsTest.java * @run driver DeleteEventRequestsTest diff --git a/jdk/test/com/sun/jdi/DoubleAgentTest.java b/jdk/test/com/sun/jdi/DoubleAgentTest.java index 0a0b5e8dcae..91babd72e26 100644 --- a/jdk/test/com/sun/jdi/DoubleAgentTest.java +++ b/jdk/test/com/sun/jdi/DoubleAgentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ import jdk.testlibrary.Utils; * @summary Check that multiple -agentlib statements in command line fails * * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibarary.* * @build DoubleAgentTest Exit0 * @run driver DoubleAgentTest diff --git a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java index 8a76f66f70e..c99a8859f09 100644 --- a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java +++ b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Unexpected ClassCastException in ThreadReference.forceEarlyReturn * @author Jim Holmlund * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g EarlyReturnNegativeTest.java * @run driver EarlyReturnNegativeTest diff --git a/jdk/test/com/sun/jdi/EarlyReturnTest.java b/jdk/test/com/sun/jdi/EarlyReturnTest.java index 2844eca497e..5a7dae00018 100644 --- a/jdk/test/com/sun/jdi/EarlyReturnTest.java +++ b/jdk/test/com/sun/jdi/EarlyReturnTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ * * @author Tim Bell (based on MethodExitReturnValuesTest by Jim Holmlund) * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g EarlyReturnTest.java * @run driver EarlyReturnTest diff --git a/jdk/test/com/sun/jdi/EnumTest.java b/jdk/test/com/sun/jdi/EnumTest.java index 042cfaf6ee1..660479b5a36 100644 --- a/jdk/test/com/sun/jdi/EnumTest.java +++ b/jdk/test/com/sun/jdi/EnumTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g EnumTest.java * @run driver EnumTest diff --git a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java index 15ce6162eca..397373c451c 100644 --- a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java +++ b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4425852 * @author Robert Field * + * @modules jdk.jdi * @run build VMConnection * @run compile -g EventQueueDisconnectTest.java * @run driver EventQueueDisconnectTest diff --git a/jdk/test/com/sun/jdi/ExceptionEvents.java b/jdk/test/com/sun/jdi/ExceptionEvents.java index 3e6eccfc65f..ab8a66b0894 100644 --- a/jdk/test/com/sun/jdi/ExceptionEvents.java +++ b/jdk/test/com/sun/jdi/ExceptionEvents.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library scaffold + * @modules jdk.jdi * @run build TestScaffold VMConnection * @run compile -g ExceptionEvents.java * diff --git a/jdk/test/com/sun/jdi/ExclusiveBind.java b/jdk/test/com/sun/jdi/ExclusiveBind.java index c20bb2d2f1c..9a648f35b4d 100644 --- a/jdk/test/com/sun/jdi/ExclusiveBind.java +++ b/jdk/test/com/sun/jdi/ExclusiveBind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * at the same time. * @library /lib/testlibrary * + * @modules java.management + * jdk.jdi * @build jdk.testlibrary.* VMConnection ExclusiveBind HelloWorld * @run driver ExclusiveBind */ diff --git a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java index 41720a41259..d8a30da9c64 100644 --- a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java +++ b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ExpiredRequestDeletionTest.java * @run driver ExpiredRequestDeletionTest diff --git a/jdk/test/com/sun/jdi/FieldWatchpoints.java b/jdk/test/com/sun/jdi/FieldWatchpoints.java index b39e422684d..a465e9c63c6 100644 --- a/jdk/test/com/sun/jdi/FieldWatchpoints.java +++ b/jdk/test/com/sun/jdi/FieldWatchpoints.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g FieldWatchpoints.java * @run driver FieldWatchpoints diff --git a/jdk/test/com/sun/jdi/FilterMatch.java b/jdk/test/com/sun/jdi/FilterMatch.java index 4014b522f04..3d3953b199a 100644 --- a/jdk/test/com/sun/jdi/FilterMatch.java +++ b/jdk/test/com/sun/jdi/FilterMatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field/Jim Holmlund * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g HelloWorld.java * @run driver FilterMatch diff --git a/jdk/test/com/sun/jdi/FilterNoMatch.java b/jdk/test/com/sun/jdi/FilterNoMatch.java index 239fa397c05..04038999c7b 100644 --- a/jdk/test/com/sun/jdi/FilterNoMatch.java +++ b/jdk/test/com/sun/jdi/FilterNoMatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field/Jim Holmlund * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g HelloWorld.java * @run driver FilterNoMatch diff --git a/jdk/test/com/sun/jdi/FinalLocalsTest.java b/jdk/test/com/sun/jdi/FinalLocalsTest.java index be7750ed659..f8e8deb39de 100644 --- a/jdk/test/com/sun/jdi/FinalLocalsTest.java +++ b/jdk/test/com/sun/jdi/FinalLocalsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g FinalLocalsTest.java * @run driver FinalLocalsTest diff --git a/jdk/test/com/sun/jdi/FinalizerTest.java b/jdk/test/com/sun/jdi/FinalizerTest.java index 2df4d0ce8a3..6ac34c7894f 100644 --- a/jdk/test/com/sun/jdi/FinalizerTest.java +++ b/jdk/test/com/sun/jdi/FinalizerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test debugger operations in finalize() methods * @author Gordon Hirsch (modified for HotSpot by tbell & rfield) * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g FinalizerTest.java * diff --git a/jdk/test/com/sun/jdi/FramesTest.java b/jdk/test/com/sun/jdi/FramesTest.java index 5d54508b778..88065b8ea9d 100644 --- a/jdk/test/com/sun/jdi/FramesTest.java +++ b/jdk/test/com/sun/jdi/FramesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g FramesTest.java * @run driver FramesTest diff --git a/jdk/test/com/sun/jdi/GenericsTest.java b/jdk/test/com/sun/jdi/GenericsTest.java index c7d21419b28..375839a37d3 100644 --- a/jdk/test/com/sun/jdi/GenericsTest.java +++ b/jdk/test/com/sun/jdi/GenericsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g GenericsTest.java * @run driver GenericsTest diff --git a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java index 00fca8a17be..65029676bcc 100644 --- a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java +++ b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g GetLocalVariables2Test.java * @run driver GetLocalVariables2Test diff --git a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java index 8081f081006..66bec8e876d 100644 --- a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java +++ b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Staffan Larsen * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g GetUninitializedStringValue.java * @run driver GetUninitializedStringValue diff --git a/jdk/test/com/sun/jdi/HomeTest.java b/jdk/test/com/sun/jdi/HomeTest.java index 38aa7ad8e9b..dcc23a013ea 100644 --- a/jdk/test/com/sun/jdi/HomeTest.java +++ b/jdk/test/com/sun/jdi/HomeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Tim Bell (based on "HomeTest.java" by Eugene I. Latkin) * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g HomeTest.java * @run driver HomeTest diff --git a/jdk/test/com/sun/jdi/InstanceFilter.java b/jdk/test/com/sun/jdi/InstanceFilter.java index a8d7da33ab9..43cfeddaab0 100644 --- a/jdk/test/com/sun/jdi/InstanceFilter.java +++ b/jdk/test/com/sun/jdi/InstanceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field/Jim Holmlund * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetAdapter TargetListener * @run compile -g InstanceFilter.java * @run driver InstanceFilter @@ -104,7 +105,10 @@ public class InstanceFilter extends TestScaffold { return; } if (theThis == null) { - // This happens when the thread has exited. + // This happens when the thread has exited or when a + // static method is called. Setting an instance + // filter does not prevent this event from being + // emitted with a this that is null. methodEntryRequest.disable(); return; } @@ -138,6 +142,10 @@ public class InstanceFilter extends TestScaffold { EventRequestManager mgr = vm().eventRequestManager(); methodEntryRequest = mgr.createMethodEntryRequest(); methodEntryRequest.addInstanceFilter(theInstance); + // Thread filter is needed to prevent MethodEntry events + // to be emitted by the debugee when a static method + // is called on any thread. + methodEntryRequest.addThreadFilter(bpe.thread()); methodEntryRequest.enable(); listenUntilVMDisconnect(); diff --git a/jdk/test/com/sun/jdi/InstancesTest.java b/jdk/test/com/sun/jdi/InstancesTest.java index cdcda4b649b..6f5cbb4c98d 100644 --- a/jdk/test/com/sun/jdi/InstancesTest.java +++ b/jdk/test/com/sun/jdi/InstancesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Add ReferenceType.getAllInstances () method to JDI. * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g InstancesTest.java * @run driver InstancesTest diff --git a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java index 80a6b30245d..dc60820ac39 100644 --- a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java +++ b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java @@ -27,6 +27,7 @@ * @bug 8071657 * @summary JDI: Add support for static and default methods in interfaces * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run build InterfaceMethodsTest * @run driver InterfaceMethodsTest diff --git a/jdk/test/com/sun/jdi/InterruptHangTest.java b/jdk/test/com/sun/jdi/InterruptHangTest.java index 859d0770f3c..fac166885d7 100644 --- a/jdk/test/com/sun/jdi/InterruptHangTest.java +++ b/jdk/test/com/sun/jdi/InterruptHangTest.java @@ -1,3 +1,30 @@ +/* + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 com.sun.jdi.*; +import com.sun.jdi.event.*; +import com.sun.jdi.request.*; + /** * @test * @bug 6459476 @@ -5,15 +32,13 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g InterruptHangTest.java * @run driver InterruptHangTest */ -import com.sun.jdi.*; -import com.sun.jdi.event.*; -import com.sun.jdi.request.*; -/* +/** * Debuggee has two threads. Debugger keeps stepping in * the first thread. The second thread keeps interrupting the first * thread. If a long time goes by with the debugger not getting diff --git a/jdk/test/com/sun/jdi/InvokeHangTest.java b/jdk/test/com/sun/jdi/InvokeHangTest.java index 1f3db7b0309..e6a49eccdba 100644 --- a/jdk/test/com/sun/jdi/InvokeHangTest.java +++ b/jdk/test/com/sun/jdi/InvokeHangTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g InvokeHangTest.java * @run driver InvokeHangTest diff --git a/jdk/test/com/sun/jdi/InvokeTest.java b/jdk/test/com/sun/jdi/InvokeTest.java index 60b7c38e85d..09fcc775e86 100644 --- a/jdk/test/com/sun/jdi/InvokeTest.java +++ b/jdk/test/com/sun/jdi/InvokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g InvokeTest.java * @run driver InvokeTest diff --git a/jdk/test/com/sun/jdi/InvokeVarArgs.java b/jdk/test/com/sun/jdi/InvokeVarArgs.java new file mode 100644 index 00000000000..45af920db9f --- /dev/null +++ b/jdk/test/com/sun/jdi/InvokeVarArgs.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8075331 + * @summary Verify that we can call varargs methods + * @run build TestScaffold VMConnection TargetAdapter TargetListener + * @run compile -g InvokeVarArgs.java + * @run driver InvokeVarArgs + */ + +import com.sun.jdi.*; +import com.sun.jdi.event.*; +import java.util.Arrays; + +interface MyInterface { +} + +class SomeClass implements MyInterface { +} + +class InvokeVarArgsTarg { + + public static void main(String args[]) { + new InvokeVarArgsTarg().run(); + } + + SomeClass someClass1 = new SomeClass(); + SomeClass someClass2 = new SomeClass(); + + MyInterface[] array = new MyInterface[]{someClass1, someClass2}; + SomeClass[] array2 = new SomeClass[]{someClass1, someClass2}; + + public void run() { + System.out.println("size(array) : " + size(array)); + System.out.println("size(array2) : " + size(array2)); + } + + int size(Object... value) { + return value.length; + } +} + +public class InvokeVarArgs extends TestScaffold { + + public static void main(String args[]) throws Exception { + new InvokeVarArgs(args).startTests(); + } + + InvokeVarArgs(String args[]) throws Exception { + super(args); + } + + protected void runTests() throws Exception { + + BreakpointEvent bpe = startTo("InvokeVarArgsTarg", "run", "()V"); + StackFrame frame = bpe.thread().frame(0); + ObjectReference targetObj = frame.thisObject(); + ReferenceType targetType = (ReferenceType) targetObj.type(); + Value arrayVal = targetObj.getValue(targetType.fieldByName("array")); + Value array2Val = targetObj.getValue(targetType.fieldByName("array2")); + Method sizeMethod = targetType.methodsByName("size", "([Ljava/lang/Object;)I").get(0); + + IntegerValue size = (IntegerValue) targetObj.invokeMethod(bpe.thread(), sizeMethod, Arrays.asList(new Value[]{arrayVal}), 0); + if (size.value() != 2) { + throw new Exception("size(array) should be 2, but was " + size.value()); + } + + size = (IntegerValue) targetObj.invokeMethod(bpe.thread(), sizeMethod, Arrays.asList(new Value[]{array2Val}), 0); + if (size.value() != 2) { + throw new Exception("size(array2) should be 2, but was " + size.value()); + } + + listenUntilVMDisconnect(); + } +} diff --git a/jdk/test/com/sun/jdi/JITDebug.sh b/jdk/test/com/sun/jdi/JITDebug.sh index 423fe26521a..0f8378618a9 100644 --- a/jdk/test/com/sun/jdi/JITDebug.sh +++ b/jdk/test/com/sun/jdi/JITDebug.sh @@ -1,7 +1,7 @@ #!/bin/ksh -p # -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @author Tim Bell # Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh # +# @modules jdk.jdi # @run build TestScaffold VMConnection TargetListener TargetAdapter # @run compile -g JITDebug.java # @run shell JITDebug.sh diff --git a/jdk/test/com/sun/jdi/Java_gTest.java b/jdk/test/com/sun/jdi/Java_gTest.java index 4b15af7dae8..5d4c811e465 100644 --- a/jdk/test/com/sun/jdi/Java_gTest.java +++ b/jdk/test/com/sun/jdi/Java_gTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g Java_gTest.java * @run driver Java_gTest diff --git a/jdk/test/com/sun/jdi/LambdaBreakpointTest.java b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java index f44dbe6962b..2423b737e47 100644 --- a/jdk/test/com/sun/jdi/LambdaBreakpointTest.java +++ b/jdk/test/com/sun/jdi/LambdaBreakpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Staffan Larsen * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g LambdaBreakpointTest.java * @run driver LambdaBreakpointTest @@ -51,7 +52,7 @@ import com.sun.jdi.event.StepEvent; class LambdaBreakpointTestTarg { static int[] breakpointLines = { - 62, 66, 63, 64, 65, 67 + 63, 67, 64, 65, 66, 68 }; public static void main(String[] args) { diff --git a/jdk/test/com/sun/jdi/LambdaStepTest.java b/jdk/test/com/sun/jdi/LambdaStepTest.java index a421b85ab11..2b594f83997 100644 --- a/jdk/test/com/sun/jdi/LambdaStepTest.java +++ b/jdk/test/com/sun/jdi/LambdaStepTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * * @author Staffan Larsen * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g LambdaStepTest.java * @run driver LambdaStepTest diff --git a/jdk/test/com/sun/jdi/LaunchCommandLine.java b/jdk/test/com/sun/jdi/LaunchCommandLine.java index 0ed11084a33..65e7fa8d20c 100644 --- a/jdk/test/com/sun/jdi/LaunchCommandLine.java +++ b/jdk/test/com/sun/jdi/LaunchCommandLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Gordon Hirsch * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g HelloWorld.java * @run build LaunchCommandLine diff --git a/jdk/test/com/sun/jdi/LineNumberInfo.java b/jdk/test/com/sun/jdi/LineNumberInfo.java index 70acaf47ca2..c5166da0c43 100644 --- a/jdk/test/com/sun/jdi/LineNumberInfo.java +++ b/jdk/test/com/sun/jdi/LineNumberInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test javac regressions in the generation of line number info * @author Gordon Hirsch * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g LineNumberInfo.java ControlFlow.java * diff --git a/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java b/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java index 009b7085b0d..49b558c76cd 100644 --- a/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java +++ b/jdk/test/com/sun/jdi/LineNumberOnBraceTest.java @@ -18,8 +18,8 @@ import java.util.*; /********** LINE NUMBER SENSITIVE! *****************************************************************/ class LineNumberOnBraceTarg { - public final static int stopLine = 28; // THIS MUST BE THE LINE NUMBER OF THE // stopline LINE - public final static int stopLine2 = 34; // THIS MUST BE THE LINE NUMBER OF THE // stopline2 LINE + public final static int stopLine = 29; // THIS MUST BE THE LINE NUMBER OF THE // stopline LINE + public final static int stopLine2 = 35; // THIS MUST BE THE LINE NUMBER OF THE // stopline2 LINE public static void main(String[] args){ diff --git a/jdk/test/com/sun/jdi/ListenAddress.java b/jdk/test/com/sun/jdi/ListenAddress.java index c13fbb572f2..25613905141 100644 --- a/jdk/test/com/sun/jdi/ListenAddress.java +++ b/jdk/test/com/sun/jdi/ListenAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Test that startListening(Map) method of the com.sun.jdi.SocketListen * Connector returns an address that is usable for the address option on * remove debuggees. + * @modules jdk.jdi */ import java.net.InetAddress; import java.net.Inet4Address; diff --git a/jdk/test/com/sun/jdi/LocalVariableEqual.java b/jdk/test/com/sun/jdi/LocalVariableEqual.java index 0602f7b632c..ed3ef665fc1 100644 --- a/jdk/test/com/sun/jdi/LocalVariableEqual.java +++ b/jdk/test/com/sun/jdi/LocalVariableEqual.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Serguei Spitsyn * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g LocalVariableEqual.java * @run driver LocalVariableEqual diff --git a/jdk/test/com/sun/jdi/LocationTest.java b/jdk/test/com/sun/jdi/LocationTest.java index 1bebd63254a..52a34e29658 100644 --- a/jdk/test/com/sun/jdi/LocationTest.java +++ b/jdk/test/com/sun/jdi/LocationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g LocationTest.java * @run driver LocationTest diff --git a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java index aaab2d4f0ce..174505f399d 100644 --- a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java +++ b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test the bug fix for: MethodExitEvents disappear when Object-Methods are called from main * @author Tim Bell * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g MethodEntryExitEvents.java * @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee diff --git a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java index e937bc50560..5c41575aaa3 100644 --- a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java +++ b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary JDWP, JDI: Add return value to Method Exit Event * @author Jim Holmlund * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g MethodExitReturnValuesTest.java * @run driver MethodExitReturnValuesTest diff --git a/jdk/test/com/sun/jdi/MixedSuspendTest.sh b/jdk/test/com/sun/jdi/MixedSuspendTest.sh index 43d0057edfe..c8b64ea36c7 100644 --- a/jdk/test/com/sun/jdi/MixedSuspendTest.sh +++ b/jdk/test/com/sun/jdi/MixedSuspendTest.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, 2014 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015 Oracle and/or its affiliates. All rights reserved. # 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 @@ # # @author Jim Holmlund # +# @modules jdk.jdi # @run build TestScaffold VMConnection TargetListener TargetAdapter # @run shell MixedSuspendTest.sh diff --git a/jdk/test/com/sun/jdi/ModificationWatchpoints.java b/jdk/test/com/sun/jdi/ModificationWatchpoints.java index 76ac1798a4a..0f407ac4269 100644 --- a/jdk/test/com/sun/jdi/ModificationWatchpoints.java +++ b/jdk/test/com/sun/jdi/ModificationWatchpoints.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * @author Robert Field (modified to JDIScaffold) * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g ModificationWatchpoints.java * @run driver ModificationWatchpoints diff --git a/jdk/test/com/sun/jdi/MonitorEventTest.java b/jdk/test/com/sun/jdi/MonitorEventTest.java index 857922c67d9..8f33071dc3e 100644 --- a/jdk/test/com/sun/jdi/MonitorEventTest.java +++ b/jdk/test/com/sun/jdi/MonitorEventTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Swamy Venkataramanappa * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g MonitorEventTest.java * @run driver MonitorEventTest diff --git a/jdk/test/com/sun/jdi/MonitorFrameInfo.java b/jdk/test/com/sun/jdi/MonitorFrameInfo.java index ae54de1454a..420170644c5 100644 --- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java +++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary MonitorInfo objects aren't invalidated when the owning thread is resumed * @author Swamy Venkataramanappa * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g MonitorFrameInfo.java * @run driver MonitorFrameInfo diff --git a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java index 3b374086576..eda894ee470 100644 --- a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java +++ b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author tbell, jjh * + * @modules jdk.jdi * @build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g MultiBreakpointsTest.java * @run driver MultiBreakpointsTest diff --git a/jdk/test/com/sun/jdi/NativeInstanceFilter.java b/jdk/test/com/sun/jdi/NativeInstanceFilter.java index 6f01bb51b35..f62ad007cd8 100644 --- a/jdk/test/com/sun/jdi/NativeInstanceFilter.java +++ b/jdk/test/com/sun/jdi/NativeInstanceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Keith McGuigan * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java * @run driver NativeInstanceFilter diff --git a/jdk/test/com/sun/jdi/NewInstanceTest.java b/jdk/test/com/sun/jdi/NewInstanceTest.java index 97cb407ab5d..3950462cbd2 100644 --- a/jdk/test/com/sun/jdi/NewInstanceTest.java +++ b/jdk/test/com/sun/jdi/NewInstanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g NewInstanceTest.java * @run driver NewInstanceTest diff --git a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java index 89654c5c48e..f141466f348 100644 --- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java +++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test for -Xrunjdwp:[onthrow,onuncaught] suboptions require launch suboption * @author Tim Bell * + * @modules jdk.jdi * @run compile -g NoLaunchOptionTest.java * @build VMConnection * @run driver NoLaunchOptionTest diff --git a/jdk/test/com/sun/jdi/NoLocInfoTest.java b/jdk/test/com/sun/jdi/NoLocInfoTest.java index b0f0c50227d..71263c2fc39 100644 --- a/jdk/test/com/sun/jdi/NoLocInfoTest.java +++ b/jdk/test/com/sun/jdi/NoLocInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Serguei Spitsyn * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g:none NoLocInfoTest.java * @run driver NoLocInfoTest diff --git a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java index 0d9be44cde3..2afad2121cb 100644 --- a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java +++ b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7105883 * @summary Ensure that JDWP doesn't crash with a null thread group name * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run driver NullThreadGroupNameTest */ diff --git a/jdk/test/com/sun/jdi/OnThrowTest.java b/jdk/test/com/sun/jdi/OnThrowTest.java index 0e0705260f4..ce9725663c6 100644 --- a/jdk/test/com/sun/jdi/OnThrowTest.java +++ b/jdk/test/com/sun/jdi/OnThrowTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test for -agentlib::[onthrow,launch] * @author Kelly O'Hair * + * @modules jdk.jdi * @run compile -g OnThrowTest.java * @run compile -g OnThrowTarget.java * @run compile -g VMConnection.java diff --git a/jdk/test/com/sun/jdi/OptionTest.java b/jdk/test/com/sun/jdi/OptionTest.java index 3278588a3e5..967146c737f 100644 --- a/jdk/test/com/sun/jdi/OptionTest.java +++ b/jdk/test/com/sun/jdi/OptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test for misc jdwp options, just that the option is parsed * @author Kelly O'Hair (copied from Tim Bell's NoLaunchOptionTest) * + * @modules jdk.jdi * @run compile -g OptionTest.java * @run compile -g HelloWorld.java * @run compile -g VMConnection.java diff --git a/jdk/test/com/sun/jdi/PopAndInvokeTest.java b/jdk/test/com/sun/jdi/PopAndInvokeTest.java index a736cc4a0f9..65cd5a5a0d4 100644 --- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java +++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /** * @test * @bug 6517249 + * @modules jdk.jdi * @ignore 6951287 * @summary JDWP: Cannot do an invokeMethod after a popFrames operation * diff --git a/jdk/test/com/sun/jdi/PopAndStepTest.java b/jdk/test/com/sun/jdi/PopAndStepTest.java index 5debf27cfa6..a0150fae110 100644 --- a/jdk/test/com/sun/jdi/PopAndStepTest.java +++ b/jdk/test/com/sun/jdi/PopAndStepTest.java @@ -8,6 +8,7 @@ * @author jjh * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g PopAndStepTest.java * @run driver PopAndStepTest @@ -23,20 +24,20 @@ import java.util.*; class PopAndStepTarg { public void B() { System.out.println("debuggee: in B"); - System.out.println("debuggee: in B, back to A"); // add line breakpoint here line 26 !!! + System.out.println("debuggee: in B, back to A"); // add line breakpoint here line 27 !!! } public void A() { - System.out.println("debuggee: in A, about to call B"); // line 30 + System.out.println("debuggee: in A, about to call B"); // line 31 B(); - System.out.println("debuggee: in A, back from B"); // line 32 - throw new RuntimeException("debuggee: Got to line 33"); + System.out.println("debuggee: in A, back from B"); // line 33 + throw new RuntimeException("debuggee: Got to line 34"); } public static void main(String[] args) { - System.out.println("debuggee: Howdy!"); // line 37 - PopAndStepTarg xxx = new PopAndStepTarg(); // line 39 - xxx.A(); // line 40 + System.out.println("debuggee: Howdy!"); // line 38 + PopAndStepTarg xxx = new PopAndStepTarg(); // line 40 + xxx.A(); // line 41 System.out.println("debugee: Goodbye from PopAndStepTarg!"); } } @@ -115,10 +116,10 @@ public class PopAndStepTest extends TestScaffold { BreakpointEvent bpe = startToMain("PopAndStepTarg"); targetClass = bpe.location().declaringType(); mainThread = bpe.thread(); - getDebuggeeLineNum(37); + getDebuggeeLineNum(38); - println("Resuming to line 26"); - bpe = resumeTo("PopAndStepTarg", 26); getDebuggeeLineNum(26); + println("Resuming to line 27"); + bpe = resumeTo("PopAndStepTarg", 27); getDebuggeeLineNum(27); // The failure is this: // create step request @@ -140,22 +141,22 @@ public class PopAndStepTest extends TestScaffold { srInto.enable(); // This fails mainThread.popFrames(frameFor("A")); //srInto.enable(); // if the enable is moved here, it passes - println("Popped back to line 40 in main, the call to A()"); - println("Stepping into line 30"); + println("Popped back to line 41 in main, the call to A()"); + println("Stepping into line 31"); waitForRequestedEvent(srInto); // println srInto.disable(); - getDebuggeeLineNum(30); - - // The failure occurs here. - println("Stepping over to line 31"); - stepOverLine(mainThread); // println getDebuggeeLineNum(31); + // The failure occurs here. println("Stepping over to line 32"); - stepOverLine(mainThread); // call to B() + stepOverLine(mainThread); // println getDebuggeeLineNum(32); + println("Stepping over to line 33"); + stepOverLine(mainThread); // call to B() + getDebuggeeLineNum(33); + vm().exit(0); if (testFailed) { diff --git a/jdk/test/com/sun/jdi/PopAsynchronousTest.java b/jdk/test/com/sun/jdi/PopAsynchronousTest.java index 19523cf1be9..2adf47e7c56 100644 --- a/jdk/test/com/sun/jdi/PopAsynchronousTest.java +++ b/jdk/test/com/sun/jdi/PopAsynchronousTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g PopAsynchronousTest.java * @run driver PopAsynchronousTest diff --git a/jdk/test/com/sun/jdi/PopSynchronousTest.java b/jdk/test/com/sun/jdi/PopSynchronousTest.java index e6870b6385a..674e17e26c8 100644 --- a/jdk/test/com/sun/jdi/PopSynchronousTest.java +++ b/jdk/test/com/sun/jdi/PopSynchronousTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g PopSynchronousTest.java * @run driver PopSynchronousTest diff --git a/jdk/test/com/sun/jdi/ProcessAttachTest.java b/jdk/test/com/sun/jdi/ProcessAttachTest.java index 972f27b04db..6ee43f52e65 100644 --- a/jdk/test/com/sun/jdi/ProcessAttachTest.java +++ b/jdk/test/com/sun/jdi/ProcessAttachTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import com.sun.jdi.connect.IllegalConnectorArgumentsException; * @summary Unit test for ProcessAttachingConnector * * @library /lib/testlibrary + * @modules java.management + * jdk.jdi * @build jdk.testlibrary.* ProcessAttachTest * @run driver ProcessAttachTest */ diff --git a/jdk/test/com/sun/jdi/RedefineCrossEvent.java b/jdk/test/com/sun/jdi/RedefineCrossEvent.java index f7f3415ab0b..69f24b33b99 100644 --- a/jdk/test/com/sun/jdi/RedefineCrossEvent.java +++ b/jdk/test/com/sun/jdi/RedefineCrossEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * * @author Robert Field * + * @modules java.corba + * jdk.jdi * @run build TestScaffold VMConnection TargetAdapter TargetListener * @run compile -g AccessSpecifierTest.java * @run compile -g AfterThreadDeathTest.java diff --git a/jdk/test/com/sun/jdi/RedefineCrossStart.java b/jdk/test/com/sun/jdi/RedefineCrossStart.java index 7e2beb97dfc..51869c6cf36 100644 --- a/jdk/test/com/sun/jdi/RedefineCrossStart.java +++ b/jdk/test/com/sun/jdi/RedefineCrossStart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g CountEvent.java * @run compile -g CountFilterTest.java diff --git a/jdk/test/com/sun/jdi/ReferrersTest.java b/jdk/test/com/sun/jdi/ReferrersTest.java index 01fccc24d88..b78a5618019 100644 --- a/jdk/test/com/sun/jdi/ReferrersTest.java +++ b/jdk/test/com/sun/jdi/ReferrersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Add support for backtracking reference graph. * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ReferrersTest.java * @run driver ReferrersTest diff --git a/jdk/test/com/sun/jdi/RepStep.java b/jdk/test/com/sun/jdi/RepStep.java index 0ce8ade1335..fce9c2bda8b 100644 --- a/jdk/test/com/sun/jdi/RepStep.java +++ b/jdk/test/com/sun/jdi/RepStep.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4334008 * @author Robert Field * + * @modules jdk.jdi * @run compile -g RepStepTarg.java * @run build VMConnection RepStep * diff --git a/jdk/test/com/sun/jdi/RequestReflectionTest.java b/jdk/test/com/sun/jdi/RequestReflectionTest.java index aea14515d29..41e3e4f4b7c 100644 --- a/jdk/test/com/sun/jdi/RequestReflectionTest.java +++ b/jdk/test/com/sun/jdi/RequestReflectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4425840 * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g RequestReflectionTest.java * @run driver RequestReflectionTest diff --git a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java index aa2682307b0..39bc76a0743 100644 --- a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java +++ b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g ResumeOneThreadTest.java * @run driver ResumeOneThreadTest diff --git a/jdk/test/com/sun/jdi/RunToExit.java b/jdk/test/com/sun/jdi/RunToExit.java index f76f4b0b9fa..4ace70d4ea9 100644 --- a/jdk/test/com/sun/jdi/RunToExit.java +++ b/jdk/test/com/sun/jdi/RunToExit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 4997445 * @summary Test that with server=y, when VM runs to System.exit() no error happens * @library /lib/testlibrary + * @modules java.management + * jdk.jdi * @build jdk.testlibrary.* VMConnection RunToExit Exit0 * @run driver RunToExit */ diff --git a/jdk/test/com/sun/jdi/SDENullTest.java b/jdk/test/com/sun/jdi/SDENullTest.java index 7c377890d87..32c08b74482 100644 --- a/jdk/test/com/sun/jdi/SDENullTest.java +++ b/jdk/test/com/sun/jdi/SDENullTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SDENullTest.java * @run driver SDENullTest diff --git a/jdk/test/com/sun/jdi/SimulResumerTest.java b/jdk/test/com/sun/jdi/SimulResumerTest.java index 9ca23e68695..e05f27eb8d1 100644 --- a/jdk/test/com/sun/jdi/SimulResumerTest.java +++ b/jdk/test/com/sun/jdi/SimulResumerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SimulResumerTest.java * @run driver SimulResumerTest diff --git a/jdk/test/com/sun/jdi/SourceNameFilterTest.java b/jdk/test/com/sun/jdi/SourceNameFilterTest.java index a5bd15933c1..ae3a0a2fd9f 100644 --- a/jdk/test/com/sun/jdi/SourceNameFilterTest.java +++ b/jdk/test/com/sun/jdi/SourceNameFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SourceNameFilterTest.java * @run driver SourceNameFilterTest diff --git a/jdk/test/com/sun/jdi/StepTest.java b/jdk/test/com/sun/jdi/StepTest.java index 2ea94ee3fab..4e829e94bfa 100644 --- a/jdk/test/com/sun/jdi/StepTest.java +++ b/jdk/test/com/sun/jdi/StepTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4270488 4787861 * @author Gordon Hirsch * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetAdapter TargetListener * @run compile -g MethodCalls.java * @run compile -g MethodCallsReflection.java diff --git a/jdk/test/com/sun/jdi/SuspendNoFlagTest.java b/jdk/test/com/sun/jdi/SuspendNoFlagTest.java index ad506f500ce..8f91db2bac5 100644 --- a/jdk/test/com/sun/jdi/SuspendNoFlagTest.java +++ b/jdk/test/com/sun/jdi/SuspendNoFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ import jdk.testlibrary.ProcessTools; * @bug 4914611 * @summary Test for JDWP: -agentlib:jdwp=suspend=n hanging * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibarary.* * @compile -g HelloWorld.java * @run driver SuspendNoFlagTest diff --git a/jdk/test/com/sun/jdi/SuspendThreadTest.java b/jdk/test/com/sun/jdi/SuspendThreadTest.java index 90f135bb347..c70a58bff37 100644 --- a/jdk/test/com/sun/jdi/SuspendThreadTest.java +++ b/jdk/test/com/sun/jdi/SuspendThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SuspendThreadTest.java * @run driver SuspendThreadTest diff --git a/jdk/test/com/sun/jdi/TemplateTest.java b/jdk/test/com/sun/jdi/TemplateTest.java index 3539c88f087..cff19abd733 100644 --- a/jdk/test/com/sun/jdi/TemplateTest.java +++ b/jdk/test/com/sun/jdi/TemplateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author <AUTHOR> * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g TemplateTest.java * @run driver TemplateTest diff --git a/jdk/test/com/sun/jdi/ThreadGroupTest.java b/jdk/test/com/sun/jdi/ThreadGroupTest.java index e3c0132cbb9..cdd0f361f8d 100644 --- a/jdk/test/com/sun/jdi/ThreadGroupTest.java +++ b/jdk/test/com/sun/jdi/ThreadGroupTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * destroyed this should not impact subsequent thread creation by * the virtual machine manager. * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile ThreadGroupTest.java * @run driver ThreadGroupTest diff --git a/jdk/test/com/sun/jdi/TwoThreadsTest.java b/jdk/test/com/sun/jdi/TwoThreadsTest.java index 67f64c4df96..ca981d9b6e9 100644 --- a/jdk/test/com/sun/jdi/TwoThreadsTest.java +++ b/jdk/test/com/sun/jdi/TwoThreadsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g TwoThreadsTest.java * @run driver TwoThreadsTest diff --git a/jdk/test/com/sun/jdi/UTF8Test.java b/jdk/test/com/sun/jdi/UTF8Test.java index 182087c0a5d..1325a0a48db 100644 --- a/jdk/test/com/sun/jdi/UTF8Test.java +++ b/jdk/test/com/sun/jdi/UTF8Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g UTF8Test.java * @run driver UTF8Test diff --git a/jdk/test/com/sun/jdi/UnpreparedByName.java b/jdk/test/com/sun/jdi/UnpreparedByName.java index 12586def42f..9e6b3d59922 100644 --- a/jdk/test/com/sun/jdi/UnpreparedByName.java +++ b/jdk/test/com/sun/jdi/UnpreparedByName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g InnerTarg.java * @run build UnpreparedByName diff --git a/jdk/test/com/sun/jdi/UnpreparedClasses.java b/jdk/test/com/sun/jdi/UnpreparedClasses.java index f41dfed7dd8..013b5ddcc33 100644 --- a/jdk/test/com/sun/jdi/UnpreparedClasses.java +++ b/jdk/test/com/sun/jdi/UnpreparedClasses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g InnerTarg.java * @run build UnpreparedClasses diff --git a/jdk/test/com/sun/jdi/VMDeathLastTest.java b/jdk/test/com/sun/jdi/VMDeathLastTest.java index 954c9eae955..0df54af3894 100644 --- a/jdk/test/com/sun/jdi/VMDeathLastTest.java +++ b/jdk/test/com/sun/jdi/VMDeathLastTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g HelloWorld.java * @run build VMDeathLastTest diff --git a/jdk/test/com/sun/jdi/VMDeathRequestTest.java b/jdk/test/com/sun/jdi/VMDeathRequestTest.java index 9e1d65d3abe..784ddaf4a30 100644 --- a/jdk/test/com/sun/jdi/VMDeathRequestTest.java +++ b/jdk/test/com/sun/jdi/VMDeathRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4419314 * @author Robert Field * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g HelloWorld.java * @run build VMDeathRequestTest diff --git a/jdk/test/com/sun/jdi/VarargsTest.java b/jdk/test/com/sun/jdi/VarargsTest.java index 79ab25c561b..4bb015e8950 100644 --- a/jdk/test/com/sun/jdi/VarargsTest.java +++ b/jdk/test/com/sun/jdi/VarargsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author jjh * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g VarargsTest.java * @run driver VarargsTest diff --git a/jdk/test/com/sun/jdi/Vars.java b/jdk/test/com/sun/jdi/Vars.java index 369612f7fc2..c101e86fab5 100644 --- a/jdk/test/com/sun/jdi/Vars.java +++ b/jdk/test/com/sun/jdi/Vars.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library scaffold + * @modules jdk.jdi * @run build JDIScaffold VMConnection * @run compile -g Vars.java * @run driver Vars diff --git a/jdk/test/com/sun/jdi/VisibleMethods.java b/jdk/test/com/sun/jdi/VisibleMethods.java index 227f16b9724..2cc088571e5 100644 --- a/jdk/test/com/sun/jdi/VisibleMethods.java +++ b/jdk/test/com/sun/jdi/VisibleMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Staffan Larsen * + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g VisibleMethods.java * @run driver VisibleMethods diff --git a/jdk/test/com/sun/jdi/connect/spi/DebugUsingCustomConnector.java b/jdk/test/com/sun/jdi/connect/spi/DebugUsingCustomConnector.java index 377f8d4d2fd..a9928bc57ee 100644 --- a/jdk/test/com/sun/jdi/connect/spi/DebugUsingCustomConnector.java +++ b/jdk/test/com/sun/jdi/connect/spi/DebugUsingCustomConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * * This tests launches a debuggee using a custom LaunchingConnector. * + * @modules jdk.jdi/com.sun.tools.jdi * @build DebugUsingCustomConnector SimpleLaunchingConnector Foo NullTransportService * @run main/othervm DebugUsingCustomConnector */ diff --git a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java index 817e35a48ad..b2faba83049 100644 --- a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java +++ b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * to encapsulate the transport. This tests that the connectors are * created and that they have an "address" argument. * + * @modules jdk.jdi * @build GeneratedConnectors NullTransportService * @run main/othervm GeneratedConnectors */ diff --git a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh index d508c00c727..3ff44bdd226 100644 --- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh +++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. # 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/jdk/test/com/sun/jdi/connect/spi/SimpleLaunchingConnector.java b/jdk/test/com/sun/jdi/connect/spi/SimpleLaunchingConnector.java index 63517835734..5d23b9f1287 100644 --- a/jdk/test/com/sun/jdi/connect/spi/SimpleLaunchingConnector.java +++ b/jdk/test/com/sun/jdi/connect/spi/SimpleLaunchingConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +93,7 @@ public class SimpleLaunchingConnector implements LaunchingConnector { public SimpleLaunchingConnector() { try { - Class c = Class.forName("com.sun.tools.jdi.SocketTransportService"); + Class<?> c = Class.forName("com.sun.tools.jdi.SocketTransportService"); ts = (TransportService)c.newInstance(); } catch (Exception x) { throw new Error(x); diff --git a/jdk/test/com/sun/jdi/redefine/RedefineTest.java b/jdk/test/com/sun/jdi/redefine/RedefineTest.java index ebd60d89a70..1f8d1256900 100644 --- a/jdk/test/com/sun/jdi/redefine/RedefineTest.java +++ b/jdk/test/com/sun/jdi/redefine/RedefineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g RedefineTest.java * @run shell RedefineSetUp.sh diff --git a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java index ab9642678a1..d504a0e5cdc 100644 --- a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java +++ b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g RedefineTest.java * @run shell RedefineSetUp.sh diff --git a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java index 665c77e576d..e5a6d601177 100644 --- a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java +++ b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java @@ -6,6 +6,7 @@ * @author Robert Field / Jim Holmlund * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE * @run compile FilterMangleTest.java * @run compile -g onion/pickle/Mangle.java diff --git a/jdk/test/com/sun/jdi/sde/MangleStepTest.java b/jdk/test/com/sun/jdi/sde/MangleStepTest.java index 7e3329c5739..0d135f9411d 100644 --- a/jdk/test/com/sun/jdi/sde/MangleStepTest.java +++ b/jdk/test/com/sun/jdi/sde/MangleStepTest.java @@ -7,6 +7,7 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE * @run compile MangleStepTest.java * @run compile -g onion/pickle/Mangle.java diff --git a/jdk/test/com/sun/jdi/sde/MangleTest.java b/jdk/test/com/sun/jdi/sde/MangleTest.java index 2aa59941308..c766ffa5616 100644 --- a/jdk/test/com/sun/jdi/sde/MangleTest.java +++ b/jdk/test/com/sun/jdi/sde/MangleTest.java @@ -7,6 +7,7 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE * @run compile MangleTest.java * @run compile -g onion/pickle/Mangle.java diff --git a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java index bf9d49a5657..62b65147ea0 100644 --- a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java +++ b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java @@ -7,6 +7,7 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE * @run compile SourceDebugExtensionTest.java * @run compile -g SourceDebugExtensionTarg.java diff --git a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java index 0fd3fd9abb0..130e72a28ac 100644 --- a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java +++ b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java @@ -7,6 +7,7 @@ * @author Robert Field * * @library .. + * @modules jdk.jdi * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld * @run compile TemperatureTableTest.java * @run compile -g TemperatureTableServlet.java diff --git a/jdk/test/com/sun/jmx/remote/CCAdminReconnectTest.java b/jdk/test/com/sun/jmx/remote/CCAdminReconnectTest.java index a0ce27f0bf2..80530402cc4 100644 --- a/jdk/test/com/sun/jmx/remote/CCAdminReconnectTest.java +++ b/jdk/test/com/sun/jmx/remote/CCAdminReconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7009998 * @summary Tests the correct processing of concurrent ClientComunicatorAdmin reconnect requests. * @author Jaroslav Bachorik + * @modules java.management/com.sun.jmx.remote.internal * @run clean CCAdminReconnectTest * @run build CCAdminReconnectTest * @run main CCAdminReconnectTest diff --git a/jdk/test/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java b/jdk/test/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java index ad8009a4b07..0e5e5e30d4e 100644 --- a/jdk/test/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java +++ b/jdk/test/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import java.util.Arrays; * @author Jaroslav Bachorik * @bug 6937053 8005472 * + * @modules java.management + * jdk.compiler * @run clean TestSerializationMismatch * @run main/othervm TestSerializationMismatch * diff --git a/jdk/test/com/sun/management/CheckSomeMXBeanImplPackage.java b/jdk/test/com/sun/management/CheckSomeMXBeanImplPackage.java new file mode 100644 index 00000000000..4879a01bc82 --- /dev/null +++ b/jdk/test/com/sun/management/CheckSomeMXBeanImplPackage.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.PlatformManagedObject; + +/* + * @test + * @bug 8042901 + * @summary If jdk.management is present, GarbageCollectorMXBean and ThreadMXBean + * must be from com.sun.management.internal + * @author Shanliang Jiang + */ +public class CheckSomeMXBeanImplPackage { + private static String implPackageName = "com.sun.management.internal"; + + public static void main(String[] args) throws Exception { + boolean present = false; + try { + Class.forName("com.sun.management.GarbageCollectorMXBean"); + present = true; + } catch (ClassNotFoundException cnfe) {} + + if (present) { + Class <? extends PlatformManagedObject> klazz = + java.lang.management.GarbageCollectorMXBean.class; + for (Object obj : + ManagementFactory.getPlatformMXBeans(klazz)) { + check(klazz.getName(), obj); + } + + klazz = com.sun.management.GarbageCollectorMXBean.class; + for (Object obj : + ManagementFactory.getPlatformMXBeans(klazz)) { + check(klazz.getName(), obj); + } + + klazz = java.lang.management.ThreadMXBean.class; + check(klazz.getName(), + ManagementFactory.getPlatformMXBean(klazz)); + + klazz = com.sun.management.ThreadMXBean.class; + check(klazz.getName(), + ManagementFactory.getPlatformMXBean(klazz)); + + System.out.println("--- PASSED!"); + } else { + System.out.println("--- Skip the test, jdk.management module is not present!"); + } + } + + private static void check(String mbeanName, Object impl) { + if (!impl.getClass().getName().startsWith(implPackageName)) { + throw new RuntimeException(mbeanName+" implementation package " + + "should be: " + implPackageName + + ", but got: " + impl.getClass()); + } else { + System.out.println("--- Good, "+mbeanName+" got right implementation: " + impl); + } + } +} diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java index c2f1e23883c..3bfd07f89cf 100644 --- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java +++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for the DiagnosticCommandMBean * @author Frederic Parain, Shanliang JIANG * + * @modules jdk.management * @run main/othervm DcmdMBeanDoubleInvocationTest */ diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java index 343ae017948..a42070d646b 100644 --- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java +++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for the DiagnosticCommandMBean * @author Frederic Parain, Shanliang JIANG * + * @modules jdk.management * @run main/othervm DcmdMBeanInvocationTest */ diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java index 3499897dd9f..368731e9d85 100644 --- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java +++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Permissions Tests for the DiagnosticCommandMBean * @author Frederic Parain * + * @modules jdk.management * @run main/othervm DcmdMBeanPermissionsTest */ diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java index 9072b2c1359..8f988b2934a 100644 --- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java +++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for the DiagnosticCommandMBean * @author Frederic Parain, Shanliang JIANG * + * @modules jdk.management * @run main/othervm DcmdMBeanTest */ diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java index e823f3108b8..be135904128 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that GarbageCollectionNotification contents are reasonable * @author Frederic Parain * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false + * @modules jdk.management * @run main/othervm GarbageCollectionNotificationContentTest */ diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java index da8082ed2ad..599c9e900ef 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/GarbageCollectionNotificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that GarbageCollection notification are thrown by every GarbageCollectorMXBean * @author Frederic Parain * @requires vm.opt.ExplicitGCInvokesConcurrent == null | vm.opt.ExplicitGCInvokesConcurrent == false + * @modules jdk.management * @run main/othervm GarbageCollectionNotificationTest */ diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java index a60ae8a4d3b..c580c49df17 100644 --- a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java +++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo(). * @author Mandy Chung * + * @modules jdk.management * @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo */ // Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index 27d80ffa106..a93b7f07490 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 8028994 * @author Staffan Larsen * @library /lib/testlibrary + * @modules jdk.attach/sun.tools.attach + * jdk.management * @build jdk.testlibrary.* * @run main CheckOrigin */ diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh index 9d750c5627f..55aef40d183 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Sanity test for com.sun.management.HotSpotDiagnosticMXBean.dumpHeap # method # +# @modules jdk.management # @build DumpHeap # @run shell DumpHeap.sh diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java index 15b38fb7d05..7e3f247d36d 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for HotSpotDiagnosticMXBean.getDiagnosticOptions() * @author Daniel Fuchs * + * @modules jdk.management * @run main GetDiagnosticOptions */ diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java index 95c50f326c4..d181677d2ba 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption() and double values * @author Jaroslav Bachorik * + * @modules jdk.management * @run main/othervm -XX:CompileThresholdScaling=0.14 GetDoubleVMOption */ diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java index f00c7916d9a..16589749648 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption() * @author Mandy Chung * + * @modules jdk.management * @run main/othervm -XX:+PrintGCDetails GetVMOption */ diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java index c9806ea6d56..c630ef4d467 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for HotSpotDiagnosticMXBean.setVMOption() * @author Tomas Hurka, Daniel Fuchs * + * @modules jdk.management * @run main SetAllVMOptions */ diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java index 1e2b807c3d5..1c7117d91d0 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Mandy Chung * @author Jaroslav Bachorik * + * @modules jdk.management * @run main/othervm -XX:+PrintGCDetails SetVMOption */ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java index 880a72e13f9..44307313787 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 6191542 * @summary Basic unit test of OperatingSystemMXBean.getCommittedVirtualMemorySize() * @author Steve Bohne + * @modules jdk.management */ /* diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java index 7e01a3c5dd7..6747bc9c730 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of OperatingSystemMXBean.getFreePhysicalMemorySize() * @author Steve Bohne + * @modules jdk.management */ /* diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java index 0ca42fd4944..82ed7250ba8 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of OperatingSystemMXBean.getFreeSwapSpaceSize() * @author Steve Bohne + * @modules jdk.management */ /* diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java index c2e2637e593..697717836bb 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7028071 * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad() * + * @modules jdk.management * @run main GetProcessCpuLoad */ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java index c503127e0a8..1e1132a3bac 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuTime() * @author Steve Bohne + * @modules jdk.management */ /* diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java index b60c1d129bc..701b1fa0139 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7028071 * @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad() * + * @modules jdk.management * @run main GetSystemCpuLoad */ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java index afa3ae8bf4f..57eb80fc9c9 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of OperatingSystemMXBean.getTotalPhysicalMemorySize() * @author Steve Bohne + * @modules jdk.management */ /* diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java index 0925710c081..046dbcbce95 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * the GlobalMemoryStatus function can return incorrect information, * reporting a value of -1 to indicate an overflow. * + * @modules jdk.management * @run main MemoryStatusOverflow */ diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java index b21eb29b804..3bb1c714e60 100644 --- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java +++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java @@ -27,6 +27,7 @@ * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize() * * @library /lib/testlibrary + * @modules jdk.management * @build TestTotalSwap jdk.testlibrary.* * @run main TestTotalSwap * diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java index 6a230c77eed..1729662347e 100644 --- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6173675 * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes * @author Paul Hohensee + * @modules jdk.management */ import java.lang.management.*; diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java index 980189098cb..378abcada17 100644 --- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6173675 * @summary Basic test of ThreadMXBean.getThreadAllocatedBytes(long[]) * @author Paul Hohensee + * @modules jdk.management */ import java.lang.management.*; diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java index b364312f0bd..2e1046cc36e 100644 --- a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java +++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * getThreadUserTime(long[]). * @author Paul Hohensee * @key randomness + * @modules jdk.management */ import java.lang.management.*; diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh index c4cca4dd20e..a131bb522ba 100644 --- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh +++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary # @author Steve Bohne # +# @modules jdk.management # @run shell GetMaxFileDescriptorCount.sh # diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh index 579126693ad..f49069843c1 100644 --- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh +++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary # @author Steve Bohne # +# @modules jdk.management # @run shell GetOpenFileDescriptorCount.sh # diff --git a/jdk/test/com/sun/management/VMOptionOpenDataTest.java b/jdk/test/com/sun/management/VMOptionOpenDataTest.java new file mode 100644 index 00000000000..7f90fd5c705 --- /dev/null +++ b/jdk/test/com/sun/management/VMOptionOpenDataTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 com.sun.management.VMOption; +import java.io.InvalidObjectException; +import java.util.Objects; +import javax.management.openmbean.OpenDataException; +import sun.management.MappedMXBeanType; + +/* + * @test + * @bug 8042901 + * @summary Check that MappedMXBeanType.toOpenTypeData supports VMOption + * @author Shanliang Jiang + */ +public class VMOptionOpenDataTest { + public static void main(String[] args) throws Exception { + System.out.println("--- VMOptionOpenDataTest-main: Checking that " + + "MappedMXBeanType.toOpenTypeData supports VMOption"); + Exception failed = null; + try { + VMOption vo = new VMOption("toto", "titi", true, VMOption.Origin.OTHER); + System.out.println("--- Construct a VMOption object: \"" + vo + "\""); + + Object open = MappedMXBeanType.toOpenTypeData(vo, VMOption.class); + System.out.println("--- Map it to an open type: \"" + open +" \""); + + Object back = MappedMXBeanType.toJavaTypeData(open, VMOption.class); + System.out.println("--- Map it back to java type: \"" + back +" \""); + + if (back == null) { + failed = new RuntimeException("Failed, mapping back got null."); + } else if (!(back instanceof VMOption)) { + failed = new RuntimeException("Failed, not mapped back to a VMOption: " + +back.getClass()); + } else { + VMOption mapBack = (VMOption)back; + if (!Objects.equals(vo.getName(), mapBack.getName()) || + !Objects.equals(vo.getOrigin(), mapBack.getOrigin()) || + !Objects.equals(vo.getValue(), mapBack.getValue()) || + vo.isWriteable() != mapBack.isWriteable()) { + failed = new RuntimeException( + "Failed, failed to map back the original VMOtion."); + } + } + } catch (OpenDataException | InvalidObjectException ode) { + failed = ode; + } + if (failed == null) { + System.out.println("--- PASSED!"); + } else { + System.out.println("--- Failed: "+failed.getMessage()); + throw failed; + } + } +} diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java index e5f4b4bd941..896e6275930 100644 --- a/jdk/test/com/sun/tools/attach/BasicTests.java +++ b/jdk/test/com/sun/tools/attach/BasicTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,9 @@ import jdk.testlibrary.ProcessThread; * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 * @summary Basic unit tests for the VM attach mechanism. * @library /lib/testlibrary + * @modules java.instrument + * java.management + * jdk.jartool/sun.tools.jar * @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil * @run main BasicTests * diff --git a/jdk/test/com/sun/tools/attach/PermissionTest.java b/jdk/test/com/sun/tools/attach/PermissionTest.java index b171fcea593..530ce6bf806 100644 --- a/jdk/test/com/sun/tools/attach/PermissionTest.java +++ b/jdk/test/com/sun/tools/attach/PermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015 Oracle and/or its affiliates. All rights reserved. * 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,9 @@ import jdk.testlibrary.ProcessThread; * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 * @summary Basic unit tests for the VM attach mechanism. * @library /lib/testlibrary + * @modules java.management + * jdk.attach + * jdk.jartool/sun.tools.jar * @run build jdk.testlibrary.* Application * @run main PermissionTest * diff --git a/jdk/test/com/sun/tools/attach/ProviderTest.java b/jdk/test/com/sun/tools/attach/ProviderTest.java index 146c17f071b..c948e3b23b0 100644 --- a/jdk/test/com/sun/tools/attach/ProviderTest.java +++ b/jdk/test/com/sun/tools/attach/ProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015 Oracle and/or its affiliates. All rights reserved. * 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,9 @@ import com.sun.tools.attach.spi.AttachProvider; * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757 * @summary Basic unit tests for the VM attach mechanism. * @library /lib/testlibrary + * @modules java.management + * jdk.attach + * jdk.jartool/sun.tools.jar * @run build jdk.testlibrary.* SimpleProvider * @run main ProviderTest * diff --git a/jdk/test/com/sun/tools/attach/StartManagementAgent.java b/jdk/test/com/sun/tools/attach/StartManagementAgent.java index 9d367c04186..fd4ecef6def 100644 --- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java +++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. * 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,6 +40,9 @@ import jdk.testlibrary.Utils; * @test * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent * @library /lib/testlibrary + * @modules java.management + * jdk.attach + * jdk.jartool/sun.tools.jar * @run build Application SimpleProvider jdk.testlibrary.* * @run main/timeout=300 StartManagementAgent */ diff --git a/jdk/test/com/sun/tools/attach/TempDirTest.java b/jdk/test/com/sun/tools/attach/TempDirTest.java index 7aa41dc80d6..d4efc77919c 100644 --- a/jdk/test/com/sun/tools/attach/TempDirTest.java +++ b/jdk/test/com/sun/tools/attach/TempDirTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,8 @@ import jdk.testlibrary.ProcessThread; * @bug 8033104 * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set * @library /lib/testlibrary + * @modules java.management + * jdk.jartool/sun.tools.jar * @run build jdk.testlibrary.* Application RunnerUtil * @run main/timeout=200 TempDirTest */ diff --git a/jdk/test/demo/jvmti/minst/MinstTest.java b/jdk/test/demo/jvmti/minst/MinstTest.java index 9f198f415b9..b40afdf1004 100644 --- a/jdk/test/demo/jvmti/minst/MinstTest.java +++ b/jdk/test/demo/jvmti/minst/MinstTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ public class MinstTest { DemoRun demo; /* Run demo that uses JVMTI minst agent (no options) */ - demo = new DemoRun("minst", "exclude=java/*,exclude=javax/*,exclude=com/*,exclude=sun/*" /* options to minst */ ); + demo = new DemoRun("minst", "exclude=java/*,exclude=javax/*,exclude=com/*,exclude=jdk/*,exclude=sun/*" /* options to minst */ ); demo.runit(args[0]); /* Make sure patterns in output look ok */ diff --git a/jdk/test/java/lang/Class/getSimpleName/GetSimpleNameTest.java b/jdk/test/java/lang/Class/getSimpleName/GetSimpleNameTest.java new file mode 100644 index 00000000000..69382710191 --- /dev/null +++ b/jdk/test/java/lang/Class/getSimpleName/GetSimpleNameTest.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8057919 + * @summary Class.getSimpleName() should work for non-JLS compliant class names + */ +import jdk.internal.org.objectweb.asm.*; +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +public class GetSimpleNameTest { + static class NestedClass {} + class InnerClass {} + + static Class<?> f1() { + class LocalClass {} + return LocalClass.class; + } + + public static void main(String[] args) throws Exception { + assertEquals(NestedClass.class.getSimpleName(), "NestedClass"); + assertEquals( InnerClass.class.getSimpleName(), "InnerClass"); + assertEquals( f1().getSimpleName(), "LocalClass"); + + java.io.Serializable anon = new java.io.Serializable() {}; + assertEquals(anon.getClass().getSimpleName(), ""); + + // Java class names, prepended enclosing class name. + testNested("p.Outer$Nested", "p.Outer", "Nested"); + testInner( "p.Outer$Inner", "p.Inner", "Inner"); + testLocal( "p.Outer$1Local", "p.Outer", "Local"); + testAnon( "p.Outer$1", "p.Outer", ""); + + // Non-Java class names, prepended enclosing class name. + testNested("p.$C1$Nested", "p.$C1$", "Nested"); + testInner( "p.$C1$Inner", "p.$C1$", "Inner"); + testLocal( "p.$C1$Local", "p.$C1$", "Local"); + testAnon( "p.$C1$1", "p.$C1$", ""); + + // Non-Java class names, unrelated class names. + testNested("p1.$Nested$", "p2.$C1$", "Nested"); + testInner( "p1.$Inner$", "p2.$C1$", "Inner"); + testLocal( "p1.$Local$", "p2.$C1$", "Local"); + testAnon( "p1.$anon$", "p2.$C1$", ""); + } + + static void testNested(String innerName, String outerName, String simpleName) throws Exception { + BytecodeGenerator bg = new BytecodeGenerator(innerName, outerName, simpleName); + CustomCL cl = new CustomCL(innerName, outerName, bg.getNestedClasses(true), bg.getNestedClasses(false)); + assertEquals(cl.loadClass(innerName).getSimpleName(), simpleName); + } + + static void testInner(String innerName, String outerName, String simpleName) throws Exception { + BytecodeGenerator bg = new BytecodeGenerator(innerName, outerName, simpleName); + CustomCL cl = new CustomCL(innerName, outerName, bg.getInnerClasses(true), bg.getInnerClasses(false)); + assertEquals(cl.loadClass(innerName).getSimpleName(), simpleName); + } + + static void testLocal(String innerName, String outerName, String simpleName) throws Exception { + BytecodeGenerator bg = new BytecodeGenerator(innerName, outerName, simpleName); + CustomCL cl = new CustomCL(innerName, outerName, bg.getLocalClasses(true), bg.getLocalClasses(false)); + assertEquals(cl.loadClass(innerName).getSimpleName(), simpleName); + } + + static void testAnon(String innerName, String outerName, String simpleName) throws Exception { + BytecodeGenerator bg = new BytecodeGenerator(innerName, outerName, simpleName); + CustomCL cl = new CustomCL(innerName, outerName, bg.getAnonymousClasses(true), bg.getAnonymousClasses(false)); + assertEquals(cl.loadClass(innerName).getSimpleName(), simpleName); + } + + static void assertEquals(Object o1, Object o2) { + if (!java.util.Objects.equals(o1, o2)) { + throw new AssertionError(o1 + " != " + o2); + } + } + + static class CustomCL extends ClassLoader { + final String innerName; + final String outerName; + + final byte[] innerClassFile; + final byte[] outerClassFile; + + CustomCL(String innerName, String outerName, byte[] innerClassFile, byte[] outerClassFile) { + this.innerName = innerName; + this.outerName = outerName; + this.innerClassFile = innerClassFile; + this.outerClassFile = outerClassFile; + } + @Override + protected Class<?> findClass(String name) throws ClassNotFoundException { + if (innerName.equals(name)) { + return defineClass(innerName, innerClassFile, 0, innerClassFile.length); + } else if (outerName.equals(name)) { + return defineClass(outerName, outerClassFile, 0, outerClassFile.length); + } else { + throw new ClassNotFoundException(name); + } + } + } + + static class BytecodeGenerator { + final String innerName; + final String outerName; + final String simpleName; + + BytecodeGenerator(String innerName, String outerName, String simpleName) { + this.innerName = intl(innerName); + this.outerName = intl(outerName); + this.simpleName = simpleName; + } + + static String intl(String name) { return name.replace('.', '/'); } + + static void makeDefaultCtor(ClassWriter cw) { + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + + void makeCtxk(ClassWriter cw, boolean isInner) { + if (isInner) { + cw.visitOuterClass(outerName, "f", "()V"); + } else { + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f", "()V", null, null); + mv.visitCode(); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + } + + byte[] getNestedClasses(boolean isInner) { + String name = (isInner ? innerName : outerName); + ClassWriter cw = new ClassWriter(0); + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, name, null, "java/lang/Object", null); + + cw.visitInnerClass(innerName, outerName, simpleName, ACC_PUBLIC | ACC_STATIC); + + makeDefaultCtor(cw); + cw.visitEnd(); + return cw.toByteArray(); + } + + byte[] getInnerClasses(boolean isInner) { + String name = (isInner ? innerName : outerName); + ClassWriter cw = new ClassWriter(0); + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, name, null, "java/lang/Object", null); + + cw.visitInnerClass(innerName, outerName, simpleName, ACC_PUBLIC); + + makeDefaultCtor(cw); + cw.visitEnd(); + return cw.toByteArray(); + } + + byte[] getLocalClasses(boolean isInner) { + String name = (isInner ? innerName : outerName); + ClassWriter cw = new ClassWriter(0); + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, name, null, "java/lang/Object", null); + + cw.visitInnerClass(innerName, null, simpleName, ACC_PUBLIC | ACC_STATIC); + makeCtxk(cw, isInner); + + makeDefaultCtor(cw); + cw.visitEnd(); + return cw.toByteArray(); + } + + byte[] getAnonymousClasses(boolean isInner) { + String name = (isInner ? innerName : outerName); + ClassWriter cw = new ClassWriter(0); + cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, name, null, "java/lang/Object", null); + + cw.visitInnerClass(innerName, null, null, ACC_PUBLIC | ACC_STATIC); + makeCtxk(cw, isInner); + + makeDefaultCtor(cw); + cw.visitEnd(); + return cw.toByteArray(); + } + } +} diff --git a/jdk/test/java/lang/Thread/ThreadStateController.java b/jdk/test/java/lang/Thread/ThreadStateController.java index e2c6341b471..728a115c271 100644 --- a/jdk/test/java/lang/Thread/ThreadStateController.java +++ b/jdk/test/java/lang/Thread/ThreadStateController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.LockSupport; import jdk.testlibrary.LockFreeLogManager; +import jdk.testlibrary.Utils; /** * ThreadStateController allows a thread to request this thread to transition @@ -73,7 +74,7 @@ public class ThreadStateController extends Thread { public static void pause(long ms) { try { - Thread.sleep(ms); + Thread.sleep(Utils.adjustTimeout(ms)); } catch (InterruptedException e) { throw new RuntimeException(e); } @@ -135,7 +136,7 @@ public class ThreadStateController extends Thread { try { // this thread has escaped the BLOCKED state // release the lock and a short wait before continue - lock.wait(10); + lock.wait(Utils.adjustTimeout(10)); } catch (InterruptedException e) { // ignore interrupted.incrementAndGet(); @@ -165,7 +166,7 @@ public class ThreadStateController extends Thread { getId(), getName(), iterations.get(), interrupted.get()); try { stateChange(nextState); - lock.wait(10000); + lock.wait(Integer.MAX_VALUE); log("%d: %s wakes up from timed waiting (iterations %d interrupted %d)%n", getId(), getName(), iterations.get(), interrupted.get()); } catch (InterruptedException e) { @@ -185,7 +186,8 @@ public class ThreadStateController extends Thread { case S_TIMED_PARKED: { log("%d: %s is going to timed park (iterations %d)%n", getId(), getName(), iterations.get()); - long deadline = System.currentTimeMillis() + 10000*1000; + long deadline = System.currentTimeMillis() + + Utils.adjustTimeout(10000*1000); stateChange(nextState); LockSupport.parkUntil(deadline); break; @@ -195,7 +197,7 @@ public class ThreadStateController extends Thread { getId(), getName(), iterations.get(), interrupted.get()); try { stateChange(nextState); - Thread.sleep(1000000); + Thread.sleep(Utils.adjustTimeout(1000000)); } catch (InterruptedException e) { // finish sleeping interrupted.incrementAndGet(); diff --git a/jdk/test/java/lang/instrument/AddTransformerTest.java b/jdk/test/java/lang/instrument/AddTransformerTest.java index d750ff75cac..bd68b7d8b37 100644 --- a/jdk/test/java/lang/instrument/AddTransformerTest.java +++ b/jdk/test/java/lang/instrument/AddTransformerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary confirms that added transformers all really run * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build AddTransformerTest ATransformerManagementTestCase * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar AddTransformerTest AddTransformerTest diff --git a/jdk/test/java/lang/instrument/AppendToBootstrapClassPathTest.java b/jdk/test/java/lang/instrument/AppendToBootstrapClassPathTest.java index a9e50fd8567..be527f9ce84 100644 --- a/jdk/test/java/lang/instrument/AppendToBootstrapClassPathTest.java +++ b/jdk/test/java/lang/instrument/AppendToBootstrapClassPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple test for the Boot-Class-Path manifest attribute * @author Gabriel Adauto, Wily Technology, Robert Field, Sun Microsystems * + * @modules java.instrument * @run build AppendToBootstrapClassPathTest ExampleForBootClassPath * @run shell AppendToBootstrapClassPathSetUp.sh * @run shell MakeJAR.sh bootclasspathAgent diff --git a/jdk/test/java/lang/instrument/AppendToClassPathTest.java b/jdk/test/java/lang/instrument/AppendToClassPathTest.java index f4e99c599ea..d332814f20b 100644 --- a/jdk/test/java/lang/instrument/AppendToClassPathTest.java +++ b/jdk/test/java/lang/instrument/AppendToClassPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple test for the Class-Path manifest attribute * @author Gabriel Adauto, Wily Technology; Robert Field, Sun Microsystems * + * @modules java.instrument * @run build AppendToClassPathTest * @run shell AppendToClassPathSetUp.sh * @run shell MakeJAR.sh classpathAgent diff --git a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh index 79c4794513d..e0a564189fa 100644 --- a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh +++ b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Test non US-ASCII characters in the value of the Boot-Class-Path # attribute. # +# @modules java.instrument # @run shell/timeout=240 BootClassPathTest.sh if [ "${TESTJAVA}" = "" ] diff --git a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java index 5346f73b129..3b1b985020c 100644 --- a/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java +++ b/jdk/test/java/lang/instrument/DaemonThread/TestDaemonThread.java @@ -1,6 +1,6 @@ /* * Copyright 2014 Goldman Sachs. - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @summary Assert in java.lang.instrument agents during shutdown when classloading occurs after shutdown * @library /lib/testlibrary * + * @modules java.instrument + * java.management * @build jdk.testlibrary.* DummyAgent DummyClass TestDaemonThreadLauncher TestDaemonThread * @run shell ../MakeJAR3.sh DummyAgent * @run main/timeout=240 TestDaemonThreadLauncher diff --git a/jdk/test/java/lang/instrument/FromShutdownHook.java b/jdk/test/java/lang/instrument/FromShutdownHook.java index 03fe432fbc5..e6e9b43ff88 100644 --- a/jdk/test/java/lang/instrument/FromShutdownHook.java +++ b/jdk/test/java/lang/instrument/FromShutdownHook.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5050487 * @summary Check that Instrumentation methods can execute from a runtime * shutdown hook + * @modules java.instrument * @run build FromShutdownHook * @run shell MakeJAR.sh basicAgent * @run main/othervm -javaagent:basicAgent.jar FromShutdownHook FromShutdownHook diff --git a/jdk/test/java/lang/instrument/GetAllLoadedClassesTest.java b/jdk/test/java/lang/instrument/GetAllLoadedClassesTest.java index 4ac68370537..9f6e5d3890d 100644 --- a/jdk/test/java/lang/instrument/GetAllLoadedClassesTest.java +++ b/jdk/test/java/lang/instrument/GetAllLoadedClassesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple tests for getAllLoadedClasses (is Object there? does a newly loaded class show up?) * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build GetAllLoadedClassesTest DummyClass * @run shell MakeJAR.sh basicAgent * @run main/othervm -javaagent:basicAgent.jar GetAllLoadedClassesTest GetAllLoadedClassesTest diff --git a/jdk/test/java/lang/instrument/GetInitiatedClassesTest.java b/jdk/test/java/lang/instrument/GetInitiatedClassesTest.java index b2562428fee..ee0f43ddbbc 100644 --- a/jdk/test/java/lang/instrument/GetInitiatedClassesTest.java +++ b/jdk/test/java/lang/instrument/GetInitiatedClassesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple tests for getInitiatedClasses (does a newly loaded class show up?) * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build GetInitiatedClassesTest DummyClass * @run shell MakeJAR.sh basicAgent * @run main/othervm -javaagent:basicAgent.jar GetInitiatedClassesTest GetInitiatedClassesTest diff --git a/jdk/test/java/lang/instrument/GetObjectSizeTest.java b/jdk/test/java/lang/instrument/GetObjectSizeTest.java index 4563d38fd23..c9f543fe7f2 100644 --- a/jdk/test/java/lang/instrument/GetObjectSizeTest.java +++ b/jdk/test/java/lang/instrument/GetObjectSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary round-trip test for getObjectSize (does it return, and is the result non-zero?) * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build GetObjectSizeTest * @run shell MakeJAR.sh basicAgent * @run main/othervm -javaagent:basicAgent.jar GetObjectSizeTest GetObjectSizeTest diff --git a/jdk/test/java/lang/instrument/IsModifiableClassAgent.java b/jdk/test/java/lang/instrument/IsModifiableClassAgent.java index bb2130924ba..3a0e364226f 100644 --- a/jdk/test/java/lang/instrument/IsModifiableClassAgent.java +++ b/jdk/test/java/lang/instrument/IsModifiableClassAgent.java @@ -27,6 +27,7 @@ * @summary test isModifiableClass * @author Robert Field, Sun Microsystems * + * @modules java.instrument * @run build IsModifiableClassApp IsModifiableClassAgent * @run shell MakeJAR3.sh IsModifiableClassAgent 'Can-Retransform-Classes: true' * @run main/othervm -javaagent:IsModifiableClassAgent.jar IsModifiableClassApp diff --git a/jdk/test/java/lang/instrument/ManifestTest.sh b/jdk/test/java/lang/instrument/ManifestTest.sh index bb0497b1616..a9466905e80 100644 --- a/jdk/test/java/lang/instrument/ManifestTest.sh +++ b/jdk/test/java/lang/instrument/ManifestTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary JLI JAR manifest processing should ignore leading and trailing white space. # @author Daniel D. Daugherty # +# @modules java.instrument # @run build ManifestTestApp ExampleForBootClassPath # @run shell/timeout=900 ManifestTest.sh # diff --git a/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java index 05f9f1942ff..1973be456fd 100644 --- a/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java +++ b/jdk/test/java/lang/instrument/ManyMethodsBenchmarkAgent.java @@ -27,6 +27,9 @@ * @summary Tests and benchmarks the JVMTI RedefineClasses when a * single class (and its parent) contains many methods. * + * @modules java.compiler + * java.instrument + * jdk.compiler * @run build ManyMethodsBenchmarkApp ManyMethodsBenchmarkAgent * @run shell MakeJAR3.sh ManyMethodsBenchmarkAgent 'Can-Retransform-Classes: true' * @run main/othervm -javaagent:ManyMethodsBenchmarkAgent.jar ManyMethodsBenchmarkApp diff --git a/jdk/test/java/lang/instrument/NMTHelper.java b/jdk/test/java/lang/instrument/NMTHelper.java index ee5d1e1b882..09e60e4a623 100644 --- a/jdk/test/java/lang/instrument/NMTHelper.java +++ b/jdk/test/java/lang/instrument/NMTHelper.java @@ -27,8 +27,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.Arrays; import java.util.stream.Collectors; -import sun.management.ManagementFactoryHelper; -import com.sun.management.DiagnosticCommandMBean; +import java.lang.management.ManagementFactory; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; public class NMTHelper { @@ -53,7 +54,12 @@ public class NMTHelper } private static String executeDcmd(String cmd, String ... args) { - DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean(); + ObjectName oname = null; + try { + oname = ObjectName.getInstance("com.sun.management:type=DiagnosticCommand"); + } catch (MalformedObjectNameException mone) { + throw new RuntimeException(mone); + } Object[] dcmdArgs = {args}; String[] signature = {String[].class.getName()}; @@ -63,7 +69,8 @@ public class NMTHelper System.out.println("Output from Dcmd '" + cmdString + "' is being written to file " + f); try (FileWriter fw = new FileWriter(f)) { fw.write("> " + cmdString + ":"); - String result = (String) dcmd.invoke(cmd, dcmdArgs, signature); + String result = (String)ManagementFactory.getPlatformMBeanServer(). + invoke(oname, cmd, dcmdArgs, signature); fw.write(result); return result; } catch(Exception ex) { diff --git a/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java b/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java index 1a51a8b4953..1389001467c 100644 --- a/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java +++ b/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test setNativeMethodPrefix * @author Robert Field, Sun Microsystems * + * @modules java.base/jdk.internal.org.objectweb.asm * @run shell/timeout=240 MakeJAR2.sh NativeMethodPrefixAgent NativeMethodPrefixApp 'Can-Retransform-Classes: true' 'Can-Set-Native-Method-Prefix: true' * @run main/othervm -javaagent:NativeMethodPrefixAgent.jar NativeMethodPrefixApp */ diff --git a/jdk/test/java/lang/instrument/NoTransformerAddedTest.java b/jdk/test/java/lang/instrument/NoTransformerAddedTest.java index 6cc0407a96d..c559763d177 100644 --- a/jdk/test/java/lang/instrument/NoTransformerAddedTest.java +++ b/jdk/test/java/lang/instrument/NoTransformerAddedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary make sure no transformers run when none are registered * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build NoTransformerAddedTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar NoTransformerAddedTest NoTransformerAddedTest diff --git a/jdk/test/java/lang/instrument/NullGetObjectSizeTest.java b/jdk/test/java/lang/instrument/NullGetObjectSizeTest.java index a588a4076f0..5be2f7a0aeb 100644 --- a/jdk/test/java/lang/instrument/NullGetObjectSizeTest.java +++ b/jdk/test/java/lang/instrument/NullGetObjectSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary make sure getObjectSize(null) throws NullPointerException. * @author Robert Field as modified from the code of Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build NullGetObjectSizeTest * @run shell MakeJAR.sh basicAgent * @run main/othervm -javaagent:basicAgent.jar NullGetObjectSizeTest NullGetObjectSizeTest diff --git a/jdk/test/java/lang/instrument/NullRedefineClassesTests.java b/jdk/test/java/lang/instrument/NullRedefineClassesTests.java index cbc73426389..9a00b2cf355 100644 --- a/jdk/test/java/lang/instrument/NullRedefineClassesTests.java +++ b/jdk/test/java/lang/instrument/NullRedefineClassesTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary make sure redefineClasses throws NullPointerException in the right places. * @author Robert Field as modified from the code of Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build NullRedefineClassesTests * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar NullRedefineClassesTests NullRedefineClassesTests diff --git a/jdk/test/java/lang/instrument/NullTransformerAddTest.java b/jdk/test/java/lang/instrument/NullTransformerAddTest.java index 155f26884e4..42c874bf742 100644 --- a/jdk/test/java/lang/instrument/NullTransformerAddTest.java +++ b/jdk/test/java/lang/instrument/NullTransformerAddTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary make sure addTransformer(null) throws what it should * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build NullTransformerAddTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar NullTransformerAddTest NullTransformerAddTest diff --git a/jdk/test/java/lang/instrument/NullTransformerRemoveTest.java b/jdk/test/java/lang/instrument/NullTransformerRemoveTest.java index 39e0e3ee874..e366e1e0b99 100644 --- a/jdk/test/java/lang/instrument/NullTransformerRemoveTest.java +++ b/jdk/test/java/lang/instrument/NullTransformerRemoveTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary make sure removeTransformer(null) throws NullPointerException * @author Robert Field as modified from the code of Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build NullTransformerRemoveTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar NullTransformerRemoveTest NullTransformerRemoveTest diff --git a/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh b/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh index 0801f07e222..7a53fbccff6 100644 --- a/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh +++ b/jdk/test/java/lang/instrument/ParallelTransformerLoader.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Test parallel class loading by parallel transformers. # @author Daniel D. Daugherty as modified from the code of Daryl Puryear @ Wily # +# @modules java.instrument # @run shell MakeJAR3.sh ParallelTransformerLoaderAgent # @run build ParallelTransformerLoaderApp # @run shell/timeout=240 ParallelTransformerLoader.sh diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0010.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0010.java index 6d824f52c3e..96f6ff344a9 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0010.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0010.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (0,0,1,0): declared 2-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent0010 * @run main/othervm -javaagent:InheritAgent0010.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0011.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0011.java index 938b849fb4c..2e014176aeb 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0011.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0011.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (0,0,1,1): declared 2-arg and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent0011 * @run main/othervm -javaagent:InheritAgent0011.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0110.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0110.java index 268b3eb9eee..a8fca7575eb 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0110.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0110.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (0,1,1,0): inherited 1-arg and declared 2-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent0110 * @run main/othervm -javaagent:InheritAgent0110.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0111.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0111.java index cb8babc91ee..7f87dbaf6e9 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent0111.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent0111.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (0,1,1,1): inherited 1-arg, declared 2-arg and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent0111 * @run main/othervm -javaagent:InheritAgent0111.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1000.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1000.java index 1b90afa99d6..adb0dbdb720 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1000.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1000.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,0,0,0): inherited 2-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1000 * @run main/othervm -javaagent:InheritAgent1000.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1001.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1001.java index b87a76d56e8..ffa226d0e3e 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1001.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1001.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,0,0,1): inherited 2-arg, and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1001 * @run main/othervm -javaagent:InheritAgent1001.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1010.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1010.java index 7599c289097..dd4e080931a 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1010.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1010.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,0,1,0): inherited 2-arg, and declared 2-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1010 * @run main/othervm -javaagent:InheritAgent1010.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1011.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1011.java index 72f6e410170..0ca9694e151 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1011.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1011.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,0,1,1): inherited 2-arg, declared 2-arg and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1011 * @run main/othervm -javaagent:InheritAgent1011.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1100.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1100.java index bec7fa9c0df..4d204f92449 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1100.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1100.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,1,0,0): inherited 2-arg and inherited 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1100 * @run main/othervm -javaagent:InheritAgent1100.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1101.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1101.java index bebcaa50ef6..9c1aeffe80e 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1101.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1101.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,1,0,1): inherited 2-arg, inherited 1-arg, and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1101 * @run main/othervm -javaagent:InheritAgent1101.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1110.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1110.java index f56dc866f77..91870006664 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1110.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1110.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,1,1,0): inherited 2-arg, inherited 1-arg, and declared 2-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1110 * @run main/othervm -javaagent:InheritAgent1110.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1111.java b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1111.java index 2c9f568fcdb..7292e47ed4e 100644 --- a/jdk/test/java/lang/instrument/PremainClass/InheritAgent1111.java +++ b/jdk/test/java/lang/instrument/PremainClass/InheritAgent1111.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test config (1,1,1,1): inherited 2-arg, inherited 1-arg, declared 2-arg and declared 1-arg in agent class * @author Daniel D. Daugherty, Sun Microsystems * + * @modules java.instrument * @run shell ../MakeJAR3.sh InheritAgent1111 * @run main/othervm -javaagent:InheritAgent1111.jar DummyMain */ diff --git a/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java b/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java index ac01286cd71..29bf5623352 100644 --- a/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java +++ b/jdk/test/java/lang/instrument/PremainClass/NoPremainAgentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ import jdk.testlibrary.Utils; * @bug 6289149 * @summary test when the agent's class is missing the premain() function. * @library /lib/testlibrary + * @modules java.management * @run build jdk.testlibrary.* DummyMain * @run shell ../MakeJAR3.sh NoPremainAgent * @run main NoPremainAgentTest diff --git a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java index 9c25afa5dae..e717bce7076 100644 --- a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java +++ b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ import jdk.testlibrary.Utils; * @bug 5055293 * @summary Test non ascii characters in the Premain-Class attribute. * @library /lib/testlibrary + * @modules java.management * @run build jdk.testlibrary.* DummyMain * @run main PremainClassTest */ diff --git a/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java b/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java index 653f8331e51..b879aa10f23 100644 --- a/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java +++ b/jdk/test/java/lang/instrument/PremainClass/ZeroArgPremainAgentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ import jdk.testlibrary.Utils; * @bug 6289149 * @summary test when the agent's class has a zero arg premain() function. * @library /lib/testlibrary + * @modules java.management * @run build jdk.testlibrary.* DummyMain * @run shell ../MakeJAR3.sh ZeroArgPremainAgent * @run main ZeroArgPremainAgentTest diff --git a/jdk/test/java/lang/instrument/RedefineBigClass.sh b/jdk/test/java/lang/instrument/RedefineBigClass.sh index e5c84e7353a..0098bf596da 100644 --- a/jdk/test/java/lang/instrument/RedefineBigClass.sh +++ b/jdk/test/java/lang/instrument/RedefineBigClass.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Redefine a big class. # @author Daniel D. Daugherty # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineBigClassAgent 'Can-Redefine-Classes: true' # @run build BigClass RedefineBigClassApp NMTHelper # @run shell/timeout=600 RedefineBigClass.sh diff --git a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh index a24b03e557a..33bf105e488 100644 --- a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh +++ b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethod.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Redefine a class with a native method. # @author Daniel D. Daugherty as modified from the test submitted by clovis@par.univie.ac.at # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineClassWithNativeMethodAgent 'Can-Redefine-Classes: true' # @run build RedefineClassWithNativeMethodApp # @run shell RedefineClassWithNativeMethod.sh diff --git a/jdk/test/java/lang/instrument/RedefineClassesDisabledTest.java b/jdk/test/java/lang/instrument/RedefineClassesDisabledTest.java index 9276f80c056..682c8e7dbd7 100644 --- a/jdk/test/java/lang/instrument/RedefineClassesDisabledTest.java +++ b/jdk/test/java/lang/instrument/RedefineClassesDisabledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test that redefineClasses and isRedefineClassesSupported behave correctly when redefine is not enabled * @author Robert Field, Sun Microsystems -- as modified from the work of Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build RedefineClassesDisabledTest * @run shell RedefineSetUp.sh * @run shell MakeJAR.sh basicAgent diff --git a/jdk/test/java/lang/instrument/RedefineClassesTests.java b/jdk/test/java/lang/instrument/RedefineClassesTests.java index 794bc3a20f9..f7049f2f085 100644 --- a/jdk/test/java/lang/instrument/RedefineClassesTests.java +++ b/jdk/test/java/lang/instrument/RedefineClassesTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary insure redefine is supported. exercise a class, then redefine it and do it again * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build RedefineClassesTests * @run shell RedefineSetUp.sh * @run shell MakeJAR.sh redefineAgent diff --git a/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh b/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh index cec270b8200..088bb2998f4 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh +++ b/jdk/test/java/lang/instrument/RedefineMethodAddInvoke.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Reflexive invocation of newly added methods broken. # @author Daniel D. Daugherty # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineMethodAddInvokeAgent 'Can-Redefine-Classes: true' # @run build RedefineMethodAddInvokeApp # @run shell RedefineMethodAddInvoke.sh diff --git a/jdk/test/java/lang/instrument/RedefineMethodDelInvoke.sh b/jdk/test/java/lang/instrument/RedefineMethodDelInvoke.sh index f1f9ac6db7e..bd7cea3cf19 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodDelInvoke.sh +++ b/jdk/test/java/lang/instrument/RedefineMethodDelInvoke.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @author Daniel D. Daugherty # @author Serguei Spitsyn # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineMethodDelInvokeAgent 'Can-Redefine-Classes: true' # @run build RedefineMethodDelInvokeApp # @run shell RedefineMethodDelInvoke.sh diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh b/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh index 4ebaaa8e73b..c15f4597c77 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Redefine a class with a method stored in a backtrace. # @author Stefan Karlsson # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineMethodInBacktraceAgent 'Can-Redefine-Classes: true' # @run build RedefineMethodInBacktraceTarget RedefineMethodInBacktraceApp # @run shell RedefineMethodInBacktrace.sh @@ -77,7 +78,7 @@ fi cat output.log -MESG="Exception" +MESG="Test failed" grep "$MESG" output.log result=$? if [ "$result" = 0 ]; then diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java index 7f7ddbf19b1..d406ae0ceed 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 +31,8 @@ import java.lang.management.ThreadInfo; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.concurrent.CountDownLatch; -import sun.management.ManagementFactoryHelper; +import javax.management.JMX; +import javax.management.ObjectName; /** * When an exception is thrown, the JVM collects just enough information @@ -46,12 +47,15 @@ import sun.management.ManagementFactoryHelper; * could be freed, since class redefinition didn't know about the backtraces. */ public class RedefineMethodInBacktraceApp { + static boolean failed = false; + public static void main(String args[]) throws Exception { System.out.println("Hello from RedefineMethodInBacktraceApp!"); - new RedefineMethodInBacktraceApp().doTest(); - System.exit(0); + if (failed) { + throw new Exception("ERROR: RedefineMethodInBacktraceApp failed."); + } } public static CountDownLatch stop = new CountDownLatch(1); @@ -63,13 +67,18 @@ public class RedefineMethodInBacktraceApp { } private void doMethodInBacktraceTest() throws Exception { - Throwable t = getThrowableFromMethodToRedefine(); + Throwable t1 = getThrowableFromMethodToRedefine(); + Throwable t2 = getThrowableFromMethodToDelete(); doRedefine(RedefineMethodInBacktraceTarget.class); doClassUnloading(); - touchRedefinedMethodInBacktrace(t); + System.out.println("checking backtrace for throwable from methodToRedefine"); + touchRedefinedMethodInBacktrace(t1); + + System.out.println("checking backtrace for throwable from methodToDelete"); + touchRedefinedMethodInBacktrace(t2); } private void doMethodInBacktraceTestB() throws Exception { @@ -95,8 +104,11 @@ public class RedefineMethodInBacktraceApp { String[] threadPrintArgs = {}; Object[] dcmdArgs = {threadPrintArgs}; String[] signature = {String[].class.getName()}; - DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean(); - System.out.println(dcmd.invoke("threadPrint", dcmdArgs, signature)); + System.out.println(ManagementFactory.getPlatformMBeanServer().invoke( + ObjectName.getInstance("com.sun.management:type=DiagnosticCommand"), + "threadPrint", + dcmdArgs, + signature)); // release the thread stop.countDown(); @@ -115,6 +127,10 @@ public class RedefineMethodInBacktraceApp { if (!(thrownFromMethodToRedefine instanceof RuntimeException)) { throw e; } + } catch (Exception e) { + e.printStackTrace(); + System.out.println("\nTest failed: unexpected exception: " + e.toString()); + failed = true; } method = null; c = null; @@ -122,15 +138,49 @@ public class RedefineMethodInBacktraceApp { return thrownFromMethodToRedefine; } + private static Throwable getThrowableFromMethodToDelete() throws Exception { + Class<RedefineMethodInBacktraceTarget> c = + RedefineMethodInBacktraceTarget.class; + Method method = c.getMethod("callMethodToDelete"); + + Throwable thrownFromMethodToDelete = null; + try { + method.invoke(null); + } catch (InvocationTargetException e) { + thrownFromMethodToDelete = e.getCause(); + if (!(thrownFromMethodToDelete instanceof RuntimeException)) { + throw e; + } + } catch (Exception e) { + e.printStackTrace(); + System.out.println("\nTest failed: unexpected exception: " + e.toString()); + failed = true; + } + return thrownFromMethodToDelete; + } + + private static void doClassUnloading() { // This will clean out old, unused redefined methods. System.gc(); } private static void touchRedefinedMethodInBacktrace(Throwable throwable) { + throwable.printStackTrace(); // Make sure that we can convert the backtrace, which is referring to // the redefined method, to a StrackTraceElement[] without crashing. - throwable.getStackTrace(); + StackTraceElement[] stackTrace = throwable.getStackTrace(); + for (int i = 0; i < stackTrace.length; i++) { + StackTraceElement frame = stackTrace[i]; + if (frame.getClassName() == null) { + System.out.println("\nTest failed: trace[" + i + "].getClassName() returned null"); + failed = true; + } + if (frame.getMethodName() == null) { + System.out.println("\nTest failed: trace[" + i + "].getMethodName() returned null"); + failed = true; + } + } } private static void doRedefine(Class<?> clazz) throws Exception { diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java index fad881137c8..d1c1e33078d 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java @@ -29,4 +29,13 @@ public class RedefineMethodInBacktraceTarget { public static void methodToRedefine() { throw new RuntimeException("Test exception"); } + + public static void callMethodToDelete() { + methodToDelete(); + } + + private static void methodToDelete() { + throw new RuntimeException("Test exception in methodToDelete"); + } + } diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java index baefeb78703..d7fb6f7857a 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java @@ -37,4 +37,16 @@ public class RedefineMethodInBacktraceTargetB { // ignore, test will fail } } + + public static void callMethodToDelete() { + try { + // signal that we are here + RedefineMethodInBacktraceApp.called.countDown(); + + // wait until test is done + RedefineMethodInBacktraceApp.stop.await(); + } catch (InterruptedException ex) { + // ignore, test will fail + } + } } diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java index de98206a8dd..33c6e7103e2 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java @@ -28,4 +28,7 @@ public class RedefineMethodInBacktraceTargetB { public static void methodToRedefine() { } + + public static void callMethodToDelete() { + } } diff --git a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java index d2ba2259932..a7d9dc666a1 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java +++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java @@ -29,4 +29,8 @@ public class RedefineMethodInBacktraceTarget { public static void methodToRedefine() { throw new RuntimeException("Test exception 2"); } + + public static void callMethodToDelete() { + throw new RuntimeException("Test exception 2 in callMethodToDelete"); + } } diff --git a/jdk/test/java/lang/instrument/RedefineMethodWithAnnotations.sh b/jdk/test/java/lang/instrument/RedefineMethodWithAnnotations.sh index b8f869cd02a..022b6c586d0 100644 --- a/jdk/test/java/lang/instrument/RedefineMethodWithAnnotations.sh +++ b/jdk/test/java/lang/instrument/RedefineMethodWithAnnotations.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Method annotations are incorrectly set when redefining classes. # @author Stefan Karlsson # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineMethodWithAnnotationsAgent 'Can-Redefine-Classes: true' # @run build RedefineMethodWithAnnotationsTarget RedefineMethodWithAnnotationsApp RedefineMethodWithAnnotationsAnnotations # @run shell RedefineMethodWithAnnotations.sh diff --git a/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh b/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh index 850fac252a1..ba5968ffabf 100644 --- a/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh +++ b/jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # verify that the right methods are called. # @author Daniel D. Daugherty # +# @modules java.instrument # @run shell MakeJAR3.sh RedefineSubclassWithTwoInterfacesAgent 'Can-Redefine-Classes: true' # @run build RedefineSubclassWithTwoInterfacesApp # @run shell RedefineSubclassWithTwoInterfaces.sh diff --git a/jdk/test/java/lang/instrument/RemoveAbsentTransformerTest.java b/jdk/test/java/lang/instrument/RemoveAbsentTransformerTest.java index 969f5993b2d..8867857c372 100644 --- a/jdk/test/java/lang/instrument/RemoveAbsentTransformerTest.java +++ b/jdk/test/java/lang/instrument/RemoveAbsentTransformerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary remove an transformer that was never added * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build RemoveAbsentTransformerTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar RemoveAbsentTransformerTest RemoveAbsentTransformerTest diff --git a/jdk/test/java/lang/instrument/RemoveTransformerTest.java b/jdk/test/java/lang/instrument/RemoveTransformerTest.java index 3daacf8b356..02ba298421c 100644 --- a/jdk/test/java/lang/instrument/RemoveTransformerTest.java +++ b/jdk/test/java/lang/instrument/RemoveTransformerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple remove of a transformer that was added * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build RemoveTransformerTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar RemoveTransformerTest RemoveTransformerTest diff --git a/jdk/test/java/lang/instrument/RetransformAgent.java b/jdk/test/java/lang/instrument/RetransformAgent.java index 99d2bc089ed..4e1bdac4519 100644 --- a/jdk/test/java/lang/instrument/RetransformAgent.java +++ b/jdk/test/java/lang/instrument/RetransformAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test retransformClasses * @author Robert Field, Sun Microsystems * + * @modules java.base/jdk.internal.org.objectweb.asm * @run shell/timeout=240 MakeJAR2.sh RetransformAgent RetransformApp 'Can-Retransform-Classes: true' * @run main/othervm -javaagent:RetransformAgent.jar RetransformApp */ diff --git a/jdk/test/java/lang/instrument/RetransformBigClass.sh b/jdk/test/java/lang/instrument/RetransformBigClass.sh index 332dd3269b7..8f9d992f422 100644 --- a/jdk/test/java/lang/instrument/RetransformBigClass.sh +++ b/jdk/test/java/lang/instrument/RetransformBigClass.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Retransform a big class. # @author Daniel D. Daugherty # +# @modules java.instrument # @run shell MakeJAR4.sh RetransformBigClassAgent SimpleIdentityTransformer 'Can-Retransform-Classes: true' # @run build BigClass RetransformBigClassApp NMTHelper # @run shell/timeout=600 RetransformBigClass.sh diff --git a/jdk/test/java/lang/instrument/SingleTransformerTest.java b/jdk/test/java/lang/instrument/SingleTransformerTest.java index d04adf1b266..e87e838c520 100644 --- a/jdk/test/java/lang/instrument/SingleTransformerTest.java +++ b/jdk/test/java/lang/instrument/SingleTransformerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary simple test with one transformer (makes sure it gets called) * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build SingleTransformerTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar SingleTransformerTest SingleTransformerTest diff --git a/jdk/test/java/lang/instrument/StressGetObjectSizeTest.sh b/jdk/test/java/lang/instrument/StressGetObjectSizeTest.sh index b410d1b17ba..c7027159d17 100644 --- a/jdk/test/java/lang/instrument/StressGetObjectSizeTest.sh +++ b/jdk/test/java/lang/instrument/StressGetObjectSizeTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary stress getObjectSize() API # @author Daniel D. Daugherty as modified from the code of fischman@google.com # +# @modules java.instrument # @run build StressGetObjectSizeApp # @run shell MakeJAR.sh basicAgent # @run shell StressGetObjectSizeTest.sh diff --git a/jdk/test/java/lang/instrument/TransformMethodTest.java b/jdk/test/java/lang/instrument/TransformMethodTest.java index 610729f1185..6c29f04367a 100644 --- a/jdk/test/java/lang/instrument/TransformMethodTest.java +++ b/jdk/test/java/lang/instrument/TransformMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary test transformer add/remove pairs in sequence * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build TransformMethodTest * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar TransformMethodTest TransformMethodTest diff --git a/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java b/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java index 0f4661e23bf..b00d403f2cc 100644 --- a/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java +++ b/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary multi-thread test to exercise sync and contention for adds to transformer registry * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build TransformerManagementThreadAddTests * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar TransformerManagementThreadAddTests TransformerManagementThreadAddTests diff --git a/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java b/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java index 49bff4dd4f3..66404446052 100644 --- a/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java +++ b/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary multi-thread test to exercise sync and contention for removes to transformer registry * @author Gabriel Adauto, Wily Technology * + * @modules java.instrument * @run build TransformerManagementThreadRemoveTests * @run shell MakeJAR.sh redefineAgent * @run main/othervm -javaagent:redefineAgent.jar TransformerManagementThreadRemoveTests TransformerManagementThreadRemoveTests diff --git a/jdk/test/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh b/jdk/test/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh index 4c893c47f5a..ac4b52b5cc0 100644 --- a/jdk/test/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh +++ b/jdk/test/java/lang/instrument/VerifyLocalVariableTableOnRetransformTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # transform() on a retransform operation. # @author Daniel D. Daugherty # +# @modules java.instrument # @run build VerifyLocalVariableTableOnRetransformTest # @run compile -g DummyClassWithLVT.java # @run shell MakeJAR.sh retransformAgent diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh index 998faee2433..3331e36c63b 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Unit tests for appendToBootstrapClassLoaderSearch and # appendToSystemClasLoaderSearch methods. # +# @modules java.instrument # @run shell/timeout=240 CircularityErrorTest.sh if [ "${TESTSRC}" = "" ] diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh index 01f805dd07c..74b2ca25566 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Unit tests for appendToBootstrapClassLoaderSearch and # appendToSystemClasLoaderSearch methods. # +# @modules java.instrument # @build ClassUnloadTest # @run shell ClassUnloadTest.sh diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh index be712202671..ad4878122cd 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @summary Unit tests for appendToBootstrapClassLoaderSearch and # appendToSystemClasLoaderSearch methods. # +# @modules java.instrument # @build Agent AgentSupport BootSupport BasicTest PrematureLoadTest DynamicTest # @run shell/timeout=240 run_tests.sh diff --git a/jdk/test/java/lang/management/BufferPoolMXBean/Basic.java b/jdk/test/java/lang/management/BufferPoolMXBean/Basic.java index 180551fdd26..ddca74f8200 100644 --- a/jdk/test/java/lang/management/BufferPoolMXBean/Basic.java +++ b/jdk/test/java/lang/management/BufferPoolMXBean/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* @test * @bug 6606598 7024172 * @summary Unit test for java.lang.management.BufferPoolMXBean + * @modules java.management * @run main/othervm Basic * @key randomness */ diff --git a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java index 238655a10d5..83fa68e2523 100644 --- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java +++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * ClassLoadingMXBean.getTotalLoadedClassCount() * ClassLoadingMXBean.getUnloadedClassCount() * @author Alexei Guibadoulline + * @modules java.management * @run main/othervm LoadCounts */ diff --git a/jdk/test/java/lang/management/CompilationMXBean/Basic.java b/jdk/test/java/lang/management/CompilationMXBean/Basic.java index 14686e107fd..c9738cc0163 100644 --- a/jdk/test/java/lang/management/CompilationMXBean/Basic.java +++ b/jdk/test/java/lang/management/CompilationMXBean/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5011189 8004928 * @summary Unit test for java.lang.management.CompilationMXBean * + * @modules java.management * @run main/othervm -Xcomp -Xbatch Basic */ import java.lang.management.*; diff --git a/jdk/test/java/lang/management/CompositeData/MemoryNotifInfoCompositeData.java b/jdk/test/java/lang/management/CompositeData/MemoryNotifInfoCompositeData.java index f7c1ea2ce4e..3aeec391edb 100644 --- a/jdk/test/java/lang/management/CompositeData/MemoryNotifInfoCompositeData.java +++ b/jdk/test/java/lang/management/CompositeData/MemoryNotifInfoCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * the input CompositeData is invalid. * @author Mandy Chung * + * @modules java.management/sun.management * @compile OpenTypeConverter.java * @build MemoryNotifInfoCompositeData * @run main MemoryNotifInfoCompositeData diff --git a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java index 819a0d04fbc..cd0df923fad 100644 --- a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java +++ b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * or throw exception if the input CompositeData is invalid. * @author Mandy Chung * + * @modules java.management * @build MemoryUsageCompositeData * @run main MemoryUsageCompositeData */ diff --git a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java index 5dc809ac04a..9b026b96980 100644 --- a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java +++ b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * the input CompositeData is invalid. * @author Mandy Chung * + * @modules java.management * @compile OpenTypeConverter.java * @build ThreadInfoCompositeData * @run main ThreadInfoCompositeData diff --git a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java index 0c4a4804153..b6c56f190a9 100644 --- a/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java +++ b/jdk/test/java/lang/management/GarbageCollectorMXBean/GcInfoCompositeType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015 Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 6396794 * @summary Check that LastGcInfo contents are reasonable * @author Eamonn McManus + * @modules java.management + * jdk.management * @run main/othervm -XX:-ExplicitGCInvokesConcurrent GcInfoCompositeType */ // Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc() diff --git a/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java b/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java index 12403164aba..243cc165bca 100644 --- a/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java +++ b/jdk/test/java/lang/management/MXBean/MXBeanBehavior.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Check that java.lang.management MXBeans have the same behavior * as user MXBeans * @author Eamonn McManus + * @modules java.management + * jdk.management * @run main/othervm MXBeanBehavior */ diff --git a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java index 8333989c5c3..f8d3aac0025 100644 --- a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java +++ b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Test if getObjectName handles properly when called by * multiple threads simultaneously. Run in othervm mode to * make sure the object name is not initialized to begin with. + * @modules java.management * @run main/othervm GetObjectName */ diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java index c0fb62c95c0..7e06603e277 100644 --- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java +++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * methods and PlatformManagedObject.getObjectName() * @author Mandy Chung * + * @modules java.management * @run main GetPlatformMXBeans */ diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java index a6aa2c905cd..7ccd852be00 100644 --- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java +++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * ManagementFactory.getPlatformManagementInterfaces() method * @author Frederic Parain * + * @modules java.management * @run main GetPlatformManagementInterfaces */ diff --git a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java index 195fb573ec8..4af1b4170c5 100644 --- a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java +++ b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Test that all the platform MXBeans are wrapped in StandardMBean so * an MBeanServer which does not have support for MXBeans can be used. * @author Luis-Miguel Alventosa + * @modules java.management + * jdk.management * @run clean MBeanServerMXBeanUnsupportedTest * @run build MBeanServerMXBeanUnsupportedTest * @run main/othervm MBeanServerMXBeanUnsupportedTest diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java index 13b31601378..33c1a833889 100644 --- a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java +++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Mandy Chung * + * @modules java.management * @build MXBeanException * @run main MXBeanException */ diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java index 98f887ea551..7895c6be58d 100644 --- a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java +++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 5024531 * @summary Basic Test for ManagementFactory.newPlatformMXBean(). + * @modules java.management * @run main/othervm MXBeanProxyTest * @author Mandy Chung */ diff --git a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java index f378634c9ea..8f44e1e70af 100644 --- a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java +++ b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4947536 * @summary Basic unit test of ManagementFactory.getPlatformMBeanServer() * @author Mandy Chung + * @modules java.management */ import java.lang.management.*; diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java index 2b8fd137a29..886efdd2b56 100644 --- a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java +++ b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Test type mapping of the platform MXBean proxy * returned from Management.newPlatformMXBeanProxy(). * @author Mandy Chung + * @modules java.management + * jdk.management */ import java.lang.management.*; import javax.management.*; diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java index 3ae6edbb083..f500d82c078 100644 --- a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java +++ b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * returned from Management.newPlatformMXBeanProxy(). * @author Mandy Chung * + * @modules java.management + * jdk.management * @compile ProxyTypeMapping.java * @run main/othervm -verbose:gc ProxyTypeMapping */ diff --git a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java index 8146e6c1d43..a5f4a1ea9a1 100644 --- a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java +++ b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @author Mandy Chung * + * @modules java.management * @run main ThreadMXBeanProxy */ diff --git a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java index cfe8733a716..20ed9cb223c 100644 --- a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java +++ b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * MBeanServer. * @author Mandy Chung * + * @modules java.management + * jdk.management * @compile ValidateOpenTypes.java * @run main/othervm -verbose:gc ValidateOpenTypes */ diff --git a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java index 74e06e6aa6e..2196f891354 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java +++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Mandy Chung * * @library /lib/testlibrary/ + * @modules java.management * @build jdk.testlibrary.* CollectionUsageThreshold MemoryUtil RunUtil * @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null" * @run main/timeout=300 CollectionUsageThreshold diff --git a/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java b/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java index a2083a80d02..288c10d0ef0 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java +++ b/jdk/test/java/lang/management/MemoryMXBean/GetMBeanInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Make sure MemoryMXBean has two notification types. * @author Mandy Chung * + * @modules java.management * @run main GetMBeanInfo */ diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java index ce107bfb6de..7c6eb0bb5b8 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java @@ -31,6 +31,7 @@ * @author Mandy Chung * * @library /lib/testlibrary/ + * @modules java.management * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil * @run main/timeout=600 LowMemoryTest * @requires vm.opt.ExplicitGCInvokesConcurrent != "true" diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh index b584c085b46..c95734a2280 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @bug 4982128 # @summary Test low memory detection of non-heap memory pool # @requires vm.gc=="null" +# @modules java.management # @run build LowMemoryTest2 MemoryUtil # @run shell/timeout=600 LowMemoryTest2.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java index 4cd913d7bcd..2ba06ecc0ff 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * * @author Mandy Chung * + * @modules java.management * @build MemoryManagement MemoryUtil * @run main/othervm/timeout=600 -Xmn8m -XX:+IgnoreUnrecognizedVMOptions -XX:G1HeapRegionSize=1 -XX:-UseLargePages MemoryManagement */ diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh index a80f2c417f1..1a0b02dae42 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary Run MemoryManagement test with concurrent mark sweep GC # @author Mandy Chung # @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" +# @modules java.management # @run build MemoryManagement # @run shell/timeout=600 MemoryManagementConcMarkSweepGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh index f315c96eb31..f04f6d481e3 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary Run MemoryManagement test with parallel GC # @author Mandy Chung # @requires vm.gc=="Parallel" | vm.gc=="null" +# @modules java.management # @run build MemoryManagement # @run shell/timeout=600 MemoryManagementParallelGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh index 043323071d7..567aea7d63a 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary Run MemoryManagement test with serial GC # @author Mandy Chung # @requires vm.gc=="Serial" | vm.gc=="null" +# @modules java.management # @run build MemoryManagement # @run shell/timeout=600 MemoryManagementSerialGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java index 2101c4cb4bf..ce55245b4c0 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * MemoryMXBean.getMemoryManager(). * @author Mandy Chung * + * @modules java.management * @run main MemoryTest 2 */ diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh index 6dbbc1659d9..4a8eea25705 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @summary # @author Mandy Chung # @requires vm.gc=="Parallel" | vm.gc=="null" +# @modules java.management # @run compile MemoryTest.java # @run shell MemoryTestAllGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java index f468aa36449..31b8f634011 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java +++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,8 @@ /* * @test * @bug 4530538 + * @modules java.base/sun.misc + * java.management * @summary Basic unit test of * RuntimeMXBean.getObjectPendingFinalizationCount() * 1. GC and runFinalization() to get the current pending number @@ -32,7 +34,6 @@ * 4. GC and runFinalization() and the finalizable objects should * be garbage collected. * @author Alexei Guibadoulline and Mandy Chung - * */ import java.lang.management.*; diff --git a/jdk/test/java/lang/management/MemoryMXBean/PendingAllGC.sh b/jdk/test/java/lang/management/MemoryMXBean/PendingAllGC.sh index 2a1ccc3be7e..2cc76ee5158 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/PendingAllGC.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/PendingAllGC.sh @@ -27,6 +27,7 @@ # @summary # @author Mandy Chung # @requires vm.gc=="null" +# @modules java.base/sun.misc # @run compile Pending.java # @run shell PendingAllGC.sh # diff --git a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java index c0d5ad57e46..b1f6e781044 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java +++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ * @author Mandy Chung * * @library /lib/testlibrary/ + * @modules java.management * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil * @run main ResetPeakMemoryUsage */ diff --git a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java index 62e8473bc8d..7f49e73dc56 100644 --- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java +++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * MemoryPoolMXBean.isCollectionThresholdExceeded(). * @author Mandy Chung * + * @modules java.management * @run main/othervm ThresholdTest */ diff --git a/jdk/test/java/lang/management/OperatingSystemMXBean/PlatformMXBeanTest.java b/jdk/test/java/lang/management/OperatingSystemMXBean/PlatformMXBeanTest.java index d78d1db8dbf..3c49bc83392 100644 --- a/jdk/test/java/lang/management/OperatingSystemMXBean/PlatformMXBeanTest.java +++ b/jdk/test/java/lang/management/OperatingSystemMXBean/PlatformMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * ManagementFactory.getPlatformMXBeans() * @author Mandy Chung * + * @modules java.management + * jdk.management * @run main PlatformMXBeanTest */ diff --git a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh index 1ef2f35c8e9..0e9ad0f679e 100644 --- a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh +++ b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,7 @@ # @author Mandy Chung # @bug 6336608 6367473 6511738 # +# @modules java.management # @run build GetSystemLoadAverage # @run shell/timeout=300 TestSystemLoadAvg.sh # diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java index 7713055b886..67548b54c42 100644 --- a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java +++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Test if proxy for PlatformLoggingMXBean is equivalent * to proxy for LoggingMXBean * + * @modules java.management + * jdk.management * @build LoggingMXBeanTest * @run main LoggingMXBeanTest */ diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java index eea0a6fdab1..3c697db7cce 100644 --- a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java +++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * This test performs similar testing as * java/util/logging/LoggingMXBeanTest. * + * @modules java.management + * jdk.management * @build PlatformLoggingMXBeanTest * @run main PlatformLoggingMXBeanTest */ diff --git a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java index f856013a3fa..a0248681944 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java +++ b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4990512 * @summary Basic Test for RuntimeMXBean.getSystemProperties(). * @author Mandy Chung + * @modules java.management */ import java.lang.management.ManagementFactory; diff --git a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java index 3489c3c618d..47ba46a6321 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java +++ b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * properties contain another list of properties as the defaults. * @author Mandy Chung * + * @modules java.management * @run build PropertiesTest * @run main PropertiesTest */ diff --git a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh index 6c135415875..f92fac42db0 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh +++ b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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 @@ # @bug 4530538 # @summary # @author Mandy Chung +# @modules java.management # @run compile InputArgument.java # @run shell TestInputArgument.sh # diff --git a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java index c6b2a2bcc8b..e068ad17413 100644 --- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java +++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4530538 * @summary Basic unit test of RuntimeMXBean.getUptime() * @author Alexei Guibadoulline + * @modules java.management */ import java.lang.management.*; diff --git a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java index aa80c746cf2..3ecacae2569 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java +++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java @@ -27,6 +27,7 @@ * @summary Basic unit test of ThreadMXBean.getAllThreadIds() * @author Alexei Guibadoulline and Mandy Chung * + * @modules java.management * @run main/othervm AllThreadIds */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java index c4058b0a03c..759abf9e5bf 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary The capability is disabled regardless of number of times * it was enabled. * @author Mandy Chung + * @modules java.management */ import java.lang.management.ThreadMXBean; diff --git a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java index 216ac5a3b46..0a3a658e36d 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * and ThreadMXBean.setThreadCpuTimeEnabled(). * @author Mandy Chung * + * @modules java.management * @run main EnableTest */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java index 0bdcd7ae4de..b5a7702a1ea 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java +++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,13 @@ /* * @test * @bug 5086470 + * @key intermittent * @summary Basic Test for the following methods: * - ThreadMXBean.findDeadlockedThreads() * - ThreadMXBean.findMonitorDeadlockedThreads() * @author Mandy Chung * + * @modules java.management * @build MonitorDeadlock * @build SynchronizerDeadlock * @build ThreadDump diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java index a64501f8233..8833febad1e 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java +++ b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * - ThreadMXBean.findMonitorDeadlockedThreads() * @author Mandy Chung * + * @modules java.management * @build MonitorDeadlock * @build ThreadDump * @run main/othervm FindMonitorDeadlock diff --git a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java index 60aa7f94499..8f7608f2d2b 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java +++ b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * if id <= 0 and returns -1 if the thread doesn't exist. * @author Mandy Chung * + * @modules java.management * @run main InvalidThreadID */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java index 51b734968bc..85a3ebfbd90 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java +++ b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ * * @author Mandy Chung * + * @modules java.management * @build Barrier * @build LockingThread * @build ThreadDump diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java index 418bb757d56..95299d5e5f1 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java +++ b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * * @author Mandy Chung * + * @modules java.management * @build Barrier * @build SynchronizerLockingThread * @build ThreadDump diff --git a/jdk/test/java/lang/management/ThreadMXBean/Locks.java b/jdk/test/java/lang/management/ThreadMXBean/Locks.java index 1c8da469289..0d40a14dd3c 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java +++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * @author Jaroslav Bachorik * * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main/othervm Locks */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java index 793e78dee67..3c6b1a68d08 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java +++ b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * and getThreadInfo of customized JSR-166 synchronizers. * @author Mandy Chung * + * @modules java.management * @build Barrier * @build ThreadDump * @run main/othervm MyOwnSynchronizer diff --git a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java index 79172684060..5253b687704 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @author Mandy Chung * @author Jaroslav Bachorik * + * @modules java.management * @build ResetPeakThreadCount * @build ThreadDump * @run main/othervm ResetPeakThreadCount diff --git a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java index 843f0134362..4034830dacf 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java +++ b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * in shared mode which has no owner when a thread is parked. * @author Mandy Chung * + * @modules java.management * @run main/othervm SharedSynchronizer */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java index 6cb4bfb0720..336389c0ef0 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java +++ b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java @@ -29,6 +29,7 @@ * @author Mandy Chung * @author Jaroslav Bachorik * + * @modules java.management * @run main/othervm SynchronizationStatistics */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java index 7fed519de59..7777d5d5227 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic unit test of ThreadInfo.getBlockedCount() * @author Alexei Guibadoulline and Mandy Chung * @author Jaroslav Bachorik + * @modules java.management * @run main ThreadBlockedCount */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java index 48b3c7a2a6d..c905a889d0d 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * mbean.getDaemonThreadCount() * @author Alexei Guibadoulline * + * @modules java.management * @run main ThreadCounts */ diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java index c52e39eac89..ae9ddf63aeb 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic test of ThreadMXBean.getThreadCpuTime and * getCurrentThreadCpuTime. * @author Mandy Chung + * @modules java.management */ import java.lang.management.*; diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java index 35cad89268b..0ec3fa8bbe3 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java @@ -31,6 +31,7 @@ import java.util.concurrent.atomic.*; * @bug 6588467 * @summary Basic test of ThreadInfo.isDaemon * @author Jeremy Manson + * @modules java.management */ public class ThreadDaemonTest { diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadInfoArray.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadInfoArray.java index 8b504344143..4de0f2e30d1 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadInfoArray.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadInfoArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,27 +23,44 @@ /* * @test - * @bug 5058327 - * @summary Test if getThreadInfo(long[]) returns a ThreadInfo[] - * with null elements with no exception. + * @bug 5058327 8074368 + * @summary Tests the correct behaviour of getThreadInfo(long[]) for non-existent + * thread IDs and the empty thread id array. * * @author Mandy Chung + * @author Jaroslav Bachorik * + * @modules java.management * @build ThreadInfoArray * @run main ThreadInfoArray */ import java.lang.management.*; import javax.management.*; -import java.util.*; import static java.lang.management.ManagementFactory.*; public class ThreadInfoArray { public static void main(String[] argv) throws Exception { - ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + ObjectName on = new ObjectName(THREAD_MXBEAN_NAME); + ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); + ThreadMXBean proxy = newPlatformMXBeanProxy(mbs, + on.toString(), + ThreadMXBean.class); + + checkNullElement(mbean, proxy, mbs, on); + checkEmptyArray(mbean, proxy, mbs, on); + System.out.println("Test passed"); + } + + private static void checkNullElement(ThreadMXBean mbean, ThreadMXBean proxy, + MBeanServer mbs, ObjectName on) + throws Exception { + System.out.println("--- Check null element"); // ID for a new thread long [] ids = {new Thread().getId()}; + // direct call ThreadInfo[] tinfos = mbean.getThreadInfo(ids); if (tinfos[0] != null) { @@ -52,8 +69,6 @@ public class ThreadInfoArray { } // call getThreadInfo through MBeanServer - MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - ObjectName on = new ObjectName(THREAD_MXBEAN_NAME); Object[] params = {ids}; String[] sigs = {"[J"}; Object[] result = (Object[]) mbs.invoke(on, "getThreadInfo", params, sigs); @@ -64,14 +79,57 @@ public class ThreadInfoArray { } // call getThreadInfo through proxy - ThreadMXBean proxy = newPlatformMXBeanProxy(mbs, - on.toString(), - ThreadMXBean.class); tinfos = proxy.getThreadInfo(ids); if (tinfos[0] != null) { throw new RuntimeException("TEST FAILED: " + "Expected to have a null element"); } - System.out.println("Test passed"); + System.out.println("--- PASSED"); + } + + private static void checkEmptyArray(ThreadMXBean mbean, ThreadMXBean proxy, + MBeanServer mbs, ObjectName on) + throws Exception { + System.out.println("--- Check empty TID array"); + + long[] ids = new long[0]; + // direct call + assertEmptyArray(mbean.getThreadInfo(ids), "Expected empty ThreadInfo array"); + assertEmptyArray(mbean.getThreadInfo(ids, 1), "Expected empty ThreadInfo array"); + assertEmptyArray(mbean.getThreadInfo(ids, true, true), "Expected empty ThreadInfo array"); + + // call getThreadInfo through MBeanServer + assertEmptyArray( + (Object[]) mbs.invoke( + on, "getThreadInfo", new Object[]{ids}, new String[]{"[J"} + ), + "Expected empty ThreadInfo array via MBeanServer" + ); + assertEmptyArray( + (Object[]) mbs.invoke( + on, "getThreadInfo", new Object[]{ids, 1}, + new String[]{"[J", "int"} + ), + "Expected empty ThreadInfo array via MBeanServer" + ); + assertEmptyArray( + (Object[]) mbs.invoke( + on, "getThreadInfo", new Object[]{ids, true, true}, + new String[]{"[J", "boolean", "boolean"} + ), + "Expected empty ThreadInfo array via MBeanServer" + ); + + // call getThreadInfo through proxy + assertEmptyArray(proxy.getThreadInfo(ids), "Expected empty ThreadInfo array"); + assertEmptyArray(proxy.getThreadInfo(ids, 1), "Expected empty ThreadInfo array"); + assertEmptyArray(proxy.getThreadInfo(ids, true, true), "Expected empty ThreadInfo array"); + System.out.println("--- PASSED"); + } + + private static void assertEmptyArray(Object[] arr, String message) throws Exception { + if (arr.length > 0) { + throw new RuntimeException("TEST FAILED: " + message); + } } } diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java index 5c3a917aa47..c596f7b9e9f 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5047639 * @summary Check that the "java-level" APIs provide a consistent view of * the thread list + * @modules java.management */ import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java index a273bfdd309..492303aa114 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * * @library ../../Thread * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @build ThreadMXBeanStateTest ThreadStateController * @run main ThreadMXBeanStateTest @@ -64,60 +65,61 @@ public class ThreadMXBeanStateTest { Thread.currentThread().getState(); ThreadStateController thread = new ThreadStateController("StateChanger", globalLock); thread.setDaemon(true); - - // before myThread starts - thread.checkThreadState(NEW); - - thread.start(); - thread.transitionTo(RUNNABLE); - thread.checkThreadState(RUNNABLE); - checkLockInfo(thread, RUNNABLE, null, null); - - thread.suspend(); - ThreadStateController.pause(10); - thread.checkThreadState(RUNNABLE); - checkSuspendedThreadState(thread, RUNNABLE); - thread.resume(); - - synchronized (globalLock) { - thread.transitionTo(BLOCKED); - thread.checkThreadState(BLOCKED); - checkLockInfo(thread, BLOCKED, - globalLock, Thread.currentThread()); - } - - thread.transitionTo(WAITING); - thread.checkThreadState(WAITING); - checkLockInfo(thread, Thread.State.WAITING, - globalLock, null); - - thread.transitionTo(TIMED_WAITING); - thread.checkThreadState(TIMED_WAITING); - checkLockInfo(thread, TIMED_WAITING, - globalLock, null); - - - thread.transitionToPark(true /* timed park */); - thread.checkThreadState(TIMED_WAITING); - checkLockInfo(thread, TIMED_WAITING, null, null); - - thread.transitionToPark(false /* indefinite park */); - thread.checkThreadState(WAITING); - checkLockInfo(thread, WAITING, null, null); - - thread.transitionToSleep(); - thread.checkThreadState(TIMED_WAITING); - checkLockInfo(thread, TIMED_WAITING, null, null); - - thread.transitionTo(TERMINATED); - thread.checkThreadState(TERMINATED); - try { - System.out.println(thread.getLog()); - } catch (InterruptedException e) { - e.printStackTrace(); - System.out.println("TEST FAILED: Unexpected exception."); - throw new RuntimeException(e); + // before myThread starts + thread.checkThreadState(NEW); + + thread.start(); + thread.transitionTo(RUNNABLE); + thread.checkThreadState(RUNNABLE); + checkLockInfo(thread, RUNNABLE, null, null); + + thread.suspend(); + ThreadStateController.pause(10); + thread.checkThreadState(RUNNABLE); + checkSuspendedThreadState(thread, RUNNABLE); + thread.resume(); + + synchronized (globalLock) { + thread.transitionTo(BLOCKED); + thread.checkThreadState(BLOCKED); + checkLockInfo(thread, BLOCKED, + globalLock, Thread.currentThread()); + } + + thread.transitionTo(WAITING); + thread.checkThreadState(WAITING); + checkLockInfo(thread, Thread.State.WAITING, + globalLock, null); + + thread.transitionTo(TIMED_WAITING); + thread.checkThreadState(TIMED_WAITING); + checkLockInfo(thread, TIMED_WAITING, + globalLock, null); + + + thread.transitionToPark(true /* timed park */); + thread.checkThreadState(TIMED_WAITING); + checkLockInfo(thread, TIMED_WAITING, null, null); + + thread.transitionToPark(false /* indefinite park */); + thread.checkThreadState(WAITING); + checkLockInfo(thread, WAITING, null, null); + + thread.transitionToSleep(); + thread.checkThreadState(TIMED_WAITING); + checkLockInfo(thread, TIMED_WAITING, null, null); + + thread.transitionTo(TERMINATED); + thread.checkThreadState(TERMINATED); + } finally { + try { + System.out.println(thread.getLog()); + } catch (InterruptedException e) { + e.printStackTrace(); + System.out.println("TEST FAILED: Unexpected exception."); + throw new RuntimeException(e); + } } System.out.println("Test passed."); } diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java index 12cef4a978b..e45ac93cce2 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,25 +28,27 @@ * ThreadInfo.getThreadState() * @author Mandy Chung * - * @run build Semaphore Utils + * @modules java.management + * @run build Utils * @run main ThreadStackTrace */ import java.lang.management.*; +import java.util.concurrent.Phaser; public class ThreadStackTrace { - private static ThreadMXBean mbean + private static final ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); private static boolean notified = false; - private static Object lockA = new Object(); - private static Object lockB = new Object(); + private static final Object lockA = new Object(); + private static final Object lockB = new Object(); private static volatile boolean testFailed = false; - private static String[] blockedStack = {"run", "test", "A", "B", "C", "D"}; - private static int bsDepth = 6; - private static int methodB = 4; - private static String[] examinerStack = {"run", "examine1", "examine2"}; - private static int esDepth = 3; - private static int methodExamine1= 2; + private static final String[] blockedStack = {"run", "test", "A", "B", "C", "D"}; + private static final int bsDepth = 6; + private static final int methodB = 4; + private static final String[] examinerStack = {"run", "examine1", "examine2"}; + private static final int esDepth = 3; + private static final int methodExamine1= 2; private static void checkNullThreadInfo(Thread t) throws Exception { ThreadInfo ti = mbean.getThreadInfo(t.getId()); @@ -69,8 +71,10 @@ public class ThreadStackTrace { trace = true; } - Examiner examiner = new Examiner("Examiner"); - BlockedThread blocked = new BlockedThread("BlockedThread"); + final Phaser p = new Phaser(2); + + Examiner examiner = new Examiner("Examiner", p); + BlockedThread blocked = new BlockedThread("BlockedThread", p); examiner.setThread(blocked); checkNullThreadInfo(examiner); @@ -79,8 +83,8 @@ public class ThreadStackTrace { // Start the threads and check them in Blocked and Waiting states examiner.start(); - // block until examiner begins doing its real work - examiner.waitForStarted(); + // #1 - block until examiner begins doing its real work + p.arriveAndAwaitAdvance(); System.out.println("Checking stack trace for the examiner thread " + "is waiting to begin."); @@ -145,35 +149,11 @@ public class ThreadStackTrace { } static class BlockedThread extends Thread { - private Semaphore handshake = new Semaphore(); + private final Phaser phaser; - BlockedThread(String name) { + BlockedThread(String name, Phaser phaser) { super(name); - } - boolean hasWaitersForBlocked() { - return (handshake.getWaiterCount() > 0); - } - - void waitUntilBlocked() { - handshake.semaP(); - - // give a chance for the examiner thread to really wait - Utils.goSleep(20); - } - - void waitUntilLockAReleased() { - handshake.semaP(); - - // give a chance for the examiner thread to really wait - Utils.goSleep(50); - } - - private void notifyWaiter() { - // wait until the examiner waits on the semaphore - while (handshake.getWaiterCount() == 0) { - Utils.goSleep(20); - } - handshake.semaV(); + this.phaser = phaser; } private void test() { @@ -185,25 +165,24 @@ public class ThreadStackTrace { private void B() { C(); - // notify the examiner about to block on lockB - notifyWaiter(); + // #4 - notify the examiner about to block on lockB + phaser.arriveAndAwaitAdvance(); - synchronized (lockB) { - }; + synchronized (lockB) {}; } private void C() { D(); } private void D() { - // Notify that examiner about to enter lockA - notifyWaiter(); + // #2 - Notify that examiner about to enter lockA + phaser.arriveAndAwaitAdvance(); synchronized (lockA) { notified = false; while (!notified) { try { - // notify the examiner about to release lockA - notifyWaiter(); + // #3 - notify the examiner about to release lockA + phaser.arriveAndAwaitAdvance(); // Wait and let examiner thread check the mbean lockA.wait(); } catch (InterruptedException e) { @@ -216,6 +195,7 @@ public class ThreadStackTrace { } } + @Override public void run() { test(); } // run() @@ -223,28 +203,17 @@ public class ThreadStackTrace { static class Examiner extends Thread { private static BlockedThread blockedThread; - private Semaphore handshake = new Semaphore(); + private final Phaser phaser; - Examiner(String name) { + Examiner(String name, Phaser phaser) { super(name); + this.phaser = phaser; } public void setThread(BlockedThread thread) { blockedThread = thread; } - public synchronized void waitForStarted() { - // wait until the examiner is about to block - handshake.semaP(); - - // wait until the examiner is waiting for blockedThread's notification - while (!blockedThread.hasWaitersForBlocked()) { - Utils.goSleep(50); - } - // give a chance for the examiner thread to really wait - Utils.goSleep(20); - } - private Thread itself; private void examine1() { synchronized (lockB) { @@ -254,8 +223,9 @@ public class ThreadStackTrace { Utils.checkThreadState(itself, Thread.State.RUNNABLE); checkStack(itself, examinerStack, methodExamine1); - // wait until blockedThread is blocked on lockB - blockedThread.waitUntilBlocked(); + // #4 - wait until blockedThread is blocked on lockB + phaser.arriveAndAwaitAdvance(); + Utils.waitForThreadState(blockedThread, State.BLOCKED); System.out.println("Checking stack trace for " + "BlockedThread - should be blocked on lockB."); @@ -271,15 +241,12 @@ public class ThreadStackTrace { private void examine2() { synchronized (lockA) { - // wait until main thread gets signalled of the semaphore - while (handshake.getWaiterCount() == 0) { - Utils.goSleep(20); - } - - handshake.semaV(); // notify the main thread + // #1 - examiner ready to do the real work + phaser.arriveAndAwaitAdvance(); try { - // Wait until BlockedThread is about to block on lockA - blockedThread.waitUntilBlocked(); + // #2 - Wait until BlockedThread is about to block on lockA + phaser.arriveAndAwaitAdvance(); + Utils.waitForThreadState(blockedThread, State.BLOCKED); System.out.println("Checking examiner's its own stack trace"); Utils.checkThreadState(itself, Thread.State.RUNNABLE); @@ -297,9 +264,10 @@ public class ThreadStackTrace { } } - // release lockA and let BlockedThread to get the lock + // #3 - release lockA and let BlockedThread to get the lock // and wait on lockA - blockedThread.waitUntilLockAReleased(); + phaser.arriveAndAwaitAdvance(); + Utils.waitForThreadState(blockedThread, State.WAITING); synchronized (lockA) { try { @@ -321,6 +289,7 @@ public class ThreadStackTrace { Utils.goSleep(50); } // examine2() + @Override public void run() { itself = Thread.currentThread(); examine1(); diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java index 36c91ce58ba..c90daa94bfe 100644 --- a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java +++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic test of ThreadMXBean.getThreadUserTime and * getCurrentThreadUserTime. * @author Mandy Chung + * @modules java.management */ import java.lang.management.*; diff --git a/jdk/test/java/nio/file/Files/CheckPermissions.java b/jdk/test/java/nio/file/Files/CheckPermissions.java index 8877daa44aa..7908d847c05 100644 --- a/jdk/test/java/nio/file/Files/CheckPermissions.java +++ b/jdk/test/java/nio/file/Files/CheckPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* @test - * @bug 6866804 7006126 8028270 + * @bug 6866804 7006126 8028270 8065109 * @summary Unit test for java.nio.file.Files * @library .. * @build CheckPermissions @@ -37,6 +37,7 @@ import java.nio.file.attribute.*; import java.nio.channels.SeekableByteChannel; import java.security.Permission; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.*; /** @@ -426,8 +427,40 @@ public class CheckPermissions { } createFile(file); // restore file + // -- newBufferedReader/newBufferedWriter -- - // -- newInputStream/newOutptuStream -- + prepare(); + try (BufferedReader br = newBufferedReader(file)) { + assertCheckRead(file); + } + + prepare(); + try (BufferedWriter bw = newBufferedWriter(file, WRITE)) { + assertCheckWrite(file); + } + + prepare(); + try (BufferedWriter bw = newBufferedWriter(file, DELETE_ON_CLOSE)) { + assertCheckWrite(file); + assertCheckDelete(file); + } + createFile(file); // restore file + + prepare(); + try (BufferedWriter bw = newBufferedWriter(file, + StandardCharsets.UTF_16, WRITE)) { + assertCheckWrite(file); + } + + prepare(); + try (BufferedWriter bw = newBufferedWriter(file, + StandardCharsets.UTF_16, DELETE_ON_CLOSE)) { + assertCheckWrite(file); + assertCheckDelete(file); + } + createFile(file); // restore file + + // -- newInputStream/newOutputStream -- prepare(); try (InputStream in = newInputStream(file)) { @@ -438,6 +471,42 @@ public class CheckPermissions { assertCheckWrite(file); } + // -- write -- + + prepare(); + Files.write(file, new byte[]{(byte) 42, (byte) 666}, WRITE); + assertCheckWrite(file); + + prepare(); + Files.write(file, new byte[]{(byte) 42, (byte) 666}, WRITE, + DELETE_ON_CLOSE); + assertCheckWrite(file); + assertCheckDelete(file); + createFile(file); // restore file + + List<String> lines = Arrays.asList("42", "666"); + + prepare(); + Files.write(file, lines, StandardCharsets.UTF_16, WRITE); + assertCheckWrite(file); + + prepare(); + Files.write(file, lines, StandardCharsets.UTF_16, WRITE, + DELETE_ON_CLOSE); + assertCheckWrite(file); + assertCheckDelete(file); + createFile(file); // restore file + + prepare(); + Files.write(file, lines, WRITE); + assertCheckWrite(file); + + prepare(); + Files.write(file, lines, WRITE, DELETE_ON_CLOSE); + assertCheckWrite(file); + assertCheckDelete(file); + createFile(file); // restore file + // -- newDirectoryStream -- prepare(); diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index 488b431b257..d945caac3b3 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -23,7 +23,7 @@ /** * @test - * @summary tests RegExp framework + * @summary tests RegExp framework (use -Dseed=X to set PRNG seed) * @author Mike McCloskey * @bug 4481568 4482696 4495089 4504687 4527731 4599621 4631553 4619345 * 4630911 4672616 4711773 4727935 4750573 4792284 4803197 4757029 4808962 @@ -33,7 +33,10 @@ * 6350801 6676425 6878475 6919132 6931676 6948903 6990617 7014645 7039066 * 7067045 7014640 7189363 8007395 8013252 8013254 8012646 8023647 6559590 * 8027645 8035076 8039124 8035975 8074678 - * @key randomness + * @library /lib/testlibrary + * @build jdk.testlibrary.* + * @run main RegExTest + * @key intermittent randomness */ import java.util.function.Function; @@ -50,7 +53,7 @@ import java.util.function.Predicate; */ public class RegExTest { - private static Random generator = new Random(); + private static Random generator = RandomFactory.getRandom(); private static boolean failure = false; private static int failCount = 0; private static String firstFailure = null; diff --git a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java index c01eaf9cb76..b17fd6442e1 100644 --- a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java +++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * is run with a security manager and the test codebase has the java permission * to read the "java.runtime.version" system property. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ImplVersionTest ImplVersionCommand * @run build ImplVersionTest ImplVersionCommand ImplVersionReader * @run main ImplVersionTest @@ -76,7 +77,6 @@ public class ImplVersionTest { checkVersion = false; String command = javaHome + File.separator + "bin" + File.separator + "java " + - " -Xbootclasspath/p:" + bootClassPath + " -classpath " + testClasses + " -Djava.security.manager -Djava.security.policy==" + testSrc + File.separator + "policy -Dtest.classes=" + testClasses + diff --git a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java index 7e284a51452..2d07a0a61bd 100644 --- a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java +++ b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Test that having a security manager doesn't trigger a * NotCompliantMBeanException * @author Daniel Fuchs, Yves Joan + * @modules java.desktop + * java.management * @run clean AnnotationSecurityTest Described UnDescribed DescribedMBean * UnDescribedMBean SqeDescriptorKey DescribedMX DescribedMXBean * @run build AnnotationSecurityTest Described UnDescribed DescribedMBean diff --git a/jdk/test/javax/management/Introspector/AnnotationTest.java b/jdk/test/javax/management/Introspector/AnnotationTest.java index a3ed06f862a..f14502f310e 100644 --- a/jdk/test/javax/management/Introspector/AnnotationTest.java +++ b/jdk/test/javax/management/Introspector/AnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that annotations in Standard MBean interfaces * correctly produce Descriptor entries * @author Eamonn McManus + * @modules java.management * @run clean AnnotationTest * @run build AnnotationTest * @run main AnnotationTest diff --git a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java index e733dcd80ab..ec2043c624b 100644 --- a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java +++ b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that Standard MBeans can change their MBeanNotificationInfo[] * and MXBeans cannot * @author Eamonn McManus + * @modules java.management * @run clean ChangingNotifsTest * @run build ChangingNotifsTest * @run main ChangingNotifsTest diff --git a/jdk/test/javax/management/Introspector/ClassLeakTest.java b/jdk/test/javax/management/Introspector/ClassLeakTest.java index ac82a06d352..5fe43fdd193 100644 --- a/jdk/test/javax/management/Introspector/ClassLeakTest.java +++ b/jdk/test/javax/management/Introspector/ClassLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,12 +26,15 @@ * @bug 4909536 * @summary Ensure that the Introspector does not retain refs to classes * @author Eamonn McManus + * @modules java.management * @run clean ClassLeakTest * @run build ClassLeakTest * @run main ClassLeakTest */ import java.lang.ref.WeakReference; +import java.io.File; +import java.nio.file.Paths; import java.net.*; import java.util.*; @@ -44,17 +47,16 @@ public class ClassLeakTest { "Standard MBean does not retain a reference to " + "the MBean's class"); - ClassLoader myClassLoader = ClassLeakTest.class.getClassLoader(); - if (!(myClassLoader instanceof URLClassLoader)) { - System.out.println("TEST INVALID: test's class loader is not " + - "a URLClassLoader"); - System.exit(1); + + String[] cpaths = System.getProperty("test.classes", ".") + .split(File.pathSeparator); + URL[] urls = new URL[cpaths.length]; + for (int i=0; i < cpaths.length; i++) { + urls[i] = Paths.get(cpaths[i]).toUri().toURL(); } - URLClassLoader myURLClassLoader = (URLClassLoader) myClassLoader; - URL[] urls = myURLClassLoader.getURLs(); PrivateMLet mlet = new PrivateMLet(urls, null, false); - Class shadowClass = mlet.loadClass(TestMBean.class.getName()); + Class<?> shadowClass = mlet.loadClass(TestMBean.class.getName()); if (shadowClass == TestMBean.class) { System.out.println("TEST INVALID: MLet got original " + "TestMBean not shadow"); diff --git a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java index 6fdfd229e8d..7be19a00f4e 100644 --- a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java +++ b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that an MBean interface can inherit two methods with * the same signature from two unrelated parent interfaces * @author Eamonn McManus + * @modules java.management */ import java.util.*; diff --git a/jdk/test/javax/management/Introspector/FeatureOrderTest.java b/jdk/test/javax/management/Introspector/FeatureOrderTest.java index 3952dae3c89..96ad78efed2 100644 --- a/jdk/test/javax/management/Introspector/FeatureOrderTest.java +++ b/jdk/test/javax/management/Introspector/FeatureOrderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that attributes and operations appear in the same order * in MBeanInfo as they did in the Standard MBean or MXBean Interface. * @author Eamonn McManus + * @modules java.management */ /* diff --git a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java index 1dbb810aef3..bfc71b73c41 100644 --- a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java +++ b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the exception thrown by DynamicMBean.getMBeanInfo() * keeps the init cause. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean GetMBeanInfoExceptionTest * @run build GetMBeanInfoExceptionTest * @run main GetMBeanInfoExceptionTest diff --git a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java index d72e8091734..9cbad773c74 100644 --- a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java +++ b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that MBeans with the same class have identical MBeanInfo * unless they are NotificationBroadcasters * @author Eamonn McManus + * @modules java.management * @run clean IdenticalMBeanInfoTest * @run build IdenticalMBeanInfoTest * @run main IdenticalMBeanInfoTest diff --git a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java index 85d1c72fad1..4880493868e 100644 --- a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java +++ b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that a StandardMBean has immutableInfo=true if it is * a NotificationBroadcasterSupport that doesn't override getNotificationInfo() * @author Eamonn McManus + * @modules java.management * @run clean ImmutableNotificationInfoTest * @run build ImmutableNotificationInfoTest * @run main ImmutableNotificationInfoTest diff --git a/jdk/test/javax/management/Introspector/InvokeGettersTest.java b/jdk/test/javax/management/Introspector/InvokeGettersTest.java index dba667cf47a..5dacf04b102 100644 --- a/jdk/test/javax/management/Introspector/InvokeGettersTest.java +++ b/jdk/test/javax/management/Introspector/InvokeGettersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6317101 * @summary Test that the jmx.invoke.getters system property works * @author Eamonn McManus + * @modules java.management * @run clean InvokeGettersTest * @run build InvokeGettersTest * @run main InvokeGettersTest diff --git a/jdk/test/javax/management/Introspector/IsMethodTest.java b/jdk/test/javax/management/Introspector/IsMethodTest.java index 25bbe1661c3..a1ec7dbb74d 100644 --- a/jdk/test/javax/management/Introspector/IsMethodTest.java +++ b/jdk/test/javax/management/Introspector/IsMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4947001 4954369 4954409 4954410 * @summary Test that "Boolean isX()" and "int isX()" define operations * @author Eamonn McManus + * @modules java.management * @run clean IsMethodTest * @run build IsMethodTest * @run main IsMethodTest diff --git a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java index be47742036b..4fccc43e9b5 100644 --- a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java +++ b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4914805 * @summary Ensure that the right exception is thrown for illegal MBeans * @author Eamonn McManus + * @modules java.management * @run clean NotAnMBeanTest * @run build NotAnMBeanTest * @run main NotAnMBeanTest diff --git a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java index eac04fc1913..063d30c9cbc 100644 --- a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java +++ b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that NotCompliantMBeanException has a cause in case of * type mapping problems. * @author Daniel Fuchs, Alexander Shusherov + * @modules java.management * @run clean NotCompliantCauseTest * @run build NotCompliantCauseTest * @run main NotCompliantCauseTest diff --git a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java index c8d05bf263b..111aec1a422 100644 --- a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java +++ b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that setting the wrong type of an attribute in a Standard * MBean or MXBean causes InvalidAttributeValueException * @author Eamonn McManus + * @modules java.management * @run clean SetWrongTypeAttributeTest * @run build SetWrongTypeAttributeTest * @run main SetWrongTypeAttributeTest diff --git a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java index c89f81f671e..c2695d76dd7 100644 --- a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java +++ b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * the supplied MBean although DynamicMBean.getMBeanInfo() throws * a runtime exception. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean UnregisterMBeanExceptionTest * @run build UnregisterMBeanExceptionTest * @run main UnregisterMBeanExceptionTest diff --git a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java index 4f794a69be8..2e71b9d05a1 100644 --- a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java +++ b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5071110 * @summary Test whether an null descriptor will cause an NullPointerException. * @author Shanliang JIANG + * @modules java.management * @run clean EqualExceptionTest * @run build EqualExceptionTest * @run main EqualExceptionTest diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java index 440878c37f3..d433190d866 100644 --- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java +++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import javax.management.openmbean.SimpleType; * @bug 8023954 * @summary Test that MBean*Info.equals do not throw NPE * @author Shanliang JIANG + * @modules java.management * @run clean MBeanInfoEqualsNPETest * @run build MBeanInfoEqualsNPETest * @run main MBeanInfoEqualsNPETest diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java index f5ce7a9066d..239cf5ceac9 100644 --- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java +++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4719923 * @summary Test that MBeanInfo.equals works even for mutable subclasses * @author Eamonn McManus + * @modules java.management * @run clean MBeanInfoEqualsTest * @run build MBeanInfoEqualsTest * @run main MBeanInfoEqualsTest diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java index bb35da38ba6..2a175d76305 100644 --- a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java +++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ import javax.management.openmbean.SimpleType; * @bug 8023669 * @summary Test that hashCode()throws NullPointerException * @author Shanliang JIANG + * @modules java.management * @run clean MBeanInfoHashCodeNPETest * @run build MBeanInfoHashCodeNPETest * @run main MBeanInfoHashCodeNPETest diff --git a/jdk/test/javax/management/MBeanInfo/NotificationInfoTest.java b/jdk/test/javax/management/MBeanInfo/NotificationInfoTest.java index 8149729deb2..efcef234290 100644 --- a/jdk/test/javax/management/MBeanInfo/NotificationInfoTest.java +++ b/jdk/test/javax/management/MBeanInfo/NotificationInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that JMX classes use fully-qualified class names * in MBeanNotificationInfo * @author Eamonn McManus + * @modules java.management * @run clean NotificationInfoTest * @run build NotificationInfoTest * @run main NotificationInfoTest diff --git a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java index 8f58799f75b..c608d787f38 100644 --- a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java +++ b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that an MBeanInfo works even if it is deserialized from * an implementation where its array fields can be null. * @author Eamonn McManus + * @modules java.management * @run clean NullInfoArraysTest * @run build NullInfoArraysTest * @run main NullInfoArraysTest diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest.java b/jdk/test/javax/management/MBeanInfo/SerializationTest.java index 24de28b7741..c83fd92e9db 100644 --- a/jdk/test/javax/management/MBeanInfo/SerializationTest.java +++ b/jdk/test/javax/management/MBeanInfo/SerializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6288100 * @summary Test the new serialization/deserialization methods. * @author Shanliang JIANG + * @modules java.management * @run clean SerializationTest * @run build SerializationTest * @run main SerializationTest diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java index d087f9729fb..a33898a6a8f 100644 --- a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java +++ b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6783290 * @summary Test correct reading of an empty Descriptor. * @author Jaroslav Bachorik + * @modules java.management * @run clean SerializationTest1 * @run build SerializationTest1 * @run main SerializationTest1 diff --git a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java index 377f10c8687..55782e4d68d 100644 --- a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java +++ b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that a method inherited from two different interfaces * appears only once in MBeanInfo. * @author dfuchs + * @modules java.management * @run clean TooManyFooTest * @run build TooManyFooTest * @run main TooManyFooTest diff --git a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java index 6db6e99caff..3fec474ebfe 100644 --- a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java +++ b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6336968 * @summary Test adding non-Attribute values to an AttributeList. * @author Eamonn McManus + * @modules java.management */ import java.util.Collections; diff --git a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java index edce5b2f336..4e908b39766 100644 --- a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java +++ b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * RuntimeMBeanException and (for Standard MBeans) that checked exceptions * are wrapped in MBeanException * @author Eamonn McManus + * @modules java.management * @compile MBeanExceptionTest.java * @run main MBeanExceptionTest */ diff --git a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java index 5fe115f7b04..b6ab026f801 100644 --- a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java +++ b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import javax.management.ObjectName; * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. * @author Jaroslav Bachorik + * @modules java.management * @run clean MBeanFallbackTest * @run build MBeanFallbackTest * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MBeanFallbackTest diff --git a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java index 1ffe3b1bac3..b0008f34e74 100644 --- a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java +++ b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5092515 * @summary Test how to unwrap a user specific exception * @author Shanliang JIANG + * @modules java.management * @run clean MBeanServerInvocationHandlerExceptionTest * @run build MBeanServerInvocationHandlerExceptionTest * @run main MBeanServerInvocationHandlerExceptionTest diff --git a/jdk/test/javax/management/MBeanServer/MBeanServerNotificationTest.java b/jdk/test/javax/management/MBeanServer/MBeanServerNotificationTest.java index b0c9406cf6b..cfea620a3da 100644 --- a/jdk/test/javax/management/MBeanServer/MBeanServerNotificationTest.java +++ b/jdk/test/javax/management/MBeanServer/MBeanServerNotificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Checks that MBeanServerNotification.toString contains the * MBean name. * @author Daniel Fuchs + * @modules java.management/com.sun.jmx.mbeanserver * @compile MBeanServerNotificationTest.java * @run main MBeanServerNotificationTest */ diff --git a/jdk/test/javax/management/MBeanServer/MBeanTest.java b/jdk/test/javax/management/MBeanServer/MBeanTest.java index 1ac50573e5f..342e15d3b69 100644 --- a/jdk/test/javax/management/MBeanServer/MBeanTest.java +++ b/jdk/test/javax/management/MBeanServer/MBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 javax.management.ObjectName; * @bug 8010285 * @summary General MBean test. * @author Jaroslav Bachorik + * @modules java.management * @run clean MBeanTest * @run build MBeanTest * @run main MBeanTest diff --git a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java index 5f659eed24e..cbccf234e1c 100644 --- a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java +++ b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4757273 * @summary Test that registered notification is sent early enough * @author Eamonn McManus + * @modules java.management * @run clean NewMBeanListenerTest * @run build NewMBeanListenerTest * @run main NewMBeanListenerTest diff --git a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java index ad551d71489..c46a90fdc96 100644 --- a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java +++ b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4757273 * @summary Test deadlock in MBeanServerDelegate listeners * @author Eamonn McManus + * @modules java.management * @run clean NotifDeadlockTest * @run build NotifDeadlockTest * @run main NotifDeadlockTest diff --git a/jdk/test/javax/management/MBeanServer/OldMBeanServerTest.java b/jdk/test/javax/management/MBeanServer/OldMBeanServerTest.java index c25a3855085..5f9a8b06174 100644 --- a/jdk/test/javax/management/MBeanServer/OldMBeanServerTest.java +++ b/jdk/test/javax/management/MBeanServer/OldMBeanServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,6 +97,7 @@ import javax.management.remote.JMXServiceURL; * @bug 5072268 * @summary Test that nothing assumes a post-1.2 MBeanServer * @author Eamonn McManus + * @modules java.management * @run main/othervm -ea OldMBeanServerTest */ diff --git a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java index f5091f282aa..35db83c2dc7 100644 --- a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java +++ b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check behaviour of MBeanServer when postRegister and postDeregister * throw exceptions. * @author Daniel Fuchs + * @modules java.management * @compile PostExceptionTest.java * @run main PostExceptionTest */ diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java index 164752d23e4..81876af0274 100644 --- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java +++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6417044 * @summary Test deadlock in MBeanRegistration.postRegister method * @author Eamonn McManus, Daniel Fuchs + * @modules java.management * @run clean PostRegisterDeadlockTest * @run build PostRegisterDeadlockTest * @run main PostRegisterDeadlockTest diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java index 3bb43908d4c..d6d52304add 100644 --- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java +++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6417044 * @summary Test that a failing MBean registration does not lead to a deadlock * @author Eamonn McManus + * @modules java.management * @run main PostRegisterDeadlockTest2 */ diff --git a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java index acc47a530c4..f3eb915830f 100644 --- a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java +++ b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6318664 * @summary Test deadlock in MBeanRegistration.preDeregister method * @author Eamonn McManus + * @modules java.management * @run clean PreDeregisterDeadlockTest * @run build PreDeregisterDeadlockTest * @run main PreDeregisterDeadlockTest diff --git a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java index 484f7b1c84b..7b1098184c6 100644 --- a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java +++ b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4911846 * @summary Test that MBeanRegistration can change caller ObjectName * @author Eamonn McManus + * @modules java.management * @run clean PreRegisterTest * @run build PreRegisterTest * @run main PreRegisterTest diff --git a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java index 797d0d57ca6..d9d792b3ac5 100644 --- a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java +++ b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the releaseMBeanServer(MBeanServer mbeanServer) method * throws IllegalArgumentException as expected * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ReleaseMBeanServerTest * @run build ReleaseMBeanServerTest * @run main ReleaseMBeanServerTest diff --git a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java index 8a33324005a..005b1e73933 100644 --- a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java +++ b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * IllegalArgumentException when attribute names, operation names, and * Java type names do not strictly follow the expected Java syntax. * @author Daniel Fuchs + * @modules java.management * @run clean MustBeValidCommand * @run build MustBeValidCommand * @run main MustBeValidCommand diff --git a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java index e0cf5c36d9b..0435329d08b 100644 --- a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java +++ b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5001857 * @summary Test queryNames() and queryMBeans() with a buggy DynamicMBean * @author Daniel Fuchs + * @modules java.management * @run clean MBeanInfoFailTest * @run build MBeanInfoFailTest * @run main MBeanInfoFailTest diff --git a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java index 1126aa6bec8..33e8497119d 100644 --- a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java +++ b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5015663 * @summary Test ObjectInstance(name,null).hashCode() and .equals() * @author Daniel Fuchs + * @modules java.management * @run clean ObjectInstanceNullTest * @run build ObjectInstanceNullTest * @run main ObjectInstanceNullTest diff --git a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java index f5261c8d699..166d06c8c55 100644 --- a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java +++ b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5080083 * @summary Test new added method "toString" * @author Shanliang JIANG + * @modules java.management * @run clean ToStringMethodTest * @run build ToStringMethodTest * @run main ToStringMethodTest diff --git a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java index 1cd2a1cb600..88427122b15 100644 --- a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java +++ b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test the ObjectName.apply(ObjectName) method * with wildcards in the key properties value part. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ApplyWildcardTest * @run build ApplyWildcardTest * @run main ApplyWildcardTest diff --git a/jdk/test/javax/management/ObjectName/ComparatorTest.java b/jdk/test/javax/management/ObjectName/ComparatorTest.java index f23223521a2..2803302ffee 100644 --- a/jdk/test/javax/management/ObjectName/ComparatorTest.java +++ b/jdk/test/javax/management/ObjectName/ComparatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5036680 * @summary Test the ObjectName.compareTo() method. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ComparatorTest * @run build ComparatorTest * @run main ComparatorTest diff --git a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java index c0ea6755622..030b629c850 100644 --- a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java +++ b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that MBeanServerDelegate.DELEGATE_NAME and ObjectName.WILDCARD * public constants have been initialized properly. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean DelegateNameWildcardNameTest * @run build DelegateNameWildcardNameTest * @run main DelegateNameWildcardNameTest diff --git a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java index 2c3d00d1ccb..385b58c6f55 100644 --- a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java +++ b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6229396 * @summary Test null/empty key/values in ObjectName constructors. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean NullEmptyKeyValueTest * @run build NullEmptyKeyValueTest * @run main NullEmptyKeyValueTest diff --git a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java index d86e384e4a7..12d0f1c5d95 100644 --- a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java +++ b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4894801 * @summary Test that ObjectName.getInstance(ObjectName) preserves key order * @author Eamonn McManus + * @modules java.management * @run clean ObjectNameGetInstanceTest * @run build ObjectNameGetInstanceTest * @run main ObjectNameGetInstanceTest diff --git a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java index 2ba61918666..6eba9ff0da8 100644 --- a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java +++ b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test if the repository supports correctly the use of * wildcards in the ObjectName key properties value part. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean RepositoryWildcardTest * @run build RepositoryWildcardTest * @run main RepositoryWildcardTest diff --git a/jdk/test/javax/management/ObjectName/SerialCompatTest.java b/jdk/test/javax/management/ObjectName/SerialCompatTest.java index 0c183b204a0..cbab37d2484 100644 --- a/jdk/test/javax/management/ObjectName/SerialCompatTest.java +++ b/jdk/test/javax/management/ObjectName/SerialCompatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6211220 6616825 * @summary Test that jmx.serial.form=1.0 works for ObjectName * @author Eamonn McManus, Daniel Fuchs + * @modules java.management * @run clean SerialCompatTest * @run build SerialCompatTest * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true -Djmx.serial.form=1.0 SerialCompatTest diff --git a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java index 166a68e7de6..ee436bdb551 100644 --- a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java +++ b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4716807 * @summary Test wildcards in ObjectName key properties value part. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ValueWildcardTest * @run build ValueWildcardTest * @run main ValueWildcardTest diff --git a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java index cbc74042b6a..9b3d120ebd4 100644 --- a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java +++ b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6204469 * @summary Test that MBean*Info can be constructed with default descriptor * @author Eamonn McManus + * @modules java.management * @run clean DefaultDescriptorTest * @run build DefaultDescriptorTest * @run main DefaultDescriptorTest diff --git a/jdk/test/javax/management/descriptor/DescriptorTest.java b/jdk/test/javax/management/descriptor/DescriptorTest.java index 44199979e68..cb2fd79e41e 100644 --- a/jdk/test/javax/management/descriptor/DescriptorTest.java +++ b/jdk/test/javax/management/descriptor/DescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6204469 6273765 * @summary Test various aspects of the Descriptor interface * @author Eamonn McManus + * @modules java.management * @run clean DescriptorTest * @run build DescriptorTest * @run main DescriptorTest diff --git a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java index 68deecd806c..ca8caaad6e2 100644 --- a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java +++ b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6255956 * @summary Test equals and hashCode for descriptors * @author Eamonn McManus + * @modules java.management * @run clean EqualsHashCodeTest * @run build EqualsHashCodeTest * @run main EqualsHashCodeTest diff --git a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java index 8cfe1c9e2cf..43138457108 100644 --- a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java +++ b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that immutability of ImmutableDescriptor cannot be * compromised by modifying field values that are arrays. * @author Eamonn McManus + * @modules java.management * @run clean ImmutableArrayFieldTest * @run build ImmutableArrayFieldTest * @run main ImmutableArrayFieldTest diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java index 0577e0c1400..c1f8b20949b 100644 --- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java +++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6204469 * @summary Test ImmutableDescriptor serialization. * @author Eamonn McManus + * @modules java.management * @run clean ImmutableDescriptorSerialTest * @run build ImmutableDescriptorSerialTest * @run main ImmutableDescriptorSerialTest diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java index 95add0e2add..49cbf6203dd 100644 --- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java +++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * null name in it and calling setFields with a field names array with an * empty name in it throw the expected exceptions. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ImmutableDescriptorSetFieldsTest * @run build ImmutableDescriptorSetFieldsTest * @run main ImmutableDescriptorSetFieldsTest diff --git a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java index 79979106e78..96a0101abdc 100644 --- a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java +++ b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6204469 * @summary Check that descriptors have not broken serial interop. * @author Eamonn McManus + * @modules java.management * @run clean MBeanInfoInteropTest SerializedInfo * @run build MBeanInfoInteropTest SerializedInfo * @run main MBeanInfoInteropTest SerializedInfo diff --git a/jdk/test/javax/management/descriptor/UnionTest.java b/jdk/test/javax/management/descriptor/UnionTest.java index e8400ea425a..3fc8590fca1 100644 --- a/jdk/test/javax/management/descriptor/UnionTest.java +++ b/jdk/test/javax/management/descriptor/UnionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6273752 * @summary Test ImmutableDescriptor.union * @author Eamonn McManus + * @modules java.management * @run clean UnionTest * @run build UnionTest * @run main UnionTest diff --git a/jdk/test/javax/management/generified/GenericTest.java b/jdk/test/javax/management/generified/GenericTest.java index 3a7b6fc7ae9..c445276d954 100644 --- a/jdk/test/javax/management/generified/GenericTest.java +++ b/jdk/test/javax/management/generified/GenericTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4847959 6191402 * @summary Test newly-generified APIs * @author Eamonn McManus + * @modules java.management * @run clean GenericTest * @run build GenericTest * @run main GenericTest diff --git a/jdk/test/javax/management/generified/ListTypeCheckTest.java b/jdk/test/javax/management/generified/ListTypeCheckTest.java index c2743cbe356..9a576784f5a 100644 --- a/jdk/test/javax/management/generified/ListTypeCheckTest.java +++ b/jdk/test/javax/management/generified/ListTypeCheckTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6250772 * @summary Test that *List objects are checked after asList is called. * @author Eamonn McManus + * @modules java.management * @run clean ListTypeCheckTest * @run build ListTypeCheckTest * @run main ListTypeCheckTest diff --git a/jdk/test/javax/management/loading/ArrayClassTest.java b/jdk/test/javax/management/loading/ArrayClassTest.java index 51cac319971..45a88cf302d 100644 --- a/jdk/test/javax/management/loading/ArrayClassTest.java +++ b/jdk/test/javax/management/loading/ArrayClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that array classes can be found in signatures always * and can be deserialized by the deprecated MBeanServer.deserialize method * @author Eamonn McManus + * @modules java.management * @run clean ArrayClassTest * @run build ArrayClassTest * @run main ArrayClassTest @@ -35,6 +36,7 @@ import java.io.*; import java.lang.reflect.*; import java.net.*; +import java.nio.file.Paths; import javax.management.*; import javax.management.loading.*; @@ -42,15 +44,16 @@ public class ArrayClassTest { public static void main(String[] args) throws Exception { MBeanServer mbs = MBeanServerFactory.createMBeanServer(); - /* If this test isn't loaded by a URLClassLoader we will get - a ClassCastException here, which is good because it means - this test isn't valid. */ - URLClassLoader testLoader = - (URLClassLoader) ArrayClassTest.class.getClassLoader(); + String[] cpaths = System.getProperty("test.classes", ".") + .split(File.pathSeparator); + URL[] urls = new URL[cpaths.length]; + for (int i=0; i < cpaths.length; i++) { + urls[i] = Paths.get(cpaths[i]).toUri().toURL(); + } // Create an MLet that can load the same class names but // will produce different results. - ClassLoader loader = new SpyLoader(testLoader.getURLs()); + ClassLoader loader = new SpyLoader(urls); ObjectName loaderName = new ObjectName("test:type=SpyLoader"); mbs.registerMBean(loader, loaderName); diff --git a/jdk/test/javax/management/loading/DocumentRootTest.java b/jdk/test/javax/management/loading/DocumentRootTest.java index 6b714e17f1f..b517d634d2b 100644 --- a/jdk/test/javax/management/loading/DocumentRootTest.java +++ b/jdk/test/javax/management/loading/DocumentRootTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test parsing error when the mlet file is * located in the web server's document root. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean DocumentRootTest * @run build DocumentRootTest * @run main DocumentRootTest diff --git a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java index 7278cd230c5..8ca12dc13a6 100644 --- a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java +++ b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * given MLet instance throws a ServiceNotFoundException exception * with a non null cause. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean GetMBeansFromURLTest * @run build GetMBeansFromURLTest * @run main GetMBeansFromURLTest diff --git a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java index 3930d0bb554..a858388e7f4 100644 --- a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java +++ b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the same native library coming from the same jar file can * be loaded twice by two different MLets on the same JVM without conflict. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean LibraryLoaderTest * @run build LibraryLoaderTest * @run main/othervm LibraryLoaderTest diff --git a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java index 48492208818..88e61dd2e76 100644 --- a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java +++ b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * for the test codebase as it is executed by the MLet code using * doPrivileged. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MLetCommand * @run build MLetCommand * @run main/othervm/policy=policy MLetCommand diff --git a/jdk/test/javax/management/loading/MLetContentTest.java b/jdk/test/javax/management/loading/MLetContentTest.java index 940f9f56efa..76f04b470ce 100644 --- a/jdk/test/javax/management/loading/MLetContentTest.java +++ b/jdk/test/javax/management/loading/MLetContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4796780 * @summary The class MLetContentTest becomes public * @author Shanliang JIANG + * @modules java.management * @run clean MLetContentTest * @run build MLetContentTest * @run main MLetContentTest diff --git a/jdk/test/javax/management/loading/MLetInternalsTest.java b/jdk/test/javax/management/loading/MLetInternalsTest.java index a359697b0b3..48318ac602c 100644 --- a/jdk/test/javax/management/loading/MLetInternalsTest.java +++ b/jdk/test/javax/management/loading/MLetInternalsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import static org.testng.Assert.*; * @bug 8058089 * @summary Tests various internal functions provided by MLet for correctness * @author Jaroslav Bachorik + * @modules java.management * @run testng MLetInternalsTest */ public class MLetInternalsTest { diff --git a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java index 3069fe577c9..f0f4da02355 100644 --- a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java +++ b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * terminated with the corresponding '>' and an opening '<' for * the subsequent tag is encountered. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ParserInfiniteLoopTest * @run build ParserInfiniteLoopTest * @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet1.html diff --git a/jdk/test/javax/management/loading/SystemClassLoaderTest.java b/jdk/test/javax/management/loading/SystemClassLoaderTest.java index 6fbbcdd22c2..73430b5b912 100644 --- a/jdk/test/javax/management/loading/SystemClassLoaderTest.java +++ b/jdk/test/javax/management/loading/SystemClassLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that a class can load MBeans from its class loader * (at least if it is the system class loader) * @author Eamonn McManus + * @modules java.management * @run clean SystemClassLoaderTest * @run build SystemClassLoaderTest * @run main SystemClassLoaderTest diff --git a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java index 67c9a0045df..049e0be2720 100644 --- a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java +++ b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ * no other attributes. * @author Yves Joan * @author Eamonn McManus + * @modules java.management * @run clean AddAttributeChangeNotificationListenerTest * @run build AddAttributeChangeNotificationListenerTest * @run main AddAttributeChangeNotificationListenerTest diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java index 35538d391c8..b83d2745bb8 100644 --- a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java +++ b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6332962 * @summary Test that DescriptorSupport does not serialize targetObject * @author Eamonn McManus + * @modules java.management * @run clean DescriptorSupportSerialTest * @run build DescriptorSupportSerialTest * @run main DescriptorSupportSerialTest diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java index f256469ba08..a19044cc95c 100644 --- a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java +++ b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4883712 4869006 4894856 5016685 * @summary Test that DescriptorSupport correctly validates fields * @author Eamonn McManus + * @modules java.management * @run clean DescriptorSupportTest * @run build DescriptorSupportTest * @run main DescriptorSupportTest diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java index acc5691332f..2e0aee671b3 100644 --- a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java +++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that DescriptorSupport.toXMLString() can be used to * reconstruct an equivalent DescriptorSupport * @author Eamonn McManus + * @modules java.management * @run clean DescriptorSupportXMLTest * @run build DescriptorSupportXMLTest * @run main DescriptorSupportXMLTest diff --git a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java index 98b3474939c..a93791777a4 100644 --- a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java +++ b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that a custom ModelMBean implementation can have custom * targetType values in its ModelMBeanOperationInfo descriptors. * @author Eamonn McManus + * @modules java.management * @run clean ExoticTargetTypeTest * @run build ExoticTargetTypeTest * @run main ExoticTargetTypeTest diff --git a/jdk/test/javax/management/modelmbean/InfoSupportTest.java b/jdk/test/javax/management/modelmbean/InfoSupportTest.java index c6e8e89b4ef..01f92bae42e 100644 --- a/jdk/test/javax/management/modelmbean/InfoSupportTest.java +++ b/jdk/test/javax/management/modelmbean/InfoSupportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * that getDescriptors("mbean") works, and that default values for * MBean descriptors are correctly assigned. * @author Eamonn McManus + * @modules java.management * @run clean InfoSupportTest * @run build InfoSupportTest * @run main InfoSupportTest diff --git a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java index 4fddd88cf88..92516cd3956 100644 --- a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java +++ b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * when traces enabled and no attributes. * @author Luis-Miguel Alventosa * @author Paul Cheeseman + * @modules java.management */ import java.util.logging.ConsoleHandler; diff --git a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java index 12a79a6a91b..b8df32c621b 100644 --- a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java +++ b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that ModelMBeanInfoSupport.getDescriptors(null) also * returns the MBean's descriptor. * @author Eamonn McManus, Daniel Fuchs + * @modules java.management * @run clean GetAllDescriptorsTest * @run build GetAllDescriptorsTest * @run main/othervm/policy=policy GetAllDescriptorsTest diff --git a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java index 5740fc874f6..dab8dc65512 100644 --- a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java +++ b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that OnUnregister is an allowed value for persistPolicy * in ModelMBeanAttributeInfo * @author Eamonn McManus + * @modules java.management * @run clean OnUnregisterTest * @run build OnUnregisterTest * @run main OnUnregisterTest diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java index 83fbb4995e3..855de5fb886 100644 --- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java +++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ * - the declared name can be loaded by the value's class loader and * produces a class to which the value can be assigned. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean RequiredModelMBeanGetAttributeTest * @run build RequiredModelMBeanGetAttributeTest * @run main RequiredModelMBeanGetAttributeTest diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java index 3eecb466d92..54d86c82884 100644 --- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java +++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * from the RequiredModelMBean class itself if they are not in the * ModelMBeanInfo * @author Eamonn McManus + * @modules java.management * @run clean RequiredModelMBeanMethodTest * @run build RequiredModelMBeanMethodTest * @run main RequiredModelMBeanMethodTest diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java index c393d787a5f..7f83c2839cc 100644 --- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java +++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * MBeanException wrapping a ServiceNotFoundException is thrown is setAttribute * called but no setMethod field has been provided. * @author Jean-Francois Denise + * @modules java.management * @run clean RequiredModelMBeanSetAttributeTest * @run build RequiredModelMBeanSetAttributeTest * @run main RequiredModelMBeanSetAttributeTest diff --git a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java index 94141f574eb..d811ad1219a 100644 --- a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java +++ b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * IllegalArgumentException when attribute names, operation names, and * Java type names do not strictly follow the expected Java syntax. * @author Eamonn McManus, Daniel Fuchs + * @modules java.management * @run clean SimpleModelMBeanCommand * @run build SimpleModelMBeanCommand * @run main/othervm/policy=policy SimpleModelMBeanCommand diff --git a/jdk/test/javax/management/modelmbean/UnserializableTargetObjectTest.java b/jdk/test/javax/management/modelmbean/UnserializableTargetObjectTest.java index ba9158b9485..ce93eadf711 100644 --- a/jdk/test/javax/management/modelmbean/UnserializableTargetObjectTest.java +++ b/jdk/test/javax/management/modelmbean/UnserializableTargetObjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that a RequiredModelMBean operation can have a targetObject * that is not serializable * @author Eamonn McManus + * @modules java.management * @run clean UnserializableTargetObjectTest * @run build UnserializableTargetObjectTest * @run main UnserializableTargetObjectTest diff --git a/jdk/test/javax/management/monitor/AttributeArbitraryDataTypeTest.java b/jdk/test/javax/management/monitor/AttributeArbitraryDataTypeTest.java index aa386062b27..34aaac676b0 100644 --- a/jdk/test/javax/management/monitor/AttributeArbitraryDataTypeTest.java +++ b/jdk/test/javax/management/monitor/AttributeArbitraryDataTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary Test that the counter/gauge/string monitors * support attributes of arbitrary data types. * @author Luis-Miguel Alventosa + * @modules java.desktop + * java.management * @run clean AttributeArbitraryDataTypeTest * @run build AttributeArbitraryDataTypeTest * @run main AttributeArbitraryDataTypeTest diff --git a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java index f241ccf7d3a..61115d6ee9f 100644 --- a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java +++ b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java @@ -27,6 +27,7 @@ * @summary Test that no locks are held when a monitor attribute is sampled * or notif delivered. * @author Eamonn McManus + * @modules java.management * @run clean CounterMonitorDeadlockTest * @run build CounterMonitorDeadlockTest * @run main CounterMonitorDeadlockTest 1 diff --git a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java index 89bf3298278..a0abb8825d1 100644 --- a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java +++ b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * objects added before the counter monitor is started as well as by * the observed objects which are added once the monitor is started. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean CounterMonitorInitThresholdTest * @run build CounterMonitorInitThresholdTest * @run main CounterMonitorInitThresholdTest diff --git a/jdk/test/javax/management/monitor/CounterMonitorTest.java b/jdk/test/javax/management/monitor/CounterMonitorTest.java index be58f31e983..07dba0458ae 100644 --- a/jdk/test/javax/management/monitor/CounterMonitorTest.java +++ b/jdk/test/javax/management/monitor/CounterMonitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the counter monitor, when running in difference mode, * emits a notification every time the threshold is exceeded. * @author Luis-Miguel Alventosa, Shanliang JIANG + * @modules java.management * @run clean CounterMonitorTest * @run build CounterMonitorTest * @run main CounterMonitorTest diff --git a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java index c42c54d9f0d..4463551ffdc 100644 --- a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java +++ b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6229368 8025207 * @summary Wrong threshold value in CounterMonitor with offset and modulus. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean CounterMonitorThresholdTest * @run build CounterMonitorThresholdTest * @run main CounterMonitorThresholdTest diff --git a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java index 9bb956da7d6..038df903dab 100644 --- a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java +++ b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6683213 * @summary Test that the initial derived gauge is (Integer)0 * @author Daniel Fuchs + * @modules java.management * @run clean DerivedGaugeMonitorTest * @run build DerivedGaugeMonitorTest * @run main DerivedGaugeMonitorTest diff --git a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java index c85c223dff8..a8a51c39ad7 100644 --- a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java +++ b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that no locks are held when a monitor attribute is sampled * or notif delivered. * @author Eamonn McManus + * @modules java.management * @run clean GaugeMonitorDeadlockTest * @run build GaugeMonitorDeadlockTest * @run main GaugeMonitorDeadlockTest 1 diff --git a/jdk/test/javax/management/monitor/MultiMonitorTest.java b/jdk/test/javax/management/monitor/MultiMonitorTest.java index fe40f63d8ff..9ec7e51734d 100644 --- a/jdk/test/javax/management/monitor/MultiMonitorTest.java +++ b/jdk/test/javax/management/monitor/MultiMonitorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4984057 * @summary Test that monitors can sample a large number of attributes * @author Eamonn McManus + * @modules java.management * @run clean MultiMonitorTest * @run build MultiMonitorTest * @run main MultiMonitorTest diff --git a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java index c382ec8cac5..ada24cbc63c 100644 --- a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java +++ b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * jmx.monitor.error.type notification when the attribute * being monitored returns a non comparable value. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean NonComparableAttributeValueTest * @run build NonComparableAttributeValueTest * @run main NonComparableAttributeValueTest diff --git a/jdk/test/javax/management/monitor/NullAttributeValueTest.java b/jdk/test/javax/management/monitor/NullAttributeValueTest.java index 3386bc57f78..7bedeee13fa 100644 --- a/jdk/test/javax/management/monitor/NullAttributeValueTest.java +++ b/jdk/test/javax/management/monitor/NullAttributeValueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * being monitored returns a null value. * @author Luis-Miguel Alventosa * @author Shanliang JIANG + * @modules java.management * @run clean NullAttributeValueTest * @run build NullAttributeValueTest * @run main NullAttributeValueTest diff --git a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java index d4acde3a928..c3b0b02dc14 100644 --- a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java +++ b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the jmx.monitor.error.runtime monitor notification * is emitted when getAttribute throws ReflectionException. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ReflectionExceptionTest MBeanServerBuilderImpl * MBeanServerForwarderInvocationHandler * @run build ReflectionExceptionTest MBeanServerBuilderImpl diff --git a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java index 53ee24db702..097b0c29bd3 100644 --- a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java +++ b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that the jmx.monitor.error.runtime monitor notification * is emitted when getAttribute throws RuntimeException. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean RuntimeExceptionTest MBeanServerBuilderImpl * MBeanServerForwarderInvocationHandler * @run build RuntimeExceptionTest MBeanServerBuilderImpl diff --git a/jdk/test/javax/management/monitor/StartStopTest.java b/jdk/test/javax/management/monitor/StartStopTest.java index 95787972412..5d5ff35cc12 100644 --- a/jdk/test/javax/management/monitor/StartStopTest.java +++ b/jdk/test/javax/management/monitor/StartStopTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * monitors are started and stopped in a loop. * @author Luis-Miguel Alventosa * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run clean StartStopTest * @run build StartStopTest diff --git a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java index 2f78ce626bf..cede5465804 100644 --- a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java +++ b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that no locks are held when a monitor attribute is sampled * or notif delivered. * @author Eamonn McManus + * @modules java.management * @run clean StringMonitorDeadlockTest * @run build StringMonitorDeadlockTest * @run main StringMonitorDeadlockTest 1 diff --git a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java index 56eb0d6a0d2..71b7c5ec064 100644 --- a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java +++ b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015 Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that each thread in the thread pool runs * in the context of the monitor.start() caller. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ThreadPoolAccTest * @run build ThreadPoolAccTest * @run main ThreadPoolAccTest diff --git a/jdk/test/javax/management/monitor/ThreadPoolTest.java b/jdk/test/javax/management/monitor/ThreadPoolTest.java index 606fa5b149d..dce81dad808 100644 --- a/jdk/test/javax/management/monitor/ThreadPoolTest.java +++ b/jdk/test/javax/management/monitor/ThreadPoolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that all monitors will be well started when sharing * a single thread pool. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ThreadPoolTest * @run build ThreadPoolTest * @run main/othervm/timeout=300 ThreadPoolTest 1 diff --git a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java index e78fdf3de9f..2b251f66d26 100644 --- a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java +++ b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 6175517 6278707 * @summary Test that ambiguous ConstructorProperties annotations are detected. * @author Eamonn McManus + * @modules java.desktop + * java.management * @run clean AmbiguousConstructorTest * @run build AmbiguousConstructorTest * @run main AmbiguousConstructorTest diff --git a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java index 1b6d94e8950..2de6cb1a528 100644 --- a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java +++ b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6601652 * @summary Test exception when SortedMap or SortedSet has non-null Comparator * @author Eamonn McManus + * @modules java.management */ import java.util.SortedMap; diff --git a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java index 494568ba62b..89ca763cfea 100644 --- a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java +++ b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 6713777 * @summary Test that exception messages include all relevant information * @author Eamonn McManus + * @modules java.desktop + * java.management */ import java.beans.ConstructorProperties; diff --git a/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java b/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java index a90a75ad579..6fa7e56c334 100644 --- a/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java +++ b/jdk/test/javax/management/mxbean/GenericArrayTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6292705 * @summary Test support for arrays in parameterized types. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean GenericArrayTypeTest * @run build GenericArrayTypeTest * @run main GenericArrayTypeTest diff --git a/jdk/test/javax/management/mxbean/GenericTypeTest.java b/jdk/test/javax/management/mxbean/GenericTypeTest.java index abd4ba9cf0c..44cfbaa60fc 100644 --- a/jdk/test/javax/management/mxbean/GenericTypeTest.java +++ b/jdk/test/javax/management/mxbean/GenericTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6376416 6406447 * @summary Test use of generic types in MXBeans (mostly illegal). * @author Eamonn McManus + * @modules java.management * @run main GenericTypeTest */ diff --git a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java index a877f3820c7..21be355dd54 100644 --- a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java +++ b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Ensure the registration of an invalid MXBean * throws NotCompliantMBeanException. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean InvalidMXBeanRegistrationTest * @run build InvalidMXBeanRegistrationTest * @run main InvalidMXBeanRegistrationTest diff --git a/jdk/test/javax/management/mxbean/LeakTest.java b/jdk/test/javax/management/mxbean/LeakTest.java index 14d197bc942..231168fec62 100644 --- a/jdk/test/javax/management/mxbean/LeakTest.java +++ b/jdk/test/javax/management/mxbean/LeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 6482247 * @summary Test that creating MXBeans does not introduce memory leaks. * @author Eamonn McManus + * @modules java.desktop + * java.management * @run build LeakTest RandomMXBeanTest * @run main LeakTest */ @@ -38,12 +40,14 @@ * This test can be applied to any jtreg test, not just the MXBean tests. */ +import java.io.File; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; +import java.nio.file.Paths; public class LeakTest { /* Ideally we would include MXBeanTest in the list of tests, since it @@ -95,11 +99,15 @@ public class LeakTest { private static WeakReference<ClassLoader> testShadow(Class<?> originalTestClass) throws Exception { - URLClassLoader originalLoader = - (URLClassLoader) originalTestClass.getClassLoader(); - URL[] urls = originalLoader.getURLs(); + String[] cpaths = System.getProperty("test.classes", ".") + .split(File.pathSeparator); + URL[] urls = new URL[cpaths.length]; + for (int i=0; i < cpaths.length; i++) { + urls[i] = Paths.get(cpaths[i]).toUri().toURL(); + } + URLClassLoader shadowLoader = - new ShadowClassLoader(urls, originalLoader.getParent()); + new ShadowClassLoader(urls, originalTestClass.getClassLoader().getParent()); System.out.println("Shadow loader is " + shadowLoader); String className = originalTestClass.getName(); Class<?> testClass = Class.forName(className, false, shadowLoader); diff --git a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java index 3f8c44d9a6d..2f63e7f6a7a 100644 --- a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java +++ b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6359948 * @summary Check that MXBean operations have the expected ReturnType in MBeanOperationInfo * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MBeanOperationInfoTest * @run build MBeanOperationInfoTest * @run main MBeanOperationInfoTest diff --git a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java index 507cbb0f272..62d1f223f4b 100644 --- a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6316491 * @summary Check that the MXBean annotation works as advertised * @author Eamonn McManus + * @modules java.management * @run clean MXBeanAnnotationTest * @run build MXBeanAnnotationTest * @run main MXBeanAnnotationTest diff --git a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java index cd10b6f6221..e0243e8da08 100644 --- a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. * @author Jaroslav Bachorik + * @modules java.management * @run clean MXBeanFallbackTest * @run build MXBeanFallbackTest * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MXBeanFallbackTest diff --git a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java index 0adbc1b9583..71b1fc2f84c 100644 --- a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6335337 * @summary Test correctness of mxbean flag in descriptor. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MXBeanFlagTest * @run build MXBeanFlagTest * @run main MXBeanFlagTest diff --git a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java index c11e54338ed..b8d9382f02d 100644 --- a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Ensure that preRegister etc are called, but not when wrapped * by the class StandardMBean * @author Eamonn McManus + * @modules java.management * @run clean MXBeanPreRegisterTest * @run build MXBeanPreRegisterTest * @run main MXBeanPreRegisterTest diff --git a/jdk/test/javax/management/mxbean/MXBeanRefTest.java b/jdk/test/javax/management/mxbean/MXBeanRefTest.java index 079afb73dcd..19cf5f99e15 100644 --- a/jdk/test/javax/management/mxbean/MXBeanRefTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanRefTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6296433 6283873 * @summary Test that inter-MXBean references work as expected. * @author Eamonn McManus + * @modules java.management * @run clean MXBeanRefTest * @run build MXBeanRefTest * @run main MXBeanRefTest diff --git a/jdk/test/javax/management/mxbean/MXBeanTest.java b/jdk/test/javax/management/mxbean/MXBeanTest.java index ecafe49adbb..9017d497a0d 100644 --- a/jdk/test/javax/management/mxbean/MXBeanTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,8 @@ * @summary General MXBean test. * @author Eamonn McManus * @author Jaroslav Bachorik + * @modules java.desktop + * java.management * @run clean MXBeanTest MerlinMXBean TigerMXBean * @run build MXBeanTest MerlinMXBean TigerMXBean * @run main MXBeanTest diff --git a/jdk/test/javax/management/mxbean/MiscTest.java b/jdk/test/javax/management/mxbean/MiscTest.java index f5ecf5a027b..27ce7bd4c8a 100644 --- a/jdk/test/javax/management/mxbean/MiscTest.java +++ b/jdk/test/javax/management/mxbean/MiscTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * interfaceClassName, openType, originalType, StandardMBean, * StandardEmitterMBean. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MiscTest * @run build MiscTest * @run main MiscTest diff --git a/jdk/test/javax/management/mxbean/OperationImpactTest.java b/jdk/test/javax/management/mxbean/OperationImpactTest.java index eeb7b97c942..85e159777b4 100644 --- a/jdk/test/javax/management/mxbean/OperationImpactTest.java +++ b/jdk/test/javax/management/mxbean/OperationImpactTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6320104 * @summary Check that MXBean operations have impact UNKNOWN. * @author Eamonn McManus + * @modules java.management * @run clean OperationImpactTest * @run build OperationImpactTest * @run main OperationImpactTest diff --git a/jdk/test/javax/management/mxbean/OverloadTest.java b/jdk/test/javax/management/mxbean/OverloadTest.java index 3fcfaf30251..6f6349c80d3 100644 --- a/jdk/test/javax/management/mxbean/OverloadTest.java +++ b/jdk/test/javax/management/mxbean/OverloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6175517 * @summary Test that MXBean interfaces can contain overloaded methods * @author Eamonn McManus + * @modules java.management * @run clean OverloadTest * @run build OverloadTest * @run main OverloadTest diff --git a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java index 6f4b9c727b0..2dabe17ea31 100644 --- a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java +++ b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6448042 * @summary Test that MXBeans can define their own names in preRegister * @author Eamonn McManus + * @modules java.management */ import java.lang.management.ManagementFactory; diff --git a/jdk/test/javax/management/mxbean/PropertyNamesTest.java b/jdk/test/javax/management/mxbean/PropertyNamesTest.java index fe63382a9a1..d8f6845ffd2 100644 --- a/jdk/test/javax/management/mxbean/PropertyNamesTest.java +++ b/jdk/test/javax/management/mxbean/PropertyNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 6175517 * @summary Test the PropertyNames annotation with MXBeans * @author Eamonn McManus + * @modules java.desktop + * java.management * @run clean PropertyNamesTest * @run build PropertyNamesTest * @run main PropertyNamesTest diff --git a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java index e9f112490d3..c71a256892d 100644 --- a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java +++ b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * names produces an exception * @author Alexander Shusherov * @author Eamonn McManus + * @modules java.management * @run main SameObjectTwoNamesTest * @run main/othervm -Djmx.mxbean.multiname=true SameObjectTwoNamesTest */ diff --git a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java index 54aed33fad5..c6c6be69332 100644 --- a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java +++ b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * getMBeanInfo and getNotificationInfo in StandardMBean and * StandardEmitterMBean. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean StandardMBeanOverrideTest * @run build StandardMBeanOverrideTest * @run main StandardMBeanOverrideTest diff --git a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java index d2ca6a90102..2752d4beeb4 100644 --- a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java +++ b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6305746 * @summary Test that the null values returned by the ThreadMXBean work. * @author Eamonn McManus + * @modules java.management * @run clean ThreadMXBeanTest * @run build ThreadMXBeanTest * @run main ThreadMXBeanTest diff --git a/jdk/test/javax/management/mxbean/TypeNameTest.java b/jdk/test/javax/management/mxbean/TypeNameTest.java index 3064ac95300..fdd7a94cc07 100644 --- a/jdk/test/javax/management/mxbean/TypeNameTest.java +++ b/jdk/test/javax/management/mxbean/TypeNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6757225 6763051 * @summary Test that type names in MXBeans match their spec. * @author Eamonn McManus + * @modules java.management */ import java.lang.reflect.Field; diff --git a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java index e40273d1b66..d4ba0bacc1b 100644 --- a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java +++ b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that NotificationBroadcasterSupport can be subclassed * and used with synchronized(this) without causing deadlock * @author Eamonn McManus + * @modules java.management * @run clean BroadcasterSupportDeadlockTest * @run build BroadcasterSupportDeadlockTest * @run main BroadcasterSupportDeadlockTest diff --git a/jdk/test/javax/management/notification/FilterExceptionTest.java b/jdk/test/javax/management/notification/FilterExceptionTest.java index 59461284794..c0d02db1f8a 100644 --- a/jdk/test/javax/management/notification/FilterExceptionTest.java +++ b/jdk/test/javax/management/notification/FilterExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6244855 6244863 * @summary Exception thrown by NotificationFilter should be ignored * @author Shanliang JIANG + * @modules java.management * @run clean FilterExceptionTest * @run build FilterExceptionTest * @run main FilterExceptionTest diff --git a/jdk/test/javax/management/notification/NotifExecutorTest.java b/jdk/test/javax/management/notification/NotifExecutorTest.java index 024d59bbba3..24e9e937be2 100644 --- a/jdk/test/javax/management/notification/NotifExecutorTest.java +++ b/jdk/test/javax/management/notification/NotifExecutorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4661545 * @summary Tests to use an executor to send notifications. * @author Shanliang JIANG + * @modules java.management * @run clean NotifExecutorTest * @run build NotifExecutorTest * @run main NotifExecutorTest diff --git a/jdk/test/javax/management/notification/NotifInfoTest.java b/jdk/test/javax/management/notification/NotifInfoTest.java index fd5a815d922..f1ebaa15440 100644 --- a/jdk/test/javax/management/notification/NotifInfoTest.java +++ b/jdk/test/javax/management/notification/NotifInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4506105 6303698 * @summary NotificationBroadcasterSupport should have a ctor with MBeanNotificationInfo[] * @author Shanliang JIANG + * @modules java.management * @run clean NotifInfoTest * @run build NotifInfoTest * @run main NotifInfoTest diff --git a/jdk/test/javax/management/openmbean/ArrayTypeTest.java b/jdk/test/javax/management/openmbean/ArrayTypeTest.java index 352a8e69c3d..c4b88b4047c 100644 --- a/jdk/test/javax/management/openmbean/ArrayTypeTest.java +++ b/jdk/test/javax/management/openmbean/ArrayTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5045358 * @summary Test that Open MBeans support arrays of primitive types. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean ArrayTypeTest * @run build ArrayTypeTest * @run main ArrayTypeTest diff --git a/jdk/test/javax/management/openmbean/BadConstraintTest.java b/jdk/test/javax/management/openmbean/BadConstraintTest.java index 850e64619da..5f39ea83a2c 100644 --- a/jdk/test/javax/management/openmbean/BadConstraintTest.java +++ b/jdk/test/javax/management/openmbean/BadConstraintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that Open MBean attributes and parameters cannot have * illegal constraints like min greater than max * @author Eamonn McManus + * @modules java.management * @run clean BadConstraintTest * @run build BadConstraintTest * @run main BadConstraintTest diff --git a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java index aa2d43a6ee9..f49a6aa86ea 100644 --- a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java +++ b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6610174 * @summary Test that CompositeDataSupport.toString() represents arrays correctly * @author Eamonn McManus + * @modules java.management */ import javax.management.openmbean.ArrayType; diff --git a/jdk/test/javax/management/openmbean/ConstraintTest.java b/jdk/test/javax/management/openmbean/ConstraintTest.java index 203d54c17e4..5457ba03709 100644 --- a/jdk/test/javax/management/openmbean/ConstraintTest.java +++ b/jdk/test/javax/management/openmbean/ConstraintTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6204469 * @summary Test that Open MBean attributes and parameters check constraints * @author Eamonn McManus + * @modules java.management * @run clean ConstraintTest * @run build ConstraintTest * @run main ConstraintTest diff --git a/jdk/test/javax/management/openmbean/EqualsTest.java b/jdk/test/javax/management/openmbean/EqualsTest.java index 707f7e99831..7d63daff917 100644 --- a/jdk/test/javax/management/openmbean/EqualsTest.java +++ b/jdk/test/javax/management/openmbean/EqualsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5072174 * @summary Test CompositeDataSupport.equals with ArrayType * @author Shanliang JIANG + * @modules java.management * @run clean EqualsTest * @run build EqualsTest * @run main EqualsTest diff --git a/jdk/test/javax/management/openmbean/IsValueTest.java b/jdk/test/javax/management/openmbean/IsValueTest.java index 189621291b9..93fa2514b24 100644 --- a/jdk/test/javax/management/openmbean/IsValueTest.java +++ b/jdk/test/javax/management/openmbean/IsValueTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5072004 * @summary Test new rules for isValue * @author Eamonn McManus + * @modules java.management */ import javax.management.openmbean.*; diff --git a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java index 8a811b1a967..0b0c4188666 100644 --- a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java +++ b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6434298 * @summary Test IAE is thrown when typeName or description parameter is null for TabularType and CompositeType constructors * @author Joel FERAUD + * @modules java.management */ import javax.management.openmbean.*; diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java index 452e940b0fd..2679615b759 100644 --- a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java +++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import javax.management.openmbean.SimpleType; * @bug 8023529 * @summary Test that OpenMBean*Info.equals do not throw NPE * @author Shanliang JIANG + * @modules java.management * @run clean OpenMBeanInfoEqualsNPETest * @run build OpenMBeanInfoEqualsNPETest * @run main OpenMBeanInfoEqualsNPETest diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java index 3c829434193..3cd70d30526 100644 --- a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java +++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +40,7 @@ import javax.management.openmbean.SimpleType; * @bug 8023529 * @summary Test that OpenMBean*Info.hashCode do not throw NPE * @author Shanliang JIANG + * @modules java.management * @run clean OpenMBeanInfoHashCodeNPETest * @run build OpenMBeanInfoHashCodeNPETest * @run main OpenMBeanInfoHashCodeNPETest diff --git a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java index 778ffa1ac27..885634e4707 100644 --- a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java +++ b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Test that Open*MBeanInfo classes include "openType" in descriptor * and also test serial compatibility with Java 5. * @author Eamonn McManus + * @modules java.management * @run clean OpenTypeDescriptorTest * @run build OpenTypeDescriptorTest * @run main OpenTypeDescriptorTest diff --git a/jdk/test/javax/management/openmbean/TabularDataOrderTest.java b/jdk/test/javax/management/openmbean/TabularDataOrderTest.java index 91e514f738f..32ce7a3db00 100644 --- a/jdk/test/javax/management/openmbean/TabularDataOrderTest.java +++ b/jdk/test/javax/management/openmbean/TabularDataOrderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6334663 * @summary Test that TabularDataSupport preserves the order elements were added * @author Eamonn McManus + * @modules java.management */ import java.io.ByteArrayInputStream; diff --git a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java index 2d96d062b30..f157457adad 100644 --- a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java +++ b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import javax.management.ObjectName; * It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic" * system property must be set before c.s.j.m.MBeanAnalyzer has been loaded. * @author Jaroslav Bachorik + * @modules java.management * @run clean JMXProxyFallbackTest * @run build JMXProxyFallbackTest * @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true JMXProxyFallbackTest diff --git a/jdk/test/javax/management/proxy/JMXProxyTest.java b/jdk/test/javax/management/proxy/JMXProxyTest.java index 0eb53cdebdb..33cae1dd3f9 100644 --- a/jdk/test/javax/management/proxy/JMXProxyTest.java +++ b/jdk/test/javax/management/proxy/JMXProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import javax.management.ObjectName; * @summary Tests that javax.management.JMX creates proxies only for the * compliant MBeans/MXBeans * @author Jaroslav Bachorik + * @modules java.management * @run clean JMXProxyTest * @run build JMXProxyTest * @run main JMXProxyTest diff --git a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java index 62146fcd8ab..2c602b9e032 100644 --- a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java +++ b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Test that we can create proxies which are NotificationEmitters. * @bug 6411747 * @author Daniel Fuchs + * @modules java.management * @run clean NotificationEmitterProxy * @run build NotificationEmitterProxy * @run main NotificationEmitterProxy diff --git a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java index 1227b9eb8ab..30238c8fb30 100644 --- a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java +++ b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6177524 * @summary Test how to execute the 3 Object methods by a Proxy. * @author Shanliang JIANG + * @modules java.management * @run clean ProxyObjectMethodsTest * @run build ProxyObjectMethodsTest * @run main ProxyObjectMethodsTest diff --git a/jdk/test/javax/management/query/CustomQueryTest.java b/jdk/test/javax/management/query/CustomQueryTest.java index 27ad42961a1..7ba7396c2c8 100644 --- a/jdk/test/javax/management/query/CustomQueryTest.java +++ b/jdk/test/javax/management/query/CustomQueryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6692027 * @summary Check that custom subclasses of QueryEval can be serialized. * @author Eamonn McManus + * @modules java.management */ import java.io.ByteArrayInputStream; diff --git a/jdk/test/javax/management/query/InstanceOfExpTest.java b/jdk/test/javax/management/query/InstanceOfExpTest.java index 8fae18d9e20..bd36da396a6 100644 --- a/jdk/test/javax/management/query/InstanceOfExpTest.java +++ b/jdk/test/javax/management/query/InstanceOfExpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5072174 6335848 * @summary test the new method javax.management.Query.isInstanceOf("className") * @author Shanliang JIANG + * @modules java.management * @run clean InstanceOfExpTest * @run build InstanceOfExpTest * @run main InstanceOfExpTest diff --git a/jdk/test/javax/management/query/QueryExpStringTest.java b/jdk/test/javax/management/query/QueryExpStringTest.java index b2ee5c71ea4..79696585cc1 100644 --- a/jdk/test/javax/management/query/QueryExpStringTest.java +++ b/jdk/test/javax/management/query/QueryExpStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4886011 * @summary Test that QueryExp.toString() is reversible * @author Eamonn McManus + * @modules java.management * @run clean QueryExpStringTest * @run build QueryExpStringTest * @run main QueryExpStringTest diff --git a/jdk/test/javax/management/query/QueryMatchTest.java b/jdk/test/javax/management/query/QueryMatchTest.java index 629e255c058..ec5c2a0c5c9 100644 --- a/jdk/test/javax/management/query/QueryMatchTest.java +++ b/jdk/test/javax/management/query/QueryMatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6266438 * @summary Query.match code for character sequences like [a-z] is wrong. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean QueryMatchTest * @run build QueryMatchTest * @run main QueryMatchTest diff --git a/jdk/test/javax/management/query/QuerySubstringTest.java b/jdk/test/javax/management/query/QuerySubstringTest.java index 9ace45f9c7a..7b0a3d81b7d 100644 --- a/jdk/test/javax/management/query/QuerySubstringTest.java +++ b/jdk/test/javax/management/query/QuerySubstringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Query.{initial,any,final}SubString fail if the * matching constraint string contains wildcards. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean QuerySubstringTest * @run build QuerySubstringTest * @run main QuerySubstringTest diff --git a/jdk/test/javax/management/relation/NonArrayListTest.java b/jdk/test/javax/management/relation/NonArrayListTest.java index 81a4d9ab12b..28de757f51b 100644 --- a/jdk/test/javax/management/relation/NonArrayListTest.java +++ b/jdk/test/javax/management/relation/NonArrayListTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4848474 * @summary Test that relation service doesn't require List params to be ArrayList * @author Eamonn McManus + * @modules java.management * @run clean NonArrayListTest * @run build NonArrayListTest * @run main NonArrayListTest diff --git a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java index 994f0275e3f..b4c974fb9f5 100644 --- a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java +++ b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6701459 * @summary Test sequence numbers in RelationService notifications. * @author Eamonn McManus + * @modules java.management */ /* diff --git a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java index 24b29d38043..0133d1a0d38 100644 --- a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java +++ b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4892674 * @summary Test that RelationNotification can be constructed with ObjectName. * @author Eamonn McManus + * @modules java.management * @run clean RelationNotificationSourceTest * @run build RelationNotificationSourceTest * @run main RelationNotificationSourceTest diff --git a/jdk/test/javax/management/relation/RelationTypeTest.java b/jdk/test/javax/management/relation/RelationTypeTest.java index fcc27c47cf4..cfcb08884b8 100644 --- a/jdk/test/javax/management/relation/RelationTypeTest.java +++ b/jdk/test/javax/management/relation/RelationTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4716675 * @summary Test that relation type checking uses isInstanceOf * @author Eamonn McManus + * @modules java.management * @run clean RelationTypeTest * @run build RelationTypeTest * @run main RelationTypeTest diff --git a/jdk/test/javax/management/remote/mandatory/URLTest.java b/jdk/test/javax/management/remote/mandatory/URLTest.java index bf84b44e7d9..d10c1c71f0f 100644 --- a/jdk/test/javax/management/remote/mandatory/URLTest.java +++ b/jdk/test/javax/management/remote/mandatory/URLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5057532 * @summary Tests that host names are parsed correctly in URLs * @author Eamonn McManus + * @modules java.management * @run clean URLTest * @run build URLTest * @run main URLTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java index 8fc49e935b3..32639ce9e0d 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6238815 * @summary test the new interface Addressable * @author Shanliang JIANG + * @modules java.management * @run clean AddressableTest * @run build AddressableTest * @run main AddressableTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java index 93dc7375019..ba230bce611 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4940957 8025205 * @summary Tests behaviour when connections break * @author Eamonn McManus + * @modules java.management * @run clean BrokenConnectionTest * @run build BrokenConnectionTest * @run main BrokenConnectionTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java index 735d5650b0d..2eb59b30acf 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4921888 * @summary Tests that we do not get a NullPointException. * @author Shanliang JIANG + * @modules java.management * @run clean CloseFailedClientTest * @run build CloseFailedClientTest * @run main CloseFailedClientTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java index 0e64e33e3eb..a1944baa8c5 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4838640 * @summary test server close in different conditions. * @author Shanliang JIANG + * @modules java.management * @run clean CloseServerTest * @run build CloseServerTest * @run main CloseServerTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java index b6ab5bbded6..34925683287 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4897052 * @summary Tests that opening and immediately closing a connector works * @author Eamonn McManus + * @modules java.management * @run clean CloseUnconnectedTest * @run build CloseUnconnectedTest * @run main CloseUnconnectedTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java index ebe8df60646..77b7adc0958 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * the method "void close() throws IOException;" extend * or implement the java.io.Closeable interface. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean CloseableTest * @run build CloseableTest * @run main CloseableTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java index a121fd8cd2b..d819d0008eb 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4943248 * @summary Tests that NullPointerException is thrown when listener is null. * @author Daniel Fuchs + * @modules java.management * @run clean ConnectionListenerNullTest * @run build ConnectionListenerNullTest * @run main ConnectionListenerNullTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java index abf0058de6c..13a84a8349b 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4865397 * @summary Tests remote JMX connections * @author Eamonn McManus + * @modules java.management * @run clean ConnectionTest * @run build ConnectionTest * @run main ConnectionTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java index ac97a803cff..42bb5e6d50d 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary test the connector server option that causes it not to prevent the * VM from exiting * @author Shanliang JIANG, Eamonn McManus + * @modules java.management * @run main/othervm DaemonRMIExporterTest */ import java.util.Arrays; diff --git a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java index 43aa61f7a62..65c40688f3a 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5039210 * @summary test on a client notification deadlock. * @author Shanliang JIANG + * @modules java.management * @run clean DeadLockTest * @run build DeadLockTest * @run main DeadLockTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java index bb098320a36..b231bbaa536 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @bug 4939578 * @summary test to get an IOException. * @author Shanliang JIANG + * @modules java.management * @run clean FailedConnectionTest * @run build FailedConnectionTest * @run main FailedConnectionTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java index 79714f3a03e..7b978db7aad 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4951414 * @summary Try to get an IOException. * @author Shanliang JIANG + * @modules java.management * @run clean GetConnectionTest * @run build GetConnectionTest * @run main GetConnectionTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java index da9800d0deb..1f177c915f4 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4886799 * @summary Check that IIOP URLs have /ior/ in the path * @author Eamonn McManus + * @modules java.management * @run clean IIOPURLTest * @run build IIOPURLTest * @run main IIOPURLTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/IdleTimeoutTest.java b/jdk/test/javax/management/remote/mandatory/connection/IdleTimeoutTest.java index b2193f276b2..08d68896bde 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/IdleTimeoutTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/IdleTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4886838 4886830 8025204 * @summary Tests that idle timeouts happen at appropriate times * @author Eamonn McManus + * @modules java.management/com.sun.jmx.remote.util * @run clean IdleTimeoutTest * @run build IdleTimeoutTest * @run main IdleTimeoutTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java index 086c10e75eb..fc913a690dc 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 1234567 * @summary Open, connect then close multi-connectors. * @author Shanliang JIANG + * @modules java.management * @run clean MultiOpenCloseTest * @run build MultiOpenCloseTest * @run main MultiOpenCloseTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java index f42abc695db..f3ee55b95bd 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ import javax.management.remote.rmi.RMIConnectorServer; * @bug 6697180 * @summary test on a client notification deadlock. * @author Shanliang JIANG + * @modules java.management * @run clean MultiThreadDeadLockTest * @run build MultiThreadDeadLockTest * @run main MultiThreadDeadLockTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/NoIIOP.java b/jdk/test/javax/management/remote/mandatory/connection/NoIIOP.java index 14858b1ed83..b710305761e 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/NoIIOP.java +++ b/jdk/test/javax/management/remote/mandatory/connection/NoIIOP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 8004502 * @summary Sanity check that attempts to use the IIOP transport or * RMIIIOPServerImpl when RMI/IIOP not present throws the expected exceptions + * @modules java.management */ import javax.management.MBeanServer; diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java index bd0a5e66602..9e243259ab4 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4901808 7183800 * @summary Check that RMI connection ids include client host name * @author Eamonn McManus + * @modules java.management * @run clean RMIConnectionIdTest * @run build RMIConnectionIdTest * @run main RMIConnectionIdTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorInternalMapTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorInternalMapTest.java index 86efed134f3..276e231cf85 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorInternalMapTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorInternalMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,7 @@ import javax.security.auth.Subject; * @bug 6566891 * @summary Check no memory leak on RMIConnector's rmbscMap * @author Shanliang JIANG + * @modules java.management * @run clean RMIConnectorInternalMapTest * @run build RMIConnectorInternalMapTest * @run main RMIConnectorInternalMapTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorNullSubjectConnTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorNullSubjectConnTest.java index 7b5224e9b92..1872a13c3f7 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorNullSubjectConnTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorNullSubjectConnTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ import javax.management.remote.rmi.RMIConnector; * @bug 6566891 * @summary Check no memory leak on RMIConnector's nullSubjectConn * @author Shanliang JIANG + * @modules java.management * @run clean RMIConnectorNullSubjectConnTest * @run build RMIConnectorNullSubjectConnTest * @run main RMIConnectorNullSubjectConnTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java index 54af752e5c3..a2a1f9ca72c 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnector_NPETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ * @summary NPE IN RMIConnector.connect * @bug 6984520 * @library /java/rmi/testlibrary + * @modules java.management + * java.rmi/sun.rmi.registry + * java.rmi/sun.rmi.server + * java.rmi/sun.rmi.transport + * java.rmi/sun.rmi.transport.tcp * @run clean RMIConnector_NPETest * @run build TestLibrary RMID * @run build RMIConnector_NPETest diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java index 14fbddeae81..cfa64ab7768 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @bug 4917237 * @summary test that process exit immediately after stop() / close() called * @author Jean Francois Denise + * @modules java.management * @run clean RMIExitTest * @run build RMIExitTest * @run main RMIExitTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java index c1da0c593cf..7b90441d8b2 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Tests to serialize RMIConnector * @bug 5032052 * @author Shanliang JIANG + * @modules java.management * @run clean RMISerializeTest * @run build RMISerializeTest * @run main RMISerializeTest diff --git a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java index fdcf22d1234..a2a110e2764 100644 --- a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java +++ b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4927217 * @summary test to reconnect * @author Shanliang JIANG + * @modules java.management * @run clean ReconnectTest * @run build ReconnectTest * @run main ReconnectTest diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java index b85dace4d5e..35ce6db28bd 100644 --- a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java +++ b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6475157 * @summary Tests deadlock in simultaneous connection and connector-server close * @author Eamonn McManus + * @modules java.management */ /* This test is somewhat dependent on implementation details. If it suddenly diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java index 746b134f7f2..8607d0266ba 100644 --- a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java +++ b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests that JNDI bind failure doesn't leave an orphan RMI * Connector Server object * @author Eamonn McManus + * @modules java.management * @run clean JNDIFailureTest * @run build JNDIFailureTest * @run main JNDIFailureTest diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java index 6a2d0745d51..c6a0e793d56 100644 --- a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java +++ b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that setting an MBeanServerForwarder on an already * started RMI connector server has the expected behavior. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MBSFPreStartPostStartTest * @run build MBSFPreStartPostStartTest * @run main MBSFPreStartPostStartTest diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/RMIExporterTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/RMIExporterTest.java index 2ac2084a655..2d305cd4886 100644 --- a/jdk/test/javax/management/remote/mandatory/connectorServer/RMIExporterTest.java +++ b/jdk/test/javax/management/remote/mandatory/connectorServer/RMIExporterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5016705 * @summary Tests the use of the RMIExporter class. * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.internal * @run clean RMIExporterTest * @run build RMIExporterTest * @run main RMIExporterTest diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/SetMBeanServerForwarder.java b/jdk/test/javax/management/remote/mandatory/connectorServer/SetMBeanServerForwarder.java index f3649b281dd..4fa67da40ec 100644 --- a/jdk/test/javax/management/remote/mandatory/connectorServer/SetMBeanServerForwarder.java +++ b/jdk/test/javax/management/remote/mandatory/connectorServer/SetMBeanServerForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests that IllegalArgumentException is thrown when * MBeanServerForwrder is null. * @author Daniel Fuchs + * @modules java.management/com.sun.jmx.remote.security * @run clean SetMBeanServerForwarder * @run build SetMBeanServerForwarder * @run main SetMBeanServerForwarder diff --git a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java index e7ff8ff23a5..e0aab2f2415 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4884913 * @summary Tests that default protocols are loaded correctly * @author Eamonn McManus + * @modules java.management * @run clean DefaultProviderTest * @run build DefaultProviderTest * @run main DefaultProviderTest diff --git a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java index a58ce1c6a15..10a929f73f4 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4924683 * @summary Check RMI/JRMP stubs can be deserialized using user's loader * @author Eamonn McManus + * @modules java.management * @run clean DeserializeEncodedURLTest SingleClassLoader * @run build DeserializeEncodedURLTest SingleClassLoader * @run main DeserializeEncodedURLTest diff --git a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java index a54514e2b74..3d65adaf9ad 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,12 +26,14 @@ * @bug 4898478 * @summary Tests client default class loader used before JSR 160 loader * @author Eamonn McManus + * @modules java.management * @run clean MethodResultTest * @run build MethodResultTest * @run main MethodResultTest */ import java.io.*; +import java.nio.file.Paths; import java.net.*; import java.util.*; import javax.management.*; @@ -56,24 +58,23 @@ import javax.management.remote.*; */ public class MethodResultTest { public static void main(String[] args) throws Exception { - Class thisClass = MethodResultTest.class; - Class exoticClass = Exotic.class; + Class<?> thisClass = MethodResultTest.class; + Class<?> exoticClass = Exotic.class; String exoticClassName = Exotic.class.getName(); - ClassLoader testClassLoader = thisClass.getClassLoader(); - if (!(testClassLoader instanceof URLClassLoader)) { - System.out.println("TEST INVALID: Not loaded by a " + - "URLClassLoader: " + testClassLoader); - System.exit(1); + + String[] cpaths = System.getProperty("test.classes", ".") + .split(File.pathSeparator); + URL[] urls = new URL[cpaths.length]; + for (int i=0; i < cpaths.length; i++) { + urls[i] = Paths.get(cpaths[i]).toUri().toURL(); } - URLClassLoader tcl = (URLClassLoader) testClassLoader; - URL[] urls = tcl.getURLs(); ClassLoader shadowLoader = - new ShadowLoader(urls, testClassLoader, + new ShadowLoader(urls, thisClass.getClassLoader(), new String[] {exoticClassName, ExoticMBeanInfo.class.getName(), ExoticException.class.getName()}); - Class cl = shadowLoader.loadClass(exoticClassName); + Class<?> cl = shadowLoader.loadClass(exoticClassName); if (cl == exoticClass) { System.out.println("TEST INVALID: Shadow class loader loaded " + "same class as test class loader"); @@ -197,12 +198,12 @@ public class MethodResultTest { } private static boolean checkType(String what, Object object, - Class wrongClass) { + Class<?> wrongClass) { return checkType(what, object, wrongClass, false); } private static boolean checkType(String what, Object object, - Class wrongClass, boolean isException) { + Class<?> wrongClass, boolean isException) { final String type = isException ? "exception" : "object"; final String rendered = isException ? "thrown" : "returned"; System.out.println("For " + type + " " + rendered + " by " + what + @@ -224,7 +225,7 @@ public class MethodResultTest { } private static boolean checkExceptionType(String what, Exception exception, - Class wrongClass) { + Class<?> wrongClass) { if (!(exception instanceof MBeanException)) { System.out.println("Exception thrown by " + what + " is not an " + MBeanException.class.getName() + @@ -320,7 +321,7 @@ public class MethodResultTest { this.shadowClassNames = Arrays.asList(shadowClassNames); } - protected Class findClass(String name) throws ClassNotFoundException { + protected Class<?> findClass(String name) throws ClassNotFoundException { if (shadowClassNames.contains(name)) return super.findClass(name); else diff --git a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java index c6e212cf924..644b8dacf0e 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4915825 4921009 4934965 4977469 8019584 * @summary Tests behavior when client or server gets object of unknown class * @author Eamonn McManus + * @modules java.management * @run clean MissingClassTest SingleClassLoader * @run build MissingClassTest SingleClassLoader * @run main MissingClassTest diff --git a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java index 65a816d4428..fdb8e8c86a8 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5021246 * @summary Check that class downloading is supported by RMI connector * @author Eamonn McManus + * @modules java.management * @run main RMIDownloadTest receive without * @run main RMIDownloadTest send without * @run main RMIDownloadTest receive with diff --git a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java index af01ba1c6d0..f6422ee817f 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4910428 * @summary Tests target MBean class loader used before JSR 160 loader * @author Eamonn McManus + * @modules java.management * @run clean TargetMBeanTest * @run build TargetMBeanTest * @run main TargetMBeanTest diff --git a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java index f3cf45e2fad..e634d6cfc41 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6356458 * @summary test to not lose a user classloader * @author Shanliang JIANG + * @modules java.management * @run clean UserClassLoaderTest * @run build UserClassLoaderTest * @run main UserClassLoaderTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java index 599b908cff4..a3b433757a7 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @bug 4838640 4917194 * @summary test on add/remove NotificationListener * @author Shanliang JIANG + * @modules java.management * @run clean AddRemoveTest * @run build AddRemoveTest * @run main AddRemoveTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java index 53f2cc1a278..3958d2bfa13 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7120365 * @summary test on Concurrent Modification * @author Shanliang JIANG + * @modules java.management * @run main ConcurrentModificationTest */ @@ -164,4 +165,4 @@ public class ConcurrentModificationTest { mserver.removeNotificationListener(delegateName, listener); } } -} \ No newline at end of file +} diff --git a/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java b/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java index 83a44a3dc44..9f19efea098 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/DeadListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 6957378 * @summary Test that a listener can be removed remotely from an MBean that no longer exists. + * @modules java.management/com.sun.jmx.remote.internal * @author Eamonn McManus */ diff --git a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java index edc4be22873..8ed989c2b9e 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4911721 * @summary test on add/remove NotificationListener * @author Shanliang JIANG + * @modules java.management * @run clean DiffHBTest * @run build DiffHBTest * @run main DiffHBTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java index c17563bf12b..ebc0ab239d6 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check that the expected notification is received by the JMX * client even when the domain in the ObjectName is not specified * @author Shanliang JIANG + * @modules java.management * @run clean EmptyDomainNotificationTest * @run build EmptyDomainNotificationTest * @run main EmptyDomainNotificationTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java index 0b09931b0f7..efebce3b365 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6338874 * @summary Check that notification dispatch is not linear in number of MBeans. * @author Eamonn McManus + * @modules java.management */ /* diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java index 538658f7b06..9abc9ba152a 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java @@ -26,6 +26,7 @@ * @summary Tests to send a not serializable notification. * @bug 5022196 * @author Shanliang JIANG + * @modules java.management * @run clean NotSerializableNotifTest * @run build NotSerializableNotifTest * @run main NotSerializableNotifTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java index 57f7a6342f8..bb7af6c3518 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6174229 * @summary Verify the property name specifying server notification buffer size. * @author Shanliang JIANG + * @modules java.management * @run clean NotifBufferSizePropertyNameTest * @run build NotifBufferSizePropertyNameTest * @run main NotifBufferSizePropertyNameTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java index 0c4f901bea1..fa8986340a0 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6199899 * @summary Tests reconnection done by a fetching notif thread. * @author Shanliang JIANG + * @modules java.management * @run clean NotifReconnectDeadlockTest * @run build NotifReconnectDeadlockTest * @run main NotifReconnectDeadlockTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java index fca338f5628..2a77ccb63a2 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationAccessControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5106721 * @summary Check the NotificationAccessController methods are properly called. * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean NotificationAccessControllerTest * @run build NotificationAccessControllerTest * @run main NotificationAccessControllerTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java index ea27cb461de..85a06afb956 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4934236 * @summary Tests that NotificationBuffer is created when used. * @author jfd@... + * @modules java.management * @run clean NotificationBufferCreationTest NotificationSender * @run build NotificationBufferCreationTest * @run main NotificationBufferCreationTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java index e0502079951..68e712947ab 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java @@ -27,6 +27,7 @@ * @summary Tests NotificationBuffer doesn't hold locks when adding listeners, * if test times out then deadlock is suspected. * @author Eamonn McManus + * @modules java.management * @run clean NotificationBufferDeadlockTest * @run build NotificationBufferDeadlockTest * @run main NotificationBufferDeadlockTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferTest.java index e996500cf6b..bf8c1639486 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ * @bug 7654321 * @summary Tests the NotificationBuffer class. * @author Eamonn McManus + * @modules java.management/com.sun.jmx.remote.internal + * java.management/com.sun.jmx.remote.util * @run clean NotificationBufferTest * @run build NotificationBufferTest NotificationSender NotificationSenderMBean * @run main NotificationBufferTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java index 54a98dce4e1..c59d723aa13 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Check the emission of notifications when a Security Manager is * installed. Test the property "jmx.remote.x.check.notification.emission". * @author Luis-Miguel Alventosa + * @modules java.management * @run clean NotificationEmissionTest * @run build NotificationEmissionTest * @run main NotificationEmissionTest 1 diff --git a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java index 0623f2868f3..092eb6413ea 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests to receive notifications for opened and closed connections ions * @author sjiang + * @modules java.management * @run clean RMINotifTest * @run build RMINotifTest * @run main RMINotifTest diff --git a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java index e2888d3850d..773ddfd1cc5 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java +++ b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests the reception of the notifications for opened and closed * connections * @author sjiang + * @modules java.management * @run clean ServerNotifs * @run build ServerNotifs * @run main ServerNotifs diff --git a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java index 77acc43de33..9623773ea59 100644 --- a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java +++ b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests whether a listener receives notifs emitted before the * listener is registered. * @author Shanliang JIANG + * @modules java.management * @run clean UnexpectedNotifTest * @run build UnexpectedNotifTest * @run main UnexpectedNotifTest diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java index cdb81f95080..b94c6663d32 100644 --- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java +++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests that MBeanServerFileAccessController supports * principals other than JMXPrincipal. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean * @run build NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean * @run main NonJMXPrincipalsTest diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java index 4dec56044d2..057e3640767 100644 --- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java +++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests the use of the "jmx.remote.x.password.file" and * "jmx.remote.x.access.file" environment map properties. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean PasswordAccessFileTest SimpleStandard SimpleStandardMBean * @run build PasswordAccessFileTest SimpleStandard SimpleStandardMBean * @run main PasswordAccessFileTest diff --git a/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIAltAuthTest.java b/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIAltAuthTest.java index e548ccd91ee..f5c4fd13571 100644 --- a/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIAltAuthTest.java +++ b/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIAltAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5016508 * @summary Supplies an alternative JAAS configuration for authenticating RMI clients * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean RMIAltAuthTest * @run build RMIAltAuthTest SimpleStandard SimpleStandardMBean * @run main RMIAltAuthTest diff --git a/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIPasswdAuthTest.java b/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIPasswdAuthTest.java index c4c983c4ca0..0a383622561 100644 --- a/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIPasswdAuthTest.java +++ b/jdk/test/javax/management/remote/mandatory/passwordAuthenticator/RMIPasswdAuthTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 5016508 * @summary Tests the default JAAS configuration for authenticating RMI clients * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean RMIPasswdAuthTest * @run build RMIPasswdAuthTest SimpleStandard SimpleStandardMBean * @run main RMIPasswdAuthTest diff --git a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java index 091d31a8a38..87e15fae068 100644 --- a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java +++ b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* * @test ProviderTest.java * @summary Tests jar services provider are called + * @modules java.management * @run clean ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl * @run build ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl * @run main ProviderTest diff --git a/jdk/test/javax/management/remote/mandatory/serverError/JMXServerErrorTest.java b/jdk/test/javax/management/remote/mandatory/serverError/JMXServerErrorTest.java index a1c06c97847..33d471b7326 100644 --- a/jdk/test/javax/management/remote/mandatory/serverError/JMXServerErrorTest.java +++ b/jdk/test/javax/management/remote/mandatory/serverError/JMXServerErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4871761 * @summary Tests that JMXServiceErrorException is correctly emitted. * @author Daniel Fuchs + * @modules java.management/com.sun.jmx.remote.security * @run clean JMXServerErrorTest * @run build JMXServerErrorTest * @run main JMXServerErrorTest diff --git a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java index 9abb260d35e..30e550a1dfb 100644 --- a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java +++ b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 7654321 * @summary Tests the use of the custom RMI socket factories. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean RMISocketFactoriesTest * @run build RMISocketFactoriesTest RMIClientFactory RMIServerFactory * @run main RMISocketFactoriesTest test_server_factory diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation1Test.java b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation1Test.java index 734102ce9e0..1e996a724fc 100644 --- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation1Test.java +++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation1Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests the use of the subject delegation feature in the * RMI connector * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean SubjectDelegation1Test SimpleStandard SimpleStandardMBean * @run build SubjectDelegation1Test SimpleStandard SimpleStandardMBean * @run main SubjectDelegation1Test policy11 ok diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java index c54456ba910..20399d12fc2 100644 --- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java +++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation2Test.java @@ -27,6 +27,7 @@ * @summary Tests the use of the subject delegation feature on the authenticated * principals within the RMI connector server's creator codebase. * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean SubjectDelegation2Test SimpleStandard SimpleStandardMBean * @run build SubjectDelegation2Test SimpleStandard SimpleStandardMBean * @run main SubjectDelegation2Test policy21 ok diff --git a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java index 689a139ea33..3dc0928e3ce 100644 --- a/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java +++ b/jdk/test/javax/management/remote/mandatory/subjectDelegation/SubjectDelegation3Test.java @@ -28,6 +28,7 @@ * principals within the RMI connector server's creator codebase with * subject delegation. * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.security * @run clean SubjectDelegation3Test SimpleStandard SimpleStandardMBean * @run build SubjectDelegation3Test SimpleStandard SimpleStandardMBean * @run main SubjectDelegation3Test policy31 ok diff --git a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java index 324b78a69cf..02351a6eb7c 100644 --- a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java +++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6190873 * @summary Tests that thread creation can use a user-supplied Executor * @author Eamonn McManus + * @modules java.management * @run clean ExecutorTest * @run build ExecutorTest * @run main ExecutorTest diff --git a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java index 8bd3ca8fc29..ec88e51d093 100644 --- a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java +++ b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6192124 * @summary Tests that you can turn off the server connection timeout thread * @author Eamonn McManus + * @modules java.management * @run clean NoServerTimeoutTest * @run build NoServerTimeoutTest * @run main NoServerTimeoutTest diff --git a/jdk/test/javax/management/remote/mandatory/util/MapNullValuesTest.java b/jdk/test/javax/management/remote/mandatory/util/MapNullValuesTest.java index 1d14f4d15cf..6990f0c4aa0 100644 --- a/jdk/test/javax/management/remote/mandatory/util/MapNullValuesTest.java +++ b/jdk/test/javax/management/remote/mandatory/util/MapNullValuesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * Check also that null values for keys are not allowed in * the maps passed to the JMXConnector[Server] factories. * @author Luis-Miguel Alventosa + * @modules java.management/com.sun.jmx.remote.util * @run clean MapNullValuesTest * @run build MapNullValuesTest * @run main MapNullValuesTest diff --git a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java index 90186a5dd9c..0a924034713 100644 --- a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java +++ b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * security manager and the test codebase has the java permission to read * the "java.runtime.version" system property. * @author Luis-Miguel Alventosa, Joel Feraud + * @modules java.management * @run clean ImplVersionTest ImplVersionCommand * @run build ImplVersionTest ImplVersionCommand ImplVersionReader * @run main ImplVersionTest @@ -66,13 +67,9 @@ public class ImplVersionTest { // Get test classes String testClasses = System.getProperty("test.classes"); - // Get boot class path - String bootClassPath = System.getProperty("sun.boot.class.path"); - // Build command string String command = javaHome + File.separator + "bin" + File.separator + "java " + - " -Xbootclasspath/p:" + bootClassPath + " -classpath " + testClasses + " -Djava.security.manager -Djava.security.policy==" + testSrc + File.separator + "policy -Dtest.classes=" + testClasses + diff --git a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java index 5bf03ac26fa..b4a781bfbf1 100644 --- a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java +++ b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Test that MBeanServer.queryNames doesn't call getMBeanInfo on every * resultant MBean when there is no security manager installed. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean AvoidGetMBeanInfoCallsTest * @run build AvoidGetMBeanInfoCallsTest * @run main AvoidGetMBeanInfoCallsTest diff --git a/jdk/test/javax/management/security/MBeanPermissionTest.java b/jdk/test/javax/management/security/MBeanPermissionTest.java index 0946efbc285..6ac0fc2c071 100644 --- a/jdk/test/javax/management/security/MBeanPermissionTest.java +++ b/jdk/test/javax/management/security/MBeanPermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6228749 * @summary MBeanPermission(null,"") should throw IllegalArgumentException. * @author Luis-Miguel Alventosa + * @modules java.management * @run clean MBeanPermissionTest * @run build MBeanPermissionTest * @run main MBeanPermissionTest diff --git a/jdk/test/javax/management/standardmbean/DeadlockTest.java b/jdk/test/javax/management/standardmbean/DeadlockTest.java index 4d5f72df10e..7bd67394800 100644 --- a/jdk/test/javax/management/standardmbean/DeadlockTest.java +++ b/jdk/test/javax/management/standardmbean/DeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6331746 * @summary Test a deadlock and will be blocked forever if the deadlock is present. * @author Shanliang JIANG + * @modules java.management * @run main DeadlockTest */ diff --git a/jdk/test/javax/management/timer/MissingNotificationTest.java b/jdk/test/javax/management/timer/MissingNotificationTest.java index 9fedc74024b..e4bb8c21d92 100644 --- a/jdk/test/javax/management/timer/MissingNotificationTest.java +++ b/jdk/test/javax/management/timer/MissingNotificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6809322 * @summary Test for missing notifications in a high concurrency environment * @author Jaroslav Bachorik + * @modules java.management * @run clean MissingNotificationTest * @run build MissingNotificationTest * @run main MissingNotificationTest diff --git a/jdk/test/javax/management/timer/StartTest.java b/jdk/test/javax/management/timer/StartTest.java index 1b7b66a8b05..50f03d4a704 100644 --- a/jdk/test/javax/management/timer/StartTest.java +++ b/jdk/test/javax/management/timer/StartTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 6659215 * @summary Test on timer start method with past notifications * @author Shanliang JIANG + * @modules java.management * @run clean StartTest * @run build StartTest * @run main StartTest diff --git a/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java b/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java index bde0aed1112..2718e7a4b33 100644 --- a/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java +++ b/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java @@ -34,6 +34,7 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; @@ -144,7 +145,7 @@ public class NestedActions { } cmds.add(sb.toString()); if (JAVA_OPTS != null && !JAVA_OPTS.isEmpty()) { - cmds.add(JAVA_OPTS); + Collections.addAll(cmds, JAVA_OPTS.trim().split("\\s+")); } cmds.add("-Djava.security.manager"); cmds.add("-Djava.security.policy=" + TEST_SOURCES + FS + args[1]); diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java index 31c2e3327cc..98239775661 100644 --- a/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java +++ b/jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java @@ -227,7 +227,8 @@ public final class ProcessTools { * <span>The default redirects of STDOUT and STDERR are started</span> * <p> * It is possible to wait for the process to get to a warmed-up state - * via {@linkplain Predicate} condition on the STDOUT + * via {@linkplain Predicate} condition on the STDOUT. The warm-up will + * wait indefinitely. * </p> * @param name The process name * @param processBuilder The process builder diff --git a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java index 4299bf34384..e5dbcf31a16 100644 --- a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java +++ b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* * @test * @bug 4990825 + * @modules jdk.jvmstat/sun.jvmstat.monitor * @summary test that HostIdentifier objects get created as expected */ diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java b/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java index 604d7dcf7a8..5f069c474e5 100644 --- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java +++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/CR6672135.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import sun.jvmstat.monitor.VmIdentifier; * @bug 6672135 * @summary setInterval() for local MonitoredHost and local MonitoredVm * @author Tomas Hurka + * @modules jdk.jvmstat/sun.jvmstat.monitor * @run main/othervm -XX:+UsePerfData CR6672135 */ public class CR6672135 { diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java index b4f609bddeb..cd446dabbb4 100644 --- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java +++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,6 +67,9 @@ import sun.jvmstat.monitor.event.VmStatusChangeEvent; * @bug 4990825 * @summary attach to external but local JVM processes * @library /lib/testlibrary + * @modules java.management + * jdk.jvmstat/sun.jvmstat.monitor + * jdk.jvmstat/sun.jvmstat.monitor.event * @build jdk.testlibrary.* * @run main/othervm MonitorVmStartTerminate */ diff --git a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java index b5215f6b6f4..408ce1f4d06 100644 --- a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java +++ b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* * @test * @bug 4990825 + * @modules jdk.jvmstat/sun.jvmstat.monitor * @summary test that VmIdentifier objects get created as expected */ diff --git a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java index 617ac22503d..79089960487 100644 --- a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java +++ b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* * @test * @bug 4990825 + * @modules jdk.jvmstat/sun.jvmstat.monitor * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck * @summary prolog size and overflow sanity checks */ diff --git a/jdk/test/sun/management/AgentCMETest.java b/jdk/test/sun/management/AgentCMETest.java index fa47696305d..ff83b30001b 100644 --- a/jdk/test/sun/management/AgentCMETest.java +++ b/jdk/test/sun/management/AgentCMETest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 7164191 * @summary properties.putAll API may fail with ConcurrentModifcationException on multi-thread scenario + * @modules java.management/sun.management * @author Deven You */ diff --git a/jdk/test/sun/management/AgentCheckTest.java b/jdk/test/sun/management/AgentCheckTest.java index 570364fd262..b7f1c668739 100644 --- a/jdk/test/sun/management/AgentCheckTest.java +++ b/jdk/test/sun/management/AgentCheckTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 5013605 * @summary Localize log messages from the management agents + * @modules java.management/sun.management * * @author Tim Bell */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java index 84b9a5de6e0..51111af24c4 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getClassInitializationTime() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetClassInitializationTime */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java index c485905f06a..37971f7e2cc 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime() * @author Steve Bohne + * @modules java.management/sun.management * @build ClassToLoad0 * @run main/othervm -XX:+UsePerfData GetClassLoadingTime */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java index a2d12a4f790..72025d85962 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getInitializedClassCount() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetInitializedClassCount */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java index 6e29430e4fb..2ca1b85f528 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getLoadedClassSize() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetLoadedClassSize */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java index 234b484c19b..a8e5f43dcd1 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getMethodDataSize() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetMethodDataSize */ diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java index 87d1dc70353..6319c9abe5f 100644 --- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java +++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getUnloadedClassSize() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetUnloadedClassSize */ diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java index 7ddf3e76332..7d85e417100 100644 --- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java +++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotClassLoadingMBean.getSafepointCount() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetSafepointCount */ diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java index 903e6b76bb6..d2a5a7c3646 100644 --- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java +++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @bug 4858522 * @summary Basic unit test of HotspotRuntimeMBean.getSafepointSyncTime() * @author Steve Bohne + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetSafepointSyncTime */ diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java index 4dccc8871b4..5d75160d188 100644 --- a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java +++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +24,7 @@ /* * @test * @bug 4858522 + * @modules java.management/sun.management * @summary Basic unit test of HotspotRuntimeMBean.getTotalSafepointTime() * @author Steve Bohne */ diff --git a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java index 99dda98ab44..5d8fe4853fe 100644 --- a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java +++ b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Basic Test for HotspotThreadMBean.getInternalThreadCount() * and getInternalThreadCpuTime() * @author Mandy Chung + * @modules java.management/sun.management * @run main/othervm -XX:+UsePerfData GetInternalThreads */ diff --git a/jdk/test/sun/management/PlatformMBeanProviderConstructorCheck.java b/jdk/test/sun/management/PlatformMBeanProviderConstructorCheck.java new file mode 100644 index 00000000000..3c806864419 --- /dev/null +++ b/jdk/test/sun/management/PlatformMBeanProviderConstructorCheck.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.security.AccessControlException; +import java.security.Permission; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.util.List; + +/* + * @test + * @bug 8042901 + * @summary Check permission for PlatformMBeanProvider Constructor + * @author Shanliang Jiang + */ +public class PlatformMBeanProviderConstructorCheck { + public static void main(String[] args) throws Exception { + Policy origPolicy = Policy.getPolicy(); + SecurityManager origSM = System.getSecurityManager(); + try { + System.out.println("---PlatformMBeanProviderConstructorCheck starting..."); + + Policy.setPolicy(new MyPolicy()); + System.setSecurityManager(new SecurityManager()); + + System.out.println("---PlatformMBeanProviderConstructorCheck Testing without permission..."); + try { + new MyProvider(); + throw new RuntimeException("Does not get expected AccessControlException!"); + } catch (AccessControlException ace) { + System.out.println("---PlatformMBeanProviderConstructorCheck got the expected exception: " + + ace); + } + + System.out.println("---PlatformMBeanProviderConstructorCheck Testing with permission..."); + MyPolicy.allowed = true; + new MyProvider(); + + System.out.println("---PlatformMBeanProviderConstructorCheck PASSED!"); + } finally { + System.setSecurityManager(origSM); + Policy.setPolicy(origPolicy); + } + } + + private static class MyPolicy extends Policy { + private static String permName = "sun.management.spi.PlatformMBeanProvider.subclass"; + private static boolean allowed = false; + + @Override + public boolean implies(ProtectionDomain domain, Permission permission) { + if (permName.equals(permission.getName())) { + System.out.println("---MyPolicy-implies checks permission for " + +permName+" and returns "+allowed); + + return allowed; + } else { + return true; + } + } + } + + private static class MyProvider extends sun.management.spi.PlatformMBeanProvider { + @Override + public List<PlatformComponent<?>> getPlatformComponentList() { + return null; + } + } +} diff --git a/jdk/test/sun/management/jdp/JdpDefaultsTest.java b/jdk/test/sun/management/jdp/JdpDefaultsTest.java index acbb25648df..2156e38c4ec 100644 --- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java +++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test JdpDefaultsTest * @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port. * @library /lib/testlibrary + * @modules java.management/sun.management.jdp * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher * @run main JdpDefaultsTest */ diff --git a/jdk/test/sun/management/jdp/JdpOffTest.java b/jdk/test/sun/management/jdp/JdpOffTest.java index aac707686a2..405ed69caf8 100644 --- a/jdk/test/sun/management/jdp/JdpOffTest.java +++ b/jdk/test/sun/management/jdp/JdpOffTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test JdpOffTest.java * @summary Assert that no JDP packets are sent to the default address and port. * @library /lib/testlibrary + * @modules java.management/sun.management.jdp * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher * @run main JdpOffTest */ diff --git a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java index ff2a6ab3128..c266c95d69c 100644 --- a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java +++ b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test JdpSpecificAddressTest * @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port. * @library /lib/testlibrary + * @modules java.management/sun.management.jdp * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher * @run main JdpSpecificAddressTest */ diff --git a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java index 83e63f8565a..7e5f973d068 100644 --- a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java +++ b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java @@ -28,6 +28,7 @@ * * @author Daniel Fuchs * + * @modules java.management/sun.management.jmxremote * @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java * @run main LocalRMIServerSocketFactoryTest */ diff --git a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java index 0f2978f9b71..33c3e55a447 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import jdk.testlibrary.ProcessTools; * @test * @bug 6434402 8004926 * @library /lib/testlibrary + * @modules java.management/sun.management + * java.management * @build jdk.testlibrary.* * @build TestManager TestApplication CustomLauncherTest * @run main/othervm CustomLauncherTest diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java index 1350eafb40a..277edb33e5f 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ * @summary Tests that the jvmstat counters published by the out-of-the-box * management agent for the JMX connection details are correct. * @author Luis-Miguel Alventosa + * @modules java.management/sun.management * @run clean JvmstatCountersTest * @run build JvmstatCountersTest * @run main/othervm/timeout=600 -XX:+UsePerfData JvmstatCountersTest 1 diff --git a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java index 1306f4e31a6..15843654d30 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +37,7 @@ import java.util.concurrent.atomic.AtomicReference; * without connection or username/password details. * TestManager will attempt a connection to the address obtained from * both agent properties and jvmstat buffer. + * @modules java.management/sun.management * @build jdk.testlibrary.* TestManager TestApplication * @run main/othervm/timeout=300 -XX:+UsePerfData LocalManagementTest */ @@ -120,9 +121,7 @@ public class LocalManagementTest { return true; } return false; - }, - 5, - TimeUnit.SECONDS + } ); System.out.println("Attaching test manager:"); @@ -142,9 +141,7 @@ public class LocalManagementTest { clientPrc = ProcessTools.startProcess( "TestManager", client, - (String line) -> line.startsWith("Starting TestManager for PID"), - 10, - TimeUnit.SECONDS + (String line) -> line.startsWith("Starting TestManager for PID") ); int clientExitCode = clientPrc.waitFor(); diff --git a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java index e53cbc9eaaf..c034dcf47bd 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.io.IOException; * @library /lib/testlibrary * @bug 6557093 * @summary Check SSL config file permission for out-of-the-box management + * @modules java.management * @build jdk.testlibrary.* AbstractFilePermissionTest Dummy * @run main/timeout=300 PasswordFilePermissionTest * diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh index 10835558713..7ace853fcad 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,6 +27,9 @@ # @summary Test RMI Bootstrap # # @library /lib/testlibrary +# @modules java.management/sun.management +# java.management/sun.management.jmxremote +# java.management # @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest # @run shell/timeout=300 RmiBootstrapTest.sh diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java index dd1b3d1a043..6d27334cd07 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,7 @@ import java.util.regex.Pattern; * @library /lib/testlibrary * @bug 6228231 * @summary Test that RMI registry uses SSL. + * @modules java.management * @build jdk.testlibrary.* RmiRegistrySslTestApp * @run main/timeout=300 RmiRegistrySslTest * @author Luis-Miguel Alventosa, Taras Ledkov diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh index f4cd49e2c66..e5552ab8a21 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh @@ -27,9 +27,11 @@ # @summary Test RMI Bootstrap with SSL # # @library /lib/testlibrary +# @modules java.management/sun.management +# java.management/sun.management.jmxremote +# @ignore 8077924 # @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest # @run shell/timeout=300 RmiSslBootstrapTest.sh -# @ignore 8077924 # Define the Java class test name TESTCLASS="RmiBootstrapTest" diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh index c186749832f..a6d10631cdd 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. # 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,8 @@ # @summary Test RMI Bootstrap with SSL and no keystore. # # @bug 4932854 +# @modules java.management/sun.management +# java.management/sun.management.jmxremote # @build TestLogger RmiSslNoKeyStoreTest # @run shell/timeout=300 RmiSslNoKeyStoreTest.sh diff --git a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java index cbe158c0858..9aeb9c8b0d6 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +27,7 @@ import java.io.IOException; * @test * @library /lib/testlibrary * @bug 6557093 + * @modules java.management * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest * @summary Check SSL config file permission for out-of-the-box management * @run main/timeout=300 SSLConfigFilePermissionTest diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java index de5e9b6bbcd..6ef71f75d0e 100644 --- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java +++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java @@ -35,20 +35,16 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; -import java.util.Random; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; -import java.util.stream.Collectors; import javax.management.*; import javax.management.remote.*; import javax.net.ssl.SSLHandshakeException; import jdk.testlibrary.ProcessTools; -import jdk.testlibrary.JDKToolLauncher; import sun.management.Agent; import sun.management.AgentConfigurationError; @@ -56,46 +52,21 @@ import sun.management.AgentConfigurationError; * @test * @bug 7110104 * @library /lib/testlibrary - * @build jdk.testlibrary.* JMXStartStopTest JMXStartStopDoSomething + * @modules java.management/sun.management + * @build jdk.testlibrary.* JMXStartStopTest PortAllocator TestApp ManagementAgentJcmd * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest * @summary Makes sure that enabling/disabling the management agent through JCMD * achieves the desired results * @key randomness */ public class JMXStartStopTest { + private static final String TEST_APP_NAME = "TestApp"; private static final String TEST_SRC = System.getProperty("test.src"); private static final boolean verbose = false; - /** - * Dynamically allocates distinct ports from the ephemeral range 49152-65535 - */ - private static class PortAllocator { - - private final static int LOWER_BOUND = 49152; - private final static int UPPER_BOUND = 65535; - - private final static Random RND = new Random(System.currentTimeMillis()); - - private static int[] allocatePorts(final int numPorts) { - int[] ports = new int[numPorts]; - for (int i = 0; i < numPorts; i++) { - int port = -1; - while (port == -1) { - port = RND.nextInt(UPPER_BOUND - LOWER_BOUND + 1) + LOWER_BOUND; - for (int j = 0; j < i; j++) { - if (ports[j] == port) { - port = -1; - break; - } - } - } - ports[i] = port; - } - return ports; - } - } + private static ManagementAgentJcmd jcmd = new ManagementAgentJcmd(TEST_APP_NAME, verbose); private static void dbg_print(String msg) { if (verbose) { @@ -318,14 +289,14 @@ public class JMXStartStopTest { } } - private static class Something { + private static class TestAppRun { private Process p; private final ProcessBuilder pb; private final String name; private final AtomicBoolean started = new AtomicBoolean(false); private volatile long pid = -1; - public Something(ProcessBuilder pb, String name) { + public TestAppRun(ProcessBuilder pb, String name) { this.pb = pb; this.name = name; } @@ -335,16 +306,14 @@ public class JMXStartStopTest { try { AtomicBoolean error = new AtomicBoolean(false); p = ProcessTools.startProcess( - "JMXStartStopDoSomething{" + name + "}", + TEST_APP_NAME + "{" + name + "}", pb, (line) -> { boolean ok = line.equals("main enter"); error.set(line.contains("BindException")); return ok || error.get(); - }, - 5, - TimeUnit.SECONDS + } ); if (error.get()) { throw new BindException("Starting process failed due to " + @@ -352,8 +321,10 @@ public class JMXStartStopTest { } pid = p.getPid(); } catch (TimeoutException e) { - p.destroy(); - p.waitFor(); + if (p != null) { + p.destroy(); + p.waitFor(); + } throw e; } } @@ -382,105 +353,32 @@ public class JMXStartStopTest { } /** - * Runs the test application "JMXStartStopDoSomething" + * Runs the test application "TestApp" * @param name Test run name * @param args Additional arguments - * @return Returns a {@linkplain Something} instance representing the run + * @return Returns a {@linkplain TestAppRun} instance representing the run * @throws IOException * @throws InterruptedException * @throws TimeoutException */ - private static Something doSomething(String name, String ... args) + private static TestAppRun doTest(String name, String ... args) throws Exception { List<String> pbArgs = new ArrayList<>(Arrays.asList( "-cp", - System.getProperty("test.class.path") + System.getProperty("test.class.path"), + "-XX:+UsePerfData" )); pbArgs.addAll(Arrays.asList(args)); - pbArgs.add("JMXStartStopDoSomething"); + pbArgs.add(TEST_APP_NAME); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( pbArgs.toArray(new String[pbArgs.size()]) ); - Something s = new Something(pb, name); + TestAppRun s = new TestAppRun(pb, name); s.start(); return s; } - /** - * Run the "jcmd" command - * - * @param command Command with parameters; space separated string - * @throws IOException - * @throws InterruptedException - */ - private static void jcmd(String ... command) throws IOException, InterruptedException { - if (command.length == 0) { - jcmd(null, c->{}); - } else { - jcmd(null, command); - } - } - - /** - * Run the "jcmd" command - * - * @param c {@linkplain Consumer} instance - * @param command Command with parameters; space separated string - * @throws IOException - * @throws InterruptedException - */ - private static void jcmd(Consumer<String> c, String ... command) throws IOException, InterruptedException { - jcmd("JMXStartStopDoSomething", c, command); - } - - /** - * Run the "jcmd" command - * - * @param target The target application name (or PID) - * @param c {@linkplain Consumer} instance - * @param command Command with parameters; space separated string - * @throws IOException - * @throws InterruptedException - */ - private static void jcmd(String target, final Consumer<String> c, String ... command) throws IOException, InterruptedException { - dbg_print("[jcmd] " + (command.length > 0 ? command[0] : "list")); - - JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jcmd"); - l.addToolArg(target); - for (String cmd : command) { - l.addToolArg(cmd); - } - - AtomicBoolean portUnavailable = new AtomicBoolean(false); - Process p = ProcessTools.startProcess( - "jcmd", - new ProcessBuilder(l.getCommand()), - line -> { - if (line.contains("BindException") || - line.contains(Agent.getText(AgentConfigurationError.CONNECTOR_SERVER_IO_ERROR))) { - portUnavailable.set(true); - } else { - c.accept(line); - } - } - ); - - p.waitFor(); - dbg_print("[jcmd] --------"); - if (portUnavailable.get()) { - String cmd = Arrays.asList(l.getCommand()).stream() - .collect( - Collectors.joining(" ", "", ": Unable to bind address") - ); - throw new BindException(cmd); - } - } - - private static final String CMD_STOP = "ManagementAgent.stop"; - private static final String CMD_START = "ManagementAgent.start"; - private static final String CMD_START_LOCAL = "ManagementAgent.start_local"; - static void test_01() throws Exception { // Run an app with JMX enabled stop it and // restart on other port @@ -488,7 +386,7 @@ public class JMXStartStopTest { System.out.println("**** Test one ****"); int ports[] = PortAllocator.allocatePorts(2); - Something s = doSomething( + TestAppRun s = doTest( "test_01", "-Dcom.sun.management.jmxremote.port=" + ports[0], "-Dcom.sun.management.jmxremote.authenticate=false", @@ -497,10 +395,10 @@ public class JMXStartStopTest { try { testConnect(ports[0]); - jcmd(CMD_STOP); + jcmd.stop(); testNoConnect(ports[0]); - jcmd(CMD_START, "jmxremote.port=" + ports[1]); + jcmd.start("jmxremote.port=" + ports[1]); testConnect(ports[1]); } finally { s.stop(); @@ -514,12 +412,13 @@ public class JMXStartStopTest { System.out.println("**** Test two ****"); int[] ports = PortAllocator.allocatePorts(1); - Something s = doSomething("test_02"); + TestAppRun s = doTest("test_02"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); testConnect(ports[0]); } finally { @@ -535,18 +434,20 @@ public class JMXStartStopTest { System.out.println("**** Test three ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_03"); + TestAppRun s = doTest("test_03"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); // Second agent shouldn't start - jcmd(CMD_START, - "jmxremote.port=" + ports[1], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[1], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); // First agent should connect testConnect(ports[0]); @@ -565,13 +466,14 @@ public class JMXStartStopTest { System.out.println("**** Test four ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_04"); + TestAppRun s = doTest("test_04"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.rmi.port=" + ports[1], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.rmi.port=" + ports[1], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); testConnect(ports[0], ports[1]); } finally { @@ -585,9 +487,9 @@ public class JMXStartStopTest { System.out.println("**** Test five ****"); int[] ports = PortAllocator.allocatePorts(1); - Something s = doSomething("test_05"); + TestAppRun s = doTest("test_05"); try { - jcmd(CMD_START_LOCAL); + jcmd.startLocal(); testNoConnect(ports[0]); testConnectLocal(s.getPid()); @@ -605,26 +507,27 @@ public class JMXStartStopTest { System.out.println("**** Test six ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_06"); + TestAppRun s = doTest("test_06"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); testConnect(ports[0], ports[1]); final AtomicBoolean checks = new AtomicBoolean(false); - jcmd( - line -> { - if (line.contains("java.lang.RuntimeException: Invalid agent state")) { - checks.set(true); - } - }, - CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + line -> { + if (line.contains("java.lang.RuntimeException: Invalid agent state")) { + checks.set(true); + } + }, + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); if (!checks.get()) { throw new Exception("Starting agent on port " + ports[0] + " should " @@ -644,27 +547,28 @@ public class JMXStartStopTest { System.out.println("**** Test seven ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_07"); + TestAppRun s = doTest("test_07"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); testConnect(ports[0], ports[1]); final AtomicBoolean checks = new AtomicBoolean(false); - jcmd( - line -> { - if (line.contains("java.lang.RuntimeException: Invalid agent state")) { - checks.set(true); - } - }, - CMD_START, - "jmxremote.port=" + ports[1], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + line -> { + if (line.contains("java.lang.RuntimeException: Invalid agent state")) { + checks.set(true); + } + }, + "jmxremote.port=" + ports[1], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); if (!checks.get()) { throw new Exception("Starting agent on poprt " + ports[1] + " should " @@ -684,17 +588,18 @@ public class JMXStartStopTest { System.out.println("**** Test eight ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_08"); + TestAppRun s = doTest("test_08"); try { - jcmd(CMD_START, - "jmxremote.port=" + ports[0], - "jmxremote.authenticate=false", - "jmxremote.ssl=false"); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); testConnect(ports[0], ports[1]); - jcmd(CMD_STOP); - jcmd(CMD_STOP); + jcmd.stop(); + jcmd.stop(); } finally { s.stop(); } @@ -707,7 +612,7 @@ public class JMXStartStopTest { System.out.println("**** Test nine ****"); - Something s = doSomething("test_09"); + TestAppRun s = doTest("test_09"); try (ServerSocket ss = new ServerSocket(0)) { int localPort = ss.getLocalPort(); @@ -723,13 +628,12 @@ public class JMXStartStopTest { final AtomicBoolean retry = new AtomicBoolean(false); try { - jcmd( + jcmd.start( line -> { if (line.contains(Agent.getText(AgentConfigurationError.AGENT_EXCEPTION))) { retry.set(true); } }, - CMD_START, "jmxremote.port=" + ports[0], "jmxremote.rmi.port=" + localPort, "jmxremote.authenticate=false", @@ -764,18 +668,17 @@ public class JMXStartStopTest { System.out.println("**** Test ten ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething( + TestAppRun s = doTest( "test_10", "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.ssl=true"); try { testNoConnect(ports[0]); - jcmd( - CMD_START, - "jmxremote.port=" + ports[1], - "jmxremote.authenticate=false", - "jmxremote.ssl=false" + jcmd.start( + "jmxremote.port=" + ports[1], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" ); testConnect(ports[1]); } finally { @@ -791,7 +694,7 @@ public class JMXStartStopTest { System.out.println("**** Test eleven ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething( + TestAppRun s = doTest( "test_11", "-Dcom.sun.management.jmxremote.port=" + ports[0], "-Dcom.sun.management.jmxremote.authenticate=false", @@ -800,15 +703,14 @@ public class JMXStartStopTest { try { testNoConnect(ports[0]); - jcmd(CMD_STOP); + jcmd.stop(); testNoConnect(ports[0]); - jcmd( - CMD_START, - "jmxremote.port=" + ports[1], - "jmxremote.authenticate=false", - "jmxremote.ssl=false" + jcmd.start( + "jmxremote.port=" + ports[1], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" ); testConnect(ports[1]); @@ -828,7 +730,7 @@ public class JMXStartStopTest { System.out.println("**** Test twelve ****"); int[] ports = PortAllocator.allocatePorts(2); - Something s = doSomething("test_12", + TestAppRun s = doTest("test_12", "-Dcom.sun.management.config.file=" + TEST_SRC + File.separator + "management_cl.properties", "-Dcom.sun.management.jmxremote.authenticate=false" @@ -837,15 +739,15 @@ public class JMXStartStopTest { try { testNoConnect(ports[0]); - jcmd(CMD_STOP); + jcmd.stop(); testNoConnect(ports[0]); - jcmd(CMD_START, - "config.file=" + TEST_SRC + File.separator - + "management_jcmd.properties", - "jmxremote.authenticate=false", - "jmxremote.port=" + ports[1] + jcmd.start( + "config.file=" + TEST_SRC + File.separator + + "management_jcmd.properties", + "jmxremote.authenticate=false", + "jmxremote.port=" + ports[1] ); testConnect(ports[1]); @@ -863,7 +765,7 @@ public class JMXStartStopTest { System.out.println("**** Test thirteen ****"); int[] ports = PortAllocator.allocatePorts(1); - Something s = doSomething( + TestAppRun s = doTest( "test_13", "-Dcom.sun.management.jmxremote.port=" + ports[0], "-Dcom.sun.management.jmxremote.authenticate=false", @@ -872,16 +774,16 @@ public class JMXStartStopTest { try { testNoConnect(ports[0]); - jcmd(CMD_STOP); - jcmd(CMD_START, - "jmxremote.ssl=false", - "jmxremote.port=" + ports[0] + jcmd.stop(); + jcmd.start( + "jmxremote.ssl=false", + "jmxremote.port=" + ports[0] ); testConnect(ports[0]); - jcmd(CMD_STOP); - jcmd(CMD_START, - "jmxremote.port=" + ports[0] + jcmd.stop(); + jcmd.start( + "jmxremote.port=" + ports[0] ); testNoConnect(ports[0]); @@ -897,14 +799,14 @@ public class JMXStartStopTest { System.out.println("**** Test fourteen ****"); int[] ports = PortAllocator.allocatePorts(1); - Something s = doSomething( + TestAppRun s = doTest( "test_14", "-Dcom.sun.management.jmxremote.port=" + ports[0], "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.ssl=false"); try { testConnect(ports[0]); - jcmd(CMD_STOP); + jcmd.stop(); testConnectLocal(s.getPid()); } finally { s.stop(); @@ -918,11 +820,11 @@ public class JMXStartStopTest { System.out.println("**** Test fifteen ****"); int[] ports = PortAllocator.allocatePorts(1); - Something s = doSomething("test_15"); + TestAppRun s = doTest("test_15"); try { testNoConnect(ports[0]); - jcmd(CMD_START + "_local"); + jcmd.startLocal(); testConnectLocal(s.getPid()); diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java new file mode 100644 index 00000000000..808b5a3c339 --- /dev/null +++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.net.BindException; +import java.util.function.Predicate; +import java.util.regex.Pattern; +import org.testng.annotations.*; +import static org.testng.Assert.*; + +import jdk.testlibrary.ProcessTools; + +/** + * @test + * @bug 8023093 + * @summary Performs a sanity test for the ManagementAgent.status diagnostic command. + * Management agent may be disable, started (only local connections) and started. + * The test asserts that the expected text is being printed. + * @library /lib/testlibrary + * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd + * @run testng/othervm -XX:+UsePerfData JMXStatusTest + */ +public class JMXStatusTest { + private final static String TEST_APP_NAME = "TestApp"; + + private final static Pattern DISABLE_AGENT_STATUS = Pattern.compile( + "Agent\\s*\\: disabled$" + ); + + private final static Pattern LOCAL_AGENT_STATUS = Pattern.compile( + "Agent\\s*\\:\\s*enabled\\n+" + + "Connection Type\\s*\\:\\s*local\\n+" + + "Protocol\\s*\\:\\s*[a-z]+\\n+" + + "Host\\s*\\:\\s*.+\\n+" + + "URL\\s*\\:\\s*service\\:jmx\\:.+", + Pattern.MULTILINE + ); + + private final static Pattern REMOTE_AGENT_STATUS = Pattern.compile( + "Agent\\s*\\: enabled\\n+" + + "Connection Type\\s*\\: remote\\n+" + + "Protocol\\s*\\: [a-z]+\\n+" + + "Host\\s*\\: .+\\n+" + + "URL\\s*\\: service\\:jmx\\:.+\\n+" + + "Properties\\s*\\:\\n+(\\s*\\S+\\s*=\\s*\\S+\\n*)+", + Pattern.MULTILINE + ); + + private static ProcessBuilder testAppPb; + private Process testApp; + + private ManagementAgentJcmd jcmd; + + @BeforeClass + public static void setupClass() throws Exception { + testAppPb = ProcessTools.createJavaProcessBuilder( + "-cp", System.getProperty("test.class.path"), + "-XX:+UsePerfData", + TEST_APP_NAME + ); + } + + @BeforeTest + public void setup() { + jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false); + } + + @BeforeMethod + public void startTestApp() throws Exception { + testApp = ProcessTools.startProcess( + TEST_APP_NAME, testAppPb, + (Predicate<String>)l->l.trim().equals("main enter") + ); + } + + @AfterMethod + public void stopTestApp() throws Exception { + testApp.getOutputStream().write(1); + testApp.getOutputStream().flush(); + testApp.waitFor(); + testApp = null; + } + + @Test + public void testAgentDisabled() throws Exception { + String status = jcmd.status(); + assertStatusMatches(DISABLE_AGENT_STATUS, status); + } + + @Test + public void testAgentLocal() throws Exception { + jcmd.startLocal(); + String status = jcmd.status(); + + assertStatusMatches(LOCAL_AGENT_STATUS, status); + } + + @Test + public void testAgentRemote() throws Exception { + while (true) { + try { + int[] ports = PortAllocator.allocatePorts(1); + jcmd.start( + "jmxremote.port=" + ports[0], + "jmxremote.authenticate=false", + "jmxremote.ssl=false" + ); + String status = jcmd.status(); + + assertStatusMatches(REMOTE_AGENT_STATUS, status); + return; + } catch (BindException e) { + System.out.println("Failed to allocate ports. Retrying ..."); + } + } + } + + private void assertStatusMatches(Pattern expected, String value) { + assertStatusMatches(expected, value, ""); + } + + private void assertStatusMatches(Pattern expected, String value, String msg) { + int idx = value.indexOf('\n'); + if (idx > -1) { + value = value.substring(idx + 1).trim(); + assertTrue(expected.matcher(value).find(), msg); + } else { + fail("The management agent status must contain more then one line of text"); + } + } +} diff --git a/jdk/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java b/jdk/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java new file mode 100644 index 00000000000..efee771cf4a --- /dev/null +++ b/jdk/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.IOException; +import java.net.BindException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import sun.management.Agent; +import sun.management.AgentConfigurationError; + +import jdk.testlibrary.JDKToolLauncher; +import jdk.testlibrary.ProcessTools; + +/** + * A helper class for issuing ManagementAgent.* diagnostic commands and capturing + * their output. + */ +final class ManagementAgentJcmd { + private static final String CMD_STOP = "ManagementAgent.stop"; + private static final String CMD_START = "ManagementAgent.start"; + private static final String CMD_START_LOCAL = "ManagementAgent.start_local"; + private static final String CMD_STATUS = "ManagementAgent.status"; + + private final String id; + private final boolean verbose; + + public ManagementAgentJcmd(String targetApp, boolean verbose) { + this.id = targetApp; + this.verbose = verbose; + } + + /** + * `jcmd` + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + public String list() throws IOException, InterruptedException { + return jcmd(); + } + + /** + * `jcmd <app> ManagementAgent.stop` + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + public String stop() throws IOException, InterruptedException { + return jcmd(CMD_STOP); + } + + /** + * `jcmd <app> ManagementAgent.start_local` + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + public String startLocal() throws IOException, InterruptedException { + return jcmd(CMD_START_LOCAL); + } + + /** + * `jcmd <app> ManagementAgent.start <args>` + * @return The JCMD output + * @param params The arguments to <b>ManagementAgent.start</b> command + * @throws IOException + * @throws InterruptedException + */ + public String start(String ... params) throws IOException, InterruptedException { + return start(c->{}, params); + } + + /** + * `jcmd <pp> ManagementAgent.start <args>` + * @param c A string consumer used to inspect the jcmd output line-by-line + * @param params The arguments to <b>ManagementAgent.start</b> command + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + public String start(Consumer<String> c, String ... params) throws IOException, InterruptedException { + List<String> args = new ArrayList<>(); + args.add(CMD_START); + args.addAll(Arrays.asList(params)); + return jcmd(c, args.toArray(new String[args.size()])); + } + + public String status() throws IOException, InterruptedException { + return jcmd(CMD_STATUS); + } + + /** + * Run the "jcmd" command + * + * @param command Command + arguments + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + private String jcmd(String ... command) throws IOException, InterruptedException { + if (command.length == 0) { + return jcmd(null, c->{}); + } else { + return jcmd(c->{}, command); + } + } + + /** + * Run the "jcmd" command + * + * @param c {@linkplain Consumer} instance + * @param command Command + arguments + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + private String jcmd(Consumer<String> c, String ... command) throws IOException, InterruptedException { + return jcmd(id, c, command); + } + + /** + * Run the "jcmd" command + * + * @param target The target application name (or PID) + * @param c {@linkplain Consumer} instance + * @param command Command + arguments + * @return The JCMD output + * @throws IOException + * @throws InterruptedException + */ + private String jcmd(String target, final Consumer<String> c, String ... command) throws IOException, InterruptedException { + dbg_print("[jcmd] " + (command.length > 0 ? command[0] : "list")); + + JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK("jcmd"); + l.addToolArg(target); + for (String cmd : command) { + l.addToolArg(cmd); + } + + StringBuilder output = new StringBuilder(); + + AtomicBoolean portUnavailable = new AtomicBoolean(false); + Process p = ProcessTools.startProcess( + "jcmd", + new ProcessBuilder(l.getCommand()), + line -> { + if (line.contains("BindException") || + line.contains(Agent.getText(AgentConfigurationError.CONNECTOR_SERVER_IO_ERROR))) { + portUnavailable.set(true); + } else { + output.append(line).append('\n'); + c.accept(line); + } + } + ); + + p.waitFor(); + dbg_print("[jcmd] --------"); + if (portUnavailable.get()) { + String cmd = Arrays.asList(l.getCommand()).stream() + .collect( + Collectors.joining(" ", "", ": Unable to bind address") + ); + throw new BindException(cmd); + } + + return output.toString(); + } + + private void dbg_print(String msg) { + if (verbose) { + System.out.println("DBG: " + msg); + } + } +} diff --git a/jdk/test/sun/management/jmxremote/startstop/PortAllocator.java b/jdk/test/sun/management/jmxremote/startstop/PortAllocator.java new file mode 100644 index 00000000000..444dfbde410 --- /dev/null +++ b/jdk/test/sun/management/jmxremote/startstop/PortAllocator.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.Random; + +/** + * Dynamically allocates distinct ports from the ephemeral range 49152-65535 + */ +class PortAllocator { + private final static int LOWER_BOUND = 49152; + private final static int UPPER_BOUND = 65535; + + private final static Random RND = new Random(System.currentTimeMillis()); + + static int[] allocatePorts(final int numPorts) { + int[] ports = new int[numPorts]; + for (int i = 0; i < numPorts; i++) { + int port = -1; + while (port == -1) { + port = RND.nextInt(UPPER_BOUND - LOWER_BOUND + 1) + LOWER_BOUND; + for (int j = 0; j < i; j++) { + if (ports[j] == port) { + port = -1; + break; + } + } + } + ports[i] = port; + } + return ports; + } +} diff --git a/jdk/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt b/jdk/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt index 20c85f1f0be..770bf20f228 100644 --- a/jdk/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt +++ b/jdk/test/sun/management/jmxremote/startstop/REMOTE_TESTING.txt @@ -4,7 +4,7 @@ on host 1 4. run - ${TESTJAVA}/bin/java -server JMXStartStopDoSomething \ + ${TESTJAVA}/bin/java -server TestApp \ -Dcom.sun.management.jmxremote.port=50234 \ -Dcom.sun.management.jmxremote.rmi.port=50235 \ -Dcom.sun.management.jmxremote.authenticate=false \ diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java b/jdk/test/sun/management/jmxremote/startstop/TestApp.java similarity index 90% rename from jdk/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java rename to jdk/test/sun/management/jmxremote/startstop/TestApp.java index 5a04a6d718b..997f9f5b900 100644 --- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java +++ b/jdk/test/sun/management/jmxremote/startstop/TestApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * 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,9 +22,8 @@ */ import java.io.IOException; -import jdk.testlibrary.ProcessTools; -public class JMXStartStopDoSomething { +public class TestApp { public static void doSomething() throws IOException{ int r = System.in.read(); System.out.println("read: " + r); diff --git a/jdk/test/sun/security/jgss/spnego/MSOID.java b/jdk/test/sun/security/jgss/spnego/MSOID.java new file mode 100644 index 00000000000..9926544fadf --- /dev/null +++ b/jdk/test/sun/security/jgss/spnego/MSOID.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8078439 + * @summary SPNEGO auth fails if client proposes MS krb5 OID + */ + +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSException; +import org.ietf.jgss.GSSManager; + +import java.lang.Exception; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Base64; + +public class MSOID { + public static void main(String[] args) throws Exception { + + // msoid.txt is a NegTokenInit packet sent from Internet Explorer to + // IIS server on a test machine. No sensitive info included. + byte[] header = Files.readAllBytes( + Paths.get(System.getProperty("test.src"), "msoid.txt")); + byte[] token = Base64.getMimeDecoder().decode( + Arrays.copyOfRange(header, 10, header.length)); + + GSSCredential cred = null; + GSSContext ctx = GSSManager.getInstance().createContext(cred); + + try { + ctx.acceptSecContext(token, 0, token.length); + // Before the fix, GSS_KRB5_MECH_OID_MS is not recognized + // and acceptor chooses another mech and goes on + throw new Exception("Should fail"); + } catch (GSSException gsse) { + // After the fix, GSS_KRB5_MECH_OID_MS is recognized but the token + // cannot be accepted because we don't have any krb5 credential. + gsse.printStackTrace(); + if (gsse.getMajor() != GSSException.NO_CRED) { + throw gsse; + } + for (StackTraceElement st: gsse.getStackTrace()) { + if (st.getClassName().startsWith("sun.security.jgss.krb5.")) { + // Good, it is already in krb5 mech's hand. + return; + } + } + throw gsse; + } + } +} diff --git a/jdk/test/sun/security/jgss/spnego/msoid.txt b/jdk/test/sun/security/jgss/spnego/msoid.txt new file mode 100644 index 00000000000..9277c0d80ef --- /dev/null +++ b/jdk/test/sun/security/jgss/spnego/msoid.txt @@ -0,0 +1,27 @@ +Negotiate YIIGPAYGKwYBBQUCoIIGMDCCBiygMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBA +GCNwICHgYKKwYBBAGCNwICCqKCBfYEggXyYIIF7gYJKoZIhvcSAQICAQBuggXdMIIF2aADAgEFoQMCAQ +6iBwMFACAAAACjggTIYYIExDCCBMCgAwIBBaEOGwxUV0VMVkUuVEhJTkuiIzAhoAMCAQKhGjAYGwRIVF +RQGxBrZGMuVFdFTFZFLlRISU5Lo4IEgjCCBH6gAwIBEqEDAgEJooIEcASCBGyoIL0zQevk57pY6D25+1 +SQbAeldYXkpdn8JlKgSyz1cdiTpwqDt8B7pj7AoKMPHCiVss37XCEpBIuZClBK3Jmry+QWXCbQemKvyO +Caz806RDNB7TA7l1NxUJ6LsCiQncNV1TEq37NM6H8il6PjnbcBoMcHH/+cFGVPNP3eP+Z5Kd+5DZELPV +qQkYogXybmngmYy2168OsfyANzotUpm/HBwEHKujCPH9Gbhwhmx4tUcBvCetPNoXmHOQZLB4u7uyblKO +c6R2yGTFCa8DBQNXx38RRHgsvlNGlx+UsSoF4/DixAreNRkZnpKabn1cRK/KZh6vHfbL2QVegr1hrp71 +IJwyVuR+RTGL/7WCSWFClJyWD3Cm4+eK46uVj4MKPUJBc0XVViV/Dsh4N9EomVDkovWU/v+0d+W4pQJk +BFnJoNYuaG8UnLWrxMKGNwVOfsblcJtB7B5zuZzsWsUIdmMT1n8mtWrv0wYiwvotfT6z/suk+Vhg9MGd +uDmeneeG9deMDUMwrwB8u5J2VEeWKurBfDB02jv/08qAZS2ovBfV2SiXCuky5z7llvQ8uPsoezVwYdhu +HmBuPE7PqDIkmkEJRWpq95dqxllCXvlL4uINxFadkhcbzuCDjSGil78p6FJTKc4Dt/kuug1zJuXhJO1L +2CgkMsYPTogoUvAtplzIDF0nSMwJUIJzQXIHCFasmDNJA1GAvQD+Qh7Mp4dYb2Uid+sSM2qlQn8bgR9S +dlfL/olQ9GKPOBBGwsVoZKR3Brimc9LOJofPMEEa560KQNgtO1MyjoqEJKzFq+2wVZQahvpcV7VgixCq +Nom3Wd4NdZ3QM0PHL7e9bl3/qCsWaiNlmRW7gupz8nNCtWNMf4UBqIeo9jPH9Cb96fOUM4c7XXp4iX6w +ns1MsmPZ4VQDRU7VK+yTC81KGfMlSvrvqCJfGoxy0NaeXtmkN55oAhaj8ebiEBdKCXXF5wk0zqvt1ifE +9ywYk/AbdFBPThyOT6Tu9x41gi6mCTiMtSdg7cFY+5yXd3UIgUwnbOG3IwAkdLXlepvnHwEXCXkbfbr9 +e1wjs5LMmYRunJ05FOx8iAibB8bWjgiFmYWbeyjyQF3KDs5cpvROXcapT1+KlFU4lEO8lnKM/Ipq81ED +s+/DygXCvlskeKV57URx+XcMWnURu4hdGHbCPY/X7eOmox0mw5/V0rJMIjSjQNPyi4UM4dDTso6mt0XE +h+YyCGmV67D8/nihO/NaRFEFxHlaGwh3Lqu/Tero88iuDb9U1uEWz8cF8wr+2azyOTmhi/ID/jfiEC8i +b/hjYEcBI99x/CNmuuM7uCwTPIsJtBD3AnUdPa/yo41rCtm/K5HZCTzw2W93vaHqyttEC7c70rdAUB49 +CfSAVtH4gwxCDKMSJMlELfHGrIloEppEoUEc7LOdmzinvzcuajj0moBn5WUZHiVmopLjGjW7wunmMPQS +H9FmCQf2I1N4E6nZfH+cUzBbHkIF5XHY4KXwmJQ3UdbUDp8z3npIH3MIH0oAMCARKigewEgenD23U6gQ +aORjuWnT1nqadqR+E5fa/viohey4g6mn6uPfVRPz5a7OsDOurQV9wHR/VEwvjpdlZzMcANbt28Ut3YvQ +SWWwqALoLtSLOTgXmK9Higb+NSSO7hKtqKgDWREfQisn3xE9PGkMUlanu2es34+k43AQmJf2InvFNNcy +PcKllikoMOldVeoF1BIKvbDI0+vE3SwSrD0UhUdDeeZTN33b0Y8f3I1UYtidwxcRRkvCaNEhphtr8hp8 +hXWQkuxVvF2TiQyHF4PnJkgb1Zr6GXydOmMgMJE1anPFKFKWH6PZWGnp8mw0F5zw== diff --git a/jdk/test/sun/security/krb5/auto/MSOID2.java b/jdk/test/sun/security/krb5/auto/MSOID2.java new file mode 100644 index 00000000000..e81be6a8a3d --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/MSOID2.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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 8078439 + * @summary SPNEGO auth fails if client proposes MS krb5 OID + * @compile -XDignore.symbol.file MSOID2.java + * @run main/othervm MSOID2 + */ + +import sun.security.jgss.GSSUtil; + +// The basic krb5 test skeleton you can copy from +public class MSOID2 { + + public static void main(String[] args) throws Exception { + + new OneKDC(null).writeJAASConf(); + + Context c, s; + c = Context.fromJAAS("client"); + s = Context.fromJAAS("server"); + + c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID); + s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID); + + byte[] t = new byte[0]; + boolean first = true; + while (true) { + if (t != null || !c.x().isEstablished()) t = c.take(t); + if (first) { + // Tweak the packet to append an extra OID + int len = t.length; + byte[] nt = new byte[len + 11]; + System.arraycopy(t, 0, nt, 0, 0x23); + System.arraycopy(t, 0x18, nt, 0x23, 11); // dup the OID + System.arraycopy(t, 0x23, nt, 0x2e, len-0x23); + nt[0x1d] = (byte)0x82; // change the 1st to MS OID + // Length bytes to be tweaked + for (int pos: new int[] {3, 0xf, 0x13, 0x15, 0x17}) { + nt[pos] = (byte)(nt[pos] + 11); + } + t = nt; + new sun.misc.HexDumpEncoder().encodeBuffer(t, System.out); + } + if (t != null || !s.x().isEstablished()) t = s.take(t); + if (c.x().isEstablished() && s.x().isEstablished()) break; + first = false; + } + + Context.transmit("i say high --", c, s); + Context.transmit(" you say low", s, c); + + s.dispose(); + c.dispose(); + } +} diff --git a/jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java b/jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java index 84c28899126..97bc3758d62 100644 --- a/jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java +++ b/jdk/test/sun/security/pkcs12/StoreSecretKeyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. * 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,12 +23,14 @@ /* * @test - * @bug 8005408 + * @bug 8005408 8079129 * @summary KeyStore API enhancements */ import java.io.*; import java.security.*; +import java.security.cert.*; +import java.security.cert.Certificate; import java.util.*; import javax.crypto.*; import javax.crypto.spec.*; @@ -39,7 +41,9 @@ public class StoreSecretKeyTest { private final static String DIR = System.getProperty("test.src", "."); private static final char[] PASSWORD = "passphrase".toCharArray(); private static final String KEYSTORE = "keystore.p12"; - private static final String ALIAS = "my secret key"; + private static final String CERT = DIR + "/trusted.pem"; + private static final String ALIAS = "my trusted cert"; + private static final String ALIAS2 = "my secret key"; public static void main(String[] args) throws Exception { @@ -56,8 +60,13 @@ public class StoreSecretKeyTest { KeyStore keystore = KeyStore.getInstance("PKCS12"); keystore.load(null, null); - // Set entry + // Set trusted certificate entry + Certificate cert = loadCertificate(CERT); keystore.setEntry(ALIAS, + new KeyStore.TrustedCertificateEntry(cert), null); + + // Set secret key entry + keystore.setEntry(ALIAS2, new KeyStore.SecretKeyEntry(generateSecretKey("AES", 128)), new KeyStore.PasswordProtection(PASSWORD)); @@ -73,7 +82,7 @@ public class StoreSecretKeyTest { " entries"); } - KeyStore.Entry entry = keystore.getEntry(ALIAS, + KeyStore.Entry entry = keystore.getEntry(ALIAS2, new KeyStore.PasswordProtection(PASSWORD)); System.out.println("Retrieved entry: " + entry); @@ -101,4 +110,14 @@ public class StoreSecretKeyTest { generator.init(size); return generator.generateKey(); } + + private static Certificate loadCertificate(String certFile) + throws Exception { + X509Certificate cert = null; + try (FileInputStream certStream = new FileInputStream(certFile)) { + CertificateFactory factory = + CertificateFactory.getInstance("X.509"); + return factory.generateCertificate(certStream); + } + } } diff --git a/jdk/test/sun/security/x509/GeneralName/X400Address.java b/jdk/test/sun/security/x509/GeneralName/X400Address.java new file mode 100644 index 00000000000..404d0910a4e --- /dev/null +++ b/jdk/test/sun/security/x509/GeneralName/X400Address.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * 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.ByteArrayInputStream; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; + +/** + * @test + * @bug 8058543 + * @summary Check that a Subject Alternative Name of type X400Address + * can be parsed + */ +public class X400Address { + + /* + * A cert containing an X400Address SAN: + * ObjectId: 2.5.29.17 Criticality=false + * SubjectAlternativeName [ + * RFC822Name: testuser@test.net + * X400Address: <DER-encoded value> + * ] + */ + private static final String certStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIIEXjCCA0agAwIBAgIEAm+MuDANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDEwlU\n" + + "ZXN0IFVzZXIwHhcNMTQwOTI2MDgyNTA1WhcNMjQwOTIzMDgyNTA1WjAUMRIwEAYD\n" + + "VQQDEwlUZXN0IFVzZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCM\n" + + "Lj3k7is6bGoZgoONF15PT/GnfGtFJFYF2alnuHYjj/zdlKtU2DAPadz2EAJHczhy\n" + + "/p1DVvyrOUgCviB0nzijuLt9YHr6goel7Pe/YtcRavfC5HzEVOjhp92WZX/jIO9X\n" + + "xlpC/aQKt0pqCgUkvzVzB2Lm8EB/bcxlRKNh6WpAGfH/23XnJZ/UPRYgu+C+00i2\n" + + "vv26kHb2hZ3px1RP4b1FMiKc5mZxd+D9Ep3kGf+SnrBROR9v2u4hOobxzC9avAfq\n" + + "vTJ1rauR08eUHD15AUrR6AlOhb4Y6XqzPZ+aPb1Mj1XSuMsXvApWhXmavRA5wK1S\n" + + "ZtnvibB/0l57AMSUh24NAgMBAAGjggG2MIIBsjAPBgNVHRMBAf8EBTADAQH/MA8G\n" + + "A1UdJQQIMAYGBFUdJQAwDgYDVR0PAQH/BAQDAgbAMEcGA1UdEQRAMD6BEXRlc3R1\n" + + "c2VyQHRlc3QubmV0oykwE2EEEwJ0cmIDEwEgogYTBFRFU1QxEjAQgAEBoQsTCVRl\n" + + "c3QgVXNlcjCCATMGA1UdDgSCASoEggEmMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" + + "MIIBCgKCAQEAjC495O4rOmxqGYKDjRdeT0/xp3xrRSRWBdmpZ7h2I4/83ZSrVNgw\n" + + "D2nc9hACR3M4cv6dQ1b8qzlIAr4gdJ84o7i7fWB6+oKHpez3v2LXEWr3wuR8xFTo\n" + + "4afdlmV/4yDvV8ZaQv2kCrdKagoFJL81cwdi5vBAf23MZUSjYelqQBnx/9t15yWf\n" + + "1D0WILvgvtNItr79upB29oWd6cdUT+G9RTIinOZmcXfg/RKd5Bn/kp6wUTkfb9ru\n" + + "ITqG8cwvWrwH6r0yda2rkdPHlBw9eQFK0egJToW+GOl6sz2fmj29TI9V0rjLF7wK\n" + + "VoV5mr0QOcCtUmbZ74mwf9JeewDElIduDQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB\n" + + "AQCD3p0mhvqDLYqTL9l5cRK9+cGOS5nbDvUmd1NutCIOJHMT96ESob9fqM9zo23l\n" + + "Yudajxa3/GooKTCe1TcaWIzFVqvO8wezMLkwuZcoto1ST8+lS36ZwZ1gMipE2Kh1\n" + + "XmnBn0wkUNfqypQ+nWH9vsYuJkeDb8402BOEdb/pvGYKC8d6EzQwUukLpXyOMs9r\n" + + "aCcsnSYRV8gFYCUxZkm0+tQOBjUsQ1SP/ww7SicPPSHqb08HvH4ALG75MUxIMVF1\n" + + "vyTeStZzsFXQaUq026U/rDXf18bV3Vi5EI5jR9p6CDXgundqnMmiEo4BXWCp/KeB\n" + + "JxndcaVIF7PbMkUw01elOmj0\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = new ByteArrayInputStream(certStr.getBytes()); + X509Certificate cert = (X509Certificate) cf.generateCertificate(is); + + if (cert.getSubjectAlternativeNames() == null) { + throw new Exception("Failed to parse Subject Alternative Name"); + } + } +} diff --git a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java index c13b4d5da11..36481d6ebce 100644 --- a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java +++ b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,6 +42,7 @@ import jdk.testlibrary.Utils; * @test * @bug 7104647 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main TestJcmdDefaults */ diff --git a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java index 8479730f52c..be8f1c7b71a 100644 --- a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java +++ b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +43,7 @@ import jdk.testlibrary.Utils; * @test * @bug 7104647 7154822 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main/othervm -XX:+UsePerfData TestJcmdSanity */ diff --git a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java index bb8e6a4b6af..e10212a0dd2 100644 --- a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java +++ b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java @@ -26,6 +26,7 @@ * @test * @bug 5008856 5023573 5024917 5062569 7172176 * @summary 'missing resource key' error for key = "Operating system" + * @modules jdk.jconsole/sun.tools.jconsole * @run main ResourceCheckTest */ diff --git a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java b/jdk/test/sun/tools/jhat/HatHeapDump1Test.java index eab353e7249..4e40fdc1aa3 100644 --- a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java +++ b/jdk/test/sun/tools/jhat/HatHeapDump1Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import jdk.testlibrary.ProcessTools; * @bug 5102009 * @summary Sanity test of jhat functionality * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibarary.* * @compile -g HelloWorld.java * @run main HatHeapDump1Test diff --git a/jdk/test/sun/tools/jinfo/JInfoLauncherTest.java b/jdk/test/sun/tools/jinfo/JInfoLauncherTest.java index ecd88831770..09b4750d778 100644 --- a/jdk/test/sun/tools/jinfo/JInfoLauncherTest.java +++ b/jdk/test/sun/tools/jinfo/JInfoLauncherTest.java @@ -36,6 +36,7 @@ import static org.testng.Assert.*; /** * @test * @bug 8039080 + * @modules jdk.jcmd/sun.tools.jinfo * @run testng JInfoLauncherTest * @summary Test JInfo launcher argument parsing */ diff --git a/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java b/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java index deb3c860d63..35dd7526e20 100644 --- a/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java +++ b/jdk/test/sun/tools/jinfo/JInfoRunningProcessFlagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,10 +23,8 @@ * questions. */ -import sun.management.ManagementFactoryHelper; - +import java.lang.management.ManagementFactory; import com.sun.management.HotSpotDiagnosticMXBean; - import jdk.testlibrary.OutputAnalyzer; import static jdk.testlibrary.Platform.isSolaris; import static jdk.testlibrary.Asserts.assertEquals; @@ -37,6 +35,7 @@ import static jdk.testlibrary.Asserts.assertTrue; * @test * @summary The test sanity checks 'jinfo -flag' option. * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JInfoHelper * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError JInfoRunningProcessFlagTest */ @@ -114,13 +113,15 @@ public class JInfoRunningProcessFlagTest { } private static void verifyIsEnabled(String flag) { - HotSpotDiagnosticMXBean hotspotDiagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + HotSpotDiagnosticMXBean hotspotDiagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); String flagValue = hotspotDiagnostic.getVMOption(flag).getValue(); assertEquals(flagValue, "true", "Expected '" + flag + "' flag be enabled"); } private static void verifyIsDisabled(String flag) { - HotSpotDiagnosticMXBean hotspotDiagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + HotSpotDiagnosticMXBean hotspotDiagnostic = + ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); String flagValue = hotspotDiagnostic.getVMOption(flag).getValue(); assertEquals(flagValue, "false", "Expected '" + flag + "' flag be disabled"); } diff --git a/jdk/test/sun/tools/jinfo/JInfoRunningProcessTest.java b/jdk/test/sun/tools/jinfo/JInfoRunningProcessTest.java index e204254ab34..633a2c99b51 100644 --- a/jdk/test/sun/tools/jinfo/JInfoRunningProcessTest.java +++ b/jdk/test/sun/tools/jinfo/JInfoRunningProcessTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,6 +30,7 @@ import static jdk.testlibrary.Asserts.assertTrue; * @test * @summary The test sanity checks functionality of 'jinfo', 'jinfo -sysprops' and 'jinfo -flags' * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JInfoHelper * @run main/othervm -XX:+HeapDumpOnOutOfMemoryError JInfoRunningProcessTest */ diff --git a/jdk/test/sun/tools/jinfo/JInfoSanityTest.java b/jdk/test/sun/tools/jinfo/JInfoSanityTest.java index dfc1b13d1f3..446d8ef057b 100644 --- a/jdk/test/sun/tools/jinfo/JInfoSanityTest.java +++ b/jdk/test/sun/tools/jinfo/JInfoSanityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import jdk.testlibrary.OutputAnalyzer; * @summary The test sanity checks functionality of 'jinfo -h', 'jinfo -help', * and verifies jinfo exits abnormally if started with invalid options. * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JInfoHelper * @run main JInfoSanityTest */ diff --git a/jdk/test/sun/tools/jmap/BasicJMapTest.java b/jdk/test/sun/tools/jmap/BasicJMapTest.java index a3c5d2c0e3e..ecfcf071e38 100644 --- a/jdk/test/sun/tools/jmap/BasicJMapTest.java +++ b/jdk/test/sun/tools/jmap/BasicJMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import jdk.testlibrary.ProcessTools; * @bug 6321286 * @summary Unit test for jmap utility * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main BasicJMapTest */ diff --git a/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java b/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java index 2db96ea27ed..768e6504c69 100644 --- a/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java +++ b/jdk/test/sun/tools/jmap/heapconfig/JMapHeapConfigTest.java @@ -26,6 +26,7 @@ * @bug 8042397 * @summary Unit test for jmap utility test heap configuration reader * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @build JMapHeapConfigTest LingeredApp TmtoolTestScenario * @run main JMapHeapConfigTest diff --git a/jdk/test/sun/tools/jps/JpsHelper.java b/jdk/test/sun/tools/jps/JpsHelper.java index e28e92dae73..a5882aee6db 100644 --- a/jdk/test/sun/tools/jps/JpsHelper.java +++ b/jdk/test/sun/tools/jps/JpsHelper.java @@ -151,6 +151,7 @@ public final class JpsHelper { */ public static OutputAnalyzer jps(List<String> vmArgs, List<String> toolArgs) throws Exception { JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps"); + launcher.addVMArg("-XX:+UsePerfData"); if (vmArgs != null) { for (String vmArg : vmArgs) { launcher.addVMArg(vmArg); diff --git a/jdk/test/sun/tools/jps/TestJpsClass.java b/jdk/test/sun/tools/jps/TestJpsClass.java index a7ad136544b..7cde3ce57b8 100644 --- a/jdk/test/sun/tools/jps/TestJpsClass.java +++ b/jdk/test/sun/tools/jps/TestJpsClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import jdk.testlibrary.ProcessTools; * will be started from within the test application. * The output should contain proper values. * @library /lib/testlibrary + * @modules jdk.jartool/sun.tools.jar + * java.management * @build jdk.testlibrary.* JpsHelper JpsBase * @run driver TestJpsClass */ diff --git a/jdk/test/sun/tools/jps/TestJpsJar.java b/jdk/test/sun/tools/jps/TestJpsJar.java index 7414c529cdf..c0b862756db 100644 --- a/jdk/test/sun/tools/jps/TestJpsJar.java +++ b/jdk/test/sun/tools/jps/TestJpsJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +36,10 @@ import jdk.testlibrary.ProcessTools; * will be started from within the test application. * The output should contain proper values. * @library /lib/testlibrary + * @modules jdk.jartool/sun.tools.jar + * java.management * @build jdk.testlibrary.* JpsHelper JpsBase - * @run driver TestJpsJar + * @run main/othervm TestJpsJar */ public class TestJpsJar { diff --git a/jdk/test/sun/tools/jps/TestJpsJarRelative.java b/jdk/test/sun/tools/jps/TestJpsJarRelative.java index 6716419f954..12282959105 100644 --- a/jdk/test/sun/tools/jps/TestJpsJarRelative.java +++ b/jdk/test/sun/tools/jps/TestJpsJarRelative.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 +36,10 @@ import jdk.testlibrary.ProcessTools; * will be started from within the test application. * The output should contain proper values. * @library /lib/testlibrary + * @modules jdk.jartool/sun.tools.jar + * java.management * @build jdk.testlibrary.* JpsHelper JpsBase - * @run driver TestJpsJarRelative + * @run main/othervm TestJpsJarRelative */ public class TestJpsJarRelative { diff --git a/jdk/test/sun/tools/jps/TestJpsSanity.java b/jdk/test/sun/tools/jps/TestJpsSanity.java index 5a0868a89ab..8b72cde97e4 100644 --- a/jdk/test/sun/tools/jps/TestJpsSanity.java +++ b/jdk/test/sun/tools/jps/TestJpsSanity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import jdk.testlibrary.OutputAnalyzer; * @summary This test verifies jps usage and checks that appropriate error message is shown * when running jps with illegal arguments. * @library /lib/testlibrary + * @modules jdk.jartool/sun.tools.jar + * java.management * @build jdk.testlibrary.* JpsHelper * @run driver TestJpsSanity */ diff --git a/jdk/test/sun/tools/jstack/BasicJStackTest.java b/jdk/test/sun/tools/jstack/BasicJStackTest.java index 9efdf14d234..ba35054b8eb 100644 --- a/jdk/test/sun/tools/jstack/BasicJStackTest.java +++ b/jdk/test/sun/tools/jstack/BasicJStackTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * 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 jdk.testlibrary.ProcessTools; * @bug 6260070 * @summary Unit test for jstack utility * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main BasicJStackTest */ diff --git a/jdk/test/sun/tools/jstat/JStatInterval.java b/jdk/test/sun/tools/jstat/JStatInterval.java index 4a67ba7b9dc..3b29136e756 100644 --- a/jdk/test/sun/tools/jstat/JStatInterval.java +++ b/jdk/test/sun/tools/jstat/JStatInterval.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary Test checks case when target application finishes execution and jstat didn't complete work. jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes after 500ms. This shouldn't cause crash or hang in target application or in jstat. + * @modules java.management * @build jdk.testlibrary.* JStatInterval * @run main JStatInterval */ diff --git a/jdk/test/sun/tools/jstat/snap2.awk b/jdk/test/sun/tools/jstat/snap2.awk index c69b88ed40c..832e37f41d7 100644 --- a/jdk/test/sun/tools/jstat/snap2.awk +++ b/jdk/test/sun/tools/jstat/snap2.awk @@ -3,7 +3,7 @@ BEGIN { totallines=0; count=0; } { totallines++; print $0 } -$0 !~ /[java|sun|com\.sun]\..+=.*$/ { count++ } +$0 !~ /[java|jdk|sun|com\.sun]\..+=.*$/ { count++ } END { if ((count == 0) && (totallines != 0)) { diff --git a/jdk/test/sun/tools/jstatd/JstatdTest.java b/jdk/test/sun/tools/jstatd/JstatdTest.java index 73a625cef7c..cdf880d1f1e 100644 --- a/jdk/test/sun/tools/jstatd/JstatdTest.java +++ b/jdk/test/sun/tools/jstatd/JstatdTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,6 @@ */ import java.io.File; -import java.io.IOException; import java.net.UnknownHostException; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; @@ -130,38 +129,18 @@ public final class JstatdTest { private OutputAnalyzer runJps() throws Exception { JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps"); launcher.addVMArg("-XX:+UsePerfData"); - // Run jps with -v flag to obtain -Dparent.pid.<pid> - launcher.addToolArg("-v"); launcher.addToolArg(getDestination()); String[] cmd = launcher.getCommand(); log("Start jps", cmd); ProcessBuilder processBuilder = new ProcessBuilder(cmd); - OutputAnalyzer output = waitForJstatdRMI(processBuilder); + OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); System.out.println(output.getOutput()); return output; } - private OutputAnalyzer waitForJstatdRMI(ProcessBuilder pb) throws Exception { - OutputAnalyzer output = ProcessTools.executeProcess(pb); - - String remoteHost = (serverName != null) ? serverName : "JStatRemoteHost"; - while (output.getExitValue() != 0) { - String out = output.getOutput(); - - if (out.contains("RMI Registry not available") || - out.contains("RMI Server " + remoteHost + " not available")) { - Thread.sleep(100); - output = ProcessTools.executeProcess(pb); - } else { - output.shouldHaveExitValue(0); - } - } - return output; - } - /** * Verifies output form jps contains pids and programs' name information. * The function will discard any lines that come before the first line with pid. @@ -211,7 +190,7 @@ public final class JstatdTest { log("Start jstat", cmd); ProcessBuilder processBuilder = new ProcessBuilder(cmd); - OutputAnalyzer output = waitForJstatdRMI(processBuilder); + OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); System.out.println(output.getOutput()); return output; @@ -277,8 +256,6 @@ public final class JstatdTest { assertTrue(policy.exists() && policy.isFile(), "Security policy " + policy.getAbsolutePath() + " does not exist or not a file"); launcher.addVMArg("-Djava.security.policy=" + policy.getAbsolutePath()); - // -Dparent.pid.<pid> will help to identify jstad process started by this test - launcher.addVMArg("-Dparent.pid." + ProcessTools.getProcessId()); if (port != null) { launcher.addToolArg("-p"); launcher.addToolArg(port); @@ -287,6 +264,9 @@ public final class JstatdTest { launcher.addToolArg("-n"); launcher.addToolArg(serverName); } + if (withExternalRegistry) { + launcher.addToolArg("-nr"); + } String[] cmd = launcher.getCommand(); log("Start jstatd", cmd); @@ -295,7 +275,7 @@ public final class JstatdTest { private ProcessThread tryToSetupJstatdProcess() throws Throwable { ProcessThread jstatdThread = new ProcessThread("Jstatd-Thread", - getJstatdCmd()); + JstatdTest::isJstadReady, getJstatdCmd()); try { jstatdThread.start(); // Make sure jstatd is up and running @@ -315,18 +295,26 @@ public final class JstatdTest { return jstatdThread; } + private static boolean isJstadReady(String line) { + return line.startsWith("jstatd started (bound to "); + } + public void doTest() throws Throwable { + if (useDefaultPort) { + verifyNoRmiRegistryOnDefaultPort(); + } + ProcessThread jstatdThread = null; try { while (jstatdThread == null) { - if (!useDefaultPort || withExternalRegistry) { + if (!useDefaultPort) { port = String.valueOf(Utils.getFreePort()); } if (withExternalRegistry) { Registry registry = startRegistry(); if (registry == null) { - // The port is already in use. Cancel and try with new one. + // The port is already in use. Cancel and try with a new one. continue; } } @@ -348,4 +336,14 @@ public final class JstatdTest { "jstatd process exited with unexpected exit code"); } + private void verifyNoRmiRegistryOnDefaultPort() throws Exception { + try { + Registry registry = LocateRegistry.getRegistry(); + registry.list(); + throw new Exception("There is already RMI registry on the default port: " + registry); + } catch (RemoteException e) { + // No RMI registry on default port is detected + } + } + } diff --git a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java index c3973f824e9..8782b2a896c 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 4990825 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser * @run main/timeout=60 TestJstatdDefaults */ diff --git a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java index fdf2e484c46..acefc694f5e 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 4990825 7092186 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser * @run main/timeout=60 TestJstatdExternalRegistry */ @@ -32,6 +33,7 @@ public class TestJstatdExternalRegistry { public static void main(String[] args) throws Throwable { JstatdTest test = new JstatdTest(); + test.setUseDefaultPort(false); test.setWithExternalRegistry(true); test.doTest(); } diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPort.java b/jdk/test/sun/tools/jstatd/TestJstatdPort.java index bba8732bad9..c011f73653f 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdPort.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 4990825 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser * @run main/timeout=60 TestJstatdPort */ diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java index 6b516f9140d..06e7a04a88b 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 4990825 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser * @run main/timeout=60 TestJstatdPortAndServer */ diff --git a/jdk/test/sun/tools/jstatd/TestJstatdServer.java b/jdk/test/sun/tools/jstatd/TestJstatdServer.java index fbf1c56026f..4622ea64a59 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdServer.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @test * @bug 4990825 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* JstatdTest JstatGCUtilParser * @run main/timeout=60 TestJstatdServer */ diff --git a/jdk/test/sun/tools/jstatd/TestJstatdUsage.java b/jdk/test/sun/tools/jstatd/TestJstatdUsage.java index 976c1173cc0..a1a2b03b6a3 100644 --- a/jdk/test/sun/tools/jstatd/TestJstatdUsage.java +++ b/jdk/test/sun/tools/jstatd/TestJstatdUsage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * 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 jdk.testlibrary.ProcessTools; * @test * @bug 4990825 * @library /lib/testlibrary + * @modules java.management * @build jdk.testlibrary.* * @run main TestJstatdUsage */ diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION index ebd4db73b0e..19d5533385c 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION +++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015b +tzdata2015d diff --git a/jdk/test/sun/util/calendar/zi/tzdata/africa b/jdk/test/sun/util/calendar/zi/tzdata/africa index 43103225577..6099a70f5e6 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/africa +++ b/jdk/test/sun/util/calendar/zi/tzdata/africa @@ -342,35 +342,29 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 - # above) says DST had no affect on electricity consumption. There is # no information about when DST will end this fall. See: # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 + +# From Steffen Thorsen (2015-04-08): +# Egypt will start DST on midnight after Thursday, April 30, 2015. +# This is based on a law (no 35) from May 15, 2014 saying it starts the last +# Thursday of April.... Clocks will still be turned back for Ramadan, but +# dates not yet announced.... +# http://almogaz.com/news/weird-news/2015/04/05/1947105 ... +# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html + +# From Ahmed Nazmy (2015-04-20): +# Egypt's ministers cabinet just announced ... that it will cancel DST at +# least for 2015. # -# For now, guess that later spring and fall transitions will use -# 2010's rules, and guess that Egypt will switch to standard time at -# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the -# first Friday after Ramadan. To implement this, -# transition dates for 2015 through 2037 were determined by running -# the following program under GNU Emacs 24.3, with the results integrated -# by hand into the table below. Ramadan again intrudes on the guessed -# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff. -# (let ((islamic-year 1436)) -# (while (< islamic-year 1460) -# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (friday 5)) -# (while (/= friday (mod a 7)) -# (setq a (1- a))) -# (while (/= friday (mod b 7)) -# (setq b (1+ b))) -# (setq a (1- a)) -# (setq b (1- b)) -# (setq a (calendar-gregorian-from-absolute a)) -# (setq b (calendar-gregorian-from-absolute b)) -# (insert -# (format -# (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n" -# "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) -# (setq islamic-year (+ 1 islamic-year)))) +# From Tim Parenti (2015-04-20): +# http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx +# "Egypt's cabinet agreed on Monday not to switch clocks for daylight saving +# time this summer, and carry out studies on the possibility of canceling the +# practice altogether in future years." +# +# From Paul Eggert (2015-04-20): +# For now, assume DST will be canceled. Any resumption would likely +# use different rules anyway. + Rule Egypt 2008 only - Aug lastThu 24:00 0 - Rule Egypt 2009 only - Aug 20 24:00 0 - Rule Egypt 2010 only - Aug 10 24:00 0 - @@ -379,22 +373,7 @@ Rule Egypt 2010 only - Sep lastThu 24:00 0 - Rule Egypt 2014 only - May 15 24:00 1:00 S Rule Egypt 2014 only - Jun 26 24:00 0 - Rule Egypt 2014 only - Jul 31 24:00 1:00 S -Rule Egypt 2014 max - Sep lastThu 24:00 0 - -Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S -Rule Egypt 2015 only - Jun 11 24:00 0 - -Rule Egypt 2015 only - Jul 23 24:00 1:00 S -Rule Egypt 2016 only - Jun 2 24:00 0 - -Rule Egypt 2016 only - Jul 7 24:00 1:00 S -Rule Egypt 2017 only - May 25 24:00 0 - -Rule Egypt 2017 only - Jun 29 24:00 1:00 S -Rule Egypt 2018 only - May 10 24:00 0 - -Rule Egypt 2018 only - Jun 14 24:00 1:00 S -Rule Egypt 2019 only - May 2 24:00 0 - -Rule Egypt 2019 only - Jun 6 24:00 1:00 S -Rule Egypt 2020 only - May 28 24:00 1:00 S -Rule Egypt 2021 only - May 13 24:00 1:00 S -Rule Egypt 2022 only - May 5 24:00 1:00 S -Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S +Rule Egypt 2014 only - Sep lastThu 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:09 - LMT 1900 Oct diff --git a/jdk/test/sun/util/calendar/zi/tzdata/antarctica b/jdk/test/sun/util/calendar/zi/tzdata/antarctica index 1f3e4347b21..102b496341d 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica +++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica @@ -38,41 +38,6 @@ # I made up all time zone abbreviations mentioned here; corrections welcome! # FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited. -# 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 -Rule ArgAQ 1967 only - Apr 2 0:00 0 - -Rule ArgAQ 1967 1968 - Oct Sun>=1 0:00 1:00 S -Rule ArgAQ 1968 1969 - Apr Sun>=1 0:00 0 - -Rule ArgAQ 1974 only - Jan 23 0:00 1:00 S -Rule ArgAQ 1974 only - May 1 0:00 0 - -Rule ChileAQ 1972 1986 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1974 1987 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1987 only - Apr 12 3:00u 0 - -Rule ChileAQ 1988 1989 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1988 only - Oct Sun>=1 4:00u 1:00 S -Rule ChileAQ 1989 only - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1990 only - Mar 18 3:00u 0 - -Rule ChileAQ 1990 only - Sep 16 4:00u 1:00 S -Rule ChileAQ 1991 1996 - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1991 1997 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 1997 only - Mar 30 3:00u 0 - -Rule ChileAQ 1998 only - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 1998 only - Sep 27 4:00u 1:00 S -Rule ChileAQ 1999 only - Apr 4 3:00u 0 - -Rule ChileAQ 1999 2010 - Oct Sun>=9 4:00u 1:00 S -Rule ChileAQ 2000 2007 - Mar Sun>=9 3:00u 0 - -# N.B.: the end of March 29 in Chile is March 30 in Universal time, -# which is used below in specifying the transition. -Rule ChileAQ 2008 only - Mar 30 3:00u 0 - -Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - -Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - -Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Carlini, Potter Cove, King George Island, -6414-0602320, since 1982-01 @@ -367,21 +332,7 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec 1 # USA - year-round bases # # Palmer, Anvers Island, since 1965 (moved 2 miles in 1968) -# -# From Ethan Dicks (1996-10-06): -# It keeps the same time as Punta Arenas, Chile, because, just like us -# and the South Pole, that's the other end of their supply line.... -# I verified with someone who was there that since 1980, -# Palmer has followed Chile. Prior to that, before the Falklands War, -# Palmer used to be supplied from Argentina. -# -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Antarctica/Palmer 0 - zzz 1965 - -4:00 ArgAQ AR%sT 1969 Oct 5 - -3:00 ArgAQ AR%sT 1982 May - -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u - -3:00 - CLT -# +# See 'southamerica' for Antarctica/Palmer, since it uses South American DST. # # McMurdo Station, Ross Island, since 1955-12 # Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20 diff --git a/jdk/test/sun/util/calendar/zi/tzdata/backward b/jdk/test/sun/util/calendar/zi/tzdata/backward index 95266a6f16c..3c845cfc01c 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/backward +++ b/jdk/test/sun/util/calendar/zi/tzdata/backward @@ -43,6 +43,7 @@ Link America/Argentina/Jujuy America/Jujuy Link America/Indiana/Knox America/Knox_IN Link America/Kentucky/Louisville America/Louisville Link America/Argentina/Mendoza America/Mendoza +Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario Link America/Denver America/Shiprock diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe index 008268ac763..7cee9a81527 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/europe +++ b/jdk/test/sun/util/calendar/zi/tzdata/europe @@ -99,7 +99,7 @@ # 1:00:14 SET Swedish (1879-1899)* # 2:00 EET EEST Eastern Europe # 3:00 FET Further-eastern Europe (2011-2014)* -# 3:00 MSK MSD MSM* Moscow +# 3:00 MSK MSD MSM* Minsk, Moscow # From Peter Ilieve (1994-12-04), # The original six [EU members]: Belgium, France, (West) Germany, Italy, diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica index 442a50eef0f..810cd93ade6 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica +++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica @@ -250,9 +250,14 @@ Zone PST8PDT -8:00 US P%sT # The law doesn't give abbreviations. # # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow: -# Public law 106-564 (2000-12-23) introduced the abbreviation -# "Chamorro Standard Time" for time in Guam and the Northern Marianas. -# See the file "australasia". +# Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time" +# for time in Guam and the Northern Marianas. See the file "australasia". +# +# From Paul Eggert (2015-04-17): +# HST and HDT are standardized abbreviations for Hawaii-Aleutian +# standard and daylight times. See section 9.47 (p 234) of the +# U.S. Government Printing Office Style Manual (2008) +# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf # From Arthur David Olson, 2005-08-09 # The following was signed into law on 2005-08-08. @@ -559,7 +564,7 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18 -11:00 - BST 1969 -11:00 US B%sT 1983 Oct 30 2:00 -10:00 US AH%sT 1983 Nov 30 - -10:00 US HA%sT + -10:00 US H%sT # The following switches don't quite make our 1970 cutoff. # # Shanks writes that part of southwest Alaska (e.g. Aniak) @@ -1354,14 +1359,9 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Quebec -# 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 (2015-03-24): +# See America/Toronto for most of Quebec, including Montreal. +# # 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. @@ -1375,39 +1375,10 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # For lack of better info, guess this practice began around 1970, contra to # Shanks & Pottenger who have this region observing AST/ADT. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Mont 1917 only - Mar 25 2:00 1:00 D -Rule Mont 1917 only - Apr 24 0:00 0 S -Rule Mont 1919 only - Mar 31 2:30 1:00 D -Rule Mont 1919 only - Oct 25 2:30 0 S -Rule Mont 1920 only - May 2 2:30 1:00 D -Rule Mont 1920 1922 - Oct Sun>=1 2:30 0 S -Rule Mont 1921 only - May 1 2:00 1:00 D -Rule Mont 1922 only - Apr 30 2:00 1:00 D -Rule Mont 1924 only - May 17 2:00 1:00 D -Rule Mont 1924 1926 - Sep lastSun 2:30 0 S -Rule Mont 1925 1926 - May Sun>=1 2:00 1:00 D -Rule Mont 1927 1937 - Apr lastSat 24:00 1:00 D -Rule Mont 1927 1937 - Sep lastSat 24:00 0 S -Rule Mont 1938 1940 - Apr lastSun 0:00 1:00 D -Rule Mont 1938 1939 - Sep lastSun 0:00 0 S -Rule Mont 1946 1973 - Apr lastSun 2:00 1:00 D -Rule Mont 1945 1948 - Sep lastSun 2:00 0 S -Rule Mont 1949 1950 - Oct lastSun 2:00 0 S -Rule Mont 1951 1956 - Sep lastSun 2:00 0 S -Rule Mont 1957 1973 - Oct lastSun 2:00 0 S - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Blanc-Sablon -3:48:28 - LMT 1884 -4:00 Canada A%sT 1970 -4:00 - AST -Zone America/Montreal -4:54:16 - LMT 1884 - -5:00 Mont E%sT 1918 - -5:00 Canada E%sT 1919 - -5:00 Mont E%sT 1942 Feb 9 2:00s - -5:00 Canada E%sT 1946 - -5:00 Mont E%sT 1974 - -5:00 Canada E%sT # Ontario @@ -1898,17 +1869,115 @@ Zone America/Creston -7:46:04 - LMT 1884 # Dawson switched to PST in 1973. Inuvik switched to MST in 1979. # Mathew Englander (1996-10-07) gives the following refs: # * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68, -# c. 7 defines Yukon standard time as UTC-9. This is still valid; +# c. 7 defines Yukon standard time as UTC-9.... # see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1). +# [http://canlii.ca/t/7vhg] # * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00. # * O.I.C. 1980/02 established DST. # * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00. -# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go -# with Englander. -# From Chris Walton (2006-06-26): -# Here is a link to the old daylight saving portion of the interpretation -# act which was last updated in 1987: -# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf + +# From Brian Inglis (2015-04-14): +# +# I tried to trace the history of Yukon time and found the following +# regulations, giving the reference title and URL if found, regulation name, +# and relevant quote if available. Each regulation specifically revokes its +# predecessor. The final reference is to the current Interpretation Act +# authorizing and resulting from these regulatory changes. +# +# Only recent regulations were retrievable via Yukon government site search or +# index, and only some via Canadian legal sources. Other sources used include +# articles titled "Standard Time and Time Zones in Canada" from JRASC via ADS +# Abstracts, cited by ADO for 1932 ..., and updated versions from 1958 and +# 1970 quoted below; each article includes current extracts from provincial +# and territorial ST and DST regulations at the end, summaries and details of +# standard times and daylight saving time at many locations across Canada, +# with time zone maps, tables and calculations for Canadian Sunrise, Sunset, +# and LMST; they also cover many countries and global locations, with a chart +# and table showing current Universal Time offsets, and may be useful as +# another source of information for 1970 and earlier. +# +# * Standard Time and Time Zones in Canada; Smith, C.C.; JRASC, Vol. 26, +# pp.49-77; February 1932; SAO/NASA Astrophysics Data System (ADS) +# http://adsabs.harvard.edu/abs/1932JRASC..26...49S from p.75: +# Yukon Interpretation Ordinance +# Yukon standard time is the local mean time at the one hundred and +# thirty-fifth meridian. +# +# * Standard Time and Time Zones in Canada; Smith, C.C.; Thomson, Malcolm M.; +# JRASC, Vol. 52, pp.193-223; October 1958; SAO/NASA Astrophysics Data System +# (ADS) http://adsabs.harvard.edu/abs/1958JRASC..52..193S from pp.220-1: +# Yukon Interpretation Ordinance, 1955, Chap. 16. +# +# (1) Subject to this section, standard time shall be reckoned as nine +# hours behind Greenwich Time and called Yukon Standard Time. +# +# (2) Notwithstanding subsection (1), the Commissioner may make regulations +# varying the manner of reckoning standard time. +# +# * Yukon Territory Commissioner's Order 1966-20 Interpretation Ordinance +# http://? - no online source found +# +# * Standard Time and Time Zones in Canada; Thomson, Malcolm M.; JRASC, +# Vol. 64, pp.129-162; June 1970; SAO/NASA Astrophysics Data System (ADS) +# http://adsabs.harvard.edu/abs/1970JRASC..64..129T from p.156: Yukon +# Territory Commissioner's Order 1967-59 Interpretation Ordinance ... +# +# 1. Commissioner's Order 1966-20 dated at Whitehorse in the Yukon +# Territory on 27th January, 1966, is hereby revoked. +# +# 2. Yukon (East) Standard Time as defined by section 36 of the +# Interpretation Ordinance from and after mid-night on the 28th day of May, +# 1967 shall be reckoned in the same manner as Pacific Standard Time, that +# is to say, eight hours behind Greenwich Time in the area of the Yukon +# Territory lying east of the 138th degree longitude west. +# +# 3. In the remainder of the Territory, lying west of the 138th degree +# longitude west, Yukon (West) Standard Time shall be reckoned as nine +# hours behind Greenwich Time. +# +# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214 +# http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html +# C.O. 1973/214 INTERPRETATION ACT ... +# +# 1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby +# revoked. +# +# 2. Yukon Standard Time as defined by section 36 of the Interpretation +# Act from and after midnight on the twenty-eighth day of October, 1973 +# shall be reckoned in the same manner as Pacific Standard Time, that is +# to say eight hours behind Greenwich Time. +# +# * O.I.C. 1980/02 INTERPRETATION ACT +# http://? - no online source found +# +# * Yukon Daylight Saving Time, YOIC 1987/56 +# http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html +# O.I.C. 1987/056 INTERPRETATION ACT ... +# +# In every year between +# (a) two o'clock in the morning in the first Sunday in April, and +# (b) two o'clock in the morning in the last Sunday in October, +# Standard Time shall be reckoned as seven hours behind Greenwich Time and +# called Yukon Daylight Saving Time. +# ... +# Dated ... 9th day of March, A.D., 1987. +# +# * Yukon Daylight Saving Time 2006, YOIC 2006/127 +# http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html +# O.I.C. 2006/127 INTERPRETATION ACT ... +# +# 1. In Yukon each year the time for general purposes shall be 7 hours +# behind Greenwich mean time during the period commencing at two o'clock +# in the forenoon on the second Sunday of March and ending at two o'clock +# in the forenoon on the first Sunday of November and shall be called +# Yukon Daylight Saving Time. +# +# 2. Order-in-Council 1987/56 is revoked. +# +# 3. This order comes into force January 1, 2007. +# +# * Interpretation Act, RSY 2002, c 125 +# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html # From Rives McDow (1999-09-04): # Nunavut ... moved ... to incorporate the whole territory into one time zone. @@ -2134,7 +2203,7 @@ Zone America/Inuvik 0 - zzz 1953 # Inuvik founded -7:00 NT_YK M%sT 1980 -7:00 Canada M%sT Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 - -9:00 NT_YK Y%sT 1966 Jul 1 2:00 + -9:00 NT_YK Y%sT 1967 May 28 0:00 -8:00 NT_YK P%sT 1980 -8:00 Canada P%sT Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 diff --git a/jdk/test/sun/util/calendar/zi/tzdata/southamerica b/jdk/test/sun/util/calendar/zi/tzdata/southamerica index 238ae3dc569..375c2d2fa9d 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica +++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica @@ -1121,6 +1121,60 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # Chile +# From Paul Eggert (2015-04-03): +# Shanks & Pottenger says America/Santiago introduced standard time in +# 1890 and rounds its UTC offset to 70W40; guess that in practice this +# was the same offset as in 1916-1919. It also says Pacific/Easter +# standardized on 109W22 in 1890; assume this didn't change the clocks. +# +# Dates for America/Santiago from 1910 to 2004 are primarily from +# the following source, cited by Oscar van Vlijmen (2006-10-08): +# [1] Chile Law +# http://www.webexhibits.org/daylightsaving/chile.html +# This contains a copy of a this official table: +# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30) +# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm +# [1] needs several corrections, though. +# +# The first set of corrections is from: +# [2] History of the Official Time of Chile +# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06). See: +# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html +# This is an English translation of: +# Historia de la hora oficial de Chile (retrieved 2012-10-24). See: +# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm +# A fancier Spanish version (requiring mouse-clicking) is at: +# http://www.horaoficial.cl/historia_hora.html +# Conflicts between [1] and [2] were resolved as follows: +# +# - [1] says the 1910 transition was Jan 1, [2] says Jan 10 and cites +# Boletín Nº 1, Aviso Nº 1 (1910). Go with [2]. +# +# - [1] says SMT was -4:42:45, [2] says Chile's official time from +# 1916 to 1919 was -4:42:46.3, the meridian of Chile's National +# Astronomical Observatory (OAN), then located in what is now +# Quinta Normal in Santiago. Go with [2], rounding it to -4:42:46. +# +# - [1] says the 1918 transition was Sep 1, [2] says Sep 10 and cites +# Boletín Nº 22, Aviso Nº 129/1918 (1918-08-23). Go with [2]. +# +# - [1] does not give times for transitions; assume they occur +# at midnight mainland time, the current common practice. However, +# go with [2]'s specification of 23:00 for the 1947-05-21 transition. +# +# Another correction to [1] is from Jesper Nørgaard Welen, who +# wrote (2006-10-08), "I think that there are some obvious mistakes in +# the suggested link from Oscar van Vlijmen,... for instance entry 66 +# says that GMT-4 ended 1990-09-12 while entry 67 only begins GMT-3 at +# 1990-09-15 (they should have been 1990-09-15 and 1990-09-16 +# respectively), but anyhow it clears up some doubts too." +# +# Data for Pacific/Easter from 1910 through 1967 come from Shanks & +# Pottenger. After that, for lack of better info assume +# Pacific/Easter is always two hours behind America/Santiago; +# this is known to work for DST transitions starting in 2008 and +# may well be true for earlier transitions. + # From Eduardo Krell (1995-10-19): # The law says to switch to DST at midnight [24:00] on the second SATURDAY # of October.... The law is the same for March and October. @@ -1133,78 +1187,35 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # Because of the same drought, the government decided to end DST later, # on April 3, (one-time change). -# From Oscar van Vlijmen (2006-10-08): -# http://www.horaoficial.cl/cambio.htm - -# From Jesper Nørgaard Welen (2006-10-08): -# I think that there are some obvious mistakes in the suggested link -# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4 -# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15 -# (they should have been 1990-09-15 and 1990-09-16 respectively), but -# anyhow it clears up some doubts too. - -# From Paul Eggert (2014-08-12): -# The following data entries for Chile and America/Santiago are from -# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by -# Jesper Nørgaard Welen. The data entries for Pacific/Easter are from Shanks -# & Pottenger, except with DST transitions after 1932 cloned from -# America/Santiago. The pre-1980 Pacific/Easter data entries are dubious, -# but we have no other source. - # From Germán Poo-Caamaño (2008-03-03): # Due to drought, Chile extends Daylight Time in three weeks. This # is one-time change (Saturday 3/29 at 24:00 for America/Santiago # and Saturday 3/29 at 22:00 for Pacific/Easter) # The Supreme Decree is located at # http://www.shoa.cl/servicios/supremo316.pdf -# and the instructions for 2008 are located in: -# http://www.horaoficial.cl/cambio.htm - +# # From José Miguel Garrido (2008-03-05): -# ... -# You could see the announces of the change on # http://www.shoa.cl/noticias/2008/04hora/hora.htm # From Angel Chiang (2010-03-04): # Subject: DST in Chile exceptionally extended to 3 April due to earthquake # http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098 -# (in Spanish, last paragraph). # -# This is breaking news. There should be more information available later. - # From Arthur David Olson (2010-03-06): # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch. -# From Glenn Eychaner (2011-03-02): -# It appears that the Chilean government has decided to postpone the -# change from summer time to winter time again, by three weeks to April -# 2nd: -# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651 -# -# This is not yet reflected in the official "cambio de hora" site, but -# probably will be soon: -# http://www.horaoficial.cl/cambio.htm - -# From Arthur David Olson (2011-03-02): -# The emol.com article mentions a water shortage as the cause of the -# postponement, which may mean that it's not a permanent change. - # From Glenn Eychaner (2011-03-28): -# The article: # http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E} -# # In English: # Chile's clocks will go back an hour this year on the 7th of May instead # of this Saturday. They will go forward again the 3rd Saturday in -# August, not in October as they have since 1968. This is a pilot plan -# which will be reevaluated in 2012. +# August, not in October as they have since 1968. # From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23): # As stated in the website of the Chilean Energy Ministry # http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html # The Chilean Government has decided to postpone the entrance into winter time -# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not -# been yet formalized but it will within the next days. +# (to leave DST) from March 11 2012 to April 28th 2012.... # Quote from the website communication: # # 6. For the year 2012, the dates of entry into winter time will be as follows: @@ -1237,17 +1248,9 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914 # From Paul Eggert (2015-03-03): # For now, assume that the extension will persist indefinitely. -# NOTE: ChileAQ rules for Antarctic bases are stored separately in the -# 'antarctica' file. - # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Chile 1927 1932 - Sep 1 0:00 1:00 S +Rule Chile 1927 1931 - Sep 1 0:00 1:00 S Rule Chile 1928 1932 - Apr 1 0:00 0 - -Rule Chile 1942 only - Jun 1 4:00u 0 - -Rule Chile 1942 only - Aug 1 5:00u 1:00 S -Rule Chile 1946 only - Jul 15 4:00u 1:00 S -Rule Chile 1946 only - Sep 1 3:00u 0:00 - -Rule Chile 1947 only - Apr 1 4:00u 0 - Rule Chile 1968 only - Nov 3 4:00u 1:00 S Rule Chile 1969 only - Mar 30 3:00u 0 - Rule Chile 1969 only - Nov 23 4:00u 1:00 S @@ -1258,10 +1261,8 @@ Rule Chile 1972 1986 - Mar Sun>=9 3:00u 0 - Rule Chile 1973 only - Sep 30 4:00u 1:00 S Rule Chile 1974 1987 - Oct Sun>=9 4:00u 1:00 S Rule Chile 1987 only - Apr 12 3:00u 0 - -Rule Chile 1988 1989 - Mar Sun>=9 3:00u 0 - -Rule Chile 1988 only - Oct Sun>=1 4:00u 1:00 S -Rule Chile 1989 only - Oct Sun>=9 4:00u 1:00 S -Rule Chile 1990 only - Mar 18 3:00u 0 - +Rule Chile 1988 1990 - Mar Sun>=9 3:00u 0 - +Rule Chile 1988 1989 - Oct Sun>=9 4:00u 1:00 S Rule Chile 1990 only - Sep 16 4:00u 1:00 S Rule Chile 1991 1996 - Mar Sun>=9 3:00u 0 - Rule Chile 1991 1997 - Oct Sun>=9 4:00u 1:00 S @@ -1284,15 +1285,21 @@ Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Santiago -4:42:46 - LMT 1890 - -4:42:46 - SMT 1910 # Santiago Mean Time + -4:42:46 - SMT 1910 Jan 10 # Santiago Mean Time -5:00 - CLT 1916 Jul 1 # Chile Time - -4:42:46 - SMT 1918 Sep 1 # Santiago Mean Time - -4:00 - CLT 1919 Jul 1 # Chile Time - -4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time - -5:00 Chile CL%sT 1947 May 22 # Chile Time + -4:42:46 - SMT 1918 Sep 10 + -4:00 - CLT 1919 Jul 1 + -4:42:46 - SMT 1927 Sep 1 + -5:00 Chile CL%sT 1932 Sep 1 + -4:00 - CLT 1942 Jun 1 + -5:00 - CLT 1942 Aug 1 + -4:00 - CLT 1946 Jul 15 + -4:00 1:00 CLST 1946 Sep 1 # central Chile + -4:00 - CLT 1947 Apr 1 + -5:00 - CLT 1947 May 21 23:00 -4:00 Chile CL%sT 2015 Apr 26 3:00u -3:00 - CLT -Zone Pacific/Easter -7:17:44 - LMT 1890 +Zone Pacific/Easter -7:17:28 - LMT 1890 -7:17:28 - EMT 1932 Sep # Easter Mean Time -7:00 Chile EAS%sT 1982 Mar 14 3:00u # Easter Time -6:00 Chile EAS%sT 2015 Apr 26 3:00u @@ -1302,6 +1309,25 @@ Zone Pacific/Easter -7:17:44 - LMT 1890 # Other Chilean locations, including Juan Fernández Is, Desventuradas Is, # and Antarctic bases, are like America/Santiago. +# Antarctic base using South American rules +# (See the file 'antarctica' for more.) +# +# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968) +# +# From Ethan Dicks (1996-10-06): +# It keeps the same time as Punta Arenas, Chile, because, just like us +# and the South Pole, that's the other end of their supply line.... +# I verified with someone who was there that since 1980, +# Palmer has followed Chile. Prior to that, before the Falklands War, +# Palmer used to be supplied from Argentina. +# +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Antarctica/Palmer 0 - zzz 1965 + -4:00 Arg AR%sT 1969 Oct 5 + -3:00 Arg AR%sT 1982 May + -4:00 Chile CL%sT 2015 Apr 26 3:00u + -3:00 - CLT + # Colombia # Milne gives 4:56:16.4 for Bogotá time in 1899; round to nearest. He writes, diff --git a/jdk/test/tools/launcher/FXLauncherTest.java b/jdk/test/tools/launcher/FXLauncherTest.java index d29d8ab6e3f..a885cb8dbf6 100644 --- a/jdk/test/tools/launcher/FXLauncherTest.java +++ b/jdk/test/tools/launcher/FXLauncherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * 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 @@ * Test uses main method and blank main method, a jfx app class and an incorrest * jfx app class, a main-class for the manifest, a bogus one and none. * All should execute except the incorrect fx app class entries. - * @run main FXLauncherTest + * @run main/othervm FXLauncherTest */ import java.io.File; import java.io.IOException; diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 15b068c6058..15b6ed65253 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -53,17 +53,7 @@ java.base_EXCLUDES += java/lang/doc-files java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java ifeq ($(OPENJDK_TARGET_OS), macosx) - JAVA_BASE_UNIX_DIR := $(JDK_TOPDIR)/src/java.base/unix/classes - # TODO: make JavaCompilation handle overrides automatically instead of excluding here - # These files are overridden in macosx - java.base_EXCLUDE_FILES += \ - $(JAVA_BASE_UNIX_DIR)/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \ - $(JAVA_BASE_UNIX_DIR)/java/net/DefaultInterface.java \ - $(JAVA_BASE_UNIX_DIR)/java/lang/ClassLoaderHelper.java \ - $(JAVA_BASE_UNIX_DIR)/sun/nio/ch/DefaultSelectorProvider.java \ - # - # This is just skipped on macosx - java.base_EXCLUDE_FILES += $(JAVA_BASE_UNIX_DIR)/sun/nio/fs/GnomeFileTypeDetector.java + java.base_EXCLUDE_FILES += sun/nio/fs/GnomeFileTypeDetector.java endif ifneq ($(OPENJDK_TARGET_OS), solaris) @@ -247,13 +237,6 @@ java.desktop_EXCLUDE_FILES += \ javax/swing/plaf/nimbus/TabbedPanePainter.java \ # -ifeq ($(OPENJDK_TARGET_OS), macosx) - # These files are duplicated in MACOSX_SRC_DIRS - java.desktop_EXCLUDE_FILES += \ - $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/BackBufferCapsProvider.java \ - # -endif - ################################################################################ java.scripting_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' @@ -418,7 +401,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) endif ifeq ($(OPENJDK_TARGET_OS),aix) - # These files are duplicated in AIX_SRC_DIRS jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES) endif diff --git a/make/Images.gmk b/make/Images.gmk index 9c4c12b4495..5d29ad47ead 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -70,7 +70,7 @@ JDK_MODULES := $(JRE_MODULES) $(TOOLS_MODULES) # compact3 builds have additional modules JDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \ - jdk.naming.rmi jdk.sctp jdk.security.auth + jdk.naming.rmi jdk.sctp jdk.security.auth jdk.management # Replacing double-comma with a single comma is to workaround the issue # with some version of make on windows that doesn't substitute spaces @@ -255,30 +255,13 @@ ifneq ($(OPENJDK_TARGET_OS), windows) $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(install-file) - define install-ja-manpage - $(MKDIR) -p $(@D) - $(CAT) $< \ - | $(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/% - $(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@) - $(call install-ja-manpage, UTF-8) + $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(install-file) $(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) - - $(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) - - $(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) + $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(install-file) ifeq ($(OPENJDK_TARGET_OS), solaris) $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/% diff --git a/make/Jprt.gmk b/make/Jprt.gmk index 57a7c67b1ca..2d643aabc75 100644 --- a/make/Jprt.gmk +++ b/make/Jprt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. # 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,8 +91,8 @@ $(JPRT_ARCHIVE_SYMBOLS_BUNDLE): bundles SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR) SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR) SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR) -SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR) -SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR) +SRC_JDK_MACOSX_BUNDLE_DIR := $(JDK_MACOSX_BUNDLE_DIR) +SRC_JRE_MACOSX_BUNDLE_DIR := $(JRE_MACOSX_BUNDLE_DIR) # Bundle up the images bundles: all @@ -123,10 +123,10 @@ final-images: all $(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)/ + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR) + $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR) + $(CP) -R -P $(SRC_JDK_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)/ + $(CP) -R -P $(SRC_JRE_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)/ endif @$(call TargetExit) diff --git a/make/MacBundles.gmk b/make/MacBundles.gmk index 8b1dddc34bf..af017d05107 100644 --- a/make/MacBundles.gmk +++ b/make/MacBundles.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # 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,32 +33,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) bundles: jre-bundle jdk-bundle - # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC. + # JDK_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC. MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle - # 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 - BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE) - endif - BUNDLE_ID_JRE := $(BUNDLE_ID).jre - BUNDLE_ID_JDK := $(BUNDLE_ID).jdk - + BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION) BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION) - BUNDLE_NAME_JRE := $(BUNDLE_NAME) - BUNDLE_NAME_JDK := $(BUNDLE_NAME) - - ifndef OPENJDK - BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION) - else - BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION)) - endif - BUNDLE_INFO_JRE := $(BUNDLE_INFO) - BUNDLE_INFO_JDK := $(BUNDLE_INFO) - + BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION) BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION) BUNDLE_VERSION := $(JDK_VERSION) ifeq ($(COMPANY_NAME), N/A) @@ -67,65 +48,66 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) BUNDLE_VENDOR := $(COMPANY_NAME) endif - 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_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST)) + JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST)) # Copy empty directories (jre/lib/applet). - $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% + $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(MKDIR) -p $(@D) if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi - $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% + $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(MKDIR) -p $(@D) if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi - $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib: + $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib: $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(MKDIR) -p $(@D) $(RM) $@ $(LN) -s ../Home/lib/jli/libjli.dylib $@ - $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib: + $(JRE_MACOSX_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) - $(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_PLIST_SRC)/JDK-Info.plist > $@ + $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \ + SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \ + OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \ + REPLACEMENTS := \ + @@ID@@ => $(BUNDLE_ID).jdk ; \ + @@NAME@@ => $(BUNDLE_NAME) ; \ + @@INFO@@ => $(BUNDLE_INFO) ; \ + @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ + @@VERSION@@ => $(BUNDLE_VERSION) ; \ + @@VENDOR@@ => $(BUNDLE_VENDOR) , \ + )) - $(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_PLIST_SRC)/JRE-Info.plist > $@ + $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \ + SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \ + OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \ + REPLACEMENTS := \ + @@ID@@ => $(BUNDLE_ID).jre ; \ + @@NAME@@ => $(BUNDLE_NAME) ; \ + @@INFO@@ => $(BUNDLE_INFO) ; \ + @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \ + @@VERSION@@ => $(BUNDLE_VERSION) ; \ + @@VENDOR@@ => $(BUNDLE_VENDOR) , \ + )) - jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \ - $(JDK_BUNDLE_DIR)/Info.plist - $(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR)) + jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ + $(BUILD_JDK_PLIST) + $(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR)) - jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \ - $(JRE_BUNDLE_DIR)/Info.plist - $(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR)) + jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \ + $(BUILD_JRE_PLIST) + $(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR)) else # Not macosx diff --git a/make/StripBinaries.gmk b/make/StripBinaries.gmk index 54f5c768050..17153130574 100644 --- a/make/StripBinaries.gmk +++ b/make/StripBinaries.gmk @@ -42,7 +42,6 @@ ifneq ($(POST_STRIP_CMD), ) $(CP) $< $@.tmp $(CHMOD) u+w $@.tmp $(POST_STRIP_CMD) $@.tmp - $(if $(POST_MCS_CMD), $(POST_MCS_CMD) $@.tmp) $(CHMOD) go-w $@.tmp $(MV) $@.tmp $@ endef diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index c08d1da62a3..f79f05f21e4 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -276,7 +276,7 @@ define SetupArchiveBody $$($1_GREP_EXCLUDE_OUTPUT) # If the vardeps file is part of the newer prereq list, it means that # either the jar file does not exist, or we need to recreate it from - # from scratch anyway since a simple update will not catch all the + # from scratch anyway since a simple update will not catch all the # potential changes. $$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \ $$(if $$($1_MANIFEST), \ @@ -321,8 +321,8 @@ define add_file_to_copy $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET))) # To allow for automatic overrides, do not create a rule for a target file that # already has one - ifeq ($$(findstring $$($2_TARGET), $$($1_COPY_LIST)), ) - $1_COPY_LIST += $$($2_TARGET) + ifneq ($$($1_COPY_$$($2_TARGET)), 1) + $1_COPY_$$($2_TARGET) := 1 # Now we can setup the depency that will trigger the copying. $$($1_BIN)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) @@ -365,7 +365,11 @@ define add_file_to_clean # 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 + # To allow for automatic overrides, do not create a rule for a target file that + # already has one + ifneq ($$($1_CLEAN_$$($2_TARGET)), 1) + $1_CLEAN_$$($2_TARGET) := 1 + $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \ | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \ @@ -378,8 +382,9 @@ define add_file_to_clean | $(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) + endif endef define remove_string @@ -396,7 +401,8 @@ endef # 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 +# SRC:=one or more directories to search for sources. The order of the source roots +# is significant. The first found file of a certain name has priority. # 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. @@ -432,7 +438,7 @@ define SetupJavaCompilationBody # 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))) + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<))) $$(call MakeDir,$$($1_BIN)) # Add all source roots to the find cache since we are likely going to run find # on these more than once. The cache will only be updated if necessary. @@ -450,15 +456,6 @@ define SetupJavaCompilationBody $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 /*,$$($1_EXCLUDES))) \ - $$(addprefix -i ,$$(addsuffix /*,$$($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)))) @@ -469,6 +466,25 @@ define SetupJavaCompilationBody $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) endif + # Remove duplicate source files by keeping the first found of each duplicate. + # This allows for automatic overrides with custom or platform specific versions + # source files. + # + # For the smart javac wrapper case, add each removed file to an extra exclude + # file list to prevent sjavac from finding duplicate sources. + $1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \ + $$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \ + $$(if $$($1_$$(relative_src)), \ + $$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \ + $$(eval $1_$$(relative_src) := 1) $$(s)))) + + # Create the corresponding smart javac wrapper command line. + $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \ + $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \ + $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \ + $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \ + -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))" + # All files below META-INF are always copied. $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) # Find all files to be copied from source to bin. diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index da94ab85436..4a88442e643 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -45,6 +45,11 @@ endif # Functions ############################## +### Debug functions + +# Prints the name and value of a variable +PrintVar = \ + $(info $(strip $1) >$($(strip $1))<) ### Functions for timers @@ -558,6 +563,13 @@ equals = \ $(and $(findstring $(strip $1),$(strip $2)),\ $(findstring $(strip $2),$(strip $1))) +# Remove a whole list of prefixes +# $1 - List of prefixes +# $2 - List of elements to process +remove-prefixes = \ + $(strip $(if $1,$(patsubst $(firstword $1)%,%,\ + $(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2)) + ################################################################################ ifneq ($(DISABLE_CACHE_FIND), true) diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 5e94952a641..4bfd6538b2b 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -43,7 +43,7 @@ ALL_TOP_SRC_DIRS := \ # Find all modules with java sources by looking in the source dirs define FindJavaModules - $(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \ + $(filter-out $(MODULES_FILTER), $(sort $(notdir \ $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \ @@ -52,7 +52,8 @@ endef # Find all modules with source for the target platform. define FindAllModules - $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \ + $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \ + $(notdir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \ $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))))) diff --git a/make/jprt.properties b/make/jprt.properties index 9af05c9b65f..cc31a94cfbc 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -28,8 +28,8 @@ # Global settings # -# Regression tests depend on test bundle -jprt.use.reg.test.bundle=true +# Install test bundle for targets in jprt.test.bundle.targets set +jprt.selective.test.bundle.installation=true # The current release name jprt.tools.default.release=jdk9 @@ -48,6 +48,9 @@ jprt.bundle.exclude.src.dirs=build dist webrev # Use configure when building jprt.build.use.configure=true +# Set up the run flavors (jvm variants) +jprt.run.flavors=c1,c2,default,${my.additional.run.flavors} + # Set make target to use for different build flavors jprt.build.flavor.debugOpen.target=jprt_bundle jprt.build.flavor.fastdebug.target=jprt_bundle @@ -73,6 +76,7 @@ jprt.build.targets=${my.is.hotspot.job ? ${my.build.targets.hotspot} : ${my.buil # Select test targets - jprt default for jprt.test.set is "default" jprt.test.targets=${my.test.targets.${jprt.test.set}} jprt.make.rule.test.targets=${my.make.rule.test.targets.${jprt.test.set}} +jprt.test.bundle.targets=${my.jprt.test.bundle.targets.${jprt.test.set}} # 7155453: Work-around to prevent popups on OSX from blocking test completion # but the work-around is added to all platforms to be consistent @@ -415,19 +419,15 @@ my.test.targets.hotspot= \ # Make file based test targets -my.make.rule.test.targets.hotspot.clienttests= \ - linux_i586_2.6-*-c1-hotspot_clienttest, \ - windows_i586_6.2-*-c1-hotspot_clienttest - -my.make.rule.test.targets.hotspot.servertests= \ - solaris_sparcv9_5.11-*-c2-hotspot_servertest, \ - solaris_x64_5.11-*-c2-hotspot_servertest, \ - linux_i586_2.6-*-c2-hotspot_servertest, \ - linux_x64_2.6-*-c2-hotspot_servertest, \ - macosx_x64_10.9-*-c2-hotspot_servertest, \ - windows_i586_6.2-*-c2-hotspot_servertest, \ - windows_x64_6.2-*-c2-hotspot_servertest - +my.make.rule.test.targets.hotspot.basicvmtests= \ + linux_i586_2.6-*-default-hotspot_basicvmtest, \ + linux_x64_2.6-*-default-hotspot_basicvmtest, \ + macosx_x64_10.9-*-default-hotspot_basicvmtest, \ + solaris_sparcv9_5.11-*-default-hotspot_basicvmtest, \ + solaris_x64_5.11-*-default-hotspot_basicvmtest, \ + windows_i586_6.2-*-default-hotspot_basicvmtest, \ + windows_x64_6.2-*-default-hotspot_basicvmtest + my.make.rule.test.targets.hotspot.internalvmtests= \ solaris_sparcv9_5.11-fastdebug-c2-hotspot_internalvmtests, \ solaris_x64_5.11-fastdebug-c2-hotspot_internalvmtests, \ @@ -448,10 +448,8 @@ my.make.rule.test.targets.hotspot.reg.group= \ linux_i586_2.6-fastdebug-c1-GROUP, \ windows_i586_6.2-fastdebug-c1-GROUP -my.make.rule.test.targets.hotspot= \ - ${my.make.rule.test.targets.hotspot.clienttests}, \ - ${my.make.rule.test.targets.hotspot.servertests}, \ - ${my.make.rule.test.targets.hotspot.internalvmtests}, \ +# Hotspot jtreg tests +my.make.rule.test.targets.hotspot.reg= \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_wbapitest}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_1}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_2}, \ @@ -461,12 +459,29 @@ my.make.rule.test.targets.hotspot= \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_closed}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_gcold}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime_closed}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity}, \ - ${my.additional.make.rule.test.targets.hotspot} + ${my.additional.make.rule.test.targets.hotspot.reg} + +# Other Makefile based Hotspot tests +my.make.rule.test.targets.hotspot.other= \ + ${my.make.rule.test.targets.hotspot.basicvmtests}, \ + ${my.make.rule.test.targets.hotspot.internalvmtests}, \ + ${my.additional.make.rule.test.targets.hotspot.other} + +# All the makefile based tests to run +my.make.rule.test.targets.hotspot= \ + ${my.make.rule.test.targets.hotspot.reg} \ + ${my.make.rule.test.targets.hotspot.other} + +# Install the test bundle for the testset hotspot jtreg tests +# (but not for the other Makefile based tests) +my.jprt.test.bundle.targets.hotspot=${my.make.rule.test.targets.hotspot.reg} # Native jdk and hotspot test targets (testset=nativesanity) my.make.rule.test.targets.nativesanity= \ ${my.test.target.set:TESTNAME=jdk_native_sanity}, \ ${my.test.target.set:TESTNAME=hotspot_native_sanity} + +# Install the test bundle for the nativesanity jtreg tests +my.jprt.test.bundle.targets.nativesanity=${my.make.rule.test.targets.nativesanity} diff --git a/modules.xml b/modules.xml index b56184dfdcb..1c53bc7e25f 100644 --- a/modules.xml +++ b/modules.xml @@ -222,11 +222,13 @@ <name>jdk.internal.org.objectweb.asm</name> <to>jdk.jfr</to> <to>jdk.scripting.nashorn</to> + <to>java.instrument</to> </export> <export> <name>jdk.internal.org.objectweb.asm.commons</name> <to>jdk.jfr</to> <to>jdk.scripting.nashorn</to> + <to>java.instrument</to> </export> <export> <name>jdk.internal.org.objectweb.asm.signature</name> @@ -235,11 +237,13 @@ <export> <name>jdk.internal.org.objectweb.asm.tree</name> <to>jdk.jfr</to> + <to>java.instrument</to> </export> <export> <name>jdk.internal.org.objectweb.asm.util</name> <to>jdk.jfr</to> <to>jdk.scripting.nashorn</to> + <to>java.instrument</to> </export> <export> <name>sun.misc</name> @@ -266,6 +270,7 @@ <to>jdk.security.auth</to> <to>jdk.security.jgss</to> <to>jdk.snmp</to> + <to>java.instrument</to> </export> <export> <name>sun.net.dns</name> @@ -310,6 +315,7 @@ <to>java.sql</to> <to>java.sql.rowset</to> <to>jdk.scripting.nashorn</to> + <to>java.instrument</to> </export> <export> <name>sun.reflect.annotation</name> @@ -766,6 +772,10 @@ <export> <name>java.lang.instrument</name> </export> + <export> + <name>jdk.internal.instrumentation</name> + <to>jdk.jfr</to> + </export> </module> <module> <name>java.logging</name> @@ -780,9 +790,6 @@ <depend>java.logging</depend> <depend>java.naming</depend> <depend re-exports="true">java.rmi</depend> - <export> - <name>com.sun.management</name> - </export> <export> <name>java.lang.management</name> </export> @@ -816,9 +823,11 @@ <export> <name>sun.management</name> <to>jdk.jconsole</to> + <to>jdk.management</to> </export> <export> <name>sun.management.spi</name> + <to>jdk.management</to> <to>jdk.management.cmm</to> </export> </module> @@ -1664,6 +1673,7 @@ <depend>java.rmi</depend> <depend>jdk.attach</depend> <depend>jdk.jvmstat</depend> + <depend>jdk.management</depend> <export> <name>com.sun.tools.jconsole</name> </export> @@ -1715,6 +1725,14 @@ <name>jdk.localedata</name> <depend>java.base</depend> </module> + <module> + <name>jdk.management</name> + <depend>java.base</depend> + <depend re-exports="true">java.management</depend> + <export> + <name>com.sun.management</name> + </export> + </module> <module> <name>jdk.naming.dns</name> <depend>java.base</depend> diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index b14626ce3e2..2b4135dff96 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -32,6 +32,7 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Stream; import java.security.BasicPermission; +import java.util.Objects; import sun.hotspot.parser.DiagnosticCommand; @@ -74,11 +75,27 @@ public class WhiteBox { public native void printHeapSizes(); // Memory - public native long getObjectAddress(Object o); + private native long getObjectAddress0(Object o); + public long getObjectAddress(Object o) { + Objects.requireNonNull(o); + return getObjectAddress0(o); + } + public native int getHeapOopSize(); public native int getVMPageSize(); - public native boolean isObjectInOldGen(Object o); - public native long getObjectSize(Object o); + public native long getVMLargePageSize(); + + private native boolean isObjectInOldGen0(Object o); + public boolean isObjectInOldGen(Object o) { + Objects.requireNonNull(o); + return isObjectInOldGen0(o); + } + + private native long getObjectSize0(Object o); + public long getObjectSize(Object o) { + Objects.requireNonNull(o); + return getObjectSize0(o); + } // Runtime // Make sure class name is in the correct format @@ -86,21 +103,45 @@ public class WhiteBox { return isClassAlive0(name.replace('.', '/')); } private native boolean isClassAlive0(String name); - public native boolean isMonitorInflated(Object obj); + + private native boolean isMonitorInflated0(Object obj); + public boolean isMonitorInflated(Object obj) { + Objects.requireNonNull(obj); + return isMonitorInflated0(obj); + } + public native void forceSafepoint(); // JVMTI - public native void addToBootstrapClassLoaderSearch(String segment); - public native void addToSystemClassLoaderSearch(String segment); + private native void addToBootstrapClassLoaderSearch0(String segment); + public void addToBootstrapClassLoaderSearch(String segment){ + Objects.requireNonNull(segment); + addToBootstrapClassLoaderSearch0(segment); + } + + private native void addToSystemClassLoaderSearch0(String segment); + public void addToSystemClassLoaderSearch(String segment) { + Objects.requireNonNull(segment); + addToSystemClassLoaderSearch0(segment); + } // G1 public native boolean g1InConcurrentMark(); - public native boolean g1IsHumongous(Object o); + private native boolean g1IsHumongous0(Object o); + public boolean g1IsHumongous(Object o) { + Objects.requireNonNull(o); + return g1IsHumongous0(o); + } + public native long g1NumMaxRegions(); public native long g1NumFreeRegions(); public native int g1RegionSize(); public native MemoryUsage g1AuxiliaryMemoryUsage(); - public native Object[] parseCommandLine(String commandline, char delim, DiagnosticCommand[] args); + private native Object[] parseCommandLine0(String commandline, char delim, DiagnosticCommand[] args); + public Object[] parseCommandLine(String commandline, char delim, DiagnosticCommand[] args) { + Objects.requireNonNull(args); + return parseCommandLine0(commandline, delim, args); + } // NMT public native long NMTMalloc(long size); @@ -119,45 +160,93 @@ public class WhiteBox { public boolean isMethodCompiled(Executable method) { return isMethodCompiled(method, false /*not osr*/); } - public native boolean isMethodCompiled(Executable method, boolean isOsr); + private native boolean isMethodCompiled0(Executable method, boolean isOsr); + public boolean isMethodCompiled(Executable method, boolean isOsr){ + Objects.requireNonNull(method); + return isMethodCompiled0(method, isOsr); + } public boolean isMethodCompilable(Executable method) { return isMethodCompilable(method, -1 /*any*/); } public boolean isMethodCompilable(Executable method, int compLevel) { return isMethodCompilable(method, compLevel, false /*not osr*/); } - public native boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr); - public native boolean isMethodQueuedForCompilation(Executable method); + private native boolean isMethodCompilable0(Executable method, int compLevel, boolean isOsr); + public boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr) { + Objects.requireNonNull(method); + return isMethodCompilable0(method, compLevel, isOsr); + } + private native boolean isMethodQueuedForCompilation0(Executable method); + public boolean isMethodQueuedForCompilation(Executable method) { + Objects.requireNonNull(method); + return isMethodQueuedForCompilation0(method); + } public int deoptimizeMethod(Executable method) { return deoptimizeMethod(method, false /*not osr*/); } - public native int deoptimizeMethod(Executable method, boolean isOsr); + private native int deoptimizeMethod0(Executable method, boolean isOsr); + public int deoptimizeMethod(Executable method, boolean isOsr) { + Objects.requireNonNull(method); + return deoptimizeMethod0(method, isOsr); + } public void makeMethodNotCompilable(Executable method) { makeMethodNotCompilable(method, -1 /*any*/); } public void makeMethodNotCompilable(Executable method, int compLevel) { makeMethodNotCompilable(method, compLevel, false /*not osr*/); } - public native void makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr); + private native void makeMethodNotCompilable0(Executable method, int compLevel, boolean isOsr); + public void makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr) { + Objects.requireNonNull(method); + makeMethodNotCompilable0(method, compLevel, isOsr); + } public int getMethodCompilationLevel(Executable method) { return getMethodCompilationLevel(method, false /*not ost*/); } - public native int getMethodCompilationLevel(Executable method, boolean isOsr); - public native boolean testSetDontInlineMethod(Executable method, boolean value); + private native int getMethodCompilationLevel0(Executable method, boolean isOsr); + public int getMethodCompilationLevel(Executable method, boolean isOsr) { + Objects.requireNonNull(method); + return getMethodCompilationLevel0(method, isOsr); + } + private native boolean testSetDontInlineMethod0(Executable method, boolean value); + public boolean testSetDontInlineMethod(Executable method, boolean value) { + Objects.requireNonNull(method); + return testSetDontInlineMethod0(method, value); + } public int getCompileQueuesSize() { return getCompileQueueSize(-1 /*any*/); } public native int getCompileQueueSize(int compLevel); - public native boolean testSetForceInlineMethod(Executable method, boolean value); + private native boolean testSetForceInlineMethod0(Executable method, boolean value); + public boolean testSetForceInlineMethod(Executable method, boolean value) { + Objects.requireNonNull(method); + return testSetForceInlineMethod0(method, value); + } public boolean enqueueMethodForCompilation(Executable method, int compLevel) { return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/); } - public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci); - public native void clearMethodState(Executable method); + private native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci); + public boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) { + Objects.requireNonNull(method); + return enqueueMethodForCompilation0(method, compLevel, entry_bci); + } + private native void clearMethodState0(Executable method); + public void clearMethodState(Executable method) { + Objects.requireNonNull(method); + clearMethodState0(method); + } public native void lockCompilation(); public native void unlockCompilation(); - public native int getMethodEntryBci(Executable method); - public native Object[] getNMethod(Executable method, boolean isOsr); + private native int getMethodEntryBci0(Executable method); + public int getMethodEntryBci(Executable method) { + Objects.requireNonNull(method); + return getMethodEntryBci0(method); + } + private native Object[] getNMethod0(Executable method, boolean isOsr); + public Object[] getNMethod(Executable method, boolean isOsr) { + Objects.requireNonNull(method); + return getNMethod0(method, isOsr); + } public native long allocateCodeBlob(int size, int type); public long allocateCodeBlob(long size, int type) { int intSize = (int) size; @@ -168,14 +257,7 @@ public class WhiteBox { return allocateCodeBlob( intSize, type); } public native void freeCodeBlob(long addr); - public void forceNMethodSweep() { - try { - forceNMethodSweep0().join(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - public native Thread forceNMethodSweep0(); + public native void forceNMethodSweep(); public native Object[] getCodeHeapEntries(int type); public native int getCompilationActivityMode(); public native Object[] getCodeBlob(long addr); @@ -213,7 +295,11 @@ public class WhiteBox { // Native extensions public native long getHeapUsageForContext(int context); public native long getHeapRegionCountForContext(int context); - public native int getContextForObject(Object obj); + private native int getContextForObject0(Object obj); + public int getContextForObject(Object obj) { + Objects.requireNonNull(obj); + return getContextForObject0(obj); + } public native void printRegionInfo(int context); // VM flags diff --git a/test/make/TestJavaCompilation.gmk b/test/make/TestJavaCompilation.gmk index 7e0aee6df87..b9341f2e3d5 100644 --- a/test/make/TestJavaCompilation.gmk +++ b/test/make/TestJavaCompilation.gmk @@ -230,6 +230,117 @@ TEST_TARGETS += $(OUTPUT_DIR)/_jar3_updated .PHONY: clean-jar3 create-jar3 update-jar3 +################################################################################ +# Test SetupJavaCompilation overrides of java files + +$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \ + JAVAC := $(JAVAC), \ +)) + +JAVA_SRC_ROOT1 := $(OUTPUT_DIR)/javaroot1 +JAVA_SRC_ROOT2 := $(OUTPUT_DIR)/javaroot2 + +# Since this makefile calls itself a number of times, protect this macro from +# being executed more than once. +# Param 1 - File name +# Param 2 - Package name +# Param 3 - Class name +# Param 4 - Message +CreateJavaSrc = \ + $(if $(wildcard $1),,$(shell \ + $(MKDIR) -p $(dir $1); \ + $(ECHO) "package $2;" > $1; \ + $(ECHO) "public class $3 {" >> $1; \ + $(ECHO) " public static void main(String[] args) {" >> $1; \ + $(ECHO) " System.out.print(\"$4\");" >> $1; \ + $(ECHO) " }" >> $1; \ + $(ECHO) "}" >> $1; \ + )) + +# Since this makefile calls itself a number of times, protect this macro from +# being executed more than once. +# Param 1 - File name +# Param 2 - Message +CreateTextFile = \ + $(if $(wildcard $1),,$(shell \ + $(MKDIR) -p $(dir $1); \ + $(PRINTF) '$2' > $1; \ + )) + +$(call CreateJavaSrc,$(JAVA_SRC_ROOT1)/a/A.java,a,A,javaroot1) +$(call CreateJavaSrc,$(JAVA_SRC_ROOT2)/a/A.java,a,A,javaroot2) +$(call CreateTextFile,$(JAVA_SRC_ROOT1)/a/b.txt,javaroot1\n) +$(call CreateTextFile,$(JAVA_SRC_ROOT2)/a/b.txt,javaroot2\n) +$(call CreateTextFile,$(JAVA_SRC_ROOT1)/a/c.properties,#javaroot1\nname=value1\n) +$(call CreateTextFile,$(JAVA_SRC_ROOT2)/a/c.properties,#javaroot2\nname=value2\n) + +# Due to a bug in gnu make 3.81, need to add the src roots with trailing slash, +# otherwise $(wildcard ) will not find the directories and the sanity check in +# SetupJavaCompilation will fail. +$(eval $(call SetupJavaCompilation, BUILD_ROOT1_FIRST, \ + SETUP := BOOT_JAVAC, \ + SRC := $(JAVA_SRC_ROOT1)/ $(JAVA_SRC_ROOT2)/, \ + COPY := .txt .java, \ + CLEAN := .properties, \ + BIN := $(OUTPUT_DIR)/root1first/, \ +)) + +$(BUILD_ROOT1_FIRST): + +verify-root1-first: $(BUILD_ROOT1_FIRST) + $(JAVA_SMALL) -cp $(OUTPUT_DIR)/root1first a.A > $(OUTPUT_DIR)/root1first.output + if [ "`$(CAT) $(OUTPUT_DIR)/root1first.output`" != "javaroot1" ]; then \ + $(ECHO) "The wrong class was compiled. Expected >javaroot1<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first.output`<"; \ + false; \ + fi + if [ "`$(CAT) $(OUTPUT_DIR)/root1first/a/b.txt`" != "javaroot1" ]; then \ + $(ECHO) "The wrong file was copied. Expected >javaroot1<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first/a/b.txt`<"; \ + false; \ + fi + if [ ! -e "$(OUTPUT_DIR)/root1first/a/A.java" ]; then \ + $(ECHO) "Missed copying $(OUTPUT_DIR)/root1first/a/A.java"; \ + false; \ + fi + if [ "`$(CAT) $(OUTPUT_DIR)/root1first/a/c.properties`" != "name=value1" ]; then \ + $(ECHO) "The wrong file was cleaned. Expected >name=value1<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first/a/c.properties`<"; \ + false; \ + fi + +$(eval $(call SetupJavaCompilation, BUILD_ROOT2_FIRST, \ + SETUP := BOOT_JAVAC, \ + SRC := $(JAVA_SRC_ROOT2)/ $(JAVA_SRC_ROOT1)/, \ + COPY := .txt, \ + CLEAN := .properties, \ + BIN := $(OUTPUT_DIR)/root2first/, \ +)) + +$(BUILD_ROOT2_FIRST): + +verify-root2-first: $(BUILD_ROOT2_FIRST) + $(JAVA_SMALL) -cp $(OUTPUT_DIR)/root2first a.A > $(OUTPUT_DIR)/root2first.output + if [ "`$(CAT) $(OUTPUT_DIR)/root2first.output`" != "javaroot2" ]; then \ + $(ECHO) "The wrong class was compiled. Expected >javaroot2<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first.output`<"; \ + false; \ + fi + if [ "`$(CAT) $(OUTPUT_DIR)/root2first/a/b.txt`" != "javaroot2" ]; then \ + $(ECHO) "The wrong file was cleaned. Expected >javaroot2<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first/a/b.txt`<"; \ + false; \ + fi + if [ "`$(CAT) $(OUTPUT_DIR)/root2first/a/c.properties`" != "name=value2" ]; then \ + $(ECHO) "The wrong file was cleaned. Expected >name=value2<"; \ + $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first/a/c.properties`<"; \ + false; \ + fi + +TEST_TARGETS += verify-root1-first verify-root2-first + +.PHONY: verify-root1-first verify-root2-first + ################################################################################ all: $(TEST_TARGETS) diff --git a/test/make/TestMakeBase.gmk b/test/make/TestMakeBase.gmk index 9a5b8cefb1d..98a8e7ba07c 100644 --- a/test/make/TestMakeBase.gmk +++ b/test/make/TestMakeBase.gmk @@ -33,6 +33,16 @@ DEPS := $(THIS_FILE) \ $(SRC_ROOT)/make/common/MakeBase.gmk \ # +# Assert two strings are equal +# 1 - Tested value +# 2 - Exepected value +# 3 - Error message +define assert-equals + ifneq ($$(strip $1),$$(strip $2)) + $$(error $3 - Expected >$$(strip $2)< - Got >$$(strip $1)<) + endif +endef + # On macosx, file system timestamps only have 1 second resultion so must add # sleeps to properly test dependencies. ifeq ($(OPENJDK_BUILD_OS), macosx) @@ -76,6 +86,17 @@ ifeq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE1)), ) $(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE1)< are not equal) endif +################################################################################ +# Test remove-prefixes + +$(eval $(call assert-equals, \ + $(call remove-prefixes, pre, prefix postfix), fix postfix, \ + Prefixes not properly removed)) + +$(eval $(call assert-equals, \ + $(call remove-prefixes, pre post, prefix postfix), fix fix, \ + Prefixes not properly removed)) + ################################################################################ # Test ShellQuote