OpenJDK / jdk / jdk12
changeset 17937:eb32dc973706
Merge
author | lana |
---|---|
date | Mon, 03 Jun 2013 16:09:43 -0700 |
parents | 2a33a19ee977 8339e359fd41 |
children | af1b01dfea42 |
files | hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java hotspot/make/bsd/makefiles/launcher.make hotspot/make/linux/makefiles/launcher.make hotspot/make/solaris/makefiles/launcher.make hotspot/make/windows/makefiles/launcher.make hotspot/src/os/posix/launcher/java_md.c hotspot/src/os/posix/launcher/java_md.h hotspot/src/os/posix/launcher/launcher.script hotspot/src/os/windows/launcher/java_md.c hotspot/src/os/windows/launcher/java_md.h hotspot/src/share/tools/launcher/java.c hotspot/src/share/tools/launcher/java.h hotspot/src/share/tools/launcher/jli_util.c hotspot/src/share/tools/launcher/jli_util.h hotspot/src/share/tools/launcher/wildcard.c hotspot/src/share/tools/launcher/wildcard.h hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.inline.hpp hotspot/test/runtime/7158804/Test7158804.sh hotspot/test/runtime/8003985/Test8003985.java langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ExpertTaglet.java langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java langtools/src/share/classes/javax/tools/annotation/GenerateNativeHeader.java langtools/test/tools/javac/nativeHeaders/javahComparison/TestClass2.java langtools/test/tools/javac/nativeHeaders/javahComparison/TestClass3.java nashorn/src/jdk/nashorn/internal/ir/LineNumberNode.java nashorn/src/jdk/nashorn/internal/ir/Location.java nashorn/src/jdk/nashorn/internal/runtime/SpillProperty.java nashorn/test/script/trusted/logcoverage.js |
diffstat | 814 files changed, 30842 insertions(+), 17303 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Mon Jun 03 13:20:46 2013 -0700 +++ b/.hgtags Mon Jun 03 16:09:43 2013 -0700 @@ -211,3 +211,5 @@ 5ebf6c63714de2c9dcf831074086d31daec819df jdk8-b87 e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88 4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89 +f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90 +80b6c3172dc2cfceb022411292d290a967f9c728 jdk8-b91
--- a/.hgtags-top-repo Mon Jun 03 13:20:46 2013 -0700 +++ b/.hgtags-top-repo Mon Jun 03 16:09:43 2013 -0700 @@ -211,3 +211,5 @@ b9415faa7066a4d3b16d466556d5428446918d95 jdk8-b87 e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88 892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89 +69b773a221b956a3386933ecdbfeccee0edeac47 jdk8-b90 +cb51fb4789ac0b8be4056482077ddfb8f3bd3805 jdk8-b91
--- a/NewMakefile.gmk Mon Jun 03 13:20:46 2013 -0700 +++ b/NewMakefile.gmk Mon Jun 03 16:09:43 2013 -0700 @@ -73,7 +73,7 @@ grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) $(all_phony_targets): - @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true + @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true endif endif
--- a/common/autoconf/basics.m4 Mon Jun 03 13:20:46 2013 -0700 +++ b/common/autoconf/basics.m4 Mon Jun 03 16:09:43 2013 -0700 @@ -23,14 +23,23 @@ # questions. # +# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) +# If so, then append $1 to $2\ +# Also set JVM_ARG_OK to true/false depending on outcome. AC_DEFUN([ADD_JVM_ARG_IF_OK], [ - # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) - # If so, then append $1 to $2 - FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD + $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD + OUTPUT=`$3 $1 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then $2="[$]$2 $1" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD + $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD + JVM_ARG_OK=false fi ]) @@ -51,16 +60,19 @@ else # We're on a posix platform. Hooray! :) path="[$]$1" - - if test ! -f "$path" && test ! -d "$path"; then - AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) AC_MSG_ERROR([Spaces are not allowed in this path.]) fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) + fi + + $1="`cd "$path"; $THEPWDCMD`" fi ])
--- a/common/autoconf/build-performance.m4 Mon Jun 03 13:20:46 2013 -0700 +++ b/common/autoconf/build-performance.m4 Mon Jun 03 16:09:43 2013 -0700 @@ -278,60 +278,37 @@ fi AC_SUBST(SJAVAC_SERVER_JAVA) -AC_ARG_WITH(sjavac-server-cores, [AS_HELP_STRING([--with-sjavac-server-cores], - [use at most this number of concurrent threads on the sjavac server @<:@probed@:>@])]) -if test "x$with_sjavac_server_cores" != x; then - SJAVAC_SERVER_CORES="$with_sjavac_server_cores" -else - if test "$NUM_CORES" -gt 16; then - # We set this arbitrary limit because we want to limit the heap - # size of the javac server. - # In the future we will make the javac compilers in the server - # share more and more state, thus enabling us to use more and - # more concurrent threads in the server. - SJAVAC_SERVER_CORES="16" - else - SJAVAC_SERVER_CORES="$NUM_CORES" +if test "$MEMORY_SIZE" -gt "2500"; then + ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + if test "$JVM_ARG_OK" = true; then + JVM_64BIT=true + JVM_ARG_OK=false + fi fi +if test "$JVM_64BIT" = true; then if test "$MEMORY_SIZE" -gt "17000"; then - MAX_HEAP_MEM=10000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "10000"; then - MAX_HEAP_MEM=6000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + fi + if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "5000"; then - MAX_HEAP_MEM=3000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + fi + if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "3800"; then - MAX_HEAP_MEM=2500 + fi + if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "1900"; then - MAX_HEAP_MEM=1200 - ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1400M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "1000"; then - MAX_HEAP_MEM=900 - ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - else - MAX_HEAP_MEM=512 - ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi - - ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - - MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501` - if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then - AC_MSG_CHECKING([if number of server cores must be reduced]) - SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" - AC_MSG_RESULT([yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB]) - fi -fi -AC_SUBST(SJAVAC_SERVER_CORES) +fi +if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms1000M -Xmx1500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi +if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi +if test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi AC_MSG_CHECKING([whether to use sjavac]) AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
--- a/common/autoconf/generated-configure.sh Mon Jun 03 13:20:46 2013 -0700 +++ b/common/autoconf/generated-configure.sh Mon Jun 03 16:09:43 2013 -0700 @@ -599,7 +599,6 @@ USE_PRECOMPILED_HEADER SJAVAC_SERVER_DIR ENABLE_SJAVAC -SJAVAC_SERVER_CORES SJAVAC_SERVER_JAVA JOBS MEMORY_SIZE @@ -682,6 +681,8 @@ SHARED_LIBRARY OBJ_SUFFIX COMPILER_NAME +JTREGEXE +JT_HOME LIPO ac_ct_OBJDUMP OBJDUMP @@ -1005,6 +1006,7 @@ with_dxsdk with_dxsdk_lib with_dxsdk_include +with_jtreg with_extra_cflags with_extra_cxxflags with_extra_ldflags @@ -1025,7 +1027,6 @@ with_memory_size with_jobs with_sjavac_server_java -with_sjavac_server_cores enable_sjavac enable_precompiled_headers enable_ccache @@ -1764,6 +1765,7 @@ [probed] --with-dxsdk-include the DirectX SDK include directory (Windows only) [probed] + --with-jtreg Regression Test Harness [probed] --with-extra-cflags extra flags to be used when compiling jdk c-files --with-extra-cxxflags extra flags to be used when compiling jdk c++-files --with-extra-ldflags extra flags to be used when linking jdk @@ -1796,9 +1798,6 @@ --with-sjavac-server-java use this java binary for running the sjavac background server [Boot JDK java] - --with-sjavac-server-cores - use at most this number of concurrent threads on the - sjavac server [probed] --with-ccache-dir where to store ccache files [~/.ccache] Some influential environment variables: @@ -3077,6 +3076,9 @@ # questions. # +# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) +# If so, then append $1 to $2\ +# Also set JVM_ARG_OK to true/false depending on outcome. # This will make sure the given variable points to a full and proper @@ -3725,6 +3727,9 @@ +# Setup the JTREG paths + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3775,7 +3780,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1367502949 +DATE_WHEN_GENERATED=1369723814 ############################################################################### # @@ -7389,17 +7394,20 @@ else # We're on a posix platform. Hooray! :) path="$SRC_ROOT" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + SRC_ROOT="`cd "$path"; $THEPWDCMD`" fi @@ -7508,17 +7516,20 @@ else # We're on a posix platform. Hooray! :) path="$CURDIR" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + CURDIR="`cd "$path"; $THEPWDCMD`" fi @@ -8104,17 +8115,20 @@ else # We're on a posix platform. Hooray! :) path="$OUTPUT_ROOT" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + OUTPUT_ROOT="`cd "$path"; $THEPWDCMD`" fi @@ -11161,17 +11175,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11490,17 +11507,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11633,17 +11653,20 @@ else # We're on a posix platform. Hooray! :) path="$JAVA_HOME_PROCESSED" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD`" fi if test ! -d "$JAVA_HOME_PROCESSED"; then @@ -11802,17 +11825,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11987,17 +12013,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12312,17 +12341,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12524,17 +12556,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12701,17 +12736,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12906,17 +12944,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13083,17 +13124,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13288,17 +13332,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13465,17 +13512,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13670,17 +13720,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13847,17 +13900,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14039,17 +14095,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14214,17 +14273,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14407,17 +14469,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14582,17 +14647,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14774,17 +14842,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14949,17 +15020,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15142,17 +15216,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15317,17 +15394,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15491,17 +15571,20 @@ else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15705,73 +15788,115 @@ # Minimum amount of heap memory. - # Test if -Xms64M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xms64M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xms64M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xms64M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xms64M" >&5 + $ECHO "Command: $JAVA -Xms64M -version" >&5 + OUTPUT=`$JAVA -Xms64M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xms64M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then # Why does macosx need more heap? Its the huge JDK batch. - # Test if -Xmx1600M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xmx1600M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xmx1600M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xmx1600M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xmx1600M" >&5 + $ECHO "Command: $JAVA -Xmx1600M -version" >&5 + OUTPUT=`$JAVA -Xmx1600M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1600M" - fi - - else - - # Test if -Xmx1100M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xmx1100M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xmx1100M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xmx1100M -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + else + + $ECHO "Check if jvm arg is ok: -Xmx1100M" >&5 + $ECHO "Command: $JAVA -Xmx1100M -version" >&5 + OUTPUT=`$JAVA -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1100M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi fi # When is adding -client something that speeds up the JVM? # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA]) - # Test if -XX:PermSize=32m is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:PermSize=32m to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:PermSize=32m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:PermSize=32m -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:PermSize=32m" >&5 + $ECHO "Command: $JAVA -XX:PermSize=32m -version" >&5 + OUTPUT=`$JAVA -XX:PermSize=32m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:PermSize=32m" - fi - - - # Test if -XX:MaxPermSize=160m is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:MaxPermSize=160m to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:MaxPermSize=160m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:MaxPermSize=160m -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + + $ECHO "Check if jvm arg is ok: -XX:MaxPermSize=160m" >&5 + $ECHO "Command: $JAVA -XX:MaxPermSize=160m -version" >&5 + OUTPUT=`$JAVA -XX:MaxPermSize=160m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:MaxPermSize=160m" - fi - - - # Test if -XX:ThreadStackSize=$STACK_SIZE is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:ThreadStackSize=$STACK_SIZE to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + + $ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5 + $ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5 + OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:ThreadStackSize=$STACK_SIZE" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi # Disable special log output when a debug build is used as Boot JDK... - # Test if -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 + $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 + OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi fi @@ -16132,6 +16257,157 @@ # Locate the actual tools + +# Check whether --with-jtreg was given. +if test "${with_jtreg+set}" = set; then : + withval=$with_jtreg; +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTReg Regression Test Harness" >&5 +$as_echo_n "checking for JTReg Regression Test Harness... " >&6; } + + if test "x$with_jtreg" != x; then + JT_HOME="$with_jtreg" + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$JT_HOME" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$JT_HOME" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$JT_HOME" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + JT_HOME="`cd "$path"; $THEPWDCMD`" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5 +$as_echo "$JT_HOME" >&6; } + + # jtreg win32 script works for everybody + JTREGEXE="$JT_HOME/win32/bin/jtreg" + if test ! -f "$JTREGEXE"; then + as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + + + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then # Store path to cygwin link.exe to help excluding it when searching for @@ -17088,17 +17364,20 @@ else # We're on a posix platform. Hooray! :) path="$MSVCR_DLL" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + MSVCR_DLL="`cd "$path"; $THEPWDCMD`" fi @@ -17242,17 +17521,20 @@ else # We're on a posix platform. Hooray! :) path="$dxsdk_path" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + dxsdk_path="`cd "$path"; $THEPWDCMD`" fi @@ -17377,17 +17659,20 @@ else # We're on a posix platform. Hooray! :) path="$DXSDK_LIB_PATH" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + DXSDK_LIB_PATH="`cd "$path"; $THEPWDCMD`" fi @@ -17510,17 +17795,20 @@ else # We're on a posix platform. Hooray! :) path="$DXSDK_INCLUDE_PATH" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + DXSDK_INCLUDE_PATH="`cd "$path"; $THEPWDCMD`" fi @@ -28199,6 +28487,8 @@ fi + + # Restore old path without tools dir PATH="$OLD_PATH" @@ -30828,17 +31118,20 @@ else # We're on a posix platform. Hooray! :) path="$with_freetype" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + with_freetype="`cd "$path"; $THEPWDCMD`" fi FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" @@ -31127,17 +31420,20 @@ else # We're on a posix platform. Hooray! :) path="$FREETYPELOCATION" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + FREETYPELOCATION="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5 @@ -32664,192 +32960,183 @@ SJAVAC_SERVER_JAVA="" # Hotspot specific options. - # Test if -verbosegc is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -verbosegc to SJAVAC_SERVER_JAVA - FOUND_WARN=`$JAVA -verbosegc -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -verbosegc -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -verbosegc" >&5 + $ECHO "Command: $JAVA -verbosegc -version" >&5 + OUTPUT=`$JAVA -verbosegc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -verbosegc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi # JRockit specific options. - # Test if -Xverbose:gc is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xverbose:gc to SJAVAC_SERVER_JAVA - FOUND_WARN=`$JAVA -Xverbose:gc -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xverbose:gc -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xverbose:gc" >&5 + $ECHO "Command: $JAVA -Xverbose:gc -version" >&5 + OUTPUT=`$JAVA -Xverbose:gc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xverbose:gc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA" fi - -# Check whether --with-sjavac-server-cores was given. -if test "${with_sjavac_server_cores+set}" = set; then : - withval=$with_sjavac_server_cores; -fi - -if test "x$with_sjavac_server_cores" != x; then - SJAVAC_SERVER_CORES="$with_sjavac_server_cores" -else - if test "$NUM_CORES" -gt 16; then - # We set this arbitrary limit because we want to limit the heap - # size of the javac server. - # In the future we will make the javac compilers in the server - # share more and more state, thus enabling us to use more and - # more concurrent threads in the server. - SJAVAC_SERVER_CORES="16" - else - SJAVAC_SERVER_CORES="$NUM_CORES" - fi - - if test "$MEMORY_SIZE" -gt "17000"; then - MAX_HEAP_MEM=10000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` +if test "$MEMORY_SIZE" -gt "2500"; then + + $ECHO "Check if jvm arg is ok: -d64" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -d64 -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" - fi - - - # Test if -Xms10G -Xmx10G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms10G -Xmx10G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + if test "$JVM_ARG_OK" = true; then + JVM_64BIT=true + JVM_ARG_OK=false + fi + fi + +if test "$JVM_64BIT" = true; then + if test "$MEMORY_SIZE" -gt "17000"; then + + $ECHO "Check if jvm arg is ok: -Xms10G -Xmx10G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G" - fi - - elif test "$MEMORY_SIZE" -gt "10000"; then - MAX_HEAP_MEM=6000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" - fi - - - # Test if -Xms6G -Xmx6G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms6G -Xmx6G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + fi + if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms6G -Xmx6G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G" - fi - - elif test "$MEMORY_SIZE" -gt "5000"; then - MAX_HEAP_MEM=3000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" - fi - - - # Test if -Xms1G -Xmx3G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms1G -Xmx3G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + fi + if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx3G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G" - fi - - elif test "$MEMORY_SIZE" -gt "3800"; then - MAX_HEAP_MEM=2500 - - # Test if -Xms1G -Xmx2500M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms1G -Xmx2500M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + fi + if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx2500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M" - fi - - elif test "$MEMORY_SIZE" -gt "1900"; then - MAX_HEAP_MEM=1200 - - # Test if -Xms700M -Xmx1400M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms700M -Xmx1400M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + fi +fi +if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms1000M -Xmx1500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M" - fi - - elif test "$MEMORY_SIZE" -gt "1000"; then - MAX_HEAP_MEM=900 - - # Test if -Xms400M -Xmx1100M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms400M -Xmx1100M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1 | grep " version \""` + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi +if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms400M -Xmx1100M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M" - fi - - else - MAX_HEAP_MEM=512 - - # Test if -Xms256M -Xmx512M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms256M -Xmx512M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1 | grep " version \""` + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi +if test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms256M -Xmx512M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M" - fi - - fi - - - # Test if -XX:PermSize=32m is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:PermSize=32m to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:PermSize=32m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:PermSize=32m -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:PermSize=32m" - fi - - - # Test if -XX:MaxPermSize=160m is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:MaxPermSize=160m to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m" - fi - - - # Test if -XX:ThreadStackSize=$STACK_SIZE is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:ThreadStackSize=$STACK_SIZE to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE" - fi - - - MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501` - if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if number of server cores must be reduced" >&5 -$as_echo_n "checking if number of server cores must be reduced... " >&6; } - SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&5 -$as_echo "yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&6; } - fi -fi - + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5 $as_echo_n "checking whether to use sjavac... " >&6; }
--- a/common/autoconf/spec.gmk.in Mon Jun 03 13:20:46 2013 -0700 +++ b/common/autoconf/spec.gmk.in Mon Jun 03 16:09:43 2013 -0700 @@ -54,9 +54,9 @@ MAKE:=@MAKE@ -# Pass along the verbosity setting. +# Pass along the verbosity and log level settings. ifeq (,$(findstring VERBOSE=,$(MAKE))) - MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" + MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)" LOG_LEVEL="$(LOG_LEVEL)" endif # No implicit variables or rules! @@ -528,6 +528,8 @@ OBJCOPY:=@OBJCOPY@ SETFILE:=@SETFILE@ XATTR:=@XATTR@ +JT_HOME:=@JT_HOME@ +JTREGEXE:=@JTREGEXE@ FIXPATH:=@FIXPATH@
--- a/common/autoconf/toolchain.m4 Mon Jun 03 13:20:46 2013 -0700 +++ b/common/autoconf/toolchain.m4 Mon Jun 03 16:09:43 2013 -0700 @@ -479,6 +479,8 @@ BASIC_FIXUP_EXECUTABLE(LIPO) fi +TOOLCHAIN_SETUP_JTREG + # Restore old path without tools dir PATH="$OLD_PATH" ]) @@ -1089,3 +1091,29 @@ [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) ]) + +# Setup the JTREG paths +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +[ + AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], + [Regression Test Harness @<:@probed@:>@])]) + + AC_MSG_CHECKING([for JTReg Regression Test Harness]) + + if test "x$with_jtreg" != x; then + JT_HOME="$with_jtreg" + BASIC_FIXUP_PATH([JT_HOME]) + AC_MSG_RESULT($JT_HOME) + + # jtreg win32 script works for everybody + JTREGEXE="$JT_HOME/win32/bin/jtreg" + if test ! -f "$JTREGEXE"; then + AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) + fi + else + AC_MSG_RESULT(no) + fi + + AC_SUBST(JT_HOME) + AC_SUBST(JTREGEXE) +])
--- a/common/makefiles/Main.gmk Mon Jun 03 13:20:46 2013 -0700 +++ b/common/makefiles/Main.gmk Mon Jun 03 16:09:43 2013 -0700 @@ -240,10 +240,10 @@ clean-test: $(call CleanComponent,testoutput) -.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only -.PHONY: all test clean dist-clean bootcycle-images start-make -.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build +.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install test docs +.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only test-only docs-only +.PHONY: all clean dist-clean bootcycle-images start-make +.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build .PHONY: profiles profiles-only profiles-oscheck FRC: # Force target
--- a/common/makefiles/NativeCompilation.gmk Mon Jun 03 13:20:46 2013 -0700 +++ b/common/makefiles/NativeCompilation.gmk Mon Jun 03 16:09:43 2013 -0700 @@ -321,11 +321,17 @@ ifneq (,$$($1_DEBUG_SYMBOLS)) ifeq ($(ENABLE_DEBUG_SYMBOLS), true) - # Programs don't get the debug symbols added in the old build. It's not clear if - # this is intentional. - ifeq ($$($1_PROGRAM),) + ifdef OPENJDK + # Always add debug symbols $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) + else + # Programs don't get the debug symbols added in the old build. It's not clear if + # this is intentional. + ifeq ($$($1_PROGRAM),) + $1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS) + $1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS) + endif endif endif endif
--- a/corba/.hgtags Mon Jun 03 13:20:46 2013 -0700 +++ b/corba/.hgtags Mon Jun 03 16:09:43 2013 -0700 @@ -211,3 +211,5 @@ f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87 4e3a881ebb1ee96ce0872508b0066d74f310dbfa jdk8-b88 fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89 +c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90 +8f7ffb296385f85a4a6d53f9f2d4a7b13a8fa1ff jdk8-b91
--- a/hotspot/.hgtags Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/.hgtags Mon Jun 03 16:09:43 2013 -0700 @@ -341,3 +341,7 @@ 4ec91349972255650f97bedfd07e6423e02428cf hs25-b31 9c1fe0b419b40a9ecdd1653cc9af1b6d67a12c46 jdk8-b89 69494caf57908ba2c8efa9eaaa472b4d1875588a hs25-b32 +1ae0472ff3a0117b5b019d380ad59fface2fde14 jdk8-b90 +b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33 +7cbdf0e3725c0c56a2ff7540fc70b6d4b5890d04 jdk8-b91 +38da9f4f67096745f851318d792d6468aa1f6cf8 hs25-b34
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java Mon Jun 03 16:09:43 2013 -0700 @@ -97,8 +97,8 @@ holder.getName().asString() + " " + OopUtilities.escapeString(method.getName().asString()) + " " + method.getSignature().asString() + " " + - method.getInvocationCounter() + " " + - method.getBackedgeCounter() + " " + + method.getInvocationCount() + " " + + method.getBackedgeCount() + " " + interpreterInvocationCount() + " " + interpreterThrowoutCount() + " " + instructionsSize());
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -package sun.jvm.hotspot.debugger.cdbg.basic.amd64; - -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.debugger.amd64.*; -import sun.jvm.hotspot.debugger.cdbg.*; -import sun.jvm.hotspot.debugger.cdbg.basic.*; - -/** Basic AMD64 frame functionality providing sender() functionality. */ - -public class AMD64CFrame extends BasicCFrame { - private Address rbp; - private Address pc; - - private static final int ADDRESS_SIZE = 8; - - /** Constructor for topmost frame */ - public AMD64CFrame(CDebugger dbg, Address rbp, Address pc) { - super(dbg); - this.rbp = rbp; - this.pc = pc; - } - - public CFrame sender(ThreadProxy thread) { - AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); - Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); - - if ( (rbp == null) || rbp.lessThan(rsp) ) { - return null; - } - - Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE); - if (nextRBP == null) { - return null; - } - Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE); - if (nextPC == null) { - return null; - } - return new AMD64CFrame(dbg(), nextRBP, nextPC); - } - - public Address pc() { - return pc; - } - - public Address localVariableBase() { - return rbp; - } -}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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.debugger.cdbg.basic.x86; - -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.debugger.x86.*; -import sun.jvm.hotspot.debugger.cdbg.*; -import sun.jvm.hotspot.debugger.cdbg.basic.*; - -/** Basic X86 frame functionality providing sender() functionality. */ - -public class X86CFrame extends BasicCFrame { - private Address ebp; - private Address pc; - - private static final int ADDRESS_SIZE = 4; - - /** Constructor for topmost frame */ - public X86CFrame(CDebugger dbg, Address ebp, Address pc) { - super(dbg); - this.ebp = ebp; - this.pc = pc; - } - - public CFrame sender(ThreadProxy thread) { - X86ThreadContext context = (X86ThreadContext) thread.getContext(); - Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP); - - if ( (ebp == null) || ebp.lessThan(esp) ) { - return null; - } - - Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); - if (nextEBP == null) { - return null; - } - Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE); - if (nextPC == null) { - return null; - } - return new X86CFrame(dbg(), nextEBP, nextPC); - } - - public Address pc() { - return pc; - } - - public Address localVariableBase() { - return ebp; - } -}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java Mon Jun 03 16:09:43 2013 -0700 @@ -28,10 +28,10 @@ import java.util.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.debugger.cdbg.*; -import sun.jvm.hotspot.debugger.cdbg.basic.x86.*; -import sun.jvm.hotspot.debugger.cdbg.basic.amd64.*; import sun.jvm.hotspot.debugger.x86.*; import sun.jvm.hotspot.debugger.amd64.*; +import sun.jvm.hotspot.debugger.windows.x86.*; +import sun.jvm.hotspot.debugger.windows.amd64.*; import sun.jvm.hotspot.utilities.AddressOps; class WindbgCDebugger implements CDebugger { @@ -75,14 +75,14 @@ if (ebp == null) return null; Address pc = context.getRegisterAsAddress(X86ThreadContext.EIP); if (pc == null) return null; - return new X86CFrame(this, ebp, pc); + return new WindowsX86CFrame(dbg, ebp, pc); } else if (dbg.getCPU().equals("amd64")) { AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); Address rbp = context.getRegisterAsAddress(AMD64ThreadContext.RBP); if (rbp == null) return null; Address pc = context.getRegisterAsAddress(AMD64ThreadContext.RIP); if (pc == null) return null; - return new AMD64CFrame(this, rbp, pc); + return new WindowsAMD64CFrame(dbg, rbp, pc); } else { // unsupported CPU! return null;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java Mon Jun 03 16:09:43 2013 -0700 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.debugger.windows.amd64; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.amd64.*; +import sun.jvm.hotspot.debugger.cdbg.*; +import sun.jvm.hotspot.debugger.cdbg.basic.*; +import sun.jvm.hotspot.debugger.windbg.*; + +public class WindowsAMD64CFrame extends BasicCFrame { + private Address rbp; + private Address pc; + + private static final int ADDRESS_SIZE = 8; + + /** Constructor for topmost frame */ + public WindowsAMD64CFrame(WindbgDebugger dbg, Address rbp, Address pc) { + super(dbg.getCDebugger()); + this.rbp = rbp; + this.pc = pc; + this.dbg = dbg; + } + + public CFrame sender(ThreadProxy thread) { + AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext(); + Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP); + + if ( (rbp == null) || rbp.lessThan(rsp) ) { + return null; + } + + // Check alignment of rbp + if ( dbg.getAddressValue(rbp) % ADDRESS_SIZE != 0) { + return null; + } + + Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE); + if (nextRBP == null || nextRBP.lessThanOrEqual(rbp)) { + return null; + } + Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE); + if (nextPC == null) { + return null; + } + return new WindowsAMD64CFrame(dbg, nextRBP, nextPC); + } + + public Address pc() { + return pc; + } + + public Address localVariableBase() { + return rbp; + } + + private WindbgDebugger dbg; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java Mon Jun 03 16:09:43 2013 -0700 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.debugger.windows.x86; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.x86.*; +import sun.jvm.hotspot.debugger.cdbg.*; +import sun.jvm.hotspot.debugger.cdbg.basic.*; +import sun.jvm.hotspot.debugger.windbg.*; + +public class WindowsX86CFrame extends BasicCFrame { + private Address ebp; + private Address pc; + + private static final int ADDRESS_SIZE = 4; + + /** Constructor for topmost frame */ + public WindowsX86CFrame(WindbgDebugger dbg, Address ebp, Address pc) { + super(dbg.getCDebugger()); + this.ebp = ebp; + this.pc = pc; + this.dbg = dbg; + } + + public CFrame sender(ThreadProxy thread) { + X86ThreadContext context = (X86ThreadContext) thread.getContext(); + Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP); + + if ( (ebp == null) || ebp.lessThan(esp) ) { + return null; + } + + // Check alignment of ebp + if ( dbg.getAddressValue(ebp) % ADDRESS_SIZE != 0) { + return null; + } + + Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); + if (nextEBP == null || nextEBP.lessThanOrEqual(ebp)) { + return null; + } + Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE); + if (nextPC == null) { + return null; + } + return new WindowsX86CFrame(dbg, nextEBP, nextPC); + } + + public Address pc() { + return pc; + } + + public Address localVariableBase() { + return ebp; + } + + private WindbgDebugger dbg; +}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Mon Jun 03 16:09:43 2013 -0700 @@ -24,15 +24,21 @@ package sun.jvm.hotspot.oops; -import java.io.*; -import java.util.*; -import sun.jvm.hotspot.code.*; -import sun.jvm.hotspot.debugger.*; -import sun.jvm.hotspot.interpreter.*; -import sun.jvm.hotspot.memory.*; -import sun.jvm.hotspot.runtime.*; -import sun.jvm.hotspot.types.*; -import sun.jvm.hotspot.utilities.*; +import java.io.PrintStream; +import java.util.Observable; +import java.util.Observer; + +import sun.jvm.hotspot.code.NMethod; +import sun.jvm.hotspot.debugger.Address; +import sun.jvm.hotspot.interpreter.OopMapCacheEntry; +import sun.jvm.hotspot.runtime.SignatureConverter; +import sun.jvm.hotspot.runtime.VM; +import sun.jvm.hotspot.runtime.VMObjectFactory; +import sun.jvm.hotspot.types.AddressField; +import sun.jvm.hotspot.types.Type; +import sun.jvm.hotspot.types.TypeDataBase; +import sun.jvm.hotspot.types.WrongTypeException; +import sun.jvm.hotspot.utilities.Assert; // A Method represents a Java method @@ -132,11 +138,13 @@ public long getAccessFlags() { return accessFlags.getValue(this); } public long getCodeSize() { return getConstMethod().getCodeSize(); } public long getVtableIndex() { return vtableIndex.getValue(this); } - public long getInvocationCounter() { - return getMethodCounters().getInvocationCounter(); + public long getInvocationCount() { + MethodCounters mc = getMethodCounters(); + return mc == null ? 0 : mc.getInvocationCounter(); } - public long getBackedgeCounter() { - return getMethodCounters().getBackedgeCounter(); + public long getBackedgeCount() { + MethodCounters mc = getMethodCounters(); + return mc == null ? 0 : mc.getBackedgeCounter(); } // get associated compiled native method, if available, else return null. @@ -349,8 +357,8 @@ holder.getName().asString() + " " + OopUtilities.escapeString(getName().asString()) + " " + getSignature().asString() + " " + - getInvocationCounter() + " " + - getBackedgeCounter() + " " + + getInvocationCount() + " " + + getBackedgeCount() + " " + interpreterInvocationCount() + " " + interpreterThrowoutCount() + " " + code_size);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java Mon Jun 03 16:09:43 2013 -0700 @@ -316,8 +316,8 @@ int iic = method.interpreterInvocationCount(); if (mileage < iic) mileage = iic; - long ic = method.getInvocationCounter(); - long bc = method.getBackedgeCounter(); + long ic = method.getInvocationCount(); + long bc = method.getBackedgeCount(); long icval = ic >> 3; if ((ic & 4) != 0) icval += CompileThreshold;
--- a/hotspot/make/Makefile Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/Makefile Mon Jun 03 16:09:43 2013 -0700 @@ -151,32 +151,43 @@ $(MAKE_ARGS) BUILD_FLAVOR=product docs endif +# Output directories +C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1 +C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2 +MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1 +ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero +SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark + # Build variation of hotspot $(C1_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT) + $(MAKE) BUILD_DIR=$(C1_DIR) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT) $(C2_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT) + $(MAKE) BUILD_DIR=$(C2_DIR) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT) $(ZERO_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ \ - generic_buildzero $(ALT_OUT) + $(MAKE) BUILD_DIR=$(ZERO_DIR) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ generic_buildzero $(ALT_OUT) $(SHARK_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \ - generic_buildshark $(ALT_OUT) + $(MAKE) BUILD_DIR=$(SHARK_DIR) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ generic_buildshark $(ALT_OUT) $(MINIMAL1_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ \ - generic_buildminimal1 $(ALT_OUT) + $(MAKE) BUILD_DIR=$(MINIMAL1_DIR) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ generic_buildminimal1 $(ALT_OUT) + +# Install hotspot script in build directory +HOTSPOT_SCRIPT=$(BUILD_DIR)/$(BUILD_FLAVOR)/hotspot +$(HOTSPOT_SCRIPT): $(GAMMADIR)/make/hotspot.script + $(QUIETLY) $(MKDIR) -p $(BUILD_DIR)/$(BUILD_FLAVOR) + $(QUIETLY) cat $< | sed -e 's|@@LIBARCH@@|$(LIBARCH)|g' | sed -e 's|@@JDK_IMPORT_PATH@@|$(JDK_IMPORT_PATH)|g' > $@ + $(QUIETLY) chmod +x $@ # Build compiler1 (client) rule, different for platforms -generic_build1: +generic_build1: $(HOTSPOT_SCRIPT) $(MKDIR) -p $(OUTPUTDIR) ifeq ($(OSNAME),windows) ifeq ($(ARCH_DATA_MODEL), 32) @@ -201,7 +212,7 @@ endif # Build compiler2 (server) rule, different for platforms -generic_build2: +generic_build2: $(HOTSPOT_SCRIPT) $(MKDIR) -p $(OUTPUTDIR) ifeq ($(OSNAME),windows) $(CD) $(OUTPUTDIR); \ @@ -217,19 +228,19 @@ $(MAKE_ARGS) $(VM_TARGET) endif -generic_buildzero: +generic_buildzero: $(HOTSPOT_SCRIPT) $(MKDIR) -p $(OUTPUTDIR) $(CD) $(OUTPUTDIR); \ $(MAKE) -f $(ABS_OS_MAKEFILE) \ $(MAKE_ARGS) $(VM_TARGET) -generic_buildshark: +generic_buildshark: $(HOTSPOT_SCRIPT) $(MKDIR) -p $(OUTPUTDIR) $(CD) $(OUTPUTDIR); \ $(MAKE) -f $(ABS_OS_MAKEFILE) \ $(MAKE_ARGS) $(VM_TARGET) -generic_buildminimal1: +generic_buildminimal1: $(HOTSPOT_SCRIPT) ifeq ($(JVM_VARIANT_MINIMAL1),true) $(MKDIR) -p $(OUTPUTDIR) ifeq ($(ARCH_DATA_MODEL), 32) @@ -252,224 +263,210 @@ # Export file rule generic_export: $(EXPORT_LIST) + export_product: - $(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%=%) generic_export export_fastdebug: - $(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \ - EXPORT_SUBDIR=/$(@:export_%=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export export_debug: - $(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \ - EXPORT_SUBDIR=/$(@:export_%=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export export_optimized: - $(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \ - EXPORT_SUBDIR=/$(@:export_%=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%=%) EXPORT_SUBDIR=/$(@:export_%=%) generic_export + export_product_jdk:: - $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \ - VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export export_optimized_jdk:: - $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \ - VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) generic_export export_fastdebug_jdk:: - $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \ - VM_SUBDIR=$(@:export_%_jdk=%) \ - ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export export_debug_jdk:: - $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=$(@:export_%_jdk=%) \ - ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \ - generic_export + $(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) generic_export # Export file copy rules XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt -DOCS_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_docs -C1_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1/$(VM_SUBDIR) -C2_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2/$(VM_SUBDIR) -MINIMAL1_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1/$(VM_SUBDIR) -ZERO_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_zero/$(VM_SUBDIR) -SHARK_DIR =$(OUTPUTDIR)/$(VM_PLATFORM)_shark/$(VM_SUBDIR) +DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs +C1_BUILD_DIR =$(C1_DIR)/$(BUILD_FLAVOR) +C2_BUILD_DIR =$(C2_DIR)/$(BUILD_FLAVOR) +MINIMAL1_BUILD_DIR=$(MINIMAL1_DIR)/$(BUILD_FLAVOR) +ZERO_BUILD_DIR =$(ZERO_DIR)/$(BUILD_FLAVOR) +SHARK_BUILD_DIR =$(SHARK_DIR)/$(BUILD_FLAVOR) # Server (C2) ifeq ($(JVM_VARIANT_SERVER), true) # Common -$(EXPORT_SERVER_DIR)/%.diz: $(C2_DIR)/%.diz +$(EXPORT_SERVER_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_LIB_DIR)/%.jar: $(C2_DIR)/../generated/%.jar +$(EXPORT_LIB_DIR)/%.jar: $(C2_BUILD_DIR)/../generated/%.jar $(install-file) -$(EXPORT_INCLUDE_DIR)/%: $(C2_DIR)/../generated/jvmtifiles/% +$(EXPORT_INCLUDE_DIR)/%: $(C2_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Windows -$(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll +$(EXPORT_SERVER_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb +$(EXPORT_SERVER_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map +$(EXPORT_SERVER_DIR)/%.map: $(C2_BUILD_DIR)/%.map $(install-file) -$(EXPORT_LIB_DIR)/%.lib: $(C2_DIR)/%.lib +$(EXPORT_LIB_DIR)/%.lib: $(C2_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_DIR)/%.diz +$(EXPORT_JRE_BIN_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_DIR)/%.dll +$(EXPORT_JRE_BIN_DIR)/%.dll: $(C2_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_DIR)/%.pdb +$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C2_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_DIR)/%.map +$(EXPORT_JRE_BIN_DIR)/%.map: $(C2_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo +$(EXPORT_SERVER_DIR)/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_DIR)/%.debuginfo +$(EXPORT_SERVER_DIR)/64/%.debuginfo: $(C2_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_DIR)/%.diz +$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_DIR)/%.diz +$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_BUILD_DIR)/%.diz $(install-file) endif # Client (C1) ifeq ($(JVM_VARIANT_CLIENT), true) # Common -$(EXPORT_CLIENT_DIR)/%.diz: $(C1_DIR)/%.diz +$(EXPORT_CLIENT_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_LIB_DIR)/%.jar: $(C1_DIR)/../generated/%.jar +$(EXPORT_LIB_DIR)/%.jar: $(C1_BUILD_DIR)/../generated/%.jar $(install-file) -$(EXPORT_INCLUDE_DIR)/%: $(C1_DIR)/../generated/jvmtifiles/% +$(EXPORT_INCLUDE_DIR)/%: $(C1_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Windows -$(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll +$(EXPORT_CLIENT_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb +$(EXPORT_CLIENT_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map +$(EXPORT_CLIENT_DIR)/%.map: $(C1_BUILD_DIR)/%.map $(install-file) -$(EXPORT_LIB_DIR)/%.lib: $(C1_DIR)/%.lib +$(EXPORT_LIB_DIR)/%.lib: $(C1_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_DIR)/%.diz +$(EXPORT_JRE_BIN_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_DIR)/%.dll +$(EXPORT_JRE_BIN_DIR)/%.dll: $(C1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_DIR)/%.pdb +$(EXPORT_JRE_BIN_DIR)/%.pdb: $(C1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_DIR)/%.map +$(EXPORT_JRE_BIN_DIR)/%.map: $(C1_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo +$(EXPORT_CLIENT_DIR)/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_DIR)/%.debuginfo +$(EXPORT_CLIENT_DIR)/64/%.debuginfo: $(C1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_DIR)/%.diz +$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_DIR)/%.diz +$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_BUILD_DIR)/%.diz $(install-file) endif # Minimal1 ifeq ($(JVM_VARIANT_MINIMAL1), true) # Common -$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz +$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_DIR)/../generated/%.jar +$(EXPORT_LIB_DIR)/%.jar: $(MINIMAL1_BUILD_DIR)/../generated/%.jar $(install-file) -$(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_DIR)/../generated/jvmtifiles/% +$(EXPORT_INCLUDE_DIR)/%: $(MINIMAL1_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Windows -$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll +$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb +$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map +$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map $(install-file) -$(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_DIR)/%.lib +$(EXPORT_LIB_DIR)/%.lib: $(MINIMAL1_BUILD_DIR)/%.lib $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz +$(EXPORT_JRE_BIN_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll +$(EXPORT_JRE_BIN_DIR)/%.dll: $(MINIMAL1_BUILD_DIR)/%.dll $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb +$(EXPORT_JRE_BIN_DIR)/%.pdb: $(MINIMAL1_BUILD_DIR)/%.pdb $(install-file) -$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_DIR)/%.map +$(EXPORT_JRE_BIN_DIR)/%.map: $(MINIMAL1_BUILD_DIR)/%.map $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo +$(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo +$(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz +$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz +$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz $(install-file) endif # Zero ifeq ($(JVM_VARIANT_ZERO), true) # Common -$(EXPORT_LIB_DIR)/%.jar: $(ZERO_DIR)/../generated/%.jar +$(EXPORT_LIB_DIR)/%.jar: $(ZERO_BUILD_DIR)/../generated/%.jar $(install-file) -$(EXPORT_INCLUDE_DIR)/%: $(ZERO_DIR)/../generated/jvmtifiles/% +$(EXPORT_INCLUDE_DIR)/%: $(ZERO_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_DIR)/%.diz +$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo +$(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_DIR)/%.diz +$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz $(install-file) endif # Shark ifeq ($(JVM_VARIANT_ZEROSHARK), true) # Common -$(EXPORT_LIB_DIR)/%.jar: $(SHARK_DIR)/../generated/%.jar +$(EXPORT_LIB_DIR)/%.jar: $(SHARK_BUILD_DIR)/../generated/%.jar $(install-file) -$(EXPORT_INCLUDE_DIR)/%: $(SHARK_DIR)/../generated/jvmtifiles/% +$(EXPORT_INCLUDE_DIR)/%: $(SHARK_BUILD_DIR)/../generated/jvmtifiles/% $(install-file) # Unix -$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_DIR)/%.debuginfo +$(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo): $(SHARK_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_DIR)/%.diz +$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) -$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) +$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_BUILD_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) -$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo +$(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo $(install-file) -$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_DIR)/%.diz +$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz $(install-file) endif
--- a/hotspot/make/bsd/makefiles/arm.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/bsd/makefiles/arm.make Mon Jun 03 16:09:43 2013 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ Obj_Files += bsd_arm.o -LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a +ifneq ($(EXT_LIBS_PATH),) + LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a +endif CFLAGS += -DVM_LITTLE_ENDIAN
--- a/hotspot/make/bsd/makefiles/buildtree.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/bsd/makefiles/buildtree.make Mon Jun 03 16:09:43 2013 -0700 @@ -49,7 +49,6 @@ # adlc.make - # jvmti.make - generate JVMTI bindings from the spec (JSR-163) # sa.make - generate SA jar file and natives -# env.[ck]sh - environment settings # # The makefiles are split this way so that "make foo" will run faster by not # having to read the dependency files for the vm. @@ -129,9 +128,7 @@ BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make # dtrace.make is used on BSD versions that implement Dtrace (like MacOS X) -BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \ - jvmti.make sa.make dtrace.make \ - env.sh env.csh jdkpath.sh +BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make dtrace.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -354,33 +351,6 @@ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ ) > $@ -env.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \ - { \ - echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ - } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ - echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ - echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \ - ) > $@ - -env.csh: env.sh - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \ - sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ - ) > $@ - -jdkpath.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - echo "JDK=${JAVA_HOME}"; \ - ) > $@ - FORCE: .PHONY: all FORCE
--- a/hotspot/make/bsd/makefiles/fastdebug.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/bsd/makefiles/fastdebug.make Mon Jun 03 16:09:43 2013 -0700 @@ -58,6 +58,6 @@ # Linker mapfile MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug -VERSION = optimized +VERSION = fastdebug SYSDEFS += -DASSERT PICFLAGS = DEFAULT
--- a/hotspot/make/bsd/makefiles/launcher.make Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -# -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# Rules to build gamma launcher, used by vm.make - - -LAUNCHER_SCRIPT = hotspot -LAUNCHER = gamma - -LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher -LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher -LAUNCHERFLAGS := $(ARCHFLAG) \ - -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ - -I$(LAUNCHERDIR_SHARE) \ - -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ - -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ - -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ - -DARCH=\"$(LIBARCH)\" \ - -DGAMMA \ - -DLAUNCHER_TYPE=\"gamma\" \ - -DLINK_INTO_$(LINK_INTO) \ - $(TARGET_DEFINES) -# Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al. -LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist - -ifeq ($(LINK_INTO),AOUT) - LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) - LAUNCHER_MAPFILE = mapfile_reorder - LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) - LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) - LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) -else - LAUNCHER.o = launcher.o - LFLAGS_LAUNCHER += -L`pwd` - - # The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a - # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting - # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM - # first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is - # statically linked with CoreFoundation framework libs. Unfortunately, gamma's - # unique searchpath results in some unresolved symbols in the framework - # libraries, because JDK libraries are inadvertently discovered first on the - # searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*. - # So, the actual filename collision is libjpeg.dylib and libJPEG.dylib. - # To resolve this, gamma needs to also statically link with the CoreFoundation - # framework libraries. - - ifeq ($(OS_VENDOR),Darwin) - LFLAGS_LAUNCHER += -framework CoreFoundation - endif - - LIBS_LAUNCHER += -l$(JVM) $(LIBS) -endif - -LINK_LAUNCHER = $(LINK.CC) - -LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK) -LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK) - -LAUNCHER_OUT = launcher - -SUFFIXES += .d - -SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") -SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") - -OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) - -DEPFILES := $(patsubst %.o,%.d,$(OBJS)) --include $(DEPFILES) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) - $(QUIETLY) echo Linking launcher... - $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) - $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER) - $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) - # Sign the launcher with the development certificate (if present) so that it can be used - # to run JStack, JInfo, et al. - $(QUIETLY) -codesign -s openjdk_codesign $@ - -$(LAUNCHER): $(LAUNCHER_SCRIPT) - -$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script - $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ - $(QUIETLY) chmod +x $@ -
--- a/hotspot/make/bsd/makefiles/vm.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/bsd/makefiles/vm.make Mon Jun 03 16:09:43 2013 -0700 @@ -144,6 +144,9 @@ ifeq ($(OS_VENDOR), Darwin) LIBJVM = lib$(JVM).dylib CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE + ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug)) + CFLAGS += -DALLOW_OPERATOR_NEW_USAGE + endif else LIBJVM = lib$(JVM).so endif @@ -328,9 +331,6 @@ #---------------------------------------------------------------------- # Other files -# Gamma launcher -include $(MAKEFILES_DIR)/launcher.make - # Signal interposition library include $(MAKEFILES_DIR)/jsig.make
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/hotspot.script Mon Jun 03 16:09:43 2013 -0700 @@ -0,0 +1,218 @@ +#!/bin/sh + +# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. + + +# This script launches HotSpot. +# +# If the first parameter is either "-gdb" or "-gud", HotSpot will be +# launched inside gdb. "-gud" means "open an Emacs window and run gdb +# inside Emacs". +# +# If the first parameter is "-dbx", HotSpot will be launched inside dbx. +# +# If the first parameter is "-valgrind", HotSpot will be launched +# inside Valgrind (http://valgrind.kde.org) using the Memcheck skin, +# and with memory leak detection enabled. This currently (2005jan19) +# requires at least Valgrind 2.3.0. -Xmx16m will also be passed as +# the first parameter to HotSpot, since lowering HotSpot's memory +# consumption makes execution inside of Valgrind *a lot* faster. +# + + +# +# User changeable parameters ------------------------------------------------ +# + +# This is the name of the gdb binary to use +if [ ! "$GDB" ] +then + GDB=gdb +fi + +# This is the name of the gdb binary to use +if [ ! "$DBX" ] +then + DBX=dbx +fi + +# This is the name of the Valgrind binary to use +if [ ! "$VALGRIND" ] +then + VALGRIND=valgrind +fi + +# This is the name of Emacs for running GUD +EMACS=emacs + +# +# End of user changeable parameters ----------------------------------------- +# + +# Make sure the paths are fully specified, i.e. they must begin with /. +REL_MYDIR=`dirname $0` +MYDIR=`cd $REL_MYDIR && pwd` + +# +# Look whether the user wants to run inside gdb +case "$1" in + -gdb) + MODE=gdb + shift + ;; + -gud) + MODE=gud + shift + ;; + -dbx) + MODE=dbx + shift + ;; + -valgrind) + MODE=valgrind + shift + ;; + *) + MODE=run + ;; +esac + +if [ "${ALT_JAVA_HOME}" != "" ]; then + JDK=${ALT_JAVA_HOME%%/jre} +else + JDK=@@JDK_IMPORT_PATH@@ +fi + +if [ "${JDK}" = "" ]; then + echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty." +fi + +# We will set the LD_LIBRARY_PATH as follows: +# o $JVMPATH (directory portion only) +# o $JRE/lib/$ARCH +# followed by the user's previous effective LD_LIBRARY_PATH, if +# any. +JRE=$JDK/jre +JAVA_HOME=$JDK +export JAVA_HOME + +ARCH=@@LIBARCH@@ +SBP=${MYDIR}:${JRE}/lib/${ARCH} + + +# Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH +OS=`uname -s` +if [ "${OS}" = "Darwin" ] +then + if [ -z "$DYLD_LIBRARY_PATH" ] + then + DYLD_LIBRARY_PATH="$SBP" + else + DYLD_LIBRARY_PATH="$SBP:$DYLD_LIBRARY_PATH" + fi + export DYLD_LIBRARY_PATH +else + # not 'Darwin' + if [ -z "$LD_LIBRARY_PATH" ] + then + LD_LIBRARY_PATH="$SBP" + else + LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH" + fi + export LD_LIBRARY_PATH +fi + +JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS"; + +# Locate the java launcher +LAUNCHER=$JDK/bin/java +if [ ! -x $LAUNCHER ] ; then + echo Error: Cannot find the java launcher \"$LAUNCHER\" + exit 1 +fi + +GDBSRCDIR=$MYDIR +BASEDIR=`cd $MYDIR/../../.. && pwd` + +init_gdb() { +# Create a gdb script in case we should run inside gdb + GDBSCR=/tmp/hsl.$$ + rm -f $GDBSCR + cat >>$GDBSCR <<EOF +cd `pwd` +handle SIGUSR1 nostop noprint +handle SIGUSR2 nostop noprint +set args $JPARMS +file $LAUNCHER +directory $GDBSRCDIR +# Get us to a point where we can set breakpoints in libjvm.so +set breakpoint pending on +break JNI_CreateJavaVM +run +# Stop in JNI_CreateJavaVM +delete 1 +# We can now set breakpoints wherever we like +EOF +} + + +case "$MODE" in + gdb) + init_gdb + $GDB -x $GDBSCR + rm -f $GDBSCR + ;; + gud) + init_gdb +# First find out what emacs version we're using, so that we can +# use the new pretty GDB mode if emacs -version >= 22.1 + case `$EMACS -version 2> /dev/null` in + *GNU\ Emacs\ 2[23]*) + emacs_gud_cmd="gdba" + emacs_gud_args="--annotate=3" + ;; + *) + emacs_gud_cmd="gdb" + emacs_gud_args= + ;; + esac + $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")"; + rm -f $GDBSCR + ;; + dbx) + $DBX -s $HOME/.dbxrc -c "loadobject -load libjvm.so; stop in JNI_CreateJavaVM; run $JPARMS; delete all" $LAUNCHER + ;; + valgrind) + echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap + echo + $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS + ;; + run) + LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS + ;; + *) + echo Error: Internal error, unknown launch mode \"$MODE\" + exit 1 + ;; +esac +RETVAL=$? +exit $RETVAL
--- a/hotspot/make/hotspot_version Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/hotspot_version Mon Jun 03 16:09:43 2013 -0700 @@ -35,7 +35,7 @@ HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=32 +HS_BUILD_NUMBER=34 JDK_MAJOR_VER=1 JDK_MINOR_VER=8
--- a/hotspot/make/jprt.properties Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/jprt.properties Mon Jun 03 16:09:43 2013 -0700 @@ -134,14 +134,14 @@ jprt.build.targets.standard= \ ${jprt.my.solaris.sparc}-{product|fastdebug}, \ - ${jprt.my.solaris.sparcv9}-{product|fastdebug}, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug|optimized}, \ ${jprt.my.solaris.i586}-{product|fastdebug}, \ ${jprt.my.solaris.x64}-{product|fastdebug}, \ ${jprt.my.linux.i586}-{product|fastdebug}, \ - ${jprt.my.linux.x64}-{product|fastdebug}, \ + ${jprt.my.linux.x64}-{product|fastdebug|optimized}, \ ${jprt.my.macosx.x64}-{product|fastdebug}, \ ${jprt.my.windows.i586}-{product|fastdebug}, \ - ${jprt.my.windows.x64}-{product|fastdebug}, \ + ${jprt.my.windows.x64}-{product|fastdebug|optimized}, \ ${jprt.my.linux.armvh}-{product|fastdebug} jprt.build.targets.open= \
--- a/hotspot/make/linux/makefiles/arm.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/linux/makefiles/arm.make Mon Jun 03 16:09:43 2013 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ Obj_Files += linux_arm.o -LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a +ifneq ($(EXT_LIBS_PATH),) + LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a +endif CFLAGS += -DVM_LITTLE_ENDIAN
--- a/hotspot/make/linux/makefiles/buildtree.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/linux/makefiles/buildtree.make Mon Jun 03 16:09:43 2013 -0700 @@ -49,7 +49,6 @@ # adlc.make - # jvmti.make - generate JVMTI bindings from the spec (JSR-163) # sa.make - generate SA jar file and natives -# env.[ck]sh - environment settings # # The makefiles are split this way so that "make foo" will run faster by not # having to read the dependency files for the vm. @@ -123,8 +122,7 @@ # For dependencies and recursive makes. BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make -BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ - env.sh env.csh jdkpath.sh +BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -349,33 +347,6 @@ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ ) > $@ -env.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \ - { \ - echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ - } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ - echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ - echo "export JAVA_HOME CLASSPATH HOTSPOT_BUILD_USER"; \ - ) > $@ - -env.csh: env.sh - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \ - sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ - ) > $@ - -jdkpath.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - echo "JDK=${JAVA_HOME}"; \ - ) > $@ - FORCE: .PHONY: all FORCE
--- a/hotspot/make/linux/makefiles/jsig.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/linux/makefiles/jsig.make Mon Jun 03 16:09:43 2013 -0700 @@ -54,7 +54,7 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ - $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
--- a/hotspot/make/linux/makefiles/launcher.make Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -# -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# Rules to build gamma launcher, used by vm.make - - -LAUNCHER_SCRIPT = hotspot -LAUNCHER = gamma - -LAUNCHERDIR := $(GAMMADIR)/src/os/posix/launcher -LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher -LAUNCHERFLAGS := $(ARCHFLAG) \ - -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ - -I$(LAUNCHERDIR_SHARE) \ - -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ - -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ - -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ - -DARCH=\"$(LIBARCH)\" \ - -DGAMMA \ - -DLAUNCHER_TYPE=\"gamma\" \ - -DLINK_INTO_$(LINK_INTO) \ - $(TARGET_DEFINES) - -ifeq ($(LINK_INTO),AOUT) - LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) - LAUNCHER_MAPFILE = mapfile_reorder - LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) - LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC) - LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS) -else - LAUNCHER.o = launcher.o - LFLAGS_LAUNCHER += -L `pwd` - LIBS_LAUNCHER += -l$(JVM) $(LIBS) -endif - -LINK_LAUNCHER = $(LINK.CC) - -LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK) -LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK) - -LAUNCHER_OUT = launcher - -SUFFIXES += .d - -SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") -SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") - -OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) - -DEPFILES := $(patsubst %.o,%.d,$(OBJS)) --include $(DEPFILES) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) - $(QUIETLY) echo Linking launcher... - $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) - $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER) - $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) - -$(LAUNCHER): $(LAUNCHER_SCRIPT) - -$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script - $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ - $(QUIETLY) chmod +x $@ -
--- a/hotspot/make/linux/makefiles/saproc.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/linux/makefiles/saproc.make Mon Jun 03 16:09:43 2013 -0700 @@ -92,6 +92,7 @@ $(SASRCFILES) \ $(SA_LFLAGS) \ $(SA_DEBUG_CFLAGS) \ + $(EXTRA_CFLAGS) \ -o $@ \ -lthread_db ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
--- a/hotspot/make/linux/makefiles/vm.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/linux/makefiles/vm.make Mon Jun 03 16:09:43 2013 -0700 @@ -372,9 +372,6 @@ #---------------------------------------------------------------------- # Other files -# Gamma launcher -include $(MAKEFILES_DIR)/launcher.make - # Signal interposition library include $(MAKEFILES_DIR)/jsig.make
--- a/hotspot/make/sa.files Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/sa.files Mon Jun 03 16:09:43 2013 -0700 @@ -48,8 +48,6 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \ -$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \ -$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \ @@ -70,6 +68,8 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/x86/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/x86/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/gc_implementation/g1/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/gc_implementation/parallelScavenge/*.java \
--- a/hotspot/make/solaris/makefiles/buildtree.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/solaris/makefiles/buildtree.make Mon Jun 03 16:09:43 2013 -0700 @@ -49,7 +49,6 @@ # adlc.make - # jvmti.make - generate JVMTI bindings from the spec (JSR-163) # sa.make - generate SA jar file and natives -# env.[ck]sh - environment settings # # The makefiles are split this way so that "make foo" will run faster by not # having to read the dependency files for the vm. @@ -116,8 +115,7 @@ # For dependencies and recursive makes. BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make -BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ - env.sh env.csh jdkpath.sh +BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -339,33 +337,6 @@ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ ) > $@ -env.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \ - { \ - echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \ - } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \ - echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \ - echo "export JAVA_HOME LD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \ - ) > $@ - -env.csh: env.sh - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \ - sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ - ) > $@ - -jdkpath.sh: $(BUILDTREE_MAKE) - @echo Creating $@ ... - $(QUIETLY) ( \ - $(BUILDTREE_COMMENT); \ - echo "JDK=${JAVA_HOME}"; \ - ) > $@ - FORCE: .PHONY: all FORCE
--- a/hotspot/make/solaris/makefiles/launcher.make Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -# -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# Rules to build gamma launcher, used by vm.make - -LAUNCHER_SCRIPT = hotspot -LAUNCHER = gamma - -LAUNCHERDIR = $(GAMMADIR)/src/os/posix/launcher -LAUNCHERDIR_SHARE := $(GAMMADIR)/src/share/tools/launcher -LAUNCHERFLAGS = $(ARCHFLAG) \ - -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ - -I$(LAUNCHERDIR_SHARE) \ - -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ - -DJDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ - -DJDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ - -DARCH=\"$(LIBARCH)\" \ - -DGAMMA \ - -DLAUNCHER_TYPE=\"gamma\" \ - -DLINK_INTO_$(LINK_INTO) \ - $(TARGET_DEFINES) - -ifeq ($(LINK_INTO),AOUT) - LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) - LAUNCHER_MAPFILE = mapfile_extended - LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE)) - LIBS_LAUNCHER += $(LIBS) -else - LAUNCHER.o = launcher.o - LFLAGS_LAUNCHER += -L `pwd` - LIBS_LAUNCHER += -l$(JVM) $(LIBS) -endif - -LINK_LAUNCHER = $(LINK.CXX) - -LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CXX/PRE_HOOK) -LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CXX/POST_HOOK) - -ifeq ("${Platform_compiler}", "sparcWorks") -# Enable the following LAUNCHERFLAGS addition if you need to compare the -# built ELF objects. -# -# The -g option makes static data global and the "-W0,-noglobal" -# option tells the compiler to not globalize static data using a unique -# globalization prefix. Instead force the use of a static globalization -# prefix based on the source filepath so the objects from two identical -# compilations are the same. -# -# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't -# seem to work. I got "-W0,-noglobal" from Kelly and that works. -#LAUNCHERFLAGS += -W0,-noglobal -endif # Platform_compiler == sparcWorks - -LAUNCHER_OUT = launcher - -SUFFIXES += .d - -SOURCES := $(shell find $(LAUNCHERDIR) -name "*.c") -SOURCES_SHARE := $(shell find $(LAUNCHERDIR_SHARE) -name "*.c") - -OBJS := $(patsubst $(LAUNCHERDIR)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES)) $(patsubst $(LAUNCHERDIR_SHARE)/%.c,$(LAUNCHER_OUT)/%.o,$(SOURCES_SHARE)) - -DEPFILES := $(patsubst %.o,%.d,$(OBJS)) --include $(DEPFILES) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR_SHARE)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c - $(QUIETLY) [ -d $(LAUNCHER_OUT) ] || { mkdir -p $(LAUNCHER_OUT); } - $(QUIETLY) $(CC) -g -o $@ -c $< -MMD $(LAUNCHERFLAGS) $(CXXFLAGS) - -$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) -ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),) - $(QUIETLY) echo Linking launcher... - $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) - $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER) - $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) -endif # filter -sbfast -xsbfast - -$(LAUNCHER): $(LAUNCHER_SCRIPT) - -$(LAUNCHER_SCRIPT): $(LAUNCHERDIR)/launcher.script - $(QUIETLY) sed -e 's/@@LIBARCH@@/$(LIBARCH)/g' $< > $@ - $(QUIETLY) chmod +x $@ -
--- a/hotspot/make/solaris/makefiles/vm.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/solaris/makefiles/vm.make Mon Jun 03 16:09:43 2013 -0700 @@ -338,9 +338,6 @@ #---------------------------------------------------------------------- # Other files -# Gamma launcher -include $(MAKEFILES_DIR)/launcher.make - # Signal interposition library include $(MAKEFILES_DIR)/jsig.make
--- a/hotspot/make/windows/makefiles/debug.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/windows/makefiles/debug.make Mon Jun 03 16:09:43 2013 -0700 @@ -33,7 +33,7 @@ BUILD_PCH_FILE=_build_pch_file.obj !endif -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA +default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA !include ../local.make !include compile.make @@ -71,4 +71,3 @@ !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make -!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- a/hotspot/make/windows/makefiles/fastdebug.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/windows/makefiles/fastdebug.make Mon Jun 03 16:09:43 2013 -0700 @@ -33,7 +33,7 @@ BUILD_PCH_FILE=_build_pch_file.obj !endif -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA +default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA !include ../local.make !include compile.make @@ -70,4 +70,3 @@ !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make -!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- a/hotspot/make/windows/makefiles/launcher.make Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -# -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -LAUNCHER_FLAGS=$(CXX_FLAGS) $(ARCHFLAG) \ - /D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ - /D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ - /D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ - /D GAMMA \ - /D LAUNCHER_TYPE=\"gamma\" \ - /D _CRT_SECURE_NO_WARNINGS \ - /D _CRT_SECURE_NO_DEPRECATE \ - /D LINK_INTO_LIBJVM \ - /I $(WorkSpace)\src\os\windows\launcher \ - /I $(WorkSpace)\src\share\tools\launcher \ - /I $(WorkSpace)\src\share\vm\prims \ - /I $(WorkSpace)\src\share\vm \ - /I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \ - /I $(WorkSpace)\src\os\windows\vm - -LD_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console - -!if "$(COMPILER_NAME)" == "VS2005" -# 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. -BUFFEROVERFLOWLIB = bufferoverflowU.lib -LD_FLAGS = $(LD_FLAGS) $(BUFFEROVERFLOWLIB) -!endif - -!if "$(COMPILER_NAME)" == "VS2010" && "$(BUILDARCH)" == "i486" -LD_FLAGS = /SAFESEH $(LD_FLAGS) -!endif - -LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher -LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher - -OUTDIR = launcher - -{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj: - -mkdir $(OUTDIR) 2>NUL >NUL - $(CXX) $(LAUNCHER_FLAGS) /c /Fo$@ $< - -{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj: - -mkdir $(OUTDIR) 2>NUL >NUL - $(CXX) $(LAUNCHER_FLAGS) /c /Fo$@ $< - -$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h - -launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj - echo $(JAVA_HOME) > jdkpath.txt - $(LD) $(LD_FLAGS) /out:hotspot.exe $**
--- a/hotspot/make/windows/makefiles/product.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/windows/makefiles/product.make Mon Jun 03 16:09:43 2013 -0700 @@ -32,7 +32,7 @@ BUILD_PCH_FILE=_build_pch_file.obj !endif -default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA +default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA !include ../local.make !include compile.make @@ -73,4 +73,3 @@ !include $(WorkSpace)/make/windows/makefiles/shared.make !include $(WorkSpace)/make/windows/makefiles/sa.make -!include $(WorkSpace)/make/windows/makefiles/launcher.make
--- a/hotspot/make/windows/makefiles/projectcreator.make Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/windows/makefiles/projectcreator.make Mon Jun 03 16:09:43 2013 -0700 @@ -59,7 +59,6 @@ -relativeSrcInclude src \ -absoluteSrcInclude $(HOTSPOTBUILDSPACE) \ -ignorePath $(HOTSPOTBUILDSPACE) \ - -ignorePath launcher \ -ignorePath share\vm\adlc \ -ignorePath share\vm\shark \ -ignorePath share\tools \ @@ -105,7 +104,6 @@ -define ALIGN_STACK_FRAMES \ -define VM_LITTLE_ENDIAN \ -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \ - -postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \ -ignoreFile jsig.c \ -ignoreFile jvmtiEnvRecommended.cpp \ -ignoreFile jvmtiEnvStub.cpp \
--- a/hotspot/make/windows/projectfiles/common/Makefile Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/make/windows/projectfiles/common/Makefile Mon Jun 03 16:09:43 2013 -0700 @@ -65,7 +65,6 @@ !endif HS_INTERNAL_NAME=jvm -!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
--- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp Mon Jun 03 16:09:43 2013 -0700 @@ -74,7 +74,7 @@ define_pd_global(bool, UseMembar, false); // GC Ergo Flags -define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ \
--- a/hotspot/src/cpu/x86/vm/globals_x86.hpp Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp Mon Jun 03 16:09:43 2013 -0700 @@ -77,7 +77,7 @@ #endif // GC Ergo Flags -define_pd_global(intx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \ \
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Jun 03 16:09:43 2013 -0700 @@ -1498,27 +1498,29 @@ __ movptr(elem_klass, elem_klass_addr); // query the object klass generate_type_check(elem_klass, ckoff_arg, ckval_arg, temp, &L_store_element, NULL); - // (On fall-through, we have failed the element type check.) + // (On fall-through, we have failed the element type check.) // ======== end loop ======== // It was a real error; we must depend on the caller to finish the job. // Register "count" = -1 * number of *remaining* oops, length_arg = *total* oops. // Emit GC store barriers for the oops we have copied (length_arg + count), // and report their number to the caller. + assert_different_registers(to, count, rax); + Label L_post_barrier; __ addl(count, length_arg); // transfers = (length - remaining) __ movl2ptr(rax, count); // save the value - __ notptr(rax); // report (-1^K) to caller - __ movptr(to, to_arg); // reload - assert_different_registers(to, count, rax); - gen_write_ref_array_post_barrier(to, count); - __ jmpb(L_done); + __ notptr(rax); // report (-1^K) to caller (does not affect flags) + __ jccb(Assembler::notZero, L_post_barrier); + __ jmp(L_done); // K == 0, nothing was copied, skip post barrier // Come here on success only. __ BIND(L_do_card_marks); + __ xorptr(rax, rax); // return 0 on success __ movl2ptr(count, length_arg); - __ movptr(to, to_arg); // reload + + __ BIND(L_post_barrier); + __ movptr(to, to_arg); // reload gen_write_ref_array_post_barrier(to, count); - __ xorptr(rax, rax); // return 0 on success // Common exit point (success or failure). __ BIND(L_done);
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Jun 03 16:09:43 2013 -0700 @@ -1217,27 +1217,28 @@ // // Input: // start - register containing starting address of destination array - // end - register containing ending address of destination array + // count - elements count // scratch - scratch register // // The input registers are overwritten. - // The ending address is inclusive. - void gen_write_ref_array_post_barrier(Register start, Register end, Register scratch) { - assert_different_registers(start, end, scratch); + // + void gen_write_ref_array_post_barrier(Register start, Register count, Register scratch) { + assert_different_registers(start, count, scratch); BarrierSet* bs = Universe::heap()->barrier_set(); switch (bs->kind()) { case BarrierSet::G1SATBCT: case BarrierSet::G1SATBCTLogging: - { - __ pusha(); // push registers (overkill) - // must compute element count unless barrier set interface is changed (other platforms supply count) - assert_different_registers(start, end, scratch); - __ lea(scratch, Address(end, BytesPerHeapOop)); - __ subptr(scratch, start); // subtract start to get #bytes - __ shrptr(scratch, LogBytesPerHeapOop); // convert to element count - __ mov(c_rarg0, start); - __ mov(c_rarg1, scratch); + __ pusha(); // push registers (overkill) + if (c_rarg0 == count) { // On win64 c_rarg0 == rcx + assert_different_registers(c_rarg1, start); + __ mov(c_rarg1, count); + __ mov(c_rarg0, start); + } else { + assert_different_registers(c_rarg0, count); + __ mov(c_rarg0, start); + __ mov(c_rarg1, count); + } __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2); __ popa(); } @@ -1249,22 +1250,16 @@ assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); Label L_loop; - - __ shrptr(start, CardTableModRefBS::card_shift); - __ addptr(end, BytesPerHeapOop); - __ shrptr(end, CardTableModRefBS::card_shift); - __ subptr(end, start); // number of bytes to copy - - intptr_t disp = (intptr_t) ct->byte_map_base; - if (Assembler::is_simm32(disp)) { - Address cardtable(noreg, noreg, Address::no_scale, disp); - __ lea(scratch, cardtable); - } else { - ExternalAddress cardtable((address)disp); - __ lea(scratch, cardtable); - } - - const Register count = end; // 'end' register contains bytes count now + const Register end = count; + + __ leaq(end, Address(start, count, TIMES_OOP, 0)); // end == start+count*oop_size + __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive + __ shrptr(start, CardTableModRefBS::card_shift); + __ shrptr(end, CardTableModRefBS::card_shift); + __ subptr(end, start); // end --> cards count + + int64_t disp = (int64_t) ct->byte_map_base; + __ mov64(scratch, disp); __ addptr(start, scratch); __ BIND(L_loop); __ movb(Address(start, count, Address::times_1), 0); @@ -1916,8 +1911,7 @@ __ BIND(L_exit); if (is_oop) { - __ leaq(end_to, Address(saved_to, dword_count, Address::times_4, -4)); - gen_write_ref_array_post_barrier(saved_to, end_to, rax); + gen_write_ref_array_post_barrier(saved_to, dword_count, rax); } restore_arg_regs(); inc_counter_np(SharedRuntime::_jint_array_copy_ctr); // Update counter after rscratch1 is free @@ -2012,12 +2006,10 @@ // Copy in multi-bytes chunks copy_bytes_backward(from, to, qword_count, rax, L_copy_bytes, L_copy_8_bytes); - __ bind(L_exit); - if (is_oop) { - Register end_to = rdx; - __ leaq(end_to, Address(to, dword_count, Address::times_4, -4)); - gen_write_ref_array_post_barrier(to, end_to, rax); - } + __ BIND(L_exit); + if (is_oop) { + gen_write_ref_array_post_barrier(to, dword_count, rax); + } restore_arg_regs(); inc_counter_np(SharedRuntime::_jint_array_copy_ctr); // Update counter after rscratch1 is free __ xorptr(rax, rax); // return 0 @@ -2055,6 +2047,7 @@ const Register end_from = from; // source array end address const Register end_to = rcx; // destination array end address const Register saved_to = to; + const Register saved_count = r11; // End pointers are inclusive, and if count is not zero they point // to the last unit copied: end_to[0] := end_from[0] @@ -2072,6 +2065,8 @@ // r9 and r10 may be used to save non-volatile registers // 'from', 'to' and 'qword_count' are now valid if (is_oop) { + // Save to and count for store barrier + __ movptr(saved_count, qword_count); // no registers are destroyed by this call gen_write_ref_array_pre_barrier(to, qword_count, dest_uninitialized); } @@ -2104,7 +2099,7 @@ if (is_oop) { __ BIND(L_exit); - gen_write_ref_array_post_barrier(saved_to, end_to, rax); + gen_write_ref_array_post_barrier(saved_to, saved_count, rax); } restore_arg_regs(); if (is_oop) { @@ -2187,8 +2182,7 @@ if (is_oop) { __ BIND(L_exit); - __ lea(rcx, Address(to, saved_count, Address::times_8, -8)); - gen_write_ref_array_post_barrier(to, rcx, rax); + gen_write_ref_array_post_barrier(to, saved_count, rax); } restore_arg_regs(); if (is_oop) { @@ -2375,20 +2369,20 @@ // Register rdx = -1 * number of *remaining* oops, r14 = *total* oops. // Emit GC store barriers for the oops we have copied (r14 + rdx), // and report their number to the caller. - assert_different_registers(rax, r14_length, count, to, end_to, rcx); - __ lea(end_to, to_element_addr); - __ addptr(end_to, -heapOopSize); // make an inclusive end pointer - gen_write_ref_array_post_barrier(to, end_to, rscratch1); - __ movptr(rax, r14_length); // original oops - __ addptr(rax, count); // K = (original - remaining) oops - __ notptr(rax); // report (-1^K) to caller - __ jmp(L_done); + assert_different_registers(rax, r14_length, count, to, end_to, rcx, rscratch1); + Label L_post_barrier; + __ addptr(r14_length, count); // K = (original - remaining) oops + __ movptr(rax, r14_length); // save the value + __ notptr(rax); // report (-1^K) to caller (does not affect flags) + __ jccb(Assembler::notZero, L_post_barrier); + __ jmp(L_done); // K == 0, nothing was copied, skip post barrier // Come here on success only. __ BIND(L_do_card_marks); - __ addptr(end_to, -heapOopSize); // make an inclusive end pointer - gen_write_ref_array_post_barrier(to, end_to, rscratch1); - __ xorptr(rax, rax); // return 0 on success + __ xorptr(rax, rax); // return 0 on success + + __ BIND(L_post_barrier); + gen_write_ref_array_post_barrier(to, r14_length, rscratch1); // Common exit point (success or failure). __ BIND(L_done);
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp Mon Jun 03 13:20:46 2013 -0700 +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp Mon Jun 03 16:09:43 2013 -0700 @@ -55,7 +55,7 @@ define_pd_global(bool, UseMembar, true); // GC Ergo Flags -define_pd_global(intx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct)
--- a/hotspot/src/os/posix/launcher/java_md.c Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1936 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 "java.h" -#include <dirent.h> -#include <dlfcn.h> -#include <fcntl.h> -#include <inttypes.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <limits.h> -#include <sys/stat.h> -#include <unistd.h> -#include <sys/types.h> - -#ifndef GAMMA -#include "manifest_info.h" -#include "version_comp.h" -#endif - -#if defined(__linux__) || defined(_ALLBSD_SOURCE) -#include <pthread.h> -#else -#include <thread.h> -#endif - -#ifdef __APPLE__ -#define JVM_DLL "libjvm.dylib" -#define JAVA_DLL "libjava.dylib" -#define LD_LIBRARY_PATH "DYLD_LIBRARY_PATH" -#else -#define JVM_DLL "libjvm.so" -#define JAVA_DLL "libjava.so" -#define LD_LIBRARY_PATH "LD_LIBRARY_PATH" -#endif - -#ifndef GAMMA /* launcher.make defines ARCH */ -/* - * If a processor / os combination has the ability to run binaries of - * two data models and cohabitation of jre/jdk bits with both data - * models is supported, then DUAL_MODE is defined. When DUAL_MODE is - * defined, the architecture names for the narrow and wide version of - * the architecture are defined in LIBARCH64NAME and LIBARCH32NAME. Currently - * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux - * i586/amd64 could be defined as DUAL_MODE but that is not the - * current policy. - */ - -#ifndef LIBARCHNAME -# error "The macro LIBARCHNAME was not defined on the compile line" -#endif - -#ifdef __sun -# define DUAL_MODE -# ifndef LIBARCH32NAME -# error "The macro LIBARCH32NAME was not defined on the compile line" -# endif -# ifndef LIBARCH64NAME -# error "The macro LIBARCH64NAME was not defined on the compile line" -# endif -# include <sys/systeminfo.h> -# include <sys/elf.h> -# include <stdio.h> -#endif - -#endif /* ifndef GAMMA */ - -/* pointer to environment */ -extern char **environ; - -#ifndef GAMMA -/* - * A collection of useful strings. One should think of these as #define - * entries, but actual strings can be more efficient (with many compilers). - */ -#ifdef __linux__ -static const char *system_dir = "/usr/java"; -static const char *user_dir = "/java"; -#else /* Solaris */ -static const char *system_dir = "/usr/jdk"; -static const char *user_dir = "/jdk"; -#endif - -#endif /* ifndef GAMMA */ - -/* - * Flowchart of launcher execs and options processing on unix - * - * The selection of the proper vm shared library to open depends on - * several classes of command line options, including vm "flavor" - * options (-client, -server) and the data model options, -d32 and - * -d64, as well as a version specification which may have come from - * the command line or from the manifest of an executable jar file. - * The vm selection options are not passed to the running - * virtual machine; they must be screened out by the launcher. - * - * The version specification (if any) is processed first by the - * platform independent routine SelectVersion. This may result in - * the exec of the specified launcher version. - * - * Typically, the launcher execs at least once to ensure a suitable - * LD_LIBRARY_PATH is in effect for the process. The first exec - * screens out all the data model options; leaving the choice of data - * model implicit in the binary selected to run. However, in case no - * exec is done, the data model options are screened out before the vm - * is invoked. - * - * incoming argv ------------------------------ - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * \|/ - * CreateExecutionEnvironment - * (removes -d32 and -d64, - * determines desired data model, - * sets up LD_LIBRARY_PATH, - * and exec's) - * | - * -------------------------------------------- - * | - * \|/ - * exec child 1 incoming argv ----------------- - * | | - * \|/ | - * CheckJVMType | - * (removes -client, -server, etc.) | - * | \|/ - * | CreateExecutionEnvironment - * | (verifies desired data model - * | is running and acceptable - * | LD_LIBRARY_PATH; - * | no-op in child) - * | - * \|/ - * TranslateDashJArgs... - * (Prepare to pass args to vm) - * | - * | - * | - * \|/ - * ParseArguments - * (ignores -d32 and -d64, - * processes version options, - * creates argument list for vm, - * etc.) - * - */ - -static char *SetExecname(char **argv); -static char * GetExecname(); -static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch); -static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative); - -#ifndef GAMMA -const char * -GetArch() -{ - return LIBARCHNAME; -} -#endif /* ifndef GAMMA */ - -void -CreateExecutionEnvironment(int *_argcp, - char ***_argvp, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv) { - /* - * First, determine if we are running the desired data model. If we - * are running the desired data model, all the error messages - * associated with calling GetJREPath, ReadKnownVMs, etc. should be - * output. However, if we are not running the desired data model, - * some of the errors should be suppressed since it is more - * informative to issue an error message based on whether or not the - * os/processor combination has dual mode capabilities. - */ - - char *execname = NULL; - int original_argc = *_argcp; - jboolean jvmpathExists; - - /* Compute the name of the executable */ - execname = SetExecname(*_argvp); - -#ifndef GAMMA - /* Set the LD_LIBRARY_PATH environment variable, check data model - flags, and exec process, if needed */ - { - char *arch = (char *)GetArch(); /* like sparc or sparcv9 */ - char * jvmtype = NULL; - int argc = *_argcp; - char **argv = original_argv; - - char *runpath = NULL; /* existing effective LD_LIBRARY_PATH - setting */ - - int running = /* What data model is being ILP32 => - 32 bit vm; LP64 => 64 bit vm */ -#ifdef _LP64 - 64; -#else - 32; -#endif - - int wanted = running; /* What data mode is being - asked for? Current model is - fine unless another model - is asked for */ - - char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */ - char* newpath = NULL; /* path on new LD_LIBRARY_PATH */ - char* lastslash = NULL; - - char** newenvp = NULL; /* current environment */ - - char** newargv = NULL; - int newargc = 0; -#ifdef __sun - char* dmpath = NULL; /* data model specific LD_LIBRARY_PATH, - Solaris only */ -#endif - - /* - * Starting in 1.5, all unix platforms accept the -d32 and -d64 - * options. On platforms where only one data-model is supported - * (e.g. ia-64 Linux), using the flag for the other data model is - * an error and will terminate the program. - */ - - { /* open new scope to declare local variables */ - int i; - - newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv)); - newargv[newargc++] = argv[0]; - - /* scan for data model arguments and remove from argument list; - last occurrence determines desired data model */ - for (i=1; i < argc; i++) { - - if (strcmp(argv[i], "-J-d64") == 0 || strcmp(argv[i], "-d64") == 0) { - wanted = 64; - continue; - } - if (strcmp(argv[i], "-J-d32") == 0 || strcmp(argv[i], "-d32") == 0) { - wanted = 32; - continue; - } - newargv[newargc++] = argv[i]; - -#ifdef JAVA_ARGS - if (argv[i][0] != '-') - continue; -#else - if (strcmp(argv[i], "-classpath") == 0 || strcmp(argv[i], "-cp") == 0) { - i++; - if (i >= argc) break; - newargv[newargc++] = argv[i]; - continue; - } - if (argv[i][0] != '-') { i++; break; } -#endif - } - - /* copy rest of args [i .. argc) */ - while (i < argc) { - newargv[newargc++] = argv[i++]; - } - newargv[newargc] = NULL; - - /* - * newargv has all proper arguments here - */ - - argc = newargc; - argv = newargv; - } - - /* If the data model is not changing, it is an error if the - jvmpath does not exist */ - if (wanted == running) { - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { - fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n"); - exit(2); - } - - /* Find the specified JVM type */ - if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) { - fprintf(stderr, "Error: no known VMs. (check for corrupt jvm.cfg file)\n"); - exit(1); - } - - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE); - - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) { - fprintf(stderr, "Error: no `%s' JVM at `%s'.\n", jvmtype, jvmpath); - exit(4); - } - } else { /* do the same speculatively or exit */ -#ifdef DUAL_MODE - if (running != wanted) { - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE)) { - goto EndDataModelSpeculate; - } - - /* - * Read in jvm.cfg for target data model and process vm - * selection options. - */ - if (ReadKnownVMs(jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), JNI_TRUE) < 1) { - goto EndDataModelSpeculate; - } - jvmpath[0] = '\0'; - jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE); - /* exec child can do error checking on the existence of the path */ - jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, - ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME)); - - } - EndDataModelSpeculate: /* give up and let other code report error message */ - ; -#else - fprintf(stderr, "Running a %d-bit JVM is not supported on this platform.\n", wanted); - exit(1); -#endif - } - - /* - * We will set the LD_LIBRARY_PATH as follows: - * - * o $JVMPATH (directory portion only) - * o $JRE/lib/$LIBARCHNAME - * o $JRE/../lib/$LIBARCHNAME - * - * followed by the user's previous effective LD_LIBRARY_PATH, if - * any. - */ - -#ifdef __sun - /* - * Starting in Solaris 7, ld.so.1 supports three LD_LIBRARY_PATH - * variables: - * - * 1. LD_LIBRARY_PATH -- used for 32 and 64 bit searches if - * data-model specific variables are not set. - * - * 2. LD_LIBRARY_PATH_64 -- overrides and replaces LD_LIBRARY_PATH - * for 64-bit binaries. - * - * 3. LD_LIBRARY_PATH_32 -- overrides and replaces LD_LIBRARY_PATH - * for 32-bit binaries. - * - * The vm uses LD_LIBRARY_PATH to set the java.library.path system - * property. To shield the vm from the complication of multiple - * LD_LIBRARY_PATH variables, if the appropriate data model - * specific variable is set, we will act as if LD_LIBRARY_PATH had - * the value of the data model specific variant and the data model - * specific variant will be unset. Note that the variable for the - * *wanted* data model must be used (if it is set), not simply the - * current running data model. - */ - - switch(wanted) { - case 0: - if(running == 32) { - dmpath = getenv("LD_LIBRARY_PATH_32"); - wanted = 32; - } - else { - dmpath = getenv("LD_LIBRARY_PATH_64"); - wanted = 64; - } - break; - - case 32: - dmpath = getenv("LD_LIBRARY_PATH_32"); - break; - - case 64: - dmpath = getenv("LD_LIBRARY_PATH_64"); - break; - - default: - fprintf(stderr, "Improper value at line %d.", __LINE__); - exit(1); /* unknown value in wanted */ - break; - } - - /* - * If dmpath is NULL, the relevant data model specific variable is - * not set and normal LD_LIBRARY_PATH should be used. - */ - if( dmpath == NULL) { - runpath = getenv("LD_LIBRARY_PATH"); - } - else { - runpath = dmpath; - } -#else - /* - * If not on Solaris, assume only a single LD_LIBRARY_PATH - * variable. - */ - runpath = getenv(LD_LIBRARY_PATH); -#endif /* __sun */ - -#if defined(__linux__) - /* - * On linux, if a binary is running as sgid or suid, glibc sets - * LD_LIBRARY_PATH to the empty string for security purposes. (In - * contrast, on Solaris the LD_LIBRARY_PATH variable for a - * privileged binary does not lose its settings; but the dynamic - * linker does apply more scrutiny to the path.) The launcher uses - * the value of LD_LIBRARY_PATH to prevent an exec loop. - * Therefore, if we are running sgid or suid, this function's - * setting of LD_LIBRARY_PATH will be ineffective and we should - * return from the function now. Getting the right libraries to - * be found must be handled through other mechanisms. - */ - if((getgid() != getegid()) || (getuid() != geteuid()) ) { - return; - } -#elif defined(_ALLBSD_SOURCE) - /* - * On BSD, if a binary is running as sgid or suid, libc sets - * LD_LIBRARY_PATH to the empty string for security purposes. (In - * contrast, on Solaris the LD_LIBRARY_PATH variable for a - * privileged binary does not lose its settings; but the dynamic - * linker does apply more scrutiny to the path.) The launcher uses - * the value of LD_LIBRARY_PATH to prevent an exec loop. - * Therefore, if we are running sgid or suid, this function's - * setting of LD_LIBRARY_PATH will be ineffective and we should - * return from the function now. Getting the right libraries to - * be found must be handled through other mechanisms. - */ - if(issetugid()) { - return; - } -#endif - - /* runpath contains current effective LD_LIBRARY_PATH setting */ - - jvmpath = JLI_StringDup(jvmpath); - new_runpath = JLI_MemAlloc( ((runpath!=NULL)?strlen(runpath):0) + - 2*strlen(jrepath) + 2*strlen(arch) + - strlen(jvmpath) + 52); - newpath = new_runpath + strlen(LD_LIBRARY_PATH "="); - - - /* - * Create desired LD_LIBRARY_PATH value for target data model. - */ - { - /* remove the name of the .so from the JVM path */ - lastslash = strrchr(jvmpath, '/'); - if (lastslash) - *lastslash = '\0'; - - - /* jvmpath, ((running != wanted)?((wanted==64)?"/"LIBARCH64NAME:"/.."):""), */ - - sprintf(new_runpath, LD_LIBRARY_PATH "=" - "%s:" - "%s/lib/%s:" - "%s/../lib/%s", - jvmpath, -#ifdef DUAL_MODE - jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME), - jrepath, ((wanted==64)?LIBARCH64NAME:LIBARCH32NAME) -#else - jrepath, arch, - jrepath, arch -#endif - ); - - - /* - * Check to make sure that the prefix of the current path is the - * desired environment variable setting. - */ - if (runpath != NULL && - strncmp(newpath, runpath, strlen(newpath))==0 && - (runpath[strlen(newpath)] == 0 || runpath[strlen(newpath)] == ':') && - (running == wanted) /* data model does not have to be changed */ -#ifdef __sun - && (dmpath == NULL) /* data model specific variables not set */ -#endif - ) { - - return; - - } - } - - /* - * Place the desired environment setting onto the prefix of - * LD_LIBRARY_PATH. Note that this prevents any possible infinite - * loop of execv() because we test for the prefix, above. - */ - if (runpath != 0) { - strcat(new_runpath, ":"); - strcat(new_runpath, runpath); - } - - if( putenv(new_runpath) != 0) { - exit(1); /* problem allocating memory; LD_LIBRARY_PATH not set - properly */ - } - - /* - * Unix systems document that they look at LD_LIBRARY_PATH only - * once at startup, so we have to re-exec the current executable - * to get the changed environment variable to have an effect. - */ - -#ifdef __sun - /* - * If dmpath is not NULL, remove the data model specific string - * in the environment for the exec'ed child. - */ - - if( dmpath != NULL) - (void)UnsetEnv((wanted==32)?"LD_LIBRARY_PATH_32":"LD_LIBRARY_PATH_64"); -#endif - - newenvp = environ; - - { - char *newexec = execname; -#ifdef DUAL_MODE - /* - * If the data model is being changed, the path to the - * executable must be updated accordingly; the executable name - * and directory the executable resides in are separate. In the - * case of 32 => 64, the new bits are assumed to reside in, e.g. - * "olddir/LIBARCH64NAME/execname"; in the case of 64 => 32, - * the bits are assumed to be in "olddir/../execname". For example, - * - * olddir/sparcv9/execname - * olddir/amd64/execname - * - * for Solaris SPARC and Linux amd64, respectively. - */ - - if (running != wanted) { - char *oldexec = strcpy(JLI_MemAlloc(strlen(execname) + 1), execname); - char *olddir = oldexec; - char *oldbase = strrchr(oldexec, '/'); - - - newexec = JLI_MemAlloc(strlen(execname) + 20); - *oldbase++ = 0; - sprintf(newexec, "%s/%s/%s", olddir, - ((wanted==64) ? LIBARCH64NAME : ".."), oldbase); - argv[0] = newexec; - } -#endif - - (void)fflush(stdout); - (void)fflush(stderr); - execve(newexec, argv, newenvp); - perror("execve()"); - - fprintf(stderr, "Error trying to exec %s.\n", newexec); - fprintf(stderr, "Check if file exists and permissions are set correctly.\n"); - -#ifdef DUAL_MODE - if (running != wanted) { - fprintf(stderr, "Failed to start a %d-bit JVM process from a %d-bit JVM.\n", - wanted, running); -# ifdef __sun - -# ifdef __sparc - fprintf(stderr, "Verify all necessary J2SE components have been installed.\n" ); - fprintf(stderr, - "(Solaris SPARC 64-bit components must be installed after 32-bit components.)\n" ); -# else - fprintf(stderr, "Either 64-bit processes are not supported by this platform\n"); - fprintf(stderr, "or the 64-bit components have not been installed.\n"); -# endif - } -# endif -#endif - - } - - exit(1); - } - -#else /* ifndef GAMMA */ - - /* - * gamma launcher is simpler in that it doesn't handle VM flavors, data - * model, LD_LIBRARY_PATH, etc. Assuming everything is set-up correctly - * all we need to do here is to return correct path names. See also - * GetJVMPath() and GetApplicationHome(). - */ - - { char *arch = (char *) ARCH; /* like sparc or sparcv9 */ - char *p; - - if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) { - fprintf(stderr, "Error: could not find Java 2 Runtime Environment.\n"); - exit(2); - } - - if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath, arch )) { - fprintf(stderr, "Error: no JVM at `%s'.\n", jvmpath); - exit(4); - } - } - -#endif /* ifndef GAMMA */ -} - - -/* - * On Solaris VM choosing is done by the launcher (java.c). - */ -static jboolean -GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize, char * arch) -{ - struct stat s; - -#ifndef GAMMA - if (strchr(jvmtype, '/')) { - sprintf(jvmpath, "%s/" JVM_DLL, jvmtype); - } else { - sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype); - } -#else - /* - * For gamma launcher, JVM is either built-in or in the same directory. - * Either way we return "<exe_path>/libjvm.so" where <exe_path> is the - * directory where gamma launcher is located. - */ - - char *p; - - snprintf(jvmpath, jvmpathsize, "%s", GetExecname()); - p = strrchr(jvmpath, '/'); - if (p) { - /* replace executable name with libjvm.so */ - snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL); - } else { - /* this case shouldn't happen */ - snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL); - } -#endif /* ifndef GAMMA */ - - if (_launcher_debug) - printf("Does `%s' exist ... ", jvmpath); - - if (stat(jvmpath, &s) == 0) { - if (_launcher_debug) - printf("yes.\n"); - return JNI_TRUE; - } else { - if (_launcher_debug) - printf("no.\n"); - return JNI_FALSE; - } -} - -/* - * Find path to JRE based on .exe's location or registry settings. - */ -static jboolean -GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative) -{ - char libjava[MAXPATHLEN]; - - if (GetApplicationHome(path, pathsize)) { - - /* Is the JRE universal, i.e. no arch dir? */ - sprintf(libjava, "%s/jre/lib/" JAVA_DLL, path); - if (access(libjava, F_OK) == 0) { - strcat(path, "/jre"); - goto found; - } - - /* Is JRE co-located with the application? */ - sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - goto found; - } - - /* Does the app ship a private JRE in <apphome>/jre directory? */ - sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch); - if (access(libjava, F_OK) == 0) { - strcat(path, "/jre"); - goto found; - } - } - - if (!speculative) - fprintf(stderr, "Error: could not find " JAVA_DLL "\n"); - return JNI_FALSE; - - found: - if (_launcher_debug) - printf("JRE path is %s\n", path); - return JNI_TRUE; -} - -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) -{ -#ifdef GAMMA - /* JVM is directly linked with gamma launcher; no dlopen() */ - ifn->CreateJavaVM = JNI_CreateJavaVM; - ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; - return JNI_TRUE; -#else - Dl_info dlinfo; - void *libjvm; - - if (_launcher_debug) { - printf("JVM path is %s\n", jvmpath); - } - - libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL); - if (libjvm == NULL) { -#if defined(__sparc) && !defined(_LP64) /* i.e. 32-bit sparc */ - FILE * fp; - Elf32_Ehdr elf_head; - int count; - int location; - - fp = fopen(jvmpath, "r"); - if(fp == NULL) - goto error; - - /* read in elf header */ - count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp); - fclose(fp); - if(count < 1) - goto error; - - /* - * Check for running a server vm (compiled with -xarch=v8plus) - * on a stock v8 processor. In this case, the machine type in - * the elf header would not be included the architecture list - * provided by the isalist command, which is turn is gotten from - * sysinfo. This case cannot occur on 64-bit hardware and thus - * does not have to be checked for in binaries with an LP64 data - * model. - */ - if(elf_head.e_machine == EM_SPARC32PLUS) { - char buf[257]; /* recommended buffer size from sysinfo man - page */ - long length; - char* location; - - length = sysinfo(SI_ISALIST, buf, 257); - if(length > 0) { - location = strstr(buf, "sparcv8plus "); - if(location == NULL) { - fprintf(stderr, "SPARC V8 processor detected; Server compiler requires V9 or better.\n"); - fprintf(stderr, "Use Client compiler on V8 processors.\n"); - fprintf(stderr, "Could not create the Java virtual machine.\n"); - return JNI_FALSE; - } - } - } -#endif - fprintf(stderr, "dl failure on line %d", __LINE__); - goto error; - } - - ifn->CreateJavaVM = (CreateJavaVM_t) - dlsym(libjvm, "JNI_CreateJavaVM"); - if (ifn->CreateJavaVM == NULL) - goto error; - - ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t) - dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs"); - if (ifn->GetDefaultJavaVMInitArgs == NULL) - goto error; - - return JNI_TRUE; - -error: - fprintf(stderr, "Error: failed %s, because %s\n", jvmpath, dlerror()); - return JNI_FALSE; -#endif /* ifndef GAMMA */ -} - -/* - * If app is "/foo/bin/javac", or "/foo/bin/sparcv9/javac" then put - * "/foo" into buf. - */ -jboolean -GetApplicationHome(char *buf, jint bufsize) -{ -#if defined(__linux__) || defined(_ALLBSD_SOURCE) - char *execname = GetExecname(); - if (execname) { - strncpy(buf, execname, bufsize-1); - buf[bufsize-1] = '\0'; - } else { - return JNI_FALSE; - } -#else - Dl_info dlinfo; - - dladdr((void *)GetApplicationHome, &dlinfo); - if (realpath(dlinfo.dli_fname, buf) == NULL) { - fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname); - return JNI_FALSE; - } -#endif - -#ifdef GAMMA - { - /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ - char* java_home_var = getenv("JAVA_HOME"); - if (java_home_var == NULL) { - printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); - return JNI_FALSE; - } - snprintf(buf, bufsize, "%s", java_home_var); - } -#else - if (strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* executable file */ - if (strlen(buf) < 4 || strrchr(buf, '/') == 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - if (strcmp("/bin", buf + strlen(buf) - 4) != 0) - *(strrchr(buf, '/')) = '\0'; /* sparcv9 or amd64 */ - if (strlen(buf) < 4 || strcmp("/bin", buf + strlen(buf) - 4) != 0) { - buf[0] = '\0'; - return JNI_FALSE; - } - *(strrchr(buf, '/')) = '\0'; /* bin */ -#endif /* ifndef GAMMA */ - - return JNI_TRUE; -} - - -/* - * Return true if the named program exists - */ -static int -ProgramExists(char *name) -{ - struct stat sb; - if (stat(name, &sb) != 0) return 0; - if (S_ISDIR(sb.st_mode)) return 0; - return (sb.st_mode & S_IEXEC) != 0; -} - - -/* - * Find a command in a directory, returning the path. - */ -static char * -Resolve(char *indir, char *cmd) -{ - char name[PATH_MAX + 2], *real; - - if ((strlen(indir) + strlen(cmd) + 1) > PATH_MAX) return 0; - sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd); - if (!ProgramExists(name)) return 0; - real = JLI_MemAlloc(PATH_MAX + 2); - if (!realpath(name, real)) - strcpy(real, name); - return real; -} - - -/* - * Find a path for the executable - */ -static char * -FindExecName(char *program) -{ - char cwdbuf[PATH_MAX+2]; - char *path; - char *tmp_path; - char *f; - char *result = NULL; - - /* absolute path? */ - if (*program == FILE_SEPARATOR || - (FILE_SEPARATOR=='\\' && strrchr(program, ':'))) - return Resolve("", program+1); - - /* relative path? */ - if (strrchr(program, FILE_SEPARATOR) != 0) { - char buf[PATH_MAX+2]; - return Resolve(getcwd(cwdbuf, sizeof(cwdbuf)), program); - } - - /* from search path? */ - path = getenv("PATH"); - if (!path || !*path) path = "."; - tmp_path = JLI_MemAlloc(strlen(path) + 2); - strcpy(tmp_path, path); - - for (f=tmp_path; *f && result==0; ) { - char *s = f; - while (*f && (*f != PATH_SEPARATOR)) ++f; - if (*f) *f++ = 0; - if (*s == FILE_SEPARATOR) - result = Resolve(s, program); - else { - /* relative path element */ - char dir[2*PATH_MAX]; - sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)), - FILE_SEPARATOR, s); - result = Resolve(dir, program); - } - if (result != 0) break; - } - - JLI_MemFree(tmp_path); - return result; -} - - -/* Store the name of the executable once computed */ -static char *execname = NULL; - -/* - * Compute the name of the executable - * - * In order to re-exec securely we need the absolute path of the - * executable. On Solaris getexecname(3c) may not return an absolute - * path so we use dladdr to get the filename of the executable and - * then use realpath to derive an absolute path. From Solaris 9 - * onwards the filename returned in DL_info structure from dladdr is - * an absolute pathname so technically realpath isn't required. - * On Linux we read the executable name from /proc/self/exe. - * As a fallback, and for platforms other than Solaris and Linux, - * we use FindExecName to compute the executable name. - */ -static char * -SetExecname(char **argv) -{ - char* exec_path = NULL; - - if (execname != NULL) /* Already determined */ - return (execname); - -#if defined(__sun) - { - Dl_info dlinfo; - if (dladdr((void*)&SetExecname, &dlinfo)) { - char *resolved = (char*)JLI_MemAlloc(PATH_MAX+1); - if (resolved != NULL) { - exec_path = realpath(dlinfo.dli_fname, resolved); - if (exec_path == NULL) { - JLI_MemFree(resolved); - } - } - } - } -#elif defined(__linux__) - { - const char* self = "/proc/self/exe"; - char buf[PATH_MAX+1]; - int len = readlink(self, buf, PATH_MAX); - if (len >= 0) { - buf[len] = '\0'; /* readlink doesn't nul terminate */ - exec_path = JLI_StringDup(buf); - } - } -#else /* !__sun && !__linux */ - { - /* Not implemented */ - } -#endif - - if (exec_path == NULL) { - exec_path = FindExecName(argv[0]); - } - execname = exec_path; - return exec_path; -} - -/* - * Return the name of the executable. Used in java_md.c to find the JRE area. - */ -static char * -GetExecname() { - return execname; -} - -void ReportErrorMessage(char * message, jboolean always) { - if (always) { - fprintf(stderr, "%s\n", message); - } -} - -void ReportErrorMessage2(char * format, char * string, jboolean always) { - if (always) { - fprintf(stderr, format, string); - fprintf(stderr, "\n"); - } -} - -void ReportExceptionDescription(JNIEnv * env) { - (*env)->ExceptionDescribe(env); -} - -/* - * Return JNI_TRUE for an option string that has no effect but should - * _not_ be passed on to the vm; return JNI_FALSE otherwise. On - * Solaris SPARC, this screening needs to be done if: - * 1) LD_LIBRARY_PATH does _not_ need to be reset and - * 2) -d32 or -d64 is passed to a binary with a matching data model - * (the exec in SetLibraryPath removes -d<n> options and points the - * exec to the proper binary). When this exec is not done, these options - * would end up getting passed onto the vm. - */ -jboolean RemovableMachineDependentOption(char * option) { - /* - * Unconditionally remove both -d32 and -d64 options since only - * the last such options has an effect; e.g. - * java -d32 -d64 -d32 -version - * is equivalent to - * java -d32 -version - */ - - if( (strcmp(option, "-d32") == 0 ) || - (strcmp(option, "-d64") == 0 )) - return JNI_TRUE; - else - return JNI_FALSE; -} - -void PrintMachineDependentOptions() { - fprintf(stdout, - " -d32 use a 32-bit data model if available\n" - "\n" - " -d64 use a 64-bit data model if available\n"); - return; -} - -#ifndef GAMMA -/* - * The following methods (down to ServerClassMachine()) answer - * the question about whether a machine is a "server-class" - * machine. A server-class machine is loosely defined as one - * with 2 or more processors and 2 gigabytes or more physical - * memory. The definition of a processor is a physical package, - * not a hyperthreaded chip masquerading as a multi-processor. - * The definition of memory is also somewhat fuzzy, since x86 - * machines seem not to report all the memory in their DIMMs, we - * think because of memory mapping of graphics cards, etc. - * - * This code is somewhat more confused with #ifdef's than we'd - * like because this file is used by both Solaris and Linux - * platforms, and so needs to be parameterized for SPARC and - * i586 hardware. The other Linux platforms (amd64 and ia64) - * don't even ask this question, because they only come with - * server JVMs. */ - -# define KB (1024UL) -# define MB (1024UL * KB) -# define GB (1024UL * MB) - -/* Compute physical memory by asking the OS */ -uint64_t -physical_memory(void) { - const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES); - const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE); - const uint64_t result = pages * page_size; -# define UINT64_FORMAT "%" PRIu64 - - if (_launcher_debug) { - printf("pages: " UINT64_FORMAT - " page_size: " UINT64_FORMAT - " physical memory: " UINT64_FORMAT " (%.3fGB)\n", - pages, page_size, result, result / (double) GB); - } - return result; -} - -#if defined(__sun) && defined(__sparc) - -/* Methods for solaris-sparc: these are easy. */ - -/* Ask the OS how many processors there are. */ -unsigned long -physical_processors(void) { - const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - return sys_processors; -} - -/* The solaris-sparc version of the "server-class" predicate. */ -jboolean -solaris_sparc_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= server_memory) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE")); - } - return result; -} - -#endif /* __sun && __sparc */ - -#if defined(__sun) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of linux-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - asm( - /* rbx is a callee-saved register */ - " movq %rbx, %r11 \n" - /* rdx and rcx are 3rd and 4th argument registers */ - " movq %rdx, %r10 \n" - " movq %rcx, %r9 \n" - " movl %edi, %eax \n" - " cpuid \n" - " movl %eax, (%rsi)\n" - " movl %ebx, (%r10)\n" - " movl %ecx, (%r9) \n" - " movl %edx, (%r8) \n" - /* Restore rbx */ - " movq %r11, %rbx"); -#else - /* EBX is a callee-saved register */ - asm(" pushl %ebx"); - /* Need ESI for storing through arguments */ - asm(" pushl %esi"); - asm(" movl 8(%ebp), %eax \n" - " cpuid \n" - " movl 12(%ebp), %esi \n" - " movl %eax, (%esi) \n" - " movl 16(%ebp), %esi \n" - " movl %ebx, (%esi) \n" - " movl 20(%ebp), %esi \n" - " movl %ecx, (%esi) \n" - " movl 24(%ebp), %esi \n" - " movl %edx, (%esi) "); - /* Restore ESI and EBX */ - asm(" popl %esi"); - /* Restore EBX */ - asm(" popl %ebx"); -#endif -} - -#endif /* __sun && i586 */ - -#if (defined(__linux__) || defined(_ALLBSD_SOURCE)) && defined(i586) - -/* - * A utility method for asking the CPU about itself. - * There's a corresponding version of solaris-i586 - * because the compilers are different. - */ -void -get_cpuid(uint32_t arg, - uint32_t* eaxp, - uint32_t* ebxp, - uint32_t* ecxp, - uint32_t* edxp) { -#ifdef _LP64 - __asm__ volatile (/* Instructions */ - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, (%0)\n" - " movl %%ebx, (%1)\n" - " movl %%ecx, (%2)\n" - " movl %%edx, (%3)\n" - : /* Outputs */ - : /* Inputs */ - "r" (eaxp), - "r" (ebxp), - "r" (ecxp), - "r" (edxp), - "r" (arg) - : /* Clobbers */ - "%rax", "%rbx", "%rcx", "%rdx", "memory" - ); -#else - uint32_t value_of_eax = 0; - uint32_t value_of_ebx = 0; - uint32_t value_of_ecx = 0; - uint32_t value_of_edx = 0; - __asm__ volatile (/* Instructions */ - /* ebx is callee-save, so push it */ - " pushl %%ebx \n" - " movl %4, %%eax \n" - " cpuid \n" - " movl %%eax, %0 \n" - " movl %%ebx, %1 \n" - " movl %%ecx, %2 \n" - " movl %%edx, %3 \n" - /* restore ebx */ - " popl %%ebx \n" - - : /* Outputs */ - "=m" (value_of_eax), - "=m" (value_of_ebx), - "=m" (value_of_ecx), - "=m" (value_of_edx) - : /* Inputs */ - "m" (arg) - : /* Clobbers */ - "%eax", "%ecx", "%edx" - ); - *eaxp = value_of_eax; - *ebxp = value_of_ebx; - *ecxp = value_of_ecx; - *edxp = value_of_edx; -#endif -} - -#endif /* __linux__ && i586 */ - -#ifdef i586 -/* - * Routines shared by solaris-i586 and linux-i586. - */ - -enum HyperThreadingSupport_enum { - hts_supported = 1, - hts_too_soon_to_tell = 0, - hts_not_supported = -1, - hts_not_pentium4 = -2, - hts_not_intel = -3 -}; -typedef enum HyperThreadingSupport_enum HyperThreadingSupport; - -/* Determine if hyperthreading is supported */ -HyperThreadingSupport -hyperthreading_support(void) { - HyperThreadingSupport result = hts_too_soon_to_tell; - /* Bits 11 through 8 is family processor id */ -# define FAMILY_ID_SHIFT 8 -# define FAMILY_ID_MASK 0xf - /* Bits 23 through 20 is extended family processor id */ -# define EXT_FAMILY_ID_SHIFT 20 -# define EXT_FAMILY_ID_MASK 0xf - /* Pentium 4 family processor id */ -# define PENTIUM4_FAMILY_ID 0xf - /* Bit 28 indicates Hyper-Threading Technology support */ -# define HT_BIT_SHIFT 28 -# define HT_BIT_MASK 1 - uint32_t vendor_id[3] = { 0U, 0U, 0U }; - uint32_t value_of_eax = 0U; - uint32_t value_of_edx = 0U; - uint32_t dummy = 0U; - - /* Yes, this is supposed to be [0], [2], [1] */ - get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]); - if (_launcher_debug) { - printf("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n", - ((vendor_id[0] >> 0) & 0xff), - ((vendor_id[0] >> 8) & 0xff), - ((vendor_id[0] >> 16) & 0xff), - ((vendor_id[0] >> 24) & 0xff), - ((vendor_id[1] >> 0) & 0xff), - ((vendor_id[1] >> 8) & 0xff), - ((vendor_id[1] >> 16) & 0xff), - ((vendor_id[1] >> 24) & 0xff), - ((vendor_id[2] >> 0) & 0xff), - ((vendor_id[2] >> 8) & 0xff), - ((vendor_id[2] >> 16) & 0xff), - ((vendor_id[2] >> 24) & 0xff)); - } - get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx); - if (_launcher_debug) { - printf("value_of_eax: 0x%x value_of_edx: 0x%x\n", - value_of_eax, value_of_edx); - } - if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) || - (((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) { - if ((((vendor_id[0] >> 0) & 0xff) == 'G') && - (((vendor_id[0] >> 8) & 0xff) == 'e') && - (((vendor_id[0] >> 16) & 0xff) == 'n') && - (((vendor_id[0] >> 24) & 0xff) == 'u') && - (((vendor_id[1] >> 0) & 0xff) == 'i') && - (((vendor_id[1] >> 8) & 0xff) == 'n') && - (((vendor_id[1] >> 16) & 0xff) == 'e') && - (((vendor_id[1] >> 24) & 0xff) == 'I') && - (((vendor_id[2] >> 0) & 0xff) == 'n') && - (((vendor_id[2] >> 8) & 0xff) == 't') && - (((vendor_id[2] >> 16) & 0xff) == 'e') && - (((vendor_id[2] >> 24) & 0xff) == 'l')) { - if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) { - if (_launcher_debug) { - printf("Hyperthreading supported\n"); - } - result = hts_supported; - } else { - if (_launcher_debug) { - printf("Hyperthreading not supported\n"); - } - result = hts_not_supported; - } - } else { - if (_launcher_debug) { - printf("Not GenuineIntel\n"); - } - result = hts_not_intel; - } - } else { - if (_launcher_debug) { - printf("not Pentium 4 or extended\n"); - } - result = hts_not_pentium4; - } - return result; -} - -/* Determine how many logical processors there are per CPU */ -unsigned int -logical_processors_per_package(void) { - /* - * After CPUID with EAX==1, register EBX bits 23 through 16 - * indicate the number of logical processors per package - */ -# define NUM_LOGICAL_SHIFT 16 -# define NUM_LOGICAL_MASK 0xff - unsigned int result = 1U; - const HyperThreadingSupport hyperthreading = hyperthreading_support(); - - if (hyperthreading == hts_supported) { - uint32_t value_of_ebx = 0U; - uint32_t dummy = 0U; - - get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy); - result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK; - if (_launcher_debug) { - printf("logical processors per package: %u\n", result); - } - } - return result; -} - -/* Compute the number of physical processors, not logical processors */ -unsigned long -physical_processors(void) { - const long sys_processors = sysconf(_SC_NPROCESSORS_CONF); - unsigned long result = sys_processors; - - if (_launcher_debug) { - printf("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors); - } - if (sys_processors > 1) { - unsigned int logical_processors = logical_processors_per_package(); - if (logical_processors > 1) { - result = (unsigned long) sys_processors / logical_processors; - } - } - if (_launcher_debug) { - printf("physical processors: %lu\n", result); - } - return result; -} - -#endif /* i586 */ - -#if defined(__sun) && defined(i586) - -/* The definition of a server-class machine for solaris-i586/amd64 */ -jboolean -solaris_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __sun && i586 */ - -#if defined(__linux__) && defined(i586) - -/* The definition of a server-class machine for linux-i586 */ -jboolean -linux_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* __linux__ && i586 */ - -#if defined(_ALLBSD_SOURCE) && defined(i586) - -/* The definition of a server-class machine for bsd-i586 */ -jboolean -bsd_i586_ServerClassMachine(void) { - jboolean result = JNI_FALSE; - /* How big is a server class machine? */ - const unsigned long server_processors = 2UL; - const uint64_t server_memory = 2UL * GB; - /* - * We seem not to get our full complement of memory. - * We allow some part (1/8?) of the memory to be "missing", - * based on the sizes of DIMMs, and maybe graphics cards. - */ - const uint64_t missing_memory = 256UL * MB; - const uint64_t actual_memory = physical_memory(); - - /* Is this a server class machine? */ - if (actual_memory >= (server_memory - missing_memory)) { - const unsigned long actual_processors = physical_processors(); - if (actual_processors >= server_processors) { - result = JNI_TRUE; - } - } - if (_launcher_debug) { - printf("linux_" LIBARCHNAME "_ServerClassMachine: %s\n", - (result == JNI_TRUE ? "true" : "false")); - } - return result; -} - -#endif /* _ALLBSD_SOURCE && i586 */ - -/* Dispatch to the platform-specific definition of "server-class" */ -jboolean -ServerClassMachine(void) { - jboolean result = JNI_FALSE; -#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_FALSE; -#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_TRUE; -#elif defined(__sun) && defined(__sparc) - result = solaris_sparc_ServerClassMachine(); -#elif defined(__sun) && defined(i586) - result = solaris_i586_ServerClassMachine(); -#elif defined(__linux__) && defined(i586) - result = linux_i586_ServerClassMachine(); -#elif defined(_ALLBSD_SOURCE) && defined(i586) - result = bsd_i586_ServerClassMachine(); -#else - if (_launcher_debug) { - printf("ServerClassMachine: returns default value of %s\n", - (result == JNI_TRUE ? "true" : "false")); - } -#endif - return result; -} - -/* - * Since using the file system as a registry is a bit risky, perform - * additional sanity checks on the identified directory to validate - * it as a valid jre/sdk. - * - * Return 0 if the tests fail; otherwise return non-zero (true). - * - * Note that checking for anything more than the existence of an - * executable object at bin/java relative to the path being checked - * will break the regression tests. - */ -static int -CheckSanity(char *path, char *dir) -{ - char buffer[PATH_MAX]; - - if (strlen(path) + strlen(dir) + 11 > PATH_MAX) - return (0); /* Silently reject "impossibly" long paths */ - - (void)strcat(strcat(strcat(strcpy(buffer, path), "/"), dir), "/bin/java"); - return ((access(buffer, X_OK) == 0) ? 1 : 0); -} - -/* - * Determine if there is an acceptable JRE in the directory dirname. - * Upon locating the "best" one, return a fully qualified path to - * it. "Best" is defined as the most advanced JRE meeting the - * constraints contained in the manifest_info. If no JRE in this - * directory meets the constraints, return NULL. - * - * Note that we don't check for errors in reading the directory - * (which would be done by checking errno). This is because it - * doesn't matter if we get an error reading the directory, or - * we just don't find anything interesting in the directory. We - * just return NULL in either case. - * - * The historical names of j2sdk and j2re were changed to jdk and - * jre respecively as part of the 1.5 rebranding effort. Since the - * former names are legacy on Linux, they must be recognized for - * all time. Fortunately, this is a minor cost. - */ -static char -*ProcessDir(manifest_info *info, char *dirname) -{ - DIR *dirp; - struct dirent *dp; - char *best = NULL; - int offset; - int best_offset = 0; - char *ret_str = NULL; - char buffer[PATH_MAX]; - - if ((dirp = opendir(dirname)) == NULL) - return (NULL); - - do { - if ((dp = readdir(dirp)) != NULL) { - offset = 0; - if ((strncmp(dp->d_name, "jre", 3) == 0) || - (strncmp(dp->d_name, "jdk", 3) == 0)) - offset = 3; - else if (strncmp(dp->d_name, "j2re", 4) == 0) - offset = 4; - else if (strncmp(dp->d_name, "j2sdk", 5) == 0) - offset = 5; - if (offset > 0) { - if ((JLI_AcceptableRelease(dp->d_name + offset, - info->jre_version)) && CheckSanity(dirname, dp->d_name)) - if ((best == NULL) || (JLI_ExactVersionId( - dp->d_name + offset, best + best_offset) > 0)) { - if (best != NULL) - JLI_MemFree(best); - best = JLI_StringDup(dp->d_name); - best_offset = offset; - } - } - } - } while (dp != NULL); - (void) closedir(dirp); - if (best == NULL) - return (NULL); - else { - ret_str = JLI_MemAlloc(strlen(dirname) + strlen(best) + 2); - ret_str = strcat(strcat(strcpy(ret_str, dirname), "/"), best); - JLI_MemFree(best); - return (ret_str); - } -} - -/* - * This is the global entry point. It examines the host for the optimal - * JRE to be used by scanning a set of directories. The set of directories - * is platform dependent and can be overridden by the environment - * variable JAVA_VERSION_PATH. - * - * This routine itself simply determines the set of appropriate - * directories before passing control onto ProcessDir(). - */ -char* -LocateJRE(manifest_info* info) -{ - char *path; - char *home; - char *target = NULL; - char *dp; - char *cp; - - /* - * Start by getting JAVA_VERSION_PATH - */ - if (info->jre_restrict_search) - path = JLI_StringDup(system_dir); - else if ((path = getenv("JAVA_VERSION_PATH")) != NULL) - path = JLI_StringDup(path); - else - if ((home = getenv("HOME")) != NULL) { - path = (char *)JLI_MemAlloc(strlen(home) + strlen(system_dir) + - strlen(user_dir) + 2); - path = strcat(strcat(strcat(strcpy(path, home), - user_dir), ":"), system_dir); - } else - path = JLI_StringDup(system_dir); - - /* - * Step through each directory on the path. Terminate the scan with - * the first directory with an acceptable JRE. - */ - cp = dp = path; - while (dp != NULL) { - cp = strchr(dp, (int)':'); - if (cp != NULL) - *cp = (char)NULL; - if ((target = ProcessDir(info, dp)) != NULL) - break; - dp = cp; - if (dp != NULL) - dp++; - } - JLI_MemFree(path); - return (target); -} - -/* - * Given a path to a jre to execute, this routine checks if this process - * is indeed that jre. If not, it exec's that jre. - * - * We want to actually check the paths rather than just the version string - * built into the executable, so that given version specification (and - * JAVA_VERSION_PATH) will yield the exact same Java environment, regardless - * of the version of the arbitrary launcher we start with. - */ -void -ExecJRE(char *jre, char **argv) -{ - char wanted[PATH_MAX]; - char *execname; - char *progname; - - /* - * Resolve the real path to the directory containing the selected JRE. - */ - if (realpath(jre, wanted) == NULL) { - fprintf(stderr, "Unable to resolve %s\n", jre); - exit(1); - } - - /* - * Resolve the real path to the currently running launcher. - */ - execname = SetExecname(argv); - if (execname == NULL) { - fprintf(stderr, "Unable to resolve current executable\n"); - exit(1); - } - - /* - * If the path to the selected JRE directory is a match to the initial - * portion of the path to the currently executing JRE, we have a winner! - * If so, just return. - */ - if (strncmp(wanted, execname, strlen(wanted)) == 0) - return; /* I am the droid you were looking for */ - - /* - * If this isn't the selected version, exec the selected version. - */ -#ifdef JAVA_ARGS /* javac, jar and friends. */ - progname = "java"; -#else /* java, oldjava, javaw and friends */ -#ifdef PROGNAME - progname = PROGNAME; -#else - progname = *argv; - if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) { - progname = s + 1; - } -#endif /* PROGNAME */ -#endif /* JAVA_ARGS */ - - /* - * This should never happen (because of the selection code in SelectJRE), - * but check for "impossibly" long path names just because buffer overruns - * can be so deadly. - */ - if (strlen(wanted) + strlen(progname) + 6 > PATH_MAX) { - fprintf(stderr, "Path length exceeds maximum length (PATH_MAX)\n"); - exit(1); - } - - /* - * Construct the path and exec it. - */ - (void)strcat(strcat(wanted, "/bin/"), progname); - argv[0] = progname; - if (_launcher_debug) { - int i; - printf("ReExec Command: %s (%s)\n", wanted, argv[0]); - printf("ReExec Args:"); - for (i = 1; argv[i] != NULL; i++) - printf(" %s", argv[i]); - printf("\n"); - } - (void)fflush(stdout); - (void)fflush(stderr); - execv(wanted, argv); - perror("execv()"); - fprintf(stderr, "Exec of %s failed\n", wanted); - exit(1); -} -#endif /* ifndef GAMMA */ - -/* - * "Borrowed" from Solaris 10 where the unsetenv() function is being added - * to libc thanks to SUSv3 (Standard Unix Specification, version 3). As - * such, in the fullness of time this will appear in libc on all relevant - * Solaris/Linux platforms and maybe even the Windows platform. At that - * time, this stub can be removed. - * - * This implementation removes the environment locking for multithreaded - * applications. (We don't have access to these mutexes within libc and - * the launcher isn't multithreaded.) Note that what remains is platform - * independent, because it only relies on attributes that a POSIX environment - * defines. - * - * Returns 0 on success, -1 on failure. - * - * Also removed was the setting of errno. The only value of errno set - * was EINVAL ("Invalid Argument"). - */ - -/* - * s1(environ) is name=value - * s2(name) is name(not the form of name=value). - * if names match, return value of 1, else return 0 - */ -static int -match_noeq(const char *s1, const char *s2) -{ - while (*s1 == *s2++) { - if (*s1++ == '=') - return (1); - } - if (*s1 == '=' && s2[-1] == '\0') - return (1); - return (0); -} - -/* - * added for SUSv3 standard - * - * Delete entry from environ. - * Do not free() memory! Other threads may be using it. - * Keep it around forever. - */ -static int -borrowed_unsetenv(const char *name) -{ - long idx; /* index into environ */ - - if (name == NULL || *name == '\0' || - strchr(name, '=') != NULL) { - return (-1); - } - - for (idx = 0; environ[idx] != NULL; idx++) { - if (match_noeq(environ[idx], name)) - break; - } - if (environ[idx] == NULL) { - /* name not found but still a success */ - return (0); - } - /* squeeze up one entry */ - do { - environ[idx] = environ[idx+1]; - } while (environ[++idx] != NULL); - - return (0); -} -/* --- End of "borrowed" code --- */ - -/* - * Wrapper for unsetenv() function. - */ -int -UnsetEnv(char *name) -{ - return(borrowed_unsetenv(name)); -} - -/* --- Splash Screen shared library support --- */ - -static const char* SPLASHSCREEN_SO = "libsplashscreen.so"; - -static void* hSplashLib = NULL; - -void* SplashProcAddress(const char* name) { - if (!hSplashLib) { - hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL); - } - if (hSplashLib) { - void* sym = dlsym(hSplashLib, name); - return sym; - } else { - return NULL; - } -} - -void SplashFreeLibrary() { - if (hSplashLib) { - dlclose(hSplashLib); - hSplashLib = NULL; - } -} - -/* - * Block current thread and continue execution in a new thread - */ -int -ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void * args) { - int rslt; -#if defined(__linux__) || defined(_ALLBSD_SOURCE) - pthread_t tid; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - - if (stack_size > 0) { - pthread_attr_setstacksize(&attr, stack_size); - } - - if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { - void * tmp; - pthread_join(tid, &tmp); - rslt = (int)(intptr_t)tmp; - } else { - /* - * Continue execution in current thread if for some reason (e.g. out of - * memory/LWP) a new thread can't be created. This will likely fail - * later in continuation as JNI_CreateJavaVM needs to create quite a - * few new threads, anyway, just give it a try.. - */ - rslt = continuation(args); - } - - pthread_attr_destroy(&attr); -#else - thread_t tid; - long flags = 0; - if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { - void * tmp; - thr_join(tid, NULL, &tmp); - rslt = (int)(intptr_t)tmp; - } else { - /* See above. Continue in current thread if thr_create() failed */ - rslt = continuation(args); - } -#endif - return rslt; -} - -/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */ -#define MAX_PID_STR_SZ 20 - -void SetJavaLauncherPlatformProps() { - /* Linux only */ -#ifdef __linux__ - const char *substr = "-Dsun.java.launcher.pid="; - char *pid_prop_str = (char *)JLI_MemAlloc(strlen(substr) + MAX_PID_STR_SZ + 1); - sprintf(pid_prop_str, "%s%d", substr, getpid()); - AddOption(pid_prop_str, NULL); -#endif -}
--- a/hotspot/src/os/posix/launcher/java_md.h Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 JAVA_MD_H -#define JAVA_MD_H - -#include <limits.h> -#include <unistd.h> -#include <sys/param.h> -#ifndef GAMMA -#include "manifest_info.h" -#endif -#include "jli_util.h" - -#define PATH_SEPARATOR ':' -#define FILESEP "/" -#define FILE_SEPARATOR '/' -#define IS_FILE_SEPARATOR(c) ((c) == '/') -#ifndef MAXNAMELEN -#define MAXNAMELEN PATH_MAX -#endif - -#ifdef JAVA_ARGS -/* - * ApplicationHome is prepended to each of these entries; the resulting - * strings are concatenated (separated by PATH_SEPARATOR) and used as the - * value of -cp option to the launcher. - */ -#ifndef APP_CLASSPATH -#define APP_CLASSPATH { "/lib/tools.jar", "/classes" } -#endif -#endif - -#ifdef HAVE_GETHRTIME -/* - * Support for doing cheap, accurate interval timing. - */ -#include <sys/time.h> -#define CounterGet() (gethrtime()/1000) -#define Counter2Micros(counts) (counts) -#else -#define CounterGet() (0) -#define Counter2Micros(counts) (1) -#endif /* HAVE_GETHRTIME */ - -#ifdef _LP64 -#define JLONG_FORMAT "%ld" -#else -#define JLONG_FORMAT "%lld" -#endif - -/* - * Function prototypes. - */ -#ifndef GAMMA -char *LocateJRE(manifest_info *info); -void ExecJRE(char *jre, char **argv); -#endif -int UnsetEnv(char *name); - -#endif
--- a/hotspot/src/os/posix/launcher/launcher.script Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. - - -# This script launches HotSpot. -# -# If the first parameter is either "-gdb" or "-gud", HotSpot will be -# launched inside gdb. "-gud" means "open an Emacs window and run gdb -# inside Emacs". -# -# If the first parameter is "-dbx", HotSpot will be launched inside dbx. -# -# If the first parameter is "-valgrind", HotSpot will be launched -# inside Valgrind (http://valgrind.kde.org) using the Memcheck skin, -# and with memory leak detection enabled. This currently (2005jan19) -# requires at least Valgrind 2.3.0. -Xmx16m will also be passed as -# the first parameter to HotSpot, since lowering HotSpot's memory -# consumption makes execution inside of Valgrind *a lot* faster. -# - - -# -# User changeable parameters ------------------------------------------------ -# - -# This is the name of the gdb binary to use -if [ ! "$GDB" ] -then - GDB=gdb -fi - -# This is the name of the gdb binary to use -if [ ! "$DBX" ] -then - DBX=dbx -fi - -# This is the name of the Valgrind binary to use -if [ ! "$VALGRIND" ] -then - VALGRIND=valgrind -fi - -# This is the name of Emacs for running GUD -EMACS=emacs - -# -# End of user changeable parameters ----------------------------------------- -# - -# Make sure the paths are fully specified, i.e. they must begin with /. -REL_MYDIR=`dirname $0` -MYDIR=`cd $REL_MYDIR && pwd` - -# Look whether the user wants to run inside gdb -case "$1" in - -gdb) - MODE=gdb - shift - ;; - -gud) - MODE=gud - shift - ;; - -dbx) - MODE=dbx - shift - ;; - -valgrind) - MODE=valgrind - shift - ;; - *) - MODE=run - ;; -esac - -JDK= -if [ "${ALT_JAVA_HOME}" = "" ]; then - . ${MYDIR}/jdkpath.sh -else - JDK=${ALT_JAVA_HOME%%/jre}; -fi - -if [ "${JDK}" = "" ]; then - echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found. - exit 1 -fi - -# We will set the LD_LIBRARY_PATH as follows: -# o $JVMPATH (directory portion only) -# o $JRE/lib/$ARCH -# followed by the user's previous effective LD_LIBRARY_PATH, if -# any. -JRE=$JDK/jre -JAVA_HOME=$JDK -export JAVA_HOME - -ARCH=@@LIBARCH@@ -SBP=${MYDIR}:${JRE}/lib/${ARCH} - - -# Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH -OS=`uname -s` -if [ "${OS}" = "Darwin" ] -then - if [ -z "$DYLD_LIBRARY_PATH" ] - then - DYLD_LIBRARY_PATH="$SBP" - else - DYLD_LIBRARY_PATH="$SBP:$DYLD_LIBRARY_PATH" - fi - export DYLD_LIBRARY_PATH -else - # not 'Darwin' - if [ -z "$LD_LIBRARY_PATH" ] - then - LD_LIBRARY_PATH="$SBP" - else - LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH" - fi - export LD_LIBRARY_PATH -fi - -JPARMS="$@ $JAVA_ARGS"; - -# Locate the gamma development launcher -LAUNCHER=${MYDIR}/gamma -if [ ! -x $LAUNCHER ] ; then - echo Error: Cannot find the gamma development launcher \"$LAUNCHER\" - exit 1 -fi - -GDBSRCDIR=$MYDIR -BASEDIR=`cd $MYDIR/../../.. && pwd` - -init_gdb() { -# Create a gdb script in case we should run inside gdb - GDBSCR=/tmp/hsl.$$ - rm -f $GDBSCR - cat >>$GDBSCR <<EOF -cd `pwd` -handle SIGUSR1 nostop noprint -handle SIGUSR2 nostop noprint -set args $JPARMS -file $LAUNCHER -directory $GDBSRCDIR -# Get us to a point where we can set breakpoints in libjvm.so -break InitializeJVM -run -# Stop in InitializeJVM -delete 1 -# We can now set breakpoints wherever we like -EOF -} - - -case "$MODE" in - gdb) - init_gdb - $GDB -x $GDBSCR - rm -f $GDBSCR - ;; - gud) - init_gdb -# First find out what emacs version we're using, so that we can -# use the new pretty GDB mode if emacs -version >= 22.1 - case `$EMACS -version 2> /dev/null` in - *GNU\ Emacs\ 2[23]*) - emacs_gud_cmd="gdba" - emacs_gud_args="--annotate=3" - ;; - *) - emacs_gud_cmd="gdb" - emacs_gud_args= - ;; - esac - $EMACS --eval "($emacs_gud_cmd \"$GDB $emacs_gud_args -x $GDBSCR\")"; - rm -f $GDBSCR - ;; - dbx) - $DBX -s $HOME/.dbxrc $LAUNCHER $JPARMS - ;; - valgrind) - echo Warning: Defaulting to 16Mb heap to make Valgrind run faster, use -Xmx for larger heap - echo - $VALGRIND --tool=memcheck --leak-check=yes --num-callers=50 $LAUNCHER -Xmx16m $JPARMS - ;; - run) - LD_PRELOAD=$PRELOADING exec $LAUNCHER $JPARMS - ;; - *) - echo Error: Internal error, unknown launch mode \"$MODE\" - exit 1 - ;; -esac -RETVAL=$? -exit $RETVAL
--- a/hotspot/src/os/windows/launcher/java_md.c Mon Jun 03 13:20:46 2013 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1507 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 <ctype.h> -#include <windows.h> -#include <io.h> -#include <process.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> - -#include <jni.h> -#include "java.h" -#ifndef GAMMA -#include "version_comp.h" -#endif - -#define JVM_DLL "jvm.dll" -#define JAVA_DLL "java.dll" -#define CRT_DLL "msvcr71.dll" - -/* - * Prototypes. - */ -static jboolean GetPublicJREHome(char *path, jint pathsize); -static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize); -static jboolean GetJREPath(char *path, jint pathsize); -static void EnsureJreInstallation(const char *jrepath); - -/* We supports warmup for UI stack that is performed in parallel - * to VM initialization. - * This helps to improve startup of UI application as warmup phase - * might be long due to initialization of OS or hardware resources. - * It is not CPU bound and therefore it does not interfere with VM init. - * Obviously such warmup only has sense for UI apps and therefore it needs - * to be explicitly requested by passing -Dsun.awt.warmup=true property - * (this is always the case for plugin/javaws). - * - * Implementation launches new thread after VM starts and use it to perform - * warmup code (platform dependent). - * This thread is later reused as AWT toolkit thread as graphics toolkit - * often assume that they are used from the same thread they were launched on. - * - * At the moment we only support warmup for D3D. It only possible on windows - * and only if other flags do not prohibit this (e.g. OpenGL support requested). - */ -#undef ENABLE_AWT_PRELOAD -#ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */ - #ifdef _X86_ /* for now disable AWT preloading for 64bit */ - #define ENABLE_AWT_PRELOAD - #endif -#endif - -#ifdef ENABLE_AWT_PRELOAD -/* "AWT was preloaded" flag; - * Turned on by AWTPreload(). - */ -int awtPreloaded = 0; - -/* Calls a function with the name specified. - * The function must be int(*fn)(void). - */ -int AWTPreload(const char *funcName); -/* Stops AWT preloading. */ -void AWTPreloadStop(); - -/* D3D preloading */ -/* -1: not initialized; 0: OFF, 1: ON */ -int awtPreloadD3D = -1; -/* Command line parameter to swith D3D preloading on. */ -#define PARAM_PRELOAD_D3D "-Dsun.awt.warmup" -/* D3D/OpenGL management parameters (may disable D3D preloading) */ -#define PARAM_NODDRAW "-Dsun.java2d.noddraw" -#define PARAM_D3D "-Dsun.java2d.d3d" -#define PARAM_OPENGL "-Dsun.java2d.opengl" -/* funtion in awt.dll (src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp) */ -#define D3D_PRELOAD_FUNC "preloadD3D" - - -/* Extracts value of a parameter with the specified name - * from command line argument (returns pointer in the argument). - * Returns NULL if the argument does not contains the parameter. - * e.g.: - * GetParamValue("theParam", "theParam=value") returns pointer to "value". - */ -const char * GetParamValue(const char *paramName, const char *arg) { - int nameLen = strlen(paramName); - if (strncmp(paramName, arg, nameLen) == 0) { - // arg[nameLen] is valid (may contain final NULL) - if (arg[nameLen] == '=') { - return arg + nameLen + 1; - } - } - return NULL; -} - -/* Checks if commandline argument contains property specified - * and analyze it as boolean property (true/false). - * Returns -1 if the argument does not contain the parameter; - * Returns 1 if the argument contains the parameter and its value is "true"; - * Returns 0 if the argument contains the parameter and its value is "false". - */ -int GetBoolParamValue(const char *paramName, const char *arg) { - const char * paramValue = GetParamValue(paramName, arg); - if (paramValue != NULL) { - if (stricmp(paramValue, "true") == 0) { - return 1; - } - if (stricmp(paramValue, "false") == 0) { - return 0; - } - } - return -1; -} -#endif /* ENABLE_AWT_PRELOAD */ - - -const char * -GetArch() -{ - -#ifdef _M_AMD64 - return "amd64"; -#elif defined(_M_IA64) - return "ia64"; -#else - return "i386"; -#endif -} - -/* - * - */ -void -CreateExecutionEnvironment(int *_argc, - char ***_argv, - char jrepath[], - jint so_jrepath, - char jvmpath[], - jint so_jvmpath, - char **original_argv) { -#ifndef GAMMA - char * jvmtype; - - /* Find out where the JRE is that we will be using. */ - if (!GetJREPath(jrepath, so_jrepath)) { - ReportErrorMessage("Error: could not find Java SE Runtime Environment.", - JNI_TRUE); - exit(2); - } - - /* Do this before we read jvm.cfg */ - EnsureJreInstallation(jrepath); - - /* Find the specified JVM type */ - if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) { - ReportErrorMessage("Error: no known VMs. (check for corrupt jvm.cfg file)", - JNI_TRUE); - exit(1); - } - jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE); - - jvmpath[0] = '\0'; - if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) { - char * message=NULL; - const char * format = "Error: no `%s' JVM at `%s'."; - message = (char *)JLI_MemAlloc((strlen(format)+strlen(jvmtype)+ - strlen(jvmpath)) * sizeof(char)); - sprintf(message,format, jvmtype, jvmpath); - ReportErrorMessage(message, JNI_TRUE); - exit(4); - } - /* If we got here, jvmpath has been correctly initialized. */ - -#else /* ifndef GAMMA */ - - /* - * gamma launcher is simpler in that it doesn't handle VM flavors, data - * model, etc. Assuming everything is set-up correctly - * all we need to do here is to return correct path names. See also - * GetJVMPath() and GetApplicationHome(). - */ - - { - if (!GetJREPath(jrepath, so_jrepath) ) { - ReportErrorMessage("Error: could not find Java SE Runtime Environment.", - JNI_TRUE); - exit(2); - } - - if (!GetJVMPath(jrepath, NULL, jvmpath, so_jvmpath)) { - char * message=NULL; - const char * format = "Error: no JVM at `%s'."; - message = (char *)JLI_MemAlloc((strlen(format)+ - strlen(jvmpath)) * sizeof(char)); - sprintf(message, format, jvmpath); - ReportErrorMessage(message, JNI_TRUE); - exit(4); - } - } - -#endif /* ifndef GAMMA */ - -} - - -static jboolean -LoadMSVCRT() -{ - // Only do this once - static int loaded = 0; - char crtpath[MAXPATHLEN]; - - if (!loaded) { - /* - * The Microsoft C Runtime Library needs to be loaded first. A copy is - * assumed to be present in the "JRE path" directory. If it is not found - * there (or "JRE path" fails to resolve), skip the explicit load and let - * nature take its course, which is likely to be a failure to execute. - */ - if (GetJREPath(crtpath, MAXPATHLEN)) { - (void)strcat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */ - if (_launcher_debug) { - printf("CRT path is %s\n", crtpath); - } - if (_access(crtpath, 0) == 0) { - if (LoadLibrary(crtpath) == 0) { - ReportErrorMessage2("Error loading: %s", crtpath, JNI_TRUE); - return JNI_FALSE; - } - } - } - loaded = 1; - } - return JNI_TRUE; -} - -/* - * The preJVMStart is a function in the jkernel.dll, which - * performs the final step of synthesizing back the decomposed - * modules (partial install) to the full JRE. Any tool which - * uses the JRE must peform this step to ensure the complete synthesis. - * The EnsureJreInstallation function calls preJVMStart based on - * the conditions outlined below, noting that the operation - * will fail silently if any of conditions are not met. - * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg - * is read, since jvm.cfg will be modified by the preJVMStart. - * 1. Are we on a supported platform. - * 2. Find the location of the JRE or the Kernel JRE. - * 3. check existence of JREHOME/lib/bundles - * 4. check jkernel.dll and invoke the entry-point - */ -typedef VOID (WINAPI *PREJVMSTART)(); - -static void -EnsureJreInstallation(const char* jrepath) -{ - HINSTANCE handle; - char tmpbuf[MAXPATHLEN]; - PREJVMSTART PreJVMStart; - struct stat s; - - /* 32 bit windows only please */ - if (strcmp(GetArch(), "i386") != 0 ) { - if (_launcher_debug) { - printf("EnsureJreInstallation:unsupported platform\n"); - } - return; - } - /* Does our bundle directory exist ? */ - strcpy(tmpbuf, jrepath); - strcat(tmpbuf, "\\lib\\bundles"); - if (stat(tmpbuf, &s) != 0) { - if (_launcher_debug) { - printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf); - } - return; - } - /* Does our jkernel dll exist ? */ - strcpy(tmpbuf, jrepath); - strcat(tmpbuf, "\\bin\\jkernel.dll"); - if (stat(tmpbuf, &s) != 0) { - if (_launcher_debug) { - printf("EnsureJreInstallation:<%s>:not found\n", tmpbuf); - } - return; - } - /* The Microsoft C Runtime Library needs to be loaded first. */ - if (!LoadMSVCRT()) { - if (_launcher_debug) { - printf("EnsureJreInstallation:could not load C runtime DLL\n"); - } - return; - } - /* Load the jkernel.dll */ - if ((handle = LoadLibrary(tmpbuf)) == 0) { - if (_launcher_debug) { - printf("EnsureJreInstallation:%s:load failed\n", tmpbuf); - } - return; - } - /* Get the function address */ - PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart"); - if (PreJVMStart == NULL) { - if (_launcher_debug) { - printf("EnsureJreInstallation:preJVMStart:function lookup failed\n"); - } - FreeLibrary(handle); - return; - } - PreJVMStart(); - if (_launcher_debug) { - printf("EnsureJreInstallation:preJVMStart:called\n"); - } - FreeLibrary(handle); - return; -} - -/* - * Find path to JRE based on .exe's location or registry settings. - */ -jboolean -GetJREPath(char *path, jint pathsize) -{ - char javadll[MAXPATHLEN]; - struct stat s; - - if (GetApplicationHome(path, pathsize)) { - /* Is JRE co-located with the application? */ - sprintf(javadll, "%s\\bin\\" JAVA_DLL, path); - if (stat(javadll, &s) == 0) { - goto found; - } - - /* Does this app ship a private JRE in <apphome>\jre directory? */ - sprintf(javadll, "%s\\jre\\bin\\" JAVA_DLL, path); - if (stat(javadll, &s) == 0) { - strcat(path, "\\jre"); - goto found; - } - } - -#ifndef GAMMA - /* Look for a public JRE on this machine. */ - if (GetPublicJREHome(path, pathsize)) { - goto found; - } -#endif - - fprintf(stderr, "Error: could not find " JAVA_DLL "\n"); - return JNI_FALSE; - - found: - if (_launcher_debug) - printf("JRE path is %s\n", path); - return JNI_TRUE; -} - -/* - * Given a JRE location and a JVM type, construct what the name the - * JVM shared library will be. Return true, if such a library - * exists, false otherwise. - */ -static jboolean -GetJVMPath(const char *jrepath, const char *jvmtype, - char *jvmpath, jint jvmpathsize) -{ - struct stat s; - -#ifndef GAMMA - if (strchr(jvmtype, '/') || strchr(jvmtype, '\\')) { - sprintf(jvmpath, "%s\\" JVM_DLL, jvmtype); - } else { - sprintf(jvmpath, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype); - } -#else - /* - * For gamma launcher, JVM is either built-in or in the same directory. - * Either way we return "<exe_path>/jvm.dll" where <exe_path> is the - * directory where gamma launcher is located. - */ - - char *p; - GetModuleFileName(0, jvmpath, jvmpathsize); - - p = strrchr(jvmpath, '\\'); - if (p) { - /* replace executable name with libjvm.so */ - snprintf(p + 1, jvmpathsize - (p + 1 - jvmpath), "%s", JVM_DLL); - } else { - /* this case shouldn't happen */ - snprintf(jvmpath, jvmpathsize, "%s", JVM_DLL); - } -#endif /* ifndef GAMMA */ - - if (stat(jvmpath, &s) == 0) { - return JNI_TRUE; - } else { - return JNI_FALSE; - } -} - -/* - * Load a jvm from "jvmpath" and initialize the invocation functions. - */ -jboolean -LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) -{ -#ifdef GAMMA - /* JVM is directly linked with gamma launcher; no Loadlibrary() */ - ifn->CreateJavaVM = JNI_CreateJavaVM; - ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; - return JNI_TRUE; -#else - HINSTANCE handle; - - if (_launcher_debug) { - printf("JVM path is %s\n", jvmpath); - } - - /* The Microsoft C Runtime Library needs to be loaded first. */ - LoadMSVCRT(); - - /* Load the Java VM DLL */ - if ((handle = LoadLibrary(jvmpath)) == 0) { - ReportErrorMessage2("Error loading: %s", (char *)jvmpath, JNI_TRUE); - return JNI_FALSE; - } - - /* Now get the function addresses */ - ifn->CreateJavaVM = - (void *)GetProcAddress(handle, "JNI_CreateJavaVM"); - ifn->GetDefaultJavaVMInitArgs = - (void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs"); - if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) { - ReportErrorMessage2("Error: can't find JNI interfaces in: %s", - (char *)jvmpath, JNI_TRUE); - return JNI_FALSE; - } - - return JNI_TRUE; -#endif /* ifndef GAMMA */ -} - -/* - * If app is "c:\foo\bin\javac", then put "c:\foo" into buf. - */ -jboolean -GetApplicationHome(char *buf, jint bufsize) -{ -#ifndef GAMMA - char *cp; - GetModuleFileName(0, buf, bufsize); - *strrchr(buf, '\\') = '\0'; /* remove .exe file name */ - if ((cp = strrchr(buf, '\\')) == 0) { - /* This happens if the application is in a drive root, and - * there is no bin directory. */ - buf[0] = '\0'; - return JNI_FALSE; - } - *cp = '\0'; /* remove the bin\ part */ - return JNI_TRUE; - -#else /* ifndef GAMMA */ - - char env[MAXPATHLEN + 1]; - - /* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */ - - if (getenv("ALT_JAVA_HOME") != NULL) { - snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME")); - } - else { - char path[MAXPATHLEN + 1]; - char* p; - int len; - FILE* fp; - - // find the path to the currect executable - len = GetModuleFileName(NULL, path, MAXPATHLEN + 1); - if (len == 0 || len > MAXPATHLEN) { - printf("Could not get directory of current executable."); - return JNI_FALSE; - } - // remove last path component ("hotspot.exe") - p = strrchr(path, '\\'); - if (p == NULL) { - printf("Could not parse directory of current executable.\n"); - return JNI_FALSE; - } - *p = '\0'; - - // open jdkpath.txt and read JAVA_HOME from it - if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) { - printf("Path too long: %s\n", path); - return JNI_FALSE; - } - strcat(path, "\\jdkpath.txt"); - fp = fopen(path, "r"); - if (fp == NULL) { - printf("Could not open file %s to get path to JDK.\n", path); - return JNI_FALSE; - } - - if (fgets(buf, bufsize, fp) == NULL) { - printf("Could not read from file %s to get path to JDK.\n", path); - fclose(fp); - return JNI_FALSE; - } - // trim the buffer - p = buf + strlen(buf) - 1; - while(isspace(*p)) { - *p = '\0'; - p--; - } - fclose(fp); - } - - _snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf); - _putenv(env); - - return JNI_TRUE; -#endif /* ifndef GAMMA */ -} - -#ifdef JAVAW -__declspec(dllimport) char **__initenv; - -int WINAPI -WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow) -{ - int ret; - - __initenv = _environ; - ret = main(__argc, __argv); - - return ret; -} -#endif - -#ifndef GAMMA - -/* - * Helpers to look in the registry for a public JRE. - */ - /* Same for 1.5.0, 1.5.1, 1.5.2 etc. */ -#define DOTRELEASE JDK_MAJOR_VERSION "." JDK_MINOR_VERSION -#define JRE_KEY "Software\\JavaSoft\\Java Runtime Environment" - -static jboolean -GetStringFromRegistry(HKEY key, const char *name, char *buf, jint bufsize) -{ - DWORD type, size; - - if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0 - && type == REG_SZ - && (size < (unsigned int)bufsize)) { - if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0) { - return JNI_TRUE; - } - } - return JNI_FALSE; -} - -static jboolean -GetPublicJREHome(char *buf, jint bufsize) -{ - HKEY key, subkey; - char version[MAXPATHLEN]; - - /* - * Note: There is a very similar implementation of the following - * registry reading code in the Windows java control panel (javacp.cpl). - * If there are bugs here, a similar bug probably exists there. Hence, - * changes here require inspection there. - */ - - /* Find the current version of the JRE */ - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_READ, &key) != 0) { - fprintf(stderr, "Error opening registry key '" JRE_KEY "'\n"); - return JNI_FALSE; - } - - if (!GetStringFromRegistry(key, "CurrentVersion", - version, sizeof(version))) { - fprintf(stderr, "Failed reading value of registry key:\n\t" - JRE_KEY "\\CurrentVersion\n"); - RegCloseKey(key); - return JNI_FALSE; - } - - if (strcmp(version, DOTRELEASE) != 0) { - fprintf(stderr, "Registry key '" JRE_KEY "\\CurrentVersion'\nhas " - "value '%s', but '" DOTRELEASE "' is required.\n", version); - RegCloseKey(key); - return JNI_FALSE; - } - - /* Find directory where the current version is installed. */ - if (RegOpenKeyEx(key, version, 0, KEY_READ, &subkey) != 0) { - fprintf(stderr, "Error opening registry key '" - JRE_KEY "\\%s'\n", version); - RegCloseKey(key); - return JNI_FALSE; - } - - if (!GetStringFromRegistry(subkey, "JavaHome", buf, bufsize)) { - fprintf(stderr, "Failed reading value of registry key:\n\t" - JRE_KEY "\\%s\\JavaHome\n", version); - RegCloseKey(key); - RegCloseKey(subkey); - return JNI_FALSE; - } - - if (_launcher_debug) { - char micro[MAXPATHLEN]; - if (!GetStringFromRegistry(subkey, "MicroVersion", micro, - sizeof(micro))) { - printf("Warning: Can't read MicroVersion\n"); - micro[0] = '\0'; - } - printf("Version major.minor.micro = %s.%s\n", version, micro); - } - - RegCloseKey(key); - RegCloseKey(subkey); - return JNI_TRUE; -} - -#endif /* ifndef GAMMA */ - -/* - * Support for doing cheap, accurate interval timing. - */ -static jboolean counterAvailable = JNI_FALSE; -static jboolean counterInitialized = JNI_FALSE; -static LARGE_INTEGER counterFrequency; - -jlong CounterGet() -{ - LARGE_INTEGER count; - - if (!counterInitialized) { - counterAvailable = QueryPerformanceFrequency(&counterFrequency); - counterInitialized = JNI_TRUE; - } - if (!counterAvailable) { - return 0; - } - QueryPerformanceCounter(&count); - return (jlong)(count.QuadPart); -} - -jlong Counter2Micros(jlong counts) -{ - if (!counterAvailable || !counterInitialized) { - return 0; - } - return (counts * 1000 * 1000)/counterFrequency.QuadPart; -} - -void ReportErrorMessage(char * message, jboolean always) { -#ifdef JAVAW - if (message != NULL) { - MessageBox(NULL, message, "Java Virtual Machine Launcher", - (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); - } -#else - if (always) { - fprintf(stderr, "%s\n", message); - } -#endif -} - -void ReportErrorMessage2(char * format, char * string, jboolean always) { - /* - * The format argument must be a printf format string with one %s - * argument, which is passed the string argument. - */ -#ifdef JAVAW - size_t size; - char * message; - size = strlen(format) + strlen(string); - message = (char*)JLI_MemAlloc(size*sizeof(char)); - sprintf(message, (const char *)format, string); - - if (message != NULL) { - MessageBox(NULL, message, "Java Virtual Machine Launcher", - (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); - JLI_MemFree(message); - } -#else - if (always) { - fprintf(stderr, (const char *)format, string); - fprintf(stderr, "\n"); - } -#endif -} - -/* - * As ReportErrorMessage2 (above) except the system message (if any) - * associated with this error is written to a second %s format specifier - * in the format argument. - */ -void ReportSysErrorMessage2(char * format, char * string, jboolean always) { - int save_errno = errno; - DWORD errval; - int freeit = 0; - char *errtext = NULL; - - if ((errval = GetLastError()) != 0) { /* Platform SDK / DOS Error */ - int n = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM| - FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, errval, 0, (LPTSTR)&errtext, 0, NULL); - if (errtext == NULL || n == 0) { /* Paranoia check */ - errtext = ""; - n = 0; - } else { - freeit = 1; - if (n > 2) { /* Drop final CR, LF */ - if (errtext[n - 1] == '\n') n--; - if (errtext[n - 1] == '\r') n--; - errtext[n] = '\0'; - } - } - } else /* C runtime error that has no corresponding DOS error code */ - errtext = strerror(save_errno); - -#ifdef JAVAW - { - size_t size; - char * message; - size = strlen(format) + strlen(string) + strlen(errtext); - message = (char*)JLI_MemAlloc(size*sizeof(char)); - sprintf(message, (const char *)format, string, errtext); - - if (message != NULL) { - MessageBox(NULL, message, "Java Virtual Machine Launcher", - (MB_OK|MB_ICONSTOP|MB_APPLMODAL)); - JLI_MemFree(message); - } - } -#else - if (always) { - fprintf(stderr, (const char *)format, string, errtext); - fprintf(stderr, "\n"); - } -#endif - if (freeit) - (void)LocalFree((HLOCAL)errtext); -} - -void ReportExceptionDescription(JNIEnv * env) { -#ifdef JAVAW - /* - * This code should be replaced by code which opens a window with - * the exception detail message. - */ - (*env)->ExceptionDescribe(env); -#else - (*env)->ExceptionDescribe(env); -#endif -} - - -/* - * Return JNI_TRUE for an option string that has no effect but should - * _not_ be passed on to the vm; return JNI_FALSE otherwise. On - * windows, there are no options that should be screened in this - * manner. - */ -jboolean RemovableMachineDependentOption(char * option) { -#ifdef ENABLE_AWT_PRELOAD - if (awtPreloadD3D < 0) { - /* Tests the command line parameter only if not set yet. */ - if (GetBoolParamValue(PARAM_PRELOAD_D3D, option) == 1) { - awtPreloadD3D = 1; - } - } - if (awtPreloadD3D != 0) { - /* Don't test the command line parameters if already disabled. */ - if (GetBoolParamValue(PARAM_NODDRAW, option) == 1 - || GetBoolParamValue(PARAM_D3D, option) == 0 - || GetBoolParamValue(PARAM_OPENGL, option) == 1) - { - awtPreloadD3D = 0; - } - } -#endif /* ENABLE_AWT_PRELOAD */ - - return JNI_FALSE; -} - -void PrintMachineDependentOptions() { - return; -} - -#ifndef GAMMA - -jboolean -ServerClassMachine() { - jboolean result = JNI_FALSE; -#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_FALSE; -#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE) - result = JNI_TRUE; -#endif - return result; -} - -/* - * Determine if there is an acceptable JRE in the registry directory top_key. - * Upon locating the "best" one, return a fully qualified path to it. - * "Best" is defined as the most advanced JRE meeting the constraints - * contained in the manifest_info. If no JRE in this directory meets the - * constraints, return NULL. - * - * It doesn't matter if we get an error reading the registry, or we just - * don't find anything interesting in the directory. We just return NULL - * in either case. - */ -static char * -ProcessDir(manifest_info* info, HKEY top_key) { - DWORD index = 0; - HKEY ver_key; - char name[MAXNAMELEN]; - int len; - char *best = NULL; - - /* - * Enumerate "<top_key>/SOFTWARE/JavaSoft/Java Runtime Environment" - * searching for the best available version. - */ - while (RegEnumKey(top_key, index, name, MAXNAMELEN) == ERROR_SUCCESS) { - index++; - if (JLI_AcceptableRelease(name, info->jre_version)) - if ((best == NULL) || (JLI_ExactVersionId(name, best) > 0)) { - if (best != NULL) - JLI_MemFree(best); - best = JLI_StringDup(name); - } - } - - /* - * Extract "JavaHome" from the "best" registry directory and return - * that path. If no appropriate version was located, or there is an - * error in extracting the "JavaHome" string, return null. - */ - if (best == NULL) - return (NULL); - else { - if (RegOpenKeyEx(top_key, best, 0, KEY_READ, &ver_key) - != ERROR_SUCCESS) { - JLI_MemFree(best); - if (ver_key != NULL) - RegCloseKey(ver_key); - return (NULL); - } - JLI_MemFree(best); - len = MAXNAMELEN; - if (RegQueryValueEx(ver_key, "JavaHome", NULL, NULL, (LPBYTE)name, &len) - != ERROR_SUCCESS) { - if (ver_key != NULL) - RegCloseKey(ver_key); - return (NULL); - } - if (ver_key != NULL) - RegCloseKey(ver_key); - return (JLI_StringDup(name)); - } -} - -/* - * This is the global entry point. It examines the host for the optimal - * JRE to be used by scanning a set of registry entries. This set of entries - * is hardwired on Windows as "Software\JavaSoft\Java Runtime Environment" - * under the set of roots "{ HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }". - * - * This routine simply opens each of these registry directories before passing - * control onto ProcessDir(). - */ -char * -LocateJRE(manifest_info* info) { - HKEY key = NULL; - char *path; - int key_index; - HKEY root_keys[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE }; - - for (key_index = 0; key_index <= 1; key_index++) { - if (RegOpenKeyEx(root_keys[key_index], JRE_KEY, 0, KEY_READ, &key) - == ERROR_SUCCESS) - if ((path = ProcessDir(info, key)) != NULL) { - if (key != NULL) - RegCloseKey(key); - return (path); - } - if (key != NULL) - RegCloseKey(key); - } - return NULL; -} - - -/* - * Local helper routine to isolate a single token (option or argument) - * from the command line.