Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.graalvm.nativeimage.Platforms;

import com.oracle.objectfile.debugentry.TypeEntry;
import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.heap.UnknownObjectField;

import jdk.graal.compiler.api.replacements.Fold;
Expand All @@ -42,7 +43,7 @@ public class SubstrateDebugTypeEntrySupport {
* debug info generation. We can't get ElementInfo at run-time, but we can reuse the type
* entries produced during the native image build for run-time debug info generation.
*/
@UnknownObjectField(fullyQualifiedTypes = {"java.util.HashMap", "java.util.ImmutableCollections$MapN", "java.util.ImmutableCollections$Map1"}) //
@UnknownObjectField(availability = AfterAnalysis.class, fullyQualifiedTypes = {"java.util.HashMap", "java.util.ImmutableCollections$MapN", "java.util.ImmutableCollections$Map1"}) //
private Map<Long, TypeEntry> typeEntryMap = new HashMap<>();

@Fold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;

/**
* For fields with this annotation no static analysis is done.
*
Expand Down Expand Up @@ -65,5 +63,5 @@
*/
boolean canBeNull() default false;

Class<? extends BooleanSupplier> availability() default AfterAnalysis.class;
Class<? extends BooleanSupplier> availability();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;

/**
* For fields with this annotation no static analysis is done.
*
Expand All @@ -46,5 +44,5 @@
@Target(ElementType.FIELD)
@Platforms(Platform.HOSTED_ONLY.class)
public @interface UnknownPrimitiveField {
Class<? extends BooleanSupplier> availability() default AfterAnalysis.class;
Class<? extends BooleanSupplier> availability();
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public final class DynamicHubCompanion {
* Back link to the SubstrateType used by the substrate meta access. Only used for the subset of
* types for which a SubstrateType exists.
*/
@UnknownObjectField(fullyQualifiedTypes = "com.oracle.svm.graal.meta.SubstrateType", canBeNull = true) //
@UnknownObjectField(availability = BuildPhaseProvider.AfterAnalysis.class, fullyQualifiedTypes = "com.oracle.svm.graal.meta.SubstrateType", canBeNull = true) //
@Stable SharedType metaType;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.SubstrateUtil;
import com.oracle.svm.core.heap.UnknownObjectField;
import com.oracle.svm.core.heap.UnknownPrimitiveField;
Expand All @@ -42,11 +43,11 @@
public class GlobTrieNode<C> {

private String content;
@UnknownObjectField(fullyQualifiedTypes = {"java.util.HashMap", "java.util.ImmutableCollections$MapN", "java.util.ImmutableCollections$Map1"}) //
@UnknownObjectField(availability = AfterAnalysis.class, fullyQualifiedTypes = {"java.util.HashMap", "java.util.ImmutableCollections$MapN", "java.util.ImmutableCollections$Map1"}) //
private Map<String, GlobTrieNode<C>> children;
@UnknownPrimitiveField //
@UnknownPrimitiveField(availability = AfterAnalysis.class) //
private boolean isLeaf;
@UnknownPrimitiveField //
@UnknownPrimitiveField(availability = AfterAnalysis.class) //
private boolean isNewLevel;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.graalvm.nativeimage.hosted.Feature.FeatureAccess;

import com.oracle.graal.pointsto.meta.AnalysisUniverse;
import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.graal.code.SubstrateBackend;
import com.oracle.svm.core.graal.code.SubstrateBackendFactory;
Expand Down Expand Up @@ -97,11 +98,11 @@ public class TruffleRuntimeCompilationSupport {
* not prematurely constant folded we must mark them as unknown fields.
*/

@UnknownObjectField private SubstrateMethod[] methodsToCompile;
@UnknownObjectField private byte[] graphEncoding;
@UnknownObjectField private Object[] graphObjects;
@UnknownObjectField private NodeClassMap graphNodeTypes;
@UnknownPrimitiveField private int graphNodeTypesSize;
@UnknownObjectField(availability = AfterAnalysis.class) private SubstrateMethod[] methodsToCompile;
@UnknownObjectField(availability = AfterAnalysis.class) private byte[] graphEncoding;
@UnknownObjectField(availability = AfterAnalysis.class) private Object[] graphObjects;
@UnknownObjectField(availability = AfterAnalysis.class) private NodeClassMap graphNodeTypes;
@UnknownPrimitiveField(availability = AfterAnalysis.class) private int graphNodeTypesSize;

protected Function<Providers, SubstrateBackend> runtimeBackendProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import com.oracle.graal.pointsto.infrastructure.OriginalFieldProvider;
import com.oracle.graal.pointsto.meta.AnalysisField;
import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.BuildPhaseProvider.AfterCompilation;
import com.oracle.svm.core.heap.UnknownObjectField;
import com.oracle.svm.core.heap.UnknownPrimitiveField;
Expand All @@ -52,8 +53,8 @@ public class SubstrateField implements SharedField {

protected static final SubstrateField[] EMPTY_ARRAY = new SubstrateField[0];

@UnknownObjectField SubstrateType type;
@UnknownObjectField SubstrateType declaringClass;
@UnknownObjectField(availability = AfterAnalysis.class) SubstrateType type;
@UnknownObjectField(availability = AfterAnalysis.class) SubstrateType declaringClass;
private final String name;
private final int modifiers;
private int hashCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.graalvm.nativeimage.Platforms;
import org.graalvm.word.WordBase;

import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.heap.UnknownObjectField;
import com.oracle.svm.core.hub.DynamicHub;
Expand All @@ -57,10 +58,10 @@ public class SubstrateType implements SharedType {
* If it is not known if the type has an instance field (because the type metadata was created
* at image runtime), it is null.
*/
@UnknownObjectField(canBeNull = true)//
@UnknownObjectField(availability = AfterAnalysis.class, canBeNull = true)//
SubstrateField[] rawAllInstanceFields;

@UnknownObjectField(canBeNull = true)//
@UnknownObjectField(availability = AfterAnalysis.class, canBeNull = true)//
protected DynamicHub uniqueConcreteImplementation;

public SubstrateType(JavaKind kind, DynamicHub hub) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.BuildPhaseProvider.AfterAnalysis;
import com.oracle.svm.core.heap.UnknownObjectField;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.espresso.classfile.ConstantPool;
Expand Down Expand Up @@ -60,7 +61,7 @@ public class InterpreterConstantPool extends ConstantPool implements jdk.vm.ci.m
final ParserConstantPool parserConstantPool;

// Assigned after analysis.
@UnknownObjectField(types = Object[].class) protected Object[] cachedEntries;
@UnknownObjectField(availability = AfterAnalysis.class, types = Object[].class) protected Object[] cachedEntries;

Object objAt(int cpi) {
if (cpi == 0) {
Expand Down
Loading