src/hotspot/share/gc/z/zHeap.inline.hpp
changeset 58293 f2bd6a3993a7
parent 58292 a8f06f2b84b0
child 58679 9c3209ff7550
equal deleted inserted replaced
58292:a8f06f2b84b0 58293:f2bd6a3993a7
    42 
    42 
    43 inline ReferenceDiscoverer* ZHeap::reference_discoverer() {
    43 inline ReferenceDiscoverer* ZHeap::reference_discoverer() {
    44   return &_reference_processor;
    44   return &_reference_processor;
    45 }
    45 }
    46 
    46 
    47 inline uint32_t ZHeap::hash_oop(oop obj) const {
    47 inline uint32_t ZHeap::hash_oop(uintptr_t addr) const {
    48   const uintptr_t offset = ZAddress::offset(ZOop::to_address(obj));
    48   const uintptr_t offset = ZAddress::offset(addr);
    49   return ZHash::address_to_uint32(offset);
    49   return ZHash::address_to_uint32(offset);
    50 }
    50 }
    51 
    51 
    52 inline bool ZHeap::is_object_live(uintptr_t addr) const {
    52 inline bool ZHeap::is_object_live(uintptr_t addr) const {
    53   ZPage* page = _page_table.get(addr);
    53   ZPage* page = _page_table.get(addr);
   131 
   131 
   132 inline void ZHeap::check_out_of_memory() {
   132 inline void ZHeap::check_out_of_memory() {
   133   _page_allocator.check_out_of_memory();
   133   _page_allocator.check_out_of_memory();
   134 }
   134 }
   135 
   135 
   136 inline bool ZHeap::is_oop(oop object) const {
   136 inline bool ZHeap::is_oop(uintptr_t addr) const {
   137   // Verify that we have a good address. Note that ZAddress::is_good()
   137   return ZAddress::is_good(addr) && is_object_aligned(addr) && is_in(addr);
   138   // would not be a strong enough verification, since it only verifies
       
   139   // that the metadata bits are good.
       
   140   const uintptr_t addr = ZOop::to_address(object);
       
   141   return ZAddress::good(addr) == addr;
       
   142 }
   138 }
   143 
   139 
   144 #endif // SHARE_GC_Z_ZHEAP_INLINE_HPP
   140 #endif // SHARE_GC_Z_ZHEAP_INLINE_HPP