use of com.oracle.svm.core.annotate.AlwaysInline in project graal by oracle.
the class InteriorObjRefWalker method walkObjectInline.
@AlwaysInline("Performance critical version")
public static boolean walkObjectInline(final Object obj, final ObjectReferenceVisitor visitor) {
final DynamicHub objHub = ObjectHeader.readDynamicHubFromObject(obj);
final int layoutEncoding = objHub.getLayoutEncoding();
final Pointer objPointer = Word.objectToUntrackedPointer(obj);
// Visit each Object reference in the array part of the Object.
if (LayoutEncoding.isObjectArray(layoutEncoding)) {
int length = KnownIntrinsics.readArrayLength(obj);
for (int index = 0; index < length; index++) {
final UnsignedWord elementOffset = LayoutEncoding.getArrayElementOffset(layoutEncoding, index);
final Pointer elementPointer = objPointer.add(elementOffset);
boolean isCompressed = ReferenceAccess.singleton().haveCompressedReferences();
final boolean visitResult = visitor.visitObjectReferenceInline(elementPointer, isCompressed);
if (!visitResult) {
return false;
}
}
}
// Visit Object reference in the fields of the Object.
byte[] referenceMapEncoding = DynamicHubSupport.getReferenceMapEncoding();
long referenceMapIndex = objHub.getReferenceMapIndex();
return ReferenceMapDecoder.walkOffsetsFromPointer(objPointer, referenceMapEncoding, referenceMapIndex, visitor);
}
Aggregations