Merge
This commit is contained in:
commit
9c3e5a2081
4
.hgtags
4
.hgtags
@ -154,3 +154,7 @@ e070119aa56ee4dc5506c19d2c4d2eecab8ad429 jdk8-b29
|
||||
23da7804aca0c9c4e6e86532a1453125a76d95ee jdk8-b30
|
||||
bac81e9f7d57b75fba5ab31b571f3fe0dc08af69 jdk8-b31
|
||||
2c5208ccb863db936eab523f49450b3fcd230348 jdk8-b32
|
||||
a6e6d42203e6d35f9e8b31eac25b0021b4dd58ad jdk8-b33
|
||||
0ae89825c75c9492e44efb3aca3d9ee3d8a209df jdk8-b34
|
||||
f151d5833912a82cd4f203944da0305c3be83ecc jdk8-b35
|
||||
98ce9816ae089c959ba1e70fba98423a31c4e9fa jdk8-b36
|
||||
|
@ -154,3 +154,7 @@ cc771d92284f71765eca14d6d08703c4af254c04 jdk8-b21
|
||||
6cea54809b51db92979c22fd8aa8fcb1cb13d12e jdk8-b30
|
||||
0b66f43b89a6c0ac1c15d7ec51992c541cdc9089 jdk8-b31
|
||||
88176171e940f02916a312c265a34c32552a8376 jdk8-b32
|
||||
42f275168fa5d9e7c70b246614dca8cf81f52c2e jdk8-b33
|
||||
894a478d2c4819a1a0f230bd7bdd09f3b2de9a8c jdk8-b34
|
||||
5285317ebb4e8e4f6d8d52b5616fa801e2ea844d jdk8-b35
|
||||
6a6ba0a07f33d37a2f97b1107e60c6a9a69ec84d jdk8-b36
|
||||
|
26
common/autoconf/Makefile.in
Normal file
26
common/autoconf/Makefile.in
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Generated Makefile @DATE_WHEN_CONFIGURED@
|
||||
SPEC:=@OUTPUT_ROOT@/spec.gmk
|
||||
include @SRC_ROOT@/common/makefiles/Makefile
|
26
common/autoconf/autogen.sh
Normal file
26
common/autoconf/autogen.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
autoconf configure.ac > configure
|
||||
rm -rf config.status config.log autom4te.cache
|
1531
common/autoconf/build-aux/config.guess
vendored
Normal file
1531
common/autoconf/build-aux/config.guess
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1658
common/autoconf/build-aux/config.sub
vendored
Normal file
1658
common/autoconf/build-aux/config.sub
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
common/autoconf/build-aux/install.sh
Normal file
5
common/autoconf/build-aux/install.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
echo >&2 "No suitable 'install' command found.'"
|
||||
echo >&2 "If automake is installed, running 'automake -fa'"
|
||||
echo >&2 "(and ignoring the errors) might produce one."
|
||||
exit 1
|
155
common/autoconf/build-aux/pkg.m4
Normal file
155
common/autoconf/build-aux/pkg.m4
Normal file
@ -0,0 +1,155 @@
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
# ----------------------------------
|
||||
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
||||
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=m4_default([$1], [0.9.0])
|
||||
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi[]dnl
|
||||
])# PKG_PROG_PKG_CONFIG
|
||||
|
||||
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
# Check to see whether a particular set of modules exists. Similar
|
||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
#
|
||||
#
|
||||
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
||||
# this or PKG_CHECK_MODULES is called, or make sure to call
|
||||
# PKG_CHECK_EXISTS manually
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
m4_ifval([$2], [$2], [:])
|
||||
m4_ifvaln([$3], [else
|
||||
$3])dnl
|
||||
fi])
|
||||
|
||||
|
||||
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
# ---------------------------------------------
|
||||
m4_define([_PKG_CONFIG],
|
||||
[if test -n "$$1"; then
|
||||
pkg_cv_[]$1="$$1"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
PKG_CHECK_EXISTS([$3],
|
||||
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
||||
[pkg_failed=yes])
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi[]dnl
|
||||
])# _PKG_CONFIG
|
||||
|
||||
# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
# -----------------------------
|
||||
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi[]dnl
|
||||
])# _PKG_SHORT_ERRORS_SUPPORTED
|
||||
|
||||
|
||||
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
# [ACTION-IF-NOT-FOUND])
|
||||
#
|
||||
#
|
||||
# Note that if there is a possibility the first call to
|
||||
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
#
|
||||
#
|
||||
# --------------------------------------------------------------
|
||||
AC_DEFUN([PKG_CHECK_MODULES],
|
||||
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
|
||||
pkg_failed=no
|
||||
AC_MSG_CHECKING([for $1])
|
||||
|
||||
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
|
||||
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.])
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
_PKG_SHORT_ERRORS_SUPPORTED
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
|
||||
else
|
||||
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
ifelse([$4], , [AC_MSG_ERROR(dnl
|
||||
[Package requirements ($2) were not met:
|
||||
|
||||
$$1_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
_PKG_TEXT
|
||||
])],
|
||||
[AC_MSG_RESULT([no])
|
||||
$4])
|
||||
elif test $pkg_failed = untried; then
|
||||
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
||||
[The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
_PKG_TEXT
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
|
||||
[$4])
|
||||
else
|
||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
AC_MSG_RESULT([yes])
|
||||
ifelse([$3], , :, [$3])
|
||||
fi[]dnl
|
||||
])# PKG_CHECK_MODULES
|
66
common/autoconf/builddeps.conf.example
Normal file
66
common/autoconf/builddeps.conf.example
Normal file
@ -0,0 +1,66 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This is a configuration example using builddeps
|
||||
# that are downloaded from an ftp server.
|
||||
# This is how you use it:
|
||||
|
||||
#configure --with-builddeps-server=ftp://builddeps.server/adir \
|
||||
# --with-builddeps-conf=..../builddeps.conf.example
|
||||
# --with-builddeps-dir=/localdisk/mybuilddeps
|
||||
|
||||
# Translate a configuration triplet/quadruplet into something
|
||||
# known by this configuration file.
|
||||
# If no rewrite was found, then rewritten_host=${host}
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
# The needed cups builddeps are host independent header files.
|
||||
# I.e. they need not be part of the devkit.
|
||||
builddep_cups=lib/cups_1_3_9.zip
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
|
||||
# The devkit is the cross compiler tools and sys-roots
|
||||
# for the build platform.
|
||||
builddep_devkit=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
|
||||
# The freetype dependency is partyl host dependent.
|
||||
# It is stored inside the sys-root.
|
||||
builddep_freetype2=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_host}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_LIBS=-lfreetype
|
||||
|
||||
# There are many other build dependencies, but they are implicitly
|
||||
# found inside the devkit sys-root.
|
||||
|
||||
# The boot jdk runs on the build system and is used to compile and run
|
||||
# Java build tools and of course, the bootstrap javac.
|
||||
builddep_bootjdk_BUILD_i386_pc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_pc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_i686_unknown_linux_gnu=java/jdk-7u2-fcs-bin-b13-linux-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_unknown_linux_gnu=java/jdk-7u2-fcs-bin-b13-linux-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_sparc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-sparc-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_sparcv9_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-sparcv9-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_i386_pc_windows=java/jdk-7u2-fcs-bin-b13-windows-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_pc_windows=java/jdk-7u2-fcs-bin-b13-windows-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_ROOT=${depdir}/jdk7_02/jdk1.7.0_02
|
43
common/autoconf/builddeps.conf.nfs.example
Normal file
43
common/autoconf/builddeps.conf.nfs.example
Normal file
@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This is a configuration example using an nfs-mount /java
|
||||
# it will use the builddeps directly from the nfs mounted directory.
|
||||
# This is how you use it:
|
||||
|
||||
#configure --with-builddeps-conf=..../builddeps.conf.nfs.example
|
||||
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
DEVTOOLS=/java/devtools
|
||||
|
||||
builddep_cups=${DEVTOOLS}/linux/cups/include
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
|
||||
JDK_ROOT=/java/re/jdk/7u4/latest/binaries
|
||||
builddep_bootjdk_BUILD_i386_pc_solaris2=${JDK_ROOT}/solaris-i586
|
||||
builddep_bootjdk_BUILD_x86_64_pc_solaris2=${JDK_ROOT}/solaris-amd64
|
||||
builddep_bootjdk_BUILD_i686_unknown_linux_gnu=${JDK_ROOT}/linux-i586
|
||||
builddep_bootjdk_BUILD_x86_64_unknown_linux_gnu=${JDK_ROOT}/linux-amd64
|
||||
builddep_bootjdk_ROOT=
|
231
common/autoconf/builddeps.m4
Normal file
231
common/autoconf/builddeps.m4
Normal file
@ -0,0 +1,231 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
[
|
||||
define(LIST_OF_BUILD_DEPENDENCIES,)
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
if test "x$with_builddeps_conf" != x; then
|
||||
AC_MSG_CHECKING([for supplied builddeps configuration file])
|
||||
builddepsfile=$with_builddeps_conf
|
||||
if test -s $builddepsfile; then
|
||||
. $builddepsfile
|
||||
AC_MSG_RESULT([loaded!])
|
||||
else
|
||||
AC_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING([for builddeps.conf files in sources...])
|
||||
builddepsfile=`mktemp`
|
||||
touch $builddepsfile
|
||||
# Put all found confs into a single file.
|
||||
find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile
|
||||
# Source the file to acquire the variables
|
||||
if test -s $builddepsfile; then
|
||||
. $builddepsfile
|
||||
AC_MSG_RESULT([found at least one!])
|
||||
else
|
||||
AC_ERROR([Could not find any builddeps.conf at all!])
|
||||
fi
|
||||
fi
|
||||
# Create build and host names that use _ instead of "-" and ".".
|
||||
# This is necessary to use them in variable names.
|
||||
build_var=`echo ${build} | tr '-' '_' | tr '.' '_'`
|
||||
host_var=`echo ${host} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and host
|
||||
eval rewritten_build=\${REWRITE_${build_var}}
|
||||
if test "x$rewritten_build" = x; then
|
||||
rewritten_build=${build}
|
||||
echo Build stays the same $rewritten_build
|
||||
else
|
||||
echo Rewriting build for builddeps into $rewritten_build
|
||||
fi
|
||||
eval rewritten_host=\${REWRITE_${host_var}}
|
||||
if test "x$rewritten_host" = x; then
|
||||
rewritten_host=${host}
|
||||
echo Host stays the same $rewritten_host
|
||||
else
|
||||
echo Rewriting host for builddeps into $rewritten_host
|
||||
fi
|
||||
rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_host_var=`echo ${rewritten_host} | tr '-' '_' | tr '.' '_'`
|
||||
fi
|
||||
AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip])
|
||||
if test "x$BDEPS_UNZIP" = x7z; then
|
||||
BDEPS_UNZIP="7z x"
|
||||
fi
|
||||
|
||||
AC_CHECK_PROGS(BDEPS_FTP, [wget lftp ftp])
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_FTPGET],
|
||||
[
|
||||
# $1 is the ftp://abuilddeps.server.com/libs/cups.zip
|
||||
# $2 is the local file name for the downloaded file.
|
||||
VALID_TOOL=no
|
||||
if test "x$BDEPS_FTP" = xwget; then
|
||||
VALID_TOOL=yes
|
||||
wget -O $2 $1
|
||||
fi
|
||||
if test "x$BDEPS_FTP" = xlftp; then
|
||||
VALID_TOOL=yes
|
||||
lftp -c "get $1 -o $2"
|
||||
fi
|
||||
if test "x$BDEPS_FTP" = xftp; then
|
||||
VALID_TOOL=yes
|
||||
FTPSERVER=`echo $1 | cut -f 3 -d '/'`
|
||||
FTPPATH=`echo $1 | cut -f 4- -d '/'`
|
||||
FTPUSERPWD=${FTPSERVER%%@*}
|
||||
if test "x$FTPSERVER" != "x$FTPUSERPWD"; then
|
||||
FTPUSER=${userpwd%%:*}
|
||||
FTPPWD=${userpwd#*@}
|
||||
FTPSERVER=${FTPSERVER#*@}
|
||||
else
|
||||
FTPUSER=ftp
|
||||
FTPPWD=ftp
|
||||
fi
|
||||
# the "pass" command does not work on some
|
||||
# ftp clients (read ftp.exe) but if it works,
|
||||
# passive mode is better!
|
||||
(\
|
||||
echo "user $FTPUSER $FTPPWD" ;\
|
||||
echo "pass" ;\
|
||||
echo "bin" ;\
|
||||
echo "get $FTPPATH $2" ;\
|
||||
) | ftp -in $FTPSERVER
|
||||
fi
|
||||
if test "x$VALID_TOOL" != xyes; then
|
||||
AC_ERROR([I do not know how to use the tool: $BDEPS_FTP])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_CHECK_MODULE],
|
||||
[
|
||||
define([LIST_OF_BUILD_DEPENDENCIES],LIST_OF_BUILD_DEPENDENCIES[$2=$3'\n'])
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
# Source the builddeps file again, to make sure it uses the latest variables!
|
||||
. $builddepsfile
|
||||
# Look for a host and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a host specific resource
|
||||
eval resource=\${builddep_$2_HOST_${rewritten_host_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a build specific resource
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a generic resource
|
||||
# (The $2 comes from M4 and not the shell, thus no need for eval here.)
|
||||
resource=${builddep_$2}
|
||||
fi
|
||||
if test "x$resource" != x; then
|
||||
AC_MSG_NOTICE([Using builddeps $resource for $2])
|
||||
# If the resource in the builddeps.conf file is an existing directory,
|
||||
# for example /java/linux/cups
|
||||
if test -d ${resource}; then
|
||||
depdir=${resource}
|
||||
else
|
||||
BDEPS_FETCH($2, $resource, $with_builddeps_server, $with_builddeps_dir, depdir)
|
||||
fi
|
||||
# Source the builddeps file again, because in the previous command, the depdir
|
||||
# was updated to point at the current build dependency install directory.
|
||||
. $builddepsfile
|
||||
# Now extract variables from the builddeps.conf files.
|
||||
theroot=${builddep_$2_ROOT}
|
||||
thecflags=${builddep_$2_CFLAGS}
|
||||
thelibs=${builddep_$2_LIBS}
|
||||
if test "x$depdir" = x; then
|
||||
AC_ERROR([Could not download build dependency $2])
|
||||
fi
|
||||
$1=$depdir
|
||||
if test "x$theroot" != x; then
|
||||
$1="$theroot"
|
||||
fi
|
||||
if test "x$thecflags" != x; then
|
||||
$1_CFLAGS="$thecflags"
|
||||
fi
|
||||
if test "x$thelibs" != x; then
|
||||
$1_LIBS="$thelibs"
|
||||
fi
|
||||
m4_default([$4], [:])
|
||||
m4_ifvaln([$5], [else $5])
|
||||
fi
|
||||
m4_ifvaln([$5], [else $5])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_FETCH],
|
||||
[
|
||||
# $1 is for example mymodule
|
||||
# $2 is for example libs/general/libmymod_1_2_3.zip
|
||||
# $3 is for example ftp://mybuilddeps.myserver.com/builddeps
|
||||
# $4 is for example /localhome/builddeps
|
||||
# $5 is the name of the variable into which we store the depdir, eg MYMOD
|
||||
# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and
|
||||
# unzip into the directory: /localhome/builddeps/libmymod_1_2_3
|
||||
filename=`basename $2`
|
||||
filebase=`echo $filename | sed 's/\.[[^\.]]*$//'`
|
||||
filebase=${filename%%.*}
|
||||
extension=${filename#*.}
|
||||
installdir=$4/$filebase
|
||||
if test ! -f $installdir/$filename.unpacked; then
|
||||
AC_MSG_NOTICE([Downloading build dependency $1 from $3/$2 and installing into $installdir])
|
||||
if test ! -d $installdir; then
|
||||
mkdir -p $installdir
|
||||
fi
|
||||
if test ! -d $installdir; then
|
||||
AC_ERROR([Could not create directory $installdir])
|
||||
fi
|
||||
tmpfile=`mktemp $installdir/$1.XXXXXXXXX`
|
||||
touch $tmpfile
|
||||
if test ! -f $tmpfile; then
|
||||
AC_ERROR([Could not create files in directory $installdir])
|
||||
fi
|
||||
BDEPS_FTPGET([$3/$2] , [$tmpfile])
|
||||
mv $tmpfile $installdir/$filename
|
||||
if test ! -s $installdir/$filename; then
|
||||
AC_ERROR([Could not download $3/$2])
|
||||
fi
|
||||
case "$extension" in
|
||||
zip) echo "Unzipping $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
tar.gz) echo "Untaring $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
tgz) echo "Untaring $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
*) AC_ERROR([Cannot handle build depency archive with extension $extension])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test -f $installdir/$filename.unpacked; then
|
||||
$5=$installdir
|
||||
fi
|
||||
])
|
||||
|
28
common/autoconf/closed.version.numbers
Normal file
28
common/autoconf/closed.version.numbers
Normal file
@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
LAUNCHER_NAME=java
|
||||
PRODUCT_NAME="Java(TM)"
|
||||
PRODUCT_SUFFIX="SE Runtime Environment"
|
||||
JDK_RC_PLATFORM_NAME="Platform SE"
|
||||
COMPANY_NAME="Oracle Corporation"
|
49
common/autoconf/config.h.in
Normal file
49
common/autoconf/config.h.in
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#define PACKAGE_NAME "openjdk"
|
||||
#define PACKAGE_TARNAME "openjdk"
|
||||
#define PACKAGE_VERSION "version-0.1"
|
||||
#define PACKAGE_STRING "openjdk version-0.1"
|
||||
#define PACKAGE_BUGREPORT "build-infra-dev@openjdk.java.net"
|
||||
#define PACKAGE_URL ""
|
||||
#define STDC_HEADERS
|
||||
#define HAVE_SYS_TYPES_H
|
||||
#define HAVE_SYS_STAT_H
|
||||
#define HAVE_STDLIB_H
|
||||
#define HAVE_STRING_H
|
||||
#define HAVE_MEMORY_H
|
||||
#define HAVE_STRINGS_H
|
||||
#define HAVE_INTTYPES_H
|
||||
#define HAVE_STDINT_H
|
||||
#define HAVE_UNISTD_H
|
||||
#define SIZEOF_INT_P 8
|
||||
#define HAVE_CUPS_CUPS_H
|
||||
#define HAVE_CUPS_PPD_H
|
||||
#define HAVE_LIBJPEG
|
||||
#define HAVE_LIBGIF
|
||||
#define HAVE_LIBZ
|
||||
#define HAVE_LIBM
|
||||
#define HAVE_ALTZONE
|
16395
common/autoconf/configure
vendored
Normal file
16395
common/autoconf/configure
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2651
common/autoconf/configure.ac
Normal file
2651
common/autoconf/configure.ac
Normal file
File diff suppressed because it is too large
Load Diff
103
common/autoconf/cores.m4
Normal file
103
common/autoconf/cores.m4
Normal file
@ -0,0 +1,103 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_CORES],
|
||||
[
|
||||
AC_MSG_CHECKING([for number of cores])
|
||||
NUM_CORES=1
|
||||
FOUND_CORES=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
NUM_CORES=4
|
||||
fi
|
||||
|
||||
# For c/c++ code we run twice as many concurrent build
|
||||
# jobs than we have cores, otherwise we will stall on io.
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect number of cores, defaulting to 1!])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_MEMORY_SIZE],
|
||||
[
|
||||
AC_MSG_CHECKING([for memory size])
|
||||
# Default to 1024MB
|
||||
MEMORY_SIZE=1024
|
||||
FOUND_MEM=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/prtconf; then
|
||||
# Looks like a Solaris system
|
||||
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$FOUND_MEM" = xyes; then
|
||||
AC_MSG_RESULT([$MEMORY_SIZE MB])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect memory size defaulting to 1024MB!])
|
||||
fi
|
||||
])
|
110
common/autoconf/help.m4
Normal file
110
common/autoconf/help.m4
Normal file
@ -0,0 +1,110 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
function help_on_build_dependency {
|
||||
# Print a helpful message on how to acquire the necessary build dependency.
|
||||
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
|
||||
MISSING_DEPENDENCY=$1
|
||||
PKGHANDLER_COMMAND=
|
||||
|
||||
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
|
||||
|
||||
case $PKGHANDLER in
|
||||
apt-get)
|
||||
apt_help $MISSING_DEPENDENCY ;;
|
||||
yum)
|
||||
yum_help $MISSING_DEPENDENCY ;;
|
||||
port)
|
||||
port_help $MISSING_DEPENDENCY ;;
|
||||
pkgutil)
|
||||
pkgutil_help $MISSING_DEPENDENCY ;;
|
||||
pkgadd)
|
||||
pkgadd_help $MISSING_DEPENDENCY ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
HELP_MSG="Try running '$PKGHANDLER_COMMAND'."
|
||||
fi
|
||||
}
|
||||
|
||||
function apt_help {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
|
||||
openjdk)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;;
|
||||
alsa)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
|
||||
cups)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
|
||||
freetype2)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
|
||||
pulse)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev" ;;
|
||||
ccache)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function yum_help {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
|
||||
openjdk)
|
||||
PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;;
|
||||
alsa)
|
||||
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
|
||||
cups)
|
||||
PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
|
||||
freetype2)
|
||||
PKGHANDLER_COMMAND="sudo yum install freetype2-devel" ;;
|
||||
pulse)
|
||||
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo yum install libXtst-devel" ;;
|
||||
ccache)
|
||||
PKGHANDLER_COMMAND="sudo yum install ccache" ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function port_help {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgutil_help {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgadd_help {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
517
common/autoconf/platform.m4
Normal file
517
common/autoconf/platform.m4
Normal file
@ -0,0 +1,517 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_FIND_DELETE],
|
||||
[
|
||||
# Test if find supports -delete
|
||||
AC_MSG_CHECKING([if find supports -delete])
|
||||
FIND_DELETE="-delete"
|
||||
|
||||
DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
|
||||
|
||||
echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
|
||||
|
||||
TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
|
||||
if test -f $DELETEDIR/TestIfFindSupportsDelete; then
|
||||
# No, it does not.
|
||||
rm $DELETEDIR/TestIfFindSupportsDelete
|
||||
FIND_DELETE="-exec rm \{\} \+"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
rmdir $DELETEDIR
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_NONEMPTY],
|
||||
[
|
||||
# Test that variable $1 is not empty.
|
||||
if test "" = "[$]$1"; then AC_ERROR(Could not find translit($1,A-Z,a-z) !); fi
|
||||
])
|
||||
|
||||
AC_DEFUN([ADD_JVM_ARG_IF_OK],
|
||||
[
|
||||
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
|
||||
# If so, then append $1 to $2
|
||||
FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
|
||||
FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
|
||||
$2="[$]$2 $1"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD],
|
||||
[
|
||||
# Translate "gcc -E" into "`which gcc` -E" ie
|
||||
# extract the full path to the binary and at the
|
||||
# same time maintain any arguments passed to it.
|
||||
# The command MUST exist in the path, or else!
|
||||
tmp="[$]$1"
|
||||
car="${tmp%% *}"
|
||||
tmp="[$]$1 EOL"
|
||||
cdr="${tmp#* }"
|
||||
# On windows we want paths without spaces.
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
WHICHCMD_SPACESAFE(car)
|
||||
else
|
||||
# "which" is not portable, but is used here
|
||||
# because we know that the command exists!
|
||||
car=`which $car`
|
||||
fi
|
||||
if test "x$cdr" != xEOL; then
|
||||
$1="$car ${cdr% *}"
|
||||
else
|
||||
$1="$car"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SPACESAFE],
|
||||
[
|
||||
# Fail with message $2 if var $1 contains a path with no spaces in it.
|
||||
# Unless on Windows, where we can rewrite the path.
|
||||
HAS_SPACE=`echo "[$]$1" | grep " "`
|
||||
if test "x$HAS_SPACE" != x; then
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
$1=`$CYGPATH -s -m -a "[$]$1"`
|
||||
$1=`$CYGPATH -u "[$]$1"`
|
||||
else
|
||||
AC_ERROR([You cannot have spaces in $2! "[$]$1"])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD_SPACESAFE],
|
||||
[
|
||||
# Translate long cygdrive or C:\sdfsf path
|
||||
# into a short mixed mode path that has no
|
||||
# spaces in it.
|
||||
tmp="[$]$1"
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
tmp=`$CYGPATH -u "[$]$1"`
|
||||
tmp=`which "$tmp"`
|
||||
# If file exists with .exe appended, that's the real filename
|
||||
# and cygpath needs that to convert to short style path.
|
||||
if test -f "${tmp}.exe"; then
|
||||
tmp="${tmp}.exe"
|
||||
elif test -f "${tmp}.cmd"; then
|
||||
tmp="${tmp}.cmd"
|
||||
fi
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
fi
|
||||
$1="$tmp"
|
||||
])
|
||||
|
||||
AC_DEFUN([REMOVE_SYMBOLIC_LINKS],
|
||||
[
|
||||
if test "x$BUILD_OS" != xwindows; then
|
||||
# Follow a chain of symbolic links. Use readlink
|
||||
# where it exists, else fall back to horribly
|
||||
# complicated shell code.
|
||||
AC_PATH_PROG(READLINK, readlink)
|
||||
if test "x$READLINK_TESTED" != yes; then
|
||||
# On MacOSX there is a readlink tool with a different
|
||||
# purpose than the GNU readlink tool. Check the found readlink.
|
||||
ISGNU=`$READLINK --help 2>&1 | grep GNU`
|
||||
if test "x$ISGNU" = x; then
|
||||
# A readlink that we do not know how to use.
|
||||
# Are there other non-GNU readlinks out there?
|
||||
READLINK_TESTED=yes
|
||||
READLINK=
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$READLINK" != x; then
|
||||
$1=`$READLINK -f [$]$1`
|
||||
else
|
||||
STARTDIR=$PWD
|
||||
COUNTER=0
|
||||
DIR=`dirname [$]$1`
|
||||
FIL=`basename [$]$1`
|
||||
while test $COUNTER -lt 20; do
|
||||
ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'`
|
||||
if test "x$ISLINK" == x; then
|
||||
# This is not a symbolic link! We are done!
|
||||
break
|
||||
fi
|
||||
# The link might be relative! We have to use cd to travel safely.
|
||||
cd $DIR
|
||||
cd `dirname $ISLINK`
|
||||
DIR=`pwd`
|
||||
FIL=`basename $ISLINK`
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
cd $STARTDIR
|
||||
$1=$DIR/$FIL
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([TESTFOR_PROG_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
[AS_HELP_STRING([--disable-ccache],
|
||||
[use ccache to speed up recompilations @<:@enabled@:>@])],
|
||||
[ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
|
||||
if test "x$ENABLE_CCACHE" = xyes; then
|
||||
AC_PATH_PROG(CCACHE, ccache)
|
||||
else
|
||||
AC_MSG_CHECKING([for ccache])
|
||||
AC_MSG_RESULT([explicitly disabled])
|
||||
CCACHE=
|
||||
fi
|
||||
AC_SUBST(CCACHE)
|
||||
|
||||
AC_ARG_WITH([ccache-dir],
|
||||
[AS_HELP_STRING([--with-ccache-dir],
|
||||
[where to store ccache files @<:@~/.ccache@:>@])])
|
||||
|
||||
if test "x$with_ccache_dir" != x; then
|
||||
# When using a non home ccache directory, assume the use is to share ccache files
|
||||
# with other users. Thus change the umask.
|
||||
SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
|
||||
fi
|
||||
CCACHE_FOUND=""
|
||||
if test "x$CCACHE" != x; then
|
||||
SETUP_CCACHE_USAGE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SETUP_CCACHE_USAGE],
|
||||
[
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_FOUND="true"
|
||||
# Only use ccache if it is 3.1.4 or later, which supports
|
||||
# precompiled headers.
|
||||
AC_MSG_CHECKING([if ccache supports precompiled headers])
|
||||
HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
AC_MSG_RESULT([no, disabling ccache])
|
||||
CCACHE=
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
|
||||
PUSHED_FLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-fpch-preprocess $CXXFLAGS"
|
||||
AC_TRY_COMPILE([], [], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
|
||||
CXXFLAGS="$PUSHED_FLAGS"
|
||||
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
|
||||
CCACHE=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_SLOPPINESS=time_macros
|
||||
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
|
||||
CCACHE_FLAGS=-fpch-preprocess
|
||||
|
||||
if test "x$SET_CCACHE_DIR" != x; then
|
||||
mkdir -p $CCACHE_DIR > /dev/null 2>&1
|
||||
chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS],
|
||||
[
|
||||
# Expects $host_os $host_cpu $build_os and $build_cpu
|
||||
# and $with_data_model to have been setup!
|
||||
#
|
||||
# Translate the standard triplet(quadruplet) definition
|
||||
# of the host/build system into
|
||||
# HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows
|
||||
# HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince
|
||||
# HOST_OS_API=posix,winapi
|
||||
#
|
||||
# HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
|
||||
# HOST_CPU_ARCH=x86,sparc,pcc,arm
|
||||
# HOST_CPU_BITS=32,64
|
||||
# HOST_CPU_ENDIAN=big,little
|
||||
#
|
||||
# The same values are setup for BUILD_...
|
||||
#
|
||||
# And the legacy variables, for controlling the old makefiles.
|
||||
# LEGACY_HOST_CPU1=i586,amd64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
|
||||
# LEGACY_HOST_OS_API=solaris,windows
|
||||
#
|
||||
# We also copy the autoconf trip/quadruplet
|
||||
# verbatim to HOST and BUILD
|
||||
AC_SUBST(HOST, ${host})
|
||||
AC_SUBST(BUILD, ${build})
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(HOST,$host_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(HOST,$host_cpu)
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(BUILD,$build_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(BUILD,$build_cpu)
|
||||
|
||||
if test "x$HOST_OS" != xsolaris; then
|
||||
LEGACY_HOST_CPU3=""
|
||||
LEGACY_BUILD_CPU3=""
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_OS($2)
|
||||
$1_OS="$VAR_OS"
|
||||
$1_OS_FAMILY="$VAR_OS_FAMILY"
|
||||
$1_OS_API="$VAR_OS_API"
|
||||
|
||||
AC_SUBST($1_OS)
|
||||
AC_SUBST($1_OS_FAMILY)
|
||||
AC_SUBST($1_OS_API)
|
||||
|
||||
if test "x$$1_OS_API" = xposix; then
|
||||
LEGACY_$1_OS_API="solaris"
|
||||
fi
|
||||
if test "x$$1_OS_API" = xwinapi; then
|
||||
LEGACY_$1_OS_API="windows"
|
||||
fi
|
||||
AC_SUBST(LEGACY_$1_OS_API)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_CPU($2)
|
||||
$1_CPU="$VAR_CPU"
|
||||
$1_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
$1_CPU_BITS="$VAR_CPU_BITS"
|
||||
$1_CPU_ENDIAN="$VAR_CPU_ENDIAN"
|
||||
|
||||
AC_SUBST($1_CPU)
|
||||
AC_SUBST($1_CPU_ARCH)
|
||||
AC_SUBST($1_CPU_BITS)
|
||||
AC_SUBST($1_CPU_ENDIAN)
|
||||
|
||||
# Also store the legacy naming of the cpu.
|
||||
# Ie i586 and amd64 instead of ia32 and x64
|
||||
LEGACY_$1_CPU1="$VAR_LEGACY_CPU"
|
||||
AC_SUBST(LEGACY_$1_CPU1)
|
||||
|
||||
# And the second legacy naming of the cpu.
|
||||
# Ie i386 and amd64 instead of ia32 and x64.
|
||||
LEGACY_$1_CPU2="$LEGACY_$1_CPU1"
|
||||
if test "x$LEGACY_$1_CPU1" = xi586; then
|
||||
LEGACY_$1_CPU2=i386
|
||||
fi
|
||||
AC_SUBST(LEGACY_$1_CPU2)
|
||||
|
||||
# And the third legacy naming of the cpu.
|
||||
# Ie only amd64 or sparcv9, used for the ISA_DIR on Solaris.
|
||||
LEGACY_$1_CPU3=""
|
||||
if test "x$$1_CPU" = xx64; then
|
||||
LEGACY_$1_CPU3=amd64
|
||||
fi
|
||||
if test "x$$1_CPU" = xsparcv9; then
|
||||
LEGACY_$1_CPU3=sparvc9
|
||||
fi
|
||||
AC_SUBST(LEGACY_$1_CPU3)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
[
|
||||
# First argument is the cpu name from the trip/quad
|
||||
case "$1" in
|
||||
x86_64)
|
||||
VAR_CPU=x64
|
||||
VAR_CPU_ARCH=x86
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=little
|
||||
VAR_LEGACY_CPU=amd64
|
||||
;;
|
||||
i?86)
|
||||
VAR_CPU=ia32
|
||||
VAR_CPU_ARCH=x86
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=little
|
||||
VAR_LEGACY_CPU=i586
|
||||
;;
|
||||
alpha*)
|
||||
VAR_CPU=alpha
|
||||
VAR_CPU_ARCH=alpha
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=alpha
|
||||
;;
|
||||
arm*)
|
||||
VAR_CPU=arm
|
||||
VAR_CPU_ARCH=arm
|
||||
VAR_CPU_BITS=3264
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=arm
|
||||
;;
|
||||
mips)
|
||||
VAR_CPU=mips
|
||||
VAR_CPU_ARCH=mips
|
||||
VAR_CPU_BITS=woot
|
||||
VAR_CPU_ENDIAN=woot
|
||||
VAR_LEGACY_CPU=mips
|
||||
;;
|
||||
mipsel)
|
||||
VAR_CPU=mipsel
|
||||
VAR_CPU_ARCH=mips
|
||||
VAR_CPU_BITS=woot
|
||||
VAR_CPU_ENDIAN=woot
|
||||
VAR_LEGACY_CPU=mipsel
|
||||
;;
|
||||
powerpc)
|
||||
VAR_CPU=ppc
|
||||
VAR_CPU_ARCH=ppc
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=ppc
|
||||
;;
|
||||
powerpc64)
|
||||
VAR_CPU=ppc64
|
||||
VAR_CPU_ARCH=ppc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=32
|
||||
VAR_LEGACY_CPU=ppc64
|
||||
;;
|
||||
sparc)
|
||||
VAR_CPU=sparc
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=sparc
|
||||
;;
|
||||
sparc64)
|
||||
VAR_CPU=sparcv9
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=sparc_sparcv9
|
||||
;;
|
||||
s390)
|
||||
VAR_CPU=s390
|
||||
VAR_CPU_ARCH=s390
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=woot
|
||||
VAR_LEGACY_CPU=s390
|
||||
VAR_LEGACY_CPU=s390
|
||||
;;
|
||||
s390x)
|
||||
VAR_CPU=s390x
|
||||
VAR_CPU_ARCH=s390
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=woot
|
||||
VAR_LEGACY_CPU=s390x
|
||||
;;
|
||||
*)
|
||||
AC_ERROR([unsupported cpu $1])
|
||||
;;
|
||||
esac
|
||||
|
||||
# Workaround cygwin not knowing about 64 bit.
|
||||
if test "x$VAR_OS" = "xwindows"; then
|
||||
if test "x$PROCESSOR_IDENTIFIER" != "x"; then
|
||||
PROC_ARCH=`echo $PROCESSOR_IDENTIFIER | $CUT -f1 -d' '`
|
||||
case "$PROC_ARCH" in
|
||||
intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64)
|
||||
VAR_CPU=x64
|
||||
VAR_CPU_BITS=64
|
||||
VAR_LEGACY_CPU=amd64
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$VAR_CPU_ARCH" = "xx86"; then
|
||||
if test "x$with_data_model" = "x64"; then
|
||||
VAR_CPU=x64
|
||||
VAR_CPU_BITS=64
|
||||
VAR_LEGACY_CPU=amd64
|
||||
fi
|
||||
if test "x$with_data_model" = "x32"; then
|
||||
VAR_CPU=ia32
|
||||
VAR_CPU_BITS=32
|
||||
VAR_LEGACY_CPU=i586
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS],
|
||||
[
|
||||
case "$1" in
|
||||
*linux*)
|
||||
VAR_OS=linux
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_FAMILY=gnu
|
||||
;;
|
||||
*solaris*)
|
||||
VAR_OS=solaris
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_FAMILY=sysv
|
||||
;;
|
||||
*darwin*)
|
||||
VAR_OS=macosx
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_FAMILY=bsd
|
||||
;;
|
||||
*bsd*)
|
||||
VAR_OS=bsd
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_FAMILY=bsd
|
||||
;;
|
||||
*cygwin*|*windows*)
|
||||
VAR_OS=windows
|
||||
VAR_OS_API=winapi
|
||||
VAR_OS_FAMILY=windows
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unsupported host operating system $1])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_COMPILER_VERSION],
|
||||
[
|
||||
# Test the compilers that their versions are new enough.
|
||||
# AC_MSG_CHECKING([version of GCC])
|
||||
gcc_ver=`${CC} -dumpversion`
|
||||
gcc_major_ver=`echo ${gcc_ver}|cut -d'.' -f1`
|
||||
gcc_minor_ver=`echo ${gcc_ver}|cut -d'.' -f2`
|
||||
# AM_CONDITIONAL(GCC_OLD, test ! ${gcc_major_ver} -ge 4 -a ${gcc_minor_ver} -ge 3)
|
||||
# AC_MSG_RESULT([${gcc_ver} (major version ${gcc_major_ver}, minor version ${gcc_minor_ver})])
|
||||
])
|
||||
|
||||
# Fixes paths on windows hosts to be mixed mode short.
|
||||
AC_DEFUN([WIN_FIX_PATH],
|
||||
[
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
AC_PATH_PROG(CYGPATH, cygpath)
|
||||
tmp="[$]$1"
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
$1="$tmp"
|
||||
fi
|
||||
])
|
588
common/autoconf/spec.gmk.in
Normal file
588
common/autoconf/spec.gmk.in
Normal file
@ -0,0 +1,588 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Configured @DATE_WHEN_CONFIGURED@ to build for a @HOST@ system,
|
||||
# using ./configure @CONFIGURE_COMMAND_LINE@
|
||||
|
||||
# When calling macros, the spaces between arguments are
|
||||
# often semantically important! Sometimes we need to subst
|
||||
# spaces and commas, therefore we need the following macros.
|
||||
X:=
|
||||
SPACE:=$(X) $(X)
|
||||
COMMA:=,
|
||||
HASH:=\#
|
||||
SQUOTE:='
|
||||
#'
|
||||
DQUOTE:="
|
||||
#"
|
||||
define NEWLINE:=
|
||||
endef
|
||||
|
||||
|
||||
# Pass along the verbosity setting.
|
||||
ifeq (,$(findstring VERBOSE=,$(MAKE)))
|
||||
MAKE:=$(MAKE) $(VERBOSE) VERBOSE="$(VERBOSE)"
|
||||
endif
|
||||
|
||||
# No implicit variables or rules!
|
||||
ifeq (,$(findstring -R,$(MAKE)))
|
||||
MAKE:=$(MAKE) -R
|
||||
endif
|
||||
|
||||
# Specify where the spec file is.
|
||||
ifeq (,$(findstring SPEC=,$(MAKE)))
|
||||
MAKE:=$(MAKE) SPEC=@SPEC@
|
||||
endif
|
||||
|
||||
# Specify where the common include directory for makefiles is.
|
||||
ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE)))
|
||||
MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles
|
||||
endif
|
||||
|
||||
# A self-referential reference to this file.
|
||||
SPEC:=@SPEC@
|
||||
|
||||
# The built jdk will run in this host system.
|
||||
HOST:=@HOST@
|
||||
HOST_OS:=@HOST_OS@
|
||||
HOST_OS_FAMILY:=@HOST_OS_FAMILY@
|
||||
HOST_OS_API:=@HOST_OS_API@
|
||||
|
||||
HOST_CPU:=@HOST_CPU@
|
||||
HOST_CPU_ARCH:=@HOST_CPU_ARCH@
|
||||
HOST_CPU_BITS:=@HOST_CPU_BITS@
|
||||
HOST_CPU_ENDIAN:=@HOST_CPU_ENDIAN@
|
||||
|
||||
# We are building on this build system.
|
||||
# When not cross-compiling, it is the same as the host.
|
||||
BUILD:=@BUILD@
|
||||
BUILD_OS:=@BUILD_OS@
|
||||
BUILD_OS_FAMILY:=@BUILD_OS_FAMILY@
|
||||
BUILD_OS_API:=@BUILD_OS_API@
|
||||
|
||||
BUILD_CPU:=@BUILD_CPU@
|
||||
BUILD_CPU_ARCH:=@BUILD_CPU_ARCH@
|
||||
BUILD_CPU_BITS:=@BUILD_CPU_BITS@
|
||||
BUILD_CPU_ENDIAN:=@BUILD_CPU_ENDIAN@
|
||||
|
||||
# Old name for HOST_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
|
||||
PLATFORM:=@HOST_OS@
|
||||
# Old name for HOST_CPU, uses i586 and amd64, instead of ia32 and x64.
|
||||
ARCH:=@LEGACY_HOST_CPU1@
|
||||
# Yet another name for arch used for an extra subdir below the jvm lib.
|
||||
# Uses i386 and amd64, instead of ia32 and x64.
|
||||
LIBARCH:=@LEGACY_HOST_CPU2@
|
||||
# Use to switch between solaris and windows subdirs in the jdk.
|
||||
LEGACY_HOST_OS_API:=@LEGACY_HOST_OS_API@
|
||||
# 32 or 64 bit
|
||||
ARCH_DATA_MODEL:=@HOST_CPU_BITS@
|
||||
# Legacy setting for building for a 64 bit machine.
|
||||
# If yes then this expands to _LP64:=1
|
||||
@LP64@
|
||||
ENDIAN:=@HOST_CPU_ENDIAN@
|
||||
@SET_OPENJDK@
|
||||
JIGSAW:=@JIGSAW@
|
||||
LIBM:=-lm
|
||||
|
||||
# colon or semicolon
|
||||
PATH_SEP:=@PATH_SEP@
|
||||
|
||||
# Set special env variables, to be passed to external tools.
|
||||
# Used for cygwin setups.
|
||||
@SETUPDEVENV@
|
||||
|
||||
# The sys root where standard headers and libraries are found.
|
||||
# Usually not needed since the configure script should have
|
||||
# taken it into account already when setting CFLAGS et al.
|
||||
SYS_ROOT:=@SYS_ROOT@
|
||||
|
||||
# Paths to the source code
|
||||
SRC_ROOT:=@SRC_ROOT@
|
||||
ADD_SRC_ROOT:=@ADD_SRC_ROOT@
|
||||
OVERRIDE_SRC_ROOT:=@OVERRIDE_SRC_ROOT@
|
||||
TOPDIR:=@SRC_ROOT@
|
||||
OUTPUT_ROOT:=@OUTPUT_ROOT@
|
||||
JDK_MAKE_SHARED_DIR:=@JDK_TOPDIR@/makefiles/common/shared
|
||||
JDK_TOPDIR:=@JDK_TOPDIR@
|
||||
LANGTOOLS_TOPDIR:=@LANGTOOLS_TOPDIR@
|
||||
CORBA_TOPDIR:=@CORBA_TOPDIR@
|
||||
JAXP_TOPDIR:=@JAXP_TOPDIR@
|
||||
JAXWS_TOPDIR:=@JAXWS_TOPDIR@
|
||||
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
|
||||
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
||||
|
||||
# Information gathered from the version.numbers file.
|
||||
JDK_MAJOR_VERSION:=@JDK_MAJOR_VERSION@
|
||||
JDK_MINOR_VERSION:=@JDK_MINOR_VERSION@
|
||||
JDK_MICRO_VERSION:=@JDK_MICRO_VERSION@
|
||||
JDK_UPDATE_VERSION:=@JDK_UPDATE_VERSION@
|
||||
JDK_BUILD_NUMBER:=@JDK_BUILD_NUMBER@
|
||||
MILESTONE:=@MILESTONE@
|
||||
LAUNCHER_NAME:=@LAUNCHER_NAME@
|
||||
PRODUCT_NAME:=@PRODUCT_NAME@
|
||||
PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@
|
||||
JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@
|
||||
COMPANY_NAME:=@COMPANY_NAME@
|
||||
|
||||
# Different version strings generated from the above information.
|
||||
JDK_VERSION:=@JDK_VERSION@
|
||||
RUNTIME_NAME:=@RUNTIME_NAME@
|
||||
FULL_VERSION:=@FULL_VERSION@
|
||||
JRE_RELEASE_VERSION:=@FULL_VERSION@
|
||||
RELEASE:=@RELEASE@
|
||||
COOKED_BUILD_NUMBER:=@COOKED_BUILD_NUMBER@
|
||||
|
||||
# How to compile the code: release, fastdebug or slowdebug
|
||||
DEBUG_LEVEL:=@DEBUG_LEVEL@
|
||||
|
||||
# This is the JDK variant to build.
|
||||
# The JDK variant is a name for a specific set of modules to be compiled for the JDK.
|
||||
JDK_VARIANT:=@JDK_VARIANT@
|
||||
|
||||
# Legacy defines controlling the JDK variant embedded.
|
||||
@JAVASE_EMBEDDED@
|
||||
@MINIMIZE_RAM_USAGE@
|
||||
|
||||
# Should we compile support for running with a graphical UI? (ie headful)
|
||||
# Should we compile support for running without? (ie headless)
|
||||
SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@
|
||||
SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
|
||||
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
|
||||
@BUILD_HEADLESS@
|
||||
@BUILD_HEADLESS_ONLY@
|
||||
|
||||
# These are the libjvms that we want to build.
|
||||
# The java launcher uses the default.
|
||||
# The other can be selected by specifying -client -server -kernel -zero or -zeroshark
|
||||
# on the java launcher command line.
|
||||
DEFAULT_JVM_VARIANT:=@DEFAULT_JVM_VARIANT@
|
||||
JVM_VARIANTS:=@JVM_VARIANTS@
|
||||
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
|
||||
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
|
||||
JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
|
||||
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
|
||||
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
|
||||
|
||||
# Legacy setting: OPT or DBG
|
||||
VARIANT:=@VARIANT@
|
||||
# Legacy setting: true or false
|
||||
FASTDEBUG:=@FASTDEBUG@
|
||||
# Legacy setting: debugging the class files?
|
||||
DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
|
||||
# Legacy setting: -debug or -fastdebug
|
||||
BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
|
||||
|
||||
LANGTOOLS_OUTPUTDIR:=@OUTPUT_ROOT@/langtools
|
||||
LANGTOOLS_DIST:=@OUTPUT_ROOT@/langtools/dist
|
||||
LANGTOOLS_MAKE_ARGS:=@LANGTOOLS_MAKE_ARGS@
|
||||
|
||||
CORBA_OUTPUTDIR:=@OUTPUT_ROOT@/corba
|
||||
CORBA_DIST:=@OUTPUT_ROOT@/corba/dist
|
||||
CORBA_MAKE_ARGS:=@CORBA_MAKE_ARGS@
|
||||
|
||||
JAXP_OUTPUTDIR:=@OUTPUT_ROOT@/jaxp
|
||||
JAXP_DIST:=@OUTPUT_ROOT@/jaxp/dist
|
||||
JAXP_MAKE_ARGS:=@JAXP_MAKE_ARGS@
|
||||
|
||||
JAXWS_OUTPUTDIR:=@OUTPUT_ROOT@/jaxws
|
||||
JAXWS_DIST:=@OUTPUT_ROOT@/jaxws/dist
|
||||
JAXWS_MAKE_ARGS:=@JAXWS_MAKE_ARGS@
|
||||
|
||||
HOTSPOT_OUTPUTDIR:=@OUTPUT_ROOT@/hotspot
|
||||
HOTSPOT_DIST:=@OUTPUT_ROOT@/hotspot/dist
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
|
||||
|
||||
# This where a working jvm is built.
|
||||
# You can run $(JDK_OUTPUTDIR)/bin/java
|
||||
# Though the layout of the contents of $(JDK_OUTPUTDIR) is not
|
||||
# yet the same as a default installation.
|
||||
HOTSPOT_IMPORT_PATH:=@OUTPUT_ROOT@/hotspot/dist
|
||||
JDK_OUTPUTDIR:=@OUTPUT_ROOT@/jdk
|
||||
JDK_MAKE_ARGS:=@JDK_MAKE_ARGS@
|
||||
|
||||
# When you run "make install" it will create the standardized
|
||||
# layout for the jdk and the jre inside the images subdir.
|
||||
# Then it will copy the contents of the jdk into the installation
|
||||
# directory.
|
||||
IMAGES_OUTPUTDIR:=@OUTPUT_ROOT@/images
|
||||
IMAGES_MAKE_ARGS:=@IMAGES_MAKE_ARGS@
|
||||
# Legacy variables used by Release.gmk
|
||||
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
|
||||
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
|
||||
|
||||
# Can be /sparcv9 or /amd64 on Solaris
|
||||
ISA_DIR:=@LEGACY_HOST_CPU3@
|
||||
BINDIR:=$(JDK_OUTPUTDIR)/bin$(ISA_DIR)
|
||||
|
||||
# The boot jdk to use
|
||||
ALT_BOOTDIR:=@BOOT_JDK@
|
||||
BOOT_JDK:=@BOOT_JDK@
|
||||
BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@
|
||||
BOOT_JAVAC_ARGS:=@BOOT_JAVAC_ARGS@
|
||||
BOOT_RTJAR:=@BOOT_RTJAR@
|
||||
BOOT_TOOLSJAR:=@BOOT_TOOLSJAR@
|
||||
|
||||
# When compiling Java source to be run by the boot jdk
|
||||
# use these extra flags, eg -source 6 -target 6
|
||||
BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
|
||||
|
||||
# Information about the build system
|
||||
NUM_CORES:=@NUM_CORES@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# This is used from the jdk build for C/C++ code.
|
||||
PARALLEL_COMPILE_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# Store javac server synchronization files here, and
|
||||
# the javac server log files.
|
||||
JAVAC_SERVERS:=@JAVAC_SERVERS@
|
||||
# Should we use a javac server or not? The javac server gives
|
||||
# an enormous performance improvement since it reduces the
|
||||
# startup costs of javac and reuses as much as possible of intermediate
|
||||
# compilation work. But if we want to compile with a non-Java
|
||||
# javac compiler, like gcj. Then we cannot use javac server and
|
||||
# this variable is set to false.
|
||||
JAVAC_USE_REMOTE:=@JAVAC_USE_REMOTE@
|
||||
# We can block the Javac server to never use more cores than this.
|
||||
# This is not for performance reasons, but for memory usage, since each
|
||||
# core requires its own JavaCompiler. We might have 64 cores and 4GB
|
||||
# of memory, 64 JavaCompilers will currently not fit in a 3GB heap.
|
||||
# Since there is no sharing of data between the JavaCompilers.
|
||||
JAVAC_SERVER_CORES:=@JAVAC_SERVER_CORES@
|
||||
# Should we use dependency tracking between Java packages? true or false.
|
||||
JAVAC_USE_DEPS:=@JAVAC_USE_DEPS@
|
||||
# We can invoke javac: SINGLE_THREADED_BATCH or MULTI_CORE_CONCURRENT
|
||||
JAVAC_USE_MODE:=@JAVAC_USE_MODE@
|
||||
|
||||
# The OpenJDK makefiles should be changed to using the standard
|
||||
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
|
||||
# extract the information here.
|
||||
FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@
|
||||
FREETYPE2_LIBS:=@FREETYPE2_LIBS@
|
||||
FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@
|
||||
USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@
|
||||
ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
|
||||
CUPS_CFLAGS:=@CUPS_CFLAGS@
|
||||
|
||||
PACKAGE_PATH=@PACKAGE_PATH@
|
||||
|
||||
CACERTS_FILE:=$(SRC_ROOT)/jdk/src/share/lib/security/cacerts
|
||||
#CACERTS_INT=$(CLOSED_SHARE_SRC)/lib/security/cacerts.internal
|
||||
|
||||
#MOZILLA_HEADERS_PATH:=
|
||||
|
||||
# Necessary additional compiler flags to compile X11
|
||||
X_CFLAGS:=@X_CFLAGS@
|
||||
X_LIBS:=@X_LIBS@
|
||||
OPENWIN_HOME:=@OPENWIN_HOME@
|
||||
|
||||
# There are two types: CC or CL
|
||||
# CC is gcc and others behaving reasonably similar.
|
||||
# CL is cl.exe only.
|
||||
COMPILER_TYPE:=@COMPILER_TYPE@
|
||||
|
||||
CC_OUT_OPTION:=@CC_OUT_OPTION@
|
||||
EXE_OUT_OPTION:=@EXE_OUT_OPTION@
|
||||
LD_OUT_OPTION:=@LD_OUT_OPTION@
|
||||
AR_OUT_OPTION:=@AR_OUT_OPTION@
|
||||
|
||||
# Flags used for overriding the default opt setting for a C/C++ source file.
|
||||
C_O_FLAG_HI:=@C_O_FLAG_HI@
|
||||
C_O_FLAG_NORM:=@C_O_FLAG_NORM@
|
||||
C_O_FLAG_NONE:=@C_O_FLAG_NONE@
|
||||
CXX_O_FLAG_HI:=@CXX_O_FLAG_HI@
|
||||
CXX_O_FLAG_NORM:=@CXX_O_FLAG_NORM@
|
||||
CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
CC:=@UNCYGDRIVE@ @CCACHE@ @CC@
|
||||
|
||||
# CFLAGS used to compile the jdk native libraries (C-code)
|
||||
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
|
||||
CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
|
||||
|
||||
# CFLAGS used to compile the jdk native launchers (C-code)
|
||||
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
|
||||
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
|
||||
|
||||
CXX:=@UNCYGDRIVE@ @CCACHE@ @CXX@
|
||||
#CXXFLAGS:=@CXXFLAGS@
|
||||
|
||||
OBJC:=@CCACHE@ @OBJC@
|
||||
#OBJCFLAGS:=@OBJCFLAGS@
|
||||
|
||||
CPP:=@UNCYGDRIVE@ @CPP@
|
||||
#CPPFLAGS:=@CPPFLAGS@
|
||||
|
||||
# The linker can be gcc or ld on posix systems, or link.exe on winapi systems.
|
||||
LD:=@UNCYGDRIVE@ @LD@
|
||||
|
||||
# LDFLAGS used to link the jdk native libraries (C-code)
|
||||
LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@
|
||||
LDFLAGS_JDKLIB_SUFFIX:=@LDFLAGS_JDKLIB_SUFFIX@
|
||||
|
||||
# On some platforms the linker cannot be used to create executables, thus
|
||||
# the need for a separate LDEXE command.
|
||||
LDEXE:=@UNCYGDRIVE@ @LDEXE@
|
||||
|
||||
# LDFLAGS used to link the jdk native launchers (C-code)
|
||||
LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@
|
||||
LDFLAGS_JDKEXE_SUFFIX:=@LDFLAGS_JDKEXE_SUFFIX@
|
||||
|
||||
# Sometimes a different linker is needed for c++ libs
|
||||
LDCXX:=@UNCYGDRIVE@ @LDCXX@
|
||||
# The flags for linking libstdc++ linker.
|
||||
LIBCXX:=@LIBCXX@
|
||||
|
||||
# Sometimes a different linker is needed for c++ executables
|
||||
LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@
|
||||
|
||||
# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.
|
||||
@DEFINE_CROSS_COMPILE_ARCH@
|
||||
# The HOSTCC should really be named BUILDCC, ie build executable for
|
||||
# the build platform. Same as CC when not cross compiling.
|
||||
HOSTCC:=@HOSTCC@
|
||||
HOSTCXX:=@HOSTCXX@
|
||||
# And of course, the jdk spells HOSTCC as NIO_CC/HOST_CC
|
||||
HOST_CC:=@HOSTCC@
|
||||
NIO_CC:=@HOSTCC@
|
||||
|
||||
AS:=@AS@
|
||||
ASFLAGS:=@ASFLAGS@
|
||||
|
||||
# AR is used to create a static library (is ar in posix, lib.exe in winapi)
|
||||
AR:=@UNCYGDRIVE@ @AR@
|
||||
ARFLAGS:=@ARFLAGS@
|
||||
|
||||
NM:=@NM@
|
||||
STRIP:=@STRIP@
|
||||
MCS:=@MCS@
|
||||
|
||||
# Command to create a shared library
|
||||
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
|
||||
|
||||
# Options to linker to specify a mapfile.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
||||
|
||||
# Options to linker to specify the library name.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
|
||||
|
||||
# Set origin using the linker, ie use the relative path to the dependent library to find the dependees.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@
|
||||
|
||||
# Different OS:es have different ways of naming shared libraries.
|
||||
# The SHARED_LIBRARY macro takes "verify" as and argument and returns:
|
||||
# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SHARED_LIBRARY=@SHARED_LIBRARY@
|
||||
STATIC_LIBRARY=@STATIC_LIBRARY@
|
||||
LIBRARY_PREFIX:=@LIBRARY_PREFIX@
|
||||
SHARED_LIBRARY_SUFFIX:=@SHARED_LIBRARY_SUFFIX@
|
||||
STATIC_LIBRARY_SUFFIX:=@STATIC_LIBRARY_SUFFIX@
|
||||
EXE_SUFFIX:=@EXE_SUFFIX@
|
||||
OBJ_SUFFIX:=@OBJ_SUFFIX@
|
||||
|
||||
JAVA_FLAGS:=@BOOT_JDK_JVMARGS@
|
||||
|
||||
JAVA=@UNCYGDRIVE@ @JAVA@ $(JAVA_FLAGS)
|
||||
|
||||
JAVAC:=@UNCYGDRIVE@ @JAVAC@
|
||||
JAVAC_FLAGS:=@JAVAC_FLAGS@
|
||||
|
||||
JAVAH:=@UNCYGDRIVE@ @JAVAH@
|
||||
|
||||
JAR:=@UNCYGDRIVE@ @JAR@
|
||||
|
||||
RMIC:=@UNCYGDRIVE@ @RMIC@
|
||||
|
||||
BOOT_JAR_CMD:=@UNCYGDRIVE@ @JAR@
|
||||
BOOT_JAR_JFLAGS:=
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
# times.
|
||||
ifndef RC_FLAGS
|
||||
RC_FLAGS:=@RC_FLAGS@
|
||||
endif
|
||||
|
||||
# A specific java binary with specific options can be used to run
|
||||
# the long running background javac server and other long running tasks.
|
||||
SERVER_JAVA:=@UNCYGDRIVE@ @SERVER_JAVA@
|
||||
|
||||
# Tools adhering to a minimal and common standard of posix compliance.
|
||||
AWK:=@AWK@
|
||||
CAT:=@CAT@
|
||||
CCACHE:=@CCACHE@
|
||||
# CD is going away, but remains to cater for legacy makefiles.
|
||||
CD:=cd
|
||||
CHMOD:=@CHMOD@
|
||||
CP:=@CP@
|
||||
CPIO:=@CPIO@
|
||||
CUT:=@CUT@
|
||||
DATE:=@DATE@
|
||||
DF:=@DF@
|
||||
DIFF:=@DIFF@
|
||||
FIND:=@FIND@
|
||||
FIND_DELETE:=@FIND_DELETE@
|
||||
ECHO:=@ECHO@
|
||||
EGREP:=@EGREP@
|
||||
FGREP:=@FGREP@
|
||||
GREP:=@GREP@
|
||||
HEAD:=@HEAD@
|
||||
LS:=@LS@
|
||||
LN:=@LN@
|
||||
MKDIR:=@MKDIR@
|
||||
MV:=@MV@
|
||||
NAWK:=@NAWK@
|
||||
PRINTF:=@PRINTF@
|
||||
PWD:=@THEPWDCMD@
|
||||
RM:=@RM@
|
||||
SED:=@SED@
|
||||
SH:=@SH@
|
||||
SORT:=@SORT@
|
||||
TAR:=@TAR@
|
||||
TAIL:=@TAIL@
|
||||
TEE:=@TEE@
|
||||
TR:=@TR@
|
||||
TOUCH:=@TOUCH@
|
||||
WC:=@WC@
|
||||
XARGS:=@XARGS@
|
||||
ZIPEXE:=@ZIP@
|
||||
ZIP:=@ZIP@
|
||||
UNZIP:=@UNZIP@
|
||||
MT:=@UNCYGDRIVE@ @MT@
|
||||
RC:=@UNCYGDRIVE@ @RC@
|
||||
DUMPBIN:=@UNCYGDRIVE@ @DUMPBIN@
|
||||
CYGPATH:=@CYGPATH@
|
||||
LDD:=@LDD@
|
||||
OTOOL:=@OTOOL@
|
||||
READELF:=@READELF@
|
||||
EXPR:=@EXPR@
|
||||
FILE:=@FILE@
|
||||
|
||||
UNCYGDRIVE:=@UNCYGDRIVE@
|
||||
|
||||
# Where the build output is stored for your convenience.
|
||||
BUILD_LOG:=@BUILD_LOG@
|
||||
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
|
||||
|
||||
# Build setup
|
||||
ENABLE_DOCS:=@ENABLE_DOCS@
|
||||
GENERATE_DOCS:=@ENABLE_DOCS@
|
||||
DISABLE_NIMBUS:=@DISABLE_NIMBUS@
|
||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
||||
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
||||
CHECK_FOR_VCINSTALLDIR=@CHECK_FOR_VCINSTALLDIR@
|
||||
MSVCRNN_DLL:=@MSVCR100DLL@
|
||||
|
||||
# ADD_SRCS takes a single argument with source roots
|
||||
# and appends any corresponding source roots found
|
||||
# below --with-add-source-root and below
|
||||
# --with-override-source-root. It is the responsibility
|
||||
# of the next macro to get rid of superfluous files.
|
||||
ADD_SRCS=$1
|
||||
ifneq (,$(ADD_SRC_ROOT))
|
||||
# Append wildcard rule to pickup any matching source roots found below ADD_SRC_ROOT
|
||||
ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(ADD_SRC_ROOT),$1))
|
||||
endif
|
||||
ifneq (,$(OVERRIDE_SRC_ROOT))
|
||||
# Append wildcard rule to pickup any matching source roots found below OVERRIDE_SRC_ROOT
|
||||
ADD_SRCS+=$(wildcard $(subst $(SRC_ROOT),$(OVERRIDE_SRC_ROOT),$1))
|
||||
endif
|
||||
|
||||
# OVR_SRCS creates a filter expression to filter out sources in
|
||||
# the original source directory that lie inside directories below
|
||||
# --with-override-source-root.
|
||||
# Use := here since we want to scan for these files here. To avoid recomputation later.
|
||||
# We cannot do the scan in configure, since that would force us to rerun configure when
|
||||
# we add overridden sources.
|
||||
ifneq (,$(OVERRIDE_SRC_ROOT))
|
||||
OVR_SRCS:=$(addsuffix %,$(subst $(OVERRIDE_SRC_ROOT),$(SRC_ROOT),$(sort $(dir $(shell $(FIND) $(OVERRIDE_SRC_ROOT) -type f)))))
|
||||
else
|
||||
OVR_SRCS:=
|
||||
endif
|
||||
|
||||
####################################################
|
||||
#
|
||||
# INSTALLATION
|
||||
#
|
||||
|
||||
# Common prefix for all installed files. Defaults to /usr/local,
|
||||
# but /opt/myjdk is another common version.
|
||||
INSTALL_PREFIX=@prefix@
|
||||
|
||||
# Directories containing architecture-dependent files should be relative to exec_prefix
|
||||
INSTALL_EXECPREFIX=@exec_prefix@
|
||||
|
||||
# java,javac,javah,javap etc are installed here.
|
||||
INSTALL_BINDIR=@bindir@
|
||||
|
||||
# Read only architecture-independent data
|
||||
INSTALL_DATADIR=@datadir@
|
||||
|
||||
# Root of above.
|
||||
INSTALL_DATAROOTDIR=@datarootdir@
|
||||
|
||||
# Doc files, other than info and man.
|
||||
INSTALL_DOCDIR=@docdir@
|
||||
|
||||
# Html documentation
|
||||
INSTALL_HTMLDIR=@htmldir@
|
||||
|
||||
# Installing C header files, JNI headers for example.
|
||||
INSTALL_INCLUDEDIR=@includedir@
|
||||
|
||||
# Installing library files....
|
||||
INSTALL_INCLUDEDIR=@libdir@
|
||||
|
||||
# Executables that other programs run.
|
||||
INSTALL_LIBEXECDIR=@libexecdir@
|
||||
|
||||
# Locale-dependent but architecture-independent data, such as message catalogs.
|
||||
INSTALL_LOCALEDIR=@localedir@
|
||||
|
||||
# Modifiable single-machine data
|
||||
INSTALL_LOCALSTATEDIR=@localstatedir@
|
||||
|
||||
# Man pages
|
||||
INSTALL_MANDIR=@mandir@
|
||||
|
||||
# Modifiable architecture-independent data.
|
||||
INSTALL_SHAREDSTATEDIR=@sharedstatedir@
|
||||
|
||||
# Read-only single-machine data
|
||||
INSTALL_SYSCONFDIR=@sysconfdir@
|
||||
|
||||
|
||||
####################################################
|
||||
#
|
||||
# Misc
|
||||
#
|
||||
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
36
common/autoconf/version.numbers
Normal file
36
common/autoconf/version.numbers
Normal file
@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
JDK_MAJOR_VERSION=1
|
||||
JDK_MINOR_VERSION=8
|
||||
JDK_MICRO_VERSION=0
|
||||
JDK_UPDATE_VERSION=
|
||||
JDK_BUILD_NUMBER=
|
||||
MILESTONE=internal
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
PRODUCT_SUFFIX="Runtime Environment"
|
||||
JDK_RC_PLATFORM_NAME=Platform
|
||||
COMPANY_NAME=N/A
|
283
common/bin/compareimage.sh
Normal file
283
common/bin/compareimage.sh
Normal file
@ -0,0 +1,283 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# MANUAL
|
||||
#
|
||||
# ./common/bin/compareimages.sh old_jdk_image new_jdk_image
|
||||
#
|
||||
# Compare the directory structure.
|
||||
# Compare the filenames in the directories.
|
||||
# Compare the contents of the zip archives
|
||||
# Compare the contents of the jar archives
|
||||
# Compare the native libraries
|
||||
# Compare the native executables
|
||||
# Compare the remaining files
|
||||
#
|
||||
# ./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]
|
||||
#
|
||||
# Compare only the selected subset of the images.
|
||||
#
|
||||
# ./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar
|
||||
#
|
||||
# Compare only the CodePointIM.jar file
|
||||
# Can be used to compare zips, libraries and executables.
|
||||
#
|
||||
|
||||
if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then
|
||||
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image"
|
||||
echo ""
|
||||
echo "Compare the directory structure."
|
||||
echo "Compare the filenames in the directories."
|
||||
echo "Compare the contents of the zip archives"
|
||||
echo "Compare the contents of the jar archives"
|
||||
echo "Compare the native libraries"
|
||||
echo "Compare the native executables"
|
||||
echo "Compare the remaining files"
|
||||
echo ""
|
||||
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]"
|
||||
echo ""
|
||||
echo "Compare only the selected subset of the images."
|
||||
echo ""
|
||||
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar"
|
||||
echo ""
|
||||
echo "Compare only the CodePointIM.jar file"
|
||||
echo "Can be used to compare zips, libraries and executables."
|
||||
exit 10
|
||||
fi
|
||||
|
||||
OLD="$1"
|
||||
NEW="$2"
|
||||
CMD="$3"
|
||||
|
||||
DIFF_RESULT=0
|
||||
|
||||
CMP_ZIPS=false
|
||||
CMP_JARS=false
|
||||
CMP_LIBS=false
|
||||
CMP_EXECS=false
|
||||
CMP_OTHER=false
|
||||
|
||||
FILTER="cat"
|
||||
|
||||
if [ -n "$CMD" ]; then
|
||||
case "$CMD" in
|
||||
zips)
|
||||
CMP_ZIPS=true
|
||||
;;
|
||||
jars)
|
||||
CMP_JARS=true
|
||||
;;
|
||||
libs)
|
||||
CMP_LIBS=true
|
||||
;;
|
||||
execs)
|
||||
CMP_EXECS=true
|
||||
;;
|
||||
other)
|
||||
CMP_OTHER=true
|
||||
;;
|
||||
*)
|
||||
CMP_ZIPS=true
|
||||
CMP_JARS=true
|
||||
CMP_LIBS=true
|
||||
CMP_EXECS=true
|
||||
CMP_OTHER=true
|
||||
FILTER="grep $3"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
CMP_ZIPS=true
|
||||
CMP_JARS=true
|
||||
CMP_LIBS=true
|
||||
CMP_EXECS=true
|
||||
CMP_OTHER=true
|
||||
fi
|
||||
|
||||
DIFFJARZIP=`dirname $0`/diffjarzip.sh
|
||||
DIFFLIB=`dirname $0`/difflib.sh
|
||||
DIFFEXEC=`dirname $0`/diffexec.sh
|
||||
export COMPARE_ROOT=/tmp/cimages
|
||||
mkdir -p $COMPARE_ROOT
|
||||
|
||||
# Load the correct exception list.
|
||||
case "`uname -s`" in
|
||||
Linux)
|
||||
. `dirname $0`/exception_list_linux
|
||||
;;
|
||||
esac
|
||||
|
||||
echo
|
||||
echo Comparing $OLD to $NEW
|
||||
echo
|
||||
|
||||
(cd $OLD && find . -type d | sort > $COMPARE_ROOT/from_dirs)
|
||||
(cd $NEW && find . -type d | sort > $COMPARE_ROOT/to_dirs)
|
||||
|
||||
echo -n Directory structure...
|
||||
if diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs > /dev/null; then
|
||||
echo Identical!
|
||||
else
|
||||
echo Differences found.
|
||||
DIFF_RESULT=1
|
||||
# Differences in directories found.
|
||||
ONLY_OLD=$(diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs | grep '<')
|
||||
if [ "$ONLY_OLD" ]; then
|
||||
echo Only in $OLD
|
||||
echo $ONLY_OLD | sed 's|< ./|\t|g' | sed 's/ /\n/g'
|
||||
fi
|
||||
# Differences in directories found.
|
||||
ONLY_NEW=$(diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs | grep '>')
|
||||
if [ "$ONLY_NEW" ]; then
|
||||
echo Only in $NEW
|
||||
echo $ONLY_NEW | sed 's|> ./|\t|g' | sed 's/ /\n/g'
|
||||
fi
|
||||
fi
|
||||
|
||||
(cd $OLD && find . -type f | sort > $COMPARE_ROOT/from_files)
|
||||
(cd $NEW && find . -type f | sort > $COMPARE_ROOT/to_files)
|
||||
|
||||
echo -n File names...
|
||||
if diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files > /dev/null; then
|
||||
echo Identical!
|
||||
else
|
||||
echo Differences found.
|
||||
DIFF_RESULT=1
|
||||
# Differences in directories found.
|
||||
ONLY_OLD=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '<')
|
||||
if [ "$ONLY_OLD" ]; then
|
||||
echo Only in $OLD
|
||||
echo $ONLY_OLD | sed 's|< ./|\t|g' | sed 's/ /\n/g'
|
||||
fi
|
||||
# Differences in directories found.
|
||||
ONLY_NEW=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '>')
|
||||
if [ "$ONLY_NEW" ]; then
|
||||
echo Only in $NEW
|
||||
echo $ONLY_NEW | sed 's|> ./|\t|g' | sed 's/ /\n/g'
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$CMP_ZIPS" == "xtrue" ]; then
|
||||
ZIPS=$(cd $OLD && find . -type f -name "*.zip" | sort | $FILTER)
|
||||
|
||||
if [ -n "$ZIPS" ]; then
|
||||
echo Zip files...
|
||||
|
||||
for f in $ZIPS
|
||||
do
|
||||
$DIFFJARZIP $OLD/$f $NEW/$f $OLD $NEW
|
||||
if [ "$?" != "0" ]; then
|
||||
DIFF_RESULT=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$CMP_JARS" == "xtrue" ]; then
|
||||
JARS=$(cd $OLD && find . -type f -name "*.jar" | sort | $FILTER)
|
||||
|
||||
if [ -n "$JARS" ]; then
|
||||
echo Jar files...
|
||||
|
||||
for f in $JARS
|
||||
do
|
||||
DIFFJAR_OUTPUT=`$DIFFJARZIP $OLD/$f $NEW/$f $OLD $NEW`
|
||||
DIFFJAR_RESULT=$?
|
||||
if [ "$DIFFJAR_RESULT" != "0" ]; then
|
||||
for diff in $LIST_DIFF_JAR; do
|
||||
DIFFJAR_OUTPUT=`echo "$DIFFJAR_OUTPUT" | grep -v "$diff"`
|
||||
done
|
||||
if [ "`echo "$DIFFJAR_OUTPUT" | grep -v "Differing files in"`" != "" ]; then
|
||||
DIFF_RESULT=1
|
||||
echo "$DIFFJAR_OUTPUT"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$FILTER" != "xcat" ]; then
|
||||
VIEW=view
|
||||
else
|
||||
VIEW=
|
||||
fi
|
||||
|
||||
if [ "x$CMP_LIBS" == "xtrue" ]; then
|
||||
LIBS=$(cd $OLD && find . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | sort | $FILTER)
|
||||
|
||||
if [ -n "$LIBS" ]; then
|
||||
echo Libraries...
|
||||
for f in $LIBS
|
||||
do
|
||||
DIFFLIB_OUTPUT=`$DIFFLIB $OLD/$f $NEW/$f $OLD $NEW $VIEW`
|
||||
DIFFLIB_RESULT=$?
|
||||
if [ "$DIFFLIB_RESULT" = "0" ]; then
|
||||
:
|
||||
#echo "OK: $DIFFLIB_OUTPUT"
|
||||
elif [ "$DIFFLIB_RESULT" = "2" ] && [[ "$LIST_DIFF_SIZE $LIST_DIFF_BYTE" == *"${f:2}"* ]]; then
|
||||
:
|
||||
#echo "OK: $DIFFLIB_OUTPUT"
|
||||
elif [ "$DIFFLIB_RESULT" = "1" ] && [[ "$LIST_DIFF_BYTE" == *"${f:2}"* ]]; then
|
||||
:
|
||||
#echo "OK: $DIFFLIB_OUTPUT"
|
||||
else
|
||||
echo "$DIFFLIB_OUTPUT"
|
||||
DIFF_RESULT=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x$CMP_EXECS" == "xtrue" ]; then
|
||||
if [ $OSTYPE == "cygwin" ]; then
|
||||
EXECS=$(cd $OLD && find . -type f -name '*.exe' | sort | $FILTER)
|
||||
else
|
||||
EXECS=$(cd $OLD && find . -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' \) | sort | $FILTER)
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$EXECS" ]; then
|
||||
echo Executables...
|
||||
|
||||
for f in $EXECS
|
||||
do
|
||||
DIFFEXEC_OUTPUT=`$DIFFEXEC $OLD/$f $NEW/$f $OLD $NEW $VIEW`
|
||||
DIFFEXEC_RESULT=$?
|
||||
if [ "$DIFFEXEC_RESULT" = "0" ]; then
|
||||
:
|
||||
#echo "OK: $DIFFEXEC_OUTPUT"
|
||||
elif [ "$DIFFEXEC_RESULT" = "2" ] && [[ "$LIST_DIFF_SIZE $LIST_DIFF_BYTE" == *"${f:2}"* ]]; then
|
||||
:
|
||||
#echo "OK: $DIFFEXEC_OUTPUT"
|
||||
elif [ "$DIFFEXEC_RESULT" = "1" ] && [[ "$LIST_DIFF_BYTE" == *"${f:2}"* ]]; then
|
||||
:
|
||||
#echo "OK: $DIFFEXEC_OUTPUT"
|
||||
else
|
||||
echo "$DIFFEXEC_OUTPUT"
|
||||
DIFF_RESULT=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $DIFF_RESULT
|
150
common/bin/diffexec.sh
Normal file
150
common/bin/diffexec.sh
Normal file
@ -0,0 +1,150 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "Diff two executables. Return codes:"
|
||||
echo "0 - no diff"
|
||||
echo "1 - Identical symbols AND size, BUT not bytewise identical"
|
||||
echo "2 - Identical symbols BUT NEW size"
|
||||
echo "3 - Differences, content BUT SAME size"
|
||||
echo "4 - Differences, content AND size"
|
||||
echo "10 - Could not perform diff"
|
||||
echo "Use 'quiet' to disable any output."
|
||||
echo "Syntax: $0 file1 file2 [quiet]"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ ! -f $1 ]
|
||||
then
|
||||
echo $1 does not exist
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ ! -f $2 ]
|
||||
then
|
||||
echo $2 does not exist
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT=gstat
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT=stat
|
||||
else
|
||||
NM=nm
|
||||
STAT=stat
|
||||
fi
|
||||
|
||||
# Should the differences be viewed?
|
||||
VIEW=
|
||||
# You can do export DIFF=meld to view
|
||||
# any differences using meld instead.
|
||||
if [ -n "$DIFF" ]; then
|
||||
DIFF="$DIFF"
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT -c%s "$OLD")
|
||||
NEW_SIZE=$($STAT -c%s "$NEW")
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
ROOT1=$(cd $3 && pwd)
|
||||
ROOT2=$(cd $4 && pwd)
|
||||
OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||")
|
||||
NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||")
|
||||
if [ "x$5" == "xview" ]; then VIEW=view; fi
|
||||
else
|
||||
ROOT1=$(dirname $OLD)/
|
||||
ROOT2=$(dirname $NEW)/
|
||||
OLD_NAME=$OLD
|
||||
NEW_NAME=$NEW
|
||||
if [ "x$3" == "xview" ]; then VIEW=view; fi
|
||||
fi
|
||||
|
||||
if cmp $OLD $NEW > /dev/null
|
||||
then
|
||||
# The files were bytewise identical.
|
||||
echo Identical: $OLD_NAME
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/$NEW_NAME.new
|
||||
|
||||
mkdir -p $(dirname $OLD_SYMBOLS)
|
||||
mkdir -p $(dirname $NEW_SYMBOLS)
|
||||
|
||||
if [ $OSTYPE == "cygwin" ]; then
|
||||
"$NM" $NM_ARGS $OLD | grep " = " > $OLD_SYMBOLS
|
||||
"$NM" $NM_ARGS $NEW | grep " = " > $NEW_SYMBOLS
|
||||
"$NM" $NM_ARGS $OLD > $OLD_SYMBOLS.full
|
||||
"$NM" $NM_ARGS $NEW > $NEW_SYMBOLS.full
|
||||
else
|
||||
# Strip the addresses, just compare the ordering of the symbols.
|
||||
$NM $OLD | cut -f 2- -d ' ' > $OLD_SYMBOLS
|
||||
$NM $NEW | cut -f 2- -d ' ' > $NEW_SYMBOLS
|
||||
# But store the full information for easy diff access.
|
||||
$NM $OLD > $OLD_SYMBOLS.full
|
||||
$NM $NEW > $NEW_SYMBOLS.full
|
||||
fi
|
||||
|
||||
DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS)
|
||||
|
||||
RESULT=0
|
||||
|
||||
if [ -n "$DIFFS" ]; then
|
||||
if [ $OLD_SIZE -ne $NEW_SIZE ]
|
||||
then
|
||||
echo Differences, content AND size : $OLD_NAME
|
||||
RESULT=4
|
||||
else
|
||||
echo Differences, content BUT SAME size: $OLD_NAME
|
||||
RESULT=3
|
||||
fi
|
||||
if [ "x$VIEW" == "xview" ]; then
|
||||
LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS
|
||||
fi
|
||||
else
|
||||
if [ $OLD_SIZE -ne $NEW_SIZE ]
|
||||
then
|
||||
echo Identical symbols BUT NEW size : $OLD_NAME
|
||||
RESULT=2
|
||||
else
|
||||
echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME
|
||||
RESULT=1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $RESULT
|
||||
|
||||
|
||||
|
151
common/bin/diffjarzip.sh
Normal file
151
common/bin/diffjarzip.sh
Normal file
@ -0,0 +1,151 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Simple tool to diff two jar or zip files. It unpacks the jar/zip files and
|
||||
# reports if files differs and if files are new or missing.
|
||||
# Assumes gnu diff.
|
||||
|
||||
# There are a few source files that have DOS line endings in the
|
||||
# jaxp/jaxws source drops, when the sources were added to the repository
|
||||
# the source files were converted to UNIX line endings.
|
||||
# For now we ignore these differences.
|
||||
DIFF_FLAGS="--strip-trailing-cr"
|
||||
#set -x
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "Diff two jar/zip files. Return codes: 0 - no diff, 1 - diff, 2 - couldn't perform diff"
|
||||
echo "Syntax: $0 old_archive new_archive [old_root new_root]"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ ! -f $1 ]
|
||||
then
|
||||
echo $1 does not exist
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ ! -f $2 ]
|
||||
then
|
||||
echo $2 does not exist
|
||||
exit 2
|
||||
fi
|
||||
|
||||
IGNORES="cat"
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
ROOT1=$(cd $3 && pwd)
|
||||
ROOT2=$(cd $4 && pwd)
|
||||
OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||")
|
||||
NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||")
|
||||
if [ $# == 5 ]; then IGNORES="$5"; fi
|
||||
else
|
||||
ROOT1=$(dirname $OLD)/
|
||||
ROOT2=$(dirname $NEW)/
|
||||
OLD_NAME=$OLD
|
||||
NEW_NAME=$NEW
|
||||
if [ $# == 3 ]; then IGNORES="$3"; fi
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
DIFF=gdiff
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
|
||||
OLD_SUFFIX="${OLD##*.}"
|
||||
NEW_SUFFIX="${NEW##*.}"
|
||||
if [ "$OLD_SUFFIX" != "$NEW_SUFFIX" ]; then
|
||||
echo The files do not have the same suffix type!
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ]; then
|
||||
echo The files have to be zip or jar! They are $OLD_SUFFIX
|
||||
exit 2
|
||||
fi
|
||||
|
||||
UNARCHIVE="unzip -q"
|
||||
|
||||
TYPE="$OLD_SUFFIX"
|
||||
|
||||
if cmp $OLD $NEW > /dev/null
|
||||
then
|
||||
# The files were bytewise identical.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Not quite identical, the might still contain the same data.
|
||||
# Unpack the jar/zip files in temp dirs
|
||||
if test "x$COMPARE_ROOT" == "x"; then
|
||||
COMPARE_ROOT=/tmp/compare_root.$$
|
||||
REMOVE_COMPARE_ROOT=true
|
||||
fi
|
||||
OLD_TEMPDIR=$COMPARE_ROOT/$OLD_NAME.old
|
||||
NEW_TEMPDIR=$COMPARE_ROOT/$NEW_NAME.new
|
||||
mkdir -p $OLD_TEMPDIR
|
||||
mkdir -p $NEW_TEMPDIR
|
||||
(cd $OLD_TEMPDIR && rm -rf * ; $UNARCHIVE $OLD)
|
||||
(cd $NEW_TEMPDIR && rm -rf * ; $UNARCHIVE $NEW)
|
||||
|
||||
ONLY1=$(LANG=C $DIFF -rq $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $OLD_TEMPDIR")
|
||||
|
||||
if [ -n "$ONLY1" ]; then
|
||||
echo " Only the OLD $OLD_NAME contains:"
|
||||
LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $OLD_TEMPDIR" \
|
||||
| sed "s|Only in $OLD_TEMPDIR| |"g | sed 's|: |/|g'
|
||||
fi
|
||||
|
||||
ONLY2=$(LANG=C $DIFF -rq $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $NEW_TEMPDIR")
|
||||
|
||||
if [ -n "$ONLY2" ]; then
|
||||
echo " Only the NEW $NEW_NAME contains:"
|
||||
LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $NEW_TEMPDIR" \
|
||||
| sed "s|Only in $NEW_TEMPDIR| |"g | sed 's|: |/|g'
|
||||
fi
|
||||
|
||||
DIFFTEXT=`dirname $0`/difftext.sh
|
||||
|
||||
LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep differ | cut -f 2,4 -d ' ' | \
|
||||
awk "{ print \"$DIFFTEXT \"\$1\" \"\$2 }" > $COMPARE_ROOT/diffing
|
||||
|
||||
/bin/bash $COMPARE_ROOT/diffing > $COMPARE_ROOT/diffs
|
||||
|
||||
if [ -s "$COMPARE_ROOT/diffs" ]; then
|
||||
echo " Differing files in $OLD_NAME"
|
||||
cat $COMPARE_ROOT/diffs | grep differ | $IGNORES | cut -f 2 -d ' ' | \
|
||||
sed "s|$OLD_TEMPDIR| |g"
|
||||
fi
|
||||
|
||||
# Clean up
|
||||
|
||||
if [ "x$REMOVE_COMPARE_ROOT" == xtrue ]; then
|
||||
rm -rf $REMOVE_COMPARE_ROOT
|
||||
fi
|
||||
|
||||
exit 1
|
||||
|
168
common/bin/difflib.sh
Normal file
168
common/bin/difflib.sh
Normal file
@ -0,0 +1,168 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Simple tool to diff two shared libraries.
|
||||
# Criterias: two shared libraries are considered equal if:
|
||||
# the file sizes are the same AND the symbols outputs from the nm command are equal
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "Diff two shared libs. Return codes:"
|
||||
echo "0 - no diff"
|
||||
echo "1 - Identical symbols AND size, BUT not bytewise identical"
|
||||
echo "2 - Identical symbols BUT NEW size"
|
||||
echo "3 - Differences, content BUT SAME size"
|
||||
echo "4 - Differences, content AND size"
|
||||
echo "10 - Could not perform diff"
|
||||
echo "Use 'quiet' to disable any output."
|
||||
echo "Syntax: $0 file1 file2 [quiet]"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ ! -f $1 ]
|
||||
then
|
||||
echo $1 does not exist
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ ! -f $2 ]
|
||||
then
|
||||
echo $2 does not exist
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT=gstat
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT=stat
|
||||
else
|
||||
NM=nm
|
||||
STAT=stat
|
||||
fi
|
||||
|
||||
# Should the differences be viewed?
|
||||
VIEW=
|
||||
# You can do export DIFF=meld to view
|
||||
# any differences using meld instead.
|
||||
if [ -n "$DIFF" ]; then
|
||||
DIFF="$DIFF"
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT -c%s "$OLD")
|
||||
NEW_SIZE=$($STAT -c%s "$NEW")
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
ROOT1=$(cd $3 && pwd)
|
||||
ROOT2=$(cd $4 && pwd)
|
||||
OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||")
|
||||
NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||")
|
||||
if [ "x$5" == "xview" ]; then VIEW=view; fi
|
||||
else
|
||||
ROOT1=$(dirname $OLD)/
|
||||
ROOT2=$(dirname $NEW)/
|
||||
OLD_NAME=$OLD
|
||||
NEW_NAME=$NEW
|
||||
if [ "x$3" == "xview" ]; then VIEW=view; fi
|
||||
fi
|
||||
|
||||
OLD_SUFFIX="${OLD##*.}"
|
||||
NEW_SUFFIX="${NEW##*.}"
|
||||
if [ "$OLD_SUFFIX" != "$NEW_SUFFIX" ]; then
|
||||
echo The files do not have the same suffix type!
|
||||
exit 10
|
||||
fi
|
||||
|
||||
if [ "$OLD_SUFFIX" != "so" ] && [ "$OLD_SUFFIX" != "dylib" ] && [ "$OLD_SUFFIX" != "dll" ]; then
|
||||
echo The files have to be .so, .dylib or .dll! They are $OLD_SUFFIX
|
||||
exit 10
|
||||
fi
|
||||
|
||||
TYPE="$OLD_SUFFIX"
|
||||
|
||||
if cmp $OLD $NEW > /dev/null
|
||||
then
|
||||
# The files were bytewise identical.
|
||||
echo Identical: $OLD_NAME
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/$NEW_NAME.new
|
||||
|
||||
mkdir -p $(dirname $OLD_SYMBOLS)
|
||||
mkdir -p $(dirname $NEW_SYMBOLS)
|
||||
|
||||
if [ $OSTYPE == "cygwin" ]; then
|
||||
"$NM" $NM_ARGS $OLD | grep " = " > $OLD_SYMBOLS
|
||||
"$NM" $NM_ARGS $NEW | grep " = " > $NEW_SYMBOLS
|
||||
"$NM" $NM_ARGS $OLD > $OLD_SYMBOLS.full
|
||||
"$NM" $NM_ARGS $NEW > $NEW_SYMBOLS.full
|
||||
else
|
||||
# Strip the addresses, just compare the ordering of the symbols.
|
||||
$NM $OLD | cut -f 2- -d ' ' > $OLD_SYMBOLS
|
||||
$NM $NEW | cut -f 2- -d ' ' > $NEW_SYMBOLS
|
||||
# But store the full information for easy diff access.
|
||||
$NM $OLD > $OLD_SYMBOLS.full
|
||||
$NM $NEW > $NEW_SYMBOLS.full
|
||||
fi
|
||||
|
||||
DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS)
|
||||
|
||||
RESULT=0
|
||||
|
||||
if [ -n "$DIFFS" ]; then
|
||||
if [ $OLD_SIZE -ne $NEW_SIZE ]
|
||||
then
|
||||
echo Differences, content AND size : $OLD_NAME
|
||||
RESULT=4
|
||||
else
|
||||
echo Differences, content BUT SAME size: $OLD_NAME
|
||||
RESULT=3
|
||||
fi
|
||||
if [ "x$VIEW" == "xview" ]; then
|
||||
LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS
|
||||
fi
|
||||
else
|
||||
if [ $OLD_SIZE -ne $NEW_SIZE ]
|
||||
then
|
||||
echo Identical symbols BUT NEW size : $OLD_NAME
|
||||
RESULT=2
|
||||
else
|
||||
echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME
|
||||
RESULT=1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $RESULT
|
||||
|
||||
|
||||
|
157
common/bin/difftext.sh
Normal file
157
common/bin/difftext.sh
Normal file
@ -0,0 +1,157 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# The difftext.sh knows how to compare text files and
|
||||
# ignore some specific differences.
|
||||
# When difftext.sh is called, we already know that the
|
||||
# files differ. But if the tests below trigger, then
|
||||
# we ignore differences caused by:
|
||||
#
|
||||
# Timestamps in Java sources generated by idl2java
|
||||
# Sorting order and cleanup style in .properties files.
|
||||
|
||||
OLD="$1"
|
||||
NEW="$2"
|
||||
SUF="${OLD##*.}"
|
||||
TMP=1
|
||||
if test "x$SUF" == "xjava"; then
|
||||
TMP=$(LANG=C diff $OLD $NEW | \
|
||||
grep '^[<>]' | \
|
||||
sed '/[<>] \* from.*\.idl/d' | \
|
||||
sed '/[<>] \*.*201[12].*/d' | \
|
||||
sed '/\/\/ Generated from input file.*/d' | \
|
||||
sed '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' | \
|
||||
sed '/\/\/ java GenerateCharacter.*/d')
|
||||
fi
|
||||
if test "x$SUF" == "xproperties"; then
|
||||
cat $OLD | sed -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
|
||||
-e 's/\\u0020/\x20/g' \
|
||||
-e 's/\\u003A/\x3A/g' \
|
||||
-e 's/\\u006B/\x6B/g' \
|
||||
-e 's/\\u0075/\x75/g' \
|
||||
-e 's/\\u00A0/\xA0/g' \
|
||||
-e 's/\\u00A3/\xA3/g' \
|
||||
-e 's/\\u00B0/\xB0/g' \
|
||||
-e 's/\\u00B7/\xB7/g' \
|
||||
-e 's/\\u00BA/\xBA/g' \
|
||||
-e 's/\\u00BF/\xBF/g' \
|
||||
-e 's/\\u00C0/\xC0/g' \
|
||||
-e 's/\\u00C1/\xC1/g' \
|
||||
-e 's/\\u00C2/\xC2/g' \
|
||||
-e 's/\\u00C4/\xC4/g' \
|
||||
-e 's/\\u00C5/\xC5/g' \
|
||||
-e 's/\\u00C8/\xC8/g' \
|
||||
-e 's/\\u00C9/\xC9/g' \
|
||||
-e 's/\\u00CA/\xCA/g' \
|
||||
-e 's/\\u00CD/\xCD/g' \
|
||||
-e 's/\\u00CE/\xCE/g' \
|
||||
-e 's/\\u00D3/\xD3/g' \
|
||||
-e 's/\\u00D4/\xD4/g' \
|
||||
-e 's/\\u00D6/\xD6/g' \
|
||||
-e 's/\\u00DA/\xDA/g' \
|
||||
-e 's/\\u00DC/\xDC/g' \
|
||||
-e 's/\\u00DD/\xDD/g' \
|
||||
-e 's/\\u00DF/\xDF/g' \
|
||||
-e 's/\\u00E0/\xE0/g' \
|
||||
-e 's/\\u00E1/\xE1/g' \
|
||||
-e 's/\\u00E2/\xE2/g' \
|
||||
-e 's/\\u00E3/\xE3/g' \
|
||||
-e 's/\\u00E4/\xE4/g' \
|
||||
-e 's/\\u00E5/\xE5/g' \
|
||||
-e 's/\\u00E6/\xE6/g' \
|
||||
-e 's/\\u00E7/\xE7/g' \
|
||||
-e 's/\\u00E8/\xE8/g' \
|
||||
-e 's/\\u00E9/\xE9/g' \
|
||||
-e 's/\\u00EA/\xEA/g' \
|
||||
-e 's/\\u00EB/\xEB/g' \
|
||||
-e 's/\\u00EC/\xEC/g' \
|
||||
-e 's/\\u00ED/\xED/g' \
|
||||
-e 's/\\u00EE/\xEE/g' \
|
||||
-e 's/\\u00EF/\xEF/g' \
|
||||
-e 's/\\u00F1/\xF1/g' \
|
||||
-e 's/\\u00F2/\xF2/g' \
|
||||
-e 's/\\u00F3/\xF3/g' \
|
||||
-e 's/\\u00F4/\xF4/g' \
|
||||
-e 's/\\u00F5/\xF5/g' \
|
||||
-e 's/\\u00F6/\xF6/g' \
|
||||
-e 's/\\u00F9/\xF9/g' \
|
||||
-e 's/\\u00FA/\xFA/g' \
|
||||
-e 's/\\u00FC/\xFC/g' \
|
||||
-e 's/\\u0020/\x20/g' \
|
||||
-e 's/\\u003f/\x3f/g' \
|
||||
-e 's/\\u006f/\x6f/g' \
|
||||
-e 's/\\u0075/\x75/g' \
|
||||
-e 's/\\u00a0/\xa0/g' \
|
||||
-e 's/\\u00a3/\xa3/g' \
|
||||
-e 's/\\u00b0/\xb0/g' \
|
||||
-e 's/\\u00ba/\xba/g' \
|
||||
-e 's/\\u00bf/\xbf/g' \
|
||||
-e 's/\\u00c1/\xc1/g' \
|
||||
-e 's/\\u00c4/\xc4/g' \
|
||||
-e 's/\\u00c5/\xc5/g' \
|
||||
-e 's/\\u00c8/\xc8/g' \
|
||||
-e 's/\\u00c9/\xc9/g' \
|
||||
-e 's/\\u00ca/\xca/g' \
|
||||
-e 's/\\u00cd/\xcd/g' \
|
||||
-e 's/\\u00d6/\xd6/g' \
|
||||
-e 's/\\u00dc/\xdc/g' \
|
||||
-e 's/\\u00dd/\xdd/g' \
|
||||
-e 's/\\u00df/\xdf/g' \
|
||||
-e 's/\\u00e0/\xe0/g' \
|
||||
-e 's/\\u00e1/\xe1/g' \
|
||||
-e 's/\\u00e2/\xe2/g' \
|
||||
-e 's/\\u00e3/\xe3/g' \
|
||||
-e 's/\\u00e4/\xe4/g' \
|
||||
-e 's/\\u00e5/\xe5/g' \
|
||||
-e 's/\\u00e7/\xe7/g' \
|
||||
-e 's/\\u00e8/\xe8/g' \
|
||||
-e 's/\\u00e9/\xe9/g' \
|
||||
-e 's/\\u00ea/\xea/g' \
|
||||
-e 's/\\u00eb/\xeb/g' \
|
||||
-e 's/\\u00ec/\xec/g' \
|
||||
-e 's/\\u00ed/\xed/g' \
|
||||
-e 's/\\u00ee/\xee/g' \
|
||||
-e 's/\\u00ef/\xef/g' \
|
||||
-e 's/\\u00f0/\xf0/g' \
|
||||
-e 's/\\u00f1/\xf1/g' \
|
||||
-e 's/\\u00f2/\xf2/g' \
|
||||
-e 's/\\u00f3/\xf3/g' \
|
||||
-e 's/\\u00f4/\xf4/g' \
|
||||
-e 's/\\u00f5/\xf5/g' \
|
||||
-e 's/\\u00f6/\xf6/g' \
|
||||
-e 's/\\u00f7/\xf7/g' \
|
||||
-e 's/\\u00f8/\xf8/g' \
|
||||
-e 's/\\u00f9/\xf9/g' \
|
||||
-e 's/\\u00fa/\xfa/g' \
|
||||
-e 's/\\u00fc/\xfc/g' \
|
||||
-e 's/\\u00ff/\xff/g' \
|
||||
| sed -e '/^#/d' -e '/^$/d' \
|
||||
-e :a -e '/\\$/N; s/\\\n//; ta' \
|
||||
-e 's/^[ \t]*//;s/[ \t]*$//' \
|
||||
-e 's/\\=/=/' | LANG=C sort > $OLD.cleaned
|
||||
TMP=$(LANG=C diff $OLD.cleaned $NEW)
|
||||
fi
|
||||
if test -n "$TMP"; then
|
||||
echo Files $OLD and $NEW differ
|
||||
fi
|
114
common/bin/exception_list_linux
Normal file
114
common/bin/exception_list_linux
Normal file
@ -0,0 +1,114 @@
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# List of files inside jar archives that are ok if they differ.
|
||||
LIST_DIFF_JAR="
|
||||
/sun/misc/Version.class
|
||||
/sun/tools/jconsole/Version.class
|
||||
/com/sun/tools/javac/resources/version.class
|
||||
/com/sun/tools/javah/resources/version.class
|
||||
/com/sun/tools/javap/resources/version.class
|
||||
"
|
||||
|
||||
# List of binaries that only need to match symbols
|
||||
LIST_DIFF_SIZE="
|
||||
jre/lib/amd64/libfontmanager.so
|
||||
jre/lib/amd64/libjdwp.so
|
||||
jre/lib/amd64/libt2k.so
|
||||
bin/unpack200
|
||||
jre/bin/unpack200
|
||||
jre/lib/amd64/libjsig.debuginfo
|
||||
jre/lib/amd64/libsaproc.debuginfo
|
||||
jre/lib/amd64/server/libjvm.debuginfo
|
||||
"
|
||||
|
||||
# List of binares that need to match both symbols and size
|
||||
LIST_DIFF_BYTE="
|
||||
jre/lib/amd64/libdt_socket.so
|
||||
jre/lib/amd64/libattach.so
|
||||
jre/lib/amd64/libjaas_unix.so
|
||||
jre/lib/amd64/libjawt.so
|
||||
jre/lib/amd64/libjpeg.so
|
||||
jre/lib/amd64/libjsdt.so
|
||||
jre/lib/amd64/libjsig.so
|
||||
jre/lib/amd64/libsaproc.so
|
||||
jre/lib/amd64/libsctp.so
|
||||
jre/lib/amd64/libsunec.so
|
||||
jre/lib/amd64/libunpack.so
|
||||
jre/lib/amd64/libverify.so
|
||||
jre/lib/amd64/libzip.so
|
||||
jre/lib/amd64/server/libjsig.so
|
||||
jre/lib/amd64/server/libjvm.so
|
||||
jre/lib/amd64/liblcms.so
|
||||
demo/jvmti/heapTracker/lib/libheapTracker.so
|
||||
demo/jvmti/hprof/lib/libhprof.so
|
||||
demo/jvmti/minst/lib/libminst.so
|
||||
demo/jvmti/mtrace/lib/libmtrace.so
|
||||
demo/jvmti/waiters/lib/libwaiters.so
|
||||
bin/appletviewer
|
||||
bin/extcheck
|
||||
bin/idlj
|
||||
bin/jar
|
||||
bin/jarsigner
|
||||
bin/java
|
||||
bin/javac
|
||||
bin/javadoc
|
||||
bin/javah
|
||||
bin/javap
|
||||
bin/jcmd
|
||||
bin/jconsole
|
||||
bin/jdb
|
||||
bin/jhat
|
||||
bin/jinfo
|
||||
bin/jmap
|
||||
bin/jps
|
||||
bin/jrunscript
|
||||
bin/jsadebugd
|
||||
bin/jstack
|
||||
bin/jstat
|
||||
bin/jstatd
|
||||
bin/keytool
|
||||
bin/native2ascii
|
||||
bin/orbd
|
||||
bin/pack200
|
||||
bin/policytool
|
||||
bin/rmic
|
||||
bin/rmid
|
||||
bin/rmiregistry
|
||||
bin/schemagen
|
||||
bin/serialver
|
||||
bin/servertool
|
||||
bin/tnameserv
|
||||
bin/wsgen
|
||||
bin/wsimport
|
||||
bin/xjc
|
||||
jre/bin/java
|
||||
jre/bin/keytool
|
||||
jre/bin/orbd
|
||||
jre/bin/pack200
|
||||
jre/bin/policytool
|
||||
jre/bin/rmid
|
||||
jre/bin/rmiregistry
|
||||
jre/bin/servertool
|
||||
jre/bin/tnameserv
|
||||
"
|
53
common/bin/extractvcvars.sh
Normal file
53
common/bin/extractvcvars.sh
Normal file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Must be bash, but that is ok since we are running from cygwin.
|
||||
# The first argument is the vcvarsall.bat file to run.
|
||||
# The second argument is the arch arg to give to vcvars.
|
||||
VCVARSALL="$1"
|
||||
ARCH_ARG="$2"
|
||||
|
||||
# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment)
|
||||
# but calculate the difference in Cygwin environment before/after running it and then
|
||||
# apply the diff.
|
||||
_vs10varsall=`cygpath -a -m -s "$VCVARSALL"`
|
||||
_dosvs10varsall=`cygpath -a -w -s $_vs10varsall`
|
||||
_dosbash=`cygpath -a -w -s \`which bash\`.*`
|
||||
|
||||
# generate the set of exported vars before/after the vs10 setup
|
||||
echo "@echo off" > localdevenvtmp.bat
|
||||
echo "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat
|
||||
echo "call $_dosvs10varsall $ARCH_ARG" >> localdevenvtmp.bat
|
||||
echo "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat
|
||||
cmd /c localdevenvtmp.bat
|
||||
|
||||
# apply the diff (less some non-vs10 vars named by "!")
|
||||
sort localdevenvtmp.export0 |grep -v "!" > localdevenvtmp.export0.sort
|
||||
sort localdevenvtmp.export1 |grep -v "!" > localdevenvtmp.export1.sort
|
||||
comm -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh
|
||||
cat localdevenv.sh | sed 's/declare -x /export /g' | sed 's/="/:="/g' | sed 's/\\\\/\\/g' | sed 's/"//g' | \
|
||||
sed 's/#/\$\(HASH\)/g' > localdevenv.gmk
|
||||
|
||||
# cleanup
|
||||
rm -f localdevenvtmp*
|
41
common/bin/hide_important_warnings_from_javac.sh
Normal file
41
common/bin/hide_important_warnings_from_javac.sh
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
if [ -x /usr/bin/ggrep ] ; then
|
||||
# Gnu grep on Solaris
|
||||
# (reference configure and build/solaris-i586-clientANDserver-release/spec.gmk
|
||||
GREP=/usr/bin/ggrep
|
||||
else
|
||||
GREP=grep
|
||||
fi
|
||||
#
|
||||
EXP="Note: Some input files use or override a deprecated API."
|
||||
EXP="${EXP}|Note: Recompile with -Xlint:deprecation for details."
|
||||
EXP="${EXP}|Note: Some input files use unchecked or unsafe operations."
|
||||
EXP="${EXP}|Note: Recompile with -Xlint:unchecked for details."
|
||||
EXP="${EXP}| warning"
|
||||
EXP="${EXP}|uses or overrides a deprecated API."
|
||||
EXP="${EXP}|uses unchecked or unsafe operations."
|
||||
#
|
||||
${GREP} --line-buffered -v -E "${EXP}"
|
46
common/bin/logger.sh
Normal file
46
common/bin/logger.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Usage: ./logger.sh theloggfile acommand arg1 arg2
|
||||
#
|
||||
# Execute acommand with args, in such a way that
|
||||
# both stdout and stderr from acommand are appended to
|
||||
# theloggfile.
|
||||
#
|
||||
# Preserve stdout and stderr, so that the stdout
|
||||
# from logger.sh is the same from acommand and equally
|
||||
# for stderr.
|
||||
#
|
||||
# Propagate the result code from acommand so that
|
||||
# ./logger.sh exits with the same result code.
|
||||
|
||||
# Create a temporary directory to store the result code from
|
||||
# the wrapped command.
|
||||
RCDIR=`mktemp -d tmp.XXXXXX` || exit $?
|
||||
trap "rm -rf '$RCDIR'" EXIT
|
||||
LOGFILE=$1
|
||||
shift
|
||||
(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > $RCDIR/rc) | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE
|
||||
exit `cat $RCDIR/rc`
|
||||
|
114
common/makefiles/IdlCompilation.gmk
Normal file
114
common/makefiles/IdlCompilation.gmk
Normal file
@ -0,0 +1,114 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
PREFIXES=-pkgPrefix CORBA org.omg \
|
||||
-pkgPrefix CosNaming org.omg \
|
||||
-pkgPrefix CosTransactions org.omg \
|
||||
-pkgPrefix CosTSInteroperation org.omg \
|
||||
-pkgPrefix DynamicAny org.omg \
|
||||
-pkgPrefix Dynamic org.omg \
|
||||
-pkgPrefix IOP org.omg \
|
||||
-pkgPrefix Messaging org.omg \
|
||||
-pkgPrefix PortableInterceptor org.omg \
|
||||
-pkgPrefix PortableServer org.omg \
|
||||
-pkgPrefix activation com.sun.corba.se.spi \
|
||||
-pkgPrefix GIOP com.sun.corba.se \
|
||||
-pkgPrefix PortableActivationIDL com.sun.corba.se \
|
||||
-pkgPrefix messages com.sun.corba.se
|
||||
|
||||
define add_idl_package
|
||||
# param 1 = MYPACKAGE
|
||||
# param 2 = src root
|
||||
# param 3 = gensrc root
|
||||
# param 4 = source idl to compile
|
||||
# param 5 = target idl package
|
||||
# param 6 = delete these files that were output from the idlj
|
||||
# param 7 = idls that match these patterns should be compiled with -oldImplBase
|
||||
# param 8 = the idlj command
|
||||
# Save the generated java files to a temporary directory so
|
||||
# that we can find them and create proper dependencies.
|
||||
# After that, we move them to the real gensrc target dir.
|
||||
$4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___
|
||||
ifneq ($$(filter $7,$4),)
|
||||
$4_OLDIMPLBASE:=-oldImplBase
|
||||
$4_OLDIMPLBASE_MSG:=with -oldImplBase
|
||||
endif
|
||||
$5 : $4
|
||||
mkdir -p $3/$$($4_TMPDIR)
|
||||
rm -rf $3/$$($4_TMPDIR)
|
||||
mkdir -p $(dir $5)
|
||||
echo Compiling IDL $(patsubst $2/%,%,$4)
|
||||
$8 -td $3/$$($4_TMPDIR) \
|
||||
-i $2/org/omg/CORBA \
|
||||
-i $2/org/omg/PortableInterceptor \
|
||||
-i $2/org/omg/PortableServer \
|
||||
-D CORBA3 -corba 3.0 \
|
||||
-fall \
|
||||
$$($4_OLDIMPLBASE) \
|
||||
$(PREFIXES) \
|
||||
$4
|
||||
rm -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
|
||||
cp -rp $3/$$($4_TMPDIR)/* $3
|
||||
(cd $3/$$($4_TMPDIR); find . -type f | sed 's!\./!$3/!g' | awk '{ print $$$$1 ": $4" }' > $5)
|
||||
rm -rf $3/$$($4_TMPDIR)
|
||||
endef
|
||||
|
||||
define SetupIdlCompilation
|
||||
# param 1 is for example BUILD_IDLS
|
||||
# param 2,3,4,5,6,7,8 are named args.
|
||||
# IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
# Remove any relative addressing in the paths.
|
||||
$1_SRC := $$(abspath $$($1_SRC))
|
||||
$1_BIN := $$(abspath $$($1_BIN))
|
||||
# Find all existing java files and existing class files.
|
||||
$$(shell mkdir -p $$($1_SRC) $$($1_BIN))
|
||||
$1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
|
||||
$1_BINS := $$(shell find $$($1_BIN) -name "*.java")
|
||||
# Prepend the source/bin path to the filter expressions.
|
||||
$1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES))
|
||||
$1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES))
|
||||
$1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES))
|
||||
$1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES))
|
||||
$1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES))
|
||||
# Now remove unwanted java/class files.
|
||||
$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
|
||||
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
|
||||
$1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
|
||||
$1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
|
||||
$1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS)))
|
||||
# Now create the dependencies for each idl target.
|
||||
$$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ))))
|
||||
endef
|
||||
|
||||
.SUFFIXES: .java .class .package
|
||||
|
887
common/makefiles/JavaCompilation.gmk
Normal file
887
common/makefiles/JavaCompilation.gmk
Normal file
@ -0,0 +1,887 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# The complexity of this makefile is not the fault of make, but the fault
|
||||
# of javac and javah. The basic problems are:
|
||||
#
|
||||
# 1) Compiling a single Java source file unpredictably generates anything
|
||||
# between zero (0!) and an infinite number of .class files!
|
||||
# 2) There is no hint, for which classes javah needs to be run,
|
||||
# and it happily generates .h files for classes with no native methods.
|
||||
# 3) javac and javah do not cleanup anything, for example if an internal
|
||||
# class (potentially with native methods) is removed from a Java source file.
|
||||
#
|
||||
# This makefile is a tribute to GNU make. And yes, it was harder to write than it is
|
||||
# to read. The include/excludes of directories and files are only a temporary measure
|
||||
# to work around the messy jdk sources that put platform specific code in src/share/classes.
|
||||
#
|
||||
# We should move most of the functionality of this makefile into a
|
||||
# smart javac/javah/javadoc/jar combo tool. sjavac ?
|
||||
#
|
||||
# I.e. 1) It always generates a single output, a zip-file from a number of source roots.
|
||||
# The zip file contains information that enable incremental builds with full
|
||||
# dependency tracking between packages.
|
||||
# 2) It automatically generates the right .h files.
|
||||
# 3) It keeps its house clean.
|
||||
# *) Generates intermediate files to be used for javadoc generation later.
|
||||
# and does all the other useful things that this makefile does, such as:
|
||||
# use all cores for compilation, reuse the running JVM for all compilations,
|
||||
# and has pubapi dependency tracking to minimize the number of files
|
||||
# that need to be recompiled during an incremental build.
|
||||
#
|
||||
# A zip file, or several zip files combined, can then be converted to a .jar file, or to a .jmod file.
|
||||
#
|
||||
# This would make this makefile much much simpler. I.e. make can be used
|
||||
# for its real purpose, track dependencies and trigger a recompile if a
|
||||
# dependency has changed.
|
||||
#
|
||||
# When you read this source. Remember that $(sort ...) has the side effect
|
||||
# of removing duplicates. It is actually this side effect that is
|
||||
# desired whenever sort is used below!
|
||||
|
||||
ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
|
||||
endif
|
||||
|
||||
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
|
||||
|
||||
# If compilation of java package fails, then the public api file for that
|
||||
# package will not be genereated. We add this fallback rule to generate
|
||||
# an empty pubapi file.
|
||||
%.api:
|
||||
if test ! -f $@; then $(MKDIR) -p $(@D); $(TOUCH) $@; fi
|
||||
|
||||
define SetupJavaCompiler
|
||||
# param 1 is for example BOOT_JAVAC or NEW_JAVAC
|
||||
# This is the name later used to decide which java compiler to use.
|
||||
# param 2-9 are named args.
|
||||
# JVM:=The jvm used to run the javac/javah command
|
||||
# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
|
||||
# JAVAH:=The javah jar and bootstrap classpath changes, or just bin/javah if JVM is left out
|
||||
# FLAGS:=Flags to be supplied to javac
|
||||
# MODE:=SINGLE_THREADED_BATCH (primarily for old javac) or MULTI_CORE_CONCURRENT
|
||||
# only for MULTI_CORE_CONCURRENT are the options below relevant:
|
||||
# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
|
||||
# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
|
||||
# USE_DEPS:=true means use -XDdeps,-XDpubapi and -XDnativeapi to track java dependencies
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
|
||||
ifeq ($$($1_MODE),MULTI_CORE_CONCURRENT)
|
||||
ifneq (,$$($1_SERVER_DIR))
|
||||
# A javac server has been requested.
|
||||
# The port file contains the tcp/ip on which the server listens
|
||||
# and the cookie necessary to talk to the server.
|
||||
$1_JAVAC_PORTFILE:=$$($1_SERVER_DIR)/$1.port
|
||||
ifeq ($$($1_SERVER_JVM),)
|
||||
# You can use a different JVM to run the background javac server.
|
||||
# But if not set, it defaults to the same JVM that is used to start
|
||||
# the javac command.
|
||||
$1_SERVER_JVM:=$$($1_JVM)
|
||||
endif
|
||||
# Set the $1_REMOTE to spawn a background javac server.
|
||||
$1_REMOTE:=-XDserver:portfile=$$($1_JAVAC_PORTFILE),poolsize=$(JAVAC_SERVER_CORES),javac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_JAVAC))))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
define SetupArchive
|
||||
# param 1 is for example ARCHIVE_MYPACKAGE
|
||||
# param 2 are the dependecies
|
||||
# param 3,4,5,6,7,8,9 are named args.
|
||||
# SRCS:=List of directories in where to find files to add to archive
|
||||
# SUFFIXES:=File suffixes to include in jar
|
||||
# INCLUDES:=List of directories/packages in SRCS that should be included
|
||||
# EXCLUDES:=List of directories/packages in SRCS that should be excluded
|
||||
# EXCLUDE_FILES:=List of files in SRCS that should be excluded
|
||||
# EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match.
|
||||
# JAR:=Jar file to create
|
||||
# MANIFEST:=Optional manifest file template.
|
||||
# JARMAIN:=Optional main class to add to manifest
|
||||
# SETUP:=The Java(h) compiler setup, needed to run javah.
|
||||
# HEADERS:=Directory to put headers in
|
||||
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
|
||||
# added to the archive.
|
||||
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$1_$(strip $(10)))
|
||||
$(if $(11),$1_$(strip $(11)))
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
|
||||
$1_JVM := $$($$($1_SETUP)_JVM)
|
||||
$1_JAVAH := $$($$($1_SETUP)_JAVAH)
|
||||
$1_JARMAIN:=$(strip $$($1_JARMAIN))
|
||||
$1_JARNAME:=$$(notdir $$($1_JAR))
|
||||
$1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest
|
||||
$1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess
|
||||
$1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes
|
||||
$1_PUBAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_pubapi_notifications
|
||||
$1_NATIVEAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native_notifications
|
||||
$1_NATIVEAPI_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native
|
||||
$1_BIN:=$$(dir $$($1_JAR))
|
||||
ifeq (,$$($1_SUFFIXES))
|
||||
# No suffix was set, default to classes.
|
||||
$1_SUFFIXES:=.class
|
||||
endif
|
||||
# Convert suffixes to a find expression
|
||||
$1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
|
||||
ifneq (,$$($1_INCLUDES))
|
||||
$1_GREP_INCLUDES:=| $(GREP) $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_INCLUDES)))
|
||||
endif
|
||||
ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES))
|
||||
$1_GREP_EXCLUDES:=| $(GREP) -v $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_EXCLUDES) $$($1_EXCLUDE_FILES)))
|
||||
endif
|
||||
|
||||
# Utility macros, to make the shell script receipt somewhat easier to dechipher.
|
||||
|
||||
# The capture contents macro finds all files (matching the patterns, typically
|
||||
# .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar.
|
||||
$1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),(($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) $$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > $$(src)/_the.$$($1_JARNAME)_contents) && )
|
||||
# The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file.
|
||||
ifeq (,$$($1_SKIP_METAINF))
|
||||
$1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) && )
|
||||
endif
|
||||
# The capture deletes macro finds all deleted files and concatenates them. The resulting file
|
||||
# tells us what to remove from the jar-file.
|
||||
$1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) &&)
|
||||
# The capture pubapi notifications scans for pubapi change notifications. If such notifications are
|
||||
# found, then we will build the classes leading up to the jar again, to take into account the new timestamps
|
||||
# on the changed pubapi files.
|
||||
$1_CAPTURE_PUBAPI_NOTIFICATIONS=$$(foreach src,$$($1_SRCS),\
|
||||
(cd $$(src) && \
|
||||
$(FIND) . -name _the.package.api.notify -exec dirname \{\} \; >> $$($1_PUBAPI_NOTIFICATIONS_FILE) ; \
|
||||
true) &&)
|
||||
# The capture nativeapi macro scans for native api change notificiations. If such notifications are
|
||||
# found, then we will run javah on the changed classes. It also collects all classes with native methods
|
||||
# to be used to find out which classes no longer has native methods, to trigger deletion of those .h files.
|
||||
$1_CAPTURE_NATIVEAPI=$$(foreach src,$$($1_SRCS),\
|
||||
(cd $$(src) && \
|
||||
$(FIND) . -name _the.package.native.notify | $(SED) 's/package.native.notify/package.native/' | \
|
||||
$(XARGS) $(CAT) | $(GREP) '^TYPE ' | $(SED) 's/.*TYPE //' >> $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
|
||||
$(FIND) . -name _the.package.native -exec $(CAT) \{\} \; | $(SED) -n 's/^TYPE //p' >> $$($1_NATIVEAPI_FILE) ; \
|
||||
true) &&)
|
||||
# The update contents macro updates the jar file with the previously capture contents.
|
||||
$1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
|
||||
(cd $$(src) && \
|
||||
if [ -s _the.$$($1_JARNAME)_contents ]; then \
|
||||
$(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
|
||||
$(JAR) uf $$@ @_the.$$($1_JARNAME)_contents; \
|
||||
fi) &&)
|
||||
# The s-variants of the above macros are used when the jar is created from scratch.
|
||||
$1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\
|
||||
(($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) $$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > $$(src)/_the.$$($1_JARNAME)_contents) && )
|
||||
ifeq (,$$($1_SKIP_METAINF))
|
||||
$1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\
|
||||
($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents) && )
|
||||
endif
|
||||
$1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
|
||||
(cd $$(src) && $(JAR) uf $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&)
|
||||
# The TOUCH macro is used to make sure all timestamps are identical for package files and the pubapi files.
|
||||
# If we do not do this, we get random recompilations, the next time we run make, since the order of package building is random,
|
||||
# ie independent of package --dependes on-> public api of another package. This is of course
|
||||
# due to the fact that Java source often (always?) has circular dependencies. (Thus there is no correct order
|
||||
# to compile packages, and we can just as well do them in a random order. Which we do.)
|
||||
$1_TOUCH_API_FILES=$$(foreach src,$$($1_SRCS),\
|
||||
($(FIND) $$(src) -name _the.package.api -exec $(TOUCH) -r $$($1_JAR) \{\} \; ; true) && \
|
||||
($(FIND) $$(src) -name _the.package -exec $(TOUCH) -r $$($1_JAR) \{\} \; ; true) &&)
|
||||
# Use a slightly shorter name for logging, but with enough path to identify this jar.
|
||||
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
|
||||
# Here is the rule that creates/updates the jar file.
|
||||
$$($1_JAR) : $2
|
||||
$(MKDIR) -p $$($1_BIN)
|
||||
if [ -n "$$($1_MANIFEST)" ]; then \
|
||||
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
|
||||
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE); \
|
||||
else \
|
||||
$(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE); \
|
||||
fi
|
||||
$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)
|
||||
if [ -n "$$($1_EXTRA_MANIFEST_ATTR)" ]; then \
|
||||
$(ECHO) "$$($1_EXTRA_MANIFEST_ATTR)" >> $$($1_MANIFEST_FILE); \
|
||||
fi
|
||||
+if [ -s $$@ ]; then \
|
||||
$(RM) -r $$($1_PUBAPI_NOTIFICATIONS_FILE) && \
|
||||
$$($1_CAPTURE_PUBAPI_NOTIFICATIONS) \
|
||||
if [ -s $$($1_PUBAPI_NOTIFICATIONS_FILE) ]; then \
|
||||
$(ECHO) Public api change detected in: && \
|
||||
$(CAT) $$($1_PUBAPI_NOTIFICATIONS_FILE) | $(TR) '/' '.' | $(SED) 's|^..||g' | $(SED) 's|\.$$$$||g' | $(AWK) '{print " "$$$$1}' && \
|
||||
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) \
|
||||
$(MAKE) -f $(word 1,$(MAKEFILE_LIST)) $$($1_JAR) ; \
|
||||
else \
|
||||
$(ECHO) Modifying $$($1_NAME) && \
|
||||
$$($1_CAPTURE_CONTENTS) \
|
||||
$$($1_CAPTURE_METAINF) \
|
||||
$(RM) $$($1_DELETES_FILE) && \
|
||||
$$($1_CAPTURE_DELETES) \
|
||||
$(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) && \
|
||||
if [ -s $$($1_DELETESS_FILE) ]; then \
|
||||
$(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \
|
||||
$(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \
|
||||
fi && \
|
||||
$$($1_UPDATE_CONTENTS) true && \
|
||||
$$($1_TOUCH_API_FILES) true && \
|
||||
$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
|
||||
$$($1_CAPTURE_NATIVEAPI) true && \
|
||||
if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ]; then \
|
||||
$(ECHO) Native api change detected in: && $(CAT) $$($1_NATIVEAPI_NOTIFICATIONS_FILE) && \
|
||||
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
|
||||
fi && \
|
||||
$(TOUCH) $$($1_NATIVEAPI_FILE)_prev ; \
|
||||
($(GREP) -xvf $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev > $$($1_NATIVEAPI_FILE)_deleted; true) && \
|
||||
$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev && \
|
||||
if [ -s $$($1_NATIVEAPI_FILE)_deleted ]; then \
|
||||
$(ECHO) Native methods dropped from classes: && $(CAT) $$($1_NATIVEAPI_FILE)_deleted && \
|
||||
$(RM) `$(CAT) $$($1_NATIVEAPI_FILE)_deleted | $(SED) -e 's|\.|_|g' -e 's|.*|$$($1_HEADERS)/&.h $$($1_HEADERS)/&_*|'` ; \
|
||||
fi && \
|
||||
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
|
||||
fi ; \
|
||||
else \
|
||||
$(ECHO) Creating $$($1_NAME) && $(JAR) cfm $$@ $$($1_MANIFEST_FILE) && \
|
||||
$$($1_SCAPTURE_CONTENTS) \
|
||||
$$($1_SCAPTURE_METAINF) \
|
||||
$$($1_SUPDATE_CONTENTS) \
|
||||
$$($1_TOUCH_API_FILES) true && \
|
||||
$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
|
||||
$$($1_CAPTURE_NATIVEAPI) true && \
|
||||
if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_FILE) ]; then \
|
||||
$(ECHO) Generating native api headers for `$(CAT) $$($1_NATIVEAPI_FILE) | $(WC) -l` classes && \
|
||||
$(RM) $$($1_HEADERS)/*.h && \
|
||||
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_FILE) && \
|
||||
$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev ; \
|
||||
fi && \
|
||||
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name "*.notify" $(FIND_DELETE); true) &&) true ; \
|
||||
fi;
|
||||
|
||||
endef
|
||||
|
||||
define append_to
|
||||
$(ECHO) "$1" >> $2
|
||||
endef
|
||||
|
||||
define SetupZipArchive
|
||||
# param 1 is for example ZIP_MYSOURCE
|
||||
# param 2,3,4,5,6,7,8,9 are named args.
|
||||
# SRC,ZIP,INCLUDES,EXCLUDES,EXCLUDE_FILES
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
|
||||
# Find all files in the source tree.
|
||||
$1_ALL_SRCS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f -a ! -name "_the.*"))
|
||||
|
||||
ifneq ($$($1_INCLUDES),)
|
||||
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
|
||||
$1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
|
||||
$1_ALL_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDES),)
|
||||
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
|
||||
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
|
||||
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
|
||||
endif
|
||||
|
||||
# Use a slightly shorter name for logging, but with enough path to identify this zip.
|
||||
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
|
||||
|
||||
# Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
|
||||
# I.e. the zip -i and -x options should match the filtering done in the makefile.
|
||||
# Explicitly excluded files can be given with absolute path. The patsubst solution
|
||||
# isn't perfect but the likelyhood of an absolute path to match something in a src
|
||||
# dir is very small.
|
||||
$$($1_ZIP) : $$($1_ALL_SRCS)
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(ECHO) Updating $$($1_NAME)
|
||||
$$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES)))) ;) true
|
||||
$(TOUCH) $$@
|
||||
endef
|
||||
|
||||
define add_file_to_copy
|
||||
# param 1 = BUILD_MYPACKAGE
|
||||
# parma 2 = The source file to copy.
|
||||
$2_TARGET:=$2
|
||||
# Remove the source prefix.
|
||||
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
|
||||
# Now we can setup the depency that will trigger the copying.
|
||||
$$($1_BIN)$$($2_TARGET) : $2
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(CP) $$< $$@
|
||||
$(CHMOD) -f ug+w $$@
|
||||
|
||||
# And do not forget this target
|
||||
$1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET)
|
||||
endef
|
||||
|
||||
|
||||
# This macro is used only for properties files that are to be
|
||||
# copied over to the classes directory in cleaned form:
|
||||
# Previously this was inconsistently done in different repositories.
|
||||
# This is the new clean standard.
|
||||
define add_file_to_copy_and_clean
|
||||
# param 1 = BUILD_MYPACKAGE
|
||||
# parma 2 = The source file to copy and clean.
|
||||
$2_TARGET:=$2
|
||||
# Remove the source prefix.
|
||||
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
|
||||
# Now we can setup the depency that will trigger the copying.
|
||||
$$($1_BIN)$$($2_TARGET) : $2
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(ECHO) Cleaning $$($2_TARGET)
|
||||
$(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
|
||||
| $(SED) \
|
||||
-e 's/\\u0020/\x20/g' \
|
||||
-e 's/\\u003A/\x3A/g' \
|
||||
-e 's/\\u006B/\x6B/g' \
|
||||
-e 's/\\u0075/\x75/g' \
|
||||
-e 's/\\u00A0/\xA0/g' \
|
||||
-e 's/\\u00A3/\xA3/g' \
|
||||
-e 's/\\u00B0/\xB0/g' \
|
||||
-e 's/\\u00B7/\xB7/g' \
|
||||
-e 's/\\u00BA/\xBA/g' \
|
||||
-e 's/\\u00BF/\xBF/g' \
|
||||
-e 's/\\u00C0/\xC0/g' \
|
||||
-e 's/\\u00C1/\xC1/g' \
|
||||
-e 's/\\u00C2/\xC2/g' \
|
||||
-e 's/\\u00C4/\xC4/g' \
|
||||
-e 's/\\u00C5/\xC5/g' \
|
||||
-e 's/\\u00C8/\xC8/g' \
|
||||
-e 's/\\u00C9/\xC9/g' \
|
||||
-e 's/\\u00CA/\xCA/g' \
|
||||
-e 's/\\u00CD/\xCD/g' \
|
||||
-e 's/\\u00CE/\xCE/g' \
|
||||
-e 's/\\u00D3/\xD3/g' \
|
||||
-e 's/\\u00D4/\xD4/g' \
|
||||
-e 's/\\u00D6/\xD6/g' \
|
||||
-e 's/\\u00DA/\xDA/g' \
|
||||
-e 's/\\u00DC/\xDC/g' \
|
||||
-e 's/\\u00DD/\xDD/g' \
|
||||
-e 's/\\u00DF/\xDF/g' \
|
||||
-e 's/\\u00E0/\xE0/g' \
|
||||
-e 's/\\u00E1/\xE1/g' \
|
||||
-e 's/\\u00E2/\xE2/g' \
|
||||
-e 's/\\u00E3/\xE3/g' \
|
||||
-e 's/\\u00E4/\xE4/g' \
|
||||
-e 's/\\u00E5/\xE5/g' \
|
||||
-e 's/\\u00E6/\xE6/g' \
|
||||
-e 's/\\u00E7/\xE7/g' \
|
||||
-e 's/\\u00E8/\xE8/g' \
|
||||
-e 's/\\u00E9/\xE9/g' \
|
||||
-e 's/\\u00EA/\xEA/g' \
|
||||
-e 's/\\u00EB/\xEB/g' \
|
||||
-e 's/\\u00EC/\xEC/g' \
|
||||
-e 's/\\u00ED/\xED/g' \
|
||||
-e 's/\\u00EE/\xEE/g' \
|
||||
-e 's/\\u00EF/\xEF/g' \
|
||||
-e 's/\\u00F1/\xF1/g' \
|
||||
-e 's/\\u00F2/\xF2/g' \
|
||||
-e 's/\\u00F3/\xF3/g' \
|
||||
-e 's/\\u00F4/\xF4/g' \
|
||||
-e 's/\\u00F5/\xF5/g' \
|
||||
-e 's/\\u00F6/\xF6/g' \
|
||||
-e 's/\\u00F9/\xF9/g' \
|
||||
-e 's/\\u00FA/\xFA/g' \
|
||||
-e 's/\\u00FC/\xFC/g' \
|
||||
-e 's/\\u0020/\x20/g' \
|
||||
-e 's/\\u003f/\x3f/g' \
|
||||
-e 's/\\u006f/\x6f/g' \
|
||||
-e 's/\\u0075/\x75/g' \
|
||||
-e 's/\\u00a0/\xa0/g' \
|
||||
-e 's/\\u00a3/\xa3/g' \
|
||||
-e 's/\\u00b0/\xb0/g' \
|
||||
-e 's/\\u00ba/\xba/g' \
|
||||
-e 's/\\u00bf/\xbf/g' \
|
||||
-e 's/\\u00c1/\xc1/g' \
|
||||
-e 's/\\u00c4/\xc4/g' \
|
||||
-e 's/\\u00c5/\xc5/g' \
|
||||
-e 's/\\u00c8/\xc8/g' \
|
||||
-e 's/\\u00c9/\xc9/g' \
|
||||
-e 's/\\u00ca/\xca/g' \
|
||||
-e 's/\\u00cd/\xcd/g' \
|
||||
-e 's/\\u00d6/\xd6/g' \
|
||||
-e 's/\\u00dc/\xdc/g' \
|
||||
-e 's/\\u00dd/\xdd/g' \
|
||||
-e 's/\\u00df/\xdf/g' \
|
||||
-e 's/\\u00e0/\xe0/g' \
|
||||
-e 's/\\u00e1/\xe1/g' \
|
||||
-e 's/\\u00e2/\xe2/g' \
|
||||
-e 's/\\u00e3/\xe3/g' \
|
||||
-e 's/\\u00e4/\xe4/g' \
|
||||
-e 's/\\u00e5/\xe5/g' \
|
||||
-e 's/\\u00e7/\xe7/g' \
|
||||
-e 's/\\u00e8/\xe8/g' \
|
||||
-e 's/\\u00e9/\xe9/g' \
|
||||
-e 's/\\u00ea/\xea/g' \
|
||||
-e 's/\\u00eb/\xeb/g' \
|
||||
-e 's/\\u00ec/\xec/g' \
|
||||
-e 's/\\u00ed/\xed/g' \
|
||||
-e 's/\\u00ee/\xee/g' \
|
||||
-e 's/\\u00ef/\xef/g' \
|
||||
-e 's/\\u00f0/\xf0/g' \
|
||||
-e 's/\\u00f1/\xf1/g' \
|
||||
-e 's/\\u00f2/\xf2/g' \
|
||||
-e 's/\\u00f3/\xf3/g' \
|
||||
-e 's/\\u00f4/\xf4/g' \
|
||||
-e 's/\\u00f5/\xf5/g' \
|
||||
-e 's/\\u00f6/\xf6/g' \
|
||||
-e 's/\\u00f7/\xf7/g' \
|
||||
-e 's/\\u00f8/\xf8/g' \
|
||||
-e 's/\\u00f9/\xf9/g' \
|
||||
-e 's/\\u00fa/\xfa/g' \
|
||||
-e 's/\\u00fc/\xfc/g' \
|
||||
-e 's/\\u00ff/\xff/g' \
|
||||
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
|
||||
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
|
||||
-e 's/^[ \t]*//;s/[ \t]*$$$$//' \
|
||||
-e 's/\\=/=/' | LANG=C sort > $$@
|
||||
$(CHMOD) -f ug+w $$@
|
||||
|
||||
# And do not forget this target
|
||||
$1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET)
|
||||
endef
|
||||
|
||||
define add_java_package
|
||||
# param 1 = BUILD_MYPACKAGE
|
||||
# param 2 = the package target file (_the.package)
|
||||
# param 3 = src roots, all of them, separated with space
|
||||
# param 4 = bin root
|
||||
# param 5 = include these dependecies
|
||||
# param 6 = not used
|
||||
# param 7 = if non-empty, then use -Xdeps and -Xpubapi
|
||||
# param 8 = xremote configuration, or empty.
|
||||
# param 9 = javac command
|
||||
# param 10 = javac flags
|
||||
# param 11 = exclude these files!
|
||||
# param 12 = only include these files!
|
||||
# param 13 = javah command
|
||||
# param 14 = override src roots to be passed into -sourcepath, ugly ugly ugly, do not use this!
|
||||
# it is only here to workaround ugly things in the source code in the jdk that ought
|
||||
# to be fixed instead!
|
||||
ifdef $2_USED_BY
|
||||
$$(error Attempting to add the package $2 from $3 which is already added with sources from $$($2_USED_BY))
|
||||
endif
|
||||
$2_USED_BY:=$3
|
||||
# Remove the _the.package file to get the target bin dir for the classes in this package.
|
||||
$2_PACKAGE_BDIR:=$(dir $2)
|
||||
# The source roots separated with a path separator (: or ; depending on os)
|
||||
# (The patsubst is necessary to trim away unnecessary spaces.)
|
||||
ifneq ($(14),)
|
||||
$2_SRCROOTSC:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$(14))))
|
||||
else
|
||||
$2_SRCROOTSC:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$3)))
|
||||
endif
|
||||
# Suffix the package path to the src roots, to get a list of all possible source locations
|
||||
# for this package.
|
||||
$2_PACKAGE_SDIRS:=$$(foreach i,$3,$$(subst $4,$$i,$$($2_PACKAGE_BDIR)))
|
||||
# Use wildcard in all potential source locations to find the actual sources.
|
||||
$2_PACKAGE_SRCS:=$$(filter-out $(11),$$(wildcard $$(addsuffix *.java,$$($2_PACKAGE_SDIRS))))
|
||||
ifneq ($(12),)
|
||||
# Filter on include file filter if set.
|
||||
$2_PACKAGE_SRCS:=$$(filter $(12),$$($2_PACKAGE_SRCS))
|
||||
endif
|
||||
# Generate a proper package name from the file name.
|
||||
$2_PACKAGE:=$(patsubst .%.,%,$(subst /,.,$(subst $4,,$(dir $2))))
|
||||
# Use a javac server for this package?
|
||||
$2_REMOTE:=$8
|
||||
|
||||
# Include previously generated information about what classes are output by this package
|
||||
# and what sources were used for the compile.
|
||||
-include $$($2_PACKAGE_BDIR)_the.package.d
|
||||
|
||||
# Include the notify, file, that exists if the package has been compiled during a previous make round.
|
||||
# I.e. we are now dealing with a compile triggered by a pubapi change.
|
||||
-include $$($2_PACKAGE_BDIR)_the.package.notify
|
||||
|
||||
# If the notify file existed, then $$($2_NOTIFIED) will be equal to true.
|
||||
# Use this information to block dependency tracking for this package.
|
||||
# This is necessary to cut the circular dependency chains that are so common in Java sources.
|
||||
|
||||
ifneq ($$($2_NOTIFIED),true)
|
||||
# No need to block, since this package has not yet been recompiled.
|
||||
# Thus include previously generated dependency information. (if it exists)
|
||||
-include $$($2_PACKAGE_BDIR)_the.package.dddd
|
||||
# else
|
||||
# $$(info WAS NOTIFIED $2)
|
||||
endif
|
||||
|
||||
# Should we create proper dependencies between packages?
|
||||
ifneq ($7,)
|
||||
# The flag: -XDpubapi:file=foo,package=mypack,notify writes a file foo that contains a
|
||||
# database of the public api of the classes supplied on the command line and are
|
||||
# inside the package mypack. If foo already exists, javac will only write to foo,
|
||||
# if there is a change in the pubapi. I.e. we can use the timestamp of this file
|
||||
# for triggering dependencies. "notify" means create a "file" suffixed with notify
|
||||
# if the pubapi really changed.
|
||||
$2_PUBAPI=-XDpubapi=file=$$($2_PACKAGE_BDIR)_the.package.api,notify,package=$$($2_PACKAGE)
|
||||
# The flag: -XDnativeapi:file=foo,package=mypack,notify works similar to pubabi, but
|
||||
# instead tracks native methods. This file can be used to trigger dependencies for
|
||||
# native compilations.
|
||||
$2_NATIVEAPI=-XDnativeapi=file=$$($2_PACKAGE_BDIR)_the.package.native,notify,package=$$($2_PACKAGE)
|
||||
# The flag -XDdeps:file=foo.deps,groupon=package writes a foo.deps file containing packages dependencies:
|
||||
# java.net : java.io java.lang
|
||||
# I.e. the classes in .net depend on the public apis of java.io and java.lang
|
||||
# The dependencies can be grouped on classes instead (groupon=class)
|
||||
# java.net.Bar : java.io.Socket java.lang.String
|
||||
$2_DEPS:=-XDdeps=file=$$($2_PACKAGE_BDIR)_the.package.deps,groupon=package
|
||||
# The next command rewrites the deps output from javac into a proper makefile dependency.
|
||||
# The dependencies are always to an .api file generated by the pubapi option above.
|
||||
# This is necessary since java package dependencies are almost always circular.
|
||||
$2_APPEND_DEPS:=($(CAT) $$($2_PACKAGE_BDIR)_the.package.deps | $(TR) '.' '/' | $(AWK) '{ print "$4/" $$$$3 }' | sort > $$($2_PACKAGE_BDIR)_the.package.ddd && $(GREP) -f $$($2_PACKAGE_BDIR)_the.package.ddd $5 | $(AWK) '{ print "$(dir $2)_the.package : " $$$$1 "_the.package.api" }' > $$($2_PACKAGE_BDIR)_the.package.dddd ; true)
|
||||
else
|
||||
# If not using dependencies, use $2 as fallback to trigger regeneration of javah header files.
|
||||
# This will generate a surplus of header files, but this does not hurt compilation.
|
||||
$2_NATIVEAPICHANGE_TRIGGER:=$2
|
||||
$2_FETCH_NATIVEAPICHANGE_CLASSES:=$(CAT) $$($2_PACKAGE_BDIR)_the.package.now|$(GREP) -v '\$$$$'|$(SED) -e 's|$4/||g'|$(SED) 's|.class||g'| $(TR) '/' '.'
|
||||
endif
|
||||
|
||||
# The _the.package file is dependent on the java files inside the package.
|
||||
# Fill the _the.package file with a list of the java files and compile them
|
||||
# to class files.
|
||||
$2 : $$($2_PACKAGE_SRCS)
|
||||
$(MKDIR) -p $$($2_PACKAGE_BDIR)
|
||||
$(RM) $2.tmp
|
||||
$$(call ListPathsSafely,$2_PACKAGE_SRCS,\n, >> $2.tmp)
|
||||
$(ECHO) $$($2_PACKAGE_BDIR)*.class | $(GREP) -v \*.class | $(TR) ' ' '\n' > $$($2_PACKAGE_BDIR)_the.package.prev
|
||||
$(RM) $$($2_PACKAGE_BDIR)*.class $$($2_PACKAGE_BDIR)*.notify $$($2_PACKAGE_BDIR)*.deleted
|
||||
$(ECHO) Compiling `$(WC) $2.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in package $(patsubst $4/%/,%,$(dir $2.tmp))
|
||||
$9 $$($2_REMOTE) $$($2_DEPS) $$($2_PUBAPI) $$($2_NATIVEAPI) $(10) -implicit:none -sourcepath "$$($2_SRCROOTSC)" -d $4 @$2.tmp
|
||||
$(ECHO) $$($2_PACKAGE_BDIR)*.class | $(GREP) -v \*.class | $(TR) ' ' '\n' > $$($2_PACKAGE_BDIR)_the.package.now
|
||||
($(GREP) -xvf $$($2_PACKAGE_BDIR)_the.package.now $$($2_PACKAGE_BDIR)_the.package.prev > $$($2_PACKAGE_BDIR)_the.package.deleted;true)
|
||||
$(ECHO) $1_CLASSES += `$(CAT) $$($2_PACKAGE_BDIR)_the.package.now` | \
|
||||
$(SED) 's/\$$$$/\$$$$\$$$$/g' > $$($2_PACKAGE_BDIR)_the.package.d
|
||||
$(ECHO) $1_JAVAS += $$($2_PACKAGE_SRCS) >> $$($2_PACKAGE_BDIR)_the.package.d
|
||||
$(ECHO) $2_NOTIFIED:=true > $$($2_PACKAGE_BDIR)_the.package.notify
|
||||
$$($2_APPEND_DEPS)
|
||||
$$($2_COPY_FILES)
|
||||
$(MV) -f $2.tmp $2
|
||||
endef
|
||||
|
||||
define remove_string
|
||||
$2 := $$(subst $1,,$$($2))
|
||||
endef
|
||||
|
||||
define replace_space_with_pathsep
|
||||
$1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2)))
|
||||
endef
|
||||
|
||||
define SetupJavaCompilation
|
||||
# param 1 is for example BUILD_MYPACKAGE
|
||||
# param 2,3,4,5,6,7,8 are named args.
|
||||
# SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
|
||||
# JVM:=path to ..bin/java
|
||||
# ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
|
||||
# SRC:=one or more directories to search for sources
|
||||
# BIN:=store classes here
|
||||
# INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
|
||||
# EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
|
||||
# COPY:=.prp means copy all prp files to the corresponding package in BIN.
|
||||
# CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
|
||||
# COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
|
||||
# SRCZIP:=Create a src.zip based on the found sources and copied files.
|
||||
# INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
|
||||
# EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
|
||||
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
|
||||
# JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac.
|
||||
# Its only here until we cleanup some nasty source code pasta in the jdk.
|
||||
# HEADERS:=path to directory where all generated c-headers are written.
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$1_$(strip $(10)))
|
||||
$(if $(11),$1_$(strip $(11)))
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
|
||||
# Extract the info from the java compiler setup.
|
||||
$1_MODE := $$($$($1_SETUP)_MODE)
|
||||
ifneq (SINGLE_THREADED_BATCH,$$($1_MODE))
|
||||
ifneq (MULTI_CORE_CONCURRENT,$$($1_MODE))
|
||||
$$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
|
||||
endif
|
||||
endif
|
||||
$1_USE_DEPS := $$($$($1_SETUP)_USE_DEPS)
|
||||
$1_REMOTE := $$($$($1_SETUP)_REMOTE)
|
||||
$1_JVM := $$($$($1_SETUP)_JVM)
|
||||
$1_JAVAC := $$($$($1_SETUP)_JAVAC)
|
||||
$1_JAVAH := $$($$($1_SETUP)_JAVAH)
|
||||
$1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
|
||||
ifeq (,$$($1_HEADERS))
|
||||
$1_HEADERS := $$($1_BIN)
|
||||
endif
|
||||
|
||||
# Handle addons and overrides.
|
||||
$1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
|
||||
# Make sure the dirs exist.
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN))
|
||||
# Find all files in the source trees.
|
||||
$1_ALL_SRCS := $$(filter-out $(OVR_SRCS),$$(foreach i,$$($1_SRC),$$(shell $(FIND) $$i -type f)))
|
||||
# Extract the java files.
|
||||
ifneq ($$($1_EXCLUDE_FILES),)
|
||||
$1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES))
|
||||
endif
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS)))
|
||||
ifneq ($$($1_INCLUDE_FILES),)
|
||||
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS))
|
||||
endif
|
||||
$1_PKGS := $$(sort $$(dir $$($1_SRCS)))
|
||||
# Remove the source root from each found path.
|
||||
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$1_PKGS)))
|
||||
$1_PKGS := $$(sort $$($1_PKGS))
|
||||
# There can be only a single bin dir root, no need to foreach over the roots.
|
||||
$1_BINS := $$(shell $(FIND) $$($1_BIN) -name "*.class")
|
||||
|
||||
# Now we have a list of all java files to compile: $$($1_SRCS)
|
||||
# and we have a list of all existing class files: $$($1_BINS)
|
||||
|
||||
# Prepend the source/bin path to the filter expressions.
|
||||
ifneq ($$($1_INCLUDES),)
|
||||
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
|
||||
$1_PKG_INCLUDES := $$(addprefix /,$$(addsuffix /%,$$($1_INCLUDES)))
|
||||
$1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$(addsuffix /%,$$($1_INCLUDES)))
|
||||
$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
|
||||
$1_PKGS := $$(filter $$($1_PKG_INCLUDES),$$($1_PKGS))
|
||||
$1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDES),)
|
||||
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
|
||||
$1_PKG_EXCLUDES := $$(addprefix /,$$(addsuffix /%,$$($1_EXCLUDES)))
|
||||
$1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$(addsuffix /%,$$($1_EXCLUDES)))
|
||||
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
|
||||
$1_PKGS := $$(filter-out $$($1_PKG_EXCLUDES),$$($1_PKGS))
|
||||
$1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
|
||||
endif
|
||||
|
||||
# Find all files to be copied from source to bin.
|
||||
ifneq (,$$($1_COPY))
|
||||
# Rewrite list of patterns into a find statement.
|
||||
$1_COPY_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_COPY))
|
||||
# Search for all files to be copied.
|
||||
$1_ALL_COPIES := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_COPY_PATTERN) \) -a -type f))
|
||||
# Copy these explicitly
|
||||
$1_ALL_COPIES += $$($1_COPY_FILES)
|
||||
# Copy must also respect filters.
|
||||
ifneq (,$$($1_INCLUDES))
|
||||
$1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES))
|
||||
endif
|
||||
ifneq (,$$($1_EXCLUDES))
|
||||
$1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES))
|
||||
endif
|
||||
ifneq (,$$($1_EXCLUDE_FILES))
|
||||
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES))
|
||||
endif
|
||||
# All files below META-INF are always copied.
|
||||
$1_ALL_COPIES += $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i/META-INF -type f 2> /dev/null))
|
||||
ifneq (,$$($1_ALL_COPIES))
|
||||
# Yep, there are files to be copied!
|
||||
$1_ALL_COPY_TARGETS:=
|
||||
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
|
||||
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
|
||||
endif
|
||||
endif
|
||||
|
||||
# Find all property files to be copied and cleaned from source to bin.
|
||||
ifneq (,$$($1_CLEAN))
|
||||
# Rewrite list of patterns into a find statement.
|
||||
$1_CLEAN_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_CLEAN))
|
||||
# Search for all files to be copied.
|
||||
$1_ALL_CLEANS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_CLEAN_PATTERN) \) -a -type f))
|
||||
# Copy and clean must also respect filters.
|
||||
ifneq (,$$($1_INCLUDES))
|
||||
$1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS))
|
||||
endif
|
||||
ifneq (,$$($1_EXCLUDES))
|
||||
$1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS))
|
||||
endif
|
||||
ifneq (,$$($1_EXCLUDE_FILES))
|
||||
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS))
|
||||
endif
|
||||
ifneq (,$$($1_ALL_CLEANS))
|
||||
# Yep, there are files to be copied and cleaned!
|
||||
$1_ALL_COPY_CLEAN_TARGETS:=
|
||||
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i)))
|
||||
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files!
|
||||
endif
|
||||
endif
|
||||
|
||||
# Find all the directories that contain java sources, each directory
|
||||
# corresponds to a package because we expect the source
|
||||
# code to be organized in this standardized way!
|
||||
$1_SDIRS := $$(sort $$(dir $$($1_SRCS)))
|
||||
# Now prefix each package with the bin root.
|
||||
$1_BDIRS := $$(foreach i,$$($1_PKGS),$$(addprefix $$($1_BIN),$$i))
|
||||
# Now create a list of the packages that are about to compile. This list is
|
||||
# later used to filter out dependencies that point outside of this set.
|
||||
$$(shell $(RM) $$($1_BIN)/_the.list_of_packages)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_BDIRS,\n, >> $$($1_BIN)/_the.list_of_packages))
|
||||
|
||||
ifeq ($$($1_MODE),SINGLE_THREADED_BATCH)
|
||||
# Ok, we will feed all the found java files into a single javac invocation.
|
||||
# There can be no dependency checking, nor incremental builds. It is
|
||||
# the best we can do with the old javac. If the javac supports a javac server
|
||||
# then we can use the javac server.
|
||||
|
||||
# We can depend on this target file to trigger a regeneration of all the sources
|
||||
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch
|
||||
|
||||
# Prep the source paths.
|
||||
ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),)
|
||||
$$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE)))
|
||||
else
|
||||
$$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC)))
|
||||
endif
|
||||
|
||||
# Create a sed expression to remove the source roots and to replace / with .
|
||||
# and remove .java at the end.
|
||||
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
|
||||
|
||||
# Here is the batch rules that depends on all the sources.
|
||||
$$($1_BIN)/_the.batch: $$($1_SRCS)
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
|
||||
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
|
||||
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in batch $1
|
||||
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) @$$($1_BIN)/_the.batch.tmp && \
|
||||
$$(if $$($1_JAVAH),\
|
||||
$(CAT) $$($1_BIN)/_the.batch.tmp | $(XARGS) $(GREP) -E "[[:space:]]native[[:space:]]|@GenerateNativeHeader" |\
|
||||
$(GREP) -v '*' | $(GREP) -v '//' | $(CUT) -f 1 -d ':' | $(SORT) -u |\
|
||||
$(SED) $$($1_REWRITE_INTO_CLASSES) > $$($1_BIN)/_the.batch.natives && \
|
||||
if test -s $$($1_BIN)/_the.batch.natives; then \
|
||||
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_BIN)" -d $$($1_HEADERS) @$$($1_BIN)/_the.batch.natives ; \
|
||||
fi &&) \
|
||||
$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
|
||||
else
|
||||
# Ok, we have a modern javac server running!
|
||||
# Since a single Java file can generate zero to an infinity number of .class files
|
||||
# the exact number and names of the .class files will only be known after the compile.
|
||||
# Thus after the compile, a list of the generated classes will be stored in _the.package.d
|
||||
# which is included by the makefile during the next compile. These .d files will
|
||||
# add the generated class names to the BUILD_MYPACKAGE_CLASSES variable and used java file names
|
||||
# to the BUILD_MYPACKAGE_JAVAS variable.
|
||||
$1_CLASSES :=
|
||||
$1_JAVAS :=
|
||||
# Create a file in each package that represents the package dependency.
|
||||
# This file (_the.package) will also contain a list of the source files
|
||||
# to be compiled for this package.
|
||||
$1 := $$(sort $$(patsubst %,%_the.package,$$($1_BDIRS)))
|
||||
# Now call add_java_package for each package to create the dependencies.
|
||||
$$(foreach p,$$($1),$$(eval $$(call add_java_package,$1,$$p,$$($1_SRC),$$($1_BIN),$$($1_BIN)/_the.list_of_packages,NOTUSED,$$($1_USE_DEPS),$$($1_REMOTE),$$($1_JVM) $$($1_JAVAC),$$($1_FLAGS),$$($1_EXCLUDE_FILES_PATTERN) $(OVR_SRCS),$$($1_INCLUDE_FILES),$$($1_JVM) $$($1_JAVAH),$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))))
|
||||
# All dependencies are setup, now we only need to depend on $1 (aka $(BUILD_MYPACKAGE))
|
||||
# and they will automatically be built!
|
||||
|
||||
# Now add on any files to copy targets
|
||||
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1)
|
||||
# Remove the set of found classes from the set of all previously known classes
|
||||
# and the remainder is the set of missing classes.
|
||||
$1_MISSING_CLASSES:=$$(filter-out $$($1_BINS),$$($1_CLASSES))
|
||||
$1_PKGS_MISSING_CLASSES:=$$(sort $$(dir $$($1_MISSING_CLASSES)))
|
||||
# Remove the set of found java files from the set of all previously known java files
|
||||
# the remainder is Java files that have gone missing.
|
||||
$1_MISSING_JAVAS:=$$(filter-out $$($1_SRCS),$$($1_JAVAS))
|
||||
$1_PKGS_MISSING_JAVAS:=$$(sort $$(dir $$($1_MISSING_JAVAS)))
|
||||
# Remove each source root from the found paths.
|
||||
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$1_PKGS_MISSING_JAVAS)))
|
||||
# Finally remove duplicates and prefix with the binary path instead.
|
||||
$1_PKGS_MISSING_JAVAS:= $$(addprefix $$($1_BIN),$$(sort $$($1_PKGS_MISSING_JAVAS)))
|
||||
|
||||
# Remove the set of all theoretical classes from the set of found classes.
|
||||
# the remainder is the set of superfluous classes.
|
||||
$1_SUPERFLUOUS_CLASSES:=$$(sort $$(filter-out $$($1_CLASSES),$$($1_BINS)))
|
||||
$1_PKGS_SUPERFLUOUS_CLASSES:=$$(sort $$(dir $$($1_SUPERFLUOUS_CLASSES)))
|
||||
|
||||
# Now delete the _the.package files inside the problematic dirs.
|
||||
# This will force a rebuild of these packages!
|
||||
$1_FOO:=$$(sort $$($1_PKGS_MISSING_CLASSES) \
|
||||
$$($1_PKGS_SUPERFLUOUS_CLASSES) \
|
||||
$$($1_PKGS_MISSING_JAVAS))
|
||||
# ifneq (,$$($1_FOO))
|
||||
# $$(info MESSED UP PACKAGES $$($1_FOO))
|
||||
# endif
|
||||
|
||||
$$(shell $(RM) $$(addsuffix _the.package,$$(sort $$($1_PKGS_MISSING_CLASSES) \
|
||||
$$($1_PKGS_SUPERFLUOUS_CLASSES) \
|
||||
$$($1_PKGS_MISSING_JAVAS))))
|
||||
|
||||
# Normal makefile dependencies based on timestamps will detect the normal use case
|
||||
# when Java files are simply added or modified.
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_JAR))
|
||||
|
||||
ifeq (,$$($1_SUFFIXES))
|
||||
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
|
||||
endif
|
||||
|
||||
# A jar file was specified. Set it up.
|
||||
$$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1),\
|
||||
SRCS:=$$($1_BIN),\
|
||||
SUFFIXES:=$$($1_SUFFIXES),\
|
||||
EXCLUDE:=$$($1_EXCLUDES),\
|
||||
INCLUDES:=$$($1_INCLUDES),\
|
||||
EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS),\
|
||||
JAR:=$$($1_JAR),\
|
||||
JARMAIN:=$$($1_JARMAIN),\
|
||||
MANIFEST:=$$($1_MANIFEST),\
|
||||
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\
|
||||
HEADERS:=$$($1_HEADERS),\
|
||||
SETUP:=$$($1_SETUP)))
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_SRCZIP))
|
||||
# A srczip file was specified. Set it up.
|
||||
$$(eval $$(call SetupZipArchive,ARCHIVE_$1,\
|
||||
SRC:=$$($1_SRC),\
|
||||
ZIP:=$$($1_SRCZIP),\
|
||||
INCLUDES:=$$($1_INCLUDES),\
|
||||
EXCLUDES:=$$($1_EXCLUDES),\
|
||||
EXCLUDE_FILES:=$$($1_EXCLUDE_FILES)))
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
|
327
common/makefiles/MakeBase.gmk
Normal file
327
common/makefiles/MakeBase.gmk
Normal file
@ -0,0 +1,327 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################
|
||||
#
|
||||
# Check that GNU make and cygwin are recent enough.
|
||||
# Setup common utility functions.
|
||||
#
|
||||
################################################################
|
||||
|
||||
ifndef _MAKEBASE_GMK
|
||||
_MAKEBASE_GMK := 1
|
||||
|
||||
ifeq (,$(findstring 3.81,$(MAKE_VERSION)))
|
||||
ifeq (,$(findstring 3.82,$(MAKE_VERSION)))
|
||||
$(error This version of GNU Make is too low ($(MAKE_VERSION)). Please upgrade to 3.81 or newer.)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(CYGPATH))
|
||||
# Cygwin styff, if needed but most is going to be
|
||||
# done in configure!
|
||||
ifeq (yes,$(CHECK_FOR_VCINSTALLDIR))
|
||||
ifeq (,$(VCINSTALLDIR))
|
||||
$(info Could not find compiler paths!)
|
||||
$(info You probably configured the build from within a)
|
||||
$(info VS command prompt, but you are not using such a)
|
||||
$(info prompt right now.)
|
||||
$(info If you instead run configure from a plain cygwin shell, it)
|
||||
$(info will attempt to setup VS for you! Please try that.)
|
||||
$(error Giving up for now.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# The build times report is turned off by setting REPORT_BUILD_TIMES to nothing.
|
||||
# This is necessary for the target clean which will erase the
|
||||
# directories where the buildtimes are stored.
|
||||
REPORT_BUILD_TIMES=1
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(MKDIR) -p $(BUILDTIMESDIR)
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
|
||||
endef
|
||||
|
||||
# Indicate that we started to build a sub repository and record starting time.
|
||||
define MakeStart
|
||||
$(call RecordStartTime,$1)
|
||||
$(BUILD_LOG_WRAPPER) $(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \
|
||||
"########################################################################" \
|
||||
"########################################################################" \
|
||||
"Entering $1 for target(s) $2" \
|
||||
"########################################################################"
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
|
||||
$(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$1
|
||||
endef
|
||||
|
||||
# Indicate that we are done.
|
||||
# Record ending time and print out the total time it took to build.
|
||||
define MakeFinish
|
||||
$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),)
|
||||
$(BUILD_LOG_WRAPPER) $(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \
|
||||
"########################################################################" \
|
||||
"Leaving $1 for target(s) $2" \
|
||||
"########################################################################" \
|
||||
$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
|
||||
"########################################################################"
|
||||
endef
|
||||
|
||||
# Find all build_time_* files and print their contents in a list sorted
|
||||
# on the name of the sub repository.
|
||||
define ReportBuildTimes
|
||||
$(BUILD_LOG_WRAPPER) $(PRINTF) -- "-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
|
||||
"$1" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
|
||||
"`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
|
||||
endef
|
||||
|
||||
define ResetTimers
|
||||
$$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*)
|
||||
endef
|
||||
|
||||
define StartTimer
|
||||
$(call RecordStartTime,TOTAL)
|
||||
endef
|
||||
|
||||
define StopTimer
|
||||
$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
|
||||
endef
|
||||
|
||||
# If the variable that you want to send to stdout for piping into a file or otherwise,
|
||||
# is potentially long, for example the a list of file paths, eg a list of all package directories.
|
||||
# Then you need to use ListPathsSafely, which optimistically splits the output into several shell
|
||||
# calls as well as use compression on recurrent file paths segments, to get around the potential
|
||||
# command line length problem that exists in cygwin and other shells.
|
||||
compress_pre:=$(strip $(shell cat $(SRC_ROOT)/common/makefiles/compress.pre))
|
||||
compress_post:=$(strip $(shell cat $(SRC_ROOT)/common/makefiles/compress.post))
|
||||
compress_paths=$(compress_pre)\
|
||||
$(subst $(SRC_ROOT),X97,\
|
||||
$(subst $(OUTPUT_ROOT),X98,\
|
||||
$(subst X,X00,\
|
||||
$(subst $(SPACE),\n,$(strip $1)))))\
|
||||
$(compress_post)
|
||||
|
||||
decompress_paths=sed -f $(SRC_ROOT)/common/makefiles/uncompress.sed -e 's|X99|\\n|g' \
|
||||
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
|
||||
-e 's|X00|X|g' | tr '\n' '$2'
|
||||
|
||||
define ListPathsSafely_If
|
||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
|
||||
endef
|
||||
|
||||
define ListPathsSafely_Printf
|
||||
$(if $(strip $($1_LPS$4)),printf -- "$(strip $($1_LPS$4))\n" | $(decompress_paths) $3)
|
||||
endef
|
||||
|
||||
# Receipt example:
|
||||
# rm -f thepaths
|
||||
# $(call ListPathsSafely,THEPATHS,\n, >> thepaths)
|
||||
# The \n argument means translate spaces into \n
|
||||
# if instead , , (a space) is supplied, then spaces remain spaces.
|
||||
define ListPathsSafely
|
||||
$(if $(word 10001,$($1)),$(error Cannot list safely more than 10000 paths. $1 has $(words $($1)) paths!))
|
||||
$(call ListPathsSafely_If,$1,$2,1,250)
|
||||
$(call ListPathsSafely_If,$1,$2,251,500)
|
||||
$(call ListPathsSafely_If,$1,$2,501,750)
|
||||
$(call ListPathsSafely_If,$1,$2,751,1000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,1001,1250)
|
||||
$(call ListPathsSafely_If,$1,$2,1251,1500)
|
||||
$(call ListPathsSafely_If,$1,$2,1501,1750)
|
||||
$(call ListPathsSafely_If,$1,$2,1751,2000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,2001,2250)
|
||||
$(call ListPathsSafely_If,$1,$2,2251,2500)
|
||||
$(call ListPathsSafely_If,$1,$2,2501,2750)
|
||||
$(call ListPathsSafely_If,$1,$2,2751,3000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,3001,3250)
|
||||
$(call ListPathsSafely_If,$1,$2,3251,3500)
|
||||
$(call ListPathsSafely_If,$1,$2,3501,3750)
|
||||
$(call ListPathsSafely_If,$1,$2,3751,4000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,4001,4250)
|
||||
$(call ListPathsSafely_If,$1,$2,4251,4500)
|
||||
$(call ListPathsSafely_If,$1,$2,4501,4750)
|
||||
$(call ListPathsSafely_If,$1,$2,4751,5000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,5001,5250)
|
||||
$(call ListPathsSafely_If,$1,$2,5251,5500)
|
||||
$(call ListPathsSafely_If,$1,$2,5501,5750)
|
||||
$(call ListPathsSafely_If,$1,$2,5751,6000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,6001,6250)
|
||||
$(call ListPathsSafely_If,$1,$2,6251,6500)
|
||||
$(call ListPathsSafely_If,$1,$2,6501,6750)
|
||||
$(call ListPathsSafely_If,$1,$2,6751,7000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,7001,7250)
|
||||
$(call ListPathsSafely_If,$1,$2,7251,7500)
|
||||
$(call ListPathsSafely_If,$1,$2,7501,7750)
|
||||
$(call ListPathsSafely_If,$1,$2,7751,8000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,8001,8250)
|
||||
$(call ListPathsSafely_If,$1,$2,8251,8500)
|
||||
$(call ListPathsSafely_If,$1,$2,8501,8750)
|
||||
$(call ListPathsSafely_If,$1,$2,8751,9000)
|
||||
|
||||
$(call ListPathsSafely_If,$1,$2,9001,9250)
|
||||
$(call ListPathsSafely_If,$1,$2,9251,9500)
|
||||
$(call ListPathsSafely_If,$1,$2,9501,9750)
|
||||
$(call ListPathsSafely_If,$1,$2,9751,10000)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,1)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,1001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,1251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,1501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,1751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,2001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,2251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,2501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,2751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,3001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,3251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,3501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,3751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,4001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,4251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,4501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,4751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,5001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,5251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,5501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,5751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,6001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,6251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,6501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,6751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,7001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,7251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,7501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,7751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,8001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,8251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,8501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,8751)
|
||||
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,9001)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,9251)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,9501)
|
||||
$(call ListPathsSafely_Printf,$1,$2,$3,9751)
|
||||
endef
|
||||
|
||||
define ListPathsSafelyNow_IfPrintf
|
||||
ifneq (,$$(word $4,$$($1)))
|
||||
$$(eval $1_LPS$4:=$$(call compress_paths,$$(wordlist $4,$5,$$($1))))
|
||||
$$(shell printf -- "$$(strip $$($1_LPS$4))\n" | $(decompress_paths) $3)
|
||||
endif
|
||||
endef
|
||||
|
||||
# And an non-receipt version:
|
||||
define ListPathsSafelyNow
|
||||
ifneq (,$$(word 10001,$$($1)))
|
||||
$$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!)
|
||||
endif
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1,250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,251,500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,501,750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,751,1000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1001,1250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1251,1500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1501,1750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1751,2000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2001,2250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2251,2500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2501,2750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2751,3000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3001,3250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3251,3500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3501,3750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3751,4000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4001,4250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4251,4500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4501,4750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4751,5000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5001,5250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5251,5500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5501,5750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5751,6000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6001,6250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6251,6500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6501,6750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6751,7000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7001,7250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7251,7500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7501,7750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7751,8000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8001,8250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8251,8500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8501,8750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8751,9000)
|
||||
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9001,9250)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9251,9500)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9501,9750)
|
||||
$(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9751,10000)
|
||||
|
||||
endef
|
||||
|
||||
endif # _MAKEBASE_GMK
|
176
common/makefiles/Makefile
Normal file
176
common/makefiles/Makefile
Normal file
@ -0,0 +1,176 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Default to sane output from make.
|
||||
# Override with empty string to get insane amount of output.
|
||||
# Override with -d to get even more insane amount of debugging output.
|
||||
# Override with "-d -p" to get it all.
|
||||
VERBOSE=-s
|
||||
|
||||
# Find all environment or command line variables that begin with ALT.
|
||||
list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
|
||||
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
|
||||
ifneq ($(list_alt_overrides),)
|
||||
$(info You have set the following ALT_ variables:)
|
||||
$(foreach var,$(list_alt_overrides), $(info $(var)=$($(var))))
|
||||
$(error Using ALT_ variables is deprecated! Please clean your environment!)
|
||||
endif
|
||||
|
||||
# The spec.gmk file contains the variables extracted by the configure script.
|
||||
# It is usually set with SPEC=....spec.gmk on the make command line.
|
||||
# However if you simply type make from the openjdk source root, it will go looking
|
||||
# for a spec file, if only one is found, use it. If more than one is found,
|
||||
# complain. If none is found, request the user to run configure!
|
||||
SPEC ?= $(wildcard $(CURDIR)/../../build/*/spec.gmk)
|
||||
|
||||
ifeq ($(words $(SPEC)),0)
|
||||
$(error You must run configure!)
|
||||
endif
|
||||
|
||||
ifneq ($(words $(SPEC)),1)
|
||||
ifeq ($(MAKECMDGOALS),all-conf)
|
||||
SPECS:=$(shell echo $(SPEC) | sed -e 's|$(CURDIR)/build/||g' -e 's|/spec.gmk|\\n|g' -e 's| ||g')
|
||||
allconf:
|
||||
@echo Building configurations:
|
||||
@printf "$(SPECS)"
|
||||
@$(foreach s,$(SPEC),($(MAKE) SPEC=$s $(VERBOSE) VERBOSE=$(VERBOSE) images) &&) true
|
||||
@echo Done building configurations:
|
||||
@printf "$(SPECS)"
|
||||
.PHONY: all-conf
|
||||
else
|
||||
$(error Since you have more than one output dir configured under build, \
|
||||
you have to either run make from the output dir of your choice \
|
||||
or specify run "make SPEC=build/.../spec.gmk" or run all the build configurations \
|
||||
using "make all-conf")
|
||||
endif
|
||||
else
|
||||
|
||||
# Now load the spec
|
||||
-include $(SPEC)
|
||||
|
||||
# Load the vital tools for all the makefiles.
|
||||
-include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
|
||||
|
||||
# Remove any build.log from a previous run
|
||||
ifneq (,$(BUILD_LOG))
|
||||
$(shell $(RM) $(BUILD_LOG))
|
||||
endif
|
||||
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
ifneq (,$(JAVAC_SERVERS))
|
||||
$(shell mkdir -p $(JAVAC_SERVERS) && rm -rf $(JAVAC_SERVERS)/*)
|
||||
endif
|
||||
# Reset the build timers.
|
||||
$(eval $(call ResetTimers))
|
||||
# Clean out any notifications from the previous build.
|
||||
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
|
||||
|
||||
all: jdk
|
||||
@$(call StopTimer)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
|
||||
langtools: start-timer
|
||||
@$(call MakeStart,langtools,all)
|
||||
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(LANGTOOLS_MAKE_ARGS))
|
||||
@$(call MakeFinish,langtools,all)
|
||||
|
||||
corba: langtools
|
||||
@$(call MakeStart,corba,all)
|
||||
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
|
||||
@$(call MakeFinish,corba,all)
|
||||
|
||||
jaxp: langtools
|
||||
@$(call MakeStart,jaxp,all)
|
||||
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxp,all)
|
||||
|
||||
jaxws: langtools jaxp
|
||||
@$(call MakeStart,jaxws,all)
|
||||
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxws,all)
|
||||
|
||||
hotspot: langtools
|
||||
@$(call MakeStart,hotspot,all)
|
||||
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS))
|
||||
@$(call MakeFinish,hotspot,all)
|
||||
|
||||
jdk: langtools corba jaxp jaxws hotspot
|
||||
@$(call MakeStart,jdk,all)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS))
|
||||
@$(call MakeFinish,jdk,all)
|
||||
|
||||
images install packages: start-timer jdk langtools corba jaxp jaxws hotspot
|
||||
@$(call MakeStart,jdk-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS) $@)
|
||||
@$(call MakeFinish,jdk-images,$@)
|
||||
@$(call StopTimer)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
|
||||
start-timer:
|
||||
@$(call StartTimer)
|
||||
|
||||
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-timer
|
||||
|
||||
# Remove everything, except the output from configure.
|
||||
clean:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | grep -v "localdevenv.*" | grep -v uncygdrive.exe`)
|
||||
@$(ECHO) Cleaned everything except the build configuration.
|
||||
.PHONY: clean
|
||||
|
||||
# Remove everything, you have to rerun configure.
|
||||
dist-clean:
|
||||
@$(RM) -r $(OUTPUT_ROOT)
|
||||
@$(ECHO) Cleaned everything, you will have to re-run configure.
|
||||
.PHONY: dist-clean
|
||||
|
||||
clean-jdk:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \
|
||||
grep -v langtools | grep -v corba | grep -v jaxp | grep -v jaxws | grep -v hotspot`)
|
||||
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)"
|
||||
.PHONY: clean
|
||||
|
||||
help:
|
||||
$(info )
|
||||
$(info Typical make commands:)
|
||||
$(info make)
|
||||
$(info make VERBOSE= # print all commands)
|
||||
$(info make VERBOSE="-d -p" # debug make as well)
|
||||
$(info make all-conf # build images for all configurations)
|
||||
$(info make clean # remove build artifacts)
|
||||
$(info make dist-clean # you have to rerun configure)
|
||||
# $(info make test # run tests)
|
||||
$(info make images # create the jdk and jre images)
|
||||
$(info make install # install the jdk image)
|
||||
# $(info make modules # EXPERIMENTAL: Migrate JDK into a modularized form!)
|
||||
$(info make packages # create zips and other packages)
|
||||
|
||||
# $(info make eclipse_workspace # Create an Eclipse workspace)
|
||||
# $(info make netbeans_workspace # Create a NetBeans workspace)
|
||||
# $(info make vs_workspace # Create a Visual Studio workspace)
|
||||
|
||||
.PHONY: help
|
||||
|
||||
endif
|
277
common/makefiles/NativeCompilation.gmk
Normal file
277
common/makefiles/NativeCompilation.gmk
Normal file
@ -0,0 +1,277 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# When you read this source. Remember that $(sort ...) has the side effect
|
||||
# of removing duplicates. It is actually this side effect that is
|
||||
# desired whenever sort is used below!
|
||||
|
||||
ifeq (,$(_MAKEBASE_GMK))
|
||||
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER_TYPE),CC)
|
||||
COMPILING_MSG=echo Compiling $1
|
||||
LINKING_MSG=echo Linking $1
|
||||
LINKING_EXE_MSG=echo Linking executable $1
|
||||
ARCHIVING_MSG=echo Archiving $1
|
||||
else
|
||||
COMPILING_MSG=
|
||||
LINKING_MSG=
|
||||
LINKING_EXE_MSG=
|
||||
ARCHIVING_MSG=
|
||||
endif
|
||||
|
||||
define add_native_source
|
||||
# param 1 = BUILD_MYPACKAGE
|
||||
# parma 2 = the source file name (..../alfa.c or .../beta.cpp)
|
||||
# param 3 = the bin dir that stores all .o (.obj) and .d files.
|
||||
# param 4 = the c flags to the compiler
|
||||
# param 5 = the c compiler
|
||||
# param 6 = the c++ flags to the compiler
|
||||
# param 7 = the c++ compiler
|
||||
|
||||
ifneq (,$$(filter %.c,$2))
|
||||
# Compile as a C file
|
||||
$1_$2_FLAGS=$4
|
||||
$1_$2_COMP=$5
|
||||
else
|
||||
# Compile as a C++ file
|
||||
$1_$2_FLAGS=$6
|
||||
$1_$2_COMP=$7
|
||||
endif
|
||||
# Generate the .o (.obj) file name and place it in the bin dir.
|
||||
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(notdir $2)))
|
||||
# Only continue if this object file hasn't been processed already. This lets the first found
|
||||
# source file override any other with the same name.
|
||||
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
|
||||
$1_OBJS_SO_FAR+=$$($1_$2_OBJ)
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_$2_DEP)
|
||||
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
|
||||
-Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
|
||||
endif
|
||||
|
||||
$$($1_$2_OBJ) : $2
|
||||
ifeq ($(COMPILER_TYPE),CC)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) -MMD -MF $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
endif
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
define SetupNativeCompilation
|
||||
# param 1 is for example BUILD_MYPACKAGE
|
||||
# param 2,3,4,5,6,7,8 are named args.
|
||||
# SRC one or more directory roots to scan for C/C++ files.
|
||||
# LANG C or C++
|
||||
# CFLAGS the compiler flags to be used, used both for C and C++.
|
||||
# CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
|
||||
# LDFLAGS the linker flags to be used, used both for C and C++.
|
||||
# LDFLAGS_SUFFIX the linker flags to be added last on the commandline
|
||||
# typically the libraries linked to.
|
||||
# ARFLAGS the archiver flags to be used
|
||||
# BIN the directory where we store the object files
|
||||
# LIB the resulting library file
|
||||
# EXE the resulting exec file
|
||||
# INCLUDES only pick source from these directories
|
||||
# EXCLUDES do not pick source from these directories
|
||||
# INCLUDE_FILES only compile exactly these files!
|
||||
# EXCLUDE_FILES with these names
|
||||
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
|
||||
# RC_FLAGS flags for RC.
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$1_$(strip $(10)))
|
||||
$(if $(11),$1_$(strip $(11)))
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$1_$(strip $(15)))
|
||||
$(if $(16),$1_$(strip $(16)))
|
||||
$(if $(17),$1_$(strip $(17)))
|
||||
$(if $(18),$1_$(strip $(18)))
|
||||
$(if $(19),$1_$(strip $(19)))
|
||||
$(if $(20),$1_$(strip $(20)))
|
||||
|
||||
ifeq (,$$($1_LANG))
|
||||
$$(error You have to specify LANG for native compilation $1)
|
||||
endif
|
||||
ifeq (C,$$($1_LANG))
|
||||
$1_LD:=$(LD)
|
||||
$1_LDEXE:=$(LDEXE)
|
||||
else
|
||||
ifeq (C++,$$($1_LANG))
|
||||
$1_LD:=$(LDCXX)
|
||||
$1_LDEXE:=$(LDEXECXX)
|
||||
else
|
||||
$$(error Unknown native language $$($1_LANG) for $1)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Make sure the dirs exist.
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN) $$(dir $$($1_LIB)) $$(dir $$($1_EXE)))
|
||||
# Find all files in the source trees. Sort to remove duplicates.
|
||||
$1_ALL_SRCS := $$(sort $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f)))
|
||||
# Extract the C/C++ files.
|
||||
$1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
|
||||
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
|
||||
ifneq ($$($1_EXCLUDE_FILES),)
|
||||
$1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
|
||||
endif
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp,$$($1_ALL_SRCS)))
|
||||
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
|
||||
endif
|
||||
ifeq (,$$($1_SRCS))
|
||||
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
|
||||
endif
|
||||
# There can be only a single bin dir root, no need to foreach over the roots.
|
||||
$1_BINS := $$(wildcard $$($1_BIN)/*$(OBJ_SUFFIX))
|
||||
# Now we have a list of all c/c++ files to compile: $$($1_SRCS)
|
||||
# and we have a list of all existing object files: $$($1_BINS)
|
||||
|
||||
# Prepend the source/bin path to the filter expressions. Then do the filtering.
|
||||
ifneq ($$($1_INCLUDES),)
|
||||
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
|
||||
$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
|
||||
endif
|
||||
ifneq ($$($1_EXCLUDES),)
|
||||
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
|
||||
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
|
||||
endif
|
||||
|
||||
# Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
|
||||
# a reproducable order on the input files to the linker).
|
||||
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))
|
||||
$1 := $$($1_EXPECTED_OBJS)
|
||||
# Are there too many object files on disk? Perhaps because some source file was removed?
|
||||
$1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
|
||||
# Clean out the superfluous object files.
|
||||
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(HOST_OS_API)) $$($1_CFLAGS_$(PLATFORM))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CFLAGS
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_debug)
|
||||
else
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_release)
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(HOST_OS_API)) $$($1_CXXFLAGS_$(PLATFORM))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CXXFLAGS
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_debug)
|
||||
else
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_release)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CXXFLAGS),)
|
||||
$1_CXXFLAGS:=$$($1_CFLAGS)
|
||||
endif
|
||||
ifeq ($$(strip $$($1_EXTRA_CXXFLAGS)),)
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
|
||||
endif
|
||||
|
||||
# Now create a list of the packages that are about to compile. Used when sending source
|
||||
# in a batch to the compiler.
|
||||
$$(shell $(RM) $$($1_BIN)/_the.list_of_sources)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_BIN)/_the.list_of_sources))
|
||||
|
||||
# Now call add_native_source for each source file we are going to compile.
|
||||
$$(foreach p,$$($1_SRCS),\
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_BIN),\
|
||||
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$(CC),\
|
||||
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX))))
|
||||
|
||||
# On windows we need to create a resource file
|
||||
ifeq ($(HOST_OS_API), winapi)
|
||||
ifneq (,$$($1_VERSIONINFO_RESOURCE))
|
||||
ifneq (,$$($1_LIB))
|
||||
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
|
||||
$1_RES:=$$(patsubst %$(SHARED_LIBRARY_SUFFIX),%.res,$$($1_LIB))
|
||||
else
|
||||
$1_RES:=$$(patsubst %$(STATIC_LIBRARY_SUFFIX),%.res,$$($1_LIB))
|
||||
endif
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
$1_RES:=$$(patsubst %$(EXE_SUFFIX),%.res,$$($1_EXE))
|
||||
endif
|
||||
$$($1_RES): $$($1_VERSIONINFO_RESOURCE)
|
||||
$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API dependent variables (posix or winapi) and
|
||||
# (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX
|
||||
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(HOST_OS_API)) $$($1_LDFLAGS_$(PLATFORM))
|
||||
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(HOST_OS_API)) $$($1_LDFLAGS_SUFFIX_$(PLATFORM))
|
||||
ifneq (,$$($1_LIB))
|
||||
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$(notdir $$($1_LIB)))
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call LINKING_MSG,$$(notdir $$($1_LIB)))
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$($1_LIB) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
else
|
||||
# Generating a static library, ie object file archive.
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call ARCHIVING_MSG,$$(notdir $$($1_LIB)))
|
||||
$(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_LIB) $$($1_EXPECTED_OBJS) \
|
||||
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
# A executable binary has been specified, setup the target for it.
|
||||
$$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call LINKING_EXE_MSG,$$(notdir $$($1_EXE)))
|
||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_EXE) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
endef
|
103
common/makefiles/RMICompile.gmk
Normal file
103
common/makefiles/RMICompile.gmk
Normal file
@ -0,0 +1,103 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
define SetupRMICompilation
|
||||
# param 1 is a name for a variable to depend on.
|
||||
# param 2 and up are named args.
|
||||
# CLASSES:=List of classes to generate stubs for
|
||||
# CLASSES_DIR:=Directory where to look for classes
|
||||
# STUB_CLASSES_DIR:=Directory in where to put stub classes
|
||||
# RUN_V11:=Set to run rmic with -v1.1
|
||||
# RUN_V12:=Set to run rmic with -v1.2
|
||||
# RUN_IIOP:=Set to run rmic with -iiop
|
||||
# RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
|
||||
# KEEP_GENERATED:=Set to keep generated sources around
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
|
||||
|
||||
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic
|
||||
|
||||
$1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES))
|
||||
$1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH)))
|
||||
$1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS := $$($1_STUB_FILES)
|
||||
$1_ARGS :=
|
||||
ifneq (,$$($1_RUN_V11))
|
||||
$1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS += $$($1_SKEL_FILES)
|
||||
$1_ARGS += -v1.1
|
||||
endif
|
||||
ifneq (,$$($1_RUN_V12))
|
||||
$1_ARGS += -v1.2
|
||||
endif
|
||||
|
||||
$1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f))
|
||||
$1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
$1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
|
||||
ifneq (,$$($1_RUN_IIOP))
|
||||
$1_TARGETS += $$($1_TIE_FILES)
|
||||
$1_ARGS += -iiop
|
||||
endif
|
||||
ifneq (,$$($1_RUN_IIOP_STDPKG))
|
||||
$1_TARGETS += $$($1_TIE_STDPKG_FILES)
|
||||
$1_ARGS2 := -iiop -standardPackage
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_KEEP_GENERATED))
|
||||
$1_ARGS += -keepgenerated
|
||||
$1_TARGETS += $$(subst .class,.java,$$($1_TARGETS))
|
||||
endif
|
||||
|
||||
$1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES))
|
||||
|
||||
$$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES)
|
||||
|
||||
$$($1_DEP_FILE): $$($1_CLASS_FILES)
|
||||
$(MKDIR) -p $$($1_STUB_CLASSES_DIR)
|
||||
if [ "x$$($1_ARGS)" != "x" ]; then \
|
||||
$(ECHO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) &&\
|
||||
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
|
||||
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\
|
||||
fi;
|
||||
if [ "x$$($1_ARGS2)" != "x" ]; then \
|
||||
$(ECHO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) &&\
|
||||
$(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \
|
||||
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\
|
||||
fi;
|
||||
|
||||
|
||||
$1 := $$($1_TARGETS)
|
||||
|
||||
# By marking as secondary, this "touch" file doesn't need to be touched and will never exist.
|
||||
.SECONDARY: $$($1_DEP_FILE)
|
||||
endef
|
1
common/makefiles/compress.post
Normal file
1
common/makefiles/compress.post
Normal file
@ -0,0 +1 @@
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
1
common/makefiles/compress.pre
Normal file
1
common/makefiles/compress.pre
Normal file
@ -0,0 +1 @@
|
||||
$(subst com,X01,$(subst org,X02,$(subst sun,X03,$(subst java,X04,$(subst javax,X05,$(subst sun/io,X06,$(subst com/sun,X07,$(subst java/io,X08,$(subst org/omg,X09,$(subst org/w3c,X10,$(subst org/xml,X11,$(subst sun/awt,X12,$(subst sun/net,X13,$(subst sun/nio,X14,$(subst sun/rmi,X15,$(subst java/awt,X16,$(subst java/net,X17,$(subst java/nio,X18,$(subst java/rmi,X19,$(subst META-INF,X20,$(subst sun/font,X21,$(subst sun/misc,X22,$(subst sun/text,X23,$(subst sun/util,X24,$(subst java/lang,X25,$(subst java/math,X26,$(subst java/text,X27,$(subst java/util,X28,$(subst javax/jws,X29,$(subst javax/net,X30,$(subst javax/rmi,X31,$(subst javax/xml,X32,$(subst sun/corba,X33,$(subst sun/print,X34,$(subst sun/swing,X35,$(subst java/beans,X36,$(subst javax/lang,X37,$(subst sun/applet,X38,$(subst sun/java2d,X39,$(subst java/applet,X40,$(subst javax/print,X41,$(subst javax/sound,X42,$(subst javax/swing,X43,$(subst javax/tools,X44,$(subst jdk/classes,X45,$(subst org/relaxng,X46,$(subst sun/reflect,X47,$(subst javax/crypto,X48,$(subst javax/naming,X49,$(subst jaxp/classes,X50,$(subst sun/security,X51,$(subst corba/classes,X52,$(subst java/security,X53,$(subst javax/imageio,X54,$(subst jdk/btclasses,X55,$(subst javax/activity,X56,$(subst javax/security,X57,$(subst jdk/newclasses,X58,$(subst sun/instrument,X59,$(subst sun/management,X60,$(subst corba/btclasses,X61,$(subst jdk/democlasses,X62,$(subst javax/activation,X63,$(subst javax/annotation,X64,$(subst javax/management,X65,$(subst javax/transaction,X66,$(subst jaxws/jaf_classes,X67,$(subst langtools/classes,X68,$(subst META-INF/services,X69,$(subst jdk/newdemoclasses,X70,$(subst javax/accessibility,X71,$(subst jaxws/jaxws_classes,X72,
|
72
common/makefiles/uncompress.sed
Normal file
72
common/makefiles/uncompress.sed
Normal file
@ -0,0 +1,72 @@
|
||||
s|X01|com|g
|
||||
s|X02|org|g
|
||||
s|X03|sun|g
|
||||
s|X04|java|g
|
||||
s|X05|javax|g
|
||||
s|X06|sun/io|g
|
||||
s|X07|com/sun|g
|
||||
s|X08|java/io|g
|
||||
s|X09|org/omg|g
|
||||
s|X10|org/w3c|g
|
||||
s|X11|org/xml|g
|
||||
s|X12|sun/awt|g
|
||||
s|X13|sun/net|g
|
||||
s|X14|sun/nio|g
|
||||
s|X15|sun/rmi|g
|
||||
s|X16|java/awt|g
|
||||
s|X17|java/net|g
|
||||
s|X18|java/nio|g
|
||||
s|X19|java/rmi|g
|
||||
s|X20|META-INF|g
|
||||
s|X21|sun/font|g
|
||||
s|X22|sun/misc|g
|
||||
s|X23|sun/text|g
|
||||
s|X24|sun/util|g
|
||||
s|X25|java/lang|g
|
||||
s|X26|java/math|g
|
||||
s|X27|java/text|g
|
||||
s|X28|java/util|g
|
||||
s|X29|javax/jws|g
|
||||
s|X30|javax/net|g
|
||||
s|X31|javax/rmi|g
|
||||
s|X32|javax/xml|g
|
||||
s|X33|sun/corba|g
|
||||
s|X34|sun/print|g
|
||||
s|X35|sun/swing|g
|
||||
s|X36|java/beans|g
|
||||
s|X37|javax/lang|g
|
||||
s|X38|sun/applet|g
|
||||
s|X39|sun/java2d|g
|
||||
s|X40|java/applet|g
|
||||
s|X41|javax/print|g
|
||||
s|X42|javax/sound|g
|
||||
s|X43|javax/swing|g
|
||||
s|X44|javax/tools|g
|
||||
s|X45|jdk/classes|g
|
||||
s|X46|org/relaxng|g
|
||||
s|X47|sun/reflect|g
|
||||
s|X48|javax/crypto|g
|
||||
s|X49|javax/naming|g
|
||||
s|X50|jaxp/classes|g
|
||||
s|X51|sun/security|g
|
||||
s|X52|corba/classes|g
|
||||
s|X53|java/security|g
|
||||
s|X54|javax/imageio|g
|
||||
s|X55|jdk/btclasses|g
|
||||
s|X56|javax/activity|g
|
||||
s|X57|javax/security|g
|
||||
s|X58|jdk/newclasses|g
|
||||
s|X59|sun/instrument|g
|
||||
s|X60|sun/management|g
|
||||
s|X61|corba/btclasses|g
|
||||
s|X62|jdk/democlasses|g
|
||||
s|X63|javax/activation|g
|
||||
s|X64|javax/annotation|g
|
||||
s|X65|javax/management|g
|
||||
s|X66|javax/transaction|g
|
||||
s|X67|jaxws/jaf_classes|g
|
||||
s|X68|langtools/classes|g
|
||||
s|X69|META-INF/services|g
|
||||
s|X70|jdk/newdemoclasses|g
|
||||
s|X71|javax/accessibility|g
|
||||
s|X72|jaxws/jaxws_classes|g
|
254
common/src/uncygdrive.c
Normal file
254
common/src/uncygdrive.c
Normal file
@ -0,0 +1,254 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include <Windows.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/*
|
||||
* Test if pos points to /cygdrive/_/ where _ can
|
||||
* be any character.
|
||||
*/
|
||||
int is_cygdrive_here(int pos, char *in, int len)
|
||||
{
|
||||
// Length of /cygdrive/c/ is 12
|
||||
if (pos+12 > len) return 0;
|
||||
if (in[pos+11]=='/' &&
|
||||
in[pos+9]=='/' &&
|
||||
in[pos+8]=='e' &&
|
||||
in[pos+7]=='v' &&
|
||||
in[pos+6]=='i' &&
|
||||
in[pos+5]=='r' &&
|
||||
in[pos+4]=='d' &&
|
||||
in[pos+3]=='g' &&
|
||||
in[pos+2]=='y' &&
|
||||
in[pos+1]=='c' &&
|
||||
in[pos+0]=='/') {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Replace /cygdrive/_/ with _:/
|
||||
* Works in place since drive letter is always
|
||||
* shorter than /cygdrive/
|
||||
*/
|
||||
char *replace_cygdrive(char *in)
|
||||
{
|
||||
int len = strlen(in);
|
||||
char *out = malloc(len+1);
|
||||
int i,j;
|
||||
|
||||
if (len < 12) {
|
||||
strcpy(out, in);
|
||||
return out;
|
||||
}
|
||||
for (i = 0, j = 0; i<len;) {
|
||||
if (is_cygdrive_here(i, in, len)) {
|
||||
out[j++] = in[i+10];
|
||||
out[j++] = ':';
|
||||
i+=11;
|
||||
} else {
|
||||
out[j] = in[i];
|
||||
i++;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
out[j] = 0;
|
||||
return out;
|
||||
}
|
||||
|
||||
void append(char **b, size_t *bl, size_t *u, char *add, size_t addlen)
|
||||
{
|
||||
while ( (addlen+*u+1) > *bl) {
|
||||
*bl *= 2;
|
||||
*b = realloc(*b, *bl);
|
||||
}
|
||||
memcpy(*b+*u, add, addlen);
|
||||
*u += addlen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new string from in where the first occurance of sub is
|
||||
* replaced by rep.
|
||||
*/
|
||||
char *replace_substring(char *in, char *sub, char *rep)
|
||||
{
|
||||
int in_len = strlen(in);
|
||||
int sub_len = strlen(sub);
|
||||
int rep_len = strlen(rep);
|
||||
char *out = malloc(in_len - sub_len + rep_len + 1);
|
||||
char *p;
|
||||
|
||||
if (!(p = strstr(in, sub))) {
|
||||
// If sub isn't a substring of in, just return in.
|
||||
return in;
|
||||
}
|
||||
|
||||
// Copy characters from beginning of in to start of sub.
|
||||
strncpy(out, in, p - in);
|
||||
out[p - in] = '\0';
|
||||
|
||||
sprintf(out + (p - in), "%s%s", rep, p + sub_len);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
char *files_to_delete[1024];
|
||||
int num_files_to_delete = 0;
|
||||
|
||||
char *fix_at_file(char *in)
|
||||
{
|
||||
char *tmpdir;
|
||||
char name[2048];
|
||||
char *atname;
|
||||
char *buffer;
|
||||
size_t buflen=65536;
|
||||
size_t used=0;
|
||||
size_t len;
|
||||
int rc;
|
||||
FILE *atout;
|
||||
FILE *atin;
|
||||
char block[2048];
|
||||
size_t blocklen;
|
||||
char *fixed;
|
||||
|
||||
atin = fopen(in+1, "r");
|
||||
if (atin == NULL) {
|
||||
fprintf(stderr, "Could not read at file %s\n", in+1);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
tmpdir = getenv("TMP");
|
||||
if (tmpdir == NULL) {
|
||||
tmpdir = "c:/cygwin/tmp";
|
||||
}
|
||||
_snprintf(name, sizeof(name), "%s\\atfile_XXXXXX", tmpdir);
|
||||
|
||||
rc = _mktemp_s(name, strlen(name)+1);
|
||||
if (rc) {
|
||||
fprintf(stderr, "Could not create temporary file name for at file!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
atout = fopen(name, "w");
|
||||
if (atout == NULL) {
|
||||
fprintf(stderr, "Could open temporary file for writing! %s\n", name);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
buffer = malloc(buflen);
|
||||
while((blocklen = fread(block,1,sizeof(block),atin)) > 0) {
|
||||
append(&buffer, &buflen, &used, block, blocklen);
|
||||
}
|
||||
buffer[used] = 0;
|
||||
fixed = replace_cygdrive(buffer);
|
||||
fwrite(fixed, strlen(fixed), 1, atout);
|
||||
fclose(atin);
|
||||
fclose(atout);
|
||||
free(fixed);
|
||||
free(buffer);
|
||||
files_to_delete[num_files_to_delete] = malloc(strlen(name)+1);
|
||||
strcpy(files_to_delete[num_files_to_delete], name);
|
||||
num_files_to_delete++;
|
||||
atname = malloc(strlen(name)+2);
|
||||
atname[0] = '@';
|
||||
strcpy(atname+1, name);
|
||||
return atname;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
unsigned short rc;
|
||||
|
||||
char *new_at_file;
|
||||
char *old_at_file;
|
||||
char *line;
|
||||
int i;
|
||||
DWORD exitCode;
|
||||
|
||||
if (argc<2) {
|
||||
fprintf(stderr, "Usage: uncygdrive.exe /cygdrive/c/WINDOWS/notepad.exe /cygdrive/c/x/test.txt");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
line = replace_cygdrive(strstr(GetCommandLine(), argv[1]));
|
||||
|
||||
for (i=1; i<argc; ++i) {
|
||||
if (argv[i][0] == '@') {
|
||||
// Found at-file! Fix it!
|
||||
old_at_file = replace_cygdrive(argv[i]);
|
||||
new_at_file = fix_at_file(old_at_file);
|
||||
line = replace_substring(line, old_at_file, new_at_file);
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv("DEBUG_UNCYGDRIVE") != NULL) {
|
||||
fprintf(stderr, "uncygdrive >%s<\n", line);
|
||||
}
|
||||
|
||||
ZeroMemory(&si,sizeof(si));
|
||||
si.cb=sizeof(si);
|
||||
ZeroMemory(&pi,sizeof(pi));
|
||||
|
||||
rc = CreateProcess(NULL,
|
||||
line,
|
||||
0,
|
||||
0,
|
||||
TRUE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
&si,
|
||||
&pi);
|
||||
if(!rc)
|
||||
{
|
||||
//Could not start process;
|
||||
fprintf(stderr, "Could not start process!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
WaitForSingleObject(pi.hProcess,INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess,&exitCode);
|
||||
|
||||
if (getenv("DEBUG_UNCYGDRIVE") != NULL) {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
fprintf(stderr, "Not deleting temporary uncygdrive file %s\n",
|
||||
files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
remove(files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
exit(exitCode);
|
||||
}
|
@ -154,3 +154,7 @@ e45d6b406d5f91ff5256a5c82456ab1e7eb8becd jdk8-b25
|
||||
4605f8418bf562e78be79b25b6b8a5110281acae jdk8-b30
|
||||
1954151dfae8f73db24e396380f7c02bdd47c486 jdk8-b31
|
||||
5d820cb6b1afd75b619e7fd69e4f2b0eb1d5d6a1 jdk8-b32
|
||||
1e2ac1ea3f6c32a62bf88f3fa330120c30db59cb jdk8-b33
|
||||
e24c5cc8b0f7cc48374eef0f995838fb4823e0eb jdk8-b34
|
||||
e3d735914edd0a621b16bb85417423f8e6af5d51 jdk8-b35
|
||||
a5a61f259961a7f46b002e5cc50b4a9bf86927b6 jdk8-b36
|
||||
|
257
corba/makefiles/Makefile
Normal file
257
corba/makefiles/Makefile
Normal file
File diff suppressed because one or more lines are too long
@ -236,3 +236,9 @@ f4767e53d6e0d5da7e3f1775904076cce54247c1 hs24-b04
|
||||
27863e4586de38be7dd17da4163f542038f4d1d7 hs24-b05
|
||||
25410a347ebb0bef166c4338a90d9dea82463a20 jdk8-b32
|
||||
cd47da9383cd932cb2b659064057feafa2a91134 hs24-b06
|
||||
785bcf415ead2eaa5f6677aaf528481008140bac jdk8-b33
|
||||
7c6aba65acd2c334f1c3512b574f9038cddac24b hs24-b07
|
||||
f284b08835584517c1ca3dd67341f569e763841f jdk8-b34
|
||||
f621660a297baa48fab9dca28e99d318826e8304 jdk8-b35
|
||||
dff6e3459210f8dd0430b9b03ccc99280560da30 hs24-b08
|
||||
50b4400ca1ecb2ac2fde35f5e53ec8f04b86be7f jdk8-b36
|
||||
|
@ -440,7 +440,7 @@ static bool sort_map_array(struct ps_prochandle* ph) {
|
||||
int j = 0;
|
||||
print_debug("---- sorted virtual address map ----\n");
|
||||
for (j = 0; j < ph->core->num_maps; j++) {
|
||||
print_debug("base = 0x%lx\tsize = %d\n", ph->core->map_array[j]->vaddr,
|
||||
print_debug("base = 0x%lx\tsize = %zd\n", ph->core->map_array[j]->vaddr,
|
||||
ph->core->map_array[j]->memsz);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,7 +42,7 @@ import sun.jvm.hotspot.types.TypeDataBase;
|
||||
public class HeapRegionSeq extends VMObject {
|
||||
// HeapRegion** _regions;
|
||||
static private AddressField regionsField;
|
||||
// size_t _length;
|
||||
// uint _length;
|
||||
static private CIntegerField lengthField;
|
||||
|
||||
static {
|
||||
|
@ -40,9 +40,9 @@ import sun.jvm.hotspot.types.TypeDataBase;
|
||||
// Mirror class for HeapRegionSetBase. Represents a group of regions.
|
||||
|
||||
public class HeapRegionSetBase extends VMObject {
|
||||
// size_t _length;
|
||||
// uint _length;
|
||||
static private CIntegerField lengthField;
|
||||
// size_t _region_num;
|
||||
// uint _region_num;
|
||||
static private CIntegerField regionNumField;
|
||||
// size_t _total_used_bytes;
|
||||
static private CIntegerField totalUsedBytesField;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -889,15 +889,9 @@ public class VirtualMachineImpl extends MirrorImpl implements PathSearchingVirtu
|
||||
Klass kls = ((ReferenceTypeImpl)type).ref();
|
||||
if (kls instanceof InstanceKlass) {
|
||||
InstanceKlass ik = (InstanceKlass) kls;
|
||||
if (ik.isInterface()) {
|
||||
if (ik.nofImplementors() == 0L) {
|
||||
return new ArrayList(0);
|
||||
}
|
||||
} else {
|
||||
// if the Klass is final or if there are no subklasses loaded yet
|
||||
if (ik.getAccessFlagsObj().isFinal() || ik.getSubklassKlass() == null) {
|
||||
includeSubtypes = false;
|
||||
}
|
||||
// if the Klass is final or if there are no subklasses loaded yet
|
||||
if (ik.getAccessFlagsObj().isFinal() || ik.getSubklassKlass() == null) {
|
||||
includeSubtypes = false;
|
||||
}
|
||||
} else {
|
||||
// no subtypes for primitive array types
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -52,7 +52,6 @@ public class InstanceKlass extends Klass {
|
||||
private static int HIGH_OFFSET;
|
||||
private static int GENERIC_SIGNATURE_INDEX_OFFSET;
|
||||
private static int FIELD_SLOTS;
|
||||
public static int IMPLEMENTORS_LIMIT;
|
||||
|
||||
// ClassState constants
|
||||
private static int CLASS_STATE_UNPARSABLE_BY_GC;
|
||||
@ -70,13 +69,6 @@ public class InstanceKlass extends Klass {
|
||||
methodOrdering = new OopField(type.getOopField("_method_ordering"), Oop.getHeaderSize());
|
||||
localInterfaces = new OopField(type.getOopField("_local_interfaces"), Oop.getHeaderSize());
|
||||
transitiveInterfaces = new OopField(type.getOopField("_transitive_interfaces"), Oop.getHeaderSize());
|
||||
nofImplementors = new CIntField(type.getCIntegerField("_nof_implementors"), Oop.getHeaderSize());
|
||||
IMPLEMENTORS_LIMIT = db.lookupIntConstant("instanceKlass::implementors_limit").intValue();
|
||||
implementors = new OopField[IMPLEMENTORS_LIMIT];
|
||||
for (int i = 0; i < IMPLEMENTORS_LIMIT; i++) {
|
||||
long arrayOffset = Oop.getHeaderSize() + (i * db.getAddressSize());
|
||||
implementors[i] = new OopField(type.getOopField("_implementors[0]"), arrayOffset);
|
||||
}
|
||||
fields = new OopField(type.getOopField("_fields"), Oop.getHeaderSize());
|
||||
javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), Oop.getHeaderSize());
|
||||
constants = new OopField(type.getOopField("_constants"), Oop.getHeaderSize());
|
||||
@ -136,8 +128,6 @@ public class InstanceKlass extends Klass {
|
||||
private static OopField methodOrdering;
|
||||
private static OopField localInterfaces;
|
||||
private static OopField transitiveInterfaces;
|
||||
private static CIntField nofImplementors;
|
||||
private static OopField[] implementors;
|
||||
private static OopField fields;
|
||||
private static CIntField javaFieldsCount;
|
||||
private static OopField constants;
|
||||
@ -317,9 +307,6 @@ public class InstanceKlass extends Klass {
|
||||
public TypeArray getMethodOrdering() { return (TypeArray) methodOrdering.getValue(this); }
|
||||
public ObjArray getLocalInterfaces() { return (ObjArray) localInterfaces.getValue(this); }
|
||||
public ObjArray getTransitiveInterfaces() { return (ObjArray) transitiveInterfaces.getValue(this); }
|
||||
public long nofImplementors() { return nofImplementors.getValue(this); }
|
||||
public Klass getImplementor() { return (Klass) implementors[0].getValue(this); }
|
||||
public Klass getImplementor(int i) { return (Klass) implementors[i].getValue(this); }
|
||||
public TypeArray getFields() { return (TypeArray) fields.getValue(this); }
|
||||
public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
|
||||
public int getAllFieldsCount() { return (int)getFields().getLength() / FIELD_SLOTS; }
|
||||
@ -527,9 +514,6 @@ public class InstanceKlass extends Klass {
|
||||
visitor.doOop(methodOrdering, true);
|
||||
visitor.doOop(localInterfaces, true);
|
||||
visitor.doOop(transitiveInterfaces, true);
|
||||
visitor.doCInt(nofImplementors, true);
|
||||
for (int i = 0; i < IMPLEMENTORS_LIMIT; i++)
|
||||
visitor.doOop(implementors[i], true);
|
||||
visitor.doOop(fields, true);
|
||||
visitor.doOop(constants, true);
|
||||
visitor.doOop(classLoader, true);
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -36,7 +36,7 @@ WB_JAVA_CLASSES = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
|
||||
$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
|
||||
|
||||
$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
|
||||
$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
$(REMOTE) $(COMPILE.JAVAC) -sourcepath $(WBSRCDIR) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
|
||||
$(WB_JAR): $(WB_JAVA_CLASSES)
|
||||
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
|
||||
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
|
||||
|
||||
HS_MAJOR_VER=24
|
||||
HS_MINOR_VER=0
|
||||
HS_BUILD_NUMBER=06
|
||||
HS_BUILD_NUMBER=08
|
||||
|
||||
JDK_MAJOR_VER=1
|
||||
JDK_MINOR_VER=8
|
||||
|
@ -36,7 +36,7 @@ WB_JAVA_CLASSES = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
|
||||
$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
|
||||
|
||||
$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
|
||||
$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
$(REMOTE) $(COMPILE.JAVAC) -sourcepath $(WBSRCDIR) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
|
||||
$(WB_JAR): $(WB_JAVA_CLASSES)
|
||||
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
|
||||
|
@ -36,7 +36,7 @@ WB_JAVA_CLASSES = $(patsubst $(WBSRCDIR)/%,$(WB_JAVA_CLASSDIR)/%, \
|
||||
$(patsubst %.java,%.class,$(WB_JAVA_SRCS)))
|
||||
|
||||
$(WB_JAVA_CLASSDIR)/%.class: $(WBSRCDIR)/%.java $(WB_JAVA_CLASSDIR)
|
||||
$(REMOTE) $(COMPILE.JAVAC) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
$(REMOTE) $(COMPILE.JAVAC) -sourcepath $(WBSRCDIR) -nowarn -d $(WB_JAVA_CLASSDIR) $<
|
||||
|
||||
$(WB_JAR): $(WB_JAVA_CLASSES)
|
||||
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(WB_JAVA_CLASSDIR)/ .
|
||||
|
@ -80,6 +80,8 @@ if [ -d "${ALTSRC}/share/vm/jfr" ]; then
|
||||
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
|
||||
fi
|
||||
|
||||
BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"
|
||||
|
||||
CORE_PATHS="${BASE_PATHS}"
|
||||
# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
|
||||
if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
|
||||
|
@ -51,6 +51,7 @@ ProjectCreatorIncludesPRIVATE=\
|
||||
-relativeInclude src\closed\cpu\$(Platform_arch)\vm \
|
||||
-relativeInclude src\share\vm \
|
||||
-relativeInclude src\share\vm\precompiled \
|
||||
-relativeInclude src\share\vm\prims\wbtestmethods \
|
||||
-relativeInclude src\share\vm\prims \
|
||||
-relativeInclude src\os\windows\vm \
|
||||
-relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
|
||||
|
@ -172,6 +172,7 @@ VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/asm
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/memory
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/oops
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/prims
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/prims/wbtestmethods
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/runtime
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/services
|
||||
VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/trace
|
||||
@ -269,6 +270,9 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
|
||||
{$(COMMONSRC)\share\vm\prims}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
{$(COMMONSRC)\share\vm\prims\wbtestmethods}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
{$(COMMONSRC)\share\vm\runtime}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
@ -349,6 +353,9 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi
|
||||
{$(ALTSRC)\share\vm\prims}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
{$(ALTSRC)\share\vm\prims\wbtestmethods}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
{$(ALTSRC)\share\vm\runtime}.cpp.obj::
|
||||
$(CXX) $(CXX_FLAGS) $(CXX_USE_PCH) /c $<
|
||||
|
||||
|
@ -40,7 +40,7 @@ wb_java_srcs: $(WorkSpace)\src\share\tools\whitebox\sun\hotspot\*.java $(WB_CLAS
|
||||
|
||||
|
||||
{$(WorkSpace)\src\share\tools\whitebox\sun\hotspot}.java.class::
|
||||
$(COMPILE_JAVAC) -d $(WB_CLASSES) $<
|
||||
$(COMPILE_JAVAC) -sourcepath $(WBSRCDIR) -d $(WB_CLASSES) $<
|
||||
|
||||
$(WB_JAR): wb_java_srcs
|
||||
$(RUN_JAR) cf $@ -C $(WB_CLASSES) .
|
||||
|
@ -528,10 +528,12 @@ address Assembler::locate_operand(address inst, WhichOperand which) {
|
||||
if (which == end_pc_operand) return ip + (is_64bit ? 8 : 4);
|
||||
// these asserts are somewhat nonsensical
|
||||
#ifndef _LP64
|
||||
assert(which == imm_operand || which == disp32_operand, "");
|
||||
assert(which == imm_operand || which == disp32_operand,
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
|
||||
#else
|
||||
assert((which == call32_operand || which == imm_operand) && is_64bit ||
|
||||
which == narrow_oop_operand && !is_64bit, "");
|
||||
which == narrow_oop_operand && !is_64bit,
|
||||
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
|
||||
#endif // _LP64
|
||||
return ip;
|
||||
|
||||
|
@ -2651,56 +2651,49 @@ void TemplateTable::jvmti_post_fast_field_mod() {
|
||||
// Check to see if a field modification watch has been set before we take
|
||||
// the time to call into the VM.
|
||||
Label L2;
|
||||
__ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
|
||||
__ testl(rcx,rcx);
|
||||
__ jcc(Assembler::zero, L2);
|
||||
__ pop_ptr(rbx); // copy the object pointer from tos
|
||||
__ verify_oop(rbx);
|
||||
__ push_ptr(rbx); // put the object pointer back on tos
|
||||
__ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object
|
||||
__ mov(rcx, rsp);
|
||||
__ push_ptr(rbx); // save object pointer so we can steal rbx,
|
||||
__ xorptr(rbx, rbx);
|
||||
const Address lo_value(rcx, rbx, Address::times_1, 0*wordSize);
|
||||
const Address hi_value(rcx, rbx, Address::times_1, 1*wordSize);
|
||||
switch (bytecode()) { // load values into the jvalue object
|
||||
case Bytecodes::_fast_bputfield: __ movb(lo_value, rax); break;
|
||||
case Bytecodes::_fast_sputfield: __ movw(lo_value, rax); break;
|
||||
case Bytecodes::_fast_cputfield: __ movw(lo_value, rax); break;
|
||||
case Bytecodes::_fast_iputfield: __ movl(lo_value, rax); break;
|
||||
case Bytecodes::_fast_lputfield:
|
||||
NOT_LP64(__ movptr(hi_value, rdx));
|
||||
__ movptr(lo_value, rax);
|
||||
break;
|
||||
__ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
|
||||
__ testl(rcx,rcx);
|
||||
__ jcc(Assembler::zero, L2);
|
||||
__ pop_ptr(rbx); // copy the object pointer from tos
|
||||
__ verify_oop(rbx);
|
||||
__ push_ptr(rbx); // put the object pointer back on tos
|
||||
|
||||
// need to call fld_s() after fstp_s() to restore the value for below
|
||||
case Bytecodes::_fast_fputfield: __ fstp_s(lo_value); __ fld_s(lo_value); break;
|
||||
// Save tos values before call_VM() clobbers them. Since we have
|
||||
// to do it for every data type, we use the saved values as the
|
||||
// jvalue object.
|
||||
switch (bytecode()) { // load values into the jvalue object
|
||||
case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
|
||||
case Bytecodes::_fast_bputfield: // fall through
|
||||
case Bytecodes::_fast_sputfield: // fall through
|
||||
case Bytecodes::_fast_cputfield: // fall through
|
||||
case Bytecodes::_fast_iputfield: __ push_i(rax); break;
|
||||
case Bytecodes::_fast_dputfield: __ push_d(); break;
|
||||
case Bytecodes::_fast_fputfield: __ push_f(); break;
|
||||
case Bytecodes::_fast_lputfield: __ push_l(rax); break;
|
||||
|
||||
// need to call fld_d() after fstp_d() to restore the value for below
|
||||
case Bytecodes::_fast_dputfield: __ fstp_d(lo_value); __ fld_d(lo_value); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
__ mov(rcx, rsp); // points to jvalue on the stack
|
||||
// access constant pool cache entry
|
||||
__ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
|
||||
__ verify_oop(rbx);
|
||||
// rbx,: object pointer copied above
|
||||
// rax,: cache entry pointer
|
||||
// rcx: jvalue object on the stack
|
||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
|
||||
|
||||
// since rcx is not an object we don't call store_check() here
|
||||
case Bytecodes::_fast_aputfield: __ movptr(lo_value, rax); break;
|
||||
|
||||
default: ShouldNotReachHere();
|
||||
}
|
||||
__ pop_ptr(rbx); // restore copy of object pointer
|
||||
|
||||
// Save rax, and sometimes rdx because call_VM() will clobber them,
|
||||
// then use them for JVM/DI purposes
|
||||
__ push(rax);
|
||||
if (bytecode() == Bytecodes::_fast_lputfield) __ push(rdx);
|
||||
// access constant pool cache entry
|
||||
__ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
|
||||
__ verify_oop(rbx);
|
||||
// rbx,: object pointer copied above
|
||||
// rax,: cache entry pointer
|
||||
// rcx: jvalue object on the stack
|
||||
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
|
||||
if (bytecode() == Bytecodes::_fast_lputfield) __ pop(rdx); // restore high value
|
||||
__ pop(rax); // restore lower value
|
||||
__ addptr(rsp, sizeof(jvalue)); // release jvalue object space
|
||||
__ bind(L2);
|
||||
switch (bytecode()) { // restore tos values
|
||||
case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
|
||||
case Bytecodes::_fast_bputfield: // fall through
|
||||
case Bytecodes::_fast_sputfield: // fall through
|
||||
case Bytecodes::_fast_cputfield: // fall through
|
||||
case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
|
||||
case Bytecodes::_fast_dputfield: __ pop_d(); break;
|
||||
case Bytecodes::_fast_fputfield: __ pop_f(); break;
|
||||
case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
|
||||
}
|
||||
__ bind(L2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2685,26 +2685,23 @@ void TemplateTable::jvmti_post_fast_field_mod() {
|
||||
__ pop_ptr(rbx); // copy the object pointer from tos
|
||||
__ verify_oop(rbx);
|
||||
__ push_ptr(rbx); // put the object pointer back on tos
|
||||
__ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object
|
||||
__ mov(c_rarg3, rsp);
|
||||
const Address field(c_rarg3, 0);
|
||||
|
||||
// Save tos values before call_VM() clobbers them. Since we have
|
||||
// to do it for every data type, we use the saved values as the
|
||||
// jvalue object.
|
||||
switch (bytecode()) { // load values into the jvalue object
|
||||
case Bytecodes::_fast_aputfield: __ movq(field, rax); break;
|
||||
case Bytecodes::_fast_lputfield: __ movq(field, rax); break;
|
||||
case Bytecodes::_fast_iputfield: __ movl(field, rax); break;
|
||||
case Bytecodes::_fast_bputfield: __ movb(field, rax); break;
|
||||
case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
|
||||
case Bytecodes::_fast_bputfield: // fall through
|
||||
case Bytecodes::_fast_sputfield: // fall through
|
||||
case Bytecodes::_fast_cputfield: __ movw(field, rax); break;
|
||||
case Bytecodes::_fast_fputfield: __ movflt(field, xmm0); break;
|
||||
case Bytecodes::_fast_dputfield: __ movdbl(field, xmm0); break;
|
||||
case Bytecodes::_fast_cputfield: // fall through
|
||||
case Bytecodes::_fast_iputfield: __ push_i(rax); break;
|
||||
case Bytecodes::_fast_dputfield: __ push_d(); break;
|
||||
case Bytecodes::_fast_fputfield: __ push_f(); break;
|
||||
case Bytecodes::_fast_lputfield: __ push_l(rax); break;
|
||||
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
// Save rax because call_VM() will clobber it, then use it for
|
||||
// JVMTI purposes
|
||||
__ push(rax);
|
||||
__ mov(c_rarg3, rsp); // points to jvalue on the stack
|
||||
// access constant pool cache entry
|
||||
__ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1);
|
||||
__ verify_oop(rbx);
|
||||
@ -2715,8 +2712,17 @@ void TemplateTable::jvmti_post_fast_field_mod() {
|
||||
CAST_FROM_FN_PTR(address,
|
||||
InterpreterRuntime::post_field_modification),
|
||||
rbx, c_rarg2, c_rarg3);
|
||||
__ pop(rax); // restore lower value
|
||||
__ addptr(rsp, sizeof(jvalue)); // release jvalue object space
|
||||
|
||||
switch (bytecode()) { // restore tos values
|
||||
case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
|
||||
case Bytecodes::_fast_bputfield: // fall through
|
||||
case Bytecodes::_fast_sputfield: // fall through
|
||||
case Bytecodes::_fast_cputfield: // fall through
|
||||
case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
|
||||
case Bytecodes::_fast_dputfield: __ pop_d(); break;
|
||||
case Bytecodes::_fast_fputfield: __ pop_f(); break;
|
||||
case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
|
||||
}
|
||||
__ bind(L2);
|
||||
}
|
||||
}
|
||||
|
@ -3369,15 +3369,6 @@ operand immP0()
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
operand immP_poll() %{
|
||||
predicate(n->get_ptr() != 0 && n->get_ptr() == (intptr_t)os::get_polling_page());
|
||||
match(ConP);
|
||||
|
||||
// formats are generated automatically for constants and base registers
|
||||
format %{ %}
|
||||
interface(CONST_INTER);
|
||||
%}
|
||||
|
||||
// Pointer Immediate
|
||||
operand immN() %{
|
||||
match(ConN);
|
||||
@ -5726,16 +5717,6 @@ instruct loadConP0(rRegP dst, immP0 src, rFlagsReg cr)
|
||||
ins_pipe(ialu_reg);
|
||||
%}
|
||||
|
||||
instruct loadConP_poll(rRegP dst, immP_poll src) %{
|
||||
match(Set dst src);
|
||||
format %{ "movq $dst, $src\t!ptr" %}
|
||||
ins_encode %{
|
||||
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
|
||||
__ lea($dst$$Register, polling_page);
|
||||
%}
|
||||
ins_pipe(ialu_reg_fat);
|
||||
%}
|
||||
|
||||
instruct loadConP31(rRegP dst, immP31 src, rFlagsReg cr)
|
||||
%{
|
||||
match(Set dst src);
|
||||
|
@ -72,15 +72,18 @@
|
||||
|
||||
#ifdef _ALLBSD_SOURCE
|
||||
#ifdef __APPLE__
|
||||
static size_t thread_id_size() { return sizeof(thread_t); }
|
||||
thread_t thread_id() const {
|
||||
return _thread_id;
|
||||
}
|
||||
#else
|
||||
static size_t thread_id_size() { return sizeof(pthread_t); }
|
||||
pthread_t thread_id() const {
|
||||
return _thread_id;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
static size_t thread_id_size() { return sizeof(pid_t); }
|
||||
pid_t thread_id() const {
|
||||
return _thread_id;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,6 +56,8 @@
|
||||
sigset_t caller_sigmask() const { return _caller_sigmask; }
|
||||
void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
|
||||
|
||||
static size_t thread_id_size() { return sizeof(pid_t); }
|
||||
|
||||
pid_t thread_id() const {
|
||||
return _thread_id;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@
|
||||
bool _vm_created_thread; // true if the VM created this thread,
|
||||
// false if primary thread or attached thread
|
||||
public:
|
||||
static size_t thread_id_size() { return sizeof(thread_t); }
|
||||
thread_t thread_id() const { return _thread_id; }
|
||||
uint lwp_id() const { return _lwp_id; }
|
||||
int native_priority() const { return _native_priority; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,6 +42,8 @@ typedef void* HANDLE;
|
||||
HANDLE interrupt_event() const { return _interrupt_event; }
|
||||
void set_interrupt_event(HANDLE interrupt_event) { _interrupt_event = interrupt_event; }
|
||||
|
||||
|
||||
static size_t thread_id_size() { return sizeof(unsigned long); }
|
||||
unsigned long thread_id() const { return _thread_id; }
|
||||
#ifndef PRODUCT
|
||||
// Used for debugging, return a unique integer for each thread.
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
package sun.hotspot;
|
||||
import java.security.BasicPermission;
|
||||
import sun.hotspot.parser.DiagnosticCommand;
|
||||
|
||||
public class WhiteBox {
|
||||
|
||||
@ -67,4 +68,5 @@ public class WhiteBox {
|
||||
public native boolean g1IsHumongous(Object o);
|
||||
public native long g1NumFreeRegions();
|
||||
public native int g1RegionSize();
|
||||
public native Object[] parseCommandLine(String commandline, DiagnosticCommand[] args);
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package sun.hotspot.parser;
|
||||
|
||||
public class DiagnosticCommand {
|
||||
|
||||
public enum DiagnosticArgumentType {
|
||||
JLONG, BOOLEAN, STRING, NANOTIME, STRINGARRAY, MEMORYSIZE
|
||||
}
|
||||
|
||||
private String name;
|
||||
private String desc;
|
||||
private DiagnosticArgumentType type;
|
||||
private boolean mandatory;
|
||||
private String defaultValue;
|
||||
|
||||
public DiagnosticCommand(String name, String desc, DiagnosticArgumentType type,
|
||||
boolean mandatory, String defaultValue) {
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
this.type = type;
|
||||
this.mandatory = mandatory;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public DiagnosticArgumentType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isMandatory() {
|
||||
return mandatory;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
@ -1694,7 +1694,9 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
|
||||
// they are roughly equivalent to Object.
|
||||
ciInstanceKlass* singleton = NULL;
|
||||
if (target->holder()->nof_implementors() == 1) {
|
||||
singleton = target->holder()->implementor(0);
|
||||
singleton = target->holder()->implementor();
|
||||
assert(singleton != NULL && singleton != target->holder(),
|
||||
"just checking");
|
||||
|
||||
assert(holder->is_interface(), "invokeinterface to non interface?");
|
||||
ciInstanceKlass* decl_interface = (ciInstanceKlass*)holder;
|
||||
@ -3130,10 +3132,23 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
|
||||
bool cantrap = true;
|
||||
vmIntrinsics::ID id = callee->intrinsic_id();
|
||||
switch (id) {
|
||||
case vmIntrinsics::_arraycopy :
|
||||
case vmIntrinsics::_arraycopy:
|
||||
if (!InlineArrayCopy) return false;
|
||||
break;
|
||||
|
||||
#ifdef TRACE_HAVE_INTRINSICS
|
||||
case vmIntrinsics::_classID:
|
||||
case vmIntrinsics::_threadID:
|
||||
preserves_state = true;
|
||||
cantrap = true;
|
||||
break;
|
||||
|
||||
case vmIntrinsics::_counterTime:
|
||||
preserves_state = true;
|
||||
cantrap = false;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case vmIntrinsics::_currentTimeMillis:
|
||||
case vmIntrinsics::_nanoTime:
|
||||
preserves_state = true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -2879,6 +2879,50 @@ void LIRGenerator::do_IfOp(IfOp* x) {
|
||||
__ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
|
||||
}
|
||||
|
||||
void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) {
|
||||
assert(x->number_of_arguments() == expected_arguments, "wrong type");
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime_leaf(routine, getThreadTemp(),
|
||||
reg, new LIR_OprList());
|
||||
LIR_Opr result = rlock_result(x);
|
||||
__ move(reg, result);
|
||||
}
|
||||
|
||||
#ifdef TRACE_HAVE_INTRINSICS
|
||||
void LIRGenerator::do_ThreadIDIntrinsic(Intrinsic* x) {
|
||||
LIR_Opr thread = getThreadPointer();
|
||||
LIR_Opr osthread = new_pointer_register();
|
||||
__ move(new LIR_Address(thread, in_bytes(JavaThread::osthread_offset()), osthread->type()), osthread);
|
||||
size_t thread_id_size = OSThread::thread_id_size();
|
||||
if (thread_id_size == (size_t) BytesPerLong) {
|
||||
LIR_Opr id = new_register(T_LONG);
|
||||
__ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_LONG), id);
|
||||
__ convert(Bytecodes::_l2i, id, rlock_result(x));
|
||||
} else if (thread_id_size == (size_t) BytesPerInt) {
|
||||
__ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_INT), rlock_result(x));
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
void LIRGenerator::do_ClassIDIntrinsic(Intrinsic* x) {
|
||||
CodeEmitInfo* info = state_for(x);
|
||||
CodeEmitInfo* info2 = new CodeEmitInfo(info); // Clone for the second null check
|
||||
assert(info != NULL, "must have info");
|
||||
LIRItem arg(x->argument_at(1), this);
|
||||
arg.load_item();
|
||||
LIR_Opr klass = new_register(T_OBJECT);
|
||||
__ move(new LIR_Address(arg.result(), java_lang_Class::klass_offset_in_bytes(), T_OBJECT), klass, info);
|
||||
LIR_Opr id = new_register(T_LONG);
|
||||
ByteSize offset = TRACE_ID_OFFSET;
|
||||
LIR_Address* trace_id_addr = new LIR_Address(klass, in_bytes(offset), T_LONG);
|
||||
__ move(trace_id_addr, id);
|
||||
__ logical_or(id, LIR_OprFact::longConst(0x01l), id);
|
||||
__ store(id, trace_id_addr);
|
||||
__ logical_and(id, LIR_OprFact::longConst(~0x3l), id);
|
||||
__ move(id, rlock_result(x));
|
||||
}
|
||||
#endif
|
||||
|
||||
void LIRGenerator::do_Intrinsic(Intrinsic* x) {
|
||||
switch (x->id()) {
|
||||
@ -2890,25 +2934,21 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
|
||||
break;
|
||||
}
|
||||
|
||||
case vmIntrinsics::_currentTimeMillis: {
|
||||
assert(x->number_of_arguments() == 0, "wrong type");
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, os::javaTimeMillis), getThreadTemp(),
|
||||
reg, new LIR_OprList());
|
||||
LIR_Opr result = rlock_result(x);
|
||||
__ move(reg, result);
|
||||
#ifdef TRACE_HAVE_INTRINSICS
|
||||
case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
|
||||
case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
|
||||
case vmIntrinsics::_counterTime:
|
||||
do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), 0, x);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case vmIntrinsics::_nanoTime: {
|
||||
assert(x->number_of_arguments() == 0, "wrong type");
|
||||
LIR_Opr reg = result_register_for(x->type());
|
||||
__ call_runtime_leaf(CAST_FROM_FN_PTR(address, os::javaTimeNanos), getThreadTemp(),
|
||||
reg, new LIR_OprList());
|
||||
LIR_Opr result = rlock_result(x);
|
||||
__ move(reg, result);
|
||||
case vmIntrinsics::_currentTimeMillis:
|
||||
do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), 0, x);
|
||||
break;
|
||||
|
||||
case vmIntrinsics::_nanoTime:
|
||||
do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
|
||||
break;
|
||||
}
|
||||
|
||||
case vmIntrinsics::_Object_init: do_RegisterFinalizer(x); break;
|
||||
case vmIntrinsics::_getClass: do_getClass(x); break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -426,6 +426,12 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
|
||||
SwitchRangeArray* create_lookup_ranges(LookupSwitch* x);
|
||||
void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux);
|
||||
|
||||
void do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x);
|
||||
#ifdef TRACE_HAVE_INTRINSICS
|
||||
void do_ThreadIDIntrinsic(Intrinsic* x);
|
||||
void do_ClassIDIntrinsic(Intrinsic* x);
|
||||
#endif
|
||||
|
||||
public:
|
||||
Compilation* compilation() const { return _compilation; }
|
||||
FrameMap* frame_map() const { return _compilation->frame_map(); }
|
||||
|
@ -295,6 +295,9 @@ const char* Runtime1::name_for_address(address entry) {
|
||||
FUNCTION_CASE(entry, SharedRuntime::dtrace_method_entry);
|
||||
FUNCTION_CASE(entry, SharedRuntime::dtrace_method_exit);
|
||||
FUNCTION_CASE(entry, trace_block_entry);
|
||||
#ifdef TRACE_HAVE_INTRINSICS
|
||||
FUNCTION_CASE(entry, TRACE_TIME_METHOD);
|
||||
#endif
|
||||
|
||||
#undef FUNCTION_CASE
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -59,10 +59,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
|
||||
_has_nonstatic_fields = ik->has_nonstatic_fields();
|
||||
_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields:
|
||||
|
||||
_nof_implementors = ik->nof_implementors();
|
||||
for (int i = 0; i < implementors_limit; i++) {
|
||||
_implementors[i] = NULL; // we will fill these lazily
|
||||
}
|
||||
_implementor = NULL; // we will fill these lazily
|
||||
|
||||
Thread *thread = Thread::current();
|
||||
if (ciObjectFactory::is_initialized()) {
|
||||
@ -102,7 +99,6 @@ ciInstanceKlass::ciInstanceKlass(ciSymbol* name,
|
||||
_nonstatic_field_size = -1;
|
||||
_has_nonstatic_fields = false;
|
||||
_nonstatic_fields = NULL;
|
||||
_nof_implementors = -1;
|
||||
_loader = loader;
|
||||
_protection_domain = protection_domain;
|
||||
_is_shared = false;
|
||||
@ -132,17 +128,6 @@ bool ciInstanceKlass::compute_shared_has_subklass() {
|
||||
)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciInstanceKlass::compute_shared_nof_implementors
|
||||
int ciInstanceKlass::compute_shared_nof_implementors() {
|
||||
// We requery this property, since it is a very old ciObject.
|
||||
GUARDED_VM_ENTRY(
|
||||
instanceKlass* ik = get_instanceKlass();
|
||||
_nof_implementors = ik->nof_implementors();
|
||||
return _nof_implementors;
|
||||
)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciInstanceKlass::loader
|
||||
oop ciInstanceKlass::loader() {
|
||||
@ -540,7 +525,7 @@ bool ciInstanceKlass::is_leaf_type() {
|
||||
if (is_shared()) {
|
||||
return is_final(); // approximately correct
|
||||
} else {
|
||||
return !_has_subklass && (_nof_implementors == 0);
|
||||
return !_has_subklass && (nof_implementors() == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -548,35 +533,31 @@ bool ciInstanceKlass::is_leaf_type() {
|
||||
// ciInstanceKlass::implementor
|
||||
//
|
||||
// Report an implementor of this interface.
|
||||
// Returns NULL if exact information is not available.
|
||||
// Note that there are various races here, since my copy
|
||||
// of _nof_implementors might be out of date with respect
|
||||
// to results returned by instanceKlass::implementor.
|
||||
// This is OK, since any dependencies we decide to assert
|
||||
// will be checked later under the Compile_lock.
|
||||
ciInstanceKlass* ciInstanceKlass::implementor(int n) {
|
||||
if (n >= implementors_limit) {
|
||||
return NULL;
|
||||
}
|
||||
ciInstanceKlass* impl = _implementors[n];
|
||||
ciInstanceKlass* ciInstanceKlass::implementor() {
|
||||
ciInstanceKlass* impl = _implementor;
|
||||
if (impl == NULL) {
|
||||
if (_nof_implementors > implementors_limit) {
|
||||
return NULL;
|
||||
}
|
||||
// Go into the VM to fetch the implementor.
|
||||
{
|
||||
VM_ENTRY_MARK;
|
||||
klassOop k = get_instanceKlass()->implementor(n);
|
||||
klassOop k = get_instanceKlass()->implementor();
|
||||
if (k != NULL) {
|
||||
impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
|
||||
if (k == get_instanceKlass()->as_klassOop()) {
|
||||
// More than one implementors. Use 'this' in this case.
|
||||
impl = this;
|
||||
} else {
|
||||
impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Memoize this result.
|
||||
if (!is_shared()) {
|
||||
_implementors[n] = (impl == NULL)? this: impl;
|
||||
_implementor = impl;
|
||||
}
|
||||
} else if (impl == this) {
|
||||
impl = NULL; // memoized null result from a VM query
|
||||
}
|
||||
return impl;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -65,9 +65,11 @@ private:
|
||||
ciConstantPoolCache* _field_cache; // cached map index->field
|
||||
GrowableArray<ciField*>* _nonstatic_fields;
|
||||
|
||||
enum { implementors_limit = instanceKlass::implementors_limit };
|
||||
ciInstanceKlass* _implementors[implementors_limit];
|
||||
jint _nof_implementors;
|
||||
// The possible values of the _implementor fall into following three cases:
|
||||
// NULL: no implementor.
|
||||
// A ciInstanceKlass that's not itself: one implementor.
|
||||
// Itsef: more than one implementors.
|
||||
ciInstanceKlass* _implementor;
|
||||
|
||||
GrowableArray<ciField*>* _non_static_fields;
|
||||
|
||||
@ -97,7 +99,6 @@ protected:
|
||||
|
||||
void compute_shared_init_state();
|
||||
bool compute_shared_has_subklass();
|
||||
int compute_shared_nof_implementors();
|
||||
int compute_nonstatic_fields();
|
||||
GrowableArray<ciField*>* compute_nonstatic_fields_impl(GrowableArray<ciField*>* super_fields);
|
||||
|
||||
@ -158,10 +159,17 @@ public:
|
||||
assert(is_loaded(), "must be loaded");
|
||||
return _nonstatic_oop_map_size; }
|
||||
ciInstanceKlass* super();
|
||||
jint nof_implementors() {
|
||||
jint nof_implementors() {
|
||||
ciInstanceKlass* impl;
|
||||
assert(is_loaded(), "must be loaded");
|
||||
if (_is_shared) return compute_shared_nof_implementors();
|
||||
return _nof_implementors;
|
||||
impl = implementor();
|
||||
if (impl == NULL) {
|
||||
return 0;
|
||||
} else if (impl != this) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
ciInstanceKlass* get_canonical_holder(int offset);
|
||||
@ -207,7 +215,7 @@ public:
|
||||
// but consider adding to vmSymbols.hpp instead.
|
||||
|
||||
bool is_leaf_type();
|
||||
ciInstanceKlass* implementor(int n);
|
||||
ciInstanceKlass* implementor();
|
||||
|
||||
// Is the defining class loader of this class the default loader?
|
||||
bool uses_default_loader();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -81,7 +81,7 @@
|
||||
#define JAVA_7_VERSION 51
|
||||
|
||||
|
||||
void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS) {
|
||||
void ClassFileParser::parse_constant_pool_entries(Handle class_loader, constantPoolHandle cp, int length, TRAPS) {
|
||||
// Use a local copy of ClassFileStream. It helps the C++ compiler to optimize
|
||||
// this function (_current can be allocated in a register, with scalar
|
||||
// replacement of aggregates). The _current pointer is copied back to
|
||||
@ -272,7 +272,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
|
||||
indices[names_count] = index;
|
||||
hashValues[names_count++] = hash;
|
||||
if (names_count == SymbolTable::symbol_alloc_batch_size) {
|
||||
SymbolTable::new_symbols(cp, names_count, names, lengths, indices, hashValues, CHECK);
|
||||
SymbolTable::new_symbols(class_loader, cp, names_count, names, lengths, indices, hashValues, CHECK);
|
||||
names_count = 0;
|
||||
}
|
||||
} else {
|
||||
@ -289,7 +289,7 @@ void ClassFileParser::parse_constant_pool_entries(constantPoolHandle cp, int len
|
||||
|
||||
// Allocate the remaining symbols
|
||||
if (names_count > 0) {
|
||||
SymbolTable::new_symbols(cp, names_count, names, lengths, indices, hashValues, CHECK);
|
||||
SymbolTable::new_symbols(class_loader, cp, names_count, names, lengths, indices, hashValues, CHECK);
|
||||
}
|
||||
|
||||
// Copy _current pointer of local copy back to stream().
|
||||
@ -318,7 +318,7 @@ class ConstantPoolCleaner : public StackObj {
|
||||
|
||||
bool inline valid_cp_range(int index, int length) { return (index > 0 && index < length); }
|
||||
|
||||
constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
constantPoolHandle ClassFileParser::parse_constant_pool(Handle class_loader, TRAPS) {
|
||||
ClassFileStream* cfs = stream();
|
||||
constantPoolHandle nullHandle;
|
||||
|
||||
@ -337,7 +337,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
|
||||
ConstantPoolCleaner cp_in_error(cp); // set constant pool to be cleaned up.
|
||||
|
||||
// parsing constant pool entries
|
||||
parse_constant_pool_entries(cp, length, CHECK_(nullHandle));
|
||||
parse_constant_pool_entries(class_loader, cp, length, CHECK_(nullHandle));
|
||||
|
||||
int index = 1; // declared outside of loops for portability
|
||||
|
||||
@ -2803,7 +2803,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
_relax_verify = Verifier::relax_verify_for(class_loader());
|
||||
|
||||
// Constant pool
|
||||
constantPoolHandle cp = parse_constant_pool(CHECK_(nullHandle));
|
||||
constantPoolHandle cp = parse_constant_pool(class_loader, CHECK_(nullHandle));
|
||||
ConstantPoolCleaner error_handler(cp); // set constant pool to be cleaned up.
|
||||
|
||||
int cp_size = cp->length();
|
||||
@ -3354,6 +3354,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
klassOop ik = oopFactory::new_instanceKlass(name, vtable_size, itable_size,
|
||||
static_field_size,
|
||||
total_oop_map_count,
|
||||
access_flags,
|
||||
rt, CHECK_(nullHandle));
|
||||
instanceKlassHandle this_klass (THREAD, ik);
|
||||
|
||||
@ -3362,7 +3363,6 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
|
||||
"sanity");
|
||||
|
||||
// Fill in information already parsed
|
||||
this_klass->set_access_flags(access_flags);
|
||||
this_klass->set_should_verify_class(verify);
|
||||
jint lh = Klass::instance_layout_helper(instance_size, false);
|
||||
this_klass->set_layout_helper(lh);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,9 +68,10 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
|
||||
void set_stream(ClassFileStream* st) { _stream = st; }
|
||||
|
||||
// Constant pool parsing
|
||||
void parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS);
|
||||
void parse_constant_pool_entries(Handle class_loader,
|
||||
constantPoolHandle cp, int length, TRAPS);
|
||||
|
||||
constantPoolHandle parse_constant_pool(TRAPS);
|
||||
constantPoolHandle parse_constant_pool(Handle class_loader, TRAPS);
|
||||
|
||||
// Interface parsing
|
||||
objArrayHandle parse_interfaces(constantPoolHandle cp,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,6 +27,7 @@
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "gc_interface/collectedHeap.inline.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/filemap.hpp"
|
||||
#include "memory/gcLocker.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
@ -37,34 +38,35 @@
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
SymbolTable* SymbolTable::_the_table = NULL;
|
||||
// Static arena for symbols that are not deallocated
|
||||
Arena* SymbolTable::_arena = NULL;
|
||||
|
||||
Symbol* SymbolTable::allocate_symbol(const u1* name, int len, TRAPS) {
|
||||
Symbol* SymbolTable::allocate_symbol(const u1* name, int len, bool c_heap, TRAPS) {
|
||||
// Don't allow symbols to be created which cannot fit in a Symbol*.
|
||||
if (len > Symbol::max_length()) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_InternalError(),
|
||||
"name is too long to represent");
|
||||
}
|
||||
Symbol* sym = new (len) Symbol(name, len);
|
||||
Symbol* sym;
|
||||
// Allocate symbols in the C heap when dumping shared spaces in case there
|
||||
// are temporary symbols we can remove.
|
||||
if (c_heap || DumpSharedSpaces) {
|
||||
// refcount starts as 1
|
||||
sym = new (len, THREAD) Symbol(name, len, 1);
|
||||
} else {
|
||||
sym = new (len, arena(), THREAD) Symbol(name, len, -1);
|
||||
}
|
||||
assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted");
|
||||
return sym;
|
||||
}
|
||||
|
||||
bool SymbolTable::allocate_symbols(int names_count, const u1** names,
|
||||
int* lengths, Symbol** syms, TRAPS) {
|
||||
for (int i = 0; i< names_count; i++) {
|
||||
if (lengths[i] > Symbol::max_length()) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_InternalError(),
|
||||
"name is too long to represent");
|
||||
}
|
||||
void SymbolTable::initialize_symbols(int arena_alloc_size) {
|
||||
// Initialize the arena for global symbols, size passed in depends on CDS.
|
||||
if (arena_alloc_size == 0) {
|
||||
_arena = new Arena();
|
||||
} else {
|
||||
_arena = new Arena(arena_alloc_size);
|
||||
}
|
||||
|
||||
for (int i = 0; i< names_count; i++) {
|
||||
int len = lengths[i];
|
||||
syms[i] = new (len) Symbol(names[i], len);
|
||||
assert(syms[i] != NULL, "new should call vm_exit_out_of_memory if "
|
||||
"C_HEAP is exhausted");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Call function for all symbols in the symbol table.
|
||||
@ -83,8 +85,7 @@ int SymbolTable::symbols_removed = 0;
|
||||
int SymbolTable::symbols_counted = 0;
|
||||
|
||||
// Remove unreferenced symbols from the symbol table
|
||||
// This is done late during GC. This doesn't use the hash table unlink because
|
||||
// it assumes that the literals are oops.
|
||||
// This is done late during GC.
|
||||
void SymbolTable::unlink() {
|
||||
int removed = 0;
|
||||
int total = 0;
|
||||
@ -156,7 +157,7 @@ Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) {
|
||||
if (s != NULL) return s;
|
||||
|
||||
// Otherwise, add to symbol to table
|
||||
return the_table()->basic_add(index, (u1*)name, len, hashValue, CHECK_NULL);
|
||||
return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
||||
@ -192,7 +193,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
||||
// We can't include the code in No_Safepoint_Verifier because of the
|
||||
// ResourceMark.
|
||||
|
||||
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, CHECK_NULL);
|
||||
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::lookup_only(const char* name, int len,
|
||||
@ -256,71 +257,81 @@ Symbol* SymbolTable::lookup_only_unicode(const jchar* name, int utf16_length,
|
||||
}
|
||||
}
|
||||
|
||||
void SymbolTable::add(constantPoolHandle cp, int names_count,
|
||||
void SymbolTable::add(Handle class_loader, constantPoolHandle cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS) {
|
||||
SymbolTable* table = the_table();
|
||||
bool added = table->basic_add(cp, names_count, names, lengths,
|
||||
bool added = table->basic_add(class_loader, cp, names_count, names, lengths,
|
||||
cp_indices, hashValues, CHECK);
|
||||
if (!added) {
|
||||
// do it the hard way
|
||||
for (int i=0; i<names_count; i++) {
|
||||
int index = table->hash_to_index(hashValues[i]);
|
||||
Symbol* sym = table->basic_add(index, (u1*)names[i], lengths[i],
|
||||
hashValues[i], CHECK);
|
||||
bool c_heap = class_loader() != NULL;
|
||||
Symbol* sym = table->basic_add(index, (u1*)names[i], lengths[i], hashValues[i], c_heap, CHECK);
|
||||
cp->symbol_at_put(cp_indices[i], sym);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::new_permanent_symbol(const char* name, TRAPS) {
|
||||
unsigned int hash;
|
||||
Symbol* result = SymbolTable::lookup_only((char*)name, (int)strlen(name), hash);
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
SymbolTable* table = the_table();
|
||||
int index = table->hash_to_index(hash);
|
||||
return table->basic_add(index, (u1*)name, (int)strlen(name), hash, false, THREAD);
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::basic_add(int index, u1 *name, int len,
|
||||
unsigned int hashValue, TRAPS) {
|
||||
unsigned int hashValue, bool c_heap, TRAPS) {
|
||||
assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
|
||||
"proposed name of symbol must be stable");
|
||||
|
||||
// We assume that lookup() has been called already, that it failed,
|
||||
// and symbol was not found. We create the symbol here.
|
||||
Symbol* sym = allocate_symbol(name, len, CHECK_NULL);
|
||||
|
||||
// Allocation must be done before grabbing the SymbolTable_lock lock
|
||||
// Grab SymbolTable_lock first.
|
||||
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||
|
||||
assert(sym->equals((char*)name, len), "symbol must be properly initialized");
|
||||
|
||||
// Since look-up was done lock-free, we need to check if another
|
||||
// thread beat us in the race to insert the symbol.
|
||||
|
||||
Symbol* test = lookup(index, (char*)name, len, hashValue);
|
||||
if (test != NULL) {
|
||||
// A race occurred and another thread introduced the symbol, this one
|
||||
// will be dropped and collected.
|
||||
delete sym;
|
||||
// A race occurred and another thread introduced the symbol.
|
||||
assert(test->refcount() != 0, "lookup should have incremented the count");
|
||||
return test;
|
||||
}
|
||||
|
||||
// Create a new symbol.
|
||||
Symbol* sym = allocate_symbol(name, len, c_heap, CHECK_NULL);
|
||||
assert(sym->equals((char*)name, len), "symbol must be properly initialized");
|
||||
|
||||
HashtableEntry<Symbol*>* entry = new_entry(hashValue, sym);
|
||||
sym->increment_refcount();
|
||||
add_entry(index, entry);
|
||||
return sym;
|
||||
}
|
||||
|
||||
bool SymbolTable::basic_add(constantPoolHandle cp, int names_count,
|
||||
// This version of basic_add adds symbols in batch from the constant pool
|
||||
// parsing.
|
||||
bool SymbolTable::basic_add(Handle class_loader, constantPoolHandle cp,
|
||||
int names_count,
|
||||
const char** names, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
TRAPS) {
|
||||
Symbol* syms[symbol_alloc_batch_size];
|
||||
bool allocated = allocate_symbols(names_count, (const u1**)names, lengths,
|
||||
syms, CHECK_false);
|
||||
if (!allocated) {
|
||||
return false;
|
||||
|
||||
// Check symbol names are not too long. If any are too long, don't add any.
|
||||
for (int i = 0; i< names_count; i++) {
|
||||
if (lengths[i] > Symbol::max_length()) {
|
||||
THROW_MSG_0(vmSymbols::java_lang_InternalError(),
|
||||
"name is too long to represent");
|
||||
}
|
||||
}
|
||||
|
||||
// Allocation must be done before grabbing the SymbolTable_lock lock
|
||||
// Hold SymbolTable_lock through the symbol creation
|
||||
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||
|
||||
for (int i=0; i<names_count; i++) {
|
||||
assert(syms[i]->equals(names[i], lengths[i]), "symbol must be properly initialized");
|
||||
// Since look-up was done lock-free, we need to check if another
|
||||
// thread beat us in the race to insert the symbol.
|
||||
int index = hash_to_index(hashValues[i]);
|
||||
@ -330,16 +341,17 @@ bool SymbolTable::basic_add(constantPoolHandle cp, int names_count,
|
||||
// will be dropped and collected. Use test instead.
|
||||
cp->symbol_at_put(cp_indices[i], test);
|
||||
assert(test->refcount() != 0, "lookup should have incremented the count");
|
||||
delete syms[i];
|
||||
} else {
|
||||
Symbol* sym = syms[i];
|
||||
// Create a new symbol. The null class loader is never unloaded so these
|
||||
// are allocated specially in a permanent arena.
|
||||
bool c_heap = class_loader() != NULL;
|
||||
Symbol* sym = allocate_symbol((const u1*)names[i], lengths[i], c_heap, CHECK_(false));
|
||||
assert(sym->equals(names[i], lengths[i]), "symbol must be properly initialized"); // why wouldn't it be???
|
||||
HashtableEntry<Symbol*>* entry = new_entry(hashValues[i], sym);
|
||||
sym->increment_refcount(); // increment refcount in external hashtable
|
||||
add_entry(index, entry);
|
||||
cp->symbol_at_put(cp_indices[i], sym);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -406,6 +418,8 @@ void SymbolTable::print_histogram() {
|
||||
((float)symbols_removed/(float)symbols_counted)* 100);
|
||||
}
|
||||
tty->print_cr("Reference counts %5d", Symbol::_total_count);
|
||||
tty->print_cr("Symbol arena size %5d used %5d",
|
||||
arena()->size_in_bytes(), arena()->used());
|
||||
tty->print_cr("Histogram of symbol length:");
|
||||
tty->print_cr("%8s %5d", "Total ", total);
|
||||
tty->print_cr("%8s %5d", "Maximum", max_symbols);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -82,24 +82,24 @@ private:
|
||||
static int symbols_removed;
|
||||
static int symbols_counted;
|
||||
|
||||
Symbol* allocate_symbol(const u1* name, int len, TRAPS); // Assumes no characters larger than 0x7F
|
||||
bool allocate_symbols(int names_count, const u1** names, int* lengths, Symbol** syms, TRAPS);
|
||||
Symbol* allocate_symbol(const u1* name, int len, bool c_heap, TRAPS); // Assumes no characters larger than 0x7F
|
||||
|
||||
// Adding elements
|
||||
Symbol* basic_add(int index, u1* name, int len,
|
||||
unsigned int hashValue, TRAPS);
|
||||
bool basic_add(constantPoolHandle cp, int names_count,
|
||||
Symbol* basic_add(int index, u1* name, int len, unsigned int hashValue,
|
||||
bool c_heap, TRAPS);
|
||||
|
||||
bool basic_add(Handle class_loader, constantPoolHandle cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
static void new_symbols(constantPoolHandle cp, int names_count,
|
||||
static void new_symbols(Handle class_loader, constantPoolHandle cp,
|
||||
int names_count,
|
||||
const char** name, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues,
|
||||
TRAPS) {
|
||||
add(cp, names_count, name, lengths, cp_indices, hashValues, THREAD);
|
||||
add(class_loader, cp, names_count, name, lengths, cp_indices, hashValues, THREAD);
|
||||
}
|
||||
|
||||
|
||||
// Table size
|
||||
enum {
|
||||
symbol_table_size = 20011
|
||||
@ -114,10 +114,16 @@ private:
|
||||
: Hashtable<Symbol*>(symbol_table_size, sizeof (HashtableEntry<Symbol*>), t,
|
||||
number_of_entries) {}
|
||||
|
||||
// Arena for permanent symbols (null class loader) that are never unloaded
|
||||
static Arena* _arena;
|
||||
static Arena* arena() { return _arena; } // called for statistics
|
||||
|
||||
static void initialize_symbols(int arena_alloc_size = 0);
|
||||
public:
|
||||
enum {
|
||||
symbol_alloc_batch_size = 8
|
||||
symbol_alloc_batch_size = 8,
|
||||
// Pick initial size based on java -version size measurements
|
||||
symbol_alloc_arena_size = 360*K
|
||||
};
|
||||
|
||||
// The symbol table
|
||||
@ -126,6 +132,7 @@ public:
|
||||
static void create_table() {
|
||||
assert(_the_table == NULL, "One symbol table allowed.");
|
||||
_the_table = new SymbolTable();
|
||||
initialize_symbols(symbol_alloc_arena_size);
|
||||
}
|
||||
|
||||
static void create_table(HashtableBucket* t, int length,
|
||||
@ -134,6 +141,9 @@ public:
|
||||
assert(length == symbol_table_size * sizeof(HashtableBucket),
|
||||
"bad shared symbol size.");
|
||||
_the_table = new SymbolTable(t, number_of_entries);
|
||||
// if CDS give symbol table a default arena size since most symbols
|
||||
// are already allocated in the shared misc section.
|
||||
initialize_symbols();
|
||||
}
|
||||
|
||||
static Symbol* lookup(const char* name, int len, TRAPS);
|
||||
@ -151,7 +161,7 @@ public:
|
||||
static Symbol* lookup_unicode(const jchar* name, int len, TRAPS);
|
||||
static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash);
|
||||
|
||||
static void add(constantPoolHandle cp, int names_count,
|
||||
static void add(Handle class_loader, constantPoolHandle cp, int names_count,
|
||||
const char** names, int* lengths, int* cp_indices,
|
||||
unsigned int* hashValues, TRAPS);
|
||||
|
||||
@ -174,6 +184,9 @@ public:
|
||||
return lookup(sym, begin, end, THREAD);
|
||||
}
|
||||
|
||||
// Create a symbol in the arena for symbols that are not deleted
|
||||
static Symbol* new_permanent_symbol(const char* name, TRAPS);
|
||||
|
||||
// Symbol lookup
|
||||
static Symbol* lookup(int index, const char* name, int len, TRAPS);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -79,7 +79,7 @@ void vmSymbols::initialize(TRAPS) {
|
||||
if (!UseSharedSpaces) {
|
||||
const char* string = &vm_symbol_bodies[0];
|
||||
for (int index = (int)FIRST_SID; index < (int)SID_LIMIT; index++) {
|
||||
Symbol* sym = SymbolTable::new_symbol(string, CHECK);
|
||||
Symbol* sym = SymbolTable::new_permanent_symbol(string, CHECK);
|
||||
_symbols[index] = sym;
|
||||
string += strlen(string); // skip string body
|
||||
string += 1; // skip trailing null
|
||||
@ -128,7 +128,7 @@ void vmSymbols::initialize(TRAPS) {
|
||||
// Spot-check correspondence between strings, symbols, and enums:
|
||||
assert(_symbols[NO_SID] == NULL, "must be");
|
||||
const char* str = "java/lang/Object";
|
||||
TempNewSymbol jlo = SymbolTable::new_symbol(str, CHECK);
|
||||
TempNewSymbol jlo = SymbolTable::new_permanent_symbol(str, CHECK);
|
||||
assert(strncmp(str, (char*)jlo->base(), jlo->utf8_length()) == 0, "");
|
||||
assert(jlo == java_lang_Object(), "");
|
||||
SID sid = VM_SYMBOL_ENUM_NAME(java_lang_Object);
|
||||
@ -147,7 +147,7 @@ void vmSymbols::initialize(TRAPS) {
|
||||
// The string "format" happens (at the moment) not to be a vmSymbol,
|
||||
// though it is a method name in java.lang.String.
|
||||
str = "format";
|
||||
TempNewSymbol fmt = SymbolTable::new_symbol(str, CHECK);
|
||||
TempNewSymbol fmt = SymbolTable::new_permanent_symbol(str, CHECK);
|
||||
sid = find_sid(fmt);
|
||||
assert(sid == NO_SID, "symbol index works (negative test)");
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "oops/symbol.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "trace/traceMacros.hpp"
|
||||
|
||||
// The class vmSymbols is a name space for fast lookup of
|
||||
// symbols commonly used in the VM.
|
||||
@ -424,6 +425,7 @@
|
||||
template(throwable_throwable_signature, "(Ljava/lang/Throwable;)Ljava/lang/Throwable;") \
|
||||
template(class_void_signature, "(Ljava/lang/Class;)V") \
|
||||
template(class_int_signature, "(Ljava/lang/Class;)I") \
|
||||
template(class_long_signature, "(Ljava/lang/Class;)J") \
|
||||
template(class_boolean_signature, "(Ljava/lang/Class;)Z") \
|
||||
template(throwable_string_void_signature, "(Ljava/lang/Throwable;Ljava/lang/String;)V") \
|
||||
template(string_array_void_signature, "([Ljava/lang/String;)V") \
|
||||
@ -539,10 +541,12 @@
|
||||
template(serializePropertiesToByteArray_signature, "()[B") \
|
||||
template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
|
||||
template(classRedefinedCount_name, "classRedefinedCount") \
|
||||
\
|
||||
/* trace signatures */ \
|
||||
TRACE_TEMPLATES(template) \
|
||||
\
|
||||
/*end*/
|
||||
|
||||
|
||||
|
||||
// Here are all the intrinsics known to the runtime and the CI.
|
||||
// Each intrinsic consists of a public enum name (like _hashCode),
|
||||
// followed by a specification of its klass, name, and signature:
|
||||
@ -648,6 +652,8 @@
|
||||
do_intrinsic(_nanoTime, java_lang_System, nanoTime_name, void_long_signature, F_S) \
|
||||
do_name( nanoTime_name, "nanoTime") \
|
||||
\
|
||||
TRACE_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias) \
|
||||
\
|
||||
do_intrinsic(_arraycopy, java_lang_System, arraycopy_name, arraycopy_signature, F_S) \
|
||||
do_name( arraycopy_name, "arraycopy") \
|
||||
do_signature(arraycopy_signature, "(Ljava/lang/Object;ILjava/lang/Object;II)V") \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1033,21 +1033,25 @@ klassOop ClassHierarchyWalker::find_witness_anywhere(klassOop context_type,
|
||||
// (Old CHA had the same limitation.)
|
||||
return context_type;
|
||||
}
|
||||
for (int i = 0; i < nof_impls; i++) {
|
||||
klassOop impl = instanceKlass::cast(context_type)->implementor(i);
|
||||
if (impl == NULL) {
|
||||
// implementors array overflowed => no exact info.
|
||||
if (nof_impls > 0) {
|
||||
klassOop impl = instanceKlass::cast(context_type)->implementor();
|
||||
assert(impl != NULL, "just checking");
|
||||
// If impl is the same as the context_type, then more than one
|
||||
// implementor has seen. No exact info in this case.
|
||||
if (impl == context_type) {
|
||||
return context_type; // report an inexact witness to this sad affair
|
||||
}
|
||||
if (do_counts)
|
||||
{ NOT_PRODUCT(deps_find_witness_steps++); }
|
||||
if (is_participant(impl)) {
|
||||
if (participants_hide_witnesses) continue;
|
||||
// else fall through to process this guy's subclasses
|
||||
if (!participants_hide_witnesses) {
|
||||
ADD_SUBCLASS_CHAIN(impl);
|
||||
}
|
||||
} else if (is_witness(impl) && !ignore_witness(impl)) {
|
||||
return impl;
|
||||
} else {
|
||||
ADD_SUBCLASS_CHAIN(impl);
|
||||
}
|
||||
ADD_SUBCLASS_CHAIN(impl);
|
||||
}
|
||||
|
||||
// Recursively process each non-trivial sibling chain.
|
||||
@ -1174,8 +1178,9 @@ klassOop Dependencies::check_leaf_type(klassOop ctxk) {
|
||||
} else if (ctx->nof_implementors() != 0) {
|
||||
// if it is an interface, it must be unimplemented
|
||||
// (if it is not an interface, nof_implementors is always zero)
|
||||
klassOop impl = ctx->implementor(0);
|
||||
return (impl != NULL)? impl: ctxk;
|
||||
klassOop impl = ctx->implementor();
|
||||
assert(impl != NULL, "must be set");
|
||||
return impl;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ public:
|
||||
static void oops_do_marking_prologue();
|
||||
static void oops_do_marking_epilogue();
|
||||
static bool oops_do_marking_is_active() { return _oops_do_mark_nmethods != NULL; }
|
||||
DEBUG_ONLY(bool test_oops_do_mark() { return _oops_do_mark_link != NULL; })
|
||||
bool test_oops_do_mark() { return _oops_do_mark_link != NULL; }
|
||||
|
||||
// ScopeDesc for an instruction
|
||||
ScopeDesc* scope_desc_at(address pc);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -2444,7 +2444,7 @@ class VerifyAllOopsClosure: public OopClosure {
|
||||
virtual void do_oop(narrowOop* p) { VerifyAllOopsClosure::do_oop_work(p); }
|
||||
};
|
||||
|
||||
void CompactibleFreeListSpace::verify(bool ignored) const {
|
||||
void CompactibleFreeListSpace::verify() const {
|
||||
assert_lock_strong(&_freelistLock);
|
||||
verify_objects_initialized();
|
||||
MemRegion span = _collector->_span;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -492,7 +492,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||
void print() const;
|
||||
void print_on(outputStream* st) const;
|
||||
void prepare_for_verify();
|
||||
void verify(bool allow_dirty) const;
|
||||
void verify() const;
|
||||
void verifyFreeLists() const PRODUCT_RETURN;
|
||||
void verifyIndexedFreeLists() const;
|
||||
void verifyIndexedFreeList(size_t size) const;
|
||||
|
@ -3109,21 +3109,21 @@ ConcurrentMarkSweepGeneration::prepare_for_verify() {
|
||||
}
|
||||
|
||||
void
|
||||
ConcurrentMarkSweepGeneration::verify(bool allow_dirty /* ignored */) {
|
||||
ConcurrentMarkSweepGeneration::verify() {
|
||||
// Locks are normally acquired/released in gc_prologue/gc_epilogue, but those
|
||||
// are not called when the heap is verified during universe initialization and
|
||||
// at vm shutdown.
|
||||
if (freelistLock()->owned_by_self()) {
|
||||
cmsSpace()->verify(false /* ignored */);
|
||||
cmsSpace()->verify();
|
||||
} else {
|
||||
MutexLockerEx fll(freelistLock(), Mutex::_no_safepoint_check_flag);
|
||||
cmsSpace()->verify(false /* ignored */);
|
||||
cmsSpace()->verify();
|
||||
}
|
||||
}
|
||||
|
||||
void CMSCollector::verify(bool allow_dirty /* ignored */) {
|
||||
_cmsGen->verify(allow_dirty);
|
||||
_permGen->verify(allow_dirty);
|
||||
void CMSCollector::verify() {
|
||||
_cmsGen->verify();
|
||||
_permGen->verify();
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -988,7 +988,7 @@ class CMSCollector: public CHeapObj {
|
||||
CMSGCAdaptivePolicyCounters* gc_adaptive_policy_counters();
|
||||
|
||||
// debugging
|
||||
void verify(bool);
|
||||
void verify();
|
||||
bool verify_after_remark();
|
||||
void verify_ok_to_terminate() const PRODUCT_RETURN;
|
||||
void verify_work_stacks_empty() const PRODUCT_RETURN;
|
||||
@ -1279,7 +1279,7 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
||||
|
||||
// Debugging
|
||||
void prepare_for_verify();
|
||||
void verify(bool allow_dirty);
|
||||
void verify();
|
||||
void print_statistics() PRODUCT_RETURN;
|
||||
|
||||
// Performance Counters support
|
||||
|
@ -29,102 +29,6 @@
|
||||
#include "gc_implementation/g1/g1ErgoVerbose.hpp"
|
||||
#include "memory/space.inline.hpp"
|
||||
|
||||
CSetChooserCache::CSetChooserCache() {
|
||||
for (int i = 0; i < CacheLength; ++i)
|
||||
_cache[i] = NULL;
|
||||
clear();
|
||||
}
|
||||
|
||||
void CSetChooserCache::clear() {
|
||||
_occupancy = 0;
|
||||
_first = 0;
|
||||
for (int i = 0; i < CacheLength; ++i) {
|
||||
HeapRegion *hr = _cache[i];
|
||||
if (hr != NULL)
|
||||
hr->set_sort_index(-1);
|
||||
_cache[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
bool CSetChooserCache::verify() {
|
||||
guarantee(false, "CSetChooserCache::verify(): don't call this any more");
|
||||
|
||||
int index = _first;
|
||||
HeapRegion *prev = NULL;
|
||||
for (int i = 0; i < _occupancy; ++i) {
|
||||
guarantee(_cache[index] != NULL, "cache entry should not be empty");
|
||||
HeapRegion *hr = _cache[index];
|
||||
guarantee(!hr->is_young(), "should not be young!");
|
||||
if (prev != NULL) {
|
||||
guarantee(prev->gc_efficiency() >= hr->gc_efficiency(),
|
||||
"cache should be correctly ordered");
|
||||
}
|
||||
guarantee(hr->sort_index() == get_sort_index(index),
|
||||
"sort index should be correct");
|
||||
index = trim_index(index + 1);
|
||||
prev = hr;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (CacheLength - _occupancy); ++i) {
|
||||
guarantee(_cache[index] == NULL, "cache entry should be empty");
|
||||
index = trim_index(index + 1);
|
||||
}
|
||||
|
||||
guarantee(index == _first, "we should have reached where we started from");
|
||||
return true;
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
void CSetChooserCache::insert(HeapRegion *hr) {
|
||||
guarantee(false, "CSetChooserCache::insert(): don't call this any more");
|
||||
|
||||
assert(!is_full(), "cache should not be empty");
|
||||
hr->calc_gc_efficiency();
|
||||
|
||||
int empty_index;
|
||||
if (_occupancy == 0) {
|
||||
empty_index = _first;
|
||||
} else {
|
||||
empty_index = trim_index(_first + _occupancy);
|
||||
assert(_cache[empty_index] == NULL, "last slot should be empty");
|
||||
int last_index = trim_index(empty_index - 1);
|
||||
HeapRegion *last = _cache[last_index];
|
||||
assert(last != NULL,"as the cache is not empty, last should not be empty");
|
||||
while (empty_index != _first &&
|
||||
last->gc_efficiency() < hr->gc_efficiency()) {
|
||||
_cache[empty_index] = last;
|
||||
last->set_sort_index(get_sort_index(empty_index));
|
||||
empty_index = last_index;
|
||||
last_index = trim_index(last_index - 1);
|
||||
last = _cache[last_index];
|
||||
}
|
||||
}
|
||||
_cache[empty_index] = hr;
|
||||
hr->set_sort_index(get_sort_index(empty_index));
|
||||
|
||||
++_occupancy;
|
||||
assert(verify(), "cache should be consistent");
|
||||
}
|
||||
|
||||
HeapRegion *CSetChooserCache::remove_first() {
|
||||
guarantee(false, "CSetChooserCache::remove_first(): "
|
||||
"don't call this any more");
|
||||
|
||||
if (_occupancy > 0) {
|
||||
assert(_cache[_first] != NULL, "cache should have at least one region");
|
||||
HeapRegion *ret = _cache[_first];
|
||||
_cache[_first] = NULL;
|
||||
ret->set_sort_index(-1);
|
||||
--_occupancy;
|
||||
_first = trim_index(_first + 1);
|
||||
assert(verify(), "cache should be consistent");
|
||||
return ret;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Even though we don't use the GC efficiency in our heuristics as
|
||||
// much as we used to, we still order according to GC efficiency. This
|
||||
// will cause regions with a lot of live objects and large RSets to
|
||||
@ -134,7 +38,7 @@ HeapRegion *CSetChooserCache::remove_first() {
|
||||
// the ones we'll skip are ones with both large RSets and a lot of
|
||||
// live objects, not the ones with just a lot of live objects if we
|
||||
// ordered according to the amount of reclaimable bytes per region.
|
||||
static int orderRegions(HeapRegion* hr1, HeapRegion* hr2) {
|
||||
static int order_regions(HeapRegion* hr1, HeapRegion* hr2) {
|
||||
if (hr1 == NULL) {
|
||||
if (hr2 == NULL) {
|
||||
return 0;
|
||||
@ -156,8 +60,8 @@ static int orderRegions(HeapRegion* hr1, HeapRegion* hr2) {
|
||||
}
|
||||
}
|
||||
|
||||
static int orderRegions(HeapRegion** hr1p, HeapRegion** hr2p) {
|
||||
return orderRegions(*hr1p, *hr2p);
|
||||
static int order_regions(HeapRegion** hr1p, HeapRegion** hr2p) {
|
||||
return order_regions(*hr1p, *hr2p);
|
||||
}
|
||||
|
||||
CollectionSetChooser::CollectionSetChooser() :
|
||||
@ -175,105 +79,74 @@ CollectionSetChooser::CollectionSetChooser() :
|
||||
//
|
||||
// Note: containing object is allocated on C heap since it is CHeapObj.
|
||||
//
|
||||
_markedRegions((ResourceObj::set_allocation_type((address)&_markedRegions,
|
||||
_regions((ResourceObj::set_allocation_type((address) &_regions,
|
||||
ResourceObj::C_HEAP),
|
||||
100), true /* C_Heap */),
|
||||
_curr_index(0), _length(0),
|
||||
_regionLiveThresholdBytes(0), _remainingReclaimableBytes(0),
|
||||
_first_par_unreserved_idx(0) {
|
||||
_regionLiveThresholdBytes =
|
||||
_curr_index(0), _length(0), _first_par_unreserved_idx(0),
|
||||
_region_live_threshold_bytes(0), _remaining_reclaimable_bytes(0) {
|
||||
_region_live_threshold_bytes =
|
||||
HeapRegion::GrainBytes * (size_t) G1OldCSetRegionLiveThresholdPercent / 100;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
bool CollectionSetChooser::verify() {
|
||||
guarantee(_length >= 0, err_msg("_length: %d", _length));
|
||||
guarantee(0 <= _curr_index && _curr_index <= _length,
|
||||
err_msg("_curr_index: %d _length: %d", _curr_index, _length));
|
||||
int index = 0;
|
||||
void CollectionSetChooser::verify() {
|
||||
guarantee(_length <= regions_length(),
|
||||
err_msg("_length: %u regions length: %u", _length, regions_length()));
|
||||
guarantee(_curr_index <= _length,
|
||||
err_msg("_curr_index: %u _length: %u", _curr_index, _length));
|
||||
uint index = 0;
|
||||
size_t sum_of_reclaimable_bytes = 0;
|
||||
while (index < _curr_index) {
|
||||
guarantee(_markedRegions.at(index) == NULL,
|
||||
guarantee(regions_at(index) == NULL,
|
||||
"all entries before _curr_index should be NULL");
|
||||
index += 1;
|
||||
}
|
||||
HeapRegion *prev = NULL;
|
||||
while (index < _length) {
|
||||
HeapRegion *curr = _markedRegions.at(index++);
|
||||
guarantee(curr != NULL, "Regions in _markedRegions array cannot be NULL");
|
||||
int si = curr->sort_index();
|
||||
HeapRegion *curr = regions_at(index++);
|
||||
guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
|
||||
guarantee(!curr->is_young(), "should not be young!");
|
||||
guarantee(!curr->isHumongous(), "should not be humongous!");
|
||||
guarantee(si > -1 && si == (index-1), "sort index invariant");
|
||||
if (prev != NULL) {
|
||||
guarantee(orderRegions(prev, curr) != 1,
|
||||
guarantee(order_regions(prev, curr) != 1,
|
||||
err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
|
||||
prev->gc_efficiency(), curr->gc_efficiency()));
|
||||
}
|
||||
sum_of_reclaimable_bytes += curr->reclaimable_bytes();
|
||||
prev = curr;
|
||||
}
|
||||
guarantee(sum_of_reclaimable_bytes == _remainingReclaimableBytes,
|
||||
guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
|
||||
err_msg("reclaimable bytes inconsistent, "
|
||||
"remaining: "SIZE_FORMAT" sum: "SIZE_FORMAT,
|
||||
_remainingReclaimableBytes, sum_of_reclaimable_bytes));
|
||||
return true;
|
||||
_remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
|
||||
}
|
||||
#endif
|
||||
#endif // !PRODUCT
|
||||
|
||||
void CollectionSetChooser::fillCache() {
|
||||
guarantee(false, "fillCache: don't call this any more");
|
||||
|
||||
while (!_cache.is_full() && (_curr_index < _length)) {
|
||||
HeapRegion* hr = _markedRegions.at(_curr_index);
|
||||
assert(hr != NULL,
|
||||
err_msg("Unexpected NULL hr in _markedRegions at index %d",
|
||||
_curr_index));
|
||||
_curr_index += 1;
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
assert(hr->sort_index() == _curr_index-1, "sort_index invariant");
|
||||
_markedRegions.at_put(hr->sort_index(), NULL);
|
||||
_cache.insert(hr);
|
||||
assert(!_cache.is_empty(), "cache should not be empty");
|
||||
}
|
||||
assert(verify(), "cache should be consistent");
|
||||
}
|
||||
|
||||
void CollectionSetChooser::sortMarkedHeapRegions() {
|
||||
void CollectionSetChooser::sort_regions() {
|
||||
// First trim any unused portion of the top in the parallel case.
|
||||
if (_first_par_unreserved_idx > 0) {
|
||||
if (G1PrintParCleanupStats) {
|
||||
gclog_or_tty->print(" Truncating _markedRegions from %d to %d.\n",
|
||||
_markedRegions.length(), _first_par_unreserved_idx);
|
||||
}
|
||||
assert(_first_par_unreserved_idx <= _markedRegions.length(),
|
||||
assert(_first_par_unreserved_idx <= regions_length(),
|
||||
"Or we didn't reserved enough length");
|
||||
_markedRegions.trunc_to(_first_par_unreserved_idx);
|
||||
regions_trunc_to(_first_par_unreserved_idx);
|
||||
}
|
||||
_markedRegions.sort(orderRegions);
|
||||
assert(_length <= _markedRegions.length(), "Requirement");
|
||||
assert(_length == 0 || _markedRegions.at(_length - 1) != NULL,
|
||||
"Testing _length");
|
||||
assert(_length == _markedRegions.length() ||
|
||||
_markedRegions.at(_length) == NULL, "Testing _length");
|
||||
if (G1PrintParCleanupStats) {
|
||||
gclog_or_tty->print_cr(" Sorted %d marked regions.", _length);
|
||||
}
|
||||
for (int i = 0; i < _length; i++) {
|
||||
assert(_markedRegions.at(i) != NULL, "Should be true by sorting!");
|
||||
_markedRegions.at(i)->set_sort_index(i);
|
||||
_regions.sort(order_regions);
|
||||
assert(_length <= regions_length(), "Requirement");
|
||||
#ifdef ASSERT
|
||||
for (uint i = 0; i < _length; i++) {
|
||||
assert(regions_at(i) != NULL, "Should be true by sorting!");
|
||||
}
|
||||
#endif // ASSERT
|
||||
if (G1PrintRegionLivenessInfo) {
|
||||
G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting");
|
||||
for (int i = 0; i < _length; ++i) {
|
||||
HeapRegion* r = _markedRegions.at(i);
|
||||
for (uint i = 0; i < _length; ++i) {
|
||||
HeapRegion* r = regions_at(i);
|
||||
cl.doHeapRegion(r);
|
||||
}
|
||||
}
|
||||
assert(verify(), "CSet chooser verification");
|
||||
verify();
|
||||
}
|
||||
|
||||
size_t CollectionSetChooser::calcMinOldCSetLength() {
|
||||
uint CollectionSetChooser::calc_min_old_cset_length() {
|
||||
// The min old CSet region bound is based on the maximum desired
|
||||
// number of mixed GCs after a cycle. I.e., even if some old regions
|
||||
// look expensive, we should add them to the CSet anyway to make
|
||||
@ -291,10 +164,10 @@ size_t CollectionSetChooser::calcMinOldCSetLength() {
|
||||
if (result * gc_num < region_num) {
|
||||
result += 1;
|
||||
}
|
||||
return result;
|
||||
return (uint) result;
|
||||
}
|
||||
|
||||
size_t CollectionSetChooser::calcMaxOldCSetLength() {
|
||||
uint CollectionSetChooser::calc_max_old_cset_length() {
|
||||
// The max old CSet region bound is based on the threshold expressed
|
||||
// as a percentage of the heap size. I.e., it should bound the
|
||||
// number of old regions added to the CSet irrespective of how many
|
||||
@ -308,23 +181,23 @@ size_t CollectionSetChooser::calcMaxOldCSetLength() {
|
||||
if (100 * result < region_num * perc) {
|
||||
result += 1;
|
||||
}
|
||||
return result;
|
||||
return (uint) result;
|
||||
}
|
||||
|
||||
void CollectionSetChooser::addMarkedHeapRegion(HeapRegion* hr) {
|
||||
void CollectionSetChooser::add_region(HeapRegion* hr) {
|
||||
assert(!hr->isHumongous(),
|
||||
"Humongous regions shouldn't be added to the collection set");
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
_markedRegions.append(hr);
|
||||
_regions.append(hr);
|
||||
_length++;
|
||||
_remainingReclaimableBytes += hr->reclaimable_bytes();
|
||||
_remaining_reclaimable_bytes += hr->reclaimable_bytes();
|
||||
hr->calc_gc_efficiency();
|
||||
}
|
||||
|
||||
void CollectionSetChooser::prepareForAddMarkedHeapRegionsPar(size_t n_regions,
|
||||
size_t chunkSize) {
|
||||
void CollectionSetChooser::prepare_for_par_region_addition(uint n_regions,
|
||||
uint chunk_size) {
|
||||
_first_par_unreserved_idx = 0;
|
||||
int n_threads = ParallelGCThreads;
|
||||
uint n_threads = (uint) ParallelGCThreads;
|
||||
if (UseDynamicNumberOfGCThreads) {
|
||||
assert(G1CollectedHeap::heap()->workers()->active_workers() > 0,
|
||||
"Should have been set earlier");
|
||||
@ -335,57 +208,46 @@ void CollectionSetChooser::prepareForAddMarkedHeapRegionsPar(size_t n_regions,
|
||||
n_threads = MAX2(G1CollectedHeap::heap()->workers()->active_workers(),
|
||||
1U);
|
||||
}
|
||||
size_t max_waste = n_threads * chunkSize;
|
||||
// it should be aligned with respect to chunkSize
|
||||
size_t aligned_n_regions =
|
||||
(n_regions + (chunkSize - 1)) / chunkSize * chunkSize;
|
||||
assert( aligned_n_regions % chunkSize == 0, "should be aligned" );
|
||||
_markedRegions.at_put_grow((int)(aligned_n_regions + max_waste - 1), NULL);
|
||||
uint max_waste = n_threads * chunk_size;
|
||||
// it should be aligned with respect to chunk_size
|
||||
uint aligned_n_regions = (n_regions + chunk_size - 1) / chunk_size * chunk_size;
|
||||
assert(aligned_n_regions % chunk_size == 0, "should be aligned");
|
||||
regions_at_put_grow(aligned_n_regions + max_waste - 1, NULL);
|
||||
}
|
||||
|
||||
jint CollectionSetChooser::getParMarkedHeapRegionChunk(jint n_regions) {
|
||||
// Don't do this assert because this can be called at a point
|
||||
// where the loop up stream will not execute again but might
|
||||
// try to claim more chunks (loop test has not been done yet).
|
||||
// assert(_markedRegions.length() > _first_par_unreserved_idx,
|
||||
// "Striding beyond the marked regions");
|
||||
jint res = Atomic::add(n_regions, &_first_par_unreserved_idx);
|
||||
assert(_markedRegions.length() > res + n_regions - 1,
|
||||
uint CollectionSetChooser::claim_array_chunk(uint chunk_size) {
|
||||
uint res = (uint) Atomic::add((jint) chunk_size,
|
||||
(volatile jint*) &_first_par_unreserved_idx);
|
||||
assert(regions_length() > res + chunk_size - 1,
|
||||
"Should already have been expanded");
|
||||
return res - n_regions;
|
||||
return res - chunk_size;
|
||||
}
|
||||
|
||||
void CollectionSetChooser::setMarkedHeapRegion(jint index, HeapRegion* hr) {
|
||||
assert(_markedRegions.at(index) == NULL, "precondition");
|
||||
void CollectionSetChooser::set_region(uint index, HeapRegion* hr) {
|
||||
assert(regions_at(index) == NULL, "precondition");
|
||||
assert(!hr->is_young(), "should not be young!");
|
||||
_markedRegions.at_put(index, hr);
|
||||
regions_at_put(index, hr);
|
||||
hr->calc_gc_efficiency();
|
||||
}
|
||||
|
||||
void CollectionSetChooser::updateTotals(jint region_num,
|
||||
size_t reclaimable_bytes) {
|
||||
void CollectionSetChooser::update_totals(uint region_num,
|
||||
size_t reclaimable_bytes) {
|
||||
// Only take the lock if we actually need to update the totals.
|
||||
if (region_num > 0) {
|
||||
assert(reclaimable_bytes > 0, "invariant");
|
||||
// We could have just used atomics instead of taking the
|
||||
// lock. However, we currently don't have an atomic add for size_t.
|
||||
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
|
||||
_length += (int) region_num;
|
||||
_remainingReclaimableBytes += reclaimable_bytes;
|
||||
_length += region_num;
|
||||
_remaining_reclaimable_bytes += reclaimable_bytes;
|
||||
} else {
|
||||
assert(reclaimable_bytes == 0, "invariant");
|
||||
}
|
||||
}
|
||||
|
||||
void CollectionSetChooser::clearMarkedHeapRegions() {
|
||||
for (int i = 0; i < _markedRegions.length(); i++) {
|
||||
HeapRegion* r = _markedRegions.at(i);
|
||||
if (r != NULL) {
|
||||
r->set_sort_index(-1);
|
||||
}
|
||||
}
|
||||
_markedRegions.clear();
|
||||
void CollectionSetChooser::clear() {
|
||||
_regions.clear();
|
||||
_curr_index = 0;
|
||||
_length = 0;
|
||||
_remainingReclaimableBytes = 0;
|
||||
_remaining_reclaimable_bytes = 0;
|
||||
};
|
||||
|
@ -28,77 +28,42 @@
|
||||
#include "gc_implementation/g1/heapRegion.hpp"
|
||||
#include "utilities/growableArray.hpp"
|
||||
|
||||
class CSetChooserCache VALUE_OBJ_CLASS_SPEC {
|
||||
private:
|
||||
enum {
|
||||
CacheLength = 16
|
||||
} PrivateConstants;
|
||||
|
||||
HeapRegion* _cache[CacheLength];
|
||||
int _occupancy; // number of regions in cache
|
||||
int _first; // (index of) "first" region in the cache
|
||||
|
||||
// adding CacheLength to deal with negative values
|
||||
inline int trim_index(int index) {
|
||||
return (index + CacheLength) % CacheLength;
|
||||
}
|
||||
|
||||
inline int get_sort_index(int index) {
|
||||
return -index-2;
|
||||
}
|
||||
inline int get_index(int sort_index) {
|
||||
return -sort_index-2;
|
||||
}
|
||||
|
||||
public:
|
||||
CSetChooserCache(void);
|
||||
|
||||
inline int occupancy(void) { return _occupancy; }
|
||||
inline bool is_full() { return _occupancy == CacheLength; }
|
||||
inline bool is_empty() { return _occupancy == 0; }
|
||||
|
||||
void clear(void);
|
||||
void insert(HeapRegion *hr);
|
||||
HeapRegion *remove_first(void);
|
||||
inline HeapRegion *get_first(void) {
|
||||
return _cache[_first];
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
bool verify (void);
|
||||
bool region_in_cache(HeapRegion *hr) {
|
||||
int sort_index = hr->sort_index();
|
||||
if (sort_index < -1) {
|
||||
int index = get_index(sort_index);
|
||||
guarantee(index < CacheLength, "should be within bounds");
|
||||
return _cache[index] == hr;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
#endif // PRODUCT
|
||||
};
|
||||
|
||||
class CollectionSetChooser: public CHeapObj {
|
||||
|
||||
GrowableArray<HeapRegion*> _markedRegions;
|
||||
GrowableArray<HeapRegion*> _regions;
|
||||
|
||||
// Unfortunately, GrowableArray uses ints for length and indexes. To
|
||||
// avoid excessive casting in the rest of the class the following
|
||||
// wrapper methods are provided that use uints.
|
||||
|
||||
uint regions_length() { return (uint) _regions.length(); }
|
||||
HeapRegion* regions_at(uint i) { return _regions.at((int) i); }
|
||||
void regions_at_put(uint i, HeapRegion* hr) {
|
||||
_regions.at_put((int) i, hr);
|
||||
}
|
||||
void regions_at_put_grow(uint i, HeapRegion* hr) {
|
||||
_regions.at_put_grow((int) i, hr);
|
||||
}
|
||||
void regions_trunc_to(uint i) { _regions.trunc_to((uint) i); }
|
||||
|
||||
// The index of the next candidate old region to be considered for
|
||||
// addition to the CSet.
|
||||
int _curr_index;
|
||||
uint _curr_index;
|
||||
|
||||
// The number of candidate old regions added to the CSet chooser.
|
||||
int _length;
|
||||
uint _length;
|
||||
|
||||
CSetChooserCache _cache;
|
||||
jint _first_par_unreserved_idx;
|
||||
// Keeps track of the start of the next array chunk to be claimed by
|
||||
// parallel GC workers.
|
||||
uint _first_par_unreserved_idx;
|
||||
|
||||
// If a region has more live bytes than this threshold, it will not
|
||||
// be added to the CSet chooser and will not be a candidate for
|
||||
// collection.
|
||||
size_t _regionLiveThresholdBytes;
|
||||
size_t _region_live_threshold_bytes;
|
||||
|
||||
// The sum of reclaimable bytes over all the regions in the CSet chooser.
|
||||
size_t _remainingReclaimableBytes;
|
||||
size_t _remaining_reclaimable_bytes;
|
||||
|
||||
public:
|
||||
|
||||
@ -107,9 +72,9 @@ public:
|
||||
HeapRegion* peek() {
|
||||
HeapRegion* res = NULL;
|
||||
if (_curr_index < _length) {
|
||||
res = _markedRegions.at(_curr_index);
|
||||
res = regions_at(_curr_index);
|
||||
assert(res != NULL,
|
||||
err_msg("Unexpected NULL hr in _markedRegions at index %d",
|
||||
err_msg("Unexpected NULL hr in _regions at index %u",
|
||||
_curr_index));
|
||||
}
|
||||
return res;
|
||||
@ -121,90 +86,71 @@ public:
|
||||
void remove_and_move_to_next(HeapRegion* hr) {
|
||||
assert(hr != NULL, "pre-condition");
|
||||
assert(_curr_index < _length, "pre-condition");
|
||||
assert(_markedRegions.at(_curr_index) == hr, "pre-condition");
|
||||
hr->set_sort_index(-1);
|
||||
_markedRegions.at_put(_curr_index, NULL);
|
||||
assert(hr->reclaimable_bytes() <= _remainingReclaimableBytes,
|
||||
assert(regions_at(_curr_index) == hr, "pre-condition");
|
||||
regions_at_put(_curr_index, NULL);
|
||||
assert(hr->reclaimable_bytes() <= _remaining_reclaimable_bytes,
|
||||
err_msg("remaining reclaimable bytes inconsistent "
|
||||
"from region: "SIZE_FORMAT" remaining: "SIZE_FORMAT,
|
||||
hr->reclaimable_bytes(), _remainingReclaimableBytes));
|
||||
_remainingReclaimableBytes -= hr->reclaimable_bytes();
|
||||
hr->reclaimable_bytes(), _remaining_reclaimable_bytes));
|
||||
_remaining_reclaimable_bytes -= hr->reclaimable_bytes();
|
||||
_curr_index += 1;
|
||||
}
|
||||
|
||||
CollectionSetChooser();
|
||||
|
||||
void sortMarkedHeapRegions();
|
||||
void fillCache();
|
||||
void sort_regions();
|
||||
|
||||
// Determine whether to add the given region to the CSet chooser or
|
||||
// not. Currently, we skip humongous regions (we never add them to
|
||||
// the CSet, we only reclaim them during cleanup) and regions whose
|
||||
// live bytes are over the threshold.
|
||||
bool shouldAdd(HeapRegion* hr) {
|
||||
bool should_add(HeapRegion* hr) {
|
||||
assert(hr->is_marked(), "pre-condition");
|
||||
assert(!hr->is_young(), "should never consider young regions");
|
||||
return !hr->isHumongous() &&
|
||||
hr->live_bytes() < _regionLiveThresholdBytes;
|
||||
hr->live_bytes() < _region_live_threshold_bytes;
|
||||
}
|
||||
|
||||
// Calculate the minimum number of old regions we'll add to the CSet
|
||||
// during a mixed GC.
|
||||
size_t calcMinOldCSetLength();
|
||||
uint calc_min_old_cset_length();
|
||||
|
||||
// Calculate the maximum number of old regions we'll add to the CSet
|
||||
// during a mixed GC.
|
||||
size_t calcMaxOldCSetLength();
|
||||
uint calc_max_old_cset_length();
|
||||
|
||||
// Serial version.
|
||||
void addMarkedHeapRegion(HeapRegion *hr);
|
||||
void add_region(HeapRegion *hr);
|
||||
|
||||
// Must be called before calls to getParMarkedHeapRegionChunk.
|
||||
// "n_regions" is the number of regions, "chunkSize" the chunk size.
|
||||
void prepareForAddMarkedHeapRegionsPar(size_t n_regions, size_t chunkSize);
|
||||
// Returns the first index in a contiguous chunk of "n_regions" indexes
|
||||
// Must be called before calls to claim_array_chunk().
|
||||
// n_regions is the number of regions, chunk_size the chunk size.
|
||||
void prepare_for_par_region_addition(uint n_regions, uint chunk_size);
|
||||
// Returns the first index in a contiguous chunk of chunk_size indexes
|
||||
// that the calling thread has reserved. These must be set by the
|
||||
// calling thread using "setMarkedHeapRegion" (to NULL if necessary).
|
||||
jint getParMarkedHeapRegionChunk(jint n_regions);
|
||||
// calling thread using set_region() (to NULL if necessary).
|
||||
uint claim_array_chunk(uint chunk_size);
|
||||
// Set the marked array entry at index to hr. Careful to claim the index
|
||||
// first if in parallel.
|
||||
void setMarkedHeapRegion(jint index, HeapRegion* hr);
|
||||
void set_region(uint index, HeapRegion* hr);
|
||||
// Atomically increment the number of added regions by region_num
|
||||
// and the amount of reclaimable bytes by reclaimable_bytes.
|
||||
void updateTotals(jint region_num, size_t reclaimable_bytes);
|
||||
void update_totals(uint region_num, size_t reclaimable_bytes);
|
||||
|
||||
void clearMarkedHeapRegions();
|
||||
void clear();
|
||||
|
||||
// Return the number of candidate regions that remain to be collected.
|
||||
size_t remainingRegions() { return _length - _curr_index; }
|
||||
uint remaining_regions() { return _length - _curr_index; }
|
||||
|
||||
// Determine whether the CSet chooser has more candidate regions or not.
|
||||
bool isEmpty() { return remainingRegions() == 0; }
|
||||
bool is_empty() { return remaining_regions() == 0; }
|
||||
|
||||
// Return the reclaimable bytes that remain to be collected on
|
||||
// all the candidate regions in the CSet chooser.
|
||||
size_t remainingReclaimableBytes () { return _remainingReclaimableBytes; }
|
||||
size_t remaining_reclaimable_bytes() { return _remaining_reclaimable_bytes; }
|
||||
|
||||
// Returns true if the used portion of "_markedRegions" is properly
|
||||
// Returns true if the used portion of "_regions" is properly
|
||||
// sorted, otherwise asserts false.
|
||||
#ifndef PRODUCT
|
||||
bool verify(void);
|
||||
bool regionProperlyOrdered(HeapRegion* r) {
|
||||
int si = r->sort_index();
|
||||
if (si > -1) {
|
||||
guarantee(_curr_index <= si && si < _length,
|
||||
err_msg("curr: %d sort index: %d: length: %d",
|
||||
_curr_index, si, _length));
|
||||
guarantee(_markedRegions.at(si) == r,
|
||||
err_msg("sort index: %d at: "PTR_FORMAT" r: "PTR_FORMAT,
|
||||
si, _markedRegions.at(si), r));
|
||||
} else {
|
||||
guarantee(si == -1, err_msg("sort index: %d", si));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void verify() PRODUCT_RETURN;
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_COLLECTIONSETCHOOSER_HPP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -42,9 +42,7 @@ typedef GenericTaskQueueSet<CMTaskQueue> CMTaskQueueSet;
|
||||
class G1CMIsAliveClosure: public BoolObjectClosure {
|
||||
G1CollectedHeap* _g1;
|
||||
public:
|
||||
G1CMIsAliveClosure(G1CollectedHeap* g1) :
|
||||
_g1(g1)
|
||||
{}
|
||||
G1CMIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) { }
|
||||
|
||||
void do_object(oop obj) {
|
||||
ShouldNotCallThis();
|
||||
@ -111,11 +109,6 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
||||
return offsetToHeapWord(heapWordToOffset(addr) + 1);
|
||||
}
|
||||
|
||||
void mostly_disjoint_range_union(BitMap* from_bitmap,
|
||||
size_t from_start_index,
|
||||
HeapWord* to_start_word,
|
||||
size_t word_num);
|
||||
|
||||
// debugging
|
||||
NOT_PRODUCT(bool covers(ReservedSpace rs) const;)
|
||||
};
|
||||
@ -258,60 +251,6 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
||||
void oops_do(OopClosure* f);
|
||||
};
|
||||
|
||||
class CMRegionStack VALUE_OBJ_CLASS_SPEC {
|
||||
MemRegion* _base;
|
||||
jint _capacity;
|
||||
jint _index;
|
||||
jint _oops_do_bound;
|
||||
bool _overflow;
|
||||
public:
|
||||
CMRegionStack();
|
||||
~CMRegionStack();
|
||||
void allocate(size_t size);
|
||||
|
||||
// This is lock-free; assumes that it will only be called in parallel
|
||||
// with other "push" operations (no pops).
|
||||
void push_lock_free(MemRegion mr);
|
||||
|
||||
// Lock-free; assumes that it will only be called in parallel
|
||||
// with other "pop" operations (no pushes).
|
||||
MemRegion pop_lock_free();
|
||||
|
||||
#if 0
|
||||
// The routines that manipulate the region stack with a lock are
|
||||
// not currently used. They should be retained, however, as a
|
||||
// diagnostic aid.
|
||||
|
||||
// These two are the implementations that use a lock. They can be
|
||||
// called concurrently with each other but they should not be called
|
||||
// concurrently with the lock-free versions (push() / pop()).
|
||||
void push_with_lock(MemRegion mr);
|
||||
MemRegion pop_with_lock();
|
||||
#endif
|
||||
|
||||
bool isEmpty() { return _index == 0; }
|
||||
bool isFull() { return _index == _capacity; }
|
||||
|
||||
bool overflow() { return _overflow; }
|
||||
void clear_overflow() { _overflow = false; }
|
||||
|
||||
int size() { return _index; }
|
||||
|
||||
// It iterates over the entries in the region stack and it
|
||||
// invalidates (i.e. assigns MemRegion()) the ones that point to
|
||||
// regions in the collection set.
|
||||
bool invalidate_entries_into_cset();
|
||||
|
||||
// This gives an upper bound up to which the iteration in
|
||||
// invalidate_entries_into_cset() will reach. This prevents
|
||||
// newly-added entries to be unnecessarily scanned.
|
||||
void set_oops_do_bound() {
|
||||
_oops_do_bound = _index;
|
||||
}
|
||||
|
||||
void setEmpty() { _index = 0; clear_overflow(); }
|
||||
};
|
||||
|
||||
class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC {
|
||||
private:
|
||||
#ifndef PRODUCT
|
||||
@ -408,7 +347,6 @@ class ConcurrentMark : public CHeapObj {
|
||||
friend class ConcurrentMarkThread;
|
||||
friend class CMTask;
|
||||
friend class CMBitMapClosure;
|
||||
friend class CSetMarkOopClosure;
|
||||
friend class CMGlobalObjectClosure;
|
||||
friend class CMRemarkTask;
|
||||
friend class CMConcurrentMarkingTask;
|
||||
@ -443,7 +381,6 @@ protected:
|
||||
CMBitMap _markBitMap2;
|
||||
CMBitMapRO* _prevMarkBitMap; // completed mark bitmap
|
||||
CMBitMap* _nextMarkBitMap; // under-construction mark bitmap
|
||||
bool _at_least_one_mark_complete;
|
||||
|
||||
BitMap _region_bm;
|
||||
BitMap _card_bm;
|
||||
@ -457,7 +394,6 @@ protected:
|
||||
|
||||
// For gray objects
|
||||
CMMarkStack _markStack; // Grey objects behind global finger.
|
||||
CMRegionStack _regionStack; // Grey regions behind global finger.
|
||||
HeapWord* volatile _finger; // the global finger, region aligned,
|
||||
// always points to the end of the
|
||||
// last claimed region
|
||||
@ -502,18 +438,6 @@ protected:
|
||||
// verbose level
|
||||
CMVerboseLevel _verbose_level;
|
||||
|
||||
// These two fields are used to implement the optimisation that
|
||||
// avoids pushing objects on the global/region stack if there are
|
||||
// no collection set regions above the lowest finger.
|
||||
|
||||
// This is the lowest finger (among the global and local fingers),
|
||||
// which is calculated before a new collection set is chosen.
|
||||
HeapWord* _min_finger;
|
||||
// If this flag is true, objects/regions that are marked below the
|
||||
// finger should be pushed on the stack(s). If this is flag is
|
||||
// false, it is safe not to push them on the stack(s).
|
||||
bool _should_gray_objects;
|
||||
|
||||
// All of these times are in ms.
|
||||
NumberSeq _init_times;
|
||||
NumberSeq _remark_times;
|
||||
@ -604,7 +528,7 @@ protected:
|
||||
CMTaskQueueSet* task_queues() { return _task_queues; }
|
||||
|
||||
// Access / manipulation of the overflow flag which is set to
|
||||
// indicate that the global stack or region stack has overflown
|
||||
// indicate that the global stack has overflown
|
||||
bool has_overflown() { return _has_overflown; }
|
||||
void set_has_overflown() { _has_overflown = true; }
|
||||
void clear_has_overflown() { _has_overflown = false; }
|
||||
@ -684,68 +608,6 @@ public:
|
||||
bool mark_stack_overflow() { return _markStack.overflow(); }
|
||||
bool mark_stack_empty() { return _markStack.isEmpty(); }
|
||||
|
||||
// (Lock-free) Manipulation of the region stack
|
||||
bool region_stack_push_lock_free(MemRegion mr) {
|
||||
// Currently we only call the lock-free version during evacuation
|
||||
// pauses.
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped");
|
||||
|
||||
_regionStack.push_lock_free(mr);
|
||||
if (_regionStack.overflow()) {
|
||||
set_has_overflown();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Lock-free version of region-stack pop. Should only be
|
||||
// called in tandem with other lock-free pops.
|
||||
MemRegion region_stack_pop_lock_free() {
|
||||
return _regionStack.pop_lock_free();
|
||||
}
|
||||
|
||||
#if 0
|
||||
// The routines that manipulate the region stack with a lock are
|
||||
// not currently used. They should be retained, however, as a
|
||||
// diagnostic aid.
|
||||
|
||||
bool region_stack_push_with_lock(MemRegion mr) {
|
||||
// Currently we only call the lock-based version during either
|
||||
// concurrent marking or remark.
|
||||
assert(!SafepointSynchronize::is_at_safepoint() || !concurrent(),
|
||||
"if we are at a safepoint it should be the remark safepoint");
|
||||
|
||||
_regionStack.push_with_lock(mr);
|
||||
if (_regionStack.overflow()) {
|
||||
set_has_overflown();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MemRegion region_stack_pop_with_lock() {
|
||||
// Currently we only call the lock-based version during either
|
||||
// concurrent marking or remark.
|
||||
assert(!SafepointSynchronize::is_at_safepoint() || !concurrent(),
|
||||
"if we are at a safepoint it should be the remark safepoint");
|
||||
|
||||
return _regionStack.pop_with_lock();
|
||||
}
|
||||
#endif
|
||||
|
||||
int region_stack_size() { return _regionStack.size(); }
|
||||
bool region_stack_overflow() { return _regionStack.overflow(); }
|
||||
bool region_stack_empty() { return _regionStack.isEmpty(); }
|
||||
|
||||
// Iterate over any regions that were aborted while draining the
|
||||
// region stack (any such regions are saved in the corresponding
|
||||
// CMTask) and invalidate (i.e. assign to the empty MemRegion())
|
||||
// any regions that point into the collection set.
|
||||
bool invalidate_aborted_regions_in_cset();
|
||||
|
||||
// Returns true if there are any aborted memory regions.
|
||||
bool has_aborted_regions();
|
||||
|
||||
CMRootRegions* root_regions() { return &_root_regions; }
|
||||
|
||||
bool concurrent_marking_in_progress() {
|
||||
@ -774,11 +636,7 @@ public:
|
||||
return _task_queues->steal(task_num, hash_seed, obj);
|
||||
}
|
||||
|
||||
// It grays an object by first marking it. Then, if it's behind the
|
||||
// global finger, it also pushes it on the global stack.
|
||||
void deal_with_reference(oop obj);
|
||||
|
||||
ConcurrentMark(ReservedSpace rs, int max_regions);
|
||||
ConcurrentMark(ReservedSpace rs, uint max_regions);
|
||||
~ConcurrentMark();
|
||||
|
||||
ConcurrentMarkThread* cmThread() { return _cmThread; }
|
||||
@ -810,22 +668,6 @@ public:
|
||||
inline void grayRoot(oop obj, size_t word_size,
|
||||
uint worker_id, HeapRegion* hr = NULL);
|
||||
|
||||
// It's used during evacuation pauses to gray a region, if
|
||||
// necessary, and it's MT-safe. It assumes that the caller has
|
||||
// marked any objects on that region. If _should_gray_objects is
|
||||
// true and we're still doing concurrent marking, the region is
|
||||
// pushed on the region stack, if it is located below the global
|
||||
// finger, otherwise we do nothing.
|
||||
void grayRegionIfNecessary(MemRegion mr);
|
||||
|
||||
// It's used during evacuation pauses to mark and, if necessary,
|
||||
// gray a single object and it's MT-safe. It assumes the caller did
|
||||
// not mark the object. If _should_gray_objects is true and we're
|
||||
// still doing concurrent marking, the objects is pushed on the
|
||||
// global stack, if it is located below the global finger, otherwise
|
||||
// we do nothing.
|
||||
void markAndGrayObjectIfNecessary(oop p);
|
||||
|
||||
// It iterates over the heap and for each object it comes across it
|
||||
// will dump the contents of its reference fields, as well as
|
||||
// liveness information for the object and its referents. The dump
|
||||
@ -869,10 +711,6 @@ public:
|
||||
// Do concurrent phase of marking, to a tentative transitive closure.
|
||||
void markFromRoots();
|
||||
|
||||
// Process all unprocessed SATB buffers. It is called at the
|
||||
// beginning of an evacuation pause.
|
||||
void drainAllSATBBuffers();
|
||||
|
||||
void checkpointRootsFinal(bool clear_all_soft_refs);
|
||||
void checkpointRootsFinalWork();
|
||||
void cleanup();
|
||||
@ -899,10 +737,6 @@ public:
|
||||
_markStack.note_end_of_gc();
|
||||
}
|
||||
|
||||
// Iterate over the oops in the mark stack and all local queues. It
|
||||
// also calls invalidate_entries_into_cset() on the region stack.
|
||||
void oops_do(OopClosure* f);
|
||||
|
||||
// Verify that there are no CSet oops on the stacks (taskqueues /
|
||||
// global mark stack), enqueued SATB buffers, per-thread SATB
|
||||
// buffers, and fingers (global / per-task). The boolean parameters
|
||||
@ -919,40 +753,6 @@ public:
|
||||
// unless the force parameter is true.
|
||||
void update_g1_committed(bool force = false);
|
||||
|
||||
void complete_marking_in_collection_set();
|
||||
|
||||
// It indicates that a new collection set is being chosen.
|
||||
void newCSet();
|
||||
|
||||
// It registers a collection set heap region with CM. This is used
|
||||
// to determine whether any heap regions are located above the finger.
|
||||
void registerCSetRegion(HeapRegion* hr);
|
||||
|
||||
// Resets the region fields of any active CMTask whose region fields
|
||||
// are in the collection set (i.e. the region currently claimed by
|
||||
// the CMTask will be evacuated and may be used, subsequently, as
|
||||
// an alloc region). When this happens the region fields in the CMTask
|
||||
// are stale and, hence, should be cleared causing the worker thread
|
||||
// to claim a new region.
|
||||
void reset_active_task_region_fields_in_cset();
|
||||
|
||||
// Registers the maximum region-end associated with a set of
|
||||
// regions with CM. Again this is used to determine whether any
|
||||
// heap regions are located above the finger.
|
||||
void register_collection_set_finger(HeapWord* max_finger) {
|
||||
// max_finger is the highest heap region end of the regions currently
|
||||
// contained in the collection set. If this value is larger than
|
||||
// _min_finger then we need to gray objects.
|
||||
// This routine is like registerCSetRegion but for an entire
|
||||
// collection of regions.
|
||||
if (max_finger > _min_finger) {
|
||||
_should_gray_objects = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns "true" if at least one mark has been completed.
|
||||
bool at_least_one_mark_complete() { return _at_least_one_mark_complete; }
|
||||
|
||||
bool isMarked(oop p) const {
|
||||
assert(p != NULL && p->is_oop(), "expected an oop");
|
||||
HeapWord* addr = (HeapWord*)p;
|
||||
@ -1164,23 +964,6 @@ private:
|
||||
// limit of the region this task is scanning, NULL if we're not scanning one
|
||||
HeapWord* _region_limit;
|
||||
|
||||
// This is used only when we scan regions popped from the region
|
||||
// stack. It records what the last object on such a region we
|
||||
// scanned was. It is used to ensure that, if we abort region
|
||||
// iteration, we do not rescan the first part of the region. This
|
||||
// should be NULL when we're not scanning a region from the region
|
||||
// stack.
|
||||
HeapWord* _region_finger;
|
||||
|
||||
// If we abort while scanning a region we record the remaining
|
||||
// unscanned portion and check this field when marking restarts.
|
||||
// This avoids having to push on the region stack while other
|
||||
// marking threads may still be popping regions.
|
||||
// If we were to push the unscanned portion directly to the
|
||||
// region stack then we would need to using locking versions
|
||||
// of the push and pop operations.
|
||||
MemRegion _aborted_region;
|
||||
|
||||
// the number of words this task has scanned
|
||||
size_t _words_scanned;
|
||||
// When _words_scanned reaches this limit, the regular clock is
|
||||
@ -1268,8 +1051,6 @@ private:
|
||||
int _global_transfers_to;
|
||||
int _global_transfers_from;
|
||||
|
||||
int _region_stack_pops;
|
||||
|
||||
int _regions_claimed;
|
||||
int _objs_found_on_bitmap;
|
||||
|
||||
@ -1347,15 +1128,6 @@ public:
|
||||
bool has_timed_out() { return _has_timed_out; }
|
||||
bool claimed() { return _claimed; }
|
||||
|
||||
// Support routines for the partially scanned region that may be
|
||||
// recorded as a result of aborting while draining the CMRegionStack
|
||||
MemRegion aborted_region() { return _aborted_region; }
|
||||
void set_aborted_region(MemRegion mr)
|
||||
{ _aborted_region = mr; }
|
||||
|
||||
// Clears any recorded partially scanned region
|
||||
void clear_aborted_region() { set_aborted_region(MemRegion()); }
|
||||
|
||||
void set_cm_oop_closure(G1CMOopClosure* cm_oop_closure);
|
||||
|
||||
// It grays the object by marking it and, if necessary, pushing it
|
||||
@ -1385,22 +1157,12 @@ public:
|
||||
// buffers are available.
|
||||
void drain_satb_buffers();
|
||||
|
||||
// It keeps popping regions from the region stack and processing
|
||||
// them until the region stack is empty.
|
||||
void drain_region_stack(BitMapClosure* closure);
|
||||
|
||||
// moves the local finger to a new location
|
||||
inline void move_finger_to(HeapWord* new_finger) {
|
||||
assert(new_finger >= _finger && new_finger < _region_limit, "invariant");
|
||||
_finger = new_finger;
|
||||
}
|
||||
|
||||
// moves the region finger to a new location
|
||||
inline void move_region_finger_to(HeapWord* new_finger) {
|
||||
assert(new_finger < _cm->finger(), "invariant");
|
||||
_region_finger = new_finger;
|
||||
}
|
||||
|
||||
CMTask(int task_num, ConcurrentMark *cm,
|
||||
size_t* marked_bytes, BitMap* card_bm,
|
||||
CMTaskQueue* task_queue, CMTaskQueueSet* task_queues);
|
||||
|
@ -49,7 +49,7 @@ inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
|
||||
HeapWord* start = mr.start();
|
||||
HeapWord* last = mr.last();
|
||||
size_t region_size_bytes = mr.byte_size();
|
||||
size_t index = hr->hrs_index();
|
||||
uint index = hr->hrs_index();
|
||||
|
||||
assert(!hr->continuesHumongous(), "should not be HC region");
|
||||
assert(hr == g1h->heap_region_containing(start), "sanity");
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
|
||||
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
|
||||
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
||||
#include "gc_implementation/g1/g1Log.hpp"
|
||||
#include "gc_implementation/g1/g1MMUTracker.hpp"
|
||||
#include "gc_implementation/g1/vm_operations_g1.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
@ -104,7 +105,7 @@ void ConcurrentMarkThread::run() {
|
||||
|
||||
double scan_start = os::elapsedTime();
|
||||
if (!cm()->has_aborted()) {
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]");
|
||||
@ -113,7 +114,7 @@ void ConcurrentMarkThread::run() {
|
||||
_cm->scanRootRegions();
|
||||
|
||||
double scan_end = os::elapsedTime();
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf]",
|
||||
@ -122,7 +123,7 @@ void ConcurrentMarkThread::run() {
|
||||
}
|
||||
|
||||
double mark_start_sec = os::elapsedTime();
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-mark-start]");
|
||||
@ -146,7 +147,7 @@ void ConcurrentMarkThread::run() {
|
||||
os::sleep(current_thread, sleep_time_ms, false);
|
||||
}
|
||||
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-mark-end, %1.7lf sec]",
|
||||
@ -165,7 +166,7 @@ void ConcurrentMarkThread::run() {
|
||||
}
|
||||
|
||||
if (cm()->restart_for_overflow()) {
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-mark-restart-for-overflow]");
|
||||
@ -211,7 +212,7 @@ void ConcurrentMarkThread::run() {
|
||||
// reclaimed by cleanup.
|
||||
|
||||
double cleanup_start_sec = os::elapsedTime();
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-cleanup-start]");
|
||||
@ -232,7 +233,7 @@ void ConcurrentMarkThread::run() {
|
||||
g1h->reset_free_regions_coming();
|
||||
|
||||
double cleanup_end_sec = os::elapsedTime();
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf]",
|
||||
@ -273,7 +274,7 @@ void ConcurrentMarkThread::run() {
|
||||
_sts.leave();
|
||||
|
||||
if (cm()->has_aborted()) {
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
gclog_or_tty->date_stamp(PrintGCDateStamps);
|
||||
gclog_or_tty->stamp(PrintGCTimeStamps);
|
||||
gclog_or_tty->print_cr("[GC concurrent-mark-abort]");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -140,7 +140,7 @@ HeapWord* G1AllocRegion::new_alloc_region_and_allocate(size_t word_size,
|
||||
}
|
||||
|
||||
void G1AllocRegion::fill_in_ext_msg(ar_ext_msg* msg, const char* message) {
|
||||
msg->append("[%s] %s c: "SIZE_FORMAT" b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT,
|
||||
msg->append("[%s] %s c: %u b: %s r: "PTR_FORMAT" u: "SIZE_FORMAT,
|
||||
_name, message, _count, BOOL_TO_STR(_bot_updates),
|
||||
_alloc_region, _used_bytes_before);
|
||||
}
|
||||
@ -215,7 +215,7 @@ void G1AllocRegion::trace(const char* str, size_t word_size, HeapWord* result) {
|
||||
jio_snprintf(rest_buffer, buffer_length, "");
|
||||
}
|
||||
|
||||
tty->print_cr("[%s] "SIZE_FORMAT" %s : %s %s",
|
||||
tty->print_cr("[%s] %u %s : %s %s",
|
||||
_name, _count, hr_buffer, str, rest_buffer);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,7 +64,7 @@ private:
|
||||
// the region that is re-used using the set() method. This count can
|
||||
// be used in any heuristics that might want to bound how many
|
||||
// distinct regions this object can used during an active interval.
|
||||
size_t _count;
|
||||
uint _count;
|
||||
|
||||
// When we set up a new active region we save its used bytes in this
|
||||
// field so that, when we retire it, we can calculate how much space
|
||||
@ -136,7 +136,7 @@ public:
|
||||
return (_alloc_region == _dummy_region) ? NULL : _alloc_region;
|
||||
}
|
||||
|
||||
size_t count() { return _count; }
|
||||
uint count() { return _count; }
|
||||
|
||||
// The following two are the building blocks for the allocation method.
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
||||
#include "gc_implementation/g1/g1ErgoVerbose.hpp"
|
||||
#include "gc_implementation/g1/g1EvacFailure.hpp"
|
||||
#include "gc_implementation/g1/g1Log.hpp"
|
||||
#include "gc_implementation/g1/g1MarkSweep.hpp"
|
||||
#include "gc_implementation/g1/g1OopClosures.inline.hpp"
|
||||
#include "gc_implementation/g1/g1RemSet.inline.hpp"
|
||||
@ -233,7 +234,7 @@ void YoungList::empty_list() {
|
||||
bool YoungList::check_list_well_formed() {
|
||||
bool ret = true;
|
||||
|
||||
size_t length = 0;
|
||||
uint length = 0;
|
||||
HeapRegion* curr = _head;
|
||||
HeapRegion* last = NULL;
|
||||
while (curr != NULL) {
|
||||
@ -252,7 +253,7 @@ bool YoungList::check_list_well_formed() {
|
||||
|
||||
if (!ret) {
|
||||
gclog_or_tty->print_cr("### YOUNG LIST seems not well formed!");
|
||||
gclog_or_tty->print_cr("### list has %d entries, _length is %d",
|
||||
gclog_or_tty->print_cr("### list has %u entries, _length is %u",
|
||||
length, _length);
|
||||
}
|
||||
|
||||
@ -263,7 +264,7 @@ bool YoungList::check_list_empty(bool check_sample) {
|
||||
bool ret = true;
|
||||
|
||||
if (_length != 0) {
|
||||
gclog_or_tty->print_cr("### YOUNG LIST should have 0 length, not %d",
|
||||
gclog_or_tty->print_cr("### YOUNG LIST should have 0 length, not %u",
|
||||
_length);
|
||||
ret = false;
|
||||
}
|
||||
@ -336,8 +337,7 @@ YoungList::reset_auxilary_lists() {
|
||||
_g1h->g1_policy()->add_region_to_incremental_cset_rhs(curr);
|
||||
young_index_in_cset += 1;
|
||||
}
|
||||
assert((size_t) young_index_in_cset == _survivor_length,
|
||||
"post-condition");
|
||||
assert((uint) young_index_in_cset == _survivor_length, "post-condition");
|
||||
_g1h->g1_policy()->note_stop_adding_survivor_regions();
|
||||
|
||||
_head = _survivor_head;
|
||||
@ -532,7 +532,7 @@ G1CollectedHeap::new_region_try_secondary_free_list() {
|
||||
if (!_secondary_free_list.is_empty()) {
|
||||
if (G1ConcRegionFreeingVerbose) {
|
||||
gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : "
|
||||
"secondary_free_list has "SIZE_FORMAT" entries",
|
||||
"secondary_free_list has %u entries",
|
||||
_secondary_free_list.length());
|
||||
}
|
||||
// It looks as if there are free regions available on the
|
||||
@ -618,12 +618,12 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool do_expand) {
|
||||
return res;
|
||||
}
|
||||
|
||||
size_t G1CollectedHeap::humongous_obj_allocate_find_first(size_t num_regions,
|
||||
size_t word_size) {
|
||||
uint G1CollectedHeap::humongous_obj_allocate_find_first(uint num_regions,
|
||||
size_t word_size) {
|
||||
assert(isHumongous(word_size), "word_size should be humongous");
|
||||
assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
|
||||
|
||||
size_t first = G1_NULL_HRS_INDEX;
|
||||
uint first = G1_NULL_HRS_INDEX;
|
||||
if (num_regions == 1) {
|
||||
// Only one region to allocate, no need to go through the slower
|
||||
// path. The caller will attempt the expasion if this fails, so
|
||||
@ -649,7 +649,7 @@ size_t G1CollectedHeap::humongous_obj_allocate_find_first(size_t num_regions,
|
||||
if (free_regions() >= num_regions) {
|
||||
first = _hrs.find_contiguous(num_regions);
|
||||
if (first != G1_NULL_HRS_INDEX) {
|
||||
for (size_t i = first; i < first + num_regions; ++i) {
|
||||
for (uint i = first; i < first + num_regions; ++i) {
|
||||
HeapRegion* hr = region_at(i);
|
||||
assert(hr->is_empty(), "sanity");
|
||||
assert(is_on_master_free_list(hr), "sanity");
|
||||
@ -663,15 +663,15 @@ size_t G1CollectedHeap::humongous_obj_allocate_find_first(size_t num_regions,
|
||||
}
|
||||
|
||||
HeapWord*
|
||||
G1CollectedHeap::humongous_obj_allocate_initialize_regions(size_t first,
|
||||
size_t num_regions,
|
||||
G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
|
||||
uint num_regions,
|
||||
size_t word_size) {
|
||||
assert(first != G1_NULL_HRS_INDEX, "pre-condition");
|
||||
assert(isHumongous(word_size), "word_size should be humongous");
|
||||
assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
|
||||
|
||||
// Index of last region in the series + 1.
|
||||
size_t last = first + num_regions;
|
||||
uint last = first + num_regions;
|
||||
|
||||
// We need to initialize the region(s) we just discovered. This is
|
||||
// a bit tricky given that it can happen concurrently with
|
||||
@ -682,7 +682,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(size_t first,
|
||||
// a specific order.
|
||||
|
||||
// The word size sum of all the regions we will allocate.
|
||||
size_t word_size_sum = num_regions * HeapRegion::GrainWords;
|
||||
size_t word_size_sum = (size_t) num_regions * HeapRegion::GrainWords;
|
||||
assert(word_size <= word_size_sum, "sanity");
|
||||
|
||||
// This will be the "starts humongous" region.
|
||||
@ -721,7 +721,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(size_t first,
|
||||
// Then, if there are any, we will set up the "continues
|
||||
// humongous" regions.
|
||||
HeapRegion* hr = NULL;
|
||||
for (size_t i = first + 1; i < last; ++i) {
|
||||
for (uint i = first + 1; i < last; ++i) {
|
||||
hr = region_at(i);
|
||||
hr->set_continuesHumongous(first_hr);
|
||||
}
|
||||
@ -767,7 +767,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(size_t first,
|
||||
// last one) is actually used when we will free up the humongous
|
||||
// region in free_humongous_region().
|
||||
hr = NULL;
|
||||
for (size_t i = first + 1; i < last; ++i) {
|
||||
for (uint i = first + 1; i < last; ++i) {
|
||||
hr = region_at(i);
|
||||
if ((i + 1) == last) {
|
||||
// last continues humongous region
|
||||
@ -803,14 +803,14 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) {
|
||||
|
||||
verify_region_sets_optional();
|
||||
|
||||
size_t num_regions =
|
||||
round_to(word_size, HeapRegion::GrainWords) / HeapRegion::GrainWords;
|
||||
size_t x_size = expansion_regions();
|
||||
size_t fs = _hrs.free_suffix();
|
||||
size_t first = humongous_obj_allocate_find_first(num_regions, word_size);
|
||||
size_t word_size_rounded = round_to(word_size, HeapRegion::GrainWords);
|
||||
uint num_regions = (uint) (word_size_rounded / HeapRegion::GrainWords);
|
||||
uint x_num = expansion_regions();
|
||||
uint fs = _hrs.free_suffix();
|
||||
uint first = humongous_obj_allocate_find_first(num_regions, word_size);
|
||||
if (first == G1_NULL_HRS_INDEX) {
|
||||
// The only thing we can do now is attempt expansion.
|
||||
if (fs + x_size >= num_regions) {
|
||||
if (fs + x_num >= num_regions) {
|
||||
// If the number of regions we're trying to allocate for this
|
||||
// object is at most the number of regions in the free suffix,
|
||||
// then the call to humongous_obj_allocate_find_first() above
|
||||
@ -1255,10 +1255,10 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
||||
// Timing
|
||||
bool system_gc = (gc_cause() == GCCause::_java_lang_system_gc);
|
||||
assert(!system_gc || explicit_gc, "invariant");
|
||||
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||
TraceTime t(system_gc ? "Full GC (System.gc())" : "Full GC",
|
||||
PrintGC, true, gclog_or_tty);
|
||||
G1Log::fine(), true, gclog_or_tty);
|
||||
|
||||
TraceCollectorStats tcs(g1mm()->full_collection_counters());
|
||||
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
|
||||
@ -1290,8 +1290,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
gclog_or_tty->print(" VerifyBeforeGC:");
|
||||
prepare_for_verify();
|
||||
Universe::verify(/* allow dirty */ true,
|
||||
/* silent */ false,
|
||||
Universe::verify(/* silent */ false,
|
||||
/* option */ VerifyOption_G1UsePrevMarking);
|
||||
|
||||
}
|
||||
@ -1365,8 +1364,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
gclog_or_tty->print(" VerifyAfterGC:");
|
||||
prepare_for_verify();
|
||||
Universe::verify(/* allow dirty */ false,
|
||||
/* silent */ false,
|
||||
Universe::verify(/* silent */ false,
|
||||
/* option */ VerifyOption_G1UsePrevMarking);
|
||||
|
||||
}
|
||||
@ -1444,7 +1442,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
||||
heap_region_iterate(&rebuild_rs);
|
||||
}
|
||||
|
||||
if (PrintGC) {
|
||||
if (G1Log::fine()) {
|
||||
print_size_transition(gclog_or_tty, g1h_prev_used, used(), capacity());
|
||||
}
|
||||
|
||||
@ -1782,7 +1780,7 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) {
|
||||
ReservedSpace::page_align_size_down(shrink_bytes);
|
||||
aligned_shrink_bytes = align_size_down(aligned_shrink_bytes,
|
||||
HeapRegion::GrainBytes);
|
||||
size_t num_regions_deleted = 0;
|
||||
uint num_regions_deleted = 0;
|
||||
MemRegion mr = _hrs.shrink_by(aligned_shrink_bytes, &num_regions_deleted);
|
||||
HeapWord* old_end = (HeapWord*) _g1_storage.high();
|
||||
assert(mr.end() == old_end, "post-condition");
|
||||
@ -1917,6 +1915,8 @@ jint G1CollectedHeap::initialize() {
|
||||
CollectedHeap::pre_initialize();
|
||||
os::enable_vtime();
|
||||
|
||||
G1Log::init();
|
||||
|
||||
// Necessary to satisfy locking discipline assertions.
|
||||
|
||||
MutexLocker x(Heap_lock);
|
||||
@ -2003,7 +2003,7 @@ jint G1CollectedHeap::initialize() {
|
||||
_reserved.set_start((HeapWord*)heap_rs.base());
|
||||
_reserved.set_end((HeapWord*)(heap_rs.base() + heap_rs.size()));
|
||||
|
||||
_expansion_regions = max_byte_size/HeapRegion::GrainBytes;
|
||||
_expansion_regions = (uint) (max_byte_size / HeapRegion::GrainBytes);
|
||||
|
||||
// Create the gen rem set (and barrier set) for the entire reserved region.
|
||||
_rem_set = collector_policy()->create_rem_set(_reserved, 2);
|
||||
@ -2040,7 +2040,7 @@ jint G1CollectedHeap::initialize() {
|
||||
|
||||
// 6843694 - ensure that the maximum region index can fit
|
||||
// in the remembered set structures.
|
||||
const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1;
|
||||
const uint max_region_idx = (1U << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1;
|
||||
guarantee((max_regions() - 1) <= max_region_idx, "too many regions");
|
||||
|
||||
size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
|
||||
@ -2056,13 +2056,14 @@ jint G1CollectedHeap::initialize() {
|
||||
_g1h = this;
|
||||
|
||||
_in_cset_fast_test_length = max_regions();
|
||||
_in_cset_fast_test_base = NEW_C_HEAP_ARRAY(bool, _in_cset_fast_test_length);
|
||||
_in_cset_fast_test_base =
|
||||
NEW_C_HEAP_ARRAY(bool, (size_t) _in_cset_fast_test_length);
|
||||
|
||||
// We're biasing _in_cset_fast_test to avoid subtracting the
|
||||
// beginning of the heap every time we want to index; basically
|
||||
// it's the same with what we do with the card table.
|
||||
_in_cset_fast_test = _in_cset_fast_test_base -
|
||||
((size_t) _g1_reserved.start() >> HeapRegion::LogOfHRGrainBytes);
|
||||
((uintx) _g1_reserved.start() >> HeapRegion::LogOfHRGrainBytes);
|
||||
|
||||
// Clear the _cset_fast_test bitmap in anticipation of adding
|
||||
// regions to the incremental collection set for the first
|
||||
@ -2071,7 +2072,7 @@ jint G1CollectedHeap::initialize() {
|
||||
|
||||
// Create the ConcurrentMark data structure and thread.
|
||||
// (Must do this late, so that "max_regions" is defined.)
|
||||
_cm = new ConcurrentMark(heap_rs, (int) max_regions());
|
||||
_cm = new ConcurrentMark(heap_rs, max_regions());
|
||||
_cmThread = _cm->cmThread();
|
||||
|
||||
// Initialize the from_card cache structure of HeapRegionRemSet.
|
||||
@ -2580,7 +2581,7 @@ G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
|
||||
uint worker,
|
||||
uint no_of_par_workers,
|
||||
jint claim_value) {
|
||||
const size_t regions = n_regions();
|
||||
const uint regions = n_regions();
|
||||
const uint max_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
|
||||
no_of_par_workers :
|
||||
1);
|
||||
@ -2588,11 +2589,11 @@ G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
|
||||
no_of_par_workers == workers()->total_workers(),
|
||||
"Non dynamic should use fixed number of workers");
|
||||
// try to spread out the starting points of the workers
|
||||
const size_t start_index = regions / max_workers * (size_t) worker;
|
||||
const uint start_index = regions / max_workers * worker;
|
||||
|
||||
// each worker will actually look at all regions
|
||||
for (size_t count = 0; count < regions; ++count) {
|
||||
const size_t index = (start_index + count) % regions;
|
||||
for (uint count = 0; count < regions; ++count) {
|
||||
const uint index = (start_index + count) % regions;
|
||||
assert(0 <= index && index < regions, "sanity");
|
||||
HeapRegion* r = region_at(index);
|
||||
// we'll ignore "continues humongous" regions (we'll process them
|
||||
@ -2614,7 +2615,7 @@ G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
|
||||
// result, we might end up processing them twice. So, we'll do
|
||||
// them first (notice: most closures will ignore them anyway) and
|
||||
// then we'll do the "starts humongous" region.
|
||||
for (size_t ch_index = index + 1; ch_index < regions; ++ch_index) {
|
||||
for (uint ch_index = index + 1; ch_index < regions; ++ch_index) {
|
||||
HeapRegion* chr = region_at(ch_index);
|
||||
|
||||
// if the region has already been claimed or it's not
|
||||
@ -2682,8 +2683,9 @@ void G1CollectedHeap::reset_cset_heap_region_claim_values() {
|
||||
class CheckClaimValuesClosure : public HeapRegionClosure {
|
||||
private:
|
||||
jint _claim_value;
|
||||
size_t _failures;
|
||||
uint _failures;
|
||||
HeapRegion* _sh_region;
|
||||
|
||||
public:
|
||||
CheckClaimValuesClosure(jint claim_value) :
|
||||
_claim_value(claim_value), _failures(0), _sh_region(NULL) { }
|
||||
@ -2711,9 +2713,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
size_t failures() {
|
||||
return _failures;
|
||||
}
|
||||
uint failures() { return _failures; }
|
||||
};
|
||||
|
||||
bool G1CollectedHeap::check_heap_region_claim_values(jint claim_value) {
|
||||
@ -2723,17 +2723,15 @@ bool G1CollectedHeap::check_heap_region_claim_values(jint claim_value) {
|
||||
}
|
||||
|
||||
class CheckClaimValuesInCSetHRClosure: public HeapRegionClosure {
|
||||
jint _claim_value;
|
||||
size_t _failures;
|
||||
private:
|
||||
jint _claim_value;
|
||||
uint _failures;
|
||||
|
||||
public:
|
||||
CheckClaimValuesInCSetHRClosure(jint claim_value) :
|
||||
_claim_value(claim_value),
|
||||
_failures(0) { }
|
||||
_claim_value(claim_value), _failures(0) { }
|
||||
|
||||
size_t failures() {
|
||||
return _failures;
|
||||
}
|
||||
uint failures() { return _failures; }
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
assert(hr->in_collection_set(), "how?");
|
||||
@ -2800,14 +2798,14 @@ HeapRegion* G1CollectedHeap::start_cset_region_for_worker(int worker_i) {
|
||||
|
||||
result = g1_policy()->collection_set();
|
||||
if (G1CollectedHeap::use_parallel_gc_threads()) {
|
||||
size_t cs_size = g1_policy()->cset_region_length();
|
||||
uint cs_size = g1_policy()->cset_region_length();
|
||||
uint active_workers = workers()->active_workers();
|
||||
assert(UseDynamicNumberOfGCThreads ||
|
||||
active_workers == workers()->total_workers(),
|
||||
"Unless dynamic should use total workers");
|
||||
|
||||
size_t end_ind = (cs_size * worker_i) / active_workers;
|
||||
size_t start_ind = 0;
|
||||
uint end_ind = (cs_size * worker_i) / active_workers;
|
||||
uint start_ind = 0;
|
||||
|
||||
if (worker_i > 0 &&
|
||||
_worker_cset_start_region_time_stamp[worker_i - 1] == gc_time_stamp) {
|
||||
@ -2817,7 +2815,7 @@ HeapRegion* G1CollectedHeap::start_cset_region_for_worker(int worker_i) {
|
||||
result = _worker_cset_start_region[worker_i - 1];
|
||||
}
|
||||
|
||||
for (size_t i = start_ind; i < end_ind; i++) {
|
||||
for (uint i = start_ind; i < end_ind; i++) {
|
||||
result = result->next_in_collection_set();
|
||||
}
|
||||
}
|
||||
@ -3033,7 +3031,6 @@ public:
|
||||
|
||||
class VerifyRegionClosure: public HeapRegionClosure {
|
||||
private:
|
||||
bool _allow_dirty;
|
||||
bool _par;
|
||||
VerifyOption _vo;
|
||||
bool _failures;
|
||||
@ -3041,9 +3038,8 @@ public:
|
||||
// _vo == UsePrevMarking -> use "prev" marking information,
|
||||
// _vo == UseNextMarking -> use "next" marking information,
|
||||
// _vo == UseMarkWord -> use mark word from object header.
|
||||
VerifyRegionClosure(bool allow_dirty, bool par, VerifyOption vo)
|
||||
: _allow_dirty(allow_dirty),
|
||||
_par(par),
|
||||
VerifyRegionClosure(bool par, VerifyOption vo)
|
||||
: _par(par),
|
||||
_vo(vo),
|
||||
_failures(false) {}
|
||||
|
||||
@ -3056,7 +3052,7 @@ public:
|
||||
"Should be unclaimed at verify points.");
|
||||
if (!r->continuesHumongous()) {
|
||||
bool failures = false;
|
||||
r->verify(_allow_dirty, _vo, &failures);
|
||||
r->verify(_vo, &failures);
|
||||
if (failures) {
|
||||
_failures = true;
|
||||
} else {
|
||||
@ -3124,7 +3120,6 @@ public:
|
||||
class G1ParVerifyTask: public AbstractGangTask {
|
||||
private:
|
||||
G1CollectedHeap* _g1h;
|
||||
bool _allow_dirty;
|
||||
VerifyOption _vo;
|
||||
bool _failures;
|
||||
|
||||
@ -3132,10 +3127,9 @@ public:
|
||||
// _vo == UsePrevMarking -> use "prev" marking information,
|
||||
// _vo == UseNextMarking -> use "next" marking information,
|
||||
// _vo == UseMarkWord -> use mark word from object header.
|
||||
G1ParVerifyTask(G1CollectedHeap* g1h, bool allow_dirty, VerifyOption vo) :
|
||||
G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) :
|
||||
AbstractGangTask("Parallel verify task"),
|
||||
_g1h(g1h),
|
||||
_allow_dirty(allow_dirty),
|
||||
_vo(vo),
|
||||
_failures(false) { }
|
||||
|
||||
@ -3145,7 +3139,7 @@ public:
|
||||
|
||||
void work(uint worker_id) {
|
||||
HandleMark hm;
|
||||
VerifyRegionClosure blk(_allow_dirty, true, _vo);
|
||||
VerifyRegionClosure blk(true, _vo);
|
||||
_g1h->heap_region_par_iterate_chunked(&blk, worker_id,
|
||||
_g1h->workers()->active_workers(),
|
||||
HeapRegion::ParVerifyClaimValue);
|
||||
@ -3155,12 +3149,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void G1CollectedHeap::verify(bool allow_dirty, bool silent) {
|
||||
verify(allow_dirty, silent, VerifyOption_G1UsePrevMarking);
|
||||
void G1CollectedHeap::verify(bool silent) {
|
||||
verify(silent, VerifyOption_G1UsePrevMarking);
|
||||
}
|
||||
|
||||
void G1CollectedHeap::verify(bool allow_dirty,
|
||||
bool silent,
|
||||
void G1CollectedHeap::verify(bool silent,
|
||||
VerifyOption vo) {
|
||||
if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) {
|
||||
if (!silent) { gclog_or_tty->print("Roots (excluding permgen) "); }
|
||||
@ -3212,7 +3205,7 @@ void G1CollectedHeap::verify(bool allow_dirty,
|
||||
assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
|
||||
"sanity check");
|
||||
|
||||
G1ParVerifyTask task(this, allow_dirty, vo);
|
||||
G1ParVerifyTask task(this, vo);
|
||||
assert(UseDynamicNumberOfGCThreads ||
|
||||
workers()->active_workers() == workers()->total_workers(),
|
||||
"If not dynamic should be using all the workers");
|
||||
@ -3234,7 +3227,7 @@ void G1CollectedHeap::verify(bool allow_dirty,
|
||||
assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),
|
||||
"sanity check");
|
||||
} else {
|
||||
VerifyRegionClosure blk(allow_dirty, false, vo);
|
||||
VerifyRegionClosure blk(false, vo);
|
||||
heap_region_iterate(&blk);
|
||||
if (blk.failures()) {
|
||||
failures = true;
|
||||
@ -3284,12 +3277,12 @@ void G1CollectedHeap::print_on(outputStream* st) const {
|
||||
_g1_storage.high_boundary());
|
||||
st->cr();
|
||||
st->print(" region size " SIZE_FORMAT "K, ", HeapRegion::GrainBytes / K);
|
||||
size_t young_regions = _young_list->length();
|
||||
st->print(SIZE_FORMAT " young (" SIZE_FORMAT "K), ",
|
||||
young_regions, young_regions * HeapRegion::GrainBytes / K);
|
||||
size_t survivor_regions = g1_policy()->recorded_survivor_regions();
|
||||
st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)",
|
||||
survivor_regions, survivor_regions * HeapRegion::GrainBytes / K);
|
||||
uint young_regions = _young_list->length();
|
||||
st->print("%u young (" SIZE_FORMAT "K), ", young_regions,
|
||||
(size_t) young_regions * HeapRegion::GrainBytes / K);
|
||||
uint survivor_regions = g1_policy()->recorded_survivor_regions();
|
||||
st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions,
|
||||
(size_t) survivor_regions * HeapRegion::GrainBytes / K);
|
||||
st->cr();
|
||||
perm()->as_gen()->print_on(st);
|
||||
}
|
||||
@ -3299,7 +3292,11 @@ void G1CollectedHeap::print_extended_on(outputStream* st) const {
|
||||
|
||||
// Print the per-region information.
|
||||
st->cr();
|
||||
st->print_cr("Heap Regions: (Y=young(eden), SU=young(survivor), HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TS=gc time stamp, PTAMS=previous top-at-mark-start, NTAMS=next top-at-mark-start)");
|
||||
st->print_cr("Heap Regions: (Y=young(eden), SU=young(survivor), "
|
||||
"HS=humongous(starts), HC=humongous(continues), "
|
||||
"CS=collection set, F=free, TS=gc time stamp, "
|
||||
"PTAMS=previous top-at-mark-start, "
|
||||
"NTAMS=next top-at-mark-start)");
|
||||
PrintRegionClosure blk(st);
|
||||
heap_region_iterate(&blk);
|
||||
}
|
||||
@ -3477,16 +3474,16 @@ size_t G1CollectedHeap::cards_scanned() {
|
||||
|
||||
void
|
||||
G1CollectedHeap::setup_surviving_young_words() {
|
||||
guarantee( _surviving_young_words == NULL, "pre-condition" );
|
||||
size_t array_length = g1_policy()->young_cset_region_length();
|
||||
_surviving_young_words = NEW_C_HEAP_ARRAY(size_t, array_length);
|
||||
assert(_surviving_young_words == NULL, "pre-condition");
|
||||
uint array_length = g1_policy()->young_cset_region_length();
|
||||
_surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length);
|
||||
if (_surviving_young_words == NULL) {
|
||||
vm_exit_out_of_memory(sizeof(size_t) * array_length,
|
||||
"Not enough space for young surv words summary.");
|
||||
}
|
||||
memset(_surviving_young_words, 0, array_length * sizeof(size_t));
|
||||
memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t));
|
||||
#ifdef ASSERT
|
||||
for (size_t i = 0; i < array_length; ++i) {
|
||||
for (uint i = 0; i < array_length; ++i) {
|
||||
assert( _surviving_young_words[i] == 0, "memset above" );
|
||||
}
|
||||
#endif // !ASSERT
|
||||
@ -3495,9 +3492,10 @@ G1CollectedHeap::setup_surviving_young_words() {
|
||||
void
|
||||
G1CollectedHeap::update_surviving_young_words(size_t* surv_young_words) {
|
||||
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
|
||||
size_t array_length = g1_policy()->young_cset_region_length();
|
||||
for (size_t i = 0; i < array_length; ++i)
|
||||
uint array_length = g1_policy()->young_cset_region_length();
|
||||
for (uint i = 0; i < array_length; ++i) {
|
||||
_surviving_young_words[i] += surv_young_words[i];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -3609,12 +3607,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||
increment_total_full_collections();
|
||||
}
|
||||
|
||||
// if PrintGCDetails is on, we'll print long statistics information
|
||||
// if the log level is "finer" is on, we'll print long statistics information
|
||||
// in the collector policy code, so let's not print this as the output
|
||||
// is messy if we do.
|
||||
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty);
|
||||
gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||
TraceTime t(verbose_str, G1Log::fine() && !G1Log::finer(), true, gclog_or_tty);
|
||||
|
||||
TraceCollectorStats tcs(g1mm()->incremental_collection_counters());
|
||||
TraceMemoryManagerStats tms(false /* fullGC */, gc_cause());
|
||||
@ -3647,8 +3645,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
gclog_or_tty->print(" VerifyBeforeGC:");
|
||||
prepare_for_verify();
|
||||
Universe::verify(/* allow dirty */ false,
|
||||
/* silent */ false,
|
||||
Universe::verify(/* silent */ false,
|
||||
/* option */ VerifyOption_G1UsePrevMarking);
|
||||
}
|
||||
|
||||
@ -3892,8 +3889,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
gclog_or_tty->print(" VerifyAfterGC:");
|
||||
prepare_for_verify();
|
||||
Universe::verify(/* allow dirty */ true,
|
||||
/* silent */ false,
|
||||
Universe::verify(/* silent */ false,
|
||||
/* option */ VerifyOption_G1UsePrevMarking);
|
||||
}
|
||||
|
||||
@ -3931,8 +3927,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
||||
}
|
||||
|
||||
// The closing of the inner scope, immediately above, will complete
|
||||
// the PrintGC logging output. The record_collection_pause_end() call
|
||||
// above will complete the logging output of PrintGCDetails.
|
||||
// logging at the "fine" level. The record_collection_pause_end() call
|
||||
// above will complete logging at the "finer" level.
|
||||
//
|
||||
// It is not yet to safe, however, to tell the concurrent mark to
|
||||
// start as we have some optional output below. We don't want the
|
||||
@ -4068,7 +4064,6 @@ void G1CollectedHeap::finalize_for_evac_failure() {
|
||||
|
||||
void G1CollectedHeap::remove_self_forwarding_pointers() {
|
||||
assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity");
|
||||
assert(g1_policy()->assertMarkedBytesDataOK(), "Should be!");
|
||||
|
||||
G1ParRemoveSelfForwardPtrsTask rsfp_task(this);
|
||||
|
||||
@ -4086,7 +4081,6 @@ void G1CollectedHeap::remove_self_forwarding_pointers() {
|
||||
reset_cset_heap_region_claim_values();
|
||||
|
||||
assert(check_cset_heap_region_claim_values(HeapRegion::InitialClaimValue), "sanity");
|
||||
assert(g1_policy()->assertMarkedBytesDataOK(), "Should be!");
|
||||
|
||||
// Now restore saved marks, if any.
|
||||
if (_objs_with_preserved_marks != NULL) {
|
||||
@ -4248,16 +4242,16 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num)
|
||||
// non-young regions (where the age is -1)
|
||||
// We also add a few elements at the beginning and at the end in
|
||||
// an attempt to eliminate cache contention
|
||||
size_t real_length = 1 + _g1h->g1_policy()->young_cset_region_length();
|
||||
size_t array_length = PADDING_ELEM_NUM +
|
||||
real_length +
|
||||
PADDING_ELEM_NUM;
|
||||
uint real_length = 1 + _g1h->g1_policy()->young_cset_region_length();
|
||||
uint array_length = PADDING_ELEM_NUM +
|
||||
real_length +
|
||||
PADDING_ELEM_NUM;
|
||||
_surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length);
|
||||
if (_surviving_young_words_base == NULL)
|
||||
vm_exit_out_of_memory(array_length * sizeof(size_t),
|
||||
"Not enough space for young surv histo.");
|
||||
_surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
|
||||
memset(_surviving_young_words, 0, real_length * sizeof(size_t));
|
||||
memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t));
|
||||
|
||||
_alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer;
|
||||
_alloc_buffers[GCAllocForTenured] = &_tenured_alloc_buffer;
|
||||
@ -4355,7 +4349,8 @@ G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1,
|
||||
_during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()),
|
||||
_mark_in_progress(_g1->mark_in_progress()) { }
|
||||
|
||||
void G1ParCopyHelper::mark_object(oop obj) {
|
||||
template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
|
||||
void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>::mark_object(oop obj) {
|
||||
#ifdef ASSERT
|
||||
HeapRegion* hr = _g1->heap_region_containing(obj);
|
||||
assert(hr != NULL, "sanity");
|
||||
@ -4366,7 +4361,9 @@ void G1ParCopyHelper::mark_object(oop obj) {
|
||||
_cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
|
||||
}
|
||||
|
||||
void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
|
||||
template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
|
||||
void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
|
||||
::mark_forwarded_object(oop from_obj, oop to_obj) {
|
||||
#ifdef ASSERT
|
||||
assert(from_obj->is_forwarded(), "from obj should be forwarded");
|
||||
assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee");
|
||||
@ -4388,8 +4385,10 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
|
||||
_cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);
|
||||
}
|
||||
|
||||
oop G1ParCopyHelper::copy_to_survivor_space(oop old) {
|
||||
size_t word_sz = old->size();
|
||||
template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
|
||||
oop G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
|
||||
::copy_to_survivor_space(oop old) {
|
||||
size_t word_sz = old->size();
|
||||
HeapRegion* from_region = _g1->heap_region_containing_raw(old);
|
||||
// +1 to make the -1 indexes valid...
|
||||
int young_index = from_region->young_index_in_cset()+1;
|
||||
@ -4457,8 +4456,8 @@ oop G1ParCopyHelper::copy_to_survivor_space(oop old) {
|
||||
} else {
|
||||
// No point in using the slower heap_region_containing() method,
|
||||
// given that we know obj is in the heap.
|
||||
_scanner->set_region(_g1->heap_region_containing_raw(obj));
|
||||
obj->oop_iterate_backwards(_scanner);
|
||||
_scanner.set_region(_g1->heap_region_containing_raw(obj));
|
||||
obj->oop_iterate_backwards(&_scanner);
|
||||
}
|
||||
} else {
|
||||
_par_scan_state->undo_allocation(alloc_purpose, obj_ptr, word_sz);
|
||||
@ -4675,67 +4674,74 @@ public:
|
||||
double start_time_ms = os::elapsedTime() * 1000.0;
|
||||
_g1h->g1_policy()->record_gc_worker_start_time(worker_id, start_time_ms);
|
||||
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
|
||||
ReferenceProcessor* rp = _g1h->ref_processor_stw();
|
||||
|
||||
G1ParScanThreadState pss(_g1h, worker_id);
|
||||
G1ParScanHeapEvacClosure scan_evac_cl(_g1h, &pss, rp);
|
||||
G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, rp);
|
||||
G1ParScanPartialArrayClosure partial_scan_cl(_g1h, &pss, rp);
|
||||
|
||||
pss.set_evac_closure(&scan_evac_cl);
|
||||
pss.set_evac_failure_closure(&evac_failure_cl);
|
||||
pss.set_partial_scan_closure(&partial_scan_cl);
|
||||
|
||||
G1ParScanExtRootClosure only_scan_root_cl(_g1h, &pss, rp);
|
||||
G1ParScanPermClosure only_scan_perm_cl(_g1h, &pss, rp);
|
||||
|
||||
G1ParScanAndMarkExtRootClosure scan_mark_root_cl(_g1h, &pss, rp);
|
||||
G1ParScanAndMarkPermClosure scan_mark_perm_cl(_g1h, &pss, rp);
|
||||
|
||||
OopClosure* scan_root_cl = &only_scan_root_cl;
|
||||
OopsInHeapRegionClosure* scan_perm_cl = &only_scan_perm_cl;
|
||||
|
||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||
// We also need to mark copied objects.
|
||||
scan_root_cl = &scan_mark_root_cl;
|
||||
scan_perm_cl = &scan_mark_perm_cl;
|
||||
}
|
||||
|
||||
G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
|
||||
|
||||
pss.start_strong_roots();
|
||||
_g1h->g1_process_strong_roots(/* not collecting perm */ false,
|
||||
SharedHeap::SO_AllClasses,
|
||||
scan_root_cl,
|
||||
&push_heap_rs_cl,
|
||||
scan_perm_cl,
|
||||
worker_id);
|
||||
pss.end_strong_roots();
|
||||
|
||||
{
|
||||
double start = os::elapsedTime();
|
||||
G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
|
||||
evac.do_void();
|
||||
double elapsed_ms = (os::elapsedTime()-start)*1000.0;
|
||||
double term_ms = pss.term_time()*1000.0;
|
||||
_g1h->g1_policy()->record_obj_copy_time(worker_id, elapsed_ms-term_ms);
|
||||
_g1h->g1_policy()->record_termination(worker_id, term_ms, pss.term_attempts());
|
||||
}
|
||||
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
|
||||
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
|
||||
// Clean up any par-expanded rem sets.
|
||||
HeapRegionRemSet::par_cleanup();
|
||||
ReferenceProcessor* rp = _g1h->ref_processor_stw();
|
||||
|
||||
if (ParallelGCVerbose) {
|
||||
MutexLocker x(stats_lock());
|
||||
pss.print_termination_stats(worker_id);
|
||||
G1ParScanThreadState pss(_g1h, worker_id);
|
||||
G1ParScanHeapEvacClosure scan_evac_cl(_g1h, &pss, rp);
|
||||
G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, rp);
|
||||
G1ParScanPartialArrayClosure partial_scan_cl(_g1h, &pss, rp);
|
||||
|
||||
pss.set_evac_closure(&scan_evac_cl);
|
||||
pss.set_evac_failure_closure(&evac_failure_cl);
|
||||
pss.set_partial_scan_closure(&partial_scan_cl);
|
||||
|
||||
G1ParScanExtRootClosure only_scan_root_cl(_g1h, &pss, rp);
|
||||
G1ParScanPermClosure only_scan_perm_cl(_g1h, &pss, rp);
|
||||
|
||||
G1ParScanAndMarkExtRootClosure scan_mark_root_cl(_g1h, &pss, rp);
|
||||
G1ParScanAndMarkPermClosure scan_mark_perm_cl(_g1h, &pss, rp);
|
||||
|
||||
OopClosure* scan_root_cl = &only_scan_root_cl;
|
||||
OopsInHeapRegionClosure* scan_perm_cl = &only_scan_perm_cl;
|
||||
|
||||
if (_g1h->g1_policy()->during_initial_mark_pause()) {
|
||||
// We also need to mark copied objects.
|
||||
scan_root_cl = &scan_mark_root_cl;
|
||||
scan_perm_cl = &scan_mark_perm_cl;
|
||||
}
|
||||
|
||||
G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
|
||||
|
||||
pss.start_strong_roots();
|
||||
_g1h->g1_process_strong_roots(/* not collecting perm */ false,
|
||||
SharedHeap::SO_AllClasses,
|
||||
scan_root_cl,
|
||||
&push_heap_rs_cl,
|
||||
scan_perm_cl,
|
||||
worker_id);
|
||||
pss.end_strong_roots();
|
||||
|
||||
{
|
||||
double start = os::elapsedTime();
|
||||
G1ParEvacuateFollowersClosure evac(_g1h, &pss, _queues, &_terminator);
|
||||
evac.do_void();
|
||||
double elapsed_ms = (os::elapsedTime()-start)*1000.0;
|
||||
double term_ms = pss.term_time()*1000.0;
|
||||
_g1h->g1_policy()->record_obj_copy_time(worker_id, elapsed_ms-term_ms);
|
||||
_g1h->g1_policy()->record_termination(worker_id, term_ms, pss.term_attempts());
|
||||
}
|
||||
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
|
||||
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
|
||||
|
||||
// Clean up any par-expanded rem sets.
|
||||
HeapRegionRemSet::par_cleanup();
|
||||
|
||||
if (ParallelGCVerbose) {
|
||||
MutexLocker x(stats_lock());
|
||||
pss.print_termination_stats(worker_id);
|
||||
}
|
||||
|
||||
assert(pss.refs()->is_empty(), "should be empty");
|
||||
|
||||
// Close the inner scope so that the ResourceMark and HandleMark
|
||||
// destructors are executed here and are included as part of the
|
||||
// "GC Worker Time".
|
||||
}
|
||||
|
||||
assert(pss.refs()->is_empty(), "should be empty");
|
||||
double end_time_ms = os::elapsedTime() * 1000.0;
|
||||
_g1h->g1_policy()->record_gc_worker_end_time(worker_id, end_time_ms);
|
||||
}
|
||||
@ -4743,6 +4749,67 @@ public:
|
||||
|
||||
// *** Common G1 Evacuation Stuff
|
||||
|
||||
// Closures that support the filtering of CodeBlobs scanned during
|
||||
// external root scanning.
|
||||
|
||||
// Closure applied to reference fields in code blobs (specifically nmethods)
|
||||
// to determine whether an nmethod contains references that point into
|
||||
// the collection set. Used as a predicate when walking code roots so
|
||||
// that only nmethods that point into the collection set are added to the
|
||||
// 'marked' list.
|
||||
|
||||
class G1FilteredCodeBlobToOopClosure : public CodeBlobToOopClosure {
|
||||
|
||||
class G1PointsIntoCSOopClosure : public OopClosure {
|
||||
G1CollectedHeap* _g1;
|
||||
bool _points_into_cs;
|
||||
public:
|
||||
G1PointsIntoCSOopClosure(G1CollectedHeap* g1) :
|
||||
_g1(g1), _points_into_cs(false) { }
|
||||
|
||||
bool points_into_cs() const { return _points_into_cs; }
|
||||
|
||||
template <class T>
|
||||
void do_oop_nv(T* p) {
|
||||
if (!_points_into_cs) {
|
||||
T heap_oop = oopDesc::load_heap_oop(p);
|
||||
if (!oopDesc::is_null(heap_oop) &&
|
||||
_g1->in_cset_fast_test(oopDesc::decode_heap_oop_not_null(heap_oop))) {
|
||||
_points_into_cs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void do_oop(oop* p) { do_oop_nv(p); }
|
||||
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
|
||||
};
|
||||
|
||||
G1CollectedHeap* _g1;
|
||||
|
||||
public:
|
||||
G1FilteredCodeBlobToOopClosure(G1CollectedHeap* g1, OopClosure* cl) :
|
||||
CodeBlobToOopClosure(cl, true), _g1(g1) { }
|
||||
|
||||
virtual void do_code_blob(CodeBlob* cb) {
|
||||
nmethod* nm = cb->as_nmethod_or_null();
|
||||
if (nm != NULL && !(nm->test_oops_do_mark())) {
|
||||
G1PointsIntoCSOopClosure predicate_cl(_g1);
|
||||
nm->oops_do(&predicate_cl);
|
||||
|
||||
if (predicate_cl.points_into_cs()) {
|
||||
// At least one of the reference fields or the oop relocations
|
||||
// in the nmethod points into the collection set. We have to
|
||||
// 'mark' this nmethod.
|
||||
// Note: Revisit the following if CodeBlobToOopClosure::do_code_blob()
|
||||
// or MarkingCodeBlobClosure::do_code_blob() change.
|
||||
if (!nm->test_set_oops_do_mark()) {
|
||||
do_newly_marked_nmethod(nm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// This method is run in a GC worker.
|
||||
|
||||
void
|
||||
@ -4764,7 +4831,7 @@ g1_process_strong_roots(bool collecting_perm_gen,
|
||||
|
||||
// Walk the code cache w/o buffering, because StarTask cannot handle
|
||||
// unaligned oop locations.
|
||||
CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, /*do_marking=*/ true);
|
||||
G1FilteredCodeBlobToOopClosure eager_scan_code_roots(this, scan_non_heap_roots);
|
||||
|
||||
process_strong_roots(false, // no scoping; this is parallel code
|
||||
collecting_perm_gen, so,
|
||||
@ -5378,25 +5445,39 @@ void G1CollectedHeap::evacuate_collection_set() {
|
||||
rem_set()->prepare_for_younger_refs_iterate(true);
|
||||
|
||||
assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty");
|
||||
double start_par = os::elapsedTime();
|
||||
double start_par_time_sec = os::elapsedTime();
|
||||
double end_par_time_sec;
|
||||
|
||||
if (G1CollectedHeap::use_parallel_gc_threads()) {
|
||||
// The individual threads will set their evac-failure closures.
|
||||
{
|
||||
StrongRootsScope srs(this);
|
||||
if (ParallelGCVerbose) G1ParScanThreadState::print_termination_stats_hdr();
|
||||
// These tasks use ShareHeap::_process_strong_tasks
|
||||
assert(UseDynamicNumberOfGCThreads ||
|
||||
workers()->active_workers() == workers()->total_workers(),
|
||||
"If not dynamic should be using all the workers");
|
||||
workers()->run_task(&g1_par_task);
|
||||
} else {
|
||||
StrongRootsScope srs(this);
|
||||
g1_par_task.set_for_termination(n_workers);
|
||||
g1_par_task.work(0);
|
||||
|
||||
if (G1CollectedHeap::use_parallel_gc_threads()) {
|
||||
// The individual threads will set their evac-failure closures.
|
||||
if (ParallelGCVerbose) G1ParScanThreadState::print_termination_stats_hdr();
|
||||
// These tasks use ShareHeap::_process_strong_tasks
|
||||
assert(UseDynamicNumberOfGCThreads ||
|
||||
workers()->active_workers() == workers()->total_workers(),
|
||||
"If not dynamic should be using all the workers");
|
||||
workers()->run_task(&g1_par_task);
|
||||
} else {
|
||||
g1_par_task.set_for_termination(n_workers);
|
||||
g1_par_task.work(0);
|
||||
}
|
||||
end_par_time_sec = os::elapsedTime();
|
||||
|
||||
// Closing the inner scope will execute the destructor
|
||||
// for the StrongRootsScope object. We record the current
|
||||
// elapsed time before closing the scope so that time
|
||||
// taken for the SRS destructor is NOT included in the
|
||||
// reported parallel time.
|
||||
}
|
||||
|
||||
double par_time = (os::elapsedTime() - start_par) * 1000.0;
|
||||
g1_policy()->record_par_time(par_time);
|
||||
double par_time_ms = (end_par_time_sec - start_par_time_sec) * 1000.0;
|
||||
g1_policy()->record_par_time(par_time_ms);
|
||||
|
||||
double code_root_fixup_time_ms =
|
||||
(os::elapsedTime() - end_par_time_sec) * 1000.0;
|
||||
g1_policy()->record_code_root_fixup_time(code_root_fixup_time_ms);
|
||||
|
||||
set_par_threads(0);
|
||||
|
||||
@ -5427,9 +5508,9 @@ void G1CollectedHeap::evacuate_collection_set() {
|
||||
|
||||
if (evacuation_failed()) {
|
||||
remove_self_forwarding_pointers();
|
||||
if (PrintGCDetails) {
|
||||
if (G1Log::finer()) {
|
||||
gclog_or_tty->print(" (to-space overflow)");
|
||||
} else if (PrintGC) {
|
||||
} else if (G1Log::fine()) {
|
||||
gclog_or_tty->print("--");
|
||||
}
|
||||
}
|
||||
@ -5504,8 +5585,8 @@ void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
|
||||
hr->set_notHumongous();
|
||||
free_region(hr, &hr_pre_used, free_list, par);
|
||||
|
||||
size_t i = hr->hrs_index() + 1;
|
||||
size_t num = 1;
|
||||
uint i = hr->hrs_index() + 1;
|
||||
uint num = 1;
|
||||
while (i < n_regions()) {
|
||||
HeapRegion* curr_hr = region_at(i);
|
||||
if (!curr_hr->continuesHumongous()) {
|
||||
@ -5714,7 +5795,7 @@ void G1CollectedHeap::free_collection_set(HeapRegion* cs_head) {
|
||||
if (cur->is_young()) {
|
||||
int index = cur->young_index_in_cset();
|
||||
assert(index != -1, "invariant");
|
||||
assert((size_t) index < policy->young_cset_region_length(), "invariant");
|
||||
assert((uint) index < policy->young_cset_region_length(), "invariant");
|
||||
size_t words_survived = _surviving_young_words[index];
|
||||
cur->record_surv_words_in_group(words_survived);
|
||||
|
||||
@ -6054,7 +6135,7 @@ void MutatorAllocRegion::retire_region(HeapRegion* alloc_region,
|
||||
// Methods for the GC alloc regions
|
||||
|
||||
HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
|
||||
size_t count,
|
||||
uint count,
|
||||
GCAllocPurpose ap) {
|
||||
assert(FreeList_lock->owned_by_self(), "pre-condition");
|
||||
|
||||
@ -6126,7 +6207,7 @@ private:
|
||||
FreeRegionList* _free_list;
|
||||
OldRegionSet* _old_set;
|
||||
HumongousRegionSet* _humongous_set;
|
||||
size_t _region_count;
|
||||
uint _region_count;
|
||||
|
||||
public:
|
||||
VerifyRegionListsClosure(OldRegionSet* old_set,
|
||||
@ -6135,7 +6216,7 @@ public:
|
||||
_old_set(old_set), _humongous_set(humongous_set),
|
||||
_free_list(free_list), _region_count(0) { }
|
||||
|
||||
size_t region_count() { return _region_count; }
|
||||
uint region_count() { return _region_count; }
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
_region_count += 1;
|
||||
@ -6157,7 +6238,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
HeapRegion* G1CollectedHeap::new_heap_region(size_t hrs_index,
|
||||
HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index,
|
||||
HeapWord* bottom) {
|
||||
HeapWord* end = bottom + HeapRegion::GrainWords;
|
||||
MemRegion mr(bottom, end);
|
||||
|
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