mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-06 14:10:36 +00:00
Merge
This commit is contained in:
commit
5370eb5519
1
.hgtags
1
.hgtags
@ -366,3 +366,4 @@ caf97b37ebec84288c112d21d3a60cb628cba1e8 jdk-9+119
|
||||
18e5cdecb37a2f03ba74f6c8f022858bcbaacf56 jdk-9+121
|
||||
7693aa00e131493ceb42b93305e2f014c9922a3b jdk-9+122
|
||||
d53037a90c441cb528dc41c30827985de0e67c62 jdk-9+123
|
||||
2a5697a98620c4f40e4a1a71478464399b8878de jdk-9+124
|
||||
|
||||
@ -366,3 +366,4 @@ e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117
|
||||
cae471d3b87783e0a3deea658e1e1c84b2485b6c jdk-9+121
|
||||
346be2df0f5b31d423807f53a719d1b9a67f3354 jdk-9+122
|
||||
405d811c0d7b9b48ff718ae6c240b732f098c028 jdk-9+123
|
||||
f80c841ae2545eaf9acd2724bccc305d98cefbe2 jdk-9+124
|
||||
|
||||
@ -5094,7 +5094,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=1466007828
|
||||
DATE_WHEN_GENERATED=1467039751
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -36621,7 +36621,6 @@ $as_echo "yes" >&6; }
|
||||
# Setup the assembler (AS)
|
||||
#
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
# FIXME: should this really be solaris, or solstudio?
|
||||
|
||||
|
||||
# Publish this variable in the help.
|
||||
@ -37105,6 +37104,9 @@ $as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;}
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$AS" = x; then
|
||||
as_fn_error $? "Solaris assembler (as) is required. Please install via \"pkg install pkg:/developer/assembler\"." "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
# FIXME: is this correct for microsoft?
|
||||
AS="$CC -c"
|
||||
|
||||
@ -597,9 +597,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
|
||||
# Setup the assembler (AS)
|
||||
#
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
# FIXME: should this really be solaris, or solstudio?
|
||||
BASIC_PATH_PROGS(AS, as)
|
||||
BASIC_FIXUP_EXECUTABLE(AS)
|
||||
if test "x$AS" = x; then
|
||||
AC_MSG_ERROR([Solaris assembler (as) is required. Please install via "pkg install pkg:/developer/assembler".])
|
||||
fi
|
||||
else
|
||||
# FIXME: is this correct for microsoft?
|
||||
AS="$CC -c"
|
||||
|
||||
@ -360,9 +360,11 @@ compare_general_files() {
|
||||
$RM $OTHER_FILE $THIS_FILE
|
||||
#Note that | doesn't work on mac sed.
|
||||
HTML_FILTER="$SED \
|
||||
-e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
|
||||
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \
|
||||
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}/<DATE>/g' \
|
||||
-e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \
|
||||
-e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/'
|
||||
-e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/' \
|
||||
-e 's/from .*\.idl/\.idl/' \
|
||||
"
|
||||
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
|
||||
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE &
|
||||
|
||||
@ -366,3 +366,4 @@ daf533920b1266603b5cbdab31908d2a931c5361 jdk-9+119
|
||||
9a5fc5a27560ac272c1341f8f3838338fba49059 jdk-9+121
|
||||
a39131aafc51a6fd8836e6ebe1b04458702ce7d6 jdk-9+122
|
||||
e33a34cc551907617d8129c4faaf1a5a7e61d21c jdk-9+123
|
||||
45121d5afb9d5bfadab75378572ad96832e0809e jdk-9+124
|
||||
|
||||
@ -2230,7 +2230,7 @@ public class IIOPInputStream
|
||||
* REVISIT -- This code doesn't do what the comment says to when
|
||||
* getField() is null!
|
||||
*/
|
||||
private void inputClassFields(Object o, Class cl,
|
||||
private void inputClassFields(Object o, Class<?> cl,
|
||||
ObjectStreamField[] fields,
|
||||
com.sun.org.omg.SendingContext.CodeBase sender)
|
||||
throws InvalidClassException, StreamCorruptedException,
|
||||
@ -2239,6 +2239,8 @@ public class IIOPInputStream
|
||||
|
||||
int primFields = fields.length - currentClassDesc.objFields;
|
||||
|
||||
// this will leave primitives in the inputstream
|
||||
// should really consume and discard where necessary
|
||||
if (o != null) {
|
||||
for (int i = 0; i < primFields; ++i) {
|
||||
inputPrimitiveField(o, cl, fields[i]);
|
||||
@ -2264,21 +2266,32 @@ public class IIOPInputStream
|
||||
}
|
||||
|
||||
try {
|
||||
Class fieldCl = fields[i].getClazz();
|
||||
Class<?> fieldCl = fields[i].getClazz();
|
||||
if ((objectValue != null)
|
||||
&& (!fieldCl.isAssignableFrom(
|
||||
objectValue.getClass()))) {
|
||||
throw new IllegalArgumentException("Field mismatch");
|
||||
}
|
||||
Field classField = null;
|
||||
Field declaredClassField = null;
|
||||
final String inputStreamFieldName = fields[i].getName();
|
||||
try {
|
||||
classField = cl.getDeclaredField(fields[i].getName());
|
||||
} catch (NoSuchFieldException nsfEx) {
|
||||
throw new IllegalArgumentException(nsfEx);
|
||||
declaredClassField = getDeclaredField( cl, inputStreamFieldName);
|
||||
} catch (PrivilegedActionException paEx) {
|
||||
throw new IllegalArgumentException(
|
||||
(NoSuchFieldException) paEx.getException());
|
||||
} catch (SecurityException secEx) {
|
||||
throw new IllegalArgumentException(secEx.getCause());
|
||||
throw new IllegalArgumentException(secEx);
|
||||
} catch (NullPointerException npEx) {
|
||||
continue;
|
||||
} catch (NoSuchFieldException e) {
|
||||
continue;
|
||||
}
|
||||
Class<?> declaredFieldClass = classField.getType();
|
||||
|
||||
if (declaredClassField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Class<?> declaredFieldClass = declaredClassField.getType();
|
||||
|
||||
// check input field type is a declared field type
|
||||
// input field is a subclass of the declared field
|
||||
@ -2291,15 +2304,24 @@ public class IIOPInputStream
|
||||
}
|
||||
bridge.putObject( o, fields[i].getFieldID(), objectValue ) ;
|
||||
// reflective code: fields[i].getField().set( o, objectValue ) ;
|
||||
} catch (IllegalArgumentException e) {
|
||||
ClassCastException exc = new ClassCastException("Assigning instance of class " +
|
||||
objectValue.getClass().getName() +
|
||||
" to field " +
|
||||
currentClassDesc.getName() +
|
||||
'#' +
|
||||
fields[i].getField().getName());
|
||||
exc.initCause( e ) ;
|
||||
throw exc ;
|
||||
} catch (IllegalArgumentException iaEx) {
|
||||
String objectValueClassName = "null";
|
||||
String currentClassDescClassName = "null";
|
||||
String fieldName = "null";
|
||||
if (objectValue != null) {
|
||||
objectValueClassName = objectValue.getClass().getName();
|
||||
}
|
||||
if (currentClassDesc != null) {
|
||||
currentClassDescClassName = currentClassDesc.getName();
|
||||
}
|
||||
if (fields[i] != null && fields[i].getField() != null) {
|
||||
fieldName = fields[i].getField().getName();
|
||||
}
|
||||
ClassCastException ccEx = new ClassCastException(
|
||||
"Assigning instance of class " + objectValueClassName
|
||||
+ " to field " + currentClassDescClassName + '#' + fieldName);
|
||||
ccEx.initCause( iaEx ) ;
|
||||
throw ccEx ;
|
||||
}
|
||||
} // end : for loop
|
||||
}
|
||||
@ -2592,12 +2614,11 @@ public class IIOPInputStream
|
||||
throw cce ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void setObjectField(Object o, Class c, String fieldName, Object v) {
|
||||
private static void setObjectField(Object o, Class<?> c, String fieldName, Object v) {
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
Class fieldCl = fld.getType();
|
||||
if(v != null && !fieldCl.isInstance(v)) {
|
||||
throw new Exception();
|
||||
@ -2617,10 +2638,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setBooleanField(Object o, Class c, String fieldName, boolean v)
|
||||
private static void setBooleanField(Object o, Class<?> c, String fieldName, boolean v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Boolean.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putBoolean( o, key, v ) ;
|
||||
@ -2640,10 +2661,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setByteField(Object o, Class c, String fieldName, byte v)
|
||||
private static void setByteField(Object o, Class<?> c, String fieldName, byte v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Byte.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putByte( o, key, v ) ;
|
||||
@ -2663,10 +2684,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setCharField(Object o, Class c, String fieldName, char v)
|
||||
private static void setCharField(Object o, Class<?> c, String fieldName, char v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Character.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putChar( o, key, v ) ;
|
||||
@ -2686,10 +2707,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setShortField(Object o, Class c, String fieldName, short v)
|
||||
private static void setShortField(Object o, Class<?> c, String fieldName, short v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Short.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putShort( o, key, v ) ;
|
||||
@ -2709,10 +2730,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setIntField(Object o, Class c, String fieldName, int v)
|
||||
private static void setIntField(Object o, Class<?> c, String fieldName, int v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Integer.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putInt( o, key, v ) ;
|
||||
@ -2732,10 +2753,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setLongField(Object o, Class c, String fieldName, long v)
|
||||
private static void setLongField(Object o, Class<?> c, String fieldName, long v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Long.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putLong( o, key, v ) ;
|
||||
@ -2755,10 +2776,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setFloatField(Object o, Class c, String fieldName, float v)
|
||||
private static void setFloatField(Object o, Class<?> c, String fieldName, float v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Float.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putFloat( o, key, v ) ;
|
||||
@ -2778,10 +2799,10 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
private static void setDoubleField(Object o, Class c, String fieldName, double v)
|
||||
private static void setDoubleField(Object o, Class<?> c, String fieldName, double v)
|
||||
{
|
||||
try {
|
||||
Field fld = c.getDeclaredField( fieldName ) ;
|
||||
Field fld = getDeclaredField( c, fieldName ) ;
|
||||
if ((fld != null) && (fld.getType() == Double.TYPE)) {
|
||||
long key = bridge.objectFieldOffset( fld ) ;
|
||||
bridge.putDouble( o, key, v ) ;
|
||||
@ -2801,6 +2822,22 @@ public class IIOPInputStream
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static Field getDeclaredField(final Class<?> c,
|
||||
final String fieldName)
|
||||
throws PrivilegedActionException, NoSuchFieldException, SecurityException {
|
||||
if (System.getSecurityManager() == null) {
|
||||
return c.getDeclaredField(fieldName);
|
||||
} else {
|
||||
return AccessController
|
||||
.doPrivileged(new PrivilegedExceptionAction<Field>() {
|
||||
public Field run() throws NoSuchFieldException {
|
||||
return c.getDeclaredField(fieldName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class maintains a map of stream position to
|
||||
* an Object currently being deserialized. It is used
|
||||
@ -2811,12 +2848,12 @@ public class IIOPInputStream
|
||||
*/
|
||||
static class ActiveRecursionManager
|
||||
{
|
||||
private Map offsetToObjectMap;
|
||||
private Map<Integer, Object> offsetToObjectMap;
|
||||
|
||||
public ActiveRecursionManager() {
|
||||
// A hash map is unsynchronized and allows
|
||||
// null values
|
||||
offsetToObjectMap = new HashMap();
|
||||
offsetToObjectMap = new HashMap<>();
|
||||
}
|
||||
|
||||
// Called right after allocating a new object.
|
||||
|
||||
@ -526,3 +526,4 @@ b64432bae5271735fd53300b2005b713e98ef411 jdk-9+114
|
||||
7e293105dbb0789a468655f81320c891f491f371 jdk-9+121
|
||||
af6b4ad908e732d23021f12e8322b204433d5cf6 jdk-9+122
|
||||
75f81e1fecfb444f34f357295fe06af60e2762d9 jdk-9+123
|
||||
479631362b4930be985245ea063d87d821a472eb jdk-9+124
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
|
||||
@ -30,6 +30,7 @@ C1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
|
||||
@ -65,6 +65,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
notproduct, \
|
||||
range, \
|
||||
constraint, \
|
||||
@ -356,6 +357,7 @@ C1_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
|
||||
@ -30,6 +30,7 @@ G1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_EXPERIMENTAL_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG, \
|
||||
MATERIALIZE_MANAGEABLE_FLAG, \
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
experimental, \
|
||||
notproduct, \
|
||||
manageable, \
|
||||
@ -323,6 +324,7 @@ G1_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_EXPERIMENTAL_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
DECLARE_MANAGEABLE_FLAG, \
|
||||
|
||||
@ -32,6 +32,7 @@ JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_EXPERIMENTAL_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE, \
|
||||
@ -89,6 +90,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_DIAGNOSTIC_FLAG_VALUE_CHANGED_CHECK_CODE, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
IGNORE_RANGE, \
|
||||
@ -104,6 +106,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECK_CODE, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
IGNORE_RANGE, \
|
||||
@ -129,6 +132,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
|
||||
JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
|
||||
JVMCI_PD_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_NOTPRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE, \
|
||||
IGNORE_RANGE, \
|
||||
@ -168,6 +172,7 @@ void JVMCIGlobals::print_jvmci_args_inconsistency_error_message() {
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_DIAGNOSTIC_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
IGNORE_RANGE, \
|
||||
@ -181,6 +186,7 @@ void JVMCIGlobals::print_jvmci_args_inconsistency_error_message() {
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_EXPERIMENTAL_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
IGNORE_RANGE, \
|
||||
@ -206,6 +212,7 @@ void JVMCIGlobals::print_jvmci_args_inconsistency_error_message() {
|
||||
JVMCI_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
|
||||
JVMCI_PD_PRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_THREE_PARAM, \
|
||||
JVMCI_IGNORE_FLAG_FOUR_PARAM, \
|
||||
JVMCI_NOTPRODUCT_FLAG_CHECK_PRINT_ERR_MSG_CODE, \
|
||||
IGNORE_RANGE, \
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
experimental, \
|
||||
notproduct, \
|
||||
range, \
|
||||
@ -102,6 +103,7 @@ JVMCI_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_EXPERIMENTAL_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
|
||||
@ -30,6 +30,7 @@ C2_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_EXPERIMENTAL_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
|
||||
@ -66,6 +66,7 @@
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
experimental, \
|
||||
notproduct, \
|
||||
range, \
|
||||
@ -203,7 +204,7 @@
|
||||
"Map number of unrolls for main loop via " \
|
||||
"Superword Level Parallelism analysis") \
|
||||
\
|
||||
product_pd(bool, PostLoopMultiversioning, \
|
||||
diagnostic_pd(bool, PostLoopMultiversioning, \
|
||||
"Multi versioned post loops to eliminate range checks") \
|
||||
\
|
||||
notproduct(bool, TraceSuperWordLoopUnrollAnalysis, false, \
|
||||
@ -764,6 +765,7 @@ C2_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_EXPERIMENTAL_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
|
||||
@ -211,6 +211,7 @@ void emit_constraint_double(const char* name, CommandLineFlagConstraintFunc_doub
|
||||
#define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_PRODUCT_RW_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_PD_PRODUCT_FLAG(type, name, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG(type, name, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_DEVELOPER_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_PD_DEVELOPER_FLAG(type, name, doc) ); emit_constraint_##type(#name
|
||||
#define EMIT_CONSTRAINT_NOTPRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
|
||||
@ -233,6 +234,7 @@ void CommandLineFlagConstraintList::init(void) {
|
||||
EMIT_CONSTRAINT_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
|
||||
EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_MANAGEABLE_FLAG,
|
||||
@ -260,6 +262,7 @@ void CommandLineFlagConstraintList::init(void) {
|
||||
EMIT_CONSTRAINT_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE,
|
||||
EMIT_CONSTRAINT_CHECK,
|
||||
@ -272,6 +275,7 @@ void CommandLineFlagConstraintList::init(void) {
|
||||
EMIT_CONSTRAINT_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
|
||||
EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE,
|
||||
@ -285,6 +289,7 @@ void CommandLineFlagConstraintList::init(void) {
|
||||
EMIT_CONSTRAINT_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
|
||||
EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
|
||||
EMIT_CONSTRAINT_MANAGEABLE_FLAG,
|
||||
|
||||
@ -278,6 +278,7 @@ void emit_range_double(const char* name, double min, double max) {
|
||||
#define EMIT_RANGE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_PRODUCT_RW_FLAG(type, name, value, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_PD_PRODUCT_FLAG(type, name, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_PD_DIAGNOSTIC_FLAG(type, name, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_DEVELOPER_FLAG(type, name, value, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_PD_DEVELOPER_FLAG(type, name, doc) ); emit_range_##type(#name
|
||||
#define EMIT_RANGE_NOTPRODUCT_FLAG(type, name, value, doc) ); emit_range_##type(#name
|
||||
@ -299,6 +300,7 @@ void CommandLineFlagRangeList::init(void) {
|
||||
EMIT_RANGE_PRODUCT_FLAG,
|
||||
EMIT_RANGE_PD_PRODUCT_FLAG,
|
||||
EMIT_RANGE_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_EXPERIMENTAL_FLAG,
|
||||
EMIT_RANGE_NOTPRODUCT_FLAG,
|
||||
EMIT_RANGE_MANAGEABLE_FLAG,
|
||||
@ -325,6 +327,7 @@ void CommandLineFlagRangeList::init(void) {
|
||||
EMIT_RANGE_PRODUCT_FLAG,
|
||||
EMIT_RANGE_PD_PRODUCT_FLAG,
|
||||
EMIT_RANGE_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_EXPERIMENTAL_FLAG,
|
||||
EMIT_RANGE_NOTPRODUCT_FLAG,
|
||||
EMIT_RANGE_CHECK,
|
||||
@ -338,6 +341,7 @@ void CommandLineFlagRangeList::init(void) {
|
||||
EMIT_RANGE_PRODUCT_FLAG,
|
||||
EMIT_RANGE_PD_PRODUCT_FLAG,
|
||||
EMIT_RANGE_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_NOTPRODUCT_FLAG,
|
||||
EMIT_RANGE_CHECK,
|
||||
IGNORE_CONSTRAINT,
|
||||
@ -350,6 +354,7 @@ void CommandLineFlagRangeList::init(void) {
|
||||
EMIT_RANGE_PRODUCT_FLAG,
|
||||
EMIT_RANGE_PD_PRODUCT_FLAG,
|
||||
EMIT_RANGE_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_EXPERIMENTAL_FLAG,
|
||||
EMIT_RANGE_NOTPRODUCT_FLAG,
|
||||
EMIT_RANGE_CHECK,
|
||||
@ -363,6 +368,7 @@ void CommandLineFlagRangeList::init(void) {
|
||||
EMIT_RANGE_PRODUCT_FLAG,
|
||||
EMIT_RANGE_PD_PRODUCT_FLAG,
|
||||
EMIT_RANGE_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_RANGE_EXPERIMENTAL_FLAG,
|
||||
EMIT_RANGE_NOTPRODUCT_FLAG,
|
||||
EMIT_RANGE_MANAGEABLE_FLAG,
|
||||
|
||||
@ -108,6 +108,7 @@ void emit_writeable_double(const char* name, CommandLineFlagWriteable::Writeable
|
||||
#define EMIT_WRITEABLE_PD_PRODUCT_FLAG(type, name, doc) ); emit_writeable_##type(#name
|
||||
#define EMIT_WRITEABLE_DEVELOPER_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
|
||||
#define EMIT_WRITEABLE_PD_DEVELOPER_FLAG(type, name, doc) ); emit_writeable_##type(#name
|
||||
#define EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG(type, name, doc) ); emit_writeable_##type(#name
|
||||
#define EMIT_WRITEABLE_NOTPRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
|
||||
#define EMIT_WRITEABLE_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name
|
||||
|
||||
@ -126,6 +127,7 @@ void CommandLineFlagWriteableList::init(void) {
|
||||
EMIT_WRITEABLE_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_PD_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
|
||||
EMIT_WRITEABLE_NOTPRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_MANAGEABLE_FLAG,
|
||||
@ -152,6 +154,7 @@ void CommandLineFlagWriteableList::init(void) {
|
||||
EMIT_WRITEABLE_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_PD_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
|
||||
EMIT_WRITEABLE_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE,
|
||||
@ -165,6 +168,7 @@ void CommandLineFlagWriteableList::init(void) {
|
||||
EMIT_WRITEABLE_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_PD_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE,
|
||||
IGNORE_CONSTRAINT,
|
||||
@ -177,6 +181,7 @@ void CommandLineFlagWriteableList::init(void) {
|
||||
EMIT_WRITEABLE_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_PD_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
|
||||
EMIT_WRITEABLE_NOTPRODUCT_FLAG,
|
||||
IGNORE_RANGE,
|
||||
@ -190,6 +195,7 @@ void CommandLineFlagWriteableList::init(void) {
|
||||
EMIT_WRITEABLE_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_PD_PRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG,
|
||||
EMIT_WRITEABLE_EXPERIMENTAL_FLAG,
|
||||
EMIT_WRITEABLE_NOTPRODUCT_FLAG,
|
||||
EMIT_WRITEABLE_MANAGEABLE_FLAG,
|
||||
|
||||
@ -58,6 +58,7 @@ RUNTIME_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_EXPERIMENTAL_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG, \
|
||||
MATERIALIZE_MANAGEABLE_FLAG, \
|
||||
@ -72,6 +73,7 @@ RUNTIME_OS_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \
|
||||
MATERIALIZE_PRODUCT_FLAG, \
|
||||
MATERIALIZE_PD_PRODUCT_FLAG, \
|
||||
MATERIALIZE_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_PD_DIAGNOSTIC_FLAG, \
|
||||
MATERIALIZE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
@ -650,6 +652,7 @@ const char* Flag::flag_error_str(Flag::Error error) {
|
||||
#define RUNTIME_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT) },
|
||||
#define RUNTIME_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define RUNTIME_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_DIAGNOSTIC) },
|
||||
#define RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT(type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_DIAGNOSTIC | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define RUNTIME_EXPERIMENTAL_FLAG_STRUCT(type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_EXPERIMENTAL) },
|
||||
#define RUNTIME_MANAGEABLE_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_MANAGEABLE) },
|
||||
#define RUNTIME_PRODUCT_RW_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_PRODUCT | Flag::KIND_READ_WRITE) },
|
||||
@ -660,6 +663,7 @@ const char* Flag::flag_error_str(Flag::Error error) {
|
||||
#define JVMCI_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_PRODUCT) },
|
||||
#define JVMCI_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define JVMCI_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_DIAGNOSTIC) },
|
||||
#define JVMCI_PD_DIAGNOSTIC_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_DIAGNOSTIC | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define JVMCI_EXPERIMENTAL_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_EXPERIMENTAL) },
|
||||
#define JVMCI_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_DEVELOP) },
|
||||
#define JVMCI_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_JVMCI | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
@ -674,6 +678,7 @@ const char* Flag::flag_error_str(Flag::Error error) {
|
||||
#define C1_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_PRODUCT) },
|
||||
#define C1_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define C1_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DIAGNOSTIC) },
|
||||
#define C1_PD_DIAGNOSTIC_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DIAGNOSTIC | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define C1_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DEVELOP) },
|
||||
#define C1_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define C1_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C1 | Flag::KIND_NOT_PRODUCT) },
|
||||
@ -681,6 +686,7 @@ const char* Flag::flag_error_str(Flag::Error error) {
|
||||
#define C2_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_PRODUCT) },
|
||||
#define C2_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define C2_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DIAGNOSTIC) },
|
||||
#define C2_PD_DIAGNOSTIC_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DIAGNOSTIC | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define C2_EXPERIMENTAL_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_EXPERIMENTAL) },
|
||||
#define C2_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DEVELOP) },
|
||||
#define C2_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_C2 | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
@ -695,6 +701,7 @@ const char* Flag::flag_error_str(Flag::Error error) {
|
||||
#define SHARK_PRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_PRODUCT) },
|
||||
#define SHARK_PD_PRODUCT_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_PRODUCT | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define SHARK_DIAGNOSTIC_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DIAGNOSTIC) },
|
||||
#define SHARK_PD_DIAGNOSTIC_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DIAGNOSTIC | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define SHARK_DEVELOP_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DEVELOP) },
|
||||
#define SHARK_PD_DEVELOP_FLAG_STRUCT( type, name, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_DEVELOP | Flag::KIND_PLATFORM_DEPENDENT) },
|
||||
#define SHARK_NOTPRODUCT_FLAG_STRUCT( type, name, value, doc) { #type, XSTR(name), (void*) &name, NOT_PRODUCT_ARG(doc) Flag::Flags(Flag::DEFAULT | Flag::KIND_SHARK | Flag::KIND_NOT_PRODUCT) },
|
||||
@ -705,6 +712,7 @@ static Flag flagTable[] = {
|
||||
RUNTIME_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_EXPERIMENTAL_FLAG_STRUCT, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_MANAGEABLE_FLAG_STRUCT, \
|
||||
@ -718,6 +726,7 @@ static Flag flagTable[] = {
|
||||
RUNTIME_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_STRUCT, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
@ -728,6 +737,7 @@ static Flag flagTable[] = {
|
||||
RUNTIME_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
RUNTIME_EXPERIMENTAL_FLAG_STRUCT, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_STRUCT, \
|
||||
RUNTIME_MANAGEABLE_FLAG_STRUCT, \
|
||||
@ -742,6 +752,7 @@ static Flag flagTable[] = {
|
||||
JVMCI_PRODUCT_FLAG_STRUCT, \
|
||||
JVMCI_PD_PRODUCT_FLAG_STRUCT, \
|
||||
JVMCI_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
JVMCI_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
JVMCI_EXPERIMENTAL_FLAG_STRUCT, \
|
||||
JVMCI_NOTPRODUCT_FLAG_STRUCT, \
|
||||
IGNORE_RANGE, \
|
||||
@ -754,6 +765,7 @@ static Flag flagTable[] = {
|
||||
C1_PRODUCT_FLAG_STRUCT, \
|
||||
C1_PD_PRODUCT_FLAG_STRUCT, \
|
||||
C1_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
C1_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
C1_NOTPRODUCT_FLAG_STRUCT, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
@ -765,6 +777,7 @@ static Flag flagTable[] = {
|
||||
C2_PRODUCT_FLAG_STRUCT, \
|
||||
C2_PD_PRODUCT_FLAG_STRUCT, \
|
||||
C2_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
C2_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
C2_EXPERIMENTAL_FLAG_STRUCT, \
|
||||
C2_NOTPRODUCT_FLAG_STRUCT, \
|
||||
IGNORE_RANGE, \
|
||||
@ -777,6 +790,7 @@ static Flag flagTable[] = {
|
||||
SHARK_PRODUCT_FLAG_STRUCT, \
|
||||
SHARK_PD_PRODUCT_FLAG_STRUCT, \
|
||||
SHARK_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
SHARK_PD_DIAGNOSTIC_FLAG_STRUCT, \
|
||||
SHARK_NOTPRODUCT_FLAG_STRUCT, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
|
||||
@ -644,6 +644,7 @@ public:
|
||||
product, \
|
||||
product_pd, \
|
||||
diagnostic, \
|
||||
diagnostic_pd, \
|
||||
experimental, \
|
||||
notproduct, \
|
||||
manageable, \
|
||||
@ -2529,7 +2530,7 @@ public:
|
||||
develop(bool, GenerateRangeChecks, true, \
|
||||
"Generate range checks for array accesses") \
|
||||
\
|
||||
develop_pd(bool, ImplicitNullChecks, \
|
||||
diagnostic_pd(bool, ImplicitNullChecks, \
|
||||
"Generate code for implicit null checks") \
|
||||
\
|
||||
product_pd(bool, TrapBasedNullChecks, \
|
||||
@ -3163,7 +3164,7 @@ public:
|
||||
"Ratio of call site execution to caller method invocation") \
|
||||
range(0, max_jint) \
|
||||
\
|
||||
develop_pd(intx, InlineFrequencyCount, \
|
||||
diagnostic_pd(intx, InlineFrequencyCount, \
|
||||
"Count of call site execution necessary to trigger frequent " \
|
||||
"inlining") \
|
||||
range(0, max_jint) \
|
||||
@ -4144,7 +4145,7 @@ public:
|
||||
"in the loaded class C. " \
|
||||
"Check (3) is available only in debug builds.") \
|
||||
\
|
||||
develop_pd(intx, InitArrayShortSize, \
|
||||
diagnostic_pd(intx, InitArrayShortSize, \
|
||||
"Threshold small size (in bytes) for clearing arrays. " \
|
||||
"Anything this size or smaller may get converted to discrete " \
|
||||
"scalar stores.") \
|
||||
@ -4168,6 +4169,7 @@ public:
|
||||
#define DECLARE_PRODUCT_FLAG(type, name, value, doc) extern "C" type name;
|
||||
#define DECLARE_PD_PRODUCT_FLAG(type, name, doc) extern "C" type name;
|
||||
#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc) extern "C" type name;
|
||||
#define DECLARE_PD_DIAGNOSTIC_FLAG(type, name, doc) extern "C" type name;
|
||||
#define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name;
|
||||
#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc) extern "C" type name;
|
||||
#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc) extern "C" type name;
|
||||
@ -4191,6 +4193,7 @@ public:
|
||||
#define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc) type name = value;
|
||||
#define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc) type name = pd_##name;
|
||||
#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc) type name = value;
|
||||
#define MATERIALIZE_PD_DIAGNOSTIC_FLAG(type, name, doc) type name = pd_##name;
|
||||
#define MATERIALIZE_EXPERIMENTAL_FLAG(type, name, value, doc) type name = value;
|
||||
#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc) type name = value;
|
||||
#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc) type name = value;
|
||||
@ -4221,6 +4224,7 @@ RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_EXPERIMENTAL_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
DECLARE_MANAGEABLE_FLAG, \
|
||||
@ -4235,6 +4239,7 @@ RUNTIME_OS_FLAGS(DECLARE_DEVELOPER_FLAG, \
|
||||
DECLARE_PRODUCT_FLAG, \
|
||||
DECLARE_PD_PRODUCT_FLAG, \
|
||||
DECLARE_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_PD_DIAGNOSTIC_FLAG, \
|
||||
DECLARE_NOTPRODUCT_FLAG, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#define RUNTIME_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_MANAGEABLE_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define RUNTIME_PRODUCT_RW_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
@ -61,6 +62,7 @@
|
||||
#define JVMCI_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define JVMCI_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define JVMCI_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define JVMCI_PD_DIAGNOSTIC_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define JVMCI_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define JVMCI_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
|
||||
@ -73,6 +75,7 @@
|
||||
#define C1_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C1_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define C1_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C1_PD_DIAGNOSTIC_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define C1_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C1_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define C1_NOTPRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
@ -80,6 +83,7 @@
|
||||
#define C2_PRODUCT_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C2_PD_PRODUCT_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define C2_DIAGNOSTIC_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C2_PD_DIAGNOSTIC_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
#define C2_EXPERIMENTAL_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C2_DEVELOP_FLAG_MEMBER(type, name, value, doc) FLAG_MEMBER(name),
|
||||
#define C2_PD_DEVELOP_FLAG_MEMBER(type, name, doc) FLAG_MEMBER(name),
|
||||
@ -97,6 +101,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_MANAGEABLE_FLAG_MEMBER, \
|
||||
@ -110,6 +115,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
@ -120,6 +126,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER, \
|
||||
RUNTIME_MANAGEABLE_FLAG_MEMBER, \
|
||||
@ -134,6 +141,7 @@ typedef enum {
|
||||
JVMCI_PRODUCT_FLAG_MEMBER, \
|
||||
JVMCI_PD_PRODUCT_FLAG_MEMBER, \
|
||||
JVMCI_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
JVMCI_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
JVMCI_EXPERIMENTAL_FLAG_MEMBER, \
|
||||
JVMCI_NOTPRODUCT_FLAG_MEMBER, \
|
||||
IGNORE_RANGE, \
|
||||
@ -146,6 +154,7 @@ typedef enum {
|
||||
C1_PRODUCT_FLAG_MEMBER, \
|
||||
C1_PD_PRODUCT_FLAG_MEMBER, \
|
||||
C1_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
C1_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
C1_NOTPRODUCT_FLAG_MEMBER, \
|
||||
IGNORE_RANGE, \
|
||||
IGNORE_CONSTRAINT, \
|
||||
@ -157,6 +166,7 @@ typedef enum {
|
||||
C2_PRODUCT_FLAG_MEMBER, \
|
||||
C2_PD_PRODUCT_FLAG_MEMBER, \
|
||||
C2_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
C2_PD_DIAGNOSTIC_FLAG_MEMBER, \
|
||||
C2_EXPERIMENTAL_FLAG_MEMBER, \
|
||||
C2_NOTPRODUCT_FLAG_MEMBER, \
|
||||
IGNORE_RANGE, \
|
||||
@ -182,6 +192,7 @@ typedef enum {
|
||||
#define RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
@ -194,12 +205,14 @@ typedef enum {
|
||||
#define JVMCI_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define JVMCI_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define JVMCI_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define JVMCI_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define JVMCI_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define JVMCI_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
|
||||
#define C1_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
@ -213,6 +226,7 @@ typedef enum {
|
||||
#define C2_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, value, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
#define C2_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE(type, name, doc) FLAG_MEMBER_WITH_TYPE(name,type),
|
||||
@ -230,6 +244,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
|
||||
@ -243,6 +258,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
IGNORE_RANGE,
|
||||
IGNORE_CONSTRAINT,
|
||||
@ -253,6 +269,7 @@ typedef enum {
|
||||
RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
|
||||
@ -267,6 +284,7 @@ typedef enum {
|
||||
JVMCI_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
JVMCI_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
JVMCI_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
JVMCI_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
JVMCI_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
||||
JVMCI_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
IGNORE_RANGE,
|
||||
@ -279,6 +297,7 @@ typedef enum {
|
||||
C1_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
C1_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
C1_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
C1_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
C1_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
IGNORE_RANGE,
|
||||
IGNORE_CONSTRAINT,
|
||||
@ -290,6 +309,7 @@ typedef enum {
|
||||
C2_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
C2_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
C2_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
C2_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
|
||||
C2_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE,
|
||||
C2_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
|
||||
IGNORE_RANGE,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -31,7 +31,7 @@
|
||||
# include "shark_globals_zero.hpp"
|
||||
#endif
|
||||
|
||||
#define SHARK_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \
|
||||
#define SHARK_FLAGS(develop, develop_pd, product, product_pd, diagnostic, diagnostic_pd, notproduct) \
|
||||
\
|
||||
product(intx, MaxNodeLimit, 65000, \
|
||||
"Maximum number of nodes") \
|
||||
@ -69,6 +69,7 @@
|
||||
"Runs LLVM verify over LLVM IR") \
|
||||
|
||||
|
||||
SHARK_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
|
||||
SHARK_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_PD_DIAGNOSTIC_FLAG,
|
||||
DECLARE_NOTPRODUCT_FLAG)
|
||||
|
||||
#endif // SHARE_VM_SHARK_SHARK_GLOBALS_HPP
|
||||
|
||||
@ -366,3 +366,4 @@ ecbe72546137cd29cb73d4dcc81cc099e847d543 jdk-9+120
|
||||
a265b8116058c56179c321c38618570b780329be jdk-9+121
|
||||
f8899b1884e2c4a000dbcc5b1a80954245fe462e jdk-9+122
|
||||
3c19ab8742c196ac267b3d87e1d19ec3472c708d jdk-9+123
|
||||
e04a15153cc293f05fcd60bc98236f50e16af46a jdk-9+124
|
||||
|
||||
@ -369,3 +369,4 @@ ecd0d6a71c7ccf93584ba4dacdd4fa8455efd741 jdk-9+120
|
||||
fb771fa3a986ccfcb00d743b1956b98c380d1dd8 jdk-9+121
|
||||
342705d785ffd9e999991a3d4baae2eca58ea7c3 jdk-9+122
|
||||
c42decd28bbfa817347112ed6053b5fbd30517a2 jdk-9+123
|
||||
1600da1665cd2cc127014e8c002b328ec33a9147 jdk-9+124
|
||||
|
||||
@ -193,7 +193,7 @@ class ContextFinder {
|
||||
try {
|
||||
Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class, Map.class);
|
||||
// any failure in invoking this method would be considered fatal
|
||||
Object obj = instantiateProviderIfNecessary(m);
|
||||
Object obj = instantiateProviderIfNecessary(spFactory);
|
||||
context = m.invoke(obj, contextPath, classLoader, properties);
|
||||
} catch (NoSuchMethodException ignored) {
|
||||
// it's not an error for the provider not to have this method.
|
||||
@ -203,7 +203,7 @@ class ContextFinder {
|
||||
// try the old method that doesn't take properties. compatible with 1.0.
|
||||
// it is an error for an implementation not to have both forms of the createContext method.
|
||||
Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class);
|
||||
Object obj = instantiateProviderIfNecessary(m);
|
||||
Object obj = instantiateProviderIfNecessary(spFactory);
|
||||
// any failure in invoking this method would be considered fatal
|
||||
context = m.invoke(obj, contextPath, classLoader);
|
||||
}
|
||||
@ -228,20 +228,20 @@ class ContextFinder {
|
||||
}
|
||||
}
|
||||
|
||||
private static Object instantiateProviderIfNecessary(Method m) throws JAXBException {
|
||||
Class<?> declaringClass = m.getDeclaringClass();
|
||||
private static Object instantiateProviderIfNecessary(Class<?> implClass) throws JAXBException {
|
||||
try {
|
||||
if (JAXBContextFactory.class.isAssignableFrom(declaringClass)) {
|
||||
if (JAXBContextFactory.class.isAssignableFrom(implClass)) {
|
||||
return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
|
||||
@Override
|
||||
public Object run() throws Exception {
|
||||
return declaringClass.newInstance();
|
||||
return implClass.newInstance();
|
||||
}
|
||||
});
|
||||
}
|
||||
return null;
|
||||
} catch (PrivilegedActionException e) {
|
||||
throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, declaringClass, e), e);
|
||||
} catch (PrivilegedActionException x) {
|
||||
Throwable e = (x.getCause() == null) ? x : x.getCause();
|
||||
throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, implClass, e), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ class ContextFinder {
|
||||
try {
|
||||
|
||||
Method m = spFactory.getMethod("createContext", Class[].class, Map.class);
|
||||
Object obj = instantiateProviderIfNecessary(m);
|
||||
Object obj = instantiateProviderIfNecessary(spFactory);
|
||||
Object context = m.invoke(obj, classes, properties);
|
||||
if (!(context instanceof JAXBContext)) {
|
||||
// the cast would fail, so generate an exception with a nice message
|
||||
@ -392,7 +392,7 @@ class ContextFinder {
|
||||
|
||||
|
||||
/**
|
||||
* first factoryId should be the preffered one,
|
||||
* first factoryId should be the preferred one,
|
||||
* more of those can be provided to support backwards compatibility
|
||||
*/
|
||||
private static String classNameFromPackageProperties(ClassLoader classLoader,
|
||||
|
||||
@ -34,7 +34,11 @@ $(eval $(call SetupTextFileProcessing, BUILD_VERSION_JAVA, \
|
||||
@@LAUNCHER_NAME@@ => $(LAUNCHER_NAME) ; \
|
||||
@@RUNTIME_NAME@@ => $(RUNTIME_NAME) ; \
|
||||
@@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
|
||||
@@VERSION_STRING@@ => $(VERSION_STRING), \
|
||||
@@VERSION_STRING@@ => $(VERSION_STRING) ; \
|
||||
@@VERSION_NUMBER@@ => $(VERSION_NUMBER) ; \
|
||||
@@VERSION_PRE@@ => $(VERSION_PRE) ; \
|
||||
@@VERSION_BUILD@@ => $(VERSION_BUILD) ; \
|
||||
@@VERSION_OPT@@ => $(VERSION_OPT), \
|
||||
))
|
||||
|
||||
GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA)
|
||||
|
||||
@ -102,9 +102,13 @@ class ApplicationShutdownHooks {
|
||||
hook.start();
|
||||
}
|
||||
for (Thread hook : threads) {
|
||||
try {
|
||||
hook.join();
|
||||
} catch (InterruptedException x) { }
|
||||
while (true) {
|
||||
try {
|
||||
hook.join();
|
||||
break;
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,8 +27,6 @@ package java.lang;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigInteger;
|
||||
import java.util.AbstractList;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -36,11 +34,9 @@ import java.util.stream.Collectors;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.RandomAccess;
|
||||
import java.util.StringTokenizer;
|
||||
import jdk.internal.reflect.CallerSensitive;
|
||||
import jdk.internal.reflect.Reflection;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
/**
|
||||
* Every Java application has a single instance of class
|
||||
@ -941,8 +937,9 @@ public class Runtime {
|
||||
*/
|
||||
public static Version version() {
|
||||
if (version == null) {
|
||||
version = Version.parse(
|
||||
GetPropertyAction.privilegedGetProperty("java.runtime.version"));
|
||||
version = new Version(VersionProps.versionNumbers(),
|
||||
VersionProps.pre(), VersionProps.build(),
|
||||
VersionProps.optional());
|
||||
}
|
||||
return version;
|
||||
}
|
||||
@ -1084,86 +1081,12 @@ public class Runtime {
|
||||
private final Optional<Integer> build;
|
||||
private final Optional<String> optional;
|
||||
|
||||
|
||||
// $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)?
|
||||
// RE limits the format of version strings
|
||||
// ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))?
|
||||
|
||||
private static final String VNUM
|
||||
= "(?<VNUM>[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)";
|
||||
private static final String VNUM_GROUP = "VNUM";
|
||||
|
||||
private static final String PRE = "(?:-(?<PRE>[a-zA-Z0-9]+))?";
|
||||
private static final String PRE_GROUP = "PRE";
|
||||
|
||||
private static final String BUILD
|
||||
= "(?:(?<PLUS>\\+)(?<BUILD>0|[1-9][0-9]*)?)?";
|
||||
private static final String PLUS_GROUP = "PLUS";
|
||||
private static final String BUILD_GROUP = "BUILD";
|
||||
|
||||
private static final String OPT = "(?:-(?<OPT>[-a-zA-Z0-9.]+))?";
|
||||
private static final String OPT_GROUP = "OPT";
|
||||
|
||||
private static final String VSTR_FORMAT
|
||||
= "^" + VNUM + PRE + BUILD + OPT + "$";
|
||||
private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
|
||||
|
||||
/**
|
||||
* Constructs a valid <a href="verStr">version string</a> containing
|
||||
* a <a href="#verNum">version number</a> followed by pre-release and
|
||||
* build information.
|
||||
*
|
||||
* @param s
|
||||
* A string to be interpreted as a version
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the given string cannot be interpreted as a valid
|
||||
* version
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* If {@code s} is {@code null}
|
||||
*
|
||||
* @throws NumberFormatException
|
||||
* If an element of the version number or the build number
|
||||
* cannot be represented as an {@link Integer}
|
||||
*/
|
||||
private Version(String s) {
|
||||
if (s == null)
|
||||
throw new NullPointerException();
|
||||
|
||||
Matcher m = VSTR_PATTERN.matcher(s);
|
||||
if (!m.matches())
|
||||
throw new IllegalArgumentException("Invalid version string: '"
|
||||
+ s + "'");
|
||||
|
||||
// $VNUM is a dot-separated list of integers of arbitrary length
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for (String i : m.group(VNUM_GROUP).split("\\."))
|
||||
list.add(Integer.parseInt(i));
|
||||
version = Collections.unmodifiableList(list);
|
||||
|
||||
pre = Optional.ofNullable(m.group(PRE_GROUP));
|
||||
|
||||
String b = m.group(BUILD_GROUP);
|
||||
// $BUILD is an integer
|
||||
build = (b == null)
|
||||
? Optional.<Integer>empty()
|
||||
: Optional.ofNullable(Integer.parseInt(b));
|
||||
|
||||
optional = Optional.ofNullable(m.group(OPT_GROUP));
|
||||
|
||||
// empty '+'
|
||||
if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
|
||||
if (optional.isPresent()) {
|
||||
if (pre.isPresent())
|
||||
throw new IllegalArgumentException("'+' found with"
|
||||
+ " pre-release and optional components:'" + s
|
||||
+ "'");
|
||||
} else {
|
||||
throw new IllegalArgumentException("'+' found with neither"
|
||||
+ " build or optional components: '" + s + "'");
|
||||
}
|
||||
}
|
||||
Version(List<Integer> version, Optional<String> pre,
|
||||
Optional<Integer> build, Optional<String> optional) {
|
||||
this.version = Collections.unmodifiableList(version);
|
||||
this.pre = pre;
|
||||
this.build = build;
|
||||
this.optional = optional;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1189,7 +1112,7 @@ public class Runtime {
|
||||
* @return The Version of the given string
|
||||
*/
|
||||
public static Version parse(String s) {
|
||||
return new Version(s);
|
||||
return VersionBuilder.parse(s);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1518,4 +1441,86 @@ public class Runtime {
|
||||
}
|
||||
}
|
||||
|
||||
private static class VersionBuilder {
|
||||
// $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)?
|
||||
// RE limits the format of version strings
|
||||
// ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))?
|
||||
|
||||
private static final String VNUM
|
||||
= "(?<VNUM>[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)";
|
||||
private static final String VNUM_GROUP = "VNUM";
|
||||
|
||||
private static final String PRE = "(?:-(?<PRE>[a-zA-Z0-9]+))?";
|
||||
private static final String PRE_GROUP = "PRE";
|
||||
|
||||
private static final String BUILD
|
||||
= "(?:(?<PLUS>\\+)(?<BUILD>0|[1-9][0-9]*)?)?";
|
||||
private static final String PLUS_GROUP = "PLUS";
|
||||
private static final String BUILD_GROUP = "BUILD";
|
||||
|
||||
private static final String OPT = "(?:-(?<OPT>[-a-zA-Z0-9.]+))?";
|
||||
private static final String OPT_GROUP = "OPT";
|
||||
|
||||
private static final String VSTR_FORMAT
|
||||
= "^" + VNUM + PRE + BUILD + OPT + "$";
|
||||
private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
|
||||
|
||||
/**
|
||||
* Constructs a valid <a href="verStr">version string</a> containing
|
||||
* a <a href="#verNum">version number</a> followed by pre-release and
|
||||
* build information.
|
||||
*
|
||||
* @param s
|
||||
* A string to be interpreted as a version
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* If the given string cannot be interpreted as a valid
|
||||
* version
|
||||
*
|
||||
* @throws NullPointerException
|
||||
* If {@code s} is {@code null}
|
||||
*
|
||||
* @throws NumberFormatException
|
||||
* If an element of the version number or the build number
|
||||
* cannot be represented as an {@link Integer}
|
||||
*/
|
||||
static Version parse(String s) {
|
||||
if (s == null)
|
||||
throw new NullPointerException();
|
||||
|
||||
Matcher m = VSTR_PATTERN.matcher(s);
|
||||
if (!m.matches())
|
||||
throw new IllegalArgumentException("Invalid version string: '"
|
||||
+ s + "'");
|
||||
|
||||
// $VNUM is a dot-separated list of integers of arbitrary length
|
||||
List<Integer> version = new ArrayList<>();
|
||||
for (String i : m.group(VNUM_GROUP).split("\\."))
|
||||
version.add(Integer.parseInt(i));
|
||||
|
||||
Optional<String> pre = Optional.ofNullable(m.group(PRE_GROUP));
|
||||
|
||||
String b = m.group(BUILD_GROUP);
|
||||
// $BUILD is an integer
|
||||
Optional<Integer> build = (b == null)
|
||||
? Optional.empty()
|
||||
: Optional.of(Integer.parseInt(b));
|
||||
|
||||
Optional<String> optional = Optional.ofNullable(m.group(OPT_GROUP));
|
||||
|
||||
// empty '+'
|
||||
if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
|
||||
if (optional.isPresent()) {
|
||||
if (pre.isPresent())
|
||||
throw new IllegalArgumentException("'+' found with"
|
||||
+ " pre-release and optional components:'" + s
|
||||
+ "'");
|
||||
} else {
|
||||
throw new IllegalArgumentException("'+' found with neither"
|
||||
+ " build or optional components: '" + s + "'");
|
||||
}
|
||||
}
|
||||
return new Version(version, pre, build, optional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,8 +137,8 @@ final class StringLatin1 {
|
||||
char c1 = (char) CharacterDataLatin1.instance.toUpperCase(getChar(value, k));
|
||||
char c2 = (char) CharacterDataLatin1.instance.toUpperCase(getChar(other, k));
|
||||
if (c1 != c2) {
|
||||
c1 = (char) CharacterDataLatin1.instance.toLowerCase(c1);
|
||||
c2 = (char) CharacterDataLatin1.instance.toLowerCase(c2);
|
||||
c1 = Character.toLowerCase(c1);
|
||||
c2 = Character.toLowerCase(c2);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -259,17 +259,7 @@ final class StringUTF16 {
|
||||
|
||||
@HotSpotIntrinsicCandidate
|
||||
public static int compareToLatin1(byte[] value, byte[] other) {
|
||||
int len1 = length(value);
|
||||
int len2 = StringLatin1.length(other);
|
||||
int lim = Math.min(len1, len2);
|
||||
for (int k = 0; k < lim; k++) {
|
||||
char c1 = getChar(value, k);
|
||||
char c2 = StringLatin1.getChar(other, k);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
return len1 - len2;
|
||||
return -StringLatin1.compareToUTF16(other, value);
|
||||
}
|
||||
|
||||
public static int compareToCI(byte[] value, byte[] other) {
|
||||
@ -295,25 +285,7 @@ final class StringUTF16 {
|
||||
}
|
||||
|
||||
public static int compareToCI_Latin1(byte[] value, byte[] other) {
|
||||
int len1 = length(value);
|
||||
int len2 = StringLatin1.length(other);
|
||||
int lim = Math.min(len1, len2);
|
||||
for (int k = 0; k < lim; k++) {
|
||||
char c1 = getChar(value, k);
|
||||
char c2 = StringLatin1.getChar(other, k);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toUpperCase(c1);
|
||||
c2 = Character.toUpperCase(c2);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toLowerCase(c1);
|
||||
c2 = Character.toLowerCase(c2);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return len1 - len2;
|
||||
return -StringLatin1.compareToCI_UTF16(other, value);
|
||||
}
|
||||
|
||||
public static int hashCode(byte[] value) {
|
||||
@ -566,24 +538,7 @@ final class StringUTF16 {
|
||||
public static boolean regionMatchesCI_Latin1(byte[] value, int toffset,
|
||||
byte[] other, int ooffset,
|
||||
int len) {
|
||||
int last = toffset + len;
|
||||
while (toffset < last) {
|
||||
char c1 = getChar(value, toffset++);
|
||||
char c2 = (char)(other[ooffset++] & 0xff);
|
||||
if (c1 == c2) {
|
||||
continue;
|
||||
}
|
||||
char u1 = Character.toUpperCase(c1);
|
||||
char u2 = Character.toUpperCase(c2);
|
||||
if (u1 == u2) {
|
||||
continue;
|
||||
}
|
||||
if (Character.toLowerCase(u1) == Character.toLowerCase(u2)) {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return StringLatin1.regionMatchesCI_UTF16(other, ooffset, value, toffset, len);
|
||||
}
|
||||
|
||||
public static String toLowerCase(String str, byte[] value, Locale locale) {
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
package java.lang;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
class VersionProps {
|
||||
|
||||
@ -42,6 +45,18 @@ class VersionProps {
|
||||
private static final String java_runtime_version =
|
||||
"@@VERSION_STRING@@";
|
||||
|
||||
private static final String VERSION_NUMBER =
|
||||
"@@VERSION_NUMBER@@";
|
||||
|
||||
private static final String VERSION_BUILD =
|
||||
"@@VERSION_BUILD@@";
|
||||
|
||||
private static final String VERSION_PRE =
|
||||
"@@VERSION_PRE@@";
|
||||
|
||||
private static final String VERSION_OPT =
|
||||
"@@VERSION_OPT@@";
|
||||
|
||||
static {
|
||||
init();
|
||||
}
|
||||
@ -52,6 +67,44 @@ class VersionProps {
|
||||
System.setProperty("java.runtime.name", java_runtime_name);
|
||||
}
|
||||
|
||||
static List<Integer> versionNumbers() {
|
||||
List<Integer> versionNumbers = new ArrayList<>(4);
|
||||
int prevIndex = 0;
|
||||
int index = VERSION_NUMBER.indexOf('.');
|
||||
while (index > 0) {
|
||||
versionNumbers.add(
|
||||
Integer.parseInt(VERSION_NUMBER, prevIndex, index, 10));
|
||||
prevIndex = index + 1; // Skip the period
|
||||
index = VERSION_NUMBER.indexOf('.', prevIndex);
|
||||
}
|
||||
versionNumbers.add(Integer.parseInt(VERSION_NUMBER,
|
||||
prevIndex, VERSION_NUMBER.length(), 10));
|
||||
return versionNumbers;
|
||||
}
|
||||
|
||||
static Optional<String> pre() {
|
||||
return optionalOf(VERSION_PRE);
|
||||
}
|
||||
|
||||
static Optional<Integer> build() {
|
||||
return VERSION_BUILD.isEmpty() ?
|
||||
Optional.empty() :
|
||||
Optional.of(Integer.parseInt(VERSION_BUILD));
|
||||
}
|
||||
|
||||
static Optional<String> optional() {
|
||||
return optionalOf(VERSION_OPT);
|
||||
}
|
||||
|
||||
// Treat empty strings as value not being present
|
||||
private static Optional<String> optionalOf(String value) {
|
||||
if (!value.isEmpty()) {
|
||||
return Optional.of(value);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* In case you were wondering this method is called by java -version.
|
||||
* Sad that it prints to stderr; would be nicer if default printed on
|
||||
@ -111,4 +164,4 @@ class VersionProps {
|
||||
java_vm_info + ")");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1275,8 +1275,6 @@ public abstract class VarHandle {
|
||||
this.methodName = methodName;
|
||||
this.at = at;
|
||||
|
||||
// Assert method name is correctly derived from value name
|
||||
assert methodName.equals(toMethodName(name()));
|
||||
// Assert that return type is correct
|
||||
// Otherwise, when disabled avoid using reflection
|
||||
assert at.returnType == getReturnType(methodName);
|
||||
@ -1311,16 +1309,6 @@ public abstract class VarHandle {
|
||||
throw new IllegalArgumentException("No AccessMode value for method name " + methodName);
|
||||
}
|
||||
|
||||
private static String toMethodName(String name) {
|
||||
StringBuilder s = new StringBuilder(name.toLowerCase());
|
||||
int i;
|
||||
while ((i = s.indexOf("_")) != -1) {
|
||||
s.deleteCharAt(i);
|
||||
s.setCharAt(i, Character.toUpperCase(s.charAt(i)));
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private static Class<?> getReturnType(String name) {
|
||||
try {
|
||||
Method m = VarHandle.class.getMethod(name, Object[].class);
|
||||
|
||||
@ -295,13 +295,13 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
* @throws IllegalStateException if the zip file has been closed
|
||||
*/
|
||||
public ZipEntry getEntry(String name) {
|
||||
|
||||
Objects.requireNonNull(name, "name");
|
||||
synchronized (this) {
|
||||
ensureOpen();
|
||||
int pos = zsrc.getEntryPos(zc.getBytes(name), true);
|
||||
byte[] bname = zc.getBytes(name);
|
||||
int pos = zsrc.getEntryPos(bname, true);
|
||||
if (pos != -1) {
|
||||
return getZipEntry(name, pos);
|
||||
return getZipEntry(name, bname, pos);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -492,7 +492,7 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
// each "entry" has 3 ints in table entries
|
||||
return getZipEntry(null, zsrc.getEntryPos(i++ * 3));
|
||||
return getZipEntry(null, null, zsrc.getEntryPos(i++ * 3));
|
||||
}
|
||||
}
|
||||
|
||||
@ -527,13 +527,17 @@ class ZipFile implements ZipConstants, Closeable {
|
||||
}
|
||||
|
||||
/* Checks ensureOpen() before invoke this method */
|
||||
private ZipEntry getZipEntry(String name, int pos) {
|
||||
private ZipEntry getZipEntry(String name, byte[] bname, int pos) {
|
||||
byte[] cen = zsrc.cen;
|
||||
int nlen = CENNAM(cen, pos);
|
||||
int elen = CENEXT(cen, pos);
|
||||
int clen = CENCOM(cen, pos);
|
||||
int flag = CENFLG(cen, pos);
|
||||
if (name == null) {
|
||||
if (name == null || bname.length != nlen) {
|
||||
// to use the entry name stored in cen, if the passed in name is
|
||||
// (1) null, invoked from iterator, or
|
||||
// (2) not equal to the name stored, a slash is appended during
|
||||
// getEntryPos() search.
|
||||
if (!zc.isUTF8() && (flag & EFS) != 0) {
|
||||
name = zc.toStringUTF8(cen, pos + CENHDR, nlen);
|
||||
} else {
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
package jdk.internal.jrtfs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystemException;
|
||||
@ -138,6 +139,15 @@ class ExplodedImage extends SystemImage {
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long size() {
|
||||
try {
|
||||
return isDirectory() ? 0 : Files.size(path);
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -222,7 +222,8 @@ public class JarIndex {
|
||||
// Any files in META-INF/ will be indexed explicitly
|
||||
if (fileName.equals("META-INF/") ||
|
||||
fileName.equals(INDEX_NAME) ||
|
||||
fileName.equals(JarFile.MANIFEST_NAME))
|
||||
fileName.equals(JarFile.MANIFEST_NAME) ||
|
||||
fileName.startsWith("META-INF/versions/"))
|
||||
continue;
|
||||
|
||||
if (!metaInfFilenames || !fileName.startsWith("META-INF/")) {
|
||||
|
||||
@ -60,6 +60,9 @@ java.launcher.opt.footer =\ -cp <class search path of directories and zip
|
||||
\ limit the universe of observable modules\n\
|
||||
\ -listmods[:<modulename>[,<modulename>...]]\n\
|
||||
\ list the observable modules and exit\n\
|
||||
\ --dry-run create VM but do not execute main method.\n\
|
||||
\ This --dry-run option may be useful for validating the\n\
|
||||
\ command-line options such as the module system configuration.\n\
|
||||
\ -D<name>=<value>\n\
|
||||
\ set a system property\n\
|
||||
\ -verbose:[class|gc|jni]\n\
|
||||
|
||||
@ -68,6 +68,7 @@ static jboolean printVersion = JNI_FALSE; /* print and exit */
|
||||
static jboolean showVersion = JNI_FALSE; /* print but continue */
|
||||
static jboolean printUsage = JNI_FALSE; /* print and exit*/
|
||||
static jboolean printXUsage = JNI_FALSE; /* print and exit*/
|
||||
static jboolean dryRun = JNI_FALSE; /* initialize VM and exit */
|
||||
static char *showSettings = NULL; /* print but continue */
|
||||
static char *listModules = NULL;
|
||||
|
||||
@ -489,14 +490,18 @@ JavaMain(void * _args)
|
||||
mainArgs = CreateApplicationArgs(env, argv, argc);
|
||||
CHECK_EXCEPTION_NULL_LEAVE(mainArgs);
|
||||
|
||||
/* Invoke main method. */
|
||||
(*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
|
||||
if (dryRun) {
|
||||
ret = 0;
|
||||
} else {
|
||||
/* Invoke main method. */
|
||||
(*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
|
||||
|
||||
/*
|
||||
* The launcher's exit code (in the absence of calls to
|
||||
* System.exit) will be non-zero if main threw an exception.
|
||||
*/
|
||||
ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
|
||||
/*
|
||||
* The launcher's exit code (in the absence of calls to
|
||||
* System.exit) will be non-zero if main threw an exception.
|
||||
*/
|
||||
ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
|
||||
}
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
@ -1203,6 +1208,8 @@ ParseArguments(int *pargc, char ***pargv,
|
||||
return JNI_TRUE;
|
||||
} else if (JLI_StrCmp(arg, "-showversion") == 0) {
|
||||
showVersion = JNI_TRUE;
|
||||
} else if (JLI_StrCmp(arg, "--dry-run") == 0) {
|
||||
dryRun = JNI_TRUE;
|
||||
} else if (JLI_StrCmp(arg, "-X") == 0) {
|
||||
printXUsage = JNI_TRUE;
|
||||
return JNI_TRUE;
|
||||
|
||||
@ -155,6 +155,7 @@ static char* next_arg(char* cmdline, char* arg, jboolean* wildcard) {
|
||||
}
|
||||
}
|
||||
dest += copyCh(ch, dest);
|
||||
slashes = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -298,7 +298,7 @@ class Http2Connection implements BufferHandler {
|
||||
|
||||
ByteBuffer[] buffers = frame.getHeaderBlock();
|
||||
for (int i = 0; i < buffers.length; i++) {
|
||||
hpackIn.decode(buffers[i], endOfHeaders, decoder);
|
||||
hpackIn.decode(buffers[i], endOfHeaders && (i == buffers.length - 1), decoder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -128,6 +128,7 @@ class PlainHttpConnection extends HttpConnection implements AsyncConnection {
|
||||
this.chan = SocketChannel.open();
|
||||
int bufsize = client.getReceiveBufferSize();
|
||||
chan.setOption(StandardSocketOptions.SO_RCVBUF, bufsize);
|
||||
chan.setOption(StandardSocketOptions.TCP_NODELAY, true);
|
||||
} catch (IOException e) {
|
||||
throw new InternalError(e);
|
||||
}
|
||||
|
||||
@ -78,6 +78,7 @@ final class StringReader {
|
||||
if (isLast) {
|
||||
input.limit(input.position() + remainingLength);
|
||||
}
|
||||
remainingLength -= Math.min(input.remaining(), remainingLength);
|
||||
if (huffman) {
|
||||
huffmanReader.read(input, output, isLast);
|
||||
} else {
|
||||
@ -85,6 +86,7 @@ final class StringReader {
|
||||
}
|
||||
if (isLast) {
|
||||
input.limit(oldLimit);
|
||||
state = DONE;
|
||||
}
|
||||
return isLast;
|
||||
}
|
||||
|
||||
@ -94,6 +94,9 @@ import java.util.Set;
|
||||
* <li> <handler-name>.append
|
||||
* specifies whether the FileHandler should append onto
|
||||
* any existing files (defaults to false). </li>
|
||||
* <li> <handler-name>.maxLocks
|
||||
* specifies the maximum number of concurrent locks held by
|
||||
* FileHandler (defaults to 100). </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* For example, the properties for {@code FileHandler} would be:
|
||||
@ -157,6 +160,7 @@ public class FileHandler extends StreamHandler {
|
||||
private FileChannel lockFileChannel;
|
||||
private File files[];
|
||||
private static final int MAX_LOCKS = 100;
|
||||
private int maxLocks = MAX_LOCKS;
|
||||
private static final Set<String> locks = new HashSet<>();
|
||||
|
||||
/**
|
||||
@ -235,6 +239,12 @@ public class FileHandler extends StreamHandler {
|
||||
setLevel(manager.getLevelProperty(cname + ".level", Level.ALL));
|
||||
setFilter(manager.getFilterProperty(cname + ".filter", null));
|
||||
setFormatter(manager.getFormatterProperty(cname + ".formatter", new XMLFormatter()));
|
||||
// Initialize maxLocks from the logging.properties file.
|
||||
// If invalid/no property is provided 100 will be used as a default value.
|
||||
maxLocks = manager.getIntProperty(cname + ".maxLocks", MAX_LOCKS);
|
||||
if(maxLocks <= 0) {
|
||||
maxLocks = MAX_LOCKS;
|
||||
}
|
||||
try {
|
||||
setEncoding(manager.getStringProperty(cname +".encoding", null));
|
||||
} catch (Exception ex) {
|
||||
@ -476,7 +486,7 @@ public class FileHandler extends StreamHandler {
|
||||
int unique = -1;
|
||||
for (;;) {
|
||||
unique++;
|
||||
if (unique > MAX_LOCKS) {
|
||||
if (unique > maxLocks) {
|
||||
throw new IOException("Couldn't get lock for " + pattern);
|
||||
}
|
||||
// Generate a lock file name from the "unique" int.
|
||||
|
||||
@ -37,6 +37,10 @@ handlers= java.util.logging.ConsoleHandler
|
||||
java.util.logging.FileHandler.pattern = %h/java%u.log
|
||||
java.util.logging.FileHandler.limit = 50000
|
||||
java.util.logging.FileHandler.count = 1
|
||||
# Default number of locks FileHandler can obtain synchronously.
|
||||
# This specifies maximum number of attempts to obtain lock file by FileHandler
|
||||
# implemented by incrementing the unique field %u as per FileHandler API documentation.
|
||||
java.util.logging.FileHandler.maxLocks = 100
|
||||
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
|
||||
|
||||
# Limit the message that are printed on the console to INFO and above.
|
||||
|
||||
@ -48,6 +48,7 @@ import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.*;
|
||||
import java.util.jar.*;
|
||||
import java.util.jar.Pack200.*;
|
||||
@ -77,24 +78,82 @@ class Main {
|
||||
PrintStream out, err;
|
||||
String fname, mname, ename;
|
||||
String zname = "";
|
||||
String[] files;
|
||||
String rootjar = null;
|
||||
|
||||
// An entryName(path)->File map generated during "expand", it helps to
|
||||
private static final int BASE_VERSION = 0;
|
||||
|
||||
class Entry {
|
||||
final String basename;
|
||||
final String entryname;
|
||||
final File file;
|
||||
final boolean isDir;
|
||||
|
||||
Entry(int version, File file) {
|
||||
this.file = file;
|
||||
String path = file.getPath();
|
||||
if (file.isDirectory()) {
|
||||
isDir = true;
|
||||
path = path.endsWith(File.separator) ? path :
|
||||
path + File.separator;
|
||||
} else {
|
||||
isDir = false;
|
||||
}
|
||||
EntryName en = new EntryName(path, version);
|
||||
basename = en.baseName;
|
||||
entryname = en.entryName;
|
||||
}
|
||||
}
|
||||
|
||||
class EntryName {
|
||||
final String baseName;
|
||||
final String entryName;
|
||||
|
||||
EntryName(String name, int version) {
|
||||
name = name.replace(File.separatorChar, '/');
|
||||
String matchPath = "";
|
||||
for (String path : pathsMap.get(version)) {
|
||||
if (name.startsWith(path)
|
||||
&& (path.length() > matchPath.length())) {
|
||||
matchPath = path;
|
||||
}
|
||||
}
|
||||
name = safeName(name.substring(matchPath.length()));
|
||||
// the old implementaton doesn't remove
|
||||
// "./" if it was led by "/" (?)
|
||||
if (name.startsWith("./")) {
|
||||
name = name.substring(2);
|
||||
}
|
||||
this.baseName = name;
|
||||
this.entryName = (version > BASE_VERSION)
|
||||
? VERSIONS_DIR + version + "/" + this.baseName
|
||||
: this.baseName;
|
||||
}
|
||||
}
|
||||
|
||||
// An entryName(path)->Entry map generated during "expand", it helps to
|
||||
// decide whether or not an existing entry in a jar file needs to be
|
||||
// replaced, during the "update" operation.
|
||||
Map<String, File> entryMap = new HashMap<String, File>();
|
||||
Map<String, Entry> entryMap = new HashMap<>();
|
||||
|
||||
// All entries need to be added/updated.
|
||||
Map<String, Entry> entries = new LinkedHashMap<>();
|
||||
|
||||
// All files need to be added/updated.
|
||||
Set<File> entries = new LinkedHashSet<File>();
|
||||
// All packages.
|
||||
Set<String> packages = new HashSet<>();
|
||||
// All actual entries added, or existing, in the jar file ( excl manifest
|
||||
// and module-info.class ). Populated during create or update.
|
||||
Set<String> jarEntries = new HashSet<>();
|
||||
|
||||
// Directories specified by "-C" operation.
|
||||
Set<String> paths = new HashSet<String>();
|
||||
// A paths Set for each version, where each Set contains directories
|
||||
// specified by the "-C" operation.
|
||||
Map<Integer,Set<String>> pathsMap = new HashMap<>();
|
||||
|
||||
// There's also a files array per version
|
||||
Map<Integer,String[]> filesMap = new HashMap<>();
|
||||
|
||||
// Do we think this is a multi-release jar? Set to true
|
||||
// if --release option found followed by at least file
|
||||
boolean isMultiRelease;
|
||||
|
||||
/*
|
||||
* cflag: create
|
||||
@ -241,10 +300,15 @@ class Main {
|
||||
if (ename != null) {
|
||||
addMainClass(manifest, ename);
|
||||
}
|
||||
if (isMultiRelease) {
|
||||
addMultiRelease(manifest);
|
||||
}
|
||||
}
|
||||
Map<String,Path> moduleInfoPaths = new HashMap<>();
|
||||
expand(null, files, false, moduleInfoPaths);
|
||||
|
||||
for (int version : filesMap.keySet()) {
|
||||
String[] files = filesMap.get(version);
|
||||
expand(null, files, false, moduleInfoPaths, version);
|
||||
}
|
||||
Map<String,byte[]> moduleInfos = new LinkedHashMap<>();
|
||||
if (!moduleInfoPaths.isEmpty()) {
|
||||
if (!checkModuleInfos(moduleInfoPaths))
|
||||
@ -348,7 +412,10 @@ class Main {
|
||||
(new FileInputStream(mname)) : null;
|
||||
|
||||
Map<String,Path> moduleInfoPaths = new HashMap<>();
|
||||
expand(null, files, true, moduleInfoPaths);
|
||||
for (int version : filesMap.keySet()) {
|
||||
String[] files = filesMap.get(version);
|
||||
expand(null, files, true, moduleInfoPaths, version);
|
||||
}
|
||||
|
||||
Map<String,byte[]> moduleInfos = new HashMap<>();
|
||||
for (Map.Entry<String,Path> e : moduleInfoPaths.entrySet())
|
||||
@ -381,10 +448,11 @@ class Main {
|
||||
tmpFile.delete();
|
||||
}
|
||||
} else if (tflag) {
|
||||
replaceFSC(files);
|
||||
replaceFSC(filesMap);
|
||||
// For the "list table contents" action, access using the
|
||||
// ZipFile class is always most efficient since only a
|
||||
// "one-finger" scan through the central directory is required.
|
||||
String[] files = filesMapToFiles(filesMap);
|
||||
if (fname != null) {
|
||||
list(fname, files);
|
||||
} else {
|
||||
@ -396,7 +464,7 @@ class Main {
|
||||
}
|
||||
}
|
||||
} else if (xflag) {
|
||||
replaceFSC(files);
|
||||
replaceFSC(filesMap);
|
||||
// For the extract action, when extracting all the entries,
|
||||
// access using the ZipInputStream class is most efficient,
|
||||
// since only a single sequential scan through the zip file is
|
||||
@ -406,6 +474,8 @@ class Main {
|
||||
// "leading garbage", we fall back from the ZipInputStream
|
||||
// implementation to the ZipFile implementation, since only the
|
||||
// latter can handle it.
|
||||
|
||||
String[] files = filesMapToFiles(filesMap);
|
||||
if (fname != null && files != null) {
|
||||
extract(fname, files);
|
||||
} else {
|
||||
@ -421,6 +491,7 @@ class Main {
|
||||
}
|
||||
}
|
||||
} else if (iflag) {
|
||||
String[] files = filesMap.get(BASE_VERSION); // base entries only, can be null
|
||||
genIndex(rootjar, files);
|
||||
} else if (printModuleDescriptor) {
|
||||
boolean found;
|
||||
@ -449,6 +520,20 @@ class Main {
|
||||
return ok;
|
||||
}
|
||||
|
||||
private String[] filesMapToFiles(Map<Integer,String[]> filesMap) {
|
||||
if (filesMap.isEmpty()) return null;
|
||||
return filesMap.entrySet()
|
||||
.stream()
|
||||
.flatMap(this::filesToEntryNames)
|
||||
.toArray(String[]::new);
|
||||
}
|
||||
|
||||
Stream<String> filesToEntryNames(Map.Entry<Integer,String[]> fileEntries) {
|
||||
int version = fileEntries.getKey();
|
||||
return Stream.of(fileEntries.getValue())
|
||||
.map(f -> (new EntryName(f, version)).entryName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses command line arguments.
|
||||
*/
|
||||
@ -579,8 +664,10 @@ class Main {
|
||||
/* parse file arguments */
|
||||
int n = args.length - count;
|
||||
if (n > 0) {
|
||||
int version = BASE_VERSION;
|
||||
int k = 0;
|
||||
String[] nameBuf = new String[n];
|
||||
pathsMap.put(version, new HashSet<>());
|
||||
try {
|
||||
for (int i = count; i < args.length; i++) {
|
||||
if (args[i].equals("-C")) {
|
||||
@ -592,8 +679,33 @@ class Main {
|
||||
while (dir.indexOf("//") > -1) {
|
||||
dir = dir.replace("//", "/");
|
||||
}
|
||||
paths.add(dir.replace(File.separatorChar, '/'));
|
||||
pathsMap.get(version).add(dir.replace(File.separatorChar, '/'));
|
||||
nameBuf[k++] = dir + args[++i];
|
||||
} else if (args[i].startsWith("--release")) {
|
||||
int v = BASE_VERSION;
|
||||
try {
|
||||
v = Integer.valueOf(args[++i]);
|
||||
} catch (NumberFormatException x) {
|
||||
error(formatMsg("error.release.value.notnumber", args[i]));
|
||||
// this will fall into the next error, thus returning false
|
||||
}
|
||||
if (v < 9) {
|
||||
error(formatMsg("error.release.value.toosmall", String.valueOf(v)));
|
||||
usageError();
|
||||
return false;
|
||||
}
|
||||
// associate the files, if any, with the previous version number
|
||||
if (k > 0) {
|
||||
String[] files = new String[k];
|
||||
System.arraycopy(nameBuf, 0, files, 0, k);
|
||||
filesMap.put(version, files);
|
||||
isMultiRelease = version > BASE_VERSION;
|
||||
}
|
||||
// reset the counters and start with the new version number
|
||||
k = 0;
|
||||
nameBuf = new String[n];
|
||||
version = v;
|
||||
pathsMap.put(version, new HashSet<>());
|
||||
} else {
|
||||
nameBuf[k++] = args[i];
|
||||
}
|
||||
@ -602,8 +714,13 @@ class Main {
|
||||
usageError();
|
||||
return false;
|
||||
}
|
||||
files = new String[k];
|
||||
System.arraycopy(nameBuf, 0, files, 0, k);
|
||||
// associate remaining files, if any, with a version
|
||||
if (k > 0) {
|
||||
String[] files = new String[k];
|
||||
System.arraycopy(nameBuf, 0, files, 0, k);
|
||||
filesMap.put(version, files);
|
||||
isMultiRelease = version > BASE_VERSION;
|
||||
}
|
||||
} else if (cflag && (mname == null)) {
|
||||
error(getMsg("error.bad.cflag"));
|
||||
usageError();
|
||||
@ -651,7 +768,8 @@ class Main {
|
||||
void expand(File dir,
|
||||
String[] files,
|
||||
boolean isUpdate,
|
||||
Map<String,Path> moduleInfoPaths)
|
||||
Map<String,Path> moduleInfoPaths,
|
||||
int version)
|
||||
throws IOException
|
||||
{
|
||||
if (files == null)
|
||||
@ -664,29 +782,29 @@ class Main {
|
||||
else
|
||||
f = new File(dir, files[i]);
|
||||
|
||||
Entry entry = new Entry(version, f);
|
||||
String entryName = entry.entryname;
|
||||
|
||||
if (f.isFile()) {
|
||||
String path = f.getPath();
|
||||
String entryName = entryName(path);
|
||||
if (entryName.endsWith(MODULE_INFO)) {
|
||||
moduleInfoPaths.put(entryName, f.toPath());
|
||||
if (isUpdate)
|
||||
entryMap.put(entryName, f);
|
||||
} else if (entries.add(f)) {
|
||||
entryMap.put(entryName, entry);
|
||||
} else if (!entries.containsKey(entryName)) {
|
||||
entries.put(entryName, entry);
|
||||
jarEntries.add(entryName);
|
||||
if (path.endsWith(".class") && !entryName.startsWith(VERSIONS_DIR))
|
||||
packages.add(toPackageName(entryName));
|
||||
if (entry.basename.endsWith(".class") && !entryName.startsWith(VERSIONS_DIR))
|
||||
packages.add(toPackageName(entry.basename));
|
||||
if (isUpdate)
|
||||
entryMap.put(entryName, f);
|
||||
entryMap.put(entryName, entry);
|
||||
}
|
||||
} else if (f.isDirectory()) {
|
||||
if (entries.add(f)) {
|
||||
if (!entries.containsKey(entryName)) {
|
||||
entries.put(entryName, entry);
|
||||
if (isUpdate) {
|
||||
String dirPath = f.getPath();
|
||||
dirPath = (dirPath.endsWith(File.separator)) ? dirPath :
|
||||
(dirPath + File.separator);
|
||||
entryMap.put(entryName(dirPath), f);
|
||||
entryMap.put(entryName, entry);
|
||||
}
|
||||
expand(f, f.list(), isUpdate, moduleInfoPaths);
|
||||
expand(f, f.list(), isUpdate, moduleInfoPaths, version);
|
||||
}
|
||||
} else {
|
||||
error(formatMsg("error.nosuch.fileordir", String.valueOf(f)));
|
||||
@ -740,8 +858,9 @@ class Main {
|
||||
in.transferTo(zos);
|
||||
zos.closeEntry();
|
||||
}
|
||||
for (File file: entries) {
|
||||
addFile(zos, file);
|
||||
for (String entryname : entries.keySet()) {
|
||||
Entry entry = entries.get(entryname);
|
||||
addFile(zos, entry);
|
||||
}
|
||||
zos.close();
|
||||
}
|
||||
@ -823,7 +942,7 @@ class Main {
|
||||
|| (Mflag && isManifestEntry)) {
|
||||
continue;
|
||||
} else if (isManifestEntry && ((newManifest != null) ||
|
||||
(ename != null))) {
|
||||
(ename != null) || isMultiRelease)) {
|
||||
foundManifest = true;
|
||||
if (newManifest != null) {
|
||||
// Don't read from the newManifest InputStream, as we
|
||||
@ -862,21 +981,21 @@ class Main {
|
||||
zos.putNextEntry(e2);
|
||||
copy(zis, zos);
|
||||
} else { // replace with the new files
|
||||
File f = entryMap.get(name);
|
||||
addFile(zos, f);
|
||||
Entry ent = entryMap.get(name);
|
||||
addFile(zos, ent);
|
||||
entryMap.remove(name);
|
||||
entries.remove(f);
|
||||
entries.remove(name);
|
||||
}
|
||||
|
||||
jarEntries.add(name);
|
||||
if (name.endsWith(".class"))
|
||||
if (name.endsWith(".class") && !(name.startsWith(VERSIONS_DIR)))
|
||||
packages.add(toPackageName(name));
|
||||
}
|
||||
}
|
||||
|
||||
// add the remaining new files
|
||||
for (File f: entries) {
|
||||
addFile(zos, f);
|
||||
for (String entryname : entries.keySet()) {
|
||||
addFile(zos, entries.get(entryname));
|
||||
}
|
||||
if (!foundManifest) {
|
||||
if (newManifest != null) {
|
||||
@ -961,6 +1080,9 @@ class Main {
|
||||
if (ename != null) {
|
||||
addMainClass(m, ename);
|
||||
}
|
||||
if (isMultiRelease) {
|
||||
addMultiRelease(m);
|
||||
}
|
||||
ZipEntry e = new ZipEntry(MANIFEST_NAME);
|
||||
e.setTime(System.currentTimeMillis());
|
||||
if (flag0) {
|
||||
@ -1016,24 +1138,6 @@ class Main {
|
||||
return name;
|
||||
}
|
||||
|
||||
private String entryName(String name) {
|
||||
name = name.replace(File.separatorChar, '/');
|
||||
String matchPath = "";
|
||||
for (String path : paths) {
|
||||
if (name.startsWith(path)
|
||||
&& (path.length() > matchPath.length())) {
|
||||
matchPath = path;
|
||||
}
|
||||
}
|
||||
name = safeName(name.substring(matchPath.length()));
|
||||
// the old implementaton doesn't remove
|
||||
// "./" if it was led by "/" (?)
|
||||
if (name.startsWith("./")) {
|
||||
name = name.substring(2);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
private void addVersion(Manifest m) {
|
||||
Attributes global = m.getMainAttributes();
|
||||
if (global.getValue(Attributes.Name.MANIFEST_VERSION) == null) {
|
||||
@ -1058,6 +1162,11 @@ class Main {
|
||||
global.put(Attributes.Name.MAIN_CLASS, mainApp);
|
||||
}
|
||||
|
||||
private void addMultiRelease(Manifest m) {
|
||||
Attributes global = m.getMainAttributes();
|
||||
global.put(Attributes.Name.MULTI_RELEASE, "true");
|
||||
}
|
||||
|
||||
private boolean isAmbiguousMainClass(Manifest m) {
|
||||
if (ename != null) {
|
||||
Attributes global = m.getMainAttributes();
|
||||
@ -1073,14 +1182,10 @@ class Main {
|
||||
/**
|
||||
* Adds a new file entry to the ZIP output stream.
|
||||
*/
|
||||
void addFile(ZipOutputStream zos, File file) throws IOException {
|
||||
String name = file.getPath();
|
||||
boolean isDir = file.isDirectory();
|
||||
if (isDir) {
|
||||
name = name.endsWith(File.separator) ? name :
|
||||
(name + File.separator);
|
||||
}
|
||||
name = entryName(name);
|
||||
void addFile(ZipOutputStream zos, Entry entry) throws IOException {
|
||||
File file = entry.file;
|
||||
String name = entry.entryname;
|
||||
boolean isDir = entry.isDir;
|
||||
|
||||
if (name.equals("") || name.equals(".") || name.equals(zname)) {
|
||||
return;
|
||||
@ -1221,12 +1326,15 @@ class Main {
|
||||
os.updateEntry(e);
|
||||
}
|
||||
|
||||
void replaceFSC(String files[]) {
|
||||
if (files != null) {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
files[i] = files[i].replace(File.separatorChar, '/');
|
||||
void replaceFSC(Map<Integer, String []> filesMap) {
|
||||
filesMap.keySet().forEach(version -> {
|
||||
String[] files = filesMap.get(version);
|
||||
if (files != null) {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
files[i] = files[i].replace(File.separatorChar, '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ -1566,7 +1674,7 @@ class Main {
|
||||
/**
|
||||
* Print an error message; like something is broken
|
||||
*/
|
||||
protected void error(String s) {
|
||||
void error(String s) {
|
||||
err.println(s);
|
||||
}
|
||||
|
||||
|
||||
@ -63,24 +63,28 @@ error.unexpected.module-info=\
|
||||
error.module.descriptor.not.found=\
|
||||
Module descriptor not found
|
||||
error.versioned.info.without.root=\
|
||||
module-info.class found in versioned section without module-info.class \
|
||||
module-info.class found in a versioned directory without module-info.class \
|
||||
in the root
|
||||
error.versioned.info.name.notequal=\
|
||||
module-info.class in versioned section contains incorrect name
|
||||
module-info.class in a versioned directory contains incorrect name
|
||||
error.versioned.info.requires.public=\
|
||||
module-info.class in versioned section contains additional requires public
|
||||
module-info.class in a versioned directory contains additional requires public
|
||||
error.versioned.info.requires.added=\
|
||||
module-info.class in versioned section contains additional requires
|
||||
module-info.class in a versioned directory contains additional requires
|
||||
error.versioned.info.requires.dropped=\
|
||||
module-info.class in versioned section contains missing requires
|
||||
module-info.class in a versioned directory contains missing requires
|
||||
error.versioned.info.exports.notequal=\
|
||||
module-info.class in versioned section contains different exports
|
||||
module-info.class in a versioned directory contains different exports
|
||||
error.versioned.info.provides.notequal=\
|
||||
module-info.class in versioned section contains different provides
|
||||
module-info.class in a versioned directory contains different provides
|
||||
error.invalid.versioned.module.attribute=\
|
||||
Invalid module descriptor attribute {0}
|
||||
error.missing.provider=\
|
||||
Service provider not found: {0}
|
||||
error.release.value.notnumber=\
|
||||
release {0} not valid
|
||||
error.release.value.toosmall=\
|
||||
release {0} not valid, must be >= 9
|
||||
out.added.manifest=\
|
||||
added manifest
|
||||
out.added.module-info=\
|
||||
@ -109,7 +113,7 @@ out.size=\
|
||||
usage.compat=\
|
||||
\Compatibility Interface:\
|
||||
\n\
|
||||
Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\
|
||||
Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files] ...\n\
|
||||
Options:\n\
|
||||
\ \ -c create new archive\n\
|
||||
\ \ -t list table of contents for archive\n\
|
||||
@ -141,7 +145,7 @@ main.usage.summary.try=\
|
||||
Try `jar --help' for more information.
|
||||
|
||||
main.help.preopt=\
|
||||
Usage: jar [OPTION...] [-C dir] files ...\n\
|
||||
Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...\n\
|
||||
jar creates an archive for classes and resources, and can manipulate or\n\
|
||||
restore individual classes or resources from an archive.\n\
|
||||
\n\
|
||||
@ -156,7 +160,9 @@ restore individual classes or resources from an archive.\n\
|
||||
\ -C foo/ classes resources\n\
|
||||
\ # Update an existing non-modular jar to a modular jar:\n\
|
||||
\ jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0\n\
|
||||
\ -C foo/ module-info.class
|
||||
\ -C foo/ module-info.class\n\
|
||||
\ # Create a multi-release jar, placing some files in the META-INF/versions/9 directory:\n\
|
||||
\ jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes
|
||||
main.help.opt.main=\
|
||||
\ Main operation mode:\n
|
||||
main.help.opt.main.create=\
|
||||
@ -178,7 +184,9 @@ main.help.opt.any=\
|
||||
\ -C DIR Change to the specified directory and include the\n\
|
||||
\ following file
|
||||
main.help.opt.any.file=\
|
||||
\ -f, --file=FILE The archive file name
|
||||
\ -f, --file=FILE The archive file name\n\
|
||||
\ --release VERSION Places all following files in a versioned directory\n\
|
||||
\ of the jar (i.e. META-INF/versions/VERSION/)
|
||||
main.help.opt.any.verbose=\
|
||||
\ -v, --verbose Generate verbose output on standard output
|
||||
main.help.opt.create.update=\
|
||||
|
||||
@ -54,8 +54,8 @@ class JImageTask {
|
||||
}, "--dir"),
|
||||
|
||||
new Option<JImageTask>(true, (task, option, arg) -> {
|
||||
task.options.filters = arg;
|
||||
}, "--filter"),
|
||||
task.options.include = arg;
|
||||
}, "--include"),
|
||||
|
||||
new Option<JImageTask>(false, (task, option, arg) -> {
|
||||
task.options.fullVersion = true;
|
||||
@ -81,12 +81,12 @@ class JImageTask {
|
||||
private static final FileSystem JRT_FILE_SYSTEM = Utils.jrtFileSystem();
|
||||
|
||||
private final OptionsValues options;
|
||||
private final List<Predicate<String>> filterPredicates;
|
||||
private final List<Predicate<String>> includePredicates;
|
||||
private PrintWriter log;
|
||||
|
||||
JImageTask() {
|
||||
this.options = new OptionsValues();
|
||||
this.filterPredicates = new ArrayList<>();
|
||||
this.includePredicates = new ArrayList<>();
|
||||
log = null;
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ class JImageTask {
|
||||
static class OptionsValues {
|
||||
Task task = Task.LIST;
|
||||
String directory = ".";
|
||||
String filters = "";
|
||||
String include = "";
|
||||
boolean fullVersion;
|
||||
boolean help;
|
||||
boolean verbose;
|
||||
@ -200,6 +200,8 @@ class JImageTask {
|
||||
|
||||
log.println(TASK_HELPER.getMessage("main.opt." + name));
|
||||
}
|
||||
|
||||
log.println(TASK_HELPER.getMessage("main.opt.footer"));
|
||||
} else {
|
||||
try {
|
||||
log.println(TASK_HELPER.getMessage("main.usage." +
|
||||
@ -219,7 +221,7 @@ class JImageTask {
|
||||
}
|
||||
}
|
||||
|
||||
processFilter(options.filters);
|
||||
processInclude(options.include);
|
||||
|
||||
return run() ? EXIT_OK : EXIT_ERROR;
|
||||
} catch (BadArgs e) {
|
||||
@ -239,15 +241,15 @@ class JImageTask {
|
||||
}
|
||||
}
|
||||
|
||||
private void processFilter(String filters) {
|
||||
if (filters.isEmpty()) {
|
||||
private void processInclude(String include) {
|
||||
if (include.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (String filter : filters.split(",")) {
|
||||
for (String filter : include.split(",")) {
|
||||
final PathMatcher matcher = Utils.getPathMatcher(JRT_FILE_SYSTEM, filter);
|
||||
Predicate<String> predicate = (path) -> matcher.matches(JRT_FILE_SYSTEM.getPath(path));
|
||||
filterPredicates.add(predicate);
|
||||
includePredicates.add(predicate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,9 +390,9 @@ class JImageTask {
|
||||
String oldModule = "";
|
||||
|
||||
for (String name : entryNames) {
|
||||
boolean match = filterPredicates.isEmpty();
|
||||
boolean match = includePredicates.isEmpty();
|
||||
|
||||
for (Predicate<String> predicate : filterPredicates) {
|
||||
for (Predicate<String> predicate : includePredicates) {
|
||||
if (predicate.test(name)) {
|
||||
match = true;
|
||||
break;
|
||||
|
||||
@ -62,9 +62,19 @@ warn.prefix=Warning:
|
||||
main.opt.dir=\
|
||||
\ --dir Target directory for extract directive
|
||||
|
||||
main.opt.filter=\
|
||||
\ --filter Filter entries for list or extract\n\
|
||||
\ Ex. /java.base/*, */module-info.class
|
||||
main.opt.include=\
|
||||
\ --include <pattern-list> Pattern list for filtering list or extract entries.
|
||||
|
||||
main.opt.footer=\
|
||||
\n\
|
||||
\For options requiring a <pattern-list>, the value will be a comma\
|
||||
\ separated list of elements each using one the following forms:\n\
|
||||
\ <glob-pattern>\n\
|
||||
\ glob:<glob-pattern>\n\
|
||||
\ regex:<regex-pattern>\n\
|
||||
\ @<filename> where filename is the name of a file containing patterns to be\
|
||||
\ used, one pattern per line\n\
|
||||
|
||||
|
||||
main.opt.fullversion=\
|
||||
\ --fullversion Print full version information
|
||||
|
||||
@ -25,9 +25,6 @@
|
||||
|
||||
package jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
|
||||
@ -44,116 +41,50 @@ import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
* {@literal bin|conf|native}/{dir1}>/.../{dirN}/{file name}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class ModuleEntryImpl implements ModuleEntry {
|
||||
|
||||
private final Type type;
|
||||
abstract class AbstractModuleEntry implements ModuleEntry {
|
||||
private final String path;
|
||||
private final String module;
|
||||
private final long length;
|
||||
private final InputStream stream;
|
||||
private byte[] buffer;
|
||||
private final Type type;
|
||||
|
||||
/**
|
||||
* Create a new LinkModuleEntry.
|
||||
* Create a new AbstractModuleEntry.
|
||||
*
|
||||
* @param module The module name.
|
||||
* @param path The data path identifier.
|
||||
* @param type The data type.
|
||||
* @param stream The data content stream.
|
||||
* @param length The stream length.
|
||||
*/
|
||||
public ModuleEntryImpl(String module, String path, Type type, InputStream stream, long length) {
|
||||
Objects.requireNonNull(module);
|
||||
Objects.requireNonNull(path);
|
||||
Objects.requireNonNull(type);
|
||||
Objects.requireNonNull(stream);
|
||||
this.path = path;
|
||||
this.type = type;
|
||||
this.module = module;
|
||||
this.stream = stream;
|
||||
this.length = length;
|
||||
AbstractModuleEntry(String module, String path, Type type) {
|
||||
this.module = Objects.requireNonNull(module);
|
||||
this.path = Objects.requireNonNull(path);
|
||||
this.type = Objects.requireNonNull(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry module name.
|
||||
*
|
||||
* @return The module name.
|
||||
*/
|
||||
@Override
|
||||
public final String getModule() {
|
||||
return module;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry path.
|
||||
*
|
||||
* @return The module path.
|
||||
*/
|
||||
@Override
|
||||
public final String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry's type.
|
||||
*
|
||||
* @return The data type.
|
||||
*/
|
||||
@Override
|
||||
public final Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry content as an array of byte.
|
||||
*
|
||||
* @return An Array of bytes.
|
||||
*/
|
||||
@Override
|
||||
public byte[] getBytes() {
|
||||
if (buffer == null) {
|
||||
try (InputStream is = stream) {
|
||||
buffer = is.readAllBytes();
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry content length.
|
||||
*
|
||||
* @return The length.
|
||||
*/
|
||||
@Override
|
||||
public long getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry stream.
|
||||
*
|
||||
* @return The module data stream.
|
||||
*/
|
||||
@Override
|
||||
public InputStream stream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + Objects.hashCode(this.path);
|
||||
return hash;
|
||||
return Objects.hashCode(this.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (!(other instanceof ModuleEntryImpl)) {
|
||||
if (!(other instanceof AbstractModuleEntry)) {
|
||||
return false;
|
||||
}
|
||||
ModuleEntryImpl f = (ModuleEntryImpl) other;
|
||||
AbstractModuleEntry f = (AbstractModuleEntry) other;
|
||||
return f.path.equals(path);
|
||||
}
|
||||
|
||||
@ -161,4 +92,4 @@ public class ModuleEntryImpl implements ModuleEntry {
|
||||
public String toString() {
|
||||
return getPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,6 @@ public interface Archive {
|
||||
public abstract class Entry {
|
||||
|
||||
public static enum EntryType {
|
||||
|
||||
MODULE_NAME,
|
||||
CLASS_OR_RESOURCE,
|
||||
NATIVE_LIB,
|
||||
@ -57,14 +56,10 @@ public interface Archive {
|
||||
private final String path;
|
||||
|
||||
public Entry(Archive archive, String path, String name, EntryType type) {
|
||||
Objects.requireNonNull(archive);
|
||||
Objects.requireNonNull(path);
|
||||
Objects.requireNonNull(name);
|
||||
Objects.requireNonNull(type);
|
||||
this.archive = archive;
|
||||
this.path = path;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.archive = Objects.requireNonNull(archive);
|
||||
this.path = Objects.requireNonNull(path);
|
||||
this.name = Objects.requireNonNull(name);
|
||||
this.type = Objects.requireNonNull(type);
|
||||
}
|
||||
|
||||
public Archive archive() {
|
||||
@ -79,7 +74,7 @@ public interface Archive {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Returns the name of this entry.
|
||||
*/
|
||||
public String name() {
|
||||
@ -91,7 +86,7 @@ public interface Archive {
|
||||
return "type " + type.name() + " path " + path;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Returns the number of uncompressed bytes for this entry.
|
||||
*/
|
||||
public abstract long size();
|
||||
@ -99,17 +94,17 @@ public interface Archive {
|
||||
public abstract InputStream stream() throws IOException;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* The module name.
|
||||
*/
|
||||
String moduleName();
|
||||
|
||||
/**
|
||||
/*
|
||||
* Returns the path to this module's content
|
||||
*/
|
||||
Path getPath();
|
||||
|
||||
/**
|
||||
/*
|
||||
* Stream of Entry.
|
||||
* The stream of entries needs to be closed after use
|
||||
* since it might cover lazy I/O based resources.
|
||||
@ -117,12 +112,12 @@ public interface Archive {
|
||||
*/
|
||||
Stream<Entry> entries();
|
||||
|
||||
/**
|
||||
/*
|
||||
* Open the archive
|
||||
*/
|
||||
void open() throws IOException;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Close the archive
|
||||
*/
|
||||
void close() throws IOException;
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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. 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 jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
|
||||
/**
|
||||
* A ModuleEntry backed by a given Archive Entry.
|
||||
*/
|
||||
final class ArchiveEntryModuleEntry extends AbstractModuleEntry {
|
||||
private final Archive.Entry entry;
|
||||
|
||||
/**
|
||||
* Create a new ArchiveModuleEntry.
|
||||
*
|
||||
* @param module The module name.
|
||||
* @param path The data path identifier.
|
||||
* @param entry The archive Entry.
|
||||
*/
|
||||
ArchiveEntryModuleEntry(String module, String path, Archive.Entry entry) {
|
||||
super(module, path, getImageFileType(Objects.requireNonNull(entry)));
|
||||
this.entry = entry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream stream() {
|
||||
try {
|
||||
return entry.stream();
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength() {
|
||||
return entry.size();
|
||||
}
|
||||
|
||||
private static ModuleEntry.Type getImageFileType(Archive.Entry entry) {
|
||||
switch(entry.type()) {
|
||||
case CLASS_OR_RESOURCE:
|
||||
return ModuleEntry.Type.CLASS_OR_RESOURCE;
|
||||
case CONFIG:
|
||||
return ModuleEntry.Type.CONFIG;
|
||||
case NATIVE_CMD:
|
||||
return ModuleEntry.Type.NATIVE_CMD;
|
||||
case NATIVE_LIB:
|
||||
return ModuleEntry.Type.NATIVE_LIB;
|
||||
default:
|
||||
return ModuleEntry.Type.OTHER;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,6 +28,7 @@ package jdk.tools.jlink.internal;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import jdk.internal.jimage.ImageHeader;
|
||||
import jdk.internal.jimage.ImageStream;
|
||||
import jdk.internal.jimage.ImageStringsReader;
|
||||
@ -54,7 +55,7 @@ public final class BasicImageWriter {
|
||||
}
|
||||
|
||||
public BasicImageWriter(ByteOrder byteOrder) {
|
||||
this.byteOrder = byteOrder;
|
||||
this.byteOrder = Objects.requireNonNull(byteOrder);
|
||||
this.input = new ArrayList<>();
|
||||
this.strings = new ImageStringsWriter();
|
||||
this.headerStream = new ImageStream(byteOrder);
|
||||
@ -96,8 +97,8 @@ public final class BasicImageWriter {
|
||||
private void generatePerfectHash() {
|
||||
PerfectHashBuilder<ImageLocationWriter> builder =
|
||||
new PerfectHashBuilder<>(
|
||||
PerfectHashBuilder.Entry.class, // PerfectHashBuilder.Entry<ImageLocationWriter>().getClass()
|
||||
PerfectHashBuilder.Bucket.class); // PerfectHashBuilder.Bucket<ImageLocationWriter>().getClass()
|
||||
PerfectHashBuilder.Entry.class,
|
||||
PerfectHashBuilder.Bucket.class);
|
||||
|
||||
input.forEach((location) -> {
|
||||
builder.put(location.getFullName(), location);
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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. 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 jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A ModuleEntry backed by a given byte[].
|
||||
*/
|
||||
class ByteArrayModuleEntry extends AbstractModuleEntry {
|
||||
private final byte[] buffer;
|
||||
|
||||
/**
|
||||
* Create a new ByteArrayModuleEntry.
|
||||
*
|
||||
* @param module The module name.
|
||||
* @param path The data path identifier.
|
||||
* @param type The data type.
|
||||
* @param buf The byte buffer.
|
||||
*/
|
||||
ByteArrayModuleEntry(String module, String path, Type type, byte[] buffer) {
|
||||
super(module, path, type);
|
||||
this.buffer = Objects.requireNonNull(buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBytes() {
|
||||
return buffer.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream stream() {
|
||||
return new ByteArrayInputStream(buffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(OutputStream out) {
|
||||
try {
|
||||
out.write(buffer);
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength() {
|
||||
return buffer.length;
|
||||
}
|
||||
}
|
||||
@ -112,13 +112,11 @@ public class DirArchive implements Archive {
|
||||
|
||||
@Override
|
||||
public Stream<Entry> entries() {
|
||||
Stream<Entry> ret = null;
|
||||
try {
|
||||
ret = Files.walk(dirPath).map(this::toEntry).filter(n -> n != null);
|
||||
return Files.walk(dirPath).map(this::toEntry).filter(n -> n != null);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private Archive.Entry toEntry(Path p) {
|
||||
|
||||
@ -25,10 +25,8 @@
|
||||
package jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.file.Files;
|
||||
@ -47,7 +45,6 @@ import jdk.tools.jlink.internal.Archive.Entry.EntryType;
|
||||
import jdk.tools.jlink.internal.ModulePoolImpl.CompressedModuleData;
|
||||
import jdk.tools.jlink.plugin.ExecutableImage;
|
||||
import jdk.tools.jlink.plugin.PluginException;
|
||||
import jdk.tools.jlink.plugin.ModulePool;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
|
||||
/**
|
||||
@ -73,7 +70,7 @@ public final class ImageFileCreator {
|
||||
private final Map<String, List<Entry>> entriesForModule = new HashMap<>();
|
||||
private final ImagePluginStack plugins;
|
||||
private ImageFileCreator(ImagePluginStack plugins) {
|
||||
this.plugins = plugins;
|
||||
this.plugins = Objects.requireNonNull(plugins);
|
||||
}
|
||||
|
||||
public static ExecutableImage create(Set<Archive> archives,
|
||||
@ -232,10 +229,9 @@ public final class ImageFileCreator {
|
||||
out.write(bytes, 0, bytes.length);
|
||||
|
||||
// write module content
|
||||
for (ModuleEntry res : content) {
|
||||
byte[] buf = res.getBytes();
|
||||
out.write(buf, 0, buf.length);
|
||||
}
|
||||
content.stream().forEach((res) -> {
|
||||
res.write(out);
|
||||
});
|
||||
|
||||
tree.addContent(out);
|
||||
|
||||
@ -244,21 +240,6 @@ public final class ImageFileCreator {
|
||||
return resultResources;
|
||||
}
|
||||
|
||||
private static ModuleEntry.Type mapImageFileType(EntryType type) {
|
||||
switch(type) {
|
||||
case CONFIG: {
|
||||
return ModuleEntry.Type.CONFIG;
|
||||
}
|
||||
case NATIVE_CMD: {
|
||||
return ModuleEntry.Type.NATIVE_CMD;
|
||||
}
|
||||
case NATIVE_LIB: {
|
||||
return ModuleEntry.Type.NATIVE_LIB;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ModulePoolImpl createPools(Set<Archive> archives,
|
||||
Map<String, List<Entry>> entriesForModule,
|
||||
ByteOrder byteOrder,
|
||||
@ -278,54 +259,27 @@ public final class ImageFileCreator {
|
||||
for (Archive archive : archives) {
|
||||
String mn = archive.moduleName();
|
||||
for (Entry entry : entriesForModule.get(mn)) {
|
||||
|
||||
String path;
|
||||
if (entry.type() == EntryType.CLASS_OR_RESOURCE) {
|
||||
// Removal of "classes/" radical.
|
||||
String path = entry.name();
|
||||
try (InputStream stream = entry.stream()) {
|
||||
byte[] bytes = readAllBytes(stream);
|
||||
if (path.endsWith("module-info.class")) {
|
||||
path = "/" + path;
|
||||
} else {
|
||||
path = "/" + mn + "/" + path;
|
||||
}
|
||||
try {
|
||||
resources.add(ModuleEntry.create(path, bytes));
|
||||
} catch (Exception ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
path = entry.name();
|
||||
if (path.endsWith("module-info.class")) {
|
||||
path = "/" + path;
|
||||
} else {
|
||||
path = "/" + mn + "/" + path;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
// Entry.path() contains the kind of file native, conf, bin, ...
|
||||
// Keep it to avoid naming conflict (eg: native/jvm.cfg and config/jvm.cfg
|
||||
resources.add(ModuleEntry.create(mn,
|
||||
"/" + mn + "/" + entry.path(), mapImageFileType(entry.type()),
|
||||
entry.stream(), entry.size()));
|
||||
} catch (Exception ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
// Entry.path() contains the kind of file native, conf, bin, ...
|
||||
// Keep it to avoid naming conflict (eg: native/jvm.cfg and config/jvm.cfg
|
||||
path = "/" + mn + "/" + entry.path();
|
||||
}
|
||||
|
||||
resources.add(new ArchiveEntryModuleEntry(mn, path, entry));
|
||||
}
|
||||
}
|
||||
return resources;
|
||||
}
|
||||
|
||||
private static final int BUF_SIZE = 8192;
|
||||
|
||||
private static byte[] readAllBytes(InputStream is) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] buf = new byte[BUF_SIZE];
|
||||
while (true) {
|
||||
int n = is.read(buf);
|
||||
if (n < 0) {
|
||||
break;
|
||||
}
|
||||
baos.write(buf, 0, n);
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method that splits a Resource path onto 3 items: module, parent
|
||||
* and resource name.
|
||||
|
||||
@ -47,18 +47,18 @@ import jdk.tools.jlink.plugin.TransformerPlugin;
|
||||
*/
|
||||
public final class ImagePluginConfiguration {
|
||||
|
||||
private static final List<Plugin.Category> CATEGORIES_ORDER = new ArrayList<>();
|
||||
private static final List<Category> CATEGORIES_ORDER = new ArrayList<>();
|
||||
|
||||
static {
|
||||
CATEGORIES_ORDER.add(Plugin.Category.FILTER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.TRANSFORMER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.MODULEINFO_TRANSFORMER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.SORTER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.COMPRESSOR);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.METAINFO_ADDER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.VERIFIER);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.PROCESSOR);
|
||||
CATEGORIES_ORDER.add(Plugin.Category.PACKAGER);
|
||||
CATEGORIES_ORDER.add(Category.FILTER);
|
||||
CATEGORIES_ORDER.add(Category.TRANSFORMER);
|
||||
CATEGORIES_ORDER.add(Category.MODULEINFO_TRANSFORMER);
|
||||
CATEGORIES_ORDER.add(Category.SORTER);
|
||||
CATEGORIES_ORDER.add(Category.COMPRESSOR);
|
||||
CATEGORIES_ORDER.add(Category.METAINFO_ADDER);
|
||||
CATEGORIES_ORDER.add(Category.VERIFIER);
|
||||
CATEGORIES_ORDER.add(Category.PROCESSOR);
|
||||
CATEGORIES_ORDER.add(Category.PACKAGER);
|
||||
}
|
||||
|
||||
private ImagePluginConfiguration() {
|
||||
@ -72,8 +72,8 @@ public final class ImagePluginConfiguration {
|
||||
if (pluginsConfiguration == null) {
|
||||
return new ImagePluginStack();
|
||||
}
|
||||
Map<Plugin.Category, List<Plugin>> plugins = new LinkedHashMap<>();
|
||||
for (Plugin.Category cat : CATEGORIES_ORDER) {
|
||||
Map<Category, List<Plugin>> plugins = new LinkedHashMap<>();
|
||||
for (Category cat : CATEGORIES_ORDER) {
|
||||
plugins.put(cat, new ArrayList<>());
|
||||
}
|
||||
|
||||
@ -96,22 +96,22 @@ public final class ImagePluginConfiguration {
|
||||
|
||||
List<TransformerPlugin> transformerPlugins = new ArrayList<>();
|
||||
List<PostProcessorPlugin> postProcessingPlugins = new ArrayList<>();
|
||||
for (Entry<Plugin.Category, List<Plugin>> entry : plugins.entrySet()) {
|
||||
plugins.entrySet().stream().forEach((entry) -> {
|
||||
// Sort according to plugin constraints
|
||||
List<Plugin> orderedPlugins = PluginOrderingGraph.sort(entry.getValue());
|
||||
Category category = entry.getKey();
|
||||
for (Plugin p : orderedPlugins) {
|
||||
orderedPlugins.stream().forEach((p) -> {
|
||||
if (category.isPostProcessor()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
PostProcessorPlugin pp = (PostProcessorPlugin) p;
|
||||
PostProcessorPlugin pp = (PostProcessorPlugin) p;
|
||||
postProcessingPlugins.add(pp);
|
||||
} else {
|
||||
@SuppressWarnings("unchecked")
|
||||
TransformerPlugin trans = (TransformerPlugin) p;
|
||||
TransformerPlugin trans = (TransformerPlugin) p;
|
||||
transformerPlugins.add(trans);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Plugin lastSorter = null;
|
||||
for (Plugin plugin : transformerPlugins) {
|
||||
if (plugin.getName().equals(pluginsConfiguration.getLastSorterPluginName())) {
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
@ -96,7 +95,7 @@ public final class ImagePluginStack {
|
||||
|
||||
public CheckOrderResourcePool(ByteOrder order, List<ModuleEntry> orderedList, StringTable table) {
|
||||
super(order, table);
|
||||
this.orderedList = orderedList;
|
||||
this.orderedList = Objects.requireNonNull(orderedList);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,7 +118,6 @@ public final class ImagePluginStack {
|
||||
|
||||
private int currentid = 0;
|
||||
private final Map<String, Integer> stringsUsage = new HashMap<>();
|
||||
|
||||
private final Map<String, Integer> stringsMap = new HashMap<>();
|
||||
private final Map<Integer, String> reverseMap = new HashMap<>();
|
||||
|
||||
@ -161,12 +159,12 @@ public final class ImagePluginStack {
|
||||
}
|
||||
}
|
||||
|
||||
private final ImageBuilder imageBuilder;
|
||||
private final Plugin lastSorter;
|
||||
private final List<TransformerPlugin> contentPlugins = new ArrayList<>();
|
||||
private final List<PostProcessorPlugin> postProcessingPlugins = new ArrayList<>();
|
||||
private final List<ResourcePrevisitor> resourcePrevisitors = new ArrayList<>();
|
||||
|
||||
private final ImageBuilder imageBuilder;
|
||||
|
||||
public ImagePluginStack() {
|
||||
this(null, Collections.emptyList(), null,
|
||||
@ -177,31 +175,32 @@ public final class ImagePluginStack {
|
||||
List<TransformerPlugin> contentPlugins,
|
||||
Plugin lastSorter,
|
||||
List<PostProcessorPlugin> postprocessingPlugins) {
|
||||
Objects.requireNonNull(contentPlugins);
|
||||
this.imageBuilder = Objects.requireNonNull(imageBuilder);
|
||||
this.lastSorter = lastSorter;
|
||||
for (TransformerPlugin p : contentPlugins) {
|
||||
Objects.requireNonNull(contentPlugins);
|
||||
Objects.requireNonNull(postprocessingPlugins);
|
||||
contentPlugins.stream().forEach((p) -> {
|
||||
Objects.requireNonNull(p);
|
||||
if (p instanceof ResourcePrevisitor) {
|
||||
resourcePrevisitors.add((ResourcePrevisitor) p);
|
||||
}
|
||||
this.contentPlugins.add(p);
|
||||
}
|
||||
for (PostProcessorPlugin p : postprocessingPlugins) {
|
||||
});
|
||||
postprocessingPlugins.stream().forEach((p) -> {
|
||||
Objects.requireNonNull(p);
|
||||
this.postProcessingPlugins.add(p);
|
||||
}
|
||||
this.imageBuilder = imageBuilder;
|
||||
});
|
||||
}
|
||||
|
||||
public void operate(ImageProvider provider) throws Exception {
|
||||
ExecutableImage img = provider.retrieve(this);
|
||||
List<String> arguments = new ArrayList<>();
|
||||
for (PostProcessorPlugin plugin : postProcessingPlugins) {
|
||||
List<String> lst = plugin.process(img);
|
||||
if (lst != null) {
|
||||
arguments.addAll(lst);
|
||||
}
|
||||
}
|
||||
postProcessingPlugins.stream()
|
||||
.map((plugin) -> plugin.process(img))
|
||||
.filter((lst) -> (lst != null))
|
||||
.forEach((lst) -> {
|
||||
arguments.addAll(lst);
|
||||
});
|
||||
img.storeLaunchArgs(arguments);
|
||||
}
|
||||
|
||||
@ -230,15 +229,15 @@ public final class ImagePluginStack {
|
||||
resources.getStringTable());
|
||||
}
|
||||
PreVisitStrings previsit = new PreVisitStrings();
|
||||
for (ResourcePrevisitor p : resourcePrevisitors) {
|
||||
resourcePrevisitors.stream().forEach((p) -> {
|
||||
p.previsit(resources, previsit);
|
||||
}
|
||||
});
|
||||
|
||||
// Store the strings resulting from the previsit.
|
||||
List<String> sorted = previsit.getSortedStrings();
|
||||
for (String s : sorted) {
|
||||
sorted.stream().forEach((s) -> {
|
||||
resources.getStringTable().addString(s);
|
||||
}
|
||||
});
|
||||
|
||||
ModulePoolImpl current = resources;
|
||||
List<ModuleEntry> frozenOrder = null;
|
||||
@ -443,9 +442,7 @@ public final class ImagePluginStack {
|
||||
byte[] bytes = decompressor.decompressResource(getByteOrder(),
|
||||
(int offset) -> pool.getStringTable().getString(offset),
|
||||
res.getBytes());
|
||||
res = ModuleEntry.create(res.getPath(),
|
||||
new ByteArrayInputStream(bytes),
|
||||
bytes.length);
|
||||
res = res.create(bytes);
|
||||
} catch (IOException ex) {
|
||||
throw new PluginException(ex);
|
||||
}
|
||||
|
||||
@ -113,8 +113,7 @@ public final class ImageResourcesTree {
|
||||
private final boolean isEmpty;
|
||||
|
||||
PackageReference(String name, boolean isEmpty) {
|
||||
Objects.requireNonNull(name);
|
||||
this.name = name;
|
||||
this.name = Objects.requireNonNull(name);
|
||||
this.isEmpty = isEmpty;
|
||||
}
|
||||
|
||||
@ -132,12 +131,8 @@ public final class ImageResourcesTree {
|
||||
|
||||
private void addReference(String name, boolean isEmpty) {
|
||||
PackageReference ref = references.get(name);
|
||||
if (ref == null) {
|
||||
if (ref == null || ref.isEmpty) {
|
||||
references.put(name, new PackageReference(name, isEmpty));
|
||||
} else {
|
||||
if (ref.isEmpty) { // replace with new one incase non empty.
|
||||
references.put(name, new PackageReference(name, isEmpty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,8 +262,7 @@ public final class ImageResourcesTree {
|
||||
}
|
||||
// Validate that the packages are well formed.
|
||||
for (Node n : packages.children.values()) {
|
||||
PackageNode pkg = (PackageNode) n;
|
||||
pkg.validate();
|
||||
((PackageNode)n).validate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,9 +44,15 @@ class ImageStringsWriter implements ImageStrings {
|
||||
|
||||
// Reserve 0 offset for empty string.
|
||||
int offset = addString("");
|
||||
assert offset == 0 : "Empty string not zero offset";
|
||||
if (offset != 0) {
|
||||
throw new InternalError("Empty string not offset zero");
|
||||
}
|
||||
|
||||
// Reserve 1 offset for frequently used ".class".
|
||||
addString("class");
|
||||
offset = addString("class");
|
||||
if (offset != 1) {
|
||||
throw new InternalError("'class' string not offset one");
|
||||
}
|
||||
}
|
||||
|
||||
private int addString(final String string) {
|
||||
@ -76,7 +82,9 @@ class ImageStringsWriter implements ImageStrings {
|
||||
public String get(int offset) {
|
||||
ByteBuffer buffer = stream.getBuffer();
|
||||
int capacity = buffer.capacity();
|
||||
assert 0 <= offset && offset < capacity : "String buffer offset out of range";
|
||||
if (offset < 0 || offset >= capacity) {
|
||||
throw new InternalError("String buffer offset out of range");
|
||||
}
|
||||
int zero = NOT_FOUND;
|
||||
for (int i = offset; i < capacity; i++) {
|
||||
if (buffer.get(i) == '\0') {
|
||||
@ -84,7 +92,9 @@ class ImageStringsWriter implements ImageStrings {
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert zero != NOT_FOUND;
|
||||
if (zero == NOT_FOUND) {
|
||||
throw new InternalError("String zero terminator not found");
|
||||
}
|
||||
int length = zero - offset;
|
||||
byte[] bytes = new byte[length];
|
||||
int mark = buffer.position();
|
||||
|
||||
@ -30,8 +30,6 @@ import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
@ -53,8 +51,8 @@ public abstract class JarArchive implements Archive {
|
||||
|
||||
JarEntry(String path, String name, EntryType type, ZipFile file, ZipEntry entry) {
|
||||
super(JarArchive.this, path, name, type);
|
||||
this.entry = entry;
|
||||
this.file = file;
|
||||
this.entry = Objects.requireNonNull(entry);
|
||||
this.file = Objects.requireNonNull(file);
|
||||
size = entry.getSize();
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ public class JlinkTask {
|
||||
private static final TaskHelper taskHelper
|
||||
= new TaskHelper(JLINK_BUNDLE);
|
||||
|
||||
static Option<?>[] recognizedOptions = {
|
||||
private static final Option<?>[] recognizedOptions = {
|
||||
new Option<JlinkTask>(false, (task, opt, arg) -> {
|
||||
task.options.help = true;
|
||||
}, "--help"),
|
||||
@ -176,7 +176,7 @@ public class JlinkTask {
|
||||
|
||||
int run(String[] args) {
|
||||
if (log == null) {
|
||||
setLog(new PrintWriter(System.err, true));
|
||||
setLog(new PrintWriter(System.out, true));
|
||||
}
|
||||
try {
|
||||
optionsHelper.handleOptions(this, args);
|
||||
@ -325,7 +325,6 @@ public class JlinkTask {
|
||||
Set<String> limitMods,
|
||||
Set<String> addMods)
|
||||
{
|
||||
|
||||
ModuleFinder finder = ModuleFinder.of(paths.toArray(new Path[0]));
|
||||
|
||||
// jmods are located at link-time
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
package jdk.tools.jlink.internal;
|
||||
|
||||
import jdk.tools.jlink.internal.JarArchive;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.internal.Archive.Entry.EntryType;
|
||||
@ -35,7 +34,7 @@ import jdk.tools.jlink.internal.Archive.Entry.EntryType;
|
||||
*/
|
||||
public class JmodArchive extends JarArchive {
|
||||
|
||||
private static final String JMOD_EXT = ".jmod";
|
||||
private static final String JMOD_EXT = ".jmod";
|
||||
private static final String MODULE_NAME = "module";
|
||||
private static final String MODULE_INFO = "module-info.class";
|
||||
private static final String CLASSES = "classes";
|
||||
@ -46,8 +45,9 @@ public class JmodArchive extends JarArchive {
|
||||
public JmodArchive(String mn, Path jmod) {
|
||||
super(mn, jmod);
|
||||
String filename = Objects.requireNonNull(jmod.getFileName()).toString();
|
||||
if (!filename.endsWith(JMOD_EXT))
|
||||
if (!filename.endsWith(JMOD_EXT)) {
|
||||
throw new UnsupportedOperationException("Unsupported format: " + filename);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,7 +65,6 @@ public class JmodArchive extends JarArchive {
|
||||
case MODULE_NAME:
|
||||
return EntryType.MODULE_NAME;
|
||||
default:
|
||||
//throw new InternalError("unexpected entry: " + name + " " + zipfile.toString()); //TODO
|
||||
throw new InternalError("unexpected entry: " + section);
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,8 +39,9 @@ public class ModularJarArchive extends JarArchive {
|
||||
public ModularJarArchive(String mn, Path jmod) {
|
||||
super(mn, jmod);
|
||||
String filename = Objects.requireNonNull(jmod.getFileName()).toString();
|
||||
if (!filename.endsWith(JAR_EXT))
|
||||
if (!filename.endsWith(JAR_EXT)) {
|
||||
throw new UnsupportedOperationException("Unsupported format: " + filename);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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. 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 jdk.tools.jlink.internal;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
|
||||
public final class ModuleEntryFactory {
|
||||
private ModuleEntryFactory() {}
|
||||
|
||||
public static ModuleEntry create(String path,
|
||||
ModuleEntry.Type type, byte[] content) {
|
||||
return new ByteArrayModuleEntry(moduleFrom(path), path, type, content);
|
||||
}
|
||||
|
||||
public static ModuleEntry create(String path,
|
||||
ModuleEntry.Type type, Path file) {
|
||||
return new PathModuleEntry(moduleFrom(path), path, type, file);
|
||||
}
|
||||
|
||||
public static ModuleEntry create(ModuleEntry original, byte[] content) {
|
||||
return new ByteArrayModuleEntry(original.getModule(),
|
||||
original.getPath(), original.getType(), content);
|
||||
}
|
||||
|
||||
public static ModuleEntry create(ModuleEntry original, Path file) {
|
||||
return new PathModuleEntry(original.getModule(),
|
||||
original.getPath(), original.getType(), file);
|
||||
}
|
||||
|
||||
private static String moduleFrom(String path) {
|
||||
Objects.requireNonNull(path);
|
||||
if (path.isEmpty() || path.charAt(0) != '/') {
|
||||
throw new IllegalArgumentException(path + " must start with /");
|
||||
}
|
||||
String noRoot = path.substring(1);
|
||||
int idx = noRoot.indexOf('/');
|
||||
if (idx == -1) {
|
||||
throw new IllegalArgumentException("/ missing after module: " + path);
|
||||
}
|
||||
return noRoot.substring(0, idx);
|
||||
}
|
||||
}
|
||||
@ -24,8 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
@ -95,7 +93,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
@Override
|
||||
public void add(ModuleEntry data) {
|
||||
if (isReadOnly()) {
|
||||
throw new PluginException("LinkConfiguration is readonly");
|
||||
throw new PluginException("ModulePool is readonly");
|
||||
}
|
||||
Objects.requireNonNull(data);
|
||||
if (!data.getModule().equals(name)) {
|
||||
@ -168,8 +166,8 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
public ModulePoolImpl(ByteOrder order, StringTable table) {
|
||||
this.order = order;
|
||||
this.table = table;
|
||||
this.order = Objects.requireNonNull(order);
|
||||
this.table = Objects.requireNonNull(table);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -180,7 +178,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
@Override
|
||||
public void add(ModuleEntry data) {
|
||||
if (isReadOnly()) {
|
||||
throw new PluginException("LinkConfiguration is readonly");
|
||||
throw new PluginException("ModulePool is readonly");
|
||||
}
|
||||
Objects.requireNonNull(data);
|
||||
if (resources.get(data.getPath()) != null) {
|
||||
@ -215,7 +213,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* The stream of modules contained in this LinkConfiguration.
|
||||
* The stream of modules contained in this ModulePool.
|
||||
*
|
||||
* @return The stream of modules.
|
||||
*/
|
||||
@ -225,7 +223,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of LinkModule count in this LinkConfiguration.
|
||||
* Return the number of LinkModule count in this ModulePool.
|
||||
*
|
||||
* @return the module count.
|
||||
*/
|
||||
@ -235,7 +233,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all ModuleEntry contained in this LinkConfiguration instance.
|
||||
* Get all ModuleEntry contained in this ModulePool instance.
|
||||
*
|
||||
* @return The stream of LinkModuleEntries.
|
||||
*/
|
||||
@ -245,7 +243,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of ModuleEntry count in this LinkConfiguration.
|
||||
* Return the number of ModuleEntry count in this ModulePool.
|
||||
*
|
||||
* @return the entry count.
|
||||
*/
|
||||
@ -267,7 +265,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the LinkConfiguration contains the given ModuleEntry.
|
||||
* Check if the ModulePool contains the given ModuleEntry.
|
||||
*
|
||||
* @param data The module data to check existence for.
|
||||
* @return The module data or null if not found.
|
||||
@ -279,7 +277,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the LinkConfiguration contains some content at all.
|
||||
* Check if the ModulePool contains some content at all.
|
||||
*
|
||||
* @return True, no content, false otherwise.
|
||||
*/
|
||||
@ -289,16 +287,16 @@ public class ModulePoolImpl implements ModulePool {
|
||||
}
|
||||
|
||||
/**
|
||||
* Visit each ModuleEntry in this LinkConfiguration to transform it and
|
||||
* copy the transformed ModuleEntry to the output LinkConfiguration.
|
||||
* Visit each ModuleEntry in this ModulePool to transform it and
|
||||
* copy the transformed ModuleEntry to the output ModulePool.
|
||||
*
|
||||
* @param transform The function called for each ModuleEntry found in
|
||||
* the LinkConfiguration. The transform function should return a
|
||||
* the ModulePool. The transform function should return a
|
||||
* ModuleEntry instance which will be added to the output or it should
|
||||
* return null if the passed ModuleEntry is to be ignored for the
|
||||
* output.
|
||||
*
|
||||
* @param output The LinkConfiguration to be filled with Visitor returned
|
||||
* @param output The ModulePool to be filled with Visitor returned
|
||||
* ModuleEntry.
|
||||
*/
|
||||
@Override
|
||||
@ -351,14 +349,13 @@ public class ModulePoolImpl implements ModulePool {
|
||||
/**
|
||||
* A resource that has been compressed.
|
||||
*/
|
||||
public static final class CompressedModuleData extends ModuleEntryImpl {
|
||||
public static final class CompressedModuleData extends ByteArrayModuleEntry {
|
||||
|
||||
final long uncompressed_size;
|
||||
|
||||
private CompressedModuleData(String module, String path,
|
||||
InputStream stream, long size,
|
||||
long uncompressed_size) {
|
||||
super(module, path, ModuleEntry.Type.CLASS_OR_RESOURCE, stream, size);
|
||||
byte[] content, long uncompressed_size) {
|
||||
super(module, path, ModuleEntry.Type.CLASS_OR_RESOURCE, content);
|
||||
this.uncompressed_size = uncompressed_size;
|
||||
}
|
||||
|
||||
@ -413,8 +410,7 @@ public class ModulePoolImpl implements ModulePool {
|
||||
|
||||
CompressedModuleData compressedResource
|
||||
= new CompressedModuleData(original.getModule(), original.getPath(),
|
||||
new ByteArrayInputStream(contentWithHeader),
|
||||
contentWithHeader.length, uncompressed_size);
|
||||
contentWithHeader, uncompressed_size);
|
||||
return compressedResource;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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. Oracle designates this
|
||||
* particular file as subject to the "Classfile" 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 jdk.tools.jlink.internal;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A ModuleEntry backed by a given nio Path.
|
||||
*/
|
||||
public class PathModuleEntry extends AbstractModuleEntry {
|
||||
private final Path file;
|
||||
|
||||
/**
|
||||
* Create a new PathModuleEntry.
|
||||
*
|
||||
* @param module The module name.
|
||||
* @param path The path for the resource content.
|
||||
* @param type The data type.
|
||||
* @param file The data file identifier.
|
||||
*/
|
||||
public PathModuleEntry(String module, String path, Type type, Path file) {
|
||||
super(module, path, type);
|
||||
this.file = Objects.requireNonNull(file);
|
||||
if (!Files.isRegularFile(file)) {
|
||||
throw new IllegalArgumentException(file + " not a file");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final InputStream stream() {
|
||||
try {
|
||||
return Files.newInputStream(file);
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long getLength() {
|
||||
try {
|
||||
return Files.size(file);
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,6 @@ public interface ResourcePrevisitor {
|
||||
* @param resources Read only resources.
|
||||
* @param strings StringTable instance. Add string to the StringTable to track string
|
||||
* usage.
|
||||
* @throws PluginException
|
||||
*/
|
||||
public void previsit(ModulePool resources, StringTable strings);
|
||||
}
|
||||
|
||||
@ -584,6 +584,8 @@ public final class TaskHelper {
|
||||
showPlugin(plugin, log, showsImageBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
log.println("\n" + bundleHelper.getMessage("main.extended.help.footer"));
|
||||
}
|
||||
|
||||
private void showPlugin(Plugin plugin, PrintWriter log, boolean showsImageBuilder) {
|
||||
|
||||
@ -34,7 +34,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import jdk.tools.jlink.plugin.Plugin;
|
||||
import jdk.tools.jlink.plugin.Plugin.Category;
|
||||
|
||||
@ -127,7 +127,7 @@ public final class AppRuntimeImageBuilder {
|
||||
jlink.build(jlinkConfig, pluginConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Returns a ModuleFinder that limits observability to the given root
|
||||
* modules, their transitive dependences, plus a set of other modules.
|
||||
*/
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import jdk.tools.jlink.internal.ModulePoolImpl;
|
||||
|
||||
@ -24,14 +24,11 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import jdk.tools.jlink.plugin.TransformerPlugin;
|
||||
import jdk.tools.jlink.plugin.ModulePool;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
import jdk.tools.jlink.internal.Utils;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import jdk.tools.jlink.plugin.TransformerPlugin;
|
||||
|
||||
@ -25,12 +25,10 @@
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -244,10 +242,7 @@ public final class ExcludeVMPlugin implements TransformerPlugin {
|
||||
|
||||
byte[] content = builder.toString().getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
return ModuleEntry.create(orig.getModule(),
|
||||
orig.getPath(),
|
||||
orig.getType(),
|
||||
new ByteArrayInputStream(content), content.length);
|
||||
return orig.create(content);
|
||||
}
|
||||
|
||||
private static String jvmlib() {
|
||||
|
||||
@ -26,7 +26,6 @@ package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.FileVisitor;
|
||||
@ -35,11 +34,10 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.internal.ModuleEntryImpl;
|
||||
import jdk.tools.jlink.internal.PathModuleEntry;
|
||||
import jdk.tools.jlink.plugin.PluginException;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
import jdk.tools.jlink.plugin.ModulePool;
|
||||
@ -66,13 +64,13 @@ public class FileCopierPlugin implements TransformerPlugin {
|
||||
/**
|
||||
* Symbolic link to another path.
|
||||
*/
|
||||
public static abstract class SymImageFile extends ModuleEntryImpl {
|
||||
public static abstract class SymImageFile extends PathModuleEntry {
|
||||
|
||||
private final String targetPath;
|
||||
|
||||
public SymImageFile(String targetPath, String module, String path,
|
||||
ModuleEntry.Type type, InputStream stream, long size) {
|
||||
super(module, path, type, stream, size);
|
||||
ModuleEntry.Type type, Path file) {
|
||||
super(module, path, type, file);
|
||||
this.targetPath = targetPath;
|
||||
}
|
||||
|
||||
@ -85,23 +83,7 @@ public class FileCopierPlugin implements TransformerPlugin {
|
||||
|
||||
public SymImageFileImpl(String targetPath, Path file, String module,
|
||||
String path, ModuleEntry.Type type) {
|
||||
super(targetPath, module, path, type, newStream(file), length(file));
|
||||
}
|
||||
}
|
||||
|
||||
private static long length(Path file) {
|
||||
try {
|
||||
return Files.size(file);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static InputStream newStream(Path file) {
|
||||
try {
|
||||
return Files.newInputStream(file);
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
super(targetPath, module, path, type, file);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,9 +157,9 @@ public class FileCopierPlugin implements TransformerPlugin {
|
||||
Objects.requireNonNull(pool);
|
||||
Objects.requireNonNull(file);
|
||||
Objects.requireNonNull(path);
|
||||
ModuleEntry impl = ModuleEntry.create(FAKE_MODULE,
|
||||
ModuleEntry impl = ModuleEntry.create(
|
||||
"/" + FAKE_MODULE + "/other/" + path,
|
||||
ModuleEntry.Type.OTHER, newStream(file), length(file));
|
||||
ModuleEntry.Type.OTHER, file);
|
||||
try {
|
||||
pool.add(impl);
|
||||
} catch (Exception ex) {
|
||||
|
||||
@ -24,10 +24,8 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -171,10 +169,9 @@ public final class GenerateJLIClassesPlugin implements TransformerPlugin {
|
||||
byte[] bytes = result.getValue();
|
||||
|
||||
// Add class to pool
|
||||
ModuleEntry ndata = ModuleEntry.create(data.getModule(),
|
||||
ModuleEntry ndata = ModuleEntry.create(
|
||||
"/java.base/" + className + ".class",
|
||||
ModuleEntry.Type.CLASS_OR_RESOURCE,
|
||||
new ByteArrayInputStream(bytes), bytes.length);
|
||||
bytes);
|
||||
if (!out.contains(ndata)) {
|
||||
out.add(ndata);
|
||||
}
|
||||
|
||||
@ -24,10 +24,8 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.IllformedLocaleException;
|
||||
import java.util.Locale;
|
||||
import java.util.List;
|
||||
@ -123,9 +121,7 @@ public final class IncludeLocalesPlugin implements TransformerPlugin, ResourcePr
|
||||
if (Arrays.stream(cr.getInterfaces())
|
||||
.anyMatch(i -> i.contains(METAINFONAME)) &&
|
||||
stripUnsupportedLocales(bytes, cr)) {
|
||||
resource = ModuleEntry.create(MODULENAME, path,
|
||||
resource.getType(),
|
||||
new ByteArrayInputStream(bytes), bytes.length);
|
||||
resource = resource.create(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ import java.io.OutputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -30,11 +30,9 @@ import java.nio.file.FileSystem;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.PathMatcher;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.ToIntFunction;
|
||||
import jdk.tools.jlink.plugin.PluginException;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
|
||||
@ -26,7 +26,6 @@ package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -46,7 +46,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -24,9 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Predicate;
|
||||
import jdk.internal.org.objectweb.asm.ClassReader;
|
||||
import jdk.internal.org.objectweb.asm.ClassWriter;
|
||||
@ -75,7 +72,7 @@ public final class StripDebugPlugin implements TransformerPlugin {
|
||||
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
reader.accept(writer, ClassReader.SKIP_DEBUG);
|
||||
byte[] content = writer.toByteArray();
|
||||
res = ModuleEntry.create(path, new ByteArrayInputStream(content), content.length);
|
||||
res = resource.create(content);
|
||||
}
|
||||
}
|
||||
} else if (predicate.test(res.getPath())) {
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package jdk.tools.jlink.internal.plugins;
|
||||
|
||||
import java.util.Collections;
|
||||
import jdk.tools.jlink.plugin.ModuleEntry;
|
||||
import jdk.tools.jlink.plugin.ModulePool;
|
||||
import jdk.tools.jlink.plugin.TransformerPlugin;
|
||||
|
||||
@ -139,11 +139,7 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin {
|
||||
ModuleInfoRewriter minfoWriter =
|
||||
new ModuleInfoRewriter(bain, mbuilder.conceals());
|
||||
// replace with the overridden version
|
||||
data = ModuleEntry.create(data.getModule(),
|
||||
data.getPath(),
|
||||
data.getType(),
|
||||
minfoWriter.stream(),
|
||||
minfoWriter.size());
|
||||
data = data.create(minfoWriter.getBytes());
|
||||
}
|
||||
out.add(data);
|
||||
} catch (IOException e) {
|
||||
@ -158,12 +154,7 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin {
|
||||
return;
|
||||
if (builder.isOverriddenClass(data.getPath())) {
|
||||
byte[] bytes = cwriter.toByteArray();
|
||||
ModuleEntry ndata =
|
||||
ModuleEntry.create(data.getModule(),
|
||||
data.getPath(),
|
||||
data.getType(),
|
||||
new ByteArrayInputStream(bytes),
|
||||
bytes.length);
|
||||
ModuleEntry ndata = data.create(bytes);
|
||||
out.add(ndata);
|
||||
} else {
|
||||
out.add(data);
|
||||
@ -183,8 +174,8 @@ public final class SystemModuleDescriptorPlugin implements TransformerPlugin {
|
||||
this.extender.write(this);
|
||||
}
|
||||
|
||||
InputStream stream() {
|
||||
return new ByteArrayInputStream(buf);
|
||||
byte[] getBytes() {
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.zip.Deflater;
|
||||
|
||||
@ -93,8 +93,7 @@ final class AsmPoolImpl implements AsmModulePool {
|
||||
}
|
||||
|
||||
byte[] content = writer.toByteArray();
|
||||
ModuleEntry res = ModuleEntry.create(path,
|
||||
new ByteArrayInputStream(content), content.length);
|
||||
ModuleEntry res = ModuleEntry.create(path, content);
|
||||
transformedClasses.put(className, res);
|
||||
}
|
||||
|
||||
|
||||
@ -76,9 +76,7 @@ public final class ControlFlow {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 79 * hash + Objects.hashCode(this.firstInstruction);
|
||||
return hash;
|
||||
return Objects.hashCode(this.firstInstruction);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -214,9 +212,7 @@ public final class ControlFlow {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
hash = 89 * hash + this.getIndex();
|
||||
return hash;
|
||||
return this.getIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -26,16 +26,18 @@ package jdk.tools.jlink.plugin;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Objects;
|
||||
import jdk.tools.jlink.internal.ImageFileCreator;
|
||||
import jdk.tools.jlink.internal.ModuleEntryImpl;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import jdk.tools.jlink.internal.ModuleEntryFactory;
|
||||
|
||||
/**
|
||||
* A LinkModuleEntry is the elementary unit of data inside an image. It is
|
||||
* generally a file. e.g.: a java class file, a resource file, a shared library,
|
||||
* ...
|
||||
* A ModuleEntry is the elementary unit of data inside an image. It is
|
||||
* generally a file. e.g.: a java class file, a resource file, a shared library.
|
||||
* <br>
|
||||
* A LinkModuleEntry is identified by a path of the form:
|
||||
* A ModuleEntry is identified by a path of the form:
|
||||
* <ul>
|
||||
* <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
|
||||
* name}</li>
|
||||
@ -63,93 +65,133 @@ public interface ModuleEntry {
|
||||
OTHER
|
||||
}
|
||||
/**
|
||||
* The LinkModuleEntry module name.
|
||||
* The ModuleEntry module name.
|
||||
*
|
||||
* @return The module name.
|
||||
*/
|
||||
public String getModule();
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry path.
|
||||
* The ModuleEntry path.
|
||||
*
|
||||
* @return The module path.
|
||||
*/
|
||||
public String getPath();
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry's type.
|
||||
* The ModuleEntry's type.
|
||||
*
|
||||
* @return The data type.
|
||||
*/
|
||||
public Type getType();
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry content as an array of byte.
|
||||
* The ModuleEntry content as an array of bytes.
|
||||
*
|
||||
* @return An Array of bytes.
|
||||
*/
|
||||
public byte[] getBytes();
|
||||
public default byte[] getBytes() {
|
||||
try (InputStream is = stream()) {
|
||||
return is.readAllBytes();
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry content length.
|
||||
* The ModuleEntry content length.
|
||||
*
|
||||
* @return The length.
|
||||
*/
|
||||
public long getLength();
|
||||
|
||||
/**
|
||||
* The LinkModuleEntry stream.
|
||||
* The ModuleEntry stream.
|
||||
*
|
||||
* @return The module data stream.
|
||||
*/
|
||||
public InputStream stream();
|
||||
|
||||
|
||||
/**
|
||||
* Create a LinkModuleEntry located inside a jimage file. Such
|
||||
* LinkModuleEntry has a Type being equals to CLASS_OR_RESOURCE.
|
||||
* Write the content of this ModuleEntry to stream.
|
||||
*
|
||||
* @param path The complete resource path (contains the module radical).
|
||||
* @param content The resource content.
|
||||
* @param size The content size.
|
||||
* @return A new LinkModuleEntry.
|
||||
* @param out the output stream
|
||||
*/
|
||||
public static ModuleEntry create(String path, InputStream content, long size) {
|
||||
Objects.requireNonNull(path);
|
||||
Objects.requireNonNull(content);
|
||||
String[] split = ImageFileCreator.splitPath(path);
|
||||
String module = split[0];
|
||||
return new ModuleEntryImpl(module, path, Type.CLASS_OR_RESOURCE, content, size);
|
||||
public default void write(OutputStream out) {
|
||||
try {
|
||||
out.write(getBytes());
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a LinkModuleEntry for a file that will be located inside a jimage
|
||||
* file.
|
||||
* Create a ModuleEntry with new content but other information
|
||||
* copied from this ModuleEntry.
|
||||
*
|
||||
* @param content The new resource content.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public default ModuleEntry create(byte[] content) {
|
||||
return ModuleEntryFactory.create(this, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a ModuleEntry with new content but other information
|
||||
* copied from this ModuleEntry.
|
||||
*
|
||||
* @param file The new resource content.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public default ModuleEntry create(Path file) {
|
||||
return ModuleEntryFactory.create(this, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a ModuleEntry for a resource of the given type.
|
||||
*
|
||||
* @param path The resource path.
|
||||
* @param type The ModuleEntry type.
|
||||
* @param content The resource content.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public static ModuleEntry create(String path,
|
||||
ModuleEntry.Type type, byte[] content) {
|
||||
return ModuleEntryFactory.create(path, type, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a ModuleEntry for a resource of type {@link Type#CLASS_OR_RESOURCE}.
|
||||
*
|
||||
* @param path The resource path.
|
||||
* @param content The resource content.
|
||||
* @return A new LinkModuleEntry.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public static ModuleEntry create(String path, byte[] content) {
|
||||
return create(path, new ByteArrayInputStream(content),
|
||||
content.length);
|
||||
return create(path, Type.CLASS_OR_RESOURCE, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a LinkModuleEntry for a file that will be located outside a jimage
|
||||
* file.
|
||||
* Create a ModuleEntry for a resource of the given type.
|
||||
*
|
||||
* @param module The module in which this files is located.
|
||||
* @param path The file path locator (doesn't contain the module name).
|
||||
* @param type The LinkModuleEntry type.
|
||||
* @param content The file content.
|
||||
* @param size The content size.
|
||||
* @return A new LinkModuleEntry.
|
||||
* @param path The resource path.
|
||||
* @param type The ModuleEntry type.
|
||||
* @param file The resource file.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public static ModuleEntry create(String module, String path, ModuleEntry.Type type,
|
||||
InputStream content, long size) {
|
||||
Objects.requireNonNull(path);
|
||||
Objects.requireNonNull(content);
|
||||
return new ModuleEntryImpl(module, path, type, content, size);
|
||||
public static ModuleEntry create(String path,
|
||||
ModuleEntry.Type type, Path file) {
|
||||
return ModuleEntryFactory.create(path, type, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a ModuleEntry for a resource of type {@link Type#CLASS_OR_RESOURCE}.
|
||||
*
|
||||
* @param path The resource path.
|
||||
* @param file The resource file.
|
||||
* @return A new ModuleEntry.
|
||||
*/
|
||||
public static ModuleEntry create(String path, Path file) {
|
||||
return create(path, Type.CLASS_OR_RESOURCE, file);
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ use --help for a list of possible options
|
||||
|
||||
main.usage=\
|
||||
Usage: {0} <options> --modulepath <modulepath> --addmods <mods> --output <path>\n\
|
||||
Possible options include:
|
||||
\Possible options include:
|
||||
|
||||
error.prefix=Error:
|
||||
warn.prefix=Warning:
|
||||
@ -68,7 +68,18 @@ after checking the database for duplicates. \
|
||||
Include your program and the following diagnostic in your report. Thank you.
|
||||
|
||||
main.extended.help=\
|
||||
List of available plugins:
|
||||
\List of available plugins:
|
||||
|
||||
main.extended.help.footer=\
|
||||
\For options requiring a <pattern-list>, the value will be a comma\
|
||||
\ separated list of elements each using one the following forms:\n\
|
||||
\ <glob-pattern>\n\
|
||||
\ glob:<glob-pattern>\n\
|
||||
\ regex:<regex-pattern>\n\
|
||||
\ @<filename> where filename is the name of a file containing patterns to be\
|
||||
\ used, one pattern per line\n\
|
||||
\n\
|
||||
|
||||
|
||||
err.unknown.byte.order:unknown byte order {0}
|
||||
err.output.must.be.specified:--output must be specified
|
||||
|
||||
@ -37,15 +37,16 @@ class-optim.description=\
|
||||
Class optimization. Warning: This plugin is experimental.\n\
|
||||
An optional <log file> can be specified to log applied optimizations.
|
||||
|
||||
compress.argument=<0|1|2>[:filter=<pattern>]
|
||||
compress.argument=<0|1|2>[:filter=<pattern-list>]
|
||||
|
||||
compress.description=\
|
||||
Compress all resources in the output image.\n\
|
||||
Level 0: constant string sharing\n\
|
||||
Level 1: ZIP\n\
|
||||
Level 2: both.\n\
|
||||
An optional filter can be specified to list the pattern of files to be filtered.\n\
|
||||
Use ^ for negation. e.g.: *Exception.class,*Error.class,^/java.base/java/lang/*
|
||||
An optional <pattern-list> filter can be specified to list the pattern of\n\
|
||||
files to be included.
|
||||
|
||||
|
||||
compact-cp.argument=<resource paths>
|
||||
|
||||
@ -59,15 +60,15 @@ copy-files.description=\
|
||||
If files to copy are not absolute path, JDK home dir is used.\n\
|
||||
e.g.: jrt-fs.jar,LICENSE,/home/me/myfile.txt=somewehere/conf.txt
|
||||
|
||||
exclude-files.argument=<files to exclude | files of excluded files>
|
||||
exclude-files.argument=<pattern-list> of files to exclude
|
||||
|
||||
exclude-files.description=\
|
||||
Specify files to exclude. e.g.: *.diz, /java.base/native/client/*
|
||||
Specify files to exclude. e.g.: **.java,glob:/java.base/native/client/**
|
||||
|
||||
exclude-resources.argument=<resources to exclude | file of excluded resources>
|
||||
exclude-resources.argument=<pattern-list> resources to exclude
|
||||
|
||||
exclude-resources.description=\
|
||||
Specify resources to exclude. e.g.: *.jcov, */META-INF/*
|
||||
Specify resources to exclude. e.g.: **.jcov,glob:**/META-INF/**
|
||||
|
||||
generate-jli-classes.argument=<bmh[:bmh-species=LL,L3,...]>
|
||||
|
||||
@ -78,10 +79,11 @@ installed-modules.description=Fast loading of module descriptors (always enabled
|
||||
|
||||
onoff.argument=<on|off>
|
||||
|
||||
order-resources.argument=<paths in priority order | file with resource paths>
|
||||
order-resources.argument=<pattern-list> of paths in priority order. If a @file\n\
|
||||
is specified, then each line should be an exact match for the path to be ordered
|
||||
|
||||
order-resources.description=\
|
||||
Order resources. e.g.: */module-info.class,/java.base/java/lang/*
|
||||
Order resources. e.g.: **/module-info.class,@classlist,/java.base/java/lang/**
|
||||
|
||||
strip-debug.description=\
|
||||
Strip debug information from the output image
|
||||
|
||||
@ -1085,7 +1085,7 @@ public class JmodTask {
|
||||
|
||||
@Override public Class<Pattern> valueType() { return Pattern.class; }
|
||||
|
||||
@Override public String valuePattern() { return "pattern"; }
|
||||
@Override public String valuePattern() { return "regex-pattern"; }
|
||||
}
|
||||
|
||||
static class PathMatcherConverter implements ValueConverter<PathMatcher> {
|
||||
@ -1100,7 +1100,7 @@ public class JmodTask {
|
||||
|
||||
@Override public Class<PathMatcher> valueType() { return PathMatcher.class; }
|
||||
|
||||
@Override public String valuePattern() { return "pattern"; }
|
||||
@Override public String valuePattern() { return "pattern-list"; }
|
||||
}
|
||||
|
||||
/* Support for @<file> in jmod help */
|
||||
@ -1145,7 +1145,7 @@ public class JmodTask {
|
||||
String content = super.format(all);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("\n").append(" Main operation modes:\n ");
|
||||
builder.append(getMessage("main.opt.mode")).append("\n ");
|
||||
builder.append(getMessage("main.opt.mode.create")).append("\n ");
|
||||
builder.append(getMessage("main.opt.mode.list")).append("\n ");
|
||||
builder.append(getMessage("main.opt.mode.describe")).append("\n ");
|
||||
|
||||
@ -28,11 +28,13 @@ Usage: {0} (create|list|describe|hash) <OPTIONS> <jmod-file>\n\
|
||||
use --help for a list of possible options
|
||||
|
||||
main.usage=\
|
||||
Usage: {0} (create|list|describe|hash) <OPTIONS> <jmod-file>
|
||||
Usage: {0} (create|list|describe|hash) <OPTIONS> <jmod-file>\n\
|
||||
|
||||
error.prefix=Error:
|
||||
warn.prefix=Warning:
|
||||
|
||||
main.opt.mode=\
|
||||
\Main operation modes:
|
||||
main.opt.mode.create=\
|
||||
\create - Creates a new jmod archive
|
||||
main.opt.mode.list=\
|
||||
@ -49,7 +51,9 @@ main.opt.libs=Location of native libraries
|
||||
main.opt.cmds=Location of native commands
|
||||
main.opt.config=Location of user-editable config files
|
||||
main.opt.dry-run=Dry run of hash mode
|
||||
main.opt.exclude=Exclude files, given as a PATTERN
|
||||
main.opt.exclude=Exclude files matching the supplied comma separated pattern\
|
||||
\ list, each element using one the following forms: <glob-pattern>,\
|
||||
\ glob:<glob-pattern> or regex:<regex-pattern>
|
||||
main.opt.module-version= Module version
|
||||
main.opt.main-class=Main class
|
||||
main.opt.main-class.arg=class-name
|
||||
@ -61,7 +65,7 @@ main.opt.os-version=Operating system version
|
||||
main.opt.os-version.arg=os-version
|
||||
main.opt.modulepath=Module path
|
||||
main.opt.hash-modules=Compute and record hashes to tie a packaged module\
|
||||
\ with modules matching the given pattern and depending upon it directly\
|
||||
\ with modules matching the given <regex-pattern> and depending upon it directly\
|
||||
\ or indirectly. The hashes are recorded in the JMOD file being created, or\
|
||||
\ a JMOD file or modular JAR on the module path specified the jmod hash command.
|
||||
|
||||
|
||||
@ -164,6 +164,10 @@ java/net/MulticastSocket/Test.java 7145658 macosx-a
|
||||
|
||||
java/net/DatagramSocket/SendDatagramToBadAddress.java 7143960 macosx-all
|
||||
|
||||
java/net/httpclient/http2/BasicTest.java 8157408 linux-all
|
||||
java/net/httpclient/http2/ErrorTest.java 8158127 solaris-all,windows-all
|
||||
java/net/httpclient/http2/TLSConnection.java 8157482 macosx-all
|
||||
|
||||
############################################################################
|
||||
|
||||
# jdk_nio
|
||||
@ -336,9 +340,6 @@ com/sun/jdi/GetLocalVariables4Test.sh 8067354 windows-
|
||||
|
||||
# jdk_time
|
||||
|
||||
java/time/test/java/time/TestClock_System.java 8158128 solaris-all
|
||||
|
||||
|
||||
############################################################################
|
||||
|
||||
# jdk_util
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
|
||||
tier1 = \
|
||||
:jdk_lang \
|
||||
-java/lang/ProcessHandle/TreeTest.java \
|
||||
:jdk_util \
|
||||
-java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
|
||||
-java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
|
||||
@ -38,7 +37,6 @@ tier1 = \
|
||||
tools/pack200
|
||||
|
||||
tier2 = \
|
||||
java/lang/ProcessHandle/TreeTest.java \
|
||||
java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
|
||||
java/util/concurrent/forkjoin/FJExceptionTableLeak.java \
|
||||
:jdk_io \
|
||||
|
||||
@ -50,7 +50,6 @@ import org.testng.annotations.Test;
|
||||
* @build jdk.test.lib.Utils
|
||||
* @run testng/othervm TreeTest
|
||||
* @summary Test counting and JavaChild.spawning and counting of Processes.
|
||||
* @key intermittent
|
||||
* @author Roger Riggs
|
||||
*/
|
||||
public class TreeTest extends ProcessUtil {
|
||||
|
||||
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