Path: blob/master/runtime/gc_vlhgc/EnvironmentVLHGC.hpp
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2021 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_Env26*/2728#if !defined(ENVIRONMENTVLHGC_HPP_)29#define ENVIRONMENTVLHGC_HPP_3031#include "j9.h"32#include "j9cfg.h"33#include "j9port.h"34#include "j9protos.h"35#include "modronopt.h"3637#if defined(J9VM_GC_MODRON_COMPACTION)38#include "CompactVLHGCStats.hpp"39#endif /* J9VM_GC_MODRON_COMPACTION */40#include "CycleStateVLHGC.hpp"41#include "EnvironmentBase.hpp"42#include "OwnableSynchronizerObjectBufferVLHGC.hpp"43#include "ReferenceObjectBufferVLHGC.hpp"44#include "UnfinalizedObjectBufferVLHGC.hpp"45#include "WorkStack.hpp"4647class MM_GCExtensions;48class MM_CopyForwardCompactGroup;49class MM_CopyScanCache;50class MM_RememberedSetCardList;5152struct MM_CardBufferControlBlock;53struct DepthStackTuple;5455/**56* @todo Provide class documentation57* @ingroup GC_Modron_Env58*/59class MM_EnvironmentVLHGC : public MM_EnvironmentBase60{61/* Data Section */62public:63MM_CopyScanCache *_survivorCopyScanCache; /**< the current copy cache for flipping */64MM_CopyScanCache *_scanCache; /**< the current scan cache */65MM_CopyScanCache *_deferredScanCache; /**< a partially scanned cache, to be scanned later */6667MM_CopyForwardCompactGroup *_copyForwardCompactGroups; /**< List of copy-forward data for each compact group for the given GC thread (only for GC threads during copy forward operations) */6869uintptr_t _previousConcurrentYieldCheckBytesScanned; /**< The number of bytes scanned in the mark stats at the end of the previous shouldYieldFromTask check in concurrent mark */7071MM_CardBufferControlBlock *_rsclBufferControlBlockHead; /**< head of BufferControlBlock thread local pool list */72MM_CardBufferControlBlock *_rsclBufferControlBlockTail; /**< tail of BufferControlBlock thread local pool list */73intptr_t _rsclBufferControlBlockCount; /**< count of buffers in BufferControlBlock thread local pool list */74MM_RememberedSetCardBucket *_rememberedSetCardBucketPool; /**< GC thread local pool of RS Card Buckets for each Region (its Card List) */75MM_RememberedSetCardList *_lastOverflowedRsclWithReleasedBuffers; /**< in global list of overflowed RSCL, this is the last RSCL this thread visited */7677MM_CopyForwardStats _copyForwardStats; /**< GC thread local statistics structure for copy forward collections */7879MM_MarkVLHGCStats _markVLHGCStats;80MM_SweepVLHGCStats _sweepVLHGCStats;8182#if defined(J9VM_GC_MODRON_COMPACTION)83MM_CompactVLHGCStats _compactVLHGCStats;84#endif /* J9VM_GC_MODRON_COMPACTION */85MM_InterRegionRememberedSetStats _irrsStats;8687protected:88private:89/* Functionality Section */90public:91static MM_EnvironmentVLHGC *newInstance(MM_GCExtensionsBase *extensions, OMR_VMThread *vmThread);92virtual void kill();9394/**95* Initialization specifically for GC threads96*/97virtual void initializeGCThread();9899MMINLINE static MM_EnvironmentVLHGC *getEnvironment(J9VMThread *vmThread) { return static_cast<MM_EnvironmentVLHGC*>(vmThread->gcExtensions); }100MMINLINE static MM_EnvironmentVLHGC *getEnvironment(OMR_VMThread *omrVMThread) { return static_cast<MM_EnvironmentVLHGC*>(omrVMThread->_gcOmrVMThreadExtensions); }101MMINLINE static MM_EnvironmentVLHGC *getEnvironment(MM_EnvironmentBase* env) { return static_cast<MM_EnvironmentVLHGC*>(env); }102103/**104* Create an Environment object.105*/106MM_EnvironmentVLHGC(OMR_VMThread *vmThread);107108/**109* Create an Environment object.110*/111MM_EnvironmentVLHGC(J9JavaVM *javaVM);112113protected:114virtual bool initialize(MM_GCExtensionsBase *extensions);115virtual void tearDown(MM_GCExtensionsBase *extensions);116117private:118119};120121#endif /* ENVIRONMENTVLHGC_HPP_ */122123124