3375 Atomic::add(strings_processed, &_strings_processed);
3376 Atomic::add(strings_removed, &_strings_removed);
3377 }
3378 if (_process_symbols) {
3379 SymbolTable::possibly_parallel_unlink(&symbols_processed, &symbols_removed);
3380 Atomic::add(symbols_processed, &_symbols_processed);
3381 Atomic::add(symbols_removed, &_symbols_removed);
3382 }
3383 if (_process_string_dedup) {
3384 G1StringDedup::parallel_unlink(&_dedup_closure, worker_id);
3385 }
3386 }
3387
3388 size_t strings_processed() const { return (size_t)_strings_processed; }
3389 size_t strings_removed() const { return (size_t)_strings_removed; }
3390
3391 size_t symbols_processed() const { return (size_t)_symbols_processed; }
3392 size_t symbols_removed() const { return (size_t)_symbols_removed; }
3393 };
3394
3395 class G1CodeCacheUnloadingTask VALUE_OBJ_CLASS_SPEC {
3396 private:
3397 static Monitor* _lock;
3398
3399 BoolObjectClosure* const _is_alive;
3400 const bool _unloading_occurred;
3401 const uint _num_workers;
3402
3403 // Variables used to claim nmethods.
3404 CompiledMethod* _first_nmethod;
3405 CompiledMethod* volatile _claimed_nmethod;
3406
3407 // The list of nmethods that need to be processed by the second pass.
3408 CompiledMethod* volatile _postponed_list;
3409 volatile uint _num_entered_barrier;
3410
3411 public:
3412 G1CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) :
3413 _is_alive(is_alive),
3414 _unloading_occurred(unloading_occurred),
3415 _num_workers(num_workers),
|
3375 Atomic::add(strings_processed, &_strings_processed);
3376 Atomic::add(strings_removed, &_strings_removed);
3377 }
3378 if (_process_symbols) {
3379 SymbolTable::possibly_parallel_unlink(&symbols_processed, &symbols_removed);
3380 Atomic::add(symbols_processed, &_symbols_processed);
3381 Atomic::add(symbols_removed, &_symbols_removed);
3382 }
3383 if (_process_string_dedup) {
3384 G1StringDedup::parallel_unlink(&_dedup_closure, worker_id);
3385 }
3386 }
3387
3388 size_t strings_processed() const { return (size_t)_strings_processed; }
3389 size_t strings_removed() const { return (size_t)_strings_removed; }
3390
3391 size_t symbols_processed() const { return (size_t)_symbols_processed; }
3392 size_t symbols_removed() const { return (size_t)_symbols_removed; }
3393 };
3394
3395 class G1CodeCacheUnloadingTask {
3396 private:
3397 static Monitor* _lock;
3398
3399 BoolObjectClosure* const _is_alive;
3400 const bool _unloading_occurred;
3401 const uint _num_workers;
3402
3403 // Variables used to claim nmethods.
3404 CompiledMethod* _first_nmethod;
3405 CompiledMethod* volatile _claimed_nmethod;
3406
3407 // The list of nmethods that need to be processed by the second pass.
3408 CompiledMethod* volatile _postponed_list;
3409 volatile uint _num_entered_barrier;
3410
3411 public:
3412 G1CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) :
3413 _is_alive(is_alive),
3414 _unloading_occurred(unloading_occurred),
3415 _num_workers(num_workers),
|