diff --git a/src/hotspot/share/gc/serial/serialHeap.cpp b/src/hotspot/share/gc/serial/serialHeap.cpp index b4cef87626278..933dc12f59e1c 100644 --- a/src/hotspot/share/gc/serial/serialHeap.cpp +++ b/src/hotspot/share/gc/serial/serialHeap.cpp @@ -624,6 +624,7 @@ void SerialHeap::do_collection(bool full, CodeCache::on_gc_marking_cycle_start(); ClassUnloadingContext ctx(1 /* num_nmethod_unlink_workers */, + false /* unregister_nmethods_during_purge */, false /* lock_codeblob_free_separately */); collect_generation(_old_gen, @@ -682,7 +683,11 @@ void SerialHeap::verify_nmethod(nmethod* nm) { } void SerialHeap::prune_scavengable_nmethods() { - ScavengableNMethods::prune_nmethods(); + ScavengableNMethods::prune_nmethods_not_into_young(); +} + +void SerialHeap::prune_unlinked_nmethods() { + ScavengableNMethods::prune_unlinked_nmethods(); } HeapWord* SerialHeap::satisfy_failed_allocation(size_t size, bool is_tlab) { @@ -808,10 +813,6 @@ void SerialHeap::process_roots(ScanningOption so, DEBUG_ONLY(ScavengableNMethods::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable)); } -void SerialHeap::gen_process_weak_roots(OopClosure* root_closure) { - WeakProcessor::oops_do(root_closure); -} - bool SerialHeap::no_allocs_since_save_marks() { return _young_gen->no_allocs_since_save_marks() && _old_gen->no_allocs_since_save_marks(); @@ -1001,15 +1002,6 @@ void SerialHeap::save_marks() { _old_gen->save_marks(); } -#if INCLUDE_SERIALGC -void SerialHeap::prepare_for_compaction() { - // Start by compacting into same gen. - CompactPoint cp(_old_gen); - _old_gen->prepare_for_compaction(&cp); - _young_gen->prepare_for_compaction(&cp); -} -#endif // INCLUDE_SERIALGC - void SerialHeap::verify(VerifyOption option /* ignored */) { log_debug(gc, verify)("%s", _old_gen->name()); _old_gen->verify(); diff --git a/src/hotspot/share/gc/serial/serialHeap.hpp b/src/hotspot/share/gc/serial/serialHeap.hpp index 5cbe283416917..d0ed728dafb28 100644 --- a/src/hotspot/share/gc/serial/serialHeap.hpp +++ b/src/hotspot/share/gc/serial/serialHeap.hpp @@ -200,6 +200,7 @@ class SerialHeap : public CollectedHeap { void verify_nmethod(nmethod* nm) override; void prune_scavengable_nmethods(); + void prune_unlinked_nmethods(); // Iteration functions. void object_iterate(ObjectClosure* cl) override; @@ -305,11 +306,6 @@ class SerialHeap : public CollectedHeap { CLDClosure* weak_cld_closure, CodeBlobToOopClosure* code_roots); - // Apply "root_closure" to all the weak roots of the system. - // These include JNI weak roots, string table, - // and referents of reachable weak refs. - void gen_process_weak_roots(OopClosure* root_closure); - // Set the saved marks of generations, if that makes sense. // In particular, if any generation might iterate over the oops // in other generations, it should call this method. @@ -353,13 +349,6 @@ class SerialHeap : public CollectedHeap { HeapWord* mem_allocate_work(size_t size, bool is_tlab); -#if INCLUDE_SERIALGC - // For use by mark-sweep. As implemented, mark-sweep-compact is global - // in an essential way: compaction is performed across generations, by - // iterating over spaces. - void prepare_for_compaction(); -#endif - // Save the tops of the spaces in all generations void record_gen_tops_before_GC() PRODUCT_RETURN;