Path: blob/master/runtime/gc_stats/MarkJavaStats.cpp
5986 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 "j9port.h"24#include "modronopt.h"2526#include "MarkJavaStats.hpp"2728void29MM_MarkJavaStats::clear()30{31_unfinalizedCandidates = 0;32_unfinalizedEnqueued = 0;3334_ownableSynchronizerCandidates = 0;35_ownableSynchronizerCleared = 0;3637_weakReferenceStats.clear();38_softReferenceStats.clear();39_phantomReferenceStats.clear();4041_stringConstantsCleared = 0;42_stringConstantsCandidates = 0;4344_monitorReferenceCleared = 0;45_monitorReferenceCandidates = 0;4647#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)48splitArraysProcessed = 0;49splitArraysAmount = 0;50#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */51};5253void54MM_MarkJavaStats::merge(MM_MarkJavaStats* statsToMerge)55{56_unfinalizedCandidates += statsToMerge->_unfinalizedCandidates;57_unfinalizedEnqueued += statsToMerge->_unfinalizedEnqueued;5859_ownableSynchronizerCandidates += statsToMerge->_ownableSynchronizerCandidates;60_ownableSynchronizerCleared += statsToMerge->_ownableSynchronizerCleared;6162_weakReferenceStats.merge(&statsToMerge->_weakReferenceStats);63_softReferenceStats.merge(&statsToMerge->_softReferenceStats);64_phantomReferenceStats.merge(&statsToMerge->_phantomReferenceStats);6566_stringConstantsCleared += statsToMerge->_stringConstantsCleared;67_stringConstantsCandidates += statsToMerge->_stringConstantsCandidates;6869_monitorReferenceCleared += statsToMerge->_monitorReferenceCleared;70_monitorReferenceCandidates += statsToMerge->_monitorReferenceCandidates;7172#if defined(J9MODRON_TGC_PARALLEL_STATISTICS)73/* It may not ever be useful to merge these stats, but do it anyways */74splitArraysProcessed += statsToMerge->splitArraysProcessed;75splitArraysAmount += statsToMerge->splitArraysAmount;76#endif /* J9MODRON_TGC_PARALLEL_STATISTICS */77};787980