|
42 | 42 | import org.graalvm.word.Pointer; |
43 | 43 |
|
44 | 44 | import com.oracle.svm.configure.ClassNameSupport; |
| 45 | +import com.oracle.svm.configure.config.ConfigurationMemberInfo; |
| 46 | +import com.oracle.svm.configure.config.ConfigurationType; |
45 | 47 | import com.oracle.svm.core.SubstrateOptions; |
46 | 48 | import com.oracle.svm.core.Uninterruptible; |
47 | 49 | import com.oracle.svm.core.heap.Heap; |
|
53 | 55 | import com.oracle.svm.core.layeredimagesingleton.MultiLayeredImageSingleton; |
54 | 56 | import com.oracle.svm.core.layeredimagesingleton.UnsavedSingleton; |
55 | 57 | import com.oracle.svm.core.log.Log; |
| 58 | +import com.oracle.svm.core.metadata.MetadataTracer; |
56 | 59 | import com.oracle.svm.core.snippets.KnownIntrinsics; |
57 | 60 | import com.oracle.svm.core.util.ImageHeapMap; |
58 | 61 | import com.oracle.svm.core.util.Utf8.WrappedAsciiCString; |
@@ -187,6 +190,9 @@ public static Class<?> getClassObjectByName(CharSequence name) { |
187 | 190 | clazz = NEGATIVE_CLASS_LOOKUP; |
188 | 191 | } |
189 | 192 | } |
| 193 | + if (MetadataTracer.Options.MetadataTracingSupport.getValue() && clazz != null && MetadataTracer.singleton().enabled()) { |
| 194 | + MetadataTracer.singleton().traceJNIType(ClassNameSupport.jniNameToTypeName(name.toString())); |
| 195 | + } |
190 | 196 | clazz = checkClass(clazz, name); |
191 | 197 | if (clazz != null) { |
192 | 198 | return clazz.getClassObject(); |
@@ -279,6 +285,10 @@ private static JNIAccessibleMethod getDeclaredMethod(Class<?> classObject, JNIAc |
279 | 285 | foundClass = true; |
280 | 286 | JNIAccessibleMethod method = clazz.getMethod(descriptor); |
281 | 287 | if (method != null) { |
| 288 | + if (MetadataTracer.Options.MetadataTracingSupport.getValue() && MetadataTracer.singleton().enabled()) { |
| 289 | + ConfigurationType clazzType = MetadataTracer.singleton().traceJNIType(classObject.getName()); |
| 290 | + clazzType.addMethod(descriptor.getNameConvertToString(), descriptor.getSignatureConvertToString(), ConfigurationMemberInfo.ConfigurationMemberDeclaration.DECLARED); |
| 291 | + } |
282 | 292 | return method; |
283 | 293 | } |
284 | 294 | } |
@@ -334,6 +344,10 @@ private static JNIAccessibleField getDeclaredField(Class<?> classObject, CharSeq |
334 | 344 | foundClass = true; |
335 | 345 | JNIAccessibleField field = clazz.getField(name); |
336 | 346 | if (field != null && (field.isStatic() == isStatic || field.isNegative())) { |
| 347 | + if (MetadataTracer.Options.MetadataTracingSupport.getValue() && MetadataTracer.singleton().enabled()) { |
| 348 | + ConfigurationType clazzType = MetadataTracer.singleton().traceJNIType(classObject.getName()); |
| 349 | + clazzType.addField(name.toString(), ConfigurationMemberInfo.ConfigurationMemberDeclaration.DECLARED, false); |
| 350 | + } |
337 | 351 | return field; |
338 | 352 | } |
339 | 353 | } |
|
0 commit comments