/*******************************************************************************1* Copyright (c) 1991, 2014 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122/**23* @file24* @ingroup GC_Check25*/2627#if !defined(CHECK_HPP_)28#define CHECK_HPP_2930#include "j9.h"31#include "j9cfg.h"3233#include "Base.hpp"34#include "GCExtensions.hpp"3536class GC_CheckEngine;3738/**39* GC_Check - abstract class for defining types of check40*41* An abstract class for defining a type of check gc_check42* can perform. Actual checks should derive from this then43* be attached to a "check cycle" that manages all the checks44* to be performed during one invocation of gc_check45*/46class GC_Check : public MM_Base47{48/*49* Data members50*/51private:52protected:53J9JavaVM *_javaVM;54GC_CheckEngine *_engine;55MM_GCExtensions *_extensions;56J9PortLibrary *_portLibrary; /**< we use a separate portlibrary (not the one from the javaVM) because this code57also runs out-of-process, where javaVM is the crashed VM (that doesn't have58a valid portlibrary) */5960GC_Check *_next; /**< pointer to the next check in the list (these objects are chained inside a GC_CheckCycle) */61UDATA _bitId; /**< identifier of particular Check class that is initialized by appropriate J9MODRON_GCCHK_SCAN_xxx bit */6263public:6465/*66* Function members67*/68private:69protected:70virtual void check() = 0; /**< run the check */71virtual void print() = 0; /**< dump the check structure to tty */7273public:74virtual void kill() = 0;7576void setNext(GC_Check *check) { _next = check; }77GC_Check *getNext(void) { return _next; }78void setBitId(UDATA bitId) { _bitId = bitId; }79UDATA getBitId() { return _bitId; }8081void run(bool shouldCheck, bool shouldPrint); /**< run gc_check on the structure */82virtual const char *getCheckName() = 0; /**< get a string representing this check-type */8384GC_Check(J9JavaVM *javaVM, GC_CheckEngine *engine)85: MM_Base()86, _javaVM(javaVM)87, _engine(engine)88, _extensions(MM_GCExtensions::getExtensions(javaVM))89, _portLibrary(javaVM->portLibrary)90, _next(NULL)91, _bitId(0)92{ }93};9495#endif /* CHECK_HPP_ */969798