src/hotspot/share/gc/shared/parallelCleaning.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File
*** old/src/hotspot/share/gc/shared/parallelCleaning.cpp	Fri Mar 29 17:26:18 2019
--- new/src/hotspot/share/gc/shared/parallelCleaning.cpp	Fri Mar 29 17:26:17 2019

*** 28,37 **** --- 28,40 ---- #include "code/codeCache.hpp" #include "gc/shared/parallelCleaning.hpp" #include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "logging/log.hpp" + #if INCLUDE_JVMCI + #include "jvmci/jvmci.hpp" + #endif StringDedupCleaningTask::StringDedupCleaningTask(BoolObjectClosure* is_alive, OopClosure* keep_alive, bool resize_table) : AbstractGangTask("String Dedup Cleaning"),
*** 156,173 **** --- 159,201 ---- while ((klass = claim_next_klass()) != NULL) { clean_klass(klass); } } + #if INCLUDE_JVMCI + JVMCICleaningTask::JVMCICleaningTask(BoolObjectClosure* is_alive) : + _is_alive(is_alive), + _cleaning_claimed(0) { + } + + bool JVMCICleaningTask::claim_cleaning_task() { + if (_cleaning_claimed) { + return false; + } + + return Atomic::cmpxchg(1, &_cleaning_claimed, 0) == 0; + } + + void JVMCICleaningTask::work(bool unloading_occurred) { + // One worker will clean JVMCI metadata handles. + if (EnableJVMCI && claim_cleaning_task()) { + JVMCI::do_unloading(_is_alive, unloading_occurred); + } + } + #endif // INCLUDE_JVMCI + ParallelCleaningTask::ParallelCleaningTask(BoolObjectClosure* is_alive, uint num_workers, bool unloading_occurred, bool resize_dedup_table) : AbstractGangTask("Parallel Cleaning"), _unloading_occurred(unloading_occurred), _string_dedup_task(is_alive, NULL, resize_dedup_table), _code_cache_task(num_workers, is_alive, unloading_occurred), + #if INCLUDE_JVMCI + _jvmci_cleaning_task(is_alive), + #endif _klass_cleaning_task() { } // The parallel work done by all worker threads. void ParallelCleaningTask::work(uint worker_id) {
*** 180,186 **** --- 208,215 ---- // Clean all klasses that were not unloaded. // The weak metadata in klass doesn't need to be // processed if there was no unloading. if (_unloading_occurred) { _klass_cleaning_task.work(); + JVMCI_ONLY(_jvmci_cleaning_task.work(_unloading_occurred);) } }

src/hotspot/share/gc/shared/parallelCleaning.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File