mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-22 03:17:54 +00:00
8061748: Remove check_ct_logs_at_safepoint()
Remove unused function and related closure class Reviewed-by: jwilhelm, mgerdin
This commit is contained in:
parent
3a3e45ab40
commit
8f8d87ece5
@ -127,41 +127,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class ClearLoggedCardTableEntryClosure: public CardTableEntryClosure {
|
||||
size_t _num_processed;
|
||||
CardTableModRefBS* _ctbs;
|
||||
int _histo[256];
|
||||
|
||||
public:
|
||||
ClearLoggedCardTableEntryClosure() :
|
||||
_num_processed(0), _ctbs(G1CollectedHeap::heap()->g1_barrier_set())
|
||||
{
|
||||
for (int i = 0; i < 256; i++) _histo[i] = 0;
|
||||
}
|
||||
|
||||
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
|
||||
unsigned char* ujb = (unsigned char*)card_ptr;
|
||||
int ind = (int)(*ujb);
|
||||
_histo[ind]++;
|
||||
|
||||
*card_ptr = (jbyte)CardTableModRefBS::clean_card_val();
|
||||
_num_processed++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t num_processed() { return _num_processed; }
|
||||
|
||||
void print_histo() {
|
||||
gclog_or_tty->print_cr("Card table value histogram:");
|
||||
for (int i = 0; i < 256; i++) {
|
||||
if (_histo[i] != 0) {
|
||||
gclog_or_tty->print_cr(" %d: %d", i, _histo[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class RedirtyLoggedCardTableEntryClosure : public CardTableEntryClosure {
|
||||
private:
|
||||
size_t _num_processed;
|
||||
@ -475,48 +440,6 @@ bool G1CollectedHeap::is_scavengable(const void* p) {
|
||||
return !hr->is_humongous();
|
||||
}
|
||||
|
||||
void G1CollectedHeap::check_ct_logs_at_safepoint() {
|
||||
DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
|
||||
CardTableModRefBS* ct_bs = g1_barrier_set();
|
||||
|
||||
// Count the dirty cards at the start.
|
||||
CountNonCleanMemRegionClosure count1(this);
|
||||
ct_bs->mod_card_iterate(&count1);
|
||||
int orig_count = count1.n();
|
||||
|
||||
// First clear the logged cards.
|
||||
ClearLoggedCardTableEntryClosure clear;
|
||||
dcqs.apply_closure_to_all_completed_buffers(&clear);
|
||||
dcqs.iterate_closure_all_threads(&clear, false);
|
||||
clear.print_histo();
|
||||
|
||||
// Now ensure that there's no dirty cards.
|
||||
CountNonCleanMemRegionClosure count2(this);
|
||||
ct_bs->mod_card_iterate(&count2);
|
||||
if (count2.n() != 0) {
|
||||
gclog_or_tty->print_cr("Card table has %d entries; %d originally",
|
||||
count2.n(), orig_count);
|
||||
}
|
||||
guarantee(count2.n() == 0, "Card table should be clean.");
|
||||
|
||||
RedirtyLoggedCardTableEntryClosure redirty;
|
||||
dcqs.apply_closure_to_all_completed_buffers(&redirty);
|
||||
dcqs.iterate_closure_all_threads(&redirty, false);
|
||||
gclog_or_tty->print_cr("Log entries = %d, dirty cards = %d.",
|
||||
clear.num_processed(), orig_count);
|
||||
guarantee(redirty.num_processed() == clear.num_processed(),
|
||||
err_msg("Redirtied "SIZE_FORMAT" cards, bug cleared "SIZE_FORMAT,
|
||||
redirty.num_processed(), clear.num_processed()));
|
||||
|
||||
CountNonCleanMemRegionClosure count3(this);
|
||||
ct_bs->mod_card_iterate(&count3);
|
||||
if (count3.n() != orig_count) {
|
||||
gclog_or_tty->print_cr("Should have restored them all: orig = %d, final = %d.",
|
||||
orig_count, count3.n());
|
||||
guarantee(count3.n() >= orig_count, "Should have restored them all.");
|
||||
}
|
||||
}
|
||||
|
||||
// Private class members.
|
||||
|
||||
G1CollectedHeap* G1CollectedHeap::_g1h;
|
||||
|
||||
@ -797,9 +797,6 @@ protected:
|
||||
// The closure used to refine a single card.
|
||||
RefineCardTableEntryClosure* _refine_cte_cl;
|
||||
|
||||
// A function to check the consistency of dirty card logs.
|
||||
void check_ct_logs_at_safepoint();
|
||||
|
||||
// A DirtyCardQueueSet that is used to hold cards that contain
|
||||
// references into the current collection set. This is used to
|
||||
// update the remembered sets of the regions in the collection
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user