-#endif
#include "childproc.h"
@@ -390,7 +388,6 @@
return resultPid;
}
-#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
static pid_t
spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
pid_t resultPid;
@@ -473,7 +470,6 @@
* via the statement below */
return resultPid;
}
-#endif
/*
* Start a child process running function childProcess.
@@ -489,10 +485,8 @@
#endif
case MODE_FORK:
return forkChild(c);
-#if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
case MODE_POSIX_SPAWN:
return spawnChild(env, process, c, helperpath);
-#endif
default:
return -1;
}
diff -r 65407a437327 -r 339963bcff24 src/java.base/unix/native/libjava/java_props_md.c
--- a/src/java.base/unix/native/libjava/java_props_md.c Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/unix/native/libjava/java_props_md.c Mon Nov 12 11:10:16 2018 +0530
@@ -399,7 +399,7 @@
#endif
/* patches/service packs installed */
- sprops.patch_level = "unknown";
+ sprops.patch_level = NULL; // leave it undefined
/* Java 2D/AWT properties */
#ifdef MACOSX
@@ -488,19 +488,15 @@
&(sprops.format_variant),
&(sprops.encoding))) {
ParseLocale(env, LC_MESSAGES,
- &(sprops.language),
- &(sprops.script),
- &(sprops.country),
- &(sprops.variant),
+ &(sprops.display_language),
+ &(sprops.display_script),
+ &(sprops.display_country),
+ &(sprops.display_variant),
NULL);
} else {
- sprops.language = "en";
+ sprops.display_language = "en";
sprops.encoding = "ISO8859-1";
}
- sprops.display_language = sprops.language;
- sprops.display_script = sprops.script;
- sprops.display_country = sprops.country;
- sprops.display_variant = sprops.variant;
/* ParseLocale failed with OOME */
JNU_CHECK_EXCEPTION_RETURN(env, NULL);
@@ -543,18 +539,12 @@
}
}
- /* User TIMEZONE */
- {
- /*
- * We defer setting up timezone until it's actually necessary.
- * Refer to TimeZone.getDefault(). However, the system
- * property is necessary to be able to be set by the command
- * line interface -D. Here temporarily set a null string to
- * timezone.
- */
- tzset(); /* for compatibility */
- sprops.timezone = "";
- }
+ /* User TIMEZONE
+ * We defer setting up timezone until it's actually necessary.
+ * Refer to TimeZone.getDefault(). The system property
+ * is able to be set by the command line interface -Duser.timezone.
+ */
+ tzset(); /* for compatibility */
/* Current directory */
{
diff -r 65407a437327 -r 339963bcff24 src/java.base/unix/native/libjsig/jsig.c
--- a/src/java.base/unix/native/libjsig/jsig.c Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/unix/native/libjsig/jsig.c Mon Nov 12 11:10:16 2018 +0530
@@ -77,7 +77,7 @@
/* Used to synchronize the installation of signal handlers. */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-static pthread_t tid = 0;
+static pthread_t tid;
typedef void (*sa_handler_t)(int);
typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
@@ -110,8 +110,11 @@
/* When the jvm is installing its set of signal handlers, threads
* other than the jvm thread should wait. */
if (jvm_signal_installing) {
- if (tid != pthread_self()) {
- pthread_cond_wait(&cond, &mutex);
+ /* tid is not initialized until jvm_signal_installing is set to true. */
+ if (pthread_equal(tid, pthread_self()) == 0) {
+ do {
+ pthread_cond_wait(&cond, &mutex);
+ } while (jvm_signal_installing);
}
}
}
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/java/lang/ProcessImpl.java
--- a/src/java.base/windows/classes/java/lang/ProcessImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/java/lang/ProcessImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
import jdk.internal.ref.CleanerFactory;
/* This class is for the exclusive use of ProcessBuilder.start() to
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java
--- a/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -25,8 +25,8 @@
package java.net;
import java.io.IOException;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
/**
* This class defines the plain DatagramSocketImpl that is used on
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/java/net/PlainSocketImpl.java
--- a/src/java.base/windows/classes/java/net/PlainSocketImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/java/net/PlainSocketImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -27,10 +27,10 @@
import java.io.IOException;
import java.io.FileDescriptor;
import java.security.AccessController;
-import java.security.PrivilegedAction;
+
import sun.security.action.GetPropertyAction;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
/**
* On Windows system we simply delegate to native methods.
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java
--- a/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -27,8 +27,8 @@
import java.io.FileDescriptor;
import java.io.IOException;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
import sun.security.action.GetPropertyAction;
import java.io.File;
import java.nio.CharBuffer;
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java
--- a/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
import java.nio.BufferOverflowException;
import java.io.IOException;
import java.io.FileDescriptor;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
/**
* Windows implementation of AsynchronousFileChannel using overlapped I/O.
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java
--- a/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/classes/sun/nio/fs/WindowsChannelFactory.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -34,8 +34,8 @@
import java.nio.file.StandardOpenOption;
import java.util.Set;
-import jdk.internal.misc.JavaIOFileDescriptorAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaIOFileDescriptorAccess;
+import jdk.internal.access.SharedSecrets;
import sun.nio.ch.FileChannelImpl;
import sun.nio.ch.ThreadPool;
import sun.nio.ch.WindowsAsynchronousFileChannelImpl;
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/native/libjava/java_props_md.c
--- a/src/java.base/windows/native/libjava/java_props_md.c Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/native/libjava/java_props_md.c Mon Nov 12 11:10:16 2018 +0530
@@ -661,12 +661,6 @@
userDefaultUILang = userDefaultLCID;
}
- SetupI18nProps(userDefaultUILang,
- &sprops.language,
- &sprops.script,
- &sprops.country,
- &sprops.variant,
- &display_encoding);
SetupI18nProps(userDefaultLCID,
&sprops.format_language,
&sprops.format_script,
@@ -710,17 +704,12 @@
}
sprops.unicode_encoding = "UnicodeLittle";
- /* User TIMEZONE */
- {
- /*
- * We defer setting up timezone until it's actually necessary.
- * Refer to TimeZone.getDefault(). However, the system
- * property is necessary to be able to be set by the command
- * line interface -D. Here temporarily set a null string to
- * timezone.
- */
- sprops.timezone = "";
- }
+
+ /* User TIMEZONE
+ * We defer setting up timezone until it's actually necessary.
+ * Refer to TimeZone.getDefault(). The system property
+ * is able to be set by the command line interface -Duser.timezone.
+ */
/* Current directory */
{
diff -r 65407a437327 -r 339963bcff24 src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c
--- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c Mon Nov 12 11:10:16 2018 +0530
@@ -311,8 +311,10 @@
HANDLE handle = FindFirstFileW(lpFileName, &data);
if (handle != INVALID_HANDLE_VALUE) {
jstring name = (*env)->NewString(env, data.cFileName, (jsize)wcslen(data.cFileName));
- if (name == NULL)
+ if (name == NULL) {
+ FindClose(handle);
return;
+ }
(*env)->SetLongField(env, obj, findFirst_handle, ptr_to_jlong(handle));
(*env)->SetObjectField(env, obj, findFirst_name, name);
(*env)->SetIntField(env, obj, findFirst_attributes, data.dwFileAttributes);
@@ -362,8 +364,10 @@
handle = FindFirstStreamW(lpFileName, FindStreamInfoStandard, &data, 0);
if (handle != INVALID_HANDLE_VALUE) {
jstring name = (*env)->NewString(env, data.cStreamName, (jsize)wcslen(data.cStreamName));
- if (name == NULL)
+ if (name == NULL) {
+ FindClose(handle);
return;
+ }
(*env)->SetLongField(env, obj, findStream_handle, ptr_to_jlong(handle));
(*env)->SetObjectField(env, obj, findStream_name, name);
} else {
diff -r 65407a437327 -r 339963bcff24 src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java
--- a/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java Mon Nov 12 11:10:16 2018 +0530
@@ -143,11 +143,26 @@
* simply because a {@code module-info} file for that module was
* created.
*
+ * Note: An implementation of this method typically performs
+ * an internal conversion from the runtime reflective
+ * representation of an annotation type as a {@code Class} object
+ * to a different representation used for annotation
+ * processing. The set of annotation types present in the runtime
+ * context may differ from the set of annotation types present in
+ * the context of annotation processing in a particular
+ * environmental configuration. If an runtime annotation type is
+ * not present in the annotation processing context, the situation
+ * is not treated as an error and no elements are found for that
+ * annotation type.
+ *
* @param a annotation type being requested
* @return the elements annotated with the given annotation type,
* or an empty set if there are none
* @throws IllegalArgumentException if the argument does not
* represent an annotation type
+ *
+ * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)
+ * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class)
*/
Set extends Element> getElementsAnnotatedWith(Class extends Annotation> a);
@@ -155,6 +170,18 @@
* Returns the elements annotated with one or more of the given
* annotation types.
*
+ *
Note: An implementation of this method typically performs
+ * an internal conversion from the runtime reflective
+ * representation of an annotation type as a {@code Class} object
+ * to a different representation used for annotation
+ * processing. The set of annotation types present in the runtime
+ * context may differ from the set of annotation types present in
+ * the context of annotation processing in a particular
+ * environmental configuration. If an runtime annotation type is
+ * not present in the annotation processing context, the situation
+ * is not treated as an error and no elements are found for that
+ * annotation type.
+ *
* @apiNote This method may be useful when processing repeating
* annotations by looking for an annotation type and its
* containing annotation type at the same time.
@@ -172,6 +199,10 @@
* @throws IllegalArgumentException if the any elements of the
* argument set do not represent an annotation type
* @jls 9.6.3 Repeatable Annotation Types
+ *
+ * @see javax.lang.model.AnnotatedConstruct#getAnnotation(Class)
+ * @see javax.lang.model.AnnotatedConstruct#getAnnotationsByType(Class)
+ *
* @since 9
*/
default Set extends Element> getElementsAnnotatedWithAny(Set> annotations){
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java
--- a/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, 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
@@ -50,7 +50,7 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
/**
* The main class to parse JavaBeans XML archive.
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/java/awt/EventQueue.java
--- a/src/java.desktop/share/classes/java/awt/EventQueue.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/java/awt/EventQueue.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, 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
@@ -47,8 +47,8 @@
import java.security.AccessControlContext;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
/**
* {@code EventQueue} is a platform-independent class
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java
--- a/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/java/awt/font/JavaAWTFontAccessImpl.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -25,7 +25,7 @@
package java.awt.font;
-import jdk.internal.misc.JavaAWTFontAccess;
+import jdk.internal.access.JavaAWTFontAccess;
class JavaAWTFontAccessImpl implements JavaAWTFontAccess {
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/java/awt/font/NumericShaper.java
--- a/src/java.desktop/share/classes/java/awt/font/NumericShaper.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/java/awt/font/NumericShaper.java Mon Nov 12 11:10:16 2018 +0530
@@ -31,7 +31,7 @@
import java.util.Comparator;
import java.util.EnumSet;
import java.util.Set;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
/**
* The {@code NumericShaper} class is used to convert Latin-1 (European)
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/java/awt/font/TextAttribute.java
--- a/src/java.desktop/share/classes/java/awt/font/TextAttribute.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/java/awt/font/TextAttribute.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -44,7 +44,7 @@
import java.text.AttributedCharacterIterator.Attribute;
import java.util.Map;
import java.util.HashMap;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
/**
* The {@code TextAttribute} class defines attribute keys and
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/java/beans/Introspector.java
--- a/src/java.desktop/share/classes/java/beans/Introspector.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/java/beans/Introspector.java Mon Nov 12 11:10:16 2018 +0530
@@ -42,15 +42,14 @@
import java.util.Map;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.EventObject;
import java.util.List;
import java.util.TreeMap;
-import jdk.internal.misc.JavaBeansAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaBeansAccess;
+import jdk.internal.access.SharedSecrets;
import sun.reflect.misc.ReflectUtil;
/**
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/javax/swing/RepaintManager.java
--- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java Mon Nov 12 11:10:16 2018 +0530
@@ -35,8 +35,8 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.applet.*;
-import jdk.internal.misc.JavaSecurityAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
+import jdk.internal.access.SharedSecrets;
import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.DisplayChangedListener;
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/javax/swing/TransferHandler.java
--- a/src/java.desktop/share/classes/javax/swing/TransferHandler.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/javax/swing/TransferHandler.java Mon Nov 12 11:10:16 2018 +0530
@@ -46,9 +46,9 @@
import java.security.PrivilegedAction;
import java.security.AccessControlContext;
-import java.security.ProtectionDomain;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.misc.JavaSecurityAccess;
+
+import jdk.internal.access.SharedSecrets;
+import jdk.internal.access.JavaSecurityAccess;
import sun.awt.AWTAccessor;
diff -r 65407a437327 -r 339963bcff24 src/java.desktop/share/classes/sun/awt/AppContext.java
--- a/src/java.desktop/share/classes/sun/awt/AppContext.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.desktop/share/classes/sun/awt/AppContext.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -44,8 +44,8 @@
import java.beans.PropertyChangeListener;
import java.lang.ref.SoftReference;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
import sun.util.logging.PlatformLogger;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
diff -r 65407a437327 -r 339963bcff24 src/java.logging/share/classes/java/util/logging/Level.java
--- a/src/java.logging/share/classes/java/util/logging/Level.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.logging/share/classes/java/util/logging/Level.java Mon Nov 12 11:10:16 2018 +0530
@@ -40,8 +40,8 @@
import java.util.ResourceBundle;
import java.util.function.Function;
import jdk.internal.loader.ClassLoaderValue;
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
/**
* The Level class defines a set of standard logging levels that
diff -r 65407a437327 -r 339963bcff24 src/java.logging/share/classes/java/util/logging/LogManager.java
--- a/src/java.logging/share/classes/java/util/logging/LogManager.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.logging/share/classes/java/util/logging/LogManager.java Mon Nov 12 11:10:16 2018 +0530
@@ -39,8 +39,8 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import jdk.internal.misc.JavaAWTAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaAWTAccess;
+import jdk.internal.access.SharedSecrets;
import sun.util.logging.internal.LoggingProviderImpl;
import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
diff -r 65407a437327 -r 339963bcff24 src/java.logging/share/classes/java/util/logging/Logger.java
--- a/src/java.logging/share/classes/java/util/logging/Logger.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.logging/share/classes/java/util/logging/Logger.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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
@@ -37,8 +37,8 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Supplier;
-import jdk.internal.misc.JavaUtilResourceBundleAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaUtilResourceBundleAccess;
+import jdk.internal.access.SharedSecrets;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
diff -r 65407a437327 -r 339963bcff24 src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java
--- a/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.management/share/classes/com/sun/jmx/mbeanserver/JavaBeansAccessor.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -26,8 +26,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import jdk.internal.misc.JavaBeansAccess;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.JavaBeansAccess;
+import jdk.internal.access.SharedSecrets;
/**
* A centralized place for gaining access to java.beans related functionality -
diff -r 65407a437327 -r 339963bcff24 src/java.management/share/classes/java/lang/management/package.html
--- a/src/java.management/share/classes/java/lang/management/package.html Mon Nov 12 10:55:49 2018 +0530
+++ b/src/java.management/share/classes/java/lang/management/package.html Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
@@ -68,28 +74,28 @@
// i.e. GC type plus GC conifg
switch(testType) {
case "G1":
- argcount = 8;
+ argcount = 9;
procArgs = new String[argcount];
procArgs[argcount - 2] = "-XX:+UseG1GC";
break;
case "Parallel":
- argcount = 8;
+ argcount = 9;
procArgs = new String[argcount];
procArgs[argcount - 2] = "-XX:+UseParallelGC";
break;
case "Serial":
- argcount = 8;
+ argcount = 9;
procArgs = new String[argcount];
procArgs[argcount - 2] = "-XX:+UseSerialGC";
break;
case "CMS":
- argcount = 9 ;
+ argcount = 10;
procArgs = new String[argcount];
procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC";
procArgs[argcount - 2] = "-XX:-UseCondCardMark";
break;
case "CMSCondMark":
- argcount = 9 ;
+ argcount = 10;
procArgs = new String[argcount];
procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC";
procArgs[argcount - 2] = "-XX:+UseCondCardMark";
@@ -106,14 +112,34 @@
// disable the transform.
procArgs[0] = "-XX:-UseBarriersForVolatile";
+ procArgs[1] = "-XX:+UseCompressedOops";
- procArgs[1] = "-XX:-TieredCompilation";
- procArgs[2] = "-XX:+PrintOptoAssembly";
- procArgs[3] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
- procArgs[4] = "--add-exports";
- procArgs[5] = "java.base/jdk.internal.misc=ALL-UNNAMED";
+ procArgs[2] = "-XX:-TieredCompilation";
+ procArgs[3] = "-XX:+PrintOptoAssembly";
+ procArgs[4] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
+ procArgs[5] = "--add-exports";
+ procArgs[6] = "java.base/jdk.internal.misc=ALL-UNNAMED";
procArgs[argcount - 1] = fullclassname;
+ runtest(classname, testType, false, true, procArgs);
+ // rerun the test class without the transform applied and
+ // check the alternative generation is as expected
+
+ procArgs[0] = "-XX:+UseBarriersForVolatile";
+ runtest(classname, testType, true, true, procArgs);
+
+ if (!classname.equals("TestUnsafeVolatileGAA")) {
+ procArgs[0] = "-XX:-UseBarriersForVolatile";
+ procArgs[1] = "-XX:-UseCompressedOops";
+ runtest(classname, testType, false, false, procArgs);
+
+ procArgs[0] = "-XX:+UseBarriersForVolatile";
+ runtest(classname, testType, true, false, procArgs);
+ }
+ }
+
+
+ public void runtest(String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops, String[] procArgs) throws Throwable {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
@@ -125,23 +151,7 @@
// appropriate to test class, test type and whether transform
// was applied
- checkoutput(output, classname, testType, false);
-
- // rerun the test class without the transform applied and
- // check the alternative generation is as expected
-
- procArgs[0] = "-XX:+UseBarriersForVolatile";
-
- pb = ProcessTools.createJavaProcessBuilder(procArgs);
- output = new OutputAnalyzer(pb.start());
-
- output.stderrShouldBeEmptyIgnoreVMWarnings();
- output.stdoutShouldNotBeEmpty();
- output.shouldHaveExitValue(0);
-
- // again check the output for the correct asm sequence
-
- checkoutput(output, classname, testType, true);
+ checkoutput(output, classname, testType, useBarriersForVolatile, useCompressedOops);
}
// skip through output returning a line containing the desireed
@@ -150,7 +160,7 @@
{
while (iter.hasNext()) {
String nextLine = iter.next();
- if (nextLine.contains(substring)) {
+ if (nextLine.matches(".*" + substring + ".*")) {
return nextLine;
}
}
@@ -163,7 +173,7 @@
// n.b. the spawned JVM's output is included in the exception
// message to make it easeir to identify what is missing.
- private void checkCompile(Iterator iter, String methodname, String[] expected, OutputAnalyzer output)
+ private boolean checkCompile(Iterator iter, String methodname, String[] expected, OutputAnalyzer output, boolean do_throw)
{
// trace call to allow eyeball check of what we are checking against
System.out.println("checkCompile(" + methodname + ",");
@@ -176,30 +186,43 @@
System.out.println(" })");
// look for the start of an opto assembly print block
- String match = skipTo(iter, "{method}");
+ String match = skipTo(iter, Pattern.quote("{method}"));
if (match == null) {
- throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput());
+ if (do_throw) {
+ throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput());
+ }
+ return false;
}
// check the compiled method name is right
- match = skipTo(iter, "- name:");
+ match = skipTo(iter, Pattern.quote("- name:"));
if (match == null) {
- throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput());
+ if (do_throw) {
+ throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput());
+ }
+ return false;
}
if (!match.contains(methodname)) {
- throw new RuntimeException("Wrong method " + match + "!\n -- expecting " + methodname + "\n\n" + output.getOutput());
+ if (do_throw) {
+ throw new RuntimeException("Wrong method " + match + "!\n -- expecting " + methodname + "\n\n" + output.getOutput());
+ }
+ return false;
}
// make sure we can match each expected term in order
for (String s : expected) {
match = skipTo(iter, s);
if (match == null) {
- throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput());
+ if (do_throw) {
+ throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput());
+ }
+ return false;
}
}
+ return true;
}
// check for expected asm output from a volatile load
- private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+ private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
{
Iterator iter = output.asLines().listIterator();
@@ -211,7 +234,7 @@
if (!useBarriersForVolatile) {
matches = new String[] {
"ldarw",
- "membar_acquire (elided)",
+ "membar_acquire \\(elided\\)",
"ret"
};
} else {
@@ -223,15 +246,30 @@
};
}
- checkCompile(iter, "testInt", matches, output);
+ checkCompile(iter, "testInt", matches, output, true);
- checkCompile(iter, "testObj", matches, output) ;
+ if (!useBarriersForVolatile) {
+ matches = new String[] {
+ useCompressedOops ? "ldarw?" : "ldar",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ } else {
+ matches = new String[] {
+ useCompressedOops ? "ldrw?" : "ldr",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ }
+
+ checkCompile(iter, "testObj", matches, output, true);
}
// check for expected asm output from a volatile store
- private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+ private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
{
Iterator iter = output.asLines().listIterator();
@@ -241,9 +279,9 @@
if (!useBarriersForVolatile) {
// this is the sequence of instructions for all cases
matches = new String[] {
- "membar_release (elided)",
+ "membar_release \\(elided\\)",
"stlrw",
- "membar_volatile (elided)",
+ "membar_volatile \\(elided\\)",
"ret"
};
} else {
@@ -258,7 +296,7 @@
};
}
- checkCompile(iter, "testInt", matches, output);
+ checkCompile(iter, "testInt", matches, output, true);
// object stores will be as above except for when the GC
// introduces barriers for card marking
@@ -268,9 +306,9 @@
default:
// this is the basic sequence of instructions
matches = new String[] {
- "membar_release (elided)",
- "stlrw",
- "membar_volatile (elided)",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "stlrw?" : "stlr",
+ "membar_volatile \\(elided\\)",
"ret"
};
break;
@@ -278,12 +316,12 @@
// a card mark volatile barrier should be generated
// before the card mark strb
matches = new String[] {
- "membar_release (elided)",
- "stlrw",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "stlrw?" : "stlr",
"membar_volatile",
"dmb ish",
"strb",
- "membar_volatile (elided)",
+ "membar_volatile \\(elided\\)",
"ret"
};
break;
@@ -292,13 +330,13 @@
// before the card mark strb from the StoreCM and the
// storestore barrier from the StoreCM should be elided
matches = new String[] {
- "membar_release (elided)",
- "stlrw",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "stlrw?" : "stlr",
"membar_volatile",
"dmb ish",
- "storestore (elided)",
+ "storestore \\(elided\\)",
"strb",
- "membar_volatile (elided)",
+ "membar_volatile \\(elided\\)",
"ret"
};
break;
@@ -308,12 +346,12 @@
// storestore barrier from the StoreCM should be
// generated as "dmb ishst"
matches = new String[] {
- "membar_release (elided)",
- "stlrw",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "stlrw?" : "stlr",
"storestore",
"dmb ishst",
"strb",
- "membar_volatile (elided)",
+ "membar_volatile \\(elided\\)",
"ret"
};
break;
@@ -325,7 +363,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "strw",
+ useCompressedOops ? "strw?" : "str",
"membar_volatile",
"dmb ish",
"ret"
@@ -337,7 +375,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "strw",
+ useCompressedOops ? "strw?" : "str",
"membar_volatile",
"dmb ish",
"strb",
@@ -353,10 +391,10 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "strw",
+ useCompressedOops ? "strw?" : "str",
"membar_volatile",
"dmb ish",
- "storestore (elided)",
+ "storestore \\(elided\\)",
"strb",
"membar_volatile",
"dmb ish",
@@ -371,7 +409,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "strw",
+ useCompressedOops ? "strw?" : "str",
"storestore",
"dmb ishst",
"strb",
@@ -383,40 +421,48 @@
}
}
- checkCompile(iter, "testObj", matches, output);
+ checkCompile(iter, "testObj", matches, output, true);
}
// check for expected asm output from a volatile cas
- private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+ private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
{
Iterator iter = output.asLines().listIterator();
String[] matches;
+ String[][] tests = {
+ { "testInt", "cmpxchgw" },
+ { "testLong", "cmpxchg" },
+ { "testByte", "cmpxchgb" },
+ { "testShort", "cmpxchgs" },
+ };
- // non object stores are straightforward
- if (!useBarriersForVolatile) {
- // this is the sequence of instructions for all cases
- matches = new String[] {
- "membar_release (elided)",
- "cmpxchgw_acq",
- "membar_acquire (elided)",
- "ret"
- };
- } else {
- // this is the alternative sequence of instructions
- matches = new String[] {
- "membar_release",
- "dmb ish",
- "cmpxchgw",
- "membar_acquire",
- "dmb ish",
- "ret"
- };
+ for (String[] test : tests) {
+ // non object stores are straightforward
+ if (!useBarriersForVolatile) {
+ // this is the sequence of instructions for all cases
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ test[1] + "_acq",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ } else {
+ // this is the alternative sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ test[1] + " ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ }
+
+ checkCompile(iter, test[0], matches, output, true);
}
- checkCompile(iter, "testInt", matches, output);
-
// object stores will be as above except for when the GC
// introduces barriers for card marking
@@ -425,10 +471,10 @@
default:
// this is the basic sequence of instructions
matches = new String[] {
- "membar_release (elided)",
- "cmpxchgw_acq",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
"strb",
- "membar_acquire (elided)",
+ "membar_acquire \\(elided\\)",
"ret"
};
break;
@@ -436,12 +482,12 @@
// a card mark volatile barrier should be generated
// before the card mark strb
matches = new String[] {
- "membar_release (elided)",
- "cmpxchgw_acq",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
"membar_volatile",
"dmb ish",
"strb",
- "membar_acquire (elided)",
+ "membar_acquire \\(elided\\)",
"ret"
};
break;
@@ -450,13 +496,13 @@
// before the card mark strb from the StoreCM and the
// storestore barrier from the StoreCM should be elided
matches = new String[] {
- "membar_release (elided)",
- "cmpxchgw_acq",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
"membar_volatile",
"dmb ish",
- "storestore (elided)",
+ "storestore \\(elided\\)",
"strb",
- "membar_acquire (elided)",
+ "membar_acquire \\(elided\\)",
"ret"
};
break;
@@ -465,12 +511,12 @@
// before the card mark strb from the StoreCM and the
// storestore barrier from the StoreCM should be elided
matches = new String[] {
- "membar_release (elided)",
- "cmpxchgw_acq",
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
"storestore",
"dmb ishst",
"strb",
- "membar_acquire (elided)",
+ "membar_acquire \\(elided\\)",
"ret"
};
break;
@@ -482,7 +528,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "cmpxchgw",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
"membar_acquire",
"dmb ish",
"ret"
@@ -494,7 +540,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "cmpxchgw",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
"membar_volatile",
"dmb ish",
"strb",
@@ -510,10 +556,191 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "cmpxchgw",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
"membar_volatile",
"dmb ish",
- "storestore (elided)",
+ "storestore \\(elided\\)",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "CMS":
+ // a volatile card mark membar should not be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be generated
+ // as "dmb ishst"
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+ "storestore",
+ "dmb ishst",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ }
+ }
+
+ checkCompile(iter, "testObj", matches, output, true);
+ }
+
+ private void checkcae(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
+ {
+ ListIterator iter = output.asLines().listIterator();
+
+ String[] matches;
+ String[][] tests = {
+ { "testInt", "cmpxchgw" },
+ { "testLong", "cmpxchg" },
+ { "testByte", "cmpxchgb" },
+ { "testShort", "cmpxchgs" },
+ };
+
+ for (String[] test : tests) {
+ // non object stores are straightforward
+ if (!useBarriersForVolatile) {
+ // this is the sequence of instructions for all cases
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ test[1] + "_acq",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ } else {
+ // this is the alternative sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ test[1] + " ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ }
+
+ checkCompile(iter, test[0], matches, output, true);
+ }
+
+ // object stores will be as above except for when the GC
+ // introduces barriers for card marking
+
+ if (!useBarriersForVolatile) {
+ switch (testType) {
+ default:
+ // this is the basic sequence of instructions
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ "strb",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+
+ // card marking store may be scheduled before or after
+ // the cmpxchg so try both sequences.
+ int idx = iter.nextIndex();
+ if (!checkCompile(iter, "testObj", matches, output, false)) {
+ iter = output.asLines().listIterator(idx);
+
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+
+ checkCompile(iter, "testObj", matches, output, true);
+ }
+ return;
+
+ case "G1":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+ "membar_volatile",
+ "dmb ish",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ case "CMSCondMark":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+ "membar_volatile",
+ "dmb ish",
+ "storestore \\(elided\\)",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ case "CMS":
+ // a volatile card mark membar should not be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
+ "storestore",
+ "dmb ishst",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ }
+ } else {
+ switch (testType) {
+ default:
+ // this is the basic sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "G1":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+ "membar_volatile",
+ "dmb ish",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "CMSCondMark":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
+ "membar_volatile",
+ "dmb ish",
+ "storestore \\(elided\\)",
"strb",
"membar_acquire",
"dmb ish",
@@ -528,7 +755,7 @@
matches = new String[] {
"membar_release",
"dmb ish",
- "cmpxchgw",
+ useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
"storestore",
"dmb ishst",
"strb",
@@ -540,12 +767,210 @@
}
}
- checkCompile(iter, "testObj", matches, output);
+ checkCompile(iter, "testObj", matches, output, true);
+ }
+
+ private void checkgas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
+ {
+ Iterator iter = output.asLines().listIterator();
+
+ String[] matches;
+ String[][] tests = {
+ { "testInt", "atomic_xchgw" },
+ { "testLong", "atomic_xchg" },
+ };
+
+ for (String[] test : tests) {
+ // non object stores are straightforward
+ if (!useBarriersForVolatile) {
+ // this is the sequence of instructions for all cases
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ test[1] + "_acq",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ } else {
+ // this is the alternative sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ test[1] + " ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ }
+
+ checkCompile(iter, test[0], matches, output, true);
+ }
+
+ // object stores will be as above except for when the GC
+ // introduces barriers for card marking
+
+ if (!useBarriersForVolatile) {
+ switch (testType) {
+ default:
+ // this is the basic sequence of instructions
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ case "G1":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+ "membar_volatile",
+ "dmb ish",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ case "CMSCondMark":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+ "membar_volatile",
+ "dmb ish",
+ "storestore \\(elided\\)",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ case "CMS":
+ // a volatile card mark membar should not be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
+ "storestore",
+ "dmb ishst",
+ "strb",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ break;
+ }
+ } else {
+ switch (testType) {
+ default:
+ // this is the basic sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "G1":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+ "membar_volatile",
+ "dmb ish",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "CMSCondMark":
+ // a card mark volatile barrier should be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be elided
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+ "membar_volatile",
+ "dmb ish",
+ "storestore \\(elided\\)",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ case "CMS":
+ // a volatile card mark membar should not be generated
+ // before the card mark strb from the StoreCM and the
+ // storestore barrier from the StoreCM should be generated
+ // as "dmb ishst"
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
+ "storestore",
+ "dmb ishst",
+ "strb",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ break;
+ }
+ }
+
+ checkCompile(iter, "testObj", matches, output, true);
+ }
+
+ private void checkgaa(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
+ {
+ Iterator iter = output.asLines().listIterator();
+
+ String[] matches;
+ String[][] tests = {
+ { "testInt", "get_and_addI" },
+ { "testLong", "get_and_addL" },
+ };
+
+ for (String[] test : tests) {
+ // non object stores are straightforward
+ if (!useBarriersForVolatile) {
+ // this is the sequence of instructions for all cases
+ matches = new String[] {
+ "membar_release \\(elided\\)",
+ test[1] + "_acq",
+ "membar_acquire \\(elided\\)",
+ "ret"
+ };
+ } else {
+ // this is the alternative sequence of instructions
+ matches = new String[] {
+ "membar_release",
+ "dmb ish",
+ test[1] + " ",
+ "membar_acquire",
+ "dmb ish",
+ "ret"
+ };
+ }
+
+ checkCompile(iter, test[0], matches, output, true);
+ }
+
}
// perform a check appropriate to the classname
- private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile) throws Throwable
+ private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
{
// trace call to allow eyeball check of what is being checked
System.out.println("checkoutput(" +
@@ -556,19 +981,29 @@
switch (classname) {
case "TestVolatileLoad":
- checkload(output, testType, useBarriersForVolatile);
+ checkload(output, testType, useBarriersForVolatile, useCompressedOops);
break;
case "TestVolatileStore":
- checkstore(output, testType, useBarriersForVolatile);
+ checkstore(output, testType, useBarriersForVolatile, useCompressedOops);
break;
case "TestUnsafeVolatileLoad":
- checkload(output, testType, useBarriersForVolatile);
+ checkload(output, testType, useBarriersForVolatile, useCompressedOops);
break;
case "TestUnsafeVolatileStore":
- checkstore(output, testType, useBarriersForVolatile);
+ checkstore(output, testType, useBarriersForVolatile, useCompressedOops);
break;
case "TestUnsafeVolatileCAS":
- checkcas(output, testType, useBarriersForVolatile);
+ case "TestUnsafeVolatileWeakCAS":
+ checkcas(output, testType, useBarriersForVolatile, useCompressedOops);
+ break;
+ case "TestUnsafeVolatileCAE":
+ checkcae(output, testType, useBarriersForVolatile, useCompressedOops);
+ break;
+ case "TestUnsafeVolatileGAS":
+ checkgas(output, testType, useBarriersForVolatile, useCompressedOops);
+ break;
+ case "TestUnsafeVolatileGAA":
+ checkgaa(output, testType, useBarriersForVolatile);
break;
}
}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java Mon Nov 12 11:10:16 2018 +0530
@@ -38,6 +38,9 @@
* compiler.c2.aarch64.TestVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileCAE
+ * compiler.c2.aarch64.TestUnsafeVolatileGAS
*
* @run driver compiler.c2.aarch64.TestVolatilesCMS
* TestVolatileLoad CMS
@@ -53,6 +56,15 @@
*
* @run driver compiler.c2.aarch64.TestVolatilesCMS
* TestUnsafeVolatileCAS CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ * TestUnsafeVolatileWeakCAS CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ * TestUnsafeVolatileCAE CMS
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMS
+ * TestUnsafeVolatileGAS CMS
*/
package compiler.c2.aarch64;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java Mon Nov 12 11:10:16 2018 +0530
@@ -38,6 +38,9 @@
* compiler.c2.aarch64.TestVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileCAE
+ * compiler.c2.aarch64.TestUnsafeVolatileGAS
*
* @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
* TestVolatileLoad CMSCondMark
@@ -53,6 +56,15 @@
*
* @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
* TestUnsafeVolatileCAS CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ * TestUnsafeVolatileWeakCAS CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ * TestUnsafeVolatileCAE CMSCondMark
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark
+ * TestUnsafeVolatileGAS CMSCondMark
*/
package compiler.c2.aarch64;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java Mon Nov 12 11:10:16 2018 +0530
@@ -38,6 +38,10 @@
* compiler.c2.aarch64.TestVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileCAE
+ * compiler.c2.aarch64.TestUnsafeVolatileGAS
+ * compiler.c2.aarch64.TestUnsafeVolatileGAA
*
* @run driver compiler.c2.aarch64.TestVolatilesG1
* TestVolatileLoad G1
@@ -53,8 +57,21 @@
*
* @run driver compiler.c2.aarch64.TestVolatilesG1
* TestUnsafeVolatileCAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ * TestUnsafeVolatileWeakCAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ * TestUnsafeVolatileCAE G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ * TestUnsafeVolatileGAS G1
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesG1
+ * TestUnsafeVolatileGAA G1
*/
+
package compiler.c2.aarch64;
public class TestVolatilesG1 {
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java Mon Nov 12 11:10:16 2018 +0530
@@ -38,6 +38,9 @@
* compiler.c2.aarch64.TestVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileCAE
+ * compiler.c2.aarch64.TestUnsafeVolatileGAS
*
* @run driver compiler.c2.aarch64.TestVolatilesParallel
* TestVolatileLoad Parallel
@@ -53,6 +56,15 @@
*
* @run driver compiler.c2.aarch64.TestVolatilesParallel
* TestUnsafeVolatileCAS Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ * TestUnsafeVolatileWeakCAS Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ * TestUnsafeVolatileCAE Parallel
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesParallel
+ * TestUnsafeVolatileGAS Parallel
*/
package compiler.c2.aarch64;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java Mon Nov 12 11:10:16 2018 +0530
@@ -38,6 +38,9 @@
* compiler.c2.aarch64.TestVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileStore
* compiler.c2.aarch64.TestUnsafeVolatileCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileWeakCAS
+ * compiler.c2.aarch64.TestUnsafeVolatileCAE
+ * compiler.c2.aarch64.TestUnsafeVolatileGAS
*
* @run driver compiler.c2.aarch64.TestVolatilesSerial
* TestVolatileLoad Serial
@@ -53,6 +56,15 @@
*
* @run driver compiler.c2.aarch64.TestVolatilesSerial
* TestUnsafeVolatileCAS Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ * TestUnsafeVolatileWeakCAS Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ * TestUnsafeVolatileCAE Serial
+ *
+ * @run driver compiler.c2.aarch64.TestVolatilesSerial
+ * TestUnsafeVolatileGAS Serial
*/
package compiler.c2.aarch64;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8212673
+ * @summary Node::eqv_uncast() shouldn't step over load barriers unconditionally
+ * @library /test/lib /
+ * @modules java.base/jdk.internal.misc
+ *
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseOnStackReplacement -XX:-TieredCompilation -XX:-BackgroundCompilation EqvUncastStepOverBarrier
+ */
+
+import sun.hotspot.WhiteBox;
+import java.lang.reflect.Method;
+
+public class EqvUncastStepOverBarrier {
+ static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+
+ private static Object field = new A();
+
+ public static void main(String[] args) throws Exception {
+ for (int i = 0; i < 20_000; i++) {
+ test();
+ test();
+ test_helper(null, 0);
+ }
+ Method m = EqvUncastStepOverBarrier.class.getDeclaredMethod("test");
+ WHITE_BOX.enqueueMethodForCompilation(m, 4);
+ if (!WHITE_BOX.isMethodCompiled(m, false)) {
+ throw new RuntimeException("Method compilation failed");
+ }
+ }
+
+ private static Object test() {
+ Object o = field;
+ if (o == null) {}
+ for (int i = 1; i < 100; i *= 2) {
+ int j = 0;
+ for (; j < 4; j++) ;
+ o = test_helper(o, j);
+ }
+ return o;
+ }
+
+ private static Object test_helper(Object o, int j) {
+ if (j == 4) {
+ A a = (A) o;
+ o = a;
+ } else {
+ o = new Object();
+ }
+ return o;
+ }
+
+ private static class A {
+ }
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
--- a/test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -115,16 +115,15 @@
mainAttrs.putValue("Can-Redefine-Classes", "true");
mainAttrs.putValue("Can-Retransform-Classes", "true");
- Path jar = Files.createTempFile("myagent", ".jar");
- try {
- JarOutputStream jarStream = new JarOutputStream(new FileOutputStream(jar.toFile()), manifest);
- add(jarStream, FooAgent.class);
- add(jarStream, FooTransformer.class);
- jarStream.close();
- runAgent(jar);
- } finally {
- Files.deleteIfExists(jar);
- }
+ // The jar file will be added to the system classloader search path. It is not safe
+ // to delete it while the JVM is running, so make sure to create it in the test
+ // directory so it will be cleaned up by the test harness.
+ Path jar = Files.createTempFile(Path.of(""), "myagent", ".jar");
+ JarOutputStream jarStream = new JarOutputStream(new FileOutputStream(jar.toFile()), manifest);
+ add(jarStream, FooAgent.class);
+ add(jarStream, FooTransformer.class);
+ jarStream.close();
+ runAgent(jar);
}
public static void runAgent(Path agent) throws Exception {
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -28,7 +28,7 @@
import compiler.jvmci.common.testcases.MultipleImplementersInterface;
import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes;
import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry;
-import jdk.internal.misc.SharedSecrets;
+import jdk.internal.access.SharedSecrets;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.reflect.ConstantPool;
import jdk.internal.reflect.ConstantPool.Tag;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -28,7 +28,7 @@
* @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupTypeTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupTypeTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupTypeTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library / /test/lib
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* jdk.internal.vm.ci/jdk.vm.ci.hotspot
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,8 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
+ * java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -28,7 +28,7 @@
* @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method
* @library /test/lib /
* @library ../common/patches
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.base/jdk.internal.reflect
* java.base/jdk.internal.org.objectweb.asm
* jdk.internal.vm.ci/jdk.vm.ci.hotspot
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java
--- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java Mon Nov 12 11:10:16 2018 +0530
@@ -33,10 +33,15 @@
package jdk.vm.ci.runtime.test;
-import jdk.vm.ci.meta.ResolvedJavaField;
-import jdk.vm.ci.meta.ResolvedJavaMethod;
-import org.junit.Test;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -45,10 +50,13 @@
import java.util.Map;
import java.util.Set;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.Assert;
+import org.junit.Test;
+
+import jdk.vm.ci.meta.ResolvedJavaField;
+import jdk.vm.ci.meta.ResolvedJavaMethod;
+import jdk.vm.ci.meta.ResolvedJavaType;
+import jdk.vm.ci.runtime.test.TestResolvedJavaField.TestClassLoader;
/**
* Tests for {@link ResolvedJavaField}.
@@ -134,4 +142,89 @@
}
}
}
+ static class TestClassLoader extends ClassLoader {
+
+ @Override
+ protected Class> findClass(final String name) {
+ if (!name.equals(TypeWithUnresolvedFieldType.class.getName())) {
+ try {
+ return super.findClass(name);
+ } catch (ClassNotFoundException e) {
+ throw new AssertionError("unexpected: " + e);
+ }
+ }
+ // copy classfile to byte array
+ byte[] classData = null;
+ try {
+ String simpleName = TypeWithUnresolvedFieldType.class.getSimpleName();
+ InputStream is = TypeWithUnresolvedFieldType.class.getResourceAsStream(simpleName + ".class");
+ assert is != null;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ byte[] buf = new byte[1024];
+ int size;
+ while ((size = is.read(buf, 0, buf.length)) != -1) {
+ baos.write(buf, 0, size);
+ }
+ baos.flush();
+ classData = baos.toByteArray();
+ } catch (IOException e) {
+ Assert.fail("can't access class: " + name);
+ }
+
+ // replace all occurrences of "PrintStream" in classfile
+ int index = -1;
+
+ while ((index = indexOf(classData, index + 1, "PrintStream")) != -1) {
+ replace(classData, index, "XXXXXXXXXXX");
+ }
+
+ Class> c = defineClass(null, classData, 0, classData.length);
+ return c;
+ }
+
+ private static int indexOf(byte[] b, int index, String find) {
+ for (int i = index; i < b.length; i++) {
+ boolean match = true;
+ for (int j = i; j < i + find.length(); j++) {
+ if (b[j] != (byte) find.charAt(j - i)) {
+ match = false;
+ break;
+ }
+ }
+ if (match) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ private static void replace(byte[] b, int index, String replace) {
+ for (int i = index; i < index + replace.length(); i++) {
+ b[i] = (byte) replace.charAt(i - index);
+ }
+ }
+ }
+
+ /**
+ * Tests that calling {@link ResolvedJavaField#getType()} does not cause a linkage error if the
+ * type of the field is not resolvable.
+ */
+ @Test
+ public void testGetType() {
+ Class> c = new TestClassLoader().findClass(TypeWithUnresolvedFieldType.class.getName());
+ ResolvedJavaType type = metaAccess.lookupJavaType(c);
+ for (ResolvedJavaField field : type.getInstanceFields(false)) {
+ assertTrue(field.getName().equals("fieldWithUnresolvableType"));
+ field.getType();
+ field.toString();
+ }
+ }
}
+
+class TypeWithUnresolvedFieldType {
+ /**
+ * {@link TestClassLoader} will rewrite the type of this field to "Ljava/io/XXXXXXXXXXX;".
+ */
+ PrintStream fieldWithUnresolvableType;
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/unsafe/CASandCAEwithNegExpected.java Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8211320
+ * @summary Aarch64: unsafe.compareAndSetByte() and unsafe.compareAndSetShort() c2 intrinsics broken with negative expected value
+ *
+ * @modules java.base/jdk.internal.misc
+ * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation CASandCAEwithNegExpected
+ */
+
+import java.lang.reflect.Field;
+import jdk.internal.misc.Unsafe;
+
+public class CASandCAEwithNegExpected {
+ public volatile int f_int = -1;
+ public volatile long f_long = -1;
+ public volatile byte f_byte = -1;
+ public volatile short f_short = -1;
+
+ public static Unsafe unsafe = Unsafe.getUnsafe();
+ public static Field f_int_field;
+ public static Field f_long_field;
+ public static Field f_byte_field;
+ public static Field f_short_field;
+ public static long f_int_off;
+ public static long f_long_off;
+ public static long f_byte_off;
+ public static long f_short_off;
+
+ static {
+ try {
+ f_int_field = CASandCAEwithNegExpected.class.getField("f_int");
+ f_long_field = CASandCAEwithNegExpected.class.getField("f_long");
+ f_byte_field = CASandCAEwithNegExpected.class.getField("f_byte");
+ f_short_field = CASandCAEwithNegExpected.class.getField("f_short");
+ f_int_off = unsafe.objectFieldOffset(f_int_field);
+ f_long_off = unsafe.objectFieldOffset(f_long_field);
+ f_byte_off = unsafe.objectFieldOffset(f_byte_field);
+ f_short_off = unsafe.objectFieldOffset(f_short_field);
+ } catch (Exception e) {
+ System.out.println("reflection failed " + e);
+ e.printStackTrace();
+ }
+ }
+
+ static public void main(String[] args) {
+ CASandCAEwithNegExpected t = new CASandCAEwithNegExpected();
+ for (int i = 0; i < 20_000; i++) {
+ t.test();
+ }
+ }
+
+ // check proper handling of sign extension of expected value in comparison
+ void test() {
+ f_int = -1;
+ f_long = -1;
+ f_byte = -1;
+ f_short = -1;
+
+ unsafe.compareAndSetInt(this, f_int_off, -1, 42);
+ if (f_int != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+ unsafe.compareAndSetLong(this, f_long_off, -1, 42);
+ if (f_long != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+ unsafe.compareAndSetByte(this, f_byte_off, (byte)-1, (byte)42);
+ if (f_byte != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+ unsafe.compareAndSetShort(this, f_short_off, (short)-1, (short)42);
+ if (f_short != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+
+ f_int = -1;
+ f_long = -1;
+ f_byte = -1;
+ f_short = -1;
+
+ unsafe.compareAndExchangeInt(this, f_int_off, -1, 42);
+ if (f_int != 42) {
+ throw new RuntimeException("CAE failed");
+ }
+ unsafe.compareAndExchangeLong(this, f_long_off, -1, 42);
+ if (f_long != 42) {
+ throw new RuntimeException("CAE failed");
+ }
+ unsafe.compareAndExchangeByte(this, f_byte_off, (byte)-1, (byte)42);
+ if (f_byte != 42) {
+ throw new RuntimeException("CAE failed");
+ }
+ unsafe.compareAndExchangeShort(this, f_short_off, (short)-1, (short)42);
+ if (f_short != 42) {
+ throw new RuntimeException("CAE failed");
+ }
+
+ f_int = -1;
+ f_long = -1;
+ f_byte = -1;
+ f_short = -1;
+
+ if (unsafe.weakCompareAndSetInt(this, f_int_off, -1, 42) && f_int != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+
+ if (unsafe.weakCompareAndSetLong(this, f_long_off, -1, 42) && f_long != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+
+ if (unsafe.weakCompareAndSetByte(this, f_byte_off, (byte)-1, (byte)42) && f_byte != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+
+ if (unsafe.weakCompareAndSetShort(this, f_short_off, (short)-1, (short)42) && f_short != 42) {
+ throw new RuntimeException("CAS failed");
+ }
+ }
+
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java
--- a/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -27,6 +27,7 @@
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @requires vm.bits == "64" & vm.gc != "Z" & os.family != "aix"
+ * @run main/timeout=360 TestAllocateHeapAtMultiple
*/
import jdk.test.lib.JDKToolFinder;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java Mon Nov 12 11:10:16 2018 +0530
@@ -44,7 +44,6 @@
{"MaxRAMFraction", "8"},
{"MinRAMFraction", "2"},
{"InitialRAMFraction", "64"},
- {"UseMembar", "true"},
{"TLABStats", "false"},
// deprecated alias flags (see also aliased_jvm_flags):
@@ -103,6 +102,5 @@
public static void main(String[] args) throws Throwable {
testDeprecated(DEPRECATED_OPTIONS); // Make sure that each deprecated option is mentioned in the output.
- testDeprecatedDiagnostic("IgnoreUnverifiableClassesDuringDump", "false");
}
}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java
--- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java Mon Nov 12 11:10:16 2018 +0530
@@ -53,8 +53,8 @@
output = new OutputAnalyzer(pb.start());
output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
- pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version");
+ pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version");
output = new OutputAnalyzer(pb.start());
- output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM.");
+ output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM.");
}
}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivRunAbstract.jasm
--- a/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivRunAbstract.jasm Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivRunAbstract.jasm Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @summary Test that JVM_DoPrivilege throws java.lang.InternalError for an
+ * @summary Test that AccessController.doPrivileged throws java.lang.AbstractMethodError for an
* abstract run() method.
* @bug 8183962
* @compile DoPrivRunAbstract.jasm
@@ -56,8 +56,8 @@
// public static void main(String[] args) throws Exception {
// try {
// doPrivileged(() -> System.out.println(System.getProperty("java.home")));
-// throw new RuntimeException("Expected InternalError not throw");
-// } catch (java.lang.InternalError e) { }
+// throw new RuntimeException("Expected AbstractMethodError not throw");
+// } catch (java.lang.AbstractMethodError e) { }
// }
//}
@@ -82,13 +82,13 @@
invokestatic Method doPrivileged:"(LDoPrivRunAbstract$VoidPrivActRunAbstract;)V";
new class java/lang/RuntimeException;
dup;
- ldc String "Expected InternalError not throw";
+ ldc String "Expected AbstractMethodError not throw";
invokespecial Method java/lang/RuntimeException."":"(Ljava/lang/String;)V";
athrow;
endtry t0;
- catch t0 java/lang/InternalError;
+ catch t0 java/lang/AbstractMethodError;
stack_frame_type stack1;
- stack_map class java/lang/InternalError;
+ stack_map class java/lang/AbstractMethodError;
astore_1;
return;
}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivileged.java
--- a/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivileged.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/JVMDoPrivileged/DoPrivileged.java Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @summary Test that JVM_DoPrivilege() searches default methods when looking
+ * @summary Test that AccessController.doPrivileged() searches default methods when looking
* for the run() method.
* @bug 8183962
* @run main DoPrivileged
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/ParentClassLoader.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/ParentClassLoader.java Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+import java.io.*;
+
+// Delegating class loader which never defines a class.
+public class ParentClassLoader extends ClassLoader {
+ public ParentClassLoader() { super(); }
+ public ParentClassLoader(String name, ClassLoader l) { super(name, l); }
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/PreemptingChildClassLoader.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/PreemptingChildClassLoader.java Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+import java.io.*;
+
+public class PreemptingChildClassLoader extends ParentClassLoader {
+
+ private static ClassLoader p = new ParentClassLoader();
+ private final Set names = new HashSet<>();
+ boolean checkLoaded = true;
+
+ public PreemptingChildClassLoader(String... names) {
+ for (String n : names) this.names.add(n);
+ }
+
+ public PreemptingChildClassLoader(String name, String[] names) {
+ super(name, p);
+ for (String n : names) this.names.add(n);
+ }
+
+ public PreemptingChildClassLoader(String name, String[] names, boolean cL) {
+ super(name, p);
+ for (String n : names) this.names.add(n);
+ checkLoaded = cL;
+ }
+
+ protected Class> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ if (!names.contains(name)) return super.loadClass(name, resolve);
+ Class> result = checkLoaded ? findLoadedClass(name) : null;
+ if (result == null) {
+ String filename = name.replace('.', '/') + ".class";
+ try (InputStream data = getResourceAsStream(filename)) {
+ if (data == null) throw new ClassNotFoundException();
+ try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
+ int b;
+ do {
+ b = data.read();
+ if (b >= 0) buffer.write(b);
+ } while (b >= 0);
+ byte[] bytes = buffer.toByteArray();
+ result = defineClass(name, bytes, 0, bytes.length);
+ }
+ } catch (IOException e) {
+ throw new ClassNotFoundException("Error reading class file", e);
+ }
+ }
+ if (resolve) resolveClass(result);
+ return result;
+ }
+
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/Test.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/LoaderConstraints/duplicateParentLE/Test.java Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8199852
+ * @summary Test exception messages of LinkageError with a parent class loader
+ * that is not known to the VM. A class loader loads
+ * twice the same class. Should trigger exception in
+ * SystemDictionary::check_constraints().
+ * @compile ../common/Foo.java
+ * @compile ../common/J.java
+ * @compile ParentClassLoader.java
+ * PreemptingChildClassLoader.java
+ * @run main/othervm Test
+ */
+
+public class Test {
+
+ // Check that all names have external formatting ('.' and not '/' in package names).
+ // Check for parent of class loader.
+ // Break expectedErrorMessage into 2 parts due to the class loader name containing
+ // the unique @ identity hash which cannot be compared against.
+
+ // Check that all names have external formatting ('.' and not '/' in package names).
+ // Check for name and parent of class loader. Type should be mentioned as 'class'.
+ static String expectedErrorMessage_part1 = "loader 'DuplicateParentLE_Test_Loader' @";
+ static String expectedErrorMessage_part2 = " attempted duplicate class definition for test.Foo. (test.Foo is in unnamed module of loader 'DuplicateParentLE_Test_Loader' @";
+ static String expectedErrorMessage_part3 = ", parent loader ParentClassLoader @";
+
+
+ // Test that the error message is correct when a loader constraint error is
+ // detected during vtable creation.
+ //
+ // In this test, during vtable creation for class Task, method "Task.m()LFoo;"
+ // overrides "J.m()LFoo;". But, Task's class Foo and super type J's class Foo
+ // are different. So, a LinkageError exception should be thrown because the
+ // loader constraint check will fail.
+ public static void test(String loaderName,
+ String testType) throws Exception {
+ String[] classNames = {testType};
+ ClassLoader l = new PreemptingChildClassLoader(loaderName, classNames, false);
+ l.loadClass(testType);
+ try {
+ l.loadClass(testType).newInstance();
+ throw new RuntimeException("Expected LinkageError exception not thrown");
+ } catch (LinkageError e) {
+ String errorMsg = e.getMessage();
+ if (!errorMsg.contains(expectedErrorMessage_part1) ||
+ !errorMsg.contains(expectedErrorMessage_part2) ||
+ !errorMsg.contains(expectedErrorMessage_part3)) {
+ System.out.println("Expected: " + expectedErrorMessage_part1 + "" + expectedErrorMessage_part2 + "\n" +
+ "but got: " + errorMsg);
+ throw new RuntimeException("Wrong LinkageError exception thrown: " + errorMsg);
+ }
+ System.out.println("Passed with message: " + errorMsg);
+ }
+ }
+
+ public static void main(String args[]) throws Exception {
+ test("DuplicateParentLE_Test_Loader", "test.Foo");
+ }
+}
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java
--- a/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -232,6 +232,19 @@
}
}
+ private static boolean isAlwaysSupportedPlatform() {
+ return Platform.isAix() ||
+ (Platform.isLinux() &&
+ (Platform.isPPC() || Platform.isS390x() || Platform.isX64() ||
+ Platform.isX86() || Platform.isAArch64())) ||
+ Platform.isOSX() ||
+ Platform.isSolaris();
+ }
+
+ private static boolean isNeverSupportedPlatform() {
+ return !isAlwaysSupportedPlatform();
+ }
+
private static boolean isSupportedPlatform;
private static void initIsSupportedPlatform() throws Exception {
@@ -256,11 +269,19 @@
// Do a sanity check. Some platforms we know are always supported. Make sure
// we didn't determine that one of those platforms is not supported.
- if (!isSupportedPlatform) {
+ if (!isSupportedPlatform && isAlwaysSupportedPlatform()) {
String msg = "This platform should be supported: " + Platform.getOsArch();
System.err.println("FAILED: " + msg);
throw new RuntimeException(msg);
}
+
+ // And some platforms we know are never supported. Make sure
+ // we didn't determine that one of those platforms is supported.
+ if (isSupportedPlatform && isNeverSupportedPlatform()) {
+ String msg = "This platform should not be supported: " + Platform.getOsArch();
+ System.err.println("FAILED: " + msg);
+ throw new RuntimeException(msg);
+ }
}
public static void main(String[] args) throws Exception {
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/appcds/CDSandJFR.java
--- a/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java Mon Nov 12 11:10:16 2018 +0530
@@ -30,7 +30,7 @@
* @modules jdk.jfr
* @build Hello GetFlightRecorder
* @run driver ClassFileInstaller -jar CDSandJFR.jar Hello GetFlightRecorder GetFlightRecorder$TestEvent GetFlightRecorder$SimpleEvent
- * @run driver CDSandJFR
+ * @run driver/timeout=500 CDSandJFR
*/
import jdk.test.lib.BuildHelper;
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/appcds/VerifierTest.java
--- a/test/hotspot/jtreg/runtime/appcds/VerifierTest.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/appcds/VerifierTest.java Mon Nov 12 11:10:16 2018 +0530
@@ -102,17 +102,17 @@
}
static void testset_0(String jar, String[] noAppClasses, String[] appClasses) throws Exception {
- // Dumping should fail if the IgnoreUnverifiableClassesDuringDump
- // option is not enabled.
- OutputAnalyzer output = TestCommon.dump(jar, appClasses,
- CDS_LOGGING,
- "-XX:+UnlockDiagnosticVMOptions",
- "-XX:-IgnoreUnverifiableClassesDuringDump");
- output.shouldContain("Please remove the unverifiable classes");
- output.shouldHaveExitValue(1);
-
- // By default, bad classes should be ignored during dumping.
- TestCommon.testDump(jar, appClasses);
+ // Unverifiable classes won't be included in the CDS archive.
+ // Dumping should not fail.
+ OutputAnalyzer output = TestCommon.dump(jar, appClasses);
+ output.shouldHaveExitValue(0);
+ if (output.getStdout().contains("Loading clases to share")) {
+ // last entry in appClasses[] is a verifiable class
+ for (int i = 0; i < (appClasses.length - 1); i++) {
+ output.shouldContain("Verification failed for " + appClasses[i]);
+ output.shouldContain("Removed error class: " + appClasses[i]);
+ }
+ }
}
static void checkRuntimeOutput(OutputAnalyzer output, String expected) throws Exception {
diff -r 65407a437327 -r 339963bcff24 test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java
--- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java Mon Nov 12 10:55:49 2018 +0530
+++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java Mon Nov 12 11:10:16 2018 +0530
@@ -31,7 +31,7 @@
* "--limit-modules java.base" option is specified
* @requires vm.cds & !vm.graal.enabled
* @library /test/lib /test/hotspot/jtreg/runtime/appcds
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.access
* java.management
* jdk.jartool/sun.tools.jar
* jdk.internal.jvmstat/sun.jvmstat.monitor
@@ -66,7 +66,7 @@
List