Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_vlhgc/CopyScanCacheVLHGC.hpp
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2014 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* 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
22
*******************************************************************************/
23
24
/**
25
* @file
26
* @ingroup GC_Modron_Base
27
*/
28
29
#if !defined(COPYSCANCACHEVLHGC_HPP_)
30
#define COPYSCANCACHEVLHGC_HPP_
31
32
#include "j9.h"
33
#include "j9cfg.h"
34
#include "j9comp.h"
35
#include "modron.h"
36
37
#include "CopyScanCache.hpp"
38
39
/**
40
* @todo Provide class documentation
41
* @ingroup GC_Modron_Base
42
*/
43
class MM_CopyScanCacheVLHGC : public MM_CopyScanCache
44
{
45
/* Data Members */
46
private:
47
protected:
48
public:
49
GC_ObjectIteratorState _objectIteratorState; /**< the scan state of the partially scanned object */
50
UDATA _compactGroup; /**< The compact group this cache belongs to */
51
double _allocationAgeSizeProduct; /**< sum of (age * size) products for each object copied to this copy cache */
52
UDATA _objectSize; /**< sum of objects sizes copied to this copy cache */
53
U_64 _lowerAgeBound; /**< lowest possible age of any object in this copy cache */
54
U_64 _upperAgeBound; /**< highest possible age of any object in this copy cache */
55
UDATA _arraySplitIndex; /**< The index within the array in scanCurrent to start scanning from (meaningful is J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY is set) */
56
57
/* Members Function */
58
private:
59
protected:
60
public:
61
/**
62
* Clears the flag on the cache which denotes that is represents a split array.
63
*/
64
MMINLINE void clearSplitArray()
65
{
66
flags &= ~J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY;
67
_arraySplitIndex = 0;
68
}
69
70
/**
71
* Determine whether the receiver represents a split array.
72
* If so, the array object may be found in scanCurrent and the index in _arraySplitIndex.
73
* @return whether the receiver represents a split array
74
*/
75
MMINLINE bool isSplitArray() const
76
{
77
return (J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY == (flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY));
78
}
79
80
/**
81
* Create a CopyScanCacheVLHGC object.
82
*/
83
MM_CopyScanCacheVLHGC()
84
: MM_CopyScanCache()
85
, _compactGroup(UDATA_MAX)
86
, _allocationAgeSizeProduct(0.0)
87
, _objectSize(0)
88
, _lowerAgeBound(U_64_MAX)
89
, _upperAgeBound(0)
90
, _arraySplitIndex(0)
91
{}
92
};
93
94
#endif /* COPYSCANCACHEVLHGC_HPP_ */
95
96