Skip to content

Commit 4c64ebe

Browse files
committed
Use JVMCI for @delete classes
1 parent 721466c commit 4c64ebe

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
143143
@Option(help = "Allow MethodTypeFlow to see @Fold methods")//
144144
public static final HostedOptionKey<Boolean> AllowFoldMethods = new HostedOptionKey<>(false);
145145

146-
@APIOption(name = "report-unsupported-elements-at-runtime", deprecated = "The flag is not needed anymore as usage of unsupported elements is now reported at run time by default.")//
146+
@APIOption(name = "report-unsupported-elements-at-runtime", deprecated = "The option is deprecated and will be removed in the future. The use of unsupported elements is always reported at run time.")//
147147
@Option(help = "Report usage of unsupported methods and fields at run time when they are accessed the first time, instead of as an error during image building", type = Debug)//
148148
public static final HostedOptionKey<Boolean> ReportUnsupportedElementsAtRuntime = new HostedOptionKey<>(true);
149149

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -589,19 +589,19 @@ private void handleDeletedClass(Class<?> originalClass, Delete deleteAnnotation)
589589
* We register all methods and fields as deleted. That still allows usage of the type in
590590
* type checks.
591591
*/
592-
for (Executable m : originalClass.getDeclaredMethods()) {
593-
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
592+
ResolvedJavaType type = metaAccess.lookupJavaType(originalClass);
593+
for (ResolvedJavaMethod method : type.getDeclaredMethods()) {
594594
registerAsDeleted(null, method, deleteAnnotation);
595595
}
596-
for (Executable m : originalClass.getDeclaredConstructors()) {
597-
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
598-
registerAsDeleted(null, method, deleteAnnotation);
596+
for (ResolvedJavaMethod constructor : type.getDeclaredConstructors()) {
597+
registerAsDeleted(null, constructor, deleteAnnotation);
599598
}
600-
for (Field f : originalClass.getDeclaredFields()) {
601-
ResolvedJavaField field = metaAccess.lookupJavaField(f);
602-
registerAsDeleted(null, field, deleteAnnotation);
599+
for (ResolvedJavaField f : type.getInstanceFields(false)) {
600+
registerAsDeleted(null, f, deleteAnnotation);
601+
}
602+
for (ResolvedJavaField f : type.getStaticFields()) {
603+
registerAsDeleted(null, f, deleteAnnotation);
603604
}
604-
605605
} else {
606606
deleteAnnotations.put(metaAccess.lookupJavaType(originalClass), deleteAnnotation);
607607
}

0 commit comments

Comments
 (0)