--- a/src/hotspot/share/gc/z/zHeap.inline.hpp Tue Sep 24 17:08:18 2019 +0200
+++ b/src/hotspot/share/gc/z/zHeap.inline.hpp Tue Sep 24 17:08:18 2019 +0200
@@ -44,8 +44,8 @@
return &_reference_processor;
}
-inline uint32_t ZHeap::hash_oop(oop obj) const {
- const uintptr_t offset = ZAddress::offset(ZOop::to_address(obj));
+inline uint32_t ZHeap::hash_oop(uintptr_t addr) const {
+ const uintptr_t offset = ZAddress::offset(addr);
return ZHash::address_to_uint32(offset);
}
@@ -133,12 +133,8 @@
_page_allocator.check_out_of_memory();
}
-inline bool ZHeap::is_oop(oop object) const {
- // Verify that we have a good address. Note that ZAddress::is_good()
- // would not be a strong enough verification, since it only verifies
- // that the metadata bits are good.
- const uintptr_t addr = ZOop::to_address(object);
- return ZAddress::good(addr) == addr;
+inline bool ZHeap::is_oop(uintptr_t addr) const {
+ return ZAddress::is_good(addr) && is_object_aligned(addr) && is_in(addr);
}
#endif // SHARE_GC_Z_ZHEAP_INLINE_HPP