public final class ImageHeapInstance extends ImageHeapConstant
AnalysisField.getPosition(). Each array entry is either
AnalysisFuture of JavaConstant which captures the
original, hosted field value and contains logic to transform and replace this valueJavaConstant, i.e., the snapshot.
The future task is executed when the field is marked as read. Moreover, the future is
self-replacing, i.e., when it is executed it also calls
ImageHeapInstance.setFieldValue(AnalysisField, JavaConstant) and updates the corresponding entry.
compressed, hostedObject, identityHashCode, type| Constructor and Description |
|---|
ImageHeapInstance(ResolvedJavaType type) |
| Modifier and Type | Method and Description |
|---|---|
JavaConstant |
compress() |
boolean |
equals(Object o) |
ImageHeapConstant |
forObjectClone()
Returns a new image heap instance, as if
Object.clone() was called on the original
object. |
Object |
getFieldValue(AnalysisField field)
Return either a task for transforming the field value, effectively a future for
ImageHeapScanner.createFieldValue(AnalysisField, ImageHeapInstance, ValueSupplier, ObjectScanner.ScanReason),
or the result of executing the task, i.e., a JavaConstant. |
int |
hashCode() |
JavaConstant |
readFieldValue(AnalysisField field)
Returns the field value, i.e., a
JavaConstant. |
void |
setFieldTask(AnalysisField field,
AnalysisFuture<JavaConstant> task)
Record the task computing the field value.
|
void |
setFieldValue(AnalysisField field,
JavaConstant value)
Record the field value produced by the task set in
ImageHeapInstance.setFieldTask(AnalysisField, AnalysisFuture), i.e., the snapshot, already transformed
and replaced. |
JavaConstant |
uncompress() |
asBoolean, asBoxedPrimitive, asDouble, asFloat, asInt, asLong, getHostedObject, getIdentityHashCode, getJavaKind, getType, isBackedByHostedObject, isCompressed, isDefaultForKind, isNull, isReachable, markReachable, setType, toValueStringpublic void setFieldTask(AnalysisField field, AnalysisFuture<JavaConstant> task)
public void setFieldValue(AnalysisField field, JavaConstant value)
ImageHeapInstance.setFieldTask(AnalysisField, AnalysisFuture), i.e., the snapshot, already transformed
and replaced.public Object getFieldValue(AnalysisField field)
ImageHeapScanner.createFieldValue(AnalysisField, ImageHeapInstance, ValueSupplier, ObjectScanner.ScanReason),
or the result of executing the task, i.e., a JavaConstant.public JavaConstant readFieldValue(AnalysisField field)
JavaConstant. If the value is not yet materialized
then the future is executed on the current thread.public JavaConstant compress()
public JavaConstant uncompress()
public ImageHeapConstant forObjectClone()
ImageHeapConstantObject.clone() was called on the original
object. If the type is not cloneable, then null is returned.forObjectClone in class ImageHeapConstantpublic boolean equals(Object o)
equals in class ImageHeapConstantpublic int hashCode()
hashCode in class ImageHeapConstant