hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
equal
deleted
inserted
replaced
26 import java.lang.reflect.Method; |
26 import java.lang.reflect.Method; |
27 import java.util.Formatter; |
27 import java.util.Formatter; |
28 import java.util.Iterator; |
28 import java.util.Iterator; |
29 import java.util.ServiceConfigurationError; |
29 import java.util.ServiceConfigurationError; |
30 import java.util.ServiceLoader; |
30 import java.util.ServiceLoader; |
|
31 import java.util.Set; |
31 |
32 |
32 /** |
33 /** |
33 * A mechanism for accessing service providers via JVMCI. |
34 * A mechanism for accessing service providers via JVMCI. |
34 */ |
35 */ |
35 public final class Services { |
36 public final class Services { |
106 } |
107 } |
107 if (JAVA_SPECIFICATION_VERSION >= 9) { |
108 if (JAVA_SPECIFICATION_VERSION >= 9) { |
108 Object jvmci = invoke(getModule, Services.class); |
109 Object jvmci = invoke(getModule, Services.class); |
109 Object requestorModule = invoke(getModule, requestor); |
110 Object requestorModule = invoke(getModule, requestor); |
110 if (jvmci != requestorModule) { |
111 if (jvmci != requestorModule) { |
111 String[] packages = invoke(getPackages, jvmci); |
112 Set<String> packages = invoke(getPackages, jvmci); |
112 for (String pkg : packages) { |
113 for (String pkg : packages) { |
113 // Export all JVMCI packages dynamically instead |
114 // Export all JVMCI packages dynamically instead |
114 // of requiring a long list of --add-exports |
115 // of requiring a long list of --add-exports |
115 // options on the JVM command line. |
116 // options on the JVM command line. |
116 boolean exported = invoke(isExported, jvmci, pkg, requestorModule); |
117 boolean exported = invoke(isExported, jvmci, pkg, requestorModule); |