Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_stats/MarkJavaStats.hpp
5985 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
#if !defined(MARKJAVASTATS_HPP_)
25
#define MARKJAVASTATS_HPP_
26
27
#include "j9port.h"
28
#include "modronopt.h"
29
30
#include "Base.hpp"
31
#include "AtomicOperations.hpp"
32
#include "ReferenceStats.hpp"
33
34
/**
35
* Storage for statistics relevant to the mark phase of a global collection.
36
* @ingroup GC_Stats
37
*/
38
class MM_MarkJavaStats : public MM_Base {
39
/* data members */
40
private:
41
protected:
42
public:
43
UDATA _unfinalizedCandidates; /**< unfinalized objects that are candidates to be finalized visited this cycle */
44
UDATA _unfinalizedEnqueued; /**< unfinalized objects that are enqueued during this cycle (MUST be less than or equal _unfinalizedCandidates) */
45
46
UDATA _ownableSynchronizerCandidates; /**< number of ownable synchronizer objects visited this cycle */
47
UDATA _ownableSynchronizerCleared; /**< number of ownable synchronizer objects cleared this cycle */
48
49
MM_ReferenceStats _weakReferenceStats; /**< Weak reference stats for the cycle */
50
MM_ReferenceStats _softReferenceStats; /**< Soft reference stats for the cycle */
51
MM_ReferenceStats _phantomReferenceStats; /**< Phantom reference stats for the cycle */
52
53
UDATA _stringConstantsCleared; /**< The number of string constants that have been cleared during marking */
54
UDATA _stringConstantsCandidates; /**< The number of string constants that have been visited in string table during marking */
55
56
UDATA _monitorReferenceCleared; /**< The number of monitor references that have been cleared during marking */
57
UDATA _monitorReferenceCandidates; /**< The number of monitor references that have been visited in monitor table during marking */
58
59
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)
60
UDATA splitArraysProcessed; /**< The number of array chunks (not counting parts smaller than the split size) processed by this thread */
61
UDATA splitArraysAmount;
62
#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */
63
64
/* function members */
65
private:
66
protected:
67
public:
68
void clear();
69
void merge(MM_MarkJavaStats* statsToMerge);
70
71
MM_MarkJavaStats() :
72
MM_Base()
73
, _unfinalizedCandidates(0)
74
, _unfinalizedEnqueued(0)
75
, _ownableSynchronizerCandidates(0)
76
, _ownableSynchronizerCleared(0)
77
, _weakReferenceStats()
78
, _softReferenceStats()
79
, _phantomReferenceStats()
80
, _stringConstantsCleared(0)
81
, _stringConstantsCandidates(0)
82
, _monitorReferenceCleared(0)
83
, _monitorReferenceCandidates(0)
84
{
85
clear();
86
}
87
};
88
89
#endif /* MARKJAVASTATS_HPP_ */
90
91