mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6791178: Specialize for zero as the compressed oop vm heap base
Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb. Reviewed-by: never, twisti, jcoomes, coleenp
This commit is contained in:
parent
66cecec230
commit
69f9ddee90
45 changed files with 1072 additions and 220 deletions
|
@ -148,10 +148,11 @@ inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; }
|
|||
|
||||
inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) {
|
||||
assert(!is_null(v), "oop value can never be zero");
|
||||
address heap_base = Universe::heap_base();
|
||||
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)heap_base, 1));
|
||||
address base = Universe::narrow_oop_base();
|
||||
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 >> LogMinObjAlignmentInBytes;
|
||||
uint64_t result = pd >> shift;
|
||||
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow");
|
||||
return (narrowOop)result;
|
||||
}
|
||||
|
@ -162,8 +163,9 @@ inline narrowOop oopDesc::encode_heap_oop(oop v) {
|
|||
|
||||
inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) {
|
||||
assert(!is_null(v), "narrow oop value can never be zero");
|
||||
address heap_base = Universe::heap_base();
|
||||
return (oop)(void*)((uintptr_t)heap_base + ((uintptr_t)v << LogMinObjAlignmentInBytes));
|
||||
address base = Universe::narrow_oop_base();
|
||||
int shift = Universe::narrow_oop_shift();
|
||||
return (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
|
||||
}
|
||||
|
||||
inline oop oopDesc::decode_heap_oop(narrowOop v) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue