Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_vlhgc/EnvironmentVLHGC.hpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2021 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* 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-exception
22
*******************************************************************************/
23
24
/**
25
* @file
26
* @ingroup GC_Modron_Env
27
*/
28
29
#if !defined(ENVIRONMENTVLHGC_HPP_)
30
#define ENVIRONMENTVLHGC_HPP_
31
32
#include "j9.h"
33
#include "j9cfg.h"
34
#include "j9port.h"
35
#include "j9protos.h"
36
#include "modronopt.h"
37
38
#if defined(J9VM_GC_MODRON_COMPACTION)
39
#include "CompactVLHGCStats.hpp"
40
#endif /* J9VM_GC_MODRON_COMPACTION */
41
#include "CycleStateVLHGC.hpp"
42
#include "EnvironmentBase.hpp"
43
#include "OwnableSynchronizerObjectBufferVLHGC.hpp"
44
#include "ReferenceObjectBufferVLHGC.hpp"
45
#include "UnfinalizedObjectBufferVLHGC.hpp"
46
#include "WorkStack.hpp"
47
48
class MM_GCExtensions;
49
class MM_CopyForwardCompactGroup;
50
class MM_CopyScanCache;
51
class MM_RememberedSetCardList;
52
53
struct MM_CardBufferControlBlock;
54
struct DepthStackTuple;
55
56
/**
57
* @todo Provide class documentation
58
* @ingroup GC_Modron_Env
59
*/
60
class MM_EnvironmentVLHGC : public MM_EnvironmentBase
61
{
62
/* Data Section */
63
public:
64
MM_CopyScanCache *_survivorCopyScanCache; /**< the current copy cache for flipping */
65
MM_CopyScanCache *_scanCache; /**< the current scan cache */
66
MM_CopyScanCache *_deferredScanCache; /**< a partially scanned cache, to be scanned later */
67
68
MM_CopyForwardCompactGroup *_copyForwardCompactGroups; /**< List of copy-forward data for each compact group for the given GC thread (only for GC threads during copy forward operations) */
69
70
uintptr_t _previousConcurrentYieldCheckBytesScanned; /**< The number of bytes scanned in the mark stats at the end of the previous shouldYieldFromTask check in concurrent mark */
71
72
MM_CardBufferControlBlock *_rsclBufferControlBlockHead; /**< head of BufferControlBlock thread local pool list */
73
MM_CardBufferControlBlock *_rsclBufferControlBlockTail; /**< tail of BufferControlBlock thread local pool list */
74
intptr_t _rsclBufferControlBlockCount; /**< count of buffers in BufferControlBlock thread local pool list */
75
MM_RememberedSetCardBucket *_rememberedSetCardBucketPool; /**< GC thread local pool of RS Card Buckets for each Region (its Card List) */
76
MM_RememberedSetCardList *_lastOverflowedRsclWithReleasedBuffers; /**< in global list of overflowed RSCL, this is the last RSCL this thread visited */
77
78
MM_CopyForwardStats _copyForwardStats; /**< GC thread local statistics structure for copy forward collections */
79
80
MM_MarkVLHGCStats _markVLHGCStats;
81
MM_SweepVLHGCStats _sweepVLHGCStats;
82
83
#if defined(J9VM_GC_MODRON_COMPACTION)
84
MM_CompactVLHGCStats _compactVLHGCStats;
85
#endif /* J9VM_GC_MODRON_COMPACTION */
86
MM_InterRegionRememberedSetStats _irrsStats;
87
88
protected:
89
private:
90
/* Functionality Section */
91
public:
92
static MM_EnvironmentVLHGC *newInstance(MM_GCExtensionsBase *extensions, OMR_VMThread *vmThread);
93
virtual void kill();
94
95
/**
96
* Initialization specifically for GC threads
97
*/
98
virtual void initializeGCThread();
99
100
MMINLINE static MM_EnvironmentVLHGC *getEnvironment(J9VMThread *vmThread) { return static_cast<MM_EnvironmentVLHGC*>(vmThread->gcExtensions); }
101
MMINLINE static MM_EnvironmentVLHGC *getEnvironment(OMR_VMThread *omrVMThread) { return static_cast<MM_EnvironmentVLHGC*>(omrVMThread->_gcOmrVMThreadExtensions); }
102
MMINLINE static MM_EnvironmentVLHGC *getEnvironment(MM_EnvironmentBase* env) { return static_cast<MM_EnvironmentVLHGC*>(env); }
103
104
/**
105
* Create an Environment object.
106
*/
107
MM_EnvironmentVLHGC(OMR_VMThread *vmThread);
108
109
/**
110
* Create an Environment object.
111
*/
112
MM_EnvironmentVLHGC(J9JavaVM *javaVM);
113
114
protected:
115
virtual bool initialize(MM_GCExtensionsBase *extensions);
116
virtual void tearDown(MM_GCExtensionsBase *extensions);
117
118
private:
119
120
};
121
122
#endif /* ENVIRONMENTVLHGC_HPP_ */
123
124