diff --git a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp index 25002186280..52b0d04a500 100644 --- a/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp +++ b/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp @@ -41,7 +41,7 @@ void G1FullGCMarkTask::work(uint worker_id) { Ticks start = Ticks::now(); ResourceMark rm; G1FullGCMarker* marker = collector()->marker(worker_id); - MarkingNMethodClosure code_closure(marker->mark_closure(), !NMethodToOopClosure::FixRelocations, true /* keepalive nmethods */); + MarkingNMethodClosure code_closure(marker->mark_closure()); if (ClassUnloading) { _root_processor.process_strong_roots(marker->mark_closure(), diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index 8c02e135379..f4383e573af 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -1065,9 +1065,7 @@ public: ParCompactionManager* cm = ParCompactionManager::gc_thread_compaction_manager(_worker_id); - MarkingNMethodClosure mark_and_push_in_blobs(&cm->_mark_and_push_closure, - !NMethodToOopClosure::FixRelocations, - true /* keepalive nmethods */); + MarkingNMethodClosure mark_and_push_in_blobs(&cm->_mark_and_push_closure); thread->oops_do(&cm->_mark_and_push_closure, &mark_and_push_in_blobs); diff --git a/src/hotspot/share/gc/serial/serialFullGC.cpp b/src/hotspot/share/gc/serial/serialFullGC.cpp index fc63b81b7ce..d45454a768f 100644 --- a/src/hotspot/share/gc/serial/serialFullGC.cpp +++ b/src/hotspot/share/gc/serial/serialFullGC.cpp @@ -485,9 +485,7 @@ void SerialFullGC::phase1_mark(bool clear_all_softrefs) { { StrongRootsScope srs(0); - MarkingNMethodClosure mark_code_closure(&follow_root_closure, - !NMethodToOopClosure::FixRelocations, - true); + MarkingNMethodClosure mark_code_closure(&follow_root_closure); // Start tracing from roots, there are 3 kinds of roots in full-gc. // diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp index fa3fa90b2f5..6aebec28163 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp @@ -152,7 +152,7 @@ public: // we risk executing that code cache blob, and crashing. template void ShenandoahSTWRootScanner::roots_do(T* oops, uint worker_id) { - MarkingNMethodClosure nmethods_cl(oops, !NMethodToOopClosure::FixRelocations, true /*FIXME*/); + MarkingNMethodClosure nmethods_cl(oops); CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong); ResourceMark rm; diff --git a/src/hotspot/share/memory/iterator.cpp b/src/hotspot/share/memory/iterator.cpp index 961130c2b3f..09e924164e8 100644 --- a/src/hotspot/share/memory/iterator.cpp +++ b/src/hotspot/share/memory/iterator.cpp @@ -53,16 +53,10 @@ void MarkingNMethodClosure::do_nmethod(nmethod* nm) { // Process the oops in the nmethod nm->oops_do(_cl); - if (_keepalive_nmethods) { - // CodeCache unloading support - nm->mark_as_maybe_on_stack(); + // CodeCache unloading support + nm->mark_as_maybe_on_stack(); - BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); - bs_nm->disarm(nm); - } - - if (_fix_relocations) { - nm->fix_oop_relocations(); - } + BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); + bs_nm->disarm(nm); } } diff --git a/src/hotspot/share/memory/iterator.hpp b/src/hotspot/share/memory/iterator.hpp index 8310c2949e2..25820d6de02 100644 --- a/src/hotspot/share/memory/iterator.hpp +++ b/src/hotspot/share/memory/iterator.hpp @@ -255,13 +255,11 @@ class NMethodToOopClosure : public NMethodClosure { const static bool FixRelocations = true; }; -class MarkingNMethodClosure : public NMethodToOopClosure { - bool _keepalive_nmethods; +class MarkingNMethodClosure : public NMethodClosure { + OopClosure* _cl; public: - MarkingNMethodClosure(OopClosure* cl, bool fix_relocations, bool keepalive_nmethods) : - NMethodToOopClosure(cl, fix_relocations), - _keepalive_nmethods(keepalive_nmethods) {} + MarkingNMethodClosure(OopClosure* cl) : _cl(cl) {} // Called for each nmethod. virtual void do_nmethod(nmethod* nm);