src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Print this page
rev 5732 : 8027476: Improve performance of Stringtable unlink
8027455: Improve symbol table scan times during gc pauses
Summary: Parallelize string table and symbol table scan during remark and full GC. Some additional statistics output if the experimental flag G1TraceStringSymbolTableScrubbing is set.
rev 5734 : 8027746: Remove do_gen_barrier template parameter in G1ParCopyClosure
Summary: Remove the above mentioned template parameter and related unused code. Also remove some classes that are never used.
@@ -48,12 +48,12 @@
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/gcTraceTime.hpp"
#include "gc_implementation/shared/isGCActiveMark.hpp"
#include "memory/gcLocker.inline.hpp"
-#include "memory/genOopClosures.inline.hpp"
#include "memory/generationSpec.hpp"
+#include "memory/iterator.hpp"
#include "memory/referenceProcessor.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/ticks.hpp"
@@ -3075,15 +3075,11 @@
default: ShouldNotReachHere();
}
return NULL; // keep some compilers happy
}
-// TODO: VerifyRootsClosure extends OopsInGenClosure so that we can
-// pass it as the perm_blk to SharedHeap::process_strong_roots.
-// When process_strong_roots stop calling perm_blk->younger_refs_iterate
-// we can change this closure to extend the simpler OopClosure.
-class VerifyRootsClosure: public OopsInGenClosure {
+class VerifyRootsClosure: public OopClosure {
private:
G1CollectedHeap* _g1h;
VerifyOption _vo;
bool _failures;
public:
@@ -3115,11 +3111,11 @@
void do_oop(oop* p) { do_oop_nv(p); }
void do_oop(narrowOop* p) { do_oop_nv(p); }
};
-class G1VerifyCodeRootOopClosure: public OopsInGenClosure {
+class G1VerifyCodeRootOopClosure: public OopClosure {
G1CollectedHeap* _g1h;
OopClosure* _root_cl;
nmethod* _nm;
VerifyOption _vo;
bool _failures;
@@ -4649,24 +4645,24 @@
_par_scan_state(par_scan_state),
_worker_id(par_scan_state->queue_num()),
_during_initial_mark(_g1->g1_policy()->during_initial_mark_pause()),
_mark_in_progress(_g1->mark_in_progress()) { }
-template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
-void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>::mark_object(oop obj) {
+template <G1Barrier barrier, bool do_mark_object>
+void G1ParCopyClosure<barrier, do_mark_object>::mark_object(oop obj) {
#ifdef ASSERT
HeapRegion* hr = _g1->heap_region_containing(obj);
assert(hr != NULL, "sanity");
assert(!hr->in_collection_set(), "should not mark objects in the CSet");
#endif // ASSERT
// We know that the object is not moving so it's safe to read its size.
_cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
}
-template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
-void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
+template <G1Barrier barrier, bool do_mark_object>
+void G1ParCopyClosure<barrier, do_mark_object>
::mark_forwarded_object(oop from_obj, oop to_obj) {
#ifdef ASSERT
assert(from_obj->is_forwarded(), "from obj should be forwarded");
assert(from_obj->forwardee() == to_obj, "to obj should be the forwardee");
assert(from_obj != to_obj, "should not be self-forwarded");
@@ -4685,12 +4681,12 @@
// well-formed. So we have to read its size from its from-space
// image which we know should not be changing.
_cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);
}
-template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
-oop G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
+template <G1Barrier barrier, bool do_mark_object>
+oop G1ParCopyClosure<barrier, do_mark_object>
::copy_to_survivor_space(oop old) {
size_t word_sz = old->size();
HeapRegion* from_region = _g1->heap_region_containing_raw(old);
// +1 to make the -1 indexes valid...
int young_index = from_region->young_index_in_cset()+1;
@@ -4782,17 +4778,15 @@
if (_g1->heap_region_containing_raw(new_obj)->is_young()) {
_scanned_klass->record_modified_oops();
}
}
-template <bool do_gen_barrier, G1Barrier barrier, bool do_mark_object>
+template <G1Barrier barrier, bool do_mark_object>
template <class T>
-void G1ParCopyClosure<do_gen_barrier, barrier, do_mark_object>
+void G1ParCopyClosure<barrier, do_mark_object>
::do_oop_work(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
- assert(barrier != G1BarrierRS || obj != NULL,
- "Precondition: G1BarrierRS implies obj is non-NULL");
assert(_worker_id == _par_scan_state->queue_num(), "sanity");
// here the null check is implicit in the cset_fast_test() test
if (_g1->in_cset_fast_test(obj)) {
@@ -4808,14 +4802,11 @@
// If the object is self-forwarded we don't need to explicitly
// mark it, the evacuation failure protocol will do so.
mark_forwarded_object(obj, forwardee);
}
- // When scanning the RS, we only care about objs in CS.
- if (barrier == G1BarrierRS) {
- _par_scan_state->update_rs(_from, p, _worker_id);
- } else if (barrier == G1BarrierKlass) {
+ if (barrier == G1BarrierKlass) {
do_klass_barrier(p, forwardee);
}
} else {
// The object is not in collection set. If we're a root scanning
// closure during an initial mark pause (i.e. do_mark_object will
@@ -4826,18 +4817,14 @@
}
if (barrier == G1BarrierEvac && obj != NULL) {
_par_scan_state->update_rs(_from, p, _worker_id);
}
-
- if (do_gen_barrier && obj != NULL) {
- par_do_barrier(p);
- }
}
-template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(oop* p);
-template void G1ParCopyClosure<false, G1BarrierEvac, false>::do_oop_work(narrowOop* p);
+template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(oop* p);
+template void G1ParCopyClosure<G1BarrierEvac, false>::do_oop_work(narrowOop* p);
template <class T> void G1ParScanPartialArrayClosure::do_oop_nv(T* p) {
assert(has_partial_array_mask(p), "invariant");
oop from_obj = clear_partial_array_mask(p);