Top Description Inners Methods
com.oracle.svm.core.annotate

public @Interface RecomputeFieldValue

extends Annotation
Annotations
@Retention:RUNTIME
@Target:FIELD
@Platforms:HOSTED_ONLY
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target, java.lang.reflect.Field, org.graalvm.nativeimage.Platform, .Platforms, org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess, .FieldValueTransformer

Supported API is available to replace this non-API annotation: Use BeforeAnalysisAccess#registerFieldValueTransformer. Mechanism to change the value of a field. Normally, field values in the native image heap of the Substrate VM are just taken from the host VM. This annotation allows the field value to be intercepted and recomputed.

This annotation must be used on a field also annotated with Alias to specify the field whose value needs to be changed.

Since
22.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public Class<?>
declClass()

The class parameter for the recomputation.

public String
declClassName()

The class parameter for the recomputation.

public boolean
disableCaching()

If true, ignores previously computed values and calculates the value for every field read.

public boolean
isFinal()

Treat the value as final, to enforce constant folding already during static analysis.

public RecomputeFieldValue.Kind
kind()

The kind of the recomputation performed.

public String
name()

The name parameter for the recomputation.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

declClassback to summary
public Class<?> declClass()

The class parameter for the recomputation. If this attribute is not specified, then the class specified by declClassName() is used. If neither declClass() nor declClassName() is specified, then the class specified by the TargetClass annotation is used.

Since
22.3
declClassNameback to summary
public String declClassName()

The class parameter for the recomputation. If this attribute is not specified, then the class specified by declClass() is used. If neither declClass() nor declClassName() is specified, then the class specified by the TargetClass annotation is used.

Since
22.3
disableCachingback to summary
public boolean disableCaching()

If true, ignores previously computed values and calculates the value for every field read.

Since
22.3
isFinalback to summary
public boolean isFinal()

Treat the value as final, to enforce constant folding already during static analysis.

Since
22.3
kindback to summary
public RecomputeFieldValue.Kind kind()

The kind of the recomputation performed.

Since
22.3
nameback to summary
public String name()

The name parameter for the recomputation.

Since
22.3
com.oracle.svm.core.annotate back to summary

public final Enum RecomputeFieldValue.Kind

extends Enum<RecomputeFieldValue.Kind>
Class Inheritance

Since
22.3

Field Summary

Modifier and TypeField and Description
public static final RecomputeFieldValue.Kind
ArrayBaseOffset

The int or long field is set to the offset of the first array element of the array class declClass, as it would be computed by sun.misc.Unsafe#arrayBaseOffset(Class).

public static final RecomputeFieldValue.Kind
ArrayIndexScale

The int or long field is set to the element size array class declClass, as it would be computed by sun.misc.Unsafe#arrayIndexScale(Class).

public static final RecomputeFieldValue.Kind
ArrayIndexShift

The int or long field is set to the log2 of ArrayIndexScale.

public static final RecomputeFieldValue.Kind
AtomicFieldUpdaterOffset

Special support for field offsets used by java.util.concurrent.atomic.AtomicXxxFieldUpdater.

public static final RecomputeFieldValue.Kind
Custom

Use a FieldValueTransformer, which is specified as the target class.

public static final RecomputeFieldValue.Kind
FieldOffset

The int or long field is set to the offset of the field named name() of the class declClass, as it would be computed by sun.misc.Unsafe#objectFieldOffset.

public static final RecomputeFieldValue.Kind
FromAlias

The field is set to the value assigned to the Alias field.

public static final RecomputeFieldValue.Kind
Manual

Marker value that the field is intercepted by some manual logic.

public static final RecomputeFieldValue.Kind
NewInstance

The object field is set to a instance of declClass created by calling the default constructor.

public static final RecomputeFieldValue.Kind
NewInstanceWhenNotNull

The object field is set to a instance of declClass created by calling the default constructor when the target field value is not null.

public static final RecomputeFieldValue.Kind
None

The initial field value is not modified.

public static final RecomputeFieldValue.Kind
Reset

The field is reset to the default value (null, 0, false).

public static final RecomputeFieldValue.Kind
StaticFieldBase

The static field base Object as it would be computed by sun.misc.Unsafe#staticFieldBase(Field).

public static final RecomputeFieldValue.Kind
TranslateFieldOffset

The field offset stored in this int or long field is updated.

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

Modifier and TypeMethod and Description
public static RecomputeFieldValue.Kind
public static RecomputeFieldValue.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ArrayBaseOffsetback to summary
public static final RecomputeFieldValue.Kind ArrayBaseOffset

The int or long field is set to the offset of the first array element of the array class declClass, as it would be computed by sun.misc.Unsafe#arrayBaseOffset(Class).

Since
22.3
ArrayIndexScaleback to summary
public static final RecomputeFieldValue.Kind ArrayIndexScale

The int or long field is set to the element size array class declClass, as it would be computed by sun.misc.Unsafe#arrayIndexScale(Class).

Since
22.3
ArrayIndexShiftback to summary
public static final RecomputeFieldValue.Kind ArrayIndexShift

The int or long field is set to the log2 of ArrayIndexScale.

Since
22.3
AtomicFieldUpdaterOffsetback to summary
public static final RecomputeFieldValue.Kind AtomicFieldUpdaterOffset

Special support for field offsets used by java.util.concurrent.atomic.AtomicXxxFieldUpdater.

Since
22.3
Customback to summary
public static final RecomputeFieldValue.Kind Custom

Use a FieldValueTransformer, which is specified as the target class.

Since
22.3
FieldOffsetback to summary
public static final RecomputeFieldValue.Kind FieldOffset

The int or long field is set to the offset of the field named name() of the class declClass, as it would be computed by sun.misc.Unsafe#objectFieldOffset.

Since
22.3
FromAliasback to summary
public static final RecomputeFieldValue.Kind FromAlias

The field is set to the value assigned to the Alias field.

Since
22.3
Manualback to summary
public static final RecomputeFieldValue.Kind Manual

Marker value that the field is intercepted by some manual logic.

Since
22.3
NewInstanceback to summary
public static final RecomputeFieldValue.Kind NewInstance

The object field is set to a instance of declClass created by calling the default constructor.

Since
22.3
NewInstanceWhenNotNullback to summary
public static final RecomputeFieldValue.Kind NewInstanceWhenNotNull

The object field is set to a instance of declClass created by calling the default constructor when the target field value is not null.

Since
22.3
Noneback to summary
public static final RecomputeFieldValue.Kind None

The initial field value is not modified. This is the default behavior when no RecomputeFieldValue annotation is present.

Since
22.3
Resetback to summary
public static final RecomputeFieldValue.Kind Reset

The field is reset to the default value (null, 0, false).

Since
22.3
StaticFieldBaseback to summary
public static final RecomputeFieldValue.Kind StaticFieldBase

The static field base Object as it would be computed by sun.misc.Unsafe#staticFieldBase(Field).

Since
23.0
TranslateFieldOffsetback to summary
public static final RecomputeFieldValue.Kind TranslateFieldOffset

The field offset stored in this int or long field is updated. The original value must be a valid field offset in the hosted universe, and the new value is the field offset of the same field in the substrate universe. The field is looked up in the class declClass.

Since
22.3

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static RecomputeFieldValue.Kind valueOf(String name)
valuesback to summary
public static RecomputeFieldValue.Kind[] values()