Path: blob/master/runtime/gc_vlhgc/CopyForwardSchemeTask.cpp
5986 views
/*******************************************************************************1* Copyright (c) 1991, 2020 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122#include "omrcfg.h"2324#include "j9port.h"25#include "modronopt.h"26#include "omrcomp.h"2728#include "CopyForwardSchemeTask.hpp"2930#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)31void32MM_CopyForwardSchemeTask::synchronizeGCThreads(MM_EnvironmentBase *envBase, const char *id)33{34PORT_ACCESS_FROM_ENVIRONMENT(envBase);35MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);36U_64 startTime = j9time_hires_clock();37MM_ParallelTask::synchronizeGCThreads(env, id);38U_64 endTime = j9time_hires_clock();39env->_copyForwardStats.addToSyncStallTime(startTime, endTime);40}4142bool43MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMain(MM_EnvironmentBase *envBase, const char *id)44{45PORT_ACCESS_FROM_ENVIRONMENT(envBase);46MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);47U_64 startTime = j9time_hires_clock();48bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);49U_64 endTime = j9time_hires_clock();50env->_copyForwardStats.addToSyncStallTime(startTime, endTime);5152return result;53}5455bool56MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseSingleThread(MM_EnvironmentBase *envBase, const char *id)57{58PORT_ACCESS_FROM_ENVIRONMENT(envBase);59MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);60U_64 startTime = j9time_hires_clock();61bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseSingleThread(env, id);62U_64 endTime = j9time_hires_clock();63env->_copyForwardStats.addToSyncStallTime(startTime, endTime);6465return result;66}6768bool69MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMainForAbort(MM_EnvironmentBase *envBase, const char *id)70{71PORT_ACCESS_FROM_ENVIRONMENT(envBase);72MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);73U_64 startTime = j9time_hires_clock();74bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);75U_64 endTime = j9time_hires_clock();76env->_copyForwardStats.addToAbortStallTime(startTime, endTime);7778return result;79}8081void82MM_CopyForwardSchemeTask::synchronizeGCThreadsForMark(MM_EnvironmentBase *envBase, const char *id)83{84PORT_ACCESS_FROM_ENVIRONMENT(envBase);85MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);86U_64 startTime = j9time_hires_clock();87MM_ParallelTask::synchronizeGCThreads(env, id);88U_64 endTime = j9time_hires_clock();89env->_copyForwardStats.addToMarkStallTime(startTime, endTime);90}9192bool93MM_CopyForwardSchemeTask::synchronizeGCThreadsAndReleaseMainForMark(MM_EnvironmentBase *envBase, const char *id)94{95PORT_ACCESS_FROM_ENVIRONMENT(envBase);96MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);97U_64 startTime = j9time_hires_clock();98bool result = MM_ParallelTask::synchronizeGCThreadsAndReleaseMain(env, id);99U_64 endTime = j9time_hires_clock();100env->_copyForwardStats.addToMarkStallTime(startTime, endTime);101102return result;103}104105void106MM_CopyForwardSchemeTask::synchronizeGCThreadsForInterRegionRememberedSet(MM_EnvironmentBase *envBase, const char *id)107{108PORT_ACCESS_FROM_ENVIRONMENT(envBase);109MM_EnvironmentVLHGC* env = MM_EnvironmentVLHGC::getEnvironment(envBase);110U_64 startTime = j9time_hires_clock();111MM_ParallelTask::synchronizeGCThreads(env, id);112U_64 endTime = j9time_hires_clock();113env->_copyForwardStats.addToInterRegionRememberedSetStallTime(startTime, endTime);114}115116#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */117118