This commit is contained in:
Coleen Phillimore 2015-12-15 10:43:12 -05:00
commit a02be6bb0d
1120 changed files with 130760 additions and 11887 deletions

View File

@ -4,6 +4,7 @@ nbproject/private/
^webrev
^.hgtip
^.bridge2
^.jib/
.DS_Store
.metadata/
.recommenders/

View File

@ -337,3 +337,5 @@ d131f4b8433a79408f935eff9bf92a0664229b60 jdk9-b90
f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
09206c6513b300e1ac8541f3be012e1a49312104 jdk9-b93
25a2cab05cfbe6034b71d9e72d64c65b0572ce63 jdk9-b94
5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95
139f19d70350238e15e107945cea75082b6380b3 jdk-9+96

View File

@ -337,3 +337,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
106c06398f7ab330eef9e335fbd3a5a8ead23b77 jdk9-b92
331fda57dfd323c61804ba0472776790de572937 jdk9-b93
349488425abcaf3ff62f580007860b4b56875d10 jdk9-b94
12a6fb4f070f8ca8fbca219ab9abf5da8908b317 jdk-9+95
5582a79892596169ebddb3e2c2aa44939e4e3f40 jdk-9+96

View File

@ -99,7 +99,13 @@ AC_DEFUN([BASIC_FIXUP_PATH],
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
fi
$1="`cd "$path"; $THEPWDCMD -L`"
if test -d "$path"; then
$1="`cd "$path"; $THEPWDCMD -L`"
else
dir="`$DIRNAME "$path"`"
base="`$BASENAME "$path"`"
$1="`cd "$dir"; $THEPWDCMD -L`/$base"
fi
fi
fi
])
@ -237,12 +243,18 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH],
# 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 -)
# $3: Messages to user.
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.])
if test "x$3" != x; then
AC_MSG_WARN([$3])
fi
fi
])
@ -1072,6 +1084,26 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
AC_SUBST(BASH_ARGS)
])
################################################################################
#
# Default make target
#
AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
[
AC_ARG_WITH(default-make-target, [AS_HELP_STRING([--with-default-make-target],
[set the default make target @<:@exploded-image@:>@])])
if test "x$with_default_make_target" = "x" \
|| test "x$with_default_make_target" = "xyes"; then
DEFAULT_MAKE_TARGET="exploded-image"
elif test "x$with_default_make_target" = "xno"; then
AC_MSG_ERROR([--without-default-make-target is not a valid option])
else
DEFAULT_MAKE_TARGET="$with_default_make_target"
fi
AC_SUBST(DEFAULT_MAKE_TARGET)
])
# Code to run after AC_OUTPUT
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
[

View File

@ -423,7 +423,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
AC_MSG_ERROR([fixpath did not work!])
fi
AC_MSG_RESULT([yes])
FIXPATH_DETACH_FLAG="--detach"
fi
AC_SUBST(FIXPATH)
AC_SUBST(FIXPATH_DETACH_FLAG)
])

View File

@ -375,6 +375,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big
AC_SUBST(JAVA_FLAGS_BIG)
# By default, the main javac compilations use big
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"
AC_SUBST(JAVA_FLAGS_JAVAC)
AC_MSG_CHECKING([flags for boot jdk java command for small workloads])

View File

@ -59,3 +59,8 @@ JAVAH_CMD:=$(BOOT_JDK)/bin/javah
JAR_CMD:=$(BOOT_JDK)/bin/jar
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
# When building a 32bit target, make sure the sjavac server flags are compatible
# with a 32bit JVM.
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
SJAVAC_SERVER_JAVA_FLAGS:= -Xms256M -Xmx1500M
endif

View File

@ -138,14 +138,6 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
JOBS="$memory_gb"
else
JOBS="$NUM_CORES"
# On bigger machines, leave some room for other processes to run
if test "$JOBS" -gt "4"; then
JOBS=`expr $JOBS '*' 90 / 100`
fi
fi
# Cap number of jobs to 16
if test "$JOBS" -gt "16"; then
JOBS=16
fi
if test "$JOBS" -eq "0"; then
JOBS=1
@ -246,6 +238,73 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
])
################################################################################
#
# Optionally enable distributed compilation of native code using icecc/icecream
#
AC_DEFUN([BPERF_SETUP_ICECC],
[
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
if test "x${enable_icecc}" = "xyes"; then
BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
old_path="$PATH"
# Look for icecc-create-env in some known places
PATH="$PATH:/usr/lib/icecc:/usr/lib64/icecc"
BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env)
# Use icecc-create-env to create a minimal compilation environment that can
# be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
AC_MSG_CHECKING([for icecc build environment for target compiler])
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env.
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
fi
PATH="$old_path"
# The bundle with the compiler gets a name based on checksums. Parse log file
# to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler
AC_MSG_CHECKING([for icecc build environment for build compiler])
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
elif test "x${BUILD_CC##*/}" = "xclang"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
fi
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
else
BUILD_ICECC="${ICECC}"
fi
AC_SUBST(ICECC)
AC_SUBST(BUILD_ICECC)
fi
])
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[
@ -258,8 +317,15 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
USE_PRECOMPILED_HEADER=1
AC_MSG_CHECKING([If precompiled header is enabled])
if test "x$ENABLE_PRECOMPH" = xno; then
AC_MSG_RESULT([no, forced])
USE_PRECOMPILED_HEADER=0
elif test "x$ICECC" != "x"; then
AC_MSG_RESULT([no, does not work effectively with icecc])
USE_PRECOMPILED_HEADER=0
else
AC_MSG_RESULT([yes])
fi
if test "x$ENABLE_PRECOMPH" = xyes; then
@ -337,9 +403,9 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
AC_MSG_RESULT([$ENABLE_SJAVAC])
AC_SUBST(ENABLE_SJAVAC)
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
[use only the server part of sjavac for faster javac compiles @<:@disabled@:>@])],
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="no"])
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server],
[disable javac server @<:@enabled@:>@])],
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"])
if test "x$JVM_ARG_OK" = "xfalse"; then
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
ENABLE_JAVAC_SERVER="no"
@ -347,4 +413,10 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
AC_MSG_CHECKING([whether to use javac server])
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
AC_SUBST(ENABLE_JAVAC_SERVER)
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
# resources.
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"
fi
])

View File

@ -257,10 +257,14 @@ fi
# Now transfer control to the script generated by autoconf. This is where the
# main work is done.
RCDIR=`mktemp -dt jdk-build-configure.tmp.XXXXXX` || exit $?
trap "rm -rf \"$RCDIR\"" EXIT
conf_logfile=./configure.log
(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
(exec 3>&1 ; ((. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) \
; echo $? > "$RCDIR/rc" ) \
| tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
conf_result_code=$?
conf_result_code=`cat "$RCDIR/rc"`
###
### Post-processing
###

View File

@ -121,6 +121,9 @@ PKG_PROG_PKG_CONFIG
# After basic tools have been setup, we can check build os specific details.
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
# Misc basic settings
BASIC_SETUP_DEFAULT_MAKE_TARGET
###############################################################################
#
# Determine OpenJDK variants, options and version numbers.
@ -237,6 +240,9 @@ BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
# Setup smart javac (after cores and memory have been setup)
BPERF_SETUP_SMART_JAVAC
# Setup use of icecc if requested
BPERF_SETUP_ICECC
# Can the C/C++ compiler use precompiled headers?
BPERF_SETUP_PRECOMPILED_HEADERS

View File

@ -976,6 +976,19 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
DISABLE_WARNING_PREFIX=
fi
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
# Repeate the check for the BUILD_CC
CC_OLD="$CC"
CC="$BUILD_CC"
FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
[BUILD_CC_CAN_DISABLE_WARNINGS=true],
[BUILD_CC_CAN_DISABLE_WARNINGS=false]
)
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
else
BUILD_CC_DISABLE_WARNING_PREFIX=
fi
CC="$CC_OLD"
;;
clang)
DISABLE_WARNING_PREFIX="-Wno-"

File diff suppressed because it is too large Load Diff

View File

@ -49,8 +49,8 @@ ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
# compiler that produces code that can be run on the build platform.
HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
HOSTCC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
####################################################
#
@ -105,7 +105,7 @@ USE_CLANG := @USE_CLANG@
# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
# Hotspot has its own handling on the Windows path situation.
CXX:=@CCACHE@ @HOTSPOT_CXX@
CXX:=@CCACHE@ @ICECC@ @HOTSPOT_CXX@
LD:=@HOTSPOT_LD@
MT:=@HOTSPOT_MT@
RC:=@HOTSPOT_RC@

View File

@ -491,53 +491,74 @@ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
[
#
# ENABLE_DEBUG_SYMBOLS
# NATIVE_DEBUG_SYMBOLS
# This must be done after the toolchain is setup, since we're looking at objcopy.
#
AC_ARG_ENABLE([debug-symbols],
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])])
AC_MSG_CHECKING([what type of native debug symbols to use])
AC_ARG_WITH([native-debug-symbols],
[AS_HELP_STRING([--with-native-debug-symbols],
[set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
[],
[with_native_debug_symbols="zipped"])
NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
AC_MSG_CHECKING([if we should generate debug symbols])
if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
if test "x$enable_debug_symbols" = "xyes" && test "x$OBJCOPY" = x; then
# explicit enabling of enable-debug-symbols and can't find objcopy
# this is an error
AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
fi
if test "x$enable_debug_symbols" = "xyes"; then
ENABLE_DEBUG_SYMBOLS=true
elif test "x$enable_debug_symbols" = "xno"; then
ENABLE_DEBUG_SYMBOLS=false
else
# Default is on if objcopy is found
if test "x$OBJCOPY" != x; then
ENABLE_DEBUG_SYMBOLS=true
# MacOS X and Windows don't use objcopy but default is on for those OSes
elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then
ENABLE_DEBUG_SYMBOLS=true
else
ENABLE_DEBUG_SYMBOLS=false
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
if test "x$OBJCOPY" = x; then
# enabling of enable-debug-symbols and can't find objcopy
# this is an error
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
fi
fi
fi
AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
#
# ZIP_DEBUGINFO_FILES
#
AC_MSG_CHECKING([if we should zip debug-info files])
AC_ARG_ENABLE([zip-debug-info],
[AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])],
[enable_zip_debug_info="${enableval}"], [enable_zip_debug_info="yes"])
AC_MSG_RESULT([${enable_zip_debug_info}])
if test "x${enable_zip_debug_info}" = "xno"; then
ZIP_DEBUGINFO_FILES=false
else
ENABLE_DEBUG_SYMBOLS=true
ZIP_DEBUGINFO_FILES=true
DEBUG_BINARIES=true
STRIP_POLICY=min_strip
elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
ENABLE_DEBUG_SYMBOLS=false
ZIP_DEBUGINFO_FILES=false
DEBUG_BINARIES=false
STRIP_POLICY=no_strip
elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
ENABLE_DEBUG_SYMBOLS=false # -g option only
ZIP_DEBUGINFO_FILES=false
DEBUG_BINARIES=true
STRIP_POLICY=no_strip
STRIP=""
elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
if test "x$OBJCOPY" = x; then
# enabling of enable-debug-symbols and can't find objcopy
# this is an error
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
fi
fi
ENABLE_DEBUG_SYMBOLS=true
ZIP_DEBUGINFO_FILES=false
DEBUG_BINARIES=true
STRIP_POLICY=min_strip
else
AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
fi
# --enable-debug-symbols is deprecated.
# Please use --with-native-debug-symbols=[internal,external,zipped] .
BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
[Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
# --enable-zip-debug-info is deprecated.
# Please use --with-native-debug-symbols=zipped .
BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
[Please use --with-native-debug-symbols=zipped .])
AC_SUBST(NATIVE_DEBUG_SYMBOLS)
AC_SUBST(DEBUG_BINARIES)
AC_SUBST(STRIP_POLICY)
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
AC_SUBST(ZIP_DEBUGINFO_FILES)
])

View File

@ -271,6 +271,9 @@ SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
# Number of parallel jobs to use for compilation
JOBS?=@JOBS@
# Default make target
DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@
FREETYPE_LIBS:=@FREETYPE_LIBS@
FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@
FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
@ -329,7 +332,7 @@ WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
# Tools that potentially need to be cross compilation aware.
CC:=@FIXPATH@ @CCACHE@ @CC@
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
# CFLAGS used to compile the jdk native libraries (C-code)
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
@ -339,7 +342,7 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
CXX:=@FIXPATH@ @CCACHE@ @CXX@
CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@
#CXXFLAGS:=@CXXFLAGS@
CPP:=@FIXPATH@ @CPP@
@ -382,8 +385,12 @@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform.
BUILD_CC:=@FIXPATH@ @BUILD_CC@
BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
BUILD_LD:=@FIXPATH@ @BUILD_LD@
BUILD_AS:=@FIXPATH@ @BUILD_AS@
BUILD_AR:=@FIXPATH@ @BUILD_AR@
BUILD_NM:=@FIXPATH@ @BUILD_NM@
BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
@ -414,6 +421,9 @@ ENABLE_DEBUG_SYMBOLS:=@ENABLE_DEBUG_SYMBOLS@
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@
NATIVE_DEBUG_SYMBOLS:=@NATIVE_DEBUG_SYMBOLS@
DEBUG_BINARIES:=@DEBUG_BINARIES@
STRIP_POLICY:=@STRIP_POLICY@
#
# Compress (or not) jars
@ -446,6 +456,7 @@ STRIPFLAGS:=@STRIPFLAGS@
JAVA_FLAGS:=@JAVA_FLAGS@
JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
@ -462,13 +473,15 @@ SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
# it possible to override only the *_CMD variables.
JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)
JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS)
JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
JAVAC=@FIXPATH@ $(JAVAC_CMD)
JAVAH=@FIXPATH@ $(JAVAH_CMD)
JAR=@FIXPATH@ $(JAR_CMD)
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
# A specific java binary with specific options can be used to run
# the long running background sjavac servers and other long running tasks.
SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAGS)
SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
$(SJAVAC_SERVER_JAVA_FLAGS)
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
# overriding that value by using ?=.

View File

@ -539,6 +539,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# The corresponding ar tool is lib.exe (used to create static libraries)
AC_CHECK_PROG([AR], [lib],[lib],,,)
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
BASIC_CHECK_TOOLS(AR, ar gcc-ar)
else
BASIC_CHECK_TOOLS(AR, ar)
fi
@ -584,7 +586,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
# FIXME: we should unify this with the solaris case above.
BASIC_CHECK_TOOLS(STRIP, strip)
BASIC_FIXUP_EXECUTABLE(STRIP)
BASIC_CHECK_TOOLS(NM, nm)
if test "x$TOOLCHAIN_TYPE" = xgcc; then
BASIC_CHECK_TOOLS(NM, nm gcc-nm)
else
BASIC_CHECK_TOOLS(NM, nm)
fi
BASIC_FIXUP_EXECUTABLE(NM)
GNM="$NM"
AC_SUBST(GNM)
@ -717,6 +723,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
BASIC_FIXUP_EXECUTABLE(BUILD_CC)
BASIC_REQUIRE_PROGS(BUILD_CXX, [cl CC g++])
BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
BASIC_PATH_PROGS(BUILD_NM, nm gcc-nm)
BASIC_FIXUP_EXECUTABLE(BUILD_NM)
BASIC_PATH_PROGS(BUILD_AR, ar gcc-ar)
BASIC_FIXUP_EXECUTABLE(BUILD_AR)
# Assume the C compiler is the assembler
BUILD_AS="$BUILD_CC -c"
# Just like for the target compiler, use the compiler as linker
BUILD_LD="$BUILD_CC"
PATH="$OLDPATH"
@ -726,15 +739,21 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
BUILD_CC="$CC"
BUILD_CXX="$CXX"
BUILD_LD="$LD"
BUILD_NM="$NM"
BUILD_AS="$AS"
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
BUILD_AR="$AR"
fi
AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CXX)
AC_SUBST(BUILD_LD)
AC_SUBST(BUILD_NM)
AC_SUBST(BUILD_AS)
AC_SUBST(BUILD_SYSROOT_CFLAGS)
AC_SUBST(BUILD_SYSROOT_LDFLAGS)
AC_SUBST(BUILD_AR)
])
# Setup legacy variables that are still needed as alternative ways to refer to

127
common/bin/jib.sh Normal file
View File

@ -0,0 +1,127 @@
#!/bin/bash
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# This script installs the JIB tool into it's own local repository and
# puts a wrapper scripts into <source-root>/.jib
mydir="$(dirname "${BASH_SOURCE[0]}")"
myname="$(basename "${BASH_SOURCE[0]}")"
installed_jib_script=${mydir}/../../.jib/jib
install_data=${mydir}/../../.jib/.data
setup_url() {
if [ -f "~/.config/jib/jib.conf" ]; then
source ~/.config/jib/jib.conf
fi
jib_repository="jdk-virtual"
jib_organization="jpg/infra/builddeps"
jib_module="jib"
jib_revision="2.0-SNAPSHOT"
jib_ext="jib.sh.gz"
closed_script="${mydir}/../../closed/conf/jib-install.conf"
if [ -f "${closed_script}" ]; then
source "${closed_script}"
fi
if [ -n "${JIB_SERVER}" ]; then
jib_server="${JIB_SERVER}"
fi
if [ -n "${JIB_REPOSITORY}" ]; then
jib_repository="${JIB_REPOSITORY}"
fi
if [ -n "${JIB_ORGANIZATION}" ]; then
jib_organization="${JIB_ORGANIZATION}"
fi
if [ -n "${JIB_MODULE}" ]; then
jib_module="${JIB_MODULE}"
fi
if [ -n "${JIB_REVISION}" ]; then
jib_revision="${JIB_REVISION}"
fi
if [ -n "${JIB_EXTENSION}" ]; then
jib_extension="${JIB_EXTENSION}"
fi
if [ -n "${JIB_URL}" ]; then
jib_url="${JIB_URL}"
data_string="${jib_url}"
else
data_string="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
jib_url="${jib_server}/${data_string}"
fi
}
install_jib() {
if [ -z "${jib_server}" -a -z "${JIB_URL}" ]; then
echo "No jib server or URL provided, set either"
echo "JIB_SERVER=<base server address>"
echo "or"
echo "JIB_URL=<full path to install script>"
exit 1
fi
if command -v curl > /dev/null; then
getcmd="curl -s"
elif command -v wget > /dev/null; then
getcmd="wget --quiet -O -"
else
echo "Could not find either curl or wget"
exit 1
fi
if ! command -v gunzip > /dev/null; then
echo "Could not find gunzip"
exit 1
fi
echo "Downloading JIB bootstrap script"
mkdir -p "${installed_jib_script%/*}"
rm -f "${installed_jib_script}.gz"
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
if [ ! -s "${installed_jib_script}.gz" ]; then
echo "Failed to download ${jib_url}"
exit 1
fi
echo "Extracting JIB bootstrap script"
rm -f "${installed_jib_script}"
gunzip "${installed_jib_script}.gz"
chmod +x "${installed_jib_script}"
echo "${data_string}" > "${install_data}"
}
# Main body starts here
setup_url
if [ ! -x "${installed_jib_script}" ]; then
install_jib
elif [ ! -e "${install_data}" ] || [ "${data_string}" != "$(cat "${install_data}")" ]; then
echo "Install url changed since last time, reinstalling"
install_jib
fi
${installed_jib_script} "$@"

View File

@ -1293,10 +1293,7 @@ jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/win
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.pkcs11/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent/package.html : jdk/src/macosx/classes/com/apple/concurrent/package.html
jdk/src/jdk.deploy.osx/macosx/classes/apple/applescript : jdk/src/macosx/classes/apple/applescript
jdk/src/jdk.deploy.osx/macosx/classes/apple/security : jdk/src/macosx/classes/apple/security
jdk/src/jdk.deploy.osx/macosx/classes/com/apple/concurrent : jdk/src/macosx/classes/com/apple/concurrent
jdk/src/jdk.deploy.osx/macosx/native/libapplescriptengine : jdk/src/macosx/native/apple/applescript
jdk/src/jdk.deploy.osx/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/Dispatch.m : jdk/src/macosx/native/com/apple/concurrent/Dispatch.m
jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m

555
common/conf/jib-profiles.js Normal file
View File

@ -0,0 +1,555 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This file defines build profiles for the JIB tool and others.
*
* A build profile defines a set of configuration options and external
* dependencies that we for some reason or other care about specifically.
* Typically, build profiles are defined for the build configurations we
* build regularly.
*
* Contract against this file from the tools that use it, is to provide
* a function on the form:
*
* getJibProfiles(input)
*
* which returns an object graph describing the profiles and their
* dependencies. The name of the function is based on the name of this
* file, minus the extension and the '-', camel cased and prefixed with
* 'get'.
*
*
* The parameter 'input' is an object that optionally contains some data.
* Optionally because a tool may read the configuration for different purposes.
* To initially get a list of available profiles, the active profile may not
* yet be known for instance.
*
* Data that may be set on the input object:
*
* input.profile = <name of active profile>
*
* If the active profile is set, the following data from it must also
* be provided:
*
* input.profile
* input.target_os
* input.target_cpu
* input.build_os
* input.build_cpu
* input.target_platform
* input.build_platform
* // The build_osenv_* variables describe the unix layer on Windows systems,
* // i.e. Cygwin, which may also be 32 or 64 bit.
* input.build_osenv
* input.build_osenv_cpu
* input.build_osenv_platform
*
* For more complex nested attributes, there is a method "get":
*
* input.get("<dependency>", "<attribute>")
*
* Valid attributes are:
* install_path
* download_path
* download_dir
*
*
* The output data generated by this configuration file has the following
* format:
*
* data: {
* // Identifies the version of this format to the tool reading it
* format_version: "1.0",
*
* // Name of base outputdir. JIB assumes the actual output dir is formed
* // by adding the configuration name: <output_basedir>/<config-name>
* output_basedir: "build",
* // Configure argument to use to specify configuration name
* configuration_configure_arg:
* // Make argument to use to specify configuration name
* configuration_make_arg:
*
* profiles: {
* <profile-name>: {
* // Name of os the profile is built to run on
* target_os; <string>
* // Name of cpu the profile is built to run on
* target_cpu; <string>
* // Combination of target_os and target_cpu for convenience
* target_platform; <string>
* // Name of os the profile is built on
* build_os; <string>
* // Name of cpu the profile is built on
* build_cpu; <string>
* // Combination of build_os and build_cpu for convenience
* build_platform; <string>
*
* // List of dependencies needed to build this profile
* dependencies: <Array of strings>
*
* // List of configure args to use for this profile
* configure_args: <Array of strings>
*
* // List of free form labels describing aspects of this profile
* labels: <Array of strings>
* }
* }
*
* // Dependencies use a Maven like deployment structure
* dependencies: {
* <dependency-name>: {
* // Organization part of path defining this dependency
* organization: <string>
* // File extension for this dependency
* ext: <string>
* // Module part of path for defining this dependency,
* // defaults to <dependency-name>
* module: <string>
* // Revision part of path for defining this dependency
* revision: <string>
*
* // List of configure args to add when using this dependency,
* // defaults to
* // "--with-<dependency-name>=input.get("<dependency-name", "install_path")"
* configure_args: <array of strings>
*
* // Name of environment variable to set when using this dependency
* // when running make
* environment_name: <string>
* // Value of environment variable to set when using this dependency
* // when running make
* environment_value: <string>
*
* // Value to add to the PATH variable when using this dependency,
* // applies to both make and configure
* environment_path: <string>
* }
*
* <dependency-name>: {
* // For certain dependencies where a legacy distribution mechanism is
* // already in place, the "javare" server layout is also supported
* // Indicate that an alternate server source and layout should be used
* server: "javare"
*
* // For "javare", a combination of module, revision,
* // build number (optional), files and checksum file is possible for
* // artifacts following the standard layout.
* module: <string>
* revision: <string>
* build_number: <string>
* checksum_file: <string>
* file: <string>
*
* // For other files, use checksum path and path instead
* checksum_path: <string>
* path: <string>
* }
* }
* }
*/
/**
* Main entry to generate the profile configuration
*
* @param input External data to use for generating the configuration
* @returns {{}} Profile configuration
*/
var getJibProfiles = function (input) {
var data = {};
// Identifies the version of this format to the tool reading it
data.format_version = "1.0";
// Organization is used when uploading/publishing build results
data.organization = "com.oracle.jpg.jdk";
// The base directory for the build output. JIB will assume that the
// actual build directory will be <output_basedir>/<configuration>
data.output_basedir = "build";
// The configure argument to use to specify the name of the configuration
data.configuration_configure_arg = "--with-conf-name=";
// The make argument to use to specify the name of the configuration
data.configuration_make_arg = "CONF_NAME=";
// Define some common values
var common = getJibProfilesCommon(input);
// Generate the profiles part of the configuration
data.profiles = getJibProfilesProfiles(input, common);
// Generate the dependencies part of the configuration
data.dependencies = getJibProfilesDependencies(input, common);
return data;
};
/**
* Generates some common values
*
* @param input External data to use for generating the configuration
* @returns Common values
*/
var getJibProfilesCommon = function (input) {
var common = {
dependencies: ["boot_jdk", "gnumake", "jtreg"],
configure_args: ["--with-default-make-target=all"],
configure_args_32bit: ["--with-target-bits=32", "--with-jvm-variants=client,server"],
configure_args_debug: ["--enable-debug"],
organization: "jpg.infra.builddeps"
};
return common;
};
/**
* Generates the profiles part of the configuration.
*
* @param input External data to use for generating the configuration
* @param common The common values
* @returns {{}} Profiles part of the configuration
*/
var getJibProfilesProfiles = function (input, common) {
var profiles = {};
// Main SE profiles
var mainProfiles = {
"linux-x64": {
target_os: "linux",
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: common.configure_args,
make_args: common.make_args
},
"linux-x86": {
target_os: "linux",
target_cpu: "x86",
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, common.configure_args_32bit),
make_args: common.make_args
},
"macosx-x64": {
target_os: "macosx",
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, "--with-sdk-name=macosx10.9"),
make_args: common.make_args
},
"solaris-x64": {
target_os: "solaris",
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit", "cups"),
configure_args: common.configure_args,
make_args: common.make_args
},
"solaris-sparcv9": {
target_os: "solaris",
target_cpu: "sparcv9",
dependencies: concat(common.dependencies, "devkit", "cups"),
configure_args: common.configure_args,
make_args: common.make_args
},
"windows-x64": {
target_os: "windows",
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit", "freetype"),
configure_args: common.configure_args,
make_args: common.make_args
},
"windows-x86": {
target_os: "windows",
target_cpu: "x86",
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit", "freetype"),
configure_args: concat(common.configure_args, common.configure_args_32bit),
make_args: common.make_args
}
};
profiles = concatObjects(profiles, mainProfiles);
// Generate debug versions of all the main profiles
profiles = concatObjects(profiles, generateDebugProfiles(common, mainProfiles));
// Specific open profiles needed for JPRT testing
var jprtOpenProfiles = {
"linux-x64-open": {
target_os: mainProfiles["linux-x64"].target_os,
target_cpu: mainProfiles["linux-x64"].target_cpu,
dependencies: mainProfiles["linux-x64"].dependencies,
configure_args: concat(mainProfiles["linux-x64"].configure_args,
"--enable-openjdk-only"),
make_args: mainProfiles["linux-x64"].make_args,
labels: [ "open" ]
},
"solaris-x64-open": {
target_os: mainProfiles["solaris-x64"].target_os,
target_cpu: mainProfiles["solaris-x64"].target_cpu,
dependencies: mainProfiles["solaris-x64"].dependencies,
configure_args: concat(mainProfiles["solaris-x64"].configure_args,
"--enable-openjdk-only"),
make_args: mainProfiles["solaris-x64"].make_args,
labels: [ "open" ]
}
};
profiles = concatObjects(profiles, jprtOpenProfiles);
// Generate debug profiles for the open jprt profiles
profiles = concatObjects(profiles, generateDebugProfiles(common, jprtOpenProfiles));
// Profiles used to run tests. Used in JPRT.
var testOnlyProfiles = {
"run-test": {
target_os: input.build_os,
target_cpu: input.build_cpu,
dependencies: [ "jtreg", "gnumake" ],
labels: "test"
}
};
profiles = concatObjects(profiles, testOnlyProfiles);
// Generate the missing platform attributes
profiles = generatePlatformAttributes(profiles);
return profiles;
};
/**
* Generate the dependencies part of the configuration
*
* @param input External data to use for generating the configuration
* @param common The common values
* @returns {{}} Dependencies part of configuration
*/
var getJibProfilesDependencies = function (input, common) {
var boot_jdk_platform = input.build_os + "-"
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
var devkit_platform_revisions = {
linux_x64: "gcc4.9.2-OEL6.4+1.0",
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
solaris_x64: "SS12u3-Solaris10u10+1.0",
solaris_sparcv9: "SS12u3-Solaris10u10+1.0",
windows_x64: "VS2013SP4+1.0"
};
var devkit_platform = (input.target_cpu == "x86"
? input.target_os + "_x64"
: input.target_platform);
var dependencies = {
boot_jdk: {
server: "javare",
module: "jdk",
revision: "8",
checksum_file: boot_jdk_platform + "/MD5_VALUES",
file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz",
configure_args: (input.build_os == "macosx"
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home"
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0")
},
devkit: {
organization: common.organization,
ext: "tar.gz",
module: "devkit-" + devkit_platform,
revision: devkit_platform_revisions[devkit_platform]
},
build_devkit: {
organization: common.organization,
ext: "tar.gz",
module: "devkit-" + input.build_platform,
revision: devkit_platform_revisions[input.build_platform]
},
cups: {
organization: common.organization,
ext: "tar.gz",
revision: "1.0118+1.0"
},
jtreg: {
server: "javare",
revision: "4.1",
build_number: "b12",
checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.1.zip",
environment_name: "JT_HOME"
},
gnumake: {
organization: common.organization,
ext: "tar.gz",
revision: "4.0+1.0",
module: (input.build_os == "windows"
? "gnumake-" + input.build_osenv_platform
: "gnumake-" + input.build_platform),
configure_args: (input.build_os == "windows"
? "MAKE=" + input.get("gnumake", "install_path") + "/cygwin/bin/make"
: "MAKE=" + input.get("gnumake", "install_path") + "/bin/make"),
environment_path: (input.build_os == "windows"
? input.get("gnumake", "install_path") + "/cygwin/bin"
: input.get("gnumake", "install_path") + "/bin")
},
freetype: {
organization: common.organization,
ext: "tar.gz",
revision: "2.3.4+1.0",
module: "freetype-" + input.target_platform
}
};
return dependencies;
};
/**
* Generate the missing platform attributes for profiles
*
* @param profiles Profiles map to generate attributes on
* @returns {{}} New profiles map with platform attributes fully filled in
*/
var generatePlatformAttributes = function (profiles) {
var ret = concatObjects(profiles, {});
for (var profile in profiles) {
if (ret[profile].build_os == null) {
ret[profile].build_os = ret[profile].target_os;
}
if (ret[profile].build_cpu == null) {
ret[profile].build_cpu = ret[profile].target_cpu;
}
ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu;
ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu;
}
return ret;
};
/**
* Generates debug versions of profiles. Clones the given profiles and adds
* debug metadata.
*
* @param common Common values
* @param profiles Profiles map to generate debug profiles for
* @returns {{}} New map of profiles containing debug profiles
*/
var generateDebugProfiles = function (common, profiles) {
var newProfiles = {};
for (var profile in profiles) {
var debugProfile = profile + "-debug";
newProfiles[debugProfile] = clone(profiles[profile]);
newProfiles[debugProfile].debug_level = "fastdebug";
newProfiles[debugProfile].labels
= concat(newProfiles[debugProfile].labels || [], "debug"),
newProfiles[debugProfile].configure_args
= concat(newProfiles[debugProfile].configure_args,
common.configure_args_debug);
}
return newProfiles;
};
/**
* Deep clones an object tree.
*
* @param o Object to clone
* @returns {{}} Clone of o
*/
var clone = function (o) {
return JSON.parse(JSON.stringify(o));
};
/**
* Concatenates all arguments into a new array
*
* @returns {Array.<T>} New array containing all arguments
*/
var concat = function () {
return Array.prototype.concat.apply([], arguments);
};
/**
* Copies all elements in an array into a new array but replacing all
* occurrences of original with replacement.
*
* @param original Element to look for
* @param replacement Element to replace with
* @param a Array to copy
* @returns {Array} New array with all occurrences of original replaced
* with replacement
*/
var replace = function (original, replacement, a) {
var newA = [];
for (var i in a) {
if (original == a[i]) {
newA.push(replacement);
} else {
newA.push(a[i]);
}
}
return newA;
};
/**
* Deep concatenation of two objects. For each node encountered, merge
* the contents with the corresponding node in the other object tree,
* treating all strings as array elements.
*
* @param o1 Object to concatenate
* @param o2 Object to concatenate
* @returns {{}} New object tree containing the concatenation of o1 and o2
*/
var concatObjects = function (o1, o2) {
var ret = {};
for (var a in o1) {
if (o2[a] == null) {
ret[a] = o1[a];
}
}
for (var a in o2) {
if (o1[a] == null) {
ret[a] = o2[a];
} else {
if (typeof o1[a] == 'string') {
ret[a] = [o1[a]].concat(o2[a]);
} else if (Array.isArray(o1[a])) {
ret[a] = o1[a].concat(o2[a]);
} else if (typeof o1[a] == 'object') {
ret[a] = concatObjects(o1[a], o2[a]);
}
}
}
return ret;
};

View File

@ -358,10 +358,13 @@ int main(int argc, char const ** argv)
char *line;
char *current;
int i, cmd;
DWORD exitCode;
DWORD exitCode = 0;
DWORD processFlags = 0;
BOOL processInheritHandles = TRUE;
BOOL waitForChild = TRUE;
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> [--detach] /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
exit(0);
}
@ -386,7 +389,22 @@ int main(int argc, char const ** argv)
exit(-1);
}
i = 2;
if (argv[2][0] == '-') {
if (strcmp(argv[2], "--detach") == 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath in detached mode\n");
}
processFlags |= DETACHED_PROCESS;
processInheritHandles = FALSE;
waitForChild = FALSE;
} else {
fprintf(stderr, "fixpath Unknown argument: %s\n", argv[2]);
exit(-1);
}
i = 3;
} else {
i = 2;
}
// handle assignments
while (i < argc) {
@ -428,6 +446,10 @@ int main(int argc, char const ** argv)
while (i < argc) {
char const *replaced = replace_cygdrive(argv[i]);
if (replaced[0] == '@') {
if (waitForChild == FALSE) {
fprintf(stderr, "fixpath Cannot use @-files in detached mode: %s\n", replaced);
exit(1);
}
// Found at-file! Fix it!
replaced = fix_at_file(replaced);
}
@ -480,8 +502,8 @@ int main(int argc, char const ** argv)
line,
0,
0,
TRUE,
0,
processInheritHandles,
processFlags,
NULL,
NULL,
&si,
@ -492,24 +514,30 @@ int main(int argc, char const ** argv)
exit(126);
}
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &exitCode);
if (waitForChild == TRUE) {
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &exitCode);
if (getenv("DEBUG_FIXPATH") != NULL) {
for (i=0; i<num_files_to_delete; ++i) {
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
files_to_delete[i]);
if (getenv("DEBUG_FIXPATH") != NULL) {
for (i=0; i<num_files_to_delete; ++i) {
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
files_to_delete[i]);
}
} else {
for (i=0; i<num_files_to_delete; ++i) {
remove(files_to_delete[i]);
}
}
if (exitCode != 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath exit code %d\n",
exitCode);
}
}
} else {
for (i=0; i<num_files_to_delete; ++i) {
remove(files_to_delete[i]);
}
}
if (exitCode != 0) {
if (getenv("DEBUG_FIXPATH") != NULL) {
fprintf(stderr, "fixpath exit code %d\n",
exitCode);
fprintf(stderr, "fixpath Not waiting for child process");
}
}

View File

@ -337,3 +337,5 @@ c847a53b38d2fffb87afc483c74db05eced9b4f4 jdk9-b89
f7d70caad89ad0c43bb057bca0aad6f17ce05a6a jdk9-b92
27e9c8d8091e2447ea7ef3e3103e9b7dd286e03a jdk9-b93
61e9f509be0f78f0961477960f372b0533214bb8 jdk9-b94
fd038e8a16eec80d0d6b337d74a582790ed4b3ee jdk-9+95
feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96

View File

@ -497,3 +497,5 @@ bc48b669bc6610fac97e16593050c0f559cf6945 jdk9-b88
53cb98d68a1aeb08d29c89d6da748de60c448e37 jdk9-b92
d8b24776484cc4dfd19f50b23eaa18a80a161371 jdk9-b93
a22b7c80529f5f05c847e932e017456e83c46233 jdk9-b94
0c79cf3cdf0904fc4a630b91b32904491e1ae430 jdk-9+95
a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96

View File

@ -1,175 +0,0 @@
#
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Rules to build serviceability agent library, used by vm.make
# libsaproc.so(dylib): serviceability agent
SAPROC = saproc
ifeq ($(OS_VENDOR), Darwin)
LIBSAPROC = lib$(SAPROC).$(LIBRARY_SUFFIX)
LIBSAPROC_DEBUGINFO = lib$(SAPROC).$(LIBRARY_SUFFIX).dSYM
LIBSAPROC_DIZ = lib$(SAPROC).diz
else
LIBSAPROC = lib$(SAPROC).so
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
endif
AGENT_DIR = $(GAMMADIR)/agent
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
$(SASRCDIR)/symtab.c \
$(SASRCDIR)/libproc_impl.c \
$(SASRCDIR)/ps_proc.c \
$(SASRCDIR)/ps_core.c \
$(SASRCDIR)/BsdDebuggerLocal.c \
$(AGENT_DIR)/src/share/native/sadis.c
DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \
$(SASRCDIR)/libproc_impl.c \
$(SASRCDIR)/ps_core.c \
$(SASRCDIR)/MacosxDebuggerLocal.m \
$(AGENT_DIR)/src/share/native/sadis.c
ifeq ($(OS_VENDOR), FreeBSD)
SASRCFILES = $(BSD_NON_STUB_SASRCFILES)
SALIBS = -lutil -lthread_db
SAARCH = $(ARCHFLAG)
else
ifeq ($(OS_VENDOR), Darwin)
SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
SALIBS = -g \
-framework Foundation \
-framework JavaNativeFoundation \
-framework Security \
-framework CoreFoundation
#objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
SAARCH = $(subst -march=i586,,$(ARCHFLAG))
# This is needed to locate JavaNativeFoundation.framework
ifeq ($(SYSROOT_CFLAGS),)
# this will happen when building without spec.gmk, set SDKROOT to a valid SDK
# path if your system does not have headers installed in the system frameworks
SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks"
else
# Just use SYSROOT_CFLAGS
SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS)
endif
else
SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
SALIBS =
SAARCH = $(ARCHFLAG)
endif
endif
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
SA_DEBUG_CFLAGS = -g
endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PPC, ARM or zero.
ifneq ($(wildcard $(AGENT_DIR)),)
ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
BUILDLIBSAPROC = $(LIBSAPROC)
endif
endif
ifneq ($(OS_VENDOR), Darwin)
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
endif
SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
@echo $(LOG_INFO) Making SA debugger back-end...
$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
$(SA_SYSROOT_FLAGS) \
$(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \
$(BOOT_JAVA_INCLUDES) \
$(SASRCFILES) \
$(SA_LFLAGS) \
$(SA_DEBUG_CFLAGS) \
-o $@ \
$(SALIBS)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(OS_VENDOR), Darwin)
$(DSYMUTIL) $@
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) -r $(LIBSAPROC_DEBUGINFO)
endif
else
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
endif
install_saproc: $(BUILDLIBSAPROC)
@echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"
ifeq ($(OS_VENDOR), Darwin)
$(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \
$(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
else
$(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \
$(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO)
endif
$(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \
$(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ)
$(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"
.PHONY: install_saproc

View File

@ -158,5 +158,6 @@ for e in ${Src_Files}; do
fi
Obj_Files="${Obj_Files}$o "
done
Obj_Files=`echo ${Obj_Files} | tr ' ' '\n' | sort`
echo Obj_Files=${Obj_Files}

View File

@ -84,10 +84,7 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const {
frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
// Pass callers initial_caller_sp as unextended_sp.
return frame(sender_sp(), sender_pc(),
CC_INTERP_ONLY((intptr_t*)((parent_ijava_frame_abi *)callers_abi())->initial_caller_sp)
NOT_CC_INTERP((intptr_t*)get_ijava_state()->sender_sp)
);
return frame(sender_sp(), sender_pc(), (intptr_t*)get_ijava_state()->sender_sp);
}
frame frame::sender_for_compiled_frame(RegisterMap *map) const {
@ -168,14 +165,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
if (method->is_native()) {
// Prior to calling into the runtime to notify the method exit the possible
// result value is saved into the interpreter frame.
#ifdef CC_INTERP
interpreterState istate = get_interpreterState();
address lresult = (address)istate + in_bytes(BytecodeInterpreter::native_lresult_offset());
address fresult = (address)istate + in_bytes(BytecodeInterpreter::native_fresult_offset());
#else
address lresult = (address)&(get_ijava_state()->lresult);
address fresult = (address)&(get_ijava_state()->fresult);
#endif
switch (method->result_type()) {
case T_OBJECT:
@ -226,31 +217,6 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result)
void frame::describe_pd(FrameValues& values, int frame_no) {
if (is_interpreted_frame()) {
#ifdef CC_INTERP
interpreterState istate = get_interpreterState();
values.describe(frame_no, (intptr_t*)istate, "istate");
values.describe(frame_no, (intptr_t*)&(istate->_thread), " thread");
values.describe(frame_no, (intptr_t*)&(istate->_bcp), " bcp");
values.describe(frame_no, (intptr_t*)&(istate->_locals), " locals");
values.describe(frame_no, (intptr_t*)&(istate->_constants), " constants");
values.describe(frame_no, (intptr_t*)&(istate->_method), err_msg(" method = %s", istate->_method->name_and_sig_as_C_string()));
values.describe(frame_no, (intptr_t*)&(istate->_mdx), " mdx");
values.describe(frame_no, (intptr_t*)&(istate->_stack), " stack");
values.describe(frame_no, (intptr_t*)&(istate->_msg), err_msg(" msg = %s", BytecodeInterpreter::C_msg(istate->_msg)));
values.describe(frame_no, (intptr_t*)&(istate->_result), " result");
values.describe(frame_no, (intptr_t*)&(istate->_prev_link), " prev_link");
values.describe(frame_no, (intptr_t*)&(istate->_oop_temp), " oop_temp");
values.describe(frame_no, (intptr_t*)&(istate->_stack_base), " stack_base");
values.describe(frame_no, (intptr_t*)&(istate->_stack_limit), " stack_limit");
values.describe(frame_no, (intptr_t*)&(istate->_monitor_base), " monitor_base");
values.describe(frame_no, (intptr_t*)&(istate->_frame_bottom), " frame_bottom");
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_pc), " last_Java_pc");
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_fp), " last_Java_fp");
values.describe(frame_no, (intptr_t*)&(istate->_last_Java_sp), " last_Java_sp");
values.describe(frame_no, (intptr_t*)&(istate->_self_link), " self_link");
values.describe(frame_no, (intptr_t*)&(istate->_native_fresult), " native_fresult");
values.describe(frame_no, (intptr_t*)&(istate->_native_lresult), " native_lresult");
#else
#define DESCRIBE_ADDRESS(name) \
values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name);
@ -266,7 +232,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
DESCRIBE_ADDRESS(oop_tmp);
DESCRIBE_ADDRESS(lresult);
DESCRIBE_ADDRESS(fresult);
#endif
}
}
#endif

View File

@ -193,33 +193,48 @@
#define _spill_nonvolatiles_neg(_component) \
(int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component))
#ifndef CC_INTERP
// Frame layout for the Java template interpreter on PPC64.
// Frame layout for the Java template interpreter on PPC64.
//
// Diffs to the CC_INTERP are marked with 'X'.
// In these figures the stack grows upwards, while memory grows
// downwards. Square brackets denote regions possibly larger than
// single 64 bit slots.
//
// STACK (interpreter is active):
// 0 [TOP_IJAVA_FRAME]
// [PARENT_IJAVA_FRAME]
// ...
// [PARENT_IJAVA_FRAME]
// [ENTRY_FRAME]
// [C_FRAME]
// ...
// [C_FRAME]
//
// With the following frame layouts:
// TOP_IJAVA_FRAME:
//
// 0 [TOP_IJAVA_FRAME_ABI]
// alignment (optional)
// [operand stack]
// [monitors] (optional)
// X[IJAVA_STATE]
// [IJAVA_STATE]
// note: own locals are located in the caller frame.
//
// PARENT_IJAVA_FRAME:
//
// 0 [PARENT_IJAVA_FRAME_ABI]
// alignment (optional)
// [callee's Java result]
// [callee's locals w/o arguments]
// [outgoing arguments]
// [used part of operand stack w/o arguments]
// [monitors] (optional)
// X[IJAVA_STATE]
// [monitors] (optional)
// [IJAVA_STATE]
//
// ENTRY_FRAME:
// 0 [PARENT_IJAVA_FRAME_ABI]
// alignment (optional)
// [callee's Java result]
// [callee's locals w/o arguments]
// [outgoing arguments]
// [ENTRY_FRAME_LOCALS]
struct parent_ijava_frame_abi : abi_minframe {
};
@ -269,113 +284,6 @@
#define _ijava_state_neg(_component) \
(int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component))
#else // CC_INTERP:
// Frame layout for the Java C++ interpreter on PPC64.
//
// This frame layout provides a C-like frame for every Java frame.
//
// In these figures the stack grows upwards, while memory grows
// downwards. Square brackets denote regions possibly larger than
// single 64 bit slots.
//
// STACK (no JNI, no compiled code, no library calls,
// interpreter-loop is active):
// 0 [InterpretMethod]
// [TOP_IJAVA_FRAME]
// [PARENT_IJAVA_FRAME]
// ...
// [PARENT_IJAVA_FRAME]
// [ENTRY_FRAME]
// [C_FRAME]
// ...
// [C_FRAME]
//
// TOP_IJAVA_FRAME:
// 0 [TOP_IJAVA_FRAME_ABI]
// alignment (optional)
// [operand stack]
// [monitors] (optional)
// [cInterpreter object]
// result, locals, and arguments are in parent frame!
//
// PARENT_IJAVA_FRAME:
// 0 [PARENT_IJAVA_FRAME_ABI]
// alignment (optional)
// [callee's Java result]
// [callee's locals w/o arguments]
// [outgoing arguments]
// [used part of operand stack w/o arguments]
// [monitors] (optional)
// [cInterpreter object]
//
// ENTRY_FRAME:
// 0 [PARENT_IJAVA_FRAME_ABI]
// alignment (optional)
// [callee's Java result]
// [callee's locals w/o arguments]
// [outgoing arguments]
// [ENTRY_FRAME_LOCALS]
//
// PARENT_IJAVA_FRAME_ABI:
// 0 [ABI_MINFRAME]
// top_frame_sp
// initial_caller_sp
//
// TOP_IJAVA_FRAME_ABI:
// 0 [PARENT_IJAVA_FRAME_ABI]
// carg_3_unused
// carg_4_unused
// carg_5_unused
// carg_6_unused
// carg_7_unused
// frame_manager_lr
//
// PARENT_IJAVA_FRAME_ABI
struct parent_ijava_frame_abi : abi_minframe {
// SOE registers.
// C2i adapters spill their top-frame stack-pointer here.
uint64_t top_frame_sp; // carg_1
// Sp of calling compiled frame before it was resized by the c2i
// adapter or sp of call stub. Does not contain a valid value for
// non-initial frames.
uint64_t initial_caller_sp; // carg_2
// aligned to frame::alignment_in_bytes (16)
};
enum {
parent_ijava_frame_abi_size = sizeof(parent_ijava_frame_abi)
};
#define _parent_ijava_frame_abi(_component) \
(offset_of(frame::parent_ijava_frame_abi, _component))
// TOP_IJAVA_FRAME_ABI
struct top_ijava_frame_abi : parent_ijava_frame_abi {
uint64_t carg_3_unused; // carg_3
uint64_t card_4_unused; //_16 carg_4
uint64_t carg_5_unused; // carg_5
uint64_t carg_6_unused; //_16 carg_6
uint64_t carg_7_unused; // carg_7
// Use arg8 for storing frame_manager_lr. The size of
// top_ijava_frame_abi must match abi_reg_args.
uint64_t frame_manager_lr; //_16 carg_8
// nothing to add here!
// aligned to frame::alignment_in_bytes (16)
};
enum {
top_ijava_frame_abi_size = sizeof(top_ijava_frame_abi)
};
#define _top_ijava_frame_abi(_component) \
(offset_of(frame::top_ijava_frame_abi, _component))
#endif // CC_INTERP
// ENTRY_FRAME
struct entry_frame_locals {
@ -496,10 +404,6 @@
public:
#ifdef CC_INTERP
// Additional interface for interpreter frames:
inline interpreterState get_interpreterState() const;
#else
inline ijava_state* get_ijava_state() const;
// Some convenient register frame setters/getters for deoptimization.
inline intptr_t* interpreter_frame_esp() const;
@ -507,7 +411,6 @@
inline void interpreter_frame_set_esp(intptr_t* esp);
inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);
#endif // CC_INTERP
// Size of a monitor in bytes.
static int interpreter_frame_monitor_size_in_bytes();

View File

@ -123,84 +123,6 @@ inline intptr_t* frame::real_fp() const {
return fp();
}
#ifdef CC_INTERP
inline interpreterState frame::get_interpreterState() const {
return (interpreterState)(((address)callers_abi())
- frame::interpreter_frame_cinterpreterstate_size_in_bytes());
}
inline intptr_t** frame::interpreter_frame_locals_addr() const {
interpreterState istate = get_interpreterState();
return (intptr_t**)&istate->_locals;
}
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
interpreterState istate = get_interpreterState();
return (intptr_t*)&istate->_bcp;
}
inline intptr_t* frame::interpreter_frame_mdp_addr() const {
interpreterState istate = get_interpreterState();
return (intptr_t*)&istate->_mdx;
}
inline intptr_t* frame::interpreter_frame_expression_stack() const {
return (intptr_t*)interpreter_frame_monitor_end() - 1;
}
inline jint frame::interpreter_frame_expression_stack_direction() {
return -1;
}
// top of expression stack
inline intptr_t* frame::interpreter_frame_tos_address() const {
interpreterState istate = get_interpreterState();
return istate->_stack + 1;
}
inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
return &interpreter_frame_tos_address()[offset];
}
// monitor elements
// in keeping with Intel side: end is lower in memory than begin;
// and beginning element is oldest element
// Also begin is one past last monitor.
inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
return get_interpreterState()->monitor_base();
}
inline BasicObjectLock* frame::interpreter_frame_monitor_end() const {
return (BasicObjectLock*)get_interpreterState()->stack_base();
}
inline int frame::interpreter_frame_cinterpreterstate_size_in_bytes() {
// Size of an interpreter object. Not aligned with frame size.
return round_to(sizeof(BytecodeInterpreter), 8);
}
inline Method** frame::interpreter_frame_method_addr() const {
interpreterState istate = get_interpreterState();
return &istate->_method;
}
// Constant pool cache
inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const {
interpreterState istate = get_interpreterState();
return &istate->_constants; // should really use accessor
}
inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
interpreterState istate = get_interpreterState();
return &istate->_constants;
}
#else // !CC_INTERP
// Template Interpreter frame value accessors.
inline frame::ijava_state* frame::get_ijava_state() const {
@ -267,8 +189,6 @@ inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
return &interpreter_frame_tos_address()[offset];
}
#endif // CC_INTERP
inline int frame::interpreter_frame_monitor_size() {
// Number of stack slots for a monitor.
return round_to(BasicObjectLock::size(), // number of stack slots

View File

@ -26,6 +26,10 @@
#ifndef CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
#define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
#ifdef CC_INTERP
#error "CC_INTERP no more supported. Removed in change 8145117."
#endif
// Size of PPC Instructions
const int BytesPerInstWord = 4;

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2015 SAP AG. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,11 +38,7 @@
#endif
void InterpreterMacroAssembler::null_check_throw(Register a, int offset, Register temp_reg) {
#ifdef CC_INTERP
address exception_entry = StubRoutines::throw_NullPointerException_at_call_entry();
#else
address exception_entry = Interpreter::throw_NullPointerException_entry();
#endif
MacroAssembler::null_check_throw(a, offset, temp_reg, exception_entry);
}
@ -57,8 +53,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry, Register Rscratch)
}
}
#ifndef CC_INTERP
void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) {
Register bytecode = R12_scratch2;
if (bcp_incr != 0) {
@ -207,7 +201,8 @@ void InterpreterMacroAssembler::load_dispatch_table(Register dst, address* table
}
}
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify) {
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode,
address* table, bool verify) {
if (verify) {
unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this
}
@ -394,7 +389,8 @@ void InterpreterMacroAssembler::get_4_byte_integer_at_bcp(int bcp_offset
//
// Kills / writes:
// - Rdst, Rscratch
void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size) {
void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset,
size_t index_size) {
assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
// Cache index is always in the native format, courtesy of Rewriter.
if (index_size == sizeof(u2)) {
@ -416,7 +412,8 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of
// Rdst now contains cp cache index.
}
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size) {
void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset,
size_t index_size) {
get_cache_index_at_bcp(cache, bcp_offset, index_size);
sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord));
add(cache, R27_constPoolCache, cache);
@ -514,7 +511,8 @@ void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_t
// and put arrayOop + shifted_index into res.
// Note: res is still shy of address by array offset into object.
void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex, int index_shift, Register Rtmp, Register Rres) {
void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex,
int index_shift, Register Rtmp, Register Rres) {
// Check that index is in range for array, then shift index by index_shift,
// and put arrayOop + shifted_index into res.
// Note: res is still shy of address by array offset into object.
@ -566,7 +564,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe
add(Rres, RsxtIndex, Rarray);
}
void InterpreterMacroAssembler::index_check(Register array, Register index, int index_shift, Register tmp, Register res) {
void InterpreterMacroAssembler::index_check(Register array, Register index,
int index_shift, Register tmp, Register res) {
// pop array
pop_ptr(array);
@ -637,7 +636,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
Label Lunlock;
// If it's still locked, everything is ok, unlock it.
ld(Rmonitor_base, 0, R1_SP);
addi(Rmonitor_base, Rmonitor_base, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
addi(Rmonitor_base, Rmonitor_base,
-(frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base
ld(R0, BasicObjectLock::obj_offset_in_bytes(), Rmonitor_base);
cmpdi(CCR0, R0, 0);
@ -677,7 +677,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
subf_(Riterations, R26_monitor, Rmonitor_base);
ble(CCR0, Lno_unlock);
addi(Rcurrent_obj_addr, Rmonitor_base, BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
addi(Rcurrent_obj_addr, Rmonitor_base,
BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes());
// Check if any monitor is on stack, bail out if not
srdi(Riterations, Riterations, exact_log2(delta));
mtctr(Riterations);
@ -727,7 +728,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
}
// Support function for remove_activation & Co.
void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc, Register Rscratch1, Register Rscratch2) {
void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc,
Register Rscratch1, Register Rscratch2) {
// Pop interpreter frame.
ld(Rscratch1, 0, R1_SP); // *SP
ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp
@ -779,8 +781,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
mtlr(R0);
}
#endif // !CC_INTERP
// Lock object
//
// Registers alive
@ -791,7 +791,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
if (UseHeavyMonitors) {
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
monitor, /*check_for_exceptions=*/true);
} else {
// template code:
//
@ -888,7 +888,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
// slow case of monitor enter.
bind(slow_case);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter),
monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false));
monitor, /*check_for_exceptions=*/true);
// }
align(32, 12);
bind(done);
@ -905,7 +905,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) {
void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) {
if (UseHeavyMonitors) {
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
monitor, check_for_exceptions);
} else {
// template code:
@ -978,7 +978,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
// we need to get into the slow case.
bind(slow_case);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit),
monitor, check_for_exceptions CC_INTERP_ONLY(&& false));
monitor, check_for_exceptions);
// }
Label done;
@ -993,8 +993,6 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
}
}
#ifndef CC_INTERP
// Load compiled (i2c) or interpreter entry when calling from interpreted and
// do the call. Centralized so that all interpreter calls will do the same actions.
// If jvmti single stepping is on for a thread we must not call compiled code.
@ -1004,7 +1002,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e
// - Rret_addr: return address
// - 2 scratch regs
//
void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2) {
void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr,
Register Rscratch1, Register Rscratch2) {
assert_different_registers(Rscratch1, Rscratch2, Rtarget_method, Rret_addr);
// Assume we want to go compiled if available.
const Register Rtarget_addr = Rscratch1;
@ -1488,7 +1487,8 @@ void InterpreterMacroAssembler::profile_typecheck_failed(Register Rscratch1, Reg
}
// Count a ret in the bytecodes.
void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2) {
void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci,
Register scratch1, Register scratch2) {
if (ProfileInterpreter) {
Label profile_continue;
uint row;
@ -1684,7 +1684,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper(
// Argument and return type profilig.
// kills: tmp, tmp2, R0, CR0, CR1
void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base,
RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2) {
RegisterOrConstant mdo_addr_offs,
Register tmp, Register tmp2) {
Label do_nothing, do_update;
// tmp2 = obj is allowed
@ -1730,7 +1731,9 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr
bind(do_nothing);
}
void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual) {
void InterpreterMacroAssembler::profile_arguments_type(Register callee,
Register tmp1, Register tmp2,
bool is_virtual) {
if (!ProfileInterpreter) {
return;
}
@ -1742,7 +1745,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
test_method_data_pointer(profile_continue);
int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
int off_to_start = is_virtual ?
in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
@ -1792,7 +1796,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register
// argument. tmp1 is the number of cells left in the
// 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");
assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(),
"can't move past ret type");
sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
add(R28_mdx, tmp1, R28_mdx);
}
@ -1841,7 +1846,8 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
}
}
void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2,
Register tmp3, Register tmp4) {
if (ProfileInterpreter && MethodData::profile_parameters()) {
Label profile_continue, done;
@ -1984,7 +1990,9 @@ void InterpreterMacroAssembler::load_local_long(Register Rdst_value, Register Rd
// Kills:
// - Rdst_value
// - Rdst_address
void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex) {
void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value,
Register Rdst_address,
Register Rindex) {
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
subf(Rdst_address, Rdst_address, R18_locals);
ld(Rdst_value, 0, Rdst_address);
@ -1995,7 +2003,9 @@ void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rds
// Kills:
// - Rdst_value
// - Rdst_address
void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value,
Register Rdst_address,
Register Rindex) {
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
subf(Rdst_address, Rdst_address, R18_locals);
lfs(Rdst_value, 0, Rdst_address);
@ -2006,7 +2016,9 @@ void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Regis
// Kills:
// - Rdst_value
// - Rdst_address
void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) {
void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value,
Register Rdst_address,
Register Rindex) {
sldi(Rdst_address, Rindex, Interpreter::logStackElementSize);
subf(Rdst_address, Rdst_address, R18_locals);
lfd(Rdst_value, -8, Rdst_address);
@ -2102,13 +2114,16 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
}
}
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions) {
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
Register arg_1, bool check_exceptions) {
// ARG1 is reserved for the thread.
mr_if_needed(R4_ARG2, arg_1);
call_VM(oop_result, entry_point, check_exceptions);
}
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions) {
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
Register arg_1, Register arg_2,
bool check_exceptions) {
// ARG1 is reserved for the thread.
mr_if_needed(R4_ARG2, arg_1);
assert(arg_2 != R4_ARG2, "smashed argument");
@ -2116,7 +2131,9 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point
call_VM(oop_result, entry_point, check_exceptions);
}
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions) {
void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point,
Register arg_1, Register arg_2, Register arg_3,
bool check_exceptions) {
// ARG1 is reserved for the thread.
mr_if_needed(R4_ARG2, arg_1);
assert(arg_2 != R4_ARG2, "smashed argument");
@ -2168,8 +2185,6 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool
#endif
}
#endif // !CC_INTERP
void InterpreterMacroAssembler::get_method_counters(Register method,
Register Rcounters,
Label& skip) {
@ -2188,7 +2203,9 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
bind(has_counters);
}
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) {
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters,
Register iv_be_count,
Register Rtmp_r0) {
assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
Register invocation_count = iv_be_count;
Register backedge_count = Rtmp_r0;
@ -2230,7 +2247,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
if (state == atos) { MacroAssembler::verify_oop(reg); }
}
#ifndef CC_INTERP
// Local helper function for the verify_oop_or_return_address macro.
static bool verify_return_address(Method* m, int bci) {
#ifndef PRODUCT
@ -2287,7 +2303,6 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis
verify_oop(reg);
bind(skip);
}
#endif // !CC_INTERP
// Inline assembly for:
//
@ -2311,7 +2326,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry),
/*check_exceptions=*/true CC_INTERP_ONLY(&& false));
/*check_exceptions=*/true);
bind(jvmti_post_done);
}
@ -2345,11 +2360,10 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread);
cmpwi(CCR0, R0, 0);
beq(CCR0, jvmti_post_done);
CC_INTERP_ONLY(assert(is_native_method && !check_exceptions, "must not push state"));
if (!is_native_method) push(state); // Expose tos to GC.
if (!is_native_method) { push(state); } // Expose tos to GC.
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit),
/*check_exceptions=*/check_exceptions);
if (!is_native_method) pop(state);
if (!is_native_method) { pop(state); }
align(32, 12);
bind(jvmti_post_done);
@ -2358,124 +2372,3 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta
// Dtrace support not implemented.
}
#ifdef CC_INTERP
// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
// (using parent_frame_resize) and push a new interpreter
// TOP_IJAVA_FRAME (using frame_size).
void InterpreterMacroAssembler::push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
Register tmp1, Register tmp2, Register tmp3,
Register tmp4, Register pc) {
assert_different_registers(top_frame_size, parent_frame_resize, tmp1, tmp2, tmp3, tmp4);
ld(tmp1, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
mr(tmp2/*top_frame_sp*/, R1_SP);
// Move initial_caller_sp.
ld(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
neg(parent_frame_resize, parent_frame_resize);
resize_frame(parent_frame_resize/*-parent_frame_resize*/, tmp3);
// Set LR in new parent frame.
std(tmp1, _abi(lr), R1_SP);
// Set top_frame_sp info for new parent frame.
std(tmp2, _parent_ijava_frame_abi(top_frame_sp), R1_SP);
std(tmp4, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
// Push new TOP_IJAVA_FRAME.
push_frame(top_frame_size, tmp2);
get_PC_trash_LR(tmp3);
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
// Used for non-initial callers by unextended_sp().
std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
}
// Pop the topmost TOP_IJAVA_FRAME and convert the previous
// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
void InterpreterMacroAssembler::pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
assert_different_registers(tmp1, tmp2, tmp3, tmp4);
ld(tmp1/*caller's sp*/, _abi(callers_sp), R1_SP);
ld(tmp3, _abi(lr), tmp1);
ld(tmp4, _parent_ijava_frame_abi(initial_caller_sp), tmp1);
ld(tmp2/*caller's caller's sp*/, _abi(callers_sp), tmp1);
// Merge top frame.
std(tmp2, _abi(callers_sp), R1_SP);
ld(tmp2, _parent_ijava_frame_abi(top_frame_sp), tmp1);
// Update C stack pointer to caller's top_abi.
resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
// Update LR in top_frame.
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
std(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
// Store the top-frame stack-pointer for c2i adapters.
std(R1_SP, _top_ijava_frame_abi(top_frame_sp), R1_SP);
}
// Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
void InterpreterMacroAssembler::pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3) {
assert_different_registers(R14_state, R15_prev_state, tmp1, tmp2, tmp3);
if (state == R14_state) {
ld(tmp1/*state's fp*/, state_(_last_Java_fp));
ld(tmp2/*state's sp*/, state_(_last_Java_sp));
} else if (state == R15_prev_state) {
ld(tmp1/*state's fp*/, prev_state_(_last_Java_fp));
ld(tmp2/*state's sp*/, prev_state_(_last_Java_sp));
} else {
ShouldNotReachHere();
}
// Merge top frames.
std(tmp1, _abi(callers_sp), R1_SP);
// Tmp2 is new SP.
// Tmp1 is parent's SP.
resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/);
// Update LR in top_frame.
// Must be interpreter frame.
get_PC_trash_LR(tmp3);
std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
// Used for non-initial callers by unextended_sp().
std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP);
}
// Set SP to initial caller's sp, but before fix the back chain.
void InterpreterMacroAssembler::resize_frame_to_initial_caller(Register tmp1, Register tmp2) {
ld(tmp1, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
ld(tmp2, _parent_ijava_frame_abi(callers_sp), R1_SP);
std(tmp2, _parent_ijava_frame_abi(callers_sp), tmp1); // Fix back chain ...
mr(R1_SP, tmp1); // ... and resize to initial caller.
}
// Pop the current interpreter state (without popping the correspoding
// frame) and restore R14_state and R15_prev_state accordingly.
// Use prev_state_may_be_0 to indicate whether prev_state may be 0
// in order to generate an extra check before retrieving prev_state_(_prev_link).
void InterpreterMacroAssembler::pop_interpreter_state(bool prev_state_may_be_0)
{
// Move prev_state to state and restore prev_state from state_(_prev_link).
Label prev_state_is_0;
mr(R14_state, R15_prev_state);
// Don't retrieve /*state==*/prev_state_(_prev_link)
// if /*state==*/prev_state is 0.
if (prev_state_may_be_0) {
cmpdi(CCR0, R15_prev_state, 0);
beq(CCR0, prev_state_is_0);
}
ld(R15_prev_state, /*state==*/prev_state_(_prev_link));
bind(prev_state_is_0);
}
void InterpreterMacroAssembler::restore_prev_state() {
// _prev_link is private, but cInterpreter is a friend.
ld(R15_prev_state, state_(_prev_link));
}
#endif // CC_INTERP

View File

@ -45,14 +45,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
#define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread
#define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method
#ifdef CC_INTERP
#define state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R14_state
#define prev_state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R15_prev_state
void pop (TosState state) {}; // Not needed.
void push(TosState state) {}; // Not needed.
#endif
#ifndef CC_INTERP
virtual void check_and_handle_popframe(Register java_thread);
virtual void check_and_handle_earlyret(Register java_thread);
@ -207,7 +199,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
void record_static_call_in_profile(Register Rentry, Register Rtmp);
void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp);
#endif // !CC_INTERP
void get_method_counters(Register method, Register Rcounters, Label& skip);
void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0);
@ -216,8 +207,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
void lock_object (Register lock_reg, Register obj_reg);
void unlock_object(Register lock_reg, bool check_for_exceptions = true);
#ifndef CC_INTERP
// Interpreter profiling operations
void set_method_data_pointer_for_bcp();
void test_method_data_pointer(Label& zero_continue);
@ -260,14 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler {
void profile_return_type(Register ret, Register tmp1, Register tmp2);
void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
#endif // !CC_INTERP
// Debugging
void verify_oop(Register reg, TosState state = atos); // only if +VerifyOops && state == atos
#ifndef CC_INTERP
void verify_oop_or_return_address(Register reg, Register rtmp); // for astore
void verify_FPU(int stack_depth, TosState state = ftos);
#endif // !CC_INTERP
typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
@ -275,33 +260,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
void notify_method_entry();
void notify_method_exit(bool is_native_method, TosState state,
NotifyMethodExitMode mode, bool check_exceptions);
#ifdef CC_INTERP
// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME
// (using parent_frame_resize) and push a new interpreter
// TOP_IJAVA_FRAME (using frame_size).
void push_interpreter_frame(Register top_frame_size, Register parent_frame_resize,
Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register pc=noreg);
// Pop the topmost TOP_IJAVA_FRAME and convert the previous
// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME.
void pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
// Turn state's interpreter frame into the current TOP_IJAVA_FRAME.
void pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3);
// Set SP to initial caller's sp, but before fix the back chain.
void resize_frame_to_initial_caller(Register tmp1, Register tmp2);
// Pop the current interpreter state (without popping the
// correspoding frame) and restore R14_state and R15_prev_state
// accordingly. Use prev_state_may_be_0 to indicate whether
// prev_state may be 0 in order to generate an extra check before
// retrieving prev_state_(_prev_link).
void pop_interpreter_state(bool prev_state_may_be_0);
void restore_prev_state();
#endif
};
#endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP

View File

@ -457,17 +457,12 @@ address InterpreterGenerator::generate_abstract_entry(void) {
// Reset JavaFrameAnchor from call_VM_leaf above.
__ reset_last_Java_frame();
#ifdef CC_INTERP
// Return to frame manager, it will handle the pending exception.
__ blr();
#else
// We don't know our caller, so jump to the general forward exception stub,
// which will also pop our full frame off. Satisfy the interface of
// SharedRuntime::generate_forward_exception()
__ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
__ mtctr(R11_scratch1);
__ bctr();
#endif
return entry;
}
@ -518,7 +513,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) {
// continue and the thread will safepoint at the next bytecode dispatch.
// If the receiver is null then it is OK to jump to the slow path.
__ ld(R3_RET, Interpreter::stackElementSize, CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp)); // get receiver
__ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver
// Check if receiver == NULL and go the slow path.
__ cmpdi(CCR0, R3_RET, 0);

View File

@ -39,12 +39,10 @@
return stackElementWords * i;
}
#ifndef CC_INTERP
// The offset in bytes to access a expression stack slot
// relative to the esp pointer.
static int expr_offset_in_bytes(int slot) {
return stackElementSize * slot + wordSize;
}
#endif
#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP

View File

@ -2822,12 +2822,8 @@ void MacroAssembler::set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, R
// sp points to a TOP_IJAVA_FRAME, retrieve frame's PC via
// TOP_IJAVA_FRAME_ABI.
// FIXME: assert that we really have a TOP_IJAVA_FRAME here!
#ifdef CC_INTERP
ld(tmp1/*pc*/, _top_ijava_frame_abi(frame_manager_lr), sp);
#else
address entry = pc();
load_const_optimized(tmp1, entry);
#endif
set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1);
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -32,12 +32,6 @@
#define __ _masm->
#ifdef CC_INTERP
#define EXCEPTION_ENTRY StubRoutines::throw_NullPointerException_at_call_entry()
#else
#define EXCEPTION_ENTRY Interpreter::throw_NullPointerException_entry()
#endif
#ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing
#else
@ -51,10 +45,12 @@ inline static RegisterOrConstant constant(int value) {
return RegisterOrConstant(value);
}
void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg) {
if (VerifyMethodHandles)
verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class), temp_reg, temp2_reg,
"MH argument is a Class");
void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg,
Register temp_reg, Register temp2_reg) {
if (VerifyMethodHandles) {
verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class),
temp_reg, temp2_reg, "MH argument is a Class");
}
__ ld(klass_reg, java_lang_Class::klass_offset_in_bytes(), klass_reg);
}
@ -187,7 +183,7 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), "");
Label L;
__ ld(temp2, __ argument_offset(temp2, temp2, 0), CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp));
__ ld(temp2, __ argument_offset(temp2, temp2, 0), R15_esp);
__ cmpd(CCR1, temp2, recv);
__ beq(CCR1, L);
__ stop("receiver not on stack");
@ -214,7 +210,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
return NULL;
}
Register argbase = CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp); // parameter (preserved)
Register argbase = R15_esp; // parameter (preserved)
Register argslot = R3;
Register temp1 = R6;
Register param_size = R7;
@ -317,10 +313,12 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
__ verify_oop(receiver_reg);
if (iid == vmIntrinsics::_linkToSpecial) {
// Don't actually load the klass; just null-check the receiver.
__ null_check_throw(receiver_reg, -1, temp1, EXCEPTION_ENTRY);
__ null_check_throw(receiver_reg, -1, temp1,
Interpreter::throw_NullPointerException_entry());
} else {
// load receiver klass itself
__ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1, EXCEPTION_ENTRY);
__ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1,
Interpreter::throw_NullPointerException_entry());
__ load_klass(temp1_recv_klass, receiver_reg);
__ verify_klass_ptr(temp1_recv_klass);
}

View File

@ -578,27 +578,17 @@ REGISTER_DECLARATION(FloatRegister, F13_ARG13, F13); // volatile
// Register declarations to be used in frame manager assembly code.
// Use only non-volatile registers in order to keep values across C-calls.
#ifdef CC_INTERP
REGISTER_DECLARATION(Register, R14_state, R14); // address of new cInterpreter.
REGISTER_DECLARATION(Register, R15_prev_state, R15); // address of old cInterpreter
#else // CC_INTERP
REGISTER_DECLARATION(Register, R14_bcp, R14);
REGISTER_DECLARATION(Register, R15_esp, R15);
REGISTER_DECLARATION(FloatRegister, F15_ftos, F15);
#endif // CC_INTERP
REGISTER_DECLARATION(Register, R16_thread, R16); // address of current thread
REGISTER_DECLARATION(Register, R17_tos, R17); // address of Java tos (prepushed).
REGISTER_DECLARATION(Register, R18_locals, R18); // address of first param slot (receiver).
REGISTER_DECLARATION(Register, R19_method, R19); // address of current method
#ifndef DONT_USE_REGISTER_DEFINES
#ifdef CC_INTERP
#define R14_state AS_REGISTER(Register, R14)
#define R15_prev_state AS_REGISTER(Register, R15)
#else // CC_INTERP
#define R14_bcp AS_REGISTER(Register, R14)
#define R15_esp AS_REGISTER(Register, R15)
#define F15_ftos AS_REGISTER(FloatRegister, F15)
#endif // CC_INTERP
#define R16_thread AS_REGISTER(Register, R16)
#define R17_tos AS_REGISTER(Register, R17)
#define R18_locals AS_REGISTER(Register, R18)
@ -619,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26);
REGISTER_DECLARATION(Register, R27_tmp7, R27);
REGISTER_DECLARATION(Register, R28_tmp8, R28);
REGISTER_DECLARATION(Register, R29_tmp9, R29);
#ifndef CC_INTERP
REGISTER_DECLARATION(Register, R24_dispatch_addr, R24);
REGISTER_DECLARATION(Register, R25_templateTableBase, R25);
REGISTER_DECLARATION(Register, R26_monitor, R26);
REGISTER_DECLARATION(Register, R27_constPoolCache, R27);
REGISTER_DECLARATION(Register, R28_mdx, R28);
#endif // CC_INTERP
#ifndef DONT_USE_REGISTER_DEFINES
#define R21_tmp1 AS_REGISTER(Register, R21)
@ -637,7 +625,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28);
#define R27_tmp7 AS_REGISTER(Register, R27)
#define R28_tmp8 AS_REGISTER(Register, R28)
#define R29_tmp9 AS_REGISTER(Register, R29)
#ifndef CC_INTERP
// Lmonitors : monitor pointer
// LcpoolCache: constant pool cache
// mdx: method data index
@ -649,7 +636,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28);
#endif
#define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4)
#endif
// Scratch registers are volatile.
REGISTER_DECLARATION(Register, R11_scratch1, R11);

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2015 SAP AG. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -954,15 +954,10 @@ static address gen_c2i_adapter(MacroAssembler *masm,
// Jump to the interpreter just as if interpreter was doing it.
#ifdef CC_INTERP
const Register tos = R17_tos;
#else
const Register tos = R15_esp;
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
#endif
// load TOS
__ addi(tos, R1_SP, st_off);
__ addi(R15_esp, R1_SP, st_off);
// Frame_manager expects initial_caller_sp (= SP without resize by c2i) in R21_tmp1.
assert(sender_SP == R21_sender_SP, "passing initial caller's SP in wrong register");
@ -996,12 +991,7 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
// save code can segv when fxsave instructions find improperly
// aligned stack pointer.
#ifdef CC_INTERP
const Register ld_ptr = R17_tos;
#else
const Register ld_ptr = R15_esp;
#endif
const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 };
const int num_value_regs = sizeof(value_regs) / sizeof(Register);
int value_regs_index = 0;
@ -2593,15 +2583,11 @@ static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
__ ld(frame_size_reg, 0, frame_sizes_reg);
__ std(pc_reg, _abi(lr), R1_SP);
__ push_frame(frame_size_reg, R0/*tmp*/);
#ifdef CC_INTERP
__ std(R1_SP, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
#else
#ifdef ASSERT
__ load_const_optimized(pc_reg, 0x5afe);
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
#endif
__ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
#endif // CC_INTERP
__ addi(number_of_frames_reg, number_of_frames_reg, -1);
__ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
__ addi(pcs_reg, pcs_reg, wordSize);
@ -2673,15 +2659,11 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
__ std(R12_scratch2, _abi(lr), R1_SP);
// Initialize initial_caller_sp.
#ifdef CC_INTERP
__ std(frame_size_reg/*old_sp*/, _parent_ijava_frame_abi(initial_caller_sp), R1_SP);
#else
#ifdef ASSERT
__ load_const_optimized(pc_reg, 0x5afe);
__ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP);
#endif
__ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP);
#endif // CC_INTERP
#ifdef ASSERT
// Make sure that there is at least one entry in the array.
@ -2708,9 +2690,6 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt,
// Store it in the top interpreter frame.
__ std(R0, _abi(lr), R1_SP);
// Initialize frame_manager_lr of interpreter top frame.
#ifdef CC_INTERP
__ std(R0, _top_ijava_frame_abi(frame_manager_lr), R1_SP);
#endif
}
#endif
@ -2899,16 +2878,8 @@ void SharedRuntime::generate_deopt_blob() {
// optional c2i, caller of deoptee, ...).
// Initialize R14_state.
#ifdef CC_INTERP
__ ld(R14_state, 0, R1_SP);
__ addi(R14_state, R14_state, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
// Also inititialize R15_prev_state.
__ restore_prev_state();
#else
__ restore_interpreter_state(R11_scratch1);
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
#endif // CC_INTERP
// Return to the interpreter entry point.
__ blr();
@ -3034,16 +3005,8 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// stack: (top interpreter frame, ..., optional interpreter frame,
// optional c2i, caller of deoptee, ...).
#ifdef CC_INTERP
// Initialize R14_state, ...
__ ld(R11_scratch1, 0, R1_SP);
__ addi(R14_state, R11_scratch1, -frame::interpreter_frame_cinterpreterstate_size_in_bytes());
// also initialize R15_prev_state.
__ restore_prev_state();
#else
__ restore_interpreter_state(R11_scratch1);
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
#endif // CC_INTERP
// Return to the interpreter entry point.
__ blr();

View File

@ -225,11 +225,8 @@ class StubGenerator: public StubCodeGenerator {
// R16_thread - JavaThread*
// Tos must point to last argument - element_size.
#ifdef CC_INTERP
const Register tos = R17_tos;
#else
const Register tos = R15_esp;
#endif
__ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize);
// initialize call_stub locals (step 2)
@ -243,11 +240,7 @@ class StubGenerator: public StubCodeGenerator {
assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread");
// Set R15_prev_state to 0 for simplifying checks in callee.
#ifdef CC_INTERP
__ li(R15_prev_state, 0);
#else
__ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
#endif
// Stack on entry to frame manager / native entry:
//
// F0 [TOP_IJAVA_FRAME_ABI]

View File

@ -24,7 +24,6 @@
*/
#include "precompiled.hpp"
#ifndef CC_INTERP
#include "asm/macroAssembler.inline.hpp"
#include "interpreter/bytecodeHistogram.hpp"
#include "interpreter/interpreter.hpp"
@ -1799,4 +1798,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() {
}
#endif // !PRODUCT
#endif // !CC_INTERP

View File

@ -39,8 +39,6 @@
#include "runtime/synchronizer.hpp"
#include "utilities/macros.hpp"
#ifndef CC_INTERP
#undef __
#define __ _masm->
@ -4145,4 +4143,3 @@ void TemplateTable::wide() {
__ bctr();
// Note: the bcp increment step is part of the individual wide bytecode implementations.
}
#endif // !CC_INTERP

View File

@ -48,9 +48,11 @@ ADLParser::~ADLParser() {
if (!_AD._quiet_mode)
fprintf(stderr,"---------------------------- Errors and Warnings ----------------------------\n");
#ifndef ASSERT
fprintf(stderr, "**************************************************************\n");
fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n");
fprintf(stderr, "**************************************************************\n");
if (!_AD._quiet_mode) {
fprintf(stderr, "**************************************************************\n");
fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n");
fprintf(stderr, "**************************************************************\n");
}
#endif
if( _AD._syntax_errs + _AD._semantic_errs + _AD._warnings == 0 ) {
if (!_AD._quiet_mode)

View File

@ -3600,13 +3600,13 @@ void G1CollectedHeap::reset_taskqueue_stats() {
}
#endif // TASKQUEUE_STATS
void G1CollectedHeap::log_gc_footer(double pause_time_counter) {
void G1CollectedHeap::log_gc_footer(jlong pause_time_counter) {
if (evacuation_failed()) {
log_info(gc)("To-space exhausted");
}
double pause_time_sec = TimeHelper::counter_to_seconds(pause_time_counter);
g1_policy()->print_phases(pause_time_sec);
double pause_time_ms = TimeHelper::counter_to_millis(pause_time_counter);
g1_policy()->print_phases(pause_time_ms);
g1_policy()->print_detailed_heap_transition();
}
@ -3698,8 +3698,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
}
GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true);
double pause_start_sec = os::elapsedTime();
double pause_start_counter = os::elapsed_counter();
jlong pause_start_counter = os::elapsed_counter();
g1_policy()->note_gc_start(active_workers);
TraceCollectorStats tcs(g1mm()->incremental_collection_counters());

View File

@ -290,7 +290,7 @@ private:
void verify_before_gc();
void verify_after_gc();
void log_gc_footer(double pause_time_counter);
void log_gc_footer(jlong pause_time_counter);
void trace_heap(GCWhen::Type when, const GCTracer* tracer);

View File

@ -1299,8 +1299,8 @@ void G1CollectorPolicy::print_detailed_heap_transition() const {
MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc);
}
void G1CollectorPolicy::print_phases(double pause_time_sec) {
phase_times()->print(pause_time_sec);
void G1CollectorPolicy::print_phases(double pause_time_ms) {
phase_times()->print(pause_time_ms);
}
void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,

View File

@ -661,7 +661,7 @@ public:
void print_detailed_heap_transition() const;
virtual void print_phases(double pause_time_sec);
virtual void print_phases(double pause_time_ms);
void record_stop_world_start();
void record_concurrent_pause();

View File

@ -349,7 +349,7 @@ class G1GCParPhasePrinter : public StackObj {
}
};
void G1GCPhaseTimes::print(double pause_time_sec) {
void G1GCPhaseTimes::print(double pause_time_ms) {
note_gc_end();
G1GCParPhasePrinter par_phase_printer(this);
@ -373,7 +373,7 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
}
print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms);
print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms);
double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms();
double misc_time_ms = pause_time_ms - accounted_time_ms();
print_stats(Indents[1], "Other", misc_time_ms);
if (_cur_verify_before_time_ms > 0.0) {
print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms);

View File

@ -126,7 +126,7 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
public:
G1GCPhaseTimes(uint max_gc_threads);
void note_gc_start(uint active_gc_threads);
void print(double pause_time_sec);
void print(double pause_time_ms);
// record the time a phase took in seconds
void record_time_secs(GCParPhases phase, uint worker_i, double secs);

View File

@ -3194,17 +3194,20 @@ JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jbool
if (isCopy != NULL) {
*isCopy = is_latin1 ? JNI_TRUE : JNI_FALSE;
}
const jchar* ret;
jchar* ret;
if (!is_latin1) {
ret = s_value->char_at_addr(0);
ret = (jchar*) s_value->base(T_CHAR);
} else {
// Inflate latin1 encoded string to UTF16
int s_len = java_lang_String::length(s);
jchar* buf = NEW_C_HEAP_ARRAY(jchar, s_len, mtInternal);
for (int i = 0; i < s_len; i++) {
buf[i] = ((jchar) s_value->byte_at(i)) & 0xff;
ret = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal); // add one for zero termination
/* JNI Specification states return NULL on OOM */
if (ret != NULL) {
for (int i = 0; i < s_len; i++) {
ret[i] = ((jchar) s_value->byte_at(i)) & 0xff;
}
ret[s_len] = 0;
}
ret = &buf[0];
}
HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN((uint16_t *) ret);
return ret;

View File

@ -337,3 +337,5 @@ ffaff3d0ad0e0ca1e632b80826afa8729ee72a48 jdk9-b91
fcabfb3c38ac1da99394e821902537d92e45222d jdk9-b92
b9c50c63305cf1120263f6b7c6993021b53c2c40 jdk9-b93
5e75b8a9c01bca09c56dec7539e44dc82090c7c2 jdk9-b94
c8d0845877a811ab4350935892f826929359a3ff jdk-9+95
1f3182529f2c474e5506955ccb3820cfa5822265 jdk-9+96

View File

@ -221,27 +221,4 @@ public final class XalanConstants {
public static final String FEATURE_TRUE = "true";
public static final String FEATURE_FALSE = "false";
/**
* Check if we're in jdk8 or above
*/
public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
/*
* Check the major version of the current JDK against that specified
* in the parameter
*
* In JDK9 the java version string was changed to comply with JEP-223
* so this method was modified to handle that new format as well
*
* @param compareTo a JDK major version to be compared to
* @return true if the current major version is the same or above
* that represented by the parameter
*/
public static boolean isJavaVersionAtLeast(int compareTo) {
String javaVersion = SecuritySupport.getSystemProperty("java.version");
javaVersion = (javaVersion.matches("[1-9][0-9]*(\\.(0|[1-9][0-9]*))*\\-.*")) ?
javaVersion.split("-|\\.")[0] :
javaVersion.split("\\.", 3)[1];
return Integer.parseInt(javaVersion) >= compareTo;
}
} // class Constants

View File

@ -524,7 +524,7 @@ public class TransformerFactoryImpl
_xmlSecurityManager.setSecureProcessing(value);
// set external access restriction when FSP is explicitly set
if (value && XalanConstants.IS_JDK8_OR_ABOVE) {
if (value) {
_xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
State.FSP, XalanConstants.EXTERNAL_ACCESS_DEFAULT_FSP);
_xmlSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_STYLESHEET,
@ -539,7 +539,6 @@ public class TransformerFactoryImpl
_featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
}
return;
}
else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
//in secure mode, let _useServicesMechanism be determined by the constructor

View File

@ -203,11 +203,6 @@ public final class Constants {
*/
public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
/**
* Check if we're in jdk8 or above
*/
public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
//
// Implementation limits: corresponding System Properties of the above
// API properties
@ -856,25 +851,6 @@ public final class Constants {
? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
} // getXercesProperties():Enumeration
/*
* Check the major version of the current JDK against that specified
* in the parameter
*
* In JDK9 the java version string was changed to comply with JEP-223
* so this method was modified to handle that new format as well
*
* @param compareTo a JDK major version to be compared to
* @return true if the current major version is the same or above
* that represented by the parameter
*/
public static boolean isJavaVersionAtLeast(int compareTo) {
String javaVersion = SecuritySupport.getSystemProperty("java.version");
javaVersion = (javaVersion.matches("[1-9][0-9]*(\\.(0|[1-9][0-9]*))*\\-.*")) ?
javaVersion.split("-|\\.")[0] :
javaVersion.split("\\.", 3)[1];
return Integer.parseInt(javaVersion) >= compareTo;
}
//
// Classes
//

View File

@ -1394,7 +1394,12 @@ public class XMLDocumentFragmentScannerImpl
fEmptyElement = true;
return true;
} else if (!isValidNameStartChar(c) || !sawSpace) {
reportFatalError("ElementUnterminated", new Object[]{fElementQName.rawname});
// Second chance. Check if this character is a high
// surrogate of a valid name start character.
if (!isValidNameStartHighSurrogate(c) || !sawSpace) {
reportFatalError("ElementUnterminated",
new Object[]{fElementQName.rawname});
}
}
return false;
@ -2606,40 +2611,38 @@ public class XMLDocumentFragmentScannerImpl
private void startOfMarkup() throws IOException {
fMarkupDepth++;
final int ch = fEntityScanner.peekChar();
switch(ch){
case '?' :{
setScannerState(SCANNER_STATE_PI);
fEntityScanner.skipChar(ch);
break;
}
case '!' :{
fEntityScanner.skipChar(ch);
if (fEntityScanner.skipChar('-')) {
if (!fEntityScanner.skipChar('-')) {
reportFatalError("InvalidCommentStart",
if (isValidNameStartChar(ch) || isValidNameStartHighSurrogate(ch)) {
setScannerState(SCANNER_STATE_START_ELEMENT_TAG);
} else {
switch(ch){
case '?' :{
setScannerState(SCANNER_STATE_PI);
fEntityScanner.skipChar(ch);
break;
}
case '!' :{
fEntityScanner.skipChar(ch);
if (fEntityScanner.skipChar('-')) {
if (!fEntityScanner.skipChar('-')) {
reportFatalError("InvalidCommentStart",
null);
}
setScannerState(SCANNER_STATE_COMMENT);
} else if (fEntityScanner.skipString(cdata)) {
setScannerState(SCANNER_STATE_CDATA );
} else if (!scanForDoctypeHook()) {
reportFatalError("MarkupNotRecognizedInContent",
null);
}
setScannerState(SCANNER_STATE_COMMENT);
} else if (fEntityScanner.skipString(cdata)) {
setScannerState(SCANNER_STATE_CDATA );
} else if (!scanForDoctypeHook()) {
reportFatalError("MarkupNotRecognizedInContent",
null);
break;
}
break;
}
case '/' :{
setScannerState(SCANNER_STATE_END_ELEMENT_TAG);
fEntityScanner.skipChar(ch);
break;
}
default :{
if (isValidNameStartChar(ch)) {
setScannerState(SCANNER_STATE_START_ELEMENT_TAG);
} else {
reportFatalError("MarkupNotRecognizedInContent",
null);
case '/' :{
setScannerState(SCANNER_STATE_END_ELEMENT_TAG);
fEntityScanner.skipChar(ch);
break;
}
default :{
reportFatalError("MarkupNotRecognizedInContent", null);
}
}
}

View File

@ -847,9 +847,12 @@ public class XMLDocumentScannerImpl
case SCANNER_STATE_START_OF_MARKUP: {
fMarkupDepth++;
if (fEntityScanner.skipChar('?')) {
setScannerState(SCANNER_STATE_PI);
if (isValidNameStartChar(fEntityScanner.peekChar()) ||
isValidNameStartHighSurrogate(fEntityScanner.peekChar())) {
setScannerState(SCANNER_STATE_ROOT_ELEMENT);
setDriver(fContentDriver);
//from now onwards this would be handled by fContentDriver,in the same next() call
return fContentDriver.next();
} else if (fEntityScanner.skipChar('!')) {
if (fEntityScanner.skipChar('-')) {
if (!fEntityScanner.skipChar('-')) {
@ -872,12 +875,8 @@ public class XMLDocumentScannerImpl
reportFatalError("MarkupNotRecognizedInProlog",
null);
}
} else if (XMLChar.isNameStart(fEntityScanner.peekChar())) {
setScannerState(SCANNER_STATE_ROOT_ELEMENT);
setDriver(fContentDriver);
//from now onwards this would be handled by fContentDriver,in the same next() call
return fContentDriver.next();
} else if (fEntityScanner.skipChar('?')) {
setScannerState(SCANNER_STATE_PI);
} else {
reportFatalError("MarkupNotRecognizedInProlog",
null);
@ -1395,7 +1394,8 @@ public class XMLDocumentScannerImpl
} else if (fEntityScanner.skipChar('/')) {
reportFatalError("MarkupNotRecognizedInMisc",
null);
} else if (XMLChar.isNameStart(fEntityScanner.peekChar())) {
} else if (isValidNameStartChar(fEntityScanner.peekChar()) ||
isValidNameStartHighSurrogate(fEntityScanner.peekChar())) {
reportFatalError("MarkupNotRecognizedInMisc",
null);
scanStartElement();

View File

@ -784,7 +784,7 @@ public abstract class XMLScanner
if (XMLChar.isHighSurrogate(c)) {
scanSurrogates(text);
}
if (isInvalidLiteral(c)) {
else if (isInvalidLiteral(c)) {
reportFatalError("InvalidCharInComment",
new Object[] { Integer.toHexString(c) });
fEntityScanner.scanChar();
@ -1385,6 +1385,14 @@ public abstract class XMLScanner
return (XMLChar.isNameStart(value));
} // isValidNameStartChar(int): boolean
// returns true if the given character is
// a valid high surrogate for a nameStartChar
// with respect to the version of XML understood
// by this scanner.
protected boolean isValidNameStartHighSurrogate(int value) {
return false;
} // isValidNameStartHighSurrogate(int): boolean
protected boolean versionSupported(String version ) {
return version.equals("1.0") || version.equals("1.1");
} // version Supported

View File

@ -136,6 +136,7 @@ public class XSDFACM
* positions in the second dimension of the transition table.
*/
private int fTransTable[][] = null;
/**
* Array containing occurence information for looping states
* which use counters to check minOccurs/maxOccurs.
@ -211,6 +212,7 @@ public class XSDFACM
// Store away our index and pools in members
fLeafCount = leafCount;
fIsCompactedForUPA = syntaxTree.isCompactedForUPA();
//
// Create some string pool indexes that represent the names of some

View File

@ -184,13 +184,11 @@ public class DocumentBuilderImpl extends DocumentBuilder
*/
if (features != null) {
Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
if (temp != null) {
if (temp && Constants.IS_JDK8_OR_ABOVE) {
fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_SCHEMA,
State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
if (temp != null && temp) {
fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_DTD,
State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(Property.ACCESS_EXTERNAL_SCHEMA,
State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
}
}

View File

@ -164,14 +164,11 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser
if (features != null) {
Boolean temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING);
if (temp != null) {
if (temp && Constants.IS_JDK8_OR_ABOVE) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
if (temp != null && temp) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
}
}

View File

@ -427,12 +427,10 @@ public final class XMLSchemaFactory extends SchemaFactory {
fSecurityManager.setSecureProcessing(value);
if (value) {
if (Constants.IS_JDK8_OR_ABOVE) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);

View File

@ -364,7 +364,7 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin
fInitSecurityManager.setSecureProcessing(value);
setProperty(SECURITY_MANAGER, fInitSecurityManager);
if (value && Constants.IS_JDK8_OR_ABOVE) {
if (value) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,

View File

@ -0,0 +1,67 @@
package parsers;
import java.io.ByteArrayInputStream;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
* @bug 8072081
* @summary verifies that supplementary characters are supported as character
* data in xml 1.0, and also names in xml 1.1.
*
* Joe Wang (huizhe.wang@oracle.com)
*/
public class SupplementaryChars {
@Test(dataProvider = "supported")
public void test(String xml) throws Exception {
ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes("UTF-8"));
getParser().parse(stream, new DefaultHandler());
stream.close();
}
@Test(dataProvider = "unsupported", expectedExceptions = SAXParseException.class)
public void testInvalid(String xml) throws Exception {
ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes("UTF-8"));
getParser().parse(stream, new DefaultHandler());
stream.close();
}
@DataProvider(name = "supported")
private Object[][] supported() {
return new Object[][] {
{"<?xml version=\"1.0\"?><tag>\uD840\uDC0B</tag>"},
{"<?xml version=\"1.0\"?><!-- \uD840\uDC0B --><tag/>"},
{"<?xml version=\"1.1\"?><tag\uD840\uDC0B>in tag name</tag\uD840\uDC0B>"},
{"<?xml version=\"1.1\"?><tag attr\uD840\uDC0B=\"in attribute\">in attribute name</tag>"},
{"<?xml version=\"1.1\"?><tag>\uD840\uDC0B</tag>"},
{"<?xml version=\"1.1\"?><!-- \uD840\uDC0B --><dontCare/>"}
};
}
@DataProvider(name = "unsupported")
private Object[][] unsupported() {
return new Object[][] {
{"<?xml version=\"1.0\"?><tag\uD840\uDC0B>in tag name</tag\uD840\uDC0B>"},
{"<?xml version=\"1.0\"?><tag attr\uD840\uDC0B=\"in attribute\">in attribute name</tag>"}
};
}
private SAXParser getParser() {
SAXParser parser = null;
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
parser = factory.newSAXParser();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
return parser;
}
}

View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package validation.tck;
import java.io.IOException;
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import org.testng.annotations.Test;
import org.xml.sax.SAXException;
/*
* @bug 8142463
* @summary Tests that verify bug fixes for Particles (http://www.w3.org/TR/xmlschema11-1/#cParticles)
* @author Joe Wang (huizhe.wang@oracle.com)
*/
public class ParticleTest {
static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
/*
@bug 8142463
This test verifies the fix for a missing flag that indicates the DFA
is compacted for UPA. Without the fix, the 2nd foo:foo element was
rejected.
*/
@Test
public void test() throws SAXException, IOException {
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xsd")));
Validator validator = schema.newValidator();
validator.validate(new StreamSource(ParticleTest.class.getResourceAsStream("upa01.xml")));
}
}

View File

@ -0,0 +1,6 @@
<foo:root xmlns:foo="foo">
<foo:foo>true</foo:foo>
<foo>123</foo >
<foo:foo>true</foo:foo>
<foo>123</foo >
</foo:root>

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="foo"
xmlns="foo"
>
<xsd:element name="e1" type="xsd:boolean" />
<xsd:element name="foo" substitutionGroup="e1" type="xsd:boolean" />
<xsd:element name="root" type="B" />
<xsd:complexType name="B">
<xsd:choice maxOccurs="1000">
<xsd:element ref="e1" />
<xsd:element name="foo" type="xsd:int" form="unqualified"/>
</xsd:choice>
</xsd:complexType>
</xsd:schema>

View File

@ -340,3 +340,5 @@ b3e45213d574618f6520fa6978e4a14ba577c2db jdk9-b90
fe772cbc64f4e0418c5bf694e9e7123f02e1808f jdk9-b92
5e94fbbb7032b3bba8254ddb1af8fc45a4d1448b jdk9-b93
e8d15c61400c1682a7873e053d7b39efde0b79be jdk9-b94
3e03ddaaac6585fa27e91596eb2a9a31e10bdcc9 jdk-9+95
b55cebc47555293cf9c2aefb3bf63c56e847ab19 jdk-9+96

View File

@ -26,94 +26,46 @@
package javax.xml.soap;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
class FactoryFinder {
/**
* Creates an instance of the specified class using the specified
* {@code ClassLoader} object.
*
* @exception SOAPException if the given class could not be found
* or could not be instantiated
*/
private static Object newInstance(String className,
ClassLoader classLoader)
throws SOAPException
{
try {
Class spiClass = safeLoadClass(className, classLoader);
return spiClass.newInstance();
private static final Logger logger = Logger.getLogger("javax.xml.soap");
} catch (ClassNotFoundException x) {
throw new SOAPException("Provider " + className + " not found", x);
} catch (Exception x) {
throw new SOAPException("Provider " + className + " could not be instantiated: " + x, x);
}
}
private static final ServiceLoaderUtil.ExceptionHandler<SOAPException> EXCEPTION_HANDLER =
new ServiceLoaderUtil.ExceptionHandler<SOAPException>() {
@Override
public SOAPException createException(Throwable throwable, String message) {
return new SOAPException(message, throwable);
}
};
/**
* Finds the implementation {@code Class} object for the given
* factory name, or null if that fails.
* <P>
* This method is package private so that this code can be shared.
*
* @return the {@code Class} object of the specified message factory;
* or {@code null}
*
* @param factoryId the name of the factory to find, which is
* a system property
* @exception SOAPException if there is a SOAP error
*/
static Object find(String factoryId)
throws SOAPException
{
return find(factoryId, null, false);
}
/**
* Finds the implementation {@code Class} object for the given
* factory name, or if that fails, finds the {@code Class} object
* for the given fallback class name. The arguments supplied must be
* used in order. If using the first argument is successful, the second
* one will not be used.
* <P>
* This method is package private so that this code can be shared.
*
* @return the {@code Class} object of the specified message factory;
* may be {@code null}
*
* @param factoryId the name of the factory to find, which is
* a system property
* @param fallbackClassName the implementation class name, which is
* to be used only if nothing else
* is found; {@code null} to indicate that
* there is no fallback class name
* @exception SOAPException if there is a SOAP error
*/
static Object find(String factoryId, String fallbackClassName)
throws SOAPException
{
return find(factoryId, fallbackClassName, true);
}
/**
* Finds the implementation {@code Class} object for the given
* factory name, or if that fails, finds the {@code Class} object
* for the given default class name, but only if {@code tryFallback}
* is {@code true}. The arguments supplied must be used in order
* If using the first argument is successful, the second one will not
* be used. Note the default class name may be needed even if fallback
* is not to be attempted, so certain error conditions can be handled.
* factory type. If it fails and {@code tryFallback} is {@code true}
* finds the {@code Class} object for the given default class name.
* The arguments supplied must be used in order
* Note the default class name may be needed even if fallback
* is not to be attempted in order to check if requested type is fallback.
* <P>
* This method is package private so that this code can be shared.
*
* @return the {@code Class} object of the specified message factory;
* may not be {@code null}
*
* @param factoryId the name of the factory to find, which is
* a system property
* @param factoryClass factory abstract class or interface to be found
* @param deprecatedFactoryId deprecated name of a factory; it is used for types
* where class name is different from a name
* being searched (in previous spec).
* @param defaultClassName the implementation class name, which is
* to be used only if nothing else
* is found; {@code null} to indicate
@ -122,63 +74,52 @@ class FactoryFinder {
* fallback
* @exception SOAPException if there is a SOAP error
*/
static Object find(String factoryId, String defaultClassName,
boolean tryFallback) throws SOAPException {
ClassLoader classLoader;
try {
classLoader = Thread.currentThread().getContextClassLoader();
} catch (Exception x) {
throw new SOAPException(x.toString(), x);
}
@SuppressWarnings("unchecked")
static <T> T find(Class<T> factoryClass,
String defaultClassName,
boolean tryFallback, String deprecatedFactoryId) throws SOAPException {
ClassLoader tccl = ServiceLoaderUtil.contextClassLoader(EXCEPTION_HANDLER);
String factoryId = factoryClass.getName();
// Use the system property first
try {
String systemProp =
System.getProperty( factoryId );
if( systemProp!=null) {
return newInstance(systemProp, classLoader);
String className = fromSystemProperty(factoryId, deprecatedFactoryId);
if (className != null) {
Object result = newInstance(className, defaultClassName, tccl);
if (result != null) {
return (T) result;
}
} catch (SecurityException se) {
}
// try to read from $java.home/lib/jaxm.properties
try {
String javah=System.getProperty( "java.home" );
String configFile = javah + File.separator +
"lib" + File.separator + "jaxm.properties";
File f=new File( configFile );
if( f.exists()) {
Properties props=new Properties();
props.load( new FileInputStream(f));
String factoryClassName = props.getProperty(factoryId);
return newInstance(factoryClassName, classLoader);
className = fromJDKProperties(factoryId, deprecatedFactoryId);
if (className != null) {
Object result = newInstance(className, defaultClassName, tccl);
if (result != null) {
return (T) result;
}
} catch(Exception ex ) {
}
String serviceId = "META-INF/services/" + factoryId;
// standard services: java.util.ServiceLoader
T factory = ServiceLoaderUtil.firstByServiceLoader(
factoryClass,
logger,
EXCEPTION_HANDLER);
if (factory != null) {
return factory;
}
// try to find services in CLASSPATH
try {
InputStream is=null;
if (classLoader == null) {
is=ClassLoader.getSystemResourceAsStream(serviceId);
} else {
is=classLoader.getResourceAsStream(serviceId);
className = fromMetaInfServices(deprecatedFactoryId, tccl);
if (className != null) {
logger.log(Level.WARNING,
"Using deprecated META-INF/services mechanism with non-standard property: {0}. " +
"Property {1} should be used instead.",
new Object[]{deprecatedFactoryId, factoryId});
Object result = newInstance(className, defaultClassName, tccl);
if (result != null) {
return (T) result;
}
if( is!=null ) {
BufferedReader rd =
new BufferedReader(new InputStreamReader(is, "UTF-8"));
String factoryClassName = rd.readLine();
rd.close();
if (factoryClassName != null &&
! "".equals(factoryClassName)) {
return newInstance(factoryClassName, classLoader);
}
}
} catch( Exception ex ) {
}
// If not found and fallback should not be tried, return a null result.
@ -191,46 +132,133 @@ class FactoryFinder {
throw new SOAPException(
"Provider for " + factoryId + " cannot be found", null);
}
return newInstance(defaultClassName, classLoader);
return (T) newInstance(defaultClassName, defaultClassName, tccl);
}
/**
* Loads the class, provided that the calling thread has an access to the
* class being loaded. If this is the specified default factory class and it
* is restricted by package.access we get a SecurityException and can do a
* Class.forName() on it so it will be loaded by the bootstrap class loader.
*/
private static Class safeLoadClass(String className,
ClassLoader classLoader)
throws ClassNotFoundException {
try {
// make sure that the current thread has an access to the package of the given name.
SecurityManager s = System.getSecurityManager();
if (s != null) {
int i = className.lastIndexOf('.');
if (i != -1) {
s.checkPackageAccess(className.substring(0, i));
// in most cases there is no deprecated factory id
static <T> T find(Class<T> factoryClass,
String defaultClassName,
boolean tryFallback) throws SOAPException {
return find(factoryClass, defaultClassName, tryFallback, null);
}
private static Object newInstance(String className, String defaultClassName, ClassLoader tccl) throws SOAPException {
return ServiceLoaderUtil.newInstance(
className,
defaultClassName,
tccl,
EXCEPTION_HANDLER);
}
// used only for deprecatedFactoryId;
// proper factoryId searched by java.util.ServiceLoader
private static String fromMetaInfServices(String deprecatedFactoryId, ClassLoader tccl) {
String serviceId = "META-INF/services/" + deprecatedFactoryId;
logger.log(Level.FINE, "Checking deprecated {0} resource", serviceId);
try (InputStream is =
tccl == null ?
ClassLoader.getSystemResourceAsStream(serviceId)
:
tccl.getResourceAsStream(serviceId)) {
if (is != null) {
String factoryClassName;
try (InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
BufferedReader rd = new BufferedReader(isr)) {
factoryClassName = rd.readLine();
}
logFound(factoryClassName);
if (factoryClassName != null && !"".equals(factoryClassName)) {
return factoryClassName;
}
}
if (classLoader == null)
return Class.forName(className);
else
return classLoader.loadClass(className);
} catch (SecurityException se) {
// (only) default implementation can be loaded
// using bootstrap class loader:
if (isDefaultImplementation(className))
return Class.forName(className);
} catch (IOException e) {
// keep original behavior
}
return null;
}
throw se;
private static String fromJDKProperties(String factoryId, String deprecatedFactoryId) {
Path path = null;
try {
String JAVA_HOME = System.getProperty("java.home");
path = Paths.get(JAVA_HOME, "conf", "jaxm.properties");
logger.log(Level.FINE, "Checking configuration in {0}", path);
// to ensure backwards compatibility
if (!Files.exists(path)) {
path = Paths.get(JAVA_HOME, "lib", "jaxm.properties");
}
logger.log(Level.FINE, "Checking configuration in {0}", path);
if (Files.exists(path)) {
Properties props = new Properties();
try (InputStream inputStream = Files.newInputStream(path)) {
props.load(inputStream);
}
// standard property
logger.log(Level.FINE, "Checking property {0}", factoryId);
String factoryClassName = props.getProperty(factoryId);
logFound(factoryClassName);
if (factoryClassName != null) {
return factoryClassName;
}
// deprecated property
if (deprecatedFactoryId != null) {
logger.log(Level.FINE, "Checking deprecated property {0}", deprecatedFactoryId);
factoryClassName = props.getProperty(deprecatedFactoryId);
logFound(factoryClassName);
if (factoryClassName != null) {
logger.log(Level.WARNING,
"Using non-standard property: {0}. Property {1} should be used instead.",
new Object[]{deprecatedFactoryId, factoryId});
return factoryClassName;
}
}
}
} catch (Exception ignored) {
logger.log(Level.SEVERE, "Error reading SAAJ configuration from [" + path +
"] file. Check it is accessible and has correct format.", ignored);
}
return null;
}
private static String fromSystemProperty(String factoryId, String deprecatedFactoryId) {
String systemProp = getSystemProperty(factoryId);
if (systemProp != null) {
return systemProp;
}
if (deprecatedFactoryId != null) {
systemProp = getSystemProperty(deprecatedFactoryId);
if (systemProp != null) {
logger.log(Level.WARNING,
"Using non-standard property: {0}. Property {1} should be used instead.",
new Object[] {deprecatedFactoryId, factoryId});
return systemProp;
}
}
return null;
}
private static String getSystemProperty(String property) {
logger.log(Level.FINE, "Checking system property {0}", property);
String value = AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty(property));
logFound(value);
return value;
}
private static void logFound(String value) {
if (value != null) {
logger.log(Level.FINE, " found {0}", value);
} else {
logger.log(Level.FINE, " not found");
}
}
private static boolean isDefaultImplementation(String className) {
return MessageFactory.DEFAULT_MESSAGE_FACTORY.equals(className) ||
SOAPFactory.DEFAULT_SOAP_FACTORY.equals(className) ||
SOAPConnectionFactory.DEFAULT_SOAP_CONNECTION_FACTORY.equals(className) ||
SAAJMetaFactory.DEFAULT_META_FACTORY_CLASS.equals(className);
}
}

View File

@ -68,27 +68,15 @@ import java.io.InputStream;
*/
public abstract class MessageFactory {
static final String DEFAULT_MESSAGE_FACTORY
private static final String DEFAULT_MESSAGE_FACTORY
= "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl";
static private final String MESSAGE_FACTORY_PROPERTY
= "javax.xml.soap.MessageFactory";
/**
* Creates a new {@code MessageFactory} object that is an instance
* of the default implementation (SOAP 1.1),
* of the default implementation (SOAP 1.1).
*
* This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load:
* <UL>
* <LI> Use the javax.xml.soap.MessageFactory system property.
* <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard
* java.util.Properties format and contains the fully qualified name of the implementation class with the key being the
* system property defined above.
* <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API
* will look for a classname in the file META-INF/services/javax.xml.soap.MessageFactory in jars available to the runtime.
* <LI> Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
* </UL>
* This method uses the lookup procedure specified in {@link javax.xml.soap} to locate and load the
* {@link javax.xml.soap.MessageFactory} class.
*
* @return a new instance of a {@code MessageFactory}
*
@ -103,7 +91,7 @@ public abstract class MessageFactory {
try {
MessageFactory factory = (MessageFactory) FactoryFinder.find(
MESSAGE_FACTORY_PROPERTY,
MessageFactory.class,
DEFAULT_MESSAGE_FACTORY,
false);

View File

@ -27,25 +27,49 @@ package javax.xml.soap;
/**
* The access point for the implementation classes of the factories defined in the
* SAAJ API. All of the {@code newInstance} methods defined on factories in
* SAAJ 1.3 defer to instances of this class to do the actual object creation.
* SAAJ API. The {@code newInstance} methods defined on factories {@link SOAPFactory} and
* {@link MessageFactory} in SAAJ 1.3 defer to instances of this class to do the actual object creation.
* The implementations of {@code newInstance()} methods (in SOAPFactory and MessageFactory)
* that existed in SAAJ 1.2 have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2
* defined lookup fails to locate the Factory implementation class name.
*
* <p>
* SAAJMetaFactory is a service provider interface. There are no public methods on this
* SAAJMetaFactory is a service provider interface and it uses similar lookup mechanism as other SAAJ factories
* to get actual instance:
*
* <ul>
* <li>If a system property with name {@code javax.xml.soap.SAAJMetaFactory} exists then its value is assumed
* to be the fully qualified name of the implementation class. This phase of the look up enables per-JVM
* override of the SAAJ implementation.
* <li>If a system property with name {@code javax.xml.soap.MetaFactory} exists then its value is assumed
* to be the fully qualified name of the implementation class. This property, defined by previous specifications
* (up to 1.3), is still supported, but it is strongly recommended to migrate to new property
* {@code javax.xml.soap.SAAJMetaFactory}.
* <li>Use the configuration file "jaxm.properties". The file is in standard {@link java.util.Properties} format
* and typically located in the {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with key {@code javax.xml.soap.SAAJMetaFactory}. If no such property is defined,
* again, property with key {@code javax.xml.soap.MetaFactory} is used. It is strongly recommended to migrate to
* new property {@code javax.xml.soap.SAAJMetaFactory}.
* <li> Use the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class,
* to attempt to locate and load an implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}.
* <li> Finally, if all the steps above fail, platform default implementation is used.
* </ul>
*
* <p>
* There are no public methods on this
* class.
*
* @author SAAJ RI Development Team
* @since 1.6, SAAJ 1.3
*/
public abstract class SAAJMetaFactory {
static private final String META_FACTORY_CLASS_PROPERTY =
"javax.xml.soap.MetaFactory";
static final String DEFAULT_META_FACTORY_CLASS =
"com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
private static final String META_FACTORY_DEPRECATED_CLASS_PROPERTY =
"javax.xml.soap.MetaFactory";
private static final String DEFAULT_META_FACTORY_CLASS =
"com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl";
/**
* Creates a new instance of a concrete {@code SAAJMetaFactory} object.
@ -54,27 +78,20 @@ public abstract class SAAJMetaFactory {
* implementation. Service providers provide the name of their {@code SAAJMetaFactory}
* implementation.
*
* This method uses the following ordered lookup procedure to determine the SAAJMetaFactory implementation class to load:
* <UL>
* <LI> Use the javax.xml.soap.MetaFactory system property.
* <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard
* java.util.Properties format and contains the fully qualified name of the implementation class with the key being the
* system property defined above.
* <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API
* will look for a classname in the file META-INF/services/javax.xml.soap.MetaFactory in jars available to the runtime.
* <LI> Default to com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl.
* </UL>
* This method uses the lookup procedure specified in {@link javax.xml.soap} to locate and load the
* {@link javax.xml.soap.SAAJMetaFactory} class.
*
* @return a concrete {@code SAAJMetaFactory} object
* @exception SOAPException if there is an error in creating the {@code SAAJMetaFactory}
*/
static SAAJMetaFactory getInstance() throws SOAPException {
try {
SAAJMetaFactory instance =
(SAAJMetaFactory) FactoryFinder.find(
META_FACTORY_CLASS_PROPERTY,
DEFAULT_META_FACTORY_CLASS);
return instance;
return FactoryFinder.find(
SAAJMetaFactory.class,
DEFAULT_META_FACTORY_CLASS,
true,
META_FACTORY_DEPRECATED_CLASS_PROPERTY);
} catch (Exception e) {
throw new SOAPException(
"Unable to create SAAJ meta-factory" + e.getMessage());
@ -88,6 +105,7 @@ public abstract class SAAJMetaFactory {
* the given {@code String} protocol.
*
* @param protocol a {@code String} indicating the protocol
* @return a {@link MessageFactory}, not null
* @exception SOAPException if there is an error in creating the
* MessageFactory
* @see SOAPConstants#SOAP_1_1_PROTOCOL
@ -102,6 +120,7 @@ public abstract class SAAJMetaFactory {
* the given {@code String} protocol.
*
* @param protocol a {@code String} indicating the protocol
* @return a {@link SOAPFactory}, not null
* @exception SOAPException if there is an error in creating the
* SOAPFactory
* @see SOAPConstants#SOAP_1_1_PROTOCOL

View File

@ -36,23 +36,21 @@ package javax.xml.soap;
* @since 1.6
*/
public abstract class SOAPConnectionFactory {
/**
* A constant representing the default value for a {@code SOAPConnection}
* object. The default is the point-to-point SOAP connection.
*/
static final String DEFAULT_SOAP_CONNECTION_FACTORY
= "com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory";
/**
* A constant representing the {@code SOAPConnection} class.
*/
static private final String SF_PROPERTY
= "javax.xml.soap.SOAPConnectionFactory";
private static final String DEFAULT_SOAP_CONNECTION_FACTORY
= "com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory";
/**
* Creates an instance of the default
* {@code SOAPConnectionFactory} object.
*
* This method uses the lookup procedure specified in {@link javax.xml.soap} to locate and load the
* {@link javax.xml.soap.SOAPConnectionFactory} class.
*
* @return a new instance of a default
* {@code SOAPConnectionFactory} object
*
@ -66,9 +64,10 @@ public abstract class SOAPConnectionFactory {
throws SOAPException, UnsupportedOperationException
{
try {
return (SOAPConnectionFactory)
FactoryFinder.find(SF_PROPERTY,
DEFAULT_SOAP_CONNECTION_FACTORY);
return FactoryFinder.find(
SOAPConnectionFactory.class,
DEFAULT_SOAP_CONNECTION_FACTORY,
true);
} catch (Exception ex) {
throw new SOAPException("Unable to create SOAP connection factory: "
+ex.getMessage());

View File

@ -47,18 +47,11 @@ import org.w3c.dom.Element;
*/
public abstract class SOAPFactory {
/**
* A constant representing the property used to lookup the name of
* a {@code SOAPFactory} implementation class.
*/
static private final String SOAP_FACTORY_PROPERTY =
"javax.xml.soap.SOAPFactory";
/**
* Class name of default {@code SOAPFactory} implementation.
*/
static final String DEFAULT_SOAP_FACTORY
= "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl";
private static final String DEFAULT_SOAP_FACTORY
= "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl";
/**
* Creates a {@code SOAPElement} object from an existing DOM
@ -239,18 +232,10 @@ public abstract class SOAPFactory {
/**
* Creates a new {@code SOAPFactory} object that is an instance of
* the default implementation (SOAP 1.1),
* the default implementation (SOAP 1.1).
*
* This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load:
* <UL>
* <LI> Use the javax.xml.soap.SOAPFactory system property.
* <LI> Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard
* java.util.Properties format and contains the fully qualified name of the implementation class with the key being the
* system property defined above.
* <LI> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API
* will look for a classname in the file META-INF/services/javax.xml.soap.SOAPFactory in jars available to the runtime.
* <LI> Use the SAAJMetaFactory instance to locate the SOAPFactory implementation class.
* </UL>
* This method uses the lookup procedure specified in {@link javax.xml.soap} to locate and load the
* {@link javax.xml.soap.SOAPFactory} class.
*
* @return a new instance of a {@code SOAPFactory}
*
@ -262,10 +247,13 @@ public abstract class SOAPFactory {
throws SOAPException
{
try {
SOAPFactory factory = (SOAPFactory) FactoryFinder.find(
SOAP_FACTORY_PROPERTY, DEFAULT_SOAP_FACTORY, false);
if (factory != null)
return factory;
SOAPFactory factory = FactoryFinder.find(
SOAPFactory.class,
DEFAULT_SOAP_FACTORY,
false);
if (factory != null) return factory;
// leave it on SAAJMetaFactory
return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
} catch (Exception ex) {
throw new SOAPException(

View File

@ -0,0 +1,125 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.xml.soap;
import java.util.ServiceLoader;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Shared ServiceLoader/FactoryFinder Utils shared among SAAJ, JAXB and JAXWS
* Class duplicated to all those projects.
*
* @author Miroslav.Kos@oracle.com
*/
class ServiceLoaderUtil {
static <P, T extends Exception> P firstByServiceLoader(Class<P> spiClass,
Logger logger,
ExceptionHandler<T> handler) throws T {
logger.log(Level.FINE, "Using java.util.ServiceLoader to find {0}", spiClass.getName());
// service discovery
try {
ServiceLoader<P> serviceLoader = ServiceLoader.load(spiClass);
for (P impl : serviceLoader) {
logger.fine("ServiceProvider loading Facility used; returning object [" +
impl.getClass().getName() + "]");
return impl;
}
} catch (Throwable t) {
throw handler.createException(t, "Error while searching for service [" + spiClass.getName() + "]");
}
return null;
}
static void checkPackageAccess(String className) {
// make sure that the current thread has an access to the package of the given name.
SecurityManager s = System.getSecurityManager();
if (s != null) {
int i = className.lastIndexOf('.');
if (i != -1) {
s.checkPackageAccess(className.substring(0, i));
}
}
}
static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
if (classLoader == null) {
return Class.forName(className);
} else {
return classLoader.loadClass(className);
}
}
// Returns instance of required class. It checks package access (security)
// unless it is defaultClassname. It means if you are trying to instantiate
// default implementation (fallback), pass the class name to both first and second parameter.
static <T extends Exception> Object newInstance(String className,
String defaultImplClassName, ClassLoader classLoader,
final ExceptionHandler<T> handler) throws T {
try {
return safeLoadClass(className, defaultImplClassName, classLoader).newInstance();
} catch (ClassNotFoundException x) {
throw handler.createException(x, "Provider " + className + " not found");
} catch (Exception x) {
throw handler.createException(x, "Provider " + className + " could not be instantiated: " + x);
}
}
static Class safeLoadClass(String className,
String defaultImplClassName,
ClassLoader classLoader) throws ClassNotFoundException {
try {
checkPackageAccess(className);
} catch (SecurityException se) {
// anyone can access the platform default factory class without permission
if (defaultImplClassName != null && defaultImplClassName.equals(className)) {
return Class.forName(className);
}
// not platform default implementation ...
throw se;
}
return nullSafeLoadClass(className, classLoader);
}
static <T extends Exception> ClassLoader contextClassLoader(ExceptionHandler<T> exceptionHandler) throws T {
try {
return Thread.currentThread().getContextClassLoader();
} catch (Exception x) {
throw exceptionHandler.createException(x, x.toString());
}
}
static abstract class ExceptionHandler<T extends Exception> {
public abstract T createException(Throwable throwable, String message);
}
}

View File

@ -0,0 +1,107 @@
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Provides the API for creating and building SOAP messages. This package
* is defined in the <i>SOAP with Attachments API for Java<sup><font size="-2">TM</font></sup>
* (SAAJ) 1.4</i> specification.
*
* <p> The API in the <code>javax.xml.soap</code> package allows you to do the following:
*
* <ul>
* <li>create a point-to-point connection to a specified endpoint
* <li>create a SOAP message
* <li>create an XML fragment
* <li>add content to the header of a SOAP message
* <li>add content to the body of a SOAP message
* <li>create attachment parts and add content to them
* <li>access/add/modify parts of a SOAP message
* <li>create/add/modify SOAP fault information
* <li>extract content from a SOAP message
* <li>send a SOAP request-response message
* </ul>
*
* <p>
* In addition the APIs in the <code>javax.xml.soap</code> package extend
* their counterparts in the <code>org.w3c.dom</code> package. This means that
* the <code>SOAPPart</code> of a <code>SOAPMessage</code> is also a DOM Level
* 2 <code>Document</code>, and can be manipulated as such by applications,
* tools and libraries that use DOM (see http://www.w3.org/DOM/ for more information).
* It is important to note that, while it is possible to use DOM APIs to add
* ordinary DOM nodes to a SAAJ tree, the SAAJ APIs are still required to return
* SAAJ types when examining or manipulating the tree. In order to accomplish
* this the SAAJ APIs (specifically {@link javax.xml.soap.SOAPElement#getChildElements()})
* are allowed to silently replace objects that are incorrectly typed relative
* to SAAJ requirements with equivalent objects of the required type. These
* replacements must never cause the logical structure of the tree to change,
* so from the perspective of the DOM APIs the tree will remain unchanged. However,
* the physical composition of the tree will have changed so that references
* to the nodes that were replaced will refer to nodes that are no longer a
* part of the tree. The SAAJ APIs are not allowed to make these replacements
* if they are not required so the replacement objects will never subsequently
* be silently replaced by future calls to the SAAJ API.
* <p>
* What this means in practical terms is that an application that starts to use
* SAAJ APIs on a tree after manipulating it using DOM APIs must assume that the
* tree has been translated into an all SAAJ tree and that any references to objects
* within the tree that were obtained using DOM APIs are no longer valid. Switching
* from SAAJ APIs to DOM APIs is not allowed to cause invalid references and
* neither is using SAAJ APIs exclusively. It is only switching from using DOM
* APIs on a particular SAAJ tree to using SAAJ APIs that causes the risk of
* invalid references.
*
* <h3>Discovery of SAAJ implementation</h3>
* <p>
* There are several factories defined in the SAAJ API to discover and load specific implementation:
*
* <ul>
* <li>{@link javax.xml.soap.SOAPFactory}
* <li>{@link javax.xml.soap.MessageFactory}
* <li>{@link javax.xml.soap.SOAPConnectionFactory}
* <li>{@link javax.xml.soap.SAAJMetaFactory}
* </ul>
*
* First three define {@code newInstance()} method which uses a common lookup procedure to determine
* the implementation class:
*
* <ul>
* <li>Checks if a system property with the same name as the factory class is set (e.g.
* {@code javax.xml.soap.SOAPFactory}). If such property exists then its value is assumed to be the fully qualified
* name of the implementation class. This phase of the look up enables per-JVM override of the SAAJ implementation.
* <li>Use the configuration file "jaxm.properties". The file is in standard
* {@link java.util.Properties} format and typically located in the
* {@code conf} directory of the Java installation. It contains the fully qualified
* name of the implementation class with the key being the system property
* defined above.
* <li> Use the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class,
* to attempt to locate and load an implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}.
* <li> Finally, if all the steps above fail, {@link javax.xml.soap.SAAJMetaFactory} instance is used
* to locate specific implementation (for {@link javax.xml.soap.MessageFactory} and {@link javax.xml.soap.SOAPFactory})
* or platform default implementation is used ({@link javax.xml.soap.SOAPConnectionFactory}).
* Whenever {@link javax.xml.soap.SAAJMetaFactory} is used, its lookup procedure to get actual instance is performed.
* </ul>
*/
package javax.xml.soap;

View File

@ -337,3 +337,5 @@ b433e4dfb830fea60e5187e4580791b62cc362d2 jdk9-b90
6a5c99506f44538b879d8635a3979849ed587130 jdk9-b92
2f12392d0dde768150c83087cdbdd0d33a4d866c jdk9-b93
559b626b01179420a94feb9c3d0f246970d2e3fa jdk9-b94
8581faf0d474472e32f589bbc16db7eec912d83f jdk-9+95
c021b855f51e572e63982654b17742cb1f814fb4 jdk-9+96

View File

@ -459,7 +459,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
# We can only compile native code after java has been compiled (since we
# depend on generated .h files)
$(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller/Poller.o: \
$(BUILD_DEMO_JAVA_POLLER_COMPILE_TARGETS)
$(BUILD_DEMO_JAVA_Poller)
# Copy to image
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt: \

View File

@ -34,11 +34,9 @@ include MakeBase.gmk
ifneq ($(OPENJDK_TARGET_OS), windows)
HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent$(OPENJDK_TARGET_CPU_LIBDIR)
else
HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/bin
BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent
endif
################################################################################
@ -58,10 +56,6 @@ HOTSPOT_BASE_IMPORT_FILES := \
Xusage.txt \
#
HOTSPOT_SA_IMPORT_FILES := \
$(addprefix $(LIBRARY_PREFIX), saproc.* sawindbg.*) \
#
$(eval $(call SetupCopyFiles,COPY_HOTSPOT_BASE, \
SRC := $(HOTSPOT_LIB_DIR), \
DEST := $(BASE_INSTALL_LIBRARIES_HERE), \
@ -77,14 +71,6 @@ endif
BASE_TARGETS := $(COPY_HOTSPOT_BASE) $(COPY_HOTSPOT_BASE_JVMLIB)
$(eval $(call SetupCopyFiles,COPY_HOTSPOT_SA, \
SRC := $(HOTSPOT_LIB_DIR), \
DEST := $(SA_INSTALL_LIBRARIES_HERE), \
FILES := $(shell $(FIND) $(HOTSPOT_LIB_DIR) -type f \
-a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE), $(HOTSPOT_SA_IMPORT_FILES)) \) )))
SA_TARGETS := $(COPY_HOTSPOT_SA)
################################################################################
ifneq ($(STATIC_BUILD), true)
@ -213,34 +199,6 @@ endif
################################################################################
$(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/_the.sa.jar.unpacked: $(HOTSPOT_DIST)/lib/sa-jdi.jar \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
$(ECHO) $(LOG_INFO) Unzipping $(<F)
$(RM) -r $(@D)
$(MKDIR) -p $(@D)
$(CD) $(@D) && $(UNZIP) $< -x META-INF/MANIFEST.MF $(LOG_DEBUG)
# We must move the service provider file out of the way so that
# Gensrc-jdk.jdi.gmk can combine them.
$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
$(MV) $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
$(TOUCH) $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
$(TOUCH) $@
# Declaring this dependency guarantees that _the.sa.services will be rebuilt
# even if zip is already unpacked.
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services: $(HOTSPOT_DIST)/lib/sa-jdi.jar
# Some platforms don't have the serviceability agent
ifeq (, $(filter $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), aix-ppc64))
ifneq ($(JVM_VARIANT_ZERO), true)
SA_TARGETS += $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/_the.sa.jar.unpacked \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
endif
endif
################################################################################
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupCopyFiles,BASE_COPY_LIBS_BIN, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
@ -252,33 +210,16 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter %.lib, $(BASE_TARGETS))))
$(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, \
$(SA_TARGETS))))
$(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, \
$(SA_TARGETS))))
else
$(eval $(call SetupCopyFiles,BASE_COPY_LIBS, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(BASE_TARGETS)))
$(eval $(call SetupCopyFiles,SA_COPY_LIBS, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent, \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent/%, $(SA_TARGETS))))
endif
################################################################################
all: $(BASE_TARGETS) $(SA_TARGETS) \
$(BASE_COPY_LIBS_BIN) $(BASE_COPY_LIBS_LIB) \
$(BASE_COPY_LIBS) $(SA_COPY_LIBS)
all: $(BASE_TARGETS) $(BASE_COPY_LIBS_BIN) $(BASE_COPY_LIBS_LIB) \
$(BASE_COPY_LIBS)
.PHONY: default all

View File

@ -58,13 +58,13 @@ UNICODEDATA := $(JDK_TOPDIR)/make/data/unicodedata/UnicodeData.txt
# output
BASE_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources
SL_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources
LD_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources
BIFILES := $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \
$(BASE_DATA_PKG_DIR)/WordBreakIteratorData \
$(BASE_DATA_PKG_DIR)/LineBreakIteratorData \
$(BASE_DATA_PKG_DIR)/SentenceBreakIteratorData
BIFILES_TH := $(SA_DATA_PKG_DIR)/th/WordBreakIteratorData_th \
$(SA_DATA_PKG_DIR)/th/LineBreakIteratorData_th
BIFILES_TH := $(LD_DATA_PKG_DIR)/th/WordBreakIteratorData_th \
$(LD_DATA_PKG_DIR)/th/LineBreakIteratorData_th
$(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
@ -77,9 +77,9 @@ $(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKIT
-spec $(UNICODEDATA)
$(TOUCH) $@
$(BIFILES_TH): $(SL_DATA_PKG_DIR)/_the.bifiles_th
$(SL_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
$(SL_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
$(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th
$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
$(ECHO) $(LOG_INFO) "Generating BreakIteratorData_th"
$(MKDIR) -p $(@D)/th
$(RM) $(BIFILES_TH)

View File

@ -70,11 +70,11 @@ endef
# Filter com.sun.jdi.connect.Connector
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
$(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/_the.sa.services
$(HOTSPOT_TOPDIR)/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector
$(process-provider)
# Copy the same service file into jdk.hotspot.agent so that they are kept the same.
$(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector: \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector
$(install-file)
@ -82,7 +82,7 @@ $(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect
ifeq (, $(filter $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), aix-ppc64))
ifneq ($(JVM_VARIANT_ZERO), true)
GENSRC_JDK_JDI += $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector \
$(JDK_OUTPUTDIR)/modules/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/META-INF/services/com.sun.jdi.connect.Connector
endif
endif

View File

@ -0,0 +1,55 @@
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
include GensrcCommon.gmk
################################################################################
define merge-providers
$(MKDIR) -p $(@D)
$(CAT) $^ > $@
endef
PROVIDER_FILE := META-INF/services/sun.jvmstat.monitor.MonitoredHostService
# Merge the local and remote sevice providers into jdk.jvmstat/META-INF/services
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE): \
$(JDK_TOPDIR)/src/jdk.jvmstat/share/classes/$(PROVIDER_FILE) \
$(JDK_TOPDIR)/src/jdk.jvmstat.rmi/share/classes/$(PROVIDER_FILE)
$(merge-providers)
# Copy the same service file into jdk.jvmstat.rmi so that they are kept the same.
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE): \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE)
$(install-file)
################################################################################
jdk.jvmstat: $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat/$(PROVIDER_FILE) \
$(SUPPORT_OUTPUTDIR)/gensrc/jdk.jvmstat.rmi/$(PROVIDER_FILE)
all: jdk.jvmstat
.PHONY: all

View File

@ -33,4 +33,3 @@ include TextFileProcessing.gmk
include SetupJavaCompilers.gmk
# We need the tools.
include Tools.gmk

View File

@ -90,7 +90,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
SRC := $(GENSRC_UC_SRC), \
INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
TOOLCHAIN := TOOLCHAIN_BUILD, \
CFLAGS := $(filter -D%, $(CFLAGS_JDKEXE)), \
OBJECT_DIR := $(GENSRC_UC_BIN), \
OUTPUT_DIR := $(GENSRC_UC_BIN), \
PROGRAM := genUnixConstants))

View File

@ -75,7 +75,7 @@ define SetupCompilePropertiesBody
# Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
# to .../support/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
# Strip away prefix and suffix, leaving for example only:
# Strip away prefix and suffix, leaving for example only:
# "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
$1_JAVAS := $$(patsubst $$($1_MODULE_PATH_ROOT)/%, \
$(SUPPORT_OUTPUTDIR)/gensrc/%, \

View File

@ -56,6 +56,77 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
))
TARGETS += $(BUILD_JABSWITCH)
################################################################################
# jaccessinspector
TOPDIR := $(JDK_TOPDIR)/src/jdk.accessibility/windows/native
TOOLS_CFLAGS := $(addprefix -I, \
$(TOPDIR)/include/bridge \
$(TOPDIR)/common \
$(TOPDIR)/toolscommon)
define SetupInspector
# Parameter 1 File name suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib User32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccessinspector$1, \
DEBUG_SYMBOLS := true, \
VERSIONINFO_RESOURCE := $(TOPDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
RC_FLAGS := $$(RC_FLAGS) \
-D "JDK_FNAME=jaccessinspector$1.exe" \
-D "JDK_INTERNAL_NAME=jaccessinspector$1" \
-D "JDK_FTYPE=0x01L", \
))
TARGETS += $$(BUILD_JACCESSINSPECTOR$1)
endef
################################################################################
# jaccesswalker
define SetupWalker
# Parameter 1 File name suffix
# Parameter 2 ACCESSBRIDGE_ARCH_ -D suffix
$$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
CFLAGS :== $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib Comctl32.lib Gdi32.lib User32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccesswalker$1, \
DEBUG_SYMBOLS := true, \
VERSIONINFO_RESOURCE := $(TOPDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
RC_FLAGS := $$(RC_FLAGS) \
-D "JDK_FNAME=jaccesswalker$1.exe" \
-D "JDK_INTERNAL_NAME=jaccesswalker$1" \
-D "JDK_FTYPE=0x01L", \
))
TARGETS += $$(BUILD_JACCESSWALKER$1)
endef
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupInspector,-32,32))
$(eval $(call SetupWalker,-32,32))
$(eval $(call SetupInspector,,LEGACY))
$(eval $(call SetupWalker,,LEGACY))
else
$(eval $(call SetupInspector,,64))
$(eval $(call SetupWalker,,64))
endif
endif
################################################################################

View File

@ -30,7 +30,6 @@ $(eval $(call SetupBuildLauncher, jinfo, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
MACOSX_SIGNED := true, \
))
@ -39,7 +38,6 @@ $(eval $(call SetupBuildLauncher, jmap, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
MACOSX_SIGNED := true, \
))
@ -52,7 +50,6 @@ $(eval $(call SetupBuildLauncher, jstack, \
JAVA_ARGS := \
-Dsun.jvm.hotspot.debugger.useProcDebugger \
-Dsun.jvm.hotspot.debugger.useWindbgDebugger, \
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
MACOSX_SIGNED := true, \
))

View File

@ -28,7 +28,6 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jconsole, \
MAIN_CLASS := sun.tools.jconsole.JConsole, \
JAVA_ARGS := -Djconsole.showOutputViewer, \
APP_CLASSPATH := /lib/jconsole.jar /lib/tools.jar /classes, \
CFLAGS_windows := -DJAVAW, \
LIBS_windows := user32.lib, \
))

View File

@ -27,5 +27,4 @@ include LauncherCommon.gmk
$(eval $(call SetupBuildLauncher, jdb, \
MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \
APP_CLASSPATH := /lib/tools.jar /lib/sa-jdi.jar /classes, \
))

View File

@ -64,7 +64,6 @@ JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manife
# Remaining parameters are named arguments. These include:
# MAIN_CLASS The Java main class to launch
# JAVA_ARGS Processed into a -DJAVA_ARGS C flag
# APP_CLASSPATH Processed into a -DAPP_CLASSPATH C flag
# CFLAGS Additional CFLAGS
# CFLAGS_windows Additional CFLAGS_windows
# LIBS_unix Additional LIBS_unix
@ -103,15 +102,6 @@ define SetupBuildLauncherBody
$1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR)
endif
ifneq ($$($1_APP_CLASSPATH), )
$1_APP_CLASSPATH_STR := '{ $$(strip $$(foreach a, \
$$($1_APP_CLASSPATH), "$$a"$(COMMA) )) }'
# Remove the trailing comma
$1_APP_CLASSPATH_STR := $$(strip $$(subst $$(COMMA) }', }', \
$$($1_APP_CLASSPATH_STR)))
$1_CFLAGS += -DAPP_CLASSPATH=$$($1_APP_CLASSPATH_STR)
endif
$1_LIBS :=
ifeq ($(OPENJDK_TARGET_OS), macosx)
ifeq ($$($1_MACOSX_SIGNED), true)

View File

@ -602,6 +602,33 @@ LIBFONTMANAGER_CFLAGS := \
$(LIBJAVA_HEADER_FLAGS) \
#
#### Begin harfbuzz configuration
HARFBUZZ_CFLAGS := -DHAVE_OT -DHAVE_FALLBACK -DHAVE_UCDN
ifneq ($(OPENJDK_TARGET_OS), windows)
HARFBUZZ_CFLAGS += -DGETPAGESIZE -DHAVE_MPROTECT -DHAVE_PTHREAD \
-DHAVE_SYSCONF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H
endif
ifneq (, $(findstring $(OPENJDK_TARGET_OS), linux macosx))
HARFBUZZ_CFLAGS += -DHAVE_INTEL_ATOMIC_PRIMITIVES
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
endif
ifneq ($(OPENJDK_TARGET_OS), macosx)
LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
endif
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc
LIBFONTMANAGER_CFLAGS += $(HARFBUZZ_CFLAGS)
#### End harfbuzz configuration
ifndef OPENJDK
LIBFONTMANAGER_CFLAGS += -I$(JDK_TOPDIR)/src/closed/java.desktop/share/native/libt2k
BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libfontmanager/mapfile-vers
@ -648,11 +675,11 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
CFLAGS_windows = -DCC_NOEX, \
DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \
delete-non-virtual-dtor type-limits, \
delete-non-virtual-dtor type-limits missing-field-initializers, \
DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast, \
DISABLED_WARNINGS_solstudio := truncwarn, \
DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146, \
DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \
WARNINGS_AS_ERRORS_gcc := false, \
WARNINGS_AS_ERRORS_solstudio := false, \
MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \

View File

@ -43,7 +43,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
LDFLAGS := $(LDFLAGS_JDKLIB), \
LIBS := $(LIBDL), \
LIBS_solaris := -lc, \
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2ucrypto, \
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
$(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)

View File

@ -29,32 +29,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
################################################################################
LIBAPPLESCRIPTENGINE_SRC := $(JDK_TOPDIR)/src/jdk.deploy.osx/macosx/native/libapplescriptengine
$(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE, \
LIBRARY := AppleScriptEngine, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(LIBAPPLESCRIPTENGINE_SRC), \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
-I$(LIBAPPLESCRIPTENGINE_SRC) \
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.deploy.osx, \
DISABLED_WARNINGS_clang := implicit-function-declaration format, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -framework Cocoa \
-framework Carbon \
-framework JavaNativeFoundation \
$(JDKLIB_LIBS), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libAppleScriptEngine, \
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
$(BUILD_LIBAPPLESCRIPTENGINE): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBAPPLESCRIPTENGINE)
################################################################################
LIBOSX_DIRS := $(JDK_TOPDIR)/src/jdk.deploy.osx/macosx/native/libosx
LIBOSX_CFLAGS := -I$(LIBOSX_DIRS) \
-I$(JDK_TOPDIR)/src/java.desktop/macosx/native/libosxapp \

View File

@ -206,6 +206,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsDevice_enumDisplayModes;
Java_sun_awt_X11GraphicsDevice_configDisplayMode;
Java_sun_awt_X11GraphicsDevice_resetNativeData;
Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor;
Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
Java_sun_awt_X11GraphicsEnvironment_getDisplayString;

View File

@ -214,6 +214,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsDevice_enumDisplayModes;
Java_sun_awt_X11GraphicsDevice_configDisplayMode;
Java_sun_awt_X11GraphicsDevice_resetNativeData;
Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor;
Java_sun_awt_X11GraphicsConfig_initIDs;
Java_sun_awt_X11GraphicsConfig_getXResolution;
Java_sun_awt_X11GraphicsConfig_getYResolution;

View File

@ -41,6 +41,7 @@ SUNWprivate_1.1 {
Java_sun_font_StrikeCache_freeLongMemory;
Java_sun_font_SunLayoutEngine_initGVIDs;
Java_sun_font_SunLayoutEngine_nativeLayout;
Java_sun_font_SunLayoutEngine_shape;
Java_sun_font_X11TextRenderer_doDrawGlyphList;
Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA;
Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD;

View File

@ -43,6 +43,7 @@ SUNWprivate_1.1 {
Java_sun_font_StrikeCache_freeLongMemory;
Java_sun_font_SunLayoutEngine_initGVIDs;
Java_sun_font_SunLayoutEngine_nativeLayout;
Java_sun_font_SunLayoutEngine_shape;
Java_sun_font_X11TextRenderer_doDrawGlyphList;
Java_sun_java2d_loops_DrawGlyphListAA_DrawGlyphListAA;
Java_sun_java2d_loops_DrawGlyphListLCD_DrawGlyphListLCD;

View File

@ -138,9 +138,14 @@ SUNWprivate_1.1 {
Java_java_lang_Double_longBitsToDouble;
Java_java_lang_Double_doubleToRawLongBits;
Java_java_lang_reflect_Proxy_defineClass0;
Java_java_lang_Shutdown_runAllFinalizers;
Java_java_lang_Float_intBitsToFloat;
Java_java_lang_Float_floatToRawIntBits;
Java_java_lang_StackFrameInfo_fillInStackFrames;
Java_java_lang_StackFrameInfo_setMethodInfo;
Java_java_lang_StackStreamFactory_checkStackWalkModes;
Java_java_lang_StackStreamFactory_00024AbstractStackWalker_callStackWalk;
Java_java_lang_StackStreamFactory_00024AbstractStackWalker_fetchStackFrames;
Java_java_lang_Shutdown_runAllFinalizers;
Java_java_lang_StrictMath_IEEEremainder;
Java_java_lang_StrictMath_acos;
Java_java_lang_StrictMath_asin;

View File

@ -173,7 +173,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_UnixNativeDispatcher_futimes;
Java_sun_nio_fs_UnixNativeDispatcher_open0;
Java_sun_nio_fs_UnixNativeDispatcher_openat0;
Java_sun_nio_fs_UnixNativeDispatcher_close;
Java_sun_nio_fs_UnixNativeDispatcher_close0;
Java_sun_nio_fs_UnixNativeDispatcher_read;
Java_sun_nio_fs_UnixNativeDispatcher_write;
Java_sun_nio_fs_UnixNativeDispatcher_fopen0;

View File

@ -150,7 +150,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_UnixNativeDispatcher_futimes;
Java_sun_nio_fs_UnixNativeDispatcher_open0;
Java_sun_nio_fs_UnixNativeDispatcher_openat0;
Java_sun_nio_fs_UnixNativeDispatcher_close;
Java_sun_nio_fs_UnixNativeDispatcher_close0;
Java_sun_nio_fs_UnixNativeDispatcher_read;
Java_sun_nio_fs_UnixNativeDispatcher_write;
Java_sun_nio_fs_UnixNativeDispatcher_fopen0;

View File

@ -150,7 +150,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_UnixNativeDispatcher_futimes;
Java_sun_nio_fs_UnixNativeDispatcher_open0;
Java_sun_nio_fs_UnixNativeDispatcher_openat0;
Java_sun_nio_fs_UnixNativeDispatcher_close;
Java_sun_nio_fs_UnixNativeDispatcher_close0;
Java_sun_nio_fs_UnixNativeDispatcher_read;
Java_sun_nio_fs_UnixNativeDispatcher_write;
Java_sun_nio_fs_UnixNativeDispatcher_fopen0;

View File

@ -62,6 +62,7 @@ class ResourceBundleGenerator implements BundleGenerator {
"Asia/Tokyo",
"Europe/Bucharest",
"Asia/Shanghai",
"UTC",
};
// For duplicated values
@ -136,7 +137,7 @@ class ResourceBundleGenerator implements BundleGenerator {
for (String preferred : preferredTZIDs) {
if (map.containsKey(preferred)) {
newMap.put(preferred, map.remove(preferred));
} else if ("GMT".equals(preferred) &&
} else if (("GMT".equals(preferred) || "UTC".equals(preferred)) &&
metaKeys.contains(CLDRConverter.METAZONE_ID_PREFIX+preferred)) {
newMap.put(preferred, preferred);
}

View File

@ -89,7 +89,7 @@ public class MakeJavaSecurity {
}
// Filter out platform-unrelated ones. We only support
// #ifdef, #ifndef, and #endif.
// #ifdef, #ifndef, #else, and #endif. Nesting not supported (yet).
int mode = 0; // 0: out of block, 1: in match, 2: in non-match
Iterator<String> iter = lines.iterator();
while (iter.hasNext()) {
@ -105,7 +105,17 @@ public class MakeJavaSecurity {
}
iter.remove();
} else if (line.startsWith("#ifndef ")) {
mode = line.endsWith(args[2])?2:1;
if (line.indexOf('-') > 0) {
mode = line.endsWith(args[2]+"-"+args[3]) ? 2 : 1;
} else {
mode = line.endsWith(args[2]) ? 2 : 1;
}
iter.remove();
} else if (line.startsWith("#else")) {
if (mode == 0) {
throw new IllegalStateException("#else not in #if block");
}
mode = 3 - mode;
iter.remove();
} else {
if (mode == 2) iter.remove();
@ -150,7 +160,7 @@ public class MakeJavaSecurity {
List<String> args) throws IOException {
// parse property until EOL, not including line breaks
boolean first = true;
while (!line.isEmpty()) {
while (line != null && !line.isEmpty()) {
if (!line.startsWith("#")) {
if (!line.endsWith(",\\") ||
(!first && line.contains("="))) {
@ -169,6 +179,8 @@ public class MakeJavaSecurity {
lines.add(String.format("%"+numSpaces+"s", "") + arg + ",\\");
}
}
lines.add(line);
if (line != null) {
lines.add(line);
}
}
}

View File

@ -19,6 +19,7 @@ java.xml.crypto
jdk.charsets
jdk.deploy
jdk.deploy.osx
jdk.vm.cds
jdk.httpserver
jdk.jfr
jdk.management

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