Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahClosures.hpp
38920 views
/*1* Copyright (c) 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*/22#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP23#define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP2425#include "memory/iterator.hpp"2627class ShenandoahHeap;28class ShenandoahMarkingContext;29class Thread;3031class ShenandoahForwardedIsAliveClosure: public BoolObjectClosure {32private:33ShenandoahMarkingContext* const _mark_context;34public:35inline ShenandoahForwardedIsAliveClosure();36inline bool do_object_b(oop obj);37};3839class ShenandoahIsAliveClosure: public BoolObjectClosure {40private:41ShenandoahMarkingContext* const _mark_context;42public:43inline ShenandoahIsAliveClosure();44inline bool do_object_b(oop obj);45};4647class ShenandoahIsAliveSelector : public StackObj {48private:49ShenandoahIsAliveClosure _alive_cl;50ShenandoahForwardedIsAliveClosure _fwd_alive_cl;51public:52inline BoolObjectClosure* is_alive_closure();53};5455class ShenandoahUpdateRefsClosure: public OopClosure {56private:57ShenandoahHeap* _heap;58public:59inline ShenandoahUpdateRefsClosure();60inline void do_oop(oop* p);61inline void do_oop(narrowOop* p);62private:63template <class T>64inline void do_oop_work(T* p);65};6667class ShenandoahEvacuateUpdateRootsClosure: public ExtendedOopClosure {68private:69ShenandoahHeap* _heap;70Thread* _thread;71public:72inline ShenandoahEvacuateUpdateRootsClosure();73inline void do_oop(oop* p);74inline void do_oop(narrowOop* p);7576private:77template <class T>78inline void do_oop_work(T* p);79};8081#ifdef ASSERT82class ShenandoahAssertNotForwardedClosure : public OopClosure {83private:84template <class T>85inline void do_oop_work(T* p);8687public:88inline void do_oop(narrowOop* p);89inline void do_oop(oop* p);90};91#endif // ASSERT9293#endif // SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_HPP949596