Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp
38921 views
/*1* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP25#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP2627#include "gc_implementation/shared/concurrentGCThread.hpp"2829// Forward Decl.30class CardTableEntryClosure;31class ConcurrentG1Refine;3233// The G1 Concurrent Refinement Thread (could be several in the future).3435class ConcurrentG1RefineThread: public ConcurrentGCThread {36friend class VMStructs;37friend class G1CollectedHeap;3839double _vtime_start; // Initial virtual time.40double _vtime_accum; // Initial virtual time.41uint _worker_id;42uint _worker_id_offset;4344// The refinement threads collection is linked list. A predecessor can activate a successor45// when the number of the rset update buffer crosses a certain threshold. A successor46// would self-deactivate when the number of the buffers falls below the threshold.47bool _active;48ConcurrentG1RefineThread* _next;49Monitor* _monitor;50ConcurrentG1Refine* _cg1r;5152// The closure applied to completed log buffers.53CardTableEntryClosure* _refine_closure;5455int _thread_threshold_step;56// This thread activation threshold57int _threshold;58// This thread deactivation threshold59int _deactivation_threshold;6061void sample_young_list_rs_lengths();62void run_young_rs_sampling();63void wait_for_completed_buffers();6465void set_active(bool x) { _active = x; }66bool is_active();67void activate();68void deactivate();6970public:71virtual void run();72// Constructor73ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread* next,74CardTableEntryClosure* refine_closure,75uint worker_id_offset, uint worker_id);7677void initialize();7879// Printing80void print() const;81void print_on(outputStream* st) const;8283// Total virtual time so far.84double vtime_accum() { return _vtime_accum; }8586ConcurrentG1Refine* cg1r() { return _cg1r; }8788// shutdown89void stop();90};9192#endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTG1REFINETHREAD_HPP939495