< prev index next >
src/share/vm/gc/shenandoah/shenandoahMarkCompact.cpp
Print this page
rev 13068 : [mq]: partial.patch
*** 225,234 ****
--- 225,241 ----
policy->record_phase_end(ShenandoahCollectorPolicy::full_gc_heapdumps);
policy->record_phase_end(ShenandoahCollectorPolicy::full_gc);
oopDesc::set_bs(old_bs);
+
+ if (UseShenandoahMatrix) {
+ if (PrintShenandoahMatrix) {
+ outputStream* log = Log(gc)::info_stream();
+ _heap->connection_matrix()->print_on(log);
+ }
+ }
}
#ifdef ASSERT
class VerifyNotForwardedPointersClosure : public MetadataAwareOopClosure {
private:
*** 303,322 ****
cm->mark_roots();
cm->shared_finish_mark_from_roots(/* full_gc = */ true);
_heap->swap_mark_bitmaps();
- if (UseShenandoahMatrix) {
- if (PrintShenandoahMatrix) {
- outputStream* log = Log(gc)::info_stream();
- _heap->connection_matrix()->print_on(log);
- }
- if (VerifyShenandoahMatrix) {
- _heap->verify_matrix();
- }
- }
-
if (VerifyDuringGC) {
HandleMark hm; // handle scope
// Universe::heap()->prepare_for_verify();
_heap->prepare_for_verify();
// Note: we can verify only the heap here. When an object is
--- 310,319 ----
*** 492,502 ****
}
class ShenandoahAdjustPointersClosure : public MetadataAwareOopClosure {
private:
ShenandoahHeap* _heap;
!
public:
ShenandoahAdjustPointersClosure() : _heap(ShenandoahHeap::heap()) {
}
--- 489,499 ----
}
class ShenandoahAdjustPointersClosure : public MetadataAwareOopClosure {
private:
ShenandoahHeap* _heap;
! uint _from_idx;
public:
ShenandoahAdjustPointersClosure() : _heap(ShenandoahHeap::heap()) {
}
*** 507,538 ****
if (! oopDesc::is_null(o)) {
oop obj = oopDesc::decode_heap_oop_not_null(o);
assert(_heap->is_marked_complete(obj), "must be marked");
oop forw = oop(BrooksPointer::get_raw(obj));
oopDesc::encode_store_heap_oop(p, forw);
}
}
public:
void do_oop(oop* p) {
do_oop_work(p);
}
void do_oop(narrowOop* p) {
do_oop_work(p);
}
};
class ShenandoahAdjustPointersObjectClosure : public ObjectClosure {
private:
! ShenandoahAdjustPointersClosure* _cl;
ShenandoahHeap* _heap;
public:
! ShenandoahAdjustPointersObjectClosure(ShenandoahAdjustPointersClosure* cl) :
! _cl(cl), _heap(ShenandoahHeap::heap()) {
}
void do_object(oop p) {
assert(_heap->is_marked_complete(p), "must be marked");
! p->oop_iterate(_cl);
}
};
class ShenandoahAdjustPointersTask : public AbstractGangTask {
private:
--- 504,548 ----
if (! oopDesc::is_null(o)) {
oop obj = oopDesc::decode_heap_oop_not_null(o);
assert(_heap->is_marked_complete(obj), "must be marked");
oop forw = oop(BrooksPointer::get_raw(obj));
oopDesc::encode_store_heap_oop(p, forw);
+ if (UseShenandoahMatrix) {
+ if (_heap->is_in_reserved(p)) {
+ assert(_heap->is_in_reserved(forw), "must be in heap");
+ uint to_idx = _heap->heap_region_index_containing(forw);
+ _heap->connection_matrix()->set_connected(_from_idx, to_idx, true);
+ }
+ }
}
}
public:
void do_oop(oop* p) {
do_oop_work(p);
}
void do_oop(narrowOop* p) {
do_oop_work(p);
}
+ void set_from_idx(uint from_idx) {
+ _from_idx = from_idx;
+ }
};
class ShenandoahAdjustPointersObjectClosure : public ObjectClosure {
private:
! ShenandoahAdjustPointersClosure _cl;
ShenandoahHeap* _heap;
public:
! ShenandoahAdjustPointersObjectClosure() :
! _heap(ShenandoahHeap::heap()) {
}
void do_object(oop p) {
assert(_heap->is_marked_complete(p), "must be marked");
! oop forw = oop(BrooksPointer::get_raw(p));
! uint from_idx = _heap->heap_region_index_containing(forw);
! _cl.set_from_idx(from_idx);
! p->oop_iterate(&_cl);
}
};
class ShenandoahAdjustPointersTask : public AbstractGangTask {
private:
*** 545,556 ****
}
void work(uint worker_id) {
ShenandoahHeap* heap = ShenandoahHeap::heap();
ShenandoahHeapRegion* r = _regions->claim_next();
! ShenandoahAdjustPointersClosure cl;
! ShenandoahAdjustPointersObjectClosure obj_cl(&cl);
while (r != NULL) {
if (! r->is_humongous_continuation()) {
heap->marked_object_iterate(r, &obj_cl);
}
r = _regions->claim_next();
--- 555,565 ----
}
void work(uint worker_id) {
ShenandoahHeap* heap = ShenandoahHeap::heap();
ShenandoahHeapRegion* r = _regions->claim_next();
! ShenandoahAdjustPointersObjectClosure obj_cl;
while (r != NULL) {
if (! r->is_humongous_continuation()) {
heap->marked_object_iterate(r, &obj_cl);
}
r = _regions->claim_next();
*** 583,592 ****
--- 592,605 ----
void ShenandoahMarkCompact::phase3_update_references() {
GCTraceTime(Info, gc, phases) time("Phase 2: Adjust pointers", _gc_timer);
ShenandoahHeap* heap = ShenandoahHeap::heap();
+ if (UseShenandoahMatrix) {
+ heap->connection_matrix()->clear_all();
+ }
+
// Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
WorkGang* workers = heap->workers();
uint nworkers = workers->active_workers();
< prev index next >