< prev index next >
src/hotspot/share/gc/z/zRelocate.cpp
Print this page
@@ -86,11 +86,11 @@
uintptr_t ZRelocate::relocate_object_inner(ZForwarding* forwarding, uintptr_t from_index, uintptr_t from_offset) const {
ZForwardingCursor cursor;
// Lookup forwarding entry
const ZForwardingEntry entry = forwarding->find(from_index, &cursor);
- if (entry.from_index() == from_index) {
+ if (entry.populated() && entry.from_index() == from_index) {
// Already relocated, return new address
return entry.to_offset();
}
assert(ZHeap::heap()->is_object_live(ZAddress::good(from_offset)), "Should be live");
@@ -148,11 +148,13 @@
uintptr_t ZRelocate::forward_object(ZForwarding* forwarding, uintptr_t from_addr) const {
const uintptr_t from_offset = ZAddress::offset(from_addr);
const uintptr_t from_index = (from_offset - forwarding->start()) >> forwarding->object_alignment_shift();
const ZForwardingEntry entry = forwarding->find(from_index);
+ assert(entry.populated(), "Should be forwarded");
assert(entry.from_index() == from_index, "Should be forwarded");
+
return ZAddress::good(entry.to_offset());
}
class ZRelocateObjectClosure : public ObjectClosure {
private:
< prev index next >