Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_stats/MarkJavaStats.cpp
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
#include "j9port.h"
25
#include "modronopt.h"
26
27
#include "MarkJavaStats.hpp"
28
29
void
30
MM_MarkJavaStats::clear()
31
{
32
_unfinalizedCandidates = 0;
33
_unfinalizedEnqueued = 0;
34
35
_ownableSynchronizerCandidates = 0;
36
_ownableSynchronizerCleared = 0;
37
38
_weakReferenceStats.clear();
39
_softReferenceStats.clear();
40
_phantomReferenceStats.clear();
41
42
_stringConstantsCleared = 0;
43
_stringConstantsCandidates = 0;
44
45
_monitorReferenceCleared = 0;
46
_monitorReferenceCandidates = 0;
47
48
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)
49
splitArraysProcessed = 0;
50
splitArraysAmount = 0;
51
#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */
52
};
53
54
void
55
MM_MarkJavaStats::merge(MM_MarkJavaStats* statsToMerge)
56
{
57
_unfinalizedCandidates += statsToMerge->_unfinalizedCandidates;
58
_unfinalizedEnqueued += statsToMerge->_unfinalizedEnqueued;
59
60
_ownableSynchronizerCandidates += statsToMerge->_ownableSynchronizerCandidates;
61
_ownableSynchronizerCleared += statsToMerge->_ownableSynchronizerCleared;
62
63
_weakReferenceStats.merge(&statsToMerge->_weakReferenceStats);
64
_softReferenceStats.merge(&statsToMerge->_softReferenceStats);
65
_phantomReferenceStats.merge(&statsToMerge->_phantomReferenceStats);
66
67
_stringConstantsCleared += statsToMerge->_stringConstantsCleared;
68
_stringConstantsCandidates += statsToMerge->_stringConstantsCandidates;
69
70
_monitorReferenceCleared += statsToMerge->_monitorReferenceCleared;
71
_monitorReferenceCandidates += statsToMerge->_monitorReferenceCandidates;
72
73
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)
74
/* It may not ever be useful to merge these stats, but do it anyways */
75
splitArraysProcessed += statsToMerge->splitArraysProcessed;
76
splitArraysAmount += statsToMerge->splitArraysAmount;
77
#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */
78
};
79
80