Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_vlhgc/CopyForwardSchemeTask.cpp
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2020 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* 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
21
*******************************************************************************/
22
23
#include "omrcfg.h"
24
25
#include "j9port.h"
26
#include "modronopt.h"
27
#include "omrcomp.h"
28
29
#include "CopyForwardSchemeTask.hpp"
30
31
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)
32
void
33
MM_CopyForwardSchemeTask::synchronizeGCThreads(MM_EnvironmentBase *envBase, const char *id)
34
{
35
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
36
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
37
U_64 startTime = j9time_hires_clock();
38
MM_ParallelTask::synchronizeGCThreads(env, id);
39
U_64 endTime = j9time_hires_clock();
40
env->_copyForwardStats.addToSyncStallTime(startTime, endTime);
41
}
42
43
bool
44
MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMain(MM_EnvironmentBase *envBase, const char *id)
45
{
46
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
47
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
48
U_64 startTime = j9time_hires_clock();
49
bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);
50
U_64 endTime = j9time_hires_clock();
51
env->_copyForwardStats.addToSyncStallTime(startTime, endTime);
52
53
return result;
54
}
55
56
bool
57
MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseSingleThread(MM_EnvironmentBase *envBase, const char *id)
58
{
59
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
60
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
61
U_64 startTime = j9time_hires_clock();
62
bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseSingleThread(env, id);
63
U_64 endTime = j9time_hires_clock();
64
env->_copyForwardStats.addToSyncStallTime(startTime, endTime);
65
66
return result;
67
}
68
69
bool
70
MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMainForAbort(MM_EnvironmentBase *envBase, const char *id)
71
{
72
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
73
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
74
U_64 startTime = j9time_hires_clock();
75
bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);
76
U_64 endTime = j9time_hires_clock();
77
env->_copyForwardStats.addToAbortStallTime(startTime, endTime);
78
79
return result;
80
}
81
82
void
83
MM_CopyForwardSchemeTask::synchronizeGCThreadsForMark(MM_EnvironmentBase *envBase, const char *id)
84
{
85
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
86
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
87
U_64 startTime = j9time_hires_clock();
88
MM_ParallelTask::synchronizeGCThreads(env, id);
89
U_64 endTime = j9time_hires_clock();
90
env->_copyForwardStats.addToMarkStallTime(startTime, endTime);
91
}
92
93
bool
94
MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMainForMark(MM_EnvironmentBase *envBase, const char *id)
95
{
96
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
97
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
98
U_64 startTime = j9time_hires_clock();
99
bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);
100
U_64 endTime = j9time_hires_clock();
101
env->_copyForwardStats.addToMarkStallTime(startTime, endTime);
102
103
return result;
104
}
105
106
void
107
MM_CopyForwardSchemeTask::synchronizeGCThreadsForInterRegionRememberedSet(MM_EnvironmentBase *envBase, const char *id)
108
{
109
PORT_ACCESS_FROM_ENVIRONMENT(envBase);
110
MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);
111
U_64 startTime = j9time_hires_clock();
112
MM_ParallelTask::synchronizeGCThreads(env, id);
113
U_64 endTime = j9time_hires_clock();
114
env->_copyForwardStats.addToInterRegionRememberedSetStallTime(startTime, endTime);
115
}
116
117
#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */
118