Search in sources :

Example 1 with ReferenceAccess

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;
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) DynamicHub(com.oracle.svm.core.hub.DynamicHub) ImageHeapObject(com.oracle.svm.core.image.ImageHeapObject) ReferenceAccess(com.oracle.svm.core.heap.ReferenceAccess) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible)

Aggregations

Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)1 ReferenceAccess (com.oracle.svm.core.heap.ReferenceAccess)1 DynamicHub (com.oracle.svm.core.hub.DynamicHub)1 ImageHeapObject (com.oracle.svm.core.image.ImageHeapObject)1 UnsignedWord (org.graalvm.word.UnsignedWord)1