This commit is contained in:
J. Duke 2017-07-05 19:18:47 +02:00
commit af692ebe47
1088 changed files with 32922 additions and 16977 deletions

View File

@ -233,3 +233,4 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103
91f47e8da5c60de58ed195e9b57f3bf192a18f83 jdk8-b109
4faa09c7fe555de086dd9048d3c5cc92317d6f45 jdk8-b110
d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -36,10 +36,8 @@ default:
TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
# Assume we have GNU make, but check version.
ifeq (,$(findstring 3.81,$(MAKE_VERSION)))
ifeq (,$(findstring 3.82,$(MAKE_VERSION)))
$(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
endif
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
$(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
endif
# Locate this Makefile

View File

@ -212,6 +212,18 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH],
[AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])])
])
# Register a --enable argument but mark it as deprecated
# $1: The name of the with argument to deprecate, not including --enable-
# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
[
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
[Deprecated. Option is kept for backwards compatibility and is ignored])])
if test "x$enable_$2" != x; then
AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
fi
])
AC_DEFUN_ONCE([BASIC_INIT],
[
# Save the original command line. This is passed to us by the wrapper configure script.
@ -502,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
if test "x$IS_GNU_MAKE" = x; then
AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
else
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'`
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[[12]]\)\|\(4\.\)'`
if test "x$IS_MODERN_MAKE" = x; then
AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
else
@ -644,6 +656,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil)
BASIC_REQUIRE_PROG(XATTR, xattr)
AC_PATH_PROG(CODESIGN, codesign)
if test "x$CODESIGN" != "x"; then

View File

@ -177,6 +177,9 @@ JDKOPT_SETUP_DEBUG_SYMBOLS
#
###############################################################################
# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
BASIC_COMPILE_FIXPATH
LIB_SETUP_INIT
LIB_SETUP_X11
LIB_SETUP_CUPS
@ -185,8 +188,6 @@ LIB_SETUP_ALSA
LIB_SETUP_MISC_LIBS
LIB_SETUP_STATIC_LINK_LIBSTDCPP
# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper
BASIC_COMPILE_FIXPATH
###############################################################################
#

File diff suppressed because it is too large Load Diff

View File

@ -31,43 +31,76 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
[
# Print a helpful message on how to acquire the necessary build dependency.
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
# $1 is the help tag: freetype, cups, pulse, alsa etc
MISSING_DEPENDENCY=$1
PKGHANDLER_COMMAND=
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$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
cygwin_help $MISSING_DEPENDENCY
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
msys_help $MISSING_DEPENDENCY
else
PKGHANDLER_COMMAND=
if test "x$PKGHANDLER_COMMAND" != x; then
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
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="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
fi
fi
])
cygwin_help() {
case $1 in
unzip)
PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip" ;;
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;;
zip)
PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P zip" ;;
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;;
make)
PKGHANDLER_COMMAND="cd <location of cygwin setup.exe> && cmd /c setup -q -P make" ;;
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;;
freetype)
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
HELP_MSG="To install freetype, run:
wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe
chmod +x /tmp/freetype-setup.exe
/tmp/freetype-setup.exe
Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\".
After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll."
else
HELP_MSG="You need to build a 64-bit version of freetype.
This is not readily available.
You can find source code and build instructions on
http://www.freetype.org/
If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically."
fi
;;
* )
break ;;
esac
}
msys_help() {
PKGHANDLER_COMMAND=""
}
apt_help() {
case $1 in
devkit)
@ -78,7 +111,7 @@ apt_help() {
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
cups)
PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
freetype2)
freetype)
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
pulse)
PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
@ -101,7 +134,7 @@ yum_help() {
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
cups)
PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
freetype2)
freetype)
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
pulse)
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -123,8 +123,7 @@ endif
# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue)
ZIP_DEBUGINFO_FILES:=1
endif
ifeq ($(ZIP_DEBUGINFO_FILES), false)
else
ZIP_DEBUGINFO_FILES:=0
endif

View File

@ -516,11 +516,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
elif test "x$enable_debug_symbols" = "xno"; then
ENABLE_DEBUG_SYMBOLS=false
else
# default on macosx is false
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
ENABLE_DEBUG_SYMBOLS=false
# Default is on if objcopy is found, otherwise off
elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then
# Default is on if objcopy is found
if test "x$OBJCOPY" != x; then
ENABLE_DEBUG_SYMBOLS=true
# MacOS X and Windows don't use objcopy but default is on for those OSes
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
ENABLE_DEBUG_SYMBOLS=true
else
ENABLE_DEBUG_SYMBOLS=false

View File

@ -57,7 +57,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes
FREETYPE2_NOT_NEEDED=yes
# If the java runtime framework is disabled, then we need X11.
# This will be adjusted below.
AC_MSG_RESULT([alsa pulse x11])
@ -70,7 +69,7 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
fi
if test "x$OPENJDK" = "xfalse"; then
FREETYPE2_NOT_NEEDED=yes
FREETYPE_NOT_NEEDED=yes
fi
if test "x$SUPPORT_HEADFUL" = xno; then
@ -79,33 +78,17 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
###############################################################################
#
# Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
# that uses this API.
# Check for MacOSX support for OpenJDK.
#
AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support],
[disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])],
[MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"])
USE_MACOSX_RUNTIME_SUPPORT=no
AC_MSG_CHECKING([for explicit Java runtime support in the OS])
BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support)
AC_MSG_CHECKING([for Mac OS X Java Framework])
if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then
MACOSX_RUNTIME_SUPPORT=yes
USE_MACOSX_RUNTIME_SUPPORT=yes
AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11])
else
AC_MSG_RESULT([yes, but explicitly disabled.])
fi
AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
else
AC_MSG_RESULT([no])
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then
AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?])
X11_NOT_NEEDED=
FREETYPE2_NOT_NEEDED=
AC_MSG_RESULT([alsa pulse])
fi
])
AC_DEFUN_ONCE([LIB_SETUP_X11],
@ -153,16 +136,6 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
fi
# Some of the old makefiles require a setting of OPENWIN_HOME
# Since the X11R6 directory has disappeared on later Linuxes,
# we need to probe for it.
if test "x$OPENJDK_TARGET_OS" = xlinux; then
if test -d "$SYS_ROOT/usr/X11R6"; then
OPENWIN_HOME="$SYS_ROOT/usr/X11R6"
elif test -d "$SYS_ROOT/usr/include/X11"; then
OPENWIN_HOME="$SYS_ROOT/usr"
fi
fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
OPENWIN_HOME="/usr/openwin"
fi
@ -277,151 +250,279 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
])
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
[
POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
POTENTIAL_FREETYPE_LIB_PATH="$2"
METHOD="$3"
# First check if the files exists.
if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
# We found an arbitrary include file. That's a good sign.
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
FOUND_FREETYPE=yes
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}"
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
FOUND_FREETYPE=no
else
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# On Windows, we will need both .lib and .dll file.
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.])
FOUND_FREETYPE=no
fi
elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
# On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
fi
fi
fi
if test "x$FOUND_FREETYPE" = xyes; then
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH)
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH)
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
AC_MSG_CHECKING([for freetype includes])
AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH])
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
AC_MSG_CHECKING([for freetype libraries])
AC_MSG_RESULT([$FREETYPE_LIB_PATH])
fi
])
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
[
###############################################################################
#
# The ubiquitous freetype2 library is used to render fonts.
# The ubiquitous freetype library is used to render fonts.
#
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
[specify prefix directory for the freetype2 package
[specify prefix directory for the freetype package
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
[specify directory for the freetype include files])])
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
[specify directory for the freetype library])])
AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling],
[disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])])
# If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree
USING_SYSTEM_FT_LIB=false
FREETYPE_CFLAGS=
FREETYPE_LIBS=
FREETYPE_BUNDLE_LIB_PATH=
if test "x$FREETYPE2_NOT_NEEDED" = xyes; then
if test "x$FREETYPE_NOT_NEEDED" = xyes; then
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
fi
FREETYPE2_CFLAGS=
FREETYPE2_LIBS=
FREETYPE2_LIB_PATH=
if test "x$enable_freetype_bundling" != x; then
AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored])
fi
else
FREETYPE2_FOUND=no
# freetype is needed to build; go get it!
if test "x$with_freetype" != x; then
BASIC_FIXUP_PATH(with_freetype)
FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype"
FREETYPE2_LIB_PATH="$with_freetype/lib"
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then
FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype"
FREETYPE2_LIB_PATH="$with_freetype/lib/amd64"
BUNDLE_FREETYPE="$enable_freetype_bundling"
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
# User has specified settings
if test "x$BUNDLE_FREETYPE" = x; then
# If not specified, default is to bundle freetype
BUNDLE_FREETYPE=yes
fi
if test "x$with_freetype" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
fi
# Allow --with-freetype-lib and --with-freetype-include to override
if test "x$with_freetype_include" != x; then
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
fi
if test "x$with_freetype_lib" != x; then
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
fi
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
# Okay, we got it. Check that it works.
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
if test "x$FOUND_FREETYPE" != xyes; then
AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype])
fi
else
# User specified only one of lib or include. This is an error.
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then
AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include])
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
else
AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib])
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
fi
fi
else
# User did not specify settings, but we need freetype. Try to locate it.
if test "x$BUNDLE_FREETYPE" = x; then
# If not specified, default is to bundle freetype only on windows
if test "x$OPENJDK_TARGET_OS" = xwindows; then
BUNDLE_FREETYPE=yes
else
BUNDLE_FREETYPE=no
fi
fi
if test "x$FOUND_FREETYPE" != xyes; then
# Check builddeps
BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
if test "x$FOUND_FREETYPE" = xyes; then
if test "x$BUNDLE_FREETYPE" = xyes; then
AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that])
FOUND_FREETYPE=no
else
AC_MSG_CHECKING([for freetype])
AC_MSG_RESULT([yes (using builddeps)])
fi
fi
fi
if test "x$FOUND_FREETYPE" != xyes; then
# Check modules using pkg-config, but only if we have it (ugly output results otherwise)
if test "x$PKG_CONFIG" != x; then
PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
if test "x$FOUND_FREETYPE" = xyes; then
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
fi
# BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
if test "x$BUNDLE_FREETYPE" = xyes; then
AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
FOUND_FREETYPE=no
else
AC_MSG_CHECKING([for freetype])
AC_MSG_RESULT([yes (using pkg-config)])
fi
fi
fi
fi
if test "x$FOUND_FREETYPE" != xyes; then
# Check in well-known locations
if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
fi
else
if test "x$SYS_ROOT" = "x/"; then
FREETYPE_ROOT=
else
FREETYPE_ROOT="$SYS_ROOT"
fi
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11"
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
fi
if test "x$FOUND_FREETYPE" != xyes; then
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
else
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
if test "x$FOUND_FREETYPE" != xyes; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
fi
fi
fi
fi
fi # end check in well-known locations
if test "x$FOUND_FREETYPE" != xyes; then
HELP_MSG_MISSING_DEPENDENCY([freetype])
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
fi
fi # end user specified settings
# Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
if test "x$FREETYPE_CFLAGS" = x; then
BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH)
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
else
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
fi
fi
if test "x$FREETYPE_LIBS" = x; then
BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
if test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPE2_LIBS="$with_freetype/lib/freetype.lib"
FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib"
else
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype"
fi
FREETYPE2_CFLAGS="-I$with_freetype/include"
if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then
FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include"
fi
FREETYPE2_FOUND=yes
if test "x$FREETYPE2_FOUND" = xyes; then
# Verify that the directories exist
if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
fi
# List the contents of the lib.
FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
if test "x$FREETYPELIB" = x; then
AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib])
fi
# Check one h-file
if ! test -s "$with_freetype/include/ft2build.h"; then
AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h])
fi
fi
fi
if test "x$FREETYPE2_FOUND" = xno; then
BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
USING_SYSTEM_FT_LIB=true
fi
if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then
FREETYPELOCATION="$PROGRAMFILES/GnuWin32"
BASIC_FIXUP_PATH(FREETYPELOCATION)
AC_MSG_CHECKING([for freetype in some standard windows locations])
if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then
FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include"
FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib"
FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib"
if ! test -s "$FREETYPE2_LIBS"; then
AC_MSG_ERROR([Could not find $FREETYPE2_LIBS])
fi
if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then
AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll])
fi
USING_SYSTEM_FT_LIB=true
FREETYPE2_FOUND=yes
fi
AC_MSG_RESULT([$FREETYPE2_FOUND])
fi
if test "x$FREETYPE2_FOUND" = xno; then
PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'`
USING_SYSTEM_FT_LIB=true
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'`
fi
fi
if test "x$FREETYPE2_FOUND" = xno; then
AC_MSG_CHECKING([for freetype in some standard locations])
if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then
DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include"
DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype"
fi
if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then
DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2"
DEFAULT_FREETYPE_LIBS="-lfreetype"
fi
PREV_CXXCFLAGS="$CXXFLAGS"
PREV_LDFLAGS="$LDFLAGS"
CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include<ft2build.h>
#include FT_FREETYPE_H
int main() { return 0; }
]])],
[
# Yes, the default cflags and libs did the trick.
FREETYPE2_FOUND=yes
FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS"
FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
],
[
FREETYPE2_FOUND=no
]
)
CXXCFLAGS="$PREV_CXXFLAGS"
LDFLAGS="$PREV_LDFLAGS"
AC_MSG_RESULT([$FREETYPE2_FOUND])
USING_SYSTEM_FT_LIB=true
fi
if test "x$FREETYPE2_FOUND" = xno; then
HELP_MSG_MISSING_DEPENDENCY([freetype2])
AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])
fi
if test "x$OPENJDK_TARGET_OS" != xwindows; then
# AC_CHECK_LIB does not support use of cl.exe
PREV_LDFLAGS="$LDFLAGS"
LDFLAGS="$FREETYPE2_LIBS"
AC_CHECK_LIB(freetype, FT_Init_FreeType,
FREETYPE2_FOUND=true,
AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]))
LDFLAGS="$PREV_LDFLAGS"
fi
fi
# Try to compile it
AC_MSG_CHECKING([if we can compile and link with freetype])
AC_LANG_PUSH(C++)
PREV_CXXCFLAGS="$CXXFLAGS"
PREV_LDFLAGS="$LDFLAGS"
PREV_CXX="$CXX"
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
CXX="$FIXPATH $CXX"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include<ft2build.h>
#include FT_FREETYPE_H
int main () {
FT_Init_FreeType(NULL);
return 0;
}
]])],
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.])
AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
HELP_MSG_MISSING_DEPENDENCY([freetype])
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
]
)
CXXCFLAGS="$PREV_CXXFLAGS"
LDFLAGS="$PREV_LDFLAGS"
CXX="$PREV_CXX"
AC_LANG_POP(C++)
AC_SUBST(USING_SYSTEM_FT_LIB)
AC_SUBST(FREETYPE2_LIB_PATH)
AC_SUBST(FREETYPE2_CFLAGS)
AC_SUBST(FREETYPE2_LIBS)
AC_MSG_CHECKING([if we should bundle freetype])
if test "x$BUNDLE_FREETYPE" = xyes; then
FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH"
fi
AC_MSG_RESULT([$BUNDLE_FREETYPE])
fi # end freetype needed
AC_SUBST(FREETYPE_BUNDLE_LIB_PATH)
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)
])
AC_DEFUN_ONCE([LIB_SETUP_ALSA],

View File

@ -268,13 +268,9 @@ SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
# Number of parallel jobs to use for compilation
JOBS?=@JOBS@
# 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@
FREETYPE_LIBS:=@FREETYPE_LIBS@
FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
CUPS_CFLAGS:=@CUPS_CFLAGS@
ALSA_LIBS:=@ALSA_LIBS@
ALSA_CFLAGS:=@ALSA_CFLAGS@
@ -485,6 +481,7 @@ CUT:=@CUT@
DATE:=@DATE@
DIFF:=@DIFF@
DIRNAME:=@DIRNAME@
DSYMUTIL:=@DSYMUTIL@
FIND:=@FIND@
FIND_DELETE:=@FIND_DELETE@
ECHO:=@ECHO@

View File

@ -176,6 +176,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS],
[
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
TOOLCHAIN_SETUP_MSVCR_DLL
BASIC_DEPRECATED_ARG_WITH([dxsdk])
BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
BASIC_DEPRECATED_ARG_WITH([dxsdk-include])

View File

@ -228,52 +228,113 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
AC_MSG_ERROR([Cannot continue])
fi
])
AC_MSG_CHECKING([for msvcr100.dll])
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
[
POSSIBLE_MSVCR_DLL="$1"
METHOD="$2"
if test -e "$POSSIBLE_MSVCR_DLL"; then
AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
# Need to check if the found msvcr is correct architecture
AC_MSG_CHECKING([found msvcr100.dll architecture])
MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
CORRECT_MSVCR_ARCH=386
else
CORRECT_MSVCR_ARCH=x86-64
fi
if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
AC_MSG_RESULT([ok])
MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
AC_MSG_CHECKING([for msvcr100.dll])
AC_MSG_RESULT([$MSVCR_DLL])
else
AC_MSG_RESULT([incorrect, ignoring])
AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE])
fi
fi
])
AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
[
AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
[copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])])
if test "x$with_msvcr_dll" != x; then
MSVCR_DLL="$with_msvcr_dll"
else
if test "x$VCINSTALLDIR" != x; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1`
else
MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
if test "x$MSVCR_DLL" = x; then
MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1`
fi
fi
if test "x$MSVCR_DLL" != x; then
AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR])
else
AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR])
fi
fi
# Try some fallback alternatives
# If given explicitely by user, do not probe. If not present, fail directly.
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll])
if test "x$MSVCR_DLL" = x; then
# If visual studio express is installed, there is usually one with the debugger
if test "x$VS100COMNTOOLS" != x; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..])
fi
fi
fi
if test "x$MSVCR_DLL" = x; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
# Fallback for 32bit builds, look in the windows directory.
if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32])
MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
fi
fi
AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
fi
fi
if test "x$MSVCR_DLL" = x; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find msvcr100.dll !])
# Probe: Using well-known location from Visual Studio 10.0
if test "x$VCINSTALLDIR" != x; then
CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
else
POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
fi
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR])
fi
fi
AC_MSG_RESULT([$MSVCR_DLL])
if test "x$MSVCR_DLL" = x; then
# Probe: Check in the Boot JDK directory.
POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
fi
if test "x$MSVCR_DLL" = x; then
# Probe: Look in the Windows system32 directory
CYGWIN_SYSTEMROOT="$SYSTEMROOT"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT])
fi
if test "x$MSVCR_DLL" = x; then
# Probe: If Visual Studio Express is installed, there is usually one with the debugger
if test "x$VS100COMNTOOLS" != x; then
CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
else
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
fi
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
fi
fi
if test "x$MSVCR_DLL" = x; then
# Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
# (This was the original behaviour; kept since it might turn up something)
if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
else
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
if test "x$POSSIBLE_MSVCR_DLL" = x; then
# We're grasping at straws now...
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
fi
fi
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
fi
fi
if test "x$MSVCR_DLL" = x; then
AC_MSG_CHECKING([for msvcr100.dll])
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.])
fi
BASIC_FIXUP_PATH(MSVCR_DLL)
])

View File

@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -27,37 +27,11 @@
command="$1"
pull_extra_base="$2"
# Python always buffers stdout significantly, thus we will not see any output from hg clone jdk,
# until a lot of time has passed! By passing -u to python, we get incremental updates
# on stdout. Much nicer.
whichhg="`which hg 2> /dev/null | grep -v '^no hg in'`"
if [ "${whichhg}" = "" ] ; then
echo Cannot find hg!
exit 1
fi
if [ "" = "$command" ] ; then
echo No command to hg supplied!
exit 1
fi
has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`"
python=""
bpython=""
if [ "#!" = "$has_hash_bang" ] ; then
python="`head -n 1 ${whichhg} | cut -b 3- | sed -e 's/^[ \t]*//;s/[ \t]*$//'`"
bpython="`basename "$python"`"
fi
if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then
hg="${python} -u ${whichhg}"
else
echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout.
hg="hg"
fi
# Clean out the temporary directory that stores the pid files.
tmp=/tmp/forest.$$
rm -f -r ${tmp}
@ -171,7 +145,7 @@ for i in ${repos} ${repos_extra} ; do
(
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
echo ${hg} clone ${pull_newrepo} ${i}
echo hg clone ${pull_newrepo} ${i}
path="`dirname ${i}`"
if [ "${path}" != "." ] ; then
times=0
@ -184,10 +158,10 @@ for i in ${repos} ${repos_extra} ; do
sleep 5
done
fi
(${hg} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
(PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
else
echo "cd ${i} && ${hg} $*"
cd ${i} && (${hg} "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
echo "cd ${i} && hg $*"
cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
fi
echo $! > ${tmp}/${repopidfile}.pid
) 2>&1 | sed -e "s@^@${reponame}: @") &

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -266,8 +266,12 @@ define SetupZipArchive
endif
# Find all files in the source tree.
$1_ALL_SRCS := $$(call not-containing,_the., \
$$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST))))
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST)))
# Filter on suffixes if set
ifneq ($$($1_SUFFIXES),)
$1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS))
endif
ifneq ($$($1_INCLUDES),)
ifneq ($$($1_SUFFIXES),)
@ -371,8 +375,8 @@ define SetupJavaCompilation
# 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.
# JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete
# source roots from SRC. This is sometimes needed when compiling specific subsets of the source.
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
@ -474,8 +478,8 @@ define SetupJavaCompilation
endif
# 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)))
ifneq ($$($1_JAVAC_SOURCE_PATH_OVERRIDE),)
$$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_OVERRIDE)))
else
$$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC)))
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -435,31 +435,36 @@ define SetupNativeCompilation
$(CP) $$< $$@
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
$(RM) $$@
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
else # not solaris
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
$(RM) $$@
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
endif # Touch to not retrigger rule on rebuild
ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X
ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows
ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
$(RM) $$@
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
else # not solaris
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
$(RM) $$@
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
endif # Touch to not retrigger rule on rebuild
$(TOUCH) $$@
endif # !windows
endif # !macosx
ifeq ($(ZIP_DEBUGINFO_FILES), true)
ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
ifeq ($(OPENJDK_TARGET_OS), windows)
@ -472,11 +477,12 @@ define SetupNativeCompilation
$(CD) $$($1_OBJECT_DIR) \
&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
endif
endif # no MacOS X support yet
else
ifeq ($(OPENJDK_TARGET_OS), windows)
$1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
$$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
else
else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
endif
endif
@ -513,31 +519,36 @@ define SetupNativeCompilation
$(CP) $$< $$@
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
$(RM) $$@
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
else # not solaris
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
$(RM) $$@
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
endif
$(TOUCH) $$@
ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X
ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows
ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
# empty section headers until a fixed $(OBJCOPY) is available.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
#
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
$(RM) $$@
$(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$<
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$<
else # not solaris
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
$(RM) $$@
$(OBJCOPY) --only-keep-debug $$< $$@
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
endif
$(TOUCH) $$@
endif # !windows
endif # !macosx
ifeq ($(ZIP_DEBUGINFO_FILES), true)
ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
ifeq ($(OPENJDK_TARGET_OS), windows)
@ -550,11 +561,12 @@ define SetupNativeCompilation
$(CD) $$($1_OBJECT_DIR) \
&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
endif
endif # no MacOS X support yet
else
ifeq ($(OPENJDK_TARGET_OS), windows)
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
$$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
else
else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
endif
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,7 @@ define SetupRMICompilation
$(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
$(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated
$1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES))
$1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH)))
@ -60,11 +60,11 @@ define SetupRMICompilation
ifneq (,$$($1_RUN_IIOP))
$1_TARGETS += $$($1_TIE_FILES)
$1_ARGS += -iiop
$1_ARGS += -iiop -emitPermissionCheck
endif
ifneq (,$$($1_RUN_IIOP_STDPKG))
$1_TARGETS += $$($1_TIE_STDPKG_FILES)
$1_ARGS2 := -iiop -standardPackage
$1_ARGS2 := -iiop -emitPermissionCheck -standardPackage
endif
ifneq (,$$($1_KEEP_GENERATED))
@ -88,10 +88,9 @@ define SetupRMICompilation
$(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
fi;
$(TOUCH) $$@
$1 := $$($1_TARGETS)
$1 := $$($1_TARGETS) $$($1_DEP_FILE)
# By marking as secondary, this "touch" file doesn't need to be touched and will never exist.
.SECONDARY: $$($1_DEP_FILE)
endef

View File

@ -233,3 +233,4 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108
428428cf5e06163322144cfb5367e1faa86acf20 jdk8-b109
3d2b7ce93c5c2e3db748f29c3d29620a8b3b748a jdk8-b110
85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112

View File

@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug
# Standard list of jprt build targets for this source tree
jprt.build.targets= \
solaris_sparc_5.10-{product|fastdebug}, \
solaris_sparcv9_5.10-{product|fastdebug}, \
solaris_i586_5.10-{product|fastdebug}, \
solaris_x64_5.10-{product|fastdebug}, \
linux_i586_2.6-{product|fastdebug}, \
linux_x64_2.6-{product|fastdebug}, \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -45,7 +45,9 @@ DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthroug
$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
JVM := $(JAVA), \
JAVAC := $(NEW_JAVAC), \
FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_CORBA_WARNINGS), \
FLAGS := $(BOOT_JDK_SOURCETARGET) \
-bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \
$(DISABLE_CORBA_WARNINGS), \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
@ -183,6 +185,15 @@ ifeq ($(LOGWRAPPERS_ARE_CREATED), yes)
COPY := .prp LogStrings.properties, \
BIN := $(CORBA_OUTPUTDIR)/classes))
$(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_CORBA, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(BUILD_CORBA_SRC), \
EXCLUDES := $(BUILD_CORBA_EXCLUDES), \
EXCLUDE_FILES := $(BUILD_CORBA_EXCLUDE_FILES), \
COPY := $(BUILD_CORBA_COPY), \
BIN := $(CORBA_OUTPUTDIR)/btclasses/corba_classes, \
JAR := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar))
# Separate src.zip call to include sources that were excluded in the build to
# mimic behavior in old build system.
$(eval $(call SetupZipArchive,ARCHIVE_BUILD_CORBA, \
@ -241,6 +252,7 @@ ifeq ($(LOGWRAPPERS_ARE_CREATED), yes)
all: $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \
$(CORBA_OUTPUTDIR)/btjars/idlj.jar \
$(CORBA_OUTPUTDIR)/btjars/logutil.jar \
$(CORBA_OUTPUTDIR)/btjars/btcorba.jar \
$(CORBA_OUTPUTDIR)/dist/lib/classes.jar \
$(CORBA_OUTPUTDIR)/dist/lib/src.zip \
$(CORBA_OUTPUTDIR)/dist/lib/bin.zip

View File

@ -905,28 +905,4 @@ public class IDLNameTranslatorImpl implements IDLNameTranslator {
return contents.toString();
}
public static void main(String[] args) {
Class remoteInterface = java.rmi.Remote.class;
if( args.length > 0 ) {
String className = args[0];
try {
remoteInterface = Class.forName(className);
} catch(Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
System.out.println("Building name translation for " + remoteInterface);
try {
IDLNameTranslator nameTranslator =
IDLNameTranslatorImpl.get(remoteInterface);
System.out.println(nameTranslator);
} catch(IllegalStateException ise) {
ise.printStackTrace();
}
}
}

View File

@ -43,6 +43,8 @@ import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ;
import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl ;
import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandler ;
import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandlerImpl ;
import java.security.AccessController;
import java.security.PrivilegedAction;
public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory
{
@ -114,24 +116,32 @@ public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory
// which extends org.omg.CORBA.Object. This handler delegates all
// calls directly to a DynamicStubImpl, which extends
// org.omg.CORBA.portable.ObjectImpl.
InvocationHandler dynamicStubHandler =
final InvocationHandler dynamicStubHandler =
DelegateInvocationHandlerImpl.create( stub ) ;
// Create an invocation handler that handles any remote interface
// methods.
InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl(
final InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl(
pm, classData, stub ) ;
// Create a composite handler that handles the DynamicStub interface
// as well as the remote interfaces.
final CompositeInvocationHandler handler =
new CustomCompositeInvocationHandlerImpl( stub ) ;
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
handler.addInvocationHandler( DynamicStub.class,
dynamicStubHandler ) ;
handler.addInvocationHandler( org.omg.CORBA.Object.class,
dynamicStubHandler ) ;
handler.addInvocationHandler( Object.class,
dynamicStubHandler ) ;
return null;
}
});
// If the method passed to invoke is not from DynamicStub or its superclasses,
// it must be from an implemented interface, so we just handle

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,7 @@ import com.sun.corba.se.impl.orbutil.ORBUtility;
/**
* @author Harold Carr
*/
public class SelectorImpl
class SelectorImpl
extends
Thread
implements

View File

@ -36,6 +36,7 @@ import java.lang.reflect.InvocationHandler ;
import com.sun.corba.se.spi.logging.CORBALogDomains ;
import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission;
public class CompositeInvocationHandlerImpl implements
CompositeInvocationHandler
@ -46,11 +47,13 @@ public class CompositeInvocationHandlerImpl implements
public void addInvocationHandler( Class interf,
InvocationHandler handler )
{
checkAccess();
classToInvocationHandler.put( interf, handler ) ;
}
public void setDefaultHandler( InvocationHandler handler )
{
checkAccess();
defaultHandler = handler ;
}
@ -78,4 +81,12 @@ public class CompositeInvocationHandlerImpl implements
return handler.invoke( proxy, method, args ) ;
}
private static final DynamicAccessPermission perm = new DynamicAccessPermission("access");
private void checkAccess() {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(perm);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,6 +34,9 @@ package sun.rmi.rmic.iiop;
import java.io.File;
import java.io.IOException;
import java.io.SerializablePermission;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;
@ -49,6 +52,7 @@ import com.sun.corba.se.impl.util.Utility;
import com.sun.corba.se.impl.util.PackagePrefixChecker;
import sun.rmi.rmic.Main;
/**
* An IIOP stub/tie generator for rmic.
*
@ -78,6 +82,7 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
protected boolean castArray = false;
protected Hashtable transactionalObjects = new Hashtable() ;
protected boolean POATie = false ;
protected boolean emitPermissionCheck = false;
/**
* Default constructor for Main to use.
@ -193,6 +198,9 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
} else if (argv[i].equals("-standardPackage")) {
standardPackage = true;
argv[i] = null;
} else if (argv[i].equals("-emitPermissionCheck")) {
emitPermissionCheck = true;
argv[i] = null;
} else if (arg.equals("-xstubbase")) {
argv[i] = null;
if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
@ -390,9 +398,22 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
writePackageAndImports(p);
// generate
// import java.security.AccessController;
// import java.security.PrivilegedAction;
// import java.io.SerializablePermission;
if (emitPermissionCheck) {
p.pln("import java.security.AccessController;");
p.pln("import java.security.PrivilegedAction;");
p.pln("import java.io.SerializablePermission;");
p.pln();
p.pln();
}
// Declare the stub class; implement all remote interfaces.
p.p("public class " + currentClass);
p.p(" extends " + getName(stubBaseClass));
p.p(" implements ");
if (remoteInterfaces.length > 0) {
@ -422,6 +443,57 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
writeIds( p, theType, false );
p.pln();
if (emitPermissionCheck) {
// produce the following generated code for example
// private static Void checkPermission() {
// SecurityManager sm = System.getSecurityManager();
// if (sm != null) {
// sm.checkPermission(new SerializablePermission(
// "enableSubclassImplementation")); // testing
// }
// return null;
// }
//
// private _XXXXX_Stub(Void ignore) {
// }
//
// public _XXXXX_Stub() {
// this(checkPermission());
// }
//
// where XXXXX is the name of the remote interface
p.pln();
p.plnI("private static Void checkPermission() {");
p.plnI("SecurityManager sm = System.getSecurityManager();");
p.pln("if (sm != null) {");
p.pI();
p.plnI("sm.checkPermission(new SerializablePermission(");
p.plnI("\"enableSubclassImplementation\"));");
p.pO();
p.pO();
p.pOln("}");
p.pln("return null;");
p.pO();
p.pOln("}");
p.pln();
p.pO();
p.pI();
p.pln("private " + currentClass + "(Void ignore) { }");
p.pln();
p.plnI("public " + currentClass + "() { ");
p.pln("this(checkPermission());");
p.pOln("}");
p.pln();
}
if (!emitPermissionCheck) {
p.pI();
}
// Write the _ids() method...
p.plnI("public String[] _ids() { ");
@ -815,7 +887,6 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
CompoundType theType) throws IOException {
// Wtite the method declaration and opening brace...
String methodName = method.getName();
String methodIDLName = method.getIDLName();

View File

@ -385,3 +385,5 @@ c81dd5393a5e333df7cb1f6621f5897ada6522b5 jdk8-b109
562a3d356de67670b4172b82aca2d30743449e04 hs25-b53
f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111
4a845c7a463844cead9e1e1641d6bcfb8a77f1c7 hs25-b54
0ed9a90f45e1b392c671005f9ee22ce1acf02984 jdk8-b112
23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55

View File

@ -0,0 +1,119 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.gc_implementation.g1;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for G1HeapRegionTable. It's essentially an index -> HeapRegion map.
public class G1HeapRegionTable extends VMObject {
// HeapRegion** _base;
static private AddressField baseField;
// uint _length;
static private CIntegerField lengthField;
// HeapRegion** _biased_base
static private AddressField biasedBaseField;
// size_t _bias
static private CIntegerField biasField;
// uint _shift_by
static private CIntegerField shiftByField;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
initialize(VM.getVM().getTypeDataBase());
}
});
}
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("G1HeapRegionTable");
baseField = type.getAddressField("_base");
lengthField = type.getCIntegerField("_length");
biasedBaseField = type.getAddressField("_biased_base");
biasField = type.getCIntegerField("_bias");
shiftByField = type.getCIntegerField("_shift_by");
}
private HeapRegion at(long index) {
Address arrayAddr = baseField.getValue(addr);
// Offset of &_base[index]
long offset = index * VM.getVM().getAddressSize();
Address regionAddr = arrayAddr.getAddressAt(offset);
return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class,
regionAddr);
}
public long length() {
return lengthField.getValue(addr);
}
public long bias() {
return biasField.getValue(addr);
}
public long shiftBy() {
return shiftByField.getValue(addr);
}
private class HeapRegionIterator implements Iterator<HeapRegion> {
private long index;
private long length;
@Override
public boolean hasNext() { return index < length; }
@Override
public HeapRegion next() { return at(index++); }
@Override
public void remove() { /* not supported */ }
HeapRegionIterator(Address addr) {
index = 0;
length = length();
}
}
public Iterator<HeapRegion> heapRegionIterator() {
return new HeapRegionIterator(addr);
}
public G1HeapRegionTable(Address addr) {
super(addr);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,13 +37,11 @@ import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for HeapRegionSeq. It's essentially an index -> HeapRegion map.
// Mirror class for HeapRegionSeq. It essentially encapsulates the G1HeapRegionTable.
public class HeapRegionSeq extends VMObject {
// HeapRegion** _regions;
static private AddressField regionsField;
// uint _length;
static private CIntegerField lengthField;
// G1HeapRegionTable _regions
static private long regionsFieldOffset;
static {
VM.registerVMInitializedObserver(new Observer() {
@ -56,44 +54,21 @@ public class HeapRegionSeq extends VMObject {
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("HeapRegionSeq");
regionsField = type.getAddressField("_regions");
lengthField = type.getCIntegerField("_length");
regionsFieldOffset = type.getField("_regions").getOffset();
}
private HeapRegion at(long index) {
Address arrayAddr = regionsField.getValue(addr);
// Offset of &_region[index]
long offset = index * VM.getVM().getAddressSize();
Address regionAddr = arrayAddr.getAddressAt(offset);
return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class,
regionAddr);
private G1HeapRegionTable regions() {
Address regionsAddr = addr.addOffsetTo(regionsFieldOffset);
return (G1HeapRegionTable) VMObjectFactory.newObject(G1HeapRegionTable.class,
regionsAddr);
}
public long length() {
return lengthField.getValue(addr);
}
private class HeapRegionIterator implements Iterator<HeapRegion> {
private long index;
private long length;
@Override
public boolean hasNext() { return index < length; }
@Override
public HeapRegion next() { return at(index++); }
@Override
public void remove() { /* not supported */ }
HeapRegionIterator(Address addr) {
index = 0;
length = length();
}
return regions().length();
}
public Iterator<HeapRegion> heapRegionIterator() {
return new HeapRegionIterator(addr);
return regions().heapRegionIterator();
}
public HeapRegionSeq(Address addr) {

View File

@ -334,6 +334,11 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_BUILD_DIR)/%.diz
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.diz: $(C2_BUILD_DIR)/%.diz
$(install-file)
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM
$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM: $(C2_BUILD_DIR)/%.dSYM
$(install-dir)
endif
# Client (C1)
@ -379,6 +384,11 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_BUILD_DIR)/%.diz
$(install-file)
$(EXPORT_CLIENT_DIR)/64/%.diz: $(C1_BUILD_DIR)/%.diz
$(install-file)
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM
$(install-dir)
$(EXPORT_CLIENT_DIR)/%.dSYM: $(C1_BUILD_DIR)/%.dSYM
$(install-dir)
endif
# Minimal1
@ -424,6 +434,7 @@ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
$(install-file)
$(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_BUILD_DIR)/%.diz
$(install-file)
# MacOS X does not support Minimal1 config
endif
# Zero
@ -446,6 +457,11 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_BUILD_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(ZERO_BUILD_DIR)/%.diz
$(install-file)
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM
$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM: $(ZERO_BUILD_DIR)/%.dSYM
$(install-dir)
endif
# Shark
@ -468,6 +484,11 @@ $(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_BUILD_DIR)/%.debuginfo
$(install-file)
$(EXPORT_SERVER_DIR)/%.diz: $(SHARK_BUILD_DIR)/%.diz
$(install-file)
# MacOS X
$(EXPORT_JRE_LIB_ARCH_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM
$(install-dir)
$(EXPORT_SERVER_DIR)/%.dSYM: $(SHARK_BUILD_DIR)/%.dSYM
$(install-dir)
endif
$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%

View File

@ -204,6 +204,7 @@ TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE_VARS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
@ -337,9 +338,11 @@ treeminimal1: $(SUBDIRS_MINIMAL1)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
# We specify 'BUILD_FLAVOR=product' so that the proper
# ENABLE_FULL_DEBUG_SYMBOLS value is used.
docs: checks
$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
# Synonyms for win32-like targets.
compiler2: debug product

View File

@ -261,6 +261,16 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
[ -n "$(CFLAGS_BROWSE)" ] && \
echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
[ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
[ -n "$(OBJCOPY)" ] && \
echo && echo "OBJCOPY = $(OBJCOPY)"; \
[ -n "$(STRIP_POLICY)" ] && \
echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
[ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
[ -n "$(ZIPEXE)" ] && \
echo && echo "ZIPEXE = $(ZIPEXE)"; \
[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
echo && \
echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \

View File

@ -136,10 +136,127 @@ ifeq ($(JVM_VARIANTS),)
endif
endif
OS_VENDOR:=$(shell uname -s)
# determine if HotSpot is being built in JDK6 or earlier version
JDK6_OR_EARLIER=0
ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
# if the longer variable names (newer build style) are set, then check those
ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
JDK6_OR_EARLIER=1
endif
else
# the longer variables aren't set so check the shorter variable names
ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
JDK6_OR_EARLIER=1
endif
endif
ifeq ($(JDK6_OR_EARLIER),0)
# Full Debug Symbols is supported on JDK7 or newer.
# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
# builds is enabled with debug info files ZIP'ed to save space. For
# BUILD_FLAVOR != product builds, FDS is always enabled, after all a
# debug build without debug info isn't very useful.
# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
#
# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
# disabled for a BUILD_FLAVOR == product build.
#
# Note: Use of a different variable name for the FDS override option
# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
# in options via environment variables, use of distinct variables
# prevents strange behaviours. For example, in a BUILD_FLAVOR !=
# product build, the FULL_DEBUG_SYMBOLS environment variable will be
# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
# the same variable name is used, then different values can be picked
# up by different parts of the build. Just to be clear, we only need
# two variable names because the incoming option value can be
# overridden in some situations, e.g., a BUILD_FLAVOR != product
# build.
# Due to the multiple sub-make processes that occur this logic gets
# executed multiple times. We reduce the noise by at least checking that
# BUILD_FLAVOR has been set.
ifneq ($(BUILD_FLAVOR),)
ifeq ($(BUILD_FLAVOR), product)
FULL_DEBUG_SYMBOLS ?= 1
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
else
# debug variants always get Full Debug Symbols (if available)
ENABLE_FULL_DEBUG_SYMBOLS = 1
endif
_JUNK_ := $(shell \
echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
# MacOS X doesn't use OBJCOPY or STRIP_POLICY
OBJCOPY=
STRIP_POLICY=
ZIP_DEBUGINFO_FILES ?= 1
else
# Default OBJCOPY comes from GNU Binutils on BSD
ifeq ($(CROSS_COMPILE_ARCH),)
DEF_OBJCOPY=/usr/bin/objcopy
else
# Assume objcopy is part of the cross-compilation toolset
ifneq ($(ALT_COMPILER_PATH),)
DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
endif
endif
OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
ifneq ($(ALT_OBJCOPY),)
_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
endif
ifeq ($(OBJCOPY),)
_JUNK_ := $(shell \
echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \
"files. You may need to set ALT_OBJCOPY.")
ENABLE_FULL_DEBUG_SYMBOLS=0
_JUNK_ := $(shell \
echo >&2 "INFO:" \
"ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
else
_JUNK_ := $(shell \
echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo" \
"files.")
# Library stripping policies for .debuginfo configs:
# all_strip - strips everything from the library
# min_strip - strips most stuff from the library; leaves
# minimum symbols
# no_strip - does not strip the library at all
#
# Oracle security policy requires "all_strip". A waiver was
# granted on 2011.09.01 that permits using "min_strip" in the
# Java JDK and Java JRE.
#
# Currently, STRIP_POLICY is only used when Full Debug Symbols
# is enabled.
#
STRIP_POLICY ?= min_strip
_JUNK_ := $(shell \
echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
ZIP_DEBUGINFO_FILES ?= 1
endif
_JUNK_ := $(shell \
echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
endif
endif # ENABLE_FULL_DEBUG_SYMBOLS=1
endif # BUILD_FLAVOR
endif # JDK_6_OR_EARLIER
JDK_INCLUDE_SUBDIR=bsd
# Library suffix
OS_VENDOR:=$(shell uname -s)
ifeq ($(OS_VENDOR),Darwin)
LIBRARY_SUFFIX=dylib
else
@ -150,6 +267,19 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
else
ifeq ($(OS_VENDOR), Darwin)
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM
else
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
endif
endif
endif
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
@ -157,34 +287,76 @@ EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
else
ifeq ($(OS_VENDOR), Darwin)
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM
else
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
endif
endif
endif
endif
ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
else
ifeq ($(OS_VENDOR), Darwin)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM
else
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
endif
endif
endif
endif
ifeq ($(JVM_VARIANT_MINIMAL1),true)
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
else
EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
endif
endif
endif
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
else
ifeq ($(OS_VENDOR), Darwin)
ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
else
ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
endif
ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/universal = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
else
ifeq ($(OS_VENDOR), Darwin)
ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
else
ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
endif
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ia64 =
ADD_SA_BINARIES/arm =
@ -225,6 +397,19 @@ ifeq ($(OS_VENDOR), Darwin)
# Files to simply copy in place
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.diz
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.diz
else
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
endif
endif
endif
endif

View File

@ -39,9 +39,15 @@ DtraceOutDir = $(GENERATED)/dtracefiles
JVM_DB = libjvm_db
LIBJVM_DB = libjvm_db.dylib
LIBJVM_DB_DEBUGINFO = libjvm_db.dylib.dSYM
LIBJVM_DB_DIZ = libjvm_db.diz
JVM_DTRACE = jvm_dtrace
LIBJVM_DTRACE = libjvm_dtrace.dylib
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.dylib.dSYM
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz
JVMOFFS = JvmOffsets
JVMOFFS.o = $(JVMOFFS).o
GENOFFS = generate$(JVMOFFS)
@ -76,21 +82,87 @@ ISA = $(subst i386,i486,$(BUILDARCH))
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
ifneq ("${ISA}","${BUILDARCH}")
XLIBJVM_DB = 64/$(LIBJVM_DB)
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
XLIBJVM_DIR = 64
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
@echo Making $@
$(QUIETLY) mkdir -p 64/ ; \
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the archived name:
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
$(RM) -r $(XLIBJVM_DB_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the link name:
$(QUIETLY) ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -x $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the archived name:
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
$(RM) $(XLIBJVM_DB_DEBUGINFO)
endif
endif
endif
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo Making $@
$(QUIETLY) mkdir -p 64/ ; \
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the archived name:
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) )
$(RM) -r $(XLIBJVM_DTRACE_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the link name:
( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -x $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
# is not in the archived name:
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) )
$(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
endif
endif
endif
endif # ifneq ("${ISA}","${BUILDARCH}")
@ -134,11 +206,59 @@ $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_D
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
$(RM) -r $(LIBJVM_DB_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -x $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
$(RM) $(LIBJVM_DB_DEBUGINFO)
endif
endif
endif
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO)
$(RM) -r $(LIBJVM_DTRACE_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -x $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO)
$(RM) $(LIBJVM_DTRACE_DEBUGINFO)
endif
endif
endif
#$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
# $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d

View File

@ -83,6 +83,11 @@ ifeq ($(SPEC),)
AS = $(CC) -c
endif
ifeq ($(OS_VENDOR), Darwin)
ifeq ($(DSYMUTIL),)
DSYMUTIL=dsymutil
endif
endif
ifeq ($(USE_CLANG), true)
CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
@ -434,6 +439,36 @@ else
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
endif
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
FASTDEBUG_CFLAGS/ia64 = -g
FASTDEBUG_CFLAGS/amd64 = -g
FASTDEBUG_CFLAGS/arm = -g
FASTDEBUG_CFLAGS/ppc = -g
FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
ifeq ($(USE_CLANG), true)
# Clang doesn't understand -gstabs
FASTDEBUG_CFLAGS += -g
else
FASTDEBUG_CFLAGS += -gstabs
endif
endif
OPT_CFLAGS/ia64 = -g
OPT_CFLAGS/amd64 = -g
OPT_CFLAGS/arm = -g
OPT_CFLAGS/ppc = -g
OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
ifeq ($(USE_CLANG), true)
# Clang doesn't understand -gstabs
OPT_CFLAGS += -g
else
OPT_CFLAGS += -gstabs
endif
endif
endif
endif
# If we are building HEADLESS, pass on to VM

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -29,13 +29,21 @@ JSIG = jsig
ifeq ($(OS_VENDOR), Darwin)
LIBJSIG = lib$(JSIG).dylib
LIBJSIG_DEBUGINFO = lib$(JSIG).dylib.dSYM
LIBJSIG_DIZ = lib$(JSIG).diz
else
LIBJSIG = lib$(JSIG).so
LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo
LIBJSIG_DIZ = lib$(JSIG).diz
endif
JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG)
DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG)
DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO)
DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ)
LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
@ -55,9 +63,42 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
@echo Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
$(RM) -r $(LIBJSIG_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
$(RM) $(LIBJSIG_DEBUGINFO)
endif
endif
endif
install_jsig: $(LIBJSIG)
@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
ifeq ($(OS_VENDOR), Darwin)
$(QUIETLY) test -d $(LIBJSIG_DEBUGINFO) && \
cp -f -r $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
else
$(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \
cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
endif
$(QUIETLY) test -f $(LIBJSIG_DIZ) && \
cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ)
$(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
.PHONY: install_jsig

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -43,15 +43,17 @@ MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-product
SYSDEFS += -DPRODUCT
VERSION = optimized
# use -g to strip library as -x will discard its symbol table; -x is fine for
# executables.
ifdef CROSS_COMPILE_ARCH
STRIP = $(ALT_COMPILER_PATH)/strip
else
STRIP = strip
endif
STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
STRIP_AOUT = $(STRIP) -x $@ || exit 1;
ifneq ($(OS_VENDOR), Darwin)
# use -g to strip library as -x will discard its symbol table; -x is fine for
# executables.
ifdef CROSS_COMPILE_ARCH
STRIP = $(ALT_COMPILER_PATH)/strip
else
STRIP = strip
endif
STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
STRIP_AOUT = $(STRIP) -x $@ || exit 1;
# Don't strip in VM build; JDK build will strip libraries later
# LINK_LIB.CXX/POST_HOOK += $(STRIP_$(LINK_INTO))
# Don't strip in VM build; JDK build will strip libraries later
# LINK_LIB.CXX/POST_HOOK += $(STRIP_$(LINK_INTO))
endif

View File

@ -28,9 +28,15 @@
SAPROC = saproc
ifeq ($(OS_VENDOR), Darwin)
LIBSAPROC = lib$(SAPROC).dylib
LIBSAPROC = lib$(SAPROC).dylib
LIBSAPROC_DEBUGINFO = lib$(SAPROC).dylib.dSYM
LIBSAPROC_DIZ = lib$(SAPROC).diz
else
LIBSAPROC = lib$(SAPROC).so
LIBSAPROC = lib$(SAPROC).so
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
endif
AGENT_DIR = $(GAMMADIR)/agent
@ -70,7 +76,9 @@ endif
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
@ -117,11 +125,42 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
$(SA_DEBUG_CFLAGS) \
-o $@ \
$(SALIBS)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) -r $(LIBSAPROC_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
endif
install_saproc: $(BUILDLIBSAPROC)
$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
@echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"
ifeq ($(OS_VENDOR), Darwin)
$(QUIETLY) test -d $(LIBSAPROC_DEBUGINFO) && \
cp -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
else
$(QUIETLY) test -f $(LIBSAPROC_DEBUGINFO) && \
cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
endif
$(QUIETLY) test -f $(LIBSAPROC_DIZ) && \
cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ)
$(QUIETLY) cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"
.PHONY: install_saproc

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -19,7 +19,7 @@
# 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.
#
#
#
# macosx universal builds
@ -35,15 +35,15 @@ universal_debug:
all_product_universal:
# $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_PRODUCT_TARGETS)
$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_PRODUCT_TARGETS)
$(QUIETLY) $(MAKE) EXPORT_SUBDIR= universalize
$(QUIETLY) $(MAKE) BUILD_FLAVOR=product EXPORT_SUBDIR= universalize
all_fastdebug_universal:
# $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_FASTDEBUG_TARGETS)
$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_FASTDEBUG_TARGETS)
$(QUIETLY) $(MAKE) EXPORT_SUBDIR=/fastdebug universalize
$(QUIETLY) $(MAKE) BUILD_FLAVOR=fastdebug EXPORT_SUBDIR=/fastdebug universalize
all_debug_universal:
# $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 $(COMMON_VM_DEBUG_TARGETS)
$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 $(COMMON_VM_DEBUG_TARGETS)
$(QUIETLY) $(MAKE) EXPORT_SUBDIR=/debug universalize
$(QUIETLY) $(MAKE) BUILD_FLAVOR=debug EXPORT_SUBDIR=/debug universalize
# Consolidate architecture builds into a single Universal binary
@ -57,18 +57,18 @@ $(UNIVERSAL_LIPO_LIST):
if [ -n "$${BUILT_LIPO_FILES}" ]; then \
$(MKDIR) -p $(shell dirname $@); \
lipo -create -output $@ $${BUILT_LIPO_FILES}; \
fi
fi
# Copy built non-universal binaries in place
# - copies directories; including empty dirs
# - copies files, symlinks, other non-directory files
$(UNIVERSAL_COPY_LIST):
BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \
BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) -prune 2>/dev/null`"; \
if [ -n "$${BUILT_COPY_FILES}" ]; then \
for i in $${BUILT_COPY_FILES}; do \
if [ -f $${i} ]; then \
$(MKDIR) -p $(shell dirname $@); \
$(CP) $${i} $@; \
fi; \
$(MKDIR) -p $(shell dirname $@); \
$(CP) -R $${i} $@; \
done; \
fi

View File

@ -60,10 +60,16 @@ Src_Dirs_I += $(GENERATED)
# The order is important for the precompiled headers to work.
INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
ifeq (${VERSION}, debug)
# SYMFLAG is used by {jsig,saproc}.make
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# always build with debug info when we can create .dSYM/.debuginfo files
SYMFLAG = -g
else
SYMFLAG =
ifeq (${VERSION}, debug)
SYMFLAG = -g
else
SYMFLAG =
endif
endif
# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
@ -147,8 +153,14 @@ ifeq ($(OS_VENDOR), Darwin)
ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug))
CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
endif
LIBJVM_DEBUGINFO = lib$(JVM).dylib.dSYM
LIBJVM_DIZ = lib$(JVM).diz
else
LIBJVM = lib$(JVM).so
LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
LIBJVM_DIZ = lib$(JVM).diz
endif
SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
@ -322,10 +334,47 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
rm -f $@.1; ln -s $@ $@.1; \
}
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
$(RM) -r $(LIBJVM_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
$(RM) $(LIBJVM_DEBUGINFO)
endif
endif
endif
DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR)
DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM)
DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
install_jvm: $(LIBJVM)
@echo "Copying $(LIBJVM) to $(DEST_JVM)"
ifeq ($(OS_VENDOR), Darwin)
$(QUIETLY) test -d $(LIBJVM_DEBUGINFO) && \
cp -f -r $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
else
$(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \
cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
endif
$(QUIETLY) test -f $(LIBJVM_DIZ) && \
cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ)
$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
#----------------------------------------------------------------------
@ -340,11 +389,8 @@ include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
ifeq ($(OS_VENDOR), Darwin)
$(LIBJVM).dSYM: $(LIBJVM)
dsymutil $(LIBJVM)
# no libjvm_db for macosx
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(LIBJVM).dSYM
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck
echo "Doing vm.make build:"
else
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)

View File

@ -77,6 +77,16 @@ define install-file
@$(RM) $@
$(CP) $< $@
endef
# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead.
# May need to have a MacOS X specific definition of install-dir
# sometime in the future.
define install-dir
@$(MKDIR) -p $(@D)
@$(RM) -r $@
$(CP) -r $< $@
endef
define prep-target
@$(MKDIR) -p $(@D)
@$(RM) $@

View File

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25
HS_MINOR_VER=0
HS_BUILD_NUMBER=54
HS_BUILD_NUMBER=55
JDK_MAJOR_VER=1
JDK_MINOR_VER=8

View File

@ -181,6 +181,7 @@ DEBUG_OPT_OPTION = /Od
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2005"
@ -199,6 +200,7 @@ LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
!if "x$(MT)" == "x"
MT=mt.exe
!endif
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2008"
@ -213,6 +215,7 @@ MP_FLAG = /MP
!if "x$(MT)" == "x"
MT=mt.exe
!endif
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2010"
@ -244,9 +247,11 @@ MP_FLAG = /MP
!if "x$(MT)" == "x"
MT=mt.exe
!endif
!if "$(BUILDARCH)" == "i486"
LD_FLAGS = /SAFESEH $(LD_FLAGS)
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(BUILDARCH)" == "i486"
LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS)
!endif
CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)

View File

@ -110,6 +110,9 @@ SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE)
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
SA_LFLAGS = $(SA_LFLAGS) -map -debug
!endif
!if "$(BUILDARCH)" == "i486"
SA_LFLAGS = $(SAFESEH_FLAG) $(SA_LFLAGS)
!endif
SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG)

View File

@ -3100,6 +3100,10 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
}
}
void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
fatal("Type profiling not implemented on this platform");
}
void LIR_Assembler::align_backward_branch_target() {
__ align(OptoLoopAlignment);
}

View File

@ -1076,6 +1076,25 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) {
__ verify_not_null_oop(Oexception);
#ifdef ASSERT
// check that fields in JavaThread for exception oop and issuing pc are
// empty before writing to them
Label oop_empty;
Register scratch = I7; // We can use I7 here because it's overwritten later anyway.
__ ld_ptr(Address(G2_thread, JavaThread::exception_oop_offset()), scratch);
__ br_null(scratch, false, Assembler::pt, oop_empty);
__ delayed()->nop();
__ stop("exception oop already set");
__ bind(oop_empty);
Label pc_empty;
__ ld_ptr(Address(G2_thread, JavaThread::exception_pc_offset()), scratch);
__ br_null(scratch, false, Assembler::pt, pc_empty);
__ delayed()->nop();
__ stop("exception pc already set");
__ bind(pc_empty);
#endif
// save the exception and issuing pc in the thread
__ st_ptr(Oexception, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
__ st_ptr(Oissuing_pc, G2_thread, in_bytes(JavaThread::exception_pc_offset()));

View File

@ -76,6 +76,8 @@ define_pd_global(bool, UseMembar, false);
// GC Ergo Flags
define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread
define_pd_global(uintx, TypeProfileLevel, 0);
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
\
product(intx, UseVIS, 99, \

View File

@ -3581,6 +3581,7 @@ void SharedRuntime::generate_deopt_blob() {
// the pending exception will be picked up the interpreter.
__ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception);
__ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
__ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_pc_offset()));
__ bind(noException);
// deallocate the deoptimization frame taking care to preserve the return values

View File

@ -3632,6 +3632,161 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
}
}
void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) {
Register obj = op->obj()->as_register();
Register tmp = op->tmp()->as_pointer_register();
Address mdo_addr = as_Address(op->mdp()->as_address_ptr());
ciKlass* exact_klass = op->exact_klass();
intptr_t current_klass = op->current_klass();
bool not_null = op->not_null();
bool no_conflict = op->no_conflict();
Label update, next, none;
bool do_null = !not_null;
bool exact_klass_set = exact_klass != NULL && ciTypeEntries::valid_ciklass(current_klass) == exact_klass;
bool do_update = !TypeEntries::is_type_unknown(current_klass) && !exact_klass_set;
assert(do_null || do_update, "why are we here?");
assert(!TypeEntries::was_null_seen(current_klass) || do_update, "why are we here?");
__ verify_oop(obj);
if (tmp != obj) {
__ mov(tmp, obj);
}
if (do_null) {
__ testptr(tmp, tmp);
__ jccb(Assembler::notZero, update);
if (!TypeEntries::was_null_seen(current_klass)) {
__ orptr(mdo_addr, TypeEntries::null_seen);
}
if (do_update) {
#ifndef ASSERT
__ jmpb(next);
}
#else
__ jmp(next);
}
} else {
__ testptr(tmp, tmp);
__ jccb(Assembler::notZero, update);
__ stop("unexpect null obj");
#endif
}
__ bind(update);
if (do_update) {
#ifdef ASSERT
if (exact_klass != NULL) {
Label ok;
__ load_klass(tmp, tmp);
__ push(tmp);
__ mov_metadata(tmp, exact_klass->constant_encoding());
__ cmpptr(tmp, Address(rsp, 0));
__ jccb(Assembler::equal, ok);
__ stop("exact klass and actual klass differ");
__ bind(ok);
__ pop(tmp);
}
#endif
if (!no_conflict) {
if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) {
if (exact_klass != NULL) {
__ mov_metadata(tmp, exact_klass->constant_encoding());
} else {
__ load_klass(tmp, tmp);
}
__ xorptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_klass_mask);
// klass seen before, nothing to do. The unknown bit may have been
// set already but no need to check.
__ jccb(Assembler::zero, next);
__ testptr(tmp, TypeEntries::type_unknown);
__ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore.
if (TypeEntries::is_type_none(current_klass)) {
__ cmpptr(mdo_addr, 0);
__ jccb(Assembler::equal, none);
__ cmpptr(mdo_addr, TypeEntries::null_seen);
__ jccb(Assembler::equal, none);
// There is a chance that the checks above (re-reading profiling
// data from memory) fail if another thread has just set the
// profiling to this obj's klass
__ xorptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_klass_mask);
__ jccb(Assembler::zero, next);
}
} else {
assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only");
__ movptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_unknown);
__ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore.
}
// different than before. Cannot keep accurate profile.
__ orptr(mdo_addr, TypeEntries::type_unknown);
if (TypeEntries::is_type_none(current_klass)) {
__ jmpb(next);
__ bind(none);
// first time here. Set profile type.
__ movptr(mdo_addr, tmp);
}
} else {
// There's a single possible klass at this profile point
assert(exact_klass != NULL, "should be");
if (TypeEntries::is_type_none(current_klass)) {
__ mov_metadata(tmp, exact_klass->constant_encoding());
__ xorptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_klass_mask);
#ifdef ASSERT
__ jcc(Assembler::zero, next);
{
Label ok;
__ push(tmp);
__ cmpptr(mdo_addr, 0);
__ jcc(Assembler::equal, ok);
__ cmpptr(mdo_addr, TypeEntries::null_seen);
__ jcc(Assembler::equal, ok);
// may have been set by another thread
__ mov_metadata(tmp, exact_klass->constant_encoding());
__ xorptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_mask);
__ jcc(Assembler::zero, ok);
__ stop("unexpected profiling mismatch");
__ bind(ok);
__ pop(tmp);
}
#else
__ jccb(Assembler::zero, next);
#endif
// first time here. Set profile type.
__ movptr(mdo_addr, tmp);
} else {
assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent");
__ movptr(tmp, mdo_addr);
__ testptr(tmp, TypeEntries::type_unknown);
__ jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore.
__ orptr(mdo_addr, TypeEntries::type_unknown);
}
}
__ bind(next);
}
}
void LIR_Assembler::emit_delay(LIR_OpDelay*) {
Unimplemented();
}

View File

@ -79,6 +79,8 @@ define_pd_global(bool, UseMembar, false);
// GC Ergo Flags
define_pd_global(uintx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread
define_pd_global(uintx, TypeProfileLevel, 11);
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) \
\
develop(bool, IEEEPrecision, true, \

View File

@ -1046,6 +1046,158 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) {
}
}
void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
Label update, next, none;
verify_oop(obj);
testptr(obj, obj);
jccb(Assembler::notZero, update);
orptr(mdo_addr, TypeEntries::null_seen);
jmpb(next);
bind(update);
load_klass(obj, obj);
xorptr(obj, mdo_addr);
testptr(obj, TypeEntries::type_klass_mask);
jccb(Assembler::zero, next); // klass seen before, nothing to
// do. The unknown bit may have been
// set already but no need to check.
testptr(obj, TypeEntries::type_unknown);
jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore.
cmpptr(mdo_addr, 0);
jccb(Assembler::equal, none);
cmpptr(mdo_addr, TypeEntries::null_seen);
jccb(Assembler::equal, none);
// There is a chance that the checks above (re-reading profiling
// data from memory) fail if another thread has just set the
// profiling to this obj's klass
xorptr(obj, mdo_addr);
testptr(obj, TypeEntries::type_klass_mask);
jccb(Assembler::zero, next);
// different than before. Cannot keep accurate profile.
orptr(mdo_addr, TypeEntries::type_unknown);
jmpb(next);
bind(none);
// first time here. Set profile type.
movptr(mdo_addr, obj);
bind(next);
}
void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual) {
if (!ProfileInterpreter) {
return;
}
if (MethodData::profile_arguments() || MethodData::profile_return()) {
Label profile_continue;
test_method_data_pointer(mdp, profile_continue);
int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
cmpb(Address(mdp, in_bytes(DataLayout::tag_offset()) - off_to_start), is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
jcc(Assembler::notEqual, profile_continue);
if (MethodData::profile_arguments()) {
Label done;
int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset());
addptr(mdp, off_to_args);
for (int i = 0; i < TypeProfileArgsLimit; i++) {
if (i > 0 || MethodData::profile_return()) {
// If return value type is profiled we may have no argument to profile
movl(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
subl(tmp, i*TypeStackSlotEntries::per_arg_count());
cmpl(tmp, TypeStackSlotEntries::per_arg_count());
jcc(Assembler::less, done);
}
movptr(tmp, Address(callee, Method::const_offset()));
load_unsigned_short(tmp, Address(tmp, ConstMethod::size_of_parameters_offset()));
// stack offset o (zero based) from the start of the argument
// list, for n arguments translates into offset n - o - 1 from
// the end of the argument list
subl(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))-off_to_args));
subl(tmp, 1);
Address arg_addr = argument_address(tmp);
movptr(tmp, arg_addr);
Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args);
profile_obj_type(tmp, mdo_arg_addr);
int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
addptr(mdp, to_add);
off_to_args += to_add;
}
if (MethodData::profile_return()) {
movl(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
subl(tmp, TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
}
bind(done);
if (MethodData::profile_return()) {
// We're right after the type profile for the last
// argument. tmp is the number of cell left in the
// CallTypeData/VirtualCallTypeData to reach its end. Non null
// if there's a return to profile.
assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
shll(tmp, exact_log2(DataLayout::cell_size));
addptr(mdp, tmp);
}
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp);
} else {
assert(MethodData::profile_return(), "either profile call args or call ret");
update_mdp_by_constant(mdp, in_bytes(ReturnTypeEntry::size()));
}
// mdp points right after the end of the
// CallTypeData/VirtualCallTypeData, right after the cells for the
// return value type if there's one
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret, Register tmp) {
assert_different_registers(mdp, ret, tmp, rsi);
if (ProfileInterpreter && MethodData::profile_return()) {
Label profile_continue, done;
test_method_data_pointer(mdp, profile_continue);
if (MethodData::profile_return_jsr292_only()) {
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
// type because we're right after it and we don't known its
// length
Label do_profile;
cmpb(Address(rsi, 0), Bytecodes::_invokedynamic);
jcc(Assembler::equal, do_profile);
cmpb(Address(rsi, 0), Bytecodes::_invokehandle);
jcc(Assembler::equal, do_profile);
get_method(tmp);
cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
jcc(Assembler::notEqual, profile_continue);
bind(do_profile);
}
Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
mov(tmp, ret);
profile_obj_type(tmp, mdo_ret_addr);
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_call(Register mdp) {
if (ProfileInterpreter) {

View File

@ -215,6 +215,9 @@ class InterpreterMacroAssembler: public MacroAssembler {
void profile_taken_branch(Register mdp, Register bumped_count);
void profile_not_taken_branch(Register mdp);
void profile_obj_type(Register obj, const Address& mdo_addr);
void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
void profile_return_type(Register mdp, Register ret, Register tmp);
void profile_call(Register mdp);
void profile_final_call(Register mdp);
void profile_virtual_call(Register receiver, Register mdp, Register scratch2,

View File

@ -1067,6 +1067,159 @@ void InterpreterMacroAssembler::profile_not_taken_branch(Register mdp) {
}
}
void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
Label update, next, none;
verify_oop(obj);
testptr(obj, obj);
jccb(Assembler::notZero, update);
orptr(mdo_addr, TypeEntries::null_seen);
jmpb(next);
bind(update);
load_klass(obj, obj);
xorptr(obj, mdo_addr);
testptr(obj, TypeEntries::type_klass_mask);
jccb(Assembler::zero, next); // klass seen before, nothing to
// do. The unknown bit may have been
// set already but no need to check.
testptr(obj, TypeEntries::type_unknown);
jccb(Assembler::notZero, next); // already unknown. Nothing to do anymore.
// There is a chance that by the time we do these checks (re-reading
// profiling data from memory) another thread has set the profling
// to this obj's klass and we set the profiling as unknow
// erroneously
cmpptr(mdo_addr, 0);
jccb(Assembler::equal, none);
cmpptr(mdo_addr, TypeEntries::null_seen);
jccb(Assembler::equal, none);
// There is a chance that the checks above (re-reading profiling
// data from memory) fail if another thread has just set the
// profiling to this obj's klass
xorptr(obj, mdo_addr);
testptr(obj, TypeEntries::type_klass_mask);
jccb(Assembler::zero, next);
// different than before. Cannot keep accurate profile.
orptr(mdo_addr, TypeEntries::type_unknown);
jmpb(next);
bind(none);
// first time here. Set profile type.
movptr(mdo_addr, obj);
bind(next);
}
void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual) {
if (!ProfileInterpreter) {
return;
}
if (MethodData::profile_arguments() || MethodData::profile_return()) {
Label profile_continue;
test_method_data_pointer(mdp, profile_continue);
int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
cmpb(Address(mdp, in_bytes(DataLayout::tag_offset()) - off_to_start), is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
jcc(Assembler::notEqual, profile_continue);
if (MethodData::profile_arguments()) {
Label done;
int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset());
addptr(mdp, off_to_args);
for (int i = 0; i < TypeProfileArgsLimit; i++) {
if (i > 0 || MethodData::profile_return()) {
// If return value type is profiled we may have no argument to profile
movq(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
subl(tmp, i*TypeStackSlotEntries::per_arg_count());
cmpl(tmp, TypeStackSlotEntries::per_arg_count());
jcc(Assembler::less, done);
}
movptr(tmp, Address(callee, Method::const_offset()));
load_unsigned_short(tmp, Address(tmp, ConstMethod::size_of_parameters_offset()));
subq(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))-off_to_args));
subl(tmp, 1);
Address arg_addr = argument_address(tmp);
movptr(tmp, arg_addr);
Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args);
profile_obj_type(tmp, mdo_arg_addr);
int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
addptr(mdp, to_add);
off_to_args += to_add;
}
if (MethodData::profile_return()) {
movq(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
subl(tmp, TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
}
bind(done);
if (MethodData::profile_return()) {
// We're right after the type profile for the last
// argument. tmp is the number of cell left in the
// CallTypeData/VirtualCallTypeData to reach its end. Non null
// if there's a return to profile.
assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
shll(tmp, exact_log2(DataLayout::cell_size));
addptr(mdp, tmp);
}
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp);
} else {
assert(MethodData::profile_return(), "either profile call args or call ret");
update_mdp_by_constant(mdp, in_bytes(ReturnTypeEntry::size()));
}
// mdp points right after the end of the
// CallTypeData/VirtualCallTypeData, right after the cells for the
// return value type if there's one
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret, Register tmp) {
assert_different_registers(mdp, ret, tmp, r13);
if (ProfileInterpreter && MethodData::profile_return()) {
Label profile_continue, done;
test_method_data_pointer(mdp, profile_continue);
if (MethodData::profile_return_jsr292_only()) {
// If we don't profile all invoke bytecodes we must make sure
// it's a bytecode we indeed profile. We can't go back to the
// begining of the ProfileData we intend to update to check its
// type because we're right after it and we don't known its
// length
Label do_profile;
cmpb(Address(r13, 0), Bytecodes::_invokedynamic);
jcc(Assembler::equal, do_profile);
cmpb(Address(r13, 0), Bytecodes::_invokehandle);
jcc(Assembler::equal, do_profile);
get_method(tmp);
cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
jcc(Assembler::notEqual, profile_continue);
bind(do_profile);
}
Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
mov(tmp, ret);
profile_obj_type(tmp, mdo_ret_addr);
bind(profile_continue);
}
}
void InterpreterMacroAssembler::profile_call(Register mdp) {
if (ProfileInterpreter) {

View File

@ -224,6 +224,9 @@ class InterpreterMacroAssembler: public MacroAssembler {
void profile_taken_branch(Register mdp, Register bumped_count);
void profile_not_taken_branch(Register mdp);
void profile_obj_type(Register obj, const Address& mdo_addr);
void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
void profile_return_type(Register mdp, Register ret, Register tmp);
void profile_call(Register mdp);
void profile_final_call(Register mdp);
void profile_virtual_call(Register receiver, Register mdp,

View File

@ -773,6 +773,7 @@ class MacroAssembler: public Assembler {
void orptr(Register dst, Address src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); }
void orptr(Register dst, Register src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); }
void orptr(Register dst, int32_t src) { LP64_ONLY(orq(dst, src)) NOT_LP64(orl(dst, src)); }
void orptr(Address dst, int32_t imm32) { LP64_ONLY(orq(dst, imm32)) NOT_LP64(orl(dst, imm32)); }
void testptr(Register src, int32_t imm32) { LP64_ONLY(testq(src, imm32)) NOT_LP64(testl(src, imm32)); }
void testptr(Register src1, Register src2);

View File

@ -194,6 +194,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ restore_bcp();
__ restore_locals();
if (incoming_state == atos) {
Register mdp = rbx;
Register tmp = rcx;
__ profile_return_type(mdp, rax, tmp);
}
Label L_got_cache, L_giant_index;
if (EnableInvokeDynamic) {
__ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic);

View File

@ -177,6 +177,12 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
__ restore_bcp();
__ restore_locals();
if (state == atos) {
Register mdp = rbx;
Register tmp = rcx;
__ profile_return_type(mdp, rax, tmp);
}
Label L_got_cache, L_giant_index;
if (EnableInvokeDynamic) {
__ cmpb(Address(r13, 0), Bytecodes::_invokedynamic);

View File

@ -2970,6 +2970,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// profile this call
__ profile_final_call(rax);
__ profile_arguments_type(rax, method, rsi, true);
__ jump_from_interpreted(method, rax);
@ -2984,6 +2985,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// get target Method* & entry point
__ lookup_virtual_method(rax, index, method);
__ profile_arguments_type(rdx, method, rsi, true);
__ jump_from_interpreted(method, rdx);
}
@ -3013,6 +3015,7 @@ void TemplateTable::invokespecial(int byte_no) {
__ null_check(rcx);
// do the call
__ profile_call(rax);
__ profile_arguments_type(rax, rbx, rsi, false);
__ jump_from_interpreted(rbx, rax);
}
@ -3023,6 +3026,7 @@ void TemplateTable::invokestatic(int byte_no) {
prepare_invoke(byte_no, rbx); // get f1 Method*
// do the call
__ profile_call(rax);
__ profile_arguments_type(rax, rbx, rsi, false);
__ jump_from_interpreted(rbx, rax);
}
@ -3082,6 +3086,8 @@ void TemplateTable::invokeinterface(int byte_no) {
__ testptr(rbx, rbx);
__ jcc(Assembler::zero, no_such_method);
__ profile_arguments_type(rdx, rbx, rsi, true);
// do the call
// rcx: receiver
// rbx,: Method*
@ -3138,6 +3144,7 @@ void TemplateTable::invokehandle(int byte_no) {
// FIXME: profile the LambdaForm also
__ profile_final_call(rax);
__ profile_arguments_type(rdx, rbx_method, rsi, true);
__ jump_from_interpreted(rbx_method, rdx);
}
@ -3171,6 +3178,7 @@ void TemplateTable::invokedynamic(int byte_no) {
// %%% should make a type profile for any invokedynamic that takes a ref argument
// profile this call
__ profile_call(rsi);
__ profile_arguments_type(rdx, rbx, rsi, false);
__ verify_oop(rax_callsite);

View File

@ -3026,6 +3026,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// profile this call
__ profile_final_call(rax);
__ profile_arguments_type(rax, method, r13, true);
__ jump_from_interpreted(method, rax);
@ -3040,6 +3041,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// get target Method* & entry point
__ lookup_virtual_method(rax, index, method);
__ profile_arguments_type(rdx, method, r13, true);
__ jump_from_interpreted(method, rdx);
}
@ -3069,6 +3071,7 @@ void TemplateTable::invokespecial(int byte_no) {
__ null_check(rcx);
// do the call
__ profile_call(rax);
__ profile_arguments_type(rax, rbx, r13, false);
__ jump_from_interpreted(rbx, rax);
}
@ -3079,6 +3082,7 @@ void TemplateTable::invokestatic(int byte_no) {
prepare_invoke(byte_no, rbx); // get f1 Method*
// do the call
__ profile_call(rax);
__ profile_arguments_type(rax, rbx, r13, false);
__ jump_from_interpreted(rbx, rax);
}
@ -3136,6 +3140,8 @@ void TemplateTable::invokeinterface(int byte_no) {
__ testptr(rbx, rbx);
__ jcc(Assembler::zero, no_such_method);
__ profile_arguments_type(rdx, rbx, r13, true);
// do the call
// rcx: receiver
// rbx,: Method*
@ -3193,6 +3199,7 @@ void TemplateTable::invokehandle(int byte_no) {
// FIXME: profile the LambdaForm also
__ profile_final_call(rax);
__ profile_arguments_type(rdx, rbx_method, r13, true);
__ jump_from_interpreted(rbx_method, rdx);
}
@ -3226,6 +3233,7 @@ void TemplateTable::invokedynamic(int byte_no) {
// %%% should make a type profile for any invokedynamic that takes a ref argument
// profile this call
__ profile_call(r13);
__ profile_arguments_type(rdx, rbx_method, r13, false);
__ verify_oop(rax_callsite);

View File

@ -159,9 +159,21 @@ julong os::available_memory() {
return Bsd::available_memory();
}
// available here means free
julong os::Bsd::available_memory() {
// XXXBSD: this is just a stopgap implementation
return physical_memory() >> 2;
uint64_t available = physical_memory() >> 2;
#ifdef __APPLE__
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
vm_statistics64_data_t vmstat;
kern_return_t kerr = host_statistics64(mach_host_self(), HOST_VM_INFO64,
(host_info64_t)&vmstat, &count);
assert(kerr == KERN_SUCCESS,
"host_statistics64 failed - check mach_host_self() and count");
if (kerr == KERN_SUCCESS) {
available = vmstat.free_count * os::vm_page_size();
}
#endif
return available;
}
julong os::physical_memory() {

View File

@ -935,6 +935,7 @@ void Canonicalizer::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {}
void Canonicalizer::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {}
void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void Canonicalizer::do_ProfileCall(ProfileCall* x) {}
void Canonicalizer::do_ProfileReturnType(ProfileReturnType* x) {}
void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {}
void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {}
void Canonicalizer::do_RangeCheckPredicate(RangeCheckPredicate* x) {}

View File

@ -104,6 +104,7 @@ class Canonicalizer: InstructionVisitor {
virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileReturnType (ProfileReturnType* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);

View File

@ -601,6 +601,17 @@ void Compilation::bailout(const char* msg) {
}
}
ciKlass* Compilation::cha_exact_type(ciType* type) {
if (type != NULL && type->is_loaded() && type->is_instance_klass()) {
ciInstanceKlass* ik = type->as_instance_klass();
assert(ik->exact_klass() == NULL, "no cha for final klass");
if (DeoptC1 && UseCHA && !(ik->has_subklass() || ik->is_interface())) {
dependency_recorder()->assert_leaf_type(ik);
return ik;
}
}
return NULL;
}
void Compilation::print_timers() {
// tty->print_cr(" Native methods : %6.3f s, Average : %2.3f", CompileBroker::_t_native_compilation.seconds(), CompileBroker::_t_native_compilation.seconds() / CompileBroker::_total_native_compile_count);

View File

@ -246,6 +246,8 @@ class Compilation: public StackObj {
(RangeCheckElimination || UseLoopInvariantCodeMotion) &&
method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
}
ciKlass* cha_exact_type(ciType* type);
};

View File

@ -42,26 +42,16 @@
#include "runtime/interfaceSupport.hpp"
#include "runtime/sharedRuntime.hpp"
volatile int Compiler::_runtimes = uninitialized;
Compiler::Compiler() {
}
Compiler::Compiler () {}
Compiler::~Compiler() {
Unimplemented();
}
void Compiler::initialize_all() {
void Compiler::init_c1_runtime() {
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
Arena* arena = new (mtCompiler) Arena();
Runtime1::initialize(buffer_blob);
FrameMap::initialize();
// initialize data structures
ValueType::initialize(arena);
// Instruction::initialize();
// BlockBegin::initialize();
GraphBuilder::initialize();
// note: to use more than one instance of LinearScan at a time this function call has to
// be moved somewhere outside of this constructor:
@ -70,32 +60,33 @@ void Compiler::initialize_all() {
void Compiler::initialize() {
if (_runtimes != initialized) {
initialize_runtimes( initialize_all, &_runtimes);
// Buffer blob must be allocated per C1 compiler thread at startup
BufferBlob* buffer_blob = init_buffer_blob();
if (should_perform_init()) {
if (buffer_blob == NULL) {
// When we come here we are in state 'initializing'; entire C1 compilation
// can be shut down.
set_state(failed);
} else {
init_c1_runtime();
set_state(initialized);
}
}
mark_initialized();
}
BufferBlob* Compiler::get_buffer_blob(ciEnv* env) {
BufferBlob* Compiler::init_buffer_blob() {
// Allocate buffer blob once at startup since allocation for each
// compilation seems to be too expensive (at least on Intel win32).
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
if (buffer_blob != NULL) {
return buffer_blob;
}
assert (CompilerThread::current()->get_buffer_blob() == NULL, "Should initialize only once");
// setup CodeBuffer. Preallocate a BufferBlob of size
// NMethodSizeLimit plus some extra space for constants.
int code_buffer_size = Compilation::desired_max_code_buffer_size() +
Compilation::desired_max_constant_size();
buffer_blob = BufferBlob::create("Compiler1 temporary CodeBuffer",
code_buffer_size);
if (buffer_blob == NULL) {
CompileBroker::handle_full_code_cache();
env->record_failure("CodeCache is full");
} else {
BufferBlob* buffer_blob = BufferBlob::create("C1 temporary CodeBuffer", code_buffer_size);
if (buffer_blob != NULL) {
CompilerThread::current()->set_buffer_blob(buffer_blob);
}
@ -104,15 +95,8 @@ BufferBlob* Compiler::get_buffer_blob(ciEnv* env) {
void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
BufferBlob* buffer_blob = Compiler::get_buffer_blob(env);
if (buffer_blob == NULL) {
return;
}
if (!is_initialized()) {
initialize();
}
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
assert(buffer_blob != NULL, "Must exist");
// invoke compilation
{
// We are nested here because we need for the destructor

View File

@ -30,11 +30,9 @@
// There is one instance of the Compiler per CompilerThread.
class Compiler: public AbstractCompiler {
private:
// Tracks whether runtime has been initialized
static volatile int _runtimes;
static void init_c1_runtime();
BufferBlob* init_buffer_blob();
public:
// Creation
@ -46,19 +44,12 @@ class Compiler: public AbstractCompiler {
virtual bool is_c1() { return true; };
BufferBlob* get_buffer_blob(ciEnv* env);
// Missing feature tests
virtual bool supports_native() { return true; }
virtual bool supports_osr () { return true; }
// Customization
virtual bool needs_adapters () { return false; }
virtual bool needs_stubs () { return false; }
// Initialization
virtual void initialize();
static void initialize_all();
// Compilation entry point for methods
virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);

View File

@ -1466,9 +1466,22 @@ void GraphBuilder::method_return(Value x) {
// State at end of inlined method is the state of the caller
// without the method parameters on stack, including the
// return value, if any, of the inlined method on operand stack.
int invoke_bci = state()->caller_state()->bci();
set_state(state()->caller_state()->copy_for_parsing());
if (x != NULL) {
state()->push(x->type(), x);
if (profile_calls() && MethodData::profile_return() && x->type()->is_object_kind()) {
ciMethod* caller = state()->scope()->method();
ciMethodData* md = caller->method_data_or_null();
ciProfileData* data = md->bci_to_data(invoke_bci);
if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return();
// May not be true in case of an inlined call through a method handle intrinsic.
if (has_return) {
profile_return_type(x, method(), caller, invoke_bci);
}
}
}
}
Goto* goto_callee = new Goto(continuation(), false);
@ -1658,6 +1671,42 @@ Dependencies* GraphBuilder::dependency_recorder() const {
return compilation()->dependency_recorder();
}
// How many arguments do we want to profile?
Values* GraphBuilder::args_list_for_profiling(int& start, bool may_have_receiver) {
int n = 0;
assert(start == 0, "should be initialized");
if (MethodData::profile_arguments()) {
ciProfileData* data = method()->method_data()->bci_to_data(bci());
if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
n = data->is_CallTypeData() ? data->as_CallTypeData()->number_of_arguments() : data->as_VirtualCallTypeData()->number_of_arguments();
bool has_receiver = may_have_receiver && Bytecodes::has_receiver(method()->java_code_at_bci(bci()));
start = has_receiver ? 1 : 0;
}
}
if (n > 0) {
return new Values(n);
}
return NULL;
}
// Collect arguments that we want to profile in a list
Values* GraphBuilder::collect_args_for_profiling(Values* args, bool may_have_receiver) {
int start = 0;
Values* obj_args = args_list_for_profiling(start, may_have_receiver);
if (obj_args == NULL) {
return NULL;
}
int s = obj_args->size();
for (int i = start, j = 0; j < s; i++) {
if (args->at(i)->type()->is_object_kind()) {
obj_args->push(args->at(i));
j++;
}
}
assert(s == obj_args->length(), "missed on arg?");
return obj_args;
}
void GraphBuilder::invoke(Bytecodes::Code code) {
bool will_link;
@ -1957,7 +2006,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
} else if (exact_target != NULL) {
target_klass = exact_target->holder();
}
profile_call(target, recv, target_klass);
profile_call(target, recv, target_klass, collect_args_for_profiling(args, false), false);
}
}
@ -1972,6 +2021,9 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
push(result_type, result);
}
}
if (profile_calls() && MethodData::profile_return() && result_type->is_object_kind()) {
profile_return_type(result, target);
}
}
@ -3509,7 +3561,7 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
recv = args->at(0);
null_check(recv);
}
profile_call(callee, recv, NULL);
profile_call(callee, recv, NULL, collect_args_for_profiling(args, true), true);
}
}
}
@ -3520,6 +3572,10 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
Value value = append_split(result);
if (result_type != voidType) push(result_type, value);
if (callee != method() && profile_calls() && MethodData::profile_return() && result_type->is_object_kind()) {
profile_return_type(result, callee);
}
// done
return true;
}
@ -3763,7 +3819,28 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
compilation()->set_would_profile(true);
if (profile_calls()) {
profile_call(callee, recv, holder_known ? callee->holder() : NULL);
int start = 0;
Values* obj_args = args_list_for_profiling(start, has_receiver);
if (obj_args != NULL) {
int s = obj_args->size();
// if called through method handle invoke, some arguments may have been popped
for (int i = args_base+start, j = 0; j < obj_args->size() && i < state()->stack_size(); ) {
Value v = state()->stack_at_inc(i);
if (v->type()->is_object_kind()) {
obj_args->push(v);
j++;
}
}
#ifdef ASSERT
{
bool ignored_will_link;
ciSignature* declared_signature = NULL;
ciMethod* real_target = method()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
assert(s == obj_args->length() || real_target->is_method_handle_intrinsic(), "missed on arg?");
}
#endif
}
profile_call(callee, recv, holder_known ? callee->holder() : NULL, obj_args, true);
}
}
@ -4251,8 +4328,23 @@ void GraphBuilder::print_stats() {
}
#endif // PRODUCT
void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder) {
append(new ProfileCall(method(), bci(), callee, recv, known_holder));
void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) {
append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
}
void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m, int invoke_bci) {
assert((m == NULL) == (invoke_bci < 0), "invalid method and invalid bci together");
if (m == NULL) {
m = method();
}
if (invoke_bci < 0) {
invoke_bci = bci();
}
ciMethodData* md = m->method_data_or_null();
ciProfileData* data = md->bci_to_data(invoke_bci);
if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
append(new ProfileReturnType(m , invoke_bci, callee, ret));
}
}
void GraphBuilder::profile_invocation(ciMethod* callee, ValueStack* state) {

View File

@ -374,7 +374,8 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC {
void print_inlining(ciMethod* callee, const char* msg = NULL, bool success = true);
void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder);
void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder, Values* obj_args, bool inlined);
void profile_return_type(Value ret, ciMethod* callee, ciMethod* m = NULL, int bci = -1);
void profile_invocation(ciMethod* inlinee, ValueStack* state);
// Shortcuts to profiling control.
@ -386,6 +387,9 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC {
bool profile_inlined_calls() { return _compilation->profile_inlined_calls(); }
bool profile_checkcasts() { return _compilation->profile_checkcasts(); }
Values* args_list_for_profiling(int& start, bool may_have_receiver);
Values* collect_args_for_profiling(Values* args, bool may_have_receiver);
public:
NOT_PRODUCT(void print_stats();)

View File

@ -104,6 +104,14 @@ void Instruction::state_values_do(ValueVisitor* f) {
}
}
ciType* Instruction::exact_type() const {
ciType* t = declared_type();
if (t != NULL && t->is_klass()) {
return t->as_klass()->exact_klass();
}
return NULL;
}
#ifndef PRODUCT
void Instruction::check_state(ValueStack* state) {
@ -135,9 +143,7 @@ void Instruction::print(InstructionPrinter& ip) {
// perform constant and interval tests on index value
bool AccessIndexed::compute_needs_range_check() {
if (length()) {
Constant* clength = length()->as_Constant();
Constant* cindex = index()->as_Constant();
if (clength && cindex) {
@ -157,34 +163,8 @@ bool AccessIndexed::compute_needs_range_check() {
}
ciType* Local::exact_type() const {
ciType* type = declared_type();
// for primitive arrays, the declared type is the exact type
if (type->is_type_array_klass()) {
return type;
} else if (type->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)type;
if (ik->is_loaded() && ik->is_final() && !ik->is_interface()) {
return type;
}
} else if (type->is_obj_array_klass()) {
ciObjArrayKlass* oak = (ciObjArrayKlass*)type;
ciType* base = oak->base_element_type();
if (base->is_instance_klass()) {
ciInstanceKlass* ik = base->as_instance_klass();
if (ik->is_loaded() && ik->is_final()) {
return type;
}
} else if (base->is_primitive_type()) {
return type;
}
}
return NULL;
}
ciType* Constant::exact_type() const {
if (type()->is_object()) {
if (type()->is_object() && type()->as_ObjectType()->is_loaded()) {
return type()->as_ObjectType()->exact_type();
}
return NULL;
@ -192,19 +172,18 @@ ciType* Constant::exact_type() const {
ciType* LoadIndexed::exact_type() const {
ciType* array_type = array()->exact_type();
if (array_type == NULL) {
return NULL;
}
assert(array_type->is_array_klass(), "what else?");
ciArrayKlass* ak = (ciArrayKlass*)array_type;
if (array_type != NULL) {
assert(array_type->is_array_klass(), "what else?");
ciArrayKlass* ak = (ciArrayKlass*)array_type;
if (ak->element_type()->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)ak->element_type();
if (ik->is_loaded() && ik->is_final()) {
return ik;
if (ak->element_type()->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)ak->element_type();
if (ik->is_loaded() && ik->is_final()) {
return ik;
}
}
}
return NULL;
return Instruction::exact_type();
}
@ -224,22 +203,6 @@ ciType* LoadField::declared_type() const {
}
ciType* LoadField::exact_type() const {
ciType* type = declared_type();
// for primitive arrays, the declared type is the exact type
if (type->is_type_array_klass()) {
return type;
}
if (type->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)type;
if (ik->is_loaded() && ik->is_final()) {
return type;
}
}
return NULL;
}
ciType* NewTypeArray::exact_type() const {
return ciTypeArrayKlass::make(elt_type());
}
@ -264,16 +227,6 @@ ciType* CheckCast::declared_type() const {
return klass();
}
ciType* CheckCast::exact_type() const {
if (klass()->is_instance_klass()) {
ciInstanceKlass* ik = (ciInstanceKlass*)klass();
if (ik->is_loaded() && ik->is_final()) {
return ik;
}
}
return NULL;
}
// Implementation of ArithmeticOp
bool ArithmeticOp::is_commutative() const {

View File

@ -107,6 +107,7 @@ class UnsafePrefetch;
class UnsafePrefetchRead;
class UnsafePrefetchWrite;
class ProfileCall;
class ProfileReturnType;
class ProfileInvoke;
class RuntimeCall;
class MemBar;
@ -211,6 +212,7 @@ class InstructionVisitor: public StackObj {
virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x) = 0;
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
virtual void do_ProfileCall (ProfileCall* x) = 0;
virtual void do_ProfileReturnType (ProfileReturnType* x) = 0;
virtual void do_ProfileInvoke (ProfileInvoke* x) = 0;
virtual void do_RuntimeCall (RuntimeCall* x) = 0;
virtual void do_MemBar (MemBar* x) = 0;
@ -322,6 +324,36 @@ class Instruction: public CompilationResourceObj {
_type = type;
}
// Helper class to keep track of which arguments need a null check
class ArgsNonNullState {
private:
int _nonnull_state; // mask identifying which args are nonnull
public:
ArgsNonNullState()
: _nonnull_state(AllBits) {}
// Does argument number i needs a null check?
bool arg_needs_null_check(int i) const {
// No data is kept for arguments starting at position 33 so
// conservatively assume that they need a null check.
if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
return is_set_nth_bit(_nonnull_state, i);
}
return true;
}
// Set whether argument number i needs a null check or not
void set_arg_needs_null_check(int i, bool check) {
if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
if (check) {
_nonnull_state |= nth_bit(i);
} else {
_nonnull_state &= ~(nth_bit(i));
}
}
}
};
public:
void* operator new(size_t size) throw() {
Compilation* c = Compilation::current();
@ -566,7 +598,7 @@ class Instruction: public CompilationResourceObj {
virtual void other_values_do(ValueVisitor* f) { /* usually no other - override on demand */ }
void values_do(ValueVisitor* f) { input_values_do(f); state_values_do(f); other_values_do(f); }
virtual ciType* exact_type() const { return NULL; }
virtual ciType* exact_type() const;
virtual ciType* declared_type() const { return NULL; }
// hashing
@ -689,7 +721,6 @@ LEAF(Local, Instruction)
int java_index() const { return _java_index; }
virtual ciType* declared_type() const { return _declared_type; }
virtual ciType* exact_type() const;
// generic
virtual void input_values_do(ValueVisitor* f) { /* no values */ }
@ -806,7 +837,6 @@ LEAF(LoadField, AccessField)
{}
ciType* declared_type() const;
ciType* exact_type() const;
// generic
HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile
@ -1299,6 +1329,7 @@ BASE(NewArray, StateSplit)
virtual bool needs_exception_state() const { return false; }
ciType* exact_type() const { return NULL; }
ciType* declared_type() const;
// generic
@ -1422,7 +1453,6 @@ LEAF(CheckCast, TypeCheck)
}
ciType* declared_type() const;
ciType* exact_type() const;
};
@ -1490,7 +1520,7 @@ LEAF(Intrinsic, StateSplit)
vmIntrinsics::ID _id;
Values* _args;
Value _recv;
int _nonnull_state; // mask identifying which args are nonnull
ArgsNonNullState _nonnull_state;
public:
// preserves_state can be set to true for Intrinsics
@ -1511,7 +1541,6 @@ LEAF(Intrinsic, StateSplit)
, _id(id)
, _args(args)
, _recv(NULL)
, _nonnull_state(AllBits)
{
assert(args != NULL, "args must exist");
ASSERT_VALUES
@ -1537,21 +1566,12 @@ LEAF(Intrinsic, StateSplit)
Value receiver() const { assert(has_receiver(), "must have receiver"); return _recv; }
bool preserves_state() const { return check_flag(PreservesStateFlag); }
bool arg_needs_null_check(int i) {
if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
return is_set_nth_bit(_nonnull_state, i);
}
return true;
bool arg_needs_null_check(int i) const {
return _nonnull_state.arg_needs_null_check(i);
}
void set_arg_needs_null_check(int i, bool check) {
if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
if (check) {
_nonnull_state |= nth_bit(i);
} else {
_nonnull_state &= ~(nth_bit(i));
}
}
_nonnull_state.set_arg_needs_null_check(i, check);
}
// generic
@ -2450,34 +2470,87 @@ LEAF(UnsafePrefetchWrite, UnsafePrefetch)
LEAF(ProfileCall, Instruction)
private:
ciMethod* _method;
int _bci_of_invoke;
ciMethod* _callee; // the method that is called at the given bci
Value _recv;
ciKlass* _known_holder;
ciMethod* _method;
int _bci_of_invoke;
ciMethod* _callee; // the method that is called at the given bci
Value _recv;
ciKlass* _known_holder;
Values* _obj_args; // arguments for type profiling
ArgsNonNullState _nonnull_state; // Do we know whether some arguments are never null?
bool _inlined; // Are we profiling a call that is inlined
public:
ProfileCall(ciMethod* method, int bci, ciMethod* callee, Value recv, ciKlass* known_holder)
ProfileCall(ciMethod* method, int bci, ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined)
: Instruction(voidType)
, _method(method)
, _bci_of_invoke(bci)
, _callee(callee)
, _recv(recv)
, _known_holder(known_holder)
, _obj_args(obj_args)
, _inlined(inlined)
{
// The ProfileCall has side-effects and must occur precisely where located
pin();
}
ciMethod* method() { return _method; }
int bci_of_invoke() { return _bci_of_invoke; }
ciMethod* callee() { return _callee; }
Value recv() { return _recv; }
ciKlass* known_holder() { return _known_holder; }
ciMethod* method() const { return _method; }
int bci_of_invoke() const { return _bci_of_invoke; }
ciMethod* callee() const { return _callee; }
Value recv() const { return _recv; }
ciKlass* known_holder() const { return _known_holder; }
int nb_profiled_args() const { return _obj_args == NULL ? 0 : _obj_args->length(); }
Value profiled_arg_at(int i) const { return _obj_args->at(i); }
bool arg_needs_null_check(int i) const {
return _nonnull_state.arg_needs_null_check(i);
}
bool inlined() const { return _inlined; }
virtual void input_values_do(ValueVisitor* f) { if (_recv != NULL) f->visit(&_recv); }
void set_arg_needs_null_check(int i, bool check) {
_nonnull_state.set_arg_needs_null_check(i, check);
}
virtual void input_values_do(ValueVisitor* f) {
if (_recv != NULL) {
f->visit(&_recv);
}
for (int i = 0; i < nb_profiled_args(); i++) {
f->visit(_obj_args->adr_at(i));
}
}
};
LEAF(ProfileReturnType, Instruction)
private:
ciMethod* _method;
ciMethod* _callee;
int _bci_of_invoke;
Value _ret;
public:
ProfileReturnType(ciMethod* method, int bci, ciMethod* callee, Value ret)
: Instruction(voidType)
, _method(method)
, _callee(callee)
, _bci_of_invoke(bci)
, _ret(ret)
{
set_needs_null_check(true);
// The ProfileType has side-effects and must occur precisely where located
pin();
}
ciMethod* method() const { return _method; }
ciMethod* callee() const { return _callee; }
int bci_of_invoke() const { return _bci_of_invoke; }
Value ret() const { return _ret; }
virtual void input_values_do(ValueVisitor* f) {
if (_ret != NULL) {
f->visit(&_ret);
}
}
};
// Call some C runtime function that doesn't safepoint,
// optionally passing the current thread as the first argument.

View File

@ -892,10 +892,24 @@ void InstructionPrinter::do_ProfileCall(ProfileCall* x) {
if (x->known_holder() != NULL) {
output()->print(", ");
print_klass(x->known_holder());
output()->print(" ");
}
for (int i = 0; i < x->nb_profiled_args(); i++) {
if (i > 0) output()->print(", ");
print_value(x->profiled_arg_at(i));
if (x->arg_needs_null_check(i)) {
output()->print(" [NC]");
}
}
output()->put(')');
}
void InstructionPrinter::do_ProfileReturnType(ProfileReturnType* x) {
output()->print("profile ret type ");
print_value(x->ret());
output()->print(" %s.%s", x->method()->holder()->name()->as_utf8(), x->method()->name()->as_utf8());
output()->put(')');
}
void InstructionPrinter::do_ProfileInvoke(ProfileInvoke* x) {
output()->print("profile_invoke ");
output()->print(" %s.%s", x->inlinee()->holder()->name()->as_utf8(), x->inlinee()->name()->as_utf8());

View File

@ -132,6 +132,7 @@ class InstructionPrinter: public InstructionVisitor {
virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileReturnType (ProfileReturnType* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);

View File

@ -1001,6 +1001,17 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
assert(opProfileCall->_tmp1->is_valid(), "used"); do_temp(opProfileCall->_tmp1);
break;
}
// LIR_OpProfileType:
case lir_profile_type: {
assert(op->as_OpProfileType() != NULL, "must be");
LIR_OpProfileType* opProfileType = (LIR_OpProfileType*)op;
do_input(opProfileType->_mdp); do_temp(opProfileType->_mdp);
do_input(opProfileType->_obj);
do_temp(opProfileType->_tmp);
break;
}
default:
ShouldNotReachHere();
}
@ -1151,6 +1162,10 @@ void LIR_OpProfileCall::emit_code(LIR_Assembler* masm) {
masm->emit_profile_call(this);
}
void LIR_OpProfileType::emit_code(LIR_Assembler* masm) {
masm->emit_profile_type(this);
}
// LIR_List
LIR_List::LIR_List(Compilation* compilation, BlockBegin* block)
: _operations(8)
@ -1803,6 +1818,8 @@ const char * LIR_Op::name() const {
case lir_cas_int: s = "cas_int"; break;
// LIR_OpProfileCall
case lir_profile_call: s = "profile_call"; break;
// LIR_OpProfileType
case lir_profile_type: s = "profile_type"; break;
// LIR_OpAssert
#ifdef ASSERT
case lir_assert: s = "assert"; break;
@ -2086,6 +2103,15 @@ void LIR_OpProfileCall::print_instr(outputStream* out) const {
tmp1()->print(out); out->print(" ");
}
// LIR_OpProfileType
void LIR_OpProfileType::print_instr(outputStream* out) const {
out->print("exact = "); exact_klass()->print_name_on(out);
out->print("current = "); ciTypeEntries::print_ciklass(out, current_klass());
mdp()->print(out); out->print(" ");
obj()->print(out); out->print(" ");
tmp()->print(out); out->print(" ");
}
#endif // PRODUCT
// Implementation of LIR_InsertionBuffer

View File

@ -882,6 +882,7 @@ class LIR_OpLock;
class LIR_OpTypeCheck;
class LIR_OpCompareAndSwap;
class LIR_OpProfileCall;
class LIR_OpProfileType;
#ifdef ASSERT
class LIR_OpAssert;
#endif
@ -1005,6 +1006,7 @@ enum LIR_Code {
, end_opCompareAndSwap
, begin_opMDOProfile
, lir_profile_call
, lir_profile_type
, end_opMDOProfile
, begin_opAssert
, lir_assert
@ -1145,6 +1147,7 @@ class LIR_Op: public CompilationResourceObj {
virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; }
virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; }
virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; }
virtual LIR_OpProfileType* as_OpProfileType() { return NULL; }
#ifdef ASSERT
virtual LIR_OpAssert* as_OpAssert() { return NULL; }
#endif
@ -1925,8 +1928,8 @@ class LIR_OpProfileCall : public LIR_Op {
public:
// Destroys recv
LIR_OpProfileCall(LIR_Code code, ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder)
: LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info
LIR_OpProfileCall(ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder)
: LIR_Op(lir_profile_call, LIR_OprFact::illegalOpr, NULL) // no result, no info
, _profiled_method(profiled_method)
, _profiled_bci(profiled_bci)
, _profiled_callee(profiled_callee)
@ -1948,6 +1951,45 @@ class LIR_OpProfileCall : public LIR_Op {
virtual void print_instr(outputStream* out) const PRODUCT_RETURN;
};
// LIR_OpProfileType
class LIR_OpProfileType : public LIR_Op {
friend class LIR_OpVisitState;
private:
LIR_Opr _mdp;
LIR_Opr _obj;
LIR_Opr _tmp;
ciKlass* _exact_klass; // non NULL if we know the klass statically (no need to load it from _obj)
intptr_t _current_klass; // what the profiling currently reports
bool _not_null; // true if we know statically that _obj cannot be null
bool _no_conflict; // true if we're profling parameters, _exact_klass is not NULL and we know
// _exact_klass it the only possible type for this parameter in any context.
public:
// Destroys recv
LIR_OpProfileType(LIR_Opr mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict)
: LIR_Op(lir_profile_type, LIR_OprFact::illegalOpr, NULL) // no result, no info
, _mdp(mdp)
, _obj(obj)
, _exact_klass(exact_klass)
, _current_klass(current_klass)
, _tmp(tmp)
, _not_null(not_null)
, _no_conflict(no_conflict) { }
LIR_Opr mdp() const { return _mdp; }
LIR_Opr obj() const { return _obj; }
LIR_Opr tmp() const { return _tmp; }
ciKlass* exact_klass() const { return _exact_klass; }
intptr_t current_klass() const { return _current_klass; }
bool not_null() const { return _not_null; }
bool no_conflict() const { return _no_conflict; }
virtual void emit_code(LIR_Assembler* masm);
virtual LIR_OpProfileType* as_OpProfileType() { return this; }
virtual void print_instr(outputStream* out) const PRODUCT_RETURN;
};
class LIR_InsertionBuffer;
//--------------------------------LIR_List---------------------------------------------------
@ -2247,7 +2289,10 @@ class LIR_List: public CompilationResourceObj {
ciMethod* profiled_method, int profiled_bci);
// MethodData* profiling
void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass));
append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass));
}
void profile_type(LIR_Address* mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) {
append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict));
}
void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }

View File

@ -208,6 +208,7 @@ class LIR_Assembler: public CompilationResourceObj {
void emit_call(LIR_OpJavaCall* op);
void emit_rtcall(LIR_OpRTCall* op);
void emit_profile_call(LIR_OpProfileCall* op);
void emit_profile_type(LIR_OpProfileType* op);
void emit_delay(LIR_OpDelay* op);
void arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack);

View File

@ -2571,6 +2571,78 @@ void LIRGenerator::do_Goto(Goto* x) {
}
ciKlass* LIRGenerator::profile_arg_type(ciMethodData* md, int md_base_offset, int md_offset, intptr_t profiled_k, Value arg, LIR_Opr& mdp, bool not_null, ciKlass* signature_k) {
ciKlass* result = NULL;
bool do_null = !not_null && !TypeEntries::was_null_seen(profiled_k);
bool do_update = !TypeEntries::is_type_unknown(profiled_k);
// known not to be null or null bit already set and already set to
// unknown: nothing we can do to improve profiling
if (!do_null && !do_update) {
return result;
}
ciKlass* exact_klass = NULL;
Compilation* comp = Compilation::current();
if (do_update) {
// try to find exact type, using CHA if possible, so that loading
// the klass from the object can be avoided
ciType* type = arg->exact_type();
if (type == NULL) {
type = arg->declared_type();
type = comp->cha_exact_type(type);
}
assert(type == NULL || type->is_klass(), "type should be class");
exact_klass = (type != NULL && type->is_loaded()) ? (ciKlass*)type : NULL;
do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass;
}
if (!do_null && !do_update) {
return result;
}
ciKlass* exact_signature_k = NULL;
if (do_update) {
// Is the type from the signature exact (the only one possible)?
exact_signature_k = signature_k->exact_klass();
if (exact_signature_k == NULL) {
exact_signature_k = comp->cha_exact_type(signature_k);
} else {
result = exact_signature_k;
do_update = false;
// Known statically. No need to emit any code: prevent
// LIR_Assembler::emit_profile_type() from emitting useless code
profiled_k = ciTypeEntries::with_status(result, profiled_k);
}
if (exact_signature_k != NULL && exact_klass != exact_signature_k) {
assert(exact_klass == NULL, "arg and signature disagree?");
// sometimes the type of the signature is better than the best type
// the compiler has
exact_klass = exact_signature_k;
do_update = exact_klass == NULL || ciTypeEntries::valid_ciklass(profiled_k) != exact_klass;
}
}
if (!do_null && !do_update) {
return result;
}
if (mdp == LIR_OprFact::illegalOpr) {
mdp = new_register(T_METADATA);
__ metadata2reg(md->constant_encoding(), mdp);
if (md_base_offset != 0) {
LIR_Address* base_type_address = new LIR_Address(mdp, md_base_offset, T_ADDRESS);
mdp = new_pointer_register();
__ leal(LIR_OprFact::address(base_type_address), mdp);
}
}
LIRItem value(arg, this);
value.load_item();
__ profile_type(new LIR_Address(mdp, md_offset, T_METADATA),
value.result(), exact_klass, profiled_k, new_pointer_register(), not_null, exact_signature_k != NULL);
return result;
}
void LIRGenerator::do_Base(Base* x) {
__ std_entry(LIR_OprFact::illegalOpr);
// Emit moves from physical registers / stack slots to virtual registers
@ -3004,12 +3076,52 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
}
}
void LIRGenerator::profile_arguments(ProfileCall* x) {
if (MethodData::profile_arguments()) {
int bci = x->bci_of_invoke();
ciMethodData* md = x->method()->method_data_or_null();
ciProfileData* data = md->bci_to_data(bci);
if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset();
int base_offset = md->byte_offset_of_slot(data, extra);
LIR_Opr mdp = LIR_OprFact::illegalOpr;
ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args();
Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
int start = 0;
int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
if (x->nb_profiled_args() < stop) {
// if called through method handle invoke, some arguments may have been popped
stop = x->nb_profiled_args();
}
ciSignature* sig = x->callee()->signature();
// method handle call to virtual method
bool has_receiver = x->inlined() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
ciSignatureStream sig_stream(sig, has_receiver ? x->callee()->holder() : NULL);
for (int i = 0; i < stop; i++) {
int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset());
ciKlass* exact = profile_arg_type(md, base_offset, off,
args->type(i), x->profiled_arg_at(i+start), mdp,
!x->arg_needs_null_check(i+start), sig_stream.next_klass());
if (exact != NULL) {
md->set_argument_type(bci, i, exact);
}
}
}
}
}
void LIRGenerator::do_ProfileCall(ProfileCall* x) {
// Need recv in a temporary register so it interferes with the other temporaries
LIR_Opr recv = LIR_OprFact::illegalOpr;
LIR_Opr mdo = new_register(T_OBJECT);
// tmp is used to hold the counters on SPARC
LIR_Opr tmp = new_pointer_register();
if (x->nb_profiled_args() > 0) {
profile_arguments(x);
}
if (x->recv() != NULL) {
LIRItem value(x->recv(), this);
value.load_item();
@ -3019,6 +3131,21 @@ void LIRGenerator::do_ProfileCall(ProfileCall* x) {
__ profile_call(x->method(), x->bci_of_invoke(), x->callee(), mdo, recv, tmp, x->known_holder());
}
void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) {
int bci = x->bci_of_invoke();
ciMethodData* md = x->method()->method_data_or_null();
ciProfileData* data = md->bci_to_data(bci);
assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
LIR_Opr mdp = LIR_OprFact::illegalOpr;
ciKlass* exact = profile_arg_type(md, 0, md->byte_offset_of_slot(data, ret->type_offset()),
ret->type(), x->ret(), mdp,
!x->needs_null_check(), x->callee()->signature()->return_type()->as_klass());
if (exact != NULL) {
md->set_return_type(bci, exact);
}
}
void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
// We can safely ignore accessors here, since c2 will inline them anyway,
// accessors are also always mature.
@ -3053,7 +3180,11 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
int offset = -1;
LIR_Opr counter_holder;
if (level == CompLevel_limited_profile) {
address counters_adr = method->ensure_method_counters();
MethodCounters* counters_adr = method->ensure_method_counters();
if (counters_adr == NULL) {
bailout("method counters allocation failed");
return;
}
counter_holder = new_pointer_register();
__ move(LIR_OprFact::intptrConst(counters_adr), counter_holder);
offset = in_bytes(backedge ? MethodCounters::backedge_counter_offset() :

View File

@ -434,6 +434,8 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
void do_ThreadIDIntrinsic(Intrinsic* x);
void do_ClassIDIntrinsic(Intrinsic* x);
#endif
ciKlass* profile_arg_type(ciMethodData* md, int md_first_offset, int md_offset, intptr_t profiled_k, Value arg, LIR_Opr& mdp, bool not_null, ciKlass* signature_k);
void profile_arguments(ProfileCall* x);
public:
Compilation* compilation() const { return _compilation; }
@ -534,6 +536,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileReturnType (ProfileReturnType* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
virtual void do_MemBar (MemBar* x);

View File

@ -531,6 +531,7 @@ public:
void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
void do_ProfileCall (ProfileCall* x);
void do_ProfileReturnType (ProfileReturnType* x);
void do_ProfileInvoke (ProfileInvoke* x);
void do_RuntimeCall (RuntimeCall* x);
void do_MemBar (MemBar* x);
@ -657,6 +658,8 @@ class NullCheckEliminator: public ValueVisitor {
void handle_Intrinsic (Intrinsic* x);
void handle_ExceptionObject (ExceptionObject* x);
void handle_Phi (Phi* x);
void handle_ProfileCall (ProfileCall* x);
void handle_ProfileReturnType (ProfileReturnType* x);
};
@ -715,7 +718,9 @@ void NullCheckVisitor::do_UnsafePutObject(UnsafePutObject* x) {}
void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {}
void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {}
void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); }
void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check();
nce()->handle_ProfileCall(x); }
void NullCheckVisitor::do_ProfileReturnType (ProfileReturnType* x) { nce()->handle_ProfileReturnType(x); }
void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {}
void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {}
void NullCheckVisitor::do_MemBar (MemBar* x) {}
@ -1134,6 +1139,15 @@ void NullCheckEliminator::handle_Phi(Phi* x) {
}
}
void NullCheckEliminator::handle_ProfileCall(ProfileCall* x) {
for (int i = 0; i < x->nb_profiled_args(); i++) {
x->set_arg_needs_null_check(i, !set_contains(x->profiled_arg_at(i)));
}
}
void NullCheckEliminator::handle_ProfileReturnType(ProfileReturnType* x) {
x->set_needs_null_check(!set_contains(x->ret()));
}
void Optimizer::eliminate_null_checks() {
ResourceMark rm;

View File

@ -162,7 +162,8 @@ public:
void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ };
void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ };
void do_ProfileCall (ProfileCall* x) { /* nothing to do */ };
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ };
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
void do_MemBar (MemBar* x) { /* nothing to do */ };
void do_RangeCheckPredicate(RangeCheckPredicate* x) { /* nothing to do */ };

View File

@ -542,8 +542,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
// exception handler can cause class loading, which might throw an
// exception and those fields are expected to be clear during
// normal bytecode execution.
thread->set_exception_oop(NULL);
thread->set_exception_pc(NULL);
thread->clear_exception_oop_and_pc();
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false);
// If an exception was thrown during exception dispatch, the exception oop may have changed

View File

@ -203,6 +203,7 @@ class ValueNumberingVisitor: public InstructionVisitor {
void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }
void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }
void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ }
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
void do_MemBar (MemBar* x) { /* nothing to do */ };

View File

@ -102,6 +102,7 @@ friend class ciMethodData; \
friend class ciMethodHandle; \
friend class ciMethodType; \
friend class ciReceiverTypeData; \
friend class ciTypeEntries; \
friend class ciSymbol; \
friend class ciArray; \
friend class ciObjArray; \

View File

@ -1154,9 +1154,12 @@ ciInstance* ciEnv::unloaded_ciinstance() {
GUARDED_VM_ENTRY(return _factory->get_unloaded_object_constant();)
}
void ciEnv::dump_replay_data(outputStream* out) {
VM_ENTRY_MARK;
MutexLocker ml(Compile_lock);
// ------------------------------------------------------------------
// ciEnv::dump_replay_data*
// Don't change thread state and acquire any locks.
// Safe to call from VM error reporter.
void ciEnv::dump_replay_data_unsafe(outputStream* out) {
ResourceMark rm;
#if INCLUDE_JVMTI
out->print_cr("JvmtiExport can_access_local_variables %d", _jvmti_can_access_local_variables);
@ -1181,3 +1184,10 @@ void ciEnv::dump_replay_data(outputStream* out) {
entry_bci, comp_level);
out->flush();
}
void ciEnv::dump_replay_data(outputStream* out) {
GUARDED_VM_ENTRY(
MutexLocker ml(Compile_lock);
dump_replay_data_unsafe(out);
)
}

View File

@ -452,6 +452,7 @@ public:
// Dump the compilation replay data for the ciEnv to the stream.
void dump_replay_data(outputStream* out);
void dump_replay_data_unsafe(outputStream* out);
};
#endif // SHARE_VM_CI_CIENV_HPP

View File

@ -671,7 +671,6 @@ class StaticFinalFieldPrinter : public FieldClosure {
void ciInstanceKlass::dump_replay_data(outputStream* out) {
ASSERT_IN_VM;
ResourceMark rm;
InstanceKlass* ik = get_instanceKlass();

View File

@ -235,6 +235,13 @@ public:
bool is_instance_klass() const { return true; }
bool is_java_klass() const { return true; }
virtual ciKlass* exact_klass() {
if (is_loaded() && is_final() && !is_interface()) {
return this;
}
return NULL;
}
// Dump the current state of this klass for compilation replay.
virtual void dump_replay_data(outputStream* out);
};

View File

@ -66,7 +66,9 @@ ciKlass::ciKlass(ciSymbol* name, BasicType bt) : ciType(bt) {
// ------------------------------------------------------------------
// ciKlass::is_subtype_of
bool ciKlass::is_subtype_of(ciKlass* that) {
assert(is_loaded() && that->is_loaded(), "must be loaded");
assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii()));
assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii()));
// Check to see if the klasses are identical.
if (this == that) {
return true;
@ -83,8 +85,8 @@ bool ciKlass::is_subtype_of(ciKlass* that) {
// ------------------------------------------------------------------
// ciKlass::is_subclass_of
bool ciKlass::is_subclass_of(ciKlass* that) {
assert(is_loaded() && that->is_loaded(), "must be loaded");
// Check to see if the klasses are identical.
assert(this->is_loaded(), err_msg("must be loaded: %s", this->name()->as_quoted_ascii()));
assert(that->is_loaded(), err_msg("must be loaded: %s", that->name()->as_quoted_ascii()));
VM_ENTRY_MARK;
Klass* this_klass = get_Klass();

View File

@ -41,6 +41,7 @@ class ciKlass : public ciType {
friend class ciEnv;
friend class ciField;
friend class ciMethod;
friend class ciMethodData;
friend class ciObjArrayKlass;
private:
@ -121,6 +122,8 @@ public:
// What kind of ciObject is this?
bool is_klass() const { return true; }
virtual ciKlass* exact_klass() = 0;
void print_name_on(outputStream* st);
};

View File

@ -846,7 +846,9 @@ bool ciMethod::has_member_arg() const {
// Return true if allocation was successful or no MDO is required.
bool ciMethod::ensure_method_data(methodHandle h_m) {
EXCEPTION_CONTEXT;
if (is_native() || is_abstract() || h_m()->is_accessor()) return true;
if (is_native() || is_abstract() || h_m()->is_accessor()) {
return true;
}
if (h_m()->method_data() == NULL) {
Method::build_interpreter_method_data(h_m, THREAD);
if (HAS_PENDING_EXCEPTION) {
@ -903,22 +905,21 @@ ciMethodData* ciMethod::method_data() {
// NULL otherwise.
ciMethodData* ciMethod::method_data_or_null() {
ciMethodData *md = method_data();
if (md->is_empty()) return NULL;
if (md->is_empty()) {
return NULL;
}
return md;
}
// ------------------------------------------------------------------
// ciMethod::ensure_method_counters
//
address ciMethod::ensure_method_counters() {
MethodCounters* ciMethod::ensure_method_counters() {
check_is_loaded();
VM_ENTRY_MARK;
methodHandle mh(THREAD, get_Method());
MethodCounters *counter = mh->method_counters();
if (counter == NULL) {
counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
}
return (address)counter;
MethodCounters* method_counters = mh->get_method_counters(CHECK_NULL);
return method_counters;
}
// ------------------------------------------------------------------
@ -1247,7 +1248,6 @@ ciMethodBlocks *ciMethod::get_method_blocks() {
#undef FETCH_FLAG_FROM_VM
void ciMethod::dump_replay_data(outputStream* st) {
ASSERT_IN_VM;
ResourceMark rm;
Method* method = get_Method();
MethodCounters* mcs = method->method_counters();

View File

@ -265,7 +265,7 @@ class ciMethod : public ciMetadata {
bool is_klass_loaded(int refinfo_index, bool must_be_resolved) const;
bool check_call(int refinfo_index, bool is_static) const;
bool ensure_method_data(); // make sure it exists in the VM also
address ensure_method_counters();
MethodCounters* ensure_method_counters();
int instructions_size();
int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC

View File

@ -78,7 +78,9 @@ ciMethodData::ciMethodData() : ciMetadata(NULL) {
void ciMethodData::load_data() {
MethodData* mdo = get_MethodData();
if (mdo == NULL) return;
if (mdo == NULL) {
return;
}
// To do: don't copy the data if it is not "ripe" -- require a minimum #
// of invocations.
@ -123,7 +125,7 @@ void ciMethodData::load_data() {
#endif
}
void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) {
void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
for (uint row = 0; row < row_limit(); row++) {
Klass* k = data->as_ReceiverTypeData()->receiver(row);
if (k != NULL) {
@ -134,6 +136,18 @@ void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) {
}
void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
for (int i = 0; i < _number_of_entries; i++) {
intptr_t k = entries->type(i);
TypeStackSlotEntries::set_type(i, translate_klass(k));
}
}
void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) {
intptr_t k = ret->type();
set_type(translate_klass(k));
}
// Get the data at an arbitrary (sort of) data index.
ciProfileData* ciMethodData::data_at(int data_index) {
if (out_of_bounds(data_index)) {
@ -164,6 +178,10 @@ ciProfileData* ciMethodData::data_at(int data_index) {
return new ciMultiBranchData(data_layout);
case DataLayout::arg_info_data_tag:
return new ciArgInfoData(data_layout);
case DataLayout::call_type_data_tag:
return new ciCallTypeData(data_layout);
case DataLayout::virtual_call_type_data_tag:
return new ciVirtualCallTypeData(data_layout);
};
}
@ -286,6 +304,34 @@ void ciMethodData::set_would_profile(bool p) {
}
}
void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) {
VM_ENTRY_MARK;
MethodData* mdo = get_MethodData();
if (mdo != NULL) {
ProfileData* data = mdo->bci_to_data(bci);
if (data->is_CallTypeData()) {
data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
} else {
assert(data->is_VirtualCallTypeData(), "no arguments!");
data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
}
}
}
void ciMethodData::set_return_type(int bci, ciKlass* k) {
VM_ENTRY_MARK;
MethodData* mdo = get_MethodData();
if (mdo != NULL) {
ProfileData* data = mdo->bci_to_data(bci);
if (data->is_CallTypeData()) {
data->as_CallTypeData()->set_return_type(k->get_Klass());
} else {
assert(data->is_VirtualCallTypeData(), "no arguments!");
data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
}
}
}
bool ciMethodData::has_escape_info() {
return eflag_set(MethodData::estimated);
}
@ -373,7 +419,6 @@ void ciMethodData::print_impl(outputStream* st) {
}
void ciMethodData::dump_replay_data(outputStream* out) {
ASSERT_IN_VM;
ResourceMark rm;
MethodData* mdo = get_MethodData();
Method* method = mdo->method();
@ -477,7 +522,50 @@ void ciMethodData::print_data_on(outputStream* st) {
}
}
void ciReceiverTypeData::print_receiver_data_on(outputStream* st) {
void ciTypeEntries::print_ciklass(outputStream* st, intptr_t k) {
if (TypeEntries::is_type_none(k)) {
st->print("none");
} else if (TypeEntries::is_type_unknown(k)) {
st->print("unknown");
} else {
valid_ciklass(k)->print_name_on(st);
}
if (TypeEntries::was_null_seen(k)) {
st->print(" (null seen)");
}
}
void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
for (int i = 0; i < _number_of_entries; i++) {
_pd->tab(st);
st->print("%d: stack (%u) ", i, stack_slot(i));
print_ciklass(st, type(i));
st->cr();
}
}
void ciReturnTypeEntry::print_data_on(outputStream* st) const {
_pd->tab(st);
st->print("ret ");
print_ciklass(st, type());
st->cr();
}
void ciCallTypeData::print_data_on(outputStream* st) const {
print_shared(st, "ciCallTypeData");
if (has_arguments()) {
tab(st, true);
st->print("argument types");
args()->print_data_on(st);
}
if (has_return()) {
tab(st, true);
st->print("return type");
ret()->print_data_on(st);
}
}
void ciReceiverTypeData::print_receiver_data_on(outputStream* st) const {
uint row;
int entries = 0;
for (row = 0; row < row_limit(); row++) {
@ -493,13 +581,28 @@ void ciReceiverTypeData::print_receiver_data_on(outputStream* st) {
}
}
void ciReceiverTypeData::print_data_on(outputStream* st) {
void ciReceiverTypeData::print_data_on(outputStream* st) const {
print_shared(st, "ciReceiverTypeData");
print_receiver_data_on(st);
}
void ciVirtualCallData::print_data_on(outputStream* st) {
void ciVirtualCallData::print_data_on(outputStream* st) const {
print_shared(st, "ciVirtualCallData");
rtd_super()->print_receiver_data_on(st);
}
void ciVirtualCallTypeData::print_data_on(outputStream* st) const {
print_shared(st, "ciVirtualCallTypeData");
rtd_super()->print_receiver_data_on(st);
if (has_arguments()) {
tab(st, true);
st->print("argument types");
args()->print_data_on(st);
}
if (has_return()) {
tab(st, true);
st->print("return type");
ret()->print_data_on(st);
}
}
#endif

View File

@ -41,6 +41,8 @@ class ciBranchData;
class ciArrayData;
class ciMultiBranchData;
class ciArgInfoData;
class ciCallTypeData;
class ciVirtualCallTypeData;
typedef ProfileData ciProfileData;
@ -59,6 +61,103 @@ public:
ciJumpData(DataLayout* layout) : JumpData(layout) {};
};
class ciTypeEntries {
protected:
static intptr_t translate_klass(intptr_t k) {
Klass* v = TypeEntries::valid_klass(k);
if (v != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(v);
return with_status(klass, k);
}
return with_status(NULL, k);
}
public:
static ciKlass* valid_ciklass(intptr_t k) {
if (!TypeEntries::is_type_none(k) &&
!TypeEntries::is_type_unknown(k)) {
return (ciKlass*)TypeEntries::klass_part(k);
} else {
return NULL;
}
}
static intptr_t with_status(ciKlass* k, intptr_t in) {
return TypeEntries::with_status((intptr_t)k, in);
}
#ifndef PRODUCT
static void print_ciklass(outputStream* st, intptr_t k);
#endif
};
class ciTypeStackSlotEntries : public TypeStackSlotEntries, ciTypeEntries {
public:
void translate_type_data_from(const TypeStackSlotEntries* args);
ciKlass* valid_type(int i) const {
return valid_ciklass(type(i));
}
#ifndef PRODUCT
void print_data_on(outputStream* st) const;
#endif
};
class ciReturnTypeEntry : public ReturnTypeEntry, ciTypeEntries {
public:
void translate_type_data_from(const ReturnTypeEntry* ret);
ciKlass* valid_type() const {
return valid_ciklass(type());
}
#ifndef PRODUCT
void print_data_on(outputStream* st) const;
#endif
};
class ciCallTypeData : public CallTypeData {
public:
ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); }
void translate_type_data_from(const ProfileData* data) {
if (has_arguments()) {
args()->translate_type_data_from(data->as_CallTypeData()->args());
}
if (has_return()) {
ret()->translate_type_data_from(data->as_CallTypeData()->ret());
}
}
intptr_t argument_type(int i) const {
assert(has_arguments(), "no arg type profiling data");
return args()->type(i);
}
ciKlass* valid_argument_type(int i) const {
assert(has_arguments(), "no arg type profiling data");
return args()->valid_type(i);
}
intptr_t return_type() const {
assert(has_return(), "no ret type profiling data");
return ret()->type();
}
ciKlass* valid_return_type() const {
assert(has_return(), "no ret type profiling data");
return ret()->valid_type();
}
#ifndef PRODUCT
void print_data_on(outputStream* st) const;
#endif
};
class ciReceiverTypeData : public ReceiverTypeData {
public:
ciReceiverTypeData(DataLayout* layout) : ReceiverTypeData(layout) {};
@ -69,7 +168,7 @@ public:
(intptr_t) recv);
}
ciKlass* receiver(uint row) {
ciKlass* receiver(uint row) const {
assert((uint)row < row_limit(), "oob");
ciKlass* recv = (ciKlass*)intptr_at(receiver0_offset + row * receiver_type_row_cell_count);
assert(recv == NULL || recv->is_klass(), "wrong type");
@ -77,19 +176,19 @@ public:
}
// Copy & translate from oop based ReceiverTypeData
virtual void translate_from(ProfileData* data) {
virtual void translate_from(const ProfileData* data) {
translate_receiver_data_from(data);
}
void translate_receiver_data_from(ProfileData* data);
void translate_receiver_data_from(const ProfileData* data);
#ifndef PRODUCT
void print_data_on(outputStream* st);
void print_receiver_data_on(outputStream* st);
void print_data_on(outputStream* st) const;
void print_receiver_data_on(outputStream* st) const;
#endif
};
class ciVirtualCallData : public VirtualCallData {
// Fake multiple inheritance... It's a ciReceiverTypeData also.
ciReceiverTypeData* rtd_super() { return (ciReceiverTypeData*) this; }
ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
public:
ciVirtualCallData(DataLayout* layout) : VirtualCallData(layout) {};
@ -103,11 +202,65 @@ public:
}
// Copy & translate from oop based VirtualCallData
virtual void translate_from(ProfileData* data) {
virtual void translate_from(const ProfileData* data) {
rtd_super()->translate_receiver_data_from(data);
}
#ifndef PRODUCT
void print_data_on(outputStream* st);
void print_data_on(outputStream* st) const;
#endif
};
class ciVirtualCallTypeData : public VirtualCallTypeData {
private:
// Fake multiple inheritance... It's a ciReceiverTypeData also.
ciReceiverTypeData* rtd_super() const { return (ciReceiverTypeData*) this; }
public:
ciVirtualCallTypeData(DataLayout* layout) : VirtualCallTypeData(layout) {}
void set_receiver(uint row, ciKlass* recv) {
rtd_super()->set_receiver(row, recv);
}
ciKlass* receiver(uint row) const {
return rtd_super()->receiver(row);
}
ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)VirtualCallTypeData::args(); }
ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)VirtualCallTypeData::ret(); }
// Copy & translate from oop based VirtualCallData
virtual void translate_from(const ProfileData* data) {
rtd_super()->translate_receiver_data_from(data);
if (has_arguments()) {
args()->translate_type_data_from(data->as_VirtualCallTypeData()->args());
}
if (has_return()) {
ret()->translate_type_data_from(data->as_VirtualCallTypeData()->ret());
}
}
intptr_t argument_type(int i) const {
assert(has_arguments(), "no arg type profiling data");
return args()->type(i);
}
ciKlass* valid_argument_type(int i) const {
assert(has_arguments(), "no arg type profiling data");
return args()->valid_type(i);
}
intptr_t return_type() const {
assert(has_return(), "no ret type profiling data");
return ret()->type();
}
ciKlass* valid_return_type() const {
assert(has_return(), "no ret type profiling data");
return ret()->valid_type();
}
#ifndef PRODUCT
void print_data_on(outputStream* st) const;
#endif
};
@ -232,8 +385,6 @@ private:
public:
bool is_method_data() const { return true; }
void set_mature() { _state = mature_state; }
bool is_empty() { return _state == empty_state; }
bool is_mature() { return _state == mature_state; }
@ -249,6 +400,10 @@ public:
// Also set the numer of loops and blocks in the method.
// Again, this is used to determine if a method is trivial.
void set_compilation_stats(short loops, short blocks);
// If the compiler finds a profiled type that is known statically
// for sure, set it in the MethodData
void set_argument_type(int bci, int i, ciKlass* k);
void set_return_type(int bci, ciKlass* k);
void load_data();

View File

@ -179,3 +179,16 @@ ciObjArrayKlass* ciObjArrayKlass::make_impl(ciKlass* element_klass) {
ciObjArrayKlass* ciObjArrayKlass::make(ciKlass* element_klass) {
GUARDED_VM_ENTRY(return make_impl(element_klass);)
}
ciKlass* ciObjArrayKlass::exact_klass() {
ciType* base = base_element_type();
if (base->is_instance_klass()) {
ciInstanceKlass* ik = base->as_instance_klass();
if (ik->exact_klass() != NULL) {
return this;
}
} else if (base->is_primitive_type()) {
return this;
}
return NULL;
}

View File

@ -73,6 +73,8 @@ public:
bool is_obj_array_klass() const { return true; }
static ciObjArrayKlass* make(ciKlass* element_klass);
virtual ciKlass* exact_klass();
};
#endif // SHARE_VM_CI_CIOBJARRAYKLASS_HPP

View File

@ -965,14 +965,12 @@ void ciReplay::initialize(ciMethod* m) {
tty->cr();
} else {
EXCEPTION_CONTEXT;
MethodCounters* mcs = method->method_counters();
// m->_instructions_size = rec->instructions_size;
m->_instructions_size = -1;
m->_interpreter_invocation_count = rec->interpreter_invocation_count;
m->_interpreter_throwout_count = rec->interpreter_throwout_count;
if (mcs == NULL) {
mcs = Method::build_method_counters(method, CHECK_AND_CLEAR);
}
MethodCounters* mcs = method->get_method_counters(CHECK_AND_CLEAR);
guarantee(mcs != NULL, "method counters allocation failed");
mcs->invocation_counter()->_counter = rec->invocation_counter;
mcs->backedge_counter()->_counter = rec->backedge_counter;
}

View File

@ -277,11 +277,14 @@ public:
class ciSignatureStream : public StackObj {
private:
ciSignature* _sig;
int _pos;
int _pos;
// holder is a method's holder
ciKlass* _holder;
public:
ciSignatureStream(ciSignature* signature) {
ciSignatureStream(ciSignature* signature, ciKlass* holder = NULL) {
_sig = signature;
_pos = 0;
_holder = holder;
}
bool at_return_type() { return _pos == _sig->count(); }
@ -301,6 +304,23 @@ public:
return _sig->type_at(_pos);
}
}
// next klass in the signature
ciKlass* next_klass() {
ciKlass* sig_k;
if (_holder != NULL) {
sig_k = _holder;
_holder = NULL;
} else {
while (!type()->is_klass()) {
next();
}
assert(!at_return_type(), "passed end of signature");
sig_k = type()->as_klass();
next();
}
return sig_k;
}
};

View File

@ -57,6 +57,10 @@ public:
// Make an array klass corresponding to the specified primitive type.
static ciTypeArrayKlass* make(BasicType type);
virtual ciKlass* exact_klass() {
return this;
}
};
#endif // SHARE_VM_CI_CITYPEARRAYKLASS_HPP

View File

@ -2197,8 +2197,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
}
if (lvt_cnt == max_lvt_cnt) {
max_lvt_cnt <<= 1;
REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt);
REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt);
localvariable_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt);
localvariable_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt);
}
localvariable_table_start[lvt_cnt] =
parse_localvariable_table(code_length,
@ -2226,8 +2226,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface,
// Parse local variable type table
if (lvtt_cnt == max_lvtt_cnt) {
max_lvtt_cnt <<= 1;
REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt);
REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt);
localvariable_type_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt);
localvariable_type_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt);
}
localvariable_type_table_start[lvtt_cnt] =
parse_localvariable_table(code_length,
@ -4483,9 +4483,8 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass
for (int index = 0; index < num_methods; index++) {
Method* m = methods->at(index);
// skip private, static and <init> methods
if ((!m->is_private()) &&
(!m->is_static()) &&
// skip static and <init> methods
if ((!m->is_static()) &&
(m->name() != vmSymbols::object_initializer_name())) {
Symbol* name = m->name();

View File

@ -857,7 +857,6 @@ static Method* new_method(
m->set_max_locals(params);
m->constMethod()->set_stackmap_data(NULL);
m->set_code(code_start);
m->set_force_inline(true);
return m;
}

View File

@ -2439,19 +2439,19 @@ void ClassVerifier::verify_invoke_instructions(
&& !ref_class_type.equals(current_type())
&& !ref_class_type.equals(VerificationType::reference_type(
current_class()->super()->name()))) {
bool subtype = ref_class_type.is_assignable_from(
current_type(), this, CHECK_VERIFY(this));
bool subtype = false;
if (!current_class()->is_anonymous()) {
subtype = ref_class_type.is_assignable_from(
current_type(), this, CHECK_VERIFY(this));
} else {
subtype = ref_class_type.is_assignable_from(VerificationType::reference_type(
current_class()->host_klass()->name()), this, CHECK_VERIFY(this));
}
if (!subtype) {
if (current_class()->is_anonymous()) {
subtype = ref_class_type.is_assignable_from(VerificationType::reference_type(
current_class()->host_klass()->name()), this, CHECK_VERIFY(this));
}
if (!subtype) {
verify_error(ErrorContext::bad_code(bci),
"Bad invokespecial instruction: "
"current class isn't assignable to reference class.");
return;
}
verify_error(ErrorContext::bad_code(bci),
"Bad invokespecial instruction: "
"current class isn't assignable to reference class.");
return;
}
}
// Match method descriptor with operand stack
@ -2470,17 +2470,13 @@ void ClassVerifier::verify_invoke_instructions(
if (!current_class()->is_anonymous()) {
current_frame->pop_stack(current_type(), CHECK_VERIFY(this));
} else {
// anonymous class invokespecial calls: either the
// operand stack/objectref is a subtype of the current class OR
// the objectref is a subtype of the host_klass of the current class
// anonymous class invokespecial calls: check if the
// objectref is a subtype of the host_klass of the current class
// to allow an anonymous class to reference methods in the host_klass
VerificationType top = current_frame->pop_stack(CHECK_VERIFY(this));
bool subtype = current_type().is_assignable_from(top, this, CHECK_VERIFY(this));
if (!subtype) {
VerificationType hosttype =
VerificationType::reference_type(current_class()->host_klass()->name());
subtype = hosttype.is_assignable_from(top, this, CHECK_VERIFY(this));
}
VerificationType hosttype =
VerificationType::reference_type(current_class()->host_klass()->name());
bool subtype = hosttype.is_assignable_from(top, this, CHECK_VERIFY(this));
if (!subtype) {
verify_error( ErrorContext::bad_type(current_frame->offset(),
current_frame->stack_top_ctx(),

View File

@ -245,8 +245,8 @@ BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
}
void* BufferBlob::operator new(size_t s, unsigned size) throw() {
void* p = CodeCache::allocate(size);
void* BufferBlob::operator new(size_t s, unsigned size, bool is_critical) throw() {
void* p = CodeCache::allocate(size, is_critical);
return p;
}
@ -277,7 +277,10 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
unsigned int size = allocation_size(cb, sizeof(AdapterBlob));
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) AdapterBlob(size, cb);
// The parameter 'true' indicates a critical memory allocation.
// This means that CodeCacheMinimumFreeSpace is used, if necessary
const bool is_critical = true;
blob = new (size, is_critical) AdapterBlob(size, cb);
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();
@ -299,7 +302,10 @@ MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
size += round_to(buffer_size, oopSize);
{
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
blob = new (size) MethodHandlesAdapterBlob(size);
// The parameter 'true' indicates a critical memory allocation.
// This means that CodeCacheMinimumFreeSpace is used, if necessary
const bool is_critical = true;
blob = new (size, is_critical) MethodHandlesAdapterBlob(size);
}
// Track memory usage statistic after releasing CodeCache_lock
MemoryService::track_code_cache_memory_usage();

View File

@ -209,7 +209,7 @@ class BufferBlob: public CodeBlob {
BufferBlob(const char* name, int size);
BufferBlob(const char* name, int size, CodeBuffer* cb);
void* operator new(size_t s, unsigned size) throw();
void* operator new(size_t s, unsigned size, bool is_critical = false) throw();
public:
// Creation
@ -253,7 +253,6 @@ public:
class MethodHandlesAdapterBlob: public BufferBlob {
private:
MethodHandlesAdapterBlob(int size) : BufferBlob("MethodHandles adapters", size) {}
MethodHandlesAdapterBlob(int size, CodeBuffer* cb) : BufferBlob("MethodHandles adapters", size, cb) {}
public:
// Creation

Some files were not shown because too many files have changed in this diff Show More