/* * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
inlinebool 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;
}
inlinebool ZAddress::is_weak_bad(uintptr_t value) { return value & ZAddressWeakBadMask;
}
inlinebool ZAddress::is_remapped(uintptr_t value) { return value & ZAddressMetadataRemapped;
}
inlinebool ZAddress::is_in(uintptr_t value) { // Check that exactly one non-offset bit is set if (!is_power_of_2(value & ~ZAddressOffsetMask)) { returnfalse;
}
// 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.