Path: blob/master/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.hpp
40957 views
/*1* Copyright (c) 2021, Red Hat, Inc. 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_GC_SHENANDOAH_SHENANDOAHCONCURRENTGC_HPP25#define SHARE_GC_SHENANDOAH_SHENANDOAHCONCURRENTGC_HPP2627#include "gc/shared/gcCause.hpp"28#include "gc/shenandoah/shenandoahConcurrentMark.hpp"29#include "gc/shenandoah/shenandoahGC.hpp"30#include "gc/shenandoah/shenandoahHeap.hpp"3132class VM_ShenandoahInitMark;33class VM_ShenandoahFinalMarkStartEvac;34class VM_ShenandoahInitUpdateRefs;35class VM_ShenandoahFinalUpdateRefs;3637class ShenandoahConcurrentGC : public ShenandoahGC {38friend class VM_ShenandoahInitMark;39friend class VM_ShenandoahFinalMarkStartEvac;40friend class VM_ShenandoahInitUpdateRefs;41friend class VM_ShenandoahFinalUpdateRefs;42friend class VM_ShenandoahFinalRoots;4344private:45ShenandoahConcurrentMark _mark;46ShenandoahDegenPoint _degen_point;4748public:49ShenandoahConcurrentGC();50bool collect(GCCause::Cause cause);51ShenandoahDegenPoint degen_point() const;5253// Cancel ongoing concurrent GC54static void cancel();55private:56// Entry points to STW GC operations, these cause a related safepoint, that then57// call the entry method below58void vmop_entry_init_mark();59void vmop_entry_final_mark();60void vmop_entry_init_updaterefs();61void vmop_entry_final_updaterefs();62void vmop_entry_final_roots();6364// Entry methods to normally STW GC operations. These set up logging, monitoring65// and workers for net VM operation66void entry_init_mark();67void entry_final_mark();68void entry_init_updaterefs();69void entry_final_updaterefs();70void entry_final_roots();7172// Entry methods to normally concurrent GC operations. These set up logging, monitoring73// for concurrent operation.74void entry_reset();75void entry_mark_roots();76void entry_mark();77void entry_thread_roots();78void entry_weak_refs();79void entry_weak_roots();80void entry_class_unloading();81void entry_strong_roots();82void entry_cleanup_early();83void entry_evacuate();84void entry_update_thread_roots();85void entry_updaterefs();86void entry_cleanup_complete();8788// Actual work for the phases89void op_reset();90void op_init_mark();91void op_mark_roots();92void op_mark();93void op_final_mark();94void op_thread_roots();95void op_weak_refs();96void op_weak_roots();97void op_class_unloading();98void op_strong_roots();99void op_cleanup_early();100void op_evacuate();101void op_init_updaterefs();102void op_updaterefs();103void op_update_thread_roots();104void op_final_updaterefs();105void op_final_roots();106void op_cleanup_complete();107108// Messages for GC trace events, they have to be immortal for109// passing around the logging/tracing systems110const char* init_mark_event_message() const;111const char* final_mark_event_message() const;112const char* conc_mark_event_message() const;113114// Check GC cancellation and abort concurrent GC115bool check_cancellation_and_abort(ShenandoahDegenPoint point);116};117118#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCONCURRENTGC_HPP119120121