Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_stats/VLHGCCycleStats.hpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2014 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_Stats
27
*/
28
29
#if !defined(VLHGCCYCLESTATS_HPP_)
30
#define VLHGCCYCLESTATS_HPP_
31
32
#include "j9.h"
33
#include "j9cfg.h"
34
#include "j9port.h"
35
#include "j9consts.h"
36
#include "modronopt.h"
37
38
#if defined(J9VM_GC_VLHGC)
39
40
#include "Base.hpp"
41
#include "InterRegionRememberedSetStats.hpp"
42
#include "ModronAssertions.h"
43
#include "SweepVLHGCStats.hpp"
44
#include "WorkPacketStats.hpp"
45
#include "VLHGCIncrementStats.hpp"
46
47
/**
48
* Storage for statistics relevant to the collection cycles
49
* @ingroup GC_Stats
50
*/
51
class MM_VLHGCCycleStats : public MM_Base
52
{
53
public:
54
class MM_MarkVLHGCStats _markStats; /**< Stats for mark phase of cycle */
55
class MM_MarkVLHGCStats _concurrentMarkStats; /**< Stats for concurrent mark phase of cycle */
56
class MM_MarkVLHGCStats _incrementalMarkStats; /**< Stats for incremental (stop-the-world) mark phase of cycle */
57
class MM_WorkPacketStats _workPacketStats; /**< Stats for work packet activity of cycle */
58
class MM_InterRegionRememberedSetStats _irrsStats; /**< Stats for Inter Region Remembered Set processing */
59
60
public:
61
MM_VLHGCCycleStats() :
62
_markStats()
63
,_concurrentMarkStats()
64
,_incrementalMarkStats()
65
,_workPacketStats()
66
,_irrsStats()
67
{};
68
69
/**
70
* Reset the statistics of the receiver for a new round.
71
*/
72
MMINLINE void clear()
73
{
74
_markStats.clear();
75
_concurrentMarkStats.clear();
76
_incrementalMarkStats.clear();
77
_workPacketStats.clear();
78
_irrsStats.clear();
79
}
80
81
/**
82
* Add / combine the statistics from the parameter to the receiver.
83
*/
84
MMINLINE void merge(MM_VLHGCIncrementStats *stats)
85
{
86
_markStats.merge(&stats->_markStats);
87
_workPacketStats.merge(&stats->_workPacketStats);
88
_irrsStats.merge(&stats->_irrsStats);
89
90
switch (stats->_globalMarkIncrementType) {
91
case MM_VLHGCIncrementStats::mark_concurrent:
92
_concurrentMarkStats.merge(&stats->_markStats);
93
break;
94
95
case MM_VLHGCIncrementStats::mark_incremental:
96
_incrementalMarkStats.merge(&stats->_markStats);
97
break;
98
99
case MM_VLHGCIncrementStats::mark_idle:
100
case MM_VLHGCIncrementStats::mark_global_collection:
101
break;
102
103
default:
104
Assert_MM_unreachable();
105
}
106
}
107
108
};
109
110
#endif /* J9VM_GC_VLHGC */
111
#endif /* VLHGCCYCLESTATS_HPP_ */
112
113