Skip to content

Commit

Permalink
8310042: [Lilliput/JDK17] ZGC fixes and cleanups
Browse files Browse the repository at this point in the history
Reviewed-by: shade
  • Loading branch information
rkennke committed Jun 14, 2023
1 parent b3f0409 commit 9d6bbff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void ZBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* a
assert(src_offset == dest_offset, "should be equal");
jlong offset = src_offset->get_long();
if (offset != arrayOopDesc::base_offset_in_bytes(T_OBJECT)) {
assert(!UseCompressedClassPointers, "should only happen without compressed class pointers");
assert(!UseCompressedClassPointers || UseCompactObjectHeaders, "should only happen without compressed class pointers or with compact object headers");
assert((arrayOopDesc::base_offset_in_bytes(T_OBJECT) - offset) == BytesPerLong, "unexpected offset");
length = phase->transform_later(new SubLNode(length, phase->longcon(1))); // Size is in longs
src_offset = phase->longcon(arrayOopDesc::base_offset_in_bytes(T_OBJECT));
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/gc/z/zLiveMap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ inline void ZLiveMap::iterate_segment(ObjectClosure* cl, BitMap::idx_t segment,
// Calculate object address
const uintptr_t addr = page_start + ((index / 2) << page_object_alignment_shift);

// Get the size of the object before calling the closure, which
// might overwrite the object in case we are relocating in-place.
const size_t size = ZUtils::object_size(addr);

// Apply closure
cl->do_object(ZOop::from_address(addr));

// Find next bit after this object
const uintptr_t next_addr = align_up(addr + 1, 1 << page_object_alignment_shift);
const uintptr_t next_addr = align_up(addr + size, 1 << page_object_alignment_shift);
const BitMap::idx_t next_index = ((next_addr - page_start) >> page_object_alignment_shift) * 2;
if (next_index >= end_index) {
// End of live map
Expand Down

0 comments on commit 9d6bbff

Please sign in to comment.