This commit is contained in:
Vladimir Ivanov 2016-05-27 16:56:23 +03:00
commit df9373aad7
1632 changed files with 110631 additions and 51073 deletions
.hgtags.hgtags-top-repo
common
corba
hotspot
.hgtags
make/lib
src
test
jaxp
.hgtags
src/java.xml/share/classes

@ -361,3 +361,5 @@ c84d0cce090e161d736de69e941830adf8c2f87a jdk-9+114
84aba7335005a3a47751dcf1f37935f97df9f99a jdk-9+116
82b8d12a553f5617737c238cec060281d52e351c jdk-9+117
7c04fcb12bd4a31570a238e663fa846dfa5ec3b8 jdk-9+118
caf97b37ebec84288c112d21d3a60cb628cba1e8 jdk-9+119
9330543436402b8f3bd070524846a464d8143557 jdk-9+120

@ -361,3 +361,5 @@ f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111
6743a8e0cab7b5f6f4a0575f6664892f0ab740af jdk-9+116
e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117
047f95de8f918d8ff5e8cd2636a2abb5c3c8adb8 jdk-9+118
3463a3f14f0f0e8a68f29ac6405454f2fa2f598a jdk-9+119
647e0142a5a52749db572b5e6638d561def6479e jdk-9+120

@ -484,6 +484,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_REQUIRE_PROGS(FILE, file)
BASIC_REQUIRE_PROGS(FIND, find)
BASIC_REQUIRE_PROGS(HEAD, head)
BASIC_REQUIRE_PROGS(GUNZIP, gunzip)
BASIC_REQUIRE_PROGS(GZIP, pigz gzip)
BASIC_REQUIRE_PROGS(LN, ln)
BASIC_REQUIRE_PROGS(LS, ls)
BASIC_REQUIRE_PROGS(MKDIR, mkdir)
@ -496,7 +498,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_REQUIRE_PROGS(SH, sh)
BASIC_REQUIRE_PROGS(SORT, sort)
BASIC_REQUIRE_PROGS(TAIL, tail)
BASIC_REQUIRE_PROGS(TAR, tar)
BASIC_REQUIRE_PROGS(TAR, gtar tar)
BASIC_REQUIRE_PROGS(TEE, tee)
BASIC_REQUIRE_PROGS(TOUCH, touch)
BASIC_REQUIRE_PROGS(TR, tr)
@ -839,8 +841,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
# The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
@ -1009,11 +1009,36 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
AC_SUBST(FIND_DELETE)
])
AC_DEFUN([BASIC_CHECK_TAR],
[
# Test which kind of tar was found
if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
TAR_TYPE="gnu"
elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
TAR_TYPE="bsd"
elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
TAR_TYPE="solaris"
fi
AC_MSG_CHECKING([what type of tar was found])
AC_MSG_RESULT([$TAR_TYPE])
if test "x$TAR_TYPE" = "xgnu"; then
TAR_INCLUDE_PARAM="T"
TAR_SUPPORTS_TRANSFORM="true"
else
TAR_INCLUDE_PARAM="I"
TAR_SUPPORTS_TRANSFORM="false"
fi
AC_SUBST(TAR_INCLUDE_PARAM)
AC_SUBST(TAR_SUPPORTS_TRANSFORM)
])
AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
[
BASIC_CHECK_GNU_MAKE
BASIC_CHECK_FIND_DELETE
BASIC_CHECK_TAR
# These tools might not be installed by default,
# need hint on how to install them.

@ -134,8 +134,9 @@ ifeq ($(JVM_INTERPRETER), cpp)
endif
HOTSPOT_MAKE_ARGS := product docs export_product
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD := false
# Control wether Hotspot builds gtest tests
BUILD_GTEST := false
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@

@ -48,6 +48,7 @@ export EXPR="@EXPR@"
export FILE="@FILE@"
export FIND="@FIND@"
export GREP="@GREP@"
export GUNZIP="@GUNZIP@"
export LDD="@LDD@"
export LN="@LN@"
export MKDIR="@MKDIR@"
@ -63,10 +64,11 @@ export SED="@SED@"
export SORT="@SORT@"
export STAT="@STAT@"
export STRIP="@STRIP@ @STRIPFLAGS@"
export TAR="@TAR@"
export TEE="@TEE@"
export UNIQ="@UNIQ@"
export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
export UNARCHIVE="@UNZIP@ -q"
export UNARCHIVE="@UNZIP@ -q -o"
export SRC_ROOT="@TOPDIR@"
export OUTPUT_ROOT="@OUTPUT_ROOT@"

@ -207,6 +207,7 @@ JDKOPT_SETUP_CODE_COVERAGE
# Need toolchain to setup dtrace
HOTSPOT_SETUP_DTRACE
HOTSPOT_SETUP_JVM_FEATURES
HOTSPOT_ENABLE_DISABLE_GTEST
###############################################################################
#
@ -226,9 +227,9 @@ LIB_SETUP_LIBRARIES
#
###############################################################################
HOTSPOT_SETUP_LEGACY_BUILD
JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
###############################################################################
#

File diff suppressed because it is too large Load Diff

@ -1,158 +0,0 @@
#
# Copyright (c) 2011, 2016, 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.
#
# Chaining of spec files
HOTSPOT_SPEC:=$(dir $(SPEC))hotspot-spec.gmk
override SPEC=$(HOTSPOT_SPEC)
# Now include the base spec.gmk file
include $(BASE_SPEC)
# Additional legacy variables defined for Hotspot
@SET_OPENJDK@
@HOTSPOT_SET_WARNINGS_AS_ERRORS@
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
@BUILD_HEADLESS@
JVM_VARIANTS:=@JVM_VARIANTS_COMMA@
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
JVM_VARIANT_MINIMAL1:=@JVM_VARIANT_MINIMAL1@
JVM_VARIANT_CORE:=@JVM_VARIANT_CORE@
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
JVM_VARIANT_CUSTOM:=@JVM_VARIANT_HOTSPOT@
# Legacy setting: OPT or DBG
VARIANT:=@VARIANT@
# Legacy setting: true or false
FASTDEBUG:=@FASTDEBUG@
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
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_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
####################################################
#
# Legacy Hotspot support
# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.
@DEFINE_CROSS_COMPILE_ARCH@
# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM=$(OPENJDK_TARGET_OS)
# 32 or 64 bit
ARCH_DATA_MODEL=$(OPENJDK_TARGET_CPU_BITS)
ALT_BOOTDIR=$(BOOT_JDK)
# Can be /sparcv9 or /amd64 on Solaris
ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
# Set the cpu architecture
ARCH=$(OPENJDK_TARGET_CPU_ARCH)
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1
@LP64@
# Legacy settings for zero
ZERO_ENDIANNESS=$(OPENJDK_TARGET_CPU_ENDIAN)
ZERO_LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
ZERO_ARCHDEF=@ZERO_ARCHDEF@
ZERO_ARCHFLAG=@ZERO_ARCHFLAG@
LIBFFI_CFLAGS=@LIBFFI_CFLAGS@
LIBFFI_LIBS=@LIBFFI_LIBS@
# Legacy settings for zeroshark
LLVM_CFLAGS=@LLVM_CFLAGS@
LLVM_LIBS=@LLVM_LIBS@
LLVM_LDFLAGS=@LLVM_LDFLAGS@
ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
ALT_EXPORT_PATH=$(HOTSPOT_DIST)
ifeq ($(HOTSPOT_TARGET_CPU), zero)
CC_INTERP=true
endif
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
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@ @ICECC@ @HOTSPOT_CXX@
LD:=@HOTSPOT_LD@
MT:=@HOTSPOT_MT@
RC:=@HOTSPOT_RC@
EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) $(NO_NULL_POINTER_CHECK_FLAG) \
$(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ $(CFLAGS_CCACHE)
EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@
# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols
# creation.
ifeq ($(COPY_DEBUG_SYMBOLS), true)
FULL_DEBUG_SYMBOLS=1
# Ensure hotspot uses the objcopy that configure located
ALT_OBJCOPY:=$(OBJCOPY)
else
FULL_DEBUG_SYMBOLS=0
endif
# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
ZIP_DEBUGINFO_FILES:=1
else
ZIP_DEBUGINFO_FILES:=0
endif
DEBUG_BINARIES := @DEBUG_BINARIES@
STRIP_POLICY := @STRIP_POLICY@
ifeq ($(OPENJDK_TARGET_OS), windows)
# On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
# environment variables (in Windows path style).
export INCLUDE:=@VS_INCLUDE@
export LIB:=@VS_LIB@
endif
# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/make/common/MakeBase.gmk

@ -93,7 +93,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
# Check that the selected variants are valid
# grep filter function inspired by a comment to http://stackoverflow.com/a/1617326
INVALID_VARIANTS=`$GREP -Fvx "${VALID_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
# Notice that the original variant failes on SLES 10 and 11
NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
STACK=${JVM_VARIANTS// /$'\n'}
INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_VARIANTS" != x; then
AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS])
AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS])
@ -101,7 +104,9 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
# All "special" variants share the same output directory ("server")
VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
STACK=${JVM_VARIANTS// /$'\n'}
INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
fi
@ -293,146 +298,51 @@ AC_DEFUN_ONCE([HOTSPOT_VALIDATE_JVM_FEATURES],
features_var_name=JVM_FEATURES_$variant
JVM_FEATURES_TO_TEST=${!features_var_name}
AC_MSG_RESULT([$JVM_FEATURES_TO_TEST])
INVALID_FEATURES=`$GREP -Fvx "${VALID_JVM_FEATURES// /$'\n'}" <<< "${JVM_FEATURES_TO_TEST// /$'\n'}"`
NEEDLE=${VALID_JVM_FEATURES// /$'\n'}
STACK=${JVM_FEATURES_TO_TEST// /$'\n'}
INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_FEATURES" != x; then
AC_MSG_ERROR([Invalid JVM feature(s): $INVALID_FEATURES])
fi
done
])
###############################################################################
# Support for old hotspot build. Remove once new hotspot build has proven
# to work satisfactory.
################################################################################
# Check if gtest should be built
#
AC_DEFUN_ONCE([HOTSPOT_SETUP_LEGACY_BUILD],
AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
[
AC_ARG_ENABLE(new-hotspot-build, [AS_HELP_STRING([--disable-new-hotspot-build],
[disable the new hotspot build system (use the old) @<:@enabled@:>@])])
AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
[Disables building of the Hotspot unit tests])])
if test "x$enable_new_hotspot_build" = "x" || test "x$enable_new_hotspot_build" = "xyes"; then
USE_NEW_HOTSPOT_BUILD=true
else
USE_NEW_HOTSPOT_BUILD=false
fi
AC_SUBST(USE_NEW_HOTSPOT_BUILD)
case $HOTSPOT_DEBUG_LEVEL in
product )
VARIANT="OPT"
FASTDEBUG="false"
DEBUG_CLASSFILES="false"
;;
fastdebug )
VARIANT="DBG"
FASTDEBUG="true"
DEBUG_CLASSFILES="true"
;;
debug )
VARIANT="DBG"
FASTDEBUG="false"
DEBUG_CLASSFILES="true"
;;
optimized )
VARIANT="OPT"
FASTDEBUG="false"
DEBUG_CLASSFILES="false"
;;
esac
AC_SUBST(VARIANT)
AC_SUBST(FASTDEBUG)
AC_SUBST(DEBUG_CLASSFILES)
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
MACOSX_UNIVERSAL="true"
fi
AC_SUBST(MACOSX_UNIVERSAL)
# Make sure JVM_VARIANTS_COMMA use minimal1 for backwards compatibility
JVM_VARIANTS_COMMA=`$ECHO ,$JVM_VARIANTS_OPT, | $SED -e 's/,minimal,/,minimal1,/'`
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,minimal1\?,/!s/.*/false/g' -e '/,minimal1\?,/s/.*/true/g'`
JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
JVM_VARIANT_CUSTOM=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,custom,/!s/.*/false/g' -e '/,custom,/s/.*/true/g'`
#####
# Generate the legacy makefile targets for hotspot.
HOTSPOT_TARGET=""
if test "x$JVM_VARIANT_SERVER" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
fi
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
fi
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
fi
if test "x$JVM_VARIANT_ZERO" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
fi
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
fi
if test "x$JVM_VARIANT_CORE" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
fi
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_DEBUG_LEVEL"
# On Macosx universal binaries are produced, but they only contain
# 64 bit intel. This invalidates control of which jvms are built
# from configure, but only server is valid anyway. Fix this
# when hotspot makefiles are rewritten.
if test "x$MACOSX_UNIVERSAL" = xtrue; then
HOTSPOT_TARGET=universal_${HOTSPOT_DEBUG_LEVEL}
fi
HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
AC_SUBST(HOTSPOT_MAKE_ARGS)
# Control wether Hotspot runs Queens test after build.
AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
[run the Queens test after Hotspot build @<:@disabled@:>@])],,
[enable_hotspot_test_in_build=no])
if test "x$enable_hotspot_test_in_build" = "xyes"; then
TEST_IN_BUILD=true
if test -e "$HOTSPOT_TOPDIR/test/native"; then
GTEST_DIR_EXISTS="true"
else
TEST_IN_BUILD=false
fi
AC_SUBST(TEST_IN_BUILD)
if test "x$USE_NEW_HOTSPOT_BUILD" = xfalse; then
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
fi
fi
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
fi
fi
if test "x$JVM_VARIANT_CUSTOM" = xtrue; then
AC_MSG_ERROR([You cannot build a custom JVM using the old hotspot build system.])
fi
GTEST_DIR_EXISTS="false"
fi
AC_SUBST(JVM_VARIANTS_COMMA)
AC_SUBST(JVM_VARIANT_SERVER)
AC_SUBST(JVM_VARIANT_CLIENT)
AC_SUBST(JVM_VARIANT_MINIMAL1)
AC_SUBST(JVM_VARIANT_HOTSPOT)
AC_SUBST(JVM_VARIANT_ZERO)
AC_SUBST(JVM_VARIANT_ZEROSHARK)
AC_SUBST(JVM_VARIANT_CORE)
AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
if test "x$enable_hotspot_gtest" = "xyes"; then
if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
AC_MSG_RESULT([yes, forced])
BUILD_GTEST="true"
else
AC_MSG_ERROR([Cannot build gtest without the test source])
fi
elif test "x$enable_hotspot_gtest" = "xno"; then
AC_MSG_RESULT([no, forced])
BUILD_GTEST="false"
elif test "x$enable_hotspot_gtest" = "x"; then
if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
AC_MSG_RESULT([yes])
BUILD_GTEST="true"
else
AC_MSG_RESULT([no])
BUILD_GTEST="false"
fi
else
AC_MSG_ERROR([--enable-gtest must be either yes or no])
fi
AC_SUBST(BUILD_GTEST)
])

@ -209,9 +209,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
if test "x$OPENJDK_TARGET_OS" = xaix ; then
INCLUDE_SA=false
fi
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
INCLUDE_SA=false
fi
AC_SUBST(INCLUDE_SA)
# Compress jars
@ -494,3 +491,46 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
AC_SUBST(BUILD_FAILURE_HANDLER)
])
################################################################################
#
# Enable or disable generation of the classlist at build time
#
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
[
AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
[forces enabling or disabling of the generation of a CDS classlist at build time.
Default is to generate it when either the server or client JVMs are built.])])
# Check if it's likely that it's possible to generate the classlist. Depending
# on exact jvm configuration it could be possible anyway.
if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
else
ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
fi
AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
if test "x$enable_generate_classlist" = "xyes"; then
AC_MSG_RESULT([yes, forced])
ENABLE_GENERATE_CLASSLIST="true"
if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
fi
elif test "x$enable_generate_classlist" = "xno"; then
AC_MSG_RESULT([no, forced])
ENABLE_GENERATE_CLASSLIST="false"
elif test "x$enable_generate_classlist" = "x"; then
if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
AC_MSG_RESULT([yes])
ENABLE_GENERATE_CLASSLIST="true"
else
AC_MSG_RESULT([no])
ENABLE_GENERATE_CLASSLIST="false"
fi
else
AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
fi
AC_SUBST([ENABLE_GENERATE_CLASSLIST])
])

@ -95,6 +95,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_LLVM
LIB_SETUP_BUNDLED_LIBS
LIB_SETUP_MISC_LIBS
LIB_SETUP_SOLARIS_STLPORT
])
################################################################################
@ -189,3 +190,26 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
LIBZIP_CAN_USE_MMAP=true
AC_SUBST(LIBZIP_CAN_USE_MMAP)
])
################################################################################
# libstlport.so.1 is needed for running gtest on Solaris. Find it to
# redistribute it in the test image.
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT],
[
if test "$OPENJDK_TARGET_OS" = "solaris"; then
# Find the root of the Solaris Studio installation from the compiler path
SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
AC_MSG_CHECKING([for libstlport.so.1])
if test -f "$STLPORT_LIB"; then
AC_MSG_RESULT([yes, $STLPORT_LIB])
BASIC_FIXUP_PATH([STLPORT_LIB])
else
AC_MSG_RESULT([no, not found at $STLPORT_LIB])
AC_MSG_ERROR([Failed to find libstlport.so.1, cannot build Hotspot gtests])
fi
AC_SUBST(STLPORT_LIB)
fi
])

@ -366,6 +366,23 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
fi
AC_SUBST(OPENJDK_$1_OS_EXPORT_DIR)
# The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
# Macosx is osx and x86_64 is x64
if test "x$OPENJDK_$1_OS" = xmacosx; then
OPENJDK_$1_OS_BUNDLE="osx"
else
OPENJDK_$1_OS_BUNDLE="$OPENJDK_TARGET_OS"
fi
if test "x$OPENJDK_$1_CPU" = xx86_64; then
OPENJDK_$1_CPU_BUNDLE="x64"
else
OPENJDK_$1_CPU_BUNDLE="$OPENJDK_$1_CPU"
fi
OPENJDK_$1_BUNDLE_PLATFORM="${OPENJDK_$1_OS_BUNDLE}-${OPENJDK_$1_CPU_BUNDLE}"
AC_SUBST(OPENJDK_$1_OS_BUNDLE)
AC_SUBST(OPENJDK_$1_CPU_BUNDLE)
AC_SUBST(OPENJDK_$1_BUNDLE_PLATFORM)
if test "x$OPENJDK_$1_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in

@ -89,6 +89,10 @@ HOTSPOT_TARGET_CPU := @HOTSPOT_TARGET_CPU@
HOTSPOT_TARGET_CPU_ARCH := @HOTSPOT_TARGET_CPU_ARCH@
HOTSPOT_TARGET_CPU_DEFINE := @HOTSPOT_TARGET_CPU_DEFINE@
OPENJDK_TARGET_CPU_BUNDLE:=@OPENJDK_TARGET_CPU_BUNDLE@
OPENJDK_TARGET_OS_BUNDLE:=@OPENJDK_TARGET_OS_BUNDLE@
OPENJDK_TARGET_BUNDLE_PLATFORM:=@OPENJDK_TARGET_BUNDLE_PLATFORM@
# We are building on this build system.
# When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
@ -232,6 +236,9 @@ JVM_FEATURES_custom := @JVM_FEATURES_custom@
VALID_JVM_FEATURES := @VALID_JVM_FEATURES@
VALID_JVM_VARIANTS := @VALID_JVM_VARIANTS@
# Control wether Hotspot builds gtest tests
BUILD_GTEST := @BUILD_GTEST@
# Control use of precompiled header in hotspot libjvm build
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
@ -265,6 +272,7 @@ BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
BUNDLES_OUTPUTDIR=$(BUILD_OUTPUT)/bundles
TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
# This does not get overridden in a bootcycle build
@ -277,6 +285,8 @@ BUILD_HOTSPOT=@BUILD_HOTSPOT@
BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
# it in sync.
BOOT_JDK:=@BOOT_JDK@
@ -629,6 +639,7 @@ ECHO:=@ECHO@
EGREP:=@EGREP@
FGREP:=@FGREP@
GREP:=@GREP@
GZIP:=@GZIP@
HEAD:=@HEAD@
LS:=@LS@
LN:=@LN@
@ -676,6 +687,9 @@ XCODEBUILD=@XCODEBUILD@
DTRACE := @DTRACE@
FIXPATH:=@FIXPATH@
TAR_INCLUDE_PARAM:=@TAR_INCLUDE_PARAM@
TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
# Build setup
ENABLE_JFR=@ENABLE_JFR@
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
@ -685,6 +699,7 @@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
MSVCR_DLL:=@MSVCR_DLL@
MSVCP_DLL:=@MSVCP_DLL@
STLPORT_LIB:=@STLPORT_LIB@
####################################################
#
@ -781,11 +796,46 @@ SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
# Interim image
INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image
# Docs image
DOCS_IMAGE_SUBDIR := docs
DOCS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(DOCS_IMAGE_SUBDIR)
# Macosx bundles directory definitions
JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents
JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents
JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle
JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle
JDK_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR)
JRE_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR)
JDK_MACOSX_CONTENTS_SUBDIR=jdk-$(VERSION_NUMBER).jdk/Contents
JRE_MACOSX_CONTENTS_SUBDIR=jre-$(VERSION_NUMBER).jre/Contents
JDK_MACOSX_CONTENTS_DIR=$(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR)
JRE_MACOSX_CONTENTS_DIR=$(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_CONTENTS_SUBDIR)
# Bundle names
BASE_NAME := $(VERSION_SHORT)+$(VERSION_BUILD)_$(OPENJDK_TARGET_BUNDLE_PLATFORM)
ifeq ($(DEBUG_LEVEL), fastdebug)
DEBUG_PART := -debug
else ifneq ($(DEBUG_LEVEL), release)
DEBUG_PART := -$(DEBUG_LEVEL)
endif
JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
ifeq ($(OPENJDK_TARGET_OS), windows)
DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).zip
else
DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).tar.gz
endif
TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
JRE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
JDK_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
JRE_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DEMOS_BUNDLE_NAME)
TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
DOCS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
# This macro is called to allow inclusion of closed source counterparts.
# Unless overridden in closed sources, it expands to nothing.

@ -274,14 +274,19 @@ compare_file_types() {
$MKDIR -p $WORK_DIR
FILE_TYPES_FILTER="$SED \
-e 's/BuildID[^,]*//' \
-e 's/last modified: .*//' \
"
echo -n File types...
found=""
for f in `cd $OTHER_DIR && $FIND . ! -type d`
do
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
if [ "$OF" != "$TF" ]
then
if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \
@ -320,7 +325,7 @@ compare_general_files() {
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
! -name "finish_installation" ! -name "Sparkle" \
! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
| $GREP -v "./bin/" | $SORT | $FILTER)
echo Other files with binary differences...
@ -423,6 +428,10 @@ compare_zip_file() {
then
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
elif [ "$TYPE" = "gz" ]
then
(cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -)
(cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -)
else
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
@ -526,10 +535,11 @@ compare_all_zip_files() {
OTHER_DIR=$2
WORK_DIR=$3
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER )
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \
| $SORT | $FILTER )
if [ -n "$ZIPS" ]; then
echo Zip files...
echo Zip/tar.gz files...
return_value=0
for f in $ZIPS; do
@ -913,7 +923,7 @@ compare_bin_file() {
FULLDUMP_MSG=" "
DIFF_FULLDUMP=
if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then
FULLDUMP_MSG=" ! "
FULLDUMP_MSG=" ! "
fi
fi
fi

@ -155,6 +155,14 @@ addBuildDir() {
printf "%s\n" "$mn" >> $IDEA_ANT
}
JTREG_HOME=" <property name=\"jtreg.home\" value=\"####\" />"
addJtregHome() {
DIR=`dirname $SPEC`
mn="`echo "$JTREG_HOME" | sed -e s@"\(.*\)####\(.*\)"@"\1$JT_HOME\2"@`"
printf "%s\n" "$mn" >> $IDEA_ANT
}
### Generate ant.xml
rm -f $IDEA_ANT
@ -162,6 +170,8 @@ while IFS= read -r line
do
if echo "$line" | egrep "^ .* <property name=\"module.name\"" > /dev/null ; then
addModuleName
elif echo "$line" | egrep "^ .* <property name=\"jtreg.home\"" > /dev/null ; then
addJtregHome
elif echo "$line" | egrep "^ .* <property name=\"build.target.dir\"" > /dev/null ; then
addBuildDir
else

@ -215,11 +215,11 @@ var getJibProfilesCommon = function (input) {
var common = {};
common.dependencies = ["boot_jdk", "gnumake", "jtreg"],
common.default_make_targets = ["product-images", "test-image"],
common.default_make_targets = ["product-bundles", "test-bundles"],
common.default_make_targets_debug = common.default_make_targets;
common.default_make_targets_slowdebug = common.default_make_targets;
common.configure_args = ["--enable-jtreg-failure-handler"],
common.configure_args_32bit = ["--with-target-bits=32", "--with-jvm-variants=client,server"],
common.configure_args_32bit = ["--with-target-bits=32"],
common.configure_args_debug = ["--enable-debug"],
common.configure_args_slowdebug = ["--with-debug-level=slowdebug"],
common.organization = "jpg.infra.builddeps"
@ -245,7 +245,7 @@ var getJibProfilesProfiles = function (input, common) {
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, "--with-zlib=system"),
default_make_targets: concat(common.default_make_targets, "docs-image")
default_make_targets: concat(common.default_make_targets, "docs-bundles")
},
"linux-x86": {
@ -254,7 +254,7 @@ var getJibProfilesProfiles = function (input, common) {
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, common.configure_args_32bit,
"--with-zlib=system"),
"--with-jvm-variants=minimal,client,server", "--with-zlib=system"),
default_make_targets: common.default_make_targets
},
@ -295,7 +295,8 @@ var getJibProfilesProfiles = function (input, common) {
target_cpu: "x86",
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit", "freetype"),
configure_args: concat(common.configure_args, common.configure_args_32bit),
configure_args: concat(common.configure_args,
"--with-jvm-variants=client,server", common.configure_args_32bit),
default_make_targets: common.default_make_targets
}
};

@ -361,3 +361,5 @@ cc30faa2da498c478e89ab062ff160653ca1b170 jdk-9+113
7dfa7377a5e601b8f740741a9a80e04c72dd04d6 jdk-9+116
7a1b36bf2fe55a9a7732489ccdd326c910329a7e jdk-9+117
8c2c2d17f7ce92a31c9ccb44a122ec62f5a85ace jdk-9+118
daf533920b1266603b5cbdab31908d2a931c5361 jdk-9+119
5943b791e131e79b969d4cea053aecda34801723 jdk-9+120

@ -521,3 +521,5 @@ b64432bae5271735fd53300b2005b713e98ef411 jdk-9+114
61a214186dae6811dd989e9165e42f7dbf02acde jdk-9+116
88170d3642905b9e6cac03e8efcc976885a7e6da jdk-9+117
9b1075cac08dc836ec32e7b368415cbe3aceaf8c jdk-9+118
15f3fe264872766bcb205696198f0c1502420e17 jdk-9+119
0be6f4f5d18671184e62583668cb1d783dffa128 jdk-9+120

@ -36,9 +36,6 @@ endif
################################################################################
GTEST_TEST_SRC_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR)/test/native -name \
"test*.cpp" -type f)
ifeq ($(OPENJDK_TARGET_OS), windows)
GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
else
@ -58,10 +55,12 @@ $(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
TOOLCHAIN := $(JVM_TOOLCHAIN), \
LIBRARY := jvm, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
EXTRA_FILES := $(GTEST_TEST_SRC_FILES) \
$(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc \
$(GTEST_TEST_SRC)/gtestMain.cpp, \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
SRC := $(GTEST_TEST_SRC), \
EXCLUDES := $(JVM_EXCLUDES), \
EXCLUDE_FILES := gtestLauncher.cpp, \
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc, \
EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
$(BUILD_LIBJVM_ALL_OBJS)), \
CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \

@ -4767,6 +4767,7 @@ void MacroAssembler::bis_zeroing(Register to, Register count, Register temp, Lab
assert(UseBlockZeroing && VM_Version::has_block_zeroing(), "only works with BIS zeroing");
Register end = count;
int cache_line_size = VM_Version::prefetch_data_size();
assert(cache_line_size > 0, "cache line size should be known for this code");
// Minimum count when BIS zeroing can be used since
// it needs membar which is expensive.
int block_zero_size = MAX2(cache_line_size*3, (int)BlockZeroingLowLimit);

@ -49,7 +49,7 @@ void VM_Version::initialize() {
AllocatePrefetchDistance = allocate_prefetch_distance();
AllocatePrefetchStyle = allocate_prefetch_style();
if (!has_blk_init()) {
if (!has_blk_init() || cache_line_size <= 0) {
if (AllocatePrefetchInstr == 1) {
warning("BIS instructions required for AllocatePrefetchInstr 1 unavailable");
FLAG_SET_DEFAULT(AllocatePrefetchInstr, 0);
@ -87,7 +87,7 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(InteriorEntryAlignment, 4);
}
if (is_niagara_plus()) {
if (has_blk_init() && UseTLAB &&
if (has_blk_init() && (cache_line_size > 0) && UseTLAB &&
FLAG_IS_DEFAULT(AllocatePrefetchInstr)) {
// Use BIS instruction for TLAB allocation prefetch.
FLAG_SET_DEFAULT(AllocatePrefetchInstr, 1);

@ -756,15 +756,9 @@ extern "C" void* thread_native_entry(void* thread_addr) {
}
}
// If the creator called set priority before we started,
// we need to call set_native_priority now that we have an lwp.
// We used to get the priority from thr_getprio (we called
// thr_setprio way back in create_thread) and pass it to
// set_native_priority, but Solaris scales the priority
// in java_to_os_priority, so when we read it back here,
// we pass trash to set_native_priority instead of what's
// in java_to_os_priority. So we save the native priority
// in the osThread and recall it here.
// Our priority was set when we were created, and stored in the
// osthread, but couldn't be passed through to our LWP until now.
// So read back the priority and set it again.
if (osthr->thread_id() != -1) {
if (UseThreadPriorities) {
@ -1044,6 +1038,10 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
// Remember that we created this thread so we can set priority on it
osthread->set_vm_created();
// Most thread types will set an explicit priority before starting the thread,
// but for those that don't we need a valid value to read back in thread_native_entry.
osthread->set_native_priority(NormPriority);
// Initial thread state is INITIALIZED, not SUSPENDED
osthread->set_state(INITIALIZED);
@ -1357,29 +1355,20 @@ double os::elapsedVTime() {
return (double)gethrvtime() / (double)hrtime_hz;
}
// in-memory timestamp support - has update accuracy of 1ms
typedef void (*_get_nsec_fromepoch_func_t)(hrtime_t*);
static _get_nsec_fromepoch_func_t _get_nsec_fromepoch = NULL;
// Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis
jlong os::javaTimeMillis() {
if (_get_nsec_fromepoch != NULL) {
hrtime_t now;
_get_nsec_fromepoch(&now);
return now / NANOSECS_PER_MILLISEC;
}
else {
timeval t;
if (gettimeofday(&t, NULL) == -1) {
fatal("os::javaTimeMillis: gettimeofday (%s)", os::strerror(errno));
}
return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000;
timeval t;
if (gettimeofday(&t, NULL) == -1) {
fatal("os::javaTimeMillis: gettimeofday (%s)", os::strerror(errno));
}
return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000;
}
// Must return seconds+nanos since Jan 1 1970. This must use the same
// time source as javaTimeMillis and can't use get_nsec_fromepoch as
// we need better than 1ms accuracy
void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) {
timeval t;
// can't use get_nsec_fromepoch here as we need better accuracy than 1ms
if (gettimeofday(&t, NULL) == -1) {
fatal("os::javaTimeSystemUTC: gettimeofday (%s)", os::strerror(errno));
}
@ -4449,9 +4438,6 @@ void os::init(void) {
if (handle != NULL) {
Solaris::_pthread_setname_np = // from 11.3
(Solaris::pthread_setname_np_func_t)dlsym(handle, "pthread_setname_np");
_get_nsec_fromepoch = // from 11.3.6
(_get_nsec_fromepoch_func_t) dlsym(handle, "get_nsec_fromepoch");
}
}

@ -5277,7 +5277,8 @@ bool os::check_heap(bool force) {
}
}
DWORD err = GetLastError();
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED &&
(err == ERROR_INVALID_FUNCTION && phe.lpData != NULL)) {
HeapUnlock(heap);
fatal("heap walk aborted with error %d", err);
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2016, 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
@ -361,14 +361,14 @@ int ciBytecodeStream::get_method_index() {
ciMethod* ciBytecodeStream::get_method(bool& will_link, ciSignature* *declared_signature_result) {
VM_ENTRY_MARK;
ciEnv* env = CURRENT_ENV;
constantPoolHandle cpool(_method->get_Method()->constants());
constantPoolHandle cpool(THREAD, _method->get_Method()->constants());
ciMethod* m = env->get_method_by_index(cpool, get_method_index(), cur_bc(), _holder);
will_link = m->is_loaded();
// Use the MethodType stored in the CP cache to create a signature
// with correct types (in respect to class loaders).
if (has_method_type()) {
ciSymbol* sig_sym = env->get_symbol(cpool->symbol_at(get_method_signature_index()));
ciSymbol* sig_sym = env->get_symbol(cpool->symbol_at(get_method_signature_index(cpool)));
ciKlass* pool_holder = env->get_klass(cpool->pool_holder());
ciMethodType* method_type = get_method_type();
ciSignature* declared_signature = new (env->arena()) ciSignature(pool_holder, sig_sym, method_type);
@ -465,9 +465,8 @@ int ciBytecodeStream::get_method_holder_index() {
// Get the constant pool index of the signature of the method
// referenced by the current bytecode. Used for generating
// deoptimization information.
int ciBytecodeStream::get_method_signature_index() {
int ciBytecodeStream::get_method_signature_index(const constantPoolHandle& cpool) {
GUARDED_VM_ENTRY(
ConstantPool* cpool = _holder->get_instanceKlass()->constants();
const int method_index = get_method_index();
const int name_and_type_index = cpool->name_and_type_ref_index_at(method_index);
return cpool->signature_ref_index_at(name_and_type_index);

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2016, 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
@ -264,7 +264,7 @@ public:
ciMethodType* get_method_type();
ciKlass* get_declared_method_holder();
int get_method_holder_index();
int get_method_signature_index();
int get_method_signature_index(const constantPoolHandle& cpool);
// Get the resolved references arrays from the constant pool
ciObjArray* get_resolved_references();

@ -5704,8 +5704,10 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
#if INCLUDE_CDS
if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
// Only dump the classes that can be stored into CDS archive
if (SystemDictionaryShared::is_sharing_possible(_loader_data)) {
// Only dump the classes that can be stored into CDS archive.
// Anonymous classes such as generated LambdaForm classes are also not included.
if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
_host_klass == NULL) {
ResourceMark rm(THREAD);
classlist_file->print_cr("%s", _class_name->as_C_string());
classlist_file->flush();

@ -382,6 +382,10 @@ void ClassLoaderData::unload() {
}
log->cr();
}
// In some rare cases items added to this list will not be freed elsewhere.
// To keep it simple, just free everything in it here.
free_deallocate_list();
}
PackageEntryTable* ClassLoaderData::packages() {

@ -38,6 +38,7 @@
CompactHashtableWriter::CompactHashtableWriter(int num_buckets,
CompactHashtableStats* stats) {
assert(DumpSharedSpaces, "dump-time only");
assert(num_buckets > 0, "no buckets");
_num_buckets = num_buckets;
_num_entries = 0;
_buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol);

@ -740,7 +740,8 @@ void StringTable::serialize(SerializeClosure* soc, GrowableArray<MemRegion> *str
} else {
int num_buckets = the_table()->number_of_entries() /
SharedSymbolTableBucketSize;
CompactStringTableWriter writer(num_buckets,
// calculation of num_buckets can result in zero buckets, we need at least one
CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
&MetaspaceShared::stats()->string);
// Copy the interned strings into the "string space" within the java heap

@ -420,9 +420,9 @@ public:
// Initialization
static void initialize(TRAPS);
// Fast access to commonly used classes (preloaded)
// Checked fast access to commonly used classes - mostly preloaded
static InstanceKlass* check_klass(InstanceKlass* k) {
assert(k != NULL, "preloaded klass not initialized");
assert(k != NULL, "klass not loaded");
return k;
}

@ -545,6 +545,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
}
assert((_conc_workers != NULL) == (ConcGCThreads > 1),
"Inconsistency");
log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
// Parallel task queues; these are shared for the
// concurrent and stop-world phases of CMS, but
@ -6094,19 +6096,23 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m(
size = CompactibleFreeListSpace::adjustObjectSize(
p->oop_iterate_size(_scanningClosure));
}
#ifdef ASSERT
size_t direct_size =
CompactibleFreeListSpace::adjustObjectSize(p->size());
assert(size == direct_size, "Inconsistency in size");
assert(size >= 3, "Necessary for Printezis marks to work");
if (!_bitMap->isMarked(addr+1)) {
_bitMap->verifyNoOneBitsInRange(addr+2, addr+size);
} else {
_bitMap->verifyNoOneBitsInRange(addr+2, addr+size-1);
assert(_bitMap->isMarked(addr+size-1),
"inconsistent Printezis mark");
}
#endif // ASSERT
#ifdef ASSERT
size_t direct_size =
CompactibleFreeListSpace::adjustObjectSize(p->size());
assert(size == direct_size, "Inconsistency in size");
assert(size >= 3, "Necessary for Printezis marks to work");
HeapWord* start_pbit = addr + 1;
HeapWord* end_pbit = addr + size - 1;
assert(_bitMap->isMarked(start_pbit) == _bitMap->isMarked(end_pbit),
"inconsistent Printezis mark");
// Verify inner mark bits (between Printezis bits) are clear,
// but don't repeat if there are multiple dirty regions for
// the same object, to avoid potential O(N^2) performance.
if (addr != _last_scanned_object) {
_bitMap->verifyNoOneBitsInRange(start_pbit + 1, end_pbit);
_last_scanned_object = addr;
}
#endif // ASSERT
} else {
// An uninitialized object.
assert(_bitMap->isMarked(addr+1), "missing Printezis mark?");

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2016, 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
@ -1501,6 +1501,7 @@ class ScanMarkedObjectsAgainCarefullyClosure: public ObjectClosureCareful {
CMSBitMap* _bitMap;
CMSMarkStack* _markStack;
MarkRefsIntoAndScanClosure* _scanningClosure;
DEBUG_ONLY(HeapWord* _last_scanned_object;)
public:
ScanMarkedObjectsAgainCarefullyClosure(CMSCollector* collector,
@ -1514,8 +1515,9 @@ class ScanMarkedObjectsAgainCarefullyClosure: public ObjectClosureCareful {
_yield(should_yield),
_bitMap(bitMap),
_markStack(markStack),
_scanningClosure(cl) {
}
_scanningClosure(cl)
DEBUG_ONLY(COMMA _last_scanned_object(NULL))
{ }
void do_object(oop p) {
guarantee(false, "call do_object_careful instead");

@ -438,6 +438,8 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper*
}
assert(ConcGCThreads > 0, "Should have been set");
log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
_parallel_marking_threads = ConcGCThreads;
_max_parallel_marking_threads = _parallel_marking_threads;

@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc/g1/g1HeapSizingPolicy.hpp"
#include "memory/allocation.inline.hpp"
G1HeapSizingPolicy* G1HeapSizingPolicy::create(const G1CollectedHeap* g1, const G1Analytics* analytics) {
return new G1HeapSizingPolicy(g1, analytics);

@ -56,7 +56,7 @@ G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults), _adaptive_size(
MAX2((uint) (MaxNewSize / HeapRegion::GrainBytes),
1U);
_sizer_kind = SizerMaxAndNewSize;
_adaptive_size = _min_desired_young_length == _max_desired_young_length;
_adaptive_size = _min_desired_young_length != _max_desired_young_length;
} else {
_sizer_kind = SizerNewSizeOnly;
}

@ -75,7 +75,11 @@ private:
SizerKind _sizer_kind;
uint _min_desired_young_length;
uint _max_desired_young_length;
// False when using a fixed young generation size due to command-line options,
// true otherwise.
bool _adaptive_size;
uint calculate_default_min_length(uint new_number_of_heap_regions);
uint calculate_default_max_length(uint new_number_of_heap_regions);

@ -394,13 +394,6 @@ void ParallelCompact_test() {
HeapWord* end_heap =
(HeapWord*) heap->young_gen()->virtual_space()->high_boundary();
size_t end_index =
PSParallelCompact::summary_data().addr_to_region_idx(end_heap);
ParallelCompactData::RegionData* c = PSParallelCompact::summary_data().region(end_index);
// Initialize the end region with a bad destination.
c->set_destination(begin_heap - 1);
print_generic_summary_data(PSParallelCompact::summary_data(),
begin_heap, end_heap);
}

@ -216,8 +216,10 @@ void ThreadLocalAllocBuffer::startup_initialization() {
_global_stats = new GlobalTLABStats();
// Need extra space at the end of TLAB, otherwise prefetching
// instructions will fault (due to accessing memory outside of heap).
#ifdef COMPILER2
// If the C2 compiler is present, extra space is needed at the end of
// TLABs, otherwise prefetching instructions generated by the C2
// compiler will fault (due to accessing memory outside of heap).
// The amount of space is the max of the number of lines to
// prefetch for array and for instance allocations. (Extra space must be
// reserved to accommodate both types of allocations.)
@ -227,11 +229,14 @@ void ThreadLocalAllocBuffer::startup_initialization() {
// AllocatePrefetchInstr==1). To be on the safe side, however,
// extra space is reserved for all combinations of
// AllocatePrefetchStyle and AllocatePrefetchInstr.
//
// If the C2 compiler is not present, no space is reserved.
// +1 for rounding up to next cache line, +1 to be safe
int lines = MAX2(AllocatePrefetchLines, AllocateInstancePrefetchLines) + 2;
_reserve_for_allocation_prefetch = (AllocatePrefetchDistance + AllocatePrefetchStepSize * lines) /
(int)HeapWordSize;
#endif
// During jvm startup, the main (primordial) thread is initialized
// before the heap is initialized. So reinitialize it now.

@ -578,11 +578,6 @@ void Test_logconfiguration_subscribe() {
LogConfiguration::disable_logging();
assert(Test_logconfiguration_subscribe_triggered == 3, "subscription not triggered (3)");
// We need to renable stderr error logging since "disable_logging" disable it all.
// TestLogSavedConfig log_cfg will only renable stdout for us.
LogConfiguration::parse_log_arguments("stderr", "all=warning", NULL, NULL, log.error_stream());
assert(Test_logconfiguration_subscribe_triggered == 4, "subscription not triggered (3)");
}
#define LOG_PREFIX_STR "THE_PREFIX "

@ -54,7 +54,7 @@ class LogStdoutOutput : public LogFileStreamOutput {
private:
static LogStdoutOutput _instance;
LogStdoutOutput() : LogFileStreamOutput(stdout) {
set_config_string("all=off");
set_config_string("all=warning");
}
virtual bool initialize(const char* options, outputStream* errstream) {
return false;
@ -70,7 +70,7 @@ class LogStderrOutput : public LogFileStreamOutput {
private:
static LogStderrOutput _instance;
LogStderrOutput() : LogFileStreamOutput(stderr) {
set_config_string("all=warning");
set_config_string("all=off");
}
virtual bool initialize(const char* options, outputStream* errstream) {
return false;

@ -50,7 +50,7 @@ LogTagSet::LogTagSet(PrefixWriter prefix_writer, LogTagType t0, LogTagType t1, L
_ntagsets++;
// Set the default output to warning and error level for all new tagsets.
_output_list.set_output_level(LogOutput::Stderr, LogLevel::Default);
_output_list.set_output_level(LogOutput::Stdout, LogLevel::Default);
}
void LogTagSet::update_decorators(const LogDecorators& decorator) {

@ -43,11 +43,11 @@
// for the x64 platform
#define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(10*M))
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M))
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
// the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on
// the sizes required for dumping the archive using the default classlist. The sizes

@ -190,6 +190,7 @@ class InstanceKlass: public Klass {
// _is_marked_dependent can be set concurrently, thus cannot be part of the
// _misc_flags.
bool _is_marked_dependent; // used for marking during flushing and deoptimization
bool _is_being_redefined; // used for locking redefinition
// The low two bits of _misc_flags contains the kind field.
// This can be used to quickly discriminate among the four kinds of
@ -694,6 +695,10 @@ class InstanceKlass: public Klass {
}
#if INCLUDE_JVMTI
// Redefinition locking. Class can only be redefined by one thread at a time.
bool is_being_redefined() const { return _is_being_redefined; }
void set_is_being_redefined(bool value) { _is_being_redefined = value; }
// RedefineClasses() support for previous versions:
void add_previous_version(instanceKlassHandle ikh, int emcp_method_count);

@ -309,10 +309,11 @@ protected:
_lh_header_size_mask = right_n_bits(BitsPerByte), // shifted mask
_lh_array_tag_bits = 2,
_lh_array_tag_shift = BitsPerInt - _lh_array_tag_bits,
_lh_array_tag_type_value = ~0x00, // 0xC0000000 >> 30
_lh_array_tag_obj_value = ~0x01 // 0x80000000 >> 30
};
static const unsigned int _lh_array_tag_type_value = 0Xffffffff; // ~0x00, // 0xC0000000 >> 30
static int layout_helper_size_in_bytes(jint lh) {
assert(lh > (jint)_lh_neutral_value, "must be instance");
return (int) lh & ~_lh_instance_slow_path_bit;

@ -3740,7 +3740,7 @@ Node* LibraryCallKit::generate_array_guard_common(Node* kls, RegionNode* region,
}
// Now test the correct condition.
jint nval = (obj_array
? ((jint)Klass::_lh_array_tag_type_value
? (jint)(Klass::_lh_array_tag_type_value
<< Klass::_lh_array_tag_shift)
: Klass::_lh_neutral_value);
Node* cmp = _gvn.transform(new CmpINode(layout_val, intcon(nval)));

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2016, 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
@ -235,7 +235,6 @@ address PhaseMacroExpand::basictype2arraycopy(BasicType t,
return StubRoutines::select_arraycopy_function(t, aligned, disjoint, name, dest_uninitialized);
}
#define COMMA ,
#define XTOP LP64_ONLY(COMMA top())
// Generate an optimized call to arraycopy.

@ -163,8 +163,6 @@ extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
#define FP_SELECT(TypeName, intcode, fpcode) \
FP_SELECT_##TypeName(intcode, fpcode)
#define COMMA ,
// Choose DT_RETURN_MARK macros based on the type: float/double -> void
// (dtrace doesn't do FP yet)
#define DT_RETURN_MARK_DECL_FOR(TypeName, name, type, probe) \

@ -69,6 +69,43 @@ VM_RedefineClasses::VM_RedefineClasses(jint class_count,
_res = JVMTI_ERROR_NONE;
}
static inline InstanceKlass* get_ik(jclass def) {
oop mirror = JNIHandles::resolve_non_null(def);
return InstanceKlass::cast(java_lang_Class::as_Klass(mirror));
}
// If any of the classes are being redefined, wait
// Parallel constant pool merging leads to indeterminate constant pools.
void VM_RedefineClasses::lock_classes() {
MutexLocker ml(RedefineClasses_lock);
bool has_redefined;
do {
has_redefined = false;
// Go through classes each time until none are being redefined.
for (int i = 0; i < _class_count; i++) {
if (get_ik(_class_defs[i].klass)->is_being_redefined()) {
RedefineClasses_lock->wait();
has_redefined = true;
break; // for loop
}
}
} while (has_redefined);
for (int i = 0; i < _class_count; i++) {
get_ik(_class_defs[i].klass)->set_is_being_redefined(true);
}
RedefineClasses_lock->notify_all();
}
void VM_RedefineClasses::unlock_classes() {
MutexLocker ml(RedefineClasses_lock);
for (int i = 0; i < _class_count; i++) {
assert(get_ik(_class_defs[i].klass)->is_being_redefined(),
"should be being redefined to get here");
get_ik(_class_defs[i].klass)->set_is_being_redefined(false);
}
RedefineClasses_lock->notify_all();
}
bool VM_RedefineClasses::doit_prologue() {
if (_class_count == 0) {
_res = JVMTI_ERROR_NONE;
@ -91,6 +128,14 @@ bool VM_RedefineClasses::doit_prologue() {
_res = JVMTI_ERROR_NULL_POINTER;
return false;
}
oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
// classes for primitives and arrays cannot be redefined
// check here so following code can assume these classes are InstanceKlass
if (!is_modifiable_class(mirror)) {
_res = JVMTI_ERROR_UNMODIFIABLE_CLASS;
return false;
}
}
// Start timer after all the sanity checks; not quite accurate, but
@ -99,6 +144,7 @@ bool VM_RedefineClasses::doit_prologue() {
_timer_vm_op_prologue.start();
}
lock_classes();
// We first load new class versions in the prologue, because somewhere down the
// call chain it is required that the current thread is a Java thread.
_res = load_new_class_versions(Thread::current());
@ -115,6 +161,7 @@ bool VM_RedefineClasses::doit_prologue() {
// Free os::malloc allocated memory in load_new_class_version.
os::free(_scratch_classes);
_timer_vm_op_prologue.stop();
unlock_classes();
return false;
}
@ -174,6 +221,8 @@ void VM_RedefineClasses::doit() {
}
void VM_RedefineClasses::doit_epilogue() {
unlock_classes();
// Free os::malloc allocated memory.
os::free(_scratch_classes);
@ -959,14 +1008,7 @@ jvmtiError VM_RedefineClasses::load_new_class_versions(TRAPS) {
// versions are deleted. Constant pools are deallocated while merging
// constant pools
HandleMark hm(THREAD);
oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
// classes for primitives cannot be redefined
if (!is_modifiable_class(mirror)) {
return JVMTI_ERROR_UNMODIFIABLE_CLASS;
}
Klass* the_class_oop = java_lang_Class::as_Klass(mirror);
instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
instanceKlassHandle the_class(THREAD, get_ik(_class_defs[i].klass));
Symbol* the_class_sym = the_class->name();
log_debug(redefine, class, load)
@ -3757,22 +3799,19 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass,
_timer_rsc_phase1.start();
}
instanceKlassHandle scratch_class(scratch_class_oop);
oop the_class_mirror = JNIHandles::resolve_non_null(the_jclass);
Klass* the_class_oop = java_lang_Class::as_Klass(the_class_mirror);
instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
instanceKlassHandle scratch_class(THREAD, scratch_class_oop);
instanceKlassHandle the_class(THREAD, get_ik(the_jclass));
// Remove all breakpoints in methods of this class
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
jvmti_breakpoints.clearall_in_class_at_safepoint(the_class_oop);
jvmti_breakpoints.clearall_in_class_at_safepoint(the_class());
// Deoptimize all compiled code that depends on this class
flush_dependent_code(the_class, THREAD);
_old_methods = the_class->methods();
_new_methods = scratch_class->methods();
_the_class_oop = the_class_oop;
_the_class_oop = the_class();
compute_added_deleted_matching_methods();
update_jmethod_ids();
@ -4002,10 +4041,10 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass,
increment_class_counter((InstanceKlass *)the_class(), THREAD);
log_info(redefine, class, load)
("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
the_class->external_name(), java_lang_Class::classRedefinedCount(the_class_mirror), os::available_memory() >> 10);
the_class->external_name(), java_lang_Class::classRedefinedCount(the_class->java_mirror()), os::available_memory() >> 10);
Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
the_class->external_name(),
java_lang_Class::classRedefinedCount(the_class_mirror));
java_lang_Class::classRedefinedCount(the_class->java_mirror()));
}
_timer_rsc_phase2.stop();

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2016, 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
@ -489,6 +489,10 @@ class VM_RedefineClasses: public VM_Operation {
void flush_dependent_code(instanceKlassHandle k_h, TRAPS);
// lock classes to redefine since constant pool merging isn't thread safe.
void lock_classes();
void unlock_classes();
static void dump_methods();
// Check that there are no old or obsolete methods

@ -1641,7 +1641,6 @@ void Arguments::set_cms_and_parnew_gc_flags() {
}
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
}
#endif // INCLUDE_ALL_GCS
@ -1949,7 +1948,6 @@ void Arguments::set_g1_gc_flags() {
}
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
}
void Arguments::set_gc_specific_flags() {

@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/mutex.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/osThread.hpp"

@ -120,6 +120,7 @@ Monitor* GCTaskManager_lock = NULL;
Mutex* Management_lock = NULL;
Monitor* Service_lock = NULL;
Monitor* PeriodicTask_lock = NULL;
Monitor* RedefineClasses_lock = NULL;
#ifdef INCLUDE_TRACE
Mutex* JfrStacktrace_lock = NULL;
@ -264,6 +265,7 @@ void mutex_init() {
def(Debug3_lock , Mutex , nonleaf+4, true, Monitor::_safepoint_check_never);
def(CompileThread_lock , Monitor, nonleaf+5, false, Monitor::_safepoint_check_always);
def(PeriodicTask_lock , Monitor, nonleaf+5, true, Monitor::_safepoint_check_sometimes);
def(RedefineClasses_lock , Monitor, nonleaf+5, true, Monitor::_safepoint_check_always);
if (WhiteBoxAPI) {
def(Compilation_lock , Monitor, leaf, false, Monitor::_safepoint_check_never);
}

@ -121,6 +121,7 @@ extern Mutex* MMUTracker_lock; // protects the MMU
extern Mutex* Management_lock; // a lock used to serialize JVM management
extern Monitor* Service_lock; // a lock used for service thread operation
extern Monitor* PeriodicTask_lock; // protects the periodic task structure
extern Monitor* RedefineClasses_lock; // locks classes from parallel redefinition
#ifdef INCLUDE_TRACE
extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -201,10 +201,12 @@ void VM_Verify::doit() {
}
bool VM_PrintThreads::doit_prologue() {
assert(Thread::current()->is_Java_thread(), "just checking");
// Make sure AbstractOwnableSynchronizer is loaded
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
JavaThread* jt = JavaThread::current();
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
if (jt->has_pending_exception()) {
return false;
}
// Get Heap_lock if concurrent locks will be dumped
if (_print_concurrent_locks) {
@ -240,11 +242,13 @@ VM_FindDeadlocks::~VM_FindDeadlocks() {
}
bool VM_FindDeadlocks::doit_prologue() {
assert(Thread::current()->is_Java_thread(), "just checking");
// Load AbstractOwnableSynchronizer class
if (_concurrent_locks) {
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
// Make sure AbstractOwnableSynchronizer is loaded
JavaThread* jt = JavaThread::current();
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
if (jt->has_pending_exception()) {
return false;
}
}
return true;
@ -298,10 +302,12 @@ VM_ThreadDump::VM_ThreadDump(ThreadDumpResult* result,
}
bool VM_ThreadDump::doit_prologue() {
assert(Thread::current()->is_Java_thread(), "just checking");
// Load AbstractOwnableSynchronizer class before taking thread snapshots
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
// Make sure AbstractOwnableSynchronizer is loaded
JavaThread* jt = JavaThread::current();
java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
if (jt->has_pending_exception()) {
return false;
}
if (_with_locked_synchronizers) {
// Acquire Heap_lock to dump concurrent locks

@ -34,6 +34,9 @@
// Makes a string of the macro expansion of a
#define XSTR(a) STR(a)
// Allow commas in macro arguments.
#define COMMA ,
// Apply pre-processor token pasting to the expansions of x and y.
// The token pasting operator (##) prevents its arguments from being
// expanded. This macro allows expansion of its arguments before the

@ -306,7 +306,10 @@ ifdef TESTDIRS
endif
ifdef CONCURRENCY
EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
endif
ifdef EXTRA_JTREG_OPTIONS
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
endif
# Default JTREG to run
@ -326,8 +329,6 @@ JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
# Multiply by 4 the timeout factor
JTREG_TIMEOUT_OPTION = -timeoutFactor:4
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
# Add any extra options
JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Set other vm and test options
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)

@ -25,9 +25,9 @@
* @test Test2GbHeap
* @bug 8031686
* @summary Regression test to ensure we can start G1 with 2gb heap.
* Skip test on 32 bit Windows: it typically does not support the many and large virtual memory reservations needed.
* Skip test on 32 bit system: it typically does not support the many and large virtual memory reservations needed.
* @requires (vm.gc == "G1" | vm.gc == "null")
* @requires !((sun.arch.data.model == "32") & (os.family == "windows"))
* @requires vm.bits != "32"
* @key gc
* @key regression
* @library /testlibrary

@ -25,7 +25,6 @@
* @test TestShrinkAuxiliaryData00
* @bug 8038423 8061715
* @summary Checks that decommitment occurs for JVM with different
* @ignore 8155957
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
@ -36,7 +35,7 @@
* TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData00
* @run main/timeout=720 TestShrinkAuxiliaryData00
*/
public class TestShrinkAuxiliaryData00 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData05
* @run main/timeout=720 TestShrinkAuxiliaryData05
*/
public class TestShrinkAuxiliaryData05 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData10
* @run main/timeout=720 TestShrinkAuxiliaryData10
*/
public class TestShrinkAuxiliaryData10 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData15
* @run main/timeout=720 TestShrinkAuxiliaryData15
*/
public class TestShrinkAuxiliaryData15 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData20
* @run main/timeout=720 TestShrinkAuxiliaryData20
*/
public class TestShrinkAuxiliaryData20 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData25
* @run main/timeout=720 TestShrinkAuxiliaryData25
*/
public class TestShrinkAuxiliaryData25 {

@ -26,7 +26,6 @@
* @bug 8038423 8061715 8078405
* @summary Checks that decommitment occurs for JVM with different
* G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
* @ignore 8155957
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.AggressiveOpts=="false" | vm.opt.AggressiveOpts=="null"
* @library /testlibrary /test/lib
@ -36,7 +35,7 @@
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run driver/timeout=720 TestShrinkAuxiliaryData30
* @run main/timeout=720 TestShrinkAuxiliaryData30
*/
public class TestShrinkAuxiliaryData30 {

@ -0,0 +1,85 @@
/*
* Copyright (c) 2016, 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.
*
*/
/* @test
* @summary a jtreg wrapper for gtest tests
* @library /test/lib/share/classes
* @modules java.base/jdk.internal.misc
* @run main/native GTestWrapper
*/
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import java.util.stream.Collectors;
import java.nio.file.Paths;
import java.nio.file.Path;
import jdk.test.lib.Platform;
import jdk.test.lib.Utils;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
public class GTestWrapper {
public static void main(String[] args) throws Throwable {
// gtestLauncher is located in <test_image>/hotspot/gtest/<vm_variant>/
// nativePath points either to <test_image>/hotspot/jtreg/native or to <test_image>/hotspot/gtest
Path nativePath = Paths.get(System.getProperty("test.nativepath"));
String jvmVariantDir = getJVMVariantSubDir();
// let's assume it's <test_image>/hotspot/gtest
Path path = nativePath.resolve(jvmVariantDir);
if (!path.toFile().exists()) {
// maybe it is <test_image>/hotspot/jtreg/native
path = nativePath.getParent()
.getParent()
.resolve("gtest")
.resolve(jvmVariantDir);
}
if (!path.toFile().exists()) {
throw new Error("TESTBUG: the library has not been found in " + nativePath);
}
path = path.resolve("gtestLauncher" + (Platform.isWindows() ? ".exe" : ""));
Stream<String> launcherArgs = Stream.of(path.toString(), "-jdk",
System.getProperty("test.jdk"));
// JVM accepts only -X and -D flags
Stream<String> vmFLags = Arrays.stream(Utils.getTestJavaOpts())
.filter(s -> s.startsWith("-X") || s.startsWith("-D"));
String[] cmds = Stream.concat(launcherArgs, vmFLags)
.toArray(String[]::new);
ProcessTools.executeCommand(cmds).shouldHaveExitValue(0);
}
private static String getJVMVariantSubDir() {
if (Platform.isServer()) {
return "server";
} else if (Platform.isClient()) {
return "client";
} else if (Platform.isMinimal()) {
return "minimal";
} else {
throw new Error("TESTBUG: unsuppported vm variant");
}
}
}

@ -89,14 +89,6 @@ public class TestOptionsWithRanges {
*/
excludeTestMaxRange("CICompilerCount");
/*
* JDK-8156679
* Temporarily exclude from range testing as the range is not
* valid for all platforms
*/
excludeTestRange("AllocatePrefetchLines");
excludeTestRange("AllocateInstancePrefetchLines");
/*
* JDK-8136766
* Temporarily remove ThreadStackSize from testing because Windows can set it to 0

@ -103,7 +103,7 @@ public class CheckRead {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -103,7 +103,7 @@ public class DiffCL_CheckRead {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -105,7 +105,7 @@ public class DiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class DiffCL_ExpQualToM1 {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -92,7 +92,7 @@ public class DiffCL_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class DiffCL_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -92,7 +92,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@ -141,7 +141,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@ -190,7 +190,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();

@ -87,7 +87,7 @@ public class DiffCL_UmodUpkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@ -136,7 +136,7 @@ public class DiffCL_UmodUpkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();

@ -105,7 +105,7 @@ public class ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -81,7 +81,7 @@ public class ExpQualToM1 {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -81,7 +81,7 @@ public class ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -93,7 +93,7 @@ public class ExportAllUnnamed {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -92,7 +92,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map module m1 to class loader.
// class c2 will be loaded in an unnamed module/loader.
@ -138,7 +138,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.
@ -184,7 +184,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.

@ -92,7 +92,7 @@ public class UmodDiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -92,7 +92,7 @@ public class UmodDiffCL_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class UmodDiffCL_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -87,7 +87,7 @@ public class UmodUPkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map module m1 to class loader.
// class c4 will be loaded in an unnamed module/loader.
@ -133,7 +133,7 @@ public class UmodUPkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.

@ -92,7 +92,7 @@ public class UmodUpkgDiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class UmodUpkgDiffCL_NotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -101,7 +101,7 @@ public class UmodUpkg_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -89,7 +89,7 @@ public class UmodUpkg_NotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -101,7 +101,7 @@ public class Umod_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -91,7 +91,7 @@ public class Umod_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -89,7 +89,7 @@ public class Umod_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
.resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map<String, ClassLoader> map = new HashMap<>();

@ -0,0 +1,43 @@
/*
* Copyright (c) 2016, 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.
*/
/*
* @test TestDefaultLogOutput
* @summary Ensure logging is default on stdout.
* @modules java.base/jdk.internal.misc
* @library /testlibrary
*/
import jdk.test.lib.ProcessTools;
import jdk.test.lib.OutputAnalyzer;
public class TestDefaultLogOutput {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:badTag");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.stdoutShouldMatch("\\[error *\\]\\[logging *\\]");
output.shouldHaveExitValue(1);
}
}

@ -1,264 +0,0 @@
/*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.hotspot;
import java.lang.reflect.Executable;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;
import java.security.BasicPermission;
import sun.hotspot.parser.DiagnosticCommand;
public class WhiteBox {
@SuppressWarnings("serial")
public static class WhiteBoxPermission extends BasicPermission {
public WhiteBoxPermission(String s) {
super(s);
}
}
private WhiteBox() {}
private static final WhiteBox instance = new WhiteBox();
private static native void registerNatives();
/**
* Returns the singleton WhiteBox instance.
*
* The returned WhiteBox object should be carefully guarded
* by the caller, since it can be used to read and write data
* at arbitrary memory addresses. It must never be passed to
* untrusted code.
*/
public synchronized static WhiteBox getWhiteBox() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new WhiteBoxPermission("getInstance"));
}
return instance;
}
static {
registerNatives();
}
// Get the maximum heap size supporting COOPs
public native long getCompressedOopsMaxHeapSize();
// Arguments
public native void printHeapSizes();
// Memory
public native long getObjectAddress(Object o);
public native int getHeapOopSize();
public native int getVMPageSize();
public native boolean isObjectInOldGen(Object o);
public native long getObjectSize(Object o);
// Runtime
// Make sure class name is in the correct format
public boolean isClassAlive(String name) {
return isClassAlive0(name.replace('.', '/'));
}
private native boolean isClassAlive0(String name);
// JVMTI
public native void addToBootstrapClassLoaderSearch(String segment);
public native void addToSystemClassLoaderSearch(String segment);
// G1
public native boolean g1InConcurrentMark();
public native boolean g1IsHumongous(Object o);
public native long g1NumFreeRegions();
public native int g1RegionSize();
public native Object[] parseCommandLine(String commandline, char delim, DiagnosticCommand[] args);
// NMT
public native long NMTMalloc(long size);
public native void NMTFree(long mem);
public native long NMTReserveMemory(long size);
public native void NMTCommitMemory(long addr, long size);
public native void NMTUncommitMemory(long addr, long size);
public native void NMTReleaseMemory(long addr, long size);
public native long NMTMallocWithPseudoStack(long size, int index);
public native boolean NMTIsDetailSupported();
public native boolean NMTChangeTrackingLevel();
public native int NMTGetHashSize();
// Compiler
public native void deoptimizeAll();
public boolean isMethodCompiled(Executable method) {
return isMethodCompiled(method, false /*not osr*/);
}
public native boolean isMethodCompiled(Executable method, boolean isOsr);
public boolean isMethodCompilable(Executable method) {
return isMethodCompilable(method, -1 /*any*/);
}
public boolean isMethodCompilable(Executable method, int compLevel) {
return isMethodCompilable(method, compLevel, false /*not osr*/);
}
public native boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr);
public native boolean isMethodQueuedForCompilation(Executable method);
public int deoptimizeMethod(Executable method) {
return deoptimizeMethod(method, false /*not osr*/);
}
public native int deoptimizeMethod(Executable method, boolean isOsr);
public void makeMethodNotCompilable(Executable method) {
makeMethodNotCompilable(method, -1 /*any*/);
}
public void makeMethodNotCompilable(Executable method, int compLevel) {
makeMethodNotCompilable(method, compLevel, false /*not osr*/);
}
public native void makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
public int getMethodCompilationLevel(Executable method) {
return getMethodCompilationLevel(method, false /*not ost*/);
}
public native int getMethodCompilationLevel(Executable method, boolean isOsr);
public native boolean testSetDontInlineMethod(Executable method, boolean value);
public int getCompileQueuesSize() {
return getCompileQueueSize(-1 /*any*/);
}
public native int getCompileQueueSize(int compLevel);
public native boolean testSetForceInlineMethod(Executable method, boolean value);
public boolean enqueueMethodForCompilation(Executable method, int compLevel) {
return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
}
public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);
public native void clearMethodState(Executable method);
public native void lockCompilation();
public native void unlockCompilation();
public native int getMethodEntryBci(Executable method);
public native Object[] getNMethod(Executable method, boolean isOsr);
public native long allocateCodeBlob(int size, int type);
public long allocateCodeBlob(long size, int type) {
int intSize = (int) size;
if ((long) intSize != size || size < 0) {
throw new IllegalArgumentException(
"size argument has illegal value " + size);
}
return allocateCodeBlob( intSize, type);
}
public native void freeCodeBlob(long addr);
public void forceNMethodSweep() {
try {
forceNMethodSweep0().join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
public native Thread forceNMethodSweep0();
public native Object[] getCodeHeapEntries(int type);
public native int getCompilationActivityMode();
public native Object[] getCodeBlob(long addr);
// Intered strings
public native boolean isInStringTable(String str);
// Memory
public native void readReservedMemory();
public native long allocateMetaspace(ClassLoader classLoader, long size);
public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
public native long incMetaspaceCapacityUntilGC(long increment);
public native long metaspaceCapacityUntilGC();
// Force Young GC
public native void youngGC();
// Force Full GC
public native void fullGC();
// Method tries to start concurrent mark cycle.
// It returns false if CM Thread is always in concurrent cycle.
public native boolean g1StartConcMarkCycle();
// Tests on ReservedSpace/VirtualSpace classes
public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
public native void runMemoryUnitTests();
public native void readFromNoaccessArea();
public native long getThreadStackSize();
public native long getThreadRemainingStackSize();
// CPU features
public native String getCPUFeatures();
// Native extensions
public native long getHeapUsageForContext(int context);
public native long getHeapRegionCountForContext(int context);
public native int getContextForObject(Object obj);
public native void printRegionInfo(int context);
// VM flags
public native boolean isConstantVMFlag(String name);
public native boolean isLockedVMFlag(String name);
public native void setBooleanVMFlag(String name, boolean value);
public native void setIntxVMFlag(String name, long value);
public native void setUintxVMFlag(String name, long value);
public native void setUint64VMFlag(String name, long value);
public native void setSizeTVMFlag(String name, long value);
public native void setStringVMFlag(String name, String value);
public native void setDoubleVMFlag(String name, double value);
public native Boolean getBooleanVMFlag(String name);
public native Long getIntxVMFlag(String name);
public native Long getUintxVMFlag(String name);
public native Long getUint64VMFlag(String name);
public native Long getSizeTVMFlag(String name);
public native String getStringVMFlag(String name);
public native Double getDoubleVMFlag(String name);
private final List<Function<String,Object>> flagsGetters = Arrays.asList(
this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag,
this::getUint64VMFlag, this::getSizeTVMFlag, this::getStringVMFlag,
this::getDoubleVMFlag);
public Object getVMFlag(String name) {
return flagsGetters.stream()
.map(f -> f.apply(name))
.filter(x -> x != null)
.findAny()
.orElse(null);
}
// Jigsaw
public native Object DefineModule(String name, Object loader, Object[] packages);
public native void AddModuleExports(Object from_module, String pkg, Object to_module);
public native void AddReadsModule(Object from_module, Object to_module);
public native boolean CanReadModule(Object asking_module, Object target_module);
public native boolean IsExportedToModule(Object from_module, String pkg, Object to_module);
public native Object GetModule(Class clazz);
public native void AddModulePackage(Object module, String pkg);
// Image File
public native boolean readImageFile(String imagefile);
public native int getOffsetForName0(String name);
public int getOffsetForName(String name) throws Exception {
int offset = getOffsetForName0(name);
if (offset == -1) {
throw new RuntimeException(name + " not found");
}
return offset;
}
}

@ -24,7 +24,7 @@
/*
* @test
* @library /testlibrary
*
* @requires vm.flavor != "minimal"
* @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
* SimpleClassFileLoadHookTest
*/

@ -361,3 +361,5 @@ bdbf2342b21bd8ecad1b4e6499a0dfb314952bd7 jdk-9+103
9d71d20e614777cd23c1a43b38b5c08a9094d27a jdk-9+116
46b57560cd06ebcdd21489250628ff5f9d9d8916 jdk-9+117
a8aa25fc6c5fda0ed7a93b8ffee62da326a752fc jdk-9+118
f92e8518bb34a9628b11e662bf7308561a55eb3b jdk-9+119
ecbe72546137cd29cb73d4dcc81cc099e847d543 jdk-9+120

@ -427,7 +427,7 @@ public final class TemplatesImpl implements Templates, Serializable {
Layer bootLayer = Layer.boot();
Configuration cf = bootLayer.configuration()
.resolveRequires(finder, ModuleFinder.empty(), Set.of(mn));
.resolveRequires(finder, ModuleFinder.of(), Set.of(mn));
PrivilegedAction<Layer> pa = () -> bootLayer.defineModules(cf, name -> loader);
Layer layer = AccessController.doPrivileged(pa);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -56,7 +56,7 @@ final class CatalogResolverImpl implements CatalogResolver {
publicId = Normalizer.normalizePublicId(Normalizer.decodeURN(Util.getNotNullOrEmpty(publicId)));
//check whether systemId is an urn
if (systemId != null && systemId.startsWith("urn:publicid:")) {
if (systemId != null && systemId.startsWith(Util.URN)) {
systemId = Normalizer.decodeURN(systemId);
if (publicId != null && !publicId.equals(systemId)) {
systemId = null;
@ -67,7 +67,7 @@ final class CatalogResolverImpl implements CatalogResolver {
}
CatalogImpl c = (CatalogImpl)catalog;
String resolvedSystemId = resolve(c, publicId, systemId);
String resolvedSystemId = Util.resolve(c, publicId, systemId);
if (resolvedSystemId != null) {
return new InputSource(resolvedSystemId);
@ -86,55 +86,4 @@ final class CatalogResolverImpl implements CatalogResolver {
return null;
}
/**
* Resolves the publicId or systemId using public or system entries in the catalog.
*
* The resolution follows the following rules determined by the prefer setting:
*
* prefer "system": attempts to resolve with a system entry;
* attempts to resolve with a public entry when only
* publicId is specified.
*
* prefer "public": attempts to resolve with a system entry;
* attempts to resolve with a public entry if no matching
* system entry is found.
* @param catalog the catalog
* @param publicId the publicId
* @param systemId the systemId
* @return the resolved systemId if a match is found, null otherwise
*/
String resolve(CatalogImpl catalog, String publicId, String systemId) {
String resolvedSystemId = null;
//search the current catalog
catalog.reset();
if (systemId != null) {
/*
If a system identifier is specified, it is used no matter how
prefer is set.
*/
resolvedSystemId = catalog.matchSystem(systemId);
}
if (resolvedSystemId == null && publicId != null) {
resolvedSystemId = catalog.matchPublic(publicId);
}
//mark the catalog as having been searched before trying alternatives
catalog.markAsSearched();
//search alternative catalogs
if (resolvedSystemId == null) {
Iterator<Catalog> iter = catalog.catalogs().iterator();
while (iter.hasNext()) {
resolvedSystemId = resolve((CatalogImpl)iter.next(), publicId, systemId);
if (resolvedSystemId != null) {
break;
}
}
}
return resolvedSystemId;
}
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -65,18 +65,30 @@ final class CatalogUriResolverImpl implements CatalogUriResolver {
if (href == null) return null;
String result = null;
CatalogImpl c = (CatalogImpl)catalog;
String uri = Normalizer.normalizeURI(href);
String result;
//remove fragment if any.
int hashPos = uri.indexOf("#");
if (hashPos >= 0) {
uri = uri.substring(0, hashPos);
//check whether uri is an urn
if (uri != null && uri.startsWith(Util.URN)) {
String publicId = Normalizer.decodeURN(uri);
if (publicId != null) {
result = Util.resolve(c, publicId, null);
}
}
//search the current catalog
result = resolve(c, uri);
//if no match with a public id, continue search for an URI
if (result == null) {
//remove fragment if any.
int hashPos = uri.indexOf("#");
if (hashPos >= 0) {
uri = uri.substring(0, hashPos);
}
//search the current catalog
result = resolve(c, uri);
}
//Report error or return the URI as is when no match is found
if (result == null) {
GroupEntry.ResolveType resolveType = c.getResolve();
switch (resolveType) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, 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
@ -298,6 +298,9 @@ class GroupEntry extends BaseEntry {
case PUBLIC:
match = ((PublicEntry) entry).match(publicId);
break;
case URI:
match = ((UriEntry) entry).match(publicId);
break;
case GROUP:
match = ((GroupEntry) entry).matchPublic(publicId);
break;

@ -100,7 +100,7 @@ class Normalizer {
} catch (UnsupportedEncodingException ex) {
CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex);
}
return "urn:publicid:" + urn;
return Util.URN + urn;
}
/**
@ -114,7 +114,7 @@ class Normalizer {
static String decodeURN(String urn) {
String publicId;
if (urn != null && urn.startsWith("urn:publicid:")) {
if (urn != null && urn.startsWith(Util.URN)) {
publicId = urn.substring(13);
} else {
return urn;

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