Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.hpp
38920 views
/*1* Copyright (c) 2013, 2018, 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_SHENANDOAHCOLLECTORPOLICY_HPP24#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTORPOLICY_HPP2526#include "memory/collectorPolicy.hpp"27#include "gc_implementation/shared/gcTrace.hpp"28#include "gc_implementation/shenandoah/shenandoahHeap.hpp"29#include "utilities/ostream.hpp"3031class STWGCTimer;32class ConcurrentGCTimer;3334class ShenandoahTracer : public GCTracer {35public:36ShenandoahTracer() : GCTracer(Shenandoah) {}37};3839class ShenandoahCollectorPolicy: public CollectorPolicy {40private:41size_t _success_concurrent_gcs;42size_t _success_degenerated_gcs;43size_t _success_full_gcs;44size_t _alloc_failure_degenerated;45size_t _alloc_failure_degenerated_upgrade_to_full;46size_t _alloc_failure_full;47size_t _explicit_concurrent;48size_t _explicit_full;49size_t _implicit_concurrent;50size_t _implicit_full;51size_t _degen_points[ShenandoahHeap::_DEGENERATED_LIMIT];5253ShenandoahSharedFlag _in_shutdown;5455ShenandoahTracer* _tracer;5657size_t _cycle_counter;5859public:60ShenandoahCollectorPolicy();6162void post_heap_initialize() {};6364BarrierSet::Name barrier_set_name();6566HeapWord* mem_allocate_work(size_t size,67bool is_tlab,68bool* gc_overhead_limit_was_exceeded);6970HeapWord* satisfy_failed_allocation(size_t size, bool is_tlab);7172MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,73size_t size,74Metaspace::MetadataType mdtype);7576void initialize_alignments();7778// TODO: This is different from gc_end: that one encompasses one VM operation.79// These two encompass the entire cycle.80void record_cycle_start();8182void record_success_concurrent();83void record_success_degenerated();84void record_success_full();85void record_alloc_failure_to_degenerated(ShenandoahHeap::ShenandoahDegenPoint point);86void record_alloc_failure_to_full();87void record_degenerated_upgrade_to_full();88void record_explicit_to_concurrent();89void record_explicit_to_full();90void record_implicit_to_concurrent();91void record_implicit_to_full();9293void record_shutdown();94bool is_at_shutdown();9596ShenandoahTracer* tracer() {return _tracer;}9798size_t cycle_counter() const;99100void print_gc_stats(outputStream* out) const;101};102103#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHCOLLECTORPOLICY_HPP104105106