Path: blob/master/runtime/gc_vlhgc/CopyScanCacheVLHGC.hpp
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2014 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/**24* @file25* @ingroup GC_Modron_Base26*/2728#if !defined(COPYSCANCACHEVLHGC_HPP_)29#define COPYSCANCACHEVLHGC_HPP_3031#include "j9.h"32#include "j9cfg.h"33#include "j9comp.h"34#include "modron.h"3536#include "CopyScanCache.hpp"3738/**39* @todo Provide class documentation40* @ingroup GC_Modron_Base41*/42class MM_CopyScanCacheVLHGC : public MM_CopyScanCache43{44/* Data Members */45private:46protected:47public:48GC_ObjectIteratorState _objectIteratorState; /**< the scan state of the partially scanned object */49UDATA _compactGroup; /**< The compact group this cache belongs to */50double _allocationAgeSizeProduct; /**< sum of (age * size) products for each object copied to this copy cache */51UDATA _objectSize; /**< sum of objects sizes copied to this copy cache */52U_64 _lowerAgeBound; /**< lowest possible age of any object in this copy cache */53U_64 _upperAgeBound; /**< highest possible age of any object in this copy cache */54UDATA _arraySplitIndex; /**< The index within the array in scanCurrent to start scanning from (meaningful is J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY is set) */5556/* Members Function */57private:58protected:59public:60/**61* Clears the flag on the cache which denotes that is represents a split array.62*/63MMINLINE void clearSplitArray()64{65flags &= ~J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY;66_arraySplitIndex = 0;67}6869/**70* Determine whether the receiver represents a split array.71* If so, the array object may be found in scanCurrent and the index in _arraySplitIndex.72* @return whether the receiver represents a split array73*/74MMINLINE bool isSplitArray() const75{76return (J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY == (flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY));77}7879/**80* Create a CopyScanCacheVLHGC object.81*/82MM_CopyScanCacheVLHGC()83: MM_CopyScanCache()84, _compactGroup(UDATA_MAX)85, _allocationAgeSizeProduct(0.0)86, _objectSize(0)87, _lowerAgeBound(U_64_MAX)88, _upperAgeBound(0)89, _arraySplitIndex(0)90{}91};9293#endif /* COPYSCANCACHEVLHGC_HPP_ */949596