Merge
This commit is contained in:
commit
c52bff739b
@ -4,6 +4,7 @@ nbproject/private/
|
|||||||
^webrev
|
^webrev
|
||||||
^.hgtip
|
^.hgtip
|
||||||
^.bridge2
|
^.bridge2
|
||||||
|
^.jib/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.metadata/
|
.metadata/
|
||||||
.recommenders/
|
.recommenders/
|
||||||
|
2
.hgtags
2
.hgtags
@ -337,3 +337,5 @@ d131f4b8433a79408f935eff9bf92a0664229b60 jdk9-b90
|
|||||||
f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
|
f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
|
||||||
09206c6513b300e1ac8541f3be012e1a49312104 jdk9-b93
|
09206c6513b300e1ac8541f3be012e1a49312104 jdk9-b93
|
||||||
25a2cab05cfbe6034b71d9e72d64c65b0572ce63 jdk9-b94
|
25a2cab05cfbe6034b71d9e72d64c65b0572ce63 jdk9-b94
|
||||||
|
5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95
|
||||||
|
139f19d70350238e15e107945cea75082b6380b3 jdk-9+96
|
||||||
|
@ -337,3 +337,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
|
|||||||
106c06398f7ab330eef9e335fbd3a5a8ead23b77 jdk9-b92
|
106c06398f7ab330eef9e335fbd3a5a8ead23b77 jdk9-b92
|
||||||
331fda57dfd323c61804ba0472776790de572937 jdk9-b93
|
331fda57dfd323c61804ba0472776790de572937 jdk9-b93
|
||||||
349488425abcaf3ff62f580007860b4b56875d10 jdk9-b94
|
349488425abcaf3ff62f580007860b4b56875d10 jdk9-b94
|
||||||
|
12a6fb4f070f8ca8fbca219ab9abf5da8908b317 jdk-9+95
|
||||||
|
5582a79892596169ebddb3e2c2aa44939e4e3f40 jdk-9+96
|
||||||
|
@ -99,7 +99,13 @@ AC_DEFUN([BASIC_FIXUP_PATH],
|
|||||||
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
|
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$1="`cd "$path"; $THEPWDCMD -L`"
|
if test -d "$path"; then
|
||||||
|
$1="`cd "$path"; $THEPWDCMD -L`"
|
||||||
|
else
|
||||||
|
dir="`$DIRNAME "$path"`"
|
||||||
|
base="`$BASENAME "$path"`"
|
||||||
|
$1="`cd "$dir"; $THEPWDCMD -L`/$base"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
@ -237,12 +243,18 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH],
|
|||||||
# Register a --enable argument but mark it as deprecated
|
# Register a --enable argument but mark it as deprecated
|
||||||
# $1: The name of the with argument to deprecate, not including --enable-
|
# $1: The name of the with argument to deprecate, not including --enable-
|
||||||
# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
|
# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
|
||||||
|
# $3: Messages to user.
|
||||||
AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
|
AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
|
||||||
[
|
[
|
||||||
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
|
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
|
||||||
[Deprecated. Option is kept for backwards compatibility and is ignored])])
|
[Deprecated. Option is kept for backwards compatibility and is ignored])])
|
||||||
if test "x$enable_$2" != x; then
|
if test "x$enable_$2" != x; then
|
||||||
AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
|
AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
|
||||||
|
|
||||||
|
if test "x$3" != x; then
|
||||||
|
AC_MSG_WARN([$3])
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -1072,6 +1084,26 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
|
|||||||
AC_SUBST(BASH_ARGS)
|
AC_SUBST(BASH_ARGS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Default make target
|
||||||
|
#
|
||||||
|
AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
|
||||||
|
[
|
||||||
|
AC_ARG_WITH(default-make-target, [AS_HELP_STRING([--with-default-make-target],
|
||||||
|
[set the default make target @<:@exploded-image@:>@])])
|
||||||
|
if test "x$with_default_make_target" = "x" \
|
||||||
|
|| test "x$with_default_make_target" = "xyes"; then
|
||||||
|
DEFAULT_MAKE_TARGET="exploded-image"
|
||||||
|
elif test "x$with_default_make_target" = "xno"; then
|
||||||
|
AC_MSG_ERROR([--without-default-make-target is not a valid option])
|
||||||
|
else
|
||||||
|
DEFAULT_MAKE_TARGET="$with_default_make_target"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(DEFAULT_MAKE_TARGET)
|
||||||
|
])
|
||||||
|
|
||||||
# Code to run after AC_OUTPUT
|
# Code to run after AC_OUTPUT
|
||||||
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
|
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
|
||||||
[
|
[
|
||||||
|
@ -423,7 +423,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
|
|||||||
AC_MSG_ERROR([fixpath did not work!])
|
AC_MSG_ERROR([fixpath did not work!])
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
|
|
||||||
|
FIXPATH_DETACH_FLAG="--detach"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(FIXPATH)
|
AC_SUBST(FIXPATH)
|
||||||
|
AC_SUBST(FIXPATH_DETACH_FLAG)
|
||||||
])
|
])
|
||||||
|
@ -375,6 +375,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
|||||||
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
|
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
|
||||||
AC_SUBST(JAVA_FLAGS_BIG)
|
AC_SUBST(JAVA_FLAGS_BIG)
|
||||||
|
|
||||||
|
# By default, the main javac compilations use big
|
||||||
|
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
|
||||||
|
AC_SUBST(JAVA_FLAGS_JAVAC)
|
||||||
|
|
||||||
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])
|
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])
|
||||||
|
|
||||||
|
@ -59,3 +59,8 @@ JAVAH_CMD:=$(BOOT_JDK)/bin/javah
|
|||||||
JAR_CMD:=$(BOOT_JDK)/bin/jar
|
JAR_CMD:=$(BOOT_JDK)/bin/jar
|
||||||
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
|
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
|
||||||
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
|
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
|
||||||
|
# When building a 32bit target, make sure the sjavac server flags are compatible
|
||||||
|
# with a 32bit JVM.
|
||||||
|
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
|
||||||
|
SJAVAC_SERVER_JAVA_FLAGS:= -Xms256M -Xmx1500M
|
||||||
|
endif
|
||||||
|
@ -138,14 +138,6 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
|
|||||||
JOBS="$memory_gb"
|
JOBS="$memory_gb"
|
||||||
else
|
else
|
||||||
JOBS="$NUM_CORES"
|
JOBS="$NUM_CORES"
|
||||||
# On bigger machines, leave some room for other processes to run
|
|
||||||
if test "$JOBS" -gt "4"; then
|
|
||||||
JOBS=`expr $JOBS '*' 90 / 100`
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# Cap number of jobs to 16
|
|
||||||
if test "$JOBS" -gt "16"; then
|
|
||||||
JOBS=16
|
|
||||||
fi
|
fi
|
||||||
if test "$JOBS" -eq "0"; then
|
if test "$JOBS" -eq "0"; then
|
||||||
JOBS=1
|
JOBS=1
|
||||||
@ -246,6 +238,73 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# Optionally enable distributed compilation of native code using icecc/icecream
|
||||||
|
#
|
||||||
|
AC_DEFUN([BPERF_SETUP_ICECC],
|
||||||
|
[
|
||||||
|
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
|
||||||
|
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
|
||||||
|
|
||||||
|
if test "x${enable_icecc}" = "xyes"; then
|
||||||
|
BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
|
||||||
|
old_path="$PATH"
|
||||||
|
|
||||||
|
# Look for icecc-create-env in some known places
|
||||||
|
PATH="$PATH:/usr/lib/icecc:/usr/lib64/icecc"
|
||||||
|
BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env)
|
||||||
|
# Use icecc-create-env to create a minimal compilation environment that can
|
||||||
|
# be sent to the other hosts in the icecream cluster.
|
||||||
|
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
|
||||||
|
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
|
||||||
|
AC_MSG_CHECKING([for icecc build environment for target compiler])
|
||||||
|
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
|
||||||
|
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||||
|
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
|
||||||
|
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||||
|
# For clang, the icecc compilerwrapper is needed. It usually resides next
|
||||||
|
# to icecc-create-env.
|
||||||
|
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
|
||||||
|
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||||
|
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
|
||||||
|
fi
|
||||||
|
PATH="$old_path"
|
||||||
|
# The bundle with the compiler gets a name based on checksums. Parse log file
|
||||||
|
# to find it.
|
||||||
|
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
|
||||||
|
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
|
||||||
|
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
|
||||||
|
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
|
||||||
|
|
||||||
|
if test "x${COMPILE_TYPE}" = "xcross"; then
|
||||||
|
# If cross compiling, create a separate env package for the build compiler
|
||||||
|
AC_MSG_CHECKING([for icecc build environment for build compiler])
|
||||||
|
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
|
||||||
|
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
|
||||||
|
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||||
|
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
|
||||||
|
elif test "x${BUILD_CC##*/}" = "xclang"; then
|
||||||
|
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
|
||||||
|
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
|
||||||
|
fi
|
||||||
|
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
|
||||||
|
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
|
||||||
|
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
|
||||||
|
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
|
||||||
|
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
|
||||||
|
else
|
||||||
|
BUILD_ICECC="${ICECC}"
|
||||||
|
fi
|
||||||
|
AC_SUBST(ICECC)
|
||||||
|
AC_SUBST(BUILD_ICECC)
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||||
[
|
[
|
||||||
|
|
||||||
@ -258,8 +317,15 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
|||||||
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
|
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
|
||||||
|
|
||||||
USE_PRECOMPILED_HEADER=1
|
USE_PRECOMPILED_HEADER=1
|
||||||
|
AC_MSG_CHECKING([If precompiled header is enabled])
|
||||||
if test "x$ENABLE_PRECOMPH" = xno; then
|
if test "x$ENABLE_PRECOMPH" = xno; then
|
||||||
|
AC_MSG_RESULT([no, forced])
|
||||||
USE_PRECOMPILED_HEADER=0
|
USE_PRECOMPILED_HEADER=0
|
||||||
|
elif test "x$ICECC" != "x"; then
|
||||||
|
AC_MSG_RESULT([no, does not work effectively with icecc])
|
||||||
|
USE_PRECOMPILED_HEADER=0
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$ENABLE_PRECOMPH" = xyes; then
|
if test "x$ENABLE_PRECOMPH" = xyes; then
|
||||||
@ -337,9 +403,9 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
|||||||
AC_MSG_RESULT([$ENABLE_SJAVAC])
|
AC_MSG_RESULT([$ENABLE_SJAVAC])
|
||||||
AC_SUBST(ENABLE_SJAVAC)
|
AC_SUBST(ENABLE_SJAVAC)
|
||||||
|
|
||||||
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
|
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server],
|
||||||
[use only the server part of sjavac for faster javac compiles @<:@disabled@:>@])],
|
[disable javac server @<:@enabled@:>@])],
|
||||||
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="no"])
|
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"])
|
||||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||||
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
|
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
|
||||||
ENABLE_JAVAC_SERVER="no"
|
ENABLE_JAVAC_SERVER="no"
|
||||||
@ -347,4 +413,10 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
|||||||
AC_MSG_CHECKING([whether to use javac server])
|
AC_MSG_CHECKING([whether to use javac server])
|
||||||
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
|
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
|
||||||
AC_SUBST(ENABLE_JAVAC_SERVER)
|
AC_SUBST(ENABLE_JAVAC_SERVER)
|
||||||
|
|
||||||
|
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
|
||||||
|
# When using a server javac, the small client instances do not need much
|
||||||
|
# resources.
|
||||||
|
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
|
||||||
|
fi
|
||||||
])
|
])
|
||||||
|
8
common/autoconf/configure
vendored
8
common/autoconf/configure
vendored
@ -257,10 +257,14 @@ fi
|
|||||||
|
|
||||||
# Now transfer control to the script generated by autoconf. This is where the
|
# Now transfer control to the script generated by autoconf. This is where the
|
||||||
# main work is done.
|
# main work is done.
|
||||||
|
RCDIR=`mktemp -dt jdk-build-configure.tmp.XXXXXX` || exit $?
|
||||||
|
trap "rm -rf \"$RCDIR\"" EXIT
|
||||||
conf_logfile=./configure.log
|
conf_logfile=./configure.log
|
||||||
(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
|
(exec 3>&1 ; ((. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) \
|
||||||
|
; echo $? > "$RCDIR/rc" ) \
|
||||||
|
| tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
|
||||||
|
|
||||||
conf_result_code=$?
|
conf_result_code=`cat "$RCDIR/rc"`
|
||||||
###
|
###
|
||||||
### Post-processing
|
### Post-processing
|
||||||
###
|
###
|
||||||
|
@ -121,6 +121,9 @@ PKG_PROG_PKG_CONFIG
|
|||||||
# After basic tools have been setup, we can check build os specific details.
|
# After basic tools have been setup, we can check build os specific details.
|
||||||
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
|
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
|
||||||
|
|
||||||
|
# Misc basic settings
|
||||||
|
BASIC_SETUP_DEFAULT_MAKE_TARGET
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Determine OpenJDK variants, options and version numbers.
|
# Determine OpenJDK variants, options and version numbers.
|
||||||
@ -237,6 +240,9 @@ BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
|
|||||||
# Setup smart javac (after cores and memory have been setup)
|
# Setup smart javac (after cores and memory have been setup)
|
||||||
BPERF_SETUP_SMART_JAVAC
|
BPERF_SETUP_SMART_JAVAC
|
||||||
|
|
||||||
|
# Setup use of icecc if requested
|
||||||
|
BPERF_SETUP_ICECC
|
||||||
|
|
||||||
# Can the C/C++ compiler use precompiled headers?
|
# Can the C/C++ compiler use precompiled headers?
|
||||||
BPERF_SETUP_PRECOMPILED_HEADERS
|
BPERF_SETUP_PRECOMPILED_HEADERS
|
||||||
|
|
||||||
|
@ -976,6 +976,19 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
|
|||||||
DISABLE_WARNING_PREFIX=
|
DISABLE_WARNING_PREFIX=
|
||||||
fi
|
fi
|
||||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||||
|
# Repeate the check for the BUILD_CC
|
||||||
|
CC_OLD="$CC"
|
||||||
|
CC="$BUILD_CC"
|
||||||
|
FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
|
||||||
|
[BUILD_CC_CAN_DISABLE_WARNINGS=true],
|
||||||
|
[BUILD_CC_CAN_DISABLE_WARNINGS=false]
|
||||||
|
)
|
||||||
|
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
|
||||||
|
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
|
||||||
|
else
|
||||||
|
BUILD_CC_DISABLE_WARNING_PREFIX=
|
||||||
|
fi
|
||||||
|
CC="$CC_OLD"
|
||||||
;;
|
;;
|
||||||
clang)
|
clang)
|
||||||
DISABLE_WARNING_PREFIX="-Wno-"
|
DISABLE_WARNING_PREFIX="-Wno-"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -49,8 +49,8 @@ ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
|
|||||||
|
|
||||||
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
|
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
|
||||||
# compiler that produces code that can be run on the build platform.
|
# compiler that produces code that can be run on the build platform.
|
||||||
HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
|
HOSTCC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
|
||||||
HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
|
HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
#
|
#
|
||||||
@ -105,7 +105,7 @@ USE_CLANG := @USE_CLANG@
|
|||||||
|
|
||||||
# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
|
# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
|
||||||
# Hotspot has its own handling on the Windows path situation.
|
# Hotspot has its own handling on the Windows path situation.
|
||||||
CXX:=@CCACHE@ @HOTSPOT_CXX@
|
CXX:=@CCACHE@ @ICECC@ @HOTSPOT_CXX@
|
||||||
LD:=@HOTSPOT_LD@
|
LD:=@HOTSPOT_LD@
|
||||||
MT:=@HOTSPOT_MT@
|
MT:=@HOTSPOT_MT@
|
||||||
RC:=@HOTSPOT_RC@
|
RC:=@HOTSPOT_RC@
|
||||||
|
@ -491,53 +491,74 @@ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
|||||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||||
[
|
[
|
||||||
#
|
#
|
||||||
# ENABLE_DEBUG_SYMBOLS
|
# NATIVE_DEBUG_SYMBOLS
|
||||||
# This must be done after the toolchain is setup, since we're looking at objcopy.
|
# This must be done after the toolchain is setup, since we're looking at objcopy.
|
||||||
#
|
#
|
||||||
AC_ARG_ENABLE([debug-symbols],
|
AC_MSG_CHECKING([what type of native debug symbols to use])
|
||||||
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
|
AC_ARG_WITH([native-debug-symbols],
|
||||||
|
[AS_HELP_STRING([--with-native-debug-symbols],
|
||||||
|
[set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
|
||||||
|
[],
|
||||||
|
[with_native_debug_symbols="zipped"])
|
||||||
|
NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
|
||||||
|
AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
|
||||||
|
|
||||||
AC_MSG_CHECKING([if we should generate debug symbols])
|
if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
|
||||||
|
|
||||||
if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
|
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||||
# explicit enabling of enable-debug-symbols and can't find objcopy
|
if test "x$OBJCOPY" = x; then
|
||||||
# this is an error
|
# enabling of enable-debug-symbols and can't find objcopy
|
||||||
AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
|
# this is an error
|
||||||
fi
|
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
||||||
|
fi
|
||||||
if test "x$enable_debug_symbols" = "xyes"; then
|
|
||||||
ENABLE_DEBUG_SYMBOLS=true
|
|
||||||
elif test "x$enable_debug_symbols" = "xno"; then
|
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
|
||||||
else
|
|
||||||
# Default is on if objcopy is found
|
|
||||||
if test "x$OBJCOPY" != x; then
|
|
||||||
ENABLE_DEBUG_SYMBOLS=true
|
|
||||||
# MacOS X and Windows don't use objcopy but default is on for those OSes
|
|
||||||
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
|
|
||||||
ENABLE_DEBUG_SYMBOLS=true
|
|
||||||
else
|
|
||||||
ENABLE_DEBUG_SYMBOLS=false
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
|
|
||||||
#
|
|
||||||
# ZIP_DEBUGINFO_FILES
|
|
||||||
#
|
|
||||||
AC_MSG_CHECKING([if we should zip debug-info files])
|
|
||||||
AC_ARG_ENABLE([zip-debug-info],
|
|
||||||
[AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
|
|
||||||
[enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
|
|
||||||
AC_MSG_RESULT([${enable_zip_debug_info}])
|
|
||||||
|
|
||||||
if test "x${enable_zip_debug_info}" = "xno"; then
|
|
||||||
ZIP_DEBUGINFO_FILES=false
|
|
||||||
else
|
|
||||||
ZIP_DEBUGINFO_FILES=true
|
ZIP_DEBUGINFO_FILES=true
|
||||||
|
DEBUG_BINARIES=true
|
||||||
|
STRIP_POLICY=min_strip
|
||||||
|
elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
|
||||||
|
ENABLE_DEBUG_SYMBOLS=false
|
||||||
|
ZIP_DEBUGINFO_FILES=false
|
||||||
|
DEBUG_BINARIES=false
|
||||||
|
STRIP_POLICY=no_strip
|
||||||
|
elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
|
||||||
|
ENABLE_DEBUG_SYMBOLS=false # -g option only
|
||||||
|
ZIP_DEBUGINFO_FILES=false
|
||||||
|
DEBUG_BINARIES=true
|
||||||
|
STRIP_POLICY=no_strip
|
||||||
|
STRIP=""
|
||||||
|
elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
|
||||||
|
|
||||||
|
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||||
|
if test "x$OBJCOPY" = x; then
|
||||||
|
# enabling of enable-debug-symbols and can't find objcopy
|
||||||
|
# this is an error
|
||||||
|
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
ENABLE_DEBUG_SYMBOLS=true
|
||||||
|
ZIP_DEBUGINFO_FILES=false
|
||||||
|
DEBUG_BINARIES=true
|
||||||
|
STRIP_POLICY=min_strip
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --enable-debug-symbols is deprecated.
|
||||||
|
# Please use --with-native-debug-symbols=[internal,external,zipped] .
|
||||||
|
BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
|
||||||
|
[Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
|
||||||
|
|
||||||
|
# --enable-zip-debug-info is deprecated.
|
||||||
|
# Please use --with-native-debug-symbols=zipped .
|
||||||
|
BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
|
||||||
|
[Please use --with-native-debug-symbols=zipped .])
|
||||||
|
|
||||||
|
AC_SUBST(NATIVE_DEBUG_SYMBOLS)
|
||||||
|
AC_SUBST(DEBUG_BINARIES)
|
||||||
|
AC_SUBST(STRIP_POLICY)
|
||||||
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
|
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
|
||||||
AC_SUBST(ZIP_DEBUGINFO_FILES)
|
AC_SUBST(ZIP_DEBUGINFO_FILES)
|
||||||
])
|
])
|
||||||
|
@ -271,6 +271,9 @@ SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
|
|||||||
# Number of parallel jobs to use for compilation
|
# Number of parallel jobs to use for compilation
|
||||||
JOBS?=@JOBS@
|
JOBS?=@JOBS@
|
||||||
|
|
||||||
|
# Default make target
|
||||||
|
DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@
|
||||||
|
|
||||||
FREETYPE_LIBS:=@FREETYPE_LIBS@
|
FREETYPE_LIBS:=@FREETYPE_LIBS@
|
||||||
FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
|
FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
|
||||||
FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
|
FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
|
||||||
@ -329,7 +332,7 @@ WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
|||||||
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
||||||
|
|
||||||
# Tools that potentially need to be cross compilation aware.
|
# Tools that potentially need to be cross compilation aware.
|
||||||
CC:=@FIXPATH@ @CCACHE@ @CC@
|
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
|
||||||
|
|
||||||
# CFLAGS used to compile the jdk native libraries (C-code)
|
# CFLAGS used to compile the jdk native libraries (C-code)
|
||||||
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
|
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
|
||||||
@ -339,7 +342,7 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
|
|||||||
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
||||||
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
||||||
|
|
||||||
CXX:=@FIXPATH@ @CCACHE@ @CXX@
|
CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@
|
||||||
#CXXFLAGS:=@CXXFLAGS@
|
#CXXFLAGS:=@CXXFLAGS@
|
||||||
|
|
||||||
CPP:=@FIXPATH@ @CPP@
|
CPP:=@FIXPATH@ @CPP@
|
||||||
@ -382,8 +385,12 @@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
|
|||||||
|
|
||||||
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
|
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
|
||||||
# build platform.
|
# build platform.
|
||||||
BUILD_CC:=@FIXPATH@ @BUILD_CC@
|
BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
|
||||||
|
BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
|
||||||
BUILD_LD:=@FIXPATH@ @BUILD_LD@
|
BUILD_LD:=@FIXPATH@ @BUILD_LD@
|
||||||
|
BUILD_AS:=@FIXPATH@ @BUILD_AS@
|
||||||
|
BUILD_AR:=@FIXPATH@ @BUILD_AR@
|
||||||
|
BUILD_NM:=@FIXPATH@ @BUILD_NM@
|
||||||
BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
|
BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
|
||||||
BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
|
BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
|
||||||
|
|
||||||
@ -414,6 +421,9 @@ ENABLE_DEBUG_SYMBOLS:=@ENABLE_DEBUG_SYMBOLS@
|
|||||||
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
|
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
|
||||||
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
|
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
|
||||||
ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@
|
ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@
|
||||||
|
NATIVE_DEBUG_SYMBOLS:=@NATIVE_DEBUG_SYMBOLS@
|
||||||
|
DEBUG_BINARIES:=@DEBUG_BINARIES@
|
||||||
|
STRIP_POLICY:=@STRIP_POLICY@
|
||||||
|
|
||||||
#
|
#
|
||||||
# Compress (or not) jars
|
# Compress (or not) jars
|
||||||
@ -446,6 +456,7 @@ STRIPFLAGS:=@STRIPFLAGS@
|
|||||||
JAVA_FLAGS:=@JAVA_FLAGS@
|
JAVA_FLAGS:=@JAVA_FLAGS@
|
||||||
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
|
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
|
||||||
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
|
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
|
||||||
|
JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@
|
||||||
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
|
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
|
||||||
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
|
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
|
||||||
|
|
||||||
@ -462,13 +473,15 @@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
|
|||||||
# it possible to override only the *_CMD variables.
|
# it possible to override only the *_CMD variables.
|
||||||
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
|
||||||
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
|
||||||
|
JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
|
||||||
JAVAC=@FIXPATH@ $(JAVAC_CMD)
|
JAVAC=@FIXPATH@ $(JAVAC_CMD)
|
||||||
JAVAH=@FIXPATH@ $(JAVAH_CMD)
|
JAVAH=@FIXPATH@ $(JAVAH_CMD)
|
||||||
JAR=@FIXPATH@ $(JAR_CMD)
|
JAR=@FIXPATH@ $(JAR_CMD)
|
||||||
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
||||||
# A specific java binary with specific options can be used to run
|
# A specific java binary with specific options can be used to run
|
||||||
# the long running background sjavac servers and other long running tasks.
|
# the long running background sjavac servers and other long running tasks.
|
||||||
SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAGS)
|
SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
|
||||||
|
$(SJAVAC_SERVER_JAVA_FLAGS)
|
||||||
|
|
||||||
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
|
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
|
||||||
# overriding that value by using ?=.
|
# overriding that value by using ?=.
|
||||||
|
@ -539,6 +539,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
|||||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||||
# The corresponding ar tool is lib.exe (used to create static libraries)
|
# The corresponding ar tool is lib.exe (used to create static libraries)
|
||||||
AC_CHECK_PROG([AR], [lib],[lib],,,)
|
AC_CHECK_PROG([AR], [lib],[lib],,,)
|
||||||
|
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||||
|
BASIC_CHECK_TOOLS(AR, ar gcc-ar)
|
||||||
else
|
else
|
||||||
BASIC_CHECK_TOOLS(AR, ar)
|
BASIC_CHECK_TOOLS(AR, ar)
|
||||||
fi
|
fi
|
||||||
@ -584,7 +586,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
|
|||||||
# FIXME: we should unify this with the solaris case above.
|
# FIXME: we should unify this with the solaris case above.
|
||||||
BASIC_CHECK_TOOLS(STRIP, strip)
|
BASIC_CHECK_TOOLS(STRIP, strip)
|
||||||
BASIC_FIXUP_EXECUTABLE(STRIP)
|
BASIC_FIXUP_EXECUTABLE(STRIP)
|
||||||
BASIC_CHECK_TOOLS(NM, nm)
|
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||||
|
BASIC_CHECK_TOOLS(NM, nm gcc-nm)
|
||||||
|
else
|
||||||
|
BASIC_CHECK_TOOLS(NM, nm)
|
||||||
|
fi
|
||||||
BASIC_FIXUP_EXECUTABLE(NM)
|
BASIC_FIXUP_EXECUTABLE(NM)
|
||||||
GNM="$NM"
|
GNM="$NM"
|
||||||
AC_SUBST(GNM)
|
AC_SUBST(GNM)
|
||||||
@ -717,6 +723,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
|||||||
BASIC_FIXUP_EXECUTABLE(BUILD_CC)
|
BASIC_FIXUP_EXECUTABLE(BUILD_CC)
|
||||||
BASIC_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
BASIC_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
|
||||||
BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
|
BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
|
||||||
|
BASIC_PATH_PROGS(BUILD_NM, nm gcc-nm)
|
||||||
|
BASIC_FIXUP_EXECUTABLE(BUILD_NM)
|
||||||
|
BASIC_PATH_PROGS(BUILD_AR, ar gcc-ar)
|
||||||
|
BASIC_FIXUP_EXECUTABLE(BUILD_AR)
|
||||||
|
# Assume the C compiler is the assembler
|
||||||
|
BUILD_AS="$BUILD_CC -c"
|
||||||
|
# Just like for the target compiler, use the compiler as linker
|
||||||
BUILD_LD="$BUILD_CC"
|
BUILD_LD="$BUILD_CC"
|
||||||
|
|
||||||
PATH="$OLDPATH"
|
PATH="$OLDPATH"
|
||||||
@ -726,15 +739,21 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
|||||||
BUILD_CC="$CC"
|
BUILD_CC="$CC"
|
||||||
BUILD_CXX="$CXX"
|
BUILD_CXX="$CXX"
|
||||||
BUILD_LD="$LD"
|
BUILD_LD="$LD"
|
||||||
|
BUILD_NM="$NM"
|
||||||
|
BUILD_AS="$AS"
|
||||||
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
|
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
|
||||||
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
|
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
|
||||||
|
BUILD_AR="$AR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(BUILD_CC)
|
AC_SUBST(BUILD_CC)
|
||||||
AC_SUBST(BUILD_CXX)
|
AC_SUBST(BUILD_CXX)
|
||||||
AC_SUBST(BUILD_LD)
|
AC_SUBST(BUILD_LD)
|
||||||
|
AC_SUBST(BUILD_NM)
|
||||||
|
AC_SUBST(BUILD_AS)
|
||||||
AC_SUBST(BUILD_SYSROOT_CFLAGS)
|
AC_SUBST(BUILD_SYSROOT_CFLAGS)
|
||||||
AC_SUBST(BUILD_SYSROOT_LDFLAGS)
|
AC_SUBST(BUILD_SYSROOT_LDFLAGS)
|
||||||
|
AC_SUBST(BUILD_AR)
|
||||||
])
|
])
|
||||||
|
|
||||||
# Setup legacy variables that are still needed as alternative ways to refer to
|
# Setup legacy variables that are still needed as alternative ways to refer to
|
||||||
|
127
common/bin/jib.sh
Normal file
127
common/bin/jib.sh
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
#
|
||||||
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License version 2 only, as
|
||||||
|
# published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
# version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
# accompanied this code).
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License version
|
||||||
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
# or visit www.oracle.com if you need additional information or have any
|
||||||
|
# questions.
|
||||||
|
#
|
||||||
|
|
||||||
|
# This script installs the JIB tool into it's own local repository and
|
||||||
|
# puts a wrapper scripts into <source-root>/.jib
|
||||||
|
|
||||||
|
mydir="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
myname="$(basename "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
installed_jib_script=${mydir}/../../.jib/jib
|
||||||
|
install_data=${mydir}/../../.jib/.data
|
||||||
|
|
||||||
|
setup_url() {
|
||||||
|
if [ -f "~/.config/jib/jib.conf" ]; then
|
||||||
|
source ~/.config/jib/jib.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
jib_repository="jdk-virtual"
|
||||||
|
jib_organization="jpg/infra/builddeps"
|
||||||
|
jib_module="jib"
|
||||||
|
jib_revision="2.0-SNAPSHOT"
|
||||||
|
jib_ext="jib.sh.gz"
|
||||||
|
|
||||||
|
closed_script="${mydir}/../../closed/conf/jib-install.conf"
|
||||||
|
if [ -f "${closed_script}" ]; then
|
||||||
|
source "${closed_script}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${JIB_SERVER}" ]; then
|
||||||
|
jib_server="${JIB_SERVER}"
|
||||||
|
fi
|
||||||
|
if [ -n "${JIB_REPOSITORY}" ]; then
|
||||||
|
jib_repository="${JIB_REPOSITORY}"
|
||||||
|
fi
|
||||||
|
if [ -n "${JIB_ORGANIZATION}" ]; then
|
||||||
|
jib_organization="${JIB_ORGANIZATION}"
|
||||||
|
fi
|
||||||
|
if [ -n "${JIB_MODULE}" ]; then
|
||||||
|
jib_module="${JIB_MODULE}"
|
||||||
|
fi
|
||||||
|
if [ -n "${JIB_REVISION}" ]; then
|
||||||
|
jib_revision="${JIB_REVISION}"
|
||||||
|
fi
|
||||||
|
if [ -n "${JIB_EXTENSION}" ]; then
|
||||||
|
jib_extension="${JIB_EXTENSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${JIB_URL}" ]; then
|
||||||
|
jib_url="${JIB_URL}"
|
||||||
|
data_string="${jib_url}"
|
||||||
|
else
|
||||||
|
data_string="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
|
||||||
|
jib_url="${jib_server}/${data_string}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_jib() {
|
||||||
|
if [ -z "${jib_server}" -a -z "${JIB_URL}" ]; then
|
||||||
|
echo "No jib server or URL provided, set either"
|
||||||
|
echo "JIB_SERVER=<base server address>"
|
||||||
|
echo "or"
|
||||||
|
echo "JIB_URL=<full path to install script>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v curl > /dev/null; then
|
||||||
|
getcmd="curl -s"
|
||||||
|
elif command -v wget > /dev/null; then
|
||||||
|
getcmd="wget --quiet -O -"
|
||||||
|
else
|
||||||
|
echo "Could not find either curl or wget"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v gunzip > /dev/null; then
|
||||||
|
echo "Could not find gunzip"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Downloading JIB bootstrap script"
|
||||||
|
mkdir -p "${installed_jib_script%/*}"
|
||||||
|
rm -f "${installed_jib_script}.gz"
|
||||||
|
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
|
||||||
|
if [ ! -s "${installed_jib_script}.gz" ]; then
|
||||||
|
echo "Failed to download ${jib_url}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Extracting JIB bootstrap script"
|
||||||
|
rm -f "${installed_jib_script}"
|
||||||
|
gunzip "${installed_jib_script}.gz"
|
||||||
|
chmod +x "${installed_jib_script}"
|
||||||
|
echo "${data_string}" > "${install_data}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main body starts here
|
||||||
|
|
||||||
|
setup_url
|
||||||
|
|
||||||
|
if [ ! -x "${installed_jib_script}" ]; then
|
||||||
|
install_jib
|
||||||
|
elif [ ! -e "${install_data}" ] || [ "${data_string}" != "$(cat "${install_data}")" ]; then
|
||||||
|
echo "Install url changed since last time, reinstalling"
|
||||||
|
install_jib
|
||||||
|
fi
|
||||||
|
|
||||||
|
${installed_jib_script} "$@"
|
@ -1293,10 +1293,7 @@ jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/win
|
|||||||
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
|
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
|
||||||
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
|
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
|
||||||
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent/package.html : jdk/src/macosx/classes/com/apple/concurrent/package.html
|
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent/package.html : jdk/src/macosx/classes/com/apple/concurrent/package.html
|
||||||
jdk/src/jdk.deploy.osx/macosx/classes/apple/applescript : jdk/src/macosx/classes/apple/applescript
|
|
||||||
jdk/src/jdk.deploy.osx/macosx/classes/apple/security : jdk/src/macosx/classes/apple/security
|
|
||||||
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent : jdk/src/macosx/classes/com/apple/concurrent
|
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent : jdk/src/macosx/classes/com/apple/concurrent
|
||||||
jdk/src/jdk.deploy.osx/macosx/native/libapplescriptengine : jdk/src/macosx/native/apple/applescript
|
|
||||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
|
jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
|
||||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
|
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
|
||||||
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
|
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m
|
||||||
|
555
common/conf/jib-profiles.js
Normal file
555
common/conf/jib-profiles.js
Normal file
@ -0,0 +1,555 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file defines build profiles for the JIB tool and others.
|
||||||
|
*
|
||||||
|
* A build profile defines a set of configuration options and external
|
||||||
|
* dependencies that we for some reason or other care about specifically.
|
||||||
|
* Typically, build profiles are defined for the build configurations we
|
||||||
|
* build regularly.
|
||||||
|
*
|
||||||
|
* Contract against this file from the tools that use it, is to provide
|
||||||
|
* a function on the form:
|
||||||
|
*
|
||||||
|
* getJibProfiles(input)
|
||||||
|
*
|
||||||
|
* which returns an object graph describing the profiles and their
|
||||||
|
* dependencies. The name of the function is based on the name of this
|
||||||
|
* file, minus the extension and the '-', camel cased and prefixed with
|
||||||
|
* 'get'.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* The parameter 'input' is an object that optionally contains some data.
|
||||||
|
* Optionally because a tool may read the configuration for different purposes.
|
||||||
|
* To initially get a list of available profiles, the active profile may not
|
||||||
|
* yet be known for instance.
|
||||||
|
*
|
||||||
|
* Data that may be set on the input object:
|
||||||
|
*
|
||||||
|
* input.profile = <name of active profile>
|
||||||
|
*
|
||||||
|
* If the active profile is set, the following data from it must also
|
||||||
|
* be provided:
|
||||||
|
*
|
||||||
|
* input.profile
|
||||||
|
* input.target_os
|
||||||
|
* input.target_cpu
|
||||||
|
* input.build_os
|
||||||
|
* input.build_cpu
|
||||||
|
* input.target_platform
|
||||||
|
* input.build_platform
|
||||||
|
* // The build_osenv_* variables describe the unix layer on Windows systems,
|
||||||
|
* // i.e. Cygwin, which may also be 32 or 64 bit.
|
||||||
|
* input.build_osenv
|
||||||
|
* input.build_osenv_cpu
|
||||||
|
* input.build_osenv_platform
|
||||||
|
*
|
||||||
|
* For more complex nested attributes, there is a method "get":
|
||||||
|
*
|
||||||
|
* input.get("<dependency>", "<attribute>")
|
||||||
|
*
|
||||||
|
* Valid attributes are:
|
||||||
|
* install_path
|
||||||
|
* download_path
|
||||||
|
* download_dir
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* The output data generated by this configuration file has the following
|
||||||
|
* format:
|
||||||
|
*
|
||||||
|
* data: {
|
||||||
|
* // Identifies the version of this format to the tool reading it
|
||||||
|
* format_version: "1.0",
|
||||||
|
*
|
||||||
|
* // Name of base outputdir. JIB assumes the actual output dir is formed
|
||||||
|
* // by adding the configuration name: <output_basedir>/<config-name>
|
||||||
|
* output_basedir: "build",
|
||||||
|
* // Configure argument to use to specify configuration name
|
||||||
|
* configuration_configure_arg:
|
||||||
|
* // Make argument to use to specify configuration name
|
||||||
|
* configuration_make_arg:
|
||||||
|
*
|
||||||
|
* profiles: {
|
||||||
|
* <profile-name>: {
|
||||||
|
* // Name of os the profile is built to run on
|
||||||
|
* target_os; <string>
|
||||||
|
* // Name of cpu the profile is built to run on
|
||||||
|
* target_cpu; <string>
|
||||||
|
* // Combination of target_os and target_cpu for convenience
|
||||||
|
* target_platform; <string>
|
||||||
|
* // Name of os the profile is built on
|
||||||
|
* build_os; <string>
|
||||||
|
* // Name of cpu the profile is built on
|
||||||
|
* build_cpu; <string>
|
||||||
|
* // Combination of build_os and build_cpu for convenience
|
||||||
|
* build_platform; <string>
|
||||||
|
*
|
||||||
|
* // List of dependencies needed to build this profile
|
||||||
|
* dependencies: <Array of strings>
|
||||||
|
*
|
||||||
|
* // List of configure args to use for this profile
|
||||||
|
* configure_args: <Array of strings>
|
||||||
|
*
|
||||||
|
* // List of free form labels describing aspects of this profile
|
||||||
|
* labels: <Array of strings>
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* // Dependencies use a Maven like deployment structure
|
||||||
|
* dependencies: {
|
||||||
|
* <dependency-name>: {
|
||||||
|
* // Organization part of path defining this dependency
|
||||||
|
* organization: <string>
|
||||||
|
* // File extension for this dependency
|
||||||
|
* ext: <string>
|
||||||
|
* // Module part of path for defining this dependency,
|
||||||
|
* // defaults to <dependency-name>
|
||||||
|
* module: <string>
|
||||||
|
* // Revision part of path for defining this dependency
|
||||||
|
* revision: <string>
|
||||||
|
*
|
||||||
|
* // List of configure args to add when using this dependency,
|
||||||
|
* // defaults to
|
||||||
|
* // "--with-<dependency-name>=input.get("<dependency-name", "install_path")"
|
||||||
|
* configure_args: <array of strings>
|
||||||
|
*
|
||||||
|
* // Name of environment variable to set when using this dependency
|
||||||
|
* // when running make
|
||||||
|
* environment_name: <string>
|
||||||
|
* // Value of environment variable to set when using this dependency
|
||||||
|
* // when running make
|
||||||
|
* environment_value: <string>
|
||||||
|
*
|
||||||
|
* // Value to add to the PATH variable when using this dependency,
|
||||||
|
* // applies to both make and configure
|
||||||
|
* environment_path: <string>
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* <dependency-name>: {
|
||||||
|
* // For certain dependencies where a legacy distribution mechanism is
|
||||||
|
* // already in place, the "javare" server layout is also supported
|
||||||
|
* // Indicate that an alternate server source and layout should be used
|
||||||
|
* server: "javare"
|
||||||
|
*
|
||||||
|
* // For "javare", a combination of module, revision,
|
||||||
|
* // build number (optional), files and checksum file is possible for
|
||||||
|
* // artifacts following the standard layout.
|
||||||
|
* module: <string>
|
||||||
|
* revision: <string>
|
||||||
|
* build_number: <string>
|
||||||
|
* checksum_file: <string>
|
||||||
|
* file: <string>
|
||||||
|
*
|
||||||
|
* // For other files, use checksum path and path instead
|
||||||
|
* checksum_path: <string>
|
||||||
|
* path: <string>
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main entry to generate the profile configuration
|
||||||
|
*
|
||||||
|
* @param input External data to use for generating the configuration
|
||||||
|
* @returns {{}} Profile configuration
|
||||||
|
*/
|
||||||
|
var getJibProfiles = function (input) {
|
||||||
|
|
||||||
|
var data = {};
|
||||||
|
|
||||||
|
// Identifies the version of this format to the tool reading it
|
||||||
|
data.format_version = "1.0";
|
||||||
|
|
||||||
|
// Organization is used when uploading/publishing build results
|
||||||
|
data.organization = "com.oracle.jpg.jdk";
|
||||||
|
|
||||||
|
// The base directory for the build output. JIB will assume that the
|
||||||
|
// actual build directory will be <output_basedir>/<configuration>
|
||||||
|
data.output_basedir = "build";
|
||||||
|
// The configure argument to use to specify the name of the configuration
|
||||||
|
data.configuration_configure_arg = "--with-conf-name=";
|
||||||
|
// The make argument to use to specify the name of the configuration
|
||||||
|
data.configuration_make_arg = "CONF_NAME=";
|
||||||
|
|
||||||
|
// Define some common values
|
||||||
|
var common = getJibProfilesCommon(input);
|
||||||
|
// Generate the profiles part of the configuration
|
||||||
|
data.profiles = getJibProfilesProfiles(input, common);
|
||||||
|
// Generate the dependencies part of the configuration
|
||||||
|
data.dependencies = getJibProfilesDependencies(input, common);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates some common values
|
||||||
|
*
|
||||||
|
* @param input External data to use for generating the configuration
|
||||||
|
* @returns Common values
|
||||||
|
*/
|
||||||
|
var getJibProfilesCommon = function (input) {
|
||||||
|
var common = {
|
||||||
|
dependencies: ["boot_jdk", "gnumake", "jtreg"],
|
||||||
|
configure_args: ["--with-default-make-target=all"],
|
||||||
|
configure_args_32bit: ["--with-target-bits=32", "--with-jvm-variants=client,server"],
|
||||||
|
configure_args_debug: ["--enable-debug"],
|
||||||
|
organization: "jpg.infra.builddeps"
|
||||||
|
};
|
||||||
|
|
||||||
|
return common;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the profiles part of the configuration.
|
||||||
|
*
|
||||||
|
* @param input External data to use for generating the configuration
|
||||||
|
* @param common The common values
|
||||||
|
* @returns {{}} Profiles part of the configuration
|
||||||
|
*/
|
||||||
|
var getJibProfilesProfiles = function (input, common) {
|
||||||
|
var profiles = {};
|
||||||
|
|
||||||
|
// Main SE profiles
|
||||||
|
var mainProfiles = {
|
||||||
|
|
||||||
|
"linux-x64": {
|
||||||
|
target_os: "linux",
|
||||||
|
target_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit"),
|
||||||
|
configure_args: common.configure_args,
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"linux-x86": {
|
||||||
|
target_os: "linux",
|
||||||
|
target_cpu: "x86",
|
||||||
|
build_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit"),
|
||||||
|
configure_args: concat(common.configure_args, common.configure_args_32bit),
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"macosx-x64": {
|
||||||
|
target_os: "macosx",
|
||||||
|
target_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit"),
|
||||||
|
configure_args: concat(common.configure_args, "--with-sdk-name=macosx10.9"),
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"solaris-x64": {
|
||||||
|
target_os: "solaris",
|
||||||
|
target_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit", "cups"),
|
||||||
|
configure_args: common.configure_args,
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"solaris-sparcv9": {
|
||||||
|
target_os: "solaris",
|
||||||
|
target_cpu: "sparcv9",
|
||||||
|
dependencies: concat(common.dependencies, "devkit", "cups"),
|
||||||
|
configure_args: common.configure_args,
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"windows-x64": {
|
||||||
|
target_os: "windows",
|
||||||
|
target_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit", "freetype"),
|
||||||
|
configure_args: common.configure_args,
|
||||||
|
make_args: common.make_args
|
||||||
|
},
|
||||||
|
|
||||||
|
"windows-x86": {
|
||||||
|
target_os: "windows",
|
||||||
|
target_cpu: "x86",
|
||||||
|
build_cpu: "x64",
|
||||||
|
dependencies: concat(common.dependencies, "devkit", "freetype"),
|
||||||
|
configure_args: concat(common.configure_args, common.configure_args_32bit),
|
||||||
|
make_args: common.make_args
|
||||||
|
}
|
||||||
|
};
|
||||||
|
profiles = concatObjects(profiles, mainProfiles);
|
||||||
|
// Generate debug versions of all the main profiles
|
||||||
|
profiles = concatObjects(profiles, generateDebugProfiles(common, mainProfiles));
|
||||||
|
|
||||||
|
// Specific open profiles needed for JPRT testing
|
||||||
|
var jprtOpenProfiles = {
|
||||||
|
|
||||||
|
"linux-x64-open": {
|
||||||
|
target_os: mainProfiles["linux-x64"].target_os,
|
||||||
|
target_cpu: mainProfiles["linux-x64"].target_cpu,
|
||||||
|
dependencies: mainProfiles["linux-x64"].dependencies,
|
||||||
|
configure_args: concat(mainProfiles["linux-x64"].configure_args,
|
||||||
|
"--enable-openjdk-only"),
|
||||||
|
make_args: mainProfiles["linux-x64"].make_args,
|
||||||
|
labels: [ "open" ]
|
||||||
|
},
|
||||||
|
|
||||||
|
"solaris-x64-open": {
|
||||||
|
target_os: mainProfiles["solaris-x64"].target_os,
|
||||||
|
target_cpu: mainProfiles["solaris-x64"].target_cpu,
|
||||||
|
dependencies: mainProfiles["solaris-x64"].dependencies,
|
||||||
|
configure_args: concat(mainProfiles["solaris-x64"].configure_args,
|
||||||
|
"--enable-openjdk-only"),
|
||||||
|
make_args: mainProfiles["solaris-x64"].make_args,
|
||||||
|
labels: [ "open" ]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
profiles = concatObjects(profiles, jprtOpenProfiles);
|
||||||
|
// Generate debug profiles for the open jprt profiles
|
||||||
|
profiles = concatObjects(profiles, generateDebugProfiles(common, jprtOpenProfiles));
|
||||||
|
|
||||||
|
// Profiles used to run tests. Used in JPRT.
|
||||||
|
var testOnlyProfiles = {
|
||||||
|
|
||||||
|
"run-test": {
|
||||||
|
target_os: input.build_os,
|
||||||
|
target_cpu: input.build_cpu,
|
||||||
|
dependencies: [ "jtreg", "gnumake" ],
|
||||||
|
labels: "test"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
profiles = concatObjects(profiles, testOnlyProfiles);
|
||||||
|
|
||||||
|
// Generate the missing platform attributes
|
||||||
|
profiles = generatePlatformAttributes(profiles);
|
||||||
|
return profiles;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the dependencies part of the configuration
|
||||||
|
*
|
||||||
|
* @param input External data to use for generating the configuration
|
||||||
|
* @param common The common values
|
||||||
|
* @returns {{}} Dependencies part of configuration
|
||||||
|
*/
|
||||||
|
var getJibProfilesDependencies = function (input, common) {
|
||||||
|
|
||||||
|
var boot_jdk_platform = input.build_os + "-"
|
||||||
|
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
|
||||||
|
|
||||||
|
var devkit_platform_revisions = {
|
||||||
|
linux_x64: "gcc4.9.2-OEL6.4+1.0",
|
||||||
|
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||||
|
solaris_x64: "SS12u3-Solaris10u10+1.0",
|
||||||
|
solaris_sparcv9: "SS12u3-Solaris10u10+1.0",
|
||||||
|
windows_x64: "VS2013SP4+1.0"
|
||||||
|
};
|
||||||
|
|
||||||
|
var devkit_platform = (input.target_cpu == "x86"
|
||||||
|
? input.target_os + "_x64"
|
||||||
|
: input.target_platform);
|
||||||
|
|
||||||
|
var dependencies = {
|
||||||
|
|
||||||
|
boot_jdk: {
|
||||||
|
server: "javare",
|
||||||
|
module: "jdk",
|
||||||
|
revision: "8",
|
||||||
|
checksum_file: boot_jdk_platform + "/MD5_VALUES",
|
||||||
|
file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz",
|
||||||
|
configure_args: (input.build_os == "macosx"
|
||||||
|
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home"
|
||||||
|
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0")
|
||||||
|
},
|
||||||
|
|
||||||
|
devkit: {
|
||||||
|
organization: common.organization,
|
||||||
|
ext: "tar.gz",
|
||||||
|
module: "devkit-" + devkit_platform,
|
||||||
|
revision: devkit_platform_revisions[devkit_platform]
|
||||||
|
},
|
||||||
|
|
||||||
|
build_devkit: {
|
||||||
|
organization: common.organization,
|
||||||
|
ext: "tar.gz",
|
||||||
|
module: "devkit-" + input.build_platform,
|
||||||
|
revision: devkit_platform_revisions[input.build_platform]
|
||||||
|
},
|
||||||
|
|
||||||
|
cups: {
|
||||||
|
organization: common.organization,
|
||||||
|
ext: "tar.gz",
|
||||||
|
revision: "1.0118+1.0"
|
||||||
|
},
|
||||||
|
|
||||||
|
jtreg: {
|
||||||
|
server: "javare",
|
||||||
|
revision: "4.1",
|
||||||
|
build_number: "b12",
|
||||||
|
checksum_file: "MD5_VALUES",
|
||||||
|
file: "jtreg_bin-4.1.zip",
|
||||||
|
environment_name: "JT_HOME"
|
||||||
|
},
|
||||||
|
|
||||||
|
gnumake: {
|
||||||
|
organization: common.organization,
|
||||||
|
ext: "tar.gz",
|
||||||
|
revision: "4.0+1.0",
|
||||||
|
|
||||||
|
module: (input.build_os == "windows"
|
||||||
|
? "gnumake-" + input.build_osenv_platform
|
||||||
|
: "gnumake-" + input.build_platform),
|
||||||
|
|
||||||
|
configure_args: (input.build_os == "windows"
|
||||||
|
? "MAKE=" + input.get("gnumake", "install_path") + "/cygwin/bin/make"
|
||||||
|
: "MAKE=" + input.get("gnumake", "install_path") + "/bin/make"),
|
||||||
|
|
||||||
|
environment_path: (input.build_os == "windows"
|
||||||
|
? input.get("gnumake", "install_path") + "/cygwin/bin"
|
||||||
|
: input.get("gnumake", "install_path") + "/bin")
|
||||||
|
},
|
||||||
|
|
||||||
|
freetype: {
|
||||||
|
organization: common.organization,
|
||||||
|
ext: "tar.gz",
|
||||||
|
revision: "2.3.4+1.0",
|
||||||
|
module: "freetype-" + input.target_platform
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return dependencies;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the missing platform attributes for profiles
|
||||||
|
*
|
||||||
|
* @param profiles Profiles map to generate attributes on
|
||||||
|
* @returns {{}} New profiles map with platform attributes fully filled in
|
||||||
|
*/
|
||||||
|
var generatePlatformAttributes = function (profiles) {
|
||||||
|
var ret = concatObjects(profiles, {});
|
||||||
|
for (var profile in profiles) {
|
||||||
|
if (ret[profile].build_os == null) {
|
||||||
|
ret[profile].build_os = ret[profile].target_os;
|
||||||
|
}
|
||||||
|
if (ret[profile].build_cpu == null) {
|
||||||
|
ret[profile].build_cpu = ret[profile].target_cpu;
|
||||||
|
}
|
||||||
|
ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu;
|
||||||
|
ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates debug versions of profiles. Clones the given profiles and adds
|
||||||
|
* debug metadata.
|
||||||
|
*
|
||||||
|
* @param common Common values
|
||||||
|
* @param profiles Profiles map to generate debug profiles for
|
||||||
|
* @returns {{}} New map of profiles containing debug profiles
|
||||||
|
*/
|
||||||
|
var generateDebugProfiles = function (common, profiles) {
|
||||||
|
var newProfiles = {};
|
||||||
|
for (var profile in profiles) {
|
||||||
|
var debugProfile = profile + "-debug";
|
||||||
|
newProfiles[debugProfile] = clone(profiles[profile]);
|
||||||
|
newProfiles[debugProfile].debug_level = "fastdebug";
|
||||||
|
newProfiles[debugProfile].labels
|
||||||
|
= concat(newProfiles[debugProfile].labels || [], "debug"),
|
||||||
|
newProfiles[debugProfile].configure_args
|
||||||
|
= concat(newProfiles[debugProfile].configure_args,
|
||||||
|
common.configure_args_debug);
|
||||||
|
}
|
||||||
|
return newProfiles;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deep clones an object tree.
|
||||||
|
*
|
||||||
|
* @param o Object to clone
|
||||||
|
* @returns {{}} Clone of o
|
||||||
|
*/
|
||||||
|
var clone = function (o) {
|
||||||
|
return JSON.parse(JSON.stringify(o));
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Concatenates all arguments into a new array
|
||||||
|
*
|
||||||
|
* @returns {Array.<T>} New array containing all arguments
|
||||||
|
*/
|
||||||
|
var concat = function () {
|
||||||
|
return Array.prototype.concat.apply([], arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies all elements in an array into a new array but replacing all
|
||||||
|
* occurrences of original with replacement.
|
||||||
|
*
|
||||||
|
* @param original Element to look for
|
||||||
|
* @param replacement Element to replace with
|
||||||
|
* @param a Array to copy
|
||||||
|
* @returns {Array} New array with all occurrences of original replaced
|
||||||
|
* with replacement
|
||||||
|
*/
|
||||||
|
var replace = function (original, replacement, a) {
|
||||||
|
var newA = [];
|
||||||
|
for (var i in a) {
|
||||||
|
if (original == a[i]) {
|
||||||
|
newA.push(replacement);
|
||||||
|
} else {
|
||||||
|
newA.push(a[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newA;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deep concatenation of two objects. For each node encountered, merge
|
||||||
|
* the contents with the corresponding node in the other object tree,
|
||||||
|
* treating all strings as array elements.
|
||||||
|
*
|
||||||
|
* @param o1 Object to concatenate
|
||||||
|
* @param o2 Object to concatenate
|
||||||
|
* @returns {{}} New object tree containing the concatenation of o1 and o2
|
||||||
|
*/
|
||||||
|
var concatObjects = function (o1, o2) {
|
||||||
|
var ret = {};
|
||||||
|
for (var a in o1) {
|
||||||
|
if (o2[a] == null) {
|
||||||
|
ret[a] = o1[a];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var a in o2) {
|
||||||
|
if (o1[a] == null) {
|
||||||
|
ret[a] = o2[a];
|
||||||
|
} else {
|
||||||
|
if (typeof o1[a] == 'string') {
|
||||||
|
ret[a] = [o1[a]].concat(o2[a]);
|
||||||
|
} else if (Array.isArray(o1[a])) {
|
||||||
|
ret[a] = o1[a].concat(o2[a]);
|
||||||
|
} else if (typeof o1[a] == 'object') {
|
||||||
|
ret[a] = concatObjects(o1[a], o2[a]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
};
|
@ -358,10 +358,13 @@ int main(int argc, char const ** argv)
|
|||||||
char *line;
|
char *line;
|
||||||
char *current;
|
char *current;
|
||||||
int i, cmd;
|
int i, cmd;
|
||||||
DWORD exitCode;
|
DWORD exitCode = 0;
|
||||||
|
DWORD processFlags = 0;
|
||||||
|
BOOL processInheritHandles = TRUE;
|
||||||
|
BOOL waitForChild = TRUE;
|
||||||
|
|
||||||
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
|
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
|
||||||
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
|
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +389,22 @@ int main(int argc, char const ** argv)
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 2;
|
if (argv[2][0] == '-') {
|
||||||
|
if (strcmp(argv[2], "--detach") == 0) {
|
||||||
|
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||||
|
fprintf(stderr, "fixpath in detached mode\n");
|
||||||
|
}
|
||||||
|
processFlags |= DETACHED_PROCESS;
|
||||||
|
processInheritHandles = FALSE;
|
||||||
|
waitForChild = FALSE;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "fixpath Unknown argument: %s\n", argv[2]);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
i = 3;
|
||||||
|
} else {
|
||||||
|
i = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// handle assignments
|
// handle assignments
|
||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
@ -428,6 +446,10 @@ int main(int argc, char const ** argv)
|
|||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
char const *replaced = replace_cygdrive(argv[i]);
|
char const *replaced = replace_cygdrive(argv[i]);
|
||||||
if (replaced[0] == '@') {
|
if (replaced[0] == '@') {
|
||||||
|
if (waitForChild == FALSE) {
|
||||||
|
fprintf(stderr, "fixpath Cannot use @-files in detached mode: %s\n", replaced);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
// Found at-file! Fix it!
|
// Found at-file! Fix it!
|
||||||
replaced = fix_at_file(replaced);
|
replaced = fix_at_file(replaced);
|
||||||
}
|
}
|
||||||
@ -480,8 +502,8 @@ int main(int argc, char const ** argv)
|
|||||||
line,
|
line,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
TRUE,
|
processInheritHandles,
|
||||||
0,
|
processFlags,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&si,
|
&si,
|
||||||
@ -492,24 +514,30 @@ int main(int argc, char const ** argv)
|
|||||||
exit(126);
|
exit(126);
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
if (waitForChild == TRUE) {
|
||||||
GetExitCodeProcess(pi.hProcess, &exitCode);
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
|
GetExitCodeProcess(pi.hProcess, &exitCode);
|
||||||
|
|
||||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||||
for (i=0; i<num_files_to_delete; ++i) {
|
for (i=0; i<num_files_to_delete; ++i) {
|
||||||
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
|
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
|
||||||
files_to_delete[i]);
|
files_to_delete[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i=0; i<num_files_to_delete; ++i) {
|
||||||
|
remove(files_to_delete[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exitCode != 0) {
|
||||||
|
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||||
|
fprintf(stderr, "fixpath exit code %d\n",
|
||||||
|
exitCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i=0; i<num_files_to_delete; ++i) {
|
|
||||||
remove(files_to_delete[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exitCode != 0) {
|
|
||||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||||
fprintf(stderr, "fixpath exit code %d\n",
|
fprintf(stderr, "fixpath Not waiting for child process");
|
||||||
exitCode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,3 +337,5 @@ c847a53b38d2fffb87afc483c74db05eced9b4f4 jdk9-b89
|
|||||||
f7d70caad89ad0c43bb057bca0aad6f17ce05a6a jdk9-b92
|
f7d70caad89ad0c43bb057bca0aad6f17ce05a6a jdk9-b92
|
||||||
27e9c8d8091e2447ea7ef3e3103e9b7dd286e03a jdk9-b93
|
27e9c8d8091e2447ea7ef3e3103e9b7dd286e03a jdk9-b93
|
||||||
61e9f509be0f78f0961477960f372b0533214bb8 jdk9-b94
|
61e9f509be0f78f0961477960f372b0533214bb8 jdk9-b94
|
||||||
|
fd038e8a16eec80d0d6b337d74a582790ed4b3ee jdk-9+95
|
||||||
|
feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96
|
||||||
|
@ -497,3 +497,5 @@ bc48b669bc6610fac97e16593050c0f559cf6945 jdk9-b88
|
|||||||
53cb98d68a1aeb08d29c89d6da748de60c448e37 jdk9-b92
|
53cb98d68a1aeb08d29c89d6da748de60c448e37 jdk9-b92
|
||||||
d8b24776484cc4dfd19f50b23eaa18a80a161371 jdk9-b93
|
d8b24776484cc4dfd19f50b23eaa18a80a161371 jdk9-b93
|
||||||
a22b7c80529f5f05c847e932e017456e83c46233 jdk9-b94
|
a22b7c80529f5f05c847e932e017456e83c46233 jdk9-b94
|
||||||
|
0c79cf3cdf0904fc4a630b91b32904491e1ae430 jdk-9+95
|
||||||
|
a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
|
#include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ppc64
|
#if defined(ppc64) || defined(ppc64le)
|
||||||
#include "sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h"
|
#include "sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -223,9 +223,12 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at
|
|||||||
verifyBitness(env, (char *) &buf);
|
verifyBitness(env, (char *) &buf);
|
||||||
CHECK_EXCEPTION;
|
CHECK_EXCEPTION;
|
||||||
|
|
||||||
|
char err_buf[200];
|
||||||
struct ps_prochandle* ph;
|
struct ps_prochandle* ph;
|
||||||
if ( (ph = Pgrab(jpid)) == NULL) {
|
if ( (ph = Pgrab(jpid, err_buf, sizeof(err_buf))) == NULL) {
|
||||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
char msg[230];
|
||||||
|
snprintf(msg, sizeof(msg), "Can't attach to the process: %s", err_buf);
|
||||||
|
THROW_NEW_DEBUGGER_EXCEPTION(msg);
|
||||||
}
|
}
|
||||||
(*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
|
(*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
|
||||||
fillThreadsAndLoadObjects(env, this_obj, ph);
|
fillThreadsAndLoadObjects(env, this_obj, ph);
|
||||||
@ -349,7 +352,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
|||||||
return (err == PS_OK)? array : 0;
|
return (err == PS_OK)? array : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9) | defined(ppc64) || defined(aarch64)
|
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9) | defined(ppc64) || defined(ppc64le) || defined(aarch64)
|
||||||
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
|
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
|
||||||
(JNIEnv *env, jobject this_obj, jint lwp_id) {
|
(JNIEnv *env, jobject this_obj, jint lwp_id) {
|
||||||
|
|
||||||
@ -377,7 +380,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
|||||||
#if defined(sparc) || defined(sparcv9)
|
#if defined(sparc) || defined(sparcv9)
|
||||||
#define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
|
#define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
|
||||||
#endif
|
#endif
|
||||||
#ifdef ppc64
|
#if defined(ppc64) || defined(ppc64le)
|
||||||
#define NPRGREG sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_NPRGREG
|
#define NPRGREG sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_NPRGREG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -486,7 +489,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
|||||||
}
|
}
|
||||||
#endif /* aarch64 */
|
#endif /* aarch64 */
|
||||||
|
|
||||||
#ifdef ppc64
|
#if defined(ppc64) || defined(ppc64le)
|
||||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_##reg
|
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_##reg
|
||||||
|
|
||||||
regs[REG_INDEX(LR)] = gregs.link;
|
regs[REG_INDEX(LR)] = gregs.link;
|
||||||
|
@ -68,7 +68,8 @@ combination of ptrace and /proc calls.
|
|||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#if defined(sparc) || defined(sparcv9) || defined(ppc64)
|
#if defined(sparc) || defined(sparcv9) || defined(ppc64) || defined(ppc64le)
|
||||||
|
#include <asm/ptrace.h>
|
||||||
#define user_regs_struct pt_regs
|
#define user_regs_struct pt_regs
|
||||||
#endif
|
#endif
|
||||||
#if defined(aarch64)
|
#if defined(aarch64)
|
||||||
@ -86,7 +87,7 @@ typedef int bool;
|
|||||||
struct ps_prochandle;
|
struct ps_prochandle;
|
||||||
|
|
||||||
// attach to a process
|
// attach to a process
|
||||||
struct ps_prochandle* Pgrab(pid_t pid);
|
struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len);
|
||||||
|
|
||||||
// attach to a core dump
|
// attach to a core dump
|
||||||
struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile);
|
struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile);
|
||||||
|
@ -215,9 +215,12 @@ static bool ptrace_waitpid(pid_t pid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// attach to a process/thread specified by "pid"
|
// attach to a process/thread specified by "pid"
|
||||||
static bool ptrace_attach(pid_t pid) {
|
static bool ptrace_attach(pid_t pid, char* err_buf, size_t err_buf_len) {
|
||||||
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
||||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
char buf[200];
|
||||||
|
char* msg = strerror_r(errno, buf, sizeof(buf));
|
||||||
|
snprintf(err_buf, err_buf_len, "ptrace(PTRACE_ATTACH, ..) failed for %d: %s", pid, msg);
|
||||||
|
print_debug("%s\n", err_buf);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return ptrace_waitpid(pid);
|
return ptrace_waitpid(pid);
|
||||||
@ -370,16 +373,17 @@ static ps_prochandle_ops process_ops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// attach to the process. One and only one exposed stuff
|
// attach to the process. One and only one exposed stuff
|
||||||
struct ps_prochandle* Pgrab(pid_t pid) {
|
struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len) {
|
||||||
struct ps_prochandle* ph = NULL;
|
struct ps_prochandle* ph = NULL;
|
||||||
thread_info* thr = NULL;
|
thread_info* thr = NULL;
|
||||||
|
|
||||||
if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) {
|
if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) {
|
||||||
print_debug("can't allocate memory for ps_prochandle\n");
|
snprintf(err_buf, err_buf_len, "can't allocate memory for ps_prochandle");
|
||||||
|
print_debug("%s\n", err_buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptrace_attach(pid) != true) {
|
if (ptrace_attach(pid, err_buf, err_buf_len) != true) {
|
||||||
free(ph);
|
free(ph);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -402,7 +406,7 @@ struct ps_prochandle* Pgrab(pid_t pid) {
|
|||||||
thr = ph->threads;
|
thr = ph->threads;
|
||||||
while (thr) {
|
while (thr) {
|
||||||
// don't attach to the main thread again
|
// don't attach to the main thread again
|
||||||
if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id) != true) {
|
if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id, err_buf, err_buf_len) != true) {
|
||||||
// even if one attach fails, we get return NULL
|
// even if one attach fails, we get return NULL
|
||||||
Prelease(ph);
|
Prelease(ph);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1446,7 +1446,7 @@ public class CommandProcessor {
|
|||||||
if (type.equals("threads")) {
|
if (type.equals("threads")) {
|
||||||
Threads threads = VM.getVM().getThreads();
|
Threads threads = VM.getVM().getThreads();
|
||||||
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
||||||
Address base = thread.getBaseOfStackPointer();
|
Address base = thread.getStackBase();
|
||||||
Address end = thread.getLastJavaSP();
|
Address end = thread.getLastJavaSP();
|
||||||
if (end == null) continue;
|
if (end == null) continue;
|
||||||
if (end.lessThan(base)) {
|
if (end.lessThan(base)) {
|
||||||
@ -1454,11 +1454,13 @@ public class CommandProcessor {
|
|||||||
base = end;
|
base = end;
|
||||||
end = tmp;
|
end = tmp;
|
||||||
}
|
}
|
||||||
out.println("Searching " + base + " " + end);
|
//out.println("Searching " + base + " " + end);
|
||||||
while (base != null && base.lessThan(end)) {
|
while (base != null && base.lessThan(end)) {
|
||||||
Address val = base.getAddressAt(0);
|
Address val = base.getAddressAt(0);
|
||||||
if (AddressOps.equal(val, value)) {
|
if (AddressOps.equal(val, value)) {
|
||||||
out.println(base);
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
thread.printThreadIDOn(new PrintStream(bos));
|
||||||
|
out.println("found on the stack of thread " + bos.toString() + " at " + base);
|
||||||
}
|
}
|
||||||
base = base.addOffsetTo(stride);
|
base = base.addOffsetTo(stride);
|
||||||
}
|
}
|
||||||
@ -1601,6 +1603,8 @@ public class CommandProcessor {
|
|||||||
thread.printThreadIDOn(new PrintStream(bos));
|
thread.printThreadIDOn(new PrintStream(bos));
|
||||||
if (all || bos.toString().equals(name)) {
|
if (all || bos.toString().equals(name)) {
|
||||||
out.println("Thread " + bos.toString() + " Address " + thread.getAddress());
|
out.println("Thread " + bos.toString() + " Address " + thread.getAddress());
|
||||||
|
thread.printInfoOn(out);
|
||||||
|
out.println(" ");
|
||||||
if (!all) return;
|
if (!all) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1618,6 +1622,8 @@ public class CommandProcessor {
|
|||||||
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
for (JavaThread thread = threads.first(); thread != null; thread = thread.next()) {
|
||||||
thread.printThreadIDOn(out);
|
thread.printThreadIDOn(out);
|
||||||
out.println(" " + thread.getThreadName());
|
out.println(" " + thread.getThreadName());
|
||||||
|
thread.printInfoOn(out);
|
||||||
|
out.println("\n...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,10 +125,14 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// close this tool without calling System.exit
|
private class CloseUI extends WindowAdapter {
|
||||||
protected void closeUI() {
|
|
||||||
workerThread.shutdown();
|
@Override
|
||||||
frame.dispose();
|
public void windowClosing(WindowEvent e) {
|
||||||
|
workerThread.shutdown();
|
||||||
|
frame.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -144,7 +148,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
|||||||
|
|
||||||
frame = new JFrame("HSDB - HotSpot Debugger");
|
frame = new JFrame("HSDB - HotSpot Debugger");
|
||||||
frame.setSize(800, 600);
|
frame.setSize(800, 600);
|
||||||
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
|
frame.addWindowListener(new CloseUI());
|
||||||
|
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
|
|
||||||
@ -207,7 +212,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
|
|||||||
item = createMenuItem("Exit",
|
item = createMenuItem("Exit",
|
||||||
new ActionListener() {
|
new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
closeUI();
|
workerThread.shutdown();
|
||||||
|
frame.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
|
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
|
||||||
|
@ -37,7 +37,7 @@ public class SAGetopt {
|
|||||||
private boolean _optreset; // special handling of first call
|
private boolean _optreset; // special handling of first call
|
||||||
|
|
||||||
public SAGetopt(String[] args) {
|
public SAGetopt(String[] args) {
|
||||||
_argv = args;
|
_argv = args.clone();
|
||||||
_optind = 0;
|
_optind = 0;
|
||||||
_optopt = 1;
|
_optopt = 1;
|
||||||
_optarg = null;
|
_optarg = null;
|
||||||
|
@ -41,7 +41,8 @@ import sun.jvm.hotspot.types.TypeDataBase;
|
|||||||
|
|
||||||
public class HeapRegionSetBase extends VMObject {
|
public class HeapRegionSetBase extends VMObject {
|
||||||
|
|
||||||
static private long countField;
|
// uint _length
|
||||||
|
static private CIntegerField lengthField;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
VM.registerVMInitializedObserver(new Observer() {
|
VM.registerVMInitializedObserver(new Observer() {
|
||||||
@ -54,13 +55,11 @@ public class HeapRegionSetBase extends VMObject {
|
|||||||
static private synchronized void initialize(TypeDataBase db) {
|
static private synchronized void initialize(TypeDataBase db) {
|
||||||
Type type = db.lookupType("HeapRegionSetBase");
|
Type type = db.lookupType("HeapRegionSetBase");
|
||||||
|
|
||||||
countField = type.getField("_count").getOffset();
|
lengthField = type.getCIntegerField("_length");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long length() {
|
||||||
public HeapRegionSetCount count() {
|
return lengthField.getValue(addr);
|
||||||
Address countFieldAddr = addr.addOffsetTo(countField);
|
|
||||||
return (HeapRegionSetCount) VMObjectFactory.newObject(HeapRegionSetCount.class, countFieldAddr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HeapRegionSetBase(Address addr) {
|
public HeapRegionSetBase(Address addr) {
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package sun.jvm.hotspot.gc.g1;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Observable;
|
|
||||||
import java.util.Observer;
|
|
||||||
|
|
||||||
import sun.jvm.hotspot.debugger.Address;
|
|
||||||
import sun.jvm.hotspot.runtime.VM;
|
|
||||||
import sun.jvm.hotspot.runtime.VMObject;
|
|
||||||
import sun.jvm.hotspot.runtime.VMObjectFactory;
|
|
||||||
import sun.jvm.hotspot.types.AddressField;
|
|
||||||
import sun.jvm.hotspot.types.CIntegerField;
|
|
||||||
import sun.jvm.hotspot.types.Type;
|
|
||||||
import sun.jvm.hotspot.types.TypeDataBase;
|
|
||||||
|
|
||||||
// Mirror class for HeapRegionSetCount. Represents a group of regions.
|
|
||||||
|
|
||||||
public class HeapRegionSetCount extends VMObject {
|
|
||||||
|
|
||||||
static private CIntegerField lengthField;
|
|
||||||
static private CIntegerField capacityField;
|
|
||||||
|
|
||||||
static {
|
|
||||||
VM.registerVMInitializedObserver(new Observer() {
|
|
||||||
public void update(Observable o, Object data) {
|
|
||||||
initialize(VM.getVM().getTypeDataBase());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
static private synchronized void initialize(TypeDataBase db) {
|
|
||||||
Type type = db.lookupType("HeapRegionSetCount");
|
|
||||||
|
|
||||||
lengthField = type.getCIntegerField("_length");
|
|
||||||
capacityField = type.getCIntegerField("_capacity");
|
|
||||||
}
|
|
||||||
|
|
||||||
public long length() {
|
|
||||||
return lengthField.getValue(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public long capacity() {
|
|
||||||
return capacityField.getValue(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeapRegionSetCount(Address addr) {
|
|
||||||
super(addr);
|
|
||||||
}
|
|
||||||
}
|
|
@ -416,7 +416,7 @@ public class JavaThread extends Thread {
|
|||||||
} else {
|
} else {
|
||||||
tty.println("No Java frames present");
|
tty.println("No Java frames present");
|
||||||
}
|
}
|
||||||
tty.println("Base of Stack: " + getBaseOfStackPointer());
|
tty.println("Base of Stack: " + getStackBase());
|
||||||
tty.println("Last_Java_SP: " + getLastJavaSP());
|
tty.println("Last_Java_SP: " + getLastJavaSP());
|
||||||
tty.println("Last_Java_FP: " + getLastJavaFP());
|
tty.println("Last_Java_FP: " + getLastJavaFP());
|
||||||
tty.println("Last_Java_PC: " + getLastJavaPC());
|
tty.println("Last_Java_PC: " + getLastJavaPC());
|
||||||
|
@ -229,17 +229,17 @@ public class VM {
|
|||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
if (isBool()) {
|
if (isBool()) {
|
||||||
return new Boolean(getBool()).toString();
|
return Boolean.toString(getBool());
|
||||||
} else if (isInt()) {
|
} else if (isInt()) {
|
||||||
return new Long(getInt()).toString();
|
return Long.toString(getInt());
|
||||||
} else if (isUInt()) {
|
} else if (isUInt()) {
|
||||||
return new Long(getUInt()).toString();
|
return Long.toString(getUInt());
|
||||||
} else if (isIntx()) {
|
} else if (isIntx()) {
|
||||||
return new Long(getIntx()).toString();
|
return Long.toString(getIntx());
|
||||||
} else if (isUIntx()) {
|
} else if (isUIntx()) {
|
||||||
return new Long(getUIntx()).toString();
|
return Long.toString(getUIntx());
|
||||||
} else if (isSizet()) {
|
} else if (isSizet()) {
|
||||||
return new Long(getSizet()).toString();
|
return Long.toString(getSizet());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,7 @@ public class HeapSummary extends Tool {
|
|||||||
long survivorRegionNum = g1mm.survivorRegionNum();
|
long survivorRegionNum = g1mm.survivorRegionNum();
|
||||||
HeapRegionSetBase oldSet = g1h.oldSet();
|
HeapRegionSetBase oldSet = g1h.oldSet();
|
||||||
HeapRegionSetBase humongousSet = g1h.humongousSet();
|
HeapRegionSetBase humongousSet = g1h.humongousSet();
|
||||||
long oldRegionNum = oldSet.count().length()
|
long oldRegionNum = oldSet.length() + humongousSet.length();
|
||||||
+ humongousSet.count().capacity() / HeapRegion.grainBytes();
|
|
||||||
printG1Space("G1 Heap:", g1h.n_regions(),
|
printG1Space("G1 Heap:", g1h.n_regions(),
|
||||||
g1h.used(), g1h.capacity());
|
g1h.used(), g1h.capacity());
|
||||||
System.out.println("G1 Young Generation:");
|
System.out.println("G1 Young Generation:");
|
||||||
|
@ -1921,6 +1921,15 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
|
|||||||
buf.link(genPCHref(addressToLong(pc)), pc.toString());
|
buf.link(genPCHref(addressToLong(pc)), pc.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!method.isStatic() && !method.isNative()) {
|
||||||
|
OopHandle oopHandle = vf.getLocals().oopHandleAt(0);
|
||||||
|
|
||||||
|
if (oopHandle != null) {
|
||||||
|
buf.append(", oop = ");
|
||||||
|
buf.append(oopHandle.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (vf.isCompiledFrame()) {
|
if (vf.isCompiledFrame()) {
|
||||||
buf.append(" (Compiled");
|
buf.append(" (Compiled");
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class PlatformInfo {
|
|||||||
|
|
||||||
public static boolean knownCPU(String cpu) {
|
public static boolean knownCPU(String cpu) {
|
||||||
final String[] KNOWN =
|
final String[] KNOWN =
|
||||||
new String[] {"i386", "x86", "x86_64", "amd64", "sparc", "sparcv9", "ppc64", "aarch64"};
|
new String[] {"i386", "x86", "x86_64", "amd64", "sparc", "sparcv9", "ppc64", "ppc64le", "aarch64"};
|
||||||
|
|
||||||
for(String s : KNOWN) {
|
for(String s : KNOWN) {
|
||||||
if(s.equals(cpu))
|
if(s.equals(cpu))
|
||||||
@ -98,6 +98,9 @@ public class PlatformInfo {
|
|||||||
if (cpu.equals("x86_64"))
|
if (cpu.equals("x86_64"))
|
||||||
return "amd64";
|
return "amd64";
|
||||||
|
|
||||||
|
if (cpu.equals("ppc64le"))
|
||||||
|
return "ppc64";
|
||||||
|
|
||||||
return cpu;
|
return cpu;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,175 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
#
|
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU General Public License version 2 only, as
|
|
||||||
# published by the Free Software Foundation.
|
|
||||||
#
|
|
||||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
# version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
# accompanied this code).
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License version
|
|
||||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
#
|
|
||||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
# or visit www.oracle.com if you need additional information or have any
|
|
||||||
# questions.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Rules to build serviceability agent library, used by vm.make
|
|
||||||
|
|
||||||
# libsaproc.so(dylib): serviceability agent
|
|
||||||
SAPROC = saproc
|
|
||||||
|
|
||||||
ifeq ($(OS_VENDOR), Darwin)
|
|
||||||
LIBSAPROC = lib$(SAPROC).$(LIBRARY_SUFFIX)
|
|
||||||
|
|
||||||
LIBSAPROC_DEBUGINFO = lib$(SAPROC).$(LIBRARY_SUFFIX).dSYM
|
|
||||||
LIBSAPROC_DIZ = lib$(SAPROC).diz
|
|
||||||
else
|
|
||||||
LIBSAPROC = lib$(SAPROC).so
|
|
||||||
|
|
||||||
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
|
|
||||||
LIBSAPROC_DIZ = lib$(SAPROC).diz
|
|
||||||
endif
|
|
||||||
|
|
||||||
AGENT_DIR = $(GAMMADIR)/agent
|
|
||||||
|
|
||||||
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
|
|
||||||
|
|
||||||
BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
|
|
||||||
$(SASRCDIR)/symtab.c \
|
|
||||||
$(SASRCDIR)/libproc_impl.c \
|
|
||||||
$(SASRCDIR)/ps_proc.c \
|
|
||||||
$(SASRCDIR)/ps_core.c \
|
|
||||||
$(SASRCDIR)/BsdDebuggerLocal.c \
|
|
||||||
$(AGENT_DIR)/src/share/native/sadis.c
|
|
||||||
|
|
||||||
DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \
|
|
||||||
$(SASRCDIR)/libproc_impl.c \
|
|
||||||
$(SASRCDIR)/ps_core.c \
|
|
||||||
$(SASRCDIR)/MacosxDebuggerLocal.m \
|
|
||||||
$(AGENT_DIR)/src/share/native/sadis.c
|
|
||||||
|
|
||||||
ifeq ($(OS_VENDOR), FreeBSD)
|
|
||||||
SASRCFILES = $(BSD_NON_STUB_SASRCFILES)
|
|
||||||
SALIBS = -lutil -lthread_db
|
|
||||||
SAARCH = $(ARCHFLAG)
|
|
||||||
else
|
|
||||||
ifeq ($(OS_VENDOR), Darwin)
|
|
||||||
SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
|
|
||||||
SALIBS = -g \
|
|
||||||
-framework Foundation \
|
|
||||||
-framework JavaNativeFoundation \
|
|
||||||
-framework Security \
|
|
||||||
-framework CoreFoundation
|
|
||||||
#objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
|
|
||||||
SAARCH = $(subst -march=i586,,$(ARCHFLAG))
|
|
||||||
|
|
||||||
# This is needed to locate JavaNativeFoundation.framework
|
|
||||||
ifeq ($(SYSROOT_CFLAGS),)
|
|
||||||
# this will happen when building without spec.gmk, set SDKROOT to a valid SDK
|
|
||||||
# path if your system does not have headers installed in the system frameworks
|
|
||||||
SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks"
|
|
||||||
else
|
|
||||||
# Just use SYSROOT_CFLAGS
|
|
||||||
SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
|
|
||||||
SALIBS =
|
|
||||||
SAARCH = $(ARCHFLAG)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
SAMAPFILE = $(SASRCDIR)/mapfile
|
|
||||||
|
|
||||||
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
|
|
||||||
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
|
|
||||||
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
|
|
||||||
|
|
||||||
# DEBUG_BINARIES overrides everything, use full -g debug information
|
|
||||||
ifeq ($(DEBUG_BINARIES), true)
|
|
||||||
SA_DEBUG_CFLAGS = -g
|
|
||||||
endif
|
|
||||||
|
|
||||||
# if $(AGENT_DIR) does not exist, we don't build SA
|
|
||||||
# also, we don't build SA on Itanium, PPC, ARM or zero.
|
|
||||||
|
|
||||||
ifneq ($(wildcard $(AGENT_DIR)),)
|
|
||||||
ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
|
|
||||||
BUILDLIBSAPROC = $(LIBSAPROC)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(OS_VENDOR), Darwin)
|
|
||||||
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
|
|
||||||
endif
|
|
||||||
SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
|
|
||||||
|
|
||||||
BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
|
|
||||||
-I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
|
|
||||||
|
|
||||||
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
|
|
||||||
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
|
|
||||||
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
@echo $(LOG_INFO) Making SA debugger back-end...
|
|
||||||
$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
|
|
||||||
$(SA_SYSROOT_FLAGS) \
|
|
||||||
$(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
|
|
||||||
-I$(SASRCDIR) \
|
|
||||||
-I$(GENERATED) \
|
|
||||||
$(BOOT_JAVA_INCLUDES) \
|
|
||||||
$(SASRCFILES) \
|
|
||||||
$(SA_LFLAGS) \
|
|
||||||
$(SA_DEBUG_CFLAGS) \
|
|
||||||
-o $@ \
|
|
||||||
$(SALIBS)
|
|
||||||
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
|
|
||||||
ifeq ($(OS_VENDOR), Darwin)
|
|
||||||
$(DSYMUTIL) $@
|
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
|
||||||
$(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
|
|
||||||
$(RM) -r $(LIBSAPROC_DEBUGINFO)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
|
|
||||||
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
|
|
||||||
ifeq ($(STRIP_POLICY),all_strip)
|
|
||||||
$(QUIETLY) $(STRIP) $@
|
|
||||||
else
|
|
||||||
ifeq ($(STRIP_POLICY),min_strip)
|
|
||||||
$(QUIETLY) $(STRIP) -g $@
|
|
||||||
# implied else here is no stripping at all
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
ifeq ($(ZIP_DEBUGINFO_FILES),1)
|
|
||||||
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
|
|
||||||
$(RM) $(LIBSAPROC_DEBUGINFO)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
install_saproc: $(BUILDLIBSAPROC)
|
|
||||||
@echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"
|
|
||||||
ifeq ($(OS_VENDOR), Darwin)
|
|
||||||
$(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \
|
|
||||||
$(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
|
|
||||||
else
|
|
||||||
$(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \
|
|
||||||
$(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
|
|
||||||
endif
|
|
||||||
$(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \
|
|
||||||
$(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ)
|
|
||||||
$(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"
|
|
||||||
|
|
||||||
.PHONY: install_saproc
|
|
@ -277,7 +277,7 @@ ifneq ($(OSNAME),windows)
|
|||||||
|
|
||||||
# Use uname output for SRCARCH, but deal with platform differences. If ARCH
|
# Use uname output for SRCARCH, but deal with platform differences. If ARCH
|
||||||
# is not explicitly listed below, it is treated as x86.
|
# is not explicitly listed below, it is treated as x86.
|
||||||
SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 aarch64 zero,$(ARCH)))
|
SRCARCH ?= $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 ppc ppc64 ppc64le aarch64 zero,$(ARCH)))
|
||||||
ARCH/ = x86
|
ARCH/ = x86
|
||||||
ARCH/sparc = sparc
|
ARCH/sparc = sparc
|
||||||
ARCH/sparc64= sparc
|
ARCH/sparc64= sparc
|
||||||
@ -285,6 +285,7 @@ ifneq ($(OSNAME),windows)
|
|||||||
ARCH/amd64 = x86
|
ARCH/amd64 = x86
|
||||||
ARCH/x86_64 = x86
|
ARCH/x86_64 = x86
|
||||||
ARCH/ppc64 = ppc
|
ARCH/ppc64 = ppc
|
||||||
|
ARCH/ppc64le= ppc
|
||||||
ARCH/ppc = ppc
|
ARCH/ppc = ppc
|
||||||
ARCH/aarch64= aarch64
|
ARCH/aarch64= aarch64
|
||||||
ARCH/zero = zero
|
ARCH/zero = zero
|
||||||
@ -309,8 +310,13 @@ ifneq ($(OSNAME),windows)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# LIBARCH is 1:1 mapping from BUILDARCH
|
# LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le
|
||||||
LIBARCH ?= $(LIBARCH/$(BUILDARCH))
|
ifeq ($(ARCH),ppc64le)
|
||||||
|
LIBARCH ?= ppc64le
|
||||||
|
else
|
||||||
|
LIBARCH ?= $(LIBARCH/$(BUILDARCH))
|
||||||
|
endif
|
||||||
|
|
||||||
LIBARCH/i486 = i386
|
LIBARCH/i486 = i386
|
||||||
LIBARCH/amd64 = amd64
|
LIBARCH/amd64 = amd64
|
||||||
LIBARCH/sparc = sparc
|
LIBARCH/sparc = sparc
|
||||||
|
@ -261,7 +261,11 @@ endif
|
|||||||
OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
|
OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
|
||||||
|
|
||||||
# Variable tracking size limit exceeded for VMStructs::init()
|
# Variable tracking size limit exceeded for VMStructs::init()
|
||||||
OPT_CFLAGS/vmStructs.o += -fno-var-tracking-assignments
|
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "1"
|
||||||
|
# GCC >= 4.3
|
||||||
|
# Gcc 4.1.2 does not support this flag, nor does it have problems compiling the file.
|
||||||
|
OPT_CFLAGS/vmStructs.o += -fno-var-tracking-assignments
|
||||||
|
endif
|
||||||
|
|
||||||
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
|
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
|
||||||
# if we use expensive-optimizations
|
# if we use expensive-optimizations
|
||||||
|
@ -158,5 +158,6 @@ for e in ${Src_Files}; do
|
|||||||
fi
|
fi
|
||||||
Obj_Files="${Obj_Files}$o "
|
Obj_Files="${Obj_Files}$o "
|
||||||
done
|
done
|
||||||
|
Obj_Files=`echo ${Obj_Files} | tr ' ' '\n' | sort`
|
||||||
|
|
||||||
echo Obj_Files=${Obj_Files}
|
echo Obj_Files=${Obj_Files}
|
||||||
|
@ -58,14 +58,17 @@ define_pd_global(intx, InlineFrequencyCount, 100);
|
|||||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||||
#define DEFAULT_STACK_RED_PAGES (1)
|
#define DEFAULT_STACK_RED_PAGES (1)
|
||||||
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5))
|
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5))
|
||||||
|
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
#define MIN_STACK_YELLOW_PAGES 1
|
#define MIN_STACK_YELLOW_PAGES 1
|
||||||
#define MIN_STACK_RED_PAGES 1
|
#define MIN_STACK_RED_PAGES 1
|
||||||
#define MIN_STACK_SHADOW_PAGES 1
|
#define MIN_STACK_SHADOW_PAGES 1
|
||||||
|
#define MIN_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||||
|
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||||
|
|
||||||
define_pd_global(bool, RewriteBytecodes, true);
|
define_pd_global(bool, RewriteBytecodes, true);
|
||||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||||
|
@ -1973,7 +1973,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
// c_rarg4 - input length
|
// c_rarg4 - input length
|
||||||
//
|
//
|
||||||
// Output:
|
// Output:
|
||||||
// rax - input length
|
// x0 - input length
|
||||||
//
|
//
|
||||||
address generate_cipherBlockChaining_decryptAESCrypt() {
|
address generate_cipherBlockChaining_decryptAESCrypt() {
|
||||||
assert(UseAES, "need AES instructions and misaligned SSE support");
|
assert(UseAES, "need AES instructions and misaligned SSE support");
|
||||||
@ -2035,7 +2035,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
__ br(Assembler::EQ, L_rounds_52);
|
__ br(Assembler::EQ, L_rounds_52);
|
||||||
|
|
||||||
__ aesd(v0, v17); __ aesimc(v0, v0);
|
__ aesd(v0, v17); __ aesimc(v0, v0);
|
||||||
__ aesd(v0, v17); __ aesimc(v0, v0);
|
__ aesd(v0, v18); __ aesimc(v0, v0);
|
||||||
__ BIND(L_rounds_52);
|
__ BIND(L_rounds_52);
|
||||||
__ aesd(v0, v19); __ aesimc(v0, v0);
|
__ aesd(v0, v19); __ aesimc(v0, v0);
|
||||||
__ aesd(v0, v20); __ aesimc(v0, v0);
|
__ aesd(v0, v20); __ aesimc(v0, v0);
|
||||||
|
@ -84,10 +84,7 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const {
|
|||||||
|
|
||||||
frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
|
frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
|
||||||
// Pass callers initial_caller_sp as unextended_sp.
|
// Pass callers initial_caller_sp as unextended_sp.
|
||||||
return frame(sender_sp(), sender_pc(),
|
return frame(sender_sp(), sender_pc(), (intptr_t*)get_ijava_state()->sender_sp);
|
||||||
CC_INTERP_ONLY((intptr_t*)((parent_ijava_frame_abi *)callers_abi())->initial_caller_sp)
|
|
||||||
NOT_CC_INTERP((intptr_t*)get_ijava_state()->sender_sp)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
frame frame::sender_for_compiled_frame(RegisterMap *map) const {
|
frame frame::sender_for_compiled_frame(RegisterMap *map) const {
|
||||||
@ -168,14 +165,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
|
|||||||
if (method->is_native()) {
|
if (method->is_native()) {
|
||||||
// Prior to calling into the runtime to notify the method exit the possible
|
// Prior to calling into the runtime to notify the method exit the possible
|
||||||
// result value is saved into the interpreter frame.
|
// result value is saved into the interpreter frame.
|
||||||
#ifdef CC_INTERP
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
address lresult = (address)istate + in_bytes(BytecodeInterpreter::native_lresult_offset());
|
|
||||||
address fresult = (address)istate + in_bytes(BytecodeInterpreter::native_fresult_offset());
|
|
||||||
#else
|
|
||||||
address lresult = (address)&(get_ijava_state()->lresult);
|
address lresult = (address)&(get_ijava_state()->lresult);
|
||||||
address fresult = (address)&(get_ijava_state()->fresult);
|
address fresult = (address)&(get_ijava_state()->fresult);
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (method->result_type()) {
|
switch (method->result_type()) {
|
||||||
case T_OBJECT:
|
case T_OBJECT:
|
||||||
@ -226,31 +217,6 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
|
|||||||
|
|
||||||
void frame::describe_pd(FrameValues& values, int frame_no) {
|
void frame::describe_pd(FrameValues& values, int frame_no) {
|
||||||
if (is_interpreted_frame()) {
|
if (is_interpreted_frame()) {
|
||||||
#ifdef CC_INTERP
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
values.describe(frame_no, (intptr_t*)istate, "istate");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_thread), " thread");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_bcp), " bcp");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_locals), " locals");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_constants), " constants");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_method), err_msg(" method = %s", istate->_method->name_and_sig_as_C_string()));
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_mdx), " mdx");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_stack), " stack");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_msg), err_msg(" msg = %s", BytecodeInterpreter::C_msg(istate->_msg)));
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_result), " result");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_prev_link), " prev_link");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_oop_temp), " oop_temp");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_stack_base), " stack_base");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_stack_limit), " stack_limit");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_monitor_base), " monitor_base");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_frame_bottom), " frame_bottom");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_pc), " last_Java_pc");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_fp), " last_Java_fp");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_sp), " last_Java_sp");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_self_link), " self_link");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_native_fresult), " native_fresult");
|
|
||||||
values.describe(frame_no, (intptr_t*)&(istate->_native_lresult), " native_lresult");
|
|
||||||
#else
|
|
||||||
#define DESCRIBE_ADDRESS(name) \
|
#define DESCRIBE_ADDRESS(name) \
|
||||||
values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name);
|
values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name);
|
||||||
|
|
||||||
@ -266,7 +232,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
|
|||||||
DESCRIBE_ADDRESS(oop_tmp);
|
DESCRIBE_ADDRESS(oop_tmp);
|
||||||
DESCRIBE_ADDRESS(lresult);
|
DESCRIBE_ADDRESS(lresult);
|
||||||
DESCRIBE_ADDRESS(fresult);
|
DESCRIBE_ADDRESS(fresult);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -193,33 +193,48 @@
|
|||||||
#define _spill_nonvolatiles_neg(_component) \
|
#define _spill_nonvolatiles_neg(_component) \
|
||||||
(int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component))
|
(int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component))
|
||||||
|
|
||||||
|
// Frame layout for the Java template interpreter on PPC64.
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
// Frame layout for the Java template interpreter on PPC64.
|
|
||||||
//
|
//
|
||||||
// Diffs to the CC_INTERP are marked with 'X'.
|
// In these figures the stack grows upwards, while memory grows
|
||||||
|
// downwards. Square brackets denote regions possibly larger than
|
||||||
|
// single 64 bit slots.
|
||||||
//
|
//
|
||||||
|
// STACK (interpreter is active):
|
||||||
|
// 0 [TOP_IJAVA_FRAME]
|
||||||
|
// [PARENT_IJAVA_FRAME]
|
||||||
|
// ...
|
||||||
|
// [PARENT_IJAVA_FRAME]
|
||||||
|
// [ENTRY_FRAME]
|
||||||
|
// [C_FRAME]
|
||||||
|
// ...
|
||||||
|
// [C_FRAME]
|
||||||
|
//
|
||||||
|
// With the following frame layouts:
|
||||||
// TOP_IJAVA_FRAME:
|
// TOP_IJAVA_FRAME:
|
||||||
//
|
|
||||||
// 0 [TOP_IJAVA_FRAME_ABI]
|
// 0 [TOP_IJAVA_FRAME_ABI]
|
||||||
// alignment (optional)
|
// alignment (optional)
|
||||||
// [operand stack]
|
// [operand stack]
|
||||||
// [monitors] (optional)
|
// [monitors] (optional)
|
||||||
// X[IJAVA_STATE]
|
// [IJAVA_STATE]
|
||||||
// note: own locals are located in the caller frame.
|
// note: own locals are located in the caller frame.
|
||||||
//
|
//
|
||||||
// PARENT_IJAVA_FRAME:
|
// PARENT_IJAVA_FRAME:
|
||||||
//
|
|
||||||
// 0 [PARENT_IJAVA_FRAME_ABI]
|
// 0 [PARENT_IJAVA_FRAME_ABI]
|
||||||
// alignment (optional)
|
// alignment (optional)
|
||||||
// [callee's Java result]
|
// [callee's Java result]
|
||||||
// [callee's locals w/o arguments]
|
// [callee's locals w/o arguments]
|
||||||
// [outgoing arguments]
|
// [outgoing arguments]
|
||||||
// [used part of operand stack w/o arguments]
|
// [used part of operand stack w/o arguments]
|
||||||
// [monitors] (optional)
|
// [monitors] (optional)
|
||||||
// X[IJAVA_STATE]
|
// [IJAVA_STATE]
|
||||||
//
|
//
|
||||||
|
// ENTRY_FRAME:
|
||||||
|
// 0 [PARENT_IJAVA_FRAME_ABI]
|
||||||
|
// alignment (optional)
|
||||||
|
// [callee's Java result]
|
||||||
|
// [callee's locals w/o arguments]
|
||||||
|
// [outgoing arguments]
|
||||||
|
// [ENTRY_FRAME_LOCALS]
|
||||||
|
|
||||||
struct parent_ijava_frame_abi : abi_minframe {
|
struct parent_ijava_frame_abi : abi_minframe {
|
||||||
};
|
};
|
||||||
@ -269,113 +284,6 @@
|
|||||||
#define _ijava_state_neg(_component) \
|
#define _ijava_state_neg(_component) \
|
||||||
(int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component))
|
(int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component))
|
||||||
|
|
||||||
#else // CC_INTERP:
|
|
||||||
|
|
||||||
// Frame layout for the Java C++ interpreter on PPC64.
|
|
||||||
//
|
|
||||||
// This frame layout provides a C-like frame for every Java frame.
|
|
||||||
//
|
|
||||||
// In these figures the stack grows upwards, while memory grows
|
|
||||||
// downwards. Square brackets denote regions possibly larger than
|
|
||||||
// single 64 bit slots.
|
|
||||||
//
|
|
||||||
// STACK (no JNI, no compiled code, no library calls,
|
|
||||||
// interpreter-loop is active):
|
|
||||||
// 0 [InterpretMethod]
|
|
||||||
// [TOP_IJAVA_FRAME]
|
|
||||||
// [PARENT_IJAVA_FRAME]
|
|
||||||
// ...
|
|
||||||
// [PARENT_IJAVA_FRAME]
|
|
||||||
// [ENTRY_FRAME]
|
|
||||||
// [C_FRAME]
|
|
||||||
// ...
|
|
||||||
// [C_FRAME]
|
|
||||||
//
|
|
||||||
// TOP_IJAVA_FRAME:
|
|
||||||
// 0 [TOP_IJAVA_FRAME_ABI]
|
|
||||||
// alignment (optional)
|
|
||||||
// [operand stack]
|
|
||||||
// [monitors] (optional)
|
|
||||||
// [cInterpreter object]
|
|
||||||
// result, locals, and arguments are in parent frame!
|
|
||||||
//
|
|
||||||
// PARENT_IJAVA_FRAME:
|
|
||||||
// 0 [PARENT_IJAVA_FRAME_ABI]
|
|
||||||
// alignment (optional)
|
|
||||||
// [callee's Java result]
|
|
||||||
// [callee's locals w/o arguments]
|
|
||||||
// [outgoing arguments]
|
|
||||||
// [used part of operand stack w/o arguments]
|
|
||||||
// [monitors] (optional)
|
|
||||||
// [cInterpreter object]
|
|
||||||
//
|
|
||||||
// ENTRY_FRAME:
|
|
||||||
// 0 [PARENT_IJAVA_FRAME_ABI]
|
|
||||||
// alignment (optional)
|
|
||||||
// [callee's Java result]
|
|
||||||
// [callee's locals w/o arguments]
|
|
||||||
// [outgoing arguments]
|
|
||||||
// [ENTRY_FRAME_LOCALS]
|
|
||||||
//
|
|
||||||
// PARENT_IJAVA_FRAME_ABI:
|
|
||||||
// 0 [ABI_MINFRAME]
|
|
||||||
// top_frame_sp
|
|
||||||
// initial_caller_sp
|
|
||||||
//
|
|
||||||
// TOP_IJAVA_FRAME_ABI:
|
|
||||||
// 0 [PARENT_IJAVA_FRAME_ABI]
|
|
||||||
// carg_3_unused
|
|
||||||
// carg_4_unused
|
|
||||||
// carg_5_unused
|
|
||||||
// carg_6_unused
|
|
||||||
// carg_7_unused
|
|
||||||
// frame_manager_lr
|
|
||||||
//
|
|
||||||
|
|
||||||
// PARENT_IJAVA_FRAME_ABI
|
|
||||||
|
|
||||||
struct parent_ijava_frame_abi : abi_minframe {
|
|
||||||
// SOE registers.
|
|
||||||
// C2i adapters spill their top-frame stack-pointer here.
|
|
||||||
uint64_t top_frame_sp; // carg_1
|
|
||||||
// Sp of calling compiled frame before it was resized by the c2i
|
|
||||||
// adapter or sp of call stub. Does not contain a valid value for
|
|
||||||
// non-initial frames.
|
|
||||||
uint64_t initial_caller_sp; // carg_2
|
|
||||||
// aligned to frame::alignment_in_bytes (16)
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
parent_ijava_frame_abi_size = sizeof(parent_ijava_frame_abi)
|
|
||||||
};
|
|
||||||
|
|
||||||
#define _parent_ijava_frame_abi(_component) \
|
|
||||||
(offset_of(frame::parent_ijava_frame_abi, _component))
|
|
||||||
|
|
||||||
// TOP_IJAVA_FRAME_ABI
|
|
||||||
|
|
||||||
struct top_ijava_frame_abi : parent_ijava_frame_abi {
|
|
||||||
uint64_t carg_3_unused; // carg_3
|
|
||||||
uint64_t card_4_unused; //_16 carg_4
|
|
||||||
uint64_t carg_5_unused; // carg_5
|
|
||||||
uint64_t carg_6_unused; //_16 carg_6
|
|
||||||
uint64_t carg_7_unused; // carg_7
|
|
||||||
// Use arg8 for storing frame_manager_lr. The size of
|
|
||||||
// top_ijava_frame_abi must match abi_reg_args.
|
|
||||||
uint64_t frame_manager_lr; //_16 carg_8
|
|
||||||
// nothing to add here!
|
|
||||||
// aligned to frame::alignment_in_bytes (16)
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
top_ijava_frame_abi_size = sizeof(top_ijava_frame_abi)
|
|
||||||
};
|
|
||||||
|
|
||||||
#define _top_ijava_frame_abi(_component) \
|
|
||||||
(offset_of(frame::top_ijava_frame_abi, _component))
|
|
||||||
|
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
// ENTRY_FRAME
|
// ENTRY_FRAME
|
||||||
|
|
||||||
struct entry_frame_locals {
|
struct entry_frame_locals {
|
||||||
@ -496,10 +404,6 @@
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
// Additional interface for interpreter frames:
|
|
||||||
inline interpreterState get_interpreterState() const;
|
|
||||||
#else
|
|
||||||
inline ijava_state* get_ijava_state() const;
|
inline ijava_state* get_ijava_state() const;
|
||||||
// Some convenient register frame setters/getters for deoptimization.
|
// Some convenient register frame setters/getters for deoptimization.
|
||||||
inline intptr_t* interpreter_frame_esp() const;
|
inline intptr_t* interpreter_frame_esp() const;
|
||||||
@ -507,7 +411,6 @@
|
|||||||
inline void interpreter_frame_set_esp(intptr_t* esp);
|
inline void interpreter_frame_set_esp(intptr_t* esp);
|
||||||
inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
|
inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
|
||||||
inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);
|
inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
// Size of a monitor in bytes.
|
// Size of a monitor in bytes.
|
||||||
static int interpreter_frame_monitor_size_in_bytes();
|
static int interpreter_frame_monitor_size_in_bytes();
|
||||||
|
@ -123,84 +123,6 @@ inline intptr_t* frame::real_fp() const {
|
|||||||
return fp();
|
return fp();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
|
|
||||||
inline interpreterState frame::get_interpreterState() const {
|
|
||||||
return (interpreterState)(((address)callers_abi())
|
|
||||||
- frame::interpreter_frame_cinterpreterstate_size_in_bytes());
|
|
||||||
}
|
|
||||||
|
|
||||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return (intptr_t**)&istate->_locals;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return (intptr_t*)&istate->_bcp;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline intptr_t* frame::interpreter_frame_mdp_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return (intptr_t*)&istate->_mdx;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline intptr_t* frame::interpreter_frame_expression_stack() const {
|
|
||||||
return (intptr_t*)interpreter_frame_monitor_end() - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline jint frame::interpreter_frame_expression_stack_direction() {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// top of expression stack
|
|
||||||
inline intptr_t* frame::interpreter_frame_tos_address() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return istate->_stack + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
|
|
||||||
return &interpreter_frame_tos_address()[offset];
|
|
||||||
}
|
|
||||||
|
|
||||||
// monitor elements
|
|
||||||
|
|
||||||
// in keeping with Intel side: end is lower in memory than begin;
|
|
||||||
// and beginning element is oldest element
|
|
||||||
// Also begin is one past last monitor.
|
|
||||||
|
|
||||||
inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
|
|
||||||
return get_interpreterState()->monitor_base();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline BasicObjectLock* frame::interpreter_frame_monitor_end() const {
|
|
||||||
return (BasicObjectLock*)get_interpreterState()->stack_base();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int frame::interpreter_frame_cinterpreterstate_size_in_bytes() {
|
|
||||||
// Size of an interpreter object. Not aligned with frame size.
|
|
||||||
return round_to(sizeof(BytecodeInterpreter), 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Method** frame::interpreter_frame_method_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return &istate->_method;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constant pool cache
|
|
||||||
|
|
||||||
inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return &istate->_constants; // should really use accessor
|
|
||||||
}
|
|
||||||
|
|
||||||
inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
|
|
||||||
interpreterState istate = get_interpreterState();
|
|
||||||
return &istate->_constants;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // !CC_INTERP
|
|
||||||
|
|
||||||
// Template Interpreter frame value accessors.
|
// Template Interpreter frame value accessors.
|
||||||
|
|
||||||
inline frame::ijava_state* frame::get_ijava_state() const {
|
inline frame::ijava_state* frame::get_ijava_state() const {
|
||||||
@ -267,8 +189,6 @@ inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
|
|||||||
return &interpreter_frame_tos_address()[offset];
|
return &interpreter_frame_tos_address()[offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
inline int frame::interpreter_frame_monitor_size() {
|
inline int frame::interpreter_frame_monitor_size() {
|
||||||
// Number of stack slots for a monitor.
|
// Number of stack slots for a monitor.
|
||||||
return round_to(BasicObjectLock::size(), // number of stack slots
|
return round_to(BasicObjectLock::size(), // number of stack slots
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
#ifndef CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
#ifndef CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
||||||
#define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
#define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
||||||
|
|
||||||
|
#ifdef CC_INTERP
|
||||||
|
#error "CC_INTERP no more supported. Removed in change 8145117."
|
||||||
|
#endif
|
||||||
|
|
||||||
// Size of PPC Instructions
|
// Size of PPC Instructions
|
||||||
const int BytesPerInstWord = 4;
|
const int BytesPerInstWord = 4;
|
||||||
|
|
||||||
@ -36,4 +40,9 @@ const int StackAlignmentInBytes = 16;
|
|||||||
// The PPC CPUs are NOT multiple-copy-atomic.
|
// The PPC CPUs are NOT multiple-copy-atomic.
|
||||||
#define CPU_NOT_MULTIPLE_COPY_ATOMIC
|
#define CPU_NOT_MULTIPLE_COPY_ATOMIC
|
||||||
|
|
||||||
|
#if defined(COMPILER2) && defined(AIX)
|
||||||
|
// Include Transactional Memory lock eliding optimization
|
||||||
|
#define INCLUDE_RTM_OPT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
|
||||||
|
@ -44,14 +44,17 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs pas
|
|||||||
#define DEFAULT_STACK_YELLOW_PAGES (6)
|
#define DEFAULT_STACK_YELLOW_PAGES (6)
|
||||||
#define DEFAULT_STACK_RED_PAGES (1)
|
#define DEFAULT_STACK_RED_PAGES (1)
|
||||||
#define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2))
|
#define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2))
|
||||||
|
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
#define MIN_STACK_YELLOW_PAGES (1)
|
#define MIN_STACK_YELLOW_PAGES (1)
|
||||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||||
#define MIN_STACK_SHADOW_PAGES (1)
|
#define MIN_STACK_SHADOW_PAGES (1)
|
||||||
|
#define MIN_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||||
|
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||||
|
|
||||||
// Use large code-entry alignment.
|
// Use large code-entry alignment.
|
||||||
define_pd_global(intx, CodeEntryAlignment, 128);
|
define_pd_global(intx, CodeEntryAlignment, 128);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2015 SAP AG. All rights reserved.
|
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -38,11 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void InterpreterMacroAssembler::null_check_throw(Register a, int offset, Register temp_reg) {
|
void InterpreterMacroAssembler::null_check_throw(Register a, int offset, Register temp_reg) {
|
||||||
#ifdef CC_INTERP
|
|
||||||
address exception_entry = StubRoutines::throw_NullPointerException_at_call_entry();
|
|
||||||
#else
|
|
||||||
address exception_entry = Interpreter::throw_NullPointerException_entry();
|
address exception_entry = Interpreter::throw_NullPointerException_entry();
|
||||||
#endif
|
|
||||||
MacroAssembler::null_check_throw(a, offset, temp_reg, exception_entry);
|
MacroAssembler::null_check_throw(a, offset, temp_reg, exception_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,8 +53,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry, Register Rscratch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
|
|
||||||
void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) {
|
void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) {
|
||||||
Register bytecode = R12_scratch2;
|
Register bytecode = R12_scratch2;
|
||||||
if (bcp_incr != 0) {
|
if (bcp_incr != 0) {
|
||||||
@ -207,7 +201,8 @@ void InterpreterMacroAssembler::load_dispatch_table(Register dst, address* table
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify) {
|
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode,
|
||||||
|
address* table, bool verify) {
|
||||||
if (verify) {
|
if (verify) {
|
||||||
unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this
|
unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this
|
||||||
}
|
}
|
||||||
@ -394,7 +389,8 @@ void InterpreterMacroAssembler::get_4_byte_integer_at_bcp(int bcp_offset
|
|||||||
//
|
//
|
||||||
// Kills / writes:
|
// Kills / writes:
|
||||||
// - Rdst, Rscratch
|
// - Rdst, Rscratch
|
||||||
void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size) {
|
void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset,
|
||||||
|
size_t index_size) {
|
||||||
assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
|
assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
|
||||||
// Cache index is always in the native format, courtesy of Rewriter.
|
// Cache index is always in the native format, courtesy of Rewriter.
|
||||||
if (index_size == sizeof(u2)) {
|
if (index_size == sizeof(u2)) {
|
||||||
@ -416,7 +412,8 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
|
|||||||
// Rdst now contains cp cache index.
|
// Rdst now contains cp cache index.
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size) {
|
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset,
|
||||||
|
size_t index_size) {
|
||||||
get_cache_index_at_bcp(cache, bcp_offset, index_size);
|
get_cache_index_at_bcp(cache, bcp_offset, index_size);
|
||||||
sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord));
|
sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord));
|
||||||
add(cache, R27_constPoolCache, cache);
|
add(cache, R27_constPoolCache, cache);
|
||||||
@ -514,7 +511,8 @@ void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_t
|
|||||||
// and put arrayOop + shifted_index into res.
|
// and put arrayOop + shifted_index into res.
|
||||||
// Note: res is still shy of address by array offset into object.
|
// Note: res is still shy of address by array offset into object.
|
||||||
|
|
||||||
void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex, int index_shift, Register Rtmp, Register Rres) {
|
void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex,
|
||||||
|
int index_shift, Register Rtmp, Register Rres) {
|
||||||
// Check that index is in range for array, then shift index by index_shift,
|
// Check that index is in range for array, then shift index by index_shift,
|
||||||
// and put arrayOop + shifted_index into res.
|
// and put arrayOop + shifted_index into res.
|
||||||
// Note: res is still shy of address by array offset into object.
|
// Note: res is still shy of address by array offset into object.
|
||||||
@ -566,7 +564,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
|
|||||||
add(Rres, RsxtIndex, Rarray);
|
add(Rres, RsxtIndex, Rarray);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::index_check(Register array, Register index, int index_shift, Register tmp, Register res) {
|
void InterpreterMacroAssembler::index_check(Register array, Register index,
|
||||||
|
int index_shift, Register tmp, Register res) {
|
||||||
// pop array
|
// pop array
|
||||||
pop_ptr(array);
|
pop_ptr(array);
|
||||||
|
|
||||||
@ -637,7 +636,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
|
|||||||
Label Lunlock;
|
Label Lunlock;
|
||||||
// If it's still locked, everything is ok, unlock it.
|
// If it's still locked, everything is ok, unlock it.
|
||||||
ld(Rmonitor_base, 0, R1_SP);
|
ld(Rmonitor_base, 0, R1_SP);
|
||||||
addi(Rmonitor_base, Rmonitor_base, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
|
addi(Rmonitor_base, Rmonitor_base,
|
||||||
|
-(frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
|
||||||
|
|
||||||
ld(R0, BasicObjectLock::obj_offset_in_bytes(), Rmonitor_base);
|
ld(R0, BasicObjectLock::obj_offset_in_bytes(), Rmonitor_base);
|
||||||
cmpdi(CCR0, R0, 0);
|
cmpdi(CCR0, R0, 0);
|
||||||
@ -677,7 +677,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
|
|||||||
subf_(Riterations, R26_monitor, Rmonitor_base);
|
subf_(Riterations, R26_monitor, Rmonitor_base);
|
||||||
ble(CCR0, Lno_unlock);
|
ble(CCR0, Lno_unlock);
|
||||||
|
|
||||||
addi(Rcurrent_obj_addr, Rmonitor_base, BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
|
addi(Rcurrent_obj_addr, Rmonitor_base,
|
||||||
|
BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
|
||||||
// Check if any monitor is on stack, bail out if not
|
// Check if any monitor is on stack, bail out if not
|
||||||
srdi(Riterations, Riterations, exact_log2(delta));
|
srdi(Riterations, Riterations, exact_log2(delta));
|
||||||
mtctr(Riterations);
|
mtctr(Riterations);
|
||||||
@ -727,7 +728,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Support function for remove_activation & Co.
|
// Support function for remove_activation & Co.
|
||||||
void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc, Register Rscratch1, Register Rscratch2) {
|
void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc,
|
||||||
|
Register Rscratch1, Register Rscratch2) {
|
||||||
// Pop interpreter frame.
|
// Pop interpreter frame.
|
||||||
ld(Rscratch1, 0, R1_SP); // *SP
|
ld(Rscratch1, 0, R1_SP); // *SP
|
||||||
ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp
|
ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp
|
||||||
@ -779,8 +781,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
|
|||||||
mtlr(R0);
|
mtlr(R0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
// Lock object
|
// Lock object
|
||||||
//
|
//
|
||||||
// Registers alive
|
// Registers alive
|
||||||
@ -791,7 +791,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
|
|||||||
void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
||||||
if (UseHeavyMonitors) {
|
if (UseHeavyMonitors) {
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
|
||||||
monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
|
monitor, /*check_for_exceptions=*/true);
|
||||||
} else {
|
} else {
|
||||||
// template code:
|
// template code:
|
||||||
//
|
//
|
||||||
@ -888,7 +888,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
|||||||
// slow case of monitor enter.
|
// slow case of monitor enter.
|
||||||
bind(slow_case);
|
bind(slow_case);
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
|
||||||
monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
|
monitor, /*check_for_exceptions=*/true);
|
||||||
// }
|
// }
|
||||||
align(32, 12);
|
align(32, 12);
|
||||||
bind(done);
|
bind(done);
|
||||||
@ -905,7 +905,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
|
|||||||
void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) {
|
void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) {
|
||||||
if (UseHeavyMonitors) {
|
if (UseHeavyMonitors) {
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
|
||||||
monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
|
monitor, check_for_exceptions);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// template code:
|
// template code:
|
||||||
@ -978,7 +978,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
|
|||||||
// we need to get into the slow case.
|
// we need to get into the slow case.
|
||||||
bind(slow_case);
|
bind(slow_case);
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
|
||||||
monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
|
monitor, check_for_exceptions);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Label done;
|
Label done;
|
||||||
@ -993,8 +993,6 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
|
|
||||||
// Load compiled (i2c) or interpreter entry when calling from interpreted and
|
// Load compiled (i2c) or interpreter entry when calling from interpreted and
|
||||||
// do the call. Centralized so that all interpreter calls will do the same actions.
|
// do the call. Centralized so that all interpreter calls will do the same actions.
|
||||||
// If jvmti single stepping is on for a thread we must not call compiled code.
|
// If jvmti single stepping is on for a thread we must not call compiled code.
|
||||||
@ -1004,7 +1002,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
|
|||||||
// - Rret_addr: return address
|
// - Rret_addr: return address
|
||||||
// - 2 scratch regs
|
// - 2 scratch regs
|
||||||
//
|
//
|
||||||
void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2) {
|
void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr,
|
||||||
|
Register Rscratch1, Register Rscratch2) {
|
||||||
assert_different_registers(Rscratch1, Rscratch2, Rtarget_method, Rret_addr);
|
assert_different_registers(Rscratch1, Rscratch2, Rtarget_method, Rret_addr);
|
||||||
// Assume we want to go compiled if available.
|
// Assume we want to go compiled if available.
|
||||||
const Register Rtarget_addr = Rscratch1;
|
const Register Rtarget_addr = Rscratch1;
|
||||||
@ -1488,7 +1487,8 @@ void InterpreterMacroAssembler::profile_typecheck_failed(Register Rscratch1, Reg
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Count a ret in the bytecodes.
|
// Count a ret in the bytecodes.
|
||||||
void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2) {
|
void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci,
|
||||||
|
Register scratch1, Register scratch2) {
|
||||||
if (ProfileInterpreter) {
|
if (ProfileInterpreter) {
|
||||||
Label profile_continue;
|
Label profile_continue;
|
||||||
uint row;
|
uint row;
|
||||||
@ -1684,7 +1684,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper(
|
|||||||
// Argument and return type profilig.
|
// Argument and return type profilig.
|
||||||
// kills: tmp, tmp2, R0, CR0, CR1
|
// kills: tmp, tmp2, R0, CR0, CR1
|
||||||
void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base,
|
void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base,
|
||||||
RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2) {
|
RegisterOrConstant mdo_addr_offs,
|
||||||
|
Register tmp, Register tmp2) {
|
||||||
Label do_nothing, do_update;
|
Label do_nothing, do_update;
|
||||||
|
|
||||||
// tmp2 = obj is allowed
|
// tmp2 = obj is allowed
|
||||||
@ -1730,7 +1731,9 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr
|
|||||||
bind(do_nothing);
|
bind(do_nothing);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual) {
|
void InterpreterMacroAssembler::profile_arguments_type(Register callee,
|
||||||
|
Register tmp1, Register tmp2,
|
||||||
|
bool is_virtual) {
|
||||||
if (!ProfileInterpreter) {
|
if (!ProfileInterpreter) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1742,7 +1745,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
|
|||||||
|
|
||||||
test_method_data_pointer(profile_continue);
|
test_method_data_pointer(profile_continue);
|
||||||
|
|
||||||
int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
|
int off_to_start = is_virtual ?
|
||||||
|
in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
|
||||||
|
|
||||||
lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
|
lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
|
||||||
cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
|
cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
|
||||||
@ -1792,7 +1796,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
|
|||||||
// argument. tmp1 is the number of cells left in the
|
// argument. tmp1 is the number of cells left in the
|
||||||
// CallTypeData/VirtualCallTypeData to reach its end. Non null
|
// CallTypeData/VirtualCallTypeData to reach its end. Non null
|
||||||
// if there's a return to profile.
|
// if there's a return to profile.
|
||||||
assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
|
assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(),
|
||||||
|
"can't move past ret type");
|
||||||
sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
|
sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
|
||||||
add(R28_mdx, tmp1, R28_mdx);
|
add(R28_mdx, tmp1, R28_mdx);
|
||||||
}
|
}
|
||||||
@ -1841,7 +1846,8 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
|
void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2,
|
||||||
|
Register tmp3, Register tmp4) {
|
||||||
if (ProfileInterpreter && MethodData::profile_parameters()) {
|
if (ProfileInterpreter && MethodData::profile_parameters()) {
|
||||||
Label profile_continue, done;
|
Label profile_continue, done;
|
||||||
|
|
||||||
@ -1984,7 +1990,9 @@ void InterpreterMacroAssembler::load_local_long(Register Rdst_value, Register Rd
|
|||||||
// Kills:
|
// Kills:
|
||||||
// - Rdst_value
|
// - Rdst_value
|
||||||
// - Rdst_address
|
// - Rdst_address
|
||||||
void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex) {
|
void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value,
|
||||||
|
Register Rdst_address,
|
||||||
|
Register Rindex) {
|
||||||
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
||||||
subf(Rdst_address, Rdst_address, R18_locals);
|
subf(Rdst_address, Rdst_address, R18_locals);
|
||||||
ld(Rdst_value, 0, Rdst_address);
|
ld(Rdst_value, 0, Rdst_address);
|
||||||
@ -1995,7 +2003,9 @@ void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rds
|
|||||||
// Kills:
|
// Kills:
|
||||||
// - Rdst_value
|
// - Rdst_value
|
||||||
// - Rdst_address
|
// - Rdst_address
|
||||||
void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
|
void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value,
|
||||||
|
Register Rdst_address,
|
||||||
|
Register Rindex) {
|
||||||
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
||||||
subf(Rdst_address, Rdst_address, R18_locals);
|
subf(Rdst_address, Rdst_address, R18_locals);
|
||||||
lfs(Rdst_value, 0, Rdst_address);
|
lfs(Rdst_value, 0, Rdst_address);
|
||||||
@ -2006,7 +2016,9 @@ void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Regis
|
|||||||
// Kills:
|
// Kills:
|
||||||
// - Rdst_value
|
// - Rdst_value
|
||||||
// - Rdst_address
|
// - Rdst_address
|
||||||
void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
|
void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value,
|
||||||
|
Register Rdst_address,
|
||||||
|
Register Rindex) {
|
||||||
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
|
||||||
subf(Rdst_address, Rdst_address, R18_locals);
|
subf(Rdst_address, Rdst_address, R18_locals);
|
||||||
lfd(Rdst_value, -8, Rdst_address);
|
lfd(Rdst_value, -8, Rdst_address);
|
||||||
@ -2102,13 +2114,16 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions) {
|
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
|
||||||
|
Register arg_1, bool check_exceptions) {
|
||||||
// ARG1 is reserved for the thread.
|
// ARG1 is reserved for the thread.
|
||||||
mr_if_needed(R4_ARG2, arg_1);
|
mr_if_needed(R4_ARG2, arg_1);
|
||||||
call_VM(oop_result, entry_point, check_exceptions);
|
call_VM(oop_result, entry_point, check_exceptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions) {
|
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
|
||||||
|
Register arg_1, Register arg_2,
|
||||||
|
bool check_exceptions) {
|
||||||
// ARG1 is reserved for the thread.
|
// ARG1 is reserved for the thread.
|
||||||
mr_if_needed(R4_ARG2, arg_1);
|
mr_if_needed(R4_ARG2, arg_1);
|
||||||
assert(arg_2 != R4_ARG2, "smashed argument");
|
assert(arg_2 != R4_ARG2, "smashed argument");
|
||||||
@ -2116,7 +2131,9 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
|
|||||||
call_VM(oop_result, entry_point, check_exceptions);
|
call_VM(oop_result, entry_point, check_exceptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions) {
|
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
|
||||||
|
Register arg_1, Register arg_2, Register arg_3,
|
||||||
|
bool check_exceptions) {
|
||||||
// ARG1 is reserved for the thread.
|
// ARG1 is reserved for the thread.
|
||||||
mr_if_needed(R4_ARG2, arg_1);
|
mr_if_needed(R4_ARG2, arg_1);
|
||||||
assert(arg_2 != R4_ARG2, "smashed argument");
|
assert(arg_2 != R4_ARG2, "smashed argument");
|
||||||
@ -2168,8 +2185,6 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
void InterpreterMacroAssembler::get_method_counters(Register method,
|
void InterpreterMacroAssembler::get_method_counters(Register method,
|
||||||
Register Rcounters,
|
Register Rcounters,
|
||||||
Label& skip) {
|
Label& skip) {
|
||||||
@ -2188,7 +2203,9 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
|
|||||||
bind(has_counters);
|
bind(has_counters);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) {
|
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters,
|
||||||
|
Register iv_be_count,
|
||||||
|
Register Rtmp_r0) {
|
||||||
assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
|
assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
|
||||||
Register invocation_count = iv_be_count;
|
Register invocation_count = iv_be_count;
|
||||||
Register backedge_count = Rtmp_r0;
|
Register backedge_count = Rtmp_r0;
|
||||||
@ -2230,7 +2247,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
|
|||||||
if (state == atos) { MacroAssembler::verify_oop(reg); }
|
if (state == atos) { MacroAssembler::verify_oop(reg); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
// Local helper function for the verify_oop_or_return_address macro.
|
// Local helper function for the verify_oop_or_return_address macro.
|
||||||
static bool verify_return_address(Method* m, int bci) {
|
static bool verify_return_address(Method* m, int bci) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -2287,7 +2303,6 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis
|
|||||||
verify_oop(reg);
|
verify_oop(reg);
|
||||||
bind(skip);
|
bind(skip);
|
||||||
}
|
}
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
// Inline assembly for:
|
// Inline assembly for:
|
||||||
//
|
//
|
||||||
@ -2311,7 +2326,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
|
|||||||
cmpwi(CCR0, R0, 0);
|
cmpwi(CCR0, R0, 0);
|
||||||
beq(CCR0, jvmti_post_done);
|
beq(CCR0, jvmti_post_done);
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry),
|
||||||
/*check_exceptions=*/true CC_INTERP_ONLY(&& false));
|
/*check_exceptions=*/true);
|
||||||
|
|
||||||
bind(jvmti_post_done);
|
bind(jvmti_post_done);
|
||||||
}
|
}
|
||||||
@ -2345,11 +2360,10 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
|
|||||||
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
|
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
|
||||||
cmpwi(CCR0, R0, 0);
|
cmpwi(CCR0, R0, 0);
|
||||||
beq(CCR0, jvmti_post_done);
|
beq(CCR0, jvmti_post_done);
|
||||||
CC_INTERP_ONLY(assert(is_native_method && !check_exceptions, "must not push state"));
|
if (!is_native_method) { push(state); } // Expose tos to GC.
|
||||||
if (!is_native_method) push(state); // Expose tos to GC.
|
|
||||||
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit),
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit),
|
||||||
/*check_exceptions=*/check_exceptions);
|
/*check_exceptions=*/check_exceptions);
|
||||||
if (!is_native_method) pop(state);
|
if (!is_native_method) { pop(state); }
|
||||||
|
|
||||||
align(32, 12);
|
align(32, 12);
|
||||||
bind(jvmti_post_done);
|
bind(jvmti_post_done);
|
||||||
@ -2358,124 +2372,3 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
|
|||||||
// Dtrace support not implemented.
|
// Dtrace support not implemented.
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
|
|
||||||
// (using parent_frame_resize) and push a new interpreter
|
|
||||||
// TOP_IJAVA_FRAME (using frame_size).
|
|
||||||
void InterpreterMacroAssembler::push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
|
|
||||||
Register tmp1, Register tmp2, Register tmp3,
|
|
||||||
Register tmp4, Register pc) {
|
|
||||||
assert_different_registers(top_frame_size, parent_frame_resize, tmp1, tmp2, tmp3, tmp4);
|
|
||||||
ld(tmp1, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
|
|
||||||
mr(tmp2/*top_frame_sp*/, R1_SP);
|
|
||||||
// Move initial_caller_sp.
|
|
||||||
ld(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
neg(parent_frame_resize, parent_frame_resize);
|
|
||||||
resize_frame(parent_frame_resize/*-parent_frame_resize*/, tmp3);
|
|
||||||
|
|
||||||
// Set LR in new parent frame.
|
|
||||||
std(tmp1, _abi(lr), R1_SP);
|
|
||||||
// Set top_frame_sp info for new parent frame.
|
|
||||||
std(tmp2, _parent_ijava_frame_abi(top_frame_sp), R1_SP);
|
|
||||||
std(tmp4, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
|
|
||||||
// Push new TOP_IJAVA_FRAME.
|
|
||||||
push_frame(top_frame_size, tmp2);
|
|
||||||
|
|
||||||
get_PC_trash_LR(tmp3);
|
|
||||||
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
|
|
||||||
// Used for non-initial callers by unextended_sp().
|
|
||||||
std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pop the topmost TOP_IJAVA_FRAME and convert the previous
|
|
||||||
// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
|
|
||||||
void InterpreterMacroAssembler::pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
|
|
||||||
assert_different_registers(tmp1, tmp2, tmp3, tmp4);
|
|
||||||
|
|
||||||
ld(tmp1/*caller's sp*/, _abi(callers_sp), R1_SP);
|
|
||||||
ld(tmp3, _abi(lr), tmp1);
|
|
||||||
|
|
||||||
ld(tmp4, _parent_ijava_frame_abi(initial_caller_sp), tmp1);
|
|
||||||
|
|
||||||
ld(tmp2/*caller's caller's sp*/, _abi(callers_sp), tmp1);
|
|
||||||
// Merge top frame.
|
|
||||||
std(tmp2, _abi(callers_sp), R1_SP);
|
|
||||||
|
|
||||||
ld(tmp2, _parent_ijava_frame_abi(top_frame_sp), tmp1);
|
|
||||||
|
|
||||||
// Update C stack pointer to caller's top_abi.
|
|
||||||
resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
|
|
||||||
|
|
||||||
// Update LR in top_frame.
|
|
||||||
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
|
|
||||||
|
|
||||||
std(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
|
|
||||||
// Store the top-frame stack-pointer for c2i adapters.
|
|
||||||
std(R1_SP, _top_ijava_frame_abi(top_frame_sp), R1_SP);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
|
|
||||||
void InterpreterMacroAssembler::pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3) {
|
|
||||||
assert_different_registers(R14_state, R15_prev_state, tmp1, tmp2, tmp3);
|
|
||||||
|
|
||||||
if (state == R14_state) {
|
|
||||||
ld(tmp1/*state's fp*/, state_(_last_Java_fp));
|
|
||||||
ld(tmp2/*state's sp*/, state_(_last_Java_sp));
|
|
||||||
} else if (state == R15_prev_state) {
|
|
||||||
ld(tmp1/*state's fp*/, prev_state_(_last_Java_fp));
|
|
||||||
ld(tmp2/*state's sp*/, prev_state_(_last_Java_sp));
|
|
||||||
} else {
|
|
||||||
ShouldNotReachHere();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Merge top frames.
|
|
||||||
std(tmp1, _abi(callers_sp), R1_SP);
|
|
||||||
|
|
||||||
// Tmp2 is new SP.
|
|
||||||
// Tmp1 is parent's SP.
|
|
||||||
resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
|
|
||||||
|
|
||||||
// Update LR in top_frame.
|
|
||||||
// Must be interpreter frame.
|
|
||||||
get_PC_trash_LR(tmp3);
|
|
||||||
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
|
|
||||||
// Used for non-initial callers by unextended_sp().
|
|
||||||
std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set SP to initial caller's sp, but before fix the back chain.
|
|
||||||
void InterpreterMacroAssembler::resize_frame_to_initial_caller(Register tmp1, Register tmp2) {
|
|
||||||
ld(tmp1, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
ld(tmp2, _parent_ijava_frame_abi(callers_sp), R1_SP);
|
|
||||||
std(tmp2, _parent_ijava_frame_abi(callers_sp), tmp1); // Fix back chain ...
|
|
||||||
mr(R1_SP, tmp1); // ... and resize to initial caller.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pop the current interpreter state (without popping the correspoding
|
|
||||||
// frame) and restore R14_state and R15_prev_state accordingly.
|
|
||||||
// Use prev_state_may_be_0 to indicate whether prev_state may be 0
|
|
||||||
// in order to generate an extra check before retrieving prev_state_(_prev_link).
|
|
||||||
void InterpreterMacroAssembler::pop_interpreter_state(bool prev_state_may_be_0)
|
|
||||||
{
|
|
||||||
// Move prev_state to state and restore prev_state from state_(_prev_link).
|
|
||||||
Label prev_state_is_0;
|
|
||||||
mr(R14_state, R15_prev_state);
|
|
||||||
|
|
||||||
// Don't retrieve /*state==*/prev_state_(_prev_link)
|
|
||||||
// if /*state==*/prev_state is 0.
|
|
||||||
if (prev_state_may_be_0) {
|
|
||||||
cmpdi(CCR0, R15_prev_state, 0);
|
|
||||||
beq(CCR0, prev_state_is_0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ld(R15_prev_state, /*state==*/prev_state_(_prev_link));
|
|
||||||
bind(prev_state_is_0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InterpreterMacroAssembler::restore_prev_state() {
|
|
||||||
// _prev_link is private, but cInterpreter is a friend.
|
|
||||||
ld(R15_prev_state, state_(_prev_link));
|
|
||||||
}
|
|
||||||
#endif // CC_INTERP
|
|
||||||
|
@ -45,14 +45,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|||||||
#define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
|
#define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
|
||||||
#define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
|
#define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
#define state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R14_state
|
|
||||||
#define prev_state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R15_prev_state
|
|
||||||
void pop (TosState state) {}; // Not needed.
|
|
||||||
void push(TosState state) {}; // Not needed.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
virtual void check_and_handle_popframe(Register java_thread);
|
virtual void check_and_handle_popframe(Register java_thread);
|
||||||
virtual void check_and_handle_earlyret(Register java_thread);
|
virtual void check_and_handle_earlyret(Register java_thread);
|
||||||
|
|
||||||
@ -207,7 +199,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|||||||
|
|
||||||
void record_static_call_in_profile(Register Rentry, Register Rtmp);
|
void record_static_call_in_profile(Register Rentry, Register Rtmp);
|
||||||
void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
|
void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
void get_method_counters(Register method, Register Rcounters, Label& skip);
|
void get_method_counters(Register method, Register Rcounters, Label& skip);
|
||||||
void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
|
void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
|
||||||
@ -216,8 +207,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|||||||
void lock_object (Register lock_reg, Register obj_reg);
|
void lock_object (Register lock_reg, Register obj_reg);
|
||||||
void unlock_object(Register lock_reg, bool check_for_exceptions = true);
|
void unlock_object(Register lock_reg, bool check_for_exceptions = true);
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
|
|
||||||
// Interpreter profiling operations
|
// Interpreter profiling operations
|
||||||
void set_method_data_pointer_for_bcp();
|
void set_method_data_pointer_for_bcp();
|
||||||
void test_method_data_pointer(Label& zero_continue);
|
void test_method_data_pointer(Label& zero_continue);
|
||||||
@ -260,14 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|||||||
void profile_return_type(Register ret, Register tmp1, Register tmp2);
|
void profile_return_type(Register ret, Register tmp1, Register tmp2);
|
||||||
void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
|
void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
|
||||||
|
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
void verify_oop(Register reg, TosState state = atos); // only if +VerifyOops && state == atos
|
void verify_oop(Register reg, TosState state = atos); // only if +VerifyOops && state == atos
|
||||||
#ifndef CC_INTERP
|
|
||||||
void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
|
void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
|
||||||
void verify_FPU(int stack_depth, TosState state = ftos);
|
void verify_FPU(int stack_depth, TosState state = ftos);
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
|
||||||
typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
|
typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
|
||||||
|
|
||||||
@ -275,33 +260,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|||||||
void notify_method_entry();
|
void notify_method_entry();
|
||||||
void notify_method_exit(bool is_native_method, TosState state,
|
void notify_method_exit(bool is_native_method, TosState state,
|
||||||
NotifyMethodExitMode mode, bool check_exceptions);
|
NotifyMethodExitMode mode, bool check_exceptions);
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
|
|
||||||
// (using parent_frame_resize) and push a new interpreter
|
|
||||||
// TOP_IJAVA_FRAME (using frame_size).
|
|
||||||
void push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
|
|
||||||
Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register pc=noreg);
|
|
||||||
|
|
||||||
// Pop the topmost TOP_IJAVA_FRAME and convert the previous
|
|
||||||
// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
|
|
||||||
void pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
|
|
||||||
|
|
||||||
// Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
|
|
||||||
void pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3);
|
|
||||||
|
|
||||||
// Set SP to initial caller's sp, but before fix the back chain.
|
|
||||||
void resize_frame_to_initial_caller(Register tmp1, Register tmp2);
|
|
||||||
|
|
||||||
// Pop the current interpreter state (without popping the
|
|
||||||
// correspoding frame) and restore R14_state and R15_prev_state
|
|
||||||
// accordingly. Use prev_state_may_be_0 to indicate whether
|
|
||||||
// prev_state may be 0 in order to generate an extra check before
|
|
||||||
// retrieving prev_state_(_prev_link).
|
|
||||||
void pop_interpreter_state(bool prev_state_may_be_0);
|
|
||||||
|
|
||||||
void restore_prev_state();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
#endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
||||||
|
@ -457,17 +457,12 @@ address InterpreterGenerator::generate_abstract_entry(void) {
|
|||||||
// Reset JavaFrameAnchor from call_VM_leaf above.
|
// Reset JavaFrameAnchor from call_VM_leaf above.
|
||||||
__ reset_last_Java_frame();
|
__ reset_last_Java_frame();
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
// Return to frame manager, it will handle the pending exception.
|
|
||||||
__ blr();
|
|
||||||
#else
|
|
||||||
// We don't know our caller, so jump to the general forward exception stub,
|
// We don't know our caller, so jump to the general forward exception stub,
|
||||||
// which will also pop our full frame off. Satisfy the interface of
|
// which will also pop our full frame off. Satisfy the interface of
|
||||||
// SharedRuntime::generate_forward_exception()
|
// SharedRuntime::generate_forward_exception()
|
||||||
__ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
|
__ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
|
||||||
__ mtctr(R11_scratch1);
|
__ mtctr(R11_scratch1);
|
||||||
__ bctr();
|
__ bctr();
|
||||||
#endif
|
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@ -518,7 +513,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) {
|
|||||||
// continue and the thread will safepoint at the next bytecode dispatch.
|
// continue and the thread will safepoint at the next bytecode dispatch.
|
||||||
|
|
||||||
// If the receiver is null then it is OK to jump to the slow path.
|
// If the receiver is null then it is OK to jump to the slow path.
|
||||||
__ ld(R3_RET, Interpreter::stackElementSize, CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp)); // get receiver
|
__ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver
|
||||||
|
|
||||||
// Check if receiver == NULL and go the slow path.
|
// Check if receiver == NULL and go the slow path.
|
||||||
__ cmpdi(CCR0, R3_RET, 0);
|
__ cmpdi(CCR0, R3_RET, 0);
|
||||||
|
@ -39,12 +39,10 @@
|
|||||||
return stackElementWords * i;
|
return stackElementWords * i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
// The offset in bytes to access a expression stack slot
|
// The offset in bytes to access a expression stack slot
|
||||||
// relative to the esp pointer.
|
// relative to the esp pointer.
|
||||||
static int expr_offset_in_bytes(int slot) {
|
static int expr_offset_in_bytes(int slot) {
|
||||||
return stackElementSize * slot + wordSize;
|
return stackElementSize * slot + wordSize;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP
|
#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP
|
||||||
|
@ -2822,12 +2822,8 @@ void MacroAssembler::set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, R
|
|||||||
// sp points to a TOP_IJAVA_FRAME, retrieve frame's PC via
|
// sp points to a TOP_IJAVA_FRAME, retrieve frame's PC via
|
||||||
// TOP_IJAVA_FRAME_ABI.
|
// TOP_IJAVA_FRAME_ABI.
|
||||||
// FIXME: assert that we really have a TOP_IJAVA_FRAME here!
|
// FIXME: assert that we really have a TOP_IJAVA_FRAME here!
|
||||||
#ifdef CC_INTERP
|
|
||||||
ld(tmp1/*pc*/, _top_ijava_frame_abi(frame_manager_lr), sp);
|
|
||||||
#else
|
|
||||||
address entry = pc();
|
address entry = pc();
|
||||||
load_const_optimized(tmp1, entry);
|
load_const_optimized(tmp1, entry);
|
||||||
#endif
|
|
||||||
|
|
||||||
set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1);
|
set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1);
|
||||||
}
|
}
|
||||||
|
@ -50,12 +50,29 @@
|
|||||||
// to be 'vtbl_list_size' instances of the vtable in order to
|
// to be 'vtbl_list_size' instances of the vtable in order to
|
||||||
// differentiate between the 'vtable_list_size' original Klass objects.
|
// differentiate between the 'vtable_list_size' original Klass objects.
|
||||||
|
|
||||||
|
#define __ masm->
|
||||||
|
|
||||||
void MetaspaceShared::generate_vtable_methods(void** vtbl_list,
|
void MetaspaceShared::generate_vtable_methods(void** vtbl_list,
|
||||||
void** vtable,
|
void** vtable,
|
||||||
char** md_top,
|
char** md_top,
|
||||||
char* md_end,
|
char* md_end,
|
||||||
char** mc_top,
|
char** mc_top,
|
||||||
char* mc_end) {
|
char* mc_end) {
|
||||||
Unimplemented();
|
intptr_t vtable_bytes = (num_virtuals * vtbl_list_size) * sizeof(void*);
|
||||||
|
*(intptr_t *)(*md_top) = vtable_bytes;
|
||||||
|
*md_top += sizeof(intptr_t);
|
||||||
|
void** dummy_vtable = (void**)*md_top;
|
||||||
|
*vtable = dummy_vtable;
|
||||||
|
*md_top += vtable_bytes;
|
||||||
|
|
||||||
|
// Get ready to generate dummy methods.
|
||||||
|
|
||||||
|
CodeBuffer cb((unsigned char*)*mc_top, mc_end - *mc_top);
|
||||||
|
MacroAssembler* masm = new MacroAssembler(&cb);
|
||||||
|
|
||||||
|
// There are more general problems with CDS on ppc, so I can not
|
||||||
|
// really test this. But having this instead of Unimplementd() allows
|
||||||
|
// us to pass TestOptionsWithRanges.java.
|
||||||
|
__ unimplemented();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -32,12 +32,6 @@
|
|||||||
|
|
||||||
#define __ _masm->
|
#define __ _masm->
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
#define EXCEPTION_ENTRY StubRoutines::throw_NullPointerException_at_call_entry()
|
|
||||||
#else
|
|
||||||
#define EXCEPTION_ENTRY Interpreter::throw_NullPointerException_entry()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PRODUCT
|
#ifdef PRODUCT
|
||||||
#define BLOCK_COMMENT(str) // nothing
|
#define BLOCK_COMMENT(str) // nothing
|
||||||
#else
|
#else
|
||||||
@ -51,10 +45,12 @@ inline static RegisterOrConstant constant(int value) {
|
|||||||
return RegisterOrConstant(value);
|
return RegisterOrConstant(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg) {
|
void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg,
|
||||||
if (VerifyMethodHandles)
|
Register temp_reg, Register temp2_reg) {
|
||||||
verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class), temp_reg, temp2_reg,
|
if (VerifyMethodHandles) {
|
||||||
"MH argument is a Class");
|
verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class),
|
||||||
|
temp_reg, temp2_reg, "MH argument is a Class");
|
||||||
|
}
|
||||||
__ ld(klass_reg, java_lang_Class::klass_offset_in_bytes(), klass_reg);
|
__ ld(klass_reg, java_lang_Class::klass_offset_in_bytes(), klass_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +183,7 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
|
|||||||
sizeof(u2), /*is_signed*/ false);
|
sizeof(u2), /*is_signed*/ false);
|
||||||
// assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), "");
|
// assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), "");
|
||||||
Label L;
|
Label L;
|
||||||
__ ld(temp2, __ argument_offset(temp2, temp2, 0), CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp));
|
__ ld(temp2, __ argument_offset(temp2, temp2, 0), R15_esp);
|
||||||
__ cmpd(CCR1, temp2, recv);
|
__ cmpd(CCR1, temp2, recv);
|
||||||
__ beq(CCR1, L);
|
__ beq(CCR1, L);
|
||||||
__ stop("receiver not on stack");
|
__ stop("receiver not on stack");
|
||||||
@ -214,7 +210,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Register argbase = CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp); // parameter (preserved)
|
Register argbase = R15_esp; // parameter (preserved)
|
||||||
Register argslot = R3;
|
Register argslot = R3;
|
||||||
Register temp1 = R6;
|
Register temp1 = R6;
|
||||||
Register param_size = R7;
|
Register param_size = R7;
|
||||||
@ -317,10 +313,12 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
|||||||
__ verify_oop(receiver_reg);
|
__ verify_oop(receiver_reg);
|
||||||
if (iid == vmIntrinsics::_linkToSpecial) {
|
if (iid == vmIntrinsics::_linkToSpecial) {
|
||||||
// Don't actually load the klass; just null-check the receiver.
|
// Don't actually load the klass; just null-check the receiver.
|
||||||
__ null_check_throw(receiver_reg, -1, temp1, EXCEPTION_ENTRY);
|
__ null_check_throw(receiver_reg, -1, temp1,
|
||||||
|
Interpreter::throw_NullPointerException_entry());
|
||||||
} else {
|
} else {
|
||||||
// load receiver klass itself
|
// load receiver klass itself
|
||||||
__ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1, EXCEPTION_ENTRY);
|
__ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1,
|
||||||
|
Interpreter::throw_NullPointerException_entry());
|
||||||
__ load_klass(temp1_recv_klass, receiver_reg);
|
__ load_klass(temp1_recv_klass, receiver_reg);
|
||||||
__ verify_klass_ptr(temp1_recv_klass);
|
__ verify_klass_ptr(temp1_recv_klass);
|
||||||
}
|
}
|
||||||
|
@ -578,27 +578,17 @@ REGISTER_DECLARATION(FloatRegister, F13_ARG13, F13); // volatile
|
|||||||
|
|
||||||
// Register declarations to be used in frame manager assembly code.
|
// Register declarations to be used in frame manager assembly code.
|
||||||
// Use only non-volatile registers in order to keep values across C-calls.
|
// Use only non-volatile registers in order to keep values across C-calls.
|
||||||
#ifdef CC_INTERP
|
|
||||||
REGISTER_DECLARATION(Register, R14_state, R14); // address of new cInterpreter.
|
|
||||||
REGISTER_DECLARATION(Register, R15_prev_state, R15); // address of old cInterpreter
|
|
||||||
#else // CC_INTERP
|
|
||||||
REGISTER_DECLARATION(Register, R14_bcp, R14);
|
REGISTER_DECLARATION(Register, R14_bcp, R14);
|
||||||
REGISTER_DECLARATION(Register, R15_esp, R15);
|
REGISTER_DECLARATION(Register, R15_esp, R15);
|
||||||
REGISTER_DECLARATION(FloatRegister, F15_ftos, F15);
|
REGISTER_DECLARATION(FloatRegister, F15_ftos, F15);
|
||||||
#endif // CC_INTERP
|
|
||||||
REGISTER_DECLARATION(Register, R16_thread, R16); // address of current thread
|
REGISTER_DECLARATION(Register, R16_thread, R16); // address of current thread
|
||||||
REGISTER_DECLARATION(Register, R17_tos, R17); // address of Java tos (prepushed).
|
REGISTER_DECLARATION(Register, R17_tos, R17); // address of Java tos (prepushed).
|
||||||
REGISTER_DECLARATION(Register, R18_locals, R18); // address of first param slot (receiver).
|
REGISTER_DECLARATION(Register, R18_locals, R18); // address of first param slot (receiver).
|
||||||
REGISTER_DECLARATION(Register, R19_method, R19); // address of current method
|
REGISTER_DECLARATION(Register, R19_method, R19); // address of current method
|
||||||
#ifndef DONT_USE_REGISTER_DEFINES
|
#ifndef DONT_USE_REGISTER_DEFINES
|
||||||
#ifdef CC_INTERP
|
|
||||||
#define R14_state AS_REGISTER(Register, R14)
|
|
||||||
#define R15_prev_state AS_REGISTER(Register, R15)
|
|
||||||
#else // CC_INTERP
|
|
||||||
#define R14_bcp AS_REGISTER(Register, R14)
|
#define R14_bcp AS_REGISTER(Register, R14)
|
||||||
#define R15_esp AS_REGISTER(Register, R15)
|
#define R15_esp AS_REGISTER(Register, R15)
|
||||||
#define F15_ftos AS_REGISTER(FloatRegister, F15)
|
#define F15_ftos AS_REGISTER(FloatRegister, F15)
|
||||||
#endif // CC_INTERP
|
|
||||||
#define R16_thread AS_REGISTER(Register, R16)
|
#define R16_thread AS_REGISTER(Register, R16)
|
||||||
#define R17_tos AS_REGISTER(Register, R17)
|
#define R17_tos AS_REGISTER(Register, R17)
|
||||||
#define R18_locals AS_REGISTER(Register, R18)
|
#define R18_locals AS_REGISTER(Register, R18)
|
||||||
@ -619,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26);
|
|||||||
REGISTER_DECLARATION(Register, R27_tmp7, R27);
|
REGISTER_DECLARATION(Register, R27_tmp7, R27);
|
||||||
REGISTER_DECLARATION(Register, R28_tmp8, R28);
|
REGISTER_DECLARATION(Register, R28_tmp8, R28);
|
||||||
REGISTER_DECLARATION(Register, R29_tmp9, R29);
|
REGISTER_DECLARATION(Register, R29_tmp9, R29);
|
||||||
#ifndef CC_INTERP
|
|
||||||
REGISTER_DECLARATION(Register, R24_dispatch_addr, R24);
|
REGISTER_DECLARATION(Register, R24_dispatch_addr, R24);
|
||||||
REGISTER_DECLARATION(Register, R25_templateTableBase, R25);
|
REGISTER_DECLARATION(Register, R25_templateTableBase, R25);
|
||||||
REGISTER_DECLARATION(Register, R26_monitor, R26);
|
REGISTER_DECLARATION(Register, R26_monitor, R26);
|
||||||
REGISTER_DECLARATION(Register, R27_constPoolCache, R27);
|
REGISTER_DECLARATION(Register, R27_constPoolCache, R27);
|
||||||
REGISTER_DECLARATION(Register, R28_mdx, R28);
|
REGISTER_DECLARATION(Register, R28_mdx, R28);
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
#ifndef DONT_USE_REGISTER_DEFINES
|
#ifndef DONT_USE_REGISTER_DEFINES
|
||||||
#define R21_tmp1 AS_REGISTER(Register, R21)
|
#define R21_tmp1 AS_REGISTER(Register, R21)
|
||||||
@ -637,7 +625,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28);
|
|||||||
#define R27_tmp7 AS_REGISTER(Register, R27)
|
#define R27_tmp7 AS_REGISTER(Register, R27)
|
||||||
#define R28_tmp8 AS_REGISTER(Register, R28)
|
#define R28_tmp8 AS_REGISTER(Register, R28)
|
||||||
#define R29_tmp9 AS_REGISTER(Register, R29)
|
#define R29_tmp9 AS_REGISTER(Register, R29)
|
||||||
#ifndef CC_INTERP
|
|
||||||
// Lmonitors : monitor pointer
|
// Lmonitors : monitor pointer
|
||||||
// LcpoolCache: constant pool cache
|
// LcpoolCache: constant pool cache
|
||||||
// mdx: method data index
|
// mdx: method data index
|
||||||
@ -649,7 +636,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4)
|
#define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4)
|
||||||
#endif
|
|
||||||
|
|
||||||
// Scratch registers are volatile.
|
// Scratch registers are volatile.
|
||||||
REGISTER_DECLARATION(Register, R11_scratch1, R11);
|
REGISTER_DECLARATION(Register, R11_scratch1, R11);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2015 SAP AG. All rights reserved.
|
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -954,15 +954,10 @@ static address gen_c2i_adapter(MacroAssembler *masm,
|
|||||||
|
|
||||||
// Jump to the interpreter just as if interpreter was doing it.
|
// Jump to the interpreter just as if interpreter was doing it.
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
const Register tos = R17_tos;
|
|
||||||
#else
|
|
||||||
const Register tos = R15_esp;
|
|
||||||
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
||||||
#endif
|
|
||||||
|
|
||||||
// load TOS
|
// load TOS
|
||||||
__ addi(tos, R1_SP, st_off);
|
__ addi(R15_esp, R1_SP, st_off);
|
||||||
|
|
||||||
// Frame_manager expects initial_caller_sp (= SP without resize by c2i) in R21_tmp1.
|
// Frame_manager expects initial_caller_sp (= SP without resize by c2i) in R21_tmp1.
|
||||||
assert(sender_SP == R21_sender_SP, "passing initial caller's SP in wrong register");
|
assert(sender_SP == R21_sender_SP, "passing initial caller's SP in wrong register");
|
||||||
@ -996,12 +991,7 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
|
|||||||
// save code can segv when fxsave instructions find improperly
|
// save code can segv when fxsave instructions find improperly
|
||||||
// aligned stack pointer.
|
// aligned stack pointer.
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
const Register ld_ptr = R17_tos;
|
|
||||||
#else
|
|
||||||
const Register ld_ptr = R15_esp;
|
const Register ld_ptr = R15_esp;
|
||||||
#endif
|
|
||||||
|
|
||||||
const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 };
|
const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 };
|
||||||
const int num_value_regs = sizeof(value_regs) / sizeof(Register);
|
const int num_value_regs = sizeof(value_regs) / sizeof(Register);
|
||||||
int value_regs_index = 0;
|
int value_regs_index = 0;
|
||||||
@ -2593,15 +2583,11 @@ static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
|
|||||||
__ ld(frame_size_reg, 0, frame_sizes_reg);
|
__ ld(frame_size_reg, 0, frame_sizes_reg);
|
||||||
__ std(pc_reg, _abi(lr), R1_SP);
|
__ std(pc_reg, _abi(lr), R1_SP);
|
||||||
__ push_frame(frame_size_reg, R0/*tmp*/);
|
__ push_frame(frame_size_reg, R0/*tmp*/);
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ std(R1_SP, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
#else
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
__ load_const_optimized(pc_reg, 0x5afe);
|
__ load_const_optimized(pc_reg, 0x5afe);
|
||||||
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
|
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
|
||||||
#endif
|
#endif
|
||||||
__ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
|
__ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
|
||||||
#endif // CC_INTERP
|
|
||||||
__ addi(number_of_frames_reg, number_of_frames_reg, -1);
|
__ addi(number_of_frames_reg, number_of_frames_reg, -1);
|
||||||
__ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
|
__ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
|
||||||
__ addi(pcs_reg, pcs_reg, wordSize);
|
__ addi(pcs_reg, pcs_reg, wordSize);
|
||||||
@ -2673,15 +2659,11 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
|
|||||||
__ std(R12_scratch2, _abi(lr), R1_SP);
|
__ std(R12_scratch2, _abi(lr), R1_SP);
|
||||||
|
|
||||||
// Initialize initial_caller_sp.
|
// Initialize initial_caller_sp.
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ std(frame_size_reg/*old_sp*/, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
|
|
||||||
#else
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
__ load_const_optimized(pc_reg, 0x5afe);
|
__ load_const_optimized(pc_reg, 0x5afe);
|
||||||
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
|
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
|
||||||
#endif
|
#endif
|
||||||
__ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP);
|
__ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP);
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
// Make sure that there is at least one entry in the array.
|
// Make sure that there is at least one entry in the array.
|
||||||
@ -2708,9 +2690,6 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
|
|||||||
// Store it in the top interpreter frame.
|
// Store it in the top interpreter frame.
|
||||||
__ std(R0, _abi(lr), R1_SP);
|
__ std(R0, _abi(lr), R1_SP);
|
||||||
// Initialize frame_manager_lr of interpreter top frame.
|
// Initialize frame_manager_lr of interpreter top frame.
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ std(R0, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2899,16 +2878,8 @@ void SharedRuntime::generate_deopt_blob() {
|
|||||||
// optional c2i, caller of deoptee, ...).
|
// optional c2i, caller of deoptee, ...).
|
||||||
|
|
||||||
// Initialize R14_state.
|
// Initialize R14_state.
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ ld(R14_state, 0, R1_SP);
|
|
||||||
__ addi(R14_state, R14_state, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
|
|
||||||
// Also inititialize R15_prev_state.
|
|
||||||
__ restore_prev_state();
|
|
||||||
#else
|
|
||||||
__ restore_interpreter_state(R11_scratch1);
|
__ restore_interpreter_state(R11_scratch1);
|
||||||
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
|
|
||||||
// Return to the interpreter entry point.
|
// Return to the interpreter entry point.
|
||||||
__ blr();
|
__ blr();
|
||||||
@ -3034,16 +3005,8 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
|||||||
// stack: (top interpreter frame, ..., optional interpreter frame,
|
// stack: (top interpreter frame, ..., optional interpreter frame,
|
||||||
// optional c2i, caller of deoptee, ...).
|
// optional c2i, caller of deoptee, ...).
|
||||||
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
// Initialize R14_state, ...
|
|
||||||
__ ld(R11_scratch1, 0, R1_SP);
|
|
||||||
__ addi(R14_state, R11_scratch1, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
|
|
||||||
// also initialize R15_prev_state.
|
|
||||||
__ restore_prev_state();
|
|
||||||
#else
|
|
||||||
__ restore_interpreter_state(R11_scratch1);
|
__ restore_interpreter_state(R11_scratch1);
|
||||||
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
||||||
#endif // CC_INTERP
|
|
||||||
|
|
||||||
// Return to the interpreter entry point.
|
// Return to the interpreter entry point.
|
||||||
__ blr();
|
__ blr();
|
||||||
|
@ -225,11 +225,8 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
// R16_thread - JavaThread*
|
// R16_thread - JavaThread*
|
||||||
|
|
||||||
// Tos must point to last argument - element_size.
|
// Tos must point to last argument - element_size.
|
||||||
#ifdef CC_INTERP
|
|
||||||
const Register tos = R17_tos;
|
|
||||||
#else
|
|
||||||
const Register tos = R15_esp;
|
const Register tos = R15_esp;
|
||||||
#endif
|
|
||||||
__ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize);
|
__ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize);
|
||||||
|
|
||||||
// initialize call_stub locals (step 2)
|
// initialize call_stub locals (step 2)
|
||||||
@ -243,11 +240,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread");
|
assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread");
|
||||||
|
|
||||||
// Set R15_prev_state to 0 for simplifying checks in callee.
|
// Set R15_prev_state to 0 for simplifying checks in callee.
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ li(R15_prev_state, 0);
|
|
||||||
#else
|
|
||||||
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
|
||||||
#endif
|
|
||||||
// Stack on entry to frame manager / native entry:
|
// Stack on entry to frame manager / native entry:
|
||||||
//
|
//
|
||||||
// F0 [TOP_IJAVA_FRAME_ABI]
|
// F0 [TOP_IJAVA_FRAME_ABI]
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#ifndef CC_INTERP
|
|
||||||
#include "asm/macroAssembler.inline.hpp"
|
#include "asm/macroAssembler.inline.hpp"
|
||||||
#include "interpreter/bytecodeHistogram.hpp"
|
#include "interpreter/bytecodeHistogram.hpp"
|
||||||
#include "interpreter/interpreter.hpp"
|
#include "interpreter/interpreter.hpp"
|
||||||
@ -1799,4 +1798,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // !PRODUCT
|
#endif // !PRODUCT
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
#include "runtime/synchronizer.hpp"
|
#include "runtime/synchronizer.hpp"
|
||||||
#include "utilities/macros.hpp"
|
#include "utilities/macros.hpp"
|
||||||
|
|
||||||
#ifndef CC_INTERP
|
|
||||||
|
|
||||||
#undef __
|
#undef __
|
||||||
#define __ _masm->
|
#define __ _masm->
|
||||||
|
|
||||||
@ -4145,4 +4143,3 @@ void TemplateTable::wide() {
|
|||||||
__ bctr();
|
__ bctr();
|
||||||
// Note: the bcp increment step is part of the individual wide bytecode implementations.
|
// Note: the bcp increment step is part of the individual wide bytecode implementations.
|
||||||
}
|
}
|
||||||
#endif // !CC_INTERP
|
|
||||||
|
@ -210,12 +210,27 @@ void VM_Version::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adjust RTM (Restricted Transactional Memory) flags.
|
// Adjust RTM (Restricted Transactional Memory) flags.
|
||||||
if (!has_tcheck() && UseRTMLocking) {
|
if (UseRTMLocking) {
|
||||||
|
// If CPU or OS are too old:
|
||||||
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
||||||
// setting during arguments processing. See use_biased_locking().
|
// setting during arguments processing. See use_biased_locking().
|
||||||
// VM_Version_init() is executed after UseBiasedLocking is used
|
// VM_Version_init() is executed after UseBiasedLocking is used
|
||||||
// in Thread::allocate().
|
// in Thread::allocate().
|
||||||
vm_exit_during_initialization("RTM instructions are not available on this CPU");
|
if (!has_tcheck()) {
|
||||||
|
vm_exit_during_initialization("RTM instructions are not available on this CPU");
|
||||||
|
}
|
||||||
|
bool os_too_old = true;
|
||||||
|
#ifdef AIX
|
||||||
|
if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30
|
||||||
|
os_too_old = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef linux
|
||||||
|
// TODO: check kernel version (we currently have too old versions only)
|
||||||
|
#endif
|
||||||
|
if (os_too_old) {
|
||||||
|
vm_exit_during_initialization("RTM is not supported on this OS version.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UseRTMLocking) {
|
if (UseRTMLocking) {
|
||||||
|
@ -1453,6 +1453,9 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
|
|||||||
|
|
||||||
|
|
||||||
void LIR_Assembler::return_op(LIR_Opr result) {
|
void LIR_Assembler::return_op(LIR_Opr result) {
|
||||||
|
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
|
||||||
|
__ reserved_stack_check();
|
||||||
|
}
|
||||||
// the poll may need a register so just pick one that isn't the return register
|
// the poll may need a register so just pick one that isn't the return register
|
||||||
#if defined(TIERED) && !defined(_LP64)
|
#if defined(TIERED) && !defined(_LP64)
|
||||||
if (result->type_field() == LIR_OprDesc::long_type) {
|
if (result->type_field() == LIR_OprDesc::long_type) {
|
||||||
|
@ -632,7 +632,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
|||||||
|
|
||||||
// stack frames shouldn't be much larger than max_stack elements
|
// stack frames shouldn't be much larger than max_stack elements
|
||||||
|
|
||||||
if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
|
if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,4 +54,8 @@ const int StackAlignmentInBytes = (2*wordSize);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(SOLARIS)
|
||||||
|
#define SUPPORT_RESERVED_STACK_AREA
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
|
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
|
||||||
|
@ -54,6 +54,7 @@ define_pd_global(intx, InlineSmallCode, 1500);
|
|||||||
|
|
||||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||||
#define DEFAULT_STACK_RED_PAGES (1)
|
#define DEFAULT_STACK_RED_PAGES (1)
|
||||||
|
#define DEFAULT_STACK_RESERVED_PAGES (SOLARIS_ONLY(1) NOT_SOLARIS(0))
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
// Stack slots are 2X larger in LP64 than in the 32 bit VM.
|
// Stack slots are 2X larger in LP64 than in the 32 bit VM.
|
||||||
@ -69,10 +70,12 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
|||||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||||
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
||||||
|
#define MIN_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||||
|
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||||
|
|
||||||
define_pd_global(bool, RewriteBytecodes, true);
|
define_pd_global(bool, RewriteBytecodes, true);
|
||||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||||
|
@ -1140,6 +1140,19 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
|
|||||||
// save result (push state before jvmti call and pop it afterwards) and notify jvmti
|
// save result (push state before jvmti call and pop it afterwards) and notify jvmti
|
||||||
notify_method_exit(false, state, NotifyJVMTI);
|
notify_method_exit(false, state, NotifyJVMTI);
|
||||||
|
|
||||||
|
if (StackReservedPages > 0) {
|
||||||
|
// testing if Stack Reserved Area needs to be re-enabled
|
||||||
|
Label no_reserved_zone_enabling;
|
||||||
|
ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G3_scratch);
|
||||||
|
cmp_and_brx_short(SP, G3_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling);
|
||||||
|
|
||||||
|
call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread);
|
||||||
|
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError), G2_thread);
|
||||||
|
should_not_reach_here();
|
||||||
|
|
||||||
|
bind(no_reserved_zone_enabling);
|
||||||
|
}
|
||||||
|
|
||||||
interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
|
interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
|
||||||
verify_thread();
|
verify_thread();
|
||||||
|
|
||||||
|
@ -3601,6 +3601,24 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroAssembler::reserved_stack_check() {
|
||||||
|
// testing if reserved zone needs to be enabled
|
||||||
|
Label no_reserved_zone_enabling;
|
||||||
|
|
||||||
|
ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G4_scratch);
|
||||||
|
cmp_and_brx_short(SP, G4_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling);
|
||||||
|
|
||||||
|
call_VM_leaf(L0, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread);
|
||||||
|
|
||||||
|
AddressLiteral stub(StubRoutines::throw_delayed_StackOverflowError_entry());
|
||||||
|
jump_to(stub, G4_scratch);
|
||||||
|
delayed()->restore();
|
||||||
|
|
||||||
|
should_not_reach_here();
|
||||||
|
|
||||||
|
bind(no_reserved_zone_enabling);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
|
|
||||||
|
@ -1422,6 +1422,9 @@ public:
|
|||||||
// stack overflow + shadow pages. Clobbers tsp and scratch registers.
|
// stack overflow + shadow pages. Clobbers tsp and scratch registers.
|
||||||
void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch);
|
void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch);
|
||||||
|
|
||||||
|
// Check for reserved stack access in method being exited (for JIT)
|
||||||
|
void reserved_stack_check();
|
||||||
|
|
||||||
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset);
|
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset);
|
||||||
|
|
||||||
void verify_tlab();
|
void verify_tlab();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -433,7 +433,7 @@ void NativeMovConstReg32::verify() {
|
|||||||
|
|
||||||
|
|
||||||
void NativeMovConstReg32::print() {
|
void NativeMovConstReg32::print() {
|
||||||
tty->print_cr(INTPTR_FORMAT ": mov reg, " INTPTR_FORMAT, instruction_address(), data());
|
tty->print_cr(INTPTR_FORMAT ": mov reg, " INTPTR_FORMAT, p2i(instruction_address()), data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1294,6 +1294,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
|||||||
|
|
||||||
__ verify_thread();
|
__ verify_thread();
|
||||||
|
|
||||||
|
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||||
|
__ reserved_stack_check();
|
||||||
|
}
|
||||||
|
|
||||||
// If this does safepoint polling, then do it here
|
// If this does safepoint polling, then do it here
|
||||||
if(do_polling() && ra_->C->is_method_compilation()) {
|
if(do_polling() && ra_->C->is_method_compilation()) {
|
||||||
AddressLiteral polling_page(os::get_polling_page());
|
AddressLiteral polling_page(os::get_polling_page());
|
||||||
@ -1651,6 +1655,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf,
|
|||||||
#endif // !_LP64
|
#endif // !_LP64
|
||||||
|
|
||||||
Unimplemented();
|
Unimplemented();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
@ -5355,7 +5355,12 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
#endif // COMPILER2 !=> _LP64
|
#endif // COMPILER2 !=> _LP64
|
||||||
|
|
||||||
// Build this early so it's available for the interpreter.
|
// Build this early so it's available for the interpreter.
|
||||||
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
StubRoutines::_throw_StackOverflowError_entry =
|
||||||
|
generate_throw_exception("StackOverflowError throw_exception",
|
||||||
|
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||||
|
StubRoutines::_throw_delayed_StackOverflowError_entry =
|
||||||
|
generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||||
|
CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError));
|
||||||
|
|
||||||
if (UseCRC32Intrinsics) {
|
if (UseCRC32Intrinsics) {
|
||||||
// set table address before stub generation which use it
|
// set table address before stub generation which use it
|
||||||
|
@ -35,7 +35,10 @@ const char* VM_Version::_features_str = "";
|
|||||||
unsigned int VM_Version::_L2_data_cache_line_size = 0;
|
unsigned int VM_Version::_L2_data_cache_line_size = 0;
|
||||||
|
|
||||||
void VM_Version::initialize() {
|
void VM_Version::initialize() {
|
||||||
_features = determine_features();
|
|
||||||
|
assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete.");
|
||||||
|
guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
|
||||||
|
|
||||||
PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
|
PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
|
||||||
PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
|
PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
|
||||||
PrefetchFieldsAhead = prefetch_fields_ahead();
|
PrefetchFieldsAhead = prefetch_fields_ahead();
|
||||||
@ -60,8 +63,6 @@ void VM_Version::initialize() {
|
|||||||
FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
|
FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
|
|
||||||
|
|
||||||
UseSSE = 0; // Only on x86 and x64
|
UseSSE = 0; // Only on x86 and x64
|
||||||
|
|
||||||
_supports_cx8 = has_v9();
|
_supports_cx8 = has_v9();
|
||||||
|
@ -127,6 +127,8 @@ public:
|
|||||||
// Initialization
|
// Initialization
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
|
static void init_before_ergo() { _features = determine_features(); }
|
||||||
|
|
||||||
// Instruction support
|
// Instruction support
|
||||||
static bool has_v8() { return (_features & v8_instructions_m) != 0; }
|
static bool has_v8() { return (_features & v8_instructions_m) != 0; }
|
||||||
static bool has_v9() { return (_features & v9_instructions_m) != 0; }
|
static bool has_v9() { return (_features & v9_instructions_m) != 0; }
|
||||||
|
@ -518,6 +518,10 @@ void LIR_Assembler::return_op(LIR_Opr result) {
|
|||||||
// Pop the stack before the safepoint code
|
// Pop the stack before the safepoint code
|
||||||
__ remove_frame(initial_frame_size_in_bytes());
|
__ remove_frame(initial_frame_size_in_bytes());
|
||||||
|
|
||||||
|
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
|
||||||
|
__ reserved_stack_check();
|
||||||
|
}
|
||||||
|
|
||||||
bool result_is_oop = result->is_valid() ? result->is_oop() : false;
|
bool result_is_oop = result->is_valid() ? result->is_oop() : false;
|
||||||
|
|
||||||
// Note: we do not need to round double result; float result has the right precision
|
// Note: we do not need to round double result; float result has the right precision
|
||||||
|
@ -57,4 +57,8 @@ const int StackAlignmentInBytes = 16;
|
|||||||
#define INCLUDE_RTM_OPT 1
|
#define INCLUDE_RTM_OPT 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(LINUX) || defined(SOLARIS) || defined(__APPLE__)
|
||||||
|
#define SUPPORT_RESERVED_STACK_AREA
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
|
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
|
||||||
|
@ -57,9 +57,11 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
|||||||
|
|
||||||
#define DEFAULT_STACK_YELLOW_PAGES (NOT_WINDOWS(2) WINDOWS_ONLY(3))
|
#define DEFAULT_STACK_YELLOW_PAGES (NOT_WINDOWS(2) WINDOWS_ONLY(3))
|
||||||
#define DEFAULT_STACK_RED_PAGES (1)
|
#define DEFAULT_STACK_RED_PAGES (1)
|
||||||
|
#define DEFAULT_STACK_RESERVED_PAGES (NOT_WINDOWS(1) WINDOWS_ONLY(0))
|
||||||
|
|
||||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||||
|
#define MIN_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
#ifdef AMD64
|
#ifdef AMD64
|
||||||
// Very large C++ stack frames using solaris-amd64 optimized builds
|
// Very large C++ stack frames using solaris-amd64 optimized builds
|
||||||
@ -76,6 +78,7 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
|||||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||||
|
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||||
|
|
||||||
define_pd_global(bool, RewriteBytecodes, true);
|
define_pd_global(bool, RewriteBytecodes, true);
|
||||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||||
|
@ -1023,6 +1023,25 @@ void InterpreterMacroAssembler::remove_activation(
|
|||||||
// get sender sp
|
// get sender sp
|
||||||
movptr(rbx,
|
movptr(rbx,
|
||||||
Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
|
Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
|
||||||
|
if (StackReservedPages > 0) {
|
||||||
|
// testing if reserved zone needs to be re-enabled
|
||||||
|
Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
|
||||||
|
Label no_reserved_zone_enabling;
|
||||||
|
|
||||||
|
NOT_LP64(get_thread(rthread);)
|
||||||
|
|
||||||
|
cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
|
||||||
|
jcc(Assembler::lessEqual, no_reserved_zone_enabling);
|
||||||
|
|
||||||
|
call_VM_leaf(
|
||||||
|
CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
|
||||||
|
push(rthread);
|
||||||
|
call_VM(noreg, CAST_FROM_FN_PTR(address,
|
||||||
|
InterpreterRuntime::throw_delayed_StackOverflowError));
|
||||||
|
should_not_reach_here();
|
||||||
|
|
||||||
|
bind(no_reserved_zone_enabling);
|
||||||
|
}
|
||||||
leave(); // remove frame anchor
|
leave(); // remove frame anchor
|
||||||
pop(ret_addr); // get return address
|
pop(ret_addr); // get return address
|
||||||
mov(rsp, rbx); // set sp to sender sp
|
mov(rsp, rbx); // set sp to sender sp
|
||||||
|
@ -1067,6 +1067,22 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MacroAssembler::reserved_stack_check() {
|
||||||
|
// testing if reserved zone needs to be enabled
|
||||||
|
Label no_reserved_zone_enabling;
|
||||||
|
Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread);
|
||||||
|
NOT_LP64(get_thread(rsi);)
|
||||||
|
|
||||||
|
cmpptr(rsp, Address(thread, JavaThread::reserved_stack_activation_offset()));
|
||||||
|
jcc(Assembler::below, no_reserved_zone_enabling);
|
||||||
|
|
||||||
|
call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), thread);
|
||||||
|
jump(RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry()));
|
||||||
|
should_not_reach_here();
|
||||||
|
|
||||||
|
bind(no_reserved_zone_enabling);
|
||||||
|
}
|
||||||
|
|
||||||
int MacroAssembler::biased_locking_enter(Register lock_reg,
|
int MacroAssembler::biased_locking_enter(Register lock_reg,
|
||||||
Register obj_reg,
|
Register obj_reg,
|
||||||
Register swap_reg,
|
Register swap_reg,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -641,6 +641,9 @@ class MacroAssembler: public Assembler {
|
|||||||
// stack overflow + shadow pages. Also, clobbers tmp
|
// stack overflow + shadow pages. Also, clobbers tmp
|
||||||
void bang_stack_size(Register size, Register tmp);
|
void bang_stack_size(Register size, Register tmp);
|
||||||
|
|
||||||
|
// Check for reserved stack access in method being exited (for JIT)
|
||||||
|
void reserved_stack_check();
|
||||||
|
|
||||||
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
|
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
|
||||||
Register tmp,
|
Register tmp,
|
||||||
int offset);
|
int offset);
|
||||||
|
@ -3290,7 +3290,10 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
|
CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
|
||||||
|
|
||||||
// Build this early so it's available for the interpreter
|
// Build this early so it's available for the interpreter
|
||||||
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception",
|
||||||
|
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError));
|
||||||
|
StubRoutines::_throw_delayed_StackOverflowError_entry = generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||||
|
CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError));
|
||||||
|
|
||||||
if (UseCRC32Intrinsics) {
|
if (UseCRC32Intrinsics) {
|
||||||
// set table address before stub generation which use it
|
// set table address before stub generation which use it
|
||||||
|
@ -4410,6 +4410,11 @@ class StubGenerator: public StubCodeGenerator {
|
|||||||
CAST_FROM_FN_PTR(address,
|
CAST_FROM_FN_PTR(address,
|
||||||
SharedRuntime::
|
SharedRuntime::
|
||||||
throw_StackOverflowError));
|
throw_StackOverflowError));
|
||||||
|
StubRoutines::_throw_delayed_StackOverflowError_entry =
|
||||||
|
generate_throw_exception("delayed StackOverflowError throw_exception",
|
||||||
|
CAST_FROM_FN_PTR(address,
|
||||||
|
SharedRuntime::
|
||||||
|
throw_delayed_StackOverflowError));
|
||||||
if (UseCRC32Intrinsics) {
|
if (UseCRC32Intrinsics) {
|
||||||
// set table address before stub generation which use it
|
// set table address before stub generation which use it
|
||||||
StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
|
StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table;
|
||||||
|
@ -541,8 +541,8 @@ void InterpreterGenerator::generate_stack_overflow_check(void) {
|
|||||||
__ subptr(rax, stack_size);
|
__ subptr(rax, stack_size);
|
||||||
|
|
||||||
// Use the maximum number of pages we might bang.
|
// Use the maximum number of pages we might bang.
|
||||||
const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages :
|
const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages+StackReservedPages) ? StackShadowPages :
|
||||||
(StackRedPages+StackYellowPages);
|
(StackRedPages+StackYellowPages+StackReservedPages);
|
||||||
|
|
||||||
// add in the red and yellow zone sizes
|
// add in the red and yellow zone sizes
|
||||||
__ addptr(rax, max_pages * page_size);
|
__ addptr(rax, max_pages * page_size);
|
||||||
|
@ -670,17 +670,16 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
|
|||||||
|
|
||||||
void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||||
Compile *C = ra_->C;
|
Compile *C = ra_->C;
|
||||||
|
MacroAssembler _masm(&cbuf);
|
||||||
|
|
||||||
if (C->max_vector_size() > 16) {
|
if (C->max_vector_size() > 16) {
|
||||||
// Clear upper bits of YMM registers when current compiled code uses
|
// Clear upper bits of YMM registers when current compiled code uses
|
||||||
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
||||||
MacroAssembler masm(&cbuf);
|
_masm.vzeroupper();
|
||||||
masm.vzeroupper();
|
|
||||||
}
|
}
|
||||||
// If method set FPU control word, restore to standard control word
|
// If method set FPU control word, restore to standard control word
|
||||||
if (C->in_24_bit_fp_mode()) {
|
if (C->in_24_bit_fp_mode()) {
|
||||||
MacroAssembler masm(&cbuf);
|
_masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
|
||||||
masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int framesize = C->frame_size_in_bytes();
|
int framesize = C->frame_size_in_bytes();
|
||||||
@ -702,6 +701,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
|||||||
|
|
||||||
emit_opcode(cbuf, 0x58 | EBP_enc);
|
emit_opcode(cbuf, 0x58 | EBP_enc);
|
||||||
|
|
||||||
|
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||||
|
__ reserved_stack_check();
|
||||||
|
}
|
||||||
|
|
||||||
if (do_polling() && C->is_method_compilation()) {
|
if (do_polling() && C->is_method_compilation()) {
|
||||||
cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0);
|
cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0);
|
||||||
emit_opcode(cbuf,0x85);
|
emit_opcode(cbuf,0x85);
|
||||||
@ -729,6 +732,7 @@ uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
|
|||||||
} else {
|
} else {
|
||||||
size += framesize ? 3 : 0;
|
size += framesize ? 3 : 0;
|
||||||
}
|
}
|
||||||
|
size += 64; // added to support ReservedStackAccess
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -953,10 +953,11 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
|||||||
void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||||
{
|
{
|
||||||
Compile* C = ra_->C;
|
Compile* C = ra_->C;
|
||||||
|
MacroAssembler _masm(&cbuf);
|
||||||
|
|
||||||
if (C->max_vector_size() > 16) {
|
if (C->max_vector_size() > 16) {
|
||||||
// Clear upper bits of YMM registers when current compiled code uses
|
// Clear upper bits of YMM registers when current compiled code uses
|
||||||
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
// wide vectors to avoid AVX <-> SSE transition penalty during call.
|
||||||
MacroAssembler _masm(&cbuf);
|
|
||||||
__ vzeroupper();
|
__ vzeroupper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,6 +985,10 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
|||||||
// popq rbp
|
// popq rbp
|
||||||
emit_opcode(cbuf, 0x58 | RBP_enc);
|
emit_opcode(cbuf, 0x58 | RBP_enc);
|
||||||
|
|
||||||
|
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||||
|
__ reserved_stack_check();
|
||||||
|
}
|
||||||
|
|
||||||
if (do_polling() && C->is_method_compilation()) {
|
if (do_polling() && C->is_method_compilation()) {
|
||||||
MacroAssembler _masm(&cbuf);
|
MacroAssembler _masm(&cbuf);
|
||||||
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
|
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
|
||||||
|
@ -48,14 +48,17 @@ define_pd_global(intx, InlineSmallCode, 1000 );
|
|||||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||||
#define DEFAULT_STACK_RED_PAGES (1)
|
#define DEFAULT_STACK_RED_PAGES (1)
|
||||||
#define DEFAULT_STACK_SHADOW_PAGES (5 LP64_ONLY(+1) DEBUG_ONLY(+3))
|
#define DEFAULT_STACK_SHADOW_PAGES (5 LP64_ONLY(+1) DEBUG_ONLY(+3))
|
||||||
|
#define DEFAULT_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
|
||||||
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
|
||||||
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
#define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
|
||||||
|
#define MIN_STACK_RESERVED_PAGES (0)
|
||||||
|
|
||||||
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
|
||||||
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
|
||||||
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
|
||||||
|
define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
|
||||||
|
|
||||||
define_pd_global(bool, RewriteBytecodes, true);
|
define_pd_global(bool, RewriteBytecodes, true);
|
||||||
define_pd_global(bool, RewriteFrequentPairs, true);
|
define_pd_global(bool, RewriteFrequentPairs, true);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -170,7 +170,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
|
|||||||
* @return flags of this method
|
* @return flags of this method
|
||||||
*/
|
*/
|
||||||
private int getFlags() {
|
private int getFlags() {
|
||||||
return UNSAFE.getByte(metaspaceMethod + config().methodFlagsOffset);
|
return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1244,7 +1244,7 @@ public class HotSpotVMConfig {
|
|||||||
@HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset;
|
@HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset;
|
||||||
@HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset;
|
@HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset;
|
||||||
@HotSpotVMField(name = "Method::_intrinsic_id", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset;
|
@HotSpotVMField(name = "Method::_intrinsic_id", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset;
|
||||||
@HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset;
|
@HotSpotVMField(name = "Method::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset;
|
||||||
@HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset;
|
@HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset;
|
||||||
|
|
||||||
@HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite;
|
@HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite;
|
||||||
|
118
hotspot/src/os/aix/vm/libodm_aix.cpp
Normal file
118
hotspot/src/os/aix/vm/libodm_aix.cpp
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright 2015, 2015 SAP AG. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please 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 "libodm_aix.hpp"
|
||||||
|
#include "misc_aix.hpp"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "runtime/arguments.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
dynamicOdm::dynamicOdm() {
|
||||||
|
const char *libodmname = "/usr/lib/libodm.a(shr_64.o)";
|
||||||
|
_libhandle = dlopen(libodmname, RTLD_MEMBER | RTLD_NOW);
|
||||||
|
if (!_libhandle) {
|
||||||
|
trcVerbose("Couldn't open %s", libodmname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_odm_initialize = (fun_odm_initialize )dlsym(_libhandle, "odm_initialize" );
|
||||||
|
_odm_set_path = (fun_odm_set_path )dlsym(_libhandle, "odm_set_path" );
|
||||||
|
_odm_mount_class = (fun_odm_mount_class)dlsym(_libhandle, "odm_mount_class");
|
||||||
|
_odm_get_obj = (fun_odm_get_obj )dlsym(_libhandle, "odm_get_obj" );
|
||||||
|
_odm_terminate = (fun_odm_terminate )dlsym(_libhandle, "odm_terminate" );
|
||||||
|
if (!_odm_initialize || !_odm_set_path || !_odm_mount_class || !_odm_get_obj || !_odm_terminate) {
|
||||||
|
trcVerbose("Couldn't find all required odm symbols from %s", libodmname);
|
||||||
|
dlclose(_libhandle);
|
||||||
|
_libhandle = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dynamicOdm::~dynamicOdm() {
|
||||||
|
if (_libhandle) { dlclose(_libhandle); }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void odmWrapper::clean_data() { if (_data) { free(_data); _data = NULL; } }
|
||||||
|
|
||||||
|
|
||||||
|
int odmWrapper::class_offset(char *field, bool is_aix_5)
|
||||||
|
{
|
||||||
|
assert(has_class(), "initialization");
|
||||||
|
for (int i = 0; i < odm_class()->nelem; i++) {
|
||||||
|
if (strcmp(odm_class()->elem[i].elemname, field) == 0) {
|
||||||
|
int offset = odm_class()->elem[i].offset;
|
||||||
|
if (is_aix_5) { offset += LINK_VAL_OFFSET; }
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void odmWrapper::determine_os_kernel_version(uint32_t* p_ver) {
|
||||||
|
int major_aix_version = ((*p_ver) >> 24) & 0xFF,
|
||||||
|
minor_aix_version = ((*p_ver) >> 16) & 0xFF;
|
||||||
|
assert(*p_ver, "must be initialized");
|
||||||
|
|
||||||
|
odmWrapper odm("product", "/usr/lib/objrepos"); // could also use "lpp"
|
||||||
|
if (!odm.has_class()) {
|
||||||
|
trcVerbose("try_determine_os_kernel_version: odm init problem");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int voff, roff, moff, foff;
|
||||||
|
bool is_aix_5 = (major_aix_version == 5);
|
||||||
|
voff = odm.class_offset("ver", is_aix_5);
|
||||||
|
roff = odm.class_offset("rel", is_aix_5);
|
||||||
|
moff = odm.class_offset("mod", is_aix_5);
|
||||||
|
foff = odm.class_offset("fix", is_aix_5);
|
||||||
|
if (voff == -1 || roff == -1 || moff == -1 || foff == -1) {
|
||||||
|
trcVerbose("try_determine_os_kernel_version: could not get offsets");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!odm.retrieve_obj("name='bos.mp64'")) {
|
||||||
|
trcVerbose("try_determine_os_kernel_version: odm_get_obj failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int version, release, modification, fix_level;
|
||||||
|
do {
|
||||||
|
version = odm.read_short(voff);
|
||||||
|
release = odm.read_short(roff);
|
||||||
|
modification = odm.read_short(moff);
|
||||||
|
fix_level = odm.read_short(foff);
|
||||||
|
trcVerbose("odm found version: %d.%d.%d.%d", version, release, modification, fix_level);
|
||||||
|
if (version >> 8 != 0 || release >> 8 != 0 || modification >> 8 != 0 || fix_level >> 8 != 0) {
|
||||||
|
trcVerbose("8 bit numbers expected");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} while (odm.retrieve_obj());
|
||||||
|
|
||||||
|
if (version != major_aix_version || release != minor_aix_version) {
|
||||||
|
trcVerbose("version determined by odm does not match uname");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*p_ver = version << 24 | release << 16 | modification << 8 | fix_level;
|
||||||
|
}
|
106
hotspot/src/os/aix/vm/libodm_aix.hpp
Normal file
106
hotspot/src/os/aix/vm/libodm_aix.hpp
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright 2015, 2015 SAP AG. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Encapsulates the libodm library and provides more convenient interfaces.
|
||||||
|
|
||||||
|
#ifndef OS_AIX_VM_LIBODM_AIX_HPP
|
||||||
|
#define OS_AIX_VM_LIBODM_AIX_HPP
|
||||||
|
|
||||||
|
#include <odmi.h>
|
||||||
|
|
||||||
|
|
||||||
|
// The purpose of this code is to dynamically load the libodm library
|
||||||
|
// instead of statically linking against it. The library is AIX-specific.
|
||||||
|
// It only exists on AIX, not on PASE. In order to share binaries
|
||||||
|
// between AIX and PASE, we can't directly link against it.
|
||||||
|
|
||||||
|
typedef int (*fun_odm_initialize )(void);
|
||||||
|
typedef char* (*fun_odm_set_path )(char*);
|
||||||
|
typedef CLASS_SYMBOL (*fun_odm_mount_class)(char*);
|
||||||
|
typedef void* (*fun_odm_get_obj )(CLASS_SYMBOL, char*, void*, int);
|
||||||
|
typedef int (*fun_odm_terminate )(void);
|
||||||
|
|
||||||
|
class dynamicOdm {
|
||||||
|
void *_libhandle;
|
||||||
|
protected:
|
||||||
|
fun_odm_initialize _odm_initialize;
|
||||||
|
fun_odm_set_path _odm_set_path;
|
||||||
|
fun_odm_mount_class _odm_mount_class;
|
||||||
|
fun_odm_get_obj _odm_get_obj;
|
||||||
|
fun_odm_terminate _odm_terminate;
|
||||||
|
public:
|
||||||
|
dynamicOdm();
|
||||||
|
~dynamicOdm();
|
||||||
|
bool odm_loaded() {return _libhandle != NULL; }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// We provide a more convenient interface for odm access and
|
||||||
|
// especially to determine the exact AIX kernel version.
|
||||||
|
|
||||||
|
class odmWrapper : private dynamicOdm {
|
||||||
|
CLASS_SYMBOL _odm_class;
|
||||||
|
char *_data;
|
||||||
|
bool _initialized;
|
||||||
|
void clean_data();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Make sure everything gets initialized and cleaned up properly.
|
||||||
|
explicit odmWrapper(char* odm_class_name, char* odm_path = NULL) : _odm_class((CLASS_SYMBOL)-1),
|
||||||
|
_data(NULL), _initialized(false) {
|
||||||
|
if (!odm_loaded()) { return; }
|
||||||
|
_initialized = ((*_odm_initialize)() != -1);
|
||||||
|
if (_initialized) {
|
||||||
|
if (odm_path) { (*_odm_set_path)(odm_path); }
|
||||||
|
_odm_class = (*_odm_mount_class)(odm_class_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~odmWrapper() {
|
||||||
|
if (_initialized) { (*_odm_terminate)(); clean_data(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
CLASS_SYMBOL odm_class() { return _odm_class; }
|
||||||
|
bool has_class() { return odm_class() != (CLASS_SYMBOL)-1; }
|
||||||
|
int class_offset(char *field, bool is_aix_5);
|
||||||
|
char* data() { return _data; }
|
||||||
|
|
||||||
|
char* retrieve_obj(char* name = NULL) {
|
||||||
|
clean_data();
|
||||||
|
char *cnp = (char*)(void*)(*_odm_get_obj)(odm_class(), name, NULL, (name == NULL) ? ODM_NEXT : ODM_FIRST);
|
||||||
|
if (cnp != (char*)-1) { _data = cnp; }
|
||||||
|
return data();
|
||||||
|
}
|
||||||
|
|
||||||
|
int read_short(int offs) {
|
||||||
|
short *addr = (short*)(data() + offs);
|
||||||
|
return *addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine the exact AIX kernel version as 4 byte value.
|
||||||
|
// The high order 2 bytes must be initialized already. They can be determined by uname.
|
||||||
|
static void determine_os_kernel_version(uint32_t* p_ver);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // OS_AIX_VM_LIBODM_AIX_HPP
|
@ -38,6 +38,7 @@
|
|||||||
#include "jvm_aix.h"
|
#include "jvm_aix.h"
|
||||||
#include "libo4.hpp"
|
#include "libo4.hpp"
|
||||||
#include "libperfstat_aix.hpp"
|
#include "libperfstat_aix.hpp"
|
||||||
|
#include "libodm_aix.hpp"
|
||||||
#include "loadlib_aix.hpp"
|
#include "loadlib_aix.hpp"
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
#include "memory/filemap.hpp"
|
#include "memory/filemap.hpp"
|
||||||
@ -197,9 +198,13 @@ int os::Aix::_page_size = -1;
|
|||||||
// -1 = uninitialized, 0 if AIX, 1 if OS/400 pase
|
// -1 = uninitialized, 0 if AIX, 1 if OS/400 pase
|
||||||
int os::Aix::_on_pase = -1;
|
int os::Aix::_on_pase = -1;
|
||||||
|
|
||||||
// -1 = uninitialized, otherwise os version in the form 0xMMmm - MM:major, mm:minor
|
// 0 = uninitialized, otherwise 32 bit number:
|
||||||
// E.g. 0x0601 for AIX 6.1 or 0x0504 for OS/400 V5R4
|
// 0xVVRRTTSS
|
||||||
int os::Aix::_os_version = -1;
|
// VV - major version
|
||||||
|
// RR - minor version
|
||||||
|
// TT - tech level, if known, 0 otherwise
|
||||||
|
// SS - service pack, if known, 0 otherwise
|
||||||
|
uint32_t os::Aix::_os_version = 0;
|
||||||
|
|
||||||
int os::Aix::_stack_page_size = -1;
|
int os::Aix::_stack_page_size = -1;
|
||||||
|
|
||||||
@ -358,7 +363,7 @@ static char cpu_arch[] = "ppc64";
|
|||||||
|
|
||||||
// Wrap the function "vmgetinfo" which is not available on older OS releases.
|
// Wrap the function "vmgetinfo" which is not available on older OS releases.
|
||||||
static int checked_vmgetinfo(void *out, int command, int arg) {
|
static int checked_vmgetinfo(void *out, int command, int arg) {
|
||||||
if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) {
|
if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) {
|
||||||
guarantee(false, "cannot call vmgetinfo on AS/400 older than V6R1");
|
guarantee(false, "cannot call vmgetinfo on AS/400 older than V6R1");
|
||||||
}
|
}
|
||||||
return ::vmgetinfo(out, command, arg);
|
return ::vmgetinfo(out, command, arg);
|
||||||
@ -367,7 +372,7 @@ static int checked_vmgetinfo(void *out, int command, int arg) {
|
|||||||
// Given an address, returns the size of the page backing that address.
|
// Given an address, returns the size of the page backing that address.
|
||||||
size_t os::Aix::query_pagesize(void* addr) {
|
size_t os::Aix::query_pagesize(void* addr) {
|
||||||
|
|
||||||
if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) {
|
if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) {
|
||||||
// AS/400 older than V6R1: no vmgetinfo here, default to 4K
|
// AS/400 older than V6R1: no vmgetinfo here, default to 4K
|
||||||
return SIZE_4K;
|
return SIZE_4K;
|
||||||
}
|
}
|
||||||
@ -1211,7 +1216,7 @@ void os::shutdown() {
|
|||||||
// Note: os::abort() might be called very early during initialization, or
|
// Note: os::abort() might be called very early during initialization, or
|
||||||
// called from signal handler. Before adding something to os::abort(), make
|
// called from signal handler. Before adding something to os::abort(), make
|
||||||
// sure it is async-safe and can handle partially initialized VM.
|
// sure it is async-safe and can handle partially initialized VM.
|
||||||
void os::abort(bool dump_core, void* siginfo, void* context) {
|
void os::abort(bool dump_core, void* siginfo, const void* context) {
|
||||||
os::shutdown();
|
os::shutdown();
|
||||||
if (dump_core) {
|
if (dump_core) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -1491,6 +1496,10 @@ void os::print_os_info(outputStream* st) {
|
|||||||
st->print(name.machine);
|
st->print(name.machine);
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
|
uint32_t ver = os::Aix::os_version();
|
||||||
|
st->print_cr("AIX kernel version %u.%u.%u.%u",
|
||||||
|
(ver >> 24) & 0xFF, (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF);
|
||||||
|
|
||||||
// rlimit
|
// rlimit
|
||||||
st->print("rlimit:");
|
st->print("rlimit:");
|
||||||
struct rlimit rlim;
|
struct rlimit rlim;
|
||||||
@ -3431,8 +3440,12 @@ void os::Aix::check_signal_handler(int sig) {
|
|||||||
}
|
}
|
||||||
} else if (os::Aix::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Aix::get_our_sigflags(sig)) {
|
} else if (os::Aix::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Aix::get_our_sigflags(sig)) {
|
||||||
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
||||||
tty->print("expected:" PTR32_FORMAT, os::Aix::get_our_sigflags(sig));
|
tty->print("expected:");
|
||||||
tty->print_cr(" found:" PTR32_FORMAT, act.sa_flags);
|
os::Posix::print_sa_flags(tty, os::Aix::get_our_sigflags(sig));
|
||||||
|
tty->cr();
|
||||||
|
tty->print(" found:");
|
||||||
|
os::Posix::print_sa_flags(tty, act.sa_flags);
|
||||||
|
tty->cr();
|
||||||
// No need to check this sig any longer
|
// No need to check this sig any longer
|
||||||
sigaddset(&check_signal_done, sig);
|
sigaddset(&check_signal_done, sig);
|
||||||
}
|
}
|
||||||
@ -3802,7 +3815,7 @@ void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
|
|||||||
Thread* thread = context.thread();
|
Thread* thread = context.thread();
|
||||||
OSThread* osthread = thread->osthread();
|
OSThread* osthread = thread->osthread();
|
||||||
if (osthread->ucontext() != NULL) {
|
if (osthread->ucontext() != NULL) {
|
||||||
_epc = os::Aix::ucontext_get_pc((ucontext_t *) context.ucontext());
|
_epc = os::Aix::ucontext_get_pc((const ucontext_t *) context.ucontext());
|
||||||
} else {
|
} else {
|
||||||
// NULL context is unexpected, double-check this is the VMThread.
|
// NULL context is unexpected, double-check this is the VMThread.
|
||||||
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
||||||
@ -4251,7 +4264,7 @@ bool os::Aix::is_primordial_thread() {
|
|||||||
// one of Aix::on_pase(), Aix::os_version() static
|
// one of Aix::on_pase(), Aix::os_version() static
|
||||||
void os::Aix::initialize_os_info() {
|
void os::Aix::initialize_os_info() {
|
||||||
|
|
||||||
assert(_on_pase == -1 && _os_version == -1, "already called.");
|
assert(_on_pase == -1 && _os_version == 0, "already called.");
|
||||||
|
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
memset(&uts, 0, sizeof(uts));
|
memset(&uts, 0, sizeof(uts));
|
||||||
@ -4267,28 +4280,34 @@ void os::Aix::initialize_os_info() {
|
|||||||
assert(major > 0, "invalid OS version");
|
assert(major > 0, "invalid OS version");
|
||||||
const int minor = atoi(uts.release);
|
const int minor = atoi(uts.release);
|
||||||
assert(minor > 0, "invalid OS release");
|
assert(minor > 0, "invalid OS release");
|
||||||
_os_version = (major << 8) | minor;
|
_os_version = (major << 24) | (minor << 16);
|
||||||
|
char ver_str[20] = {0};
|
||||||
|
char *name_str = "unknown OS";
|
||||||
if (strcmp(uts.sysname, "OS400") == 0) {
|
if (strcmp(uts.sysname, "OS400") == 0) {
|
||||||
// We run on AS/400 PASE. We do not support versions older than V5R4M0.
|
// We run on AS/400 PASE. We do not support versions older than V5R4M0.
|
||||||
_on_pase = 1;
|
_on_pase = 1;
|
||||||
if (_os_version < 0x0504) {
|
if (os_version_short() < 0x0504) {
|
||||||
trcVerbose("OS/400 releases older than V5R4M0 not supported.");
|
trcVerbose("OS/400 releases older than V5R4M0 not supported.");
|
||||||
assert(false, "OS/400 release too old.");
|
assert(false, "OS/400 release too old.");
|
||||||
} else {
|
|
||||||
trcVerbose("We run on OS/400 (pase) V%dR%d", major, minor);
|
|
||||||
}
|
}
|
||||||
|
name_str = "OS/400 (pase)";
|
||||||
|
jio_snprintf(ver_str, sizeof(ver_str), "%u.%u", major, minor);
|
||||||
} else if (strcmp(uts.sysname, "AIX") == 0) {
|
} else if (strcmp(uts.sysname, "AIX") == 0) {
|
||||||
// We run on AIX. We do not support versions older than AIX 5.3.
|
// We run on AIX. We do not support versions older than AIX 5.3.
|
||||||
_on_pase = 0;
|
_on_pase = 0;
|
||||||
if (_os_version < 0x0503) {
|
// Determine detailed AIX version: Version, Release, Modification, Fix Level.
|
||||||
|
odmWrapper::determine_os_kernel_version(&_os_version);
|
||||||
|
if (os_version_short() < 0x0503) {
|
||||||
trcVerbose("AIX release older than AIX 5.3 not supported.");
|
trcVerbose("AIX release older than AIX 5.3 not supported.");
|
||||||
assert(false, "AIX release too old.");
|
assert(false, "AIX release too old.");
|
||||||
} else {
|
|
||||||
trcVerbose("We run on AIX %d.%d", major, minor);
|
|
||||||
}
|
}
|
||||||
|
name_str = "AIX";
|
||||||
|
jio_snprintf(ver_str, sizeof(ver_str), "%u.%u.%u.%u",
|
||||||
|
major, minor, (_os_version >> 8) & 0xFF, _os_version & 0xFF);
|
||||||
} else {
|
} else {
|
||||||
assert(false, "unknown OS");
|
assert(false, name_str);
|
||||||
}
|
}
|
||||||
|
trcVerbose("We run on %s %s", name_str, ver_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release");
|
guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release");
|
||||||
@ -4353,7 +4372,7 @@ void os::Aix::scan_environment() {
|
|||||||
|
|
||||||
p = ::getenv("LDR_CNTRL");
|
p = ::getenv("LDR_CNTRL");
|
||||||
trcVerbose("LDR_CNTRL=%s.", p ? p : "<unset>");
|
trcVerbose("LDR_CNTRL=%s.", p ? p : "<unset>");
|
||||||
if (os::Aix::on_pase() && os::Aix::os_version() == 0x0701) {
|
if (os::Aix::on_pase() && os::Aix::os_version_short() == 0x0701) {
|
||||||
if (p && ::strstr(p, "TEXTPSIZE")) {
|
if (p && ::strstr(p, "TEXTPSIZE")) {
|
||||||
trcVerbose("*** WARNING - LDR_CNTRL contains TEXTPSIZE. "
|
trcVerbose("*** WARNING - LDR_CNTRL contains TEXTPSIZE. "
|
||||||
"you may experience hangs or crashes on OS/400 V7R1.");
|
"you may experience hangs or crashes on OS/400 V7R1.");
|
||||||
@ -5012,7 +5031,7 @@ void TestReserveMemorySpecial_test() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool os::start_debugging(char *buf, int buflen) {
|
bool os::start_debugging(char *buf, int buflen) {
|
||||||
int len = (int)strlen(buf);
|
int len = (int)strlen(buf);
|
||||||
char *p = &buf[len];
|
char *p = &buf[len];
|
||||||
|
|
||||||
|
@ -55,15 +55,12 @@ class Aix {
|
|||||||
// -1 = uninitialized, 0 = AIX, 1 = OS/400 (PASE)
|
// -1 = uninitialized, 0 = AIX, 1 = OS/400 (PASE)
|
||||||
static int _on_pase;
|
static int _on_pase;
|
||||||
|
|
||||||
// -1 = uninitialized, otherwise 16 bit number:
|
// 0 = uninitialized, otherwise 16 bit number:
|
||||||
// lower 8 bit - minor version
|
// lower 8 bit - minor version
|
||||||
// higher 8 bit - major version
|
// higher 8 bit - major version
|
||||||
// For AIX, e.g. 0x0601 for AIX 6.1
|
// For AIX, e.g. 0x0601 for AIX 6.1
|
||||||
// for OS/400 e.g. 0x0504 for OS/400 V5R4
|
// for OS/400 e.g. 0x0504 for OS/400 V5R4
|
||||||
static int _os_version;
|
static uint32_t _os_version;
|
||||||
|
|
||||||
// 4 Byte kernel version: Version, Release, Tech Level, Service Pack.
|
|
||||||
static unsigned int _os_kernel_version;
|
|
||||||
|
|
||||||
// -1 = uninitialized,
|
// -1 = uninitialized,
|
||||||
// 0 - SPEC1170 not requested (XPG_SUS_ENV is OFF or not set)
|
// 0 - SPEC1170 not requested (XPG_SUS_ENV is OFF or not set)
|
||||||
@ -126,8 +123,8 @@ class Aix {
|
|||||||
static int vm_default_page_size(void ) { return 8*K; }
|
static int vm_default_page_size(void ) { return 8*K; }
|
||||||
|
|
||||||
static address ucontext_get_pc(const ucontext_t* uc);
|
static address ucontext_get_pc(const ucontext_t* uc);
|
||||||
static intptr_t* ucontext_get_sp(ucontext_t* uc);
|
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
|
||||||
static intptr_t* ucontext_get_fp(ucontext_t* uc);
|
static intptr_t* ucontext_get_fp(const ucontext_t* uc);
|
||||||
// Set PC into context. Needed for continuation after signal.
|
// Set PC into context. Needed for continuation after signal.
|
||||||
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
||||||
|
|
||||||
@ -175,32 +172,31 @@ class Aix {
|
|||||||
return _on_pase ? false : true;
|
return _on_pase ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -1 = uninitialized, otherwise 16 bit number:
|
// Get 4 byte AIX kernel version number:
|
||||||
|
// highest 2 bytes: Version, Release
|
||||||
|
// if available: lowest 2 bytes: Tech Level, Service Pack.
|
||||||
|
static uint32_t os_version() {
|
||||||
|
assert(_os_version != 0, "not initialized");
|
||||||
|
return _os_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0 = uninitialized, otherwise 16 bit number:
|
||||||
// lower 8 bit - minor version
|
// lower 8 bit - minor version
|
||||||
// higher 8 bit - major version
|
// higher 8 bit - major version
|
||||||
// For AIX, e.g. 0x0601 for AIX 6.1
|
// For AIX, e.g. 0x0601 for AIX 6.1
|
||||||
// for OS/400 e.g. 0x0504 for OS/400 V5R4
|
// for OS/400 e.g. 0x0504 for OS/400 V5R4
|
||||||
static int os_version () {
|
static int os_version_short() {
|
||||||
assert(_os_version != -1, "not initialized");
|
return os_version() >> 16;
|
||||||
return _os_version;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 4 byte AIX kernel version number:
|
|
||||||
// highest 2 bytes: Version, Release
|
|
||||||
// if available: lowest 2 bytes: Tech Level, Service Pack.
|
|
||||||
static unsigned int os_kernel_version() {
|
|
||||||
if (_os_kernel_version) return _os_kernel_version;
|
|
||||||
return os_version() << 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience method: returns true if running on PASE V5R4 or older.
|
// Convenience method: returns true if running on PASE V5R4 or older.
|
||||||
static bool on_pase_V5R4_or_older() {
|
static bool on_pase_V5R4_or_older() {
|
||||||
return on_pase() && os_version() <= 0x0504;
|
return on_pase() && os_version_short() <= 0x0504;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience method: returns true if running on AIX 5.3 or older.
|
// Convenience method: returns true if running on AIX 5.3 or older.
|
||||||
static bool on_aix_53_or_older() {
|
static bool on_aix_53_or_older() {
|
||||||
return on_aix() && os_version() <= 0x0503;
|
return on_aix() && os_version_short() <= 0x0503;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if we run in SPEC1170 compliant mode (XPG_SUS_ENV=ON).
|
// Returns true if we run in SPEC1170 compliant mode (XPG_SUS_ENV=ON).
|
||||||
|
@ -1077,7 +1077,7 @@ void os::shutdown() {
|
|||||||
// Note: os::abort() might be called very early during initialization, or
|
// Note: os::abort() might be called very early during initialization, or
|
||||||
// called from signal handler. Before adding something to os::abort(), make
|
// called from signal handler. Before adding something to os::abort(), make
|
||||||
// sure it is async-safe and can handle partially initialized VM.
|
// sure it is async-safe and can handle partially initialized VM.
|
||||||
void os::abort(bool dump_core, void* siginfo, void* context) {
|
void os::abort(bool dump_core, void* siginfo, const void* context) {
|
||||||
os::shutdown();
|
os::shutdown();
|
||||||
if (dump_core) {
|
if (dump_core) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -3382,8 +3382,12 @@ void os::Bsd::check_signal_handler(int sig) {
|
|||||||
}
|
}
|
||||||
} else if(os::Bsd::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Bsd::get_our_sigflags(sig)) {
|
} else if(os::Bsd::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Bsd::get_our_sigflags(sig)) {
|
||||||
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
||||||
tty->print("expected:" PTR32_FORMAT, os::Bsd::get_our_sigflags(sig));
|
tty->print("expected:");
|
||||||
tty->print_cr(" found:" PTR32_FORMAT, act.sa_flags);
|
os::Posix::print_sa_flags(tty, os::Bsd::get_our_sigflags(sig));
|
||||||
|
tty->cr();
|
||||||
|
tty->print(" found:");
|
||||||
|
os::Posix::print_sa_flags(tty, act.sa_flags);
|
||||||
|
tty->cr();
|
||||||
// No need to check this sig any longer
|
// No need to check this sig any longer
|
||||||
sigaddset(&check_signal_done, sig);
|
sigaddset(&check_signal_done, sig);
|
||||||
}
|
}
|
||||||
@ -3493,7 +3497,7 @@ jint os::init_2(void) {
|
|||||||
// Add in 2*BytesPerWord times page size to account for VM stack during
|
// Add in 2*BytesPerWord times page size to account for VM stack during
|
||||||
// class initialization depending on 32 or 64 bit VM.
|
// class initialization depending on 32 or 64 bit VM.
|
||||||
os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
|
os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
|
||||||
(size_t)(StackYellowPages+StackRedPages+StackShadowPages+
|
(size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+
|
||||||
2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size());
|
2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size());
|
||||||
|
|
||||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||||
@ -3639,7 +3643,7 @@ void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
|
|||||||
Thread* thread = context.thread();
|
Thread* thread = context.thread();
|
||||||
OSThread* osthread = thread->osthread();
|
OSThread* osthread = thread->osthread();
|
||||||
if (osthread->ucontext() != NULL) {
|
if (osthread->ucontext() != NULL) {
|
||||||
_epc = os::Bsd::ucontext_get_pc((ucontext_t *) context.ucontext());
|
_epc = os::Bsd::ucontext_get_pc((const ucontext_t *) context.ucontext());
|
||||||
} else {
|
} else {
|
||||||
// NULL context is unexpected, double-check this is the VMThread
|
// NULL context is unexpected, double-check this is the VMThread
|
||||||
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
||||||
|
@ -86,19 +86,21 @@ class Bsd {
|
|||||||
static int page_size(void) { return _page_size; }
|
static int page_size(void) { return _page_size; }
|
||||||
static void set_page_size(int val) { _page_size = val; }
|
static void set_page_size(int val) { _page_size = val; }
|
||||||
|
|
||||||
static address ucontext_get_pc(ucontext_t* uc);
|
static address ucontext_get_pc(const ucontext_t* uc);
|
||||||
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
||||||
static intptr_t* ucontext_get_sp(ucontext_t* uc);
|
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
|
||||||
static intptr_t* ucontext_get_fp(ucontext_t* uc);
|
static intptr_t* ucontext_get_fp(const ucontext_t* uc);
|
||||||
|
|
||||||
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
||||||
//
|
//
|
||||||
// This interface should be declared in os_bsd_i486.hpp, but
|
// This interface should be declared in os_bsd_i486.hpp, but
|
||||||
// that file provides extensions to the os class and not the
|
// that file provides extensions to the os class and not the
|
||||||
// Bsd class.
|
// Bsd class.
|
||||||
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
|
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, const ucontext_t* uc,
|
||||||
intptr_t** ret_sp, intptr_t** ret_fp);
|
intptr_t** ret_sp, intptr_t** ret_fp);
|
||||||
|
|
||||||
|
static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);
|
||||||
|
|
||||||
// This boolean allows users to forward their own non-matching signals
|
// This boolean allows users to forward their own non-matching signals
|
||||||
// to JVM_handle_bsd_signal, harmlessly.
|
// to JVM_handle_bsd_signal, harmlessly.
|
||||||
static bool signal_handlers_are_installed;
|
static bool signal_handlers_are_installed;
|
||||||
|
@ -1341,7 +1341,7 @@ void os::shutdown() {
|
|||||||
// Note: os::abort() might be called very early during initialization, or
|
// Note: os::abort() might be called very early during initialization, or
|
||||||
// called from signal handler. Before adding something to os::abort(), make
|
// called from signal handler. Before adding something to os::abort(), make
|
||||||
// sure it is async-safe and can handle partially initialized VM.
|
// sure it is async-safe and can handle partially initialized VM.
|
||||||
void os::abort(bool dump_core, void* siginfo, void* context) {
|
void os::abort(bool dump_core, void* siginfo, const void* context) {
|
||||||
os::shutdown();
|
os::shutdown();
|
||||||
if (dump_core) {
|
if (dump_core) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -1733,7 +1733,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
|||||||
#if defined(VM_LITTLE_ENDIAN)
|
#if defined(VM_LITTLE_ENDIAN)
|
||||||
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2LSB, (char*)"Power PC 64"},
|
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2LSB, (char*)"Power PC 64"},
|
||||||
#else
|
#else
|
||||||
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"},
|
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64 LE"},
|
||||||
#endif
|
#endif
|
||||||
{EM_ARM, EM_ARM, ELFCLASS32, ELFDATA2LSB, (char*)"ARM"},
|
{EM_ARM, EM_ARM, ELFCLASS32, ELFDATA2LSB, (char*)"ARM"},
|
||||||
{EM_S390, EM_S390, ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"},
|
{EM_S390, EM_S390, ELFCLASSNONE, ELFDATA2MSB, (char*)"IBM System/390"},
|
||||||
@ -1861,8 +1861,8 @@ void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf,
|
|||||||
JavaThread *jt = Threads::first();
|
JavaThread *jt = Threads::first();
|
||||||
|
|
||||||
while (jt) {
|
while (jt) {
|
||||||
if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized
|
if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized
|
||||||
jt->stack_yellow_zone_enabled()) { // No pending stack overflow exceptions
|
jt->stack_guards_enabled()) { // No pending stack overflow exceptions
|
||||||
if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(),
|
if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(),
|
||||||
jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) {
|
jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) {
|
||||||
warning("Attempt to reguard stack yellow zone failed.");
|
warning("Attempt to reguard stack yellow zone failed.");
|
||||||
@ -2177,6 +2177,8 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
|
|||||||
const char* search_string = "model name";
|
const char* search_string = "model name";
|
||||||
#elif defined(SPARC)
|
#elif defined(SPARC)
|
||||||
const char* search_string = "cpu";
|
const char* search_string = "cpu";
|
||||||
|
#elif defined(PPC64)
|
||||||
|
const char* search_string = "cpu";
|
||||||
#else
|
#else
|
||||||
const char* search_string = "Processor";
|
const char* search_string = "Processor";
|
||||||
#endif
|
#endif
|
||||||
@ -4533,8 +4535,12 @@ void os::Linux::check_signal_handler(int sig) {
|
|||||||
}
|
}
|
||||||
} else if(os::Linux::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Linux::get_our_sigflags(sig)) {
|
} else if(os::Linux::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Linux::get_our_sigflags(sig)) {
|
||||||
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
||||||
tty->print("expected:" PTR32_FORMAT, os::Linux::get_our_sigflags(sig));
|
tty->print("expected:");
|
||||||
tty->print_cr(" found:" PTR32_FORMAT, act.sa_flags);
|
os::Posix::print_sa_flags(tty, os::Linux::get_our_sigflags(sig));
|
||||||
|
tty->cr();
|
||||||
|
tty->print(" found:");
|
||||||
|
os::Posix::print_sa_flags(tty, act.sa_flags);
|
||||||
|
tty->cr();
|
||||||
// No need to check this sig any longer
|
// No need to check this sig any longer
|
||||||
sigaddset(&check_signal_done, sig);
|
sigaddset(&check_signal_done, sig);
|
||||||
}
|
}
|
||||||
@ -4599,6 +4605,11 @@ void os::init(void) {
|
|||||||
if (vm_page_size() > (int)Linux::vm_default_page_size()) {
|
if (vm_page_size() > (int)Linux::vm_default_page_size()) {
|
||||||
StackYellowPages = 1;
|
StackYellowPages = 1;
|
||||||
StackRedPages = 1;
|
StackRedPages = 1;
|
||||||
|
#if defined(IA32) || defined(IA64)
|
||||||
|
StackReservedPages = 1;
|
||||||
|
#else
|
||||||
|
StackReservedPages = 0;
|
||||||
|
#endif
|
||||||
StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size();
|
StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4660,7 +4671,7 @@ jint os::init_2(void) {
|
|||||||
// Add in 2*BytesPerWord times page size to account for VM stack during
|
// Add in 2*BytesPerWord times page size to account for VM stack during
|
||||||
// class initialization depending on 32 or 64 bit VM.
|
// class initialization depending on 32 or 64 bit VM.
|
||||||
os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
|
os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
|
||||||
(size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
|
(size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
|
||||||
(2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
|
(2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
|
||||||
|
|
||||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||||
@ -4842,7 +4853,7 @@ void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
|
|||||||
Thread* thread = context.thread();
|
Thread* thread = context.thread();
|
||||||
OSThread* osthread = thread->osthread();
|
OSThread* osthread = thread->osthread();
|
||||||
if (osthread->ucontext() != NULL) {
|
if (osthread->ucontext() != NULL) {
|
||||||
_epc = os::Linux::ucontext_get_pc((ucontext_t *) context.ucontext());
|
_epc = os::Linux::ucontext_get_pc((const ucontext_t *) context.ucontext());
|
||||||
} else {
|
} else {
|
||||||
// NULL context is unexpected, double-check this is the VMThread
|
// NULL context is unexpected, double-check this is the VMThread
|
||||||
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
||||||
|
@ -123,19 +123,21 @@ class Linux {
|
|||||||
|
|
||||||
static int vm_default_page_size(void) { return _vm_default_page_size; }
|
static int vm_default_page_size(void) { return _vm_default_page_size; }
|
||||||
|
|
||||||
static address ucontext_get_pc(ucontext_t* uc);
|
static address ucontext_get_pc(const ucontext_t* uc);
|
||||||
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
||||||
static intptr_t* ucontext_get_sp(ucontext_t* uc);
|
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
|
||||||
static intptr_t* ucontext_get_fp(ucontext_t* uc);
|
static intptr_t* ucontext_get_fp(const ucontext_t* uc);
|
||||||
|
|
||||||
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
||||||
//
|
//
|
||||||
// This interface should be declared in os_linux_i486.hpp, but
|
// This interface should be declared in os_linux_i486.hpp, but
|
||||||
// that file provides extensions to the os class and not the
|
// that file provides extensions to the os class and not the
|
||||||
// Linux class.
|
// Linux class.
|
||||||
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
|
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, const ucontext_t* uc,
|
||||||
intptr_t** ret_sp, intptr_t** ret_fp);
|
intptr_t** ret_sp, intptr_t** ret_fp);
|
||||||
|
|
||||||
|
static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);
|
||||||
|
|
||||||
// This boolean allows users to forward their own non-matching signals
|
// This boolean allows users to forward their own non-matching signals
|
||||||
// to JVM_handle_linux_signal, harmlessly.
|
// to JVM_handle_linux_signal, harmlessly.
|
||||||
static bool signal_handlers_are_installed;
|
static bool signal_handlers_are_installed;
|
||||||
|
@ -736,12 +736,12 @@ bool os::Posix::is_valid_signal(int sig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns:
|
// Returns:
|
||||||
// "invalid (<num>)" for an invalid signal number
|
// NULL for an invalid signal number
|
||||||
// "SIG<num>" for a valid but unknown signal number
|
// "SIG<num>" for a valid but unknown signal number
|
||||||
// signal name otherwise.
|
// signal name otherwise.
|
||||||
const char* os::exception_name(int sig, char* buf, size_t size) {
|
const char* os::exception_name(int sig, char* buf, size_t size) {
|
||||||
if (!os::Posix::is_valid_signal(sig)) {
|
if (!os::Posix::is_valid_signal(sig)) {
|
||||||
jio_snprintf(buf, size, "invalid (%d)", sig);
|
return NULL;
|
||||||
}
|
}
|
||||||
const char* const name = os::Posix::get_signal_name(sig, buf, size);
|
const char* const name = os::Posix::get_signal_name(sig, buf, size);
|
||||||
if (strcmp(name, "UNKNOWN") == 0) {
|
if (strcmp(name, "UNKNOWN") == 0) {
|
||||||
@ -1031,7 +1031,7 @@ int os::Posix::unblock_thread_signal_mask(const sigset_t *set) {
|
|||||||
return pthread_sigmask(SIG_UNBLOCK, set, NULL);
|
return pthread_sigmask(SIG_UNBLOCK, set, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
address os::Posix::ucontext_get_pc(ucontext_t* ctx) {
|
address os::Posix::ucontext_get_pc(const ucontext_t* ctx) {
|
||||||
#ifdef TARGET_OS_FAMILY_linux
|
#ifdef TARGET_OS_FAMILY_linux
|
||||||
return Linux::ucontext_get_pc(ctx);
|
return Linux::ucontext_get_pc(ctx);
|
||||||
#elif defined(TARGET_OS_FAMILY_solaris)
|
#elif defined(TARGET_OS_FAMILY_solaris)
|
||||||
|
@ -76,7 +76,7 @@ public:
|
|||||||
// A POSIX conform, platform-independend siginfo print routine.
|
// A POSIX conform, platform-independend siginfo print routine.
|
||||||
static void print_siginfo_brief(outputStream* os, const siginfo_t* si);
|
static void print_siginfo_brief(outputStream* os, const siginfo_t* si);
|
||||||
|
|
||||||
static address ucontext_get_pc(ucontext_t* ctx);
|
static address ucontext_get_pc(const ucontext_t* ctx);
|
||||||
// Set PC into context. Needed for continuation after signal.
|
// Set PC into context. Needed for continuation after signal.
|
||||||
static void ucontext_set_pc(ucontext_t* ctx, address pc);
|
static void ucontext_set_pc(ucontext_t* ctx, address pc);
|
||||||
};
|
};
|
||||||
|
@ -1380,7 +1380,7 @@ void os::shutdown() {
|
|||||||
// Note: os::abort() might be called very early during initialization, or
|
// Note: os::abort() might be called very early during initialization, or
|
||||||
// called from signal handler. Before adding something to os::abort(), make
|
// called from signal handler. Before adding something to os::abort(), make
|
||||||
// sure it is async-safe and can handle partially initialized VM.
|
// sure it is async-safe and can handle partially initialized VM.
|
||||||
void os::abort(bool dump_core, void* siginfo, void* context) {
|
void os::abort(bool dump_core, void* siginfo, const void* context) {
|
||||||
os::shutdown();
|
os::shutdown();
|
||||||
if (dump_core) {
|
if (dump_core) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
@ -3736,7 +3736,7 @@ void PcFetcher::do_task(const os::SuspendedThreadTaskContext& context) {
|
|||||||
Thread* thread = context.thread();
|
Thread* thread = context.thread();
|
||||||
OSThread* osthread = thread->osthread();
|
OSThread* osthread = thread->osthread();
|
||||||
if (osthread->ucontext() != NULL) {
|
if (osthread->ucontext() != NULL) {
|
||||||
_epc = os::Solaris::ucontext_get_pc((ucontext_t *) context.ucontext());
|
_epc = os::Solaris::ucontext_get_pc((const ucontext_t *) context.ucontext());
|
||||||
} else {
|
} else {
|
||||||
// NULL context is unexpected, double-check this is the VMThread
|
// NULL context is unexpected, double-check this is the VMThread
|
||||||
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
guarantee(thread->is_VM_thread(), "can only be called for VMThread");
|
||||||
@ -4058,8 +4058,12 @@ void os::Solaris::check_signal_handler(int sig) {
|
|||||||
}
|
}
|
||||||
} else if(os::Solaris::get_our_sigflags(sig) != 0 && act.sa_flags != os::Solaris::get_our_sigflags(sig)) {
|
} else if(os::Solaris::get_our_sigflags(sig) != 0 && act.sa_flags != os::Solaris::get_our_sigflags(sig)) {
|
||||||
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
|
||||||
tty->print("expected:" PTR32_FORMAT, os::Solaris::get_our_sigflags(sig));
|
tty->print("expected:");
|
||||||
tty->print_cr(" found:" PTR32_FORMAT, act.sa_flags);
|
os::Posix::print_sa_flags(tty, os::Solaris::get_our_sigflags(sig));
|
||||||
|
tty->cr();
|
||||||
|
tty->print(" found:");
|
||||||
|
os::Posix::print_sa_flags(tty, act.sa_flags);
|
||||||
|
tty->cr();
|
||||||
// No need to check this sig any longer
|
// No need to check this sig any longer
|
||||||
sigaddset(&check_signal_done, sig);
|
sigaddset(&check_signal_done, sig);
|
||||||
}
|
}
|
||||||
@ -4378,6 +4382,7 @@ void os::init(void) {
|
|||||||
if (vm_page_size() > 8*K) {
|
if (vm_page_size() > 8*K) {
|
||||||
StackYellowPages = 1;
|
StackYellowPages = 1;
|
||||||
StackRedPages = 1;
|
StackRedPages = 1;
|
||||||
|
StackReservedPages = 1;
|
||||||
StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size();
|
StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4434,7 +4439,7 @@ jint os::init_2(void) {
|
|||||||
// Add in 2*BytesPerWord times page size to account for VM stack during
|
// Add in 2*BytesPerWord times page size to account for VM stack during
|
||||||
// class initialization depending on 32 or 64 bit VM.
|
// class initialization depending on 32 or 64 bit VM.
|
||||||
os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed,
|
os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed,
|
||||||
(size_t)(StackYellowPages+StackRedPages+StackShadowPages+
|
(size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+
|
||||||
2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size);
|
2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size);
|
||||||
|
|
||||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -130,15 +130,15 @@ class Solaris {
|
|||||||
static address handler_start, handler_end; // start and end pc of thr_sighndlrinfo
|
static address handler_start, handler_end; // start and end pc of thr_sighndlrinfo
|
||||||
|
|
||||||
static bool valid_stack_address(Thread* thread, address sp);
|
static bool valid_stack_address(Thread* thread, address sp);
|
||||||
static bool valid_ucontext(Thread* thread, ucontext_t* valid, ucontext_t* suspect);
|
static bool valid_ucontext(Thread* thread, const ucontext_t* valid, const ucontext_t* suspect);
|
||||||
static ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
|
static const ucontext_t* get_valid_uc_in_signal_handler(Thread* thread,
|
||||||
ucontext_t* uc);
|
const ucontext_t* uc);
|
||||||
|
|
||||||
static ExtendedPC ucontext_get_ExtendedPC(ucontext_t* uc);
|
static ExtendedPC ucontext_get_ExtendedPC(const ucontext_t* uc);
|
||||||
static intptr_t* ucontext_get_sp(ucontext_t* uc);
|
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
|
||||||
// ucontext_get_fp() is only used by Solaris X86 (see note below)
|
// ucontext_get_fp() is only used by Solaris X86 (see note below)
|
||||||
static intptr_t* ucontext_get_fp(ucontext_t* uc);
|
static intptr_t* ucontext_get_fp(const ucontext_t* uc);
|
||||||
static address ucontext_get_pc(ucontext_t* uc);
|
static address ucontext_get_pc(const ucontext_t* uc);
|
||||||
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
static void ucontext_set_pc(ucontext_t* uc, address pc);
|
||||||
|
|
||||||
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
// For Analyzer Forte AsyncGetCallTrace profiling support:
|
||||||
@ -147,9 +147,11 @@ class Solaris {
|
|||||||
// We should have different declarations of this interface in
|
// We should have different declarations of this interface in
|
||||||
// os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
|
// os_solaris_i486.hpp and os_solaris_sparc.hpp, but that file
|
||||||
// provides extensions to the os class and not the Solaris class.
|
// provides extensions to the os class and not the Solaris class.
|
||||||
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc,
|
static ExtendedPC fetch_frame_from_ucontext(Thread* thread, const ucontext_t* uc,
|
||||||
intptr_t** ret_sp, intptr_t** ret_fp);
|
intptr_t** ret_sp, intptr_t** ret_fp);
|
||||||
|
|
||||||
|
static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);
|
||||||
|
|
||||||
static void hotspot_sigmask(Thread* thread);
|
static void hotspot_sigmask(Thread* thread);
|
||||||
|
|
||||||
// SR_handler
|
// SR_handler
|
||||||
|
@ -1028,7 +1028,7 @@ void os::check_dump_limit(char* buffer, size_t buffsz) {
|
|||||||
VMError::record_coredump_status(buffer, status);
|
VMError::record_coredump_status(buffer, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::abort(bool dump_core, void* siginfo, void* context) {
|
void os::abort(bool dump_core, void* siginfo, const void* context) {
|
||||||
HINSTANCE dbghelp;
|
HINSTANCE dbghelp;
|
||||||
EXCEPTION_POINTERS ep;
|
EXCEPTION_POINTERS ep;
|
||||||
MINIDUMP_EXCEPTION_INFORMATION mei;
|
MINIDUMP_EXCEPTION_INFORMATION mei;
|
||||||
@ -2374,6 +2374,39 @@ static inline void report_error(Thread* t, DWORD exception_code,
|
|||||||
// somewhere where we can find it in the minidump.
|
// somewhere where we can find it in the minidump.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread,
|
||||||
|
struct _EXCEPTION_POINTERS* exceptionInfo, address pc, frame* fr) {
|
||||||
|
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
|
||||||
|
address addr = (address) exceptionRecord->ExceptionInformation[1];
|
||||||
|
if (Interpreter::contains(pc)) {
|
||||||
|
*fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord);
|
||||||
|
if (!fr->is_first_java_frame()) {
|
||||||
|
assert(fr->safe_for_sender(thread), "Safety check");
|
||||||
|
*fr = fr->java_sender();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// more complex code with compiled code
|
||||||
|
assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
|
||||||
|
CodeBlob* cb = CodeCache::find_blob(pc);
|
||||||
|
if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
|
||||||
|
// Not sure where the pc points to, fallback to default
|
||||||
|
// stack overflow handling
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
*fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord);
|
||||||
|
// in compiled code, the stack banging is performed just after the return pc
|
||||||
|
// has been pushed on the stack
|
||||||
|
*fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp()));
|
||||||
|
if (!fr->is_java_frame()) {
|
||||||
|
assert(fr->safe_for_sender(thread), "Safety check");
|
||||||
|
*fr = fr->java_sender();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(fr->is_java_frame(), "Safety check");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
||||||
if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH;
|
if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH;
|
||||||
@ -2550,7 +2583,16 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||||||
SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW));
|
SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (thread->stack_yellow_zone_enabled()) {
|
if (thread->stack_guards_enabled()) {
|
||||||
|
if (_thread_in_Java) {
|
||||||
|
frame fr;
|
||||||
|
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
|
||||||
|
address addr = (address) exceptionRecord->ExceptionInformation[1];
|
||||||
|
if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) {
|
||||||
|
assert(fr.is_java_frame(), "Must be a Java frame");
|
||||||
|
SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
// Yellow zone violation. The o/s has unprotected the first yellow
|
// Yellow zone violation. The o/s has unprotected the first yellow
|
||||||
// zone page for us. Note: must call disable_stack_yellow_zone to
|
// zone page for us. Note: must call disable_stack_yellow_zone to
|
||||||
// update the enabled status, even if the zone contains only one page.
|
// update the enabled status, even if the zone contains only one page.
|
||||||
@ -5529,8 +5571,6 @@ bool os::start_debugging(char *buf, int buflen) {
|
|||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef JDK6_OR_EARLIER
|
|
||||||
|
|
||||||
void os::Kernel32Dll::initialize() {
|
void os::Kernel32Dll::initialize() {
|
||||||
initializeCommon();
|
initializeCommon();
|
||||||
}
|
}
|
||||||
@ -5705,261 +5745,6 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name,
|
|||||||
return agent_entry_name;
|
return agent_entry_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
// Kernel32 API
|
|
||||||
typedef BOOL (WINAPI* SwitchToThread_Fn)(void);
|
|
||||||
typedef HANDLE (WINAPI* CreateToolhelp32Snapshot_Fn)(DWORD, DWORD);
|
|
||||||
typedef BOOL (WINAPI* Module32First_Fn)(HANDLE, LPMODULEENTRY32);
|
|
||||||
typedef BOOL (WINAPI* Module32Next_Fn)(HANDLE, LPMODULEENTRY32);
|
|
||||||
typedef void (WINAPI* GetNativeSystemInfo_Fn)(LPSYSTEM_INFO);
|
|
||||||
|
|
||||||
SwitchToThread_Fn os::Kernel32Dll::_SwitchToThread = NULL;
|
|
||||||
CreateToolhelp32Snapshot_Fn os::Kernel32Dll::_CreateToolhelp32Snapshot = NULL;
|
|
||||||
Module32First_Fn os::Kernel32Dll::_Module32First = NULL;
|
|
||||||
Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL;
|
|
||||||
GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL;
|
|
||||||
|
|
||||||
void os::Kernel32Dll::initialize() {
|
|
||||||
if (!initialized) {
|
|
||||||
HMODULE handle = ::GetModuleHandle("Kernel32.dll");
|
|
||||||
assert(handle != NULL, "Just check");
|
|
||||||
|
|
||||||
_SwitchToThread = (SwitchToThread_Fn)::GetProcAddress(handle, "SwitchToThread");
|
|
||||||
_CreateToolhelp32Snapshot = (CreateToolhelp32Snapshot_Fn)
|
|
||||||
::GetProcAddress(handle, "CreateToolhelp32Snapshot");
|
|
||||||
_Module32First = (Module32First_Fn)::GetProcAddress(handle, "Module32First");
|
|
||||||
_Module32Next = (Module32Next_Fn)::GetProcAddress(handle, "Module32Next");
|
|
||||||
_GetNativeSystemInfo = (GetNativeSystemInfo_Fn)::GetProcAddress(handle, "GetNativeSystemInfo");
|
|
||||||
initializeCommon(); // resolve the functions that always need resolving
|
|
||||||
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Kernel32Dll::SwitchToThread() {
|
|
||||||
assert(initialized && _SwitchToThread != NULL,
|
|
||||||
"SwitchToThreadAvailable() not yet called");
|
|
||||||
return _SwitchToThread();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL os::Kernel32Dll::SwitchToThreadAvailable() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _SwitchToThread != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Help tools
|
|
||||||
BOOL os::Kernel32Dll::HelpToolsAvailable() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _CreateToolhelp32Snapshot != NULL &&
|
|
||||||
_Module32First != NULL &&
|
|
||||||
_Module32Next != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
HANDLE os::Kernel32Dll::CreateToolhelp32Snapshot(DWORD dwFlags,
|
|
||||||
DWORD th32ProcessId) {
|
|
||||||
assert(initialized && _CreateToolhelp32Snapshot != NULL,
|
|
||||||
"HelpToolsAvailable() not yet called");
|
|
||||||
|
|
||||||
return _CreateToolhelp32Snapshot(dwFlags, th32ProcessId);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Kernel32Dll::Module32First(HANDLE hSnapshot,LPMODULEENTRY32 lpme) {
|
|
||||||
assert(initialized && _Module32First != NULL,
|
|
||||||
"HelpToolsAvailable() not yet called");
|
|
||||||
|
|
||||||
return _Module32First(hSnapshot, lpme);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline BOOL os::Kernel32Dll::Module32Next(HANDLE hSnapshot,
|
|
||||||
LPMODULEENTRY32 lpme) {
|
|
||||||
assert(initialized && _Module32Next != NULL,
|
|
||||||
"HelpToolsAvailable() not yet called");
|
|
||||||
|
|
||||||
return _Module32Next(hSnapshot, lpme);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL os::Kernel32Dll::GetNativeSystemInfoAvailable() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _GetNativeSystemInfo != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) {
|
|
||||||
assert(initialized && _GetNativeSystemInfo != NULL,
|
|
||||||
"GetNativeSystemInfoAvailable() not yet called");
|
|
||||||
|
|
||||||
_GetNativeSystemInfo(lpSystemInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
// PSAPI API
|
|
||||||
|
|
||||||
|
|
||||||
typedef BOOL (WINAPI *EnumProcessModules_Fn)(HANDLE, HMODULE *, DWORD, LPDWORD);
|
|
||||||
typedef BOOL (WINAPI *GetModuleFileNameEx_Fn)(HANDLE, HMODULE, LPTSTR, DWORD);
|
|
||||||
typedef BOOL (WINAPI *GetModuleInformation_Fn)(HANDLE, HMODULE, LPMODULEINFO, DWORD);
|
|
||||||
|
|
||||||
EnumProcessModules_Fn os::PSApiDll::_EnumProcessModules = NULL;
|
|
||||||
GetModuleFileNameEx_Fn os::PSApiDll::_GetModuleFileNameEx = NULL;
|
|
||||||
GetModuleInformation_Fn os::PSApiDll::_GetModuleInformation = NULL;
|
|
||||||
BOOL os::PSApiDll::initialized = FALSE;
|
|
||||||
|
|
||||||
void os::PSApiDll::initialize() {
|
|
||||||
if (!initialized) {
|
|
||||||
HMODULE handle = os::win32::load_Windows_dll("PSAPI.DLL", NULL, 0);
|
|
||||||
if (handle != NULL) {
|
|
||||||
_EnumProcessModules = (EnumProcessModules_Fn)::GetProcAddress(handle,
|
|
||||||
"EnumProcessModules");
|
|
||||||
_GetModuleFileNameEx = (GetModuleFileNameEx_Fn)::GetProcAddress(handle,
|
|
||||||
"GetModuleFileNameExA");
|
|
||||||
_GetModuleInformation = (GetModuleInformation_Fn)::GetProcAddress(handle,
|
|
||||||
"GetModuleInformation");
|
|
||||||
}
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOL os::PSApiDll::EnumProcessModules(HANDLE hProcess, HMODULE *lpModule,
|
|
||||||
DWORD cb, LPDWORD lpcbNeeded) {
|
|
||||||
assert(initialized && _EnumProcessModules != NULL,
|
|
||||||
"PSApiAvailable() not yet called");
|
|
||||||
return _EnumProcessModules(hProcess, lpModule, cb, lpcbNeeded);
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD os::PSApiDll::GetModuleFileNameEx(HANDLE hProcess, HMODULE hModule,
|
|
||||||
LPTSTR lpFilename, DWORD nSize) {
|
|
||||||
assert(initialized && _GetModuleFileNameEx != NULL,
|
|
||||||
"PSApiAvailable() not yet called");
|
|
||||||
return _GetModuleFileNameEx(hProcess, hModule, lpFilename, nSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::PSApiDll::GetModuleInformation(HANDLE hProcess, HMODULE hModule,
|
|
||||||
LPMODULEINFO lpmodinfo, DWORD cb) {
|
|
||||||
assert(initialized && _GetModuleInformation != NULL,
|
|
||||||
"PSApiAvailable() not yet called");
|
|
||||||
return _GetModuleInformation(hProcess, hModule, lpmodinfo, cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::PSApiDll::PSApiAvailable() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _EnumProcessModules != NULL &&
|
|
||||||
_GetModuleFileNameEx != NULL &&
|
|
||||||
_GetModuleInformation != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// WinSock2 API
|
|
||||||
typedef int (PASCAL FAR* WSAStartup_Fn)(WORD, LPWSADATA);
|
|
||||||
typedef struct hostent *(PASCAL FAR *gethostbyname_Fn)(...);
|
|
||||||
|
|
||||||
WSAStartup_Fn os::WinSock2Dll::_WSAStartup = NULL;
|
|
||||||
gethostbyname_Fn os::WinSock2Dll::_gethostbyname = NULL;
|
|
||||||
BOOL os::WinSock2Dll::initialized = FALSE;
|
|
||||||
|
|
||||||
void os::WinSock2Dll::initialize() {
|
|
||||||
if (!initialized) {
|
|
||||||
HMODULE handle = os::win32::load_Windows_dll("ws2_32.dll", NULL, 0);
|
|
||||||
if (handle != NULL) {
|
|
||||||
_WSAStartup = (WSAStartup_Fn)::GetProcAddress(handle, "WSAStartup");
|
|
||||||
_gethostbyname = (gethostbyname_Fn)::GetProcAddress(handle, "gethostbyname");
|
|
||||||
}
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL os::WinSock2Dll::WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) {
|
|
||||||
assert(initialized && _WSAStartup != NULL,
|
|
||||||
"WinSock2Available() not yet called");
|
|
||||||
return _WSAStartup(wVersionRequested, lpWSAData);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct hostent* os::WinSock2Dll::gethostbyname(const char *name) {
|
|
||||||
assert(initialized && _gethostbyname != NULL,
|
|
||||||
"WinSock2Available() not yet called");
|
|
||||||
return _gethostbyname(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::WinSock2Dll::WinSock2Available() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _WSAStartup != NULL &&
|
|
||||||
_gethostbyname != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef BOOL (WINAPI *AdjustTokenPrivileges_Fn)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
|
|
||||||
typedef BOOL (WINAPI *OpenProcessToken_Fn)(HANDLE, DWORD, PHANDLE);
|
|
||||||
typedef BOOL (WINAPI *LookupPrivilegeValue_Fn)(LPCTSTR, LPCTSTR, PLUID);
|
|
||||||
|
|
||||||
AdjustTokenPrivileges_Fn os::Advapi32Dll::_AdjustTokenPrivileges = NULL;
|
|
||||||
OpenProcessToken_Fn os::Advapi32Dll::_OpenProcessToken = NULL;
|
|
||||||
LookupPrivilegeValue_Fn os::Advapi32Dll::_LookupPrivilegeValue = NULL;
|
|
||||||
BOOL os::Advapi32Dll::initialized = FALSE;
|
|
||||||
|
|
||||||
void os::Advapi32Dll::initialize() {
|
|
||||||
if (!initialized) {
|
|
||||||
HMODULE handle = os::win32::load_Windows_dll("advapi32.dll", NULL, 0);
|
|
||||||
if (handle != NULL) {
|
|
||||||
_AdjustTokenPrivileges = (AdjustTokenPrivileges_Fn)::GetProcAddress(handle,
|
|
||||||
"AdjustTokenPrivileges");
|
|
||||||
_OpenProcessToken = (OpenProcessToken_Fn)::GetProcAddress(handle,
|
|
||||||
"OpenProcessToken");
|
|
||||||
_LookupPrivilegeValue = (LookupPrivilegeValue_Fn)::GetProcAddress(handle,
|
|
||||||
"LookupPrivilegeValueA");
|
|
||||||
}
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Advapi32Dll::AdjustTokenPrivileges(HANDLE TokenHandle,
|
|
||||||
BOOL DisableAllPrivileges,
|
|
||||||
PTOKEN_PRIVILEGES NewState,
|
|
||||||
DWORD BufferLength,
|
|
||||||
PTOKEN_PRIVILEGES PreviousState,
|
|
||||||
PDWORD ReturnLength) {
|
|
||||||
assert(initialized && _AdjustTokenPrivileges != NULL,
|
|
||||||
"AdvapiAvailable() not yet called");
|
|
||||||
return _AdjustTokenPrivileges(TokenHandle, DisableAllPrivileges, NewState,
|
|
||||||
BufferLength, PreviousState, ReturnLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Advapi32Dll::OpenProcessToken(HANDLE ProcessHandle,
|
|
||||||
DWORD DesiredAccess,
|
|
||||||
PHANDLE TokenHandle) {
|
|
||||||
assert(initialized && _OpenProcessToken != NULL,
|
|
||||||
"AdvapiAvailable() not yet called");
|
|
||||||
return _OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Advapi32Dll::LookupPrivilegeValue(LPCTSTR lpSystemName,
|
|
||||||
LPCTSTR lpName, PLUID lpLuid) {
|
|
||||||
assert(initialized && _LookupPrivilegeValue != NULL,
|
|
||||||
"AdvapiAvailable() not yet called");
|
|
||||||
return _LookupPrivilegeValue(lpSystemName, lpName, lpLuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL os::Advapi32Dll::AdvapiAvailable() {
|
|
||||||
if (!initialized) {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
return _AdjustTokenPrivileges != NULL &&
|
|
||||||
_OpenProcessToken != NULL &&
|
|
||||||
_LookupPrivilegeValue != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
|
||||||
// test the code path in reserve_memory_special() that tries to allocate memory in a single
|
// test the code path in reserve_memory_special() that tries to allocate memory in a single
|
||||||
@ -5976,7 +5761,7 @@ BOOL os::Advapi32Dll::AdvapiAvailable() {
|
|||||||
void TestReserveMemorySpecial_test() {
|
void TestReserveMemorySpecial_test() {
|
||||||
if (!UseLargePages) {
|
if (!UseLargePages) {
|
||||||
if (VerboseInternalVMTests) {
|
if (VerboseInternalVMTests) {
|
||||||
gclog_or_tty->print("Skipping test because large pages are disabled");
|
tty->print("Skipping test because large pages are disabled");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -5992,7 +5777,7 @@ void TestReserveMemorySpecial_test() {
|
|||||||
char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false);
|
char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false);
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
if (VerboseInternalVMTests) {
|
if (VerboseInternalVMTests) {
|
||||||
gclog_or_tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.",
|
tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.",
|
||||||
large_allocation_size);
|
large_allocation_size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -6005,7 +5790,7 @@ void TestReserveMemorySpecial_test() {
|
|||||||
char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false);
|
char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false);
|
||||||
if (actual_location == NULL) {
|
if (actual_location == NULL) {
|
||||||
if (VerboseInternalVMTests) {
|
if (VerboseInternalVMTests) {
|
||||||
gclog_or_tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.",
|
tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.",
|
||||||
expected_location, large_allocation_size);
|
expected_location, large_allocation_size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -110,6 +110,10 @@ class win32 {
|
|||||||
// Default stack size for the current process.
|
// Default stack size for the current process.
|
||||||
static size_t default_stack_size() { return _default_stack_size; }
|
static size_t default_stack_size() { return _default_stack_size; }
|
||||||
|
|
||||||
|
static bool get_frame_at_stack_banging_point(JavaThread* thread,
|
||||||
|
struct _EXCEPTION_POINTERS* exceptionInfo,
|
||||||
|
address pc, frame* fr);
|
||||||
|
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
// A wrapper to install a structured exception handler for fast JNI accesors.
|
// A wrapper to install a structured exception handler for fast JNI accesors.
|
||||||
static address fast_jni_accessor_wrapper(BasicType);
|
static address fast_jni_accessor_wrapper(BasicType);
|
||||||
@ -183,26 +187,11 @@ class PlatformParker : public CHeapObj<mtInternal> {
|
|||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
// JDK7 requires VS2010
|
|
||||||
#if _MSC_VER < 1600
|
|
||||||
#define JDK6_OR_EARLIER 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WinSock2Dll: AllStatic {
|
class WinSock2Dll: AllStatic {
|
||||||
public:
|
public:
|
||||||
static BOOL WSAStartup(WORD, LPWSADATA);
|
static BOOL WSAStartup(WORD, LPWSADATA);
|
||||||
static struct hostent* gethostbyname(const char *name);
|
static struct hostent* gethostbyname(const char *name);
|
||||||
static BOOL WinSock2Available();
|
static BOOL WinSock2Available();
|
||||||
#ifdef JDK6_OR_EARLIER
|
|
||||||
private:
|
|
||||||
static int (PASCAL FAR* _WSAStartup)(WORD, LPWSADATA);
|
|
||||||
static struct hostent *(PASCAL FAR *_gethostbyname)(...);
|
|
||||||
static BOOL initialized;
|
|
||||||
|
|
||||||
static void initialize();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Kernel32Dll: AllStatic {
|
class Kernel32Dll: AllStatic {
|
||||||
@ -244,16 +233,6 @@ private:
|
|||||||
|
|
||||||
static void initialize();
|
static void initialize();
|
||||||
static void initializeCommon();
|
static void initializeCommon();
|
||||||
|
|
||||||
#ifdef JDK6_OR_EARLIER
|
|
||||||
private:
|
|
||||||
static BOOL (WINAPI *_SwitchToThread)(void);
|
|
||||||
static HANDLE (WINAPI* _CreateToolhelp32Snapshot)(DWORD,DWORD);
|
|
||||||
static BOOL (WINAPI* _Module32First)(HANDLE,LPMODULEENTRY32);
|
|
||||||
static BOOL (WINAPI* _Module32Next)(HANDLE,LPMODULEENTRY32);
|
|
||||||
static void (WINAPI *_GetNativeSystemInfo)(LPSYSTEM_INFO);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Advapi32Dll: AllStatic {
|
class Advapi32Dll: AllStatic {
|
||||||
@ -263,16 +242,6 @@ public:
|
|||||||
static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID);
|
static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID);
|
||||||
|
|
||||||
static BOOL AdvapiAvailable();
|
static BOOL AdvapiAvailable();
|
||||||
|
|
||||||
#ifdef JDK6_OR_EARLIER
|
|
||||||
private:
|
|
||||||
static BOOL (WINAPI *_AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
|
|
||||||
static BOOL (WINAPI *_OpenProcessToken)(HANDLE, DWORD, PHANDLE);
|
|
||||||
static BOOL (WINAPI *_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID);
|
|
||||||
static BOOL initialized;
|
|
||||||
|
|
||||||
static void initialize();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PSApiDll: AllStatic {
|
class PSApiDll: AllStatic {
|
||||||
@ -282,16 +251,6 @@ public:
|
|||||||
static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD);
|
static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD);
|
||||||
|
|
||||||
static BOOL PSApiAvailable();
|
static BOOL PSApiAvailable();
|
||||||
|
|
||||||
#ifdef JDK6_OR_EARLIER
|
|
||||||
private:
|
|
||||||
static BOOL (WINAPI *_EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD);
|
|
||||||
static BOOL (WINAPI *_GetModuleFileNameEx)(HANDLE, HMODULE, LPTSTR, DWORD);;
|
|
||||||
static BOOL (WINAPI *_GetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD);
|
|
||||||
static BOOL initialized;
|
|
||||||
|
|
||||||
static void initialize();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OS_WINDOWS_VM_OS_WINDOWS_HPP
|
#endif // OS_WINDOWS_VM_OS_WINDOWS_HPP
|
||||||
|
162
hotspot/src/os/windows/vm/sharedRuntimeRem.cpp
Normal file
162
hotspot/src/os/windows/vm/sharedRuntimeRem.cpp
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precompiled.hpp"
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
// These are copied defines from fdlibm.h, this allows us to keep the code
|
||||||
|
// the same as in the JDK, for easier maintenance.
|
||||||
|
|
||||||
|
#define __HI(x) *(1+(int*)&x)
|
||||||
|
#define __LO(x) *(int*)&x
|
||||||
|
|
||||||
|
// This code is a copy of __ieee754_fmod() from the JDK's libfdlibm and is
|
||||||
|
// used as a workaround for issues with the Windows x64 CRT implementation
|
||||||
|
// of fmod. Microsoft has acknowledged that this is an issue in Visual Studio
|
||||||
|
// 2012 and forward, but has not provided a time frame for a fix other than that
|
||||||
|
// it'll not be fixed in Visual Studio 2013 or 2015.
|
||||||
|
|
||||||
|
static const double one = 1.0, Zero[] = { 0.0, -0.0, };
|
||||||
|
|
||||||
|
double SharedRuntime::fmod_winx64(double x, double y)
|
||||||
|
{
|
||||||
|
int n, hx, hy, hz, ix, iy, sx, i;
|
||||||
|
unsigned lx, ly, lz;
|
||||||
|
|
||||||
|
hx = __HI(x); /* high word of x */
|
||||||
|
lx = __LO(x); /* low word of x */
|
||||||
|
hy = __HI(y); /* high word of y */
|
||||||
|
ly = __LO(y); /* low word of y */
|
||||||
|
sx = hx & 0x80000000; /* sign of x */
|
||||||
|
hx ^= sx; /* |x| */
|
||||||
|
hy &= 0x7fffffff; /* |y| */
|
||||||
|
|
||||||
|
#pragma warning( disable : 4146 )
|
||||||
|
/* purge off exception values */
|
||||||
|
if ((hy | ly) == 0 || (hx >= 0x7ff00000) || /* y=0,or x not finite */
|
||||||
|
((hy | ((ly | -ly) >> 31))>0x7ff00000)) /* or y is NaN */
|
||||||
|
#pragma warning( default : 4146 )
|
||||||
|
return (x*y) / (x*y);
|
||||||
|
if (hx <= hy) {
|
||||||
|
if ((hx<hy) || (lx<ly)) return x; /* |x|<|y| return x */
|
||||||
|
if (lx == ly)
|
||||||
|
return Zero[(unsigned)sx >> 31]; /* |x|=|y| return x*0*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* determine ix = ilogb(x) */
|
||||||
|
if (hx<0x00100000) { /* subnormal x */
|
||||||
|
if (hx == 0) {
|
||||||
|
for (ix = -1043, i = lx; i>0; i <<= 1) ix -= 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (ix = -1022, i = (hx << 11); i>0; i <<= 1) ix -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else ix = (hx >> 20) - 1023;
|
||||||
|
|
||||||
|
/* determine iy = ilogb(y) */
|
||||||
|
if (hy<0x00100000) { /* subnormal y */
|
||||||
|
if (hy == 0) {
|
||||||
|
for (iy = -1043, i = ly; i>0; i <<= 1) iy -= 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (iy = -1022, i = (hy << 11); i>0; i <<= 1) iy -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else iy = (hy >> 20) - 1023;
|
||||||
|
|
||||||
|
/* set up {hx,lx}, {hy,ly} and align y to x */
|
||||||
|
if (ix >= -1022)
|
||||||
|
hx = 0x00100000 | (0x000fffff & hx);
|
||||||
|
else { /* subnormal x, shift x to normal */
|
||||||
|
n = -1022 - ix;
|
||||||
|
if (n <= 31) {
|
||||||
|
hx = (hx << n) | (lx >> (32 - n));
|
||||||
|
lx <<= n;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hx = lx << (n - 32);
|
||||||
|
lx = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (iy >= -1022)
|
||||||
|
hy = 0x00100000 | (0x000fffff & hy);
|
||||||
|
else { /* subnormal y, shift y to normal */
|
||||||
|
n = -1022 - iy;
|
||||||
|
if (n <= 31) {
|
||||||
|
hy = (hy << n) | (ly >> (32 - n));
|
||||||
|
ly <<= n;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hy = ly << (n - 32);
|
||||||
|
ly = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fix point fmod */
|
||||||
|
n = ix - iy;
|
||||||
|
while (n--) {
|
||||||
|
hz = hx - hy; lz = lx - ly; if (lx<ly) hz -= 1;
|
||||||
|
if (hz<0){ hx = hx + hx + (lx >> 31); lx = lx + lx; }
|
||||||
|
else {
|
||||||
|
if ((hz | lz) == 0) /* return sign(x)*0 */
|
||||||
|
return Zero[(unsigned)sx >> 31];
|
||||||
|
hx = hz + hz + (lz >> 31); lx = lz + lz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hz = hx - hy; lz = lx - ly; if (lx<ly) hz -= 1;
|
||||||
|
if (hz >= 0) { hx = hz; lx = lz; }
|
||||||
|
|
||||||
|
/* convert back to floating value and restore the sign */
|
||||||
|
if ((hx | lx) == 0) /* return sign(x)*0 */
|
||||||
|
return Zero[(unsigned)sx >> 31];
|
||||||
|
while (hx<0x00100000) { /* normalize x */
|
||||||
|
hx = hx + hx + (lx >> 31); lx = lx + lx;
|
||||||
|
iy -= 1;
|
||||||
|
}
|
||||||
|
if (iy >= -1022) { /* normalize output */
|
||||||
|
hx = ((hx - 0x00100000) | ((iy + 1023) << 20));
|
||||||
|
__HI(x) = hx | sx;
|
||||||
|
__LO(x) = lx;
|
||||||
|
}
|
||||||
|
else { /* subnormal output */
|
||||||
|
n = -1022 - iy;
|
||||||
|
if (n <= 20) {
|
||||||
|
lx = (lx >> n) | ((unsigned)hx << (32 - n));
|
||||||
|
hx >>= n;
|
||||||
|
}
|
||||||
|
else if (n <= 31) {
|
||||||
|
lx = (hx << (32 - n)) | (lx >> n); hx = sx;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lx = hx >> (n - 32); hx = sx;
|
||||||
|
}
|
||||||
|
__HI(x) = hx | sx;
|
||||||
|
__LO(x) = lx;
|
||||||
|
x *= one; /* create necessary signal */
|
||||||
|
}
|
||||||
|
return x; /* exact output */
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user