Path: blob/master/runtime/gc_vlhgc/GlobalCollectionCardCleaner.hpp
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2018 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception21*******************************************************************************/222324/**25* @file26* @ingroup GC_Modron_Standard27*/2829#if !defined(GLOBALCOLLECTIONCARDCLEANER_HPP_)30#define GLOBALCOLLECTIONCARDCLEANER_HPP_313233#include "j9.h"34#include "j9cfg.h"35#include "j9modron.h"3637#include "CardCleaner.hpp"3839class MM_GlobalMarkingScheme;40class MM_HeapMap;4142/**43* @todo Provide typedef documentation44* @ingroup GC_Modron_Standard45*/4647class MM_GlobalCollectionCardCleaner : public MM_CardCleaner48{49/* Data Members */50private:51MM_GlobalMarkingScheme * const _markingScheme; /**< The marking scheme to use for scanning objects which have been modified since they were last scanned */52protected:53public:5455/* Member Functions */56private:57protected:58/**59* Clean a range of addresses (typically within a span of a card).60* This class is used for updating the RSM based on the previous mark map and scanning modified objects in the next mark map61* (note that next is always a subset of previous so anything not marked in next but marked in previous only requires RSM62* inter-region reference updating while objects marked in both require RSM updates and object scanning to update the next63* mark map).64*65* @param[in] env A thread (typically the thread initializing the GC)66* @param[in] lowAddress low address of the range to be cleaned67* @param[in] highAddress high address of the range to be cleaned68* @param cardToClean[in/out] The card which we are cleaning69*/70virtual void clean(MM_EnvironmentBase *env, void *lowAddress, void *highAddress, Card *cardToClean);7172/**73* @see MM_CardCleaner::getVMStateID()74*/75virtual UDATA getVMStateID() { return OMRVMSTATE_GC_GLOBAL_COLLECTION_CARD_CLEANER; }7677public:7879/**80* Create a CardCleaner object for updating RSM and next mark map.81*/82MM_GlobalCollectionCardCleaner(MM_GlobalMarkingScheme *markingScheme)83: MM_CardCleaner()84, _markingScheme(markingScheme)85{86_typeId = __FUNCTION__;87}88};8990#endif /* GLOBALCOLLECTIONCARDCLEANER_HPP_ */919293