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 @@ -68,6 +68,8 @@
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant.Object.Relinking.EnumConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant.Object.Relinking.StringConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PrimitiveArray;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PrimitiveValue;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.SharedLayerSnapshot;
import com.oracle.graal.pointsto.heap.value.ValueSupplier;
import com.oracle.graal.pointsto.infrastructure.ResolvedSignature;
Expand Down Expand Up @@ -952,7 +954,7 @@ protected void injectIdentityHashCode(Object object, Integer identityHashCode) {
/* The hash code can only be injected in the SVM context. */
}

private static Object getArray(PersistedConstant.PrimitiveData.Reader reader) {
protected static Object getArray(PrimitiveArray.Reader reader) {
return switch (reader.which()) {
case Z -> getBooleans(reader.getZ());
case B -> toArray(reader.getB(), r -> IntStream.range(0, r.size()).collect(() -> new byte[r.size()], (a, i) -> a[i] = r.get(i), combineUnsupported()));
Expand Down Expand Up @@ -1019,7 +1021,7 @@ private Object[] getReferencedValues(ImageHeapConstant parentConstant, StructLis
throw AnalysisError.shouldNotReachHere("This constant was not materialized in the base image.");
});
case PRIMITIVE_VALUE -> {
ConstantReference.PrimitiveValue.Reader pv = constantData.getPrimitiveValue();
PrimitiveValue.Reader pv = constantData.getPrimitiveValue();
yield JavaConstant.forPrimitive((char) pv.getTypeChar(), pv.getRawValue());
}
default -> throw GraalError.shouldNotReachHere("Unexpected constant reference: " + constantData.which());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant.Object.Relinking.EnumConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PersistedConstant.Object.Relinking.StringConstant;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PrimitiveArray;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.PrimitiveValue;
import com.oracle.graal.pointsto.heap.SharedLayerSnapshotCapnProtoSchemaHolder.SharedLayerSnapshot;
import com.oracle.graal.pointsto.infrastructure.OriginalFieldProvider;
import com.oracle.graal.pointsto.meta.AnalysisField;
Expand Down Expand Up @@ -699,7 +701,7 @@ protected void persistConstantRelinkingInfo(PersistedConstant.Object.Relinking.B
}
}

private static void persistConstantPrimitiveArray(PersistedConstant.PrimitiveData.Builder builder, JavaKind componentKind, Object array) {
protected static void persistConstantPrimitiveArray(PrimitiveArray.Builder builder, JavaKind componentKind, Object array) {
assert componentKind.toJavaClass().equals(array.getClass().getComponentType());
switch (array) {
case boolean[] a -> persistArray(a, builder::initZ, (b, i) -> b.set(i, a[i]));
Expand Down Expand Up @@ -737,7 +739,7 @@ private void persistConstantObjectData(PersistedConstant.Object.Builder builder,
} else if (object == JavaConstant.NULL_POINTER) {
b.setNullPointer(Void.VOID);
} else if (object instanceof PrimitiveConstant pc) {
ConstantReference.PrimitiveValue.Builder pb = b.initPrimitiveValue();
PrimitiveValue.Builder pb = b.initPrimitiveValue();
pb.setTypeChar(NumUtil.safeToUByte(pc.getJavaKind().getTypeChar()));
pb.setRawValue(pc.getRawValue());
} else {
Expand Down
Loading