< prev index next >

src/hotspot/share/oops/compressedOops.inline.hpp

Print this page

        

*** 64,74 **** int shift = Universe::narrow_oop_shift(); 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"); return (narrowOop)result; } inline narrowOop encode(oop v) { return is_null(v) ? (narrowOop)0 : encode_not_null(v); --- 64,74 ---- int shift = Universe::narrow_oop_shift(); 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(oopDesc::unsafe_equals(decode(result), v), "reversibility"); return (narrowOop)result; } inline narrowOop encode(oop v) { return is_null(v) ? (narrowOop)0 : encode_not_null(v);
< prev index next >