< prev index next >
src/hotspot/share/oops/compressedOops.inline.hpp
Print this page
*** 56,66 ****
return is_null(v) ? (oop)NULL : decode_not_null(v);
}
inline narrowOop CompressedOops::encode_not_null(oop v) {
assert(!is_null(v), "oop value can never be zero");
! DEBUG_ONLY(Universe::heap()->check_oop_location(v);)
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base(), 1));
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
uint64_t result = pd >> shift();
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
assert(decode(result) == v, "reversibility");
--- 56,66 ----
return is_null(v) ? (oop)NULL : decode_not_null(v);
}
inline narrowOop CompressedOops::encode_not_null(oop v) {
assert(!is_null(v), "oop value can never be zero");
! assert(Universe::heap()->is_oop_location(v), "invalid oop location");
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base(), 1));
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
uint64_t result = pd >> shift();
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
assert(decode(result) == v, "reversibility");
< prev index next >