8177845: Need a mechanism to load Graal

Reviewed-by: kvn, iveresov, mchung
This commit is contained in:
Doug Simon 2017-04-28 02:54:05 -07:00
parent 58199581cd
commit 16d29f2564
110 changed files with 1135 additions and 721 deletions

View File

@ -3,7 +3,7 @@
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/.mx.jvmci</path>
<path>/mx.jvmci</path>
</pydev_pathproperty>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/mx</path>

View File

@ -24,7 +24,6 @@ package jdk.vm.ci.hotspot;
import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilationEvent;
import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilerFailureEvent;
import jdk.vm.ci.services.JVMCIPermission;
/**
* Service-provider class for logging compiler related events.

View File

@ -28,9 +28,9 @@ import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option;
import jdk.vm.ci.runtime.JVMCICompiler;
import jdk.vm.ci.runtime.JVMCICompilerFactory;
import jdk.vm.ci.runtime.JVMCIRuntime;
import jdk.vm.ci.services.JVMCIServiceLocator;
import jdk.vm.ci.services.JVMCIPermission;
import jdk.vm.ci.services.Services;
import jdk.vm.ci.services.JVMCIServiceLocator;
import jdk.vm.ci.services.internal.ReflectionAccessJDK;
final class HotSpotJVMCICompilerConfig {
@ -47,7 +47,7 @@ final class HotSpotJVMCICompilerConfig {
@Override
public String getCompilerName() {
return "<none>";
return "null";
}
@Override
@ -73,19 +73,23 @@ final class HotSpotJVMCICompilerConfig {
JVMCICompilerFactory factory = null;
String compilerName = Option.Compiler.getString();
if (compilerName != null) {
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (f.getCompilerName().equals(compilerName)) {
factory = f;
if (compilerName.isEmpty() || compilerName.equals("null")) {
factory = new DummyCompilerFactory();
} else {
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (f.getCompilerName().equals(compilerName)) {
factory = f;
}
}
if (factory == null) {
throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
}
}
if (factory == null) {
throw new JVMCIError("JVMCI compiler '%s' not found", compilerName);
}
} else {
// Auto select a single available compiler
for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) {
if (factory == null) {
Services.exportJVMCITo(f.getClass());
ReflectionAccessJDK.openJVMCITo(f.getClass());
factory = f;
} else {
// Multiple factories seen - cancel auto selection

View File

@ -32,6 +32,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.ServiceLoader;
import java.util.TreeMap;
import jdk.internal.misc.VM;
@ -50,7 +51,6 @@ import jdk.vm.ci.runtime.JVMCIBackend;
import jdk.vm.ci.runtime.JVMCICompiler;
import jdk.vm.ci.runtime.JVMCICompilerFactory;
import jdk.vm.ci.services.JVMCIServiceLocator;
import jdk.vm.ci.services.Services;
/**
* HotSpot implementation of a JVMCI runtime.
@ -88,7 +88,10 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider {
*/
public enum Option {
// @formatter:off
Compiler(String.class, null, "Selects the system compiler."),
Compiler(String.class, null, "Selects the system compiler. This must match the getCompilerName() value returned " +
"by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. " +
"An empty string or the value \"null\" selects a compiler " +
"that will raise an exception upon receiving a compilation request."),
// Note: The following one is not used (see InitTimer.ENABLED). It is added here
// so that -XX:+JVMCIPrintProperties shows the option.
InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."),
@ -208,7 +211,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider {
}
public static HotSpotJVMCIBackendFactory findFactory(String architecture) {
for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) {
for (HotSpotJVMCIBackendFactory factory : ServiceLoader.load(HotSpotJVMCIBackendFactory.class, ClassLoader.getSystemClassLoader())) {
if (factory.getArchitecture().equalsIgnoreCase(architecture)) {
return factory;
}

View File

@ -98,7 +98,7 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider {
boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0;
if (displacement < 0 || displacement > (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) {
int index = (int) ((displacement - headerSize) / sizeOfElement);
throw new AssertionError("Unsafe array access: reading element of kind " + kind +
throw new IllegalArgumentException("Unsafe array access: reading element of kind " + kind +
" at offset " + displacement + " (index ~ " + index + ") in " +
type.toJavaName() + " object of length " + length);
}

View File

@ -801,8 +801,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
}
if (elementType.getName().startsWith("Ljava/")) {
// Classes in a java.* package can only be defined by the
// boot class loader. This is enforced by ClassLoader.preDefineClass()
assert mirror().getClassLoader() == null;
// boot or platform class loader.
return true;
}
ClassLoader thisCl = mirror().getClassLoader();

View File

@ -24,12 +24,15 @@ package jdk.vm.ci.services;
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
import jdk.vm.ci.services.internal.ReflectionAccessJDK;
/**
* Service-provider class for the runtime to locate providers of JVMCI services where the latter are
* not in packages exported by the JVMCI module. As part of instantiating
* {@link JVMCIServiceLocator}, all JVMCI packages will be {@linkplain Services#exportJVMCITo(Class)
* exported} to the module defining the class of the instantiated object.
* not in packages exported by the JVMCI module. As part of instantiating a
* {@link JVMCIServiceLocator}, all JVMCI packages will be opened to the module defining the class
* of the instantiated object.
*
* While the {@link #getProvider(Class)} method can be used directly, it's usually easier to use
* {@link #getProviders(Class)}.
@ -49,30 +52,39 @@ public abstract class JVMCIServiceLocator {
}
/**
* Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI exports all
* its packages to the module defining the type of this object.
* Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI opens all its
* packages to the module defining the type of this object.
*
* @throws SecurityException if a security manager has been installed and it denies
* {@link JVMCIPermission}
*/
protected JVMCIServiceLocator() {
this(checkPermission());
Services.exportJVMCITo(getClass());
Services.checkJVMCIEnabled();
ReflectionAccessJDK.openJVMCITo(getClass());
}
/**
* Gets the provider of the service defined by {@code service} or {@code null} if this object
* does not have a provider for {@code service}.
*/
public abstract <S> S getProvider(Class<S> service);
protected abstract <S> S getProvider(Class<S> service);
/**
* Gets the providers of the service defined by {@code service} by querying the
* {@link JVMCIServiceLocator} providers obtained by {@link Services#load(Class)}.
* Gets the providers of the service defined by {@code service} by querying the available
* {@link JVMCIServiceLocator} providers.
*
* @throws SecurityException if a security manager is present and it denies
* {@link JVMCIPermission}
*/
public static <S> List<S> getProviders(Class<S> service) {
Services.checkJVMCIEnabled();
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JVMCIPermission());
}
List<S> providers = new ArrayList<>();
for (JVMCIServiceLocator access : Services.load(JVMCIServiceLocator.class)) {
for (JVMCIServiceLocator access : ServiceLoader.load(JVMCIServiceLocator.class, ClassLoader.getSystemClassLoader())) {
S provider = access.getProvider(service);
if (provider != null) {
providers.add(provider);

View File

@ -22,167 +22,64 @@
*/
package jdk.vm.ci.services;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Formatter;
import java.util.Iterator;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.Map;
/**
* A mechanism for accessing service providers via JVMCI.
* Provides utilities needed by JVMCI clients.
*/
public final class Services {
// This class must be compilable and executable on JDK 8 since it's used in annotation
// processors while building JDK 9 so use of API added in JDK 9 is made via reflection.
private Services() {
}
private static int getJavaSpecificationVersion() {
String value = System.getProperty("java.specification.version");
if (value.startsWith("1.")) {
value = value.substring(2);
}
return Integer.parseInt(value);
}
/**
* The integer value corresponding to the value of the {@code java.specification.version} system
* property after any leading {@code "1."} has been stripped.
*/
public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
// Use reflection so that this compiles on Java 8
private static final Method getModule;
private static final Method getPackages;
private static final Method addUses;
private static final Method isExported;
private static final Method addExports;
static {
if (JAVA_SPECIFICATION_VERSION >= 9) {
try {
getModule = Class.class.getMethod("getModule");
Class<?> moduleClass = getModule.getReturnType();
getPackages = moduleClass.getMethod("getPackages");
addUses = moduleClass.getMethod("addUses", Class.class);
isExported = moduleClass.getMethod("isExported", String.class, moduleClass);
addExports = moduleClass.getMethod("addExports", String.class, moduleClass);
} catch (NoSuchMethodException | SecurityException e) {
throw new InternalError(e);
}
} else {
getModule = null;
getPackages = null;
addUses = null;
isExported = null;
addExports = null;
}
}
@SuppressWarnings("unchecked")
static <T> T invoke(Method method, Object receiver, Object... args) {
private static Map<String, String> initSavedProperties() throws InternalError {
try {
return (T) method.invoke(receiver, args);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
Class<?> vmClass = Class.forName("jdk.internal.misc.VM");
Method m = vmClass.getMethod("getSavedProperties");
return (Map<String, String>) m.invoke(null);
} catch (Exception e) {
throw new InternalError(e);
}
}
static final Map<String, String> SAVED_PROPERTIES = initSavedProperties();
static final boolean JVMCI_ENABLED = Boolean.parseBoolean(SAVED_PROPERTIES.get("jdk.internal.vm.ci.enabled"));
/**
* Performs any required security checks and dynamic reconfiguration to allow the module of a
* given class to access the classes in the JVMCI module.
*
* Note: This API uses {@link Class} instead of {@code Module} to provide backwards
* compatibility for JVMCI clients compiled against a JDK release earlier than 9.
*
* @param requestor a class requesting access to the JVMCI module for its module
* @throws SecurityException if a security manager is present and it denies
* {@link JVMCIPermission}
* Checks that JVMCI is enabled in the VM and throws an error if it isn't.
*/
public static void exportJVMCITo(Class<?> requestor) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JVMCIPermission());
}
if (JAVA_SPECIFICATION_VERSION >= 9) {
Object jvmci = invoke(getModule, Services.class);
Object requestorModule = invoke(getModule, requestor);
if (jvmci != requestorModule) {
Set<String> packages = invoke(getPackages, jvmci);
for (String pkg : packages) {
// Export all JVMCI packages dynamically instead
// of requiring a long list of --add-exports
// options on the JVM command line.
boolean exported = invoke(isExported, jvmci, pkg, requestorModule);
if (!exported) {
invoke(addExports, jvmci, pkg, requestorModule);
}
}
}
static void checkJVMCIEnabled() {
if (!JVMCI_ENABLED) {
throw new Error("The EnableJVMCI VM option must be true (i.e., -XX:+EnableJVMCI) to use JVMCI");
}
}
/**
* Gets an {@link Iterable} of the JVMCI providers available for a given service.
*
* @throws SecurityException if a security manager is present and it denies
* {@link JVMCIPermission}
* Gets an unmodifiable copy of the system properties saved when {@link System} is initialized.
*/
public static <S> Iterable<S> load(Class<S> service) {
public static Map<String, String> getSavedProperties() {
checkJVMCIEnabled();
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JVMCIPermission());
}
if (JAVA_SPECIFICATION_VERSION >= 9) {
Object jvmci = invoke(getModule, Services.class);
invoke(addUses, jvmci, service);
}
// Restrict JVMCI clients to be on the class path or module path
return ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
return SAVED_PROPERTIES;
}
/**
* Gets the JVMCI provider for a given service for which at most one provider must be available.
*
* @param service the service whose provider is being requested
* @param required specifies if an {@link InternalError} should be thrown if no provider of
* {@code service} is available
* @throws SecurityException if a security manager is present and it denies
* {@link JVMCIPermission}
* Causes the JVMCI subsystem to be initialized if it isn't already initialized.
*/
public static <S> S loadSingle(Class<S> service, boolean required) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JVMCIPermission());
}
if (JAVA_SPECIFICATION_VERSION >= 9) {
Object jvmci = invoke(getModule, Services.class);
invoke(addUses, jvmci, service);
}
// Restrict JVMCI clients to be on the class path or module path
Iterable<S> providers = ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
S singleProvider = null;
public static void initializeJVMCI() {
checkJVMCIEnabled();
try {
for (Iterator<S> it = providers.iterator(); it.hasNext();) {
singleProvider = it.next();
if (it.hasNext()) {
throw new InternalError(String.format("Multiple %s providers found", service.getName()));
}
}
} catch (ServiceConfigurationError e) {
// If the service is required we will bail out below.
Class.forName("jdk.vm.ci.runtime.JVMCI");
} catch (ClassNotFoundException e) {
throw new InternalError(e);
}
if (singleProvider == null && required) {
String javaHome = System.getProperty("java.home");
String vmName = System.getProperty("java.vm.name");
Formatter errorMessage = new Formatter();
errorMessage.format("The VM does not expose required service %s.%n", service.getName());
errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
errorMessage.format("Currently used VM configuration is: %s", vmName);
throw new UnsupportedOperationException(errorMessage.toString());
}
return singleProvider;
}
}

View File

@ -0,0 +1,91 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.services.internal;
import java.lang.reflect.Method;
import java.util.Set;
import jdk.vm.ci.services.Services;
/**
* Reflection based access to API introduced in JDK 9. This allows the API to be used in code that
* must be compiled (but not executed) on JDK 8.
*/
public final class ReflectionAccessJDK {
/**
* {@code Class.getModule()}.
*/
private static final Method getModule;
/**
* {@code java.lang.Module.addOpens(String, Module)}.
*/
private static final Method addOpens;
/**
* {@code java.lang.Module.getPackages(Module, String, Module)}.
*/
private static final Method getPackages;
/**
* {@code java.lang.Module.isOpen(String, Module)}.
*/
private static final Method isOpenTo;
/**
* Opens all JVMCI packages to the module of a given class.
*
* @param other all JVMCI packages will be opened to the module of this class
*/
@SuppressWarnings("unchecked")
public static void openJVMCITo(Class<?> other) {
try {
Object jvmci = getModule.invoke(Services.class);
Object otherModule = getModule.invoke(other);
if (jvmci != otherModule) {
Set<String> packages = (Set<String>) getPackages.invoke(jvmci);
for (String pkg : packages) {
boolean opened = (Boolean) isOpenTo.invoke(jvmci, pkg, otherModule);
if (!opened) {
addOpens.invoke(jvmci, pkg, otherModule);
}
}
}
} catch (Exception e) {
throw new InternalError(e);
}
}
static {
try {
getModule = Class.class.getMethod("getModule");
Class<?> moduleClass = getModule.getReturnType();
getPackages = moduleClass.getMethod("getPackages");
isOpenTo = moduleClass.getMethod("isOpen", String.class, moduleClass);
addOpens = moduleClass.getDeclaredMethod("addOpens", String.class, moduleClass);
} catch (NoSuchMethodException | SecurityException e) {
throw new InternalError(e);
}
}
}

View File

@ -33,37 +33,4 @@ module jdk.internal.vm.ci {
jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
exports jdk.vm.ci.aarch64 to
jdk.internal.vm.compiler;
exports jdk.vm.ci.amd64 to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.code to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.code.site to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.code.stack to
jdk.internal.vm.compiler;
exports jdk.vm.ci.common to
jdk.internal.vm.compiler;
exports jdk.vm.ci.hotspot to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.hotspot.aarch64 to
jdk.internal.vm.compiler;
exports jdk.vm.ci.hotspot.amd64 to
jdk.internal.vm.compiler;
exports jdk.vm.ci.hotspot.sparc to
jdk.internal.vm.compiler;
exports jdk.vm.ci.meta to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.runtime to
jdk.aot,
jdk.internal.vm.compiler;
exports jdk.vm.ci.sparc to
jdk.internal.vm.compiler;
}

View File

@ -3,9 +3,9 @@
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/mx.graal</path>
<path>/mx.graal</path>
<path>/mx.graal</path>
<path>/.mx.graal</path>
<path>/.mx.graal</path>
<path>/.mx.graal</path>
</pydev_pathproperty>
</pydev_project>

View File

@ -8,6 +8,36 @@ suite = {
# (e.g., macosx-x86_64-normal-server-release).
"outputRoot" : "../../../build/mx/hotspot",
"jdklibraries" : {
"JVMCI_SERVICES" : {
"path" : "lib/jvmci-services.jar",
"sourcePath" : "lib/jvmci-services.src.zip",
"optional" : False,
"jdkStandardizedSince" : "9",
"module" : "jdk.internal.vm.ci"
},
"JVMCI_API" : {
"path" : "lib/jvmci/jvmci-api.jar",
"sourcePath" : "lib/jvmci/jvmci-api.src.zip",
"dependencies" : [
"JVMCI_SERVICES",
],
"optional" : False,
"jdkStandardizedSince" : "9",
"module" : "jdk.internal.vm.ci"
},
"JVMCI_HOTSPOT" : {
"path" : "lib/jvmci/jvmci-hotspot.jar",
"sourcePath" : "lib/jvmci/jvmci-hotspot.src.zip",
"dependencies" : [
"JVMCI_API",
],
"optional" : False,
"jdkStandardizedSince" : "9",
"module" : "jdk.internal.vm.ci"
},
},
"libraries" : {
# ------------- Libraries -------------
@ -17,6 +47,16 @@ suite = {
"sha1" : "476d9a44cd19d6b55f81571077dfa972a4f8a083",
"bootClassPathAgent" : "true",
},
"ASM5" : {
"sha1" : "0da08b8cce7bbf903602a25a3a163ae252435795",
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar"],
},
"ASM_TREE5" : {
"sha1" : "396ce0c07ba2b481f25a70195c7c94922f0d1b0b",
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar"],
"dependencies" : ["ASM5"],
},
},
"projects" : {
@ -32,6 +72,7 @@ suite = {
"org.graalvm.compiler.serviceprovider" : {
"subDir" : "share/classes",
"dependencies" : ["JVMCI_SERVICES"],
"sourceDirs" : ["src"],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -49,6 +90,7 @@ suite = {
"org.graalvm.compiler.options" : {
"subDir" : "share/classes",
"dependencies" : ["JVMCI_SERVICES", "JVMCI_API"],
"sourceDirs" : ["src"],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -83,6 +125,7 @@ suite = {
"sourceDirs" : ["src"],
"checkstyle" : "org.graalvm.compiler.graph",
"dependencies" : [
"JVMCI_API",
"org.graalvm.compiler.serviceprovider",
"org.graalvm.compiler.options"
],
@ -137,6 +180,7 @@ suite = {
"sourceDirs" : ["src"],
"checkstyle" : "org.graalvm.compiler.graph",
"dependencies" : [
"JVMCI_HOTSPOT",
"org.graalvm.compiler.core.test",
],
"javaCompliance" : "1.8",
@ -146,6 +190,9 @@ suite = {
"org.graalvm.compiler.api.runtime" : {
"subDir" : "share/classes",
"sourceDirs" : ["src"],
"dependencies" : [
"JVMCI_API",
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
"workingSets" : "API,Graal",
@ -156,6 +203,7 @@ suite = {
"sourceDirs" : ["src"],
"dependencies" : [
"mx:JUNIT",
"JVMCI_SERVICES",
"org.graalvm.compiler.api.runtime",
],
"checkstyle" : "org.graalvm.compiler.graph",
@ -166,6 +214,7 @@ suite = {
"org.graalvm.compiler.api.replacements" : {
"subDir" : "share/classes",
"sourceDirs" : ["src"],
"dependencies" : ["JVMCI_API"],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
"workingSets" : "API,Graal,Replacements",
@ -175,6 +224,7 @@ suite = {
"subDir" : "share/classes",
"sourceDirs" : ["src"],
"dependencies" : [
"JVMCI_HOTSPOT",
"org.graalvm.compiler.api.runtime",
"org.graalvm.compiler.replacements",
"org.graalvm.compiler.runtime",
@ -261,6 +311,8 @@ suite = {
"org.graalvm.compiler.hotspot",
"org.graalvm.compiler.lir.jtt",
"org.graalvm.compiler.lir.test",
"JVMCI_API",
"JVMCI_HOTSPOT",
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -347,6 +399,9 @@ suite = {
"org.graalvm.compiler.asm" : {
"subDir" : "share/classes",
"sourceDirs" : ["src"],
"dependencies" : [
"JVMCI_API",
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
"workingSets" : "Graal,Assembler",
@ -403,6 +458,7 @@ suite = {
"org.graalvm.compiler.bytecode" : {
"subDir" : "share/classes",
"sourceDirs" : ["src"],
"dependencies" : ["JVMCI_API"],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
"workingSets" : "Graal,Java",
@ -774,6 +830,7 @@ suite = {
"dependencies" : [
"org.graalvm.compiler.lir.jtt",
"org.graalvm.compiler.lir.aarch64",
"JVMCI_HOTSPOT"
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -803,6 +860,7 @@ suite = {
"dependencies" : [
"org.graalvm.compiler.lir.jtt",
"org.graalvm.compiler.lir.amd64",
"JVMCI_HOTSPOT"
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -831,6 +889,7 @@ suite = {
"sourceDirs" : ["src"],
"dependencies" : [
"org.graalvm.compiler.lir.jtt",
"JVMCI_HOTSPOT"
],
"checkstyle" : "org.graalvm.compiler.graph",
"javaCompliance" : "1.8",
@ -908,6 +967,7 @@ suite = {
"org.graalvm.compiler.graph.test",
"org.graalvm.compiler.printer",
"JAVA_ALLOCATION_INSTRUMENTER",
"ASM_TREE5",
],
"annotationProcessors" : ["GRAAL_NODEINFO_PROCESSOR"],
"checkstyle" : "org.graalvm.compiler.graph",

View File

@ -40,7 +40,7 @@ public class Graal {
private static final GraalRuntime runtime = initializeRuntime();
private static GraalRuntime initializeRuntime() {
Services.exportJVMCITo(Graal.class);
Services.initializeJVMCI();
JVMCICompiler compiler = JVMCI.getRuntime().getCompiler();
if (compiler instanceof GraalJVMCICompiler) {
GraalJVMCICompiler graal = (GraalJVMCICompiler) compiler;

View File

@ -52,11 +52,6 @@ public final class ModuleAPI {
*/
public static final ModuleAPI getModule;
/**
* {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
*/
public static final ModuleAPI addExports;
/**
* {@code java.lang.Module.getResourceAsStream(String)}.
*/
@ -116,13 +111,11 @@ public final class ModuleAPI {
try {
getModule = new ModuleAPI(Class.class.getMethod("getModule"));
Class<?> moduleClass = getModule.method.getReturnType();
Class<?> modulesClass = Class.forName("jdk.internal.module.Modules");
getResourceAsStream = new ModuleAPI(moduleClass.getMethod("getResourceAsStream", String.class));
canRead = new ModuleAPI(moduleClass.getMethod("canRead", moduleClass));
isExported = new ModuleAPI(moduleClass.getMethod("isExported", String.class));
isExportedTo = new ModuleAPI(moduleClass.getMethod("isExported", String.class, moduleClass));
addExports = new ModuleAPI(modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass));
} catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
} catch (NoSuchMethodException | SecurityException e) {
throw new InternalError(e);
}
} else {
@ -132,8 +125,6 @@ public final class ModuleAPI {
canRead = unavailable;
isExported = unavailable;
isExportedTo = unavailable;
addExports = unavailable;
}
}
}

View File

@ -127,7 +127,7 @@ public class CheckGraalInvariants extends GraalTest {
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -26,15 +26,14 @@ import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import org.junit.Test;
import org.graalvm.compiler.code.CompilationResult;
import org.graalvm.compiler.test.ExportingClassLoader;
import org.junit.Test;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Label;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.vm.ci.code.InstalledCode;
import jdk.vm.ci.meta.ResolvedJavaMethod;

View File

@ -44,19 +44,17 @@ import java.util.Objects;
import java.util.ServiceLoader;
import java.util.Set;
import org.junit.Test;
import org.graalvm.compiler.options.OptionDescriptor;
import org.graalvm.compiler.options.OptionDescriptors;
import org.graalvm.compiler.options.OptionValue;
import org.graalvm.compiler.test.GraalTest;
import jdk.internal.org.objectweb.asm.ClassReader;
import jdk.internal.org.objectweb.asm.ClassVisitor;
import jdk.internal.org.objectweb.asm.Label;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.org.objectweb.asm.Type;
import org.junit.Test;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
/**
* Verifies a class declaring one or more {@linkplain OptionValue options} has a class initializer

View File

@ -83,7 +83,7 @@ public class StaticInterfaceFieldTest extends GraalTest {
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -24,10 +24,10 @@ package org.graalvm.compiler.core.test;
import jdk.vm.ci.code.BailoutException;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Label;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
@ -86,7 +86,7 @@ public class UnbalancedMonitorsTest extends GraalCompilerTest implements Opcodes
ResolvedJavaMethod method = getResolvedJavaMethod(LOADER.findClass(INNER_CLASS_NAME), name);
try {
StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.NO, INVALID_COMPILATION_ID);
Plugins plugins = new Plugins(new InvocationPlugins(getMetaAccess()));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
OptimisticOptimizations optimisticOpts = OptimisticOptimizations.NONE;

View File

@ -122,7 +122,7 @@ public class VerifyBailoutUsageTest {
Providers providers = rt.getHostBackend().getProviders();
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -300,7 +300,7 @@ public class VerifyDebugUsageTest {
Providers providers = rt.getHostBackend().getProviders();
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -267,7 +267,7 @@ public class VerifyVirtualizableTest {
Providers providers = rt.getHostBackend().getProviders();
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -249,7 +249,7 @@ public class VerifyMethodMetricsTest {
Providers providers = rt.getHostBackend().getProviders();
MetaAccessProvider metaAccess = providers.getMetaAccess();
PhaseSuite<HighTierContext> graphBuilderSuite = new PhaseSuite<>();
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);

View File

@ -253,7 +253,7 @@ public class StaticAnalysis {
* the code before static analysis, the classes would otherwise be not loaded
* yet and the bytecode parser would only create a graph.
*/
Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
Plugins plugins = new Plugins(new InvocationPlugins());
GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
/*
* For simplicity, we ignore all exception handling during the static analysis.

View File

@ -29,15 +29,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import org.junit.Test;
import org.graalvm.compiler.api.test.Graal;
import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
@ -45,12 +42,15 @@ import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
import org.graalvm.compiler.runtime.RuntimeProvider;
import org.graalvm.compiler.test.GraalTest;
import org.junit.Test;
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
import jdk.vm.ci.hotspot.VMIntrinsicMethod;
import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.meta.MetaUtil;
import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod;
import jdk.vm.ci.meta.ResolvedJavaMethod;
@ -63,11 +63,10 @@ import jdk.vm.ci.meta.ResolvedJavaMethod;
*/
public class CheckGraalIntrinsics extends GraalTest {
public static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
if (intrinsic.name.equals(method.getName())) {
if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
if (declaringClass.equals(intrinsic.declaringClass)) {
public static boolean match(String type, Binding binding, VMIntrinsicMethod intrinsic) {
if (intrinsic.name.equals(binding.name)) {
if (intrinsic.descriptor.startsWith(binding.argumentsDescriptor)) {
if (type.equals(intrinsic.declaringClass)) {
return true;
}
}
@ -75,16 +74,20 @@ public class CheckGraalIntrinsics extends GraalTest {
return false;
}
private static ResolvedJavaMethod findMethod(Set<ResolvedJavaMethod> methods, VMIntrinsicMethod intrinsic) {
for (ResolvedJavaMethod method : methods) {
if (match(method, intrinsic)) {
return method;
public static InvocationPlugin findPlugin(Map<String, List<Binding>> bindings, VMIntrinsicMethod intrinsic) {
for (Map.Entry<String, List<Binding>> e : bindings.entrySet()) {
// Match format of VMIntrinsicMethod.declaringClass
String type = MetaUtil.internalNameToJava(e.getKey(), true, false).replace('.', '/');
for (Binding binding : e.getValue()) {
if (match(type, binding, intrinsic)) {
return binding.plugin;
}
}
}
return null;
}
private static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
public static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
Class<?> c = Class.forName(intrinsic.declaringClass.replace('/', '.'), false, CheckGraalIntrinsics.class.getClassLoader());
for (Method javaMethod : c.getDeclaredMethods()) {
if (javaMethod.getName().equals(intrinsic.name)) {
@ -425,28 +428,20 @@ public class CheckGraalIntrinsics extends GraalTest {
public void test() throws ClassNotFoundException {
HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
HotSpotProviders providers = rt.getHostBackend().getProviders();
Map<ResolvedJavaMethod, Object> impl = new HashMap<>();
Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
for (ResolvedJavaMethod method : invocationPlugins.getMethods()) {
InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
assert plugin != null;
impl.put(method, plugin);
}
Set<ResolvedJavaMethod> methods = invocationPlugins.getMethods();
HotSpotVMConfigStore store = rt.getVMConfig().getStore();
List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
List<String> missing = new ArrayList<>();
Map<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
for (VMIntrinsicMethod intrinsic : intrinsics) {
ResolvedJavaMethod method = findMethod(methods, intrinsic);
if (method == null) {
method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
IntrinsicMethod intrinsicMethod = null;
InvocationPlugin plugin = findPlugin(bindings, intrinsic);
if (plugin == null) {
ResolvedJavaMethod method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
if (method != null) {
intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
IntrinsicMethod intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
if (intrinsicMethod != null) {
continue;
}

View File

@ -39,9 +39,9 @@ import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
import org.junit.BeforeClass;
import org.junit.Test;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import jdk.vm.ci.meta.ResolvedJavaMethod;
public class ConstantPoolSubstitutionsTests extends GraalCompilerTest implements Opcodes {

View File

@ -22,13 +22,12 @@
*/
package org.graalvm.compiler.hotspot.test;
import java.util.List;
import java.util.Set;
import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
import org.junit.Test;
import java.util.List;
import java.util.Map;
import org.graalvm.compiler.api.test.Graal;
import org.graalvm.compiler.core.common.CompilationIdentifier;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.hotspot.HotSpotGraalCompiler;
import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
@ -37,8 +36,10 @@ import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
import org.graalvm.compiler.nodes.graphbuilderconf.MethodSubstitutionPlugin;
import org.graalvm.compiler.runtime.RuntimeProvider;
import org.junit.Test;
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
import jdk.vm.ci.hotspot.VMIntrinsicMethod;
@ -50,46 +51,27 @@ import jdk.vm.ci.runtime.JVMCI;
*/
public class TestIntrinsicCompiles extends GraalCompilerTest {
private static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
if (intrinsic.name.equals(method.getName())) {
if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
if (declaringClass.equals(intrinsic.declaringClass)) {
return true;
}
}
}
return false;
}
private static ResolvedJavaMethod findMethod(Set<ResolvedJavaMethod> methods, VMIntrinsicMethod intrinsic) {
for (ResolvedJavaMethod method : methods) {
if (match(method, intrinsic)) {
return method;
}
}
return null;
}
@Test
@SuppressWarnings("try")
public void test() {
public void test() throws ClassNotFoundException {
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) JVMCI.getRuntime().getCompiler();
HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
HotSpotProviders providers = rt.getHostBackend().getProviders();
Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
Set<ResolvedJavaMethod> pluginMethods = invocationPlugins.getMethods();
Map<String, List<Binding>> bindings = invocationPlugins.getBindings(true);
HotSpotVMConfigStore store = rt.getVMConfig().getStore();
List<VMIntrinsicMethod> intrinsics = store.getIntrinsics();
for (VMIntrinsicMethod intrinsic : intrinsics) {
ResolvedJavaMethod method = findMethod(pluginMethods, intrinsic);
if (method != null) {
InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
if (plugin instanceof MethodSubstitutionPlugin && !method.isNative()) {
StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, CompilationIdentifier.INVALID_COMPILATION_ID);
getCode(method, graph);
InvocationPlugin plugin = CheckGraalIntrinsics.findPlugin(bindings, intrinsic);
if (plugin != null) {
if (plugin instanceof MethodSubstitutionPlugin) {
ResolvedJavaMethod method = CheckGraalIntrinsics.resolveIntrinsic(getMetaAccess(), intrinsic);
if (!method.isNative()) {
StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, INVALID_COMPILATION_ID);
getCode(method, graph);
}
}
}
}

View File

@ -102,7 +102,6 @@ import jdk.vm.ci.meta.ConstantPool;
import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.runtime.JVMCI;
import jdk.vm.ci.runtime.JVMCICompiler;
import jdk.vm.ci.services.Services;
/**
* This class implements compile-the-world functionality with JVMCI.
@ -785,7 +784,6 @@ public final class CompileTheWorld {
}
public static void main(String[] args) throws Throwable {
Services.exportJVMCITo(CompileTheWorld.class);
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) HotSpotJVMCIRuntime.runtime().getCompiler();
compiler.compileTheWorld();
}

View File

@ -22,21 +22,19 @@
*/
package org.graalvm.compiler.hotspot;
import static org.graalvm.compiler.core.common.util.Util.Java8OrEarlier;
import static org.graalvm.compiler.options.OptionValue.PROFILE_OPTIONVALUE_PROPERTY_NAME;
import static jdk.vm.ci.common.InitTimer.timer;
import static org.graalvm.compiler.options.OptionValue.PROFILE_OPTIONVALUE_PROPERTY_NAME;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.ServiceLoader;
import org.graalvm.compiler.debug.GraalError;
import org.graalvm.compiler.debug.MethodFilter;
import org.graalvm.compiler.options.Option;
import org.graalvm.compiler.options.OptionDescriptors;
@ -46,10 +44,11 @@ import org.graalvm.compiler.options.OptionsParser;
import org.graalvm.compiler.phases.tiers.CompilerConfiguration;
import jdk.vm.ci.common.InitTimer;
import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotSignature;
import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
import jdk.vm.ci.runtime.JVMCIRuntime;
import jdk.vm.ci.services.Services;
public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFactory {
@ -135,8 +134,8 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
if (allOptionsSettings == null) {
try (InitTimer t = timer("InitializeOptions")) {
ServiceLoader<OptionDescriptors> loader = ServiceLoader.load(OptionDescriptors.class, OptionDescriptors.class.getClassLoader());
Properties savedProps = getSavedProperties(Java8OrEarlier);
String optionsFile = savedProps.getProperty(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
Map<String, String> savedProps = Services.getSavedProperties();
String optionsFile = savedProps.get(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
if (optionsFile != null) {
File graalOptions = new File(optionsFile);
@ -165,15 +164,15 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
}
Map<String, String> optionSettings = new HashMap<>();
for (Map.Entry<Object, Object> e : savedProps.entrySet()) {
String name = (String) e.getKey();
for (Entry<String, String> e : savedProps.entrySet()) {
String name = e.getKey();
if (name.startsWith(GRAAL_OPTION_PROPERTY_PREFIX)) {
if (name.equals("graal.PrintFlags") || name.equals("graal.ShowFlags")) {
System.err.println("The " + name + " option has been removed and will be ignored. Use -XX:+JVMCIPrintProperties instead.");
} else if (name.equals(GRAAL_OPTIONS_FILE_PROPERTY_NAME) || name.equals(GRAAL_VERSION_PROPERTY_NAME) || name.equals(PROFILE_OPTIONVALUE_PROPERTY_NAME)) {
// Ignore well known properties that do not denote an option
} else {
String value = (String) e.getValue();
String value = e.getValue();
optionSettings.put(name.substring(GRAAL_OPTION_PROPERTY_PREFIX.length()), value);
}
}
@ -206,18 +205,6 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
}
}
private static Properties getSavedProperties(boolean jdk8OrEarlier) {
try {
String vmClassName = jdk8OrEarlier ? "sun.misc.VM" : "jdk.internal.misc.VM";
Class<?> vmClass = Class.forName(vmClassName);
Field savedPropsField = vmClass.getDeclaredField("savedProps");
savedPropsField.setAccessible(true);
return (Properties) savedPropsField.get(null);
} catch (Exception e) {
throw new GraalError(e);
}
}
@Override
public HotSpotGraalCompiler createCompiler(JVMCIRuntime runtime) {
HotSpotGraalCompiler compiler = createCompiler(runtime, CompilerConfigurationFactory.selectFactory(null));

View File

@ -22,10 +22,6 @@
*/
package org.graalvm.compiler.hotspot;
import static org.graalvm.compiler.core.common.util.ModuleAPI.addExports;
import static org.graalvm.compiler.core.common.util.ModuleAPI.getModule;
import static org.graalvm.compiler.core.common.util.Util.JAVA_SPECIFICATION_VERSION;
import org.graalvm.compiler.serviceprovider.ServiceProvider;
import jdk.vm.ci.hotspot.HotSpotVMEventListener;
@ -35,43 +31,45 @@ import jdk.vm.ci.services.JVMCIServiceLocator;
@ServiceProvider(JVMCIServiceLocator.class)
public final class HotSpotGraalJVMCIServiceLocator extends JVMCIServiceLocator {
private boolean exportsAdded;
/**
* Dynamically exports various internal JDK packages to the Graal module. This requires only
* {@code --add-exports=java.base/jdk.internal.module=org.graalvm.compiler.graal_core} on the VM
* command line instead of a {@code --add-exports} instance for each JDK internal package used
* by Graal.
* Holds the state shared between all {@link HotSpotGraalJVMCIServiceLocator} instances. This is
* necessary as a service provider instance is created each time the service is loaded.
*/
private void addExports() {
if (JAVA_SPECIFICATION_VERSION >= 9 && !exportsAdded) {
Object javaBaseModule = getModule.invoke(String.class);
Object graalModule = getModule.invoke(getClass());
addExports.invokeStatic(javaBaseModule, "jdk.internal.misc", graalModule);
addExports.invokeStatic(javaBaseModule, "jdk.internal.jimage", graalModule);
addExports.invokeStatic(javaBaseModule, "com.sun.crypto.provider", graalModule);
exportsAdded = true;
private static final class Shared {
static final Shared SINGLETON = new Shared();
<T> T getProvider(Class<T> service, HotSpotGraalJVMCIServiceLocator locator) {
if (service == JVMCICompilerFactory.class) {
return service.cast(new HotSpotGraalCompilerFactory(locator));
} else if (service == HotSpotVMEventListener.class) {
if (graalRuntime != null) {
return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
}
}
return null;
}
private HotSpotGraalRuntime graalRuntime;
/**
* Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
*/
void onCompilerCreation(HotSpotGraalCompiler compiler) {
assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
}
}
private HotSpotGraalRuntime graalRuntime;
@Override
public <T> T getProvider(Class<T> service) {
if (service == JVMCICompilerFactory.class) {
addExports();
return service.cast(new HotSpotGraalCompilerFactory(this));
} else if (service == HotSpotVMEventListener.class) {
if (graalRuntime != null) {
addExports();
return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
}
}
return null;
return Shared.SINGLETON.getProvider(service, this);
}
public void onCompilerCreation(HotSpotGraalCompiler compiler) {
assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
/**
* Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
*/
@SuppressWarnings("static-method")
void onCompilerCreation(HotSpotGraalCompiler compiler) {
Shared.SINGLETON.onCompilerCreation(compiler);
}
}

View File

@ -128,7 +128,7 @@ public class HotSpotGraphBuilderPlugins {
*/
public static Plugins create(GraalHotSpotVMConfig config, HotSpotWordTypes wordTypes, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection,
SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, StampProvider stampProvider, ReplacementsImpl replacements) {
InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, metaAccess);
InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config);
Plugins plugins = new Plugins(invocationPlugins);
NodeIntrinsificationProvider nodeIntrinsificationProvider = new NodeIntrinsificationProvider(metaAccess, snippetReflection, foreignCalls, wordTypes);

View File

@ -38,7 +38,6 @@ import org.graalvm.compiler.nodes.type.StampTool;
import org.graalvm.compiler.replacements.nodes.MacroNode;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.meta.ResolvedJavaType;
/**
@ -47,8 +46,7 @@ import jdk.vm.ci.meta.ResolvedJavaType;
final class HotSpotInvocationPlugins extends InvocationPlugins {
final GraalHotSpotVMConfig config;
HotSpotInvocationPlugins(GraalHotSpotVMConfig config, MetaAccessProvider metaAccess) {
super(metaAccess);
HotSpotInvocationPlugins(GraalHotSpotVMConfig config) {
this.config = config;
}

View File

@ -29,8 +29,6 @@ import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.VERY_SLO
import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
import java.lang.reflect.Field;
import org.graalvm.compiler.api.replacements.ClassSubstitution;
import org.graalvm.compiler.api.replacements.MethodSubstitution;
import org.graalvm.compiler.core.common.LocationIdentity;
@ -61,7 +59,7 @@ public class AESCryptSubstitutions {
static final long kOffset;
static final long lastKeyOffset;
static final Class<?> AESCryptClass;
static final int AES_BLOCK_SIZE;
static final int AES_BLOCK_SIZE_IN_BYTES;
static {
try {
@ -72,9 +70,9 @@ public class AESCryptSubstitutions {
AESCryptClass = Class.forName("com.sun.crypto.provider.AESCrypt", true, cl);
kOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("K"));
lastKeyOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("lastKey"));
Field aesBlockSizeField = Class.forName("com.sun.crypto.provider.AESConstants", true, cl).getDeclaredField("AES_BLOCK_SIZE");
aesBlockSizeField.setAccessible(true);
AES_BLOCK_SIZE = aesBlockSizeField.getInt(null);
// Thankfully the AES block size is a constant (128 bits) and so we don't need to
// reflect on com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE.
AES_BLOCK_SIZE_IN_BYTES = 16;
} catch (Exception ex) {
throw new GraalError(ex);
}
@ -141,7 +139,7 @@ public class AESCryptSubstitutions {
* Perform null and array bounds checks for arguments to a cipher operation.
*/
static void checkArgs(byte[] in, int inOffset, byte[] out, int outOffset) {
if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE < outOffset)) {
if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE_IN_BYTES < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE_IN_BYTES < outOffset)) {
DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
}
}

View File

@ -57,7 +57,7 @@ public class CRC32Substitutions {
return config.crcTableAddress;
}
@MethodSubstitution
@MethodSubstitution(optional = true)
static int update(int crc, int b) {
final long crcTableRawAddress = GraalHotSpotVMConfigNode.crcTableAddress();
@ -69,7 +69,7 @@ public class CRC32Substitutions {
return ~result;
}
@MethodSubstitution
@MethodSubstitution(optional = true)
static int updateBytes(int crc, byte[] buf, int off, int len) {
Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
@ -84,7 +84,7 @@ public class CRC32Substitutions {
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
}
@MethodSubstitution
@MethodSubstitution(optional = true)
static int updateByteBuffer(int crc, long addr, int off, int len) {
Word bufAddr = Word.unsigned(addr).add(off);
return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);

View File

@ -45,7 +45,7 @@ import org.graalvm.compiler.word.Word;
@ClassSubstitution(Thread.class)
public class ThreadSubstitutions {
@MethodSubstitution(isStatic = false)
@MethodSubstitution(isStatic = false, optional = true)
public static boolean isInterrupted(final Thread thisObject, boolean clearInterrupted) {
Word javaThread = CurrentJavaThreadNode.get();
Object thread = javaThread.readObject(threadObjectOffset(INJECTED_VMCONFIG), JAVA_THREAD_THREAD_OBJECT_LOCATION);

View File

@ -40,8 +40,7 @@ public interface InvocationPlugin extends GraphBuilderPlugin {
/**
* The receiver in a non-static method. The class literal for this interface must be used with
* {@link InvocationPlugins#put(InvocationPlugin, boolean, boolean, boolean, Class, String, Class...)}
* to denote the receiver argument for such a non-static method.
* {@link InvocationPlugins#put} to denote the receiver argument for such a non-static method.
*/
public interface Receiver {
/**

View File

@ -69,8 +69,7 @@ interface GraphPrinter extends Closeable {
void close();
/**
* A JVMCI package {@linkplain Services#exportJVMCITo(Class) dynamically exported} to trusted
* modules.
* A JVMCI package dynamically exported to trusted modules.
*/
String JVMCI_RUNTIME_PACKAGE = JVMCI.class.getPackage().getName();

View File

@ -30,10 +30,10 @@ import org.graalvm.compiler.test.ExportingClassLoader;
import org.junit.Assert;
import org.junit.Test;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Label;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import jdk.vm.ci.meta.ResolvedJavaMethod;
/**

View File

@ -22,9 +22,17 @@
*/
package org.graalvm.compiler.serviceprovider;
import static org.graalvm.compiler.serviceprovider.JDK9Method.Java8OrEarlier;
import static org.graalvm.compiler.serviceprovider.JDK9Method.addOpens;
import static org.graalvm.compiler.serviceprovider.JDK9Method.getModule;
import static org.graalvm.compiler.serviceprovider.JDK9Method.getPackages;
import static org.graalvm.compiler.serviceprovider.JDK9Method.isOpenTo;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.Set;
import jdk.vm.ci.services.JVMCIPermission;
import jdk.vm.ci.services.Services;
@ -32,14 +40,32 @@ import jdk.vm.ci.services.Services;
/**
* A mechanism for accessing service providers that abstracts over whether Graal is running on
* JVMCI-8 or JVMCI-9. In JVMCI-8, a JVMCI specific mechanism is used to lookup services via the
* hidden JVMCI class loader. in JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
* hidden JVMCI class loader. In JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
*/
public final class GraalServices {
private GraalServices() {
}
public static final boolean Java8OrEarlier = System.getProperty("java.specification.version").compareTo("1.9") < 0;
/**
* Opens all JVMCI packages to the module of a given class. This relies on JVMCI already having
* opened all its packages to the module defining {@link GraalServices}.
*
* @param other all JVMCI packages will be opened to the module defining this class
*/
public static void openJVMCITo(Class<?> other) {
Object jvmci = getModule.invoke(Services.class);
Object otherModule = getModule.invoke(other);
if (jvmci != otherModule) {
Set<String> packages = getPackages.invoke(jvmci);
for (String pkg : packages) {
boolean opened = isOpenTo.invoke(jvmci, pkg, otherModule);
if (!opened) {
addOpens.invoke(jvmci, pkg, otherModule);
}
}
}
}
/**
* Gets an {@link Iterable} of the providers available for a given service.
@ -50,9 +76,9 @@ public final class GraalServices {
public static <S> Iterable<S> load(Class<S> service) {
assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
if (Java8OrEarlier) {
return Services.load(service);
return load8(service);
}
ServiceLoader<S> iterable = ServiceLoader.load(service);
Iterable<S> iterable = ServiceLoader.load(service);
return new Iterable<S>() {
@Override
public Iterator<S> iterator() {
@ -66,8 +92,8 @@ public final class GraalServices {
@Override
public S next() {
S provider = iterator.next();
// Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
Services.exportJVMCITo(provider.getClass());
// Allow Graal extensions to access JVMCI
openJVMCITo(provider.getClass());
return provider;
}
@ -80,6 +106,23 @@ public final class GraalServices {
};
}
/**
* {@code Services.load(Class)} is only defined in JVMCI-8.
*/
private static volatile Method loadMethod;
@SuppressWarnings("unchecked")
private static <S> Iterable<S> load8(Class<S> service) throws InternalError {
try {
if (loadMethod == null) {
loadMethod = Services.class.getMethod("load", Class.class);
}
return (Iterable<S>) loadMethod.invoke(null, service);
} catch (Exception e) {
throw new InternalError(e);
}
}
/**
* Gets the provider for a given service for which at most one provider must be available.
*
@ -92,16 +135,14 @@ public final class GraalServices {
*/
public static <S> S loadSingle(Class<S> service, boolean required) {
assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
if (Java8OrEarlier) {
return Services.loadSingle(service, required);
}
Iterable<S> providers = ServiceLoader.load(service);
Iterable<S> providers = load(service);
S singleProvider = null;
try {
for (Iterator<S> it = providers.iterator(); it.hasNext();) {
singleProvider = it.next();
if (it.hasNext()) {
throw new InternalError(String.format("Multiple %s providers found", service.getName()));
S other = it.next();
throw new InternalError(String.format("Multiple %s providers found: %s, %s", service.getName(), singleProvider.getClass().getName(), other.getClass().getName()));
}
}
} catch (ServiceConfigurationError e) {
@ -111,9 +152,6 @@ public final class GraalServices {
if (required) {
throw new InternalError(String.format("No provider for %s found", service.getName()));
}
} else {
// Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
Services.exportJVMCITo(singleProvider.getClass());
}
return singleProvider;
}

View File

@ -0,0 +1,148 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.serviceprovider;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Reflection based access to API introduced by JDK 9. This allows the API to be used in code that
* must be compiled on a JDK prior to 9.
*/
public final class JDK9Method {
private static int getJavaSpecificationVersion() {
String value = System.getProperty("java.specification.version");
if (value.startsWith("1.")) {
value = value.substring(2);
}
return Integer.parseInt(value);
}
/**
* The integer value corresponding to the value of the {@code java.specification.version} system
* property after any leading {@code "1."} has been stripped.
*/
public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
public JDK9Method(Class<?> declaringClass, String name, Class<?>... parameterTypes) {
try {
this.method = declaringClass.getMethod(name, parameterTypes);
} catch (Exception e) {
throw new InternalError(e);
}
}
/**
* Determines if the Java runtime is version 8 or earlier.
*/
public static final boolean Java8OrEarlier = JAVA_SPECIFICATION_VERSION <= 8;
public final Method method;
public Class<?> getReturnType() {
return method.getReturnType();
}
/**
* {@code Class.getModule()}.
*/
public static final JDK9Method getModule;
/**
* {@code java.lang.Module.getPackages()}.
*/
public static final JDK9Method getPackages;
/**
* {@code java.lang.Module.getResourceAsStream(String)}.
*/
public static final JDK9Method getResourceAsStream;
/**
* {@code java.lang.Module.addOpens(String, Module)}.
*/
public static final JDK9Method addOpens;
/**
* {@code java.lang.Module.isOpen(String, Module)}.
*/
public static final JDK9Method isOpenTo;
/**
* Invokes the static Module API method represented by this object.
*/
@SuppressWarnings("unchecked")
public <T> T invokeStatic(Object... args) {
checkAvailability();
assert Modifier.isStatic(method.getModifiers());
try {
return (T) method.invoke(null, args);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new InternalError(e);
}
}
/**
* Invokes the non-static Module API method represented by this object.
*/
@SuppressWarnings("unchecked")
public <T> T invoke(Object receiver, Object... args) {
checkAvailability();
assert !Modifier.isStatic(method.getModifiers());
try {
return (T) method.invoke(receiver, args);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new InternalError(e);
}
}
private void checkAvailability() throws InternalError {
if (method == null) {
throw new InternalError("Cannot use Module API on JDK " + JAVA_SPECIFICATION_VERSION);
}
}
static {
if (JAVA_SPECIFICATION_VERSION >= 9) {
getModule = new JDK9Method(Class.class, "getModule");
Class<?> moduleClass = getModule.getReturnType();
getPackages = new JDK9Method(moduleClass, "getPackages");
addOpens = new JDK9Method(moduleClass, "addOpens", String.class, moduleClass);
getResourceAsStream = new JDK9Method(moduleClass, "getResourceAsStream", String.class);
isOpenTo = new JDK9Method(moduleClass, "isOpen", String.class, moduleClass);
} else {
JDK9Method unavailable = new JDK9Method();
getModule = unavailable;
getPackages = unavailable;
addOpens = unavailable;
getResourceAsStream = unavailable;
isOpenTo = unavailable;
}
}
private JDK9Method() {
method = null;
}
}

View File

@ -96,6 +96,7 @@ public class JLModule {
}
}
@SuppressWarnings("unchecked")
public Set<String> getPackages() {
try {
return (Set<String>) getPackagesMethod.invoke(realModule);

View File

@ -2515,6 +2515,9 @@ bool Arguments::check_vm_args_consistency() {
status = status && check_jvmci_args_consistency();
if (EnableJVMCI) {
PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true",
AddProperty, UnwriteableProperty, InternalProperty);
if (!ScavengeRootsInCode) {
warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled");
ScavengeRootsInCode = 1;

View File

@ -30,7 +30,7 @@
* @modules jdk.internal.vm.ci/jdk.vm.ci.runtime
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true
* -XX:+EnableJVMCI
* -XX:+EnableJVMCI -Djvmci.Compiler=null
* compiler.jvmci.JVM_GetJVMCIRuntimeTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false
@ -39,7 +39,7 @@
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true
* -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.threaded=true
* -XX:+EnableJVMCI
* -XX:+EnableJVMCI -Djvmci.Compiler=null
* compiler.jvmci.JVM_GetJVMCIRuntimeTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false

View File

@ -36,11 +36,11 @@ public class TestJVMCIPrintProperties {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockExperimentalVMOptions",
"-XX:+EnableJVMCI",
"-XX:+EnableJVMCI", "-Djvmci.Compiler=null",
"-XX:+JVMCIPrintProperties");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("[JVMCI properties]"); // expected message
output.shouldContain("jvmci.Compiler = null"); // expected message
output.shouldContain("jvmci.Compiler := \"null\""); // expected message
output.shouldContain("jvmci.InitTimer = false"); // expected message
output.shouldContain("jvmci.PrintConfig = false"); // expected message
output.shouldContain("jvmci.TraceMethodDataFilter = null"); // expected message

View File

@ -34,7 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* jdk.internal.vm.ci/jdk.vm.ci.meta
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.AsResolvedJavaMethodTest
*/

View File

@ -39,6 +39,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.DoNotInlineOrCompileTest
*/

View File

@ -36,6 +36,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest
*/

View File

@ -34,6 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetBytecodeTest
*/

View File

@ -31,6 +31,7 @@
* @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
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetClassInitializerTest
*/

View File

@ -38,6 +38,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetConstantPoolTest
*/
package compiler.jvmci.compilerToVM;

View File

@ -34,6 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetExceptionTableTest
*/
@ -137,4 +138,3 @@ public class GetExceptionTableTest {
}
}
}

View File

@ -31,6 +31,7 @@
* @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
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetImplementorTest
*/

View File

@ -35,6 +35,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetLineNumberTableTest
*/

View File

@ -38,6 +38,7 @@
* @compile -g DummyClass.java
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetLocalVariableTableTest
* @clean compiler.jvmci.compilerToVM.*
*/

View File

@ -35,6 +35,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.meta
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetNextStackFrameTest
*/

View File

@ -38,6 +38,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetResolvedJavaMethodTest
*/

View File

@ -44,7 +44,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -XX:-UseCompressedOops
* -XX:-UseCompressedOops -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetResolvedJavaTypeTest
*/

View File

@ -34,6 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetStackTraceElementTest
*/

View File

@ -35,6 +35,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.meta
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetSymbolTest
*/

View File

@ -34,6 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest
*/

View File

@ -39,7 +39,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -XX:-BackgroundCompilation
* -XX:-BackgroundCompilation -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest
*/

View File

@ -31,7 +31,8 @@
* @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
* compiler.jvmci.compilerToVM.HasFinalizableSubclassTest
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.HasFinalizableSubclassTest
*/
package compiler.jvmci.compilerToVM;

View File

@ -39,6 +39,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.HasNeverInlineDirectiveTest
*/

View File

@ -42,6 +42,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest
*/

View File

@ -39,10 +39,12 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.IsCompilableTest
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.IsCompilableTest
*/

View File

@ -38,6 +38,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbatch
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.IsMatureVsReprofileTest
*/

View File

@ -42,6 +42,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupKlassInPoolTest
*/

View File

@ -40,6 +40,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest
*/

View File

@ -40,6 +40,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupMethodInPoolTest
*/

View File

@ -40,6 +40,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest
*/

View File

@ -41,6 +41,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupNameInPoolTest
*/

View File

@ -41,6 +41,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupSignatureInPoolTest
*/

View File

@ -31,6 +31,7 @@
* @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
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.LookupTypeTest
*/

View File

@ -49,6 +49,7 @@
* -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
* @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@ -60,6 +61,7 @@
* -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
* @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@ -71,6 +73,7 @@
* -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
* @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
@ -82,6 +85,7 @@
* -XX:+DoEscapeAnalysis -XX:-UseCounterDecay
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false
* -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest
*/

View File

@ -35,6 +35,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest
*/

View File

@ -32,6 +32,7 @@
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @build compiler.jvmci.compilerToVM.ReadConfigurationTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ReadConfigurationTest
*/

View File

@ -40,7 +40,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Xmixed -Xbatch
* -Xmixed -Xbatch -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ReprofileTest
*/

View File

@ -40,6 +40,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ResolveConstantInPoolTest
*/

View File

@ -40,6 +40,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ResolveFieldInPoolTest
*/

View File

@ -34,6 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.code
* @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ResolveMethodTest
*/

View File

@ -40,6 +40,7 @@
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest
*/

View File

@ -41,6 +41,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ResolveTypeInPoolTest
*/

View File

@ -39,6 +39,7 @@
* @run main/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null
* compiler.jvmci.compilerToVM.ShouldInlineMethodTest
*/

View File

@ -31,7 +31,8 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.common
* @compile CodeInstallerTest.java
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidCompilationResult
*/
package compiler.jvmci.errors;

View File

@ -31,7 +31,8 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.common
* @compile CodeInstallerTest.java
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidDebugInfo
*/
package compiler.jvmci.errors;

View File

@ -31,7 +31,8 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.internal.vm.ci/jdk.vm.ci.common
* @compile CodeInstallerTest.java
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap
* @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidOopMap
*/
package compiler.jvmci.errors;

View File

@ -49,21 +49,14 @@
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Xbootclasspath/a:. -Xmixed
* -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
* -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
* compiler.jvmci.events.JvmciNotifyInstallEventTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
* -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
* -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI
* -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
* compiler.jvmci.events.JvmciNotifyInstallEventTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions
* -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
* -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
* -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0
* -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false
* compiler.jvmci.events.JvmciNotifyInstallEventTest
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-EnableJVMCI
* -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed
* -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=true
* compiler.jvmci.events.JvmciNotifyInstallEventTest
*/
@ -91,8 +84,6 @@ import java.lang.reflect.Method;
public class JvmciNotifyInstallEventTest extends JVMCIServiceLocator implements HotSpotVMEventListener {
private static final String METHOD_NAME = "testMethod";
private static final boolean FAIL_ON_INIT = !Boolean.getBoolean(
"compiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit");
private static volatile int gotInstallNotification = 0;
public static void main(String args[]) {
@ -116,16 +107,9 @@ public class JvmciNotifyInstallEventTest extends JVMCIServiceLocator implements
codeCache = (HotSpotCodeCacheProvider) HotSpotJVMCIRuntime.runtime()
.getHostJVMCIBackend().getCodeCache();
} catch (InternalError ie) {
if (FAIL_ON_INIT) {
throw new AssertionError(
"Got unexpected InternalError trying to get code cache",
ie);
}
// passed
return;
}
Asserts.assertTrue(FAIL_ON_INIT,
"Haven't caught InternalError in negative case");
Method testMethod;
try {
testMethod = SimpleClass.class.getDeclaredMethod(METHOD_NAME);

View File

@ -33,7 +33,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.DataPatchTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.DataPatchTest
*/
package jdk.vm.ci.code.test;

View File

@ -33,7 +33,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.InterpreterFrameSizeTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.InterpreterFrameSizeTest
*/
package jdk.vm.ci.code.test;

View File

@ -34,7 +34,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.MaxOopMapStackOffsetTest
*/
package jdk.vm.ci.code.test;

View File

@ -33,7 +33,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleCodeInstallationTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleCodeInstallationTest
*/
package jdk.vm.ci.code.test;

View File

@ -33,7 +33,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleDebugInfoTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleDebugInfoTest
*/
package jdk.vm.ci.code.test;

View File

@ -33,7 +33,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.amd64
* jdk.internal.vm.ci/jdk.vm.ci.sparc
* @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.VirtualObjectDebugInfoTest
*/
package jdk.vm.ci.code.test;

View File

@ -34,7 +34,7 @@
* @run driver ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass
* @run testng/othervm/timeout=300 -Xbootclasspath/a:.
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
* -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest
*/
package jdk.vm.ci.hotspot.test;

View File

@ -37,7 +37,7 @@
* @run testng/othervm -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* jdk.vm.ci.hotspot.test.MemoryAccessProviderTest
* -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MemoryAccessProviderTest
*/
package jdk.vm.ci.hotspot.test;

View File

@ -32,7 +32,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
* @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
* -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest
*/
package jdk.vm.ci.hotspot.test;

View File

@ -28,7 +28,7 @@
* @modules jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* java.base/jdk.internal.misc
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ConstantTest
*/
package jdk.vm.ci.runtime.test;

View File

@ -29,7 +29,7 @@
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* jdk.attach
* java.base/jdk.internal.misc
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.RedefineClassTest
*/
package jdk.vm.ci.runtime.test;

View File

@ -26,7 +26,7 @@
* @requires vm.jvmci
* @modules jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest
*/
package jdk.vm.ci.runtime.test;

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