mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-17 00:50:48 +00:00
Merge
This commit is contained in:
commit
413ba627fd
1
.hgtags
1
.hgtags
@ -359,3 +359,4 @@ a6614ff7bf09da74be1d0ef3d9755090d244697a jdk-9+111
|
||||
c84d0cce090e161d736de69e941830adf8c2f87a jdk-9+114
|
||||
8d78fb40648dd221ce4ef19f9d5aa41ee1a3a884 jdk-9+115
|
||||
84aba7335005a3a47751dcf1f37935f97df9f99a jdk-9+116
|
||||
82b8d12a553f5617737c238cec060281d52e351c jdk-9+117
|
||||
|
||||
@ -359,3 +359,4 @@ f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111
|
||||
1d992540870ff33fe6cc550443388588df9b9e4f jdk-9+114
|
||||
09617ce980b99d49abfd54dacfed353c47e2a115 jdk-9+115
|
||||
6743a8e0cab7b5f6f4a0575f6664892f0ab740af jdk-9+116
|
||||
e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117
|
||||
|
||||
@ -435,6 +435,9 @@ AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK],
|
||||
elif test ! -x "$BUILD_JDK/bin/jlink"; then
|
||||
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring])
|
||||
BUILD_JDK_FOUND=no
|
||||
elif test ! -x "$BUILD_JDK/bin/jmod"; then
|
||||
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring])
|
||||
BUILD_JDK_FOUND=no
|
||||
elif test ! -x "$BUILD_JDK/bin/javac"; then
|
||||
# Do we have a bin/javac?
|
||||
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring])
|
||||
@ -474,7 +477,8 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
|
||||
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk],
|
||||
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])])
|
||||
|
||||
CREATE_BUILDJDK_FOR_HOST=false
|
||||
CREATE_BUILDJDK=false
|
||||
EXTERNAL_BUILDJDK=false
|
||||
BUILD_JDK_FOUND="no"
|
||||
if test "x$with_build_jdk" != "x"; then
|
||||
BOOTJDK_CHECK_BUILD_JDK([
|
||||
@ -483,6 +487,7 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
|
||||
BUILD_JDK_FOUND=maybe
|
||||
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
|
||||
fi])
|
||||
EXTERNAL_BUILDJDK=true
|
||||
else
|
||||
if test "x$COMPILE_TYPE" = "xcross"; then
|
||||
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
|
||||
@ -498,6 +503,11 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
|
||||
fi
|
||||
fi
|
||||
|
||||
JMOD="$BUILD_JDK/bin/jmod"
|
||||
JLINK="$BUILD_JDK/bin/jlink"
|
||||
AC_SUBST(JMOD)
|
||||
AC_SUBST(JLINK)
|
||||
|
||||
if test "x$BUILD_JDK_FOUND" != "xyes"; then
|
||||
AC_MSG_CHECKING([for Build JDK])
|
||||
AC_MSG_RESULT([no])
|
||||
@ -506,4 +516,5 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
|
||||
|
||||
AC_SUBST(CREATE_BUILDJDK)
|
||||
AC_SUBST(BUILD_JDK)
|
||||
AC_SUBST(EXTERNAL_BUILDJDK)
|
||||
])
|
||||
|
||||
@ -46,6 +46,7 @@ HOTSPOT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPO
|
||||
HOTSPOT_DIST := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_DIST))
|
||||
SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
|
||||
JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
|
||||
IMAGES_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR))
|
||||
|
||||
OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
|
||||
OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@
|
||||
|
||||
@ -896,8 +896,11 @@ JAXWS_TOPDIR
|
||||
JAXP_TOPDIR
|
||||
CORBA_TOPDIR
|
||||
LANGTOOLS_TOPDIR
|
||||
EXTERNAL_BUILDJDK
|
||||
BUILD_JDK
|
||||
CREATE_BUILDJDK
|
||||
JLINK
|
||||
JMOD
|
||||
BOOT_JDK_BITS
|
||||
JAVAC_FLAGS
|
||||
BOOT_JDK_MODULAR
|
||||
@ -5070,7 +5073,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=1462204427
|
||||
DATE_WHEN_GENERATED=1462806878
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -30171,7 +30174,8 @@ if test "${with_build_jdk+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
CREATE_BUILDJDK_FOR_HOST=false
|
||||
CREATE_BUILDJDK=false
|
||||
EXTERNAL_BUILDJDK=false
|
||||
BUILD_JDK_FOUND="no"
|
||||
if test "x$with_build_jdk" != "x"; then
|
||||
|
||||
@ -30196,6 +30200,10 @@ $as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/ja
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&5
|
||||
$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&6;}
|
||||
BUILD_JDK_FOUND=no
|
||||
elif test ! -x "$BUILD_JDK/bin/jmod"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&5
|
||||
$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring" >&6;}
|
||||
BUILD_JDK_FOUND=no
|
||||
elif test ! -x "$BUILD_JDK/bin/javac"; then
|
||||
# Do we have a bin/javac?
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&5
|
||||
@ -30364,6 +30372,7 @@ $as_echo "$BUILD_JDK_VERSION" >&6; }
|
||||
fi # end check build jdk found
|
||||
fi
|
||||
|
||||
EXTERNAL_BUILDJDK=true
|
||||
else
|
||||
if test "x$COMPILE_TYPE" = "xcross"; then
|
||||
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
|
||||
@ -30383,6 +30392,11 @@ $as_echo "yes, will use output dir" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
JMOD="$BUILD_JDK/bin/jmod"
|
||||
JLINK="$BUILD_JDK/bin/jlink"
|
||||
|
||||
|
||||
|
||||
if test "x$BUILD_JDK_FOUND" != "xyes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5
|
||||
$as_echo_n "checking for Build JDK... " >&6; }
|
||||
@ -30395,6 +30409,7 @@ $as_echo "no" >&6; }
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Configure the sources to use. We can add or override individual directories.
|
||||
|
||||
@ -283,6 +283,7 @@ BOOT_JDK:=@BOOT_JDK@
|
||||
|
||||
BUILD_JDK:=@BUILD_JDK@
|
||||
CREATE_BUILDJDK:=@CREATE_BUILDJDK@
|
||||
EXTERNAL_BUILDJDK:=@EXTERNAL_BUILDJDK@
|
||||
|
||||
# When compiling Java source to be run by the boot jdk
|
||||
# use these extra flags, eg -source 6 -target 6
|
||||
@ -542,6 +543,8 @@ JAVA_CMD:=@JAVA@
|
||||
JAVAC_CMD:=@JAVAC@
|
||||
JAVAH_CMD:=@JAVAH@
|
||||
JAR_CMD:=@JAR@
|
||||
JLINK_CMD := @JLINK@
|
||||
JMOD_CMD := @JMOD@
|
||||
JARSIGNER_CMD:=@JARSIGNER@
|
||||
SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
|
||||
# These variables are meant to be used. They are defined with = instead of := to make
|
||||
@ -552,6 +555,8 @@ JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS)
|
||||
JAVAC=@FIXPATH@ $(JAVAC_CMD)
|
||||
JAVAH=@FIXPATH@ $(JAVAH_CMD)
|
||||
JAR=@FIXPATH@ $(JAR_CMD)
|
||||
JLINK = @FIXPATH@ $(JLINK_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JMOD = @FIXPATH@ $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
|
||||
# A specific java binary with specific options can be used to run
|
||||
# the long running background sjavac servers and other long running tasks.
|
||||
@ -569,14 +574,15 @@ BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
|
||||
# Use ?= as this can be overridden from bootcycle-spec.gmk
|
||||
BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@
|
||||
|
||||
INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \
|
||||
jdk.jdeps jdk.javadoc jdk.rmic
|
||||
ifeq ($(BOOT_JDK_MODULAR), true)
|
||||
INTERIM_OVERRIDE_MODULES_ARGS = -Xpatch:$(BUILDTOOLS_OUTPUTDIR)/override_modules
|
||||
INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \
|
||||
-Xpatch:$m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m)
|
||||
INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS)
|
||||
JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main
|
||||
JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main
|
||||
else
|
||||
INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \
|
||||
jdk.jdeps jdk.javadoc jdk.rmic
|
||||
INTERIM_OVERRIDE_MODULES_ARGS = \
|
||||
-Xbootclasspath/p:$(call PathList, \
|
||||
$(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
|
||||
@ -591,12 +597,8 @@ endif
|
||||
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
|
||||
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
|
||||
|
||||
# JLink/Jmod are run using the BUILD_JDK, which is normally the jdk output dir.
|
||||
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
|
||||
|
||||
JLINK = @FIXPATH@ $(BUILD_JDK)/bin/jlink $(JAVA_TOOL_FLAGS_SMALL)
|
||||
JMOD = @FIXPATH@ $(BUILD_JDK)/bin/jmod $(JAVA_TOOL_FLAGS_SMALL)
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
# times.
|
||||
@ -776,6 +778,9 @@ TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
|
||||
SYMBOLS_IMAGE_SUBDIR:=symbols
|
||||
SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
|
||||
|
||||
# Interim image
|
||||
INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image
|
||||
|
||||
# Macosx bundles directory definitions
|
||||
JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents
|
||||
JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents
|
||||
|
||||
@ -404,7 +404,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
jtreg: {
|
||||
server: "javare",
|
||||
revision: "4.2",
|
||||
build_number: "b01",
|
||||
build_number: "b02",
|
||||
checksum_file: "MD5_VALUES",
|
||||
file: "jtreg_bin-4.2.zip",
|
||||
environment_name: "JT_HOME"
|
||||
|
||||
@ -359,3 +359,4 @@ cc30faa2da498c478e89ab062ff160653ca1b170 jdk-9+113
|
||||
10d175b0368c30f54350fc648adc41b94ce357ee jdk-9+114
|
||||
7bab1b1b36824924b1c657a8419369ba93d198d3 jdk-9+115
|
||||
7dfa7377a5e601b8f740741a9a80e04c72dd04d6 jdk-9+116
|
||||
7a1b36bf2fe55a9a7732489ccdd326c910329a7e jdk-9+117
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2013 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
||||
@ -222,7 +222,8 @@ public abstract class FileLocator extends Object {
|
||||
|
||||
/**
|
||||
* locateFileInClassPath returns a DataInputStream that can be used
|
||||
* to read the requested file. The CLASSPATH is used to locate the file.
|
||||
* to read the requested file. The resource is located in the java.corba
|
||||
* module or if not found, then the CLASSPATH is searched.
|
||||
*
|
||||
* @param fileName The name of the file to locate. The file name
|
||||
* may be qualified with a partial path name, using '/' as the separator
|
||||
@ -238,6 +239,12 @@ public abstract class FileLocator extends Object {
|
||||
public static DataInputStream locateFileInClassPath (String fileName)
|
||||
throws FileNotFoundException, IOException {
|
||||
|
||||
// The resource should be in the java.corba module
|
||||
InputStream in = FileLocator.class.getResourceAsStream("/" + fileName);
|
||||
if (in != null) {
|
||||
return new DataInputStream(in);
|
||||
}
|
||||
|
||||
boolean notFound = true;
|
||||
StringTokenizer st;
|
||||
String path = "";
|
||||
|
||||
@ -71,7 +71,4 @@ module java.corba {
|
||||
java.naming;
|
||||
exports com.sun.jndi.url.iiopname to
|
||||
java.naming;
|
||||
|
||||
provides javax.naming.spi.InitialContextFactory
|
||||
with com.sun.jndi.cosnaming.CNCtxFactory;
|
||||
}
|
||||
|
||||
@ -519,3 +519,4 @@ c569f8d89269fb6205b90f727581eb8cc04132f9 jdk-9+113
|
||||
b64432bae5271735fd53300b2005b713e98ef411 jdk-9+114
|
||||
88dd08d7be0fe7fb9f1914b1628f0aae9bf56e25 jdk-9+115
|
||||
61a214186dae6811dd989e9165e42f7dbf02acde jdk-9+116
|
||||
88170d3642905b9e6cac03e8efcc976885a7e6da jdk-9+117
|
||||
|
||||
@ -140,9 +140,10 @@ PerfCounter* ClassLoader::_unsafe_defineClassCallCounter = NULL;
|
||||
PerfCounter* ClassLoader::_isUnsyncloadClass = NULL;
|
||||
PerfCounter* ClassLoader::_load_instance_class_failCounter = NULL;
|
||||
|
||||
ClassPathEntry* ClassLoader::_first_entry = NULL;
|
||||
ClassPathEntry* ClassLoader::_last_entry = NULL;
|
||||
int ClassLoader::_num_entries = 0;
|
||||
GrowableArray<ModuleClassPathList*>* ClassLoader::_xpatch_entries = NULL;
|
||||
ClassPathEntry* ClassLoader::_first_entry = NULL;
|
||||
ClassPathEntry* ClassLoader::_last_entry = NULL;
|
||||
int ClassLoader::_num_entries = 0;
|
||||
ClassPathEntry* ClassLoader::_first_append_entry = NULL;
|
||||
bool ClassLoader::_has_jimage = false;
|
||||
#if INCLUDE_CDS
|
||||
@ -179,6 +180,44 @@ bool ClassLoader::string_ends_with(const char* str, const char* str_to_find) {
|
||||
return (strncmp(str + (str_len - str_to_find_len), str_to_find, str_to_find_len) == 0);
|
||||
}
|
||||
|
||||
// Used to obtain the package name from a fully qualified class name.
|
||||
// It is the responsibility of the caller to establish ResourceMark.
|
||||
const char* ClassLoader::package_from_name(const char* class_name) {
|
||||
const char* last_slash = strrchr(class_name, '/');
|
||||
if (last_slash == NULL) {
|
||||
// No package name
|
||||
return NULL;
|
||||
}
|
||||
int length = last_slash - class_name;
|
||||
|
||||
// A class name could have just the slash character in the name,
|
||||
// resulting in a negative length.
|
||||
if (length <= 0) {
|
||||
// No package name
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// drop name after last slash (including slash)
|
||||
// Ex., "java/lang/String.class" => "java/lang"
|
||||
char* pkg_name = NEW_RESOURCE_ARRAY(char, length + 1);
|
||||
strncpy(pkg_name, class_name, length);
|
||||
*(pkg_name+length) = '\0';
|
||||
|
||||
return (const char *)pkg_name;
|
||||
}
|
||||
|
||||
// Given a fully qualified class name, find its defining package in the class loader's
|
||||
// package entry table.
|
||||
static PackageEntry* get_package_entry(const char* class_name, ClassLoaderData* loader_data, TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
const char *pkg_name = ClassLoader::package_from_name(class_name);
|
||||
if (pkg_name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
PackageEntryTable* pkgEntryTable = loader_data->packages();
|
||||
TempNewSymbol pkg_symbol = SymbolTable::new_symbol(pkg_name, CHECK_NULL);
|
||||
return pkgEntryTable->lookup_only(pkg_symbol);
|
||||
}
|
||||
|
||||
ClassPathDirEntry::ClassPathDirEntry(const char* dir) : ClassPathEntry() {
|
||||
char* copy = NEW_C_HEAP_ARRAY(char, strlen(dir)+1, mtClass);
|
||||
@ -281,8 +320,7 @@ u1* ClassPathZipEntry::open_entry(const char* name, jint* filesize, bool nul_ter
|
||||
#if INCLUDE_CDS
|
||||
u1* ClassPathZipEntry::open_versioned_entry(const char* name, jint* filesize, TRAPS) {
|
||||
u1* buffer = NULL;
|
||||
if (!_is_boot_append) {
|
||||
assert(DumpSharedSpaces, "Should be called only for non-boot entries during dump time");
|
||||
if (DumpSharedSpaces) {
|
||||
// We presume default is multi-release enabled
|
||||
const char* multi_ver = Arguments::get_property("jdk.util.jar.enableMultiRelease");
|
||||
const char* verstr = Arguments::get_property("jdk.util.jar.version");
|
||||
@ -402,31 +440,6 @@ ClassPathImageEntry::~ClassPathImageEntry() {
|
||||
}
|
||||
}
|
||||
|
||||
void ClassPathImageEntry::name_to_package(const char* name, char* buffer, int length) {
|
||||
const char *pslash = strrchr(name, '/');
|
||||
if (pslash == NULL) {
|
||||
buffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
int len = pslash - name;
|
||||
#if INCLUDE_CDS
|
||||
if (len <= 0 && DumpSharedSpaces) {
|
||||
buffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
assert(len > 0, "Bad length for package name");
|
||||
if (len >= length) {
|
||||
buffer[0] = '\0';
|
||||
return;
|
||||
}
|
||||
// drop name after last slash (including slash)
|
||||
// Ex., "java/lang/String.class" => "java/lang"
|
||||
strncpy(buffer, name, len);
|
||||
// ensure string termination (strncpy does not guarantee)
|
||||
buffer[len] = '\0';
|
||||
}
|
||||
|
||||
// For a class in a named module, look it up in the jimage file using this syntax:
|
||||
// /<module-name>/<package-name>/<base-class>
|
||||
//
|
||||
@ -439,15 +452,10 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
|
||||
JImageLocationRef location = (*JImageFindResource)(_jimage, "", get_jimage_version_string(), name, &size);
|
||||
|
||||
if (location == 0) {
|
||||
char package[JIMAGE_MAX_PATH];
|
||||
name_to_package(name, package, JIMAGE_MAX_PATH);
|
||||
ResourceMark rm;
|
||||
const char* pkg_name = ClassLoader::package_from_name(name);
|
||||
|
||||
#if INCLUDE_CDS
|
||||
if (package[0] == '\0' && DumpSharedSpaces) {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if (package[0] != '\0') {
|
||||
if (pkg_name != NULL) {
|
||||
if (!Universe::is_module_initialized()) {
|
||||
location = (*JImageFindResource)(_jimage, "java.base", get_jimage_version_string(), name, &size);
|
||||
#if INCLUDE_CDS
|
||||
@ -455,7 +463,7 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
|
||||
// modules defined for other class loaders. So, for now, get their module
|
||||
// names from the "modules" jimage file.
|
||||
if (DumpSharedSpaces && location == 0) {
|
||||
const char* module_name = (*JImagePackageToModule)(_jimage, package);
|
||||
const char* module_name = (*JImagePackageToModule)(_jimage, pkg_name);
|
||||
if (module_name != NULL) {
|
||||
location = (*JImageFindResource)(_jimage, module_name, get_jimage_version_string(), name, &size);
|
||||
}
|
||||
@ -463,13 +471,7 @@ ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
|
||||
#endif
|
||||
|
||||
} else {
|
||||
// Get boot class loader's package entry table
|
||||
PackageEntryTable* pkgEntryTable =
|
||||
ClassLoaderData::the_null_class_loader_data()->packages();
|
||||
// Get package's package entry
|
||||
TempNewSymbol pkg_symbol = SymbolTable::new_symbol(package, CHECK_NULL);
|
||||
PackageEntry* package_entry = pkgEntryTable->lookup_only(pkg_symbol);
|
||||
|
||||
PackageEntry* package_entry = get_package_entry(name, ClassLoaderData::the_null_class_loader_data(), THREAD);
|
||||
if (package_entry != NULL) {
|
||||
ResourceMark rm;
|
||||
// Get the module name
|
||||
@ -542,6 +544,33 @@ void ClassLoader::exit_with_path_failure(const char* error, const char* message)
|
||||
}
|
||||
#endif
|
||||
|
||||
ModuleClassPathList::ModuleClassPathList(Symbol* module_name) {
|
||||
_module_name = module_name;
|
||||
_module_first_entry = NULL;
|
||||
_module_last_entry = NULL;
|
||||
}
|
||||
|
||||
ModuleClassPathList::~ModuleClassPathList() {
|
||||
// Clean out each ClassPathEntry on list
|
||||
ClassPathEntry* e = _module_first_entry;
|
||||
while (e != NULL) {
|
||||
ClassPathEntry* next_entry = e->next();
|
||||
delete e;
|
||||
e = next_entry;
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleClassPathList::add_to_list(ClassPathEntry* new_entry) {
|
||||
if (new_entry != NULL) {
|
||||
if (_module_last_entry == NULL) {
|
||||
_module_first_entry = _module_last_entry = new_entry;
|
||||
} else {
|
||||
_module_last_entry->set_next(new_entry);
|
||||
_module_last_entry = new_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClassLoader::trace_class_path(const char* msg, const char* name) {
|
||||
if (log_is_enabled(Info, classpath)) {
|
||||
ResourceMark rm;
|
||||
@ -619,6 +648,61 @@ bool ClassLoader::check_shared_paths_misc_info(void *buf, int size) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Construct the array of module/path pairs as specified to -Xpatch
|
||||
// for the boot loader to search ahead of the jimage, if the class being
|
||||
// loaded is defined to a module that has been specified to -Xpatch.
|
||||
void ClassLoader::setup_xpatch_entries() {
|
||||
Thread* THREAD = Thread::current();
|
||||
GrowableArray<ModuleXPatchPath*>* xpatch_args = Arguments::get_xpatchprefix();
|
||||
int num_of_entries = xpatch_args->length();
|
||||
|
||||
// Set up the boot loader's xpatch_entries list
|
||||
_xpatch_entries = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<ModuleClassPathList*>(num_of_entries, true);
|
||||
|
||||
for (int i = 0; i < num_of_entries; i++) {
|
||||
const char* module_name = (xpatch_args->at(i))->module_name();
|
||||
Symbol* const module_sym = SymbolTable::lookup(module_name, (int)strlen(module_name), CHECK);
|
||||
assert(module_sym != NULL, "Failed to obtain Symbol for module name");
|
||||
ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym);
|
||||
|
||||
char* class_path = (xpatch_args->at(i))->path_string();
|
||||
int len = (int)strlen(class_path);
|
||||
int end = 0;
|
||||
// Iterate over the module's class path entries
|
||||
for (int start = 0; start < len; start = end) {
|
||||
while (class_path[end] && class_path[end] != os::path_separator()[0]) {
|
||||
end++;
|
||||
}
|
||||
EXCEPTION_MARK;
|
||||
ResourceMark rm(THREAD);
|
||||
char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
|
||||
strncpy(path, &class_path[start], end - start);
|
||||
path[end - start] = '\0';
|
||||
|
||||
struct stat st;
|
||||
if (os::stat(path, &st) == 0) {
|
||||
// File or directory found
|
||||
Thread* THREAD = Thread::current();
|
||||
ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
|
||||
// If the path specification is valid, enter it into this module's list
|
||||
if (new_entry != NULL) {
|
||||
module_cpl->add_to_list(new_entry);
|
||||
}
|
||||
}
|
||||
|
||||
while (class_path[end] == os::path_separator()[0]) {
|
||||
end++;
|
||||
}
|
||||
}
|
||||
|
||||
// Record the module into the list of -Xpatch entries only if
|
||||
// valid ClassPathEntrys have been created
|
||||
if (module_cpl->module_first_entry() != NULL) {
|
||||
_xpatch_entries->push(module_cpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClassLoader::setup_search_path(const char *class_path, bool bootstrap_search) {
|
||||
int offset = 0;
|
||||
int len = (int)strlen(class_path);
|
||||
@ -850,8 +934,29 @@ bool ClassLoader::update_class_path_entry_list(const char *path,
|
||||
}
|
||||
|
||||
void ClassLoader::print_bootclasspath() {
|
||||
ClassPathEntry* e = _first_entry;
|
||||
ClassPathEntry* e;
|
||||
tty->print("[bootclasspath= ");
|
||||
|
||||
// Print -Xpatch module/path specifications first
|
||||
if (_xpatch_entries != NULL) {
|
||||
ResourceMark rm;
|
||||
int num_of_entries = _xpatch_entries->length();
|
||||
for (int i = 0; i < num_of_entries; i++) {
|
||||
ModuleClassPathList* mpl = _xpatch_entries->at(i);
|
||||
tty->print("%s=", mpl->module_name()->as_C_string());
|
||||
e = mpl->module_first_entry();
|
||||
while (e != NULL) {
|
||||
tty->print("%s", e->name());
|
||||
e = e->next();
|
||||
if (e != NULL) {
|
||||
tty->print("%s", os::path_separator());
|
||||
}
|
||||
}
|
||||
tty->print(" ;");
|
||||
}
|
||||
}
|
||||
|
||||
e = _first_entry;
|
||||
while (e != NULL) {
|
||||
tty->print("%s ;", e->name());
|
||||
e = e->next();
|
||||
@ -941,6 +1046,7 @@ int ClassLoader::crc32(int crc, const char* buf, int len) {
|
||||
|
||||
#if INCLUDE_CDS
|
||||
void ClassLoader::initialize_module_loader_map(JImageFile* jimage) {
|
||||
ResourceMark rm;
|
||||
jlong size;
|
||||
JImageLocationRef location = (*JImageFindResource)(jimage, "java.base", get_jimage_version_string(), MODULE_LOADER_MAP, &size);
|
||||
if (location == 0) {
|
||||
@ -985,7 +1091,6 @@ void ClassLoader::initialize_module_loader_map(JImageFile* jimage) {
|
||||
begin_ptr = ++end_ptr;
|
||||
end_ptr = strchr(begin_ptr, '\n');
|
||||
}
|
||||
FREE_RESOURCE_ARRAY(u1, buffer, size);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1106,8 +1211,7 @@ s2 ClassLoader::module_to_classloader(const char* module_name) {
|
||||
}
|
||||
#endif
|
||||
|
||||
s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e,
|
||||
int classpath_index, TRAPS) {
|
||||
s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e, int classpath_index, TRAPS) {
|
||||
#if INCLUDE_CDS
|
||||
// obtain the classloader type based on the class name.
|
||||
// First obtain the package name based on the class name. Then obtain
|
||||
@ -1157,12 +1261,11 @@ const char* ClassLoader::file_name_for_class_name(const char* class_name,
|
||||
}
|
||||
|
||||
instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {
|
||||
|
||||
assert(name != NULL, "invariant");
|
||||
assert(THREAD->is_Java_thread(), "must be a JavaThread");
|
||||
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
ResourceMark rm(THREAD);
|
||||
HandleMark hm(THREAD);
|
||||
|
||||
const char* const class_name = name->as_C_string();
|
||||
|
||||
@ -1178,30 +1281,101 @@ instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_onl
|
||||
// Lookup stream for parsing .class file
|
||||
ClassFileStream* stream = NULL;
|
||||
s2 classpath_index = 0;
|
||||
ClassPathEntry* e = NULL;
|
||||
|
||||
// If DumpSharedSpaces is true, boot loader visibility boundaries are set
|
||||
// to be _first_entry to the end (all path entries).
|
||||
// to be _first_entry to the end (all path entries). No -Xpatch entries are
|
||||
// included since CDS and AppCDS are not supported if -Xpatch is specified.
|
||||
//
|
||||
// If search_append_only is true, boot loader visibility boundaries are
|
||||
// set to be _fist_append_entry to the end. This includes:
|
||||
// set to be _first_append_entry to the end. This includes:
|
||||
// [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
//
|
||||
// If both DumpSharedSpaces and search_append_only are false, boot loader
|
||||
// visibility boundaries are set to be _first_entry to the entry before
|
||||
// the _first_append_entry. This would include:
|
||||
// [-Xpatch:<dirs>]; [exploded build | modules]
|
||||
// [-Xpatch:<module>=<file>(<pathsep><file>)*]; [exploded build | jimage]
|
||||
//
|
||||
// DumpSharedSpaces and search_append_only are mutually exclusive and cannot
|
||||
// be true at the same time.
|
||||
ClassPathEntry* e = (search_append_only ? _first_append_entry : _first_entry);
|
||||
ClassPathEntry* last_e =
|
||||
(search_append_only || DumpSharedSpaces ? NULL : _first_append_entry);
|
||||
assert(!(DumpSharedSpaces && search_append_only), "DumpSharedSpaces and search_append_only are both true");
|
||||
|
||||
{
|
||||
// Load Attempt #1: -Xpatch
|
||||
// Determine the class' defining module. If it appears in the _xpatch_entries,
|
||||
// attempt to load the class from those locations specific to the module.
|
||||
// Note: The -Xpatch entries are never searched if the boot loader's
|
||||
// visibility boundary is limited to only searching the append entries.
|
||||
if (_xpatch_entries != NULL && !search_append_only && !DumpSharedSpaces) {
|
||||
// Find the module in the boot loader's module entry table
|
||||
PackageEntry* pkg_entry = get_package_entry(class_name, ClassLoaderData::the_null_class_loader_data(), THREAD);
|
||||
ModuleEntry* mod_entry = (pkg_entry != NULL) ? pkg_entry->module() : NULL;
|
||||
|
||||
// If the module system has not defined java.base yet, then
|
||||
// classes loaded are assumed to be defined to java.base.
|
||||
// When java.base is eventually defined by the module system,
|
||||
// all packages of classes that have been previously loaded
|
||||
// are verified in ModuleEntryTable::verify_javabase_packages().
|
||||
if (!Universe::is_module_initialized() &&
|
||||
!ModuleEntryTable::javabase_defined() &&
|
||||
mod_entry == NULL) {
|
||||
mod_entry = ModuleEntryTable::javabase_module();
|
||||
}
|
||||
|
||||
// The module must be a named module
|
||||
if (mod_entry != NULL && mod_entry->is_named()) {
|
||||
int num_of_entries = _xpatch_entries->length();
|
||||
const Symbol* class_module_name = mod_entry->name();
|
||||
|
||||
// Loop through all the xpatch entries looking for module
|
||||
for (int i = 0; i < num_of_entries; i++) {
|
||||
ModuleClassPathList* module_cpl = _xpatch_entries->at(i);
|
||||
Symbol* module_cpl_name = module_cpl->module_name();
|
||||
|
||||
if (module_cpl_name->fast_compare(class_module_name) == 0) {
|
||||
// Class' module has been located, attempt to load
|
||||
// the class from the module's ClassPathEntry list.
|
||||
e = module_cpl->module_first_entry();
|
||||
while (e != NULL) {
|
||||
stream = e->open_stream(file_name, CHECK_NULL);
|
||||
// No context.check is required since both CDS
|
||||
// and AppCDS are turned off if -Xpatch is specified.
|
||||
if (NULL != stream) {
|
||||
break;
|
||||
}
|
||||
e = e->next();
|
||||
}
|
||||
// If the module was located in the xpatch entries, break out
|
||||
// even if the class was not located successfully from that module's
|
||||
// ClassPathEntry list. There will not be another valid entry for
|
||||
// that module in the _xpatch_entries array.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load Attempt #2: [exploded build | jimage]
|
||||
if (!search_append_only && (NULL == stream)) {
|
||||
e = _first_entry;
|
||||
while ((e != NULL) && (e != _first_append_entry)) {
|
||||
stream = e->open_stream(file_name, CHECK_NULL);
|
||||
if (!context.check(stream, classpath_index)) {
|
||||
return NULL;
|
||||
}
|
||||
if (NULL != stream) {
|
||||
break;
|
||||
}
|
||||
e = e->next();
|
||||
++classpath_index;
|
||||
}
|
||||
}
|
||||
|
||||
// Load Attempt #3: [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
if ((search_append_only || DumpSharedSpaces) && (NULL == stream)) {
|
||||
// For the boot loader append path search, must calculate
|
||||
// the starting classpath_index prior to attempting to
|
||||
// load the classfile.
|
||||
if (search_append_only) {
|
||||
// For the boot loader append path search, must calculate
|
||||
// the starting classpath_index prior to attempting to
|
||||
// load the classfile.
|
||||
ClassPathEntry *tmp_e = _first_entry;
|
||||
while ((tmp_e != NULL) && (tmp_e != _first_append_entry)) {
|
||||
tmp_e = tmp_e->next();
|
||||
@ -1209,11 +1383,8 @@ instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_onl
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to load the classfile from either:
|
||||
// - [-Xpatch:dir]; exploded build | modules
|
||||
// or
|
||||
// - [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
while ((e != NULL) && (e != last_e)) {
|
||||
e = _first_append_entry;
|
||||
while (e != NULL) {
|
||||
stream = e->open_stream(file_name, CHECK_NULL);
|
||||
if (!context.check(stream, classpath_index)) {
|
||||
return NULL;
|
||||
@ -1384,10 +1555,23 @@ int ClassLoader::compute_Object_vtable() {
|
||||
}
|
||||
|
||||
|
||||
void classLoader_init() {
|
||||
void classLoader_init1() {
|
||||
ClassLoader::initialize();
|
||||
}
|
||||
|
||||
// Complete the ClassPathEntry setup for the boot loader
|
||||
void classLoader_init2() {
|
||||
// Setup the list of module/path pairs for -Xpatch processing
|
||||
// This must be done after the SymbolTable is created in order
|
||||
// to use fast_compare on module names instead of a string compare.
|
||||
if (Arguments::get_xpatchprefix() != NULL) {
|
||||
ClassLoader::setup_xpatch_entries();
|
||||
}
|
||||
|
||||
// Determine if this is an exploded build
|
||||
ClassLoader::set_has_jimage();
|
||||
}
|
||||
|
||||
|
||||
bool ClassLoader::get_canonical_path(const char* orig, char* out, int len) {
|
||||
assert(orig != NULL && out != NULL && len > 0, "bad arguments");
|
||||
@ -1431,17 +1615,19 @@ void ClassLoader::create_javabase() {
|
||||
}
|
||||
ModuleEntryTable::set_javabase_module(jb_module);
|
||||
}
|
||||
}
|
||||
|
||||
// When looking for the jimage file, only
|
||||
// search the boot loader's module path which
|
||||
// can consist of [-Xpatch]; exploded build | modules
|
||||
// Do not search the boot loader's append path.
|
||||
void ClassLoader::set_has_jimage() {
|
||||
// Determine if this is an exploded build. When looking for
|
||||
// the jimage file, only search the piece of the boot
|
||||
// loader's boot class path which contains [exploded build | jimage].
|
||||
// Do not search the boot loader's xpatch entries or append path.
|
||||
ClassPathEntry* e = _first_entry;
|
||||
ClassPathEntry* last_e = _first_append_entry;
|
||||
while ((e != NULL) && (e != last_e)) {
|
||||
JImageFile *jimage = e->jimage();
|
||||
if (jimage != NULL && e->is_jrt()) {
|
||||
set_has_jimage(true);
|
||||
_has_jimage = true;
|
||||
#if INCLUDE_CDS
|
||||
ClassLoader::initialize_module_loader_map(jimage);
|
||||
#endif
|
||||
|
||||
@ -142,13 +142,30 @@ public:
|
||||
JImageFile* jimage() const { return _jimage; }
|
||||
ClassPathImageEntry(JImageFile* jimage, const char* name);
|
||||
~ClassPathImageEntry();
|
||||
void name_to_package(const char* name, char* package, int length);
|
||||
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||
|
||||
// Debugging
|
||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
||||
};
|
||||
|
||||
// ModuleClassPathList contains a linked list of ClassPathEntry's
|
||||
// that have been specified for a specific module. Currently,
|
||||
// the only way to specify a module/path pair is via the -Xpatch
|
||||
// command line option.
|
||||
class ModuleClassPathList : public CHeapObj<mtClass> {
|
||||
private:
|
||||
Symbol* _module_name;
|
||||
// First and last entries of class path entries for a specific module
|
||||
ClassPathEntry* _module_first_entry;
|
||||
ClassPathEntry* _module_last_entry;
|
||||
public:
|
||||
Symbol* module_name() const { return _module_name; }
|
||||
ClassPathEntry* module_first_entry() const { return _module_first_entry; }
|
||||
ModuleClassPathList(Symbol* module_name);
|
||||
~ModuleClassPathList();
|
||||
void add_to_list(ClassPathEntry* new_entry);
|
||||
};
|
||||
|
||||
class SharedPathsMiscInfo;
|
||||
|
||||
class ClassLoader: AllStatic {
|
||||
@ -195,21 +212,31 @@ class ClassLoader: AllStatic {
|
||||
static PerfCounter* _isUnsyncloadClass;
|
||||
static PerfCounter* _load_instance_class_failCounter;
|
||||
|
||||
// First entry in linked list of ClassPathEntry instances.
|
||||
// This consists of entries made up by:
|
||||
// - boot loader modules
|
||||
// [-Xpatch]; exploded build | modules;
|
||||
// - boot loader append path
|
||||
// [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
// The boot class path consists of 3 ordered pieces:
|
||||
// 1. the module/path pairs specified to -Xpatch
|
||||
// -Xpatch:<module>=<file>(<pathsep><file>)*
|
||||
// 2. the base piece
|
||||
// [exploded build | jimage]
|
||||
// 3. boot loader append path
|
||||
// [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
//
|
||||
// The boot loader must obey this order when attempting
|
||||
// to load a class.
|
||||
|
||||
// Contains the module/path pairs specified to -Xpatch
|
||||
static GrowableArray<ModuleClassPathList*>* _xpatch_entries;
|
||||
|
||||
// Contains the ClassPathEntry instances that include
|
||||
// both the base piece and the boot loader append path.
|
||||
static ClassPathEntry* _first_entry;
|
||||
// Last entry in linked list of ClassPathEntry instances
|
||||
static ClassPathEntry* _last_entry;
|
||||
static int _num_entries;
|
||||
|
||||
// Pointer into the linked list of ClassPathEntry instances.
|
||||
// Marks the start of:
|
||||
// - the boot loader's append path
|
||||
// [-Xbootclasspath/a]; [jvmti appended entries]
|
||||
// within the linked list of ClassPathEntry instances.
|
||||
static ClassPathEntry* _first_append_entry;
|
||||
|
||||
static const char* _shared_archive;
|
||||
@ -325,11 +352,11 @@ class ClassLoader: AllStatic {
|
||||
return _load_instance_class_failCounter;
|
||||
}
|
||||
|
||||
// Sets _has_jimage to TRUE if "modules" jimage file exists
|
||||
static void set_has_jimage(bool val) {
|
||||
_has_jimage = val;
|
||||
}
|
||||
// Set up the module/path pairs as specified to -Xpatch
|
||||
static void setup_xpatch_entries();
|
||||
|
||||
// Sets _has_jimage to TRUE if "modules" jimage file exists
|
||||
static void set_has_jimage();
|
||||
static bool has_jimage() { return _has_jimage; }
|
||||
|
||||
// Create the ModuleEntry for java.base
|
||||
@ -416,6 +443,9 @@ class ClassLoader: AllStatic {
|
||||
|
||||
static bool string_ends_with(const char* str, const char* str_to_find);
|
||||
|
||||
// obtain package name from a fully qualified class name
|
||||
static const char* package_from_name(const char* class_name);
|
||||
|
||||
static bool is_jrt(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }
|
||||
|
||||
// Debugging
|
||||
|
||||
@ -133,68 +133,31 @@ static PackageEntry* get_package_entry_by_name(Symbol* package,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Check if -Xpatch:<dirs> was specified. If so, prepend each <dir>/module_name,
|
||||
// if it exists, to bootpath so boot loader can find the class files. Also, if
|
||||
// using exploded modules, append <java.home>/modules/module_name, if it exists,
|
||||
// to bootpath so that its class files can be found by the boot loader.
|
||||
static void add_to_boot_loader_list(char *module_name, TRAPS) {
|
||||
// java.base should be handled by argument parsing.
|
||||
// If using exploded build, append <java.home>/modules/module_name, if it exists,
|
||||
// to the system boot class path in order for the boot loader to locate class files.
|
||||
static void add_to_exploded_build_list(char *module_name, TRAPS) {
|
||||
assert(!ClassLoader::has_jimage(), "Exploded build not applicable");
|
||||
// java.base is handled by os::set_boot_path
|
||||
assert(strcmp(module_name, "java.base") != 0, "Unexpected java.base module name");
|
||||
|
||||
char file_sep = os::file_separator()[0];
|
||||
size_t module_len = strlen(module_name);
|
||||
|
||||
// If -Xpatch is set then add <patch-dir>/module_name paths.
|
||||
char** patch_dirs = Arguments::patch_dirs();
|
||||
if (patch_dirs != NULL) {
|
||||
int dir_count = Arguments::patch_dirs_count();
|
||||
for (int x = 0; x < dir_count; x++) {
|
||||
// Really shouldn't be NULL, but check can't hurt
|
||||
if (patch_dirs[x] != NULL) {
|
||||
size_t len = strlen(patch_dirs[x]);
|
||||
if (len != 0) { // Ignore empty strings.
|
||||
len = len + module_len + 2;
|
||||
char* prefix_path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
|
||||
jio_snprintf(prefix_path, len, "%s%c%s", patch_dirs[x], file_sep, module_name);
|
||||
|
||||
// See if Xpatch module path exists.
|
||||
struct stat st;
|
||||
if ((os::stat(prefix_path, &st) != 0)) {
|
||||
FREE_C_HEAP_ARRAY(char, prefix_path);
|
||||
} else {
|
||||
{
|
||||
HandleMark hm;
|
||||
Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
|
||||
ObjectLocker ol(loader_lock, THREAD);
|
||||
ClassLoader::prepend_to_list(prefix_path);
|
||||
}
|
||||
log_info(classload)("opened: -Xpatch %s", prefix_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If "modules" jimage does not exist then assume exploded form
|
||||
// ${java.home}/modules/<module-name>
|
||||
char* path = NULL;
|
||||
if (!ClassLoader::has_jimage()) {
|
||||
const char* home = Arguments::get_java_home();
|
||||
size_t len = strlen(home) + module_len + 32;
|
||||
path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
|
||||
jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
|
||||
struct stat st;
|
||||
// See if exploded module path exists.
|
||||
if ((os::stat(path, &st) != 0)) {
|
||||
FREE_C_HEAP_ARRAY(char, path);
|
||||
path = NULL;
|
||||
}
|
||||
const char* home = Arguments::get_java_home();
|
||||
size_t len = strlen(home) + module_len + 32;
|
||||
char* path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
|
||||
jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
|
||||
struct stat st;
|
||||
// See if exploded module path exists
|
||||
if ((os::stat(path, &st) != 0)) {
|
||||
FREE_C_HEAP_ARRAY(char, path);
|
||||
path = NULL;
|
||||
}
|
||||
|
||||
if (path != NULL) {
|
||||
HandleMark hm;
|
||||
Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
|
||||
ObjectLocker ol(loader_lock, THREAD);
|
||||
|
||||
log_info(classload)("opened: %s", path);
|
||||
ClassLoader::add_to_list(path);
|
||||
}
|
||||
@ -493,13 +456,12 @@ void Modules::define_module(jobject module, jstring version,
|
||||
}
|
||||
}
|
||||
|
||||
if (loader == NULL && !Universe::is_module_initialized()) {
|
||||
// Now that the module is defined, if it is in the bootloader, make sure that
|
||||
// its classes can be found. Check if -Xpatch:<path> was specified. If
|
||||
// so prepend <path>/module_name, if it exists, to bootpath. Also, if using
|
||||
// exploded modules, prepend <java.home>/modules/module_name, if it exists,
|
||||
// to bootpath.
|
||||
add_to_boot_loader_list(module_name, CHECK);
|
||||
// If the module is defined to the boot loader and an exploded build is being
|
||||
// used, prepend <java.home>/modules/modules_name, if it exists, to the system boot class path.
|
||||
if (loader == NULL &&
|
||||
!Universe::is_module_initialized() &&
|
||||
!ClassLoader::has_jimage()) {
|
||||
add_to_exploded_build_list(module_name, CHECK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -880,7 +880,7 @@ bool FileMapInfo::FileMapHeader::validate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arguments::patch_dirs() != NULL) {
|
||||
if (Arguments::get_xpatchprefix() != NULL) {
|
||||
FileMapInfo::fail_continue("The shared archive file cannot be used with -Xpatch.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -43,10 +43,10 @@
|
||||
// for the x64 platform
|
||||
#define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform
|
||||
|
||||
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(12*M) LP64_ONLY(16*M))
|
||||
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(12*M))
|
||||
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(8*M) LP64_ONLY(10*M))
|
||||
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(10*M))
|
||||
|
||||
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(12*M) LP64_ONLY(16*M))
|
||||
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(8*M) LP64_ONLY(10*M))
|
||||
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(8*M) LP64_ONLY(9*M))
|
||||
|
||||
// the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on
|
||||
|
||||
@ -415,8 +415,12 @@ static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* reso
|
||||
if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) {
|
||||
return false; // Total size of arguments on stack mismatch.
|
||||
}
|
||||
if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
|
||||
return false; // Return value size or type mismatch encountered.
|
||||
if (!symbolic_info->return_type()->is_void()) {
|
||||
// Only check the return type if the symbolic method is not void
|
||||
// i.e. the return value of the resolved method can be dropped
|
||||
if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
|
||||
return false; // Return value size or type mismatch encountered.
|
||||
}
|
||||
}
|
||||
|
||||
switch (symbolic_info->intrinsic_id()) {
|
||||
|
||||
@ -84,8 +84,6 @@ const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
|
||||
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
|
||||
int Arguments::_sun_java_launcher_pid = -1;
|
||||
bool Arguments::_sun_java_launcher_is_altjvm = false;
|
||||
int Arguments::_patch_dirs_count = 0;
|
||||
char** Arguments::_patch_dirs = NULL;
|
||||
int Arguments::_bootclassloader_append_index = -1;
|
||||
|
||||
// These parameters are reset in method parse_vm_init_args()
|
||||
@ -112,6 +110,7 @@ SystemProperty *Arguments::_java_home = NULL;
|
||||
SystemProperty *Arguments::_java_class_path = NULL;
|
||||
SystemProperty *Arguments::_jdk_boot_class_path_append = NULL;
|
||||
|
||||
GrowableArray<ModuleXPatchPath*> *Arguments::_xpatchprefix = NULL;
|
||||
PathString *Arguments::_system_boot_class_path = NULL;
|
||||
|
||||
char* Arguments::_ext_dirs = NULL;
|
||||
@ -579,204 +578,6 @@ static bool verify_special_jvm_flags() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Constructs the system boot class path from the following components, in order:
|
||||
//
|
||||
// prefix // from -Xpatch:...
|
||||
// base // from os::get_system_properties()
|
||||
// suffix // from -Xbootclasspath/a:...
|
||||
//
|
||||
// This could be AllStatic, but it isn't needed after argument processing is
|
||||
// complete. After argument processing, the combined components are copied
|
||||
// to Arguments::_system_boot_class_path via a call to Arguments::set_sysclasspath.
|
||||
class ArgumentBootClassPath: public StackObj {
|
||||
public:
|
||||
ArgumentBootClassPath(const char* base);
|
||||
~ArgumentBootClassPath();
|
||||
|
||||
inline void set_base(const char* base);
|
||||
inline void add_prefix(const char* prefix);
|
||||
inline void add_suffix_to_prefix(const char* suffix);
|
||||
inline void add_suffix(const char* suffix);
|
||||
inline void reset_path(const char* base);
|
||||
|
||||
inline const char* get_base() const { return _items[_bcp_base]; }
|
||||
inline const char* get_prefix() const { return _items[_bcp_prefix]; }
|
||||
inline const char* get_suffix() const { return _items[_bcp_suffix]; }
|
||||
|
||||
// Combine all the components into a single c-heap-allocated string; caller
|
||||
// must free the string if/when no longer needed.
|
||||
char* combined_path();
|
||||
|
||||
private:
|
||||
// Utility routines.
|
||||
static char* add_to_path(const char* path, const char* str, bool prepend);
|
||||
static char* add_jars_to_path(char* path, const char* directory);
|
||||
|
||||
inline void reset_item_at(int index);
|
||||
|
||||
// Array indices for the items that make up the sysclasspath. All except the
|
||||
// base are allocated in the C heap and freed by this class.
|
||||
enum {
|
||||
_bcp_prefix, // was -Xpatch:...
|
||||
_bcp_base, // the default system boot class path
|
||||
_bcp_suffix, // from -Xbootclasspath/a:...
|
||||
_bcp_nitems // the number of items, must be last.
|
||||
};
|
||||
|
||||
const char* _items[_bcp_nitems];
|
||||
};
|
||||
|
||||
ArgumentBootClassPath::ArgumentBootClassPath(const char* base) {
|
||||
memset(_items, 0, sizeof(_items));
|
||||
_items[_bcp_base] = base;
|
||||
}
|
||||
|
||||
ArgumentBootClassPath::~ArgumentBootClassPath() {
|
||||
// Free everything except the base.
|
||||
for (int i = 0; i < _bcp_nitems; ++i) {
|
||||
if (i != _bcp_base) reset_item_at(i);
|
||||
}
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::set_base(const char* base) {
|
||||
_items[_bcp_base] = base;
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::add_prefix(const char* prefix) {
|
||||
_items[_bcp_prefix] = add_to_path(_items[_bcp_prefix], prefix, true);
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::add_suffix_to_prefix(const char* suffix) {
|
||||
_items[_bcp_prefix] = add_to_path(_items[_bcp_prefix], suffix, false);
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::add_suffix(const char* suffix) {
|
||||
_items[_bcp_suffix] = add_to_path(_items[_bcp_suffix], suffix, false);
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::reset_item_at(int index) {
|
||||
assert(index < _bcp_nitems && index != _bcp_base, "just checking");
|
||||
if (_items[index] != NULL) {
|
||||
FREE_C_HEAP_ARRAY(char, _items[index]);
|
||||
_items[index] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline void ArgumentBootClassPath::reset_path(const char* base) {
|
||||
// Clear the prefix and suffix.
|
||||
reset_item_at(_bcp_prefix);
|
||||
reset_item_at(_bcp_suffix);
|
||||
set_base(base);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Combine the bootclasspath elements, some of which may be null, into a single
|
||||
// c-heap-allocated string.
|
||||
char* ArgumentBootClassPath::combined_path() {
|
||||
assert(_items[_bcp_base] != NULL, "empty default sysclasspath");
|
||||
|
||||
size_t lengths[_bcp_nitems];
|
||||
size_t total_len = 0;
|
||||
|
||||
const char separator = *os::path_separator();
|
||||
|
||||
// Get the lengths.
|
||||
int i;
|
||||
for (i = 0; i < _bcp_nitems; ++i) {
|
||||
if (i == _bcp_suffix) {
|
||||
// Record index of boot loader's append path.
|
||||
Arguments::set_bootclassloader_append_index((int)total_len);
|
||||
}
|
||||
if (_items[i] != NULL) {
|
||||
lengths[i] = strlen(_items[i]);
|
||||
// Include space for the separator char (or a NULL for the last item).
|
||||
total_len += lengths[i] + 1;
|
||||
}
|
||||
}
|
||||
assert(total_len > 0, "empty sysclasspath not allowed");
|
||||
|
||||
// Copy the _items to a single string.
|
||||
char* cp = NEW_C_HEAP_ARRAY(char, total_len, mtArguments);
|
||||
char* cp_tmp = cp;
|
||||
for (i = 0; i < _bcp_nitems; ++i) {
|
||||
if (_items[i] != NULL) {
|
||||
memcpy(cp_tmp, _items[i], lengths[i]);
|
||||
cp_tmp += lengths[i];
|
||||
*cp_tmp++ = separator;
|
||||
}
|
||||
}
|
||||
*--cp_tmp = '\0'; // Replace the extra separator.
|
||||
return cp;
|
||||
}
|
||||
|
||||
// Note: path must be c-heap-allocated (or NULL); it is freed if non-null.
|
||||
char*
|
||||
ArgumentBootClassPath::add_to_path(const char* path, const char* str, bool prepend) {
|
||||
char *cp;
|
||||
|
||||
assert(str != NULL, "just checking");
|
||||
if (path == NULL) {
|
||||
size_t len = strlen(str) + 1;
|
||||
cp = NEW_C_HEAP_ARRAY(char, len, mtArguments);
|
||||
memcpy(cp, str, len); // copy the trailing null
|
||||
} else {
|
||||
const char separator = *os::path_separator();
|
||||
size_t old_len = strlen(path);
|
||||
size_t str_len = strlen(str);
|
||||
size_t len = old_len + str_len + 2;
|
||||
|
||||
if (prepend) {
|
||||
cp = NEW_C_HEAP_ARRAY(char, len, mtArguments);
|
||||
char* cp_tmp = cp;
|
||||
memcpy(cp_tmp, str, str_len);
|
||||
cp_tmp += str_len;
|
||||
*cp_tmp = separator;
|
||||
memcpy(++cp_tmp, path, old_len + 1); // copy the trailing null
|
||||
FREE_C_HEAP_ARRAY(char, path);
|
||||
} else {
|
||||
cp = REALLOC_C_HEAP_ARRAY(char, path, len, mtArguments);
|
||||
char* cp_tmp = cp + old_len;
|
||||
*cp_tmp = separator;
|
||||
memcpy(++cp_tmp, str, str_len + 1); // copy the trailing null
|
||||
}
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
|
||||
// Scan the directory and append any jar or zip files found to path.
|
||||
// Note: path must be c-heap-allocated (or NULL); it is freed if non-null.
|
||||
char* ArgumentBootClassPath::add_jars_to_path(char* path, const char* directory) {
|
||||
DIR* dir = os::opendir(directory);
|
||||
if (dir == NULL) return path;
|
||||
|
||||
char dir_sep[2] = { '\0', '\0' };
|
||||
size_t directory_len = strlen(directory);
|
||||
const char fileSep = *os::file_separator();
|
||||
if (directory[directory_len - 1] != fileSep) dir_sep[0] = fileSep;
|
||||
|
||||
/* Scan the directory for jars/zips, appending them to path. */
|
||||
struct dirent *entry;
|
||||
char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtArguments);
|
||||
while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
|
||||
const char* name = entry->d_name;
|
||||
const char* ext = name + strlen(name) - 4;
|
||||
bool isJarOrZip = ext > name &&
|
||||
(os::file_name_strcmp(ext, ".jar") == 0 ||
|
||||
os::file_name_strcmp(ext, ".zip") == 0);
|
||||
if (isJarOrZip) {
|
||||
char* jarpath = NEW_C_HEAP_ARRAY(char, directory_len + 2 + strlen(name), mtArguments);
|
||||
sprintf(jarpath, "%s%s%s", directory, dir_sep, name);
|
||||
path = add_to_path(path, jarpath, false);
|
||||
FREE_C_HEAP_ARRAY(char, jarpath);
|
||||
}
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, dbuf);
|
||||
os::closedir(dir);
|
||||
return path;
|
||||
}
|
||||
|
||||
// Parses a memory size specification string.
|
||||
static bool atomull(const char *s, julong* result) {
|
||||
julong n = 0;
|
||||
@ -2687,9 +2488,7 @@ Arguments::ArgsRange Arguments::parse_memory_size(const char* s,
|
||||
jint Arguments::parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
|
||||
const JavaVMInitArgs *java_options_args,
|
||||
const JavaVMInitArgs *cmd_line_args) {
|
||||
// For components of the system classpath.
|
||||
ArgumentBootClassPath bcp(Arguments::get_sysclasspath());
|
||||
bool bcp_assembly_required = false;
|
||||
bool xpatch_javabase = false;
|
||||
|
||||
// Save default settings for some mode flags
|
||||
Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
|
||||
@ -2706,29 +2505,26 @@ jint Arguments::parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
|
||||
|
||||
// Parse args structure generated from JAVA_TOOL_OPTIONS environment
|
||||
// variable (if present).
|
||||
jint result = parse_each_vm_init_arg(
|
||||
java_tool_options_args, &bcp, &bcp_assembly_required, Flag::ENVIRON_VAR);
|
||||
jint result = parse_each_vm_init_arg(java_tool_options_args, &xpatch_javabase, Flag::ENVIRON_VAR);
|
||||
if (result != JNI_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Parse args structure generated from the command line flags.
|
||||
result = parse_each_vm_init_arg(cmd_line_args, &bcp, &bcp_assembly_required,
|
||||
Flag::COMMAND_LINE);
|
||||
result = parse_each_vm_init_arg(cmd_line_args, &xpatch_javabase, Flag::COMMAND_LINE);
|
||||
if (result != JNI_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Parse args structure generated from the _JAVA_OPTIONS environment
|
||||
// variable (if present) (mimics classic VM)
|
||||
result = parse_each_vm_init_arg(
|
||||
java_options_args, &bcp, &bcp_assembly_required, Flag::ENVIRON_VAR);
|
||||
result = parse_each_vm_init_arg(java_options_args, &xpatch_javabase, Flag::ENVIRON_VAR);
|
||||
if (result != JNI_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Do final processing now that all arguments have been parsed
|
||||
result = finalize_vm_init_args(&bcp, bcp_assembly_required);
|
||||
result = finalize_vm_init_args();
|
||||
if (result != JNI_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -2781,10 +2577,7 @@ bool valid_jdwp_agent(char *name, bool is_path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
ArgumentBootClassPath* bcp_p,
|
||||
bool* bcp_assembly_required_p,
|
||||
Flag::Flags origin) {
|
||||
jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_javabase, Flag::Flags origin) {
|
||||
// For match_option to return remaining or value part of option string
|
||||
const char* tail;
|
||||
|
||||
@ -2840,8 +2633,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
return JNI_EINVAL;
|
||||
// -bootclasspath/a:
|
||||
} else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
|
||||
bcp_p->add_suffix(tail);
|
||||
*bcp_assembly_required_p = true;
|
||||
Arguments::set_bootclassloader_append_index((int)strlen(Arguments::get_sysclasspath())+1);
|
||||
Arguments::append_sysclasspath(tail);
|
||||
// -bootclasspath/p:
|
||||
} else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
|
||||
jio_fprintf(defaultStream::output_stream(),
|
||||
@ -2901,9 +2694,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
if (tail != NULL) {
|
||||
char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtArguments), tail);
|
||||
add_init_agent("instrument", options, false);
|
||||
// java agents need module java.instrument. Also -addmods ALL-SYSTEM because
|
||||
// the java agent is in the unmamed module of the application class loader
|
||||
if (!Arguments::append_to_addmods_property("java.instrument,ALL-SYSTEM")) {
|
||||
// java agents need module java.instrument
|
||||
if (!Arguments::append_to_addmods_property("java.instrument")) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
}
|
||||
@ -3181,37 +2973,30 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
return JNI_ERR;
|
||||
#endif
|
||||
}
|
||||
if (match_option(option, "-Djdk.launcher.patch.0=", &tail)) {
|
||||
// -Xpatch
|
||||
int dir_count;
|
||||
char** patch_dirs = os::split_path(tail, &dir_count);
|
||||
if (patch_dirs == NULL) {
|
||||
jio_fprintf(defaultStream::output_stream(),
|
||||
"Bad value for -Xpatch.\n");
|
||||
if (match_option(option, "-Djdk.launcher.patch.", &tail)) {
|
||||
// -Djdk.launcher.patch.#=<module>=<file>(<pathsep><file>)*
|
||||
// The number, #, specified will be increasing with each -Xpatch
|
||||
// specified on the command line.
|
||||
// Pick up module name, following the -D property's equal sign.
|
||||
const char* property_equal = strchr(tail, '=');
|
||||
if (property_equal == NULL) {
|
||||
jio_fprintf(defaultStream::output_stream(), "Missing '=' in -Xpatch specification\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
set_patch_dirs(patch_dirs);
|
||||
set_patch_dirs_count(dir_count);
|
||||
|
||||
// Create a path for each patch dir consisting of dir/java.base.
|
||||
char file_sep = os::file_separator()[0];
|
||||
for (int x = 0; x < dir_count; x++) {
|
||||
// Really shouldn't be NULL, but check can't hurt
|
||||
if (patch_dirs[x] != NULL) {
|
||||
size_t len = strlen(patch_dirs[x]);
|
||||
if (len != 0) { // Ignore empty strings.
|
||||
len += 11; // file_sep + "java.base" + null terminator.
|
||||
char* dir = NEW_C_HEAP_ARRAY(char, len, mtArguments);
|
||||
jio_snprintf(dir, len, "%s%cjava.base", patch_dirs[x], file_sep);
|
||||
|
||||
// See if Xpatch module path exists.
|
||||
struct stat st;
|
||||
if ((os::stat(dir, &st) == 0)) {
|
||||
bcp_p->add_prefix(dir);
|
||||
*bcp_assembly_required_p = true;
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, dir);
|
||||
}
|
||||
} else {
|
||||
// Find the equal sign between the module name and the path specification
|
||||
const char* module_equal = strchr(property_equal + 1, '=');
|
||||
if (module_equal == NULL) {
|
||||
jio_fprintf(defaultStream::output_stream(), "Bad value for -Xpatch, no module name specified\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
// Pick out the module name, in between the two equal signs
|
||||
size_t module_len = module_equal - property_equal - 1;
|
||||
char* module_name = NEW_C_HEAP_ARRAY(char, module_len+1, mtArguments);
|
||||
memcpy(module_name, property_equal + 1, module_len);
|
||||
*(module_name + module_len) = '\0';
|
||||
// The path piece begins one past the module_equal sign
|
||||
Arguments::add_xpatchprefix(module_name, module_equal + 1, xpatch_javabase);
|
||||
FREE_C_HEAP_ARRAY(char, module_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3474,6 +3259,27 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
return JNI_OK;
|
||||
}
|
||||
|
||||
void Arguments::add_xpatchprefix(const char* module_name, const char* path, bool* xpatch_javabase) {
|
||||
// For java.base check for duplicate -Xpatch options being specified on the command line.
|
||||
// This check is only required for java.base, all other duplicate module specifications
|
||||
// will be checked during module system initialization. The module system initialization
|
||||
// will throw an ExceptionInInitializerError if this situation occurs.
|
||||
if (strcmp(module_name, "java.base") == 0) {
|
||||
if (*xpatch_javabase) {
|
||||
vm_exit_during_initialization("Cannot specify java.base more than once to -Xpatch");
|
||||
} else {
|
||||
*xpatch_javabase = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Create GrowableArray lazily, only if -Xpatch has been specified
|
||||
if (_xpatchprefix == NULL) {
|
||||
_xpatchprefix = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<ModuleXPatchPath*>(10, true);
|
||||
}
|
||||
|
||||
_xpatchprefix->push(new ModuleXPatchPath(module_name, path));
|
||||
}
|
||||
|
||||
// Set property jdk.boot.class.path.append to the contents of the bootclasspath
|
||||
// that follows either the jimage file or exploded module directories. The
|
||||
// property will contain -Xbootclasspath/a and/or jvmti appended additions.
|
||||
@ -3572,7 +3378,7 @@ static int check_non_empty_dirs(const char* path) {
|
||||
return nonEmptyDirs;
|
||||
}
|
||||
|
||||
jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_assembly_required) {
|
||||
jint Arguments::finalize_vm_init_args() {
|
||||
// check if the default lib/endorsed directory exists; if so, error
|
||||
char path[JVM_MAXPATHLEN];
|
||||
const char* fileSep = os::file_separator();
|
||||
@ -3608,17 +3414,7 @@ jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_ass
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
if (bcp_assembly_required) {
|
||||
// Assemble the bootclasspath elements into the final path.
|
||||
char *combined_path = bcp_p->combined_path();
|
||||
Arguments::set_sysclasspath(combined_path);
|
||||
FREE_C_HEAP_ARRAY(char, combined_path);
|
||||
} else {
|
||||
// At this point in sysclasspath processing anything
|
||||
// added would be considered in the boot loader's append path.
|
||||
// Record this index, including +1 for the file separator character.
|
||||
Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1);
|
||||
}
|
||||
Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1);
|
||||
|
||||
// This must be done after all arguments have been processed.
|
||||
// java_compiler() true means set to "NONE" or empty.
|
||||
@ -3667,6 +3463,12 @@ jint Arguments::finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_ass
|
||||
UNSUPPORTED_OPTION(TieredCompilation);
|
||||
#endif
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI && !append_to_addmods_property("jdk.vm.ci")) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
#endif
|
||||
|
||||
// If we are running in a headless jre, force java.awt.headless property
|
||||
// to be true unless the property has already been set.
|
||||
// Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
|
||||
@ -3968,7 +3770,7 @@ jint Arguments::parse_options_buffer(const char* name, char* buffer, const size_
|
||||
|
||||
void Arguments::set_shared_spaces_flags() {
|
||||
if (DumpSharedSpaces) {
|
||||
if (Arguments::patch_dirs() != NULL) {
|
||||
if (Arguments::get_xpatchprefix() != NULL) {
|
||||
vm_exit_during_initialization(
|
||||
"Cannot use the following option when dumping the shared archive", "-Xpatch");
|
||||
}
|
||||
|
||||
@ -41,17 +41,15 @@ extern "C" {
|
||||
typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0);
|
||||
}
|
||||
|
||||
// Forward declarations
|
||||
class ArgumentBootClassPath;
|
||||
|
||||
// PathString is used as the underlying value container for a
|
||||
// SystemProperty and for the string that represents the system
|
||||
// boot class path, Arguments::_system_boot_class_path.
|
||||
// PathString is used as:
|
||||
// - the underlying value for a SystemProperty
|
||||
// - the path portion of an -Xpatch module/path pair
|
||||
// - the string that represents the system boot class path, Arguments::_system_boot_class_path.
|
||||
class PathString : public CHeapObj<mtArguments> {
|
||||
protected:
|
||||
char* _value;
|
||||
char* _value;
|
||||
public:
|
||||
char* value() const { return _value; }
|
||||
char* value() const { return _value; }
|
||||
|
||||
bool set_value(const char *value) {
|
||||
if (_value != NULL) {
|
||||
@ -92,7 +90,6 @@ class PathString : public CHeapObj<mtArguments> {
|
||||
}
|
||||
}
|
||||
|
||||
// Constructor
|
||||
PathString(const char* value) {
|
||||
if (value == NULL) {
|
||||
_value = NULL;
|
||||
@ -101,6 +98,43 @@ class PathString : public CHeapObj<mtArguments> {
|
||||
strcpy(_value, value);
|
||||
}
|
||||
}
|
||||
|
||||
~PathString() {
|
||||
if (_value != NULL) {
|
||||
FreeHeap(_value);
|
||||
_value = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ModuleXPatchPath records the module/path pair as specified to -Xpatch.
|
||||
class ModuleXPatchPath : public CHeapObj<mtInternal> {
|
||||
private:
|
||||
char* _module_name;
|
||||
PathString* _path;
|
||||
public:
|
||||
ModuleXPatchPath(const char* module_name, const char* path) {
|
||||
assert(module_name != NULL && path != NULL, "Invalid module name or path value");
|
||||
size_t len = strlen(module_name) + 1;
|
||||
_module_name = AllocateHeap(len, mtInternal);
|
||||
strncpy(_module_name, module_name, len); // copy the trailing null
|
||||
_path = new PathString(path);
|
||||
}
|
||||
|
||||
~ModuleXPatchPath() {
|
||||
if (_module_name != NULL) {
|
||||
FreeHeap(_module_name);
|
||||
_module_name = NULL;
|
||||
}
|
||||
if (_path != NULL) {
|
||||
delete _path;
|
||||
_path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline void set_path(const char* path) { _path->set_value(path); }
|
||||
inline const char* module_name() const { return _module_name; }
|
||||
inline char* path_string() const { return _path->value(); }
|
||||
};
|
||||
|
||||
// Element describing System and User (-Dkey=value flags) defined property.
|
||||
@ -114,7 +148,7 @@ class SystemProperty : public PathString {
|
||||
SystemProperty* _next;
|
||||
bool _internal;
|
||||
bool _writeable;
|
||||
bool writeable() { return _writeable; }
|
||||
bool writeable() { return _writeable; }
|
||||
|
||||
public:
|
||||
// Accessors
|
||||
@ -314,10 +348,19 @@ class Arguments : AllStatic {
|
||||
static SystemProperty *_java_class_path;
|
||||
static SystemProperty *_jdk_boot_class_path_append;
|
||||
|
||||
// -Xpatch:module=<file>(<pathsep><file>)*
|
||||
// Each element contains the associated module name, path
|
||||
// string pair as specified to -Xpatch.
|
||||
static GrowableArray<ModuleXPatchPath*>* _xpatchprefix;
|
||||
|
||||
// The constructed value of the system class path after
|
||||
// argument processing and JVMTI OnLoad additions via
|
||||
// calls to AddToBootstrapClassLoaderSearch. This is the
|
||||
// final form before ClassLoader::setup_bootstrap_search().
|
||||
// Note: since -Xpatch is a module name/path pair, the system
|
||||
// boot class path string no longer contains the "prefix" to
|
||||
// the boot class path base piece as it did when
|
||||
// -Xbootclasspath/p was supported.
|
||||
static PathString *_system_boot_class_path;
|
||||
|
||||
// temporary: to emit warning if the default ext dirs are not empty.
|
||||
@ -373,12 +416,6 @@ class Arguments : AllStatic {
|
||||
// mark the boot loader's append path observability boundary.
|
||||
static int _bootclassloader_append_index;
|
||||
|
||||
// -Xpatch flag
|
||||
static char** _patch_dirs;
|
||||
static int _patch_dirs_count;
|
||||
static void set_patch_dirs(char** dirs) { _patch_dirs = dirs; }
|
||||
static void set_patch_dirs_count(int count) { _patch_dirs_count = count; }
|
||||
|
||||
// -Xdebug flag
|
||||
static bool _xdebug_mode;
|
||||
static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; }
|
||||
@ -465,8 +502,8 @@ class Arguments : AllStatic {
|
||||
static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
|
||||
const JavaVMInitArgs *java_options_args,
|
||||
const JavaVMInitArgs *cmd_line_args);
|
||||
static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, ArgumentBootClassPath* bcp_p, bool* bcp_assembly_required_p, Flag::Flags origin);
|
||||
static jint finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_assembly_required);
|
||||
static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_javabase, Flag::Flags origin);
|
||||
static jint finalize_vm_init_args();
|
||||
static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
|
||||
|
||||
static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
|
||||
@ -637,13 +674,12 @@ class Arguments : AllStatic {
|
||||
return _bootclassloader_append_index;
|
||||
}
|
||||
static void set_bootclassloader_append_index(int value) {
|
||||
_bootclassloader_append_index = value;
|
||||
// Set only if the index has not been set yet
|
||||
if (_bootclassloader_append_index == -1) {
|
||||
_bootclassloader_append_index = value;
|
||||
}
|
||||
}
|
||||
|
||||
// -Xpatch
|
||||
static char** patch_dirs() { return _patch_dirs; }
|
||||
static int patch_dirs_count() { return _patch_dirs_count; }
|
||||
|
||||
// -Xrun
|
||||
static AgentLibrary* libraries() { return _libraryList.first(); }
|
||||
static bool init_libraries_at_startup() { return !_libraryList.is_empty(); }
|
||||
@ -701,8 +737,8 @@ class Arguments : AllStatic {
|
||||
static void set_library_path(const char *value) { _java_library_path->set_value(value); }
|
||||
static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); }
|
||||
|
||||
// Set up of the underlying system boot class path
|
||||
static void set_jdkbootclasspath_append();
|
||||
// Set up the underlying pieces of the system boot class path
|
||||
static void add_xpatchprefix(const char *module_name, const char *path, bool* xpatch_javabase);
|
||||
static void set_sysclasspath(const char *value) {
|
||||
_system_boot_class_path->set_value(value);
|
||||
set_jdkbootclasspath_append();
|
||||
@ -711,11 +747,15 @@ class Arguments : AllStatic {
|
||||
_system_boot_class_path->append_value(value);
|
||||
set_jdkbootclasspath_append();
|
||||
}
|
||||
static void set_jdkbootclasspath_append();
|
||||
|
||||
static char* get_java_home() { return _java_home->value(); }
|
||||
static char* get_dll_dir() { return _sun_boot_library_path->value(); }
|
||||
static GrowableArray<ModuleXPatchPath*>* get_xpatchprefix() { return _xpatchprefix; }
|
||||
static char* get_sysclasspath() { return _system_boot_class_path->value(); }
|
||||
static char* get_ext_dirs() { return _ext_dirs; }
|
||||
static char* get_jdk_boot_class_path_append() { return _jdk_boot_class_path_append->value(); }
|
||||
|
||||
static char* get_java_home() { return _java_home->value(); }
|
||||
static char* get_dll_dir() { return _sun_boot_library_path->value(); }
|
||||
static char* get_ext_dirs() { return _ext_dirs; }
|
||||
static char* get_appclasspath() { return _java_class_path->value(); }
|
||||
static void fix_appclasspath();
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ void SuspendibleThreadSet_init() NOT_ALL_GCS_RETURN;
|
||||
// Initialization done by Java thread in init_globals()
|
||||
void management_init();
|
||||
void bytecodes_init();
|
||||
void classLoader_init();
|
||||
void classLoader_init1();
|
||||
void classLoader_init2(); // note: ClassLoader need 2-phase init
|
||||
void compilationPolicy_init();
|
||||
void codeCache_init();
|
||||
void VM_Version_init();
|
||||
@ -102,7 +103,7 @@ jint init_globals() {
|
||||
HandleMark hm;
|
||||
management_init();
|
||||
bytecodes_init();
|
||||
classLoader_init();
|
||||
classLoader_init1();
|
||||
compilationPolicy_init();
|
||||
codeCache_init();
|
||||
CodeCacheExtensions::initialize();
|
||||
@ -116,6 +117,7 @@ jint init_globals() {
|
||||
if (status != JNI_OK)
|
||||
return status;
|
||||
|
||||
classLoader_init2(); // after SymbolTable creation, set up -Xpatch entries
|
||||
CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Universe);
|
||||
interpreter_init(); // before any methods loaded
|
||||
CodeCacheExtensions::complete_step(CodeCacheExtensionsSteps::Interpreter);
|
||||
|
||||
@ -36,9 +36,12 @@ groups=TEST.groups [closed/TEST.groups]
|
||||
requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java
|
||||
requires.properties=sun.arch.data.model
|
||||
|
||||
# Tests using jtreg 4.2 b01 features
|
||||
requiredVersion=4.2 b01
|
||||
# Tests using jtreg 4.2 b02 features
|
||||
requiredVersion=4.2 b02
|
||||
|
||||
# Path to libraries in the topmost test directory. This is needed so @library
|
||||
# does not need ../../ notation to reach them
|
||||
external.lib.roots = ../../
|
||||
|
||||
# Use new form of -Xpatch
|
||||
useNewXpatch=true
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -30,7 +30,7 @@
|
||||
* @build AndnTestI
|
||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||
* sun.hotspot.WhiteBox$WhiteBoxPermission
|
||||
* @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestI
|
||||
*/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -30,7 +30,7 @@
|
||||
* @build AndnTestL
|
||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||
* sun.hotspot.WhiteBox$WhiteBoxPermission
|
||||
* @run main/bootclasspath -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions AndnTestL
|
||||
*/
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* @modules java.base/jdk.internal.org.objectweb.asm
|
||||
* @library patches
|
||||
* @build java.base/java.lang.invoke.MethodHandleHelper
|
||||
* @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload
|
||||
* @run main/bootclasspath/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload
|
||||
* -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC
|
||||
* -verbose:gc compiler.jsr292.CallSiteDepContextTest
|
||||
*/
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8067247
|
||||
* @library /test/lib /compiler/whitebox /
|
||||
* @run main/bootclasspath -Xcomp -Xbatch
|
||||
* @run main/bootclasspath/othervm -Xcomp -Xbatch
|
||||
* -XX:CompileCommand=compileonly,InvokerGC::test
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* InvokerGC
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* @modules java.base/jdk.internal.vm.annotation
|
||||
* @build java.base/java.lang.invoke.MethodHandleHelper
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
* @build java.base/java.lang.invoke.MethodHandleHelper
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.jsr292.NonInlinedCall.InvokeTest
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
|
||||
* compiler.jsr292.NonInlinedCall.InvokeTest
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
* @run main ClassFileInstaller sun.hotspot.WhiteBox
|
||||
* sun.hotspot.WhiteBox$WhiteBoxPermission
|
||||
* compiler.jsr292.NonInlinedCall.RedefineTest
|
||||
* @run main/bootclasspath -javaagent:agent.jar
|
||||
* @run main/bootclasspath/othervm -javaagent:agent.jar
|
||||
* -XX:+IgnoreUnrecognizedVMOptions
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
|
||||
* -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* @bug 8058828
|
||||
* @modules java.base/jdk.internal.org.objectweb.asm
|
||||
* java.base/jdk.internal.misc
|
||||
* @run main/bootclasspath -Xbatch VMAnonymousClasses
|
||||
* @run main/bootclasspath/othervm -Xbatch VMAnonymousClasses
|
||||
*/
|
||||
|
||||
import jdk.internal.org.objectweb.asm.ClassWriter;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableBoolean
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableBoolean
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:-FoldStableValues
|
||||
* compiler.stable.TestStableBoolean
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableBoolean
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:-FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableByte
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableByte
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableByte
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableByte
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableChar
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableChar
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableChar
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableChar
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableDouble
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableDouble
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableDouble
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableDouble
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableFloat
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableFloat
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableFloat
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableFloat
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableInt
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableInt
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableInt
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableInt
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableLong
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableLong
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableLong
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableLong
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,7 +30,7 @@
|
||||
* @library /testlibrary /test/lib
|
||||
* @modules java.base/jdk.internal.vm.annotation
|
||||
*
|
||||
* @run main/bootclasspath -Xcomp -XX:CompileOnly=::testCompile
|
||||
* @run main/bootclasspath/othervm -Xcomp -XX:CompileOnly=::testCompile
|
||||
* compiler.stable.TestStableMemoryBarrier
|
||||
*
|
||||
* @author hui.shi@linaro.org
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableObject
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableObject
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableObject
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableObject
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 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
|
||||
@ -31,23 +31,23 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableShort
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableShort
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableShort
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* compiler.stable.TestStableShort
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:CompileOnly=::get,::get1,::get2,::get3,::get4
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
|
||||
@ -31,26 +31,26 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableUByte
|
||||
*
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUByte
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:-FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUByte
|
||||
*
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUByte
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:-FoldStableValues
|
||||
|
||||
@ -31,26 +31,26 @@
|
||||
* @build sun.hotspot.WhiteBox
|
||||
* @build compiler.stable.TestStableUShort
|
||||
*
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUShort
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:-TieredCompilation
|
||||
* -XX:-FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUShort
|
||||
*
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileOnly=::get,::get1
|
||||
* compiler.stable.TestStableUShort
|
||||
* @run main/bootclasspath -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
|
||||
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xcomp
|
||||
* -XX:+TieredCompilation -XX:TieredStopAtLevel=1
|
||||
* -XX:-FoldStableValues
|
||||
|
||||
@ -33,21 +33,23 @@
|
||||
* @modules java.base/jdk.internal.org.objectweb.asm
|
||||
* java.base/jdk.internal.vm.annotation
|
||||
* java.base/jdk.internal.misc
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions
|
||||
* -Xbatch -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress()
|
||||
* -XX:CompileCommand=dontinline,*.test*
|
||||
* -XX:+UseUnalignedAccesses
|
||||
* -XaddReads:java.base=ALL-UNNAMED
|
||||
* compiler.unsafe.UnsafeGetConstantField
|
||||
*
|
||||
* @run main/bootclasspath -XX:+UnlockDiagnosticVMOptions
|
||||
* @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions
|
||||
* -Xbatch -XX:-TieredCompilation
|
||||
* -XX:+FoldStableValues
|
||||
* -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress()
|
||||
* -XX:CompileCommand=dontinline,*.test*
|
||||
* -XX:CompileCommand=inline,*Unsafe.get*
|
||||
* -XX:-UseUnalignedAccesses
|
||||
* -XaddReads:java.base=ALL-UNNAMED
|
||||
* compiler.unsafe.UnsafeGetConstantField
|
||||
*/
|
||||
package compiler.unsafe;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -48,7 +48,7 @@ public class BootstrapRedefine {
|
||||
"-Xmodule:java.base"),
|
||||
"mods/java.base");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods", "-version");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base", "-version");
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldContain("Incompatible definition of java.lang.Object")
|
||||
.shouldHaveExitValue(1);
|
||||
|
||||
@ -35,7 +35,7 @@ import jdk.test.lib.*;
|
||||
public class MaxMetaspaceSize {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:MaxMetaspaceSize=20m", "-Xshare:dump");
|
||||
"-XX:MaxMetaspaceSize=10m", "-Xshare:dump");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("is not large enough.\nEither don't specify the -XX:MaxMetaspaceSize=<size>\nor increase the size to at least");
|
||||
output.shouldHaveExitValue(2);
|
||||
|
||||
@ -119,9 +119,9 @@ public class GetSysPkgTest {
|
||||
getPkg("java/nio/charset", "jrt:/java.base");
|
||||
|
||||
// Test a package in a module not owned by boot loader.
|
||||
Class clss = Class.forName("javax.activation.DataHandler");
|
||||
Class clss = Class.forName("jdk.nio.zipfs.ZipPath");
|
||||
if (clss == null)
|
||||
throw new RuntimeException("Could not find class javax.activation.DataHandler");
|
||||
throw new RuntimeException("Could not find class jdk.nio.zipfs.ZipPath");
|
||||
getPkg("javax/activation", null); // Not owned by boot loader
|
||||
|
||||
// Test a package not in jimage file.
|
||||
|
||||
@ -209,9 +209,9 @@ public class DiffCL_Umod {
|
||||
// now use the same loader to load class p1.c1Loose
|
||||
Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose");
|
||||
|
||||
// change m1 to be a loose module
|
||||
// change m1 to read all unnamed modules
|
||||
Module m1 = layer.findModule("m1").get();
|
||||
jdk.internal.module.Modules.addReads(m1, null);
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1);
|
||||
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
|
||||
@ -200,9 +200,9 @@ public class Umod {
|
||||
// now use the same loader to load class p1.c1Loose
|
||||
Class p1_c1_class = loader.loadClass("p1.c1Loose");
|
||||
|
||||
// change m1 to be a loose module
|
||||
// change m1 to read all unnamed modules
|
||||
Module m1 = layer.findModule("m1").get();
|
||||
jdk.internal.module.Modules.addReads(m1, null);
|
||||
jdk.internal.module.Modules.addReadsAllUnnamed(m1);
|
||||
|
||||
try {
|
||||
p1_c1_class.newInstance();
|
||||
|
||||
@ -48,26 +48,27 @@ public class JVMAddReadsModule {
|
||||
assertNotNull(to_module, "Module should not be null");
|
||||
ModuleHelper.DefineModule(to_module, "9.0", "to_module/here", new String[] { "yourpackage" });
|
||||
|
||||
// Null from_module argument, expect an NPE
|
||||
// Null from_module argument, expect NPE
|
||||
try {
|
||||
ModuleHelper.AddReadsModule(null, to_module);
|
||||
throw new RuntimeException("Failed to get the expected NPE");
|
||||
} catch(NullPointerException e) {
|
||||
} catch (NullPointerException e) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
// Null to_module argument, do not expect an NPE
|
||||
// Null to_module argument, expect NPE
|
||||
try {
|
||||
ModuleHelper.AddReadsModule(from_module, null);
|
||||
} catch(NullPointerException e) {
|
||||
throw new RuntimeException("Unexpected NPE was thrown");
|
||||
} catch (NullPointerException e) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
// Null from_module and to_module arguments, expect an NPE
|
||||
// Null from_module and to_module arguments, expect NPE
|
||||
try {
|
||||
ModuleHelper.AddReadsModule(null, null);
|
||||
throw new RuntimeException("Failed to get the expected NPE");
|
||||
} catch(NullPointerException e) {
|
||||
} catch (NullPointerException e) {
|
||||
// Expected
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -83,7 +83,7 @@ public class XpatchVisibility {
|
||||
"p2" + File.separator + "Vis2_B.class"));
|
||||
|
||||
new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(
|
||||
"-Xpatch:mods2",
|
||||
"-Xpatch:java.base=mods2/java.base",
|
||||
"-XaddExports:java.base/p2=ALL-UNNAMED",
|
||||
"Vis2_A")
|
||||
.start()).shouldHaveExitValue(0);
|
||||
|
||||
96
hotspot/test/runtime/modules/Xpatch/BasicJarBuilder.java
Normal file
96
hotspot/test/runtime/modules/Xpatch/BasicJarBuilder.java
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @summary Simple jar builder
|
||||
* Input: jarName className1 className2 ...
|
||||
* do not specify extensions, just the names
|
||||
* E.g. prot_domain ProtDomainA ProtDomainB
|
||||
* Output: A jar containing compiled classes, placed in a test classes folder
|
||||
*/
|
||||
|
||||
import jdk.test.lib.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import sun.tools.jar.Main;
|
||||
|
||||
// Using JarBuilder requires that all to-be-jarred classes should be placed
|
||||
// in the current working directory, aka "."
|
||||
public class BasicJarBuilder {
|
||||
private static final String classDir = System.getProperty("test.classes");
|
||||
|
||||
public static void build(boolean classesInWorkDir, String jarName,
|
||||
String ...classNames) throws Exception {
|
||||
|
||||
if (classesInWorkDir) {
|
||||
createSimpleJar(".", classDir + File.separator + jarName + ".jar", classNames);
|
||||
} else {
|
||||
build(jarName, classNames);
|
||||
}
|
||||
}
|
||||
|
||||
public static void build(String jarName, String ...classNames) throws Exception {
|
||||
createSimpleJar(classDir, classDir + File.separator + jarName + ".jar",
|
||||
classNames);
|
||||
}
|
||||
|
||||
private static void createSimpleJar(String jarclassDir, String jarName,
|
||||
String[] classNames) throws Exception {
|
||||
ArrayList<String> args = new ArrayList<String>();
|
||||
args.add("cf");
|
||||
args.add(jarName);
|
||||
addClassArgs(args, jarclassDir, classNames);
|
||||
createJar(args);
|
||||
}
|
||||
|
||||
private static void addClassArgs(ArrayList<String> args, String jarclassDir,
|
||||
String[] classNames) {
|
||||
|
||||
for (String name : classNames) {
|
||||
args.add("-C");
|
||||
args.add(jarclassDir);
|
||||
args.add(name + ".class");
|
||||
}
|
||||
}
|
||||
|
||||
private static void createJar(ArrayList<String> args) {
|
||||
Main jarTool = new Main(System.out, System.err, "jar");
|
||||
if (!jarTool.run(args.toArray(new String[1]))) {
|
||||
throw new RuntimeException("jar operation failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Get full path to the test jar
|
||||
public static String getTestJar(String jar) {
|
||||
File dir = new File(System.getProperty("test.classes", "."));
|
||||
File jarFile = new File(dir, jar);
|
||||
if (!jarFile.exists()) {
|
||||
throw new RuntimeException("Cannot find " + jarFile.getPath());
|
||||
}
|
||||
if (!jarFile.isFile()) {
|
||||
throw new RuntimeException("Not a regular file: " + jarFile.getPath());
|
||||
}
|
||||
return jarFile.getPath();
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -57,7 +57,8 @@ public class Xpatch2Dirs {
|
||||
"mods2/java.desktop");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-Xpatch:mods" + File.pathSeparator + "mods2",
|
||||
"-Xpatch:java.naming=mods/java.naming",
|
||||
"-Xpatch:java.desktop=mods2/java.desktop",
|
||||
"Xpatch2DirsMain", "javax.naming.spi.NamingManager", "java.beans.Encoder");
|
||||
|
||||
OutputAnalyzer oa = new OutputAnalyzer(pb.start());
|
||||
|
||||
45
hotspot/test/runtime/modules/Xpatch/XpatchDupJavaBase.java
Normal file
45
hotspot/test/runtime/modules/Xpatch/XpatchDupJavaBase.java
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary VM exit initialization results if java.base is specificed more than once to Xpatch.
|
||||
* @library /testlibrary
|
||||
*/
|
||||
|
||||
import jdk.test.lib.*;
|
||||
|
||||
public class XpatchDupJavaBase {
|
||||
// The VM should exit initialization if java.base is specified
|
||||
// more than once to -Xpatch.
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-Xpatch:java.base=javabase_dir",
|
||||
"-Xpatch:java.base=javabase_dir",
|
||||
"-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Cannot specify java.base more than once to -Xpatch");
|
||||
output.shouldHaveExitValue(1);
|
||||
}
|
||||
}
|
||||
|
||||
47
hotspot/test/runtime/modules/Xpatch/XpatchDupModule.java
Normal file
47
hotspot/test/runtime/modules/Xpatch/XpatchDupModule.java
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Module system initialization exception results if a module is specificed twice to Xpatch.
|
||||
* @library /testlibrary
|
||||
*/
|
||||
|
||||
import jdk.test.lib.*;
|
||||
|
||||
public class XpatchDupModule {
|
||||
|
||||
// The module system initialization should generate an ExceptionInInitializerError
|
||||
// if -Xpatch is specified with the same module more than once.
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-Xpatch:module1=module1_dir",
|
||||
"-Xpatch:module1=module1_dir",
|
||||
"-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("java.lang.ExceptionInInitializerError");
|
||||
output.shouldHaveExitValue(1);
|
||||
}
|
||||
}
|
||||
|
||||
56
hotspot/test/runtime/modules/Xpatch/XpatchJavaBase.java
Normal file
56
hotspot/test/runtime/modules/Xpatch/XpatchJavaBase.java
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8130399
|
||||
* @summary Make sure -Xpatch works for java.base.
|
||||
* @library /testlibrary
|
||||
* @compile XpatchMain.java
|
||||
* @run main XpatchJavaBase
|
||||
*/
|
||||
|
||||
import jdk.test.lib.*;
|
||||
|
||||
public class XpatchJavaBase {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String source = "package java.lang; " +
|
||||
"public class NewClass { " +
|
||||
" static { " +
|
||||
" System.out.println(\"I pass!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("java/lang/NewClass",
|
||||
InMemoryJavaCompiler.compile("java.lang.NewClass", source, "-Xmodule:java.base"),
|
||||
"mods/java.base");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base",
|
||||
"XpatchMain", "java.lang.NewClass");
|
||||
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldContain("I pass!")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -46,7 +46,7 @@ public class XpatchTest {
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
|
||||
"mods/java.naming");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods",
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming",
|
||||
"XpatchMain", "javax.naming.spi.NamingManager");
|
||||
|
||||
new OutputAnalyzer(pb.start())
|
||||
|
||||
83
hotspot/test/runtime/modules/Xpatch/XpatchTestJar.java
Normal file
83
hotspot/test/runtime/modules/Xpatch/XpatchTestJar.java
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Make sure -Xpatch works when a jar file is specified for a module
|
||||
* @library /testlibrary
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.jartool/sun.tools.jar
|
||||
* @build BasicJarBuilder
|
||||
* @compile XpatchMain.java
|
||||
* @run main XpatchTestJar
|
||||
*/
|
||||
|
||||
import jdk.test.lib.*;
|
||||
|
||||
public class XpatchTestJar {
|
||||
private static String moduleJar;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// Create a class file in the module java.naming. This class file
|
||||
// will be put in the javanaming.jar file.
|
||||
String source = "package javax.naming.spi; " +
|
||||
"public class NamingManager { " +
|
||||
" static { " +
|
||||
" System.out.println(\"I pass!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
|
||||
System.getProperty("test.classes"));
|
||||
|
||||
// Build the jar file that will be used for the module "java.naming".
|
||||
BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager");
|
||||
moduleJar = BasicJarBuilder.getTestJar("javanaming.jar");
|
||||
|
||||
// Just to make sure we are not fooled by the class file being on the
|
||||
// class path where all the test classes are stored, write the NamingManager.class
|
||||
// file out again with output that does not contain what OutputAnalyzer
|
||||
// expects. This will provide confidence that the contents of the class
|
||||
// is truly coming from the jar file and not the class file.
|
||||
source = "package javax.naming.spi; " +
|
||||
"public class NamingManager { " +
|
||||
" static { " +
|
||||
" System.out.println(\"Fail!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
|
||||
System.getProperty("test.classes"));
|
||||
|
||||
// Supply -Xpatch with the name of the jar file for the module java.naming.
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=" + moduleJar,
|
||||
"XpatchMain", "javax.naming.spi.NamingManager");
|
||||
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldContain("I pass!")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
105
hotspot/test/runtime/modules/Xpatch/XpatchTestJarDir.java
Normal file
105
hotspot/test/runtime/modules/Xpatch/XpatchTestJarDir.java
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Make sure -Xpatch works when a jar file and a directory is specified for a module
|
||||
* @library /testlibrary
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* jdk.jartool/sun.tools.jar
|
||||
* @build BasicJarBuilder
|
||||
* @compile Xpatch2DirsMain.java
|
||||
* @run main XpatchTestJarDir
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import jdk.test.lib.*;
|
||||
|
||||
public class XpatchTestJarDir {
|
||||
private static String moduleJar;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// Create a class file in the module java.naming. This class file
|
||||
// will be put in the javanaming.jar file.
|
||||
String source = "package javax.naming.spi; " +
|
||||
"public class NamingManager1 { " +
|
||||
" static { " +
|
||||
" System.out.println(\"I pass one!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"),
|
||||
System.getProperty("test.classes"));
|
||||
|
||||
// Build the jar file that will be used for the module "java.naming".
|
||||
BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager1");
|
||||
moduleJar = BasicJarBuilder.getTestJar("javanaming.jar");
|
||||
|
||||
// Just to make sure we are not fooled by the class file being on the
|
||||
// class path where all the test classes are stored, write the NamingManager.class
|
||||
// file out again with output that does not contain what OutputAnalyzer
|
||||
// expects. This will provide confidence that the contents of the class
|
||||
// is truly coming from the jar file and not the class file.
|
||||
source = "package javax.naming.spi; " +
|
||||
"public class NamingManager1 { " +
|
||||
" static { " +
|
||||
" System.out.println(\"Fail!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager1",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager1", source, "-Xmodule:java.naming"),
|
||||
System.getProperty("test.classes"));
|
||||
|
||||
// Create a second class file in the module java.naming. This class file
|
||||
// will be put in the mods/java.naming directory.
|
||||
source = "package javax.naming.spi; " +
|
||||
"public class NamingManager2 { " +
|
||||
" static { " +
|
||||
" System.out.println(\"I pass two!\"); " +
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager2",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager2", source, "-Xmodule:java.naming"),
|
||||
(System.getProperty("test.classes") + "/mods/java.naming"));
|
||||
|
||||
|
||||
// Supply -Xpatch with the name of the jar file for the module java.naming.
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=" +
|
||||
moduleJar +
|
||||
File.pathSeparator +
|
||||
System.getProperty("test.classes") + "/mods/java.naming",
|
||||
"Xpatch2DirsMain",
|
||||
"javax.naming.spi.NamingManager1",
|
||||
"javax.naming.spi.NamingManager2");
|
||||
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldContain("I pass one!")
|
||||
.shouldContain("I pass two!")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8069469
|
||||
* @summary Make sure -XX:+TraceClassLoading works properly with "modules" jimage,
|
||||
* @summary Make sure -Xlog:classload=info works properly with "modules" jimage,
|
||||
-Xpatch, and with -Xbootclasspath/a
|
||||
* @library /testlibrary
|
||||
* @compile XpatchMain.java
|
||||
@ -44,24 +44,23 @@ public class XpatchTraceCL {
|
||||
" } " +
|
||||
"}";
|
||||
|
||||
// Test -XX:+TraceClassLoading output for -Xpatch
|
||||
// Test -Xlog:classload=info output for -Xpatch
|
||||
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
|
||||
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
|
||||
"mods/java.naming");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:mods",
|
||||
"-XX:+TraceClassLoading", "XpatchMain", "javax.naming.spi.NamingManager");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming",
|
||||
"-Xlog:classload=info", "XpatchMain", "javax.naming.spi.NamingManager");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
// "modules" jimage case.
|
||||
output.shouldContain("[classload] java.lang.Thread source: jrt:/java.base");
|
||||
// -Xpatch case.
|
||||
output.shouldContain("[classload] javax.naming.spi.NamingManager source: mods" +
|
||||
File.separator + "java.naming");
|
||||
output.shouldContain("[classload] javax.naming.spi.NamingManager source: mods/java.naming");
|
||||
// -cp case.
|
||||
output.shouldContain("[classload] XpatchMain source: file");
|
||||
|
||||
// Test -XX:+TraceClassLoading output for -Xbootclasspath/a
|
||||
// Test -Xlog:classload=info output for -Xbootclasspath/a
|
||||
source = "package XpatchTraceCL_pkg; " +
|
||||
"public class ItIsI { " +
|
||||
" static { " +
|
||||
@ -74,7 +73,7 @@ public class XpatchTraceCL {
|
||||
"xbcp");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:xbcp",
|
||||
"-XX:+TraceClassLoading", "XpatchMain", "XpatchTraceCL_pkg.ItIsI");
|
||||
"-Xlog:classload=info", "XpatchMain", "XpatchTraceCL_pkg.ItIsI");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
// -Xbootclasspath/a case.
|
||||
output.shouldContain("[classload] XpatchTraceCL_pkg.ItIsI source: xbcp");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,7 +35,7 @@ public class XpatchCDS {
|
||||
|
||||
public static void main(String args[]) throws Throwable {
|
||||
System.out.println("Test that -Xpatch and -Xshare:dump are incompatibable");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:.", "-Xshare:dump");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=mods/java.naming", "-Xshare:dump");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Cannot use the following option when dumping the shared archive: -Xpatch");
|
||||
|
||||
@ -52,7 +52,7 @@ public class XpatchCDS {
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=" + filename,
|
||||
"-Xshare:on",
|
||||
"-Xpatch:.",
|
||||
"-Xpatch:java.naming=mods/java.naming",
|
||||
"-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("The shared archive file cannot be used with -Xpatch");
|
||||
|
||||
@ -359,3 +359,4 @@ bdbf2342b21bd8ecad1b4e6499a0dfb314952bd7 jdk-9+103
|
||||
147114dd0641cd7c9fe6e81642eb993a7b9c6f0b jdk-9+114
|
||||
1902a5bda18e794b31fc5f520f5e7d827714b50d jdk-9+115
|
||||
9d71d20e614777cd23c1a43b38b5c08a9094d27a jdk-9+116
|
||||
46b57560cd06ebcdd21489250628ff5f9d9d8916 jdk-9+117
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
*/
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -32,19 +32,26 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
|
||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
|
||||
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.io.NotSerializableException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.ObjectStreamField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.lang.module.Configuration;
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
import java.lang.module.ModuleFinder;
|
||||
import java.lang.module.ModuleReference;
|
||||
import java.lang.reflect.Layer;
|
||||
import java.lang.reflect.Module;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.lang.reflect.Module;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.Transformer;
|
||||
@ -389,6 +396,48 @@ public final class TemplatesImpl implements Templates, Serializable {
|
||||
return _name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a module layer with one module that is defined to the given class
|
||||
* loader.
|
||||
*/
|
||||
private Module createModule(ModuleDescriptor descriptor, ClassLoader loader) {
|
||||
String mn = descriptor.name();
|
||||
|
||||
ModuleReference mref = new ModuleReference(descriptor, null, () -> {
|
||||
IOException ioe = new IOException("<dynamic module>");
|
||||
throw new UncheckedIOException(ioe);
|
||||
});
|
||||
|
||||
ModuleFinder finder = new ModuleFinder() {
|
||||
@Override
|
||||
public Optional<ModuleReference> find(String name) {
|
||||
if (name.equals(mn)) {
|
||||
return Optional.of(mref);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Set<ModuleReference> findAll() {
|
||||
return Set.of(mref);
|
||||
}
|
||||
};
|
||||
|
||||
Layer bootLayer = Layer.boot();
|
||||
|
||||
Configuration cf = bootLayer.configuration()
|
||||
.resolveRequires(finder, ModuleFinder.empty(), Set.of(mn));
|
||||
|
||||
PrivilegedAction<Layer> pa = () -> bootLayer.defineModules(cf, name -> loader);
|
||||
Layer layer = AccessController.doPrivileged(pa);
|
||||
|
||||
Module m = layer.findModule(mn).get();
|
||||
assert m.getLayer() == layer;
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the translet class and auxiliary classes.
|
||||
* Returns a reference to the Class object that defines the main class
|
||||
@ -417,29 +466,32 @@ public final class TemplatesImpl implements Templates, Serializable {
|
||||
}
|
||||
|
||||
// create a module for the translet
|
||||
Module xmlModule = TemplatesImpl.class.getModule();
|
||||
|
||||
String mn = "jdk.translet";
|
||||
|
||||
String pn = _tfactory.getPackageName();
|
||||
assert pn != null && pn.length() > 0;
|
||||
|
||||
Module m = Modules.defineModule(loader, "jdk.translet",
|
||||
Collections.singleton(pn));
|
||||
ModuleDescriptor descriptor
|
||||
= new ModuleDescriptor.Builder(mn)
|
||||
.requires("java.xml")
|
||||
.exports(pn)
|
||||
.build();
|
||||
|
||||
// jdk.translate reads java.base && java.xml
|
||||
Modules.addReads(m, Object.class.getModule());
|
||||
Modules.addReads(m, xmlModule);
|
||||
Module m = createModule(descriptor, loader);
|
||||
|
||||
// jdk.translet needs access to runtime classes
|
||||
// the module needs access to runtime classes
|
||||
Module thisModule = TemplatesImpl.class.getModule();
|
||||
Arrays.asList(Constants.PKGS_USED_BY_TRANSLET_CLASSES).forEach(p -> {
|
||||
xmlModule.addExports(p, m);
|
||||
thisModule.addExports(p, m);
|
||||
});
|
||||
|
||||
// jdk.translate also needs to be loose as the XSL may bind to
|
||||
// java types in an unnamed module
|
||||
Modules.addReads(m, null);
|
||||
// For now, the module reads all unnnamed modules. This will be changed once
|
||||
// the XSLT compiler is updated to generate code to invoke addReads.
|
||||
Modules.addReadsAllUnnamed(m);
|
||||
|
||||
// java.xml needs to instanitate the translate class
|
||||
xmlModule.addReads(m);
|
||||
Modules.addExports(m, pn, xmlModule);
|
||||
// java.xml needs to instanitate the translet class
|
||||
thisModule.addReads(m);
|
||||
|
||||
for (int i = 0; i < classCount; i++) {
|
||||
_class[i] = loader.defineClass(_bytecodes[i]);
|
||||
|
||||
@ -26,3 +26,6 @@
|
||||
# 8147431
|
||||
javax/xml/jaxp/isolatedjdk/catalog/PropertiesTest.sh generic-all
|
||||
|
||||
# 8150145
|
||||
javax/xml/jaxp/unittest/common/TransformationWarningsTest.java generic-all
|
||||
|
||||
|
||||
@ -18,4 +18,4 @@ othervm.dirs=javax/xml/jaxp
|
||||
groups=TEST.groups
|
||||
|
||||
# Minimum jtreg version
|
||||
requiredVersion=4.2 b01
|
||||
requiredVersion=4.2 b02
|
||||
|
||||
@ -36,6 +36,7 @@ import java.util.Enumeration;
|
||||
import java.util.PropertyPermission;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
|
||||
/*
|
||||
* Simple Policy class that supports the required Permissions to validate the
|
||||
* JAXP concrete classes.
|
||||
@ -45,6 +46,8 @@ import java.util.StringJoiner;
|
||||
public class TestPolicy extends Policy {
|
||||
protected final PermissionCollection permissions = new Permissions();
|
||||
|
||||
private static Policy defaultPolicy = Policy.getPolicy();
|
||||
|
||||
/**
|
||||
* Constructor which sets the minimum permissions by default allowing testNG
|
||||
* to work with a SecurityManager.
|
||||
@ -87,11 +90,8 @@ public class TestPolicy extends Policy {
|
||||
"read"));
|
||||
permissions.add(new PropertyPermission("user.dir", "read"));
|
||||
permissions.add(new PropertyPermission("test.src", "read"));
|
||||
permissions.add(new PropertyPermission("file.separator", "read"));
|
||||
permissions.add(new PropertyPermission("line.separator", "read"));
|
||||
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
|
||||
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
|
||||
permissions.add(new RuntimePermission("charsetProvider"));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -145,6 +145,9 @@ public class TestPolicy extends Policy {
|
||||
|
||||
@Override
|
||||
public boolean implies(ProtectionDomain domain, Permission perm) {
|
||||
if (defaultPolicy.implies(domain, perm))
|
||||
return true;
|
||||
|
||||
return permissions.implies(perm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -362,3 +362,4 @@ e980062475c10d21137051045bf95ee229db9b27 jdk-9+113
|
||||
b314bb02182b9ca94708a91f312c377f5435f740 jdk-9+114
|
||||
4ff86e5489e4c0513dadfa69def8601c110ca5cd jdk-9+115
|
||||
529f0bf896e58525614d863e283ad155531941cb jdk-9+116
|
||||
58265b39fc74b932bda4d4f4649c530a89f55c4e jdk-9+117
|
||||
|
||||
@ -140,6 +140,9 @@ public class SchemaGenerator {
|
||||
aptargs.add("-cp");
|
||||
aptargs.add(setClasspath(options.classpath)); // set original classpath + jaxb-api to be visible to annotation processor
|
||||
|
||||
aptargs.add("-addmods");
|
||||
aptargs.add("java.xml.bind");
|
||||
|
||||
if(options.targetDir!=null) {
|
||||
aptargs.add("-d");
|
||||
aptargs.add(options.targetDir.getPath());
|
||||
|
||||
@ -162,6 +162,8 @@ public class WsgenTool {
|
||||
boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class);
|
||||
List<String> args = new ArrayList<String>(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0)
|
||||
+ (options.encoding != null ? 2 : 0));
|
||||
args.add("-addmods");
|
||||
args.add("java.xml.ws");
|
||||
args.add("-d");
|
||||
args.add(options.destDir.getAbsolutePath());
|
||||
args.add("-classpath");
|
||||
|
||||
@ -525,6 +525,8 @@ public class WsimportTool {
|
||||
String classpathString = createClasspathString();
|
||||
boolean bootCP = useBootClasspath(EndpointContext.class) || useBootClasspath(JAXBPermission.class);
|
||||
List<String> args = new ArrayList<String>();
|
||||
args.add("-addmods");
|
||||
args.add("java.xml.ws");
|
||||
args.add("-d");
|
||||
args.add(classDir);
|
||||
args.add("-classpath");
|
||||
|
||||
@ -37,10 +37,6 @@ BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
|
||||
|
||||
################################################################################
|
||||
|
||||
# Add a checksum ("jsum") to the end of a text file. Prevents trivial tampering with class lists.
|
||||
TOOL_ADDJSUM = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.addjsum.AddJsum
|
||||
|
||||
ifeq ($(BOOT_JDK_MODULAR), true)
|
||||
COMPILEFONTCONFIG_ADD_EXPORTS := -XaddExports:java.desktop/sun.awt=ALL-UNNAMED
|
||||
endif
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This tool is used to help create the class list for class data sharing.
|
||||
*
|
||||
* The classlist is produced internally by first running a select number of
|
||||
* startup benchmarks with the -XX:DumpLoadedClassList=<file> option, then
|
||||
* running this tool in the following fashion to produce a complete classlist:
|
||||
*
|
||||
* jjs -scripting makeClasslist.js -- list1 list2 list3 > classlist.platform
|
||||
*
|
||||
* The lists should be listed in roughly smallest to largest order based on
|
||||
* application size.
|
||||
*
|
||||
* After generating the classlist it's necessary to add a checksum (using
|
||||
* AddJsum.java) before checking it into the workspace as the corresponding
|
||||
* platform-specific classlist, such as make/data/classlist/classlist.linux
|
||||
*/
|
||||
"use strict";
|
||||
var classlist = [];
|
||||
var seenClasses = {};
|
||||
|
||||
for (var a in $ARG) {
|
||||
var arg = $ARG[a];
|
||||
|
||||
var classes = readFully(arg).replace(/[\r\n]+/g, "\n").split("\n");
|
||||
|
||||
for (var c in classes) {
|
||||
var clazz = classes[c];
|
||||
if (clazz !== "" && seenClasses[clazz] === undefined) {
|
||||
seenClasses[clazz] = clazz;
|
||||
classlist.push(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (c in classlist) {
|
||||
print(classlist[c]);
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package build.tools.addjsum;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.regex.*;
|
||||
|
||||
/** Adds a checksum ("jsum") to the end of a text file. The algorithm
|
||||
used is known to the JVM and prevents trivial tampering with the
|
||||
class list used for class data sharing.
|
||||
*/
|
||||
|
||||
public class AddJsum {
|
||||
private static final long JSUM_SEED = 0xCAFEBABEBABECAFEL;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length != 2) {
|
||||
System.err.println("Usage: java AddJsum [input file name] [output file name]");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
File inFile = new File(args[0]);
|
||||
File outFile = new File(args[1]);
|
||||
BufferedReader reader = new BufferedReader(new FileReader(inFile));
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(outFile));
|
||||
Pattern p = Pattern.compile("# [0-9A-Fa-f]*");
|
||||
long computedJsum = JSUM_SEED;
|
||||
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (line.length() > 0 && line.charAt(0) == '#') {
|
||||
Matcher m = p.matcher(line);
|
||||
if (!m.matches()) {
|
||||
writer.write(line);
|
||||
writer.newLine();
|
||||
}
|
||||
} else {
|
||||
computedJsum = jsum(computedJsum, line);
|
||||
writer.write(line);
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
String hex = Long.toHexString(computedJsum);
|
||||
int diff = 16 - hex.length();
|
||||
for (int i = 0; i < diff; i++) {
|
||||
hex = "0" + hex;
|
||||
}
|
||||
writer.write("# " + hex);
|
||||
writer.newLine();
|
||||
reader.close();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
System.err.println("Error reading or writing file");
|
||||
throw(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static long jsum(long start, String str) {
|
||||
long h = start;
|
||||
int len = str.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = str.charAt(i);
|
||||
if (c <= ' ') {
|
||||
/* Skip spaces and control characters */
|
||||
continue;
|
||||
}
|
||||
h = 31 * h + c;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
}
|
||||
@ -1221,13 +1221,13 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hash code for a {@code int} value; compatible with
|
||||
* Returns a hash code for an {@code int} value; compatible with
|
||||
* {@code Integer.hashCode()}.
|
||||
*
|
||||
* @param value the value to hash
|
||||
* @since 1.8
|
||||
*
|
||||
* @return a hash code value for a {@code int} value.
|
||||
* @return a hash code value for an {@code int} value.
|
||||
*/
|
||||
public static int hashCode(int value) {
|
||||
return value;
|
||||
@ -1596,7 +1596,7 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
@Native public static final int SIZE = 32;
|
||||
|
||||
/**
|
||||
* The number of bytes used to represent a {@code int} value in two's
|
||||
* The number of bytes used to represent an {@code int} value in two's
|
||||
* complement binary form.
|
||||
*
|
||||
* @since 1.8
|
||||
@ -1790,9 +1790,8 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
i = (i & 0x55555555) << 1 | (i >>> 1) & 0x55555555;
|
||||
i = (i & 0x33333333) << 2 | (i >>> 2) & 0x33333333;
|
||||
i = (i & 0x0f0f0f0f) << 4 | (i >>> 4) & 0x0f0f0f0f;
|
||||
i = (i << 24) | ((i & 0xff00) << 8) |
|
||||
((i >>> 8) & 0xff00) | (i >>> 24);
|
||||
return i;
|
||||
|
||||
return reverseBytes(i);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1820,10 +1819,10 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
*/
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static int reverseBytes(int i) {
|
||||
return ((i >>> 24) ) |
|
||||
((i >> 8) & 0xFF00) |
|
||||
((i << 8) & 0xFF0000) |
|
||||
((i << 24));
|
||||
return (i << 24) |
|
||||
((i & 0xff00) << 8) |
|
||||
((i >>> 8) & 0xff00) |
|
||||
(i >>> 24);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1952,10 +1952,8 @@ public final class Long extends Number implements Comparable<Long> {
|
||||
i = (i & 0x5555555555555555L) << 1 | (i >>> 1) & 0x5555555555555555L;
|
||||
i = (i & 0x3333333333333333L) << 2 | (i >>> 2) & 0x3333333333333333L;
|
||||
i = (i & 0x0f0f0f0f0f0f0f0fL) << 4 | (i >>> 4) & 0x0f0f0f0f0f0f0f0fL;
|
||||
i = (i & 0x00ff00ff00ff00ffL) << 8 | (i >>> 8) & 0x00ff00ff00ff00ffL;
|
||||
i = (i << 48) | ((i & 0xffff0000L) << 16) |
|
||||
((i >>> 16) & 0xffff0000L) | (i >>> 48);
|
||||
return i;
|
||||
|
||||
return reverseBytes(i);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1627,8 +1627,7 @@ class SecurityManager {
|
||||
* @deprecated This method relies on the caller being at a stack depth
|
||||
* of 4 which is error-prone and cannot be enforced by the runtime.
|
||||
* Users of this method should instead invoke {@link #checkPermission}
|
||||
* directly. This method will be changed in a future release
|
||||
* to check the permission {@code java.security.AllPermission}.
|
||||
* directly.
|
||||
* This method is subject to removal in a future version of Java SE.
|
||||
*
|
||||
* @see java.lang.reflect.Member
|
||||
|
||||
@ -29,21 +29,20 @@ import jdk.internal.misc.SharedSecrets;
|
||||
|
||||
import static java.lang.StackWalker.Option.*;
|
||||
import java.lang.StackWalker.StackFrame;
|
||||
import java.lang.reflect.Module;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
class StackFrameInfo implements StackFrame {
|
||||
private final static JavaLangInvokeAccess jlInvokeAccess =
|
||||
private final static JavaLangInvokeAccess JLIA =
|
||||
SharedSecrets.getJavaLangInvokeAccess();
|
||||
|
||||
// Footprint improvement: MemberName::clazz can replace
|
||||
// StackFrameInfo::declaringClass.
|
||||
|
||||
final StackWalker walker;
|
||||
final Class<?> declaringClass;
|
||||
final Object memberName;
|
||||
final short bci;
|
||||
private final StackWalker walker;
|
||||
private final Class<?> declaringClass;
|
||||
private final Object memberName;
|
||||
private final short bci;
|
||||
private volatile StackTraceElement ste;
|
||||
|
||||
/*
|
||||
@ -54,9 +53,17 @@ class StackFrameInfo implements StackFrame {
|
||||
this.walker = walker;
|
||||
this.declaringClass = null;
|
||||
this.bci = -1;
|
||||
this.memberName = jlInvokeAccess.newMemberName();
|
||||
this.memberName = JLIA.newMemberName();
|
||||
}
|
||||
|
||||
// package-private called by StackStreamFactory to skip
|
||||
// the capability check
|
||||
Class<?> declaringClass() {
|
||||
return declaringClass;
|
||||
}
|
||||
|
||||
// ----- implementation of StackFrame methods
|
||||
|
||||
@Override
|
||||
public String getClassName() {
|
||||
return declaringClass.getName();
|
||||
@ -70,31 +77,39 @@ class StackFrameInfo implements StackFrame {
|
||||
|
||||
@Override
|
||||
public String getMethodName() {
|
||||
return jlInvokeAccess.getName(memberName);
|
||||
return JLIA.getName(memberName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Optional<String> getFileName() {
|
||||
StackTraceElement ste = toStackTraceElement();
|
||||
return ste.getFileName() != null ? Optional.of(ste.getFileName()) : Optional.empty();
|
||||
public int getByteCodeIndex() {
|
||||
return bci;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final OptionalInt getLineNumber() {
|
||||
StackTraceElement ste = toStackTraceElement();
|
||||
return ste.getLineNumber() > 0 ? OptionalInt.of(ste.getLineNumber()) : OptionalInt.empty();
|
||||
public String getFileName() {
|
||||
if (isNativeMethod())
|
||||
return null;
|
||||
|
||||
return toStackTraceElement().getFileName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isNativeMethod() {
|
||||
StackTraceElement ste = toStackTraceElement();
|
||||
return ste.isNativeMethod();
|
||||
public int getLineNumber() {
|
||||
if (isNativeMethod())
|
||||
return -2;
|
||||
|
||||
return toStackTraceElement().getLineNumber();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isNativeMethod() {
|
||||
return JLIA.isNative(memberName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StackTraceElement ste = toStackTraceElement();
|
||||
return ste.toString();
|
||||
return toStackTraceElement().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -492,7 +492,7 @@ final class StackStreamFactory {
|
||||
|
||||
@Override
|
||||
final Class<?> at(int index) {
|
||||
return stackFrames[index].declaringClass;
|
||||
return stackFrames[index].declaringClass();
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,7 +761,7 @@ final class StackStreamFactory {
|
||||
|
||||
@Override
|
||||
final Class<?> at(int index) {
|
||||
return stackFrames[index].declaringClass;
|
||||
return stackFrames[index].declaringClass();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -126,6 +126,20 @@ public final class StackWalker {
|
||||
*/
|
||||
public Class<?> getDeclaringClass();
|
||||
|
||||
/**
|
||||
* Returns the index to the code array of the {@code Code} attribute
|
||||
* containing the execution point represented by this stack frame.
|
||||
* The code array gives the actual bytes of Java Virtual Machine code
|
||||
* that implement the method.
|
||||
*
|
||||
* @return the index to the code array of the {@code Code} attribute
|
||||
* containing the execution point represented by this stack frame,
|
||||
* or a negative number if the method is native.
|
||||
*
|
||||
* @jvms 4.7.3 The {@code Code} Attribute
|
||||
*/
|
||||
public int getByteCodeIndex();
|
||||
|
||||
/**
|
||||
* Returns the name of the source file containing the execution point
|
||||
* represented by this stack frame. Generally, this corresponds
|
||||
@ -135,12 +149,12 @@ public final class StackWalker {
|
||||
* other than a file, such as an entry in a source repository.
|
||||
*
|
||||
* @return the name of the file containing the execution point
|
||||
* represented by this stack frame, or empty {@code Optional}
|
||||
* is unavailable.
|
||||
* represented by this stack frame, or {@code null} if
|
||||
* this information is unavailable.
|
||||
*
|
||||
* @jvms 4.7.10 The {@code SourceFile} Attribute
|
||||
*/
|
||||
public Optional<String> getFileName();
|
||||
public String getFileName();
|
||||
|
||||
/**
|
||||
* Returns the line number of the source line containing the execution
|
||||
@ -150,12 +164,12 @@ public final class StackWalker {
|
||||
* Specification</cite>.
|
||||
*
|
||||
* @return the line number of the source line containing the execution
|
||||
* point represented by this stack frame, or empty
|
||||
* {@code Optional} if this information is unavailable.
|
||||
* point represented by this stack frame, or a negative number if
|
||||
* this information is unavailable.
|
||||
*
|
||||
* @jvms 4.7.12 The {@code LineNumberTable} Attribute
|
||||
*/
|
||||
public OptionalInt getLineNumber();
|
||||
public int getLineNumber();
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the method containing the execution point
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
package java.lang.invoke;
|
||||
|
||||
import jdk.internal.misc.JavaLangInvokeAccess;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import sun.invoke.util.BytecodeDescriptor;
|
||||
import sun.invoke.util.VerifyAccess;
|
||||
|
||||
@ -1143,15 +1145,25 @@ import java.util.Objects;
|
||||
}
|
||||
|
||||
static {
|
||||
// Allow privileged classes outside of java.lang
|
||||
jdk.internal.misc.SharedSecrets.setJavaLangInvokeAccess(new jdk.internal.misc.JavaLangInvokeAccess() {
|
||||
// StackFrameInfo stores Member and this provides the shared secrets
|
||||
// for stack walker to access MemberName information.
|
||||
SharedSecrets.setJavaLangInvokeAccess(new JavaLangInvokeAccess() {
|
||||
@Override
|
||||
public Object newMemberName() {
|
||||
return new MemberName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(Object mname) {
|
||||
MemberName memberName = (MemberName)mname;
|
||||
return memberName.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNative(Object mname) {
|
||||
MemberName memberName = (MemberName)mname;
|
||||
return memberName.isNative();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,7 +318,7 @@ public class ModuleDescriptor
|
||||
/**
|
||||
* Tests this module export for equality with the given object.
|
||||
*
|
||||
* <p> If the given object is not a {@code Exports} then this method
|
||||
* <p> If the given object is not an {@code Exports} then this method
|
||||
* returns {@code false}. Two module exports objects are equal if the
|
||||
* package names are equal and the set of target module names is equal.
|
||||
* </p>
|
||||
|
||||
@ -903,7 +903,7 @@ class Field extends AccessibleObject implements Member {
|
||||
* Sets the value of a field as an {@code int} on the specified object.
|
||||
* This method is equivalent to
|
||||
* {@code set(obj, iObj)},
|
||||
* where {@code iObj} is a {@code Integer} object and
|
||||
* where {@code iObj} is an {@code Integer} object and
|
||||
* {@code iObj.intValue() == i}.
|
||||
*
|
||||
* @param obj the object whose field should be modified
|
||||
|
||||
@ -36,13 +36,13 @@ public class InaccessibleObjectException extends RuntimeException {
|
||||
private static final long serialVersionUID = 4158786093378140901L;
|
||||
|
||||
/**
|
||||
* Constructs a {@code InaccessibleObjectException} with no detail message.
|
||||
* Constructs an {@code InaccessibleObjectException} with no detail message.
|
||||
*/
|
||||
public InaccessibleObjectException() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a {@code InaccessibleObjectException} with the given detail
|
||||
* Constructs an {@code InaccessibleObjectException} with the given detail
|
||||
* message.
|
||||
*
|
||||
* @param msg
|
||||
|
||||
@ -4676,7 +4676,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
|
||||
*
|
||||
* @return this {@code BigInteger} converted to an {@code int}.
|
||||
* @throws ArithmeticException if the value of {@code this} will
|
||||
* not exactly fit in a {@code int}.
|
||||
* not exactly fit in an {@code int}.
|
||||
* @see BigInteger#intValue
|
||||
* @since 1.8
|
||||
*/
|
||||
|
||||
@ -246,7 +246,7 @@ public class InetSocketAddress
|
||||
* the range of valid port values, or if the hostname
|
||||
* parameter is {@code null}.
|
||||
* @see #isUnresolved()
|
||||
* @return a {@code InetSocketAddress} representing the unresolved
|
||||
* @return an {@code InetSocketAddress} representing the unresolved
|
||||
* socket address
|
||||
* @since 1.5
|
||||
*/
|
||||
|
||||
@ -106,8 +106,8 @@ public class URLDecoder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a {@code application/x-www-form-urlencoded} string using a specific
|
||||
* encoding scheme.
|
||||
* Decodes an {@code application/x-www-form-urlencoded} string using
|
||||
* a specific encoding scheme.
|
||||
* The supplied encoding is used to determine
|
||||
* what characters are represented by any consecutive sequences of the
|
||||
* form "<i>{@code %xy}</i>".
|
||||
|
||||
@ -225,7 +225,7 @@ public class URLEncoder {
|
||||
/*
|
||||
* If this character represents the start of a Unicode
|
||||
* surrogate pair, then pass in two characters. It's not
|
||||
* clear what should be done if a bytes reserved in the
|
||||
* clear what should be done if a byte reserved in the
|
||||
* surrogate pairs range occurs outside of a legal
|
||||
* surrogate pair. For now, just treat it as if it were
|
||||
* any other character.
|
||||
|
||||
@ -196,10 +196,9 @@ import java.util.Objects;
|
||||
* of the JDK reference implementation.
|
||||
* <p>
|
||||
* This implementation supports the Hash_DRBG and HMAC_DRBG mechanisms with
|
||||
* DRBG algorithm SHA-1, SHA-224, SHA-512/224, SHA-256, SHA-512/256,
|
||||
* SHA-384 and SHA-512, and CTR_DRBG (both using derivation function and
|
||||
* not using derivation function) with DRBG algorithm 3KeyTDEA
|
||||
* (also known as DESede in JCE), AES-128, AES-192 and AES-256.
|
||||
* DRBG algorithm SHA-224, SHA-512/224, SHA-256, SHA-512/256, SHA-384 and
|
||||
* SHA-512, and CTR_DRBG (both using derivation function and not using
|
||||
* derivation function) with DRBG algorithm AES-128, AES-192 and AES-256.
|
||||
* <p>
|
||||
* The mechanism name and DRBG algorithm name are determined by the
|
||||
* {@linkplain Security#getProperty(String) security property}
|
||||
|
||||
@ -65,7 +65,7 @@ extends GeneralSecurityException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidAlgorithmParameterException} with the
|
||||
* Creates an {@code InvalidAlgorithmParameterException} with the
|
||||
* specified detail message and cause.
|
||||
*
|
||||
* @param message the detail message (which is saved for later retrieval
|
||||
@ -80,7 +80,7 @@ extends GeneralSecurityException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidAlgorithmParameterException} with the
|
||||
* Creates an {@code InvalidAlgorithmParameterException} with the
|
||||
* specified cause and a detail message of
|
||||
* {@code (cause==null ? null : cause.toString())}
|
||||
* (which typically contains the class and detail message of
|
||||
|
||||
@ -58,7 +58,7 @@ public class InvalidKeyException extends KeyException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidKeyException} with the specified
|
||||
* Creates an {@code InvalidKeyException} with the specified
|
||||
* detail message and cause.
|
||||
*
|
||||
* @param message the detail message (which is saved for later retrieval
|
||||
@ -73,7 +73,7 @@ public class InvalidKeyException extends KeyException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidKeyException} with the specified cause
|
||||
* Creates an {@code InvalidKeyException} with the specified cause
|
||||
* and a detail message of {@code (cause==null ? null : cause.toString())}
|
||||
* (which typically contains the class and detail message of
|
||||
* {@code cause}).
|
||||
|
||||
@ -139,12 +139,10 @@ public class ProtectionDomain {
|
||||
*/
|
||||
final Key key = new Key();
|
||||
|
||||
private static final Debug debug = Debug.getInstance("domain");
|
||||
|
||||
/**
|
||||
* Creates a new ProtectionDomain with the given CodeSource and
|
||||
* Permissions. If the permissions object is not null, then
|
||||
* {@code setReadOnly())} will be called on the passed in
|
||||
* {@code setReadOnly()} will be called on the passed in
|
||||
* Permissions object. The only permissions granted to this domain
|
||||
* are the ones specified; the current Policy will not be consulted.
|
||||
*
|
||||
@ -338,6 +336,13 @@ public class ProtectionDomain {
|
||||
" "+pc+"\n";
|
||||
}
|
||||
|
||||
/*
|
||||
* holder class for the static field "debug" to delay its initialization
|
||||
*/
|
||||
private static class DebugHolder {
|
||||
private static final Debug debug = Debug.getInstance("domain");
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true (merge policy permissions) in the following cases:
|
||||
*
|
||||
@ -359,7 +364,7 @@ public class ProtectionDomain {
|
||||
if (sm == null) {
|
||||
return true;
|
||||
} else {
|
||||
if (debug != null) {
|
||||
if (DebugHolder.debug != null) {
|
||||
if (sm.getClass().getClassLoader() == null &&
|
||||
Policy.getPolicyNoCheck().getClass().getClassLoader()
|
||||
== null) {
|
||||
|
||||
@ -1809,7 +1809,7 @@ public abstract class Provider extends Properties {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this service has its Supported* properties for
|
||||
* Return whether this service has its supported properties for
|
||||
* keys defined. Parses the attributes if not yet initialized.
|
||||
*/
|
||||
private boolean hasKeyAttributes() {
|
||||
|
||||
@ -62,8 +62,6 @@ public class SecureClassLoader extends ClassLoader {
|
||||
private final Map<CodeSourceKey, ProtectionDomain> pdcache
|
||||
= new ConcurrentHashMap<>(11);
|
||||
|
||||
private static final Debug debug = Debug.getInstance("scl");
|
||||
|
||||
static {
|
||||
ClassLoader.registerAsParallelCapable();
|
||||
}
|
||||
@ -202,6 +200,13 @@ public class SecureClassLoader extends ClassLoader {
|
||||
return new Permissions(); // ProtectionDomain defers the binding
|
||||
}
|
||||
|
||||
/*
|
||||
* holder class for the static field "debug" to delay its initialization
|
||||
*/
|
||||
private static class DebugHolder {
|
||||
private static final Debug debug = Debug.getInstance("scl");
|
||||
}
|
||||
|
||||
/*
|
||||
* Returned cached ProtectionDomain for the specified CodeSource.
|
||||
*/
|
||||
@ -222,9 +227,9 @@ public class SecureClassLoader extends ClassLoader {
|
||||
= SecureClassLoader.this.getPermissions(cs);
|
||||
ProtectionDomain pd = new ProtectionDomain(
|
||||
cs, perms, SecureClassLoader.this, null);
|
||||
if (debug != null) {
|
||||
debug.println(" getPermissions " + pd);
|
||||
debug.println("");
|
||||
if (DebugHolder.debug != null) {
|
||||
DebugHolder.debug.println(" getPermissions " + pd);
|
||||
DebugHolder.debug.println("");
|
||||
}
|
||||
return pd;
|
||||
}
|
||||
|
||||
@ -549,7 +549,7 @@ public final class Security {
|
||||
|
||||
/**
|
||||
* Returns an array containing all installed providers that satisfy the
|
||||
* specified* selection criteria, or null if no such providers have been
|
||||
* specified selection criteria, or null if no such providers have been
|
||||
* installed. The returned providers are ordered
|
||||
* according to their
|
||||
* {@linkplain #insertProviderAt(java.security.Provider, int)
|
||||
|
||||
@ -63,7 +63,7 @@ public class InvalidKeySpecException extends GeneralSecurityException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidKeySpecException} with the specified
|
||||
* Creates an {@code InvalidKeySpecException} with the specified
|
||||
* detail message and cause.
|
||||
*
|
||||
* @param message the detail message (which is saved for later retrieval
|
||||
@ -78,7 +78,7 @@ public class InvalidKeySpecException extends GeneralSecurityException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code InvalidKeySpecException} with the specified cause
|
||||
* Creates an {@code InvalidKeySpecException} with the specified cause
|
||||
* and a detail message of {@code (cause==null ? null : cause.toString())}
|
||||
* (which typically contains the class and detail message of
|
||||
* {@code cause}).
|
||||
|
||||
@ -799,33 +799,33 @@ public final class Instant
|
||||
* The supported fields behave as follows:
|
||||
* <ul>
|
||||
* <li>{@code NANOS} -
|
||||
* Returns a {@code Instant} with the specified number of nanoseconds added.
|
||||
* Returns an {@code Instant} with the specified number of nanoseconds added.
|
||||
* This is equivalent to {@link #plusNanos(long)}.
|
||||
* <li>{@code MICROS} -
|
||||
* Returns a {@code Instant} with the specified number of microseconds added.
|
||||
* Returns an {@code Instant} with the specified number of microseconds added.
|
||||
* This is equivalent to {@link #plusNanos(long)} with the amount
|
||||
* multiplied by 1,000.
|
||||
* <li>{@code MILLIS} -
|
||||
* Returns a {@code Instant} with the specified number of milliseconds added.
|
||||
* Returns an {@code Instant} with the specified number of milliseconds added.
|
||||
* This is equivalent to {@link #plusNanos(long)} with the amount
|
||||
* multiplied by 1,000,000.
|
||||
* <li>{@code SECONDS} -
|
||||
* Returns a {@code Instant} with the specified number of seconds added.
|
||||
* Returns an {@code Instant} with the specified number of seconds added.
|
||||
* This is equivalent to {@link #plusSeconds(long)}.
|
||||
* <li>{@code MINUTES} -
|
||||
* Returns a {@code Instant} with the specified number of minutes added.
|
||||
* Returns an {@code Instant} with the specified number of minutes added.
|
||||
* This is equivalent to {@link #plusSeconds(long)} with the amount
|
||||
* multiplied by 60.
|
||||
* <li>{@code HOURS} -
|
||||
* Returns a {@code Instant} with the specified number of hours added.
|
||||
* Returns an {@code Instant} with the specified number of hours added.
|
||||
* This is equivalent to {@link #plusSeconds(long)} with the amount
|
||||
* multiplied by 3,600.
|
||||
* <li>{@code HALF_DAYS} -
|
||||
* Returns a {@code Instant} with the specified number of half-days added.
|
||||
* Returns an {@code Instant} with the specified number of half-days added.
|
||||
* This is equivalent to {@link #plusSeconds(long)} with the amount
|
||||
* multiplied by 43,200 (12 hours).
|
||||
* <li>{@code DAYS} -
|
||||
* Returns a {@code Instant} with the specified number of days added.
|
||||
* Returns an {@code Instant} with the specified number of days added.
|
||||
* This is equivalent to {@link #plusSeconds(long)} with the amount
|
||||
* multiplied by 86,400 (24 hours).
|
||||
* </ul>
|
||||
@ -958,7 +958,7 @@ public final class Instant
|
||||
/**
|
||||
* Returns a copy of this instant with the specified amount subtracted.
|
||||
* <p>
|
||||
* This returns a {@code Instant}, based on this one, with the amount
|
||||
* This returns an {@code Instant}, based on this one, with the amount
|
||||
* in terms of the unit subtracted. If it is not possible to subtract the amount,
|
||||
* because the unit is not supported or for some other reason, an exception is thrown.
|
||||
* <p>
|
||||
|
||||
@ -665,7 +665,7 @@ public final class LocalDateTime
|
||||
* The {@link #isSupported(TemporalField) supported fields} will return valid
|
||||
* values based on this date-time, except {@code NANO_OF_DAY}, {@code MICRO_OF_DAY},
|
||||
* {@code EPOCH_DAY} and {@code PROLEPTIC_MONTH} which are too large to fit in
|
||||
* an {@code int} and throw a {@code UnsupportedTemporalTypeException}.
|
||||
* an {@code int} and throw an {@code UnsupportedTemporalTypeException}.
|
||||
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
|
||||
* <p>
|
||||
* If the field is not a {@code ChronoField}, then the result of this method
|
||||
|
||||
@ -619,7 +619,7 @@ public final class LocalTime
|
||||
* If the field is a {@link ChronoField} then the query is implemented here.
|
||||
* The {@link #isSupported(TemporalField) supported fields} will return valid
|
||||
* values based on this time, except {@code NANO_OF_DAY} and {@code MICRO_OF_DAY}
|
||||
* which are too large to fit in an {@code int} and throw a {@code UnsupportedTemporalTypeException}.
|
||||
* which are too large to fit in an {@code int} and throw an {@code UnsupportedTemporalTypeException}.
|
||||
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
|
||||
* <p>
|
||||
* If the field is not a {@code ChronoField}, then the result of this method
|
||||
|
||||
@ -576,7 +576,7 @@ public final class OffsetDateTime
|
||||
* The {@link #isSupported(TemporalField) supported fields} will return valid
|
||||
* values based on this date-time, except {@code NANO_OF_DAY}, {@code MICRO_OF_DAY},
|
||||
* {@code EPOCH_DAY}, {@code PROLEPTIC_MONTH} and {@code INSTANT_SECONDS} which are too
|
||||
* large to fit in an {@code int} and throw a {@code UnsupportedTemporalTypeException}.
|
||||
* large to fit in an {@code int} and throw an {@code UnsupportedTemporalTypeException}.
|
||||
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
|
||||
* <p>
|
||||
* If the field is not a {@code ChronoField}, then the result of this method
|
||||
|
||||
@ -481,7 +481,7 @@ public final class OffsetTime
|
||||
* If the field is a {@link ChronoField} then the query is implemented here.
|
||||
* The {@link #isSupported(TemporalField) supported fields} will return valid
|
||||
* values based on this time, except {@code NANO_OF_DAY} and {@code MICRO_OF_DAY}
|
||||
* which are too large to fit in an {@code int} and throw a {@code UnsupportedTemporalTypeException}.
|
||||
* which are too large to fit in an {@code int} and throw an {@code UnsupportedTemporalTypeException}.
|
||||
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
|
||||
* <p>
|
||||
* If the field is not a {@code ChronoField}, then the result of this method
|
||||
|
||||
@ -793,7 +793,7 @@ public final class ZonedDateTime
|
||||
* The {@link #isSupported(TemporalField) supported fields} will return valid
|
||||
* values based on this date-time, except {@code NANO_OF_DAY}, {@code MICRO_OF_DAY},
|
||||
* {@code EPOCH_DAY}, {@code PROLEPTIC_MONTH} and {@code INSTANT_SECONDS} which are too
|
||||
* large to fit in an {@code int} and throw a {@code UnsupportedTemporalTypeException}.
|
||||
* large to fit in an {@code int} and throw an {@code UnsupportedTemporalTypeException}.
|
||||
* All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.
|
||||
* <p>
|
||||
* If the field is not a {@code ChronoField}, then the result of this method
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user