diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp index efb6c0d037b908828fcb7d24ae7e930ed6891f9b..7cf1a9ddc39a1a560facc78e62b8b30e62bffc85 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -3203,8 +3203,12 @@ public: CMTask* task) : _g1h(g1h), _cm(cm), _task(task) { - _ref_processor = g1h->ref_processor(); - assert(_ref_processor != NULL, "should not be NULL"); + assert(_ref_processor == NULL, "should be initialized to NULL"); + + if (G1UseConcMarkReferenceProcessing) { + _ref_processor = g1h->ref_processor(); + assert(_ref_processor != NULL, "should not be NULL"); + } } }; diff --git a/src/share/vm/gc_implementation/g1/g1_globals.hpp b/src/share/vm/gc_implementation/g1/g1_globals.hpp index aafd16e0219e3f9442fdbd346b41b26ce34c0ea8..b42949f22a1b973412721b8716ac5b8f15cd65aa 100644 --- a/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -89,6 +89,11 @@ "The number of discovered reference objects to process before " \ "draining concurrent marking work queues.") \ \ + experimental(bool, G1UseConcMarkReferenceProcessing, false, \ + "If true, enable reference discovery during concurrent " \ + "marking and reference processing at the end of remark " \ + "(unsafe).") \ + \ develop(bool, G1SATBBarrierPrintNullPreVals, false, \ "If true, count frac of ptr writes with null pre-vals.") \ \