Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_vlhgc/CardListFlushTask.hpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2020 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_Standard
27
*/
28
29
#if !defined(CARDLISTFLUSHTASK_HPP_)
30
#define CARDLISTFLUSHTASK_HPP_
31
32
#include "j9.h"
33
#include "j9cfg.h"
34
#include "j9modron.h"
35
#include "modronopt.h"
36
37
#include "EnvironmentBase.hpp"
38
#include "ParallelTask.hpp"
39
40
class MM_CycleState;
41
class MM_HeapRegionManager;
42
class MM_InterRegionRememberedSet;
43
44
45
/**
46
* @}
47
*/
48
49
50
/**
51
* @todo Provide class documentation
52
* @ingroup GC_Modron_Standard
53
*/
54
class MM_CardListFlushTask : public MM_ParallelTask
55
{
56
/* Data Members */
57
private:
58
MM_HeapRegionManager * const _regionManager;
59
MM_InterRegionRememberedSet * const _interRegionRememberedSet;
60
MM_CycleState * const _cycleState;
61
protected:
62
public:
63
64
/* Member Functions */
65
private:
66
protected:
67
public:
68
virtual UDATA getVMStateID() { return OMRVMSTATE_GC_MARK; }
69
70
virtual void run(MM_EnvironmentBase *env);
71
virtual void setup(MM_EnvironmentBase *env);
72
virtual void cleanup(MM_EnvironmentBase *env);
73
74
void mainSetup(MM_EnvironmentBase *env);
75
void mainCleanup(MM_EnvironmentBase *env);
76
77
/**
78
* 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 want
79
* the resultant state to also describe that a card from a card list was flushed to it.
80
* This is used in Marking and Compact scheme when we flush RSCL into CardTable.
81
* @param card[in/out] The card which will be used as the input and output of the state machine function
82
* @param gmpIsActive[in] True if there is currently a GMP in progress during this PGC
83
*/
84
static void writeFlushToCardState(Card *card, bool gmpIsActive);
85
86
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)
87
virtual void synchronizeGCThreads(MM_EnvironmentBase *env, const char *id);
88
virtual bool synchronizeGCThreadsAndReleaseMain(MM_EnvironmentBase *env, const char *id);
89
virtual bool synchronizeGCThreadsAndReleaseSingleThread(MM_EnvironmentBase *env, const char *id);
90
#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */
91
92
MM_CardListFlushTask(MM_EnvironmentBase *env, MM_ParallelDispatcher *dispatcher, MM_HeapRegionManager *manager, MM_InterRegionRememberedSet *remset)
93
: MM_ParallelTask(env, dispatcher)
94
, _regionManager(manager)
95
, _interRegionRememberedSet(remset)
96
, _cycleState(env->_cycleState)
97
{
98
_typeId = __FUNCTION__;
99
}
100
};
101
102
#endif /* CARDLISTFLUSHTASK_HPP_ */
103
104
105