inline bool ZAddress::is_good_or_null(uintptr_t value) { // Checking if an address is "not bad" is an optimized version of // checking if it's "good or null", which eliminates an explicit // null check. However, the implicit null check only checks that // the mask bits are zero, not that the entire address is zero. // This means that an address without mask bits would pass through // the barrier as if it was null. This should be harmless as such // addresses should ever be passed through the barrier. constbool result = !is_bad(value);
assert((is_good(value) || is_null(value)) == result, "Bad address"); return result;
}
inline bool ZAddress::is_weak_bad(uintptr_t value) { return value & ZAddressWeakBadMask;
}
inline bool ZAddress::is_remapped(uintptr_t value) { return value & ZAddressMetadataRemapped;
}
inline bool ZAddress::is_in(uintptr_t value) { // Check that exactly one non-offset bit is set
if (!is_power_of_2(value & ~ZAddressOffsetMask)) { return false;
}
// Check that one of the non-finalizable metadata is set return value & (ZAddressMetadataMask & ~ZAddressMetadataFinalizable);
}
inline uintptr_t ZAddress::offset(uintptr_t value) { return value & ZAddressOffsetMask;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.