Merge
This commit is contained in:
commit
026b1aa044
1
.hgtags
1
.hgtags
@ -255,3 +255,4 @@ efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09
|
|||||||
8c0bdeecd7c0f9ce3f3762a51991f755cb3a972c jdk9-b10
|
8c0bdeecd7c0f9ce3f3762a51991f755cb3a972c jdk9-b10
|
||||||
0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11
|
0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11
|
||||||
0d1f816217dce5e72187f167cc1816080cbeb453 jdk9-b12
|
0d1f816217dce5e72187f167cc1816080cbeb453 jdk9-b12
|
||||||
|
1a30593dcb9802faec3b6edb24d86ca088594e4e jdk9-b13
|
||||||
|
@ -255,3 +255,5 @@ db045d8faa0924b7378102d24a1a0d850c1e3834 jdk9-b08
|
|||||||
fa13f2b926f8426876ec03e7903f3ee0ee150f2e jdk9-b10
|
fa13f2b926f8426876ec03e7903f3ee0ee150f2e jdk9-b10
|
||||||
ab55a18a95e1990a588929d5d29db3eb9985fea0 jdk9-b11
|
ab55a18a95e1990a588929d5d29db3eb9985fea0 jdk9-b11
|
||||||
59f6350295f9681fe5956d8bc889bf341914c6cb jdk9-b12
|
59f6350295f9681fe5956d8bc889bf341914c6cb jdk9-b12
|
||||||
|
5800456add07e1a68170a229fb5e27376f8875e5 jdk9-b13
|
||||||
|
4e3aa9723e9972623e3dafc321b368e7db7e9b3b jdk9-b14
|
||||||
|
@ -331,8 +331,8 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
|||||||
|
|
||||||
# Finally, set some other options...
|
# Finally, set some other options...
|
||||||
|
|
||||||
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
|
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
|
||||||
BOOT_JDK_SOURCETARGET="-source 7 -target 7"
|
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
|
||||||
AC_SUBST(BOOT_JDK_SOURCETARGET)
|
AC_SUBST(BOOT_JDK_SOURCETARGET)
|
||||||
AC_SUBST(JAVAC_FLAGS)
|
AC_SUBST(JAVAC_FLAGS)
|
||||||
])
|
])
|
||||||
|
@ -4253,7 +4253,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
|
|||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1398861894
|
DATE_WHEN_GENERATED=1399969244
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -26014,8 +26014,8 @@ $as_echo "$tool_specified" >&6; }
|
|||||||
|
|
||||||
# Finally, set some other options...
|
# Finally, set some other options...
|
||||||
|
|
||||||
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
|
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
|
||||||
BOOT_JDK_SOURCETARGET="-source 7 -target 7"
|
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2009, 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.
|
||||||
@ -23,25 +22,40 @@
|
|||||||
# questions.
|
# questions.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Shell script for a fast parallel forest command
|
# Shell script for a fast parallel forest/trees command
|
||||||
|
|
||||||
global_opts=""
|
usage() {
|
||||||
status_output="/dev/stdout"
|
echo "usage: $0 [-h|--help] [-q|--quiet] [-v|--verbose] [-s|--sequential] [--] <command> [commands...]" > ${status_output}
|
||||||
qflag="false"
|
echo "Environment variables which modify behaviour:"
|
||||||
vflag="false"
|
echo " HGFOREST_QUIET : (boolean) If 'true' then standard output is redirected to /dev/null"
|
||||||
sflag="false"
|
echo " HGFOREST_VERBOSE : (boolean) If 'true' then Mercurial asked to produce verbose output"
|
||||||
|
echo " HGFOREST_SEQUENTIAL : (boolean) If 'true' then repos are processed sequentially. Disables concurrency"
|
||||||
|
echo " HGFOREST_GLOBALOPTS : (string, must begin with space) Additional Mercurial global options"
|
||||||
|
echo " HGFOREST_REDIRECT : (file path) Redirect standard output to specified file"
|
||||||
|
echo " HGFOREST_FIFOS : (boolean) Default behaviour for FIFO detection. Does not override FIFOs disabled"
|
||||||
|
echo " HGFOREST_CONCURRENCY: (positive integer) Number of repos to process concurrently"
|
||||||
|
echo " HGFOREST_DEBUG : (boolean) If 'true' then temp files are retained"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
global_opts="${HGFOREST_GLOBALOPTS:-}"
|
||||||
|
status_output="${HGFOREST_REDIRECT:-/dev/stdout}"
|
||||||
|
qflag="${HGFOREST_QUIET:-false}"
|
||||||
|
vflag="${HGFOREST_VERBOSE:-false}"
|
||||||
|
sflag="${HGFOREST_SEQUENTIAL:-false}"
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
-h | --help )
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
|
||||||
-q | --quiet )
|
-q | --quiet )
|
||||||
qflag="true"
|
qflag="true"
|
||||||
global_opts="${global_opts} -q"
|
|
||||||
status_output="/dev/null"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-v | --verbose )
|
-v | --verbose )
|
||||||
vflag="true"
|
vflag="true"
|
||||||
global_opts="${global_opts} -v"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-s | --sequential )
|
-s | --sequential )
|
||||||
@ -63,39 +77,60 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# silence standard output?
|
||||||
|
if [ ${qflag} = "true" ] ; then
|
||||||
|
global_opts="${global_opts} -q"
|
||||||
|
status_output="/dev/null"
|
||||||
|
fi
|
||||||
|
|
||||||
command="$1"; shift
|
# verbose output?
|
||||||
command_args="$@"
|
if [ ${vflag} = "true" ] ; then
|
||||||
|
global_opts="${global_opts} -v"
|
||||||
|
fi
|
||||||
|
|
||||||
usage() {
|
# Make sure we have a command.
|
||||||
echo "usage: $0 [-q|--quiet] [-v|--verbose] [-s|--sequential] [--] <command> [commands...]" > ${status_output}
|
if [ $# -lt 1 -o -z "${1:-}" ] ; then
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "x" = "x$command" ] ; then
|
|
||||||
echo "ERROR: No command to hg supplied!"
|
echo "ERROR: No command to hg supplied!"
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if we can use fifos for monitoring sub-process completion.
|
command="$1"; shift
|
||||||
on_windows=`uname -s | egrep -ic -e 'cygwin|msys'`
|
command_args="${@:-}"
|
||||||
if [ ${on_windows} = "1" ]; then
|
|
||||||
# cygwin has (2014-04-18) broken (single writer only) FIFOs
|
|
||||||
# msys has (2014-04-18) no FIFOs.
|
|
||||||
have_fifos="false"
|
|
||||||
else
|
|
||||||
have_fifos="true"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean out the temporary directory that stores the pid files.
|
# Clean out the temporary directory that stores the pid files.
|
||||||
tmp=/tmp/forest.$$
|
tmp=/tmp/forest.$$
|
||||||
rm -f -r ${tmp}
|
rm -f -r ${tmp}
|
||||||
mkdir -p ${tmp}
|
mkdir -p ${tmp}
|
||||||
|
|
||||||
|
|
||||||
|
if [ "${HGFOREST_DEBUG:-false}" = "true" ] ; then
|
||||||
|
echo "DEBUG: temp files are in: ${tmp}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if we can use fifos for monitoring sub-process completion.
|
||||||
|
echo "1" > ${tmp}/read
|
||||||
|
while_subshell=1
|
||||||
|
while read line; do
|
||||||
|
while_subshell=0
|
||||||
|
break;
|
||||||
|
done < ${tmp}/read
|
||||||
|
rm ${tmp}/read
|
||||||
|
|
||||||
|
on_windows=`uname -s | egrep -ic -e 'cygwin|msys'`
|
||||||
|
|
||||||
|
if [ ${while_subshell} = "1" -o ${on_windows} = "1" ]; then
|
||||||
|
# cygwin has (2014-04-18) broken (single writer only) FIFOs
|
||||||
|
# msys has (2014-04-18) no FIFOs.
|
||||||
|
# older shells create a sub-shell for redirect to while
|
||||||
|
have_fifos="false"
|
||||||
|
else
|
||||||
|
have_fifos="${HGFOREST_FIFOS:-true}"
|
||||||
|
fi
|
||||||
|
|
||||||
safe_interrupt () {
|
safe_interrupt () {
|
||||||
if [ -d ${tmp} ]; then
|
if [ -d ${tmp} ]; then
|
||||||
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
||||||
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!" > ${status_output}
|
echo "Waiting for processes ( `cat ${tmp}/.*.pid ${tmp}/*.pid 2> /dev/null | tr '\n' ' '`) to terminate nicely!" > ${status_output}
|
||||||
sleep 1
|
sleep 1
|
||||||
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
||||||
# a subprocess that has already exited.
|
# a subprocess that has already exited.
|
||||||
@ -110,10 +145,12 @@ safe_interrupt () {
|
|||||||
|
|
||||||
nice_exit () {
|
nice_exit () {
|
||||||
if [ -d ${tmp} ]; then
|
if [ -d ${tmp} ]; then
|
||||||
if [ "`ls ${tmp}`" != "" ]; then
|
if [ "`ls -A ${tmp} 2> /dev/null`" != "" ]; then
|
||||||
wait
|
wait
|
||||||
fi
|
fi
|
||||||
rm -f -r ${tmp}
|
if [ "${HGFOREST_DEBUG:-false}" != "true" ] ; then
|
||||||
|
rm -f -r ${tmp}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,17 +165,20 @@ pull_default=""
|
|||||||
repos=""
|
repos=""
|
||||||
repos_extra=""
|
repos_extra=""
|
||||||
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
||||||
|
# we must be a clone
|
||||||
if [ ! -f .hg/hgrc ] ; then
|
if [ ! -f .hg/hgrc ] ; then
|
||||||
echo "ERROR: Need initial repository to use this script" > ${status_output}
|
echo "ERROR: Need initial repository to use this script" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# the clone must know where it came from (have a default pull path).
|
||||||
pull_default=`hg paths default`
|
pull_default=`hg paths default`
|
||||||
if [ "${pull_default}" = "" ] ; then
|
if [ "${pull_default}" = "" ] ; then
|
||||||
echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
|
echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# determine which sub repos need to be cloned.
|
||||||
for i in ${subrepos} ; do
|
for i in ${subrepos} ; do
|
||||||
if [ ! -f ${i}/.hg/hgrc ] ; then
|
if [ ! -f ${i}/.hg/hgrc ] ; then
|
||||||
repos="${repos} ${i}"
|
repos="${repos} ${i}"
|
||||||
@ -147,12 +187,15 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone
|
|||||||
|
|
||||||
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
|
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
|
||||||
|
|
||||||
if [ "${command_args}" != "" ] ; then
|
if [ -n "${command_args}" ] ; then
|
||||||
|
# if there is an "extra sources" path then reparent "extra" repos to that path
|
||||||
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
|
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
|
||||||
echo "ERROR: Need initial clone from non-local source" > ${status_output}
|
echo "ERROR: Need initial clone from non-local source" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pull_extra="${command_args}/${pull_default_tail}"
|
pull_extra="${command_args}/${pull_default_tail}"
|
||||||
|
|
||||||
|
# determine which extra subrepos need to be cloned.
|
||||||
for i in ${subrepos_extra} ; do
|
for i in ${subrepos_extra} ; do
|
||||||
if [ ! -f ${i}/.hg/hgrc ] ; then
|
if [ ! -f ${i}/.hg/hgrc ] ; then
|
||||||
repos_extra="${repos_extra} ${i}"
|
repos_extra="${repos_extra} ${i}"
|
||||||
@ -160,7 +203,7 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone
|
|||||||
done
|
done
|
||||||
else
|
else
|
||||||
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
|
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
|
||||||
# local source repo. Copy the extras ones that exist there.
|
# local source repo. Clone the "extra" subrepos that exist there.
|
||||||
for i in ${subrepos_extra} ; do
|
for i in ${subrepos_extra} ; do
|
||||||
if [ -f ${pull_default}/${i}/.hg/hgrc -a ! -f ${i}/.hg/hgrc ] ; then
|
if [ -f ${pull_default}/${i}/.hg/hgrc -a ! -f ${i}/.hg/hgrc ] ; then
|
||||||
# sub-repo there in source but not here
|
# sub-repo there in source but not here
|
||||||
@ -169,13 +212,17 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
at_a_time=2
|
|
||||||
# Any repos to deal with?
|
# Any repos to deal with?
|
||||||
if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
|
if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
|
||||||
echo "No repositories to process." > ${status_output}
|
echo "No repositories to process." > ${status_output}
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Repos to process concurrently. Clone does better with low concurrency.
|
||||||
|
at_a_time="${HGFOREST_CONCURRENCY:-2}"
|
||||||
else
|
else
|
||||||
|
# Process command for all of the present repos
|
||||||
for i in . ${subrepos} ${subrepos_extra} ; do
|
for i in . ${subrepos} ${subrepos_extra} ; do
|
||||||
if [ -d ${i}/.hg ] ; then
|
if [ -d ${i}/.hg ] ; then
|
||||||
repos="${repos} ${i}"
|
repos="${repos} ${i}"
|
||||||
@ -189,6 +236,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# any of the repos locked?
|
# any of the repos locked?
|
||||||
|
locked=""
|
||||||
for i in ${repos} ; do
|
for i in ${repos} ; do
|
||||||
if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
|
if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
|
||||||
locked="${i} ${locked}"
|
locked="${i} ${locked}"
|
||||||
@ -198,34 +246,39 @@ else
|
|||||||
echo "ERROR: These repositories are locked: ${locked}" > ${status_output}
|
echo "ERROR: These repositories are locked: ${locked}" > ${status_output}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
at_a_time=8
|
|
||||||
|
# Repos to process concurrently.
|
||||||
|
at_a_time="${HGFOREST_CONCURRENCY:-8}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Echo out what repositories we do a command on.
|
# Echo out what repositories we do a command on.
|
||||||
echo "# Repositories: ${repos} ${repos_extra}" > ${status_output}
|
echo "# Repositories: ${repos} ${repos_extra}" > ${status_output}
|
||||||
|
|
||||||
if [ "${command}" = "serve" ] ; then
|
if [ "${command}" = "serve" ] ; then
|
||||||
# "serve" is run for all the repos.
|
# "serve" is run for all the repos as one command.
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
cwd=`pwd`
|
||||||
|
serving=`basename ${cwd}`
|
||||||
(
|
(
|
||||||
echo "[web]"
|
echo "[web]"
|
||||||
echo "description = $(basename $(pwd))"
|
echo "description = ${serving}"
|
||||||
echo "allow_push = *"
|
echo "allow_push = *"
|
||||||
echo "push_ssl = False"
|
echo "push_ssl = False"
|
||||||
|
|
||||||
echo "[paths]"
|
echo "[paths]"
|
||||||
for i in ${repos} ${repos_extra} ; do
|
for i in ${repos} ; do
|
||||||
if [ "${i}" != "." ] ; then
|
if [ "${i}" != "." ] ; then
|
||||||
echo "/$(basename $(pwd))/${i} = ${i}"
|
echo "/${serving}/${i} = ${i}"
|
||||||
else
|
else
|
||||||
echo "/$(basename $(pwd)) = $(pwd)"
|
echo "/${serving} = ${cwd}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
) > ${tmp}/serve.web-conf
|
) > ${tmp}/serve.web-conf
|
||||||
|
|
||||||
echo "serving root repo $(basename $(pwd))"
|
echo "serving root repo ${serving}" > ${status_output}
|
||||||
|
|
||||||
|
echo "hg${global_opts} serve" > ${status_output}
|
||||||
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
|
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
|
||||||
) 2>&1 | sed -e "s@^@serve: @" > ${status_output}
|
) 2>&1 | sed -e "s@^@serve: @" > ${status_output}
|
||||||
) &
|
) &
|
||||||
@ -234,81 +287,93 @@ else
|
|||||||
|
|
||||||
# n is the number of subprocess started or which might still be running.
|
# n is the number of subprocess started or which might still be running.
|
||||||
n=0
|
n=0
|
||||||
if [ $have_fifos = "true" ]; then
|
if [ ${have_fifos} = "true" ]; then
|
||||||
# if we have fifos use them to detect command completion.
|
# if we have fifos use them to detect command completion.
|
||||||
mkfifo ${tmp}/fifo
|
mkfifo ${tmp}/fifo
|
||||||
exec 3<>${tmp}/fifo
|
exec 3<>${tmp}/fifo
|
||||||
if [ "${sflag}" = "true" ] ; then
|
|
||||||
# force sequential
|
|
||||||
at_a_time=1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# iterate over all of the subrepos.
|
||||||
for i in ${repos} ${repos_extra} ; do
|
for i in ${repos} ${repos_extra} ; do
|
||||||
n=`expr ${n} '+' 1`
|
n=`expr ${n} '+' 1`
|
||||||
repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
|
repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
|
||||||
reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
|
reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
|
||||||
pull_base="${pull_default}"
|
pull_base="${pull_default}"
|
||||||
for j in $repos_extra ; do
|
|
||||||
if [ "$i" = "$j" ] ; then
|
# regular repo or "extra" repo?
|
||||||
pull_base="${pull_extra}"
|
for j in ${repos_extra} ; do
|
||||||
|
if [ "${i}" = "${j}" ] ; then
|
||||||
|
# it's an "extra"
|
||||||
|
pull_base="${pull_extra}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# remove trailing slash
|
||||||
pull_base="`echo ${pull_base} | sed -e 's@[/]*$@@'`"
|
pull_base="`echo ${pull_base} | sed -e 's@[/]*$@@'`"
|
||||||
|
|
||||||
|
# execute the command on the subrepo
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
||||||
pull_newrepo="${pull_base}/${i}"
|
# some form of clone
|
||||||
path="`dirname ${i}`"
|
clone_newrepo="${pull_base}/${i}"
|
||||||
if [ "${path}" != "." ] ; then
|
parent_path="`dirname ${i}`"
|
||||||
|
if [ "${parent_path}" != "." ] ; then
|
||||||
times=0
|
times=0
|
||||||
while [ ! -d "${path}" ] ## nested repo, ensure containing dir exists
|
while [ ! -d "${parent_path}" ] ; do ## nested repo, ensure containing dir exists
|
||||||
do
|
if [ "${sflag}" = "true" ] ; then
|
||||||
|
# Missing parent is fatal during sequential operation.
|
||||||
|
echo "ERROR: Missing parent path: ${parent_path}" > ${status_output}
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
times=`expr ${times} '+' 1`
|
times=`expr ${times} '+' 1`
|
||||||
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
||||||
echo "${path} still not created, waiting..." > ${status_output}
|
echo "${parent_path} still not created, waiting..." > ${status_output}
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "hg${global_opts} clone ${pull_newrepo} ${i}" > ${status_output}
|
# run the clone command.
|
||||||
(PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
echo "hg${global_opts} clone ${clone_newrepo} ${i}" > ${status_output}
|
||||||
|
(PYTHONUNBUFFERED=true hg${global_opts} clone ${clone_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||||
else
|
else
|
||||||
|
# run the command.
|
||||||
echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
|
echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
|
||||||
cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_args}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_args}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $! > ${tmp}/${repopidfile}.pid
|
echo $! > ${tmp}/${repopidfile}.pid
|
||||||
) 2>&1 | sed -e "s@^@${reponame}: @" > ${status_output}
|
) 2>&1 | sed -e "s@^@${reponame}: @" > ${status_output}
|
||||||
if [ $have_fifos = "true" ]; then
|
# tell the fifo waiter that this subprocess is done.
|
||||||
echo "${reponame}" >&3
|
if [ ${have_fifos} = "true" ]; then
|
||||||
|
echo "${i}" >&3
|
||||||
fi
|
fi
|
||||||
) &
|
) &
|
||||||
|
|
||||||
if [ $have_fifos = "true" ]; then
|
if [ "${sflag}" = "true" ] ; then
|
||||||
# check on count of running subprocesses and possibly wait for completion
|
# complete this task before starting another.
|
||||||
if [ ${at_a_time} -lt ${n} ] ; then
|
wait
|
||||||
# read will block until there are completed subprocesses
|
|
||||||
while read repo_done; do
|
|
||||||
n=`expr ${n} '-' 1`
|
|
||||||
if [ ${n} -lt ${at_a_time} ] ; then
|
|
||||||
# we should start more subprocesses
|
|
||||||
break;
|
|
||||||
fi
|
|
||||||
done <&3
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if [ "${sflag}" = "false" ] ; then
|
if [ "${have_fifos}" = "true" ]; then
|
||||||
|
# check on count of running subprocesses and possibly wait for completion
|
||||||
|
if [ ${n} -ge ${at_a_time} ] ; then
|
||||||
|
# read will block until there are completed subprocesses
|
||||||
|
while read repo_done; do
|
||||||
|
n=`expr ${n} '-' 1`
|
||||||
|
if [ ${n} -lt ${at_a_time} ] ; then
|
||||||
|
# we should start more subprocesses
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done <&3
|
||||||
|
fi
|
||||||
|
else
|
||||||
# Compare completions to starts
|
# Compare completions to starts
|
||||||
completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
|
completed="`(ls -a1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
|
||||||
while [ ${at_a_time} -lt `expr ${n} '-' ${completed}` ] ; do
|
while [ `expr ${n} '-' ${completed}` -ge ${at_a_time} ] ; do
|
||||||
# sleep a short time to give time for something to complete
|
# sleep a short time to give time for something to complete
|
||||||
sleep 1
|
sleep 1
|
||||||
completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
|
completed="`(ls -a1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
|
||||||
done
|
done
|
||||||
else
|
|
||||||
# complete this task before starting another.
|
|
||||||
wait
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -320,11 +385,12 @@ wait
|
|||||||
# Terminate with exit 0 only if all subprocesses were successful
|
# Terminate with exit 0 only if all subprocesses were successful
|
||||||
ec=0
|
ec=0
|
||||||
if [ -d ${tmp} ]; then
|
if [ -d ${tmp} ]; then
|
||||||
for rc in ${tmp}/*.pid.rc ; do
|
rcfiles="`(ls -a ${tmp}/*.pid.rc 2> /dev/null) || echo ''`"
|
||||||
|
for rc in ${rcfiles} ; do
|
||||||
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
||||||
if [ "${exit_code}" != "0" ] ; then
|
if [ "${exit_code}" != "0" ] ; then
|
||||||
repo="`echo ${rc} | sed -e s@^${tmp}@@ -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
|
repo="`echo ${rc} | sed -e 's@^'${tmp}'@@' -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
|
||||||
echo "WARNING: ${repo} exited abnormally ($exit_code)" > ${status_output}
|
echo "WARNING: ${repo} exited abnormally (${exit_code})" > ${status_output}
|
||||||
ec=1
|
ec=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -255,3 +255,4 @@ a4bf701ac316946c2e5e83138ad8e687da6a4b30 jdk9-b06
|
|||||||
3bd4039dfc632fd7fc8418a25a3dcc34d1cd4019 jdk9-b10
|
3bd4039dfc632fd7fc8418a25a3dcc34d1cd4019 jdk9-b10
|
||||||
77ea0a2503582a28e4e66be7239a49a0d1dd313f jdk9-b11
|
77ea0a2503582a28e4e66be7239a49a0d1dd313f jdk9-b11
|
||||||
e212cdcc8c11f0ba5acf6f5ddb596c4c545a93f9 jdk9-b12
|
e212cdcc8c11f0ba5acf6f5ddb596c4c545a93f9 jdk9-b12
|
||||||
|
088eec4c36f4d7f250fcd19c4969bf698e3d2cdc jdk9-b13
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
package com.sun.corba.se.spi.orb;
|
package com.sun.corba.se.spi.orb;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.Map ;
|
import java.util.Map ;
|
||||||
import java.util.HashMap ;
|
import java.util.HashMap ;
|
||||||
import java.util.Properties ;
|
import java.util.Properties ;
|
||||||
@ -44,16 +42,13 @@ import com.sun.corba.se.pept.transport.ByteBufferPool;
|
|||||||
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
|
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
|
||||||
import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
|
import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
|
||||||
import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
|
import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
|
||||||
import com.sun.corba.se.spi.protocol.CorbaMessageMediator ;
|
|
||||||
import com.sun.corba.se.spi.protocol.PIHandler ;
|
import com.sun.corba.se.spi.protocol.PIHandler ;
|
||||||
import com.sun.corba.se.spi.resolver.LocalResolver ;
|
import com.sun.corba.se.spi.resolver.LocalResolver ;
|
||||||
import com.sun.corba.se.spi.resolver.Resolver ;
|
import com.sun.corba.se.spi.resolver.Resolver ;
|
||||||
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
|
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
|
||||||
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo;
|
|
||||||
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
|
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
|
||||||
import com.sun.corba.se.spi.monitoring.MonitoringConstants;
|
import com.sun.corba.se.spi.monitoring.MonitoringConstants;
|
||||||
import com.sun.corba.se.spi.monitoring.MonitoringManager;
|
import com.sun.corba.se.spi.monitoring.MonitoringManager;
|
||||||
import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory;
|
|
||||||
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
|
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
|
||||||
|
|
||||||
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
|
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
|
||||||
@ -62,11 +57,6 @@ import com.sun.corba.se.spi.ior.ObjectKey ;
|
|||||||
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
|
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
|
||||||
import com.sun.corba.se.spi.ior.IOR ;
|
import com.sun.corba.se.spi.ior.IOR ;
|
||||||
|
|
||||||
import com.sun.corba.se.spi.orbutil.closure.Closure ;
|
|
||||||
|
|
||||||
import com.sun.corba.se.spi.orb.Operation ;
|
|
||||||
import com.sun.corba.se.spi.orb.ORBData ;
|
|
||||||
import com.sun.corba.se.spi.orb.ORBVersion ;
|
|
||||||
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
|
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
|
||||||
|
|
||||||
import com.sun.corba.se.spi.oa.OAInvocationInfo ;
|
import com.sun.corba.se.spi.oa.OAInvocationInfo ;
|
||||||
@ -99,8 +89,6 @@ import com.sun.corba.se.impl.logging.OMGSystemException ;
|
|||||||
|
|
||||||
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
|
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
|
||||||
|
|
||||||
import sun.misc.JavaAWTAccess;
|
|
||||||
|
|
||||||
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||||
implements Broker, TypeCodeFactory
|
implements Broker, TypeCodeFactory
|
||||||
{
|
{
|
||||||
@ -146,9 +134,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
// This map is needed for resolving recursive type code placeholders
|
// This map is needed for resolving recursive type code placeholders
|
||||||
// based on the unique repository id.
|
// based on the unique repository id.
|
||||||
// XXX Should this be a WeakHashMap for GC?
|
// XXX Should this be a WeakHashMap for GC?
|
||||||
private Map typeCodeMap ;
|
private Map<String, TypeCodeImpl> typeCodeMap;
|
||||||
|
|
||||||
private TypeCodeImpl[] primitiveTypeCodeConstants ;
|
private TypeCodeImpl[] primitiveTypeCodeConstants;
|
||||||
|
|
||||||
// ByteBufferPool - needed by both ORBImpl and ORBSingleton
|
// ByteBufferPool - needed by both ORBImpl and ORBSingleton
|
||||||
ByteBufferPool byteBufferPool;
|
ByteBufferPool byteBufferPool;
|
||||||
@ -169,16 +157,18 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
// wrapperMap maintains a table of LogWrapper instances used by
|
// wrapperMap maintains a table of LogWrapper instances used by
|
||||||
// different classes to log exceptions. The key is a StringPair
|
// different classes to log exceptions. The key is a StringPair
|
||||||
// representing LogDomain and ExceptionGroup.
|
// representing LogDomain and ExceptionGroup.
|
||||||
private Map wrapperMap ;
|
private Map<StringPair, LogWrapperBase> wrapperMap;
|
||||||
|
|
||||||
static class Holder {
|
static class Holder {
|
||||||
static final PresentationManager defaultPresentationManager =
|
static final PresentationManager defaultPresentationManager =
|
||||||
setupPresentationManager();
|
setupPresentationManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<Object, PresentationManager> pmContexts = new HashMap<>();
|
private static final Map<Object, PresentationManager> pmContexts =
|
||||||
|
new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private static Map staticWrapperMap = new ConcurrentHashMap();
|
private static Map<StringPair, LogWrapperBase> staticWrapperMap =
|
||||||
|
new ConcurrentHashMap<>();
|
||||||
|
|
||||||
protected MonitoringManager monitoringManager;
|
protected MonitoringManager monitoringManager;
|
||||||
|
|
||||||
@ -245,28 +235,12 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
public static PresentationManager getPresentationManager()
|
public static PresentationManager getPresentationManager()
|
||||||
{
|
{
|
||||||
SecurityManager sm = System.getSecurityManager();
|
SecurityManager sm = System.getSecurityManager();
|
||||||
JavaAWTAccess javaAwtAccess = sun.misc.SharedSecrets.getJavaAWTAccess();
|
sun.misc.JavaAWTAccess javaAwtAccess = sun.misc.SharedSecrets.getJavaAWTAccess();
|
||||||
if (sm != null && javaAwtAccess != null) {
|
if (sm != null && javaAwtAccess != null) {
|
||||||
Object appletContext;
|
final Object appletContext = javaAwtAccess.getAppletContext();
|
||||||
try {
|
|
||||||
Class<?> clazz = JavaAWTAccess.class;
|
|
||||||
Method method = clazz.getMethod("getAppletContext");
|
|
||||||
appletContext = method.invoke(javaAwtAccess);
|
|
||||||
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
|
|
||||||
InternalError err = new InternalError();
|
|
||||||
err.initCause(e);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appletContext != null) {
|
if (appletContext != null) {
|
||||||
synchronized (pmContexts) {
|
return pmContexts.computeIfAbsent(appletContext,
|
||||||
PresentationManager pm = pmContexts.get(appletContext);
|
x -> setupPresentationManager());
|
||||||
if (pm == null) {
|
|
||||||
pm = setupPresentationManager();
|
|
||||||
pmContexts.put(appletContext, pm);
|
|
||||||
}
|
|
||||||
return pm;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,13 +264,13 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
{
|
{
|
||||||
// Initialize logging first, since it is needed nearly
|
// Initialize logging first, since it is needed nearly
|
||||||
// everywhere (for example, in TypeCodeImpl).
|
// everywhere (for example, in TypeCodeImpl).
|
||||||
wrapperMap = new ConcurrentHashMap();
|
wrapperMap = new ConcurrentHashMap<>();
|
||||||
wrapper = ORBUtilSystemException.get( this,
|
wrapper = ORBUtilSystemException.get( this,
|
||||||
CORBALogDomains.RPC_PRESENTATION ) ;
|
CORBALogDomains.RPC_PRESENTATION ) ;
|
||||||
omgWrapper = OMGSystemException.get( this,
|
omgWrapper = OMGSystemException.get( this,
|
||||||
CORBALogDomains.RPC_PRESENTATION ) ;
|
CORBALogDomains.RPC_PRESENTATION ) ;
|
||||||
|
|
||||||
typeCodeMap = new HashMap();
|
typeCodeMap = new HashMap<>();
|
||||||
|
|
||||||
primitiveTypeCodeConstants = new TypeCodeImpl[] {
|
primitiveTypeCodeConstants = new TypeCodeImpl[] {
|
||||||
new TypeCodeImpl(this, TCKind._tk_null),
|
new TypeCodeImpl(this, TCKind._tk_null),
|
||||||
@ -363,7 +337,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
public synchronized TypeCodeImpl getTypeCode(String id)
|
public synchronized TypeCodeImpl getTypeCode(String id)
|
||||||
{
|
{
|
||||||
checkShutdownState();
|
checkShutdownState();
|
||||||
return (TypeCodeImpl)typeCodeMap.get(id);
|
return typeCodeMap.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MonitoringManager getMonitoringManager( ) {
|
public MonitoringManager getMonitoringManager( ) {
|
||||||
@ -526,35 +500,23 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
|||||||
/** get the log wrapper class (its type is dependent on the exceptionGroup) for the
|
/** get the log wrapper class (its type is dependent on the exceptionGroup) for the
|
||||||
* given log domain and exception group in this ORB instance.
|
* given log domain and exception group in this ORB instance.
|
||||||
*/
|
*/
|
||||||
public LogWrapperBase getLogWrapper( String logDomain,
|
public LogWrapperBase getLogWrapper(String logDomain,
|
||||||
String exceptionGroup, LogWrapperFactory factory )
|
String exceptionGroup, LogWrapperFactory factory)
|
||||||
{
|
{
|
||||||
StringPair key = new StringPair( logDomain, exceptionGroup ) ;
|
return wrapperMap.computeIfAbsent(
|
||||||
|
new StringPair(logDomain, exceptionGroup),
|
||||||
LogWrapperBase logWrapper = (LogWrapperBase)wrapperMap.get( key );
|
x -> factory.create(getLogger(logDomain)));
|
||||||
if (logWrapper == null) {
|
|
||||||
logWrapper = factory.create( getLogger( logDomain ) );
|
|
||||||
wrapperMap.put( key, logWrapper );
|
|
||||||
}
|
|
||||||
|
|
||||||
return logWrapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get the log wrapper class (its type is dependent on the exceptionGroup) for the
|
/** get the log wrapper class (its type is dependent on the exceptionGroup) for the
|
||||||
* given log domain and exception group in this ORB instance.
|
* given log domain and exception group in this ORB instance.
|
||||||
*/
|
*/
|
||||||
public static LogWrapperBase staticGetLogWrapper( String logDomain,
|
public static LogWrapperBase staticGetLogWrapper(String logDomain,
|
||||||
String exceptionGroup, LogWrapperFactory factory )
|
String exceptionGroup, LogWrapperFactory factory)
|
||||||
{
|
{
|
||||||
StringPair key = new StringPair( logDomain, exceptionGroup ) ;
|
return staticWrapperMap.computeIfAbsent(
|
||||||
|
new StringPair(logDomain, exceptionGroup),
|
||||||
LogWrapperBase logWrapper = (LogWrapperBase)staticWrapperMap.get( key );
|
x -> factory.create(staticGetLogger(logDomain)));
|
||||||
if (logWrapper == null) {
|
|
||||||
logWrapper = factory.create( staticGetLogger( logDomain ) );
|
|
||||||
staticWrapperMap.put( key, logWrapper );
|
|
||||||
}
|
|
||||||
|
|
||||||
return logWrapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a reference to a ByteBufferPool, a pool of NIO ByteBuffers
|
// get a reference to a ByteBufferPool, a pool of NIO ByteBuffers
|
||||||
|
@ -415,3 +415,4 @@ bdc5311e1db7598589b77015119b821bf8c828bd jdk9-b05
|
|||||||
ebc44d040cd149d2120d69fe183a3dae7840f4b4 jdk9-b10
|
ebc44d040cd149d2120d69fe183a3dae7840f4b4 jdk9-b10
|
||||||
783309c3a1a629a452673399dcfa83ef7eca94d8 jdk9-b11
|
783309c3a1a629a452673399dcfa83ef7eca94d8 jdk9-b11
|
||||||
1c383bb39e2849ca62cb763f4e182a29b421d60a jdk9-b12
|
1c383bb39e2849ca62cb763f4e182a29b421d60a jdk9-b12
|
||||||
|
456ad9c99133803d4e1433124c85a6fd141b9ac9 jdk9-b13
|
||||||
|
@ -34,19 +34,7 @@
|
|||||||
#include "libproc_md.h"
|
#include "libproc_md.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(sparc) || defined(sparcv9)
|
#include <linux/ptrace.h>
|
||||||
/*
|
|
||||||
If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
|
|
||||||
otherwise it should be from /usr/include/asm-sparc
|
|
||||||
These two files define pt_regs structure differently
|
|
||||||
*/
|
|
||||||
#ifdef _LP64
|
|
||||||
#include "asm-sparc64/ptrace.h"
|
|
||||||
#else
|
|
||||||
#include "asm-sparc/ptrace.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif //sparc or sparcv9
|
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
* Copyright 2012, 2014 SAP AG. All rights reserved.
|
||||||
@ -403,7 +404,7 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(Label& stack_ov
|
|||||||
BLOCK_COMMENT("compute_interpreter_state {");
|
BLOCK_COMMENT("compute_interpreter_state {");
|
||||||
|
|
||||||
// access_flags = method->access_flags();
|
// access_flags = method->access_flags();
|
||||||
// TODO: PPC port: assert(4 == methodOopDesc::sz_access_flags(), "unexpected field size");
|
// TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size");
|
||||||
__ lwa(access_flags, method_(access_flags));
|
__ lwa(access_flags, method_(access_flags));
|
||||||
|
|
||||||
// parameter_count = method->constMethod->size_of_parameters();
|
// parameter_count = method->constMethod->size_of_parameters();
|
||||||
@ -419,10 +420,8 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(Label& stack_ov
|
|||||||
// TODO: PPC port: assert(2 == ConstMethod::sz_max_stack(), "unexpected field size");
|
// TODO: PPC port: assert(2 == ConstMethod::sz_max_stack(), "unexpected field size");
|
||||||
__ lhz(max_stack, in_bytes(ConstMethod::max_stack_offset()), max_stack);
|
__ lhz(max_stack, in_bytes(ConstMethod::max_stack_offset()), max_stack);
|
||||||
|
|
||||||
if (EnableInvokeDynamic) {
|
// Take into account 'extra_stack_entries' needed by method handles (see method.hpp).
|
||||||
// Take into account 'extra_stack_entries' needed by method handles (see method.hpp).
|
|
||||||
__ addi(max_stack, max_stack, Method::extra_stack_entries());
|
__ addi(max_stack, max_stack, Method::extra_stack_entries());
|
||||||
}
|
|
||||||
|
|
||||||
// mem_stack_limit = thread->stack_limit();
|
// mem_stack_limit = thread->stack_limit();
|
||||||
__ ld(mem_stack_limit, thread_(stack_overflow_limit));
|
__ ld(mem_stack_limit, thread_(stack_overflow_limit));
|
||||||
@ -1055,7 +1054,7 @@ address CppInterpreterGenerator::generate_native_entry(void) {
|
|||||||
assert(access_flags->is_nonvolatile(),
|
assert(access_flags->is_nonvolatile(),
|
||||||
"access_flags must be in a non-volatile register");
|
"access_flags must be in a non-volatile register");
|
||||||
// Type check.
|
// Type check.
|
||||||
// TODO: PPC port: assert(4 == methodOopDesc::sz_access_flags(), "unexpected field size");
|
// TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size");
|
||||||
__ lwz(access_flags, method_(access_flags));
|
__ lwz(access_flags, method_(access_flags));
|
||||||
|
|
||||||
// We don't want to reload R19_method and access_flags after calls
|
// We don't want to reload R19_method and access_flags after calls
|
||||||
@ -1838,7 +1837,7 @@ address CppInterpreterGenerator::generate_normal_entry(void) {
|
|||||||
// Interpreter state fields.
|
// Interpreter state fields.
|
||||||
const Register msg = R24_tmp4;
|
const Register msg = R24_tmp4;
|
||||||
|
|
||||||
// MethodOop fields.
|
// Method fields.
|
||||||
const Register parameter_count = R25_tmp5;
|
const Register parameter_count = R25_tmp5;
|
||||||
const Register result_index = R26_tmp6;
|
const Register result_index = R26_tmp6;
|
||||||
|
|
||||||
@ -2023,7 +2022,7 @@ address CppInterpreterGenerator::generate_normal_entry(void) {
|
|||||||
__ add(R17_tos, R17_tos, parameter_count);
|
__ add(R17_tos, R17_tos, parameter_count);
|
||||||
|
|
||||||
// Result stub address array index
|
// Result stub address array index
|
||||||
// TODO: PPC port: assert(4 == methodOopDesc::sz_result_index(), "unexpected field size");
|
// TODO: PPC port: assert(4 == sizeof(AccessFlags), "unexpected field size");
|
||||||
__ lwa(result_index, method_(result_index));
|
__ lwa(result_index, method_(result_index));
|
||||||
|
|
||||||
__ li(msg, BytecodeInterpreter::method_resume);
|
__ li(msg, BytecodeInterpreter::method_resume);
|
||||||
@ -2709,7 +2708,7 @@ address CppInterpreterGenerator::generate_normal_entry(void) {
|
|||||||
__ ld(R3_ARG1, state_(_result._osr._osr_buf));
|
__ ld(R3_ARG1, state_(_result._osr._osr_buf));
|
||||||
__ mtctr(R12_scratch2);
|
__ mtctr(R12_scratch2);
|
||||||
|
|
||||||
// Load method oop, gc may move it during execution of osr'd method.
|
// Load method, gc may move it during execution of osr'd method.
|
||||||
__ ld(R22_tmp2, state_(_method));
|
__ ld(R22_tmp2, state_(_method));
|
||||||
// Load message 'call_method'.
|
// Load message 'call_method'.
|
||||||
__ li(R23_tmp3, BytecodeInterpreter::call_method);
|
__ li(R23_tmp3, BytecodeInterpreter::call_method);
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#ifndef CPU_PPC_VM_FRAME_PPC_INLINE_HPP
|
#ifndef CPU_PPC_VM_FRAME_PPC_INLINE_HPP
|
||||||
#define CPU_PPC_VM_FRAME_PPC_INLINE_HPP
|
#define CPU_PPC_VM_FRAME_PPC_INLINE_HPP
|
||||||
|
|
||||||
|
#include "code/codeCache.hpp"
|
||||||
|
|
||||||
// Inline functions for ppc64 frames:
|
// Inline functions for ppc64 frames:
|
||||||
|
|
||||||
// Find codeblob and set deopt_state.
|
// Find codeblob and set deopt_state.
|
||||||
|
@ -380,7 +380,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
|
|||||||
if (index_size == sizeof(u2)) {
|
if (index_size == sizeof(u2)) {
|
||||||
get_2_byte_integer_at_bcp(bcp_offset, Rdst, Unsigned);
|
get_2_byte_integer_at_bcp(bcp_offset, Rdst, Unsigned);
|
||||||
} else if (index_size == sizeof(u4)) {
|
} else if (index_size == sizeof(u4)) {
|
||||||
assert(EnableInvokeDynamic, "giant index used only for JSR 292");
|
|
||||||
get_4_byte_integer_at_bcp(bcp_offset, Rdst, Signed);
|
get_4_byte_integer_at_bcp(bcp_offset, Rdst, Signed);
|
||||||
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
|
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
|
||||||
nand(Rdst, Rdst, Rdst); // convert to plain index
|
nand(Rdst, Rdst, Rdst); // convert to plain index
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#ifndef CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
#ifndef CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
||||||
#define CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
#define CPU_PPC_VM_INTERP_MASM_PPC_64_HPP
|
||||||
|
|
||||||
#include "assembler_ppc.inline.hpp"
|
#include "asm/macroAssembler.hpp"
|
||||||
#include "interpreter/invocationCounter.hpp"
|
#include "interpreter/invocationCounter.hpp"
|
||||||
|
|
||||||
// This file specializes the assembler with interpreter-specific macros.
|
// This file specializes the assembler with interpreter-specific macros.
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
|
#include "asm/assembler.inline.hpp"
|
||||||
#include "interpreter/interpreter.hpp"
|
#include "interpreter/interpreter.hpp"
|
||||||
#include "interpreter/interpreterRuntime.hpp"
|
#include "interpreter/interpreterRuntime.hpp"
|
||||||
#include "memory/allocation.inline.hpp"
|
#include "memory/allocation.inline.hpp"
|
||||||
|
@ -139,32 +139,16 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() {
|
|||||||
// Signature is in R3_RET. Signature is callee saved.
|
// Signature is in R3_RET. Signature is callee saved.
|
||||||
__ mr(signature, R3_RET);
|
__ mr(signature, R3_RET);
|
||||||
|
|
||||||
// Reload method, it may have moved.
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ ld(R19_method, state_(_method));
|
|
||||||
#else
|
|
||||||
__ ld(R19_method, 0, target_sp);
|
|
||||||
__ ld(R19_method, _ijava_state_neg(method), R19_method);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Get the result handler.
|
// Get the result handler.
|
||||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method);
|
__ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method);
|
||||||
|
|
||||||
// Reload method, it may have moved.
|
|
||||||
#ifdef CC_INTERP
|
|
||||||
__ ld(R19_method, state_(_method));
|
|
||||||
#else
|
|
||||||
__ ld(R19_method, 0, target_sp);
|
|
||||||
__ ld(R19_method, _ijava_state_neg(method), R19_method);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Label L;
|
Label L;
|
||||||
// test if static
|
// test if static
|
||||||
// _access_flags._flags must be at offset 0.
|
// _access_flags._flags must be at offset 0.
|
||||||
// TODO PPC port: requires change in shared code.
|
// TODO PPC port: requires change in shared code.
|
||||||
//assert(in_bytes(AccessFlags::flags_offset()) == 0,
|
//assert(in_bytes(AccessFlags::flags_offset()) == 0,
|
||||||
// "MethodOopDesc._access_flags == MethodOopDesc._access_flags._flags");
|
// "MethodDesc._access_flags == MethodDesc._access_flags._flags");
|
||||||
// _access_flags must be a 32 bit value.
|
// _access_flags must be a 32 bit value.
|
||||||
assert(sizeof(AccessFlags) == 4, "wrong size");
|
assert(sizeof(AccessFlags) == 4, "wrong size");
|
||||||
__ lwa(R11_scratch1/*access_flags*/, method_(access_flags));
|
__ lwa(R11_scratch1/*access_flags*/, method_(access_flags));
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
|
||||||
// we don't have fast jni accessors.
|
// We don't have fast jni accessors.
|
||||||
return (address) -1;
|
return (address) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,12 +57,12 @@ address JNI_FastGetField::generate_fast_get_int_field() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
address JNI_FastGetField::generate_fast_get_long_field() {
|
address JNI_FastGetField::generate_fast_get_long_field() {
|
||||||
// we don't have fast jni accessors.
|
// We don't have fast jni accessors.
|
||||||
return (address) -1;
|
return (address) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||||
// e don't have fast jni accessors.
|
// We don't have fast jni accessors.
|
||||||
return (address) -1;
|
return (address) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,7 +898,7 @@ source_hpp %{
|
|||||||
// To keep related declarations/definitions/uses close together,
|
// To keep related declarations/definitions/uses close together,
|
||||||
// we switch between source %{ }% and source_hpp %{ }% freely as needed.
|
// we switch between source %{ }% and source_hpp %{ }% freely as needed.
|
||||||
|
|
||||||
// Returns true if Node n is followed by a MemBar node that
|
// Returns true if Node n is followed by a MemBar node that
|
||||||
// will do an acquire. If so, this node must not do the acquire
|
// will do an acquire. If so, this node must not do the acquire
|
||||||
// operation.
|
// operation.
|
||||||
bool followed_by_acquire(const Node *n);
|
bool followed_by_acquire(const Node *n);
|
||||||
@ -908,7 +908,7 @@ source %{
|
|||||||
|
|
||||||
// Optimize load-acquire.
|
// Optimize load-acquire.
|
||||||
//
|
//
|
||||||
// Check if acquire is unnecessary due to following operation that does
|
// Check if acquire is unnecessary due to following operation that does
|
||||||
// acquire anyways.
|
// acquire anyways.
|
||||||
// Walk the pattern:
|
// Walk the pattern:
|
||||||
//
|
//
|
||||||
@ -919,12 +919,12 @@ source %{
|
|||||||
// Proj(ctrl) Proj(mem)
|
// Proj(ctrl) Proj(mem)
|
||||||
// | |
|
// | |
|
||||||
// MemBarRelease/Volatile
|
// MemBarRelease/Volatile
|
||||||
//
|
//
|
||||||
bool followed_by_acquire(const Node *load) {
|
bool followed_by_acquire(const Node *load) {
|
||||||
assert(load->is_Load(), "So far implemented only for loads.");
|
assert(load->is_Load(), "So far implemented only for loads.");
|
||||||
|
|
||||||
// Find MemBarAcquire.
|
// Find MemBarAcquire.
|
||||||
const Node *mba = NULL;
|
const Node *mba = NULL;
|
||||||
for (DUIterator_Fast imax, i = load->fast_outs(imax); i < imax; i++) {
|
for (DUIterator_Fast imax, i = load->fast_outs(imax); i < imax; i++) {
|
||||||
const Node *out = load->fast_out(i);
|
const Node *out = load->fast_out(i);
|
||||||
if (out->Opcode() == Op_MemBarAcquire) {
|
if (out->Opcode() == Op_MemBarAcquire) {
|
||||||
@ -937,7 +937,7 @@ bool followed_by_acquire(const Node *load) {
|
|||||||
|
|
||||||
// Find following MemBar node.
|
// Find following MemBar node.
|
||||||
//
|
//
|
||||||
// The following node must be reachable by control AND memory
|
// The following node must be reachable by control AND memory
|
||||||
// edge to assure no other operations are in between the two nodes.
|
// edge to assure no other operations are in between the two nodes.
|
||||||
//
|
//
|
||||||
// So first get the Proj node, mem_proj, to use it to iterate forward.
|
// So first get the Proj node, mem_proj, to use it to iterate forward.
|
||||||
@ -1135,6 +1135,7 @@ class CallStubImpl {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Emit call stub, compiled java to interpreter.
|
||||||
static void emit_trampoline_stub(MacroAssembler &_masm, int destination_toc_offset, int insts_call_instruction_offset);
|
static void emit_trampoline_stub(MacroAssembler &_masm, int destination_toc_offset, int insts_call_instruction_offset);
|
||||||
|
|
||||||
// Size of call trampoline stub.
|
// Size of call trampoline stub.
|
||||||
@ -2755,7 +2756,7 @@ encode %{
|
|||||||
// inputs for new nodes
|
// inputs for new nodes
|
||||||
m1->add_req(NULL, n_toc);
|
m1->add_req(NULL, n_toc);
|
||||||
m2->add_req(NULL, m1);
|
m2->add_req(NULL, m1);
|
||||||
|
|
||||||
// operands for new nodes
|
// operands for new nodes
|
||||||
m1->_opnds[0] = new (C) iRegPdstOper(); // dst
|
m1->_opnds[0] = new (C) iRegPdstOper(); // dst
|
||||||
m1->_opnds[1] = op_src; // src
|
m1->_opnds[1] = op_src; // src
|
||||||
@ -2763,29 +2764,29 @@ encode %{
|
|||||||
m2->_opnds[0] = new (C) iRegPdstOper(); // dst
|
m2->_opnds[0] = new (C) iRegPdstOper(); // dst
|
||||||
m2->_opnds[1] = op_src; // src
|
m2->_opnds[1] = op_src; // src
|
||||||
m2->_opnds[2] = new (C) iRegLdstOper(); // base
|
m2->_opnds[2] = new (C) iRegLdstOper(); // base
|
||||||
|
|
||||||
// Initialize ins_attrib TOC fields.
|
// Initialize ins_attrib TOC fields.
|
||||||
m1->_const_toc_offset = -1;
|
m1->_const_toc_offset = -1;
|
||||||
m2->_const_toc_offset_hi_node = m1;
|
m2->_const_toc_offset_hi_node = m1;
|
||||||
|
|
||||||
// Register allocation for new nodes.
|
// Register allocation for new nodes.
|
||||||
ra_->set_pair(m1->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(m1->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
|
|
||||||
nodes->push(m1);
|
nodes->push(m1);
|
||||||
nodes->push(m2);
|
nodes->push(m2);
|
||||||
assert(m2->bottom_type()->isa_ptr(), "must be ptr");
|
assert(m2->bottom_type()->isa_ptr(), "must be ptr");
|
||||||
} else {
|
} else {
|
||||||
loadConPNode *m2 = new (C) loadConPNode();
|
loadConPNode *m2 = new (C) loadConPNode();
|
||||||
|
|
||||||
// inputs for new nodes
|
// inputs for new nodes
|
||||||
m2->add_req(NULL, n_toc);
|
m2->add_req(NULL, n_toc);
|
||||||
|
|
||||||
// operands for new nodes
|
// operands for new nodes
|
||||||
m2->_opnds[0] = new (C) iRegPdstOper(); // dst
|
m2->_opnds[0] = new (C) iRegPdstOper(); // dst
|
||||||
m2->_opnds[1] = op_src; // src
|
m2->_opnds[1] = op_src; // src
|
||||||
m2->_opnds[2] = new (C) iRegPdstOper(); // toc
|
m2->_opnds[2] = new (C) iRegPdstOper(); // toc
|
||||||
|
|
||||||
// Register allocation for new nodes.
|
// Register allocation for new nodes.
|
||||||
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
|
|
||||||
@ -2977,17 +2978,17 @@ encode %{
|
|||||||
n_sub_base->_opnds[1] = op_crx;
|
n_sub_base->_opnds[1] = op_crx;
|
||||||
n_sub_base->_opnds[2] = op_src;
|
n_sub_base->_opnds[2] = op_src;
|
||||||
n_sub_base->_bottom_type = _bottom_type;
|
n_sub_base->_bottom_type = _bottom_type;
|
||||||
|
|
||||||
n_shift->add_req(n_region, n_sub_base);
|
n_shift->add_req(n_region, n_sub_base);
|
||||||
n_shift->_opnds[0] = op_dst;
|
n_shift->_opnds[0] = op_dst;
|
||||||
n_shift->_opnds[1] = op_dst;
|
n_shift->_opnds[1] = op_dst;
|
||||||
n_shift->_bottom_type = _bottom_type;
|
n_shift->_bottom_type = _bottom_type;
|
||||||
|
|
||||||
ra_->set_pair(n_shift->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(n_shift->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx));
|
ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx));
|
||||||
ra_->set_pair(n_sub_base->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(n_sub_base->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
ra_->set_pair(n_move->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(n_move->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
|
|
||||||
nodes->push(n_move);
|
nodes->push(n_move);
|
||||||
nodes->push(n_compare);
|
nodes->push(n_compare);
|
||||||
nodes->push(n_sub_base);
|
nodes->push(n_sub_base);
|
||||||
@ -3064,20 +3065,20 @@ encode %{
|
|||||||
} else {
|
} else {
|
||||||
// before Power 7
|
// before Power 7
|
||||||
cond_add_baseNode *n_add_base = new (C) cond_add_baseNode();
|
cond_add_baseNode *n_add_base = new (C) cond_add_baseNode();
|
||||||
|
|
||||||
n_add_base->add_req(n_region, n_compare, n_shift);
|
n_add_base->add_req(n_region, n_compare, n_shift);
|
||||||
n_add_base->_opnds[0] = op_dst;
|
n_add_base->_opnds[0] = op_dst;
|
||||||
n_add_base->_opnds[1] = op_crx;
|
n_add_base->_opnds[1] = op_crx;
|
||||||
n_add_base->_opnds[2] = op_dst;
|
n_add_base->_opnds[2] = op_dst;
|
||||||
n_add_base->_bottom_type = _bottom_type;
|
n_add_base->_bottom_type = _bottom_type;
|
||||||
|
|
||||||
assert(ra_->is_oop(this) == true, "A decodeN node must produce an oop!");
|
assert(ra_->is_oop(this) == true, "A decodeN node must produce an oop!");
|
||||||
ra_->set_oop(n_add_base, true);
|
ra_->set_oop(n_add_base, true);
|
||||||
|
|
||||||
ra_->set_pair(n_shift->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(n_shift->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx));
|
ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx));
|
||||||
ra_->set_pair(n_add_base->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
ra_->set_pair(n_add_base->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
|
||||||
|
|
||||||
nodes->push(n_compare);
|
nodes->push(n_compare);
|
||||||
nodes->push(n_shift);
|
nodes->push(n_shift);
|
||||||
nodes->push(n_add_base);
|
nodes->push(n_add_base);
|
||||||
@ -3634,11 +3635,11 @@ encode %{
|
|||||||
// Req...
|
// Req...
|
||||||
for (uint i = 0; i < req(); ++i) {
|
for (uint i = 0; i < req(); ++i) {
|
||||||
// The expanded node does not need toc any more.
|
// The expanded node does not need toc any more.
|
||||||
// Add the inline cache constant here instead. This expresses the
|
// Add the inline cache constant here instead. This expresses the
|
||||||
// register of the inline cache must be live at the call.
|
// register of the inline cache must be live at the call.
|
||||||
// Else we would have to adapt JVMState by -1.
|
// Else we would have to adapt JVMState by -1.
|
||||||
if (i == mach_constant_base_node_input()) {
|
if (i == mach_constant_base_node_input()) {
|
||||||
call->add_req(loadConLNodes_IC._last);
|
call->add_req(loadConLNodes_IC._last);
|
||||||
} else {
|
} else {
|
||||||
call->add_req(in(i));
|
call->add_req(in(i));
|
||||||
}
|
}
|
||||||
@ -3666,6 +3667,8 @@ encode %{
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
// Compound version of call dynamic
|
// Compound version of call dynamic
|
||||||
|
// Toc is only passed so that it can be used in ins_encode statement.
|
||||||
|
// In the code we have to use $constanttablebase.
|
||||||
enc_class enc_java_dynamic_call(method meth, iRegLdst toc) %{
|
enc_class enc_java_dynamic_call(method meth, iRegLdst toc) %{
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
MacroAssembler _masm(&cbuf);
|
MacroAssembler _masm(&cbuf);
|
||||||
@ -3673,14 +3676,17 @@ encode %{
|
|||||||
|
|
||||||
Register Rtoc = (ra_) ? $constanttablebase : R2_TOC;
|
Register Rtoc = (ra_) ? $constanttablebase : R2_TOC;
|
||||||
#if 0
|
#if 0
|
||||||
|
int vtable_index = this->_vtable_index;
|
||||||
if (_vtable_index < 0) {
|
if (_vtable_index < 0) {
|
||||||
// Must be invalid_vtable_index, not nonvirtual_vtable_index.
|
// Must be invalid_vtable_index, not nonvirtual_vtable_index.
|
||||||
assert(_vtable_index == Method::invalid_vtable_index, "correct sentinel value");
|
assert(_vtable_index == Method::invalid_vtable_index, "correct sentinel value");
|
||||||
Register ic_reg = as_Register(Matcher::inline_cache_reg_encode());
|
Register ic_reg = as_Register(Matcher::inline_cache_reg_encode());
|
||||||
AddressLiteral meta = __ allocate_metadata_address((Metadata *)Universe::non_oop_word());
|
|
||||||
|
|
||||||
|
// Virtual call relocation will point to ic load.
|
||||||
address virtual_call_meta_addr = __ pc();
|
address virtual_call_meta_addr = __ pc();
|
||||||
__ load_const_from_method_toc(ic_reg, meta, Rtoc);
|
// Load a clear inline cache.
|
||||||
|
AddressLiteral empty_ic((address) Universe::non_oop_word());
|
||||||
|
__ load_const_from_method_toc(ic_reg, empty_ic, Rtoc);
|
||||||
// CALL to fixup routine. Fixup routine uses ScopeDesc info
|
// CALL to fixup routine. Fixup routine uses ScopeDesc info
|
||||||
// to determine who we intended to call.
|
// to determine who we intended to call.
|
||||||
__ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
|
__ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr));
|
||||||
@ -3713,7 +3719,6 @@ encode %{
|
|||||||
"Fix constant in ret_addr_offset()");
|
"Fix constant in ret_addr_offset()");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
guarantee(0, "Fix handling of toc edge: messes up derived/base pairs.");
|
|
||||||
Unimplemented(); // ret_addr_offset not yet fixed. Depends on compressed oops (load klass!).
|
Unimplemented(); // ret_addr_offset not yet fixed. Depends on compressed oops (load klass!).
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -5439,7 +5444,7 @@ instruct loadI_ac(iRegIdst dst, memory mem) %{
|
|||||||
ins_pipe(pipe_class_memory);
|
ins_pipe(pipe_class_memory);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// Match loading integer and casting it to unsigned int in
|
// Match loading integer and casting it to unsigned int in
|
||||||
// long register.
|
// long register.
|
||||||
// LoadI + ConvI2L + AndL 0xffffffff.
|
// LoadI + ConvI2L + AndL 0xffffffff.
|
||||||
instruct loadUI2L(iRegLdst dst, memory mem, immL_32bits mask) %{
|
instruct loadUI2L(iRegLdst dst, memory mem, immL_32bits mask) %{
|
||||||
@ -6081,7 +6086,7 @@ instruct loadConNKlass_hi(iRegNdst dst, immNKlass src) %{
|
|||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// This needs a match rule so that build_oop_map knows this is
|
// This needs a match rule so that build_oop_map knows this is
|
||||||
// not a narrow oop.
|
// not a narrow oop.
|
||||||
instruct loadConNKlass_lo(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{
|
instruct loadConNKlass_lo(iRegNdst dst, immNKlass_NM src1, iRegNsrc src2) %{
|
||||||
match(Set dst src1);
|
match(Set dst src1);
|
||||||
@ -6705,7 +6710,7 @@ instruct cond_set_0_oop(iRegNdst dst, flagsReg crx, iRegPsrc src1) %{
|
|||||||
size(4);
|
size(4);
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
// This is a Power7 instruction for which no machine description exists.
|
// This is a Power7 instruction for which no machine description exists.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
__ isel_0($dst$$Register, $crx$$CondRegister, Assembler::equal, $src1$$Register);
|
__ isel_0($dst$$Register, $crx$$CondRegister, Assembler::equal, $src1$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -6850,7 +6855,7 @@ instruct cond_set_0_ptr(iRegPdst dst, flagsReg crx, iRegPsrc src1) %{
|
|||||||
size(4);
|
size(4);
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
// This is a Power7 instruction for which no machine description exists.
|
// This is a Power7 instruction for which no machine description exists.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
__ isel_0($dst$$Register, $crx$$CondRegister, Assembler::equal, $src1$$Register);
|
__ isel_0($dst$$Register, $crx$$CondRegister, Assembler::equal, $src1$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7067,7 +7072,7 @@ instruct decodeNKlass_notNull_addBase_Ex(iRegPdst dst, iRegLsrc base, iRegNsrc s
|
|||||||
n1->_bottom_type = _bottom_type;
|
n1->_bottom_type = _bottom_type;
|
||||||
|
|
||||||
decodeNKlass_shiftNode *n2 = new (C) decodeNKlass_shiftNode();
|
decodeNKlass_shiftNode *n2 = new (C) decodeNKlass_shiftNode();
|
||||||
n2->add_req(n_region, n2);
|
n2->add_req(n_region, n1);
|
||||||
n2->_opnds[0] = op_dst;
|
n2->_opnds[0] = op_dst;
|
||||||
n2->_opnds[1] = op_dst;
|
n2->_opnds[1] = op_dst;
|
||||||
n2->_bottom_type = _bottom_type;
|
n2->_bottom_type = _bottom_type;
|
||||||
@ -7202,7 +7207,7 @@ instruct membar_volatile() %{
|
|||||||
// inline_unsafe_load_store).
|
// inline_unsafe_load_store).
|
||||||
//
|
//
|
||||||
// Add this node again if we found a good solution for inline_unsafe_load_store().
|
// Add this node again if we found a good solution for inline_unsafe_load_store().
|
||||||
// Don't forget to look at the implementation of post_store_load_barrier again,
|
// Don't forget to look at the implementation of post_store_load_barrier again,
|
||||||
// we did other fixes in that method.
|
// we did other fixes in that method.
|
||||||
//instruct unnecessary_membar_volatile() %{
|
//instruct unnecessary_membar_volatile() %{
|
||||||
// match(MemBarVolatile);
|
// match(MemBarVolatile);
|
||||||
@ -7240,7 +7245,7 @@ instruct cmovI_reg_isel(cmpOp cmp, flagsReg crx, iRegIdst dst, iRegIsrc src) %{
|
|||||||
// exists. Anyways, the scheduler should be off on Power7.
|
// exists. Anyways, the scheduler should be off on Power7.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
int cc = $cmp$$cmpcode;
|
int cc = $cmp$$cmpcode;
|
||||||
__ isel($dst$$Register, $crx$$CondRegister,
|
__ isel($dst$$Register, $crx$$CondRegister,
|
||||||
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7286,7 +7291,7 @@ instruct cmovL_reg_isel(cmpOp cmp, flagsReg crx, iRegLdst dst, iRegLsrc src) %{
|
|||||||
// exists. Anyways, the scheduler should be off on Power7.
|
// exists. Anyways, the scheduler should be off on Power7.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
int cc = $cmp$$cmpcode;
|
int cc = $cmp$$cmpcode;
|
||||||
__ isel($dst$$Register, $crx$$CondRegister,
|
__ isel($dst$$Register, $crx$$CondRegister,
|
||||||
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7332,7 +7337,7 @@ instruct cmovN_reg_isel(cmpOp cmp, flagsReg crx, iRegNdst dst, iRegNsrc src) %{
|
|||||||
// exists. Anyways, the scheduler should be off on Power7.
|
// exists. Anyways, the scheduler should be off on Power7.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
int cc = $cmp$$cmpcode;
|
int cc = $cmp$$cmpcode;
|
||||||
__ isel($dst$$Register, $crx$$CondRegister,
|
__ isel($dst$$Register, $crx$$CondRegister,
|
||||||
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7379,7 +7384,7 @@ instruct cmovP_reg_isel(cmpOp cmp, flagsReg crx, iRegPdst dst, iRegPsrc src) %{
|
|||||||
// exists. Anyways, the scheduler should be off on Power7.
|
// exists. Anyways, the scheduler should be off on Power7.
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
int cc = $cmp$$cmpcode;
|
int cc = $cmp$$cmpcode;
|
||||||
__ isel($dst$$Register, $crx$$CondRegister,
|
__ isel($dst$$Register, $crx$$CondRegister,
|
||||||
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
(Assembler::Condition)(cc & 3), /*invert*/((~cc) & 8), $src$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7525,8 +7530,8 @@ instruct compareAndSwapI_regP_regI_regI(iRegIdst res, iRegPdst mem_ptr, iRegIsrc
|
|||||||
ins_encode %{
|
ins_encode %{
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
|
// CmpxchgX sets CCR0 to cmpX(src1, src2) and Rres to 'true'/'false'.
|
||||||
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
|
__ cmpxchgw(CCR0, R0, $src1$$Register, $src2$$Register, $mem_ptr$$Register,
|
||||||
MacroAssembler::MemBarFenceAfter, MacroAssembler::cmpxchgx_hint_atomic_update(),
|
MacroAssembler::MemBarFenceAfter, MacroAssembler::cmpxchgx_hint_atomic_update(),
|
||||||
$res$$Register, true);
|
$res$$Register, true);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -7932,7 +7937,23 @@ instruct subL_reg_imm16(iRegLdst dst, iRegLsrc src1, immL16 src2) %{
|
|||||||
|
|
||||||
// Turn the sign-bit of a long into a 64-bit mask, 0x0...0 for
|
// Turn the sign-bit of a long into a 64-bit mask, 0x0...0 for
|
||||||
// positive longs and 0xF...F for negative ones.
|
// positive longs and 0xF...F for negative ones.
|
||||||
instruct signmask64I_regI(iRegIdst dst, iRegIsrc src) %{
|
instruct signmask64I_regL(iRegIdst dst, iRegLsrc src) %{
|
||||||
|
// no match-rule, false predicate
|
||||||
|
effect(DEF dst, USE src);
|
||||||
|
predicate(false);
|
||||||
|
|
||||||
|
format %{ "SRADI $dst, $src, #63" %}
|
||||||
|
size(4);
|
||||||
|
ins_encode %{
|
||||||
|
// TODO: PPC port $archOpcode(ppc64Opcode_sradi);
|
||||||
|
__ sradi($dst$$Register, $src$$Register, 0x3f);
|
||||||
|
%}
|
||||||
|
ins_pipe(pipe_class_default);
|
||||||
|
%}
|
||||||
|
|
||||||
|
// Turn the sign-bit of a long into a 64-bit mask, 0x0...0 for
|
||||||
|
// positive longs and 0xF...F for negative ones.
|
||||||
|
instruct signmask64L_regL(iRegLdst dst, iRegLsrc src) %{
|
||||||
// no match-rule, false predicate
|
// no match-rule, false predicate
|
||||||
effect(DEF dst, USE src);
|
effect(DEF dst, USE src);
|
||||||
predicate(false);
|
predicate(false);
|
||||||
@ -8896,7 +8917,7 @@ instruct andI_reg_immIpowerOf2(iRegIdst dst, iRegIsrc src1, immIpowerOf2 src2) %
|
|||||||
size(4);
|
size(4);
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_rlwinm);
|
// TODO: PPC port $archOpcode(ppc64Opcode_rlwinm);
|
||||||
__ rlwinm($dst$$Register, $src1$$Register, 0,
|
__ rlwinm($dst$$Register, $src1$$Register, 0,
|
||||||
(31-log2_long((jlong) $src2$$constant)) & 0x1f, (31-log2_long((jlong) $src2$$constant)) & 0x1f);
|
(31-log2_long((jlong) $src2$$constant)) & 0x1f, (31-log2_long((jlong) $src2$$constant)) & 0x1f);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -9622,14 +9643,14 @@ instruct cmpLTMask_reg_reg_Ex(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{
|
|||||||
ins_cost(DEFAULT_COST*4);
|
ins_cost(DEFAULT_COST*4);
|
||||||
|
|
||||||
expand %{
|
expand %{
|
||||||
iRegIdst src1s;
|
iRegLdst src1s;
|
||||||
iRegIdst src2s;
|
iRegLdst src2s;
|
||||||
iRegIdst diff;
|
iRegLdst diff;
|
||||||
sxtI_reg(src1s, src1); // ensure proper sign extention
|
convI2L_reg(src1s, src1); // Ensure proper sign extension.
|
||||||
sxtI_reg(src2s, src2); // ensure proper sign extention
|
convI2L_reg(src2s, src2); // Ensure proper sign extension.
|
||||||
subI_reg_reg(diff, src1s, src2s);
|
subL_reg_reg(diff, src1s, src2s);
|
||||||
// Need to consider >=33 bit result, therefore we need signmaskL.
|
// Need to consider >=33 bit result, therefore we need signmaskL.
|
||||||
signmask64I_regI(dst, diff);
|
signmask64I_regL(dst, diff);
|
||||||
%}
|
%}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -10866,7 +10887,7 @@ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P supe
|
|||||||
format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
|
format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %}
|
||||||
ins_encode %{
|
ins_encode %{
|
||||||
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
// TODO: PPC port $archOpcode(ppc64Opcode_compound);
|
||||||
__ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
|
__ check_klass_subtype_slow_path($subklass$$Register, $superklass$$Register, $tmp_arrayptr$$Register,
|
||||||
$tmp_klass$$Register, NULL, $result$$Register);
|
$tmp_klass$$Register, NULL, $result$$Register);
|
||||||
%}
|
%}
|
||||||
ins_pipe(pipe_class_default);
|
ins_pipe(pipe_class_default);
|
||||||
@ -11181,18 +11202,18 @@ instruct minI_reg_reg_Ex(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{
|
|||||||
ins_cost(DEFAULT_COST*6);
|
ins_cost(DEFAULT_COST*6);
|
||||||
|
|
||||||
expand %{
|
expand %{
|
||||||
iRegIdst src1s;
|
iRegLdst src1s;
|
||||||
iRegIdst src2s;
|
iRegLdst src2s;
|
||||||
iRegIdst diff;
|
iRegLdst diff;
|
||||||
iRegIdst sm;
|
iRegLdst sm;
|
||||||
iRegIdst doz; // difference or zero
|
iRegLdst doz; // difference or zero
|
||||||
sxtI_reg(src1s, src1); // Ensure proper sign extention.
|
convI2L_reg(src1s, src1); // Ensure proper sign extension.
|
||||||
sxtI_reg(src2s, src2); // Ensure proper sign extention.
|
convI2L_reg(src2s, src2); // Ensure proper sign extension.
|
||||||
subI_reg_reg(diff, src2s, src1s);
|
subL_reg_reg(diff, src2s, src1s);
|
||||||
// Need to consider >=33 bit result, therefore we need signmaskL.
|
// Need to consider >=33 bit result, therefore we need signmaskL.
|
||||||
signmask64I_regI(sm, diff);
|
signmask64L_regL(sm, diff);
|
||||||
andI_reg_reg(doz, diff, sm); // <=0
|
andL_reg_reg(doz, diff, sm); // <=0
|
||||||
addI_reg_reg(dst, doz, src1s);
|
addI_regL_regL(dst, doz, src1s);
|
||||||
%}
|
%}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -11201,19 +11222,18 @@ instruct maxI_reg_reg_Ex(iRegIdst dst, iRegIsrc src1, iRegIsrc src2) %{
|
|||||||
ins_cost(DEFAULT_COST*6);
|
ins_cost(DEFAULT_COST*6);
|
||||||
|
|
||||||
expand %{
|
expand %{
|
||||||
immI_minus1 m1 %{ -1 %}
|
iRegLdst src1s;
|
||||||
iRegIdst src1s;
|
iRegLdst src2s;
|
||||||
iRegIdst src2s;
|
iRegLdst diff;
|
||||||
iRegIdst diff;
|
iRegLdst sm;
|
||||||
iRegIdst sm;
|
iRegLdst doz; // difference or zero
|
||||||
iRegIdst doz; // difference or zero
|
convI2L_reg(src1s, src1); // Ensure proper sign extension.
|
||||||
sxtI_reg(src1s, src1); // Ensure proper sign extention.
|
convI2L_reg(src2s, src2); // Ensure proper sign extension.
|
||||||
sxtI_reg(src2s, src2); // Ensure proper sign extention.
|
subL_reg_reg(diff, src2s, src1s);
|
||||||
subI_reg_reg(diff, src2s, src1s);
|
|
||||||
// Need to consider >=33 bit result, therefore we need signmaskL.
|
// Need to consider >=33 bit result, therefore we need signmaskL.
|
||||||
signmask64I_regI(sm, diff);
|
signmask64L_regL(sm, diff);
|
||||||
andcI_reg_reg(doz, sm, m1, diff); // >=0
|
andcL_reg_reg(doz, diff, sm); // >=0
|
||||||
addI_reg_reg(dst, doz, src1s);
|
addI_regL_regL(dst, doz, src1s);
|
||||||
%}
|
%}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
@ -81,24 +81,18 @@ address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(con
|
|||||||
#if 0
|
#if 0
|
||||||
// Call special ClassCastException constructor taking object to cast
|
// Call special ClassCastException constructor taking object to cast
|
||||||
// and target class as arguments.
|
// and target class as arguments.
|
||||||
address TemplateInterpreterGenerator::generate_ClassCastException_verbose_handler(const char* name) {
|
address TemplateInterpreterGenerator::generate_ClassCastException_verbose_handler() {
|
||||||
address entry = __ pc();
|
address entry = __ pc();
|
||||||
|
|
||||||
// Target class oop is in register R6_ARG4 by convention!
|
|
||||||
|
|
||||||
// Expression stack must be empty before entering the VM if an
|
// Expression stack must be empty before entering the VM if an
|
||||||
// exception happened.
|
// exception happened.
|
||||||
__ empty_expression_stack();
|
__ empty_expression_stack();
|
||||||
// Setup parameters.
|
|
||||||
// Thread will be loaded to R3_ARG1.
|
// Thread will be loaded to R3_ARG1.
|
||||||
__ load_const_optimized(R4_ARG2, (address) name);
|
// Target class oop is in register R5_ARG3 by convention!
|
||||||
__ mr(R5_ARG3, R17_tos);
|
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose, R17_tos, R5_ARG3));
|
||||||
// R6_ARG4 contains specified class.
|
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose));
|
|
||||||
#ifdef ASSERT
|
|
||||||
// Above call must not return here since exception pending.
|
// Above call must not return here since exception pending.
|
||||||
__ should_not_reach_here();
|
DEBUG_ONLY(__ should_not_reach_here();)
|
||||||
#endif
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1538,14 +1532,32 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|||||||
__ stw(R0, in_bytes(JavaThread::popframe_condition_offset()), R16_thread);
|
__ stw(R0, in_bytes(JavaThread::popframe_condition_offset()), R16_thread);
|
||||||
|
|
||||||
// Get out of the current method and re-execute the call that called us.
|
// Get out of the current method and re-execute the call that called us.
|
||||||
__ merge_frames(/*top_frame_sp*/ R21_sender_SP, /*return_pc*/ return_pc, R11_scratch1, R12_scratch2);
|
__ merge_frames(/*top_frame_sp*/ R21_sender_SP, /*return_pc*/ noreg, R11_scratch1, R12_scratch2);
|
||||||
__ restore_interpreter_state(R11_scratch1);
|
__ restore_interpreter_state(R11_scratch1);
|
||||||
__ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1);
|
__ ld(R12_scratch2, _ijava_state_neg(top_frame_sp), R11_scratch1);
|
||||||
__ resize_frame_absolute(R12_scratch2, R11_scratch1, R0);
|
__ resize_frame_absolute(R12_scratch2, R11_scratch1, R0);
|
||||||
__ mtlr(return_pc);
|
|
||||||
if (ProfileInterpreter) {
|
if (ProfileInterpreter) {
|
||||||
__ set_method_data_pointer_for_bcp();
|
__ set_method_data_pointer_for_bcp();
|
||||||
}
|
}
|
||||||
|
#if INCLUDE_JVMTI
|
||||||
|
Label L_done;
|
||||||
|
|
||||||
|
__ lbz(R11_scratch1, 0, R14_bcp);
|
||||||
|
__ cmpwi(CCR0, R11_scratch1, Bytecodes::_invokestatic);
|
||||||
|
__ bne(CCR0, L_done);
|
||||||
|
|
||||||
|
// The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
|
||||||
|
// Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
|
||||||
|
__ ld(R4_ARG2, 0, R18_locals);
|
||||||
|
__ call_VM(R11_scratch1, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null),
|
||||||
|
R4_ARG2, R19_method, R14_bcp);
|
||||||
|
|
||||||
|
__ cmpdi(CCR0, R11_scratch1, 0);
|
||||||
|
__ beq(CCR0, L_done);
|
||||||
|
|
||||||
|
__ std(R11_scratch1, wordSize, R15_esp);
|
||||||
|
__ bind(L_done);
|
||||||
|
#endif // INCLUDE_JVMTI
|
||||||
__ dispatch_next(vtos);
|
__ dispatch_next(vtos);
|
||||||
}
|
}
|
||||||
// end of JVMTI PopFrame support
|
// end of JVMTI PopFrame support
|
||||||
|
@ -64,7 +64,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
assert_different_registers(Rtmp1, Rtmp2, Rtmp3, Rval, Rbase);
|
assert_different_registers(Rtmp1, Rtmp2, Rtmp3, Rval, Rbase);
|
||||||
|
|
||||||
switch (barrier) {
|
switch (barrier) {
|
||||||
#ifndef SERIALGC
|
#if INCLUDE_ALL_GCS
|
||||||
case BarrierSet::G1SATBCT:
|
case BarrierSet::G1SATBCT:
|
||||||
case BarrierSet::G1SATBCTLogging:
|
case BarrierSet::G1SATBCTLogging:
|
||||||
{
|
{
|
||||||
@ -104,7 +104,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
|||||||
__ bind(Ldone);
|
__ bind(Ldone);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // SERIALGC
|
#endif // INCLUDE_ALL_GCS
|
||||||
case BarrierSet::CardTableModRef:
|
case BarrierSet::CardTableModRef:
|
||||||
case BarrierSet::CardTableExtension:
|
case BarrierSet::CardTableExtension:
|
||||||
{
|
{
|
||||||
@ -259,17 +259,17 @@ void TemplateTable::fconst(int value) {
|
|||||||
switch (value) {
|
switch (value) {
|
||||||
default: ShouldNotReachHere();
|
default: ShouldNotReachHere();
|
||||||
case 0: {
|
case 0: {
|
||||||
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&zero, R0);
|
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&zero, R0, true);
|
||||||
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&one, R0);
|
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&one, R0, true);
|
||||||
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&two, R0);
|
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&two, R0, true);
|
||||||
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
__ lfs(F15_ftos, simm16_offset, R11_scratch1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -282,12 +282,12 @@ void TemplateTable::dconst(int value) {
|
|||||||
static double one = 1.0;
|
static double one = 1.0;
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case 0: {
|
case 0: {
|
||||||
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&zero, R0);
|
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&zero, R0, true);
|
||||||
__ lfd(F15_ftos, simm16_offset, R11_scratch1);
|
__ lfd(F15_ftos, simm16_offset, R11_scratch1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&one, R0);
|
int simm16_offset = __ load_const_optimized(R11_scratch1, (address*)&one, R0, true);
|
||||||
__ lfd(F15_ftos, simm16_offset, R11_scratch1);
|
__ lfd(F15_ftos, simm16_offset, R11_scratch1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3453,16 +3453,6 @@ void TemplateTable::invokedynamic(int byte_no) {
|
|||||||
Rscratch1 = R11_scratch1,
|
Rscratch1 = R11_scratch1,
|
||||||
Rscratch2 = R12_scratch2;
|
Rscratch2 = R12_scratch2;
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// We should not encounter this bytecode if !EnableInvokeDynamic.
|
|
||||||
// The verifier will stop it. However, if we get past the verifier,
|
|
||||||
// this will stop the thread in a reasonable way, without crashing the JVM.
|
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeError));
|
|
||||||
// The call_VM checks for exception, so we should never return here.
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, noreg, Rflags, Rscratch2);
|
prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, noreg, Rflags, Rscratch2);
|
||||||
|
|
||||||
// Profile this call.
|
// Profile this call.
|
||||||
@ -3486,12 +3476,6 @@ void TemplateTable::invokehandle(int byte_no) {
|
|||||||
Rscratch1 = R11_scratch1,
|
Rscratch1 = R11_scratch1,
|
||||||
Rscratch2 = R12_scratch2;
|
Rscratch2 = R12_scratch2;
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// Rewriter does not generate this bytecode.
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, Rrecv, Rflags, Rscratch2);
|
prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, Rrecv, Rflags, Rscratch2);
|
||||||
__ verify_method_ptr(Rmethod);
|
__ verify_method_ptr(Rmethod);
|
||||||
__ null_check_throw(Rrecv, -1, Rscratch2);
|
__ null_check_throw(Rrecv, -1, Rscratch2);
|
||||||
@ -3728,9 +3712,9 @@ void TemplateTable::checkcast() {
|
|||||||
transition(atos, atos);
|
transition(atos, atos);
|
||||||
|
|
||||||
Label Ldone, Lis_null, Lquicked, Lresolved;
|
Label Ldone, Lis_null, Lquicked, Lresolved;
|
||||||
Register Roffset = R5_ARG3,
|
Register Roffset = R6_ARG4,
|
||||||
RobjKlass = R4_ARG2,
|
RobjKlass = R4_ARG2,
|
||||||
RspecifiedKlass = R6_ARG4, // Generate_ClassCastException_verbose_handler will expect this register.
|
RspecifiedKlass = R5_ARG3, // Generate_ClassCastException_verbose_handler will read value from this register.
|
||||||
Rcpool = R11_scratch1,
|
Rcpool = R11_scratch1,
|
||||||
Rtags = R12_scratch2;
|
Rtags = R12_scratch2;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* 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
|
||||||
@ -123,8 +123,13 @@ class Assembler : public AbstractAssembler {
|
|||||||
fpop2_op3 = 0x35,
|
fpop2_op3 = 0x35,
|
||||||
impdep1_op3 = 0x36,
|
impdep1_op3 = 0x36,
|
||||||
aes3_op3 = 0x36,
|
aes3_op3 = 0x36,
|
||||||
|
alignaddr_op3 = 0x36,
|
||||||
|
faligndata_op3 = 0x36,
|
||||||
flog3_op3 = 0x36,
|
flog3_op3 = 0x36,
|
||||||
|
edge_op3 = 0x36,
|
||||||
|
fsrc_op3 = 0x36,
|
||||||
impdep2_op3 = 0x37,
|
impdep2_op3 = 0x37,
|
||||||
|
stpartialf_op3 = 0x37,
|
||||||
jmpl_op3 = 0x38,
|
jmpl_op3 = 0x38,
|
||||||
rett_op3 = 0x39,
|
rett_op3 = 0x39,
|
||||||
trap_op3 = 0x3a,
|
trap_op3 = 0x3a,
|
||||||
@ -175,17 +180,23 @@ class Assembler : public AbstractAssembler {
|
|||||||
|
|
||||||
enum opfs {
|
enum opfs {
|
||||||
// selected opfs
|
// selected opfs
|
||||||
|
edge8n_opf = 0x01,
|
||||||
|
|
||||||
fmovs_opf = 0x01,
|
fmovs_opf = 0x01,
|
||||||
fmovd_opf = 0x02,
|
fmovd_opf = 0x02,
|
||||||
|
|
||||||
fnegs_opf = 0x05,
|
fnegs_opf = 0x05,
|
||||||
fnegd_opf = 0x06,
|
fnegd_opf = 0x06,
|
||||||
|
|
||||||
|
alignaddr_opf = 0x18,
|
||||||
|
|
||||||
fadds_opf = 0x41,
|
fadds_opf = 0x41,
|
||||||
faddd_opf = 0x42,
|
faddd_opf = 0x42,
|
||||||
fsubs_opf = 0x45,
|
fsubs_opf = 0x45,
|
||||||
fsubd_opf = 0x46,
|
fsubd_opf = 0x46,
|
||||||
|
|
||||||
|
faligndata_opf = 0x48,
|
||||||
|
|
||||||
fmuls_opf = 0x49,
|
fmuls_opf = 0x49,
|
||||||
fmuld_opf = 0x4a,
|
fmuld_opf = 0x4a,
|
||||||
fdivs_opf = 0x4d,
|
fdivs_opf = 0x4d,
|
||||||
@ -348,6 +359,8 @@ class Assembler : public AbstractAssembler {
|
|||||||
ASI_PRIMARY = 0x80,
|
ASI_PRIMARY = 0x80,
|
||||||
ASI_PRIMARY_NOFAULT = 0x82,
|
ASI_PRIMARY_NOFAULT = 0x82,
|
||||||
ASI_PRIMARY_LITTLE = 0x88,
|
ASI_PRIMARY_LITTLE = 0x88,
|
||||||
|
// 8x8-bit partial store
|
||||||
|
ASI_PST8_PRIMARY = 0xC0,
|
||||||
// Block initializing store
|
// Block initializing store
|
||||||
ASI_ST_BLKINIT_PRIMARY = 0xE2,
|
ASI_ST_BLKINIT_PRIMARY = 0xE2,
|
||||||
// Most-Recently-Used (MRU) BIS variant
|
// Most-Recently-Used (MRU) BIS variant
|
||||||
@ -585,6 +598,9 @@ class Assembler : public AbstractAssembler {
|
|||||||
// instruction only in VIS1
|
// instruction only in VIS1
|
||||||
static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
|
static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
|
||||||
|
|
||||||
|
// instruction only in VIS2
|
||||||
|
static void vis2_only() { assert( VM_Version::has_vis2(), "This instruction only works on SPARC with VIS2"); }
|
||||||
|
|
||||||
// instruction only in VIS3
|
// instruction only in VIS3
|
||||||
static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
|
static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
|
||||||
|
|
||||||
@ -1164,6 +1180,20 @@ public:
|
|||||||
inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
|
inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
|
||||||
|
|
||||||
|
|
||||||
|
// VIS1 instructions
|
||||||
|
|
||||||
|
void alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); }
|
||||||
|
|
||||||
|
void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); }
|
||||||
|
|
||||||
|
void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); }
|
||||||
|
|
||||||
|
void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); }
|
||||||
|
|
||||||
|
// VIS2 instructions
|
||||||
|
|
||||||
|
void edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); }
|
||||||
|
|
||||||
// VIS3 instructions
|
// VIS3 instructions
|
||||||
|
|
||||||
void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||||
|
@ -259,8 +259,8 @@
|
|||||||
|
|
||||||
// next two fns read and write Lmonitors value,
|
// next two fns read and write Lmonitors value,
|
||||||
private:
|
private:
|
||||||
BasicObjectLock* interpreter_frame_monitors() const { return *interpreter_frame_monitors_addr(); }
|
BasicObjectLock* interpreter_frame_monitors() const;
|
||||||
void interpreter_frame_set_monitors(BasicObjectLock* monitors) { *interpreter_frame_monitors_addr() = monitors; }
|
void interpreter_frame_set_monitors(BasicObjectLock* monitors);
|
||||||
#else
|
#else
|
||||||
public:
|
public:
|
||||||
inline interpreterState get_interpreterState() const {
|
inline interpreterState get_interpreterState() const {
|
||||||
|
@ -226,6 +226,13 @@ inline Method** frame::interpreter_frame_method_addr() const {
|
|||||||
return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window());
|
return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline BasicObjectLock* frame::interpreter_frame_monitors() const {
|
||||||
|
return *interpreter_frame_monitors_addr();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) {
|
||||||
|
*interpreter_frame_monitors_addr() = monitors;
|
||||||
|
}
|
||||||
|
|
||||||
// Constant pool cache
|
// Constant pool cache
|
||||||
|
|
||||||
|
@ -727,7 +727,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register temp, Register i
|
|||||||
if (index_size == sizeof(u2)) {
|
if (index_size == sizeof(u2)) {
|
||||||
get_2_byte_integer_at_bcp(bcp_offset, temp, index, Unsigned);
|
get_2_byte_integer_at_bcp(bcp_offset, temp, index, Unsigned);
|
||||||
} else if (index_size == sizeof(u4)) {
|
} else if (index_size == sizeof(u4)) {
|
||||||
assert(EnableInvokeDynamic, "giant index used only for JSR 292");
|
|
||||||
get_4_byte_integer_at_bcp(bcp_offset, temp, index);
|
get_4_byte_integer_at_bcp(bcp_offset, temp, index);
|
||||||
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
|
assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
|
||||||
xor3(index, -1, index); // convert to plain index
|
xor3(index, -1, index); // convert to plain index
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@ static bool returns_to_call_stub(address return_pc) {
|
|||||||
enum /* platform_dependent_constants */ {
|
enum /* platform_dependent_constants */ {
|
||||||
// %%%%%%%% May be able to shrink this a lot
|
// %%%%%%%% May be able to shrink this a lot
|
||||||
code_size1 = 20000, // simply increase if too small (assembler will crash if too small)
|
code_size1 = 20000, // simply increase if too small (assembler will crash if too small)
|
||||||
code_size2 = 20000 // simply increase if too small (assembler will crash if too small)
|
code_size2 = 22000 // simply increase if too small (assembler will crash if too small)
|
||||||
};
|
};
|
||||||
|
|
||||||
class Sparc {
|
class Sparc {
|
||||||
|
@ -1888,7 +1888,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if INCLUDE_JVMTI
|
#if INCLUDE_JVMTI
|
||||||
if (EnableInvokeDynamic) {
|
{
|
||||||
Label L_done;
|
Label L_done;
|
||||||
|
|
||||||
__ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode
|
__ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode
|
||||||
|
@ -3209,12 +3209,6 @@ void TemplateTable::invokehandle(int byte_no) {
|
|||||||
transition(vtos, vtos);
|
transition(vtos, vtos);
|
||||||
assert(byte_no == f1_byte, "use this argument");
|
assert(byte_no == f1_byte, "use this argument");
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// rewriter does not generate this bytecode
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Register Rret = Lscratch;
|
const Register Rret = Lscratch;
|
||||||
const Register G4_mtype = G4_scratch;
|
const Register G4_mtype = G4_scratch;
|
||||||
const Register O0_recv = O0;
|
const Register O0_recv = O0;
|
||||||
@ -3240,17 +3234,6 @@ void TemplateTable::invokedynamic(int byte_no) {
|
|||||||
transition(vtos, vtos);
|
transition(vtos, vtos);
|
||||||
assert(byte_no == f1_byte, "use this argument");
|
assert(byte_no == f1_byte, "use this argument");
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// We should not encounter this bytecode if !EnableInvokeDynamic.
|
|
||||||
// The verifier will stop it. However, if we get past the verifier,
|
|
||||||
// this will stop the thread in a reasonable way, without crashing the JVM.
|
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
|
|
||||||
InterpreterRuntime::throw_IncompatibleClassChangeError));
|
|
||||||
// the call_VM checks for exception, so we should never return here.
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Register Rret = Lscratch;
|
const Register Rret = Lscratch;
|
||||||
const Register G4_callsite = G4_scratch;
|
const Register G4_callsite = G4_scratch;
|
||||||
const Register Rscratch = G3_scratch;
|
const Register Rscratch = G3_scratch;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* 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
|
||||||
@ -266,9 +266,9 @@ void VM_Version::initialize() {
|
|||||||
if (!has_vis1()) // Drop to 0 if no VIS1 support
|
if (!has_vis1()) // Drop to 0 if no VIS1 support
|
||||||
UseVIS = 0;
|
UseVIS = 0;
|
||||||
|
|
||||||
// T2 and above should have support for AES instructions
|
// SPARC T4 and above should have support for AES instructions
|
||||||
if (has_aes()) {
|
if (has_aes()) {
|
||||||
if (UseVIS > 0) { // AES intrinsics use FXOR instruction which is VIS1
|
if (UseVIS > 2) { // AES intrinsics use MOVxTOd/MOVdTOx which are VIS3
|
||||||
if (FLAG_IS_DEFAULT(UseAES)) {
|
if (FLAG_IS_DEFAULT(UseAES)) {
|
||||||
FLAG_SET_DEFAULT(UseAES, true);
|
FLAG_SET_DEFAULT(UseAES, true);
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ void VM_Version::initialize() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (UseAES || UseAESIntrinsics) {
|
if (UseAES || UseAESIntrinsics) {
|
||||||
warning("SPARC AES intrinsics require VIS1 instruction support. Intrinsics will be disabled.");
|
warning("SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled.");
|
||||||
if (UseAES) {
|
if (UseAES) {
|
||||||
FLAG_SET_DEFAULT(UseAES, false);
|
FLAG_SET_DEFAULT(UseAES, false);
|
||||||
}
|
}
|
||||||
|
@ -1766,7 +1766,7 @@ void Assembler::movdqu(Address dst, XMMRegister src) {
|
|||||||
|
|
||||||
// Move Unaligned 256bit Vector
|
// Move Unaligned 256bit Vector
|
||||||
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
|
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
|
||||||
assert(UseAVX, "");
|
assert(UseAVX > 0, "");
|
||||||
bool vector256 = true;
|
bool vector256 = true;
|
||||||
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
|
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
|
||||||
emit_int8(0x6F);
|
emit_int8(0x6F);
|
||||||
@ -1774,7 +1774,7 @@ void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Assembler::vmovdqu(XMMRegister dst, Address src) {
|
void Assembler::vmovdqu(XMMRegister dst, Address src) {
|
||||||
assert(UseAVX, "");
|
assert(UseAVX > 0, "");
|
||||||
InstructionMark im(this);
|
InstructionMark im(this);
|
||||||
bool vector256 = true;
|
bool vector256 = true;
|
||||||
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
|
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
|
||||||
@ -1783,7 +1783,7 @@ void Assembler::vmovdqu(XMMRegister dst, Address src) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Assembler::vmovdqu(Address dst, XMMRegister src) {
|
void Assembler::vmovdqu(Address dst, XMMRegister src) {
|
||||||
assert(UseAVX, "");
|
assert(UseAVX > 0, "");
|
||||||
InstructionMark im(this);
|
InstructionMark im(this);
|
||||||
bool vector256 = true;
|
bool vector256 = true;
|
||||||
// swap src<->dst for encoding
|
// swap src<->dst for encoding
|
||||||
|
@ -207,7 +207,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_off
|
|||||||
if (index_size == sizeof(u2)) {
|
if (index_size == sizeof(u2)) {
|
||||||
load_unsigned_short(reg, Address(rsi, bcp_offset));
|
load_unsigned_short(reg, Address(rsi, bcp_offset));
|
||||||
} else if (index_size == sizeof(u4)) {
|
} else if (index_size == sizeof(u4)) {
|
||||||
assert(EnableInvokeDynamic, "giant index used only for JSR 292");
|
|
||||||
movl(reg, Address(rsi, bcp_offset));
|
movl(reg, Address(rsi, bcp_offset));
|
||||||
// Check if the secondary index definition is still ~x, otherwise
|
// Check if the secondary index definition is still ~x, otherwise
|
||||||
// we have to change the following assembler code to calculate the
|
// we have to change the following assembler code to calculate the
|
||||||
|
@ -205,7 +205,6 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index,
|
|||||||
if (index_size == sizeof(u2)) {
|
if (index_size == sizeof(u2)) {
|
||||||
load_unsigned_short(index, Address(r13, bcp_offset));
|
load_unsigned_short(index, Address(r13, bcp_offset));
|
||||||
} else if (index_size == sizeof(u4)) {
|
} else if (index_size == sizeof(u4)) {
|
||||||
assert(EnableInvokeDynamic, "giant index used only for JSR 292");
|
|
||||||
movl(index, Address(r13, bcp_offset));
|
movl(index, Address(r13, bcp_offset));
|
||||||
// Check if the secondary index definition is still ~x, otherwise
|
// Check if the secondary index definition is still ~x, otherwise
|
||||||
// we have to change the following assembler code to calculate the
|
// we have to change the following assembler code to calculate the
|
||||||
|
@ -26,8 +26,14 @@
|
|||||||
#ifndef _JAVASOFT_JNI_MD_H_
|
#ifndef _JAVASOFT_JNI_MD_H_
|
||||||
#define _JAVASOFT_JNI_MD_H_
|
#define _JAVASOFT_JNI_MD_H_
|
||||||
|
|
||||||
#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE)
|
#if defined(_WIN32)
|
||||||
|
#define JNIEXPORT __declspec(dllexport)
|
||||||
|
#define JNIIMPORT __declspec(dllimport)
|
||||||
|
#define JNICALL __stdcall
|
||||||
|
|
||||||
|
typedef int jint;
|
||||||
|
typedef __int64 jlong;
|
||||||
|
#else
|
||||||
|
|
||||||
// Note: please do not change these without also changing jni_md.h in the JDK
|
// Note: please do not change these without also changing jni_md.h in the JDK
|
||||||
// repository
|
// repository
|
||||||
@ -50,13 +56,6 @@
|
|||||||
typedef long long jlong;
|
typedef long long jlong;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
#define JNIEXPORT __declspec(dllexport)
|
|
||||||
#define JNIIMPORT __declspec(dllimport)
|
|
||||||
#define JNICALL __stdcall
|
|
||||||
|
|
||||||
typedef int jint;
|
|
||||||
typedef __int64 jlong;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef signed char jbyte;
|
typedef signed char jbyte;
|
||||||
|
@ -3152,10 +3152,12 @@ void MacroAssembler::fast_pow() {
|
|||||||
// if fast computation is not possible, result is NaN. Requires
|
// if fast computation is not possible, result is NaN. Requires
|
||||||
// fallback from user of this macro.
|
// fallback from user of this macro.
|
||||||
// increase precision for intermediate steps of the computation
|
// increase precision for intermediate steps of the computation
|
||||||
|
BLOCK_COMMENT("fast_pow {");
|
||||||
increase_precision();
|
increase_precision();
|
||||||
fyl2x(); // Stack: (Y*log2(X)) ...
|
fyl2x(); // Stack: (Y*log2(X)) ...
|
||||||
pow_exp_core_encoding(); // Stack: exp(X) ...
|
pow_exp_core_encoding(); // Stack: exp(X) ...
|
||||||
restore_precision();
|
restore_precision();
|
||||||
|
BLOCK_COMMENT("} fast_pow");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacroAssembler::fast_exp() {
|
void MacroAssembler::fast_exp() {
|
||||||
|
@ -76,12 +76,7 @@ void AbstractInterpreter::layout_activation(Method* method,
|
|||||||
Interpreter::stackElementWords;
|
Interpreter::stackElementWords;
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
if (!EnableInvokeDynamic) {
|
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
|
||||||
// @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
|
|
||||||
// Probably, since deoptimization doesn't work yet.
|
|
||||||
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
|
|
||||||
}
|
|
||||||
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
interpreter_frame->interpreter_frame_set_method(method);
|
interpreter_frame->interpreter_frame_set_method(method);
|
||||||
|
@ -1831,7 +1831,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|||||||
__ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
|
__ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
|
||||||
|
|
||||||
#if INCLUDE_JVMTI
|
#if INCLUDE_JVMTI
|
||||||
if (EnableInvokeDynamic) {
|
{
|
||||||
Label L_done;
|
Label L_done;
|
||||||
const Register local0 = rdi;
|
const Register local0 = rdi;
|
||||||
|
|
||||||
|
@ -1848,7 +1848,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|||||||
JavaThread::popframe_inactive);
|
JavaThread::popframe_inactive);
|
||||||
|
|
||||||
#if INCLUDE_JVMTI
|
#if INCLUDE_JVMTI
|
||||||
if (EnableInvokeDynamic) {
|
{
|
||||||
Label L_done;
|
Label L_done;
|
||||||
const Register local0 = r14;
|
const Register local0 = r14;
|
||||||
|
|
||||||
|
@ -3128,12 +3128,6 @@ void TemplateTable::invokehandle(int byte_no) {
|
|||||||
const Register rcx_recv = rcx;
|
const Register rcx_recv = rcx;
|
||||||
const Register rdx_flags = rdx;
|
const Register rdx_flags = rdx;
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// rewriter does not generate this bytecode
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
|
prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
|
||||||
__ verify_method_ptr(rbx_method);
|
__ verify_method_ptr(rbx_method);
|
||||||
__ verify_oop(rcx_recv);
|
__ verify_oop(rcx_recv);
|
||||||
@ -3156,17 +3150,6 @@ void TemplateTable::invokedynamic(int byte_no) {
|
|||||||
transition(vtos, vtos);
|
transition(vtos, vtos);
|
||||||
assert(byte_no == f1_byte, "use this argument");
|
assert(byte_no == f1_byte, "use this argument");
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// We should not encounter this bytecode if !EnableInvokeDynamic.
|
|
||||||
// The verifier will stop it. However, if we get past the verifier,
|
|
||||||
// this will stop the thread in a reasonable way, without crashing the JVM.
|
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
|
|
||||||
InterpreterRuntime::throw_IncompatibleClassChangeError));
|
|
||||||
// the call_VM checks for exception, so we should never return here.
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Register rbx_method = rbx;
|
const Register rbx_method = rbx;
|
||||||
const Register rax_callsite = rax;
|
const Register rax_callsite = rax;
|
||||||
|
|
||||||
|
@ -3179,12 +3179,6 @@ void TemplateTable::invokehandle(int byte_no) {
|
|||||||
const Register rcx_recv = rcx;
|
const Register rcx_recv = rcx;
|
||||||
const Register rdx_flags = rdx;
|
const Register rdx_flags = rdx;
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// rewriter does not generate this bytecode
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
|
prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
|
||||||
__ verify_method_ptr(rbx_method);
|
__ verify_method_ptr(rbx_method);
|
||||||
__ verify_oop(rcx_recv);
|
__ verify_oop(rcx_recv);
|
||||||
@ -3207,17 +3201,6 @@ void TemplateTable::invokedynamic(int byte_no) {
|
|||||||
transition(vtos, vtos);
|
transition(vtos, vtos);
|
||||||
assert(byte_no == f1_byte, "use this argument");
|
assert(byte_no == f1_byte, "use this argument");
|
||||||
|
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
// We should not encounter this bytecode if !EnableInvokeDynamic.
|
|
||||||
// The verifier will stop it. However, if we get past the verifier,
|
|
||||||
// this will stop the thread in a reasonable way, without crashing the JVM.
|
|
||||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
|
|
||||||
InterpreterRuntime::throw_IncompatibleClassChangeError));
|
|
||||||
// the call_VM checks for exception, so we should never return here.
|
|
||||||
__ should_not_reach_here();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Register rbx_method = rbx;
|
const Register rbx_method = rbx;
|
||||||
const Register rax_callsite = rax;
|
const Register rax_callsite = rax;
|
||||||
|
|
||||||
|
@ -263,6 +263,10 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
|
|||||||
// and check upper YMM bits after it.
|
// and check upper YMM bits after it.
|
||||||
//
|
//
|
||||||
VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts
|
VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts
|
||||||
|
intx saved_useavx = UseAVX;
|
||||||
|
intx saved_usesse = UseSSE;
|
||||||
|
UseAVX = 1;
|
||||||
|
UseSSE = 2;
|
||||||
|
|
||||||
// load value into all 32 bytes of ymm7 register
|
// load value into all 32 bytes of ymm7 register
|
||||||
__ movl(rcx, VM_Version::ymm_test_value());
|
__ movl(rcx, VM_Version::ymm_test_value());
|
||||||
@ -292,6 +296,8 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
VM_Version::clean_cpuFeatures();
|
VM_Version::clean_cpuFeatures();
|
||||||
|
UseAVX = saved_useavx;
|
||||||
|
UseSSE = saved_usesse;
|
||||||
|
|
||||||
//
|
//
|
||||||
// cpuid(0x7) Structured Extended Features
|
// cpuid(0x7) Structured Extended Features
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "runtime/deoptimization.hpp"
|
#include "runtime/deoptimization.hpp"
|
||||||
#include "runtime/frame.inline.hpp"
|
#include "runtime/frame.inline.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
#include "runtime/stubRoutines.hpp"
|
#include "runtime/stubRoutines.hpp"
|
||||||
#include "runtime/synchronizer.hpp"
|
#include "runtime/synchronizer.hpp"
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/objectMonitor.hpp"
|
#include "runtime/objectMonitor.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/perfMemory.hpp"
|
#include "runtime/perfMemory.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
@ -26,12 +26,9 @@
|
|||||||
#ifndef OS_AIX_VM_OS_AIX_INLINE_HPP
|
#ifndef OS_AIX_VM_OS_AIX_INLINE_HPP
|
||||||
#define OS_AIX_VM_OS_AIX_INLINE_HPP
|
#define OS_AIX_VM_OS_AIX_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#ifdef TARGET_OS_ARCH_aix_ppc
|
|
||||||
# include "atomic_aix_ppc.inline.hpp"
|
|
||||||
# include "orderAccess_aix_ppc.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
|
|
||||||
|
@ -26,13 +26,10 @@
|
|||||||
#ifndef OS_AIX_VM_THREAD_AIX_INLINE_HPP
|
#ifndef OS_AIX_VM_THREAD_AIX_INLINE_HPP
|
||||||
#define OS_AIX_VM_THREAD_AIX_INLINE_HPP
|
#define OS_AIX_VM_THREAD_AIX_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/prefetch.hpp"
|
#include "runtime/prefetch.hpp"
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
|
|
||||||
#include "atomic_aix_ppc.inline.hpp"
|
|
||||||
#include "orderAccess_aix_ppc.inline.hpp"
|
|
||||||
#include "prefetch_aix_ppc.inline.hpp"
|
#include "prefetch_aix_ppc.inline.hpp"
|
||||||
|
|
||||||
// Contains inlined functions for class Thread and ThreadLocalStorage
|
// Contains inlined functions for class Thread and ThreadLocalStorage
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/objectMonitor.hpp"
|
#include "runtime/objectMonitor.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/perfMemory.hpp"
|
#include "runtime/perfMemory.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
@ -26,15 +26,9 @@
|
|||||||
#define OS_BSD_VM_OS_BSD_INLINE_HPP
|
#define OS_BSD_VM_OS_BSD_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
|
||||||
#ifdef TARGET_OS_ARCH_bsd_x86
|
|
||||||
# include "orderAccess_bsd_x86.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_bsd_zero
|
|
||||||
# include "orderAccess_bsd_zero.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -29,18 +29,12 @@
|
|||||||
#error "This file should only be included from thread.inline.hpp"
|
#error "This file should only be included from thread.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/prefetch.hpp"
|
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
#ifdef TARGET_OS_ARCH_bsd_x86
|
#ifdef TARGET_OS_ARCH_bsd_x86
|
||||||
# include "atomic_bsd_x86.inline.hpp"
|
|
||||||
# include "orderAccess_bsd_x86.inline.hpp"
|
|
||||||
# include "prefetch_bsd_x86.inline.hpp"
|
# include "prefetch_bsd_x86.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_bsd_zero
|
#ifdef TARGET_OS_ARCH_bsd_zero
|
||||||
# include "atomic_bsd_zero.inline.hpp"
|
|
||||||
# include "orderAccess_bsd_zero.inline.hpp"
|
|
||||||
# include "prefetch_bsd_zero.inline.hpp"
|
# include "prefetch_bsd_zero.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/objectMonitor.hpp"
|
#include "runtime/objectMonitor.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/perfMemory.hpp"
|
#include "runtime/perfMemory.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
@ -5271,7 +5272,6 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
|
static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
|
||||||
static bool proc_task_unchecked = true;
|
|
||||||
pid_t tid = thread->osthread()->thread_id();
|
pid_t tid = thread->osthread()->thread_id();
|
||||||
char *s;
|
char *s;
|
||||||
char stat[2048];
|
char stat[2048];
|
||||||
@ -5284,24 +5284,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
|
|||||||
long ldummy;
|
long ldummy;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
snprintf(proc_name, 64, "/proc/%d/stat", tid);
|
snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid);
|
||||||
|
|
||||||
// The /proc/<tid>/stat aggregates per-process usage on
|
|
||||||
// new Linux kernels 2.6+ where NPTL is supported.
|
|
||||||
// The /proc/self/task/<tid>/stat still has the per-thread usage.
|
|
||||||
// See bug 6328462.
|
|
||||||
// There possibly can be cases where there is no directory
|
|
||||||
// /proc/self/task, so we check its availability.
|
|
||||||
if (proc_task_unchecked && os::Linux::is_NPTL()) {
|
|
||||||
// This is executed only once
|
|
||||||
proc_task_unchecked = false;
|
|
||||||
fp = fopen("/proc/self/task", "r");
|
|
||||||
if (fp != NULL) {
|
|
||||||
snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid);
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fp = fopen(proc_name, "r");
|
fp = fopen(proc_name, "r");
|
||||||
if ( fp == NULL ) return -1;
|
if ( fp == NULL ) return -1;
|
||||||
statlen = fread(stat, 1, 2047, fp);
|
statlen = fread(stat, 1, 2047, fp);
|
||||||
|
@ -26,24 +26,9 @@
|
|||||||
#define OS_LINUX_VM_OS_LINUX_INLINE_HPP
|
#define OS_LINUX_VM_OS_LINUX_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
|
||||||
#ifdef TARGET_OS_ARCH_linux_x86
|
|
||||||
# include "orderAccess_linux_x86.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_linux_sparc
|
|
||||||
# include "orderAccess_linux_sparc.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_linux_zero
|
|
||||||
# include "orderAccess_linux_zero.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_linux_arm
|
|
||||||
# include "orderAccess_linux_arm.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_linux_ppc
|
|
||||||
# include "orderAccess_linux_ppc.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -29,33 +29,22 @@
|
|||||||
#error "This file should only be included from thread.inline.hpp"
|
#error "This file should only be included from thread.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/prefetch.hpp"
|
#include "runtime/prefetch.hpp"
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
#ifdef TARGET_OS_ARCH_linux_x86
|
#ifdef TARGET_OS_ARCH_linux_x86
|
||||||
# include "atomic_linux_x86.inline.hpp"
|
|
||||||
# include "orderAccess_linux_x86.inline.hpp"
|
|
||||||
# include "prefetch_linux_x86.inline.hpp"
|
# include "prefetch_linux_x86.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_linux_sparc
|
#ifdef TARGET_OS_ARCH_linux_sparc
|
||||||
# include "atomic_linux_sparc.inline.hpp"
|
|
||||||
# include "orderAccess_linux_sparc.inline.hpp"
|
|
||||||
# include "prefetch_linux_sparc.inline.hpp"
|
# include "prefetch_linux_sparc.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_linux_zero
|
#ifdef TARGET_OS_ARCH_linux_zero
|
||||||
# include "atomic_linux_zero.inline.hpp"
|
|
||||||
# include "orderAccess_linux_zero.inline.hpp"
|
|
||||||
# include "prefetch_linux_zero.inline.hpp"
|
# include "prefetch_linux_zero.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_linux_arm
|
#ifdef TARGET_OS_ARCH_linux_arm
|
||||||
# include "atomic_linux_arm.inline.hpp"
|
|
||||||
# include "orderAccess_linux_arm.inline.hpp"
|
|
||||||
# include "prefetch_linux_arm.inline.hpp"
|
# include "prefetch_linux_arm.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_linux_ppc
|
#ifdef TARGET_OS_ARCH_linux_ppc
|
||||||
# include "atomic_linux_ppc.inline.hpp"
|
|
||||||
# include "orderAccess_linux_ppc.inline.hpp"
|
|
||||||
# include "prefetch_linux_ppc.inline.hpp"
|
# include "prefetch_linux_ppc.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/objectMonitor.hpp"
|
#include "runtime/objectMonitor.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/perfMemory.hpp"
|
#include "runtime/perfMemory.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
@ -26,15 +26,9 @@
|
|||||||
#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
|
#define OS_SOLARIS_VM_OS_SOLARIS_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
|
||||||
#ifdef TARGET_OS_ARCH_solaris_x86
|
|
||||||
# include "orderAccess_solaris_x86.inline.hpp"
|
|
||||||
#endif
|
|
||||||
#ifdef TARGET_OS_ARCH_solaris_sparc
|
|
||||||
# include "orderAccess_solaris_sparc.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
@ -29,18 +29,14 @@
|
|||||||
#error "This file should only be included from thread.inline.hpp"
|
#error "This file should only be included from thread.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
#include "runtime/prefetch.hpp"
|
#include "runtime/prefetch.hpp"
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
#ifdef TARGET_OS_ARCH_solaris_x86
|
#ifdef TARGET_OS_ARCH_solaris_x86
|
||||||
# include "atomic_solaris_x86.inline.hpp"
|
|
||||||
# include "orderAccess_solaris_x86.inline.hpp"
|
|
||||||
# include "prefetch_solaris_x86.inline.hpp"
|
# include "prefetch_solaris_x86.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_ARCH_solaris_sparc
|
#ifdef TARGET_OS_ARCH_solaris_sparc
|
||||||
# include "atomic_solaris_sparc.inline.hpp"
|
|
||||||
# include "orderAccess_solaris_sparc.inline.hpp"
|
|
||||||
# include "prefetch_solaris_sparc.inline.hpp"
|
# include "prefetch_solaris_sparc.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
#include "runtime/objectMonitor.hpp"
|
#include "runtime/objectMonitor.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/osThread.hpp"
|
#include "runtime/osThread.hpp"
|
||||||
#include "runtime/perfMemory.hpp"
|
#include "runtime/perfMemory.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
@ -26,12 +26,9 @@
|
|||||||
#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
|
#define OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP
|
||||||
|
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
|
|
||||||
#ifdef TARGET_OS_ARCH_windows_x86
|
|
||||||
# include "orderAccess_windows_x86.inline.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline const char* os::file_separator() { return "\\"; }
|
inline const char* os::file_separator() { return "\\"; }
|
||||||
inline const char* os::line_separator() { return "\r\n"; }
|
inline const char* os::line_separator() { return "\r\n"; }
|
||||||
inline const char* os::path_separator() { return ";"; }
|
inline const char* os::path_separator() { return ";"; }
|
||||||
|
@ -29,13 +29,10 @@
|
|||||||
#error "This file should only be included from thread.inline.hpp"
|
#error "This file should only be included from thread.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "runtime/atomic.hpp"
|
|
||||||
#include "runtime/prefetch.hpp"
|
#include "runtime/prefetch.hpp"
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "runtime/threadLocalStorage.hpp"
|
#include "runtime/threadLocalStorage.hpp"
|
||||||
#ifdef TARGET_OS_ARCH_windows_x86
|
#ifdef TARGET_OS_ARCH_windows_x86
|
||||||
# include "atomic_windows_x86.inline.hpp"
|
|
||||||
# include "orderAccess_windows_x86.inline.hpp"
|
|
||||||
# include "prefetch_windows_x86.inline.hpp"
|
# include "prefetch_windows_x86.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#ifndef OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP
|
#ifndef OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP
|
||||||
#define OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP
|
#define OS_CPU_AIX_OJDKPPC_VM_ATOMIC_AIX_PPC_INLINE_HPP
|
||||||
|
|
||||||
#include "orderAccess_aix_ppc.inline.hpp"
|
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "vm_version_ppc.hpp"
|
#include "vm_version_ppc.hpp"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
|
#ifndef OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
|
||||||
#define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
|
#define OS_CPU_LINUX_PPC_VM_ATOMIC_LINUX_PPC_INLINE_HPP
|
||||||
|
|
||||||
#include "orderAccess_linux_ppc.inline.hpp"
|
|
||||||
#include "runtime/atomic.hpp"
|
#include "runtime/atomic.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "vm_version_ppc.hpp"
|
#include "vm_version_ppc.hpp"
|
||||||
@ -53,41 +52,41 @@ inline void Atomic::store_ptr(void* store_value, volatile void* dest) { *
|
|||||||
|
|
||||||
inline jlong Atomic::load(volatile jlong* src) { return *src; }
|
inline jlong Atomic::load(volatile jlong* src) { return *src; }
|
||||||
|
|
||||||
/*
|
//
|
||||||
machine barrier instructions:
|
// machine barrier instructions:
|
||||||
|
//
|
||||||
- sync two-way memory barrier, aka fence
|
// - sync two-way memory barrier, aka fence
|
||||||
- lwsync orders Store|Store,
|
// - lwsync orders Store|Store,
|
||||||
Load|Store,
|
// Load|Store,
|
||||||
Load|Load,
|
// Load|Load,
|
||||||
but not Store|Load
|
// but not Store|Load
|
||||||
- eieio orders memory accesses for device memory (only)
|
// - eieio orders memory accesses for device memory (only)
|
||||||
- isync invalidates speculatively executed instructions
|
// - isync invalidates speculatively executed instructions
|
||||||
From the POWER ISA 2.06 documentation:
|
// From the POWER ISA 2.06 documentation:
|
||||||
"[...] an isync instruction prevents the execution of
|
// "[...] an isync instruction prevents the execution of
|
||||||
instructions following the isync until instructions
|
// instructions following the isync until instructions
|
||||||
preceding the isync have completed, [...]"
|
// preceding the isync have completed, [...]"
|
||||||
From IBM's AIX assembler reference:
|
// From IBM's AIX assembler reference:
|
||||||
"The isync [...] instructions causes the processor to
|
// "The isync [...] instructions causes the processor to
|
||||||
refetch any instructions that might have been fetched
|
// refetch any instructions that might have been fetched
|
||||||
prior to the isync instruction. The instruction isync
|
// prior to the isync instruction. The instruction isync
|
||||||
causes the processor to wait for all previous instructions
|
// causes the processor to wait for all previous instructions
|
||||||
to complete. Then any instructions already fetched are
|
// to complete. Then any instructions already fetched are
|
||||||
discarded and instruction processing continues in the
|
// discarded and instruction processing continues in the
|
||||||
environment established by the previous instructions."
|
// environment established by the previous instructions."
|
||||||
|
//
|
||||||
semantic barrier instructions:
|
// semantic barrier instructions:
|
||||||
(as defined in orderAccess.hpp)
|
// (as defined in orderAccess.hpp)
|
||||||
|
//
|
||||||
- release orders Store|Store, (maps to lwsync)
|
// - release orders Store|Store, (maps to lwsync)
|
||||||
Load|Store
|
// Load|Store
|
||||||
- acquire orders Load|Store, (maps to lwsync)
|
// - acquire orders Load|Store, (maps to lwsync)
|
||||||
Load|Load
|
// Load|Load
|
||||||
- fence orders Store|Store, (maps to sync)
|
// - fence orders Store|Store, (maps to sync)
|
||||||
Load|Store,
|
// Load|Store,
|
||||||
Load|Load,
|
// Load|Load,
|
||||||
Store|Load
|
// Store|Load
|
||||||
*/
|
//
|
||||||
|
|
||||||
#define strasm_sync "\n sync \n"
|
#define strasm_sync "\n sync \n"
|
||||||
#define strasm_lwsync "\n lwsync \n"
|
#define strasm_lwsync "\n lwsync \n"
|
||||||
|
@ -78,12 +78,12 @@ inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
|
|||||||
__asm__ volatile(
|
__asm__ volatile(
|
||||||
"1: \n\t"
|
"1: \n\t"
|
||||||
" ldx [%2], %%o2\n\t"
|
" ldx [%2], %%o2\n\t"
|
||||||
" add %0, %%o2, %%o3\n\t"
|
" add %1, %%o2, %%o3\n\t"
|
||||||
" casx [%2], %%o2, %%o3\n\t"
|
" casx [%2], %%o2, %%o3\n\t"
|
||||||
" cmp %%o2, %%o3\n\t"
|
" cmp %%o2, %%o3\n\t"
|
||||||
" bne %%xcc, 1b\n\t"
|
" bne %%xcc, 1b\n\t"
|
||||||
" nop\n\t"
|
" nop\n\t"
|
||||||
" add %0, %%o2, %0\n\t"
|
" add %1, %%o2, %0\n\t"
|
||||||
: "=r" (rv)
|
: "=r" (rv)
|
||||||
: "r" (add_value), "r" (dest)
|
: "r" (add_value), "r" (dest)
|
||||||
: "memory", "o2", "o3");
|
: "memory", "o2", "o3");
|
||||||
|
@ -302,29 +302,30 @@ void os::print_register_info(outputStream *st, void *context) {
|
|||||||
if (context == NULL) return;
|
if (context == NULL) return;
|
||||||
|
|
||||||
ucontext_t *uc = (ucontext_t*)context;
|
ucontext_t *uc = (ucontext_t*)context;
|
||||||
|
sigcontext* sc = (sigcontext*)context;
|
||||||
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
|
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
|
||||||
|
|
||||||
st->print_cr("Register to memory mapping:");
|
st->print_cr("Register to memory mapping:");
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
// this is only for the "general purpose" registers
|
// this is only for the "general purpose" registers
|
||||||
st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]);
|
st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON_G1]);
|
||||||
st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]);
|
st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON_G2]);
|
||||||
st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]);
|
st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON_G3]);
|
||||||
st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]);
|
st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON_G4]);
|
||||||
st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]);
|
st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON_G5]);
|
||||||
st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]);
|
st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON_G6]);
|
||||||
st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]);
|
st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON_G7]);
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]);
|
st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON_O0]);
|
||||||
st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]);
|
st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON_O1]);
|
||||||
st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]);
|
st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON_O2]);
|
||||||
st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]);
|
st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON_O3]);
|
||||||
st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]);
|
st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON_O4]);
|
||||||
st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]);
|
st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON_O5]);
|
||||||
st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]);
|
st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON_O6]);
|
||||||
st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]);
|
st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON_O7]);
|
||||||
st->cr();
|
st->cr();
|
||||||
|
|
||||||
st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
|
st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
|
||||||
@ -516,7 +517,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) {
|
|||||||
if (nativeInstruction_at(*pc)->is_ic_miss_trap()) {
|
if (nativeInstruction_at(*pc)->is_ic_miss_trap()) {
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
#ifdef TIERED
|
#ifdef TIERED
|
||||||
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
CodeBlob* cb = CodeCache::find_blob_unsafe(*pc);
|
||||||
assert(cb->is_compiled_by_c2(), "Wrong compiler");
|
assert(cb->is_compiled_by_c2(), "Wrong compiler");
|
||||||
#endif // TIERED
|
#endif // TIERED
|
||||||
#endif // ASSERT
|
#endif // ASSERT
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, 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
|
||||||
@ -89,200 +89,6 @@ char *FileBuff::get_line(void) {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------FileBuffRegion---------------------------------
|
|
||||||
// Create a new region in a FileBuff.
|
|
||||||
FileBuffRegion::FileBuffRegion( FileBuff* bufr, int soln, int ln,
|
|
||||||
int off, int len)
|
|
||||||
: _bfr(bufr), _sol(soln), _line(ln), _offset(off), _length(len) {
|
|
||||||
_next = NULL; // No chained regions
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------~FileBuffRegion--------------------------------
|
|
||||||
// Delete the entire linked list of buffer regions.
|
|
||||||
FileBuffRegion::~FileBuffRegion() {
|
|
||||||
if( _next ) delete _next;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------copy-------------------------------------------
|
|
||||||
// Deep copy a FileBuffRegion
|
|
||||||
FileBuffRegion *FileBuffRegion::copy() {
|
|
||||||
if( !this ) return NULL; // The empty buffer region
|
|
||||||
FileBuffRegion *br = new FileBuffRegion(_bfr,_sol,_line,_offset,_length);
|
|
||||||
if( _next ) br->_next = _next->copy();
|
|
||||||
return br;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------merge------------------------------------------
|
|
||||||
// Merge another buffer region into this buffer region. Make overlapping areas
|
|
||||||
// become a single region. Remove (delete) the input FileBuffRegion.
|
|
||||||
// Since the buffer regions are sorted by file offset, this is a varient of a
|
|
||||||
// "sorted-merge" running in linear time.
|
|
||||||
FileBuffRegion *FileBuffRegion::merge( FileBuffRegion *br ) {
|
|
||||||
if( !br ) return this; // Merging nothing
|
|
||||||
if( !this ) return br; // Merging into nothing
|
|
||||||
|
|
||||||
assert( _bfr == br->_bfr, "" ); // Check for pointer-equivalent buffers
|
|
||||||
|
|
||||||
if( _offset < br->_offset ) { // "this" starts before "br"
|
|
||||||
if( _offset+_length < br->_offset ) { // "this" ends before "br"
|
|
||||||
if( _next ) _next->merge( br ); // Merge with remainder of list
|
|
||||||
else _next = br; // No more in this list; just append.
|
|
||||||
} else { // Regions overlap.
|
|
||||||
int l = br->_offset + br->_length - _offset;
|
|
||||||
if( l > _length ) _length = l; // Pick larger region
|
|
||||||
FileBuffRegion *nr = br->_next; // Get rest of region
|
|
||||||
br->_next = NULL; // Remove indication of rest of region
|
|
||||||
delete br; // Delete this region (it's been subsumed).
|
|
||||||
if( nr ) merge( nr ); // Merge with rest of region
|
|
||||||
} // End of if regions overlap or not.
|
|
||||||
} else { // "this" starts after "br"
|
|
||||||
if( br->_offset+br->_length < _offset ) { // "br" ends before "this"
|
|
||||||
FileBuffRegion *nr = new FileBuffRegion(_bfr,_sol,_line,_offset,_length);
|
|
||||||
nr->_next = _next; // Structure copy "this" guy to "nr"
|
|
||||||
*this = *br; // Structure copy "br" over "this".
|
|
||||||
br->_next = NULL; // Remove indication of rest of region
|
|
||||||
delete br; // Delete this region (it's been copied)
|
|
||||||
merge( nr ); // Finish merging
|
|
||||||
} else { // Regions overlap.
|
|
||||||
int l = _offset + _length - br->_offset;
|
|
||||||
if( l > _length ) _length = l; // Pick larger region
|
|
||||||
_offset = br->_offset; // Start with earlier region
|
|
||||||
_sol = br->_sol; // Also use earlier line start
|
|
||||||
_line = br->_line; // Also use earlier line
|
|
||||||
FileBuffRegion *nr = br->_next; // Get rest of region
|
|
||||||
br->_next = NULL; // Remove indication of rest of region
|
|
||||||
delete br; // Delete this region (it's been subsumed).
|
|
||||||
if( nr ) merge( nr ); // Merge with rest of region
|
|
||||||
} // End of if regions overlap or not.
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------expandtab--------------------------------------
|
|
||||||
static int expandtab( ostream &os, int off, char c, char fill1, char fill2 ) {
|
|
||||||
if( c == '\t' ) { // Tab?
|
|
||||||
do os << fill1; // Expand the tab; Output space
|
|
||||||
while( (++off) & 7 ); // Expand to tab stop
|
|
||||||
} else { // Normal character
|
|
||||||
os << fill2; // Display normal character
|
|
||||||
off++; // Increment "cursor" offset
|
|
||||||
}
|
|
||||||
return off;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------printline--------------------------------------
|
|
||||||
// Print and highlite a region of a line. Return the amount of highliting left
|
|
||||||
// to do (i.e. highlite length minus length of line).
|
|
||||||
static int printline( ostream& os, const char *fname, int line,
|
|
||||||
const char *_sol, int skip, int len ) {
|
|
||||||
|
|
||||||
// Display the entire tab-expanded line
|
|
||||||
os << fname << ":" << line << ": ";
|
|
||||||
const char *t = strchr(_sol,'\n')+1; // End of line
|
|
||||||
int off = 0; // Cursor offset for tab expansion
|
|
||||||
const char *s = _sol; // Nice string pointer
|
|
||||||
while( t-s ) { // Display whole line
|
|
||||||
char c = *s++; // Get next character to display
|
|
||||||
off = expandtab(os,off,c,' ',c);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display the tab-expanded skippings before underlining.
|
|
||||||
os << fname << ":" << line << ": ";
|
|
||||||
off = 0; // Cursor offset for tab expansion
|
|
||||||
s = _sol; // Restart string pointer
|
|
||||||
|
|
||||||
// Start underlining.
|
|
||||||
if( skip != -1 ) { // The no-start-indicating flag
|
|
||||||
const char *u = _sol+skip; // Amount to skip
|
|
||||||
while( u-s ) // Display skipped part
|
|
||||||
off = expandtab(os,off,*s++,' ',' ');
|
|
||||||
os << '^'; // Start region
|
|
||||||
off++; // Moved cursor
|
|
||||||
len--; // 1 less char to do
|
|
||||||
if( *s++ == '\t' ) // Starting character is a tab?
|
|
||||||
off = expandtab(os,off,'\t','-','^');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Long region doesn't end on this line
|
|
||||||
int llen = (int)(t-s); // Length of line, minus what's already done
|
|
||||||
if( len > llen ) { // Doing entire rest of line?
|
|
||||||
while( t-s ) // Display rest of line
|
|
||||||
off = expandtab(os,off,*s++,'-','-');
|
|
||||||
os << '\n'; // EOL
|
|
||||||
return len-llen; // Return what's not yet done.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Region does end on this line. This code fails subtly if the region ends
|
|
||||||
// in a tab character.
|
|
||||||
int i;
|
|
||||||
for( i=1; i<len; i++ ) // Underline just what's needed
|
|
||||||
off = expandtab(os,off,*s++,'-','-');
|
|
||||||
if( i == len ) os << '^'; // Mark end of region
|
|
||||||
os << '\n'; // End of marked line
|
|
||||||
return 0; // All done
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------print------------------------------------------
|
|
||||||
//std::ostream& operator<< ( std::ostream& os, FileBuffRegion &br ) {
|
|
||||||
ostream& operator<< ( ostream& os, FileBuffRegion &br ) {
|
|
||||||
if( &br == NULL ) return os; // The empty buffer region
|
|
||||||
FileBuffRegion *brp = &br; // Pointer to region
|
|
||||||
while( brp ) { // While have chained regions
|
|
||||||
brp->print(os); // Print region
|
|
||||||
brp = brp->_next; // Chain to next
|
|
||||||
}
|
|
||||||
return os; // Return final stream
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------print------------------------------------------
|
|
||||||
// Print the FileBuffRegion to a stream. FileBuffRegions are printed with the
|
|
||||||
// filename and line number to the left, and complete text lines to the right.
|
|
||||||
// Selected portions (portions of a line actually in the FileBuffRegion are
|
|
||||||
// underlined. Ellipses are used for long multi-line regions.
|
|
||||||
//void FileBuffRegion::print( std::ostream& os ) {
|
|
||||||
void FileBuffRegion::print( ostream& os ) {
|
|
||||||
if( !this ) return; // Nothing to print
|
|
||||||
char *s = _bfr->get_line();
|
|
||||||
int skip = (int)(_offset - _sol); // Amount to skip to start of data
|
|
||||||
int len = printline( os, _bfr->_fp->_name, _line, s, skip, _length );
|
|
||||||
|
|
||||||
if( !len ) return; // All done; exit
|
|
||||||
|
|
||||||
// Here we require at least 2 lines
|
|
||||||
int off1 = _length - len + skip; // Length of line 1
|
|
||||||
int off2 = off1 + _sol; // Offset to start of line 2
|
|
||||||
char *s2 = _bfr->get_line(); // Start of line 2
|
|
||||||
char *s3 = strchr( s2, '\n' )+1; // Start of line 3 (unread)
|
|
||||||
if( len <= (s3-s2) ) { // It all fits on the next line
|
|
||||||
printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Print&underline
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Here we require at least 3 lines
|
|
||||||
int off3 = off2 + (int)(s3-s2); // Offset to start of line 3
|
|
||||||
s3 = _bfr->get_line(); // Start of line 3 (read)
|
|
||||||
const char *s4 = strchr( s3, '\n' )+1;// Start of line 4 (unread)
|
|
||||||
if( len < (s4-s3) ) { // It all fits on the next 2 lines
|
|
||||||
s2 = _bfr->get_line();
|
|
||||||
len = printline( os, _bfr->_fp->_name, _line+1, s2, -1, len ); // Line 2
|
|
||||||
s3 = _bfr->get_line();
|
|
||||||
printline( os, _bfr->_fp->_name, _line+2, s3, -1, len ); // Line 3
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Here we require at least 4 lines.
|
|
||||||
// Print only the 1st and last line, with ellipses in middle.
|
|
||||||
os << "...\n"; // The ellipses
|
|
||||||
int cline = _line+1; // Skipped 2 lines
|
|
||||||
do { // Do until find last line
|
|
||||||
len -= (int)(s3-s2); // Remove length of line
|
|
||||||
cline++; // Next line
|
|
||||||
s2 = _bfr->get_line(); // Get next line from end of this line
|
|
||||||
s3 = strchr( s2, '\n' ) + 1;// Get end of next line
|
|
||||||
} while( len > (s3-s2) ); // Repeat until last line
|
|
||||||
printline( os, _bfr->_fp->_name, cline, s2, -1, len ); // Print & underline
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------file_error-------------------------------------
|
//------------------------------file_error-------------------------------------
|
||||||
void FileBuff::file_error(int flag, int linenum, const char *fmt, ...)
|
void FileBuff::file_error(int flag, int linenum, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2010, 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
|
||||||
@ -46,7 +46,6 @@ class ArchDesc;
|
|||||||
// This class defines a nicely behaved buffer of text. Entire file of text
|
// This class defines a nicely behaved buffer of text. Entire file of text
|
||||||
// is read into buffer at creation, with sentinels at start and end.
|
// is read into buffer at creation, with sentinels at start and end.
|
||||||
class FileBuff {
|
class FileBuff {
|
||||||
friend class FileBuffRegion;
|
|
||||||
private:
|
private:
|
||||||
long _bufferSize; // Size of text holding buffer.
|
long _bufferSize; // Size of text holding buffer.
|
||||||
long _offset; // Expected filepointer offset.
|
long _offset; // Expected filepointer offset.
|
||||||
@ -82,29 +81,4 @@ class FileBuff {
|
|||||||
// when the pointer is valid (i.e. just obtained from getline()).
|
// when the pointer is valid (i.e. just obtained from getline()).
|
||||||
long getoff(const char* s) { return _bufoff + (long)(s - _buf); }
|
long getoff(const char* s) { return _bufoff + (long)(s - _buf); }
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------FileBuffRegion---------------------------------
|
|
||||||
// A buffer region is really a region of some file, specified as a linked list
|
|
||||||
// of offsets and lengths. These regions can be merged; overlapping regions
|
|
||||||
// will coalesce.
|
|
||||||
class FileBuffRegion {
|
|
||||||
public: // Workaround dev-studio friend/private bug
|
|
||||||
FileBuffRegion *_next; // Linked list of regions sorted by offset.
|
|
||||||
private:
|
|
||||||
FileBuff *_bfr; // The Buffer of the file
|
|
||||||
int _offset, _length; // The file area
|
|
||||||
int _sol; // Start of line where the file area starts
|
|
||||||
int _line; // First line of region
|
|
||||||
|
|
||||||
public:
|
|
||||||
FileBuffRegion(FileBuff*, int sol, int line, int offset, int len);
|
|
||||||
~FileBuffRegion();
|
|
||||||
|
|
||||||
FileBuffRegion *copy(); // Deep copy
|
|
||||||
FileBuffRegion *merge(FileBuffRegion*); // Merge 2 regions; delete input
|
|
||||||
|
|
||||||
void print(ostream&);
|
|
||||||
friend ostream& operator<< (ostream&, FileBuffRegion&);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // SHARE_VM_ADLC_FILEBUFF_HPP
|
#endif // SHARE_VM_ADLC_FILEBUFF_HPP
|
||||||
|
@ -1701,6 +1701,15 @@ Values* GraphBuilder::args_list_for_profiling(ciMethod* target, int& start, bool
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphBuilder::check_args_for_profiling(Values* obj_args, int expected) {
|
||||||
|
#ifdef ASSERT
|
||||||
|
bool ignored_will_link;
|
||||||
|
ciSignature* declared_signature = NULL;
|
||||||
|
ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
|
||||||
|
assert(expected == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Collect arguments that we want to profile in a list
|
// Collect arguments that we want to profile in a list
|
||||||
Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) {
|
Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver) {
|
||||||
int start = 0;
|
int start = 0;
|
||||||
@ -1709,13 +1718,14 @@ Values* GraphBuilder::collect_args_for_profiling(Values* args, ciMethod* target,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
int s = obj_args->size();
|
int s = obj_args->size();
|
||||||
for (int i = start, j = 0; j < s; i++) {
|
// if called through method handle invoke, some arguments may have been popped
|
||||||
|
for (int i = start, j = 0; j < s && i < args->length(); i++) {
|
||||||
if (args->at(i)->type()->is_object_kind()) {
|
if (args->at(i)->type()->is_object_kind()) {
|
||||||
obj_args->push(args->at(i));
|
obj_args->push(args->at(i));
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(s == obj_args->length(), "missed on arg?");
|
check_args_for_profiling(obj_args, s);
|
||||||
return obj_args;
|
return obj_args;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3847,14 +3857,7 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef ASSERT
|
check_args_for_profiling(obj_args, s);
|
||||||
{
|
|
||||||
bool ignored_will_link;
|
|
||||||
ciSignature* declared_signature = NULL;
|
|
||||||
ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
|
|
||||||
assert(s == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
profile_call(callee, recv, holder_known ? callee->holder() : NULL, obj_args, true);
|
profile_call(callee, recv, holder_known ? callee->holder() : NULL, obj_args, true);
|
||||||
}
|
}
|
||||||
|
@ -392,6 +392,7 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC {
|
|||||||
|
|
||||||
Values* args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver);
|
Values* args_list_for_profiling(ciMethod* target, int& start, bool may_have_receiver);
|
||||||
Values* collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver);
|
Values* collect_args_for_profiling(Values* args, ciMethod* target, bool may_have_receiver);
|
||||||
|
void check_args_for_profiling(Values* obj_args, int expected);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NOT_PRODUCT(void print_stats();)
|
NOT_PRODUCT(void print_stats();)
|
||||||
|
@ -263,8 +263,7 @@ int CodeEmitInfo::interpreter_frame_size() const {
|
|||||||
// Implementation of IR
|
// Implementation of IR
|
||||||
|
|
||||||
IR::IR(Compilation* compilation, ciMethod* method, int osr_bci) :
|
IR::IR(Compilation* compilation, ciMethod* method, int osr_bci) :
|
||||||
_locals_size(in_WordSize(-1))
|
_num_loops(0) {
|
||||||
, _num_loops(0) {
|
|
||||||
// setup IR fields
|
// setup IR fields
|
||||||
_compilation = compilation;
|
_compilation = compilation;
|
||||||
_top_scope = new IRScope(compilation, NULL, -1, method, osr_bci, true);
|
_top_scope = new IRScope(compilation, NULL, -1, method, osr_bci, true);
|
||||||
|
@ -293,7 +293,6 @@ class IR: public CompilationResourceObj {
|
|||||||
private:
|
private:
|
||||||
Compilation* _compilation; // the current compilation
|
Compilation* _compilation; // the current compilation
|
||||||
IRScope* _top_scope; // the root of the scope hierarchy
|
IRScope* _top_scope; // the root of the scope hierarchy
|
||||||
WordSize _locals_size; // the space required for all locals
|
|
||||||
int _num_loops; // Total number of loops
|
int _num_loops; // Total number of loops
|
||||||
BlockList* _code; // the blocks in code generation order w/ use counts
|
BlockList* _code; // the blocks in code generation order w/ use counts
|
||||||
|
|
||||||
@ -310,8 +309,6 @@ class IR: public CompilationResourceObj {
|
|||||||
BlockBegin* start() const { return top_scope()->start(); }
|
BlockBegin* start() const { return top_scope()->start(); }
|
||||||
BlockBegin* std_entry() const { return start()->end()->as_Base()->std_entry(); }
|
BlockBegin* std_entry() const { return start()->end()->as_Base()->std_entry(); }
|
||||||
BlockBegin* osr_entry() const { return start()->end()->as_Base()->osr_entry(); }
|
BlockBegin* osr_entry() const { return start()->end()->as_Base()->osr_entry(); }
|
||||||
WordSize locals_size() const { return _locals_size; }
|
|
||||||
int locals_size_in_words() const { return in_words(_locals_size); }
|
|
||||||
BlockList* code() const { return _code; }
|
BlockList* code() const { return _code; }
|
||||||
int num_loops() const { return _num_loops; }
|
int num_loops() const { return _num_loops; }
|
||||||
int max_stack() const { return top_scope()->max_stack(); } // expensive
|
int max_stack() const { return top_scope()->max_stack(); } // expensive
|
||||||
|
@ -2636,8 +2636,10 @@ ciKlass* LIRGenerator::profile_type(ciMethodData* md, int md_base_offset, int md
|
|||||||
// LIR_Assembler::emit_profile_type() from emitting useless code
|
// LIR_Assembler::emit_profile_type() from emitting useless code
|
||||||
profiled_k = ciTypeEntries::with_status(result, profiled_k);
|
profiled_k = ciTypeEntries::with_status(result, profiled_k);
|
||||||
}
|
}
|
||||||
if (exact_signature_k != NULL && exact_klass != exact_signature_k) {
|
// exact_klass and exact_signature_k can be both non NULL but
|
||||||
assert(exact_klass == NULL, "obj and signature disagree?");
|
// different if exact_klass is loaded after the ciObject for
|
||||||
|
// exact_signature_k is created.
|
||||||
|
if (exact_klass == NULL && exact_signature_k != NULL && exact_klass != exact_signature_k) {
|
||||||
// sometimes the type of the signature is better than the best type
|
// sometimes the type of the signature is better than the best type
|
||||||
// the compiler has
|
// the compiler has
|
||||||
exact_klass = exact_signature_k;
|
exact_klass = exact_signature_k;
|
||||||
@ -2648,8 +2650,7 @@ ciKlass* LIRGenerator::profile_type(ciMethodData* md, int md_base_offset, int md
|
|||||||
if (improved_klass == NULL) {
|
if (improved_klass == NULL) {
|
||||||
improved_klass = comp->cha_exact_type(callee_signature_k);
|
improved_klass = comp->cha_exact_type(callee_signature_k);
|
||||||
}
|
}
|
||||||
if (improved_klass != NULL && exact_klass != improved_klass) {
|
if (exact_klass == NULL && improved_klass != NULL && exact_klass != improved_klass) {
|
||||||
assert(exact_klass == NULL, "obj and signature disagree?");
|
|
||||||
exact_klass = exact_signature_k;
|
exact_klass = exact_signature_k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include "runtime/init.hpp"
|
#include "runtime/init.hpp"
|
||||||
#include "runtime/reflection.hpp"
|
#include "runtime/reflection.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
|
#include "runtime/thread.inline.hpp"
|
||||||
#include "utilities/dtrace.hpp"
|
#include "utilities/dtrace.hpp"
|
||||||
#include "utilities/macros.hpp"
|
#include "utilities/macros.hpp"
|
||||||
#ifdef COMPILER1
|
#ifdef COMPILER1
|
||||||
|
@ -181,9 +181,8 @@ bool ciObject::should_be_constant() {
|
|||||||
if (klass() == env->String_klass() || klass() == env->Class_klass()) {
|
if (klass() == env->String_klass() || klass() == env->Class_klass()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (EnableInvokeDynamic &&
|
if (klass()->is_subclass_of(env->MethodHandle_klass()) ||
|
||||||
(klass()->is_subclass_of(env->MethodHandle_klass()) ||
|
klass()->is_subclass_of(env->CallSite_klass())) {
|
||||||
klass()->is_subclass_of(env->CallSite_klass()))) {
|
|
||||||
assert(ScavengeRootsInCode >= 1, "must be");
|
assert(ScavengeRootsInCode >= 1, "must be");
|
||||||
// We want to treat these aggressively.
|
// We want to treat these aggressively.
|
||||||
return true;
|
return true;
|
||||||
|
@ -376,11 +376,15 @@ class CompileReplay : public StackObj {
|
|||||||
int c = getc(_stream);
|
int c = getc(_stream);
|
||||||
while(c != EOF) {
|
while(c != EOF) {
|
||||||
c = get_line(c);
|
c = get_line(c);
|
||||||
process_command(CHECK);
|
process_command(THREAD);
|
||||||
if (had_error()) {
|
if (had_error()) {
|
||||||
tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message);
|
tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message);
|
||||||
tty->print_cr("%s", _buffer);
|
if (ReplayIgnoreInitErrors) {
|
||||||
return;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
|
_error_message = NULL;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
line_no++;
|
line_no++;
|
||||||
}
|
}
|
||||||
@ -565,10 +569,14 @@ class CompileReplay : public StackObj {
|
|||||||
void process_ciMethodData(TRAPS) {
|
void process_ciMethodData(TRAPS) {
|
||||||
Method* method = parse_method(CHECK);
|
Method* method = parse_method(CHECK);
|
||||||
if (had_error()) return;
|
if (had_error()) return;
|
||||||
/* jsut copied from Method, to build interpret data*/
|
/* just copied from Method, to build interpret data*/
|
||||||
if (InstanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
|
if (InstanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// To be properly initialized, some profiling in the MDO needs the
|
||||||
|
// method to be rewritten (number of arguments at a call for
|
||||||
|
// instance)
|
||||||
|
method->method_holder()->link_class(CHECK);
|
||||||
// methodOopDesc::build_interpreter_method_data(method, CHECK);
|
// methodOopDesc::build_interpreter_method_data(method, CHECK);
|
||||||
{
|
{
|
||||||
// Grab a lock here to prevent multiple
|
// Grab a lock here to prevent multiple
|
||||||
|
@ -164,11 +164,6 @@ void ClassFileParser::parse_constant_pool_entries(int length, TRAPS) {
|
|||||||
"Class file version does not support constant tag %u in class file %s",
|
"Class file version does not support constant tag %u in class file %s",
|
||||||
tag, CHECK);
|
tag, CHECK);
|
||||||
}
|
}
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
classfile_parse_error(
|
|
||||||
"This JVM does not support constant tag %u in class file %s",
|
|
||||||
tag, CHECK);
|
|
||||||
}
|
|
||||||
if (tag == JVM_CONSTANT_MethodHandle) {
|
if (tag == JVM_CONSTANT_MethodHandle) {
|
||||||
cfs->guarantee_more(4, CHECK); // ref_kind, method_index, tag/access_flags
|
cfs->guarantee_more(4, CHECK); // ref_kind, method_index, tag/access_flags
|
||||||
u1 ref_kind = cfs->get_u1_fast();
|
u1 ref_kind = cfs->get_u1_fast();
|
||||||
@ -189,11 +184,6 @@ void ClassFileParser::parse_constant_pool_entries(int length, TRAPS) {
|
|||||||
"Class file version does not support constant tag %u in class file %s",
|
"Class file version does not support constant tag %u in class file %s",
|
||||||
tag, CHECK);
|
tag, CHECK);
|
||||||
}
|
}
|
||||||
if (!EnableInvokeDynamic) {
|
|
||||||
classfile_parse_error(
|
|
||||||
"This JVM does not support constant tag %u in class file %s",
|
|
||||||
tag, CHECK);
|
|
||||||
}
|
|
||||||
cfs->guarantee_more(5, CHECK); // bsm_index, nt, tag/access_flags
|
cfs->guarantee_more(5, CHECK); // bsm_index, nt, tag/access_flags
|
||||||
u2 bootstrap_specifier_index = cfs->get_u2_fast();
|
u2 bootstrap_specifier_index = cfs->get_u2_fast();
|
||||||
u2 name_and_type_index = cfs->get_u2_fast();
|
u2 name_and_type_index = cfs->get_u2_fast();
|
||||||
@ -263,7 +253,7 @@ void ClassFileParser::parse_constant_pool_entries(int length, TRAPS) {
|
|||||||
verify_legal_utf8((unsigned char*)utf8_buffer, utf8_length, CHECK);
|
verify_legal_utf8((unsigned char*)utf8_buffer, utf8_length, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EnableInvokeDynamic && has_cp_patch_at(index)) {
|
if (has_cp_patch_at(index)) {
|
||||||
Handle patch = clear_cp_patch_at(index);
|
Handle patch = clear_cp_patch_at(index);
|
||||||
guarantee_property(java_lang_String::is_instance(patch()),
|
guarantee_property(java_lang_String::is_instance(patch()),
|
||||||
"Illegal utf8 patch at %d in class file %s",
|
"Illegal utf8 patch at %d in class file %s",
|
||||||
@ -419,8 +409,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
|||||||
{
|
{
|
||||||
int ref_index = cp->method_handle_index_at(index);
|
int ref_index = cp->method_handle_index_at(index);
|
||||||
check_property(
|
check_property(
|
||||||
valid_cp_range(ref_index, length) &&
|
valid_cp_range(ref_index, length),
|
||||||
EnableInvokeDynamic,
|
|
||||||
"Invalid constant pool index %u in class file %s",
|
"Invalid constant pool index %u in class file %s",
|
||||||
ref_index, CHECK_(nullHandle));
|
ref_index, CHECK_(nullHandle));
|
||||||
constantTag tag = cp->tag_at(ref_index);
|
constantTag tag = cp->tag_at(ref_index);
|
||||||
@ -466,7 +455,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
|||||||
case JVM_CONSTANT_MethodType :
|
case JVM_CONSTANT_MethodType :
|
||||||
{
|
{
|
||||||
int ref_index = cp->method_type_index_at(index);
|
int ref_index = cp->method_type_index_at(index);
|
||||||
check_property(valid_symbol_at(ref_index) && EnableInvokeDynamic,
|
check_property(valid_symbol_at(ref_index),
|
||||||
"Invalid constant pool index %u in class file %s",
|
"Invalid constant pool index %u in class file %s",
|
||||||
ref_index, CHECK_(nullHandle));
|
ref_index, CHECK_(nullHandle));
|
||||||
}
|
}
|
||||||
@ -492,7 +481,6 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
|||||||
|
|
||||||
if (_cp_patches != NULL) {
|
if (_cp_patches != NULL) {
|
||||||
// need to treat this_class specially...
|
// need to treat this_class specially...
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
int this_class_index;
|
int this_class_index;
|
||||||
{
|
{
|
||||||
cfs->guarantee_more(8, CHECK_(nullHandle)); // flags, this_class, super_class, infs_len
|
cfs->guarantee_more(8, CHECK_(nullHandle)); // flags, this_class, super_class, infs_len
|
||||||
@ -640,7 +628,6 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
|||||||
|
|
||||||
|
|
||||||
void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) {
|
void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) {
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
BasicType patch_type = T_VOID;
|
BasicType patch_type = T_VOID;
|
||||||
|
|
||||||
switch (cp->tag_at(index).value()) {
|
switch (cp->tag_at(index).value()) {
|
||||||
|
@ -377,11 +377,9 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS);
|
char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS);
|
||||||
|
|
||||||
bool is_anonymous() {
|
bool is_anonymous() {
|
||||||
assert(EnableInvokeDynamic || _host_klass.is_null(), "");
|
|
||||||
return _host_klass.not_null();
|
return _host_klass.not_null();
|
||||||
}
|
}
|
||||||
bool has_cp_patch_at(int index) {
|
bool has_cp_patch_at(int index) {
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
assert(index >= 0, "oob");
|
assert(index >= 0, "oob");
|
||||||
return (_cp_patches != NULL
|
return (_cp_patches != NULL
|
||||||
&& index < _cp_patches->length()
|
&& index < _cp_patches->length()
|
||||||
@ -404,10 +402,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
|||||||
// constant pool construction, but in later versions they can.
|
// constant pool construction, but in later versions they can.
|
||||||
// %%% Let's phase out the old is_klass_reference.
|
// %%% Let's phase out the old is_klass_reference.
|
||||||
bool valid_klass_reference_at(int index) {
|
bool valid_klass_reference_at(int index) {
|
||||||
return _cp->is_within_bounds(index) &&
|
return _cp->is_within_bounds(index) && _cp->tag_at(index).is_klass_or_reference();
|
||||||
(EnableInvokeDynamic
|
|
||||||
? _cp->tag_at(index).is_klass_or_reference()
|
|
||||||
: _cp->tag_at(index).is_klass_reference());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks that the cpool index is in range and is a utf8
|
// Checks that the cpool index is in range and is a utf8
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "memory/iterator.hpp"
|
#include "memory/iterator.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "utilities/hashtable.inline.hpp"
|
#include "utilities/hashtable.inline.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -2646,7 +2646,7 @@ oop java_lang_invoke_DirectMethodHandle::member(oop dmh) {
|
|||||||
|
|
||||||
void java_lang_invoke_DirectMethodHandle::compute_offsets() {
|
void java_lang_invoke_DirectMethodHandle::compute_offsets() {
|
||||||
Klass* klass_oop = SystemDictionary::DirectMethodHandle_klass();
|
Klass* klass_oop = SystemDictionary::DirectMethodHandle_klass();
|
||||||
if (klass_oop != NULL && EnableInvokeDynamic) {
|
if (klass_oop != NULL) {
|
||||||
compute_offset(_member_offset, klass_oop, vmSymbols::member_name(), vmSymbols::java_lang_invoke_MemberName_signature());
|
compute_offset(_member_offset, klass_oop, vmSymbols::member_name(), vmSymbols::java_lang_invoke_MemberName_signature());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2668,18 +2668,15 @@ int java_lang_invoke_LambdaForm::_vmentry_offset;
|
|||||||
|
|
||||||
void java_lang_invoke_MethodHandle::compute_offsets() {
|
void java_lang_invoke_MethodHandle::compute_offsets() {
|
||||||
Klass* klass_oop = SystemDictionary::MethodHandle_klass();
|
Klass* klass_oop = SystemDictionary::MethodHandle_klass();
|
||||||
if (klass_oop != NULL && EnableInvokeDynamic) {
|
if (klass_oop != NULL) {
|
||||||
compute_offset(_type_offset, klass_oop, vmSymbols::type_name(), vmSymbols::java_lang_invoke_MethodType_signature());
|
compute_offset(_type_offset, klass_oop, vmSymbols::type_name(), vmSymbols::java_lang_invoke_MethodType_signature());
|
||||||
compute_optional_offset(_form_offset, klass_oop, vmSymbols::form_name(), vmSymbols::java_lang_invoke_LambdaForm_signature());
|
compute_offset(_form_offset, klass_oop, vmSymbols::form_name(), vmSymbols::java_lang_invoke_LambdaForm_signature());
|
||||||
if (_form_offset == 0) {
|
|
||||||
EnableInvokeDynamic = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void java_lang_invoke_MemberName::compute_offsets() {
|
void java_lang_invoke_MemberName::compute_offsets() {
|
||||||
Klass* klass_oop = SystemDictionary::MemberName_klass();
|
Klass* klass_oop = SystemDictionary::MemberName_klass();
|
||||||
if (klass_oop != NULL && EnableInvokeDynamic) {
|
if (klass_oop != NULL) {
|
||||||
compute_offset(_clazz_offset, klass_oop, vmSymbols::clazz_name(), vmSymbols::class_signature());
|
compute_offset(_clazz_offset, klass_oop, vmSymbols::clazz_name(), vmSymbols::class_signature());
|
||||||
compute_offset(_name_offset, klass_oop, vmSymbols::name_name(), vmSymbols::string_signature());
|
compute_offset(_name_offset, klass_oop, vmSymbols::name_name(), vmSymbols::string_signature());
|
||||||
compute_offset(_type_offset, klass_oop, vmSymbols::type_name(), vmSymbols::object_signature());
|
compute_offset(_type_offset, klass_oop, vmSymbols::type_name(), vmSymbols::object_signature());
|
||||||
@ -2690,7 +2687,7 @@ void java_lang_invoke_MemberName::compute_offsets() {
|
|||||||
|
|
||||||
void java_lang_invoke_LambdaForm::compute_offsets() {
|
void java_lang_invoke_LambdaForm::compute_offsets() {
|
||||||
Klass* klass_oop = SystemDictionary::LambdaForm_klass();
|
Klass* klass_oop = SystemDictionary::LambdaForm_klass();
|
||||||
if (klass_oop != NULL && EnableInvokeDynamic) {
|
if (klass_oop != NULL) {
|
||||||
compute_offset(_vmentry_offset, klass_oop, vmSymbols::vmentry_name(), vmSymbols::java_lang_invoke_MemberName_signature());
|
compute_offset(_vmentry_offset, klass_oop, vmSymbols::vmentry_name(), vmSymbols::java_lang_invoke_MemberName_signature());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2905,7 +2902,6 @@ int java_lang_invoke_MethodType::rtype_slot_count(oop mt) {
|
|||||||
int java_lang_invoke_CallSite::_target_offset;
|
int java_lang_invoke_CallSite::_target_offset;
|
||||||
|
|
||||||
void java_lang_invoke_CallSite::compute_offsets() {
|
void java_lang_invoke_CallSite::compute_offsets() {
|
||||||
if (!EnableInvokeDynamic) return;
|
|
||||||
Klass* k = SystemDictionary::CallSite_klass();
|
Klass* k = SystemDictionary::CallSite_klass();
|
||||||
if (k != NULL) {
|
if (k != NULL) {
|
||||||
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
|
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
|
||||||
@ -3296,14 +3292,12 @@ void JavaClasses::compute_offsets() {
|
|||||||
java_lang_ClassLoader::compute_offsets();
|
java_lang_ClassLoader::compute_offsets();
|
||||||
java_lang_Thread::compute_offsets();
|
java_lang_Thread::compute_offsets();
|
||||||
java_lang_ThreadGroup::compute_offsets();
|
java_lang_ThreadGroup::compute_offsets();
|
||||||
if (EnableInvokeDynamic) {
|
java_lang_invoke_MethodHandle::compute_offsets();
|
||||||
java_lang_invoke_MethodHandle::compute_offsets();
|
java_lang_invoke_DirectMethodHandle::compute_offsets();
|
||||||
java_lang_invoke_DirectMethodHandle::compute_offsets();
|
java_lang_invoke_MemberName::compute_offsets();
|
||||||
java_lang_invoke_MemberName::compute_offsets();
|
java_lang_invoke_LambdaForm::compute_offsets();
|
||||||
java_lang_invoke_LambdaForm::compute_offsets();
|
java_lang_invoke_MethodType::compute_offsets();
|
||||||
java_lang_invoke_MethodType::compute_offsets();
|
java_lang_invoke_CallSite::compute_offsets();
|
||||||
java_lang_invoke_CallSite::compute_offsets();
|
|
||||||
}
|
|
||||||
java_security_AccessControlContext::compute_offsets();
|
java_security_AccessControlContext::compute_offsets();
|
||||||
// Initialize reflection classes. The layouts of these classes
|
// Initialize reflection classes. The layouts of these classes
|
||||||
// changed with the new reflection implementation in JDK 1.4, and
|
// changed with the new reflection implementation in JDK 1.4, and
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 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
|
||||||
@ -32,12 +32,13 @@
|
|||||||
|
|
||||||
// add new entry to the table
|
// add new entry to the table
|
||||||
void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
void ResolutionErrorTable::add_entry(int index, unsigned int hash,
|
||||||
constantPoolHandle pool, int cp_index, Symbol* error)
|
constantPoolHandle pool, int cp_index,
|
||||||
|
Symbol* error, Symbol* message)
|
||||||
{
|
{
|
||||||
assert_locked_or_safepoint(SystemDictionary_lock);
|
assert_locked_or_safepoint(SystemDictionary_lock);
|
||||||
assert(!pool.is_null() && error != NULL, "adding NULL obj");
|
assert(!pool.is_null() && error != NULL, "adding NULL obj");
|
||||||
|
|
||||||
ResolutionErrorEntry* entry = new_entry(hash, pool(), cp_index, error);
|
ResolutionErrorEntry* entry = new_entry(hash, pool(), cp_index, error, message);
|
||||||
add_entry(index, entry);
|
add_entry(index, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,19 +59,26 @@ ResolutionErrorEntry* ResolutionErrorTable::find_entry(int index, unsigned int h
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ResolutionErrorEntry::set_error(Symbol* e) {
|
void ResolutionErrorEntry::set_error(Symbol* e) {
|
||||||
assert(e == NULL || _error == NULL, "cannot reset error");
|
assert(e != NULL, "must set a value");
|
||||||
_error = e;
|
_error = e;
|
||||||
if (_error != NULL) _error->increment_refcount();
|
_error->increment_refcount();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResolutionErrorEntry::set_message(Symbol* c) {
|
||||||
|
assert(c != NULL, "must set a value");
|
||||||
|
_message = c;
|
||||||
|
_message->increment_refcount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// create new error entry
|
// create new error entry
|
||||||
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, ConstantPool* pool,
|
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, ConstantPool* pool,
|
||||||
int cp_index, Symbol* error)
|
int cp_index, Symbol* error,
|
||||||
|
Symbol* message)
|
||||||
{
|
{
|
||||||
ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::new_entry(hash, pool);
|
ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<ConstantPool*, mtClass>::new_entry(hash, pool);
|
||||||
entry->set_cp_index(cp_index);
|
entry->set_cp_index(cp_index);
|
||||||
NOT_PRODUCT(entry->set_error(NULL);)
|
|
||||||
entry->set_error(error);
|
entry->set_error(error);
|
||||||
|
entry->set_message(message);
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@ -79,6 +87,7 @@ void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) {
|
|||||||
// decrement error refcount
|
// decrement error refcount
|
||||||
assert(entry->error() != NULL, "error should be set");
|
assert(entry->error() != NULL, "error should be set");
|
||||||
entry->error()->decrement_refcount();
|
entry->error()->decrement_refcount();
|
||||||
|
entry->message()->decrement_refcount();
|
||||||
Hashtable<ConstantPool*, mtClass>::free_entry(entry);
|
Hashtable<ConstantPool*, mtClass>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 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
|
||||||
@ -38,7 +38,8 @@ class ResolutionErrorTable : public Hashtable<ConstantPool*, mtClass> {
|
|||||||
public:
|
public:
|
||||||
ResolutionErrorTable(int table_size);
|
ResolutionErrorTable(int table_size);
|
||||||
|
|
||||||
ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index, Symbol* error);
|
ResolutionErrorEntry* new_entry(int hash, ConstantPool* pool, int cp_index,
|
||||||
|
Symbol* error, Symbol* message);
|
||||||
void free_entry(ResolutionErrorEntry *entry);
|
void free_entry(ResolutionErrorEntry *entry);
|
||||||
|
|
||||||
ResolutionErrorEntry* bucket(int i) {
|
ResolutionErrorEntry* bucket(int i) {
|
||||||
@ -55,7 +56,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, unsigned int hash,
|
void add_entry(int index, unsigned int hash,
|
||||||
constantPoolHandle pool, int which, Symbol* error);
|
constantPoolHandle pool, int which, Symbol* error, Symbol* message);
|
||||||
|
|
||||||
|
|
||||||
// find error given the constant pool and constant pool index
|
// find error given the constant pool and constant pool index
|
||||||
@ -79,10 +80,10 @@ class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> {
|
|||||||
private:
|
private:
|
||||||
int _cp_index;
|
int _cp_index;
|
||||||
Symbol* _error;
|
Symbol* _error;
|
||||||
|
Symbol* _message;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConstantPool* pool() const { return (ConstantPool*)literal(); }
|
ConstantPool* pool() const { return literal(); }
|
||||||
ConstantPool** pool_addr() { return (ConstantPool**)literal_addr(); }
|
|
||||||
|
|
||||||
int cp_index() const { return _cp_index; }
|
int cp_index() const { return _cp_index; }
|
||||||
void set_cp_index(int cp_index) { _cp_index = cp_index; }
|
void set_cp_index(int cp_index) { _cp_index = cp_index; }
|
||||||
@ -90,6 +91,9 @@ class ResolutionErrorEntry : public HashtableEntry<ConstantPool*, mtClass> {
|
|||||||
Symbol* error() const { return _error; }
|
Symbol* error() const { return _error; }
|
||||||
void set_error(Symbol* e);
|
void set_error(Symbol* e);
|
||||||
|
|
||||||
|
Symbol* message() const { return _message; }
|
||||||
|
void set_message(Symbol* c);
|
||||||
|
|
||||||
ResolutionErrorEntry* next() const {
|
ResolutionErrorEntry* next() const {
|
||||||
return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next();
|
return (ResolutionErrorEntry*)HashtableEntry<ConstantPool*, mtClass>::next();
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/signature.hpp"
|
#include "runtime/signature.hpp"
|
||||||
#include "services/classLoadingService.hpp"
|
#include "services/classLoadingService.hpp"
|
||||||
#include "services/threadService.hpp"
|
#include "services/threadService.hpp"
|
||||||
@ -172,12 +173,14 @@ Klass* SystemDictionary::resolve_or_fail(Symbol* class_name, Handle class_loader
|
|||||||
if (HAS_PENDING_EXCEPTION || klass == NULL) {
|
if (HAS_PENDING_EXCEPTION || klass == NULL) {
|
||||||
KlassHandle k_h(THREAD, klass);
|
KlassHandle k_h(THREAD, klass);
|
||||||
// can return a null klass
|
// can return a null klass
|
||||||
klass = handle_resolution_exception(class_name, class_loader, protection_domain, throw_error, k_h, THREAD);
|
klass = handle_resolution_exception(class_name, throw_error, k_h, THREAD);
|
||||||
}
|
}
|
||||||
return klass;
|
return klass;
|
||||||
}
|
}
|
||||||
|
|
||||||
Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, KlassHandle klass_h, TRAPS) {
|
Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name,
|
||||||
|
bool throw_error,
|
||||||
|
KlassHandle klass_h, TRAPS) {
|
||||||
if (HAS_PENDING_EXCEPTION) {
|
if (HAS_PENDING_EXCEPTION) {
|
||||||
// If we have a pending exception we forward it to the caller, unless throw_error is true,
|
// If we have a pending exception we forward it to the caller, unless throw_error is true,
|
||||||
// in which case we have to check whether the pending exception is a ClassNotFoundException,
|
// in which case we have to check whether the pending exception is a ClassNotFoundException,
|
||||||
@ -385,7 +388,7 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
|
|||||||
}
|
}
|
||||||
if (HAS_PENDING_EXCEPTION || superk_h() == NULL) {
|
if (HAS_PENDING_EXCEPTION || superk_h() == NULL) {
|
||||||
// can null superk
|
// can null superk
|
||||||
superk_h = KlassHandle(THREAD, handle_resolution_exception(class_name, class_loader, protection_domain, true, superk_h, THREAD));
|
superk_h = KlassHandle(THREAD, handle_resolution_exception(class_name, true, superk_h, THREAD));
|
||||||
}
|
}
|
||||||
|
|
||||||
return superk_h();
|
return superk_h();
|
||||||
@ -971,7 +974,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
|
|||||||
if (host_klass.not_null()) {
|
if (host_klass.not_null()) {
|
||||||
// Create a new CLD for anonymous class, that uses the same class loader
|
// Create a new CLD for anonymous class, that uses the same class loader
|
||||||
// as the host_klass
|
// as the host_klass
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
guarantee(host_klass->class_loader() == class_loader(), "should be the same");
|
guarantee(host_klass->class_loader() == class_loader(), "should be the same");
|
||||||
loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader(), CHECK_NULL);
|
loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader(), CHECK_NULL);
|
||||||
loader_data->record_dependency(host_klass(), CHECK_NULL);
|
loader_data->record_dependency(host_klass(), CHECK_NULL);
|
||||||
@ -996,7 +998,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
|
|||||||
|
|
||||||
|
|
||||||
if (host_klass.not_null() && k.not_null()) {
|
if (host_klass.not_null() && k.not_null()) {
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
k->set_host_klass(host_klass());
|
k->set_host_klass(host_klass());
|
||||||
// If it's anonymous, initialize it now, since nobody else will.
|
// If it's anonymous, initialize it now, since nobody else will.
|
||||||
|
|
||||||
@ -1877,13 +1878,7 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
|
|||||||
WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
|
WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
|
||||||
WKID jsr292_group_end = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
|
WKID jsr292_group_end = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
|
||||||
initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
|
initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
|
||||||
if (EnableInvokeDynamic) {
|
initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
|
||||||
initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
|
|
||||||
} else {
|
|
||||||
// Skip the JSR 292 classes, if not enabled.
|
|
||||||
scan = WKID(jsr292_group_end + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
|
initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
|
||||||
|
|
||||||
_box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
|
_box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
|
||||||
@ -2119,12 +2114,13 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name,
|
|||||||
|
|
||||||
// Add entry to resolution error table to record the error when the first
|
// Add entry to resolution error table to record the error when the first
|
||||||
// attempt to resolve a reference to a class has failed.
|
// attempt to resolve a reference to a class has failed.
|
||||||
void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which, Symbol* error) {
|
void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which,
|
||||||
|
Symbol* error, Symbol* message) {
|
||||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||||
int index = resolution_errors()->hash_to_index(hash);
|
int index = resolution_errors()->hash_to_index(hash);
|
||||||
{
|
{
|
||||||
MutexLocker ml(SystemDictionary_lock, Thread::current());
|
MutexLocker ml(SystemDictionary_lock, Thread::current());
|
||||||
resolution_errors()->add_entry(index, hash, pool, which, error);
|
resolution_errors()->add_entry(index, hash, pool, which, error, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2134,13 +2130,19 @@ void SystemDictionary::delete_resolution_error(ConstantPool* pool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lookup resolution error table. Returns error if found, otherwise NULL.
|
// Lookup resolution error table. Returns error if found, otherwise NULL.
|
||||||
Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which) {
|
Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which,
|
||||||
|
Symbol** message) {
|
||||||
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
unsigned int hash = resolution_errors()->compute_hash(pool, which);
|
||||||
int index = resolution_errors()->hash_to_index(hash);
|
int index = resolution_errors()->hash_to_index(hash);
|
||||||
{
|
{
|
||||||
MutexLocker ml(SystemDictionary_lock, Thread::current());
|
MutexLocker ml(SystemDictionary_lock, Thread::current());
|
||||||
ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which);
|
ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which);
|
||||||
return (entry != NULL) ? entry->error() : (Symbol*)NULL;
|
if (entry != NULL) {
|
||||||
|
*message = entry->message();
|
||||||
|
return entry->error();
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2221,7 +2223,6 @@ methodHandle SystemDictionary::find_method_handle_intrinsic(vmIntrinsics::ID iid
|
|||||||
Symbol* signature,
|
Symbol* signature,
|
||||||
TRAPS) {
|
TRAPS) {
|
||||||
methodHandle empty;
|
methodHandle empty;
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
assert(MethodHandles::is_signature_polymorphic(iid) &&
|
assert(MethodHandles::is_signature_polymorphic(iid) &&
|
||||||
MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
|
MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
|
||||||
iid != vmIntrinsics::_invokeGeneric,
|
iid != vmIntrinsics::_invokeGeneric,
|
||||||
@ -2295,7 +2296,6 @@ methodHandle SystemDictionary::find_method_handle_invoker(Symbol* name,
|
|||||||
Handle *method_type_result,
|
Handle *method_type_result,
|
||||||
TRAPS) {
|
TRAPS) {
|
||||||
methodHandle empty;
|
methodHandle empty;
|
||||||
assert(EnableInvokeDynamic, "");
|
|
||||||
assert(!THREAD->is_Compiler_thread(), "");
|
assert(!THREAD->is_Compiler_thread(), "");
|
||||||
Handle method_type =
|
Handle method_type =
|
||||||
SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
|
SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
|
||||||
|
@ -151,16 +151,16 @@ class Ticks;
|
|||||||
\
|
\
|
||||||
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
|
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
|
||||||
do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Opt ) \
|
do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Opt ) \
|
||||||
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292 ) \
|
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre ) \
|
||||||
do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292 ) \
|
do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre ) \
|
||||||
do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292 ) \
|
do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre ) \
|
||||||
do_klass(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt ) \
|
do_klass(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt ) \
|
||||||
do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292 ) \
|
do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre ) \
|
||||||
do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292 ) \
|
do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre ) \
|
||||||
do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292 ) \
|
do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre ) \
|
||||||
do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292 ) \
|
do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre ) \
|
||||||
do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292 ) \
|
do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre ) \
|
||||||
do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292 ) \
|
do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre ) \
|
||||||
/* Note: MethodHandle must be first, and VolatileCallSite last in group */ \
|
/* Note: MethodHandle must be first, and VolatileCallSite last in group */ \
|
||||||
\
|
\
|
||||||
do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \
|
do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \
|
||||||
@ -204,7 +204,6 @@ class SystemDictionary : AllStatic {
|
|||||||
|
|
||||||
enum InitOption {
|
enum InitOption {
|
||||||
Pre, // preloaded; error if not present
|
Pre, // preloaded; error if not present
|
||||||
Pre_JSR292, // preloaded if EnableInvokeDynamic
|
|
||||||
|
|
||||||
// Order is significant. Options before this point require resolve_or_fail.
|
// Order is significant. Options before this point require resolve_or_fail.
|
||||||
// Options after this point will use resolve_or_null instead.
|
// Options after this point will use resolve_or_null instead.
|
||||||
@ -228,7 +227,7 @@ class SystemDictionary : AllStatic {
|
|||||||
static Klass* resolve_or_fail(Symbol* class_name, bool throw_error, TRAPS);
|
static Klass* resolve_or_fail(Symbol* class_name, bool throw_error, TRAPS);
|
||||||
private:
|
private:
|
||||||
// handle error translation for resolve_or_null results
|
// handle error translation for resolve_or_null results
|
||||||
static Klass* handle_resolution_exception(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, KlassHandle klass_h, TRAPS);
|
static Klass* handle_resolution_exception(Symbol* class_name, bool throw_error, KlassHandle klass_h, TRAPS);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -385,7 +384,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Klass* check_klass_Pre( Klass* k) { return check_klass(k); }
|
static Klass* check_klass_Pre( Klass* k) { return check_klass(k); }
|
||||||
static Klass* check_klass_Pre_JSR292(Klass* k) { return EnableInvokeDynamic ? check_klass(k) : k; }
|
|
||||||
static Klass* check_klass_Opt( Klass* k) { return k; }
|
static Klass* check_klass_Opt( Klass* k) { return k; }
|
||||||
static Klass* check_klass_Opt_Only_JDK15(Klass* k) {
|
static Klass* check_klass_Opt_Only_JDK15(Klass* k) {
|
||||||
assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only");
|
assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only");
|
||||||
@ -531,9 +529,11 @@ public:
|
|||||||
|
|
||||||
// Record the error when the first attempt to resolve a reference from a constant
|
// Record the error when the first attempt to resolve a reference from a constant
|
||||||
// pool entry to a class fails.
|
// pool entry to a class fails.
|
||||||
static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error);
|
static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error,
|
||||||
|
Symbol* message);
|
||||||
static void delete_resolution_error(ConstantPool* pool);
|
static void delete_resolution_error(ConstantPool* pool);
|
||||||
static Symbol* find_resolution_error(constantPoolHandle pool, int which);
|
static Symbol* find_resolution_error(constantPoolHandle pool, int which,
|
||||||
|
Symbol** message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/interfaceSupport.hpp"
|
#include "runtime/interfaceSupport.hpp"
|
||||||
#include "runtime/javaCalls.hpp"
|
#include "runtime/javaCalls.hpp"
|
||||||
#include "runtime/orderAccess.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#ifdef TARGET_ARCH_x86
|
#ifdef TARGET_ARCH_x86
|
||||||
# include "bytes_x86.hpp"
|
# include "bytes_x86.hpp"
|
||||||
@ -2361,12 +2361,9 @@ void ClassVerifier::verify_invoke_instructions(
|
|||||||
// Get referenced class type
|
// Get referenced class type
|
||||||
VerificationType ref_class_type;
|
VerificationType ref_class_type;
|
||||||
if (opcode == Bytecodes::_invokedynamic) {
|
if (opcode == Bytecodes::_invokedynamic) {
|
||||||
if (!EnableInvokeDynamic ||
|
if (_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
|
||||||
_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
|
|
||||||
class_format_error(
|
class_format_error(
|
||||||
(!EnableInvokeDynamic ?
|
"invokedynamic instructions not supported by this class file version",
|
||||||
"invokedynamic instructions not enabled in this JVM" :
|
|
||||||
"invokedynamic instructions not supported by this class file version"),
|
|
||||||
_klass->external_name());
|
_klass->external_name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -775,7 +775,7 @@
|
|||||||
/* java/lang/ref/Reference */ \
|
/* java/lang/ref/Reference */ \
|
||||||
do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \
|
do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \
|
||||||
\
|
\
|
||||||
/* support for com.sum.crypto.provider.AESCrypt and some of its callers */ \
|
/* support for com.sun.crypto.provider.AESCrypt and some of its callers */ \
|
||||||
do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \
|
do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \
|
||||||
do_intrinsic(_aescrypt_encryptBlock, com_sun_crypto_provider_aescrypt, encryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
do_intrinsic(_aescrypt_encryptBlock, com_sun_crypto_provider_aescrypt, encryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
||||||
do_intrinsic(_aescrypt_decryptBlock, com_sun_crypto_provider_aescrypt, decryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
do_intrinsic(_aescrypt_decryptBlock, com_sun_crypto_provider_aescrypt, decryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/handles.hpp"
|
#include "runtime/handles.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
|
#include "runtime/thread.inline.hpp"
|
||||||
#include "utilities/copy.hpp"
|
#include "utilities/copy.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "oops/methodData.hpp"
|
#include "oops/methodData.hpp"
|
||||||
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
#include "prims/jvmtiRedefineClassesTrace.hpp"
|
||||||
#include "prims/jvmtiImpl.hpp"
|
#include "prims/jvmtiImpl.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/sharedRuntime.hpp"
|
#include "runtime/sharedRuntime.hpp"
|
||||||
#include "runtime/sweeper.hpp"
|
#include "runtime/sweeper.hpp"
|
||||||
#include "utilities/resourceHash.hpp"
|
#include "utilities/resourceHash.hpp"
|
||||||
@ -750,7 +751,11 @@ nmethod::nmethod(
|
|||||||
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
|
||||||
|
|
||||||
code_buffer->copy_values_to(this);
|
code_buffer->copy_values_to(this);
|
||||||
debug_only(verify_scavenge_root_oops());
|
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
|
||||||
|
CodeCache::add_scavenge_root_nmethod(this);
|
||||||
|
Universe::heap()->register_nmethod(this);
|
||||||
|
}
|
||||||
|
DEBUG_ONLY(verify_scavenge_root_oops();)
|
||||||
CodeCache::commit(this);
|
CodeCache::commit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2284,13 +2289,13 @@ nmethodLocker::nmethodLocker(address pc) {
|
|||||||
void nmethodLocker::lock_nmethod(nmethod* nm, bool zombie_ok) {
|
void nmethodLocker::lock_nmethod(nmethod* nm, bool zombie_ok) {
|
||||||
if (nm == NULL) return;
|
if (nm == NULL) return;
|
||||||
Atomic::inc(&nm->_lock_count);
|
Atomic::inc(&nm->_lock_count);
|
||||||
guarantee(zombie_ok || !nm->is_zombie(), "cannot lock a zombie method");
|
assert(zombie_ok || !nm->is_zombie(), "cannot lock a zombie method");
|
||||||
}
|
}
|
||||||
|
|
||||||
void nmethodLocker::unlock_nmethod(nmethod* nm) {
|
void nmethodLocker::unlock_nmethod(nmethod* nm) {
|
||||||
if (nm == NULL) return;
|
if (nm == NULL) return;
|
||||||
Atomic::dec(&nm->_lock_count);
|
Atomic::dec(&nm->_lock_count);
|
||||||
guarantee(nm->_lock_count >= 0, "unmatched nmethod lock/unlock");
|
assert(nm->_lock_count >= 0, "unmatched nmethod lock/unlock");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class nmethod : public CodeBlob {
|
|||||||
// and is not made into a zombie. However, once the nmethod is made into
|
// and is not made into a zombie. However, once the nmethod is made into
|
||||||
// a zombie, it will be locked one final time if CompiledMethodUnload
|
// a zombie, it will be locked one final time if CompiledMethodUnload
|
||||||
// event processing needs to be done.
|
// event processing needs to be done.
|
||||||
jint _lock_count;
|
volatile jint _lock_count;
|
||||||
|
|
||||||
// not_entrant method removal. Each mark_sweep pass will update
|
// not_entrant method removal. Each mark_sweep pass will update
|
||||||
// this mark to current sweep invocation count if it is seen on the
|
// this mark to current sweep invocation count if it is seen on the
|
||||||
|
@ -150,9 +150,8 @@ int CompileBroker::_sum_nmethod_code_size = 0;
|
|||||||
|
|
||||||
long CompileBroker::_peak_compilation_time = 0;
|
long CompileBroker::_peak_compilation_time = 0;
|
||||||
|
|
||||||
CompileQueue* CompileBroker::_c2_method_queue = NULL;
|
CompileQueue* CompileBroker::_c2_compile_queue = NULL;
|
||||||
CompileQueue* CompileBroker::_c1_method_queue = NULL;
|
CompileQueue* CompileBroker::_c1_compile_queue = NULL;
|
||||||
CompileTask* CompileBroker::_task_free_list = NULL;
|
|
||||||
|
|
||||||
GrowableArray<CompilerThread*>* CompileBroker::_compiler_threads = NULL;
|
GrowableArray<CompilerThread*>* CompileBroker::_compiler_threads = NULL;
|
||||||
|
|
||||||
@ -220,13 +219,56 @@ CompileTaskWrapper::~CompileTaskWrapper() {
|
|||||||
|
|
||||||
// By convention, the compiling thread is responsible for
|
// By convention, the compiling thread is responsible for
|
||||||
// recycling a non-blocking CompileTask.
|
// recycling a non-blocking CompileTask.
|
||||||
CompileBroker::free_task(task);
|
CompileTask::free(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
CompileTask* CompileTask::_task_free_list = NULL;
|
||||||
// CompileTask::initialize
|
#ifdef ASSERT
|
||||||
|
int CompileTask::_num_allocated_tasks = 0;
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* Allocate a CompileTask, from the free list if possible.
|
||||||
|
*/
|
||||||
|
CompileTask* CompileTask::allocate() {
|
||||||
|
MutexLocker locker(CompileTaskAlloc_lock);
|
||||||
|
CompileTask* task = NULL;
|
||||||
|
|
||||||
|
if (_task_free_list != NULL) {
|
||||||
|
task = _task_free_list;
|
||||||
|
_task_free_list = task->next();
|
||||||
|
task->set_next(NULL);
|
||||||
|
} else {
|
||||||
|
task = new CompileTask();
|
||||||
|
DEBUG_ONLY(_num_allocated_tasks++;)
|
||||||
|
assert (_num_allocated_tasks < 10000, "Leaking compilation tasks?");
|
||||||
|
task->set_next(NULL);
|
||||||
|
task->set_is_free(true);
|
||||||
|
}
|
||||||
|
assert(task->is_free(), "Task must be free.");
|
||||||
|
task->set_is_free(false);
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a task to the free list.
|
||||||
|
*/
|
||||||
|
void CompileTask::free(CompileTask* task) {
|
||||||
|
MutexLocker locker(CompileTaskAlloc_lock);
|
||||||
|
if (!task->is_free()) {
|
||||||
|
task->set_code(NULL);
|
||||||
|
assert(!task->lock()->is_locked(), "Should not be locked when freed");
|
||||||
|
JNIHandles::destroy_global(task->_method_holder);
|
||||||
|
JNIHandles::destroy_global(task->_hot_method_holder);
|
||||||
|
|
||||||
|
task->set_is_free(true);
|
||||||
|
task->set_next(_task_free_list);
|
||||||
|
_task_free_list = task;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CompileTask::initialize(int compile_id,
|
void CompileTask::initialize(int compile_id,
|
||||||
methodHandle method,
|
methodHandle method,
|
||||||
int osr_bci,
|
int osr_bci,
|
||||||
@ -284,15 +326,6 @@ void CompileTask::set_code(nmethod* nm) {
|
|||||||
if (nm == NULL) _code_handle = NULL; // drop the handle also
|
if (nm == NULL) _code_handle = NULL; // drop the handle also
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
|
||||||
// CompileTask::free
|
|
||||||
void CompileTask::free() {
|
|
||||||
set_code(NULL);
|
|
||||||
assert(!_lock->is_locked(), "Should not be locked when freed");
|
|
||||||
JNIHandles::destroy_global(_method_holder);
|
|
||||||
JNIHandles::destroy_global(_hot_method_holder);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CompileTask::mark_on_stack() {
|
void CompileTask::mark_on_stack() {
|
||||||
// Mark these methods as something redefine classes cannot remove.
|
// Mark these methods as something redefine classes cannot remove.
|
||||||
@ -555,9 +588,12 @@ void CompileTask::log_task_done(CompileLog* log) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Add a CompileTask to a CompileQueue
|
/**
|
||||||
|
* Add a CompileTask to a CompileQueue
|
||||||
|
*/
|
||||||
void CompileQueue::add(CompileTask* task) {
|
void CompileQueue::add(CompileTask* task) {
|
||||||
assert(lock()->owned_by_self(), "must own lock");
|
assert(lock()->owned_by_self(), "must own lock");
|
||||||
|
assert(!CompileBroker::is_compilation_disabled_forever(), "Do not add task if compilation is turned off forever");
|
||||||
|
|
||||||
task->set_next(NULL);
|
task->set_next(NULL);
|
||||||
task->set_prev(NULL);
|
task->set_prev(NULL);
|
||||||
@ -579,9 +615,7 @@ void CompileQueue::add(CompileTask* task) {
|
|||||||
// Mark the method as being in the compile queue.
|
// Mark the method as being in the compile queue.
|
||||||
task->method()->set_queued_for_compilation();
|
task->method()->set_queued_for_compilation();
|
||||||
|
|
||||||
if (CIPrintCompileQueue) {
|
NOT_PRODUCT(print();)
|
||||||
print();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LogCompilation && xtty != NULL) {
|
if (LogCompilation && xtty != NULL) {
|
||||||
task->log_task_queued();
|
task->log_task_queued();
|
||||||
@ -591,14 +625,29 @@ void CompileQueue::add(CompileTask* task) {
|
|||||||
lock()->notify_all();
|
lock()->notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileQueue::delete_all() {
|
/**
|
||||||
assert(lock()->owned_by_self(), "must own lock");
|
* Empties compilation queue by putting all compilation tasks onto
|
||||||
if (_first != NULL) {
|
* a freelist. Furthermore, the method wakes up all threads that are
|
||||||
for (CompileTask* task = _first; task != NULL; task = task->next()) {
|
* waiting on a compilation task to finish. This can happen if background
|
||||||
delete task;
|
* compilation is disabled.
|
||||||
}
|
*/
|
||||||
_first = NULL;
|
void CompileQueue::free_all() {
|
||||||
|
MutexLocker mu(lock());
|
||||||
|
CompileTask* next = _first;
|
||||||
|
|
||||||
|
// Iterate over all tasks in the compile queue
|
||||||
|
while (next != NULL) {
|
||||||
|
CompileTask* current = next;
|
||||||
|
next = current->next();
|
||||||
|
// Wake up thread that blocks on the compile task.
|
||||||
|
current->lock()->notify();
|
||||||
|
// Put the task back on the freelist.
|
||||||
|
CompileTask::free(current);
|
||||||
}
|
}
|
||||||
|
_first = NULL;
|
||||||
|
|
||||||
|
// Wake up all threads that block on the queue.
|
||||||
|
lock()->notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
@ -691,18 +740,24 @@ void CompileQueue::mark_on_stack() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
#ifndef PRODUCT
|
||||||
// CompileQueue::print
|
/**
|
||||||
|
* Print entire compilation queue.
|
||||||
|
*/
|
||||||
void CompileQueue::print() {
|
void CompileQueue::print() {
|
||||||
tty->print_cr("Contents of %s", name());
|
if (CIPrintCompileQueue) {
|
||||||
tty->print_cr("----------------------");
|
ttyLocker ttyl;
|
||||||
CompileTask* task = _first;
|
tty->print_cr("Contents of %s", name());
|
||||||
while (task != NULL) {
|
tty->print_cr("----------------------");
|
||||||
task->print_line();
|
CompileTask* task = _first;
|
||||||
task = task->next();
|
while (task != NULL) {
|
||||||
|
task->print_line();
|
||||||
|
task = task->next();
|
||||||
|
}
|
||||||
|
tty->print_cr("----------------------");
|
||||||
}
|
}
|
||||||
tty->print_cr("----------------------");
|
|
||||||
}
|
}
|
||||||
|
#endif // PRODUCT
|
||||||
|
|
||||||
CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
|
CompilerCounters::CompilerCounters(const char* thread_name, int instance, TRAPS) {
|
||||||
|
|
||||||
@ -775,9 +830,6 @@ void CompileBroker::compilation_init() {
|
|||||||
_compilers[1] = new SharkCompiler();
|
_compilers[1] = new SharkCompiler();
|
||||||
#endif // SHARK
|
#endif // SHARK
|
||||||
|
|
||||||
// Initialize the CompileTask free list
|
|
||||||
_task_free_list = NULL;
|
|
||||||
|
|
||||||
// Start the CompilerThreads
|
// Start the CompilerThreads
|
||||||
init_compiler_threads(c1_count, c2_count);
|
init_compiler_threads(c1_count, c2_count);
|
||||||
// totalTime performance counter is always created as it is required
|
// totalTime performance counter is always created as it is required
|
||||||
@ -970,11 +1022,11 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler
|
|||||||
#endif // !ZERO && !SHARK
|
#endif // !ZERO && !SHARK
|
||||||
// Initialize the compilation queue
|
// Initialize the compilation queue
|
||||||
if (c2_compiler_count > 0) {
|
if (c2_compiler_count > 0) {
|
||||||
_c2_method_queue = new CompileQueue("C2MethodQueue", MethodCompileQueue_lock);
|
_c2_compile_queue = new CompileQueue("C2 CompileQueue", MethodCompileQueue_lock);
|
||||||
_compilers[1]->set_num_compiler_threads(c2_compiler_count);
|
_compilers[1]->set_num_compiler_threads(c2_compiler_count);
|
||||||
}
|
}
|
||||||
if (c1_compiler_count > 0) {
|
if (c1_compiler_count > 0) {
|
||||||
_c1_method_queue = new CompileQueue("C1MethodQueue", MethodCompileQueue_lock);
|
_c1_compile_queue = new CompileQueue("C1 CompileQueue", MethodCompileQueue_lock);
|
||||||
_compilers[0]->set_num_compiler_threads(c1_compiler_count);
|
_compilers[0]->set_num_compiler_threads(c1_compiler_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -989,7 +1041,7 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler
|
|||||||
sprintf(name_buffer, "C2 CompilerThread%d", i);
|
sprintf(name_buffer, "C2 CompilerThread%d", i);
|
||||||
CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
|
CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
|
||||||
// Shark and C2
|
// Shark and C2
|
||||||
CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_method_queue, counters, _compilers[1], CHECK);
|
CompilerThread* new_thread = make_compiler_thread(name_buffer, _c2_compile_queue, counters, _compilers[1], CHECK);
|
||||||
_compiler_threads->append(new_thread);
|
_compiler_threads->append(new_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -998,7 +1050,7 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler
|
|||||||
sprintf(name_buffer, "C1 CompilerThread%d", i);
|
sprintf(name_buffer, "C1 CompilerThread%d", i);
|
||||||
CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
|
CompilerCounters* counters = new CompilerCounters("compilerThread", i, CHECK);
|
||||||
// C1
|
// C1
|
||||||
CompilerThread* new_thread = make_compiler_thread(name_buffer, _c1_method_queue, counters, _compilers[0], CHECK);
|
CompilerThread* new_thread = make_compiler_thread(name_buffer, _c1_compile_queue, counters, _compilers[0], CHECK);
|
||||||
_compiler_threads->append(new_thread);
|
_compiler_threads->append(new_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1008,14 +1060,19 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set the methods on the stack as on_stack so that redefine classes doesn't
|
/**
|
||||||
// reclaim them
|
* Set the methods on the stack as on_stack so that redefine classes doesn't
|
||||||
|
* reclaim them. This method is executed at a safepoint.
|
||||||
|
*/
|
||||||
void CompileBroker::mark_on_stack() {
|
void CompileBroker::mark_on_stack() {
|
||||||
if (_c2_method_queue != NULL) {
|
assert(SafepointSynchronize::is_at_safepoint(), "sanity check");
|
||||||
_c2_method_queue->mark_on_stack();
|
// Since we are at a safepoint, we do not need a lock to access
|
||||||
|
// the compile queues.
|
||||||
|
if (_c2_compile_queue != NULL) {
|
||||||
|
_c2_compile_queue->mark_on_stack();
|
||||||
}
|
}
|
||||||
if (_c1_method_queue != NULL) {
|
if (_c1_compile_queue != NULL) {
|
||||||
_c1_method_queue->mark_on_stack();
|
_c1_compile_queue->mark_on_stack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1031,7 +1088,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
|||||||
const char* comment,
|
const char* comment,
|
||||||
Thread* thread) {
|
Thread* thread) {
|
||||||
// do nothing if compiler thread(s) is not available
|
// do nothing if compiler thread(s) is not available
|
||||||
if (!_initialized ) {
|
if (!_initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1078,7 +1135,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
|||||||
|
|
||||||
// If this method is already in the compile queue, then
|
// If this method is already in the compile queue, then
|
||||||
// we do not block the current thread.
|
// we do not block the current thread.
|
||||||
if (compilation_is_in_queue(method, osr_bci)) {
|
if (compilation_is_in_queue(method)) {
|
||||||
// We may want to decay our counter a bit here to prevent
|
// We may want to decay our counter a bit here to prevent
|
||||||
// multiple denied requests for compilation. This is an
|
// multiple denied requests for compilation. This is an
|
||||||
// open compilation policy issue. Note: The other possibility,
|
// open compilation policy issue. Note: The other possibility,
|
||||||
@ -1111,7 +1168,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
|||||||
// Make sure the method has not slipped into the queues since
|
// Make sure the method has not slipped into the queues since
|
||||||
// last we checked; note that those checks were "fast bail-outs".
|
// last we checked; note that those checks were "fast bail-outs".
|
||||||
// Here we need to be more careful, see 14012000 below.
|
// Here we need to be more careful, see 14012000 below.
|
||||||
if (compilation_is_in_queue(method, osr_bci)) {
|
if (compilation_is_in_queue(method)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1132,7 +1189,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Should this thread wait for completion of the compile?
|
// Should this thread wait for completion of the compile?
|
||||||
blocking = is_compile_blocking(method, osr_bci);
|
blocking = is_compile_blocking();
|
||||||
|
|
||||||
// We will enter the compilation in the queue.
|
// We will enter the compilation in the queue.
|
||||||
// 14012000: Note that this sets the queued_for_compile bits in
|
// 14012000: Note that this sets the queued_for_compile bits in
|
||||||
@ -1324,19 +1381,17 @@ bool CompileBroker::compilation_is_complete(methodHandle method,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
/**
|
||||||
// CompileBroker::compilation_is_in_queue
|
* See if this compilation is already requested.
|
||||||
//
|
*
|
||||||
// See if this compilation is already requested.
|
* Implementation note: there is only a single "is in queue" bit
|
||||||
//
|
* for each method. This means that the check below is overly
|
||||||
// Implementation note: there is only a single "is in queue" bit
|
* conservative in the sense that an osr compilation in the queue
|
||||||
// for each method. This means that the check below is overly
|
* will block a normal compilation from entering the queue (and vice
|
||||||
// conservative in the sense that an osr compilation in the queue
|
* versa). This can be remedied by a full queue search to disambiguate
|
||||||
// will block a normal compilation from entering the queue (and vice
|
* cases. If it is deemed profitable, this may be done.
|
||||||
// versa). This can be remedied by a full queue search to disambiguate
|
*/
|
||||||
// cases. If it is deemed profitible, this may be done.
|
bool CompileBroker::compilation_is_in_queue(methodHandle method) {
|
||||||
bool CompileBroker::compilation_is_in_queue(methodHandle method,
|
|
||||||
int osr_bci) {
|
|
||||||
return method->queued_for_compilation();
|
return method->queued_for_compilation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1416,13 +1471,11 @@ int CompileBroker::assign_compile_id(methodHandle method, int osr_bci) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
// ------------------------------------------------------------------
|
* Should the current thread block until this compilation request
|
||||||
// CompileBroker::is_compile_blocking
|
* has been fulfilled?
|
||||||
//
|
*/
|
||||||
// Should the current thread be blocked until this compilation request
|
bool CompileBroker::is_compile_blocking() {
|
||||||
// has been fulfilled?
|
|
||||||
bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) {
|
|
||||||
assert(!InstanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
|
assert(!InstanceRefKlass::owns_pending_list_lock(JavaThread::current()), "possible deadlock");
|
||||||
return !BackgroundCompilation;
|
return !BackgroundCompilation;
|
||||||
}
|
}
|
||||||
@ -1450,7 +1503,7 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
|||||||
int hot_count,
|
int hot_count,
|
||||||
const char* comment,
|
const char* comment,
|
||||||
bool blocking) {
|
bool blocking) {
|
||||||
CompileTask* new_task = allocate_task();
|
CompileTask* new_task = CompileTask::allocate();
|
||||||
new_task->initialize(compile_id, method, osr_bci, comp_level,
|
new_task->initialize(compile_id, method, osr_bci, comp_level,
|
||||||
hot_method, hot_count, comment,
|
hot_method, hot_count, comment,
|
||||||
blocking);
|
blocking);
|
||||||
@ -1459,75 +1512,52 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
/**
|
||||||
// CompileBroker::allocate_task
|
* Wait for the compilation task to complete.
|
||||||
//
|
*/
|
||||||
// Allocate a CompileTask, from the free list if possible.
|
|
||||||
CompileTask* CompileBroker::allocate_task() {
|
|
||||||
MutexLocker locker(CompileTaskAlloc_lock);
|
|
||||||
CompileTask* task = NULL;
|
|
||||||
if (_task_free_list != NULL) {
|
|
||||||
task = _task_free_list;
|
|
||||||
_task_free_list = task->next();
|
|
||||||
task->set_next(NULL);
|
|
||||||
} else {
|
|
||||||
task = new CompileTask();
|
|
||||||
task->set_next(NULL);
|
|
||||||
}
|
|
||||||
return task;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
|
||||||
// CompileBroker::free_task
|
|
||||||
//
|
|
||||||
// Add a task to the free list.
|
|
||||||
void CompileBroker::free_task(CompileTask* task) {
|
|
||||||
MutexLocker locker(CompileTaskAlloc_lock);
|
|
||||||
task->free();
|
|
||||||
task->set_next(_task_free_list);
|
|
||||||
_task_free_list = task;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
|
||||||
// CompileBroker::wait_for_completion
|
|
||||||
//
|
|
||||||
// Wait for the given method CompileTask to complete.
|
|
||||||
void CompileBroker::wait_for_completion(CompileTask* task) {
|
void CompileBroker::wait_for_completion(CompileTask* task) {
|
||||||
if (CIPrintCompileQueue) {
|
if (CIPrintCompileQueue) {
|
||||||
|
ttyLocker ttyl;
|
||||||
tty->print_cr("BLOCKING FOR COMPILE");
|
tty->print_cr("BLOCKING FOR COMPILE");
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(task->is_blocking(), "can only wait on blocking task");
|
assert(task->is_blocking(), "can only wait on blocking task");
|
||||||
|
|
||||||
JavaThread *thread = JavaThread::current();
|
JavaThread* thread = JavaThread::current();
|
||||||
thread->set_blocked_on_compilation(true);
|
thread->set_blocked_on_compilation(true);
|
||||||
|
|
||||||
methodHandle method(thread, task->method());
|
methodHandle method(thread, task->method());
|
||||||
{
|
{
|
||||||
MutexLocker waiter(task->lock(), thread);
|
MutexLocker waiter(task->lock(), thread);
|
||||||
|
|
||||||
while (!task->is_complete())
|
while (!task->is_complete() && !is_compilation_disabled_forever()) {
|
||||||
task->lock()->wait();
|
task->lock()->wait();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thread->set_blocked_on_compilation(false);
|
||||||
|
if (is_compilation_disabled_forever()) {
|
||||||
|
CompileTask::free(task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// It is harmless to check this status without the lock, because
|
// It is harmless to check this status without the lock, because
|
||||||
// completion is a stable property (until the task object is recycled).
|
// completion is a stable property (until the task object is recycled).
|
||||||
assert(task->is_complete(), "Compilation should have completed");
|
assert(task->is_complete(), "Compilation should have completed");
|
||||||
assert(task->code_handle() == NULL, "must be reset");
|
assert(task->code_handle() == NULL, "must be reset");
|
||||||
|
|
||||||
thread->set_blocked_on_compilation(false);
|
|
||||||
|
|
||||||
// By convention, the waiter is responsible for recycling a
|
// By convention, the waiter is responsible for recycling a
|
||||||
// blocking CompileTask. Since there is only one waiter ever
|
// blocking CompileTask. Since there is only one waiter ever
|
||||||
// waiting on a CompileTask, we know that no one else will
|
// waiting on a CompileTask, we know that no one else will
|
||||||
// be using this CompileTask; we can free it.
|
// be using this CompileTask; we can free it.
|
||||||
free_task(task);
|
CompileTask::free(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize compiler thread(s) + compiler object(s). The postcondition
|
/**
|
||||||
// of this function is that the compiler runtimes are initialized and that
|
* Initialize compiler thread(s) + compiler object(s). The postcondition
|
||||||
//compiler threads can start compiling.
|
* of this function is that the compiler runtimes are initialized and that
|
||||||
|
* compiler threads can start compiling.
|
||||||
|
*/
|
||||||
bool CompileBroker::init_compiler_runtime() {
|
bool CompileBroker::init_compiler_runtime() {
|
||||||
CompilerThread* thread = CompilerThread::current();
|
CompilerThread* thread = CompilerThread::current();
|
||||||
AbstractCompiler* comp = thread->compiler();
|
AbstractCompiler* comp = thread->compiler();
|
||||||
@ -1564,7 +1594,6 @@ bool CompileBroker::init_compiler_runtime() {
|
|||||||
disable_compilation_forever();
|
disable_compilation_forever();
|
||||||
// If compiler initialization failed, no compiler thread that is specific to a
|
// If compiler initialization failed, no compiler thread that is specific to a
|
||||||
// particular compiler runtime will ever start to compile methods.
|
// particular compiler runtime will ever start to compile methods.
|
||||||
|
|
||||||
shutdown_compiler_runtime(comp, thread);
|
shutdown_compiler_runtime(comp, thread);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1578,9 +1607,11 @@ bool CompileBroker::init_compiler_runtime() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If C1 and/or C2 initialization failed, we shut down all compilation.
|
/**
|
||||||
// We do this to keep things simple. This can be changed if it ever turns out to be
|
* If C1 and/or C2 initialization failed, we shut down all compilation.
|
||||||
// a problem.
|
* We do this to keep things simple. This can be changed if it ever turns
|
||||||
|
* out to be a problem.
|
||||||
|
*/
|
||||||
void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) {
|
void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) {
|
||||||
// Free buffer blob, if allocated
|
// Free buffer blob, if allocated
|
||||||
if (thread->get_buffer_blob() != NULL) {
|
if (thread->get_buffer_blob() != NULL) {
|
||||||
@ -1592,28 +1623,25 @@ void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerTh
|
|||||||
// There are two reasons for shutting down the compiler
|
// There are two reasons for shutting down the compiler
|
||||||
// 1) compiler runtime initialization failed
|
// 1) compiler runtime initialization failed
|
||||||
// 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing
|
// 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing
|
||||||
warning("Shutting down compiler %s (no space to run compilers)", comp->name());
|
warning("%s initialization failed. Shutting down all compilers", comp->name());
|
||||||
|
|
||||||
// Only one thread per compiler runtime object enters here
|
// Only one thread per compiler runtime object enters here
|
||||||
// Set state to shut down
|
// Set state to shut down
|
||||||
comp->set_shut_down();
|
comp->set_shut_down();
|
||||||
|
|
||||||
MutexLocker mu(MethodCompileQueue_lock, thread);
|
// Delete all queued compilation tasks to make compiler threads exit faster.
|
||||||
CompileQueue* queue;
|
if (_c1_compile_queue != NULL) {
|
||||||
if (_c1_method_queue != NULL) {
|
_c1_compile_queue->free_all();
|
||||||
_c1_method_queue->delete_all();
|
|
||||||
queue = _c1_method_queue;
|
|
||||||
_c1_method_queue = NULL;
|
|
||||||
delete _c1_method_queue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_c2_method_queue != NULL) {
|
if (_c2_compile_queue != NULL) {
|
||||||
_c2_method_queue->delete_all();
|
_c2_compile_queue->free_all();
|
||||||
queue = _c2_method_queue;
|
|
||||||
_c2_method_queue = NULL;
|
|
||||||
delete _c2_method_queue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set flags so that we continue execution with using interpreter only.
|
||||||
|
UseCompiler = false;
|
||||||
|
UseInterpreter = true;
|
||||||
|
|
||||||
// We could delete compiler runtimes also. However, there are references to
|
// We could delete compiler runtimes also. However, there are references to
|
||||||
// the compiler runtime(s) (e.g., nmethod::is_compiled_by_c1()) which then
|
// the compiler runtime(s) (e.g., nmethod::is_compiled_by_c1()) which then
|
||||||
// fail. This can be done later if necessary.
|
// fail. This can be done later if necessary.
|
||||||
|
@ -40,6 +40,11 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
|||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static CompileTask* _task_free_list;
|
||||||
|
#ifdef ASSERT
|
||||||
|
static int _num_allocated_tasks;
|
||||||
|
#endif
|
||||||
|
|
||||||
Monitor* _lock;
|
Monitor* _lock;
|
||||||
uint _compile_id;
|
uint _compile_id;
|
||||||
Method* _method;
|
Method* _method;
|
||||||
@ -52,7 +57,7 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
|||||||
int _num_inlined_bytecodes;
|
int _num_inlined_bytecodes;
|
||||||
nmethodLocker* _code_handle; // holder of eventual result
|
nmethodLocker* _code_handle; // holder of eventual result
|
||||||
CompileTask* _next, *_prev;
|
CompileTask* _next, *_prev;
|
||||||
|
bool _is_free;
|
||||||
// Fields used for logging why the compilation was initiated:
|
// Fields used for logging why the compilation was initiated:
|
||||||
jlong _time_queued; // in units of os::elapsed_counter()
|
jlong _time_queued; // in units of os::elapsed_counter()
|
||||||
Method* _hot_method; // which method actually triggered this task
|
Method* _hot_method; // which method actually triggered this task
|
||||||
@ -69,7 +74,8 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
|||||||
methodHandle hot_method, int hot_count, const char* comment,
|
methodHandle hot_method, int hot_count, const char* comment,
|
||||||
bool is_blocking);
|
bool is_blocking);
|
||||||
|
|
||||||
void free();
|
static CompileTask* allocate();
|
||||||
|
static void free(CompileTask* task);
|
||||||
|
|
||||||
int compile_id() const { return _compile_id; }
|
int compile_id() const { return _compile_id; }
|
||||||
Method* method() const { return _method; }
|
Method* method() const { return _method; }
|
||||||
@ -98,6 +104,8 @@ class CompileTask : public CHeapObj<mtCompiler> {
|
|||||||
void set_next(CompileTask* next) { _next = next; }
|
void set_next(CompileTask* next) { _next = next; }
|
||||||
CompileTask* prev() const { return _prev; }
|
CompileTask* prev() const { return _prev; }
|
||||||
void set_prev(CompileTask* prev) { _prev = prev; }
|
void set_prev(CompileTask* prev) { _prev = prev; }
|
||||||
|
bool is_free() const { return _is_free; }
|
||||||
|
void set_is_free(bool val) { _is_free = val; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level,
|
static void print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level,
|
||||||
@ -213,8 +221,8 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
|||||||
|
|
||||||
// Redefine Classes support
|
// Redefine Classes support
|
||||||
void mark_on_stack();
|
void mark_on_stack();
|
||||||
void delete_all();
|
void free_all();
|
||||||
void print();
|
NOT_PRODUCT (void print();)
|
||||||
|
|
||||||
~CompileQueue() {
|
~CompileQueue() {
|
||||||
assert (is_empty(), " Compile Queue must be empty");
|
assert (is_empty(), " Compile Queue must be empty");
|
||||||
@ -267,9 +275,8 @@ class CompileBroker: AllStatic {
|
|||||||
static int _last_compile_level;
|
static int _last_compile_level;
|
||||||
static char _last_method_compiled[name_buffer_length];
|
static char _last_method_compiled[name_buffer_length];
|
||||||
|
|
||||||
static CompileQueue* _c2_method_queue;
|
static CompileQueue* _c2_compile_queue;
|
||||||
static CompileQueue* _c1_method_queue;
|
static CompileQueue* _c1_compile_queue;
|
||||||
static CompileTask* _task_free_list;
|
|
||||||
|
|
||||||
static GrowableArray<CompilerThread*>* _compiler_threads;
|
static GrowableArray<CompilerThread*>* _compiler_threads;
|
||||||
|
|
||||||
@ -322,7 +329,7 @@ class CompileBroker: AllStatic {
|
|||||||
static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
|
static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
|
||||||
static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
|
static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
|
||||||
static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
|
static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
|
||||||
static bool is_compile_blocking (methodHandle method, int osr_bci);
|
static bool is_compile_blocking ();
|
||||||
static void preload_classes (methodHandle method, TRAPS);
|
static void preload_classes (methodHandle method, TRAPS);
|
||||||
|
|
||||||
static CompileTask* create_compile_task(CompileQueue* queue,
|
static CompileTask* create_compile_task(CompileQueue* queue,
|
||||||
@ -334,8 +341,6 @@ class CompileBroker: AllStatic {
|
|||||||
int hot_count,
|
int hot_count,
|
||||||
const char* comment,
|
const char* comment,
|
||||||
bool blocking);
|
bool blocking);
|
||||||
static CompileTask* allocate_task();
|
|
||||||
static void free_task(CompileTask* task);
|
|
||||||
static void wait_for_completion(CompileTask* task);
|
static void wait_for_completion(CompileTask* task);
|
||||||
|
|
||||||
static void invoke_compiler_on_method(CompileTask* task);
|
static void invoke_compiler_on_method(CompileTask* task);
|
||||||
@ -353,8 +358,8 @@ class CompileBroker: AllStatic {
|
|||||||
const char* comment,
|
const char* comment,
|
||||||
Thread* thread);
|
Thread* thread);
|
||||||
static CompileQueue* compile_queue(int comp_level) {
|
static CompileQueue* compile_queue(int comp_level) {
|
||||||
if (is_c2_compile(comp_level)) return _c2_method_queue;
|
if (is_c2_compile(comp_level)) return _c2_compile_queue;
|
||||||
if (is_c1_compile(comp_level)) return _c1_method_queue;
|
if (is_c1_compile(comp_level)) return _c1_compile_queue;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
static bool init_compiler_runtime();
|
static bool init_compiler_runtime();
|
||||||
@ -372,7 +377,7 @@ class CompileBroker: AllStatic {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool compilation_is_in_queue(methodHandle method, int osr_bci);
|
static bool compilation_is_in_queue(methodHandle method);
|
||||||
static int queue_size(int comp_level) {
|
static int queue_size(int comp_level) {
|
||||||
CompileQueue *q = compile_queue(comp_level);
|
CompileQueue *q = compile_queue(comp_level);
|
||||||
return q != NULL ? q->size() : 0;
|
return q != NULL ? q->size() : 0;
|
||||||
|
@ -467,7 +467,6 @@ void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) {
|
|||||||
assert(cb != NULL, "no codeblob");
|
assert(cb != NULL, "no codeblob");
|
||||||
|
|
||||||
// Any reg might be saved by a safepoint handler (see generate_handler_blob).
|
// Any reg might be saved by a safepoint handler (see generate_handler_blob).
|
||||||
const int max_saved_on_entry_reg_count = ConcreteRegisterImpl::number_of_registers;
|
|
||||||
assert( reg_map->_update_for_id == NULL || fr->is_older(reg_map->_update_for_id),
|
assert( reg_map->_update_for_id == NULL || fr->is_older(reg_map->_update_for_id),
|
||||||
"already updated this map; do not 'update' it twice!" );
|
"already updated this map; do not 'update' it twice!" );
|
||||||
debug_only(reg_map->_update_for_id = fr->id());
|
debug_only(reg_map->_update_for_id = fr->id());
|
||||||
@ -477,27 +476,20 @@ void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) {
|
|||||||
!cb->caller_must_gc_arguments(reg_map->thread())),
|
!cb->caller_must_gc_arguments(reg_map->thread())),
|
||||||
"include_argument_oops should already be set");
|
"include_argument_oops should already be set");
|
||||||
|
|
||||||
int nof_callee = 0;
|
|
||||||
oop* locs[2*max_saved_on_entry_reg_count+1];
|
|
||||||
VMReg regs[2*max_saved_on_entry_reg_count+1];
|
|
||||||
// ("+1" because max_saved_on_entry_reg_count might be zero)
|
|
||||||
|
|
||||||
// Scan through oopmap and find location of all callee-saved registers
|
// Scan through oopmap and find location of all callee-saved registers
|
||||||
// (we do not do update in place, since info could be overwritten)
|
// (we do not do update in place, since info could be overwritten)
|
||||||
|
|
||||||
address pc = fr->pc();
|
address pc = fr->pc();
|
||||||
|
|
||||||
OopMap* map = cb->oop_map_for_return_address(pc);
|
OopMap* map = cb->oop_map_for_return_address(pc);
|
||||||
|
assert(map != NULL, "no ptr map found");
|
||||||
|
DEBUG_ONLY(int nof_callee = 0;)
|
||||||
|
|
||||||
assert(map != NULL, " no ptr map found");
|
for (OopMapStream oms(map, OopMapValue::callee_saved_value); !oms.is_done(); oms.next()) {
|
||||||
|
OopMapValue omv = oms.current();
|
||||||
OopMapValue omv;
|
VMReg reg = omv.content_reg();
|
||||||
for(OopMapStream oms(map,OopMapValue::callee_saved_value); !oms.is_done(); oms.next()) {
|
oop* loc = fr->oopmapreg_to_location(omv.reg(), reg_map);
|
||||||
omv = oms.current();
|
reg_map->set_location(reg, (address) loc);
|
||||||
assert(nof_callee < 2*max_saved_on_entry_reg_count, "overflow");
|
DEBUG_ONLY(nof_callee++;)
|
||||||
regs[nof_callee] = omv.content_reg();
|
|
||||||
locs[nof_callee] = fr->oopmapreg_to_location(omv.reg(),reg_map);
|
|
||||||
nof_callee++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that runtime stubs save all callee-saved registers
|
// Check that runtime stubs save all callee-saved registers
|
||||||
@ -506,11 +498,6 @@ void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) {
|
|||||||
(nof_callee >= SAVED_ON_ENTRY_REG_COUNT || nof_callee >= C_SAVED_ON_ENTRY_REG_COUNT),
|
(nof_callee >= SAVED_ON_ENTRY_REG_COUNT || nof_callee >= C_SAVED_ON_ENTRY_REG_COUNT),
|
||||||
"must save all");
|
"must save all");
|
||||||
#endif // COMPILER2
|
#endif // COMPILER2
|
||||||
|
|
||||||
// Copy found callee-saved register to reg_map
|
|
||||||
for(int i = 0; i < nof_callee; i++) {
|
|
||||||
reg_map->set_location(regs[i], (address)locs[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -158,7 +158,7 @@ void AdaptiveFreeList<Chunk>::verify_stats() const {
|
|||||||
" coal_deaths(" SIZE_FORMAT ")"
|
" coal_deaths(" SIZE_FORMAT ")"
|
||||||
" + count(" SSIZE_FORMAT ")",
|
" + count(" SSIZE_FORMAT ")",
|
||||||
this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
|
this, size(), _allocation_stats.prev_sweep(), _allocation_stats.split_births(),
|
||||||
_allocation_stats.split_births(), _allocation_stats.split_deaths(),
|
_allocation_stats.coal_births(), _allocation_stats.split_deaths(),
|
||||||
_allocation_stats.coal_deaths(), count()));
|
_allocation_stats.coal_deaths(), count()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "memory/collectorPolicy.hpp"
|
#include "memory/collectorPolicy.hpp"
|
||||||
|
|
||||||
class ConcurrentMarkSweepPolicy : public TwoGenerationCollectorPolicy {
|
class ConcurrentMarkSweepPolicy : public GenCollectorPolicy {
|
||||||
protected:
|
protected:
|
||||||
void initialize_alignments();
|
void initialize_alignments();
|
||||||
void initialize_generations();
|
void initialize_generations();
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/init.hpp"
|
#include "runtime/init.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#include "utilities/copy.hpp"
|
#include "utilities/copy.hpp"
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
#include "runtime/globals_extension.hpp"
|
#include "runtime/globals_extension.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#include "services/memoryService.hpp"
|
#include "services/memoryService.hpp"
|
||||||
#include "services/runtimeService.hpp"
|
#include "services/runtimeService.hpp"
|
||||||
@ -1560,7 +1561,7 @@ bool CMSCollector::shouldConcurrentCollect() {
|
|||||||
// this is not likely to be productive in practice because it's probably too
|
// this is not likely to be productive in practice because it's probably too
|
||||||
// late anyway.
|
// late anyway.
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
assert(gch->collector_policy()->is_two_generation_policy(),
|
assert(gch->collector_policy()->is_generation_policy(),
|
||||||
"You may want to check the correctness of the following");
|
"You may want to check the correctness of the following");
|
||||||
if (gch->incremental_collection_will_fail(true /* consult_young */)) {
|
if (gch->incremental_collection_will_fail(true /* consult_young */)) {
|
||||||
if (Verbose && PrintGCDetails) {
|
if (Verbose && PrintGCDetails) {
|
||||||
@ -1964,7 +1965,7 @@ void CMSCollector::decide_foreground_collection_type(
|
|||||||
// has exceeded the threshold set by CMSFullGCsBeforeCompaction,
|
// has exceeded the threshold set by CMSFullGCsBeforeCompaction,
|
||||||
// or if an incremental collection has failed
|
// or if an incremental collection has failed
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
assert(gch->collector_policy()->is_two_generation_policy(),
|
assert(gch->collector_policy()->is_generation_policy(),
|
||||||
"You may want to check the correctness of the following");
|
"You may want to check the correctness of the following");
|
||||||
// Inform cms gen if this was due to partial collection failing.
|
// Inform cms gen if this was due to partial collection failing.
|
||||||
// The CMS gen may use this fact to determine its expansion policy.
|
// The CMS gen may use this fact to determine its expansion policy.
|
||||||
|
@ -223,12 +223,6 @@ void ConcurrentMarkSweepThread::threads_do(ThreadClosure* tc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentMarkSweepThread::print_on(outputStream* st) const {
|
|
||||||
st->print("\"%s\" ", name());
|
|
||||||
Thread::print_on(st);
|
|
||||||
st->cr();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConcurrentMarkSweepThread::print_all_on(outputStream* st) {
|
void ConcurrentMarkSweepThread::print_all_on(outputStream* st) {
|
||||||
if (_cmst != NULL) {
|
if (_cmst != NULL) {
|
||||||
_cmst->print_on(st);
|
_cmst->print_on(st);
|
||||||
|
@ -94,8 +94,6 @@ class ConcurrentMarkSweepThread: public ConcurrentGCThread {
|
|||||||
static void threads_do(ThreadClosure* tc);
|
static void threads_do(ThreadClosure* tc);
|
||||||
|
|
||||||
// Printing
|
// Printing
|
||||||
void print_on(outputStream* st) const;
|
|
||||||
void print() const { print_on(tty); }
|
|
||||||
static void print_all_on(outputStream* st);
|
static void print_all_on(outputStream* st);
|
||||||
static void print_all() { print_all_on(tty); }
|
static void print_all() { print_all_on(tty); }
|
||||||
|
|
||||||
|
@ -58,6 +58,9 @@ ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *nex
|
|||||||
}
|
}
|
||||||
initialize();
|
initialize();
|
||||||
create_and_start();
|
create_and_start();
|
||||||
|
|
||||||
|
// set name
|
||||||
|
set_name("G1 Concurrent Refinement Thread#%d", worker_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentG1RefineThread::initialize() {
|
void ConcurrentG1RefineThread::initialize() {
|
||||||
@ -247,12 +250,3 @@ void ConcurrentG1RefineThread::stop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentG1RefineThread::print() const {
|
|
||||||
print_on(tty);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConcurrentG1RefineThread::print_on(outputStream* st) const {
|
|
||||||
st->print("\"G1 Concurrent Refinement Thread#%d\" ", _worker_id);
|
|
||||||
Thread::print_on(st);
|
|
||||||
st->cr();
|
|
||||||
}
|
|
||||||
|
@ -77,10 +77,6 @@ public:
|
|||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
// Printing
|
|
||||||
void print() const;
|
|
||||||
void print_on(outputStream* st) const;
|
|
||||||
|
|
||||||
// Total virtual time so far.
|
// Total virtual time so far.
|
||||||
double vtime_accum() { return _vtime_accum; }
|
double vtime_accum() { return _vtime_accum; }
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
|
|||||||
_in_progress(false),
|
_in_progress(false),
|
||||||
_vtime_accum(0.0),
|
_vtime_accum(0.0),
|
||||||
_vtime_mark_accum(0.0) {
|
_vtime_mark_accum(0.0) {
|
||||||
|
|
||||||
|
set_name("G1 Main Concurrent Mark GC Thread");
|
||||||
create_and_start();
|
create_and_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,16 +324,6 @@ void ConcurrentMarkThread::stop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentMarkThread::print() const {
|
|
||||||
print_on(tty);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConcurrentMarkThread::print_on(outputStream* st) const {
|
|
||||||
st->print("\"G1 Main Concurrent Mark GC Thread\" ");
|
|
||||||
Thread::print_on(st);
|
|
||||||
st->cr();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConcurrentMarkThread::sleepBeforeNextCycle() {
|
void ConcurrentMarkThread::sleepBeforeNextCycle() {
|
||||||
// We join here because we don't want to do the "shouldConcurrentMark()"
|
// We join here because we don't want to do the "shouldConcurrentMark()"
|
||||||
// below while the world is otherwise stopped.
|
// below while the world is otherwise stopped.
|
||||||
|
@ -60,10 +60,6 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
static void makeSurrogateLockerThread(TRAPS);
|
static void makeSurrogateLockerThread(TRAPS);
|
||||||
static SurrogateLockerThread* slt() { return _slt; }
|
static SurrogateLockerThread* slt() { return _slt; }
|
||||||
|
|
||||||
// Printing
|
|
||||||
void print_on(outputStream* st) const;
|
|
||||||
void print() const;
|
|
||||||
|
|
||||||
// Total virtual time so far.
|
// Total virtual time so far.
|
||||||
double vtime_accum();
|
double vtime_accum();
|
||||||
// Marking virtual time so far
|
// Marking virtual time so far
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc_implementation/g1/g1AllocRegion.inline.hpp"
|
#include "gc_implementation/g1/g1AllocRegion.inline.hpp"
|
||||||
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
|
|
||||||
G1CollectedHeap* G1AllocRegion::_g1h = NULL;
|
G1CollectedHeap* G1AllocRegion::_g1h = NULL;
|
||||||
HeapRegion* G1AllocRegion::_dummy_region = NULL;
|
HeapRegion* G1AllocRegion::_dummy_region = NULL;
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
#include "memory/referenceProcessor.hpp"
|
#include "memory/referenceProcessor.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "oops/oop.pcgc.inline.hpp"
|
#include "oops/oop.pcgc.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/vmThread.hpp"
|
#include "runtime/vmThread.hpp"
|
||||||
#include "utilities/globalDefinitions.hpp"
|
#include "utilities/globalDefinitions.hpp"
|
||||||
#include "utilities/ticks.hpp"
|
#include "utilities/ticks.hpp"
|
||||||
|
@ -1107,20 +1107,11 @@ public:
|
|||||||
return _gc_time_stamp;
|
return _gc_time_stamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset_gc_time_stamp() {
|
inline void reset_gc_time_stamp();
|
||||||
_gc_time_stamp = 0;
|
|
||||||
OrderAccess::fence();
|
|
||||||
// Clear the cached CSet starting regions and time stamps.
|
|
||||||
// Their validity is dependent on the GC timestamp.
|
|
||||||
clear_cset_start_regions();
|
|
||||||
}
|
|
||||||
|
|
||||||
void check_gc_time_stamps() PRODUCT_RETURN;
|
void check_gc_time_stamps() PRODUCT_RETURN;
|
||||||
|
|
||||||
void increment_gc_time_stamp() {
|
inline void increment_gc_time_stamp();
|
||||||
++_gc_time_stamp;
|
|
||||||
OrderAccess::fence();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the given region's GC timestamp. If it's starts humongous,
|
// Reset the given region's GC timestamp. If it's starts humongous,
|
||||||
// also reset the GC timestamp of its corresponding
|
// also reset the GC timestamp of its corresponding
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
||||||
#include "gc_implementation/g1/heapRegionSet.inline.hpp"
|
#include "gc_implementation/g1/heapRegionSet.inline.hpp"
|
||||||
#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
|
#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "utilities/taskqueue.hpp"
|
#include "utilities/taskqueue.hpp"
|
||||||
|
|
||||||
// Inline functions for G1CollectedHeap
|
// Inline functions for G1CollectedHeap
|
||||||
@ -60,6 +61,19 @@ G1CollectedHeap::heap_region_containing(const T addr) const {
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void G1CollectedHeap::reset_gc_time_stamp() {
|
||||||
|
_gc_time_stamp = 0;
|
||||||
|
OrderAccess::fence();
|
||||||
|
// Clear the cached CSet starting regions and time stamps.
|
||||||
|
// Their validity is dependent on the GC timestamp.
|
||||||
|
clear_cset_start_regions();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void G1CollectedHeap::increment_gc_time_stamp() {
|
||||||
|
++_gc_time_stamp;
|
||||||
|
OrderAccess::fence();
|
||||||
|
}
|
||||||
|
|
||||||
inline void G1CollectedHeap::old_set_remove(HeapRegion* hr) {
|
inline void G1CollectedHeap::old_set_remove(HeapRegion* hr) {
|
||||||
_old_set.remove(hr);
|
_old_set.remove(hr);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "gc_implementation/g1/heapRegion.hpp"
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "gc_implementation/g1/satbQueue.hpp"
|
#include "gc_implementation/g1/satbQueue.hpp"
|
||||||
#include "runtime/mutexLocker.hpp"
|
#include "runtime/mutexLocker.hpp"
|
||||||
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
|
|
||||||
G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap,
|
G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap,
|
||||||
|
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