Skip to content

Commit 4f395cd

Browse files
[GR-36606] Remove hosted annotations from getAnnotation method.
PullRequest: graal/11386
2 parents 4066b56 + 3e93ee2 commit 4f395cd

26 files changed

+140
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Alias.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -51,5 +54,6 @@
5154
*/
5255
@Retention(RetentionPolicy.RUNTIME)
5356
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
57+
@Platforms(Platform.HOSTED_ONLY.class)
5458
public @interface Alias {
5559
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/AlwaysInline.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -34,6 +37,7 @@
3437
*/
3538
@Retention(RetentionPolicy.RUNTIME)
3639
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
40+
@Platforms(Platform.HOSTED_ONLY.class)
3741
public @interface AlwaysInline {
3842

3943
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/AnnotateOriginal.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -38,5 +41,6 @@
3841
*/
3942
@Retention(RetentionPolicy.RUNTIME)
4043
@Target(ElementType.METHOD)
44+
@Platforms(Platform.HOSTED_ONLY.class)
4145
public @interface AnnotateOriginal {
4246
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/AutomaticFeature.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -35,5 +38,6 @@
3538
*/
3639
@Retention(RetentionPolicy.RUNTIME)
3740
@Target({ElementType.TYPE})
41+
@Platforms(Platform.HOSTED_ONLY.class)
3842
public @interface AutomaticFeature {
3943
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Delete.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -37,6 +40,7 @@
3740
*/
3841
@Retention(RetentionPolicy.RUNTIME)
3942
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
43+
@Platforms(Platform.HOSTED_ONLY.class)
4044
public @interface Delete {
4145

4246
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/DeoptTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -37,6 +40,7 @@
3740
*/
3841
@Retention(RetentionPolicy.RUNTIME)
3942
@Target(ElementType.METHOD)
43+
@Platforms(Platform.HOSTED_ONLY.class)
4044
public @interface DeoptTest {
4145

4246
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/DuplicatedInNativeCode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -35,5 +38,6 @@
3538
*/
3639
@Retention(RetentionPolicy.SOURCE)
3740
@Target(value = {ElementType.METHOD, ElementType.TYPE, ElementType.FIELD})
41+
@Platforms(Platform.HOSTED_ONLY.class)
3842
public @interface DuplicatedInNativeCode {
3943
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/ExcludeFromReferenceMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
*/
4040
@Retention(RetentionPolicy.RUNTIME)
4141
@Target(ElementType.FIELD)
42+
@Platforms(Platform.HOSTED_ONLY.class)
4243
public @interface ExcludeFromReferenceMap {
4344

4445
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Inject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -38,5 +41,6 @@
3841
*/
3942
@Retention(RetentionPolicy.RUNTIME)
4043
@Target({ElementType.FIELD})
44+
@Platforms(Platform.HOSTED_ONLY.class)
4145
public @interface Inject {
4246
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/InjectAccessors.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -57,6 +60,7 @@
5760
*/
5861
@Retention(RetentionPolicy.RUNTIME)
5962
@Target(ElementType.FIELD)
63+
@Platforms(Platform.HOSTED_ONLY.class)
6064
public @interface InjectAccessors {
6165

6266
Class<?> value();

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/InvokeJavaFunctionPointer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import java.lang.annotation.RetentionPolicy;
3030
import java.lang.annotation.Target;
3131

32+
import org.graalvm.nativeimage.Platform;
33+
import org.graalvm.nativeimage.Platforms;
3234
import org.graalvm.nativeimage.c.function.CFunctionPointer;
3335

3436
/**
@@ -38,5 +40,6 @@
3840
*/
3941
@Retention(RetentionPolicy.RUNTIME)
4042
@Target({ElementType.METHOD})
43+
@Platforms(Platform.HOSTED_ONLY.class)
4144
public @interface InvokeJavaFunctionPointer {
4245
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/KeepOriginal.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -41,5 +44,6 @@
4144
*/
4245
@Retention(RetentionPolicy.RUNTIME)
4346
@Target({ElementType.METHOD, ElementType.TYPE})
47+
@Platforms(Platform.HOSTED_ONLY.class)
4448
public @interface KeepOriginal {
4549
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/NeverInlineTrivial.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -35,6 +38,7 @@
3538
*/
3639
@Retention(RetentionPolicy.RUNTIME)
3740
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
41+
@Platforms(Platform.HOSTED_ONLY.class)
3842
public @interface NeverInlineTrivial {
3943

4044
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RecomputeFieldValue.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
import jdk.vm.ci.meta.MetaAccessProvider;
3636
import jdk.vm.ci.meta.ResolvedJavaField;
37+
import org.graalvm.nativeimage.Platform;
38+
import org.graalvm.nativeimage.Platforms;
3739

3840
/**
3941
* Mechanism to change the value of a field. Normally, field values in the native image heap of the
@@ -45,6 +47,7 @@
4547
*/
4648
@Retention(RetentionPolicy.RUNTIME)
4749
@Target(ElementType.FIELD)
50+
@Platforms(Platform.HOSTED_ONLY.class)
4851
public @interface RecomputeFieldValue {
4952

5053
enum Kind {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/RestrictHeapAccess.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -35,6 +38,7 @@
3538
*/
3639
@Retention(RetentionPolicy.RUNTIME)
3740
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
41+
@Platforms(Platform.HOSTED_ONLY.class)
3842
public @interface RestrictHeapAccess {
3943
enum Access {
4044
UNRESTRICTED,

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Specialize.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -42,6 +45,7 @@
4245
*/
4346
@Retention(RetentionPolicy.RUNTIME)
4447
@Target(ElementType.METHOD)
48+
@Platforms(Platform.HOSTED_ONLY.class)
4549
public @interface Specialize {
4650

4751
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/StubCallingConvention.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import java.lang.annotation.RetentionPolicy;
3030
import java.lang.annotation.Target;
3131

32+
import org.graalvm.nativeimage.Platform;
33+
import org.graalvm.nativeimage.Platforms;
3234
import org.graalvm.util.GuardedAnnotationAccess;
3335

3436
import com.oracle.svm.core.CalleeSavedRegisters;
@@ -45,6 +47,7 @@
4547
*/
4648
@Retention(RetentionPolicy.RUNTIME)
4749
@Target(ElementType.METHOD)
50+
@Platforms(Platform.HOSTED_ONLY.class)
4851
public @interface StubCallingConvention {
4952

5053
class Utils {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/Substitute.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -52,6 +55,7 @@
5255
*/
5356
@Retention(RetentionPolicy.RUNTIME)
5457
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.FIELD})
58+
@Platforms(Platform.HOSTED_ONLY.class)
5559
public @interface Substitute {
5660
boolean polymorphicSignature() default false;
5761
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/SubstituteTarget.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -37,5 +40,6 @@
3740
*/
3841
@Retention(RetentionPolicy.CLASS)
3942
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.FIELD})
43+
@Platforms(Platform.HOSTED_ONLY.class)
4044
public @interface SubstituteTarget {
4145
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/TargetClass.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -71,6 +74,7 @@
7174
*/
7275
@Retention(RetentionPolicy.RUNTIME)
7376
@Target(ElementType.TYPE)
77+
@Platforms(Platform.HOSTED_ONLY.class)
7478
public @interface TargetClass {
7579

7680
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/TargetElement.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -39,6 +42,7 @@
3942
*/
4043
@Retention(RetentionPolicy.RUNTIME)
4144
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
45+
@Platforms(Platform.HOSTED_ONLY.class)
4246
public @interface TargetElement {
4347

4448
String CONSTRUCTOR_NAME = "<init>";

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/UnknownClass.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -37,6 +40,7 @@
3740
*/
3841
@Retention(RetentionPolicy.RUNTIME)
3942
@Target({ElementType.FIELD, ElementType.TYPE})
43+
@Platforms(Platform.HOSTED_ONLY.class)
4044
public @interface UnknownClass {
4145

4246
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/UnknownObjectField.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
package com.oracle.svm.core.annotate;
2626

27+
import org.graalvm.nativeimage.Platform;
28+
import org.graalvm.nativeimage.Platforms;
29+
2730
import java.lang.annotation.ElementType;
2831
import java.lang.annotation.Retention;
2932
import java.lang.annotation.RetentionPolicy;
@@ -37,6 +40,7 @@
3740
*/
3841
@Retention(RetentionPolicy.RUNTIME)
3942
@Target(ElementType.FIELD)
43+
@Platforms(Platform.HOSTED_ONLY.class)
4044
public @interface UnknownObjectField {
4145

4246
/**

0 commit comments

Comments
 (0)