File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -251,4 +251,27 @@ public static ResolvedJavaType getResolvedReturnType(ResolvedJavaMethod m) {
251251 }
252252 throw new GraalError ("Method does not have a resolved return type: %s" , m .format ("%H.%n(%p)" ));
253253 }
254+
255+ /**
256+ * Gets the type name for a {@link ResolvedJavaType}. This is the same as calling
257+ * {@link Class#getTypeName()} on the underlying class.
258+ * <p>
259+ * Implementation derived from {@link Class#getTypeName()}.
260+ */
261+ public static String getTypeName (ResolvedJavaType type ) {
262+ if (type .isArray ()) {
263+ try {
264+ ResolvedJavaType cl = type ;
265+ int dimensions = 0 ;
266+ do {
267+ dimensions ++;
268+ cl = cl .getComponentType ();
269+ } while (cl .isArray ());
270+ return cl .getName ().concat ("[]" .repeat (dimensions ));
271+ } catch (Throwable e ) {
272+ /* FALLTHRU */
273+ }
274+ }
275+ return type .toClassName ();
276+ }
254277}
Original file line number Diff line number Diff line change 3030import jdk .vm .ci .meta .ResolvedJavaMethod ;
3131import jdk .vm .ci .meta .ResolvedJavaType ;
3232
33+ /**
34+ * Mirror of org.graalvm.nativeimage.dynamicaccess.JNIAccess using JVMCI types.
35+ */
3336public interface JVMCIJNIAccess {
37+ /**
38+ * See org.graalvm.nativeimage.dynamicaccess.JNIAccess#register(AccessCondition, Class...).
39+ */
3440 void register (AccessCondition condition , ResolvedJavaType ... types );
3541
42+ /**
43+ * See org.graalvm.nativeimage.dynamicaccess.JNIAccess#register(AccessCondition, Executable...).
44+ */
3645 void register (AccessCondition condition , ResolvedJavaMethod ... methods );
3746
47+ /**
48+ * See org.graalvm.nativeimage.dynamicaccess.JNIAccess#register(AccessCondition, Field...).
49+ */
3850 void register (AccessCondition condition , ResolvedJavaField ... fields );
3951}
You can’t perform that action at this time.
0 commit comments