This commit is contained in:
Lana Steuck 2017-02-09 19:15:12 +00:00
commit a05d288085
1655 changed files with 38158 additions and 26346 deletions
.hgtags.hgtags-top-repo
common
corba
.hgtags
src/java.corba/share/classes
com/sun
org/omg
sun/corba
hotspot
.hgtags
make
ide
lib
src/classes/build/tools/projectcreator
symbols
src
cpu
jdk.aot/share/classes
jdk.vm.ci/share/classes
jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot
jdk.vm.ci.meta/src/jdk/vm/ci/meta
jdk.vm.compiler
.mx.graal
share/classes
org.graalvm.compiler.debug/src/org/graalvm/compiler/debug
org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64

@ -396,3 +396,6 @@ cf139f925da04c8bd7efd33270a0315d72b338d3 jdk-9+149
37b95df0042ae0687324e1f7dc4a2519e230e704 jdk-9+151
ab2c8b03c3284fcbdd157551a66f807e3a182d9b jdk-9+152
d7034ff7f8e257e81c9f95c7785dd4eaaa3c2afc jdk-9+153
8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0
45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154
f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155

@ -396,3 +396,5 @@ b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149
71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151
ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152
816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153
8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154
688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155

@ -746,7 +746,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
fi
# set SDKROOT too, Xcode tools will pick it up
AC_SUBST(SDKROOT,$SYSROOT)
SDKROOT="$SYSROOT"
AC_SUBST(SDKROOT)
fi
# Prepend the extra path to the global path
@ -831,9 +832,10 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
CONFIGURESUPPORT_OUTPUTDIR="$OUTPUT_ROOT/configure-support"
$MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
AC_SUBST(CONF_NAME, $CONF_NAME)
AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
SPEC="$OUTPUT_ROOT/spec.gmk"
AC_SUBST(SPEC)
AC_SUBST(CONF_NAME)
AC_SUBST(OUTPUT_ROOT)
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
# The spec.gmk file contains all variables for the make system.

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -325,7 +325,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
fi
AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits])
AC_MSG_RESULT([$BOOT_JDK_BITS])
AC_SUBST(BOOT_JDK_BITS)
])
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],

@ -224,7 +224,7 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
AC_MSG_ERROR([On macosx, ccache 3.2 or later is required, found $CCACHE_VERSION])
fi
fi
if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
if test "x$USE_PRECOMPILED_HEADER" = "xtrue"; then
HAS_BAD_CCACHE=[`$ECHO $CCACHE_VERSION | \
$GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]$'`]
if test "x$HAS_BAD_CCACHE" != "x"; then
@ -362,20 +362,20 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[disable using precompiled headers when compiling C++ @<:@enabled@:>@])],
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
USE_PRECOMPILED_HEADER=1
USE_PRECOMPILED_HEADER=true
AC_MSG_CHECKING([If precompiled header is enabled])
if test "x$ENABLE_PRECOMPH" = xno; then
AC_MSG_RESULT([no, forced])
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$ICECC" != "x"; then
AC_MSG_RESULT([no, does not work effectively with icecc])
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
AC_MSG_RESULT([no, does not work with Solaris Studio])
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
AC_MSG_RESULT([no, does not work with xlc])
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
else
AC_MSG_RESULT([yes])
fi
@ -387,7 +387,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
echo "int alfa();" > conftest.h
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
if test ! -f conftest.hpp.gch; then
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -808,7 +808,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
IF_FALSE: [$2CXXSTD_CXXFLAG=""])
$2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}"
$2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"
AC_SUBST([$2CXXSTD_CXXFLAG])
AC_SUBST($2CXXSTD_CXXFLAG)
fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
$2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
@ -1440,18 +1440,6 @@ BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS],
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
[
# Some Zero and Shark settings.
# ZERO_ARCHFLAG tells the compiler which mode to build for
case "${OPENJDK_TARGET_CPU}" in
s390)
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
;;
*)
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
esac
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$ZERO_ARCHFLAG], IF_FALSE: [ZERO_ARCHFLAG=""])
AC_SUBST(ZERO_ARCHFLAG)
# Check that the compiler supports -mX (or -qX on AIX) flags
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
@ -1476,15 +1464,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
fi
if test "x$WARNINGS_AS_ERRORS" = "xfalse"; then
# Set legacy hotspot variable
HOTSPOT_SET_WARNINGS_AS_ERRORS="WARNINGS_ARE_ERRORS="
else
HOTSPOT_SET_WARNINGS_AS_ERRORS=""
fi
AC_SUBST(WARNINGS_AS_ERRORS)
AC_SUBST(HOTSPOT_SET_WARNINGS_AS_ERRORS)
case "${TOOLCHAIN_TYPE}" in
microsoft)

@ -704,7 +704,6 @@ FIXPATH_DETACH_FLAG
FIXPATH
BUILD_GTEST
ENABLE_AOT
INCLUDE_DTRACE
GCOV_ENABLED
ZIP_EXTERNAL_DEBUG_SYMBOLS
COPY_DEBUG_SYMBOLS
@ -712,10 +711,8 @@ COMPILE_WITH_DEBUG_SYMBOLS
CFLAGS_WARNINGS_ARE_ERRORS
BUILD_CC_DISABLE_WARNING_PREFIX
DISABLE_WARNING_PREFIX
HOTSPOT_SET_WARNINGS_AS_ERRORS
WARNINGS_AS_ERRORS
COMPILER_SUPPORTS_TARGET_BITS_FLAG
ZERO_ARCHFLAG
LDFLAGS_TESTEXE
LDFLAGS_TESTLIB
CXXFLAGS_TESTEXE
@ -884,7 +881,6 @@ BUILD_JDK
CREATE_BUILDJDK
JLINK
JMOD
BOOT_JDK_BITS
JAVAC_FLAGS
BOOT_JDK_MODULAR
BOOT_JDK_SOURCETARGET
@ -974,15 +970,12 @@ CANONICAL_TOPDIR
ORIGINAL_TOPDIR
TOPDIR
PATH_SEP
ZERO_ARCHDEF
HOTSPOT_BUILD_CPU_DEFINE
HOTSPOT_BUILD_CPU_ARCH
HOTSPOT_BUILD_CPU
HOTSPOT_BUILD_OS_TYPE
HOTSPOT_BUILD_OS
OPENJDK_BUILD_BUNDLE_PLATFORM
OPENJDK_BUILD_CPU_BUNDLE
OPENJDK_BUILD_OS_BUNDLE
OPENJDK_BUILD_OS_EXPORT_DIR
OPENJDK_BUILD_CPU_OSARCH
OPENJDK_BUILD_CPU_ISADIR
@ -994,10 +987,7 @@ HOTSPOT_TARGET_CPU
HOTSPOT_TARGET_OS_TYPE
HOTSPOT_TARGET_OS
DEFINE_CROSS_COMPILE_ARCH
LP64
OPENJDK_TARGET_BUNDLE_PLATFORM
OPENJDK_TARGET_CPU_BUNDLE
OPENJDK_TARGET_OS_BUNDLE
OPENJDK_TARGET_OS_EXPORT_DIR
OPENJDK_TARGET_CPU_OSARCH
OPENJDK_TARGET_CPU_ISADIR
@ -3818,7 +3808,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# ... then the rest
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -3998,7 +3988,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -4273,7 +4263,7 @@ pkgadd_help() {
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -4561,7 +4551,7 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -4841,7 +4831,7 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -5180,7 +5170,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1484571183
DATE_WHEN_GENERATED=1486175373
###############################################################################
#
@ -15936,18 +15926,14 @@ $as_echo "$COMPILE_TYPE" >&6; }
OPENJDK_TARGET_BUNDLE_PLATFORM="${OPENJDK_TARGET_OS_BUNDLE}-${OPENJDK_TARGET_CPU_BUNDLE}"
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
# unpack200.exe
# unpack200.exe. This variable is used in
# FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER.
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_ADD_LP64="-D_LP64=1"
fi
fi
LP64=$A_LP64
if test "x$COMPILE_TYPE" = "xcross"; then
# FIXME: ... or should this include reduced builds..?
@ -16092,18 +16078,14 @@ $as_echo "$COMPILE_TYPE" >&6; }
OPENJDK_BUILD_BUNDLE_PLATFORM="${OPENJDK_BUILD_OS_BUNDLE}-${OPENJDK_BUILD_CPU_BUNDLE}"
if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
# unpack200.exe
# unpack200.exe. This variable is used in
# FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER.
if test "x$OPENJDK_BUILD_OS" = xlinux || test "x$OPENJDK_BUILD_OS" = xmacosx; then
OPENJDK_BUILD_ADD_LP64="-D_LP64=1"
fi
fi
LP64=$A_LP64
if test "x$COMPILE_TYPE" = "xcross"; then
# FIXME: ... or should this include reduced builds..?
@ -16173,12 +16155,6 @@ $as_echo "$COMPILE_TYPE" >&6; }
# ZERO_ARCHDEF is used to enable architecture-specific code.
# This is used in legacy hotspot build.
ZERO_ARCHDEF="$HOTSPOT_TARGET_CPU_DEFINE"
# Continue setting up basic stuff. Most remaining code require fundamental tools.
@ -17280,7 +17256,7 @@ $as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROO
fi
# set SDKROOT too, Xcode tools will pick it up
SDKROOT=$SYSROOT
SDKROOT="$SYSROOT"
fi
@ -17528,11 +17504,9 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval
CONFIGURESUPPORT_OUTPUTDIR="$OUTPUT_ROOT/configure-support"
$MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
SPEC=$OUTPUT_ROOT/spec.gmk
SPEC="$OUTPUT_ROOT/spec.gmk"
CONF_NAME=$CONF_NAME
OUTPUT_ROOT=$OUTPUT_ROOT
@ -30730,7 +30704,6 @@ $as_echo "$BOOT_JDK_BITS" >&6; }
# Check whether --with-build-jdk was given.
if test "${with_build_jdk+set}" = set; then :
withval=$with_build_jdk;
@ -31283,12 +31256,6 @@ $as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\"
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi
@ -51486,282 +51453,6 @@ OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_JA
# Some Zero and Shark settings.
# ZERO_ARCHFLAG tells the compiler which mode to build for
case "${OPENJDK_TARGET_CPU}" in
s390)
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
;;
*)
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
esac
# Execute function body
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$ZERO_ARCHFLAG\"" >&5
$as_echo_n "checking if the C compiler supports \"$ZERO_ARCHFLAG\"... " >&6; }
supports=yes
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $ZERO_ARCHFLAG"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CFLAGS="$saved_cflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
C_COMP_SUPPORTS="yes"
else
:
C_COMP_SUPPORTS="no"
fi
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$ZERO_ARCHFLAG\"" >&5
$as_echo_n "checking if the C++ compiler supports \"$ZERO_ARCHFLAG\"... " >&6; }
supports=yes
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $ZERO_ARCHFLAG"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
supports=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CXXFLAGS="$saved_cxxflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
CXX_COMP_SUPPORTS="yes"
else
:
CXX_COMP_SUPPORTS="no"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$ZERO_ARCHFLAG\"" >&5
$as_echo_n "checking if both compilers support \"$ZERO_ARCHFLAG\"... " >&6; }
supports=no
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
else
:
ZERO_ARCHFLAG=""
fi
# Check that the compiler supports -mX (or -qX on AIX) flags
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
@ -52060,14 +51751,6 @@ $as_echo "yes (default)" >&6; }
as_fn_error $? "--enable-warnings-as-errors accepts no argument" "$LINENO" 5
fi
if test "x$WARNINGS_AS_ERRORS" = "xfalse"; then
# Set legacy hotspot variable
HOTSPOT_SET_WARNINGS_AS_ERRORS="WARNINGS_ARE_ERRORS="
else
HOTSPOT_SET_WARNINGS_AS_ERRORS=""
fi
case "${TOOLCHAIN_TYPE}" in
@ -52922,7 +52605,6 @@ $as_echo "yes, dependencies present" >&6; }
fi
# Check whether --enable-aot was given.
if test "${enable_aot+set}" = set; then :
enableval=$enable_aot;
@ -63700,12 +63382,14 @@ $as_echo_n "checking for which libpng to use... " >&6; }
DEFAULT_LIBPNG=bundled
# if user didn't specify, use DEFAULT_LIBPNG
if test "x${with_libpng}" = "x"; then
with_libpng=${DEFAULT_LIBPNG}
with_libpng=${DEFAULT_LIBPNG}
fi
if test "x${with_libpng}" = "xbundled"; then
USE_EXTERNAL_LIBPNG=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5
USE_EXTERNAL_LIBPNG=false
PNG_CFLAGS=""
PNG_LIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5
$as_echo "bundled" >&6; }
elif test "x${with_libpng}" = "xsystem"; then
@ -63765,33 +63449,36 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
LIBPNG_FOUND=no
LIBPNG_FOUND=no
elif test $pkg_failed = untried; then
LIBPNG_FOUND=no
LIBPNG_FOUND=no
else
PNG_CFLAGS=$pkg_cv_PNG_CFLAGS
PNG_LIBS=$pkg_cv_PNG_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LIBPNG_FOUND=yes
LIBPNG_FOUND=yes
fi
if test "x${LIBPNG_FOUND}" = "xyes"; then
USE_EXTERNAL_LIBPNG=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5
if test "x${LIBPNG_FOUND}" = "xyes"; then
# PKG_CHECK_MODULES will set PNG_CFLAGS and PNG_LIBS
USE_EXTERNAL_LIBPNG=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5
$as_echo "system" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5
$as_echo "system not found" >&6; }
as_fn_error $? "--with-libpng=system specified, but no libpng found!" "$LINENO" 5
fi
as_fn_error $? "--with-libpng=system specified, but no libpng found!" "$LINENO" 5
fi
else
as_fn_error $? "Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'" "$LINENO" 5
as_fn_error $? "Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'" "$LINENO" 5
fi
# Check whether --with-zlib was given.
if test "${with_zlib+set}" = set; then :
withval=$with_zlib;
@ -63894,11 +63581,13 @@ $as_echo_n "checking for which lcms to use... " >&6; }
DEFAULT_LCMS=bundled
# If user didn't specify, use DEFAULT_LCMS
if test "x${with_lcms}" = "x"; then
with_lcms=${DEFAULT_LCMS}
with_lcms=${DEFAULT_LCMS}
fi
if test "x${with_lcms}" = "xbundled"; then
USE_EXTERNAL_LCMS=false
LCMS_CFLAGS=""
LCMS_LIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5
$as_echo "bundled" >&6; }
elif test "x${with_lcms}" = "xsystem"; then
@ -63972,6 +63661,7 @@ $as_echo "yes" >&6; }
LCMS_FOUND=yes
fi
if test "x${LCMS_FOUND}" = "xyes"; then
# PKG_CHECK_MODULES will set LCMS_CFLAGS and LCMS_LIBS
USE_EXTERNAL_LCMS=true
else
as_fn_error $? "--with-lcms=system specified, but no lcms found!" "$LINENO" 5
@ -63990,6 +63680,8 @@ fi
# Setup libm (the maths library)
if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
@ -64774,11 +64466,11 @@ fi
$as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; }
if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
ENABLE_INTREE_EC=yes
ENABLE_INTREE_EC=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
ENABLE_INTREE_EC=no
ENABLE_INTREE_EC=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
@ -66145,25 +65837,25 @@ else
fi
USE_PRECOMPILED_HEADER=1
USE_PRECOMPILED_HEADER=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If precompiled header is enabled" >&5
$as_echo_n "checking If precompiled header is enabled... " >&6; }
if test "x$ENABLE_PRECOMPH" = xno; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
$as_echo "no, forced" >&6; }
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$ICECC" != "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work effectively with icecc" >&5
$as_echo "no, does not work effectively with icecc" >&6; }
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with Solaris Studio" >&5
$as_echo "no, does not work with Solaris Studio" >&6; }
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, does not work with xlc" >&5
$as_echo "no, does not work with xlc" >&6; }
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@ -66177,7 +65869,7 @@ $as_echo_n "checking that precompiled headers work... " >&6; }
echo "int alfa();" > conftest.h
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&5 >&5
if test ! -f conftest.hpp.gch; then
USE_PRECOMPILED_HEADER=0
USE_PRECOMPILED_HEADER=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
else
@ -66464,7 +66156,7 @@ $as_echo "$as_me: WARNING: --with-ccache-dir has no meaning when ccache is not e
as_fn_error $? "On macosx, ccache 3.2 or later is required, found $CCACHE_VERSION" "$LINENO" 5
fi
fi
if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
if test "x$USE_PRECOMPILED_HEADER" = "xtrue"; then
HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \
$GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]$'`
if test "x$HAS_BAD_CCACHE" != "x"; then

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -189,7 +189,6 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
else
AC_MSG_ERROR([Invalid value for --enable-dtrace: $enable_dtrace])
fi
AC_SUBST(INCLUDE_DTRACE)
])
################################################################################

@ -210,10 +210,10 @@ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
ENABLE_INTREE_EC=yes
ENABLE_INTREE_EC=true
AC_MSG_RESULT([yes])
else
ENABLE_INTREE_EC=no
ENABLE_INTREE_EC=false
AC_MSG_RESULT([no])
fi
@ -479,5 +479,5 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
fi
AC_SUBST([ENABLE_GENERATE_CLASSLIST])
AC_SUBST(ENABLE_GENERATE_CLASSLIST)
])

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -119,28 +119,31 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBPNG],
DEFAULT_LIBPNG=bundled
# if user didn't specify, use DEFAULT_LIBPNG
if test "x${with_libpng}" = "x"; then
with_libpng=${DEFAULT_LIBPNG}
with_libpng=${DEFAULT_LIBPNG}
fi
if test "x${with_libpng}" = "xbundled"; then
USE_EXTERNAL_LIBPNG=false
AC_MSG_RESULT([bundled])
USE_EXTERNAL_LIBPNG=false
PNG_CFLAGS=""
PNG_LIBS=""
AC_MSG_RESULT([bundled])
elif test "x${with_libpng}" = "xsystem"; then
PKG_CHECK_MODULES(PNG, libpng,
[ LIBPNG_FOUND=yes ],
[ LIBPNG_FOUND=no ])
if test "x${LIBPNG_FOUND}" = "xyes"; then
USE_EXTERNAL_LIBPNG=true
AC_MSG_RESULT([system])
else
AC_MSG_RESULT([system not found])
AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
fi
PKG_CHECK_MODULES(PNG, libpng, [LIBPNG_FOUND=yes], [LIBPNG_FOUND=no])
if test "x${LIBPNG_FOUND}" = "xyes"; then
# PKG_CHECK_MODULES will set PNG_CFLAGS and PNG_LIBS
USE_EXTERNAL_LIBPNG=true
AC_MSG_RESULT([system])
else
AC_MSG_RESULT([system not found])
AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
fi
else
AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
fi
AC_SUBST(USE_EXTERNAL_LIBPNG)
AC_SUBST(PNG_CFLAGS)
AC_SUBST(PNG_LIBS)
])
################################################################################
@ -204,16 +207,19 @@ AC_DEFUN_ONCE([LIB_SETUP_LCMS],
DEFAULT_LCMS=bundled
# If user didn't specify, use DEFAULT_LCMS
if test "x${with_lcms}" = "x"; then
with_lcms=${DEFAULT_LCMS}
with_lcms=${DEFAULT_LCMS}
fi
if test "x${with_lcms}" = "xbundled"; then
USE_EXTERNAL_LCMS=false
LCMS_CFLAGS=""
LCMS_LIBS=""
AC_MSG_RESULT([bundled])
elif test "x${with_lcms}" = "xsystem"; then
AC_MSG_RESULT([system])
PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no])
if test "x${LCMS_FOUND}" = "xyes"; then
# PKG_CHECK_MODULES will set LCMS_CFLAGS and LCMS_LIBS
USE_EXTERNAL_LCMS=true
else
AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
@ -223,4 +229,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LCMS],
fi
AC_SUBST(USE_EXTERNAL_LCMS)
AC_SUBST(LCMS_CFLAGS)
AC_SUBST(LCMS_LIBS)
])

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -276,12 +276,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
[
PLATFORM_SETUP_LEGACY_VARS_HELPER([TARGET])
PLATFORM_SETUP_LEGACY_VARS_HELPER([BUILD])
# ZERO_ARCHDEF is used to enable architecture-specific code.
# This is used in legacy hotspot build.
ZERO_ARCHDEF="$HOTSPOT_TARGET_CPU_DEFINE"
AC_SUBST(ZERO_ARCHDEF)
])
# $1 - Either TARGET or BUILD to setup the variables for.
@ -360,19 +354,16 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
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
# unpack200.exe
# unpack200.exe. This variable is used in
# FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER.
if test "x$OPENJDK_$1_OS" = xlinux || test "x$OPENJDK_$1_OS" = xmacosx; then
OPENJDK_$1_ADD_LP64="-D_LP64=1"
fi
fi
AC_SUBST(LP64,$A_LP64)
if test "x$COMPILE_TYPE" = "xcross"; then
# FIXME: ... or should this include reduced builds..?

@ -114,12 +114,6 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2017, 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
@ -87,9 +87,8 @@ 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@
JDK_ARCH_ABI_PROP_NAME := @JDK_ARCH_ABI_PROP_NAME@
# We are building on this build system.
# When not cross-compiling, it is the same as the target.
@ -683,8 +682,7 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
# Build setup
ENABLE_AOT:=@ENABLE_AOT@
ENABLE_JFR=@ENABLE_JFR@
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@

@ -309,8 +309,8 @@ if [ "${command}" = "serve" ] ; then
echo "serving root repo ${serving}" > ${status_output}
echo "hg${global_opts} serve" > ${status_output}
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
echo "hg${global_opts} serve ${@}" > ${status_output}
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf "${@}"; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
) 2>&1 | sed -e "s@^@serve: @" > ${status_output}
) &
else

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2017, 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
@ -60,7 +60,7 @@ jaxp/src/java.xml/share/classes/org/xml/sax : jaxp/src/org/xml/sax
jaxws/src/java.activation/share/classes/com/sun/activation/registries : jaxws/src/share/jaf_classes/com/sun/activation/registries
jaxws/src/java.activation/share/classes/javax/activation : jaxws/src/share/jaf_classes/javax/activation
jaxws/src/java.activation/share/classes/META-INF : jaxws/src/share/jaf_classes/META-INF
jaxws/src/java.annotations.common/share/classes/javax/annotation : jaxws/src/share/jaxws_classes/javax/annotation
jaxws/src/java.xml.ws.annotation/share/classes/javax/annotation : jaxws/src/share/jaxws_classes/javax/annotation
jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal : jaxws/src/share/jaxws_classes/com/sun/istack/internal
jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization : jaxws/src/share/jaxws_classes/com/sun/istack/internal/localization
jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/logging/Logger.java : jaxws/src/share/jaxws_classes/com/sun/istack/internal/logging/Logger.java
@ -1163,9 +1163,6 @@ jdk/src/java.management/share/classes/mgmt-overview.html : jdk/src/share/classes
jdk/src/java.management/share/classes/sun/management/counter : jdk/src/share/classes/sun/management/counter
jdk/src/java.management/share/classes/sun/management/counter/perf : jdk/src/share/classes/sun/management/counter/perf
jdk/src/java.management/share/classes/sun/management : jdk/src/share/classes/sun/management
jdk/src/java.management/share/classes/sun/management/jdp : jdk/src/share/classes/sun/management/jdp
jdk/src/java.management/share/classes/sun/management/jmxremote : jdk/src/share/classes/sun/management/jmxremote
jdk/src/java.management/share/classes/sun/management/resources : jdk/src/share/classes/sun/management/resources
jdk/src/java.management/share/conf : jdk/src/share/lib/management
jdk/src/java.management/share/native/include/jmm.h : jdk/src/share/javavm/export/jmm.h
jdk/src/java.management/share/native/libmanagement : jdk/src/share/native/sun/management
@ -1173,6 +1170,11 @@ jdk/src/java.management/unix/classes/sun/management : jdk/src/solaris/classes/su
jdk/src/java.management/unix/native/libmanagement : jdk/src/solaris/native/sun/management
jdk/src/java.management/windows/classes/sun/management : jdk/src/windows/classes/sun/management
jdk/src/java.management/windows/native/libmanagement : jdk/src/windows/native/sun/management
jdk/src/java.management.rmi/share/classes/com/sun/jmx/remote/internal/rmi/ProxyRef.java : jdk/src/share/classes/com/sun/jmx/remote/internal/ProxyRef.java
jdk/src/java.management.rmi/share/classes/com/sun/jmx/remote/internal/rmi/RMIExporter.java : jdk/src/share/classes/com/sun/jmx/remote/internal/RMIExporter.java
jdk/src/java.management.rmi/share/classes/com/sun/jmx/remote/internal/rmi/Unmarshal.java : jdk/src/share/classes/com/sun/jmx/remote/internal/Unmarshal.java
jdk/src/java.management.rmi/share/classes/com/sun/jmx/remote/protocol/rmi : jdk/src/share/classes/com/sun/jmx/remote/protocol/rmi
jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi : jdk/src/share/classes/javax/management/remote/rmi
jdk/src/java.naming/share/classes/com/sun/jndi/ldap/ext : jdk/src/share/classes/com/sun/jndi/ldap/ext
jdk/src/java.naming/share/classes/com/sun/jndi/ldap : jdk/src/share/classes/com/sun/jndi/ldap
jdk/src/java.naming/share/classes/com/sun/jndi/ldap/pool : jdk/src/share/classes/com/sun/jndi/ldap/pool
@ -1266,33 +1268,33 @@ jdk/src/jdk.crypto.ec/share/native/libsunec/ECC_JNI.cpp : jdk/src/share/native/s
jdk/src/jdk.crypto.ec/share/native/libsunec/impl : jdk/src/share/native/sun/security/ec/impl
jdk/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi : jdk/src/windows/classes/sun/security/mscapi
jdk/src/jdk.crypto.mscapi/windows/native/libsunmscapi : jdk/src/windows/native/sun/security/mscapi
jdk/src/jdk.crypto.token/share/classes/sun/security/pkcs11 : jdk/src/share/classes/sun/security/pkcs11
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/j2secmod.c : jdk/src/share/native/sun/security/pkcs11/j2secmod.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/j2secmod.h : jdk/src/share/native/sun/security/pkcs11/j2secmod.h
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_convert.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_crypt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_digest.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_digest.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_dual.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_dual.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_general.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_keymgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_mutex.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_mutex.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_objmgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sessmgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sign.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_util.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/pkcs11f.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11f.h
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/pkcs11.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11.h
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/pkcs11t.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11t.h
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/pkcs-11v2-20a3.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h
jdk/src/jdk.crypto.token/share/native/libj2pkcs11/pkcs11wrapper.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/j2secmod_md.c : jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c
jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/j2secmod_md.h : jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.h
jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/p11_md.c : jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/p11_md.h : jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.h
jdk/src/jdk.crypto.token/windows/native/libj2pkcs11/j2secmod_md.c : jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c
jdk/src/jdk.crypto.token/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h
jdk/src/jdk.crypto.token/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.token/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11 : jdk/src/share/classes/sun/security/pkcs11
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c : jdk/src/share/native/sun/security/pkcs11/j2secmod.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.h : jdk/src/share/native/sun/security/pkcs11/j2secmod.h
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_digest.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_dual.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_dual.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_mutex.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c : jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11f.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11f.h
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11.h
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11t.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11t.h
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs-11v2-20a3.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs-11v2-20a3.h
jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h : jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.c : jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c
jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.h : jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.h
jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c : jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h : jdk/src/solaris/native/sun/security/pkcs11/wrapper/p11_md.h
jdk/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/j2secmod_md.c : jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.c
jdk/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/j2secmod_md.h : jdk/src/windows/native/sun/security/pkcs11/j2secmod_md.h
jdk/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.c : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.c
jdk/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h : jdk/src/windows/native/sun/security/pkcs11/wrapper/p11_md.h
jdk/src/java.desktop/macosx/native/libosx/CFileManager.m : jdk/src/macosx/native/com/apple/eio/CFileManager.m
jdk/src/java.base/macosx/native/libosxsecurity/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof
@ -1330,9 +1332,9 @@ jdk/src/jdk.jdwp.agent/unix/native/libdt_socket : jdk/src/solaris/transport/sock
jdk/src/jdk.jdwp.agent/unix/native/libjdwp : jdk/src/solaris/back
jdk/src/jdk.jdwp.agent/windows/native/libdt_socket : jdk/src/windows/transport/socket
jdk/src/jdk.jdwp.agent/windows/native/libjdwp : jdk/src/windows/back
jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/monitor : jdk/src/share/classes/sun/jvmstat/monitor
jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata : jdk/src/share/classes/sun/jvmstat/perfdata
jdk/src/jdk.jvmstat/share/classes/sun/tools/jstatd : jdk/src/share/classes/sun/tools/jstatd
jdk/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor : jdk/src/share/classes/sun/jvmstat/monitor
jdk/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata : jdk/src/share/classes/sun/jvmstat/perfdata
jdk/src/jdk.internal.jvmstat/share/classes/sun/tools/jstatd : jdk/src/share/classes/sun/tools/jstatd
jdk/src/jdk.localedata/share/classes/sun/text/resources/ar : jdk/src/share/classes/sun/text/resources/ar
jdk/src/jdk.localedata/share/classes/sun/text/resources/be : jdk/src/share/classes/sun/text/resources/be
jdk/src/jdk.localedata/share/classes/sun/text/resources/bg : jdk/src/share/classes/sun/text/resources/bg
@ -1421,6 +1423,9 @@ jdk/src/jdk.localedata/share/classes/sun/util/resources/uk : jdk/src/share/class
jdk/src/jdk.localedata/share/classes/sun/util/resources/vi : jdk/src/share/classes/sun/util/resources/vi
jdk/src/jdk.localedata/share/classes/sun/util/resources/zh : jdk/src/share/classes/sun/util/resources/zh
jdk/src/jdk.management/share/classes/com/sun/management : jdk/src/share/classes/com/sun/management
jdk/src/jdk.management.agent/share/classes/jdk/internal/agent/resources : jdk/src/share/classes/sun/management/resources
jdk/src/jdk.management.agent/share/classes/sun/management/jmxremote : jdk/src/share/classes/sun/management/jmxremote
jdk/src/jdk.management.agent/share/classes/sun/management/jdp : jdk/src/share/classes/sun/management/jdp
jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns : jdk/src/share/classes/com/sun/jndi/dns
jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/url/dns : jdk/src/share/classes/com/sun/jndi/url/dns
jdk/src/jdk.naming.dns/share/classes/META-INF/services : jdk/src/share/classes/sun/net/spi/nameservice/dns/META-INF/services

@ -610,6 +610,19 @@ var getJibProfilesProfiles = function (input, common, data) {
}
profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
// On macosx add the devkit bin dir to the path in all the run-test profiles.
// This gives us a guaranteed working version of lldb for the jtreg failure handler.
if (input.build_os == "macosx") {
macosxRunTestExtra = {
dependencies: [ "devkit" ],
environment_path: input.get("devkit", "install_path")
+ "/Xcode.app/Contents/Developer/usr/bin"
}
profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
}
//
// Define artifacts for profiles
//
@ -844,7 +857,7 @@ var getJibProfilesDependencies = function (input, common) {
file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
+ "-" + boot_jdk_platform + ".tar.gz",
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
environment_path: common.boot_jdk_home
environment_path: common.boot_jdk_home + "/bin"
},
devkit: {

@ -2166,7 +2166,7 @@
</df>
</df>
</df>
<df name="jdk.crypto.token">
<df name="jdk.crypto.cryptoki">
<df name="share">
<df name="native">
<df name="libj2pkcs11">
@ -29422,35 +29422,35 @@
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/j2secmod.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_convert.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_crypt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_digest.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_dual.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_dual.c"
ex="false"
tool="0"
flavor2="2">
@ -29460,63 +29460,63 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_general.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_keymgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_mutex.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_objmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sessmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sign.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_util.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/j2secmod_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.c"
ex="false"
tool="0"
flavor2="3">
<cTool flags="5">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/p11_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c"
ex="false"
tool="0"
flavor2="3">
@ -31752,7 +31752,7 @@
</preprocessorList>
</ccTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token">
<folder path="0/jdk/src/jdk.crypto.cryptoki">
<cTool>
<incDir>
<pElem>../../jdk/src/java.base/share/native/include</pElem>
@ -31760,10 +31760,10 @@
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
<pElem>../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/java.base/macosx/native/libjava</pElem>
<pElem>../../build/support/headers/jdk.crypto.token</pElem>
<pElem>../../build/support/headers/jdk.crypto.cryptoki</pElem>
<pElem>../../make</pElem>
</incDir>
<preprocessorList>
@ -31772,7 +31772,7 @@
</preprocessorList>
</cTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token/unix">
<folder path="0/jdk/src/jdk.crypto.cryptoki/unix">
<cTool>
<preprocessorList>
<Elem>THIS_FILE="j2secmod_md.c"</Elem>
@ -44741,14 +44741,14 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/j2secmod.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c"
ex="false"
tool="0"
flavor2="0">
<cTool flags="4">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_convert.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c"
ex="false"
tool="0"
flavor2="0">
@ -44758,7 +44758,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_crypt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c"
ex="false"
tool="0"
flavor2="0">
@ -44768,7 +44768,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_digest.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c"
ex="false"
tool="0"
flavor2="0">
@ -44778,7 +44778,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_dual.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_dual.c"
ex="false"
tool="0"
flavor2="0">
@ -44788,7 +44788,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_general.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c"
ex="false"
tool="0"
flavor2="0">
@ -44798,7 +44798,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_keymgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -44808,7 +44808,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_mutex.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c"
ex="false"
tool="0"
flavor2="0">
@ -44818,7 +44818,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_objmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -44828,7 +44828,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sessmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -44838,7 +44838,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sign.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c"
ex="false"
tool="0"
flavor2="0">
@ -44848,7 +44848,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_util.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c"
ex="false"
tool="0"
flavor2="0">
@ -44858,14 +44858,14 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/j2secmod_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.c"
ex="false"
tool="0"
flavor2="0">
<cTool flags="4">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/p11_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c"
ex="false"
tool="0"
flavor2="0">
@ -47795,7 +47795,7 @@
</preprocessorList>
</ccTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token">
<folder path="0/jdk/src/jdk.crypto.cryptoki">
<cTool>
<incDir>
<pElem>../../jdk/src/java.base/share/native/include</pElem>
@ -47803,10 +47803,10 @@
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
<pElem>../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/java.base/linux/native/libjava</pElem>
<pElem>../../build/support/headers/jdk.crypto.token</pElem>
<pElem>../../build/support/headers/jdk.crypto.cryptoki</pElem>
<pElem>../../make</pElem>
</incDir>
<preprocessorList>
@ -47815,7 +47815,7 @@
</preprocessorList>
</cTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token/unix">
<folder path="0/jdk/src/jdk.crypto.cryptoki/unix">
<cTool>
<preprocessorList>
<Elem>THIS_FILE="j2secmod_md.c"</Elem>
@ -62728,14 +62728,14 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/j2secmod.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c"
ex="false"
tool="0"
flavor2="0">
<cTool flags="2">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_convert.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_convert.c"
ex="false"
tool="0"
flavor2="0">
@ -62745,7 +62745,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_crypt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_crypt.c"
ex="false"
tool="0"
flavor2="0">
@ -62755,7 +62755,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_digest.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_digest.c"
ex="false"
tool="0"
flavor2="0">
@ -62765,7 +62765,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_dual.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_dual.c"
ex="false"
tool="0"
flavor2="0">
@ -62775,7 +62775,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_general.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_general.c"
ex="false"
tool="0"
flavor2="0">
@ -62785,7 +62785,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_keymgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_keymgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -62795,7 +62795,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_mutex.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_mutex.c"
ex="false"
tool="0"
flavor2="0">
@ -62805,7 +62805,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_objmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_objmgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -62815,7 +62815,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sessmgmt.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c"
ex="false"
tool="0"
flavor2="0">
@ -62825,7 +62825,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_sign.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sign.c"
ex="false"
tool="0"
flavor2="0">
@ -62835,7 +62835,7 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11/p11_util.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c"
ex="false"
tool="0"
flavor2="0">
@ -62845,14 +62845,14 @@
</preprocessorList>
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/j2secmod_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.c"
ex="false"
tool="0"
flavor2="0">
<cTool flags="2">
</cTool>
</item>
<item path="../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11/p11_md.c"
<item path="../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c"
ex="false"
tool="0"
flavor2="0">
@ -66281,7 +66281,7 @@
</preprocessorList>
</ccTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token">
<folder path="0/jdk/src/jdk.crypto.cryptoki">
<cTool>
<incDir>
<pElem>../../jdk/src/java.base/share/native/include</pElem>
@ -66289,10 +66289,10 @@
<pElem>../../jdk/src/java.base/unix/native/include</pElem>
<pElem>../../jdk/src/java.base/share/native/libjava</pElem>
<pElem>../../jdk/src/java.base/unix/native/libjava</pElem>
<pElem>../../jdk/src/jdk.crypto.token/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.token/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/share/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11</pElem>
<pElem>../../jdk/src/java.base/solaris/native/libjava</pElem>
<pElem>../../build/support/headers/jdk.crypto.token</pElem>
<pElem>../../build/support/headers/jdk.crypto.cryptoki</pElem>
<pElem>../../make</pElem>
</incDir>
<preprocessorList>
@ -66301,7 +66301,7 @@
</preprocessorList>
</cTool>
</folder>
<folder path="0/jdk/src/jdk.crypto.token/unix">
<folder path="0/jdk/src/jdk.crypto.cryptoki/unix">
<cTool>
<preprocessorList>
<Elem>THIS_FILE="j2secmod_md.c"</Elem>

@ -396,3 +396,5 @@ f95cc86b6ac22ec1ade5d4f825dc7782adeea228 jdk-9+148
77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151
ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152
68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153
078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154
a545f54babfa31aa7eb611f36031609acd617cbc jdk-9+155

@ -31,9 +31,6 @@ import java.util.Properties ;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger ;
import java.security.AccessController ;
import java.security.PrivilegedAction ;
import org.omg.CORBA.TCKind ;
import com.sun.corba.se.pept.broker.Broker ;
@ -89,9 +86,6 @@ import com.sun.corba.se.impl.logging.OMGSystemException ;
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
import jdk.internal.misc.JavaAWTAccess;
import jdk.internal.misc.SharedSecrets;
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
implements Broker, TypeCodeFactory
{
@ -164,12 +158,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
static class Holder {
static final PresentationManager defaultPresentationManager =
setupPresentationManager();
setupPresentationManager();
}
private static final Map<Object, PresentationManager> pmContexts =
new ConcurrentHashMap<>();
private static Map<StringPair, LogWrapperBase> staticWrapperMap =
new ConcurrentHashMap<>();
@ -198,23 +189,10 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
byteBufferPool = null;
}
/**
* Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
* AppContext to hold it. Creates and records one if needed.
/** Get the single instance of the PresentationManager
*/
public static PresentationManager getPresentationManager()
{
SecurityManager sm = System.getSecurityManager();
JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess();
if (sm != null && javaAwtAccess != null) {
final Object appletContext = javaAwtAccess.getAppletContext();
if (appletContext != null) {
return pmContexts.computeIfAbsent(appletContext,
x -> setupPresentationManager());
}
}
// No security manager or AppletAppContext
return Holder.defaultPresentationManager;
}

@ -33,6 +33,8 @@ import java.util.Hashtable;
import org.omg.CosNaming.*;
import com.sun.jndi.toolkit.corba.CorbaUtils;
/**
* Implements the JNDI NamingEnumeration interface for COS
* Naming. Gets hold of a list of bindings from the COS Naming Server
@ -212,7 +214,10 @@ final class CNBindingEnumeration
Name cname = CNNameParser.cosNameToName(bndg.binding_name);
try {
obj = NamingManager.getObjectInstance(obj, cname, _ctx, _env);
// Check whether object factory codebase is trusted
if (CorbaUtils.isObjectFactoryTrusted(obj)) {
obj = NamingManager.getObjectInstance(obj, cname, _ctx, _env);
}
} catch (NamingException e) {
throw e;
} catch (Exception e) {

@ -36,6 +36,8 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
@ -82,6 +84,19 @@ public class CNCtx implements javax.naming.Context {
private static final String FED_PROP = "com.sun.jndi.cosnaming.federation";
boolean federation = false;
/**
* Determines whether classes may be loaded from an arbitrary URL code base.
*/
public static final boolean trustURLCodebase;
static {
// System property to control whether classes may be loaded from an
// arbitrary URL code base
PrivilegedAction<String> act = () -> System.getProperty(
"com.sun.jndi.cosnaming.object.trustURLCodebase", "false");
String trust = AccessController.doPrivileged(act);
trustURLCodebase = "true".equalsIgnoreCase(trust);
}
// Reference counter for tracking _orb references
OrbReuseTracker orbTracker = null;
int enumCount;
@ -534,12 +549,16 @@ public class CNCtx implements javax.naming.Context {
if (name.size() == 0 )
return this; // %%% should clone() so that env can be changed
NameComponent[] path = CNNameParser.nameToCosName(name);
java.lang.Object answer = null;
try {
java.lang.Object answer = callResolve(path);
answer = callResolve(path);
try {
return NamingManager.getObjectInstance(answer, name, this, _env);
// Check whether object factory codebase is trusted
if (CorbaUtils.isObjectFactoryTrusted(answer)) {
answer = NamingManager.getObjectInstance(
answer, name, this, _env);
}
} catch (NamingException e) {
throw e;
} catch (Exception e) {
@ -552,6 +571,7 @@ public class CNCtx implements javax.naming.Context {
javax.naming.Context cctx = getContinuationContext(cpe);
return cctx.lookup(cpe.getRemainingName());
}
return answer;
}
/**

@ -33,6 +33,8 @@ import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import com.sun.jndi.toolkit.corba.CorbaUtils;
/**
* A convenience class to map the COS Naming exceptions to the JNDI exceptions.
* @author Raj Krishnamurthy
@ -202,10 +204,13 @@ public final class ExceptionMapper {
// Not a context, use object factory to transform object.
Name cname = CNNameParser.cosNameToName(resolvedName);
java.lang.Object resolvedObj2;
java.lang.Object resolvedObj2 = null;
try {
resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
cname, ctx, ctx._env);
// Check whether object factory codebase is trusted
if (CorbaUtils.isObjectFactoryTrusted(resolvedObj)) {
resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
cname, ctx, ctx._env);
}
} catch (NamingException ge) {
throw ge;
} catch (Exception ge) {

@ -36,11 +36,12 @@ import java.applet.Applet;
import org.omg.CORBA.ORB;
import javax.naming.Context;
import javax.naming.ConfigurationException;
import javax.naming.*;
import javax.rmi.CORBA.Stub;
import javax.rmi.PortableRemoteObject;
import com.sun.jndi.cosnaming.CNCtx;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URLDecoder;
@ -182,6 +183,32 @@ public class CorbaUtils {
return ORB.init(new String[0], orbProp);
}
/**
* Check whether object factory code base is trusted.
* Classes may only be loaded from an arbitrary URL code base when
* the system property com.sun.jndi.rmi.object.trustURLCodebase
* has been set to "true".
*/
public static boolean isObjectFactoryTrusted(Object obj)
throws NamingException {
// Extract Reference, if possible
Reference ref = null;
if (obj instanceof Reference) {
ref = (Reference) obj;
} else if (obj instanceof Referenceable) {
ref = ((Referenceable)(obj)).getReference();
}
if (ref != null && ref.getFactoryClassLocation() != null &&
!CNCtx.trustURLCodebase) {
throw new ConfigurationException(
"The object factory is untrusted. Set the system property" +
" 'com.sun.jndi.cosnaming.object.trustURLCodebase' to 'true'.");
}
return true;
}
/**
* Decode a URI string (according to RFC 2396).
*/

@ -36,8 +36,6 @@ import java.io.FileInputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.reflect.misc.ReflectUtil;
/**
* A class providing APIs for the CORBA Object Request Broker
* features. The {@code ORB} class also provides
@ -188,6 +186,24 @@ abstract public class ORB {
private static final String ORBClassKey = "org.omg.CORBA.ORBClass";
private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass";
// check that access to the class is not restricted by the security manager.
private static void checkPackageAccess(String name) {
SecurityManager s = System.getSecurityManager();
if (s != null) {
String cname = name.replace('/', '.');
if (cname.startsWith("[")) {
int b = cname.lastIndexOf('[') + 2;
if (b > 1 && b < cname.length()) {
cname = cname.substring(b);
}
}
int i = cname.lastIndexOf('.');
if (i != -1) {
s.checkPackageAccess(cname.substring(0, i));
}
}
}
//
// The global instance of the singleton ORB implementation which
// acts as a factory for typecodes for generated Helper classes.
@ -318,7 +334,7 @@ abstract public class ORB {
private static ORB create_impl_with_systemclassloader(String className) {
try {
ReflectUtil.checkPackageAccess(className);
checkPackageAccess(className);
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
@ -337,7 +353,7 @@ abstract public class ORB {
cl = ClassLoader.getSystemClassLoader();
try {
ReflectUtil.checkPackageAccess(className);
checkPackageAccess(className);
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
return (ORB)orbClass.newInstance();

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, 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
@ -75,10 +75,11 @@ public abstract class InputStream extends org.omg.CORBA.portable.InputStream {
/**
* Create a new instance of this class.
*
* throw SecurityException if SecurityManager is installed and
* @implNote
* Throws SecurityException if SecurityManager is installed and
* enableSubclassImplementation SerializablePermission
* is not granted or jdk.corba.allowInputStreamSubclass system
* property is either not set or is set to 'false'
* property is either not set or is set to 'false'.
*/
public InputStream() {
this(checkPermission());

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, 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
@ -72,10 +72,11 @@ public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream {
/**
* Create a new instance of this class.
*
* throw SecurityException if SecurityManager is installed and
* @implNote
* Throws SecurityException if SecurityManager is installed and
* enableSubclassImplementation SerializablePermission
* is not granted or jdk.corba.allowOutputStreamSubclass system
* property is either not set or is set to 'false'
* property is either not set or is set to 'false'.
*/
public OutputStream() {
this(checkPermission());

@ -29,6 +29,10 @@ import java.io.OptionalDataException;
import java.lang.invoke.MethodHandle;
import java.lang.reflect.Field ;
import java.lang.reflect.Constructor ;
import java.lang.StackWalker;
import java.lang.StackWalker.StackFrame;
import java.util.Optional;
import java.util.stream.Stream;
import java.security.AccessController;
import java.security.Permission;
@ -58,6 +62,7 @@ import sun.reflect.ReflectionFactory;
* <li>RuntimePermission "reflectionFactoryAccess"</li>
* <li>BridgePermission "getBridge"</li>
* <li>ReflectPermission "suppressAccessChecks"</li>
* <li>StackFramePermission "retainClassReference"</li>
* </ul>
* <p>
* All of these permissions are required to obtain and correctly initialize
@ -89,9 +94,12 @@ public final class Bridge
) ;
private final ReflectionFactory reflectionFactory ;
private final StackWalker stackWalker;
private Bridge() {
reflectionFactory = ReflectionFactory.getReflectionFactory();
stackWalker = StackWalker.getInstance(
StackWalker.Option.RETAIN_CLASS_REFERENCE);
}
/** Fetch the Bridge singleton. This requires the following
@ -100,6 +108,7 @@ public final class Bridge
* <li>RuntimePermission "reflectionFactoryAccess"</li>
* <li>BridgePermission "getBridge"</li>
* <li>ReflectPermission "suppressAccessChecks"</li>
* <li>StackFramePermission "retainClassReference"</li>
* </ul>
* @return The singleton instance of the Bridge class
* @throws SecurityException if the caller does not have the
@ -118,11 +127,33 @@ public final class Bridge
return bridge ;
}
/** Returns true if the loader that loaded the frame's declaring class
* is a user loader (if it is not the platform class loader or one of
* its ancestor).
*/
private boolean isUserLoader(StackFrame sf) {
ClassLoader cl = sf.getDeclaringClass().getClassLoader();
if (cl == null) return false;
ClassLoader p = ClassLoader.getPlatformClassLoader();
while (cl != p && p != null) p = p.getParent();
return cl != p;
}
private Optional<StackFrame> getLatestUserDefinedLoaderFrame(Stream<StackFrame> stream) {
return stream.filter(this::isUserLoader).findFirst();
}
/** Obtain the latest user defined ClassLoader from the call stack.
* This is required by the RMI-IIOP specification.
*/
public final ClassLoader getLatestUserDefinedLoader() {
return jdk.internal.misc.VM.latestUserDefinedLoader();
// requires getClassLoader permission => needs doPrivileged.
PrivilegedAction<ClassLoader> pa = () ->
stackWalker.walk(this::getLatestUserDefinedLoaderFrame)
.map(sf -> sf.getDeclaringClass().getClassLoader())
.orElseGet(() -> ClassLoader.getPlatformClassLoader());
return AccessController.doPrivileged(pa);
}
/**

@ -556,3 +556,5 @@ a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146
2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151
31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152
217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153
a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154
f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2017, 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
@ -121,7 +121,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
-buildBase $(call FixPath, $(IDE_OUTPUTDIR)/vs-output) \
-buildSpace $(call FixPath, $(IDE_OUTPUTDIR)) \
-makeBinary $(call FixPath, $(MAKE)) \
-makeOutput $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-%f/libjvm) \
-makeOutput $(call FixPath, $(JDK_OUTPUTDIR)/bin/server) \
-absoluteInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
-absoluteSrcInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
$(EXTRACTED_DEFINES_client) \

@ -63,7 +63,7 @@ JVM_CFLAGS_INCLUDES += \
# INCLUDE_SUFFIX_* is only meant for including the proper
# platform files. Don't use it to guard code. Use the value of
# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
# Remaining TARGET_ARCH_* is needed to select the cpu specific
# Remaining TARGET_ARCH_* is needed to select the cpu specific
# sources for 64-bit ARM ports (arm versus aarch64).
JVM_CFLAGS_TARGET_DEFINES += \
-DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
@ -132,7 +132,7 @@ CFLAGS_VM_VERSION := \
#
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
ifeq ($(USE_PRECOMPILED_HEADER), 0)
ifeq ($(USE_PRECOMPILED_HEADER), false)
JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
endif
@ -145,7 +145,7 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm)
JVM_EXCLUDE_PATTERNS += arm_64
else ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-aarch64)
# For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm
# For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm
# hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm.
# Exclude the aarch64 and 32 bit arm files for this build.
ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2017, 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
@ -114,8 +114,8 @@ public class WinGammaPlatformVC10 extends WinGammaPlatform {
tag(cfg, "CodeAnalysisRuleAssemblies");
}
for (BuildConfig cfg : allConfigs) {
tagData(cfg, "NMakeBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile import-hotspot LOG=info");
tagData(cfg, "NMakeReBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot import-hotspot LOG=info");
tagData(cfg, "NMakeBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile hotspot LOG=info");
tagData(cfg, "NMakeReBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot hotspot LOG=info");
tagData(cfg, "NMakeCleanCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot LOG=info");
tagData(cfg, "NMakeOutput", cfg.get("MakeOutput") + Util.sep + "jvm.dll");
tagData(cfg, "NMakePreprocessorDefinitions", Util.join(";", cfg.getDefines()));

@ -192,4 +192,3 @@ JVM_AddModulePackage
JVM_AddReadsModule
JVM_DefineModule
JVM_SetBootLoaderUnnamedModule
JVM_GetModuleByPackageName

File diff suppressed because it is too large Load Diff

@ -532,8 +532,14 @@ void LIR_Assembler::poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo*
void LIR_Assembler::return_op(LIR_Opr result) {
assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == r0, "word returns are in r0,");
// Pop the stack before the safepoint code
__ remove_frame(initial_frame_size_in_bytes());
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
__ reserved_stack_check();
}
address polling_page(os::get_polling_page());
__ read_polling_page(rscratch1, polling_page, relocInfo::poll_return_type);
__ ret(lr);

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -1179,6 +1179,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Label done;
Label runtime;
// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ ldrw(tmp, in_progress);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ ldrb(tmp, in_progress);
}
__ cbzw(tmp, done);
// Can we store original value in the thread's buffer?
__ ldr(tmp, queue_index);
__ cbz(tmp, runtime);

@ -375,7 +375,8 @@ void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp
fr._unextended_sp = unextended_sp;
address original_pc = nm->get_original_pc(&fr);
assert(nm->insts_contains(original_pc), "original PC must be in nmethod");
assert(nm->insts_contains_inclusive(original_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
}
#endif
@ -629,6 +630,7 @@ void frame::describe_pd(FrameValues& values, int frame_no) {
DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);
DESCRIBE_FP_OFFSET(interpreter_frame_method);
DESCRIBE_FP_OFFSET(interpreter_frame_mdp);
DESCRIBE_FP_OFFSET(interpreter_frame_mirror);
DESCRIBE_FP_OFFSET(interpreter_frame_cache);
DESCRIBE_FP_OFFSET(interpreter_frame_locals);
DESCRIBE_FP_OFFSET(interpreter_frame_bcp);

@ -46,6 +46,9 @@
// [pointer to locals ] = locals() locals_offset
// [constant pool cache ] = cache() cache_offset
// [klass of method ] = mirror() mirror_offset
// [padding ]
// [methodData ] = mdp() mdx_offset
// [methodOop ] = method() method_offset

@ -82,7 +82,8 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
address original_pc = CompiledMethod::get_deopt_original_pc(this);
if (original_pc != NULL) {
_pc = original_pc;
assert(((CompiledMethod*)_cb)->insts_contains(_pc), "original PC must be in CompiledMethod");
assert(_cb->as_compiled_method()->insts_contains_inclusive(_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
_deopt_state = is_deoptimized;
} else {
_deopt_state = not_deoptimized;

@ -53,4 +53,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
// evidence that it's worth doing.
#define DEOPTIMIZE_WHEN_PATCHING
#define SUPPORT_RESERVED_STACK_AREA
#endif // CPU_AARCH64_VM_GLOBALDEFINITIONS_AARCH64_HPP

@ -46,8 +46,11 @@ define_pd_global(intx, InlineFrequencyCount, 100);
#define DEFAULT_STACK_YELLOW_PAGES (2)
#define DEFAULT_STACK_RED_PAGES (1)
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5))
#define DEFAULT_STACK_RESERVED_PAGES (0)
// Java_java_net_SocketOutputStream_socketWrite0() uses a 64k buffer on the
// stack if compiled for unix and LP64. To pass stack overflow tests we need
// 20 shadow pages.
#define DEFAULT_STACK_SHADOW_PAGES (20 DEBUG_ONLY(+5))
#define DEFAULT_STACK_RESERVED_PAGES (1)
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES

@ -619,6 +619,22 @@ void InterpreterMacroAssembler::remove_activation(
// get sender esp
ldr(esp,
Address(rfp, frame::interpreter_frame_sender_sp_offset * wordSize));
if (StackReservedPages > 0) {
// testing if reserved zone needs to be re-enabled
Label no_reserved_zone_enabling;
ldr(rscratch1, Address(rthread, JavaThread::reserved_stack_activation_offset()));
cmp(esp, rscratch1);
br(Assembler::LS, no_reserved_zone_enabling);
call_VM_leaf(
CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
call_VM(noreg, CAST_FROM_FN_PTR(address,
InterpreterRuntime::throw_delayed_StackOverflowError));
should_not_reach_here();
bind(no_reserved_zone_enabling);
}
// remove frame anchor
leave();
// If we're returning to interpreted code we will shortly be

@ -402,6 +402,30 @@ void MacroAssembler::far_jump(Address entry, CodeBuffer *cbuf, Register tmp) {
}
}
void MacroAssembler::reserved_stack_check() {
// testing if reserved zone needs to be enabled
Label no_reserved_zone_enabling;
ldr(rscratch1, Address(rthread, JavaThread::reserved_stack_activation_offset()));
cmp(sp, rscratch1);
br(Assembler::LO, no_reserved_zone_enabling);
enter(); // LR and FP are live.
lea(rscratch1, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone));
mov(c_rarg0, rthread);
blr(rscratch1);
leave();
// We have already removed our own frame.
// throw_delayed_StackOverflowError will think that it's been
// called by our caller.
lea(rscratch1, RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry()));
br(rscratch1);
should_not_reach_here();
bind(no_reserved_zone_enabling);
}
int MacroAssembler::biased_locking_enter(Register lock_reg,
Register obj_reg,
Register swap_reg,

@ -957,6 +957,9 @@ public:
// stack overflow + shadow pages. Also, clobbers tmp
void bang_stack_size(Register size, Register tmp);
// Check for reserved stack access in method being exited (for JIT)
void reserved_stack_check();
virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
Register tmp,
int offset);

@ -4676,8 +4676,11 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_throw_StackOverflowError_entry =
generate_throw_exception("StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address,
SharedRuntime::
throw_StackOverflowError));
SharedRuntime::throw_StackOverflowError));
StubRoutines::_throw_delayed_StackOverflowError_entry =
generate_throw_exception("delayed StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address,
SharedRuntime::throw_delayed_StackOverflowError));
if (UseCRC32Intrinsics) {
// set table address before stub generation which use it
StubRoutines::_crc_table_adr = (address)StubRoutines::aarch64::_crc_table;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, 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
@ -551,6 +551,8 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
const Register r_index_1 = R1;
const Register r_buffer_2 = R2;
Address queue_active(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_active()));
Address queue_index(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_index()));
Address buffer(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() +
@ -559,6 +561,11 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Label done;
Label runtime;
// Is marking still active?
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ ldrb(R1, queue_active);
__ cbz(R1, done);
__ ldr(r_index_1, queue_index);
__ ldr(r_pre_val_0, Address(SP, nb_saved_regs*wordSize));
__ ldr(r_buffer_2, buffer);

@ -364,7 +364,8 @@ void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp
fr._unextended_sp = unextended_sp;
address original_pc = nm->get_original_pc(&fr);
assert(nm->insts_contains(original_pc), "original PC must be in nmethod");
assert(nm->insts_contains_inclusive(original_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be");
}
#endif

@ -75,7 +75,8 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
address original_pc = CompiledMethod::get_deopt_original_pc(this);
if (original_pc != NULL) {
_pc = original_pc;
assert(_cb->as_compiled_method()->insts_contains(_pc), "original PC must be in CompiledMethod");
assert(_cb->as_compiled_method()->insts_contains_inclusive(_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
_deopt_state = is_deoptimized;
} else {
_deopt_state = not_deoptimized;

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -741,7 +741,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Register tmp = R14;
Register tmp2 = R15;
Label refill, restart;
Label refill, restart, marking_not_active;
int satb_q_active_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_active());
int satb_q_index_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_index());
@ -753,6 +756,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ std(tmp, -16, R1_SP);
__ std(tmp2, -24, R1_SP);
// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ lwz(tmp, satb_q_active_byte_offset, R16_thread);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ lbz(tmp, satb_q_active_byte_offset, R16_thread);
}
__ cmpdi(CCR0, tmp, 0);
__ beq(CCR0, marking_not_active);
__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
// size_t so ld_ptr is appropriate.
@ -769,6 +782,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ std(tmp, satb_q_index_byte_offset, R16_thread);
__ stdx(pre_val, tmp2, tmp); // [_buf + index] := <address_of_card>
__ bind(marking_not_active);
// Restore temp registers and return-from-leaf.
__ ld(tmp2, -24, R1_SP);
__ ld(tmp, -16, R1_SP);

@ -2569,7 +2569,7 @@ void MacroAssembler::rtm_retry_lock_on_abort(Register retry_count_Reg, Register
}
// Spin and retry if lock is busy.
// inputs: box_Reg (monitor address)
// inputs: owner_addr_Reg (monitor address)
// : retry_count_Reg
// output: retry_count_Reg decremented by 1
// CTR is killed
@ -2577,15 +2577,22 @@ void MacroAssembler::rtm_retry_lock_on_busy(Register retry_count_Reg, Register o
Label SpinLoop, doneRetry;
addic_(retry_count_Reg, retry_count_Reg, -1);
blt(CCR0, doneRetry);
li(R0, RTMSpinLoopCount);
mtctr(R0);
if (RTMSpinLoopCount > 1) {
li(R0, RTMSpinLoopCount);
mtctr(R0);
}
bind(SpinLoop);
smt_yield(); // Can't use waitrsv(). No permission (SIGILL).
bdz(retryLabel);
ld(R0, 0, owner_addr_Reg);
cmpdi(CCR0, R0, 0);
bne(CCR0, SpinLoop);
if (RTMSpinLoopCount > 1) {
bdz(retryLabel);
ld(R0, 0, owner_addr_Reg);
cmpdi(CCR0, R0, 0);
bne(CCR0, SpinLoop);
}
b(retryLabel);
bind(doneRetry);

@ -327,7 +327,10 @@ void VM_Version::initialize() {
warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50");
FLAG_SET_DEFAULT(RTMAbortRatio, 50);
}
guarantee(RTMSpinLoopCount > 0, "unsupported");
if (RTMSpinLoopCount < 0) {
warning("RTMSpinLoopCount must not be a negative value, resetting it to 0");
FLAG_SET_DEFAULT(RTMSpinLoopCount, 0);
}
#else
// Only C2 does RTM locking optimization.
// Can't continue because UseRTMLocking affects UseBiasedLocking flag

@ -1105,16 +1105,16 @@ void LIR_Assembler::reg2mem(LIR_Opr from, LIR_Opr dest_opr, BasicType type,
}
case T_FLOAT :
if (short_disp) {
__ z_ste(from->as_float_reg(), disp_value, disp_reg, dest);
__ z_ste(from->as_float_reg(), disp_value, disp_reg, dest);
} else {
__ z_stey(from->as_float_reg(), disp_value, disp_reg, dest);
__ z_stey(from->as_float_reg(), disp_value, disp_reg, dest);
}
break;
case T_DOUBLE:
if (short_disp) {
__ z_std(from->as_double_reg(), disp_value, disp_reg, dest);
__ z_std(from->as_double_reg(), disp_value, disp_reg, dest);
} else {
__ z_stdy(from->as_double_reg(), disp_value, disp_reg, dest);
__ z_stdy(from->as_double_reg(), disp_value, disp_reg, dest);
}
break;
default: ShouldNotReachHere();
@ -1148,6 +1148,10 @@ void LIR_Assembler::return_op(LIR_Opr result) {
__ restore_return_pc();
}
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
__ reserved_stack_check(Z_R14);
}
// We need to mark the code position where the load from the safepoint
// polling page was emitted as relocInfo::poll_return_type here.
__ relocate(relocInfo::poll_return_type);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -784,7 +784,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Register tmp = Z_R6; // Must be non-volatile because it is used to save pre_val.
Register tmp2 = Z_R7;
Label refill, restart;
Label refill, restart, marking_not_active;
int satb_q_active_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_active());
int satb_q_index_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_index());
@ -796,6 +799,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ z_stg(tmp, 0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
__ z_stg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ load_and_test_int(tmp, Address(Z_thread, satb_q_active_byte_offset));
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ load_and_test_byte(tmp, Address(Z_thread, satb_q_active_byte_offset));
}
__ z_bre(marking_not_active); // Activity indicator is zero, so there is no marking going on currently.
__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
// size_t so ld_ptr is appropriate.
@ -810,6 +822,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ z_stg(pre_val, 0, tmp, tmp2); // [_buf + index] := <address_of_card>
__ z_stg(tmp, satb_q_index_byte_offset, Z_thread);
__ bind(marking_not_active);
// Restore tmp registers (see assertion in G1PreBarrierStub::emit_code()).
__ z_lg(tmp, 0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
__ z_lg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);

@ -52,4 +52,6 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
// The expected size in bytes of a cache line, used to pad data structures.
#define DEFAULT_CACHE_LINE_SIZE 256
#define SUPPORT_RESERVED_STACK_AREA
#endif // CPU_S390_VM_GLOBALDEFINITIONS_S390_HPP

@ -56,7 +56,7 @@ define_pd_global(intx, InlineSmallCode, 2000);
// Java_java_net_SocketOutputStream_socketWrite0() uses a 64k buffer on the
// stack. To pass stack overflow tests we need 20 shadow pages.
#define DEFAULT_STACK_SHADOW_PAGES (20 DEBUG_ONLY(+2))
#define DEFAULT_STACK_RESERVED_PAGES (0)
#define DEFAULT_STACK_RESERVED_PAGES (1)
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES

@ -860,16 +860,39 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
bool throw_monitor_exception,
bool install_monitor_exception,
bool notify_jvmti) {
BLOCK_COMMENT("remove_activation {");
unlock_if_synchronized_method(state, throw_monitor_exception, install_monitor_exception);
// Save result (push state before jvmti call and pop it afterwards) and notify jvmti.
notify_method_exit(false, state, notify_jvmti ? NotifyJVMTI : SkipNotifyJVMTI);
if (StackReservedPages > 0) {
BLOCK_COMMENT("reserved_stack_check:");
// Test if reserved zone needs to be enabled.
Label no_reserved_zone_enabling;
// Compare frame pointers. There is no good stack pointer, as with stack
// frame compression we can get different SPs when we do calls. A subsequent
// call could have a smaller SP, so that this compare succeeds for an
// inner call of the method annotated with ReservedStack.
z_lg(Z_R0, Address(Z_SP, (intptr_t)_z_abi(callers_sp)));
z_clg(Z_R0, Address(Z_thread, JavaThread::reserved_stack_activation_offset())); // Compare with frame pointer in memory.
z_brl(no_reserved_zone_enabling);
// Enable reserved zone again, throw stack overflow exception.
call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), Z_thread);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError));
should_not_reach_here();
bind(no_reserved_zone_enabling);
}
verify_oop(Z_tos, state);
verify_thread();
pop_interpreter_frame(return_pc, Z_ARG2, Z_ARG3);
BLOCK_COMMENT("} remove_activation");
}
// lock object

@ -2666,6 +2666,32 @@ void MacroAssembler::bang_stack_with_offset(int offset) {
}
}
void MacroAssembler::reserved_stack_check(Register return_pc) {
// Test if reserved zone needs to be enabled.
Label no_reserved_zone_enabling;
assert(return_pc == Z_R14, "Return pc must be in R14 before z_br() to StackOverflow stub.");
BLOCK_COMMENT("reserved_stack_check {");
z_clg(Z_SP, Address(Z_thread, JavaThread::reserved_stack_activation_offset()));
z_brl(no_reserved_zone_enabling);
// Enable reserved zone again, throw stack overflow exception.
save_return_pc();
push_frame_abi160(0);
call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), Z_thread);
pop_frame();
restore_return_pc();
load_const_optimized(Z_R1, StubRoutines::throw_delayed_StackOverflowError_entry());
// Don't use call() or z_basr(), they will invalidate Z_R14 which contains the return pc.
z_br(Z_R1);
should_not_reach_here();
bind(no_reserved_zone_enabling);
BLOCK_COMMENT("} reserved_stack_check");
}
// Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes.
void MacroAssembler::tlab_allocate(Register obj,
Register var_size_in_bytes,

@ -627,6 +627,11 @@ class MacroAssembler: public Assembler {
// Stack overflow checking
void bang_stack_with_offset(int offset);
// Check for reserved stack access in method being exited. If the reserved
// stack area was accessed, protect it again and throw StackOverflowError.
// Uses Z_R1.
void reserved_stack_check(Register return_pc);
// Atomics
// -- none?

@ -909,15 +909,8 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
// If this does safepoint polling, then do it here.
bool need_polling = do_polling() && C->is_method_compilation();
// Touch the polling page.
// Part 1: get the page's address.
if (need_polling) {
AddressLiteral pp(os::get_polling_page());
__ load_const_optimized(Z_R1_scratch, pp);
}
// Pop frame, restore return_pc, and all stuff needed by interpreter.
// Pop frame by add insted of load (a penny saved is a penny got :-).
// Pop frame by add instead of load (a penny saved is a penny got :-).
int frame_size_in_bytes = Assembler::align((C->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
int retPC_offset = frame_size_in_bytes + _z_abi16(return_pc);
if (Displacement::is_validDisp(retPC_offset)) {
@ -928,9 +921,14 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ restore_return_pc();
}
// Touch the polling page,
// part 2: touch the page now.
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
__ reserved_stack_check(Z_R14);
}
// Touch the polling page.
if (need_polling) {
AddressLiteral pp(os::get_polling_page());
__ load_const_optimized(Z_R1_scratch, pp);
// We need to mark the code position where the load from the safepoint
// polling page was emitted as relocInfo::poll_return_type here.
__ relocate(relocInfo::poll_return_type);
@ -939,7 +937,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
}
uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
// variable size. determine dynamically.
// Variable size. determine dynamically.
return MachNode::size(ra_);
}

@ -2433,13 +2433,12 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_throw_StackOverflowError_entry =
generate_throw_exception("StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false);
StubRoutines::_throw_delayed_StackOverflowError_entry =
generate_throw_exception("delayed StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError), false);
//----------------------------------------------------------------------
// Entry points that are platform specific.
// Build this early so it's available for the interpreter.
StubRoutines::_throw_StackOverflowError_entry =
generate_throw_exception("StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false);
if (UseCRC32Intrinsics) {
// We have no CRC32 table on z/Architecture.

@ -1112,16 +1112,21 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
// top_frame_size = TOP_IJAVA_FRAME_ABI + max_stack + size of interpreter state
__ add2reg(top_frame_size,
frame::z_top_ijava_frame_abi_size +
frame::z_ijava_state_size +
frame::interpreter_frame_monitor_size() * wordSize,
frame::z_ijava_state_size +
frame::interpreter_frame_monitor_size() * wordSize,
max_stack);
// Check if there's room for the new frame...
Register frame_size = max_stack; // Reuse the regiser for max_stack.
__ z_lgr(frame_size, Z_SP);
__ z_sgr(frame_size, sp_after_resize);
__ z_agr(frame_size, top_frame_size);
generate_stack_overflow_check(frame_size, fp/*tmp1*/);
if (!native_call) {
// Stack overflow check.
// Native calls don't need the stack size check since they have no
// expression stack and the arguments are already on the stack and
// we only add a handful of words to the stack.
Register frame_size = max_stack; // Reuse the regiser for max_stack.
__ z_lgr(frame_size, Z_SP);
__ z_sgr(frame_size, sp_after_resize);
__ z_agr(frame_size, top_frame_size);
generate_stack_overflow_check(frame_size, fp/*tmp1*/);
}
DEBUG_ONLY(__ z_cg(Z_R14, _z_abi16(return_pc), Z_SP));
__ asm_assert_eq("killed Z_R14", 0);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, 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
@ -694,6 +694,7 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) {
int store_offset;
if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) {
assert(base != O7, "destroying register");
assert(!unaligned, "can't handle this");
// for offsets larger than a simm13 we setup the offset in O7
__ set(offset, O7);
@ -712,9 +713,12 @@ int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType
case T_LONG :
#ifdef _LP64
if (unaligned || PatchALot) {
__ srax(from_reg->as_register_lo(), 32, O7);
// Don't use O7 here because it may be equal to 'base' (see LIR_Assembler::reg2mem)
assert(G3_scratch != base, "can't handle this");
assert(G3_scratch != from_reg->as_register_lo(), "can't handle this");
__ srax(from_reg->as_register_lo(), 32, G3_scratch);
__ stw(from_reg->as_register_lo(), base, offset + lo_word_offset_in_bytes);
__ stw(O7, base, offset + hi_word_offset_in_bytes);
__ stw(G3_scratch, base, offset + hi_word_offset_in_bytes);
} else {
__ stx(from_reg->as_register_lo(), base, offset);
}
@ -821,7 +825,7 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
case T_SHORT : __ ldsh(base, offset, to_reg->as_register()); break;
case T_INT : __ ld(base, offset, to_reg->as_register()); break;
case T_LONG :
if (!unaligned) {
if (!unaligned && !PatchALot) {
#ifdef _LP64
__ ldx(base, offset, to_reg->as_register_lo());
#else
@ -1297,7 +1301,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type,
disp_reg = O7;
}
} else if (unaligned || PatchALot) {
__ add(src, addr->index()->as_register(), O7);
__ add(src, addr->index()->as_pointer_register(), O7);
src = O7;
} else {
disp_reg = addr->index()->as_pointer_register();
@ -1424,7 +1428,7 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
disp_reg = O7;
}
} else if (unaligned || PatchALot) {
__ add(src, addr->index()->as_register(), O7);
__ add(src, addr->index()->as_pointer_register(), O7);
src = O7;
} else {
disp_reg = addr->index()->as_pointer_register();

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@ -856,7 +856,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Register tmp2 = G3_scratch;
Label refill, restart;
bool with_frame = false; // I don't know if we can do with-frame.
int satb_q_active_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_active());
int satb_q_index_byte_offset =
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_index());
@ -864,6 +866,17 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_buf());
// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ ld(G2_thread, satb_q_active_byte_offset, tmp);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ ldsb(G2_thread, satb_q_active_byte_offset, tmp);
}
__ cmp_and_br_short(tmp, G0, Assembler::notEqual, Assembler::pt, restart);
__ retl();
__ delayed()->nop();
__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
// size_t so ld_ptr is appropriate

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@ -1623,6 +1623,8 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
NOT_LP64(__ get_thread(thread);)
Address queue_active(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_active()));
Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
SATBMarkQueue::byte_offset_of_index()));
Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
@ -1631,6 +1633,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
Label done;
Label runtime;
// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ cmpl(queue_active, 0);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ cmpb(queue_active, 0);
}
__ jcc(Assembler::equal, done);
// Can we store original value in the thread's buffer?
__ movptr(tmp, queue_index);

@ -376,7 +376,8 @@ void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp
fr._unextended_sp = unextended_sp;
address original_pc = nm->get_original_pc(&fr);
assert(nm->insts_contains(original_pc), "original PC must be in CompiledMethod");
assert(nm->insts_contains_inclusive(original_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
}
#endif

@ -75,7 +75,8 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
address original_pc = CompiledMethod::get_deopt_original_pc(this);
if (original_pc != NULL) {
_pc = original_pc;
assert(((CompiledMethod*)_cb)->insts_contains(_pc), "original PC must be in CompiledMethod");
assert(_cb->as_compiled_method()->insts_contains_inclusive(_pc),
"original PC must be in the main code section of the the compiled method (or must be immediately following it)");
_deopt_state = is_deoptimized;
} else {
if (_cb->is_deoptimization_stub()) {

@ -3499,12 +3499,12 @@ void MacroAssembler::movdqu(XMMRegister dst, XMMRegister src) {
}
}
void MacroAssembler::movdqu(XMMRegister dst, AddressLiteral src) {
void MacroAssembler::movdqu(XMMRegister dst, AddressLiteral src, Register scratchReg) {
if (reachable(src)) {
movdqu(dst, as_Address(src));
} else {
lea(rscratch1, src);
movdqu(dst, Address(rscratch1, 0));
lea(scratchReg, src);
movdqu(dst, Address(scratchReg, 0));
}
}

@ -1085,7 +1085,7 @@ public:
void movdqu(Address dst, XMMRegister src);
void movdqu(XMMRegister dst, Address src);
void movdqu(XMMRegister dst, XMMRegister src);
void movdqu(XMMRegister dst, AddressLiteral src);
void movdqu(XMMRegister dst, AddressLiteral src, Register scratchReg = rscratch1);
// AVX Unaligned forms
void vmovdqu(Address dst, XMMRegister src);
void vmovdqu(XMMRegister dst, Address src);

@ -817,7 +817,7 @@ enum {
movl(d, Address(CTX, 4*3));
movl(e, Address(CTX, 4*4));
movl(f, Address(CTX, 4*5));
movl(g, Address(CTX, 4*6));
// load g - r10 after it is used as scratch
movl(h, Address(CTX, 4*7));
pshuffle_byte_flip_mask_addr = pshuffle_byte_flip_mask;
@ -825,6 +825,8 @@ enum {
vmovdqu(SHUF_00BA, ExternalAddress(pshuffle_byte_flip_mask_addr + 32)); //[_SHUF_00BA wrt rip]
vmovdqu(SHUF_DC00, ExternalAddress(pshuffle_byte_flip_mask_addr + 64)); //[_SHUF_DC00 wrt rip]
movl(g, Address(CTX, 4*6));
movq(Address(rsp, _CTX), CTX); // store
bind(loop0);
@ -977,7 +979,7 @@ bind(only_one_block);
movl(d, Address(CTX, 4*3)); // 0xa54ff53a
movl(e, Address(CTX, 4*4)); // 0x510e527f
movl(f, Address(CTX, 4*5)); // 0x9b05688c
movl(g, Address(CTX, 4*6)); // 0x1f83d9ab
// load g - r10 after use as scratch
movl(h, Address(CTX, 4*7)); // 0x5be0cd19
@ -986,6 +988,8 @@ bind(only_one_block);
vmovdqu(SHUF_00BA, ExternalAddress(pshuffle_byte_flip_mask_addr + 32)); //[_SHUF_00BA wrt rip]
vmovdqu(SHUF_DC00, ExternalAddress(pshuffle_byte_flip_mask_addr + 64)); //[_SHUF_DC00 wrt rip]
movl(g, Address(CTX, 4*6)); // 0x1f83d9ab
movq(Address(rsp, _CTX), CTX);
jmpb(do_last_block);
@ -1154,9 +1158,8 @@ void MacroAssembler::sha512_AVX2_one_round_and_schedule(
// Move to appropriate lanes for calculating w[16] and w[17]
vperm2f128(xmm4, xmm0, xmm0, 0); //xmm4 = W[-16] + W[-7] + s0{ BABA }
address MASK_YMM_LO = StubRoutines::x86::pshuffle_byte_flip_mask_addr_sha512();
//Move to appropriate lanes for calculating w[18] and w[19]
vpand(xmm0, xmm0, ExternalAddress(MASK_YMM_LO + 32), AVX_256bit); //xmm0 = W[-16] + W[-7] + s0{ DC00 }
vpand(xmm0, xmm0, xmm10, AVX_256bit); //xmm0 = W[-16] + W[-7] + s0{ DC00 }
//Calculate w[16] and w[17] in both 128 bit lanes
//Calculate sigma1 for w[16] and w[17] on both 128 bit lanes
vperm2f128(xmm2, xmm7, xmm7, 17); //xmm2 = W[-2] {BABA}
@ -1250,6 +1253,7 @@ void MacroAssembler::sha512_AVX2(XMMRegister msg, XMMRegister state0, XMMRegiste
const XMMRegister& XFER = xmm0; // YTMP0
const XMMRegister& BYTE_FLIP_MASK = xmm9; // ymm9
const XMMRegister& YMM_MASK_LO = xmm10; // ymm10
#ifdef _WIN64
const Register& INP = rcx; //1st arg
const Register& CTX = rdx; //2nd arg
@ -1368,11 +1372,14 @@ void MacroAssembler::sha512_AVX2(XMMRegister msg, XMMRegister state0, XMMRegiste
movq(d, Address(CTX, 8 * 3));
movq(e, Address(CTX, 8 * 4));
movq(f, Address(CTX, 8 * 5));
movq(g, Address(CTX, 8 * 6));
// load g - r10 after it is used as scratch
movq(h, Address(CTX, 8 * 7));
pshuffle_byte_flip_mask_addr = pshuffle_byte_flip_mask_sha512;
vmovdqu(BYTE_FLIP_MASK, ExternalAddress(pshuffle_byte_flip_mask_addr + 0)); //PSHUFFLE_BYTE_FLIP_MASK wrt rip
vmovdqu(YMM_MASK_LO, ExternalAddress(pshuffle_byte_flip_mask_addr + 32));
movq(g, Address(CTX, 8 * 6));
bind(loop0);
lea(TBL, ExternalAddress(K512_W));

@ -3207,7 +3207,7 @@ class StubGenerator: public StubCodeGenerator {
const Register len_reg = c_rarg4; // src len (must be multiple of blocksize 16)
#else
const Address len_mem(rbp, 6 * wordSize); // length is on stack on Win64
const Register len_reg = r10; // pick the first volatile windows register
const Register len_reg = r11; // pick the volatile windows register
#endif
const Register pos = rax;
@ -3404,7 +3404,7 @@ class StubGenerator: public StubCodeGenerator {
const Register len_reg = c_rarg4; // src len (must be multiple of blocksize 16)
#else
const Address len_mem(rbp, 6 * wordSize); // length is on stack on Win64
const Register len_reg = r10; // pick the first volatile windows register
const Register len_reg = r11; // pick the volatile windows register
#endif
const Register pos = rax;
@ -3930,7 +3930,7 @@ class StubGenerator: public StubCodeGenerator {
__ push(rbx); // Save RBX
__ movdqu(xmm_curr_counter, Address(counter, 0x00)); // initialize counter with initial counter
__ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr()));
__ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr()), pos); // pos as scratch
__ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled
__ movptr(pos, 0);
@ -3953,7 +3953,7 @@ class StubGenerator: public StubCodeGenerator {
__ movl(Address(used_addr, 0), used);
// key length could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()), rbx); // rbx as scratch
__ movl(rbx, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
__ cmpl(rbx, 52);
__ jcc(Assembler::equal, L_multiBlock_loopTop[1]);

@ -37,6 +37,7 @@ import jdk.tools.jaotc.binformat.Symbol.Binding;
import jdk.tools.jaotc.binformat.Symbol.Kind;
import jdk.tools.jaotc.binformat.elf.JELFRelocObject;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
/**
* A format-agnostic container class that holds various components of a binary.
@ -257,9 +258,9 @@ public class BinaryContainer implements SymbolTable {
* prefix {@code prefix}. It also initializes internal code container, symbol table and
* relocation tables.
*/
public BinaryContainer(GraalHotSpotVMConfig config, String jvmVersion) {
this.codeSegmentSize = config.codeSegmentSize;
this.codeEntryAlignment = config.codeEntryAlignment;
public BinaryContainer(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, String jvmVersion) {
this.codeSegmentSize = graalHotSpotVMConfig.codeSegmentSize;
this.codeEntryAlignment = graalHotSpotVMConfig.codeEntryAlignment;
// read only, code
codeContainer = new CodeContainer(".text", this);
@ -289,30 +290,31 @@ public class BinaryContainer implements SymbolTable {
addGlobalSymbols();
recordConfiguration(config);
recordConfiguration(graalHotSpotVMConfig, graphBuilderConfig);
}
private void recordConfiguration(GraalHotSpotVMConfig config) {
private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig) {
// @formatter:off
boolean[] booleanFlags = { config.cAssertions, // Debug VM
config.useCompressedOops,
config.useCompressedClassPointers,
config.compactFields,
config.useG1GC,
config.useCMSGC,
config.useTLAB,
config.useBiasedLocking,
boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM
graalHotSpotVMConfig.useCompressedOops,
graalHotSpotVMConfig.useCompressedClassPointers,
graalHotSpotVMConfig.compactFields,
graalHotSpotVMConfig.useG1GC,
graalHotSpotVMConfig.useCMSGC,
graalHotSpotVMConfig.useTLAB,
graalHotSpotVMConfig.useBiasedLocking,
TieredAOT.getValue(),
config.enableContended,
config.restrictContended,
graalHotSpotVMConfig.enableContended,
graalHotSpotVMConfig.restrictContended,
graphBuilderConfig.omitAssertions()
};
int[] intFlags = { config.narrowOopShift,
config.narrowKlassShift,
config.contendedPaddingWidth,
config.fieldsAllocationStyle,
config.objectAlignment,
config.codeSegmentSize,
int[] intFlags = { graalHotSpotVMConfig.getOopEncoding().shift,
graalHotSpotVMConfig.getKlassEncoding().shift,
graalHotSpotVMConfig.contendedPaddingWidth,
graalHotSpotVMConfig.fieldsAllocationStyle,
1 << graalHotSpotVMConfig.getOopEncoding().alignment,
graalHotSpotVMConfig.codeSegmentSize,
};
// @formatter:on
@ -395,6 +397,10 @@ public class BinaryContainer implements SymbolTable {
return "_aot_narrow_klass_base_address";
}
public String getNarrowOopBaseAddressSymbolName() {
return "_aot_narrow_oop_base_address";
}
public String getLogOfHeapRegionGrainBytesSymbolName() {
return "_aot_log_of_heap_region_grain_bytes";
}
@ -445,6 +451,7 @@ public class BinaryContainer implements SymbolTable {
createGotSymbol(getHeapTopAddressSymbolName());
createGotSymbol(getHeapEndAddressSymbolName());
createGotSymbol(getNarrowKlassBaseAddressSymbolName());
createGotSymbol(getNarrowOopBaseAddressSymbolName());
createGotSymbol(getPollingPageSymbolName());
createGotSymbol(getLogOfHeapRegionGrainBytesSymbolName());
createGotSymbol(getInlineContiguousAllocationSupportedSymbolName());

@ -77,10 +77,14 @@ public class AOTBackend {
this.filters = filters;
providers = backend.getProviders();
codeCache = providers.getCodeCache();
graphBuilderSuite = initGraphBuilderSuite(backend);
graphBuilderSuite = initGraphBuilderSuite(backend, main.options.compileWithAssertions);
highTierContext = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.ALL);
}
public PhaseSuite<HighTierContext> getGraphBuilderSuite() {
return graphBuilderSuite;
}
private Suites getSuites() {
// create suites every time, as we modify options for the compiler
return backend.getSuites().getDefaultSuites();
@ -146,14 +150,14 @@ public class AOTBackend {
return backend.getRuntime().getVMConfig().cAssertions;
}
private static PhaseSuite<HighTierContext> initGraphBuilderSuite(HotSpotBackend backend) {
private static PhaseSuite<HighTierContext> initGraphBuilderSuite(HotSpotBackend backend, boolean compileWithAssertions) {
PhaseSuite<HighTierContext> graphBuilderSuite = backend.getSuites().getDefaultGraphBuilderSuite().copy();
ListIterator<BasePhase<? super HighTierContext>> iterator = graphBuilderSuite.findPhase(GraphBuilderPhase.class);
GraphBuilderConfiguration baseConfig = ((GraphBuilderPhase) iterator.previous()).getGraphBuilderConfig();
// Use all default plugins.
Plugins plugins = baseConfig.getPlugins();
GraphBuilderConfiguration aotConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
GraphBuilderConfiguration aotConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withOmitAssertions(!compileWithAssertions);
iterator.next();
iterator.remove();

@ -293,12 +293,18 @@ public class AOTCompiledClass {
// Record methods holder
methodInfo.addDependentKlassData(binaryContainer, resolvedJavaType);
// Record inlinee classes
for (ResolvedJavaMethod m : methodInfo.getCompilationResult().getMethods()) {
methodInfo.addDependentKlassData(binaryContainer, (HotSpotResolvedObjectType) m.getDeclaringClass());
ResolvedJavaMethod[] inlinees = methodInfo.getCompilationResult().getMethods();
if (inlinees != null) {
for (ResolvedJavaMethod m : inlinees) {
methodInfo.addDependentKlassData(binaryContainer, (HotSpotResolvedObjectType) m.getDeclaringClass());
}
}
// Record classes of fields that were accessed
for (ResolvedJavaField f : methodInfo.getCompilationResult().getFields()) {
methodInfo.addDependentKlassData(binaryContainer, (HotSpotResolvedObjectType) f.getDeclaringClass());
ResolvedJavaField[] fields = methodInfo.getCompilationResult().getFields();
if (fields != null) {
for (ResolvedJavaField f : fields) {
methodInfo.addDependentKlassData(binaryContainer, (HotSpotResolvedObjectType) f.getDeclaringClass());
}
}
}
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
package jdk.tools.jaotc;/*
* Copyright (c) 2015, 2017, 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
@ -20,45 +20,45 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package plugin;
import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
import jdk.tools.jlink.plugin.ResourcePoolEntry;
import jdk.tools.jlink.plugin.ResourcePool;
import jdk.tools.jlink.plugin.ResourcePoolBuilder;
import jdk.tools.jlink.plugin.Plugin;
public class LoadedClass {
private final String name;
private final Class<?> clz;
public class CustomPlugin implements Plugin {
private final static String NAME = "custom-plugin";
public CustomPlugin() {
public LoadedClass(String name, Class<?> clz) {
this.name = name;
this.clz = clz;
}
@Override
public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out) {
in.transformAndCopy(Function.identity(), out);
return out.build();
}
@Override
public String getName() {
return NAME;
return name;
}
public Class<?> getLoadedClass() {
return clz;
}
@Override
public String getDescription() {
return NAME + "-description";
public String toString() {
return name;
}
@Override
public void configure(Map<String, String> config) {
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof LoadedClass)) return false;
LoadedClass that = (LoadedClass) o;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
return clz != null ? clz.equals(that.clz) : that.clz == null;
}
@Override
public Category getType() {
return Category.PROCESSOR;
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (clz != null ? clz.hashCode() : 0);
return result;
}
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,19 +43,31 @@ import java.nio.file.Paths;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import java.util.stream.Stream;
import jdk.tools.jaotc.binformat.BinaryContainer;
import jdk.tools.jaotc.binformat.ByteContainer;
import jdk.tools.jaotc.collect.ClassCollector;
import jdk.tools.jaotc.collect.*;
import jdk.tools.jaotc.collect.classname.ClassNameSourceProvider;
import jdk.tools.jaotc.collect.directory.DirectorySourceProvider;
import jdk.tools.jaotc.collect.jar.JarSourceProvider;
import jdk.tools.jaotc.collect.module.ModuleSourceProvider;
import jdk.tools.jaotc.utils.Timer;
import org.graalvm.compiler.api.runtime.GraalJVMCICompiler;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
import org.graalvm.compiler.hotspot.HotSpotHostBackend;
import org.graalvm.compiler.java.GraphBuilderPhase;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
import org.graalvm.compiler.phases.BasePhase;
import org.graalvm.compiler.phases.PhaseSuite;
import org.graalvm.compiler.phases.tiers.HighTierContext;
import org.graalvm.compiler.runtime.RuntimeProvider;
import jdk.vm.ci.meta.MetaAccessProvider;
@ -120,17 +132,7 @@ public class Main implements LogPrinter {
abstract void process(Main task, String opt, String arg) throws BadArgs;
}
static Option[] recognizedOptions = {new Option(" --module <name> Module to compile", true, "--module") {
@Override
void process(Main task, String opt, String arg) {
task.options.module = arg;
}
}, new Option(" --module-path <path> Specify where to find module to compile", true, "--module-path") {
@Override
void process(Main task, String opt, String arg) {
task.options.modulepath = arg;
}
}, new Option(" --output <file> Output file name", true, "--output") {
static Option[] recognizedOptions = { new Option(" --output <file> Output file name", true, "--output") {
@Override
void process(Main task, String opt, String arg) {
String name = arg;
@ -139,22 +141,48 @@ public class Main implements LogPrinter {
}
task.options.outputName = name;
}
}, new Option(" --class-name <class names> List of classes to compile", true, "--class-name", "--classname") {
@Override
void process(Main task, String opt, String arg) {
task.options.files.addAll(ClassSearch.makeList(ClassNameSourceProvider.TYPE, arg));
}
}, new Option(" --jar <jarfiles> List of jar files to compile", true, "--jar") {
@Override
void process(Main task, String opt, String arg) {
task.options.files.addAll(ClassSearch.makeList(JarSourceProvider.TYPE, arg));
}
}, new Option(" --module <modules> List of modules to compile", true, "--module") {
@Override
void process(Main task, String opt, String arg) {
task.options.files.addAll(ClassSearch.makeList(ModuleSourceProvider.TYPE, arg));
}
}, new Option(" --directory <dirs> List of directories where to search for files to compile", true, "--directory") {
@Override
void process(Main task, String opt, String arg) {
task.options.files.addAll(ClassSearch.makeList(DirectorySourceProvider.TYPE, arg));
}
}, new Option(" --search-path <dirs> List of directories where to search for specified files", true, "--search-path") {
@Override
void process(Main task, String opt, String arg) {
String[] elements = arg.split(":");
task.options.searchPath.add(elements);
}
}, new Option(" --compile-commands <file> Name of file with compile commands", true, "--compile-commands") {
@Override
void process(Main task, String opt, String arg) {
task.options.methodList = arg;
}
}, new Option(" --compile-for-tiered Generated profiling code for tiered compilation", false, "--compile-for-tiered") {
}, new Option(" --compile-for-tiered Generate profiling code for tiered compilation", false, "--compile-for-tiered") {
@Override
void process(Main task, String opt, String arg) {
TieredAOT.setValue(true);
}
}, new Option(" --classpath <path> Specify where to find user class files", true, "--classpath", "--class-path") {
}, new Option(" --compile-with-assertions Compile with java assertions", false, "--compile-with-assertions") {
@Override
void process(Main task, String opt, String arg) {
task.options.classpath = arg;
task.options.compileWithAssertions = true;
}
}, new Option(" --threads <number> Number of compilation threads to be used", true, "--threads") {
}, new Option(" --compile-threads <number> Number of compilation threads to be used", true, "--compile-threads", "--threads") {
@Override
void process(Main task, String opt, String arg) {
int threads = Integer.parseInt(arg);
@ -213,27 +241,27 @@ public class Main implements LogPrinter {
}};
public static class Options {
public List<String> files = new LinkedList<>();
public String module = null;
public String modulepath = "modules";
public List<SearchFor> files = new LinkedList<>();
public String outputName = "unnamed";
public String methodList;
public String classpath = ".";
public List<ClassSource> sources = new ArrayList<>();
public SearchPath searchPath = new SearchPath();
/**
* We don't see scaling beyond 16 threads.
*/
private static final int COMPILER_THREADS = 16;
int threads = Integer.min(COMPILER_THREADS, Runtime.getRuntime().availableProcessors());
public int threads = Integer.min(COMPILER_THREADS, Runtime.getRuntime().availableProcessors());
public boolean ignoreClassLoadingErrors;
public boolean exitOnError;
boolean info;
boolean verbose;
boolean debug;
boolean help;
boolean version;
public boolean info;
public boolean verbose;
public boolean debug;
public boolean help;
public boolean version;
public boolean compileWithAssertions;
}
/* package */final Options options = new Options();
@ -275,7 +303,9 @@ public class Main implements LogPrinter {
printlnInfo("Compiling " + options.outputName + "...");
final long start = System.currentTimeMillis();
run();
if (!run()) {
return EXIT_ABNORMAL;
}
final long end = System.currentTimeMillis();
printlnInfo("Total time: " + (end - start) + " ms");
@ -318,17 +348,34 @@ public class Main implements LogPrinter {
}
@SuppressWarnings("try")
private void run() throws Exception {
private boolean run() throws Exception {
openLog();
try {
CompilationSpec compilationRestrictions = collectSpecifiedMethods();
Set<Class<?>> classesToCompile;
Set<Class<?>> classesToCompile = new HashSet<>();
try (Timer t = new Timer(this, "")) {
ClassCollector collector = new ClassCollector(this.options, this);
classesToCompile = collector.collectClassesToCompile();
FileSupport fileSupport = new FileSupport();
ClassSearch lookup = new ClassSearch();
lookup.addProvider(new ModuleSourceProvider());
lookup.addProvider(new ClassNameSourceProvider(fileSupport));
lookup.addProvider(new JarSourceProvider());
lookup.addProvider(new DirectorySourceProvider(fileSupport));
List<LoadedClass> found = null;
try {
found = lookup.search(options.files, options.searchPath);
} catch (InternalError e) {
reportError(e);
return false;
}
for (LoadedClass loadedClass : found) {
classesToCompile.add(loadedClass.getLoadedClass());
}
printInfo(classesToCompile.size() + " classes found");
}
@ -356,6 +403,11 @@ public class Main implements LogPrinter {
AOTCompiler compiler = new AOTCompiler(this, aotBackend, options.threads);
classes = compiler.compileClasses(classes);
GraalHotSpotVMConfig graalHotSpotVMConfig = runtime.getVMConfig();
PhaseSuite<HighTierContext> graphBuilderSuite = aotBackend.getGraphBuilderSuite();
ListIterator<BasePhase<? super HighTierContext>> iterator = graphBuilderSuite.findPhase(GraphBuilderPhase.class);
GraphBuilderConfiguration graphBuilderConfig = ((GraphBuilderPhase) iterator.previous()).getGraphBuilderConfig();
// Free memory!
try (Timer t = options.verbose ? new Timer(this, "Freeing memory") : null) {
printMemoryUsage();
@ -364,7 +416,7 @@ public class Main implements LogPrinter {
System.gc();
}
BinaryContainer binaryContainer = new BinaryContainer(runtime.getVMConfig(), JVM_VERSION);
BinaryContainer binaryContainer = new BinaryContainer(graalHotSpotVMConfig, graphBuilderConfig, JVM_VERSION);
DataBuilder dataBuilder = new DataBuilder(this, backend, classes, binaryContainer);
dataBuilder.prepareData();
@ -446,6 +498,7 @@ public class Main implements LogPrinter {
} finally {
closeLog();
}
return true;
}
private void addMethods(AOTCompiledClass aotClass, ResolvedJavaMethod[] methods, CompilationSpec compilationRestrictions, GraalFilters filters) {
@ -509,7 +562,7 @@ public class Main implements LogPrinter {
break;
}
} else {
options.files.add(arg);
options.files.add(new SearchFor(arg));
}
}
}
@ -570,6 +623,12 @@ public class Main implements LogPrinter {
log.flush();
}
private void reportError(Throwable e) {
log.println("Error: " + e.getMessage());
e.printStackTrace(log);
log.flush();
}
private void reportError(String key, Object... args) {
printError(MessageFormat.format(key, args));
}
@ -580,17 +639,17 @@ public class Main implements LogPrinter {
}
private void showUsage() {
log.println("Usage: " + PROGNAME + " <options> list...");
log.println("Usage: " + PROGNAME + " <options> list");
log.println("use --help for a list of possible options");
}
private void showHelp() {
log.println("Usage: " + PROGNAME + " <options> <--module name> | <list...>");
log.println("Usage: " + PROGNAME + " <options> list");
log.println();
log.println(" list A list of class files, jar files or directories which");
log.println(" contains class files.");
log.println(" list A : separated list of class names, modules, jar files");
log.println(" or directories which contain class files.");
log.println();
log.println("where possible options include:");
log.println("where options include:");
for (Option o : recognizedOptions) {
String name = o.aliases[0].substring(1); // there must always be at least one name
name = name.charAt(0) == '-' ? name.substring(1) : name;

@ -48,6 +48,7 @@ enum MarkId {
HEAP_TOP_ADDRESS("CodeInstaller::HEAP_TOP_ADDRESS"),
HEAP_END_ADDRESS("CodeInstaller::HEAP_END_ADDRESS"),
NARROW_KLASS_BASE_ADDRESS("CodeInstaller::NARROW_KLASS_BASE_ADDRESS"),
NARROW_OOP_BASE_ADDRESS("CodeInstaller::NARROW_OOP_BASE_ADDRESS"),
CRC_TABLE_ADDRESS("CodeInstaller::CRC_TABLE_ADDRESS"),
LOG_OF_HEAP_REGION_GRAIN_BYTES("CodeInstaller::LOG_OF_HEAP_REGION_GRAIN_BYTES"),
INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED("CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED");

@ -57,6 +57,7 @@ class MarkProcessor {
case HEAP_TOP_ADDRESS:
case HEAP_END_ADDRESS:
case NARROW_KLASS_BASE_ADDRESS:
case NARROW_OOP_BASE_ADDRESS:
case CRC_TABLE_ADDRESS:
case LOG_OF_HEAP_REGION_GRAIN_BYTES:
case INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED:
@ -78,6 +79,9 @@ class MarkProcessor {
case NARROW_KLASS_BASE_ADDRESS:
vmSymbolName = binaryContainer.getNarrowKlassBaseAddressSymbolName();
break;
case NARROW_OOP_BASE_ADDRESS:
vmSymbolName = binaryContainer.getNarrowOopBaseAddressSymbolName();
break;
case CRC_TABLE_ADDRESS:
vmSymbolName = binaryContainer.getCrcTableAddressSymbolName();
break;

@ -1,332 +0,0 @@
/*
* 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.
*/
package jdk.tools.jaotc.collect;
import jdk.tools.jaotc.LogPrinter;
import jdk.tools.jaotc.Main;
import java.io.File;
import java.io.IOException;
import java.net.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import static java.nio.file.FileVisitResult.CONTINUE;
public class ClassCollector {
private final Main.Options options;
private final LogPrinter log;
public ClassCollector(Main.Options options, LogPrinter log) {
this.options = options;
this.log = log;
}
/**
* Collect all class names passed by the user.
*
* @return array list of classes
*/
public Set<Class<?>> collectClassesToCompile() {
Set<Class<?>> classes = new HashSet<>();
List<String> filesToScan = new LinkedList<>(options.files);
if (options.module != null) {
classes.addAll(scanModule(filesToScan));
}
classes.addAll(scanFiles(filesToScan));
return classes;
}
private Set<Class<?>> scanModule(List<String> filesToScan) {
String module = options.module;
// Search module in standard JDK installation.
Path dir = getModuleDirectory(options.modulepath, module);
if (Files.isDirectory(dir)) {
return loadFromModuleDirectory(dir);
} else {
findFilesToScan(filesToScan, module);
return new HashSet<>();
}
}
private Set<Class<?>> loadFromModuleDirectory(Path dir) {
log.printInfo("Scanning module: " + dir + " ...");
log.printlnVerbose(" "); // Break line
FileSystemFinder finder = new FileSystemFinder(dir, pathname -> entryIsClassFile(pathname.toString()));
Set<Class<?>> cls = loadWithClassLoader(() -> ClassLoader.getSystemClassLoader(), dir, finder);
log.printlnInfo(" " + cls.size() + " classes loaded.");
return cls;
}
private void findFilesToScan(List<String> filesToScan, String module) {
// Try to search regular directory, .jar or .class files
Path path = Paths.get(options.modulepath, module);
if (Files.isDirectory(path)) {
filesToScan.add(".");
options.classpath = path.toString();
} else if (path.endsWith(".jar") || path.endsWith(".class")) {
filesToScan.add(path.toString());
} else {
path = Paths.get(options.modulepath, module + ".jar");
if (Files.exists(path)) {
filesToScan.add(path.toString());
} else {
path = Paths.get(options.modulepath, module + ".class");
if (Files.exists(path)) {
filesToScan.add(path.toString());
} else {
throw new InternalError("Expecting a .class, .jar or directory: " + path);
}
}
}
}
private boolean entryIsClassFile(String entry) {
return entry.endsWith(".class") && !entry.endsWith("module-info.class");
}
private Set<Class<?>> scanFiles(List<String> filesToScan) {
Set<Class<?>> classes = new HashSet<>();
for (String fileName : filesToScan) {
Set<Class<?>> loaded = scanFile(fileName);
log.printlnInfo(" " + loaded.size() + " classes loaded.");
classes.addAll(loaded);
}
return classes;
}
interface ClassLoaderFactory {
ClassLoader create() throws IOException;
}
private Set<Class<?>> loadWithClassLoader(ClassLoaderFactory factory, Path root, FileSystemFinder finder) {
ClassLoader loader = null;
try {
loader = factory.create();
return loadClassFiles(root, finder, loader);
} catch (IOException e) {
throw new InternalError(e);
} finally {
if (loader instanceof AutoCloseable) {
try {
((AutoCloseable) loader).close();
} catch (Exception e) {
throw new InternalError(e);
}
}
}
}
private Set<Class<?>> scanFile(String fileName) {
log.printInfo("Scanning: " + fileName + " ...");
log.printlnVerbose(" "); // Break line
if (fileName.endsWith(".jar")) {
return loadFromJarFile(fileName);
} else if (fileName.endsWith(".class")) {
Set<Class<?>> classes = new HashSet<>();
loadFromClassFile(fileName, classes);
return classes;
} else {
return scanClassPath(fileName);
}
}
private Set<Class<?>> loadFromJarFile(String fileName) {
FileSystem fs = makeFileSystem(fileName);
FileSystemFinder finder = new FileSystemFinder(fs.getPath("/"), pathname -> entryIsClassFile(pathname.toString()));
return loadWithClassLoader(() -> URLClassLoader.newInstance(buildUrls(fileName)), fs.getPath("/"), finder);
}
private void loadFromClassFile(String fileName, Set<Class<?>> classes) {
Class<?> result;
File file = new File(options.classpath);
try (URLClassLoader loader = URLClassLoader.newInstance(buildUrls(file))) {
result = loadClassFile(loader, fileName);
} catch (IOException e) {
throw new InternalError(e);
}
Class<?> c = result;
addClass(classes, fileName, c);
}
private Set<Class<?>> scanClassPath(String fileName) {
Path classPath = Paths.get(options.classpath);
if (!Files.exists(classPath)) {
throw new InternalError("Path does not exist: " + classPath);
}
if (!Files.isDirectory(classPath)) {
throw new InternalError("Path must be a directory: " + classPath);
}
// Combine class path and file name and see what it is.
Path combinedPath = Paths.get(options.classpath + File.separator + fileName);
if (combinedPath.endsWith(".class")) {
throw new InternalError("unimplemented");
} else if (Files.isDirectory(combinedPath)) {
return scanDirectory(classPath, combinedPath);
} else {
throw new InternalError("Expecting a .class, .jar or directory: " + fileName);
}
}
private FileSystem makeFileSystem(String fileName) {
try {
return FileSystems.newFileSystem(makeJarFileURI(fileName), new HashMap<>());
} catch (IOException e) {
throw new InternalError(e);
}
}
private URI makeJarFileURI(String fileName) {
try {
return new URI("jar:file:" + Paths.get(fileName).toAbsolutePath() + "!/");
} catch (URISyntaxException e) {
throw new InternalError(e);
}
}
private PathMatcher combine(PathMatcher m1, PathMatcher m2) {
return path -> m1.matches(path) && m2.matches(path);
}
private Set<Class<?>> scanDirectory(Path classPath, Path combinedPath) {
String dir = options.classpath;
FileSystem fileSystem = FileSystems.getDefault();
PathMatcher matcher = fileSystem.getPathMatcher("glob:" + "*.class");
FileSystemFinder finder = new FileSystemFinder(combinedPath,
combine(matcher, pathname -> entryIsClassFile(pathname.toString())));
File file = new File(dir);
try (URLClassLoader loader = URLClassLoader.newInstance(buildUrls(file))) {
return loadClassFiles(classPath, finder, loader);
} catch (IOException e) {
throw new InternalError(e);
}
}
private Set<Class<?>> loadClassFiles(Path root, FileSystemFinder finder, ClassLoader loader) {
Set<Class<?>> classes = new HashSet<>();
for (Path name : finder.done()) {
// Now relativize to the class path so we get the actual class names.
String entry = root.relativize(name).normalize().toString();
Class<?> c = loadClassFile(loader, entry);
addClass(classes, entry, c);
}
return classes;
}
private void addClass(Set<Class<?>> classes, String name, Class<?> c) {
if (c != null) {
classes.add(c);
log.printlnVerbose(" loaded " + name);
}
}
private URL[] buildUrls(String fileName) throws MalformedURLException {
return new URL[]{ new URL("jar:file:" + Paths.get(fileName).toAbsolutePath() + "!/") };
}
private URL[] buildUrls(File file) throws MalformedURLException {
return new URL[] {file.toURI().toURL() };
}
private Path getModuleDirectory(String modulepath, String module) {
FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/"));
return fs.getPath(modulepath, module);
}
/**
* Loads a class with the given file name from the specified {@link URLClassLoader}.
*/
private Class<?> loadClassFile(final ClassLoader loader, final String fileName) {
int start = 0;
if (fileName.startsWith("/")) {
start = 1;
}
String className = fileName.substring(start, fileName.length() - ".class".length());
className = className.replace('/', '.');
try {
return loader.loadClass(className);
} catch (Throwable e) {
// If we are running in JCK mode we ignore all exceptions.
if (options.ignoreClassLoadingErrors) {
log.printError(className + ": " + e);
return null;
}
throw new InternalError(e);
}
}
/**
* {@link FileVisitor} implementation to find class files recursively.
*/
private static class FileSystemFinder extends SimpleFileVisitor<Path> {
private final ArrayList<Path> fileNames = new ArrayList<>();
private final PathMatcher filter;
FileSystemFinder(Path combinedPath, PathMatcher filter) {
this.filter = filter;
try {
Files.walkFileTree(combinedPath, this);
} catch (IOException e) {
throw new InternalError(e);
}
}
/**
* Compares the glob pattern against the file name.
*/
void find(Path file) {
Path name = file.getFileName();
if (name != null && filter.matches(name)) {
fileNames.add(file);
}
}
List<Path> done() {
return fileNames;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
find(file);
return CONTINUE;
}
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
find(dir);
return CONTINUE;
}
}
}

@ -0,0 +1,93 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
import jdk.tools.jaotc.LoadedClass;
import java.util.ArrayList;
import java.util.List;
public class ClassSearch {
private List<SourceProvider> providers = new ArrayList<>();
public void addProvider(SourceProvider provider) {
providers.add(provider);
}
public List<LoadedClass> search(List<SearchFor> search, SearchPath searchPath) {
List<LoadedClass> loaded = new ArrayList<>();
List<ClassSource> sources = new ArrayList<>();
for (SearchFor entry : search) {
sources.add(findSource(entry, searchPath));
}
for (ClassSource source : sources) {
source.eachClass((name, loader) -> loaded.add(loadClass(name, loader)));
}
return loaded;
}
private LoadedClass loadClass(String name, ClassLoader loader) {
try {
Class<?> clzz = loader.loadClass(name);
return new LoadedClass(name, clzz);
} catch (ClassNotFoundException e) {
throw new InternalError("Failed to load with: " + loader, e);
}
}
private ClassSource findSource(SearchFor searchFor, SearchPath searchPath) {
ClassSource found = null;
for (SourceProvider provider : providers) {
if (!searchFor.isUnknown() && !provider.supports(searchFor.getType())) {
continue;
}
ClassSource source = provider.findSource(searchFor.getName(), searchPath);
if (source != null) {
if (found != null) {
throw new InternalError("Multiple possible sources: " + source + " and: " + found);
}
found = source;
}
}
if (found == null) {
throw new InternalError("Failed to find: " + searchFor.toString());
}
return found;
}
public static List<SearchFor> makeList(String type, String argument) {
List<SearchFor> list = new ArrayList<>();
String[] elements = argument.split(":");
for (String element : elements) {
list.add(new SearchFor(element, type));
}
return list;
}
}

@ -0,0 +1,52 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
import java.nio.file.Path;
import java.util.function.BiConsumer;
public interface ClassSource {
static boolean pathIsClassFile(Path entry) {
String fileName = entry.getFileName().toString();
return fileName.endsWith(".class") && !fileName.endsWith("module-info.class");
}
static String makeClassName(Path path) {
String fileName = path.toString();
if (!fileName.endsWith(".class")) {
throw new IllegalArgumentException("File doesn't end with .class: '" + fileName + "'");
}
int start = 0;
if (fileName.startsWith("/")) {
start = 1;
}
String className = fileName.substring(start, fileName.length() - ".class".length());
className = className.replace('/', '.');
return className;
}
void eachClass(BiConsumer<String, ClassLoader> consumer);
}

@ -0,0 +1,90 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
import java.io.IOException;
import java.net.*;
import java.nio.file.*;
import java.util.HashMap;
public class FileSupport {
public boolean exists(Path path) {
return Files.exists(path);
}
public boolean isDirectory(Path path) {
return Files.isDirectory(path);
}
private FileSystem makeJarFileSystem(Path path) {
try {
return FileSystems.newFileSystem(makeJarFileURI(path), new HashMap<>());
} catch (IOException e) {
throw new InternalError(e);
}
}
private URI makeJarFileURI(Path path) {
try {
return new URI("jar:file:" + path.toAbsolutePath() + "!/");
} catch (URISyntaxException e) {
throw new InternalError(e);
}
}
public ClassLoader createClassLoader(Path path, ClassLoader parent) {
try {
return URLClassLoader.newInstance(buildUrls(path), parent);
} catch (MalformedURLException e) {
throw new InternalError(e);
}
}
public ClassLoader createClassLoader(Path path) throws MalformedURLException {
return URLClassLoader.newInstance(buildUrls(path));
}
private URL[] buildUrls(Path path) throws MalformedURLException {
return new URL[] { path.toUri().toURL() };
}
public Path getJarFileSystemRoot(Path jarFile) {
FileSystem fileSystem = makeJarFileSystem(jarFile);
return fileSystem.getPath("/");
}
public boolean isAbsolute(Path entry) {
return entry.isAbsolute();
}
public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException {
DirectoryStream<Path> paths = fileSystem.provider().newDirectoryStream(root,null);
for (Path entry : paths) {
Path relative = root.relativize(entry);
if (relative.equals(path)) {
return entry;
}
}
return null;
}
}

@ -0,0 +1,76 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Iterator;
import static java.nio.file.FileVisitResult.CONTINUE;
/**
* {@link FileVisitor} implementation to find class files recursively.
*/
public class FileSystemFinder extends SimpleFileVisitor<Path> implements Iterable<Path> {
private final ArrayList<Path> fileNames = new ArrayList<>();
private final PathMatcher filter;
public FileSystemFinder(Path combinedPath, PathMatcher filter) {
this.filter = filter;
try {
Files.walkFileTree(combinedPath, this);
} catch (IOException e) {
throw new InternalError(e);
}
}
/**
* Compares the glob pattern against the file name.
*/
private void find(Path file) {
Path name = file.getFileName();
if (name != null && filter.matches(name)) {
fileNames.add(file);
}
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
find(file);
return CONTINUE;
}
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
find(dir);
return CONTINUE;
}
@Override
public Iterator<Path> iterator() {
return fileNames.iterator();
}
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
@ -20,23 +20,35 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.tools.jaotc.collect;
package compiler.aot.fingerprint;
public class SearchFor {
private final String name;
private final String type;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
public SearchFor(String name) {
this(name, "unknown");
}
// Usage:
// java CDSRunner <vmargs> <class> <args> ...
public class CDSRunner {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
public SearchFor(String name, String type) {
this.name = name;
this.type = type;
}
System.out.println("[stdout = " + output.getStdout() + "]");
System.out.println("[stderr = " + output.getStderr() + "]");
public boolean isUnknown() {
return "unknown".equals(type);
}
output.shouldContain("PASSED");
output.shouldHaveExitValue(0);
public String getType() {
return this.type;
}
public String getName() {
return this.name;
}
@Override
public String toString() {
return type + ":" + name;
}
}

@ -0,0 +1,87 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public class SearchPath {
private final List<Path> searchPaths = new ArrayList<>();
private final FileSupport fileSupport;
public SearchPath() {
this(new FileSupport());
}
public SearchPath(FileSupport fileSupport) {
this.fileSupport = fileSupport;
}
public Path find(FileSystem fileSystem, Path entry, String... defaults) {
if (isAbsolute(entry)) {
if (exists(entry)) {
return entry;
}
return null;
}
if (exists(entry)) {
return entry;
}
for (String searchPath : defaults) {
Path newPath = fileSystem.getPath(searchPath, entry.toString());
if (exists(newPath)) {
return newPath;
}
}
for (Path searchPath : searchPaths) {
Path newPath = fileSystem.getPath(searchPath.toString(), entry.toString());
if (exists(newPath)) {
return newPath;
}
}
return null;
}
private boolean isAbsolute(Path entry) {
return fileSupport.isAbsolute(entry);
}
private boolean exists(Path entry) {
return fileSupport.exists(entry);
}
public void add(String... paths) {
for (String name : paths) {
Path path = Paths.get(name);
searchPaths.add(path);
}
}
}

@ -0,0 +1,29 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect;
public interface SourceProvider {
ClassSource findSource(String name, SearchPath searchPath);
boolean supports(String type);
}

@ -0,0 +1,42 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.classname;
import jdk.tools.jaotc.collect.ClassSource;
import java.util.function.BiConsumer;
public class ClassNameSource implements ClassSource {
private final String name;
private final ClassLoader classLoader;
public ClassNameSource(String name, ClassLoader classLoader) {
this.name = name;
this.classLoader = classLoader;
}
@Override
public void eachClass(BiConsumer<String, ClassLoader> consumer) {
consumer.accept(name, classLoader);
}
}

@ -0,0 +1,62 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.classname;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSupport;
import jdk.tools.jaotc.collect.SearchPath;
import jdk.tools.jaotc.collect.SourceProvider;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ClassNameSourceProvider implements SourceProvider {
public final static String TYPE = "classname";
private final ClassLoader classLoader;
public ClassNameSourceProvider(FileSupport fileSupport) {
String classPath = System.getProperty("java.class.path");
ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
if (classPath != null && !classPath.isEmpty()) {
classLoader = systemClassLoader;
} else {
Path path = Paths.get(".").toAbsolutePath();
classLoader = fileSupport.createClassLoader(path, systemClassLoader);
}
}
@Override
public ClassSource findSource(String name, SearchPath searchPath) {
try {
classLoader.loadClass(name);
return new ClassNameSource(name, classLoader);
} catch (ClassNotFoundException e) {
return null;
}
}
@Override
public boolean supports(String type) {
return TYPE.equals(type);
}
}

@ -0,0 +1,53 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.directory;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSystemFinder;
import java.nio.file.Path;
import java.util.function.BiConsumer;
public class DirectorySource implements ClassSource {
private final Path directoryPath;
private final ClassLoader classLoader;
public DirectorySource(Path directoryPath, ClassLoader classLoader) {
this.directoryPath = directoryPath;
this.classLoader = classLoader;
}
@Override
public void eachClass(BiConsumer<String, ClassLoader> consumer) {
FileSystemFinder finder = new FileSystemFinder(directoryPath, ClassSource::pathIsClassFile);
for (Path path : finder) {
consumer.accept(ClassSource.makeClassName(directoryPath.relativize(path).normalize()), classLoader);
}
}
@Override
public String toString() {
return "directory:" + directoryPath.toString();
}
}

@ -0,0 +1,68 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.directory;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSupport;
import jdk.tools.jaotc.collect.SearchPath;
import jdk.tools.jaotc.collect.SourceProvider;
import java.net.MalformedURLException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
public class DirectorySourceProvider implements SourceProvider {
private final FileSupport fileSupport;
private final FileSystem fileSystem;
public final static String TYPE = "directory";
public DirectorySourceProvider(FileSupport fileSupport) {
this.fileSupport = fileSupport;
fileSystem = FileSystems.getDefault();
}
@Override
public ClassSource findSource(String name, SearchPath searchPath) {
Path directoryPath = fileSystem.getPath(name);
if (!fileSupport.exists(directoryPath)) {
return null;
}
if (!fileSupport.isDirectory(directoryPath)) {
return null;
}
try {
ClassLoader classLoader = fileSupport.createClassLoader(directoryPath);
return new DirectorySource(directoryPath, classLoader);
} catch (MalformedURLException e) {
return null;
}
}
@Override
public boolean supports(String type) {
return TYPE.equals(type);
}
}

@ -0,0 +1,55 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.jar;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSystemFinder;
import java.nio.file.Path;
import java.util.function.BiConsumer;
public class JarFileSource implements ClassSource {
private final Path jarFile;
private final Path jarRootPath;
private final ClassLoader classLoader;
public JarFileSource(Path jarFile, Path jarRootPath, ClassLoader classLoader) {
this.jarFile = jarFile;
this.jarRootPath = jarRootPath;
this.classLoader = classLoader;
}
public void eachClass(BiConsumer<String, ClassLoader> consumer) {
FileSystemFinder finder = new FileSystemFinder(jarRootPath, ClassSource::pathIsClassFile);
for (Path path : finder) {
consumer.accept(ClassSource.makeClassName(jarRootPath.relativize(path).normalize()), classLoader);
}
}
@Override
public String toString() {
return "jar:" + jarFile.toString();
}
}

@ -0,0 +1,83 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.jar;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSupport;
import jdk.tools.jaotc.collect.SearchPath;
import jdk.tools.jaotc.collect.SourceProvider;
import java.net.MalformedURLException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.ProviderNotFoundException;
public class JarSourceProvider implements SourceProvider {
private final FileSystem fileSystem;
private final FileSupport fileSupport;
public final static String TYPE = "jar";
public JarSourceProvider() {
this(new FileSupport());
}
public JarSourceProvider(FileSupport fileSupport) {
this.fileSupport = fileSupport;
fileSystem = FileSystems.getDefault();
}
@Override
public ClassSource findSource(String name, SearchPath searchPath) {
Path fileName = fileSystem.getPath(name);
Path jarFile = searchPath.find(fileSystem, fileName);
if (!validPath(jarFile)) {
return null;
}
return createSource(jarFile);
}
private ClassSource createSource(Path jarFile) {
try {
Path jarRootPath = fileSupport.getJarFileSystemRoot(jarFile);
if (jarRootPath == null) {
return null;
}
ClassLoader classLoader = fileSupport.createClassLoader(jarFile);
return new JarFileSource(jarFile, jarRootPath, classLoader);
} catch (ProviderNotFoundException | MalformedURLException e) {
}
return null;
}
@Override
public boolean supports(String type) {
return TYPE.equals(type);
}
private boolean validPath(Path jarFile) {
return jarFile != null && !fileSupport.isDirectory(jarFile);
}
}

@ -0,0 +1,57 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.module;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSystemFinder;
import java.nio.file.Path;
import java.util.function.BiConsumer;
public class ModuleSource implements ClassSource {
private final Path modulePath;
private final ClassLoader classLoader;
public ModuleSource(Path modulePath, ClassLoader classLoader) {
this.modulePath = modulePath;
this.classLoader = classLoader;
}
@Override
public void eachClass(BiConsumer<String, ClassLoader> consumer) {
FileSystemFinder finder = new FileSystemFinder(modulePath, ClassSource::pathIsClassFile);
for (Path path : finder) {
consumer.accept(ClassSource.makeClassName(modulePath.relativize(path).normalize()), classLoader);
}
}
public Path getModulePath() {
return modulePath;
}
@Override
public String toString() {
return "module:" + modulePath.toString();
}
}

@ -0,0 +1,82 @@
/*
* Copyright (c) 2017, 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 jdk.tools.jaotc.collect.module;
import jdk.tools.jaotc.collect.ClassSource;
import jdk.tools.jaotc.collect.FileSupport;
import jdk.tools.jaotc.collect.SearchPath;
import jdk.tools.jaotc.collect.SourceProvider;
import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
public class ModuleSourceProvider implements SourceProvider {
private final FileSystem fileSystem;
private final ClassLoader classLoader;
private final FileSupport fileSupport;
public final static String TYPE = "module";
public ModuleSourceProvider() {
this(FileSystems.getFileSystem(URI.create("jrt:/")), ClassLoader.getSystemClassLoader(), new FileSupport());
}
public ModuleSourceProvider(FileSystem fileSystem, ClassLoader classLoader, FileSupport fileSupport) {
this.fileSystem = fileSystem;
this.classLoader = classLoader;
this.fileSupport = fileSupport;
}
@Override
public ClassSource findSource(String name, SearchPath searchPath) {
Path path = fileSystem.getPath(name);
Path dir = fileSystem.getPath("modules");
if (dir == null || !fileSupport.isDirectory(dir)) {
return null;
}
Path found = findModuleDirectory(dir, path);
if (found == null) {
return null;
}
return new ModuleSource(found, classLoader);
}
private Path findModuleDirectory(Path root, Path path) {
try {
return fileSupport.getSubDirectory(fileSystem, root, path);
} catch (IOException e) {
throw new InternalError(e);
}
}
@Override
public boolean supports(String type) {
return TYPE.equals(type);
}
}

@ -100,15 +100,19 @@ final class CompilerToVM {
native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
/**
* Determines if {@code method} can be inlined. A method may not be inlinable for a number of
* reasons such as:
* <ul>
* <li>a CompileOracle directive may prevent inlining or compilation of methods</li>
* <li>the method may have a bytecode breakpoint set</li>
* <li>the method may have other bytecode features that require special handling by the VM</li>
* </ul>
* Determines whether {@code method} is currently compilable by the JVMCI compiler being used by
* the VM. This can return false if JVMCI compilation failed earlier for {@code method}, a
* breakpoint is currently set in {@code method} or {@code method} contains other bytecode
* features that require special handling by the VM.
*/
native boolean canInlineMethod(HotSpotResolvedJavaMethodImpl method);
native boolean isCompilable(HotSpotResolvedJavaMethodImpl method);
/**
* Determines if {@code method} is targeted by a VM directive (e.g.,
* {@code -XX:CompileCommand=dontinline,<pattern>}) or annotation (e.g.,
* {@code jdk.internal.vm.annotation.DontInline}) that specifies it should not be inlined.
*/
native boolean hasNeverInlineDirective(HotSpotResolvedJavaMethodImpl method);
/**
* Determines if {@code method} should be inlined at any cost. This could be because:

@ -49,13 +49,6 @@ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod {
*/
boolean isForceInline();
/**
* Returns true if this method has a {@code DontInline} annotation.
*
* @return true if DontInline annotation present, false otherwise
*/
boolean isDontInline();
/**
* Returns true if this method has a {@code ReservedStackAccess} annotation.
*

@ -298,15 +298,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
return (getFlags() & config().methodFlagsForceInline) != 0;
}
/**
* Returns true if this method has a {@code DontInline} annotation.
*
* @return true if DontInline annotation present, false otherwise
*/
public boolean isDontInline() {
return (getFlags() & config().methodFlagsDontInline) != 0;
}
/**
* Returns true if this method has a {@code ReservedStackAccess} annotation.
*
@ -582,10 +573,15 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
@Override
public boolean canBeInlined() {
if (isDontInline()) {
if (hasNeverInlineDirective()) {
return false;
}
return compilerToVM().canInlineMethod(this);
return compilerToVM().isCompilable(this);
}
@Override
public boolean hasNeverInlineDirective() {
return compilerToVM().hasNeverInlineDirective(this);
}
@Override

@ -346,6 +346,13 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
*/
boolean canBeInlined();
/**
* Determines if this method is targeted by a VM directive (e.g.,
* {@code -XX:CompileCommand=dontinline,<pattern>}) or VM recognized annotation (e.g.,
* {@code jdk.internal.vm.annotation.DontInline}) that specifies it should not be inlined.
*/
boolean hasNeverInlineDirective();
/**
* Returns {@code true} if the inlining of this method should be forced.
*/

@ -638,6 +638,7 @@ suite = {
"annotationProcessors" : [
"GRAAL_NODEINFO_PROCESSOR",
"GRAAL_REPLACEMENTS_VERIFIER",
"GRAAL_OPTIONS_PROCESSOR",
],
"workingSets" : "Graal,Graph",
},

@ -116,6 +116,7 @@ public class Debug {
public static final int INFO_LOG_LEVEL = 2;
public static final int VERBOSE_LOG_LEVEL = 3;
public static final int DETAILED_LOG_LEVEL = 4;
public static final int VERY_DETAILED_LOG_LEVEL = 5;
public static boolean isDumpEnabled(int dumpLevel) {
return ENABLED && DebugScope.getInstance().isDumpEnabled(dumpLevel);

@ -267,10 +267,15 @@ public class AMD64HotSpotBackend extends HotSpotHostBackend {
if (config.useCompressedClassPointers) {
Register register = r10;
AMD64HotSpotMove.decodeKlassPointer(asm, register, providers.getRegisters().getHeapBaseRegister(), src, config.getKlassEncoding());
if (config.narrowKlassBase != 0) {
// The heap base register was destroyed above, so restore it
asm.movq(providers.getRegisters().getHeapBaseRegister(), config.narrowOopBase);
AMD64HotSpotMove.decodeKlassPointer(crb, asm, register, providers.getRegisters().getHeapBaseRegister(), src, config);
if (GeneratePIC.getValue()) {
asm.movq(providers.getRegisters().getHeapBaseRegister(), asm.getPlaceholder(-1));
crb.recordMark(config.MARKID_NARROW_OOP_BASE_ADDRESS);
} else {
if (config.narrowKlassBase != 0) {
// The heap base register was destroyed above, so restore it
asm.movq(providers.getRegisters().getHeapBaseRegister(), config.narrowOopBase);
}
}
asm.cmpq(inlineCacheKlass, register);
} else {

@ -265,14 +265,21 @@ public class AMD64HotSpotMove {
}
}
public static void decodeKlassPointer(AMD64MacroAssembler masm, Register register, Register scratch, AMD64Address address, CompressEncoding encoding) {
public static void decodeKlassPointer(CompilationResultBuilder crb, AMD64MacroAssembler masm, Register register, Register scratch, AMD64Address address, GraalHotSpotVMConfig config) {
CompressEncoding encoding = config.getKlassEncoding();
masm.movl(register, address);
if (encoding.shift != 0) {
assert encoding.alignment == encoding.shift : "Decode algorithm is wrong";
masm.shlq(register, encoding.alignment);
}
if (encoding.base != 0) {
masm.movq(scratch, encoding.base);
if (GeneratePIC.getValue() || encoding.base != 0) {
if (GeneratePIC.getValue()) {
masm.movq(scratch, masm.getPlaceholder(-1));
crb.recordMark(config.MARKID_NARROW_KLASS_BASE_ADDRESS);
} else {
assert encoding.base != 0;
masm.movq(scratch, encoding.base);
}
masm.addq(register, scratch);
}
}

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