|
48 | 48 | import java.util.function.Predicate;
|
49 | 49 | import java.util.function.Supplier;
|
50 | 50 |
|
51 |
| -import com.oracle.svm.hosted.SVMHost; |
52 | 51 | import org.graalvm.nativeimage.AnnotationAccess;
|
53 | 52 | import org.graalvm.nativeimage.ImageSingletons;
|
54 | 53 | import org.graalvm.nativeimage.Platform;
|
|
58 | 57 | import com.oracle.graal.pointsto.BigBang;
|
59 | 58 | import com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor;
|
60 | 59 | import com.oracle.graal.pointsto.meta.AnalysisField;
|
| 60 | +import com.oracle.graal.pointsto.meta.AnalysisUniverse; |
61 | 61 | import com.oracle.svm.core.SubstrateOptions;
|
62 | 62 | import com.oracle.svm.core.SubstrateUtil;
|
63 | 63 | import com.oracle.svm.core.Uninterruptible;
|
|
84 | 84 | import com.oracle.svm.hosted.ImageClassLoader;
|
85 | 85 | import com.oracle.svm.hosted.NativeImageGenerator;
|
86 | 86 | import com.oracle.svm.hosted.NativeImageOptions;
|
| 87 | +import com.oracle.svm.hosted.SVMHost; |
87 | 88 | import com.oracle.svm.hosted.ameta.FieldValueInterceptionSupport;
|
88 | 89 | import com.oracle.svm.hosted.classinitialization.ClassInitializationSupport;
|
| 90 | +import com.oracle.svm.hosted.meta.HostedUniverse; |
89 | 91 | import com.oracle.svm.util.ReflectionUtil;
|
90 | 92 | import com.oracle.svm.util.ReflectionUtil.ReflectionUtilError;
|
91 | 93 |
|
|
94 | 96 | import jdk.vm.ci.meta.ResolvedJavaMethod;
|
95 | 97 | import jdk.vm.ci.meta.ResolvedJavaType;
|
96 | 98 |
|
| 99 | +/** |
| 100 | + * The main substitution processor for Native Image. The annotations supported by this processor |
| 101 | + * are: |
| 102 | + * <ul> |
| 103 | + * <li>{@link TargetClass}</li> |
| 104 | + * <li>{@link Substitute}</li> |
| 105 | + * <li>{@link TargetElement}</li> |
| 106 | + * <li>{@link Alias}</li> |
| 107 | + * <li>{@link AnnotateOriginal}</li> |
| 108 | + * <li>{@link Delete}</li> |
| 109 | + * <li>{@link Inject}</li> |
| 110 | + * <li>{@link InjectAccessors}</li> |
| 111 | + * <li>{@link KeepOriginal}</li> |
| 112 | + * <li>{@link RecomputeFieldValue}</li> |
| 113 | + * </ul> |
| 114 | + * Code tagged with these annotations is preprocessed during Native Image setup when the processor |
| 115 | + * is {@link AnnotationSubstitutionProcessor#init(FieldValueInterceptionSupport) initialized}. Then, |
| 116 | + * hosted code corresponding to the substitution code is intercepted and replaced without modifying |
| 117 | + * the class files during {@link AnalysisUniverse} lookups. See each annotation's JavaDoc for more |
| 118 | + * details, starting with {@link TargetClass}. See also {@link HostedUniverse} for a comprehensive |
| 119 | + * description of the substitution layer. |
| 120 | + */ |
97 | 121 | public class AnnotationSubstitutionProcessor extends SubstitutionProcessor {
|
98 | 122 |
|
99 | 123 | /**
|
@@ -306,7 +330,7 @@ public void registerUnsafeAccessedFields(BigBang bb) {
|
306 | 330 | }
|
307 | 331 |
|
308 | 332 | public void init(FieldValueInterceptionSupport newFieldValueInterceptionSupport) {
|
309 |
| - /** |
| 333 | + /* |
310 | 334 | * Cannot set this field in the constructor due to cyclic dependencies between the two
|
311 | 335 | * classes.
|
312 | 336 | */
|
|
0 commit comments