Path: blob/master/runtime/gc_stats/ScavengerJavaStats.cpp
5985 views
1/*******************************************************************************2* Copyright (c) 1991, 2020 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* 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 and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*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-exception21*******************************************************************************/2223#include "ScavengerJavaStats.hpp"2425MM_ScavengerJavaStats::MM_ScavengerJavaStats() :26_unfinalizedCandidates(0)27,_unfinalizedEnqueued(0)28,_ownableSynchronizerCandidates(0)29,_ownableSynchronizerTotalSurvived(0)30,_ownableSynchronizerNurserySurvived(0)31,_weakReferenceStats()32,_softReferenceStats()33,_phantomReferenceStats()34,_monitorReferenceCleared(0)35,_monitorReferenceCandidates(0)36{37}3839void40MM_ScavengerJavaStats::clear()41{42_unfinalizedCandidates = 0;43_unfinalizedEnqueued = 0;4445_ownableSynchronizerCandidates = 0;46_ownableSynchronizerTotalSurvived = 0;47_ownableSynchronizerNurserySurvived = 0;4849_weakReferenceStats.clear();50_softReferenceStats.clear();51_phantomReferenceStats.clear();5253_monitorReferenceCleared = 0;54_monitorReferenceCandidates = 0;55};565758void59MM_ScavengerJavaStats::clearOwnableSynchronizerCounts()60{61_ownableSynchronizerCandidates = 0;62_ownableSynchronizerTotalSurvived = 0;63_ownableSynchronizerNurserySurvived = 0;64}6566void67MM_ScavengerJavaStats::mergeOwnableSynchronizerCounts(MM_ScavengerJavaStats *statsToMerge)68{69_ownableSynchronizerCandidates += statsToMerge->_ownableSynchronizerCandidates;70_ownableSynchronizerTotalSurvived += statsToMerge->_ownableSynchronizerTotalSurvived;71_ownableSynchronizerNurserySurvived += statsToMerge->_ownableSynchronizerNurserySurvived;72}737475