--- old/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-06-23 12:27:44.805298354 +0200 +++ new/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-06-23 12:27:44.517292139 +0200 @@ -50,7 +50,8 @@ #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/oopStorage.inline.hpp" -#include "gc/shared/oopStorageSet.hpp" +#include "gc/shared/oopStorageSet.inline.hpp" +#include "gc/shared/oopStorageSetParState.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/referenceProcessorPhaseTimes.hpp" @@ -2015,10 +2016,6 @@ Universe::oops_do(&mark_and_push_closure); break; - case ParallelRootType::jni_handles: - JNIHandles::oops_do(&mark_and_push_closure); - break; - case ParallelRootType::object_synchronizer: ObjectSynchronizer::oops_do(&mark_and_push_closure); break; @@ -2031,10 +2028,6 @@ JvmtiExport::oops_do(&mark_and_push_closure); break; - case ParallelRootType::vm_global: - OopStorageSet::vm_global()->oops_do(&mark_and_push_closure); - break; - case ParallelRootType::class_loader_data: { CLDToOopClosure cld_closure(&mark_and_push_closure, ClassLoaderData::_claim_strong); @@ -2081,6 +2074,7 @@ class MarkFromRootsTask : public AbstractGangTask { typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask; StrongRootsScope _strong_roots_scope; // needed for Threads::possibly_parallel_threads_do + OopStorageSetStrongParState _oop_storage_set_par_state; SequentialSubTasksDone _subtasks; TaskTerminator _terminator; uint _active_workers; @@ -2105,6 +2099,15 @@ PCAddThreadRootsMarkingTaskClosure closure(worker_id); Threads::possibly_parallel_threads_do(true /*parallel */, &closure); + // Mark from OopStorages + { + ParCompactionManager* cm = ParCompactionManager::gc_thread_compaction_manager(worker_id); + PCMarkAndPushClosure closure(cm); + _oop_storage_set_par_state.oops_do(&closure); + // Do the real work + cm->follow_marking_stacks(); + } + if (_active_workers > 1) { steal_marking_work(_terminator, worker_id); } @@ -2235,12 +2238,11 @@ // General strong roots. Universe::oops_do(&oop_closure); - JNIHandles::oops_do(&oop_closure); // Global (strong) JNI handles Threads::oops_do(&oop_closure, NULL); ObjectSynchronizer::oops_do(&oop_closure); Management::oops_do(&oop_closure); JvmtiExport::oops_do(&oop_closure); - OopStorageSet::vm_global()->oops_do(&oop_closure); + OopStorageSet::strong_oops_do(&oop_closure); CLDToOopClosure cld_closure(&oop_closure, ClassLoaderData::_claim_strong); ClassLoaderDataGraph::cld_do(&cld_closure);