Skip to content

Commit

Permalink
Fix preservedMarks gtest
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kennke committed Dec 12, 2024
1 parent eb5ff17 commit 42ca1c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/shared/fullGCForwarding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ void FullGCForwarding::initialize(MemRegion heap) {
_heap_start_region_bias = (uintptr_t)_heap_start >> BLOCK_SIZE_BYTES_SHIFT;
_region_mask = ~((uintptr_t(1) << BLOCK_SIZE_BYTES_SHIFT) - 1);

guarantee((_heap_start_region_bias << BLOCK_SIZE_BYTES_SHIFT) == (uintptr_t)_heap_start, "must be aligned: _heap_start_region_bias: " SIZE_FORMAT ", _region_size_byte_shift: %u, _heap_start: " PTR_FORMAT, _heap_start_region_bias, BLOCK_SIZE_BYTES_SHIFT, p2i(_heap_start));

assert(_bases_table == nullptr, "should not be initialized yet");
assert(_fallback_table == nullptr, "should not be initialized yet");
#endif
Expand Down
4 changes: 4 additions & 0 deletions test/hotspot/gtest/gc/shared/test_preservedMarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ TEST_VM(PreservedMarks, iterate_and_restore) {
ASSERT_MARK_WORD_EQ(o1->mark(), changedMark());
ASSERT_MARK_WORD_EQ(o2->mark(), changedMark());

FullGCForwarding::begin();

// Push o1 and o2 to have their marks preserved.
pm.push_if_necessary(o1, o1->mark());
pm.push_if_necessary(o2, o2->mark());
Expand All @@ -74,4 +76,6 @@ TEST_VM(PreservedMarks, iterate_and_restore) {
pm.restore();
ASSERT_MARK_WORD_EQ(o3->mark(), changedMark());
ASSERT_MARK_WORD_EQ(o4->mark(), changedMark());

FullGCForwarding::end();
}

0 comments on commit 42ca1c8

Please sign in to comment.