diff --git a/src/hotspot/share/code/dependencyContext.cpp b/src/hotspot/share/code/dependencyContext.cpp index 2161e3b..ba2c45e 100644 --- a/src/hotspot/share/code/dependencyContext.cpp +++ b/src/hotspot/share/code/dependencyContext.cpp @@ -112,6 +112,7 @@ void DependencyContext::add_dependent_nmethod(nmethod* nm) { void DependencyContext::release(nmethodBucket* b) { bool expunge = Atomic::load(&_cleaning_epoch) == 0; if (expunge) { + assert_locked_or_safepoint(CodeCache_lock); delete b; if (UsePerfData) { _perf_total_buckets_deallocated_count->inc(); @@ -204,7 +205,6 @@ void DependencyContext::clean_unloading_dependents() { // // Invalidate all dependencies in the context int DependencyContext::remove_all_dependents() { - assert_locked_or_safepoint(CodeCache_lock); nmethodBucket* b = dependencies_not_unloading(); set_dependencies(NULL); int marked = 0; @@ -309,16 +309,16 @@ nmethodBucket* DependencyContext::dependencies() { // After the gc_prologue, the dependency contexts may be claimed by the GC // and releasing of nmethodBucket entries will be deferred and placed on // a purge list to be deleted later. -void DependencyContext::gc_prologue() { +void DependencyContext::cleaning_start() { assert(SafepointSynchronize::is_at_safepoint(), "must be"); - uint64_t epoch = SafepointSynchronize::_safepoint_counter; + uint64_t epoch = SafepointSynchronize::safepoint_counter(); Atomic::store(epoch, &_cleaning_epoch); } // The epilogue marks the end of dependency context cleanup by the GC, // and also makes subsequent releases of nmethodBuckets case immediate // deletion. It is admitted to end the cleanup in a concurrent phase. -void DependencyContext::gc_epilogue() { +void DependencyContext::cleaning_end() { uint64_t epoch = 0; Atomic::store(epoch, &_cleaning_epoch); }