Skip to content

Commit

Permalink
8329962: Remove CardTable::invalidate
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, gli
  • Loading branch information
albertnetymk committed Apr 12, 2024
1 parent c7fcd62 commit 006a516
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
10 changes: 1 addition & 9 deletions src/hotspot/share/gc/shared/cardTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void CardTable::resize_covered_region(MemRegion new_region) {
void CardTable::dirty_MemRegion(MemRegion mr) {
assert(align_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
assert(align_up (mr.end(), HeapWordSize) == mr.end(), "Unaligned end" );
assert(_covered[0].contains(mr) || _covered[1].contains(mr), "precondition");
CardValue* cur = byte_for(mr.start());
CardValue* last = byte_after(mr.last());
memset(cur, dirty_card, pointer_delta(last, cur, sizeof(CardValue)));
Expand All @@ -226,15 +227,6 @@ uintx CardTable::ct_max_alignment_constraint() {
return GCCardSizeInBytes * os::vm_page_size();
}

void CardTable::invalidate(MemRegion mr) {
assert(align_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
assert(align_up (mr.end(), HeapWordSize) == mr.end(), "Unaligned end" );
for (int i = 0; i < max_covered_regions; i++) {
MemRegion mri = mr.intersection(_covered[i]);
if (!mri.is_empty()) dirty_MemRegion(mri);
}
}

#ifndef PRODUCT
void CardTable::verify_region(MemRegion mr, CardValue val, bool val_equals) {
CardValue* start = byte_for(mr.start());
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/shared/cardTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ class CardTable: public CHeapObj<mtGC> {
return byte_for(p) + 1;
}

void invalidate(MemRegion mr);

// Provide read-only access to the card table array.
const CardValue* byte_for_const(const void* p) const {
return byte_for(p);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void CardTableBarrierSet::write_ref_array_work(MemRegion mr) {
}

void CardTableBarrierSet::invalidate(MemRegion mr) {
_card_table->invalidate(mr);
_card_table->dirty_MemRegion(mr);
}

void CardTableBarrierSet::print_on(outputStream* st) const {
Expand Down

1 comment on commit 006a516

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.