OpenJDK / jdk / jdk10
changeset 25783:20f52389c1aa
Merge
author | prr |
---|---|
date | Wed, 16 Jul 2014 15:12:24 -0700 |
parents | 5a832643a534 d461312cb89f |
children | 656f7d3eef5f |
files | hotspot/src/cpu/ppc/vm/bytecodes_ppc.cpp hotspot/src/cpu/ppc/vm/bytecodes_ppc.hpp hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp hotspot/src/cpu/x86/vm/bytecodes_x86.cpp hotspot/src/cpu/x86/vm/bytecodes_x86.hpp hotspot/src/cpu/zero/vm/bytecodes_zero.cpp hotspot/src/cpu/zero/vm/bytecodes_zero.hpp hotspot/test/runtime/8001071/Test8001071.java hotspot/test/runtime/8001071/Test8001071.sh jdk/make/CopyFiles.gmk jdk/make/profile-includes.txt jdk/src/share/classes/com/sun/jmx/remote/util/CacheMap.java jdk/src/share/classes/java/awt/Toolkit.java jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java jdk/src/share/lib/security/BlacklistedCertsConverter.java jdk/src/share/lib/security/blacklisted.certs jdk/src/share/lib/security/blacklisted.certs.pem jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ExplodeOpTest.java jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SummaryStatisticsTest.java jdk/test/javax/management/remote/mandatory/util/CacheMapTest.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/CommentedMethodFinder.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/TaggedMethodFinder.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java langtools/test/com/sun/javadoc/testHref/pkg/C3.java langtools/test/tools/javac/completion/C.java langtools/test/tools/javac/completion/C.out langtools/test/tools/javac/completion/example/B.class langtools/test/tools/javac/diags/examples/AnnotationsNotSupported.java langtools/test/tools/javac/diags/examples/AssertAsIdentifier.java langtools/test/tools/javac/diags/examples/EnumAsIdentifier.java langtools/test/tools/javac/diags/examples/EnumsNotSupported.java langtools/test/tools/javac/diags/examples/ForeachNotSupported.java langtools/test/tools/javac/diags/examples/GenericsNotSupported.java langtools/test/tools/javac/diags/examples/StaticImportNotSupported.java langtools/test/tools/javac/diags/examples/UnsupportedFpLit.java langtools/test/tools/javac/diags/examples/VarargsNotSupported.java langtools/test/tools/javac/enum/T5081785a.java langtools/test/tools/javac/enum/T5081785b.java langtools/test/tools/javac/enum/T5081785c.java langtools/test/tools/javac/expression/_super/NonDirectSuper/Base.java langtools/test/tools/javac/expression/_super/NonDirectSuper/NonDirectSuper.java langtools/test/tools/javac/expression/_super/NonDirectSuper/Target11.java langtools/test/tools/javac/miranda/6964669/T6964669.java langtools/test/tools/javac/miranda/6964669/pkg/A.java langtools/test/tools/javac/miranda/6964669/pkg/B.java langtools/test/tools/javac/miranda/6964669/pkg/C.java langtools/test/tools/javac/mixedTarget/CompatibleAbstracts1.java langtools/test/tools/javac/mixedTarget/CompatibleAbstracts2.java langtools/test/tools/javac/versions/CheckClassFileVersion.java langtools/test/tools/javac/versions/check.sh nashorn/src/jdk/nashorn/api/scripting/resources/engine.js |
diffstat | 1704 files changed, 28740 insertions(+), 18161 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Jul 16 16:02:51 2014 +0400 +++ b/.hgtags Wed Jul 16 15:12:24 2014 -0700 @@ -263,3 +263,5 @@ c5495e25c7258ab5f96a1ae14610887d76d2be63 jdk9-b18 2dcf544eb7ed5ac6a3f7813a32e33acea7442405 jdk9-b19 89731ae72a761afdf4262e8b9513f302f6563f89 jdk9-b20 +28dd0c7beb3cad9cf95f17b4b5ad87eb447a4084 jdk9-b21 +9678e0db8ff6ed845d4c2ee4a3baf7f386a777e5 jdk9-b22
--- a/.hgtags-top-repo Wed Jul 16 16:02:51 2014 +0400 +++ b/.hgtags-top-repo Wed Jul 16 15:12:24 2014 -0700 @@ -263,3 +263,5 @@ 65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18 75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19 ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20 +9052803f4d01feda28b3d65f2b64dd457d21c7b6 jdk9-b21 +8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
--- a/common/autoconf/basics.m4 Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/basics.m4 Wed Jul 16 15:12:24 2014 -0700 @@ -512,7 +512,7 @@ ) AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot], - [use this directory as sysroot)])], + [use this directory as sysroot])], [SYSROOT=$with_sysroot] ) @@ -531,6 +531,75 @@ [BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)] ) + if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then + # detect if Xcode is installed by running xcodebuild -version + # if no Xcode installed, xcodebuild exits with 1 + # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0 + if /usr/bin/xcodebuild -version >/dev/null 2>&1; then + # We need to use xcodebuild in the toolchain dir provided by the user, this will + # fall back on the stub binary in /usr/bin/xcodebuild + AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH]) + else + # this should result in SYSROOT being empty, unless --with-sysroot is provided + # when only the command line tools are installed there are no SDKs, so headers + # are copied into the system frameworks + XCODEBUILD= + AC_SUBST(XCODEBUILD) + fi + + AC_MSG_CHECKING([for sdk name]) + AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name], + [use the platform SDK of the given name. @<:@macosx@:>@])], + [SDKNAME=$with_sdk_name] + ) + AC_MSG_RESULT([$SDKNAME]) + + # if toolchain path is specified then don't rely on system headers, they may not compile + HAVE_SYSTEM_FRAMEWORK_HEADERS=0 + test -z "$TOOLCHAIN_PATH" && \ + HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?` + + if test -z "$SYSROOT"; then + if test -n "$XCODEBUILD"; then + # if we don't have system headers, use default SDK name (last resort) + if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then + SDKNAME=${SDKNAME:-macosx} + fi + + if test -n "$SDKNAME"; then + # Call xcodebuild to determine SYSROOT + SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'` + fi + else + if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then + AC_MSG_ERROR([No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK]) + fi + fi + else + # warn user if --with-sdk-name was also set + if test -n "$with_sdk_name"; then + AC_MSG_WARN([Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used]) + fi + fi + + if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then + # If no system framework headers, then SYSROOT must be set, or we won't build + AC_MSG_ERROR([Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments.]) + fi + + # Perform a basic sanity test + if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then + if test -z "$SYSROOT"; then + AC_MSG_ERROR([Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly]) + else + AC_MSG_ERROR([Invalid SDK or SYSROOT path, dependent framework headers not found]) + fi + fi + + # set SDKROOT too, Xcode tools will pick it up + AC_SUBST(SDKROOT,$SYSROOT) + fi + # Prepend the extra path to the global path BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
--- a/common/autoconf/flags.m4 Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/flags.m4 Wed Jul 16 15:12:24 2014 -0700 @@ -131,6 +131,10 @@ -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" fi + elif test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks + SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\"" + SYSROOT_LDFLAGS=$SYSROOT_CFLAGS elif test "x$TOOLCHAIN_TYPE" = xgcc; then SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\"" SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\"" @@ -143,6 +147,14 @@ LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" fi + + # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework + # set this here so it doesn't have to be peppered throughout the forest + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + fi + AC_SUBST(SYSROOT_CFLAGS) AC_SUBST(SYSROOT_LDFLAGS) ]) @@ -644,23 +656,18 @@ # Additional macosx handling if test "x$OPENJDK_TARGET_OS" = xmacosx; then - if test "x$TOOLCHAIN_TYPE" = xgcc; then - # FIXME: This needs to be exported in spec.gmk due to closed legacy code. - # FIXME: clean this up, and/or move it elsewhere. + # Setting these parameters makes it an error to link to macosx APIs that are + # newer than the given OS version and makes the linked binaries compatible + # even if built on a newer version of the OS. + # The expected format is X.Y.Z + MACOSX_VERSION_MIN=10.7.0 + AC_SUBST(MACOSX_VERSION_MIN) - # Setting these parameters makes it an error to link to macosx APIs that are - # newer than the given OS version and makes the linked binaries compatible - # even if built on a newer version of the OS. - # The expected format is X.Y.Z - MACOSX_VERSION_MIN=10.7.0 - AC_SUBST(MACOSX_VERSION_MIN) - - # The macro takes the version with no dots, ex: 1070 - # Let the flags variables get resolved in make for easier override on make - # command line. - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - fi + # The macro takes the version with no dots, ex: 1070 + # Let the flags variables get resolved in make for easier override on make + # command line. + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" + LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi # Setup some hard coded includes
--- a/common/autoconf/generated-configure.sh Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/generated-configure.sh Wed Jul 16 15:12:24 2014 -0700 @@ -874,6 +874,8 @@ OUTPUT_ROOT CONF_NAME SPEC +SDKROOT +XCODEBUILD BUILD_VARIANT_RELEASE DEBUG_CLASSFILES FASTDEBUG @@ -1040,6 +1042,7 @@ with_tools_dir with_toolchain_path with_extra_path +with_sdk_name with_conf_name with_builddeps_conf with_builddeps_server @@ -1074,7 +1077,6 @@ with_extra_ldflags enable_debug_symbols enable_zip_debug_info -enable_macosx_runtime_support with_x with_cups with_cups_include @@ -1085,6 +1087,7 @@ with_alsa with_alsa_include with_alsa_lib +with_libjpeg with_giflib with_lcms with_libpng @@ -1841,9 +1844,6 @@ --disable-debug-symbols disable generation of debug symbols [enabled] --disable-zip-debug-info disable zipping of debug-info files [enabled] - --enable-macosx-runtime-support - Deprecated. Option is kept for backwards - compatibility and is ignored --disable-freetype-bundling disable bundling of the freetype library with the build result [enabled on Windows or when using @@ -1872,12 +1872,13 @@ optimized (HotSpot build only)) [release] --with-devkit use this devkit for compilers, tools and resources --with-sys-root alias for --with-sysroot for backwards compatability - --with-sysroot use this directory as sysroot) + --with-sysroot use this directory as sysroot --with-tools-dir alias for --with-toolchain-path for backwards compatibility --with-toolchain-path prepend these directories when searching for toolchain binaries (compilers etc) --with-extra-path prepend these directories to the default path + --with-sdk-name use the platform SDK of the given name. [macosx] --with-conf-name use this as the name of the configuration [generated from important configuration options] --with-builddeps-conf use this configuration file for the builddeps @@ -1942,6 +1943,8 @@ headers under PATH/include) --with-alsa-include specify directory for the alsa include files --with-alsa-lib specify directory for the alsa library + --with-libjpeg use libjpeg from build system or OpenJDK source + (system, bundled) [bundled] --with-giflib use giflib from build system or OpenJDK source (system, bundled) [bundled] --with-lcms use lcms2 from build system or OpenJDK source @@ -4308,7 +4311,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1402614845 +DATE_WHEN_GENERATED=1403557683 ############################################################################### # @@ -13607,7 +13610,7 @@ VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big ;; - sparcv9) + sparcv9|sparc64) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64 @@ -13738,7 +13741,7 @@ VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big ;; - sparcv9) + sparcv9|sparc64) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64 @@ -14968,6 +14971,122 @@ fi + if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then + # detect if Xcode is installed by running xcodebuild -version + # if no Xcode installed, xcodebuild exits with 1 + # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0 + if /usr/bin/xcodebuild -version >/dev/null 2>&1; then + # We need to use xcodebuild in the toolchain dir provided by the user, this will + # fall back on the stub binary in /usr/bin/xcodebuild + # Extract the first word of "xcodebuild", so it can be a program name with args. +set dummy xcodebuild; 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_XCODEBUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $XCODEBUILD in + [\\/]* | ?:[\\/]*) + ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $TOOLCHAIN_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_XCODEBUILD="$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 + + test -z "$ac_cv_path_XCODEBUILD" && ac_cv_path_XCODEBUILD="/usr/bin/xcodebuild" + ;; +esac +fi +XCODEBUILD=$ac_cv_path_XCODEBUILD +if test -n "$XCODEBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 +$as_echo "$XCODEBUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + # this should result in SYSROOT being empty, unless --with-sysroot is provided + # when only the command line tools are installed there are no SDKs, so headers + # are copied into the system frameworks + XCODEBUILD= + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdk name" >&5 +$as_echo_n "checking for sdk name... " >&6; } + +# Check whether --with-sdk-name was given. +if test "${with_sdk_name+set}" = set; then : + withval=$with_sdk_name; SDKNAME=$with_sdk_name + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKNAME" >&5 +$as_echo "$SDKNAME" >&6; } + + # if toolchain path is specified then don't rely on system headers, they may not compile + HAVE_SYSTEM_FRAMEWORK_HEADERS=0 + test -z "$TOOLCHAIN_PATH" && \ + HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?` + + if test -z "$SYSROOT"; then + if test -n "$XCODEBUILD"; then + # if we don't have system headers, use default SDK name (last resort) + if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then + SDKNAME=${SDKNAME:-macosx} + fi + + if test -n "$SDKNAME"; then + # Call xcodebuild to determine SYSROOT + SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'` + fi + else + if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then + as_fn_error $? "No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK" "$LINENO" 5 + fi + fi + else + # warn user if --with-sdk-name was also set + if test -n "$with_sdk_name"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&5 +$as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&2;} + fi + fi + + if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then + # If no system framework headers, then SYSROOT must be set, or we won't build + as_fn_error $? "Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments." "$LINENO" 5 + fi + + # Perform a basic sanity test + if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then + if test -z "$SYSROOT"; then + as_fn_error $? "Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly" "$LINENO" 5 + else + as_fn_error $? "Invalid SDK or SYSROOT path, dependent framework headers not found" "$LINENO" 5 + fi + fi + + # set SDKROOT too, Xcode tools will pick it up + SDKROOT=$SYSROOT + + fi + # Prepend the extra path to the global path if test "x$EXTRA_PATH" != x; then @@ -26596,21 +26715,28 @@ VALID_TOOLCHAINS=${!toolchain_var_name} if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On Mac OS X, default toolchain to clang after Xcode 5 - XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1` - $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null - if test $? -ne 0; then - as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5 - fi - XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ - $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \ - $CUT -f 1 -d .` - { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5 + if test -n "$XCODEBUILD"; then + # On Mac OS X, default toolchain to clang after Xcode 5 + XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1` + $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null + if test $? -ne 0; then + as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5 + fi + XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ + $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \ + $CUT -f 1 -d .` + { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5 $as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;} - if test $XCODE_MAJOR_VERSION -ge 5; then - DEFAULT_TOOLCHAIN="clang" - else - DEFAULT_TOOLCHAIN="gcc" + if test $XCODE_MAJOR_VERSION -ge 5; then + DEFAULT_TOOLCHAIN="clang" + else + DEFAULT_TOOLCHAIN="gcc" + fi + else + # If Xcode is not installed, but the command line tools are + # then we can't run xcodebuild. On these systems we should + # default to clang + DEFAULT_TOOLCHAIN="clang" fi else # First toolchain type in the list is the default @@ -41076,6 +41202,10 @@ -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" fi + elif test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks + SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\"" + SYSROOT_LDFLAGS=$SYSROOT_CFLAGS elif test "x$TOOLCHAIN_TYPE" = xgcc; then SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\"" SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\"" @@ -41089,6 +41219,14 @@ LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" fi + # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework + # set this here so it doesn't have to be peppered throughout the forest + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + fi + + @@ -42135,23 +42273,18 @@ # Additional macosx handling if test "x$OPENJDK_TARGET_OS" = xmacosx; then - if test "x$TOOLCHAIN_TYPE" = xgcc; then - # FIXME: This needs to be exported in spec.gmk due to closed legacy code. - # FIXME: clean this up, and/or move it elsewhere. - - # Setting these parameters makes it an error to link to macosx APIs that are - # newer than the given OS version and makes the linked binaries compatible - # even if built on a newer version of the OS. - # The expected format is X.Y.Z - MACOSX_VERSION_MIN=10.7.0 - - - # The macro takes the version with no dots, ex: 1070 - # Let the flags variables get resolved in make for easier override on make - # command line. - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - fi + # Setting these parameters makes it an error to link to macosx APIs that are + # newer than the given OS version and makes the linked binaries compatible + # even if built on a newer version of the OS. + # The expected format is X.Y.Z + MACOSX_VERSION_MIN=10.7.0 + + + # The macro takes the version with no dots, ex: 1070 + # Let the flags variables get resolved in make for easier override on make + # command line. + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" + LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi # Setup some hard coded includes @@ -42654,8 +42787,6 @@ ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - # If the java runtime framework is disabled, then we need X11. - # This will be adjusted below. { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5 $as_echo "alsa pulse x11" >&6; } fi @@ -42676,33 +42807,6 @@ X11_NOT_NEEDED=yes fi - ############################################################################### - # - # Check for MacOSX support for OpenJDK. - # - - - # Check whether --enable-macosx-runtime-support was given. -if test "${enable_macosx_runtime_support+set}" = set; then : - enableval=$enable_macosx_runtime_support; -fi - - if test "x$enable_macosx_runtime_support" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&2;} - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5 -$as_echo_n "checking for Mac OS X Java Framework... " >&6; } - if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5 -$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ############################################################################### @@ -47573,10 +47677,43 @@ # Check for the jpeg library # - USE_EXTERNAL_LIBJPEG=true - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 -$as_echo_n "checking for main in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_main+:} false; then : + +# Check whether --with-libjpeg was given. +if test "${with_libjpeg+set}" = set; then : + withval=$with_libjpeg; +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5 +$as_echo_n "checking for which libjpeg to use... " >&6; } + + # default is bundled + DEFAULT_LIBJPEG=bundled + + # + # if user didn't specify, use DEFAULT_LIBJPEG + # + if test "x${with_libjpeg}" = "x"; then + with_libjpeg=${DEFAULT_LIBJPEG} + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5 +$as_echo "${with_libjpeg}" >&6; } + + if test "x${with_libjpeg}" = "xbundled"; then + USE_EXTERNAL_LIBJPEG=false + elif test "x${with_libjpeg}" = "xsystem"; then + ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes; then : + +else + as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5 +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 +$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -47584,27 +47721,33 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ -return main (); +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_CreateDecompress (); +int +main () +{ +return jpeg_CreateDecompress (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_jpeg_main=yes -else - ac_cv_lib_jpeg_main=no + ac_cv_lib_jpeg_jpeg_CreateDecompress=yes +else + ac_cv_lib_jpeg_jpeg_CreateDecompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5 -$as_echo "$ac_cv_lib_jpeg_main" >&6; } -if test "x$ac_cv_lib_jpeg_main" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF @@ -47612,11 +47755,14 @@ LIBS="-ljpeg $LIBS" else - USE_EXTERNAL_LIBJPEG=false - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5 -$as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;} - -fi + as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5 +fi + + + USE_EXTERNAL_LIBJPEG=true + else + as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5 + fi
--- a/common/autoconf/hotspot-spec.gmk.in Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/hotspot-spec.gmk.in Wed Jul 16 15:12:24 2014 -0700 @@ -69,8 +69,8 @@ # Yet another name for arch used for an extra subdir below the jvm lib. # Uses i386 and amd64, instead of x86 and x86_64. LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB) -# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64. -ARCH=$(OPENJDK_TARGET_CPU_LEGACY) +# Set the cpu architecture +ARCH=$(OPENJDK_TARGET_CPU_ARCH) # Legacy setting for building for a 64 bit machine. # If yes then this expands to _LP64:=1 @LP64@
--- a/common/autoconf/libraries.m4 Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/libraries.m4 Wed Jul 16 15:12:24 2014 -0700 @@ -65,8 +65,6 @@ ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - # If the java runtime framework is disabled, then we need X11. - # This will be adjusted below. AC_MSG_RESULT([alsa pulse x11]) fi @@ -83,20 +81,6 @@ if test "x$SUPPORT_HEADFUL" = xno; then X11_NOT_NEEDED=yes fi - - ############################################################################### - # - # Check for MacOSX support for OpenJDK. - # - - BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support) - - AC_MSG_CHECKING([for Mac OS X Java Framework]) - if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework]) - else - AC_MSG_RESULT([no]) - fi ]) AC_DEFUN_ONCE([LIB_SETUP_X11], @@ -620,11 +604,36 @@ # Check for the jpeg library # - USE_EXTERNAL_LIBJPEG=true - AC_CHECK_LIB(jpeg, main, [], - [ USE_EXTERNAL_LIBJPEG=false - AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) - ]) + AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg], + [use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) + + AC_MSG_CHECKING([for which libjpeg to use]) + + # default is bundled + DEFAULT_LIBJPEG=bundled + + # + # if user didn't specify, use DEFAULT_LIBJPEG + # + if test "x${with_libjpeg}" = "x"; then + with_libjpeg=${DEFAULT_LIBJPEG} + fi + + AC_MSG_RESULT(${with_libjpeg}) + + if test "x${with_libjpeg}" = "xbundled"; then + USE_EXTERNAL_LIBJPEG=false + elif test "x${with_libjpeg}" = "xsystem"; then + AC_CHECK_HEADER(jpeglib.h, [], + [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])]) + AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [], + [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])]) + + USE_EXTERNAL_LIBJPEG=true + else + AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled']) + fi + AC_SUBST(USE_EXTERNAL_LIBJPEG) ###############################################################################
--- a/common/autoconf/platform.m4 Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/platform.m4 Wed Jul 16 15:12:24 2014 -0700 @@ -84,7 +84,7 @@ VAR_CPU_BITS=32 VAR_CPU_ENDIAN=big ;; - sparcv9) + sparcv9|sparc64) VAR_CPU=sparcv9 VAR_CPU_ARCH=sparc VAR_CPU_BITS=64
--- a/common/autoconf/spec.gmk.in Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/spec.gmk.in Wed Jul 16 15:12:24 2014 -0700 @@ -347,6 +347,9 @@ # The linker can be gcc or ld on posix systems, or link.exe on windows systems. LD:=@FIXPATH@ @LD@ +# Xcode SDK path +SDKROOT:=@SDKROOT@ + # The linker on older SuSE distros (e.g. on SLES 10) complains with: # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." # if feeded with a version script which contains named tags. @@ -544,7 +547,7 @@ XATTR:=@XATTR@ JT_HOME:=@JT_HOME@ JTREGEXE:=@JTREGEXE@ - +XCODEBUILD=@XCODEBUILD@ FIXPATH:=@FIXPATH@ # Where the build output is stored for your convenience.
--- a/common/autoconf/toolchain.m4 Wed Jul 16 16:02:51 2014 +0400 +++ b/common/autoconf/toolchain.m4 Wed Jul 16 15:12:24 2014 -0700 @@ -98,20 +98,27 @@ VALID_TOOLCHAINS=${!toolchain_var_name} if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On Mac OS X, default toolchain to clang after Xcode 5 - XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1` - $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null - if test $? -ne 0; then - AC_MSG_ERROR([Failed to determine Xcode version.]) - fi - XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ - $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \ - $CUT -f 1 -d .` - AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION]) - if test $XCODE_MAJOR_VERSION -ge 5; then - DEFAULT_TOOLCHAIN="clang" + if test -n "$XCODEBUILD"; then + # On Mac OS X, default toolchain to clang after Xcode 5 + XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1` + $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null + if test $? -ne 0; then + AC_MSG_ERROR([Failed to determine Xcode version.]) + fi + XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ + $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \ + $CUT -f 1 -d .` + AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION]) + if test $XCODE_MAJOR_VERSION -ge 5; then + DEFAULT_TOOLCHAIN="clang" + else + DEFAULT_TOOLCHAIN="gcc" + fi else - DEFAULT_TOOLCHAIN="gcc" + # If Xcode is not installed, but the command line tools are + # then we can't run xcodebuild. On these systems we should + # default to clang + DEFAULT_TOOLCHAIN="clang" fi else # First toolchain type in the list is the default
--- a/corba/.hgtags Wed Jul 16 16:02:51 2014 +0400 +++ b/corba/.hgtags Wed Jul 16 15:12:24 2014 -0700 @@ -263,3 +263,5 @@ 77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18 eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19 87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20 +3615a4e7f0542ca7552ad6454b742c73ee211d8e jdk9-b21 +ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java Wed Jul 16 16:02:51 2014 +0400 +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,8 @@ import java.io.OutputStream; import java.io.ObjectOutputStream; import java.io.ObjectOutput; -import java.util.Hashtable; +import java.util.Map; +import java.util.HashMap; import org.omg.CORBA.INTERNAL; @@ -49,7 +50,7 @@ */ private class HookPutFields extends ObjectOutputStream.PutField { - private Hashtable fields = new Hashtable(); + private Map<String,Object> fields = new HashMap<>(); /** * Put the value of the named boolean field into the persistent field. @@ -140,7 +141,6 @@ public OutputStreamHook() throws java.io.IOException { super(); - } public void defaultWriteObject() throws IOException {
--- a/get_source.sh Wed Jul 16 16:02:51 2014 +0400 +++ b/get_source.sh Wed Jul 16 15:12:24 2014 -0700 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,76 @@ # questions. # -# Get clones of all nested repositories -sh ./common/bin/hgforest.sh clone "$@" || exit 1 +to_stderr() { + echo "$@" >&2 +} + +error() { + to_stderr "ERROR: $1" + exit ${2:-126} +} + +warning() { + to_stderr "WARNING: $1" +} + +version_field() { + # rev is typically omitted for minor and major releases + field=`echo ${1}.0 | cut -f ${2} -d .` + if expr 1 + $field >/dev/null 2> /dev/null; then + echo $field + else + echo -1 + fi +} + +# Version check + +# required +reqdmajor=1 +reqdminor=4 +reqdrev=0 + +# requested +rqstmajor=2 +rqstminor=6 +rqstrev=3 + + +# installed +hgwhere="`command -v hg`" +if [ "x$hgwhere" = "x" ]; then + error "Could not locate Mercurial command" +fi + +hgversion="`hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`" +if [ "x${hgversion}" = "x" ] ; then + error "Could not determine Mercurial version of $hgwhere" +fi + +hgmajor="`version_field $hgversion 1`" +hgminor="`version_field $hgversion 2`" +hgrev="`version_field $hgversion 3`" + +if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then + error "Could not determine Mercurial version of $hgwhere from \"$hgversion\"" +fi + + +# Require +if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then + error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion" +fi + + +# Request +if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then + warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion" +fi + + +# Get clones of all absent nested repositories (harmless if already exist) +sh ./common/bin/hgforest.sh clone "$@" || exit $? # Update all existing repositories to the latest sources sh ./common/bin/hgforest.sh pull -u -
--- a/hotspot/.hgtags Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/.hgtags Wed Jul 16 15:12:24 2014 -0700 @@ -423,3 +423,5 @@ 871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18 d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19 c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20 +17b4a5e831b398738feedb0afe75245744510153 jdk9-b21 +518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22
--- a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ #import <Foundation/Foundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h> -#include <JavaVM/jni.h> +#include <jni.h> #import <mach/mach.h> #import <mach/mach_types.h>
--- a/hotspot/agent/src/os/bsd/Makefile Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/os/bsd/Makefile Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -50,9 +50,9 @@ ps_core.c OBJS = $(SOURCES:.c=.o) OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS) -EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I. +EXTINCLUDE = -I. EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation -FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation +FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation LIBSA = $(ARCH)/libsaproc.dylib endif # Darwin
--- a/hotspot/agent/src/os/linux/libproc.h Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/os/linux/libproc.h Wed Jul 16 15:12:24 2014 -0700 @@ -34,7 +34,7 @@ #include "libproc_md.h" #endif -#include <linux/ptrace.h> +#include <sys/ptrace.h> /************************************************************************************
--- a/hotspot/agent/src/os/linux/ps_proc.c Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/os/linux/ps_proc.c Wed Jul 16 15:12:24 2014 -0700 @@ -263,7 +263,7 @@ static bool read_lib_info(struct ps_prochandle* ph) { char fname[32]; - char buf[256]; + char buf[PATH_MAX]; FILE *fp = NULL; sprintf(fname, "/proc/%d/maps", ph->pid); @@ -273,10 +273,41 @@ return false; } - while(fgets_no_cr(buf, 256, fp)){ - char * word[6]; - int nwords = split_n_str(buf, 6, word, ' ', '\0'); - if (nwords > 5 && find_lib(ph, word[5]) == false) { + while(fgets_no_cr(buf, PATH_MAX, fp)){ + char * word[7]; + int nwords = split_n_str(buf, 7, word, ' ', '\0'); + + if (nwords < 6) { + // not a shared library entry. ignore. + continue; + } + + // SA does not handle the lines with patterns: + // "[stack]", "[heap]", "[vdso]", "[vsyscall]", etc. + if (word[5][0] == '[') { + // not a shared library entry. ignore. + continue; + } + + if (nwords > 6) { + // prelink altered mapfile when the program is running. + // Entries like one below have to be skipped + // /lib64/libc-2.15.so (deleted) + // SO name in entries like one below have to be stripped. + // /lib64/libpthread-2.15.so.#prelink#.EECVts + char *s = strstr(word[5],".#prelink#"); + if (s == NULL) { + // No prelink keyword. skip deleted library + print_debug("skip shared object %s deleted by prelink\n", word[5]); + continue; + } + + // Fall through + print_debug("rectifying shared object name %s changed by prelink\n", word[5]); + *s = 0; + } + + if (find_lib(ph, word[5]) == false) { intptr_t base; lib_info* lib; #ifdef _LP64
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/G1YCType.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_interface; + +//These definitions should be kept in sync with the definitions in the HotSpot +//code. + +public enum G1YCType { + Normal ("Normal"), + InitialMark ("Initial Mark"), + DuringMark ("During Mark"), + Mixed ("Mixed"), + G1YCTypeEndSentinel ("Unknown"); + + private final String value; + + G1YCType(String val) { + this.value = val; + } + public String value() { + return value; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCCause.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_interface; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum GCCause { + _java_lang_system_gc ("System.gc()"), + _full_gc_alot ("FullGCAlot"), + _scavenge_alot ("ScavengeAlot"), + _allocation_profiler ("Allocation Profiler"), + _jvmti_force_gc ("JvmtiEnv ForceGarbageCollection"), + _gc_locker ("GCLocker Initiated GC"), + _heap_inspection ("Heap Inspection Initiated GC"), + _heap_dump ("Heap Dump Initiated GC"), + + _no_gc ("No GC"), + _no_cause_specified ("Unknown GCCause"), + _allocation_failure ("Allocation Failure"), + + _tenured_generation_full ("Tenured Generation Full"), + _metadata_GC_threshold ("Metadata GC Threshold"), + + _cms_generation_full ("CMS Generation Full"), + _cms_initial_mark ("CMS Initial Mark"), + _cms_final_remark ("CMS Final Remark"), + _cms_concurrent_mark ("CMS Concurrent Mark"), + + _old_generation_expanded_on_last_scavenge ("Old Generation Expanded On Last Scavenge"), + _old_generation_too_full_to_scavenge ("Old Generation Too Full To Scavenge"), + _adaptive_size_policy ("Ergonomics"), + + _g1_inc_collection_pause ("G1 Evacuation Pause"), + _g1_humongous_allocation ("G1 Humongous Allocation"), + + _last_ditch_collection ("Last ditch collection"), + _last_gc_cause ("ILLEGAL VALUE - last gc cause - ILLEGAL VALUE"); + + private final String value; + + GCCause(String val) { + this.value = val; + } + public String value() { + return value; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCName.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_interface; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum GCName { + ParallelOld ("ParallelOld"), + SerialOld ("SerialOld"), + PSMarkSweep ("PSMarkSweep"), + ParallelScavenge ("ParallelScavenge"), + DefNew ("DefNew"), + ParNew ("ParNew"), + G1New ("G1New"), + ConcurrentMarkSweep ("ConcurrentMarkSweep"), + G1Old ("G1Old"), + GCNameEndSentinel ("GCNameEndSentinel"); + + private final String value; + + GCName(String val) { + this.value = val; + } + public String value() { + return value; + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/GCWhen.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_interface; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum GCWhen { + BeforeGC ("Before GC"), + AfterGC ("After GC"), + GCWhenEndSentinel ("GCWhenEndSentinel"); + + private final String value; + + GCWhen(String val) { + this.value = val; + } + public String value() { + return value; + } +} + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_interface/ReferenceType.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.gc_interface; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum ReferenceType { + REF_NONE ("None reference"), // Regular class + REF_OTHER ("Other reference"), // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below + REF_SOFT ("Soft reference"), // Subclass of java/lang/ref/SoftReference + REF_WEAK ("Weak reference"), // Subclass of java/lang/ref/WeakReference + REF_FINAL ("Final reference"), // Subclass of java/lang/ref/FinalReference + REF_PHANTOM ("Phantom reference"); // Subclass of java/lang/ref/PhantomReference + + private final String value; + + ReferenceType(String val) { + this.value = val; + } + public String value() { + return value; + } +}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Wed Jul 16 15:12:24 2014 -0700 @@ -56,6 +56,12 @@ private static AddressField narrowKlassBaseField; private static CIntegerField narrowKlassShiftField; + public enum NARROW_OOP_MODE { + UnscaledNarrowOop, + ZeroBasedNarrowOop, + HeapBasedNarrowOop + } + static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { @@ -94,7 +100,17 @@ public Universe() { } - + public static String narrowOopModeToString(NARROW_OOP_MODE mode) { + switch (mode) { + case UnscaledNarrowOop: + return "32-bits Oops"; + case ZeroBasedNarrowOop: + return "zero based Compressed Oops"; + case HeapBasedNarrowOop: + return "Compressed Oops with base"; + } + return ""; + } public CollectedHeap heap() { try { return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Wed Jul 16 15:12:24 2014 -0700 @@ -55,6 +55,7 @@ layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0); name = type.getAddressField("_name"); accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); + traceIDField = type.getField("_trace_id"); subklass = new MetadataField(type.getAddressField("_subklass"), 0); nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0); @@ -86,6 +87,7 @@ private static CIntField accessFlags; private static MetadataField subklass; private static MetadataField nextSibling; + private static sun.jvm.hotspot.types.Field traceIDField; private Address getValue(AddressField field) { return addr.getAddressAt(field.getOffset()); @@ -106,6 +108,7 @@ public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); } public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); } public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); } + public long traceID() { return traceIDField.getJLong(addr); } // computed access flags - takes care of inner classes etc. // This is closer to actual source level than getAccessFlags() etc.
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java Wed Jul 16 15:12:24 2014 -0700 @@ -54,6 +54,8 @@ private static OopField threadNameField; private static OopField threadGroupField; private static LongField threadEETopField; + //tid field is new since 1.5 + private static LongField threadTIDField; // threadStatus field is new since 1.5 private static IntField threadStatusField; // parkBlocker field is new since 1.6 @@ -220,6 +222,7 @@ threadNameField = (OopField) k.findField("name", "[C"); threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;"); threadEETopField = (LongField) k.findField("eetop", "J"); + threadTIDField = (LongField) k.findField("tid", "J"); threadStatusField = (IntField) k.findField("threadStatus", "I"); threadParkBlockerField = (OopField) k.findField("parkBlocker", "Ljava/lang/Object;"); @@ -268,6 +271,15 @@ return VM.getVM().getThreads().createJavaThreadWrapper(addr); } + public static long threadOopGetTID(Oop threadOop) { + initThreadFields(); + if (threadTIDField != null) { + return threadTIDField.getValue(threadOop); + } else { + return 0; + } + } + /** returns value of java.lang.Thread.threadStatus field */ public static int threadOopGetThreadStatus(Oop threadOop) { initThreadFields();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.opto; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum CompilerPhaseType { + PHASE_BEFORE_STRINGOPTS ("Before StringOpts"), + PHASE_AFTER_STRINGOPTS ("After StringOpts"), + PHASE_BEFORE_REMOVEUSELESS ("Before RemoveUseless"), + PHASE_AFTER_PARSING ("After Parsing"), + PHASE_ITER_GVN1 ("Iter GVN 1"), + PHASE_PHASEIDEAL_BEFORE_EA ("PhaseIdealLoop before EA"), + PHASE_ITER_GVN_AFTER_EA ("Iter GVN after EA"), + PHASE_ITER_GVN_AFTER_ELIMINATION ("Iter GVN after eliminating allocations and locks"), + PHASE_PHASEIDEALLOOP1 ("PhaseIdealLoop 1"), + PHASE_PHASEIDEALLOOP2 ("PhaseIdealLoop 2"), + PHASE_PHASEIDEALLOOP3 ("PhaseIdealLoop 3"), + PHASE_CPP1 ("PhaseCPP 1"), + PHASE_ITER_GVN2 ("Iter GVN 2"), + PHASE_PHASEIDEALLOOP_ITERATIONS ("PhaseIdealLoop iterations"), + PHASE_OPTIMIZE_FINISHED ("Optimize finished"), + PHASE_GLOBAL_CODE_MOTION ("Global code motion"), + PHASE_FINAL_CODE ("Final Code"), + PHASE_AFTER_EA ("After Escape Analysis"), + PHASE_BEFORE_CLOOPS ("Before CountedLoop"), + PHASE_AFTER_CLOOPS ("After CountedLoop"), + PHASE_BEFORE_BEAUTIFY_LOOPS ("Before beautify loops"), + PHASE_AFTER_BEAUTIFY_LOOPS ("After beautify loops"), + PHASE_BEFORE_MATCHING ("Before Matching"), + PHASE_INCREMENTAL_INLINE ("Incremental Inline"), + PHASE_INCREMENTAL_BOXING_INLINE ("Incremental Boxing Inline"), + PHASE_END ("End"), + PHASE_FAILURE ("Failure"), + PHASE_NUM_TYPES ("Number of Phase Types"); + + private final String value; + + CompilerPhaseType(String val) { + this.value = val; + } + public String value() { + return value; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.runtime; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum Flags { + // value origin + DEFAULT ("Default"), + COMMAND_LINE ("Command line"), + ENVIRON_VAR ("Environment variable"), + CONFIG_FILE ("Config file"), + MANAGEMENT ("Management"), + ERGONOMIC ("Ergonomic"), + ATTACH_ON_DEMAND ("Attach on demand"), + INTERNAL ("Internal"); + + private final String value; + + Flags(String val) { + this.value = val; + } + public String value() { + return value; + } +}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java Wed Jul 16 15:12:24 2014 -0700 @@ -41,6 +41,8 @@ private static AddressField currentPendingMonitorField; private static AddressField currentWaitingMonitorField; + private static JLongField allocatedBytesField; + static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { @@ -61,6 +63,7 @@ activeHandlesField = type.getAddressField("_active_handles"); currentPendingMonitorField = type.getAddressField("_current_pending_monitor"); currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor"); + allocatedBytesField = type.getJLongField("_allocated_bytes"); } public Thread(Address addr) { @@ -104,6 +107,10 @@ return new JNIHandleBlock(a); } + public long allocatedBytes() { + return allocatedBytesField.getValue(addr); + } + public boolean isVMThread() { return false; } public boolean isJavaThread() { return false; } public boolean isCompilerThread() { return false; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java Wed Jul 16 15:12:24 2014 -0700 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.runtime; + +//These definitions should be kept in sync with the definitions in the HotSpot code. + +public enum VMOps { + Dummy, + ThreadStop, + ThreadDump, + PrintThreads, + FindDeadlocks, + ForceSafepoint, + ForceAsyncSafepoint, + Deoptimize, + DeoptimizeFrame, + DeoptimizeAll, + ZombieAll, + UnlinkSymbols, + Verify, + PrintJNI, + HeapDumper, + DeoptimizeTheWorld, + CollectForMetadataAllocation, + GC_HeapInspection, + GenCollectFull, + GenCollectFullConcurrent, + GenCollectForAllocation, + ParallelGCFailedAllocation, + ParallelGCSystemGC, + CGC_Operation, + CMS_Initial_Mark, + CMS_Final_Remark, + G1CollectFull, + G1CollectForAllocation, + G1IncCollectionPause, + EnableBiasedLocking, + RevokeBias, + BulkRevokeBias, + PopulateDumpSharedSpace, + JNIFunctionTableCopier, + RedefineClasses, + GetOwnedMonitorInfo, + GetObjectMonitorUsage, + GetCurrentContendedMonitor, + GetStackTrace, + GetMultipleStackTraces, + GetAllStackTraces, + GetThreadListStackTraces, + GetFrameCount, + GetFrameLocation, + ChangeBreakpoints, + GetOrSetLocal, + GetCurrentLocation, + EnterInterpOnlyMode, + ChangeSingleStep, + HeapWalkOperation, + HeapIterateOperation, + ReportJavaOutOfMemory, + JFRCheckpoint, + Exit, + LinuxDllLoad, + Terminating +}
--- a/hotspot/make/aix/makefiles/vm.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/aix/makefiles/vm.make Wed Jul 16 15:12:24 2014 -0700 @@ -82,14 +82,12 @@ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ $(JDK_VER_DEFS) HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" -BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" CXXFLAGS = \ ${SYSDEFS} \ ${INCLUDES} \ - ${BUILD_TARGET} \ ${BUILD_USER} \ ${HS_LIB_ARCH} \ ${VM_DISTRO}
--- a/hotspot/make/bsd/makefiles/gcc.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/bsd/makefiles/gcc.make Wed Jul 16 15:12:24 2014 -0700 @@ -280,7 +280,10 @@ # optimization control flags (Used by fastdebug and release variants) OPT_CFLAGS/NOOPT=-O0 -ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" +ifeq ($(USE_CLANG), true) + # Clang does not support -Og + OPT_CFLAGS/DEBUG=-O0 +else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination) OPT_CFLAGS/DEBUG=-Og else @@ -319,9 +322,20 @@ # Work around some compiler bugs. ifeq ($(USE_CLANG), true) + # Clang 4.2 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 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 + else + $(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)") endif else # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. @@ -443,7 +457,10 @@ CFLAGS += -flimit-debug-info endif -ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" +ifeq ($(USE_CLANG), true) + # Clang does not support -Og + DEBUG_CFLAGS=-O0 +else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination) DEBUG_CFLAGS=-Og else
--- a/hotspot/make/bsd/makefiles/saproc.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/bsd/makefiles/saproc.make Wed Jul 16 15:12:24 2014 -0700 @@ -64,9 +64,23 @@ else ifeq ($(OS_VENDOR), Darwin) SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES) - SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation + SALIBS = -g \ + -framework Foundation \ + -framework JavaNativeFoundation \ + -framework Security \ + -framework CoreFoundation #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles? SAARCH = $(subst -march=i586,,$(ARCHFLAG)) + + # This is needed to locate JavaNativeFoundation.framework + ifeq ($(SYSROOT_CFLAGS),) + # this will happen when building without spec.gmk, set SDKROOT to a valid SDK + # path if your system does not have headers installed in the system frameworks + SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks" + else + # Just use SYSROOT_CFLAGS + SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS) + endif else SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c SALIBS = @@ -100,14 +114,8 @@ endif SA_LFLAGS += $(LDFLAGS_HASH_STYLE) -ifeq ($(OS_VENDOR), Darwin) - BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \ - -I/System/Library/Frameworks/JavaVM.framework/Headers -else - BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") -endif +BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ + -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ @@ -116,6 +124,7 @@ fi @echo Making SA debugger back-end... $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ + $(SA_SYSROOT_FLAGS) \ $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \ -I$(SASRCDIR) \ -I$(GENERATED) \
--- a/hotspot/make/bsd/makefiles/vm.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/bsd/makefiles/vm.make Wed Jul 16 15:12:24 2014 -0700 @@ -81,14 +81,12 @@ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ $(JDK_VER_DEFS) HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" -BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" CXXFLAGS = \ ${SYSDEFS} \ ${INCLUDES} \ - ${BUILD_TARGET} \ ${BUILD_USER} \ ${HS_LIB_ARCH} \ ${VM_DISTRO} @@ -295,6 +293,7 @@ $(PRECOMPILED_HEADER): $(QUIETLY) echo Generating precompiled header $@ $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR) + $(QUIETLY) rm -f $@ $(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE) # making the library:
--- a/hotspot/make/defs.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/defs.make Wed Jul 16 15:12:24 2014 -0700 @@ -135,8 +135,12 @@ ifeq ($(JDK_MKTG_VERSION),) JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) endif -ifeq ($(JDK_VERSION),) - JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) +ifeq ($(JDK_VERSION),) + ifeq ($(BUILD_FLAVOR), product) + JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) + else + JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)-$(BUILD_FLAVOR) + endif endif ifeq ($(FULL_VERSION),) FULL_VERSION="$(JDK_VERSION)"
--- a/hotspot/make/linux/makefiles/defs.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/linux/makefiles/defs.make Wed Jul 16 15:12:24 2014 -0700 @@ -69,7 +69,7 @@ endif # sparc -ifeq ($(ARCH), sparc64) +ifneq (,$(findstring $(ARCH), sparc)) ifeq ($(ARCH_DATA_MODEL), 64) ARCH_DATA_MODEL = 64 MAKE_ARGS += LP64=1 @@ -83,30 +83,20 @@ HS_ARCH = sparc endif -# amd64/x86_64 -ifneq (,$(findstring $(ARCH), amd64 x86_64)) +# i686/i586 and amd64/x86_64 +ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586)) ifeq ($(ARCH_DATA_MODEL), 64) ARCH_DATA_MODEL = 64 MAKE_ARGS += LP64=1 PLATFORM = linux-amd64 VM_PLATFORM = linux_amd64 - HS_ARCH = x86 else ARCH_DATA_MODEL = 32 PLATFORM = linux-i586 VM_PLATFORM = linux_i486 - HS_ARCH = x86 - # We have to reset ARCH to i686 since SRCARCH relies on it - ARCH = i686 endif -endif -# i686/i586 ie 32-bit x86 -ifneq (,$(findstring $(ARCH), i686 i586)) - ARCH_DATA_MODEL = 32 - PLATFORM = linux-i586 - VM_PLATFORM = linux_i486 - HS_ARCH = x86 + HS_ARCH = x86 endif # ARM @@ -118,20 +108,18 @@ endif # PPC -ifeq ($(ARCH), ppc) - ARCH_DATA_MODEL = 32 - PLATFORM = linux-ppc - VM_PLATFORM = linux_ppc - HS_ARCH = ppc -endif +ifneq (,$(findstring $(ARCH), ppc)) + ifeq ($(ARCH_DATA_MODEL), 64) + MAKE_ARGS += LP64=1 + PLATFORM = linux-ppc64 + VM_PLATFORM = linux_ppc64 + else + ARCH_DATA_MODEL = 32 + PLATFORM = linux-ppc + VM_PLATFORM = linux_ppc + endif -# PPC64 -ifeq ($(ARCH), ppc64) - ARCH_DATA_MODEL = 64 - MAKE_ARGS += LP64=1 - PLATFORM = linux-ppc64 - VM_PLATFORM = linux_ppc64 - HS_ARCH = ppc + HS_ARCH = ppc endif # On 32 bit linux we build server and client, on 64 bit just server.
--- a/hotspot/make/linux/makefiles/vm.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/linux/makefiles/vm.make Wed Jul 16 15:12:24 2014 -0700 @@ -82,14 +82,12 @@ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ $(JDK_VER_DEFS) HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" -BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" CXXFLAGS = \ ${SYSDEFS} \ ${INCLUDES} \ - ${BUILD_TARGET} \ ${BUILD_USER} \ ${HS_LIB_ARCH} \ ${VM_DISTRO} @@ -290,6 +288,7 @@ $(PRECOMPILED_HEADER): $(QUIETLY) echo Generating precompiled header $@ $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR) + $(QUIETLY) rm -f $@ $(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE) # making the library:
--- a/hotspot/make/solaris/makefiles/sa.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/solaris/makefiles/sa.make Wed Jul 16 15:12:24 2014 -0700 @@ -29,8 +29,12 @@ # and generate JNI header file for native methods. include $(GAMMADIR)/make/solaris/makefiles/rules.make +include $(GAMMADIR)/make/defs.make AGENT_DIR = $(GAMMADIR)/agent include $(GAMMADIR)/make/sa.files + +-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make + GENERATED = ../generated # tools.jar is needed by the JDI - SA binding
--- a/hotspot/make/solaris/makefiles/vm.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/solaris/makefiles/vm.make Wed Jul 16 15:12:24 2014 -0700 @@ -77,14 +77,12 @@ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ $(JDK_VER_DEFS) HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" -BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" CXXFLAGS = \ ${SYSDEFS} \ ${INCLUDES} \ - ${BUILD_TARGET} \ ${BUILD_USER} \ ${HS_LIB_ARCH} \ ${VM_DISTRO}
--- a/hotspot/make/windows/create.bat Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/create.bat Wed Jul 16 15:12:24 2014 -0700 @@ -1,6 +1,6 @@ @echo off REM -REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. +REM Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it @@ -81,33 +81,8 @@ for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i echo ************************************************************** -set ProjectFile=%HotSpotBuildSpace%\jvm.vcproj echo MSC_VER = "%MSC_VER%" -if "%MSC_VER%" == "1200" ( -set ProjectFile=%HotSpotBuildSpace%\jvm.dsp -echo Will generate VC6 project {unsupported} -) else ( -if "%MSC_VER%" == "1400" ( -echo Will generate VC8 {Visual Studio 2005} -) else ( -if "%MSC_VER%" == "1500" ( -echo Will generate VC9 {Visual Studio 2008} -) else ( -if "%MSC_VER%" == "1600" ( -echo Will generate VC10 {Visual Studio 2010} set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj -) else ( -if "%MSC_VER%" == "1700" ( -echo Will generate VC10 {compatible with Visual Studio 2012} -echo After opening in VS 2012, click "Update" when prompted. -set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj -) else ( -echo Will generate VC7 project {Visual Studio 2003 .NET} -) -) -) -) -) echo %ProjectFile% echo **************************************************************
--- a/hotspot/make/windows/makefiles/compile.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/makefiles/compile.make Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,28 +63,20 @@ # Based on BUILDARCH we add some flags and select the default compiler name !if "$(BUILDARCH)" == "ia64" MACHINE=IA64 -DEFAULT_COMPILER_NAME=VS2003 CXX_FLAGS=$(CXX_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64" !endif !if "$(BUILDARCH)" == "amd64" MACHINE=AMD64 -DEFAULT_COMPILER_NAME=VS2005 CXX_FLAGS=$(CXX_FLAGS) /D "_LP64" /D "AMD64" LP64=1 !endif !if "$(BUILDARCH)" == "i486" MACHINE=I386 -DEFAULT_COMPILER_NAME=VS2003 CXX_FLAGS=$(CXX_FLAGS) /D "IA32" !endif -# Sanity check, this is the default if not amd64, ia64, or i486 -!ifndef DEFAULT_COMPILER_NAME -CXX=ARCH_ERROR -!endif - CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS" # Must specify this for sharedRuntimeTrig.cpp CXX_FLAGS=$(CXX_FLAGS) /D "VM_LITTLE_ENDIAN" @@ -112,6 +104,7 @@ # 1500 is for VS2008 # 1600 is for VS2010 # 1700 is for VS2012 +# 1800 is for VS2013 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400. # Normally they are the same, but a pre-release of the VS2005 compilers @@ -119,35 +112,6 @@ # closer to VS2003 in terms of option spellings, so we use 1399 for that # 1400 version that really isn't 1400. # See the file get_msc_ver.sh for more info. -!if "x$(MSC_VER)" == "x" -COMPILER_NAME=$(DEFAULT_COMPILER_NAME) -!else -!if "$(MSC_VER)" == "1200" -COMPILER_NAME=VC6 -!endif -!if "$(MSC_VER)" == "1300" -COMPILER_NAME=VS2003 -!endif -!if "$(MSC_VER)" == "1310" -COMPILER_NAME=VS2003 -!endif -!if "$(MSC_VER)" == "1399" -# Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005 -COMPILER_NAME=VS2003 -!endif -!if "$(MSC_VER)" == "1400" -COMPILER_NAME=VS2005 -!endif -!if "$(MSC_VER)" == "1500" -COMPILER_NAME=VS2008 -!endif -!if "$(MSC_VER)" == "1600" -COMPILER_NAME=VS2010 -!endif -!if "$(MSC_VER)" == "1700" -COMPILER_NAME=VS2012 -!endif -!endif # By default, we do not want to use the debug version of the msvcrt.dll file # but if MFC_DEBUG is defined in the environment it will be used. @@ -165,60 +129,6 @@ !endif CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION) -# How /GX option is spelled -GX_OPTION = /GX - -# Optimization settings for various versions of the compilers and types of -# builds. Three basic sets of settings: product, fastdebug, and debug. -# These get added into CXX_FLAGS as needed by other makefiles. -!if "$(COMPILER_NAME)" == "VC6" -PRODUCT_OPT_OPTION = /Ox /Os /Gy /GF -FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF -DEBUG_OPT_OPTION = /Od -!endif - -!if "$(COMPILER_NAME)" == "VS2003" -PRODUCT_OPT_OPTION = /O2 /Oy- -FASTDEBUG_OPT_OPTION = /O2 /Oy- -DEBUG_OPT_OPTION = /Od -SAFESEH_FLAG = /SAFESEH -!endif - -!if "$(COMPILER_NAME)" == "VS2005" -PRODUCT_OPT_OPTION = /O2 /Oy- -FASTDEBUG_OPT_OPTION = /O2 /Oy- -DEBUG_OPT_OPTION = /Od -GX_OPTION = /EHsc -# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib -# on the link command line, otherwise we get missing __security_check_cookie -# externals at link time. Even with /GS-, you need bufferoverflowU.lib. -# NOTE: Currently we decided to not use /GS- -BUFFEROVERFLOWLIB = bufferoverflowU.lib -LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB) -# Manifest Tool - used in VS2005 and later to adjust manifests stored -# as resources inside build artifacts. -!if "x$(MT)" == "x" -MT=mt.exe -!endif -SAFESEH_FLAG = /SAFESEH -!endif - -!if "$(COMPILER_NAME)" == "VS2008" -PRODUCT_OPT_OPTION = /O2 /Oy- -FASTDEBUG_OPT_OPTION = /O2 /Oy- -DEBUG_OPT_OPTION = /Od -GX_OPTION = /EHsc -LD_FLAGS = /manifest $(LD_FLAGS) -MP_FLAG = /MP -# Manifest Tool - used in VS2005 and later to adjust manifests stored -# as resources inside build artifacts. -!if "x$(MT)" == "x" -MT=mt.exe -!endif -SAFESEH_FLAG = /SAFESEH -!endif - -!if "$(COMPILER_NAME)" == "VS2010" PRODUCT_OPT_OPTION = /O2 /Oy- FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od @@ -233,26 +143,6 @@ !if "$(BUILDARCH)" == "i486" LD_FLAGS = /SAFESEH $(LD_FLAGS) !endif -!endif - -!if "$(COMPILER_NAME)" == "VS2012" -PRODUCT_OPT_OPTION = /O2 /Oy- -FASTDEBUG_OPT_OPTION = /O2 /Oy- -DEBUG_OPT_OPTION = /Od -GX_OPTION = /EHsc -LD_FLAGS = /manifest $(LD_FLAGS) -MP_FLAG = /MP -# Manifest Tool - used in VS2005 and later to adjust manifests stored -# as resources inside build artifacts. -!if "x$(MT)" == "x" -MT=mt.exe -!endif -SAFESEH_FLAG = /SAFESEH -!endif - -!if "$(BUILDARCH)" == "i486" -LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS) -!endif CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)
--- a/hotspot/make/windows/makefiles/rules.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/makefiles/rules.make Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -49,35 +49,8 @@ JAVAC_FLAGS=-g -encoding ascii BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) -ProjectFile=jvm.vcproj - -!if "$(MSC_VER)" == "1200" - -VcVersion=VC6 -ProjectFile=jvm.dsp - -!elseif "$(MSC_VER)" == "1400" - -VcVersion=VC8 - -!elseif "$(MSC_VER)" == "1500" - -VcVersion=VC9 - -!elseif "$(MSC_VER)" == "1600" - +# VS2012 and VS2013 loads VS10 projects just fine (and will +# upgrade them automatically to VS2012 format). VcVersion=VC10 ProjectFile=jvm.vcxproj -!elseif "$(MSC_VER)" == "1700" -# This is VS2012, but it loads VS10 projects just fine (and will -# upgrade them automatically to VS2012 format). - -VcVersion=VC10 -ProjectFile=jvm.vcxproj - -!else - -VcVersion=VC7 - -!endif
--- a/hotspot/make/windows/makefiles/sa.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/makefiles/sa.make Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,22 @@ GENERATED = ../generated +HS_COMMON_SRC_REL = src + +!if "$(OPENJDK)" != "true" +HS_ALT_SRC_REL=src/closed +HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL) +!ifndef HS_ALT_MAKE +HS_ALT_MAKE=$(WorkSpace)/make/closed +!endif +!endif + +HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL) + +!ifdef HS_ALT_MAKE +!include $(HS_ALT_MAKE)/windows/makefiles/sa.make +!endif + # tools.jar is needed by the JDI - SA binding SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar @@ -85,14 +101,9 @@ # will be useful to have the assertion checks in place !if "$(BUILDARCH)" == "ia64" -SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c +SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c !elseif "$(BUILDARCH)" == "amd64" -SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c -!if "$(COMPILER_NAME)" == "VS2005" -# On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line, -# otherwise we get missing __security_check_cookie externals at link time. -SA_LD_FLAGS = bufferoverflowU.lib -!endif +SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c !else SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
--- a/hotspot/make/windows/makefiles/sanity.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/makefiles/sanity.make Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,9 @@ all: checkCL checkLink checkCL: - @ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" \ - echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)). Use FORCE_MSC_VER to override automatic detection. + @ if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" if "$(MSC_VER)" NEQ "1800" \ + echo *** WARNING *** Unsupported cl.exe version detected: $(MSC_VER) ($(RAW_MSC_VER)), only 1600/1700/1800 (Visual Studio 2010/2012/2013) are supported. checkLink: - @ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" \ - echo *** WARNING *** unrecognized link.exe version $(LD_VER) ($(RAW_LD_VER)). Use FORCE_LD_VER to override automatic detection. + @ if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" if "$(LD_VER)" NEQ "1200" \ + echo *** WARNING *** Unsupported link.exe version detected: $(LD_VER) ($(RAW_LD_VER)), only 1000/1100/1200 (Visual Studio 2010/2012/2013) are supported.
--- a/hotspot/make/windows/makefiles/vm.make Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/makefiles/vm.make Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -132,7 +132,7 @@ !if "$(USE_PRECOMPILED_HEADER)" != "0" CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp" -!if "$(COMPILER_NAME)" == "VS2012" +!if "$(MSC_VER)" > "1600" # VS2012 requires this object file to be listed: LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj !endif
--- a/hotspot/make/windows/projectfiles/common/Makefile Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/make/windows/projectfiles/common/Makefile Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -116,11 +116,10 @@ JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\"" JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\"" -ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) +ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) -define VISUAL_STUDIO_BUILD=true ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions) $(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class - @if "$(MSC_VER)"=="1500" echo Make sure you have VS2008 SP1 or later, or you may see 'expanded command line too long' @$(RUN_JAVA) -Djava.class.path="$(HOTSPOTBUILDSPACE)/classes" ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions) clean:
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -693,7 +693,7 @@ // PPC 1, section 4.6.7 Floating-Point Compare Instructions fcmpu( CCR7, F24, F25); - tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end()); + tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end())); code()->decode(); }
--- a/hotspot/src/cpu/ppc/vm/bytecodes_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "interpreter/bytecodes.hpp" - -void Bytecodes::pd_initialize() { - // No ppc specific initialization. -}
--- a/hotspot/src/cpu/ppc/vm/bytecodes_ppc.hpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_PPC_VM_BYTECODES_PPC_HPP -#define CPU_PPC_VM_BYTECODES_PPC_HPP - -// No ppc64 specific bytecodes - -#endif // CPU_PPC_VM_BYTECODES_PPC_HPP
--- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,34 +50,6 @@ return is_icholder_entry(call->destination()); } -//----------------------------------------------------------------------------- -// High-level access to an inline cache. Guaranteed to be MT-safe. - -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) - : _ic_call(call) -{ - address ic_call = call->instruction_address(); - - assert(ic_call != NULL, "ic_call address must be set"); - assert(nm != NULL, "must pass nmethod"); - assert(nm->contains(ic_call), "must be in nmethod"); - - // Search for the ic_call at the given address. - RelocIterator iter(nm, ic_call, ic_call+1); - bool ret = iter.next(); - assert(ret == true, "relocInfo must exist at this address"); - assert(iter.addr() == ic_call, "must find ic_call"); - if (iter.type() == relocInfo::virtual_call_type) { - virtual_call_Relocation* r = iter.virtual_call_reloc(); - _is_optimized = false; - _value = nativeMovConstReg_at(r->cached_value()); - } else { - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); - _is_optimized = true; - _value = NULL; - } -} - // ---------------------------------------------------------------------------- // A PPC CompiledStaticCall looks like this: @@ -203,7 +175,7 @@ if (TraceICs) { ResourceMark rm; tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", - instruction_address(), + p2i(instruction_address()), callee->name_and_sig_as_C_string()); }
--- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -140,7 +140,7 @@ void frame::patch_pc(Thread* thread, address pc) { if (TracePcPatching) { tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]", - &((address*) _sp)[-1], ((address*) _sp)[-1], pc); + p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc)); } own_abi()->lr = (uint64_t)pc; _cb = CodeCache::find_blob(pc);
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -3099,7 +3099,7 @@ }; static void stop_on_request(int tp, const char* msg) { - tty->print("PPC assembly code requires stop: (%s) %s\n", (void *)stop_types[tp%/*stop_end*/4], msg); + tty->print("PPC assembly code requires stop: (%s) %s\n", stop_types[tp%/*stop_end*/4], msg); guarantee(false, err_msg("PPC assembly code requires stop: %s", msg)); }
--- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -464,7 +464,7 @@ 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, (intptr_t) mh, (intptr_t) entry_sp); if (Verbose) { tty->print_cr("Registers:");
--- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -147,9 +147,9 @@ address addr = addr_at(0); if (!NativeCall::is_call_at(addr)) { - tty->print_cr("not a NativeCall at " PTR_FORMAT, addr); + tty->print_cr("not a NativeCall at " PTR_FORMAT, p2i(addr)); // TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty); - fatal(err_msg("not a NativeCall at " PTR_FORMAT, addr)); + fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr))); } } #endif // ASSERT @@ -160,9 +160,9 @@ NativeInstruction::verify(); if (!NativeFarCall::is_far_call_at(addr)) { - tty->print_cr("not a NativeFarCall at " PTR_FORMAT, addr); + tty->print_cr("not a NativeFarCall at " PTR_FORMAT, p2i(addr)); // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty); - fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, addr)); + fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr))); } } #endif // ASSERT @@ -306,9 +306,9 @@ if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) && ! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) && ! MacroAssembler::is_bl(*((int*) addr))) { - tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, addr); + tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)); // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty); - fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, addr)); + fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr))); } } } @@ -344,9 +344,9 @@ NativeInstruction::verify(); if (!NativeJump::is_jump_at(addr)) { - tty->print_cr("not a NativeJump at " PTR_FORMAT, addr); + tty->print_cr("not a NativeJump at " PTR_FORMAT, p2i(addr)); // TODO: PPC port: Disassembler::decode(addr, 20, 20, tty); - fatal(err_msg("not a NativeJump at " PTR_FORMAT, addr)); + fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr))); } } #endif // ASSERT
--- a/hotspot/src/cpu/ppc/vm/ppc.ad Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/ppc.ad Wed Jul 16 15:12:24 2014 -0700 @@ -1329,7 +1329,7 @@ if (!false /* TODO: PPC port C->is_frameless_method()*/) { st->print("save return pc\n\t"); - st->print("push frame %d\n\t", -framesize); + st->print("push frame %ld\n\t", -framesize); } } #endif
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -352,7 +352,7 @@ if (PrintAssembly) { ttyLocker ttyl; - tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", code); + tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code)); Disassembler::decode((u_char*)code, (u_char*)code_end, tty); tty->print_cr("Time loop1 :%f", loop1_seconds); tty->print_cr("Time loop2 :%f", loop2_seconds); @@ -435,7 +435,7 @@ // Print the detection code. if (PrintAssembly) { ttyLocker ttyl; - tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", code); + tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code)); Disassembler::decode((u_char*)code, (u_char*)code_end, tty); } @@ -468,7 +468,7 @@ // Print the detection code. if (PrintAssembly) { ttyLocker ttyl; - tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", code); + tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code)); Disassembler::decode((u_char*)code, (u_char*)code_end, tty); }
--- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 "interpreter/bytecodes.hpp" - - -void Bytecodes::pd_initialize() { - // (nothing) -} - -Bytecodes::Code Bytecodes::pd_base_code_for(Code code) { - return code; -}
--- a/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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_SPARC_VM_BYTECODES_SPARC_HPP -#define CPU_SPARC_VM_BYTECODES_SPARC_HPP - -#ifdef SPARC -#define NLOCALS_IN_REGS 6 -#endif - - -// Sparc specific bytecodes - -// (none) - -#endif // CPU_SPARC_VM_BYTECODES_SPARC_HPP
--- a/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -50,34 +50,6 @@ return is_icholder_entry(call->destination()); } -//----------------------------------------------------------------------------- -// High-level access to an inline cache. Guaranteed to be MT-safe. - -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) - : _ic_call(call) -{ - address ic_call = call->instruction_address(); - - assert(ic_call != NULL, "ic_call address must be set"); - assert(nm != NULL, "must pass nmethod"); - assert(nm->contains(ic_call), "must be in nmethod"); - - // Search for the ic_call at the given address. - RelocIterator iter(nm, ic_call, ic_call+1); - bool ret = iter.next(); - assert(ret == true, "relocInfo must exist at this address"); - assert(iter.addr() == ic_call, "must find ic_call"); - if (iter.type() == relocInfo::virtual_call_type) { - virtual_call_Relocation* r = iter.virtual_call_reloc(); - _is_optimized = false; - _value = nativeMovConstReg_at(r->cached_value()); - } else { - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); - _is_optimized = true; - _value = NULL; - } -} - // ---------------------------------------------------------------------------- #define __ _masm.
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -436,32 +436,6 @@ } #endif // CC_INTERP - -#ifdef ASSERT -// Debugging aid -static frame nth_sender(int n) { - frame f = JavaThread::current()->last_frame(); - - for(int i = 0; i < n; ++i) - f = f.sender((RegisterMap*)NULL); - - printf("first frame %d\n", f.is_first_frame() ? 1 : 0); - printf("interpreted frame %d\n", f.is_interpreted_frame() ? 1 : 0); - printf("java frame %d\n", f.is_java_frame() ? 1 : 0); - printf("entry frame %d\n", f.is_entry_frame() ? 1 : 0); - printf("native frame %d\n", f.is_native_frame() ? 1 : 0); - if (f.is_compiled_frame()) { - if (f.is_deoptimized_frame()) - printf("deoptimized frame 1\n"); - else - printf("compiled frame 1\n"); - } - - return f; -} -#endif - - frame frame::sender_for_entry_frame(RegisterMap *map) const { assert(map != NULL, "map must be set"); // Java frame called from C; skip all C frames and return top C
--- a/hotspot/src/cpu/x86/vm/bytecodes_x86.cpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 "interpreter/bytecodes.hpp" - - -void Bytecodes::pd_initialize() { - // No i486 specific initialization -} - - -Bytecodes::Code Bytecodes::pd_base_code_for(Code code) { - // No i486 specific bytecodes - return code; -}
--- a/hotspot/src/cpu/x86/vm/bytecodes_x86.hpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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_BYTECODES_X86_HPP -#define CPU_X86_VM_BYTECODES_X86_HPP - -// No i486 specific bytecodes - -#endif // CPU_X86_VM_BYTECODES_X86_HPP
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -625,6 +625,7 @@ __ lea(rscratch1, polling_page); offset = __ offset(); add_debug_info_for_branch(info); + __ relocate(relocInfo::poll_type); __ testl(rax, Address(rscratch1, 0)); } else { add_debug_info_for_branch(info);
--- a/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -47,34 +47,6 @@ return is_icholder_entry(call->destination()); } -//----------------------------------------------------------------------------- -// High-level access to an inline cache. Guaranteed to be MT-safe. - -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) - : _ic_call(call) -{ - address ic_call = call->instruction_address(); - - assert(ic_call != NULL, "ic_call address must be set"); - assert(nm != NULL, "must pass nmethod"); - assert(nm->contains(ic_call), "must be in nmethod"); - - // Search for the ic_call at the given address. - RelocIterator iter(nm, ic_call, ic_call+1); - bool ret = iter.next(); - assert(ret == true, "relocInfo must exist at this address"); - assert(iter.addr() == ic_call, "must find ic_call"); - if (iter.type() == relocInfo::virtual_call_type) { - virtual_call_Relocation* r = iter.virtual_call_reloc(); - _is_optimized = false; - _value = nativeMovConstReg_at(r->cached_value()); - } else { - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); - _is_optimized = true; - _value = NULL; - } -} - // ---------------------------------------------------------------------------- #define __ _masm.
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -280,6 +280,8 @@ case T_BYTE : __ sign_extend_byte (rax); break; case T_SHORT : __ sign_extend_short(rax); break; case T_INT : /* nothing to do */ break; + case T_LONG : /* nothing to do */ break; + case T_VOID : /* nothing to do */ break; case T_DOUBLE : case T_FLOAT : { const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp();
--- a/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007 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 - * 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 "interpreter/bytecodes.hpp" - -void Bytecodes::pd_initialize() { - // No zero specific initialization -}
--- a/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp Wed Jul 16 16:02:51 2014 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 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 - * 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_ZERO_VM_BYTECODES_ZERO_HPP -#define CPU_ZERO_VM_BYTECODES_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP
--- a/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/zero/vm/compiledIC_zero.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -58,34 +58,6 @@ return is_icholder_entry(call->destination()); } -//----------------------------------------------------------------------------- -// High-level access to an inline cache. Guaranteed to be MT-safe. - -CompiledIC::CompiledIC(nmethod* nm, NativeCall* call) - : _ic_call(call) -{ - address ic_call = call->instruction_address(); - - assert(ic_call != NULL, "ic_call address must be set"); - assert(nm != NULL, "must pass nmethod"); - assert(nm->contains(ic_call), "must be in nmethod"); - - // Search for the ic_call at the given address. - RelocIterator iter(nm, ic_call, ic_call+1); - bool ret = iter.next(); - assert(ret == true, "relocInfo must exist at this address"); - assert(iter.addr() == ic_call, "must find ic_call"); - if (iter.type() == relocInfo::virtual_call_type) { - virtual_call_Relocation* r = iter.virtual_call_reloc(); - _is_optimized = false; - _value = nativeMovConstReg_at(r->cached_value()); - } else { - assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call"); - _is_optimized = true; - _value = NULL; - } -} - // ---------------------------------------------------------------------------- void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -37,6 +37,7 @@ #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" #include "runtime/arguments.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" #include "runtime/interfaceSupport.hpp"
--- a/hotspot/src/os/aix/vm/osThread_aix.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/os/aix/vm/osThread_aix.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -24,17 +24,13 @@ */ // no precompiled headers -#include "runtime/atomic.hpp" + #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/os.hpp" #include "runtime/osThread.hpp" #include "runtime/safepoint.hpp" #include "runtime/vmThread.hpp" -#ifdef TARGET_ARCH_ppc -# include "assembler_ppc.inline.hpp" -#endif - void OSThread::pd_initialize() { assert(this != NULL, "check");
--- a/hotspot/src/os/aix/vm/os_aix.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/os/aix/vm/os_aix.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -48,6 +48,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" @@ -2812,13 +2813,6 @@ os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; } -void os::yield_all() { - // Yields to all threads, including threads with lower priorities - // Threads on Linux are all with same priority. The Solaris style - // os::yield_all() with nanosleep(1ms) is not necessary. - sched_yield(); -} - //////////////////////////////////////////////////////////////////////////////// // thread priority support @@ -3075,7 +3069,7 @@ for (int n = 0; !osthread->sr.is_suspended(); n++) { for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) { - os::yield_all(); + os::yield(); } // timeout, try to cancel the request @@ -3109,7 +3103,7 @@ if (sr_notify(osthread) == 0) { for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) { for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) { - os::yield_all(); + os::yield(); } } } else {
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -41,6 +41,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" @@ -786,7 +787,7 @@ case os::java_thread: // Java threads use ThreadStackSize which default value can be // changed with the flag -Xss - assert (JavaThread::stack_size_at_create() > 0, "this should be set"); + assert(JavaThread::stack_size_at_create() > 0, "this should be set"); stack_size = JavaThread::stack_size_at_create(); break; case os::compiler_thread: @@ -1303,7 +1304,7 @@ if (pelements == NULL) { return false; } - for (int i = 0 ; i < n ; i++) { + for (int i = 0; i < n; i++) { // Really shouldn't be NULL, but check can't hurt if (pelements[i] == NULL || strlen(pelements[i]) == 0) { continue; // skip the empty path values @@ -1316,7 +1317,7 @@ } } // release the storage - for (int i = 0 ; i < n ; i++) { + for (int i = 0; i < n; i++) { if (pelements[i] != NULL) { FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal); } @@ -1467,7 +1468,7 @@ bool failed_to_read_elf_head= (sizeof(elf_head)!= - (::read(file_descriptor, &elf_head,sizeof(elf_head)))) ; + (::read(file_descriptor, &elf_head,sizeof(elf_head)))); ::close(file_descriptor); if (failed_to_read_elf_head) { @@ -1565,7 +1566,7 @@ arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL}; int running_arch_index=-1; - for (unsigned int i=0 ; i < ARRAY_SIZE(arch_array) ; i++ ) { + for (unsigned int i=0; i < ARRAY_SIZE(arch_array); i++) { if (running_arch_code == arch_array[i].code) { running_arch_index = i; } @@ -1596,7 +1597,7 @@ #endif // !S390 if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) { - if ( lib_arch.name!=NULL ) { + if (lib_arch.name!=NULL) { ::snprintf(diag_msg_buf, diag_msg_max_length-1, " (Possible cause: can't load %s-bit .so on a %s-bit platform)", lib_arch.name, arch_array[running_arch_index].name); @@ -2598,14 +2599,7 @@ sched_yield(); } -os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;} - -void os::yield_all() { - // Yields to all threads, including threads with lower priorities - // Threads on Bsd are all with same priority. The Solaris style - // os::yield_all() with nanosleep(1ms) is not necessary. - sched_yield(); -} +os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; } //////////////////////////////////////////////////////////////////////////////// // thread priority support @@ -2686,7 +2680,7 @@ } OSReturn os::set_native_priority(Thread* thread, int newpri) { - if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK; + if (!UseThreadPriorities || ThreadPriorityPolicy == 0) return OS_OK; #ifdef __OpenBSD__ // OpenBSD pthread_setprio starves low priority threads @@ -2713,7 +2707,7 @@ } OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) { - if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) { + if (!UseThreadPriorities || ThreadPriorityPolicy == 0) { *priority_ptr = java_to_os_priority[NormPriority]; return OS_OK; } @@ -3079,7 +3073,7 @@ } struct sigaction* os::Bsd::get_preinstalled_handler(int sig) { - if ((( (unsigned int)1 << sig ) & sigs) != 0) { + if ((((unsigned int)1 << sig) & sigs) != 0) { return &sigact[sig]; } return NULL; @@ -3300,7 +3294,7 @@ address rh = VMError::get_resetted_sighandler(sig); // May be, handler was resetted by VMError? - if(rh != NULL) { + if (rh != NULL) { handler = rh; sa.sa_flags = VMError::get_resetted_sigflags(sig) & SIGNIFICANT_SIGNAL_MASK; } @@ -3309,11 +3303,11 @@ os::Posix::print_sa_flags(st, sa.sa_flags); // Check: is it our handler? - if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) || + if (handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) || handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) { // It is our signal handler // check for flags, reset system-used one! - if((int)sa.sa_flags != os::Bsd::get_our_sigflags(sig)) { + if ((int)sa.sa_flags != os::Bsd::get_our_sigflags(sig)) { st->print( ", flags was changed from " PTR32_FORMAT ", consider using jsig library", os::Bsd::get_our_sigflags(sig)); @@ -3382,10 +3376,10 @@ address thisHandler = (act.sa_flags & SA_SIGINFO) ? CAST_FROM_FN_PTR(address, act.sa_sigaction) - : CAST_FROM_FN_PTR(address, act.sa_handler) ; - - - switch(sig) { + : CAST_FROM_FN_PTR(address, act.sa_handler); + + + switch (sig) { case SIGSEGV: case SIGBUS: case SIGFPE: @@ -3515,22 +3509,22 @@ { // Allocate a single page and mark it as readable for safepoint polling address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); - - os::set_polling_page( polling_page ); + guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page"); + + os::set_polling_page(polling_page); #ifndef PRODUCT - if(Verbose && PrintMiscellaneous) + if (Verbose && PrintMiscellaneous) tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page); #endif if (!UseMembar) { address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); - os::set_memory_serialize_page( mem_serialize_page ); + guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); + os::set_memory_serialize_page(mem_serialize_page); #ifndef PRODUCT - if(Verbose && PrintMiscellaneous) + if (Verbose && PrintMiscellaneous) tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); #endif } @@ -3631,13 +3625,13 @@ // Mark the polling page as unreadable void os::make_polling_page_unreadable(void) { - if( !guard_memory((char*)_polling_page, Bsd::page_size()) ) + if (!guard_memory((char*)_polling_page, Bsd::page_size())) fatal("Could not disable polling page"); }; // Mark the polling page as readable void os::make_polling_page_readable(void) { - if( !bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) { + if (!bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) { fatal("Could not enable polling page"); } }; @@ -4229,9 +4223,9 @@ int os::PlatformEvent::TryPark() { for (;;) { - const int v = _Event ; - guarantee ((v == 0) || (v == 1), "invariant") ; - if (Atomic::cmpxchg (0, &_Event, v) == v) return v ; + const int v = _Event; + guarantee((v == 0) || (v == 1), "invariant"); + if (Atomic::cmpxchg(0, &_Event, v) == v) return v; } } @@ -4239,18 +4233,18 @@ // Invariant: Only the thread associated with the Event/PlatformEvent // may call park(). // TODO: assert that _Assoc != NULL or _Assoc == Self - int v ; + int v; for (;;) { - v = _Event ; - if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ; + v = _Event; + if (Atomic::cmpxchg(v-1, &_Event, v) == v) break; } - guarantee (v >= 0, "invariant") ; + guarantee(v >= 0, "invariant"); if (v == 0) { // Do this the hard way by blocking ... int status = pthread_mutex_lock(_mutex); assert_status(status == 0, status, "mutex_lock"); - guarantee (_nParked == 0, "invariant") ; - ++ _nParked ; + guarantee(_nParked == 0, "invariant"); + ++_nParked; while (_Event < 0) { status = pthread_cond_wait(_cond, _mutex); // for some reason, under 2.7 lwp_cond_wait() may return ETIME ... @@ -4258,28 +4252,28 @@ if (status == ETIMEDOUT) { status = EINTR; } assert_status(status == 0 || status == EINTR, status, "cond_wait"); } - -- _nParked ; - - _Event = 0 ; + --_nParked; + + _Event = 0; status = pthread_mutex_unlock(_mutex); assert_status(status == 0, status, "mutex_unlock"); // Paranoia to ensure our locked and lock-free paths interact // correctly with each other. OrderAccess::fence(); } - guarantee (_Event >= 0, "invariant") ; + guarantee(_Event >= 0, "invariant"); } int os::PlatformEvent::park(jlong millis) { - guarantee (_nParked == 0, "invariant") ; - - int v ; + guarantee(_nParked == 0, "invariant"); + + int v; for (;;) { - v = _Event ; - if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ; + v = _Event; + if (Atomic::cmpxchg(v-1, &_Event, v) == v) break; } - guarantee (v >= 0, "invariant") ; - if (v != 0) return OS_OK ; + guarantee(v >= 0, "invariant"); + if (v != 0) return OS_OK; // We do this the hard way, by blocking the thread. // Consider enforcing a minimum timeout value. @@ -4289,8 +4283,8 @@ int ret = OS_TIMEOUT; int status = pthread_mutex_lock(_mutex); assert_status(status == 0, status, "mutex_lock"); - guarantee (_nParked == 0, "invariant") ; - ++_nParked ; + guarantee(_nParked == 0, "invariant"); + ++_nParked; // Object.wait(timo) will return because of // (a) notification @@ -4308,24 +4302,24 @@ while (_Event < 0) { status = os::Bsd::safe_cond_timedwait(_cond, _mutex, &abst); if (status != 0 && WorkAroundNPTLTimedWaitHang) { - pthread_cond_destroy (_cond); - pthread_cond_init (_cond, NULL) ; + pthread_cond_destroy(_cond); + pthread_cond_init(_cond, NULL); } assert_status(status == 0 || status == EINTR || status == ETIMEDOUT, status, "cond_timedwait"); - if (!FilterSpuriousWakeups) break ; // previous semantics - if (status == ETIMEDOUT) break ; + if (!FilterSpuriousWakeups) break; // previous semantics + if (status == ETIMEDOUT) break; // We consume and ignore EINTR and spurious wakeups. } - --_nParked ; + --_nParked; if (_Event >= 0) { ret = OS_OK; } - _Event = 0 ; + _Event = 0; status = pthread_mutex_unlock(_mutex); assert_status(status == 0, status, "mutex_unlock"); - assert (_nParked == 0, "invariant") ; + assert(_nParked == 0, "invariant"); // Paranoia to ensure our locked and lock-free paths interact // correctly with each other. OrderAccess::fence(); @@ -4409,7 +4403,7 @@ */ static void unpackTime(struct timespec* absTime, bool isAbsolute, jlong time) { - assert (time > 0, "convertTime"); + assert(time > 0, "convertTime"); struct timeval now; int status = gettimeofday(&now, NULL); @@ -4470,7 +4464,7 @@ // Next, demultiplex/decode time arguments struct timespec absTime; - if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all + if (time < 0 || (isAbsolute && time == 0)) { // don't wait at all return; } if (time > 0) { @@ -4492,11 +4486,11 @@ return; } - int status ; + int status; if (_counter > 0) { // no wait needed _counter = 0; status = pthread_mutex_unlock(_mutex); - assert (status == 0, "invariant") ; + assert(status == 0, "invariant"); // Paranoia to ensure our locked and lock-free paths interact // correctly with each other and Java-level accesses. OrderAccess::fence(); @@ -4516,12 +4510,12 @@ // cleared by handle_special_suspend_equivalent_condition() or java_suspend_self() if (time == 0) { - status = pthread_cond_wait (_cond, _mutex) ; + status = pthread_cond_wait(_cond, _mutex); } else { - status = os::Bsd::safe_cond_timedwait (_cond, _mutex, &absTime) ; + status = os::Bsd::safe_cond_timedwait(_cond, _mutex, &absTime); if (status != 0 && WorkAroundNPTLTimedWaitHang) { - pthread_cond_destroy (_cond) ; - pthread_cond_init (_cond, NULL); + pthread_cond_destroy(_cond); + pthread_cond_init(_cond, NULL); } } assert_status(status == 0 || status == EINTR || @@ -4532,9 +4526,9 @@ pthread_sigmask(SIG_SETMASK, &oldsigs, NULL); #endif - _counter = 0 ; - status = pthread_mutex_unlock(_mutex) ; - assert_status(status == 0, status, "invariant") ; + _counter = 0; + status = pthread_mutex_unlock(_mutex); + assert_status(status == 0, status, "invariant"); // Paranoia to ensure our locked and lock-free paths interact // correctly with each other and Java-level accesses. OrderAccess::fence(); @@ -4546,26 +4540,26 @@ } void Parker::unpark() { - int s, status ; + int s, status; status = pthread_mutex_lock(_mutex); - assert (status == 0, "invariant") ; + assert(status == 0, "invariant"); s = _counter; _counter = 1; if (s < 1) { if (WorkAroundNPTLTimedWaitHang) { - status = pthread_cond_signal (_cond) ; - assert (status == 0, "invariant") ; + status = pthread_cond_signal(_cond); + assert(status == 0, "invariant"); status = pthread_mutex_unlock(_mutex); - assert (status == 0, "invariant") ; + assert(status == 0, "invariant"); } else { status = pthread_mutex_unlock(_mutex); - assert (status == 0, "invariant") ; - status = pthread_cond_signal (_cond) ; - assert (status == 0, "invariant") ; + assert(status == 0, "invariant"); + status = pthread_cond_signal(_cond); + assert(status == 0, "invariant"); } } else { pthread_mutex_unlock(_mutex); - assert (status == 0, "invariant") ; + assert(status == 0, "invariant"); } }
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/os/bsd/vm/os_bsd.hpp Wed Jul 16 15:12:24 2014 -0700 @@ -191,16 +191,16 @@ class PlatformEvent : public CHeapObj<mtInternal> { private: - double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line - volatile int _Event ; - volatile int _nParked ; - pthread_mutex_t _mutex [1] ; - pthread_cond_t _cond [1] ; - double PostPad [2] ; - Thread * _Assoc ; + double CachePad[4]; // increase odds that _mutex is sole occupant of cache line + volatile int _Event; + volatile int _nParked; + pthread_mutex_t _mutex[1]; + pthread_cond_t _cond[1]; + double PostPad[2]; + Thread * _Assoc; public: // TODO-FIXME: make dtor private - ~PlatformEvent() { guarantee (0, "invariant") ; } + ~PlatformEvent() { guarantee(0, "invariant"); } public: PlatformEvent() { @@ -209,28 +209,28 @@ assert_status(status == 0, status, "cond_init"); status = pthread_mutex_init (_mutex, NULL); assert_status(status == 0, status, "mutex_init"); - _Event = 0 ; - _nParked = 0 ; - _Assoc = NULL ; + _Event = 0; + _nParked = 0; + _Assoc = NULL; } // Use caution with reset() and fired() -- they may require MEMBARs - void reset() { _Event = 0 ; } + void reset() { _Event = 0; } int fired() { return _Event; } - void park () ; - void unpark () ; - int TryPark () ; - int park (jlong millis) ; - void SetAssociation (Thread * a) { _Assoc = a ; } + void park(); + void unpark(); + int TryPark(); + int park(jlong millis); + void SetAssociation(Thread * a) { _Assoc = a; } }; class PlatformParker : public CHeapObj<mtInternal> { protected: - pthread_mutex_t _mutex [1] ; - pthread_cond_t _cond [1] ; + pthread_mutex_t _mutex[1]; + pthread_cond_t _cond[1]; public: // TODO-FIXME: make dtor private - ~PlatformParker() { guarantee (0, "invariant") ; } + ~PlatformParker() { guarantee(0, "invariant"); } public: PlatformParker() {
--- a/hotspot/src/os/linux/vm/os_linux.cpp Wed Jul 16 16:02:51 2014 +0400 +++ b/hotspot/src/os/linux/vm/os_linux.cpp Wed Jul 16 15:12:24 2014 -0700 @@ -41,6 +41,7 @@ #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "runtime/arguments.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/extendedPC.hpp" #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" @@ -862,7 +863,7 @@ case os::java_thread: // Java threads use ThreadStackSize which default value can be // changed with the flag -Xss - assert (JavaThread::stack_size_at_create() > 0, "this should be set"); + assert(JavaThread::stack_size_at_create() > 0, "this should be set"); stack_size = JavaThread::stack_size_at_create(); break; case os::compiler_thread: @@ -1097,7 +1098,7 @@ if (low <= addr && addr < high) { if (vma_low) *vma_low = low; if (vma_high) *vma_high = high; - fclose (fp); + fclose(fp); return true; } } @@ -1420,7 +1421,7 @@ // must return at least tp.tv_sec == 0 which means a resolution // better than 1 sec. This is extra check for reliability. - if(pthread_getcpuclockid_func && + if (pthread_getcpuclockid_func && pthread_getcpuclockid_func(_main_thread, &clockid) == 0 && sys_clock_getres(clockid, &tp) == 0 && tp.tv_sec == 0) { @@ -1630,7 +1631,7 @@ if (pelements == NULL) { return false; } - for (int i = 0 ; i < n ; i++) { + for (int i = 0; i < n; i++) { // Really shouldn't be NULL, but check can't hurt if (pelements[i] == NULL || strlen(pelements[i]) == 0) { continue; // skip the empty path values @@ -1642,7 +1643,7 @@ } } // release the storage - for (int i = 0 ; i < n ; i++) { + for (int i = 0; i < n; i++) { if (pelements[i] != NULL) { FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal); } @@ -1906,7 +1907,7 @@ bool failed_to_read_elf_head= (sizeof(elf_head)!= - (::read(file_descriptor, &elf_head,sizeof(elf_head)))) ; + (::read(file_descriptor, &elf_head,sizeof(elf_head)))); ::close(file_descriptor); if (failed_to_read_elf_head) { @@ -1988,7 +1989,7 @@ arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL}; int running_arch_index=-1; - for (unsigned int i=0 ; i < ARRAY_SIZE(arch_array) ; i++ ) { + for (unsigned int i=0; i < ARRAY_SIZE(arch_array); i++) { if (running_arch_code == arch_array[i].code) { running_arch_index = i; } @@ -2019,7 +2020,7 @@ #endif // !S390 if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) { - if ( lib_arch.name!=NULL ) { + if (lib_arch.name!=NULL) { ::snprintf(diag_msg_buf, diag_msg_max_length-1, " (Possible cause: can't load %s-bit .so on a %s-bit platform)", lib_arch.name, arch_array[running_arch_index].name); @@ -3793,14 +3794,7 @@ sched_yield(); } -os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;} - -void os::yield_all() { - // Yields to all threads, including threads with lower priorities - // Threads on Linux are all with same priority. The Solaris style - // os::yield_all() with nanosleep(1ms) is not necessary. - sched_yield(); -} +os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; } //////////////////////////////////////////////////////////////////////////////// // thread priority support @@ -3858,14 +3852,14 @@ } OSReturn os::set_native_priority(Thread* thread, int newpri) { - if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK; + if (!UseThreadPriorities || ThreadPriorityPolicy == 0) return OS_OK; int ret = setpriority(PRIO_PROCESS, thread->osthread()->thread_id(), newpri); return (ret == 0) ? OS_OK : OS_ERR; } OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) { - if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) { + if (!UseThreadPriorities || ThreadPriorityPolicy == 0) { *priority_ptr = java_to_os_priority[NormPriority]; return OS_OK; } @@ -4219,7 +4213,7 @@ } struct sigaction* os::Linux::get_preinstalled_handler(int sig) { - if ((( (unsigned int)1 << sig ) & sigs) != 0) { + if ((((unsigned int)1 << sig) & sigs) != 0) { return &sigact[sig]; } return NULL; @@ -4423,7 +4417,7 @@ address rh = VMError::get_resetted_sighandler(sig); // May be, handler was resetted by VMError? - if(rh != NULL) { + if (rh != NULL) { handler = rh; sa.sa_flags = VMError::get_resetted_sigflags(sig) & SIGNIFICANT_SIGNAL_MASK; } @@ -4432,11 +4426,11 @@ os::Posix::print_sa_flags(st, sa.sa_flags); // Check: is it our handler? - if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) || + if (handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) || handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) { // It is our signal handler // check for flags, reset system-used one! - if((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) { + if ((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) { st->print( ", flags was changed from " PTR32_FORMAT ", consider using jsig library", os::Linux::get_our_sigflags(sig)); @@ -4507,10 +4501,10 @@ address thisHandler = (act.sa_flags & SA_SIGINFO) ? CAST_FROM_FN_PTR(address, act.sa_sigaction) - : CAST_FROM_FN_PTR(address, act.sa_handler) ; - - - switch(sig) { + : CAST_FROM_FN_PTR(address, act.sa_handler); + + + switch (sig) { case SIGSEGV: case SIGBUS: case SIGFPE: @@ -4662,22 +4656,22 @@ // Allocate a single page and mark it as readable for safepoint polling address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); - - os::set_polling_page( polling_page ); + guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page"); + + os::set_polling_page(polling_page); #ifndef PRODUCT - if(Verbose && PrintMiscellaneous) + if (Verbose && PrintMiscellaneous) tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page); #endif if (!UseMembar) { address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); - os::set_memory_serialize_page( mem_serialize_page ); + guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); + os::set_memory_serialize_page(mem_serialize_page); #ifndef PRODUCT - if(Verbose && PrintMiscellaneous) + if (Verbose && PrintMiscellaneous) tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page); #endif } @@ -4819,13 +4813,13 @@ // Mark the polling page as unreadable void os::make_polling_page_unreadable(void) { - if( !guard_memory((char*)_polling_page, Linux::page_size()) ) + if (!guard_memory((char*)_polling_page, Linux::page_size())) fatal("Could not disable polling page"); }; // Mark the polling page as readable void os::make_polling_page_readable(void) { - if( !linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) { + if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) { fatal("Could not enable polling page"); } }; @@ -5288,7 +5282,7 @@ snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid); fp = fopen(proc_name, "r"); - if ( fp == NULL ) return -1; + if (fp == NULL) return -1; statlen = fread(stat, 1, 2047, fp); stat[statlen] = '\0'; fclose(fp); @@ -5300,7 +5294,7 @@ // We don't really need to know the command string, just find the last // occurrence of ")" and then start parsing from there. See bug 4726580. s = strrchr(stat, ')'); - if (s == NULL ) return -1; + if (s == NULL) return -1; // Skip blank chars do s++; while (isspace(*s)); @@ -5309,7 +5303,7 @@ &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy, &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, &user_time, &sys_time); - if ( count != 13 ) return -1; + if (count != 13) return -1; if (user_sys_cpu_time) { return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec); } else { @@ -5468,9 +5462,9 @@ int os::PlatformEvent::TryPark() { for (;;) { - const int v = _Event ; - guarantee ((v == 0) || (v == 1), "invariant") ; - if (Atomic::cmpxchg (0, &_Event, v) == v) return v ; + const int v = _Event; + guarantee((v == 0) || (v == 1), "invariant"); + if (Atomic::cmpxchg(0, &_Event, v) == v) return v; } } @@ -5478,18 +5472,18 @@ // Invariant: Only the thread associated with the Event/PlatformEvent // may call park(). // TODO: assert that _Assoc != NULL or _Assoc == Self - int v ; + int v; for (;;) { - v = _Event ; - if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ; - } - guarantee (v >= 0, "invariant") ; + v = _Event; + if (Atomic::cmpxchg(v-1, &_Event, v) == v) break; + } + guarantee(v >= 0, "invariant"); if (v == 0) { // Do this the hard way by blocking ... int status = pthread_mutex_lock(_mutex); assert_status(status == 0, status, "mutex_lock"); - guarantee (_nParked == 0, "invariant") ; - ++ _nParked ; + guarantee(_nParked == 0, "invariant"); + ++_nParked; while (_Event < 0) { status = pthread_cond_wait(_cond, _mutex); // for some reason, under 2.7 lwp_cond_wait() may return ETIME ... @@ -5497,28 +5491,28 @@ if (status == ETIME) { status = EINTR; } assert_status(status == 0 || status == EINTR, status, "cond_wait"); } - -- _nParked ; - - _Event = 0 ; + --_nParked; + + _Event = 0; status = pthread_mutex_unlock(_mutex); assert_status(status == 0, status, "mutex_unlock"); // Paranoia to ensure our locked and lock-free paths interact // correctly with each other. OrderAccess::fence(); } - guarantee (_Event >= 0, "invariant") ; + guarantee(_Event >= 0, "invariant"); } int os::PlatformEvent::park(jlong millis) { - guarantee (_nParked == 0, "invariant") ; - - int v ; + guarantee(_nParked == 0, "invariant"); + + int v; for (;;) { - v = _Event ; - if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ; - } - guarantee (v >= 0, "invariant") ; - if (v != 0) return OS_OK ; + v = _Event; + if (Atomic::cmpxchg(v-1, &_Event, v) == v) break; + } + guarantee(v >= 0, "invariant"); + if (v != 0) return OS_OK; // We do this the hard way, by blocking the thread. // Consider enforcing a minimum timeout value. @@ -5528,8 +5522,8 @@ int ret = OS_TIMEOUT; int status = pthread_mutex_lock(_mutex); assert_status(status == 0, status, "mutex_lock"); - guarantee (_nParked == 0, "invariant") ; - ++_nParked ; + guarantee(_nParked == 0, "invariant"); + ++_nParked; // Object.wait(timo) will return because of // (a) notification @@ -5547,24 +5541,24 @@ while (_Event < 0) { status = os::Linux::safe_cond_timedwait(_cond, _mutex, &abst); if (status != 0 && WorkAroundNPTLTimedWaitHang) { - pthread_cond_destroy (_cond); - pthread_cond_init (_cond, os::Linux::condAttr()) ; + pthread_cond_destroy(_cond); + pthread_cond_init(_cond, os::Linux::condAttr()); } assert_status(status == 0 || status == EINTR || status == ETIME || status == ETIMEDOUT, status, "cond_timedwait"); - if (!FilterSpuriousWakeups) break ; // previous semantics - if (status == ETIME || status == ETIMEDOUT) break ; + if (!FilterSpuriousWakeups) break; // previous semantics + if (status == ETIME || status == ETIMEDOUT) break; // We consume and ignore EINTR and spurious wakeups. } - --_nParked ; + --_nParked; if (_Event >= 0) { ret = OS_OK; } - _Event = 0 ; + _Event = 0; status = pthread_mutex_unlock(_mutex); assert_status(status == 0, status, "mutex_unlock&