// Functions for encoding and decoding compressed oops. // If the oops are compressed, the type passed to these overloaded functions // is narrowOop. All functions are overloaded so they can be called by // template functions without conditionals (the compiler instantiates via // the right type and inlines the appropriate code).
// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit // offset from the heap base. Saving the check for null can save instructions // in inner GC loops so these are separated.
inline oop CompressedOops::decode_raw_not_null(narrowOop v) {
assert(!is_null(v), "narrow oop value can never be zero"); return decode_raw(v);
}
inline oop CompressedOops::decode_not_null(narrowOop v) {
assert(!is_null(v), "narrow oop value can never be zero");
oop result = decode_raw(v);
assert(is_object_aligned(result), "address not aligned: " PTR_FORMAT, p2i(result));
assert(Universe::is_in_heap(result), "object not in heap " PTR_FORMAT, p2i(result)); return result;
}
inline Klass* CompressedKlassPointers::decode_not_null(narrowKlass v, address narrow_base) {
assert(!is_null(v), "narrow klass value can never be zero");
Klass* result = decode_raw(v, narrow_base);
assert(check_alignment(result), "address not aligned: " PTR_FORMAT, p2i(result)); return result;
}
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.