Path: blob/master/runtime/gc_vlhgc/CardListFlushTask.hpp
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2020 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*******************************************************************************/2223/**24* @file25* @ingroup GC_Modron_Standard26*/2728#if !defined(CARDLISTFLUSHTASK_HPP_)29#define CARDLISTFLUSHTASK_HPP_3031#include "j9.h"32#include "j9cfg.h"33#include "j9modron.h"34#include "modronopt.h"3536#include "EnvironmentBase.hpp"37#include "ParallelTask.hpp"3839class MM_CycleState;40class MM_HeapRegionManager;41class MM_InterRegionRememberedSet;424344/**45* @}46*/474849/**50* @todo Provide class documentation51* @ingroup GC_Modron_Standard52*/53class MM_CardListFlushTask : public MM_ParallelTask54{55/* Data Members */56private:57MM_HeapRegionManager * const _regionManager;58MM_InterRegionRememberedSet * const _interRegionRememberedSet;59MM_CycleState * const _cycleState;60protected:61public:6263/* Member Functions */64private:65protected:66public:67virtual UDATA getVMStateID() { return OMRVMSTATE_GC_MARK; }6869virtual void run(MM_EnvironmentBase *env);70virtual void setup(MM_EnvironmentBase *env);71virtual void cleanup(MM_EnvironmentBase *env);7273void mainSetup(MM_EnvironmentBase *env);74void mainCleanup(MM_EnvironmentBase *env);7576/**77* Checks the state of the given card and updates its content based on what state it should transition the old one from, given that we want78* the resultant state to also describe that a card from a card list was flushed to it.79* This is used in Marking and Compact scheme when we flush RSCL into CardTable.80* @param card[in/out] The card which will be used as the input and output of the state machine function81* @param gmpIsActive[in] True if there is currently a GMP in progress during this PGC82*/83static void writeFlushToCardState(Card *card, bool gmpIsActive);8485#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)86virtual void synchronizeGCThreads(MM_EnvironmentBase *env, const char *id);87virtual bool synchronizeGCThreadsAndReleaseMain(MM_EnvironmentBase *env, const char *id);88virtual bool synchronizeGCThreadsAndReleaseSingleThread(MM_EnvironmentBase *env, const char *id);89#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */9091MM_CardListFlushTask(MM_EnvironmentBase *env, MM_ParallelDispatcher *dispatcher, MM_HeapRegionManager *manager, MM_InterRegionRememberedSet *remset)92: MM_ParallelTask(env, dispatcher)93, _regionManager(manager)94, _interRegionRememberedSet(remset)95, _cycleState(env->_cycleState)96{97_typeId = __FUNCTION__;98}99};100101#endif /* CARDLISTFLUSHTASK_HPP_ */102103104105