mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8055919: Remove dead code in G1 concurrent marking code
Reviewed-by: jmasa, jwilhelm
This commit is contained in:
parent
40b25893d0
commit
f789d43b8e
3 changed files with 29 additions and 175 deletions
|
@ -434,10 +434,6 @@ void CMMarkStack::oops_do(OopClosure* f) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConcurrentMark::not_yet_marked(oop obj) const {
|
|
||||||
return _g1h->is_obj_ill(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
CMRootRegions::CMRootRegions() :
|
CMRootRegions::CMRootRegions() :
|
||||||
_young_list(NULL), _cm(NULL), _scan_in_progress(false),
|
_young_list(NULL), _cm(NULL), _scan_in_progress(false),
|
||||||
_should_abort(false), _next_survivor(NULL) { }
|
_should_abort(false), _next_survivor(NULL) { }
|
||||||
|
@ -1117,20 +1113,17 @@ public:
|
||||||
if (!_cm->has_aborted()) {
|
if (!_cm->has_aborted()) {
|
||||||
do {
|
do {
|
||||||
double start_vtime_sec = os::elapsedVTime();
|
double start_vtime_sec = os::elapsedVTime();
|
||||||
double start_time_sec = os::elapsedTime();
|
|
||||||
double mark_step_duration_ms = G1ConcMarkStepDurationMillis;
|
double mark_step_duration_ms = G1ConcMarkStepDurationMillis;
|
||||||
|
|
||||||
the_task->do_marking_step(mark_step_duration_ms,
|
the_task->do_marking_step(mark_step_duration_ms,
|
||||||
true /* do_termination */,
|
true /* do_termination */,
|
||||||
false /* is_serial*/);
|
false /* is_serial*/);
|
||||||
|
|
||||||
double end_time_sec = os::elapsedTime();
|
|
||||||
double end_vtime_sec = os::elapsedVTime();
|
double end_vtime_sec = os::elapsedVTime();
|
||||||
double elapsed_vtime_sec = end_vtime_sec - start_vtime_sec;
|
double elapsed_vtime_sec = end_vtime_sec - start_vtime_sec;
|
||||||
double elapsed_time_sec = end_time_sec - start_time_sec;
|
|
||||||
_cm->clear_has_overflown();
|
_cm->clear_has_overflown();
|
||||||
|
|
||||||
bool ret = _cm->do_yield_check(worker_id);
|
_cm->do_yield_check(worker_id);
|
||||||
|
|
||||||
jlong sleep_time_ms;
|
jlong sleep_time_ms;
|
||||||
if (!_cm->has_aborted() && the_task->has_aborted()) {
|
if (!_cm->has_aborted() && the_task->has_aborted()) {
|
||||||
|
@ -1140,17 +1133,6 @@ public:
|
||||||
os::sleep(Thread::current(), sleep_time_ms, false);
|
os::sleep(Thread::current(), sleep_time_ms, false);
|
||||||
SuspendibleThreadSet::join();
|
SuspendibleThreadSet::join();
|
||||||
}
|
}
|
||||||
double end_time2_sec = os::elapsedTime();
|
|
||||||
double elapsed_time2_sec = end_time2_sec - start_time_sec;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
gclog_or_tty->print_cr("CM: elapsed %1.4lf ms, sleep %1.4lf ms, "
|
|
||||||
"overhead %1.4lf",
|
|
||||||
elapsed_vtime_sec * 1000.0, (double) sleep_time_ms,
|
|
||||||
the_task->conc_overhead(os::elapsedTime()) * 8.0);
|
|
||||||
gclog_or_tty->print_cr("elapsed time %1.4lf ms, time 2: %1.4lf ms",
|
|
||||||
elapsed_time_sec * 1000.0, elapsed_time2_sec * 1000.0);
|
|
||||||
#endif
|
|
||||||
} while (!_cm->has_aborted() && the_task->has_aborted());
|
} while (!_cm->has_aborted() && the_task->has_aborted());
|
||||||
}
|
}
|
||||||
the_task->record_end_time();
|
the_task->record_end_time();
|
||||||
|
@ -2949,11 +2931,6 @@ void ConcurrentMark::clearRangeNextBitmap(MemRegion mr) {
|
||||||
_nextMarkBitMap->clearRange(mr);
|
_nextMarkBitMap->clearRange(mr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConcurrentMark::clearRangeBothBitmaps(MemRegion mr) {
|
|
||||||
clearRangePrevBitmap(mr);
|
|
||||||
clearRangeNextBitmap(mr);
|
|
||||||
}
|
|
||||||
|
|
||||||
HeapRegion*
|
HeapRegion*
|
||||||
ConcurrentMark::claim_region(uint worker_id) {
|
ConcurrentMark::claim_region(uint worker_id) {
|
||||||
// "checkpoint" the finger
|
// "checkpoint" the finger
|
||||||
|
@ -3499,17 +3476,6 @@ bool ConcurrentMark::do_yield_check(uint worker_id) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConcurrentMark::containing_card_is_marked(void* p) {
|
|
||||||
size_t offset = pointer_delta(p, _g1h->reserved_region().start(), 1);
|
|
||||||
return _card_bm.at(offset >> CardTableModRefBS::card_shift);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ConcurrentMark::containing_cards_are_marked(void* start,
|
|
||||||
void* last) {
|
|
||||||
return containing_card_is_marked(start) &&
|
|
||||||
containing_card_is_marked(last);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
// for debugging purposes
|
// for debugging purposes
|
||||||
void ConcurrentMark::print_finger() {
|
void ConcurrentMark::print_finger() {
|
||||||
|
@ -3762,7 +3728,7 @@ void CMTask::regular_clock_call() {
|
||||||
|
|
||||||
if (_cm->verbose_medium()) {
|
if (_cm->verbose_medium()) {
|
||||||
gclog_or_tty->print_cr("[%u] regular clock, interval = %1.2lfms, "
|
gclog_or_tty->print_cr("[%u] regular clock, interval = %1.2lfms, "
|
||||||
"scanned = %d%s, refs reached = %d%s",
|
"scanned = "SIZE_FORMAT"%s, refs reached = "SIZE_FORMAT"%s",
|
||||||
_worker_id, last_interval_ms,
|
_worker_id, last_interval_ms,
|
||||||
_words_scanned,
|
_words_scanned,
|
||||||
(_words_scanned >= _words_scanned_limit) ? " (*)" : "",
|
(_words_scanned >= _words_scanned_limit) ? " (*)" : "",
|
||||||
|
|
|
@ -683,7 +683,9 @@ public:
|
||||||
return _task_queues->steal(worker_id, hash_seed, obj);
|
return _task_queues->steal(worker_id, hash_seed, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage);
|
ConcurrentMark(G1CollectedHeap* g1h,
|
||||||
|
G1RegionToSpaceMapper* prev_bitmap_storage,
|
||||||
|
G1RegionToSpaceMapper* next_bitmap_storage);
|
||||||
~ConcurrentMark();
|
~ConcurrentMark();
|
||||||
|
|
||||||
ConcurrentMarkThread* cmThread() { return _cmThread; }
|
ConcurrentMarkThread* cmThread() { return _cmThread; }
|
||||||
|
@ -712,8 +714,10 @@ public:
|
||||||
// inconsistent) and always passing the size. hr is the region that
|
// inconsistent) and always passing the size. hr is the region that
|
||||||
// contains the object and it's passed optionally from callers who
|
// contains the object and it's passed optionally from callers who
|
||||||
// might already have it (no point in recalculating it).
|
// might already have it (no point in recalculating it).
|
||||||
inline void grayRoot(oop obj, size_t word_size,
|
inline void grayRoot(oop obj,
|
||||||
uint worker_id, HeapRegion* hr = NULL);
|
size_t word_size,
|
||||||
|
uint worker_id,
|
||||||
|
HeapRegion* hr = NULL);
|
||||||
|
|
||||||
// It iterates over the heap and for each object it comes across it
|
// It iterates over the heap and for each object it comes across it
|
||||||
// will dump the contents of its reference fields, as well as
|
// will dump the contents of its reference fields, as well as
|
||||||
|
@ -734,7 +738,8 @@ public:
|
||||||
// AND MARKED : indicates that an object is both explicitly and
|
// AND MARKED : indicates that an object is both explicitly and
|
||||||
// implicitly live (it should be one or the other, not both)
|
// implicitly live (it should be one or the other, not both)
|
||||||
void print_reachable(const char* str,
|
void print_reachable(const char* str,
|
||||||
VerifyOption vo, bool all) PRODUCT_RETURN;
|
VerifyOption vo,
|
||||||
|
bool all) PRODUCT_RETURN;
|
||||||
|
|
||||||
// Clear the next marking bitmap (will be called concurrently).
|
// Clear the next marking bitmap (will be called concurrently).
|
||||||
void clearNextBitmap();
|
void clearNextBitmap();
|
||||||
|
@ -771,12 +776,11 @@ public:
|
||||||
// this carefully!
|
// this carefully!
|
||||||
inline void markPrev(oop p);
|
inline void markPrev(oop p);
|
||||||
|
|
||||||
// Clears marks for all objects in the given range, for the prev,
|
// Clears marks for all objects in the given range, for the prev or
|
||||||
// next, or both bitmaps. NB: the previous bitmap is usually
|
// next bitmaps. NB: the previous bitmap is usually
|
||||||
// read-only, so use this carefully!
|
// read-only, so use this carefully!
|
||||||
void clearRangePrevBitmap(MemRegion mr);
|
void clearRangePrevBitmap(MemRegion mr);
|
||||||
void clearRangeNextBitmap(MemRegion mr);
|
void clearRangeNextBitmap(MemRegion mr);
|
||||||
void clearRangeBothBitmaps(MemRegion mr);
|
|
||||||
|
|
||||||
// Notify data structures that a GC has started.
|
// Notify data structures that a GC has started.
|
||||||
void note_start_of_gc() {
|
void note_start_of_gc() {
|
||||||
|
@ -798,21 +802,6 @@ public:
|
||||||
bool verify_thread_buffers,
|
bool verify_thread_buffers,
|
||||||
bool verify_fingers) PRODUCT_RETURN;
|
bool verify_fingers) PRODUCT_RETURN;
|
||||||
|
|
||||||
bool isMarked(oop p) const {
|
|
||||||
assert(p != NULL && p->is_oop(), "expected an oop");
|
|
||||||
HeapWord* addr = (HeapWord*)p;
|
|
||||||
assert(addr >= _nextMarkBitMap->startWord() ||
|
|
||||||
addr < _nextMarkBitMap->endWord(), "in a region");
|
|
||||||
|
|
||||||
return _nextMarkBitMap->isMarked(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool not_yet_marked(oop p) const;
|
|
||||||
|
|
||||||
// XXX Debug code
|
|
||||||
bool containing_card_is_marked(void* p);
|
|
||||||
bool containing_cards_are_marked(void* start, void* last);
|
|
||||||
|
|
||||||
bool isPrevMarked(oop p) const {
|
bool isPrevMarked(oop p) const {
|
||||||
assert(p != NULL && p->is_oop(), "expected an oop");
|
assert(p != NULL && p->is_oop(), "expected an oop");
|
||||||
HeapWord* addr = (HeapWord*)p;
|
HeapWord* addr = (HeapWord*)p;
|
||||||
|
@ -898,7 +887,8 @@ public:
|
||||||
// marked_bytes array slot for the given HeapRegion.
|
// marked_bytes array slot for the given HeapRegion.
|
||||||
// Sets the bits in the given card bitmap that are associated with the
|
// Sets the bits in the given card bitmap that are associated with the
|
||||||
// cards that are spanned by the memory region.
|
// cards that are spanned by the memory region.
|
||||||
inline void count_region(MemRegion mr, HeapRegion* hr,
|
inline void count_region(MemRegion mr,
|
||||||
|
HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm);
|
BitMap* task_card_bm);
|
||||||
|
|
||||||
|
@ -906,56 +896,27 @@ public:
|
||||||
// data structures for the given worker id.
|
// data structures for the given worker id.
|
||||||
inline void count_region(MemRegion mr, HeapRegion* hr, uint worker_id);
|
inline void count_region(MemRegion mr, HeapRegion* hr, uint worker_id);
|
||||||
|
|
||||||
// Counts the given memory region in the task/worker counting
|
|
||||||
// data structures for the given worker id.
|
|
||||||
inline void count_region(MemRegion mr, uint worker_id);
|
|
||||||
|
|
||||||
// Counts the given object in the given task/worker counting
|
// Counts the given object in the given task/worker counting
|
||||||
// data structures.
|
// data structures.
|
||||||
inline void count_object(oop obj, HeapRegion* hr,
|
inline void count_object(oop obj,
|
||||||
|
HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm);
|
BitMap* task_card_bm);
|
||||||
|
|
||||||
// Counts the given object in the task/worker counting data
|
|
||||||
// structures for the given worker id.
|
|
||||||
inline void count_object(oop obj, HeapRegion* hr, uint worker_id);
|
|
||||||
|
|
||||||
// Attempts to mark the given object and, if successful, counts
|
// Attempts to mark the given object and, if successful, counts
|
||||||
// the object in the given task/worker counting structures.
|
// the object in the given task/worker counting structures.
|
||||||
inline bool par_mark_and_count(oop obj, HeapRegion* hr,
|
inline bool par_mark_and_count(oop obj,
|
||||||
|
HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm);
|
BitMap* task_card_bm);
|
||||||
|
|
||||||
// Attempts to mark the given object and, if successful, counts
|
// Attempts to mark the given object and, if successful, counts
|
||||||
// the object in the task/worker counting structures for the
|
// the object in the task/worker counting structures for the
|
||||||
// given worker id.
|
// given worker id.
|
||||||
inline bool par_mark_and_count(oop obj, size_t word_size,
|
inline bool par_mark_and_count(oop obj,
|
||||||
HeapRegion* hr, uint worker_id);
|
size_t word_size,
|
||||||
|
HeapRegion* hr,
|
||||||
// Attempts to mark the given object and, if successful, counts
|
uint worker_id);
|
||||||
// the object in the task/worker counting structures for the
|
|
||||||
// given worker id.
|
|
||||||
inline bool par_mark_and_count(oop obj, HeapRegion* hr, uint worker_id);
|
|
||||||
|
|
||||||
// Similar to the above routine but we don't know the heap region that
|
|
||||||
// contains the object to be marked/counted, which this routine looks up.
|
|
||||||
inline bool par_mark_and_count(oop obj, uint worker_id);
|
|
||||||
|
|
||||||
// Similar to the above routine but there are times when we cannot
|
|
||||||
// safely calculate the size of obj due to races and we, therefore,
|
|
||||||
// pass the size in as a parameter. It is the caller's responsibility
|
|
||||||
// to ensure that the size passed in for obj is valid.
|
|
||||||
inline bool par_mark_and_count(oop obj, size_t word_size, uint worker_id);
|
|
||||||
|
|
||||||
// Unconditionally mark the given object, and unconditionally count
|
|
||||||
// the object in the counting structures for worker id 0.
|
|
||||||
// Should *not* be called from parallel code.
|
|
||||||
inline bool mark_and_count(oop obj, HeapRegion* hr);
|
|
||||||
|
|
||||||
// Similar to the above routine but we don't know the heap region that
|
|
||||||
// contains the object to be marked/counted, which this routine looks up.
|
|
||||||
// Should *not* be called from parallel code.
|
|
||||||
inline bool mark_and_count(oop obj);
|
|
||||||
|
|
||||||
// Returns true if initialization was successfully completed.
|
// Returns true if initialization was successfully completed.
|
||||||
bool completed_initialization() const {
|
bool completed_initialization() const {
|
||||||
|
@ -1227,9 +1188,12 @@ public:
|
||||||
_finger = new_finger;
|
_finger = new_finger;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMTask(uint worker_id, ConcurrentMark *cm,
|
CMTask(uint worker_id,
|
||||||
size_t* marked_bytes, BitMap* card_bm,
|
ConcurrentMark *cm,
|
||||||
CMTaskQueue* task_queue, CMTaskQueueSet* task_queues);
|
size_t* marked_bytes,
|
||||||
|
BitMap* card_bm,
|
||||||
|
CMTaskQueue* task_queue,
|
||||||
|
CMTaskQueueSet* task_queues);
|
||||||
|
|
||||||
// it prints statistics associated with this task
|
// it prints statistics associated with this task
|
||||||
void print_stats();
|
void print_stats();
|
||||||
|
|
|
@ -125,14 +125,6 @@ inline void ConcurrentMark::count_region(MemRegion mr,
|
||||||
count_region(mr, hr, marked_bytes_array, task_card_bm);
|
count_region(mr, hr, marked_bytes_array, task_card_bm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counts the given memory region, which may be a single object, in the
|
|
||||||
// task/worker counting data structures for the given worker id.
|
|
||||||
inline void ConcurrentMark::count_region(MemRegion mr, uint worker_id) {
|
|
||||||
HeapWord* addr = mr.start();
|
|
||||||
HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
|
|
||||||
count_region(mr, hr, worker_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Counts the given object in the given task/worker counting data structures.
|
// Counts the given object in the given task/worker counting data structures.
|
||||||
inline void ConcurrentMark::count_object(oop obj,
|
inline void ConcurrentMark::count_object(oop obj,
|
||||||
HeapRegion* hr,
|
HeapRegion* hr,
|
||||||
|
@ -142,17 +134,6 @@ inline void ConcurrentMark::count_object(oop obj,
|
||||||
count_region(mr, hr, marked_bytes_array, task_card_bm);
|
count_region(mr, hr, marked_bytes_array, task_card_bm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counts the given object in the task/worker counting data
|
|
||||||
// structures for the given worker id.
|
|
||||||
inline void ConcurrentMark::count_object(oop obj,
|
|
||||||
HeapRegion* hr,
|
|
||||||
uint worker_id) {
|
|
||||||
size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
|
|
||||||
BitMap* task_card_bm = count_card_bitmap_for(worker_id);
|
|
||||||
HeapWord* addr = (HeapWord*) obj;
|
|
||||||
count_object(obj, hr, marked_bytes_array, task_card_bm);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempts to mark the given object and, if successful, counts
|
// Attempts to mark the given object and, if successful, counts
|
||||||
// the object in the given task/worker counting structures.
|
// the object in the given task/worker counting structures.
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
||||||
|
@ -184,63 +165,6 @@ inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempts to mark the given object and, if successful, counts
|
|
||||||
// the object in the task/worker counting structures for the
|
|
||||||
// given worker id.
|
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
|
||||||
HeapRegion* hr,
|
|
||||||
uint worker_id) {
|
|
||||||
HeapWord* addr = (HeapWord*)obj;
|
|
||||||
if (_nextMarkBitMap->parMark(addr)) {
|
|
||||||
// Update the task specific count data for the object.
|
|
||||||
count_object(obj, hr, worker_id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// As above - but we don't know the heap region containing the
|
|
||||||
// object and so have to supply it.
|
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj, uint worker_id) {
|
|
||||||
HeapWord* addr = (HeapWord*)obj;
|
|
||||||
HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
|
|
||||||
return par_mark_and_count(obj, hr, worker_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Similar to the above routine but we already know the size, in words, of
|
|
||||||
// the object that we wish to mark/count
|
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
|
||||||
size_t word_size,
|
|
||||||
uint worker_id) {
|
|
||||||
HeapWord* addr = (HeapWord*)obj;
|
|
||||||
if (_nextMarkBitMap->parMark(addr)) {
|
|
||||||
// Update the task specific count data for the object.
|
|
||||||
MemRegion mr(addr, word_size);
|
|
||||||
count_region(mr, worker_id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unconditionally mark the given object, and unconditionally count
|
|
||||||
// the object in the counting structures for worker id 0.
|
|
||||||
// Should *not* be called from parallel code.
|
|
||||||
inline bool ConcurrentMark::mark_and_count(oop obj, HeapRegion* hr) {
|
|
||||||
HeapWord* addr = (HeapWord*)obj;
|
|
||||||
_nextMarkBitMap->mark(addr);
|
|
||||||
// Update the task specific count data for the object.
|
|
||||||
count_object(obj, hr, 0 /* worker_id */);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// As above - but we don't have the heap region containing the
|
|
||||||
// object, so we have to supply it.
|
|
||||||
inline bool ConcurrentMark::mark_and_count(oop obj) {
|
|
||||||
HeapWord* addr = (HeapWord*)obj;
|
|
||||||
HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
|
|
||||||
return mark_and_count(obj, hr);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
||||||
HeapWord* start_addr = MAX2(startWord(), mr.start());
|
HeapWord* start_addr = MAX2(startWord(), mr.start());
|
||||||
HeapWord* end_addr = MIN2(endWord(), mr.end());
|
HeapWord* end_addr = MIN2(endWord(), mr.end());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue