Mercurial > hg > truffle
comparison src/share/vm/oops/oop.inline.hpp @ 135:b7268662a986
6689523: max heap calculation for compressed oops is off by MaxPermSize
Summary: Need to subtract MaxPermSize from the total heap size when determining whether compressed oops is turned on.
Reviewed-by: jmasa, jcoomes, kvn
author | coleenp |
---|---|
date | Tue, 29 Apr 2008 19:31:29 -0400 |
parents | 435e64505015 |
children | feeb96a45707 37f87013dfd8 |
comparison
equal
deleted
inserted
replaced
134:8a79f7ec8f5d | 135:b7268662a986 |
---|---|
132 // in inner GC loops so these are separated. | 132 // in inner GC loops so these are separated. |
133 | 133 |
134 inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { | 134 inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { |
135 assert(!is_null(v), "oop value can never be zero"); | 135 assert(!is_null(v), "oop value can never be zero"); |
136 address heap_base = Universe::heap_base(); | 136 address heap_base = Universe::heap_base(); |
137 uint64_t result = (uint64_t)(pointer_delta((void*)v, (void*)heap_base, 1) >> LogMinObjAlignmentInBytes); | 137 uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)heap_base, 1)); |
138 assert((result & 0xffffffff00000000ULL) == 0, "narrow oop overflow"); | 138 assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); |
139 uint64_t result = pd >> LogMinObjAlignmentInBytes; | |
140 assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); | |
139 return (narrowOop)result; | 141 return (narrowOop)result; |
140 } | 142 } |
141 | 143 |
142 inline narrowOop oopDesc::encode_heap_oop(oop v) { | 144 inline narrowOop oopDesc::encode_heap_oop(oop v) { |
143 return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); | 145 return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); |