Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.hpp
38920 views
/*1* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16*17* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18* or visit www.oracle.com if you need additional information or have any19* questions.20*21*/2223#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP24#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP2526#include "utilities/taskqueue.hpp"27#include "gc_implementation/shenandoah/shenandoahOopClosures.hpp"28#include "gc_implementation/shenandoah/shenandoahTaskqueue.hpp"29#include "gc_implementation/shenandoah/shenandoahPhaseTimings.hpp"3031class ShenandoahStrDedupQueue;3233class ShenandoahConcurrentMark: public CHeapObj<mtGC> {34private:35ShenandoahHeap* _heap;36ShenandoahObjToScanQueueSet* _task_queues;3738public:39void initialize(uint workers);40void cancel();4142// ---------- Marking loop and tasks43//44private:45template <class T>46inline void do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveData* live_data, ShenandoahMarkTask* task);4748template <class T>49inline void do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop array);5051template <class T>52inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow);5354inline void count_liveness(ShenandoahLiveData* live_data, oop obj);5556template <class T, bool CANCELLABLE>57void mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, ShenandoahTaskTerminator *t);5859template <bool CANCELLABLE>60void mark_loop_prework(uint worker_id, ShenandoahTaskTerminator *terminator, ReferenceProcessor *rp, bool strdedup);6162public:63void mark_loop(uint worker_id, ShenandoahTaskTerminator* terminator, ReferenceProcessor *rp,64bool cancellable, bool strdedup) {65if (cancellable) {66mark_loop_prework<true>(worker_id, terminator, rp, strdedup);67} else {68mark_loop_prework<false>(worker_id, terminator, rp, strdedup);69}70}7172template<class T, UpdateRefsMode UPDATE_REFS, StringDedupMode STRING_DEDUP>73static inline void mark_through_ref(T* p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context, ShenandoahStrDedupQueue* dq = NULL);7475void mark_from_roots();76void finish_mark_from_roots(bool full_gc);7778void mark_roots(ShenandoahPhaseTimings::Phase root_phase);79void update_roots(ShenandoahPhaseTimings::Phase root_phase);80void update_thread_roots(ShenandoahPhaseTimings::Phase root_phase);8182// ---------- Weak references83//84private:85void weak_refs_work(bool full_gc);86void weak_refs_work_doit(bool full_gc);8788public:89void weak_roots_work(bool full_gc);90void preclean_weak_refs();9192// ---------- Concurrent code cache93//94private:95ShenandoahSharedFlag _claimed_codecache;9697public:98void concurrent_scan_code_roots(uint worker_id, ReferenceProcessor* rp);99bool claim_codecache();100void clear_claim_codecache();101102// ---------- Helpers103// Used from closures, need to be public104//105public:106ShenandoahObjToScanQueue* get_queue(uint worker_id);107ShenandoahObjToScanQueueSet* task_queues() { return _task_queues; }108109};110111#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_HPP112113114