Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
38920 views
/*1* Copyright (c) 2001, 2013, 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_PARALLELSCAVENGE_PSMARKSWEEP_HPP25#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP2627#include "gc_implementation/shared/collectorCounters.hpp"28#include "gc_implementation/shared/markSweep.inline.hpp"29#include "utilities/stack.hpp"3031class PSAdaptiveSizePolicy;32class PSYoungGen;33class PSOldGen;3435class PSMarkSweep : public MarkSweep {36private:37static elapsedTimer _accumulated_time;38static jlong _time_of_last_gc; // ms39static CollectorCounters* _counters;4041// Closure accessors42static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; }43static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; }44static CLDClosure* follow_cld_closure() { return &MarkSweep::follow_cld_closure; }45static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; }46static CLDClosure* adjust_cld_closure() { return &MarkSweep::adjust_cld_closure; }47static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&MarkSweep::is_alive; }4849debug_only(public:) // Used for PSParallelCompact debugging50// Mark live objects51static void mark_sweep_phase1(bool clear_all_softrefs);52// Calculate new addresses53static void mark_sweep_phase2();54debug_only(private:) // End used for PSParallelCompact debugging55// Update pointers56static void mark_sweep_phase3();57// Move objects to new positions58static void mark_sweep_phase4();5960debug_only(public:) // Used for PSParallelCompact debugging61// Temporary data structures for traversal and storing/restoring marks62static void allocate_stacks();63static void deallocate_stacks();64static void set_ref_processor(ReferenceProcessor* rp) { // delete this method65_ref_processor = rp;66}67debug_only(private:) // End used for PSParallelCompact debugging6869// If objects are left in eden after a collection, try to move the boundary70// and absorb them into the old gen. Returns true if eden was emptied.71static bool absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy,72PSYoungGen* young_gen,73PSOldGen* old_gen);7475// Reset time since last full gc76static void reset_millis_since_last_gc();7778public:79static void invoke(bool clear_all_softrefs);80static bool invoke_no_policy(bool clear_all_softrefs);8182static void initialize();8384// Public accessors85static elapsedTimer* accumulated_time() { return &_accumulated_time; }86static CollectorCounters* counters() { return _counters; }8788// Time since last full gc (in milliseconds)89static jlong millis_since_last_gc();90};9192#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP939495