Path: blob/master/runtime/gc_glue_java/ConcurrentSafepointCallbackJava.hpp
5985 views
/*******************************************************************************1* Copyright (c) 2015, 2017 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#if !defined(CONCURRENTSAFEPOINTCALLBACKJAVA_HPP_)23#define CONCURRENTSAFEPOINTCALLBACKJAVA_HPP_2425#include "j9cfg.h"2627#if defined (OMR_GC_MODRON_CONCURRENT_MARK)2829#include "j9.h"30#include "vmhook.h"31#include "j9comp.h"32#include "ConcurrentSafepointCallback.hpp"33#include "EnvironmentStandard.hpp"3435/**36* @todo Provide typedef documentation37* @ingroup GC_Modron_Standard38*/3940class MM_ConcurrentSafepointCallbackJava : public MM_ConcurrentSafepointCallback41{42private:43intptr_t _asyncEventKey;44#if defined(AIXPPC) || defined(LINUXPPC)45bool _cancelAfterGC;46#endif /* defined(AIXPPC) || defined(LINUXPPC) */47protected:48public:4950private:51bool initialize(MM_EnvironmentBase *env);52static void vmInitialized(J9HookInterface** hook, uintptr_t eventNum, void* eventData, void* userData);53static void vmTerminating(J9HookInterface** hook, uintptr_t eventNum, void* eventData, void* userData);54static void reportGlobalGCComplete(J9HookInterface** hook, uintptr_t eventNum, void* eventData, void* userData);55static void registerAsyncEventHandler(MM_EnvironmentBase *env, MM_ConcurrentSafepointCallbackJava *callback);56static void asyncEventHandler(J9VMThread *vmThread, intptr_t handlerKey, void *userData);5758void globalGCComplete(MM_EnvironmentBase *env);5960protected:61public:62#if defined(AIXPPC) || defined(LINUXPPC)63virtual void registerCallback(MM_EnvironmentBase *env, SafepointCallbackHandler handler, void *userData, bool cancelAfterGC = false);64#else65virtual void registerCallback(MM_EnvironmentBase *env, SafepointCallbackHandler handler, void *userData);66#endif /* defined(AIXPPC) || defined(LINUXPPC) */6768virtual void cancelCallback(MM_EnvironmentBase *env);6970virtual void requestCallback(MM_EnvironmentBase *env);7172static MM_ConcurrentSafepointCallbackJava *newInstance(MM_EnvironmentBase *env);73virtual void kill(MM_EnvironmentBase *env);7475/**76* Create a MM_ConcurrentSafepointCallbackJava object77*/78MM_ConcurrentSafepointCallbackJava(MM_EnvironmentBase *env)79: MM_ConcurrentSafepointCallback(env)80,_asyncEventKey(-1)81#if defined(AIXPPC) || defined(LINUXPPC)82,_cancelAfterGC(false)83#endif /* defined(AIXPPC) || defined(LINUXPPC) */84{85_typeId = __FUNCTION__;86}87};8889#endif /* defined (OMR_GC_MODRON_CONCURRENT_MARK)*/9091#endif /* CONCURRENTSAFEPOINTCALLBACKJAVA_HPP_ */929394