use of com.oracle.svm.core.heap.ReferenceAccess in project graal by oracle.
the class ObjectHeaderImpl method dynamicHubFromObjectHeader.
@Override
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public DynamicHub dynamicHubFromObjectHeader(UnsignedWord header) {
UnsignedWord pointerBits = clearBits(header);
Object objectValue;
ReferenceAccess referenceAccess = ReferenceAccess.singleton();
if (referenceAccess.haveCompressedReferences()) {
UnsignedWord compressedBits = pointerBits.unsignedShiftRight(getCompressionShift());
objectValue = referenceAccess.uncompressReference(compressedBits);
} else {
objectValue = ((Pointer) pointerBits).toObject();
}
return (DynamicHub) objectValue;
}
Aggregations