Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_realtime/IncrementalOverflow.hpp
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2019 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* 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 and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
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-exception
21
*******************************************************************************/
22
23
/**
24
* @file
25
* @ingroup GC_Modron_Standard
26
*/
27
28
#if !defined(INCREMENTALOVERFLOW_HPP_)
29
#define INCREMENTALOVERFLOW_HPP_
30
31
#include "EnvironmentBase.hpp"
32
#include "Metronome.hpp"
33
#include "WorkPacketOverflow.hpp"
34
35
class MM_Packet;
36
class MM_HeapRegionDescriptorRealtime;
37
38
/**
39
* @todo Provide class documentation
40
*/
41
class MM_IncrementalOverflow : public MM_WorkPacketOverflow
42
{
43
/* Data members & types */
44
public:
45
protected:
46
private:
47
MM_GCExtensionsBase *_extensions;
48
MM_HeapRegionDescriptorRealtime *_overflowList;
49
bool _overflowThisGCCycle; /**< set to signify an overflow happened sometime during GC cycle */
50
51
/* Methods */
52
public:
53
static MM_IncrementalOverflow *newInstance(MM_EnvironmentBase *env, MM_WorkPackets *workPackets);
54
virtual void reset(MM_EnvironmentBase *env);
55
56
virtual bool isEmpty()
57
{
58
return (_overflowList == NULL);
59
}
60
61
bool isOverflowThisGCCycle() const { return _overflowThisGCCycle; }
62
void resetOverflowThisGCCycle() { _overflowThisGCCycle = false; }
63
64
virtual void emptyToOverflow(MM_EnvironmentBase *env, MM_Packet *packet, MM_OverflowType type);
65
virtual void fillFromOverflow(MM_EnvironmentBase *env, MM_Packet *packet);
66
virtual void overflowItem(MM_EnvironmentBase *env, void *item, MM_OverflowType type);
67
68
/**
69
* Create a IncrementalOverflow object.
70
*/
71
MM_IncrementalOverflow(MM_EnvironmentBase *env, MM_WorkPackets *workPackets) :
72
MM_WorkPacketOverflow(env, workPackets),
73
_overflowList(NULL),
74
_overflowThisGCCycle(false)
75
{
76
_typeId = __FUNCTION__;
77
};
78
79
protected:
80
bool initialize(MM_EnvironmentBase *env);
81
void tearDown(MM_EnvironmentBase *env);
82
private:
83
void overflowItemInternal(MM_EnvironmentBase *env, void *item, MM_OverflowType type);
84
void push(MM_EnvironmentBase *env, MM_HeapRegionDescriptorRealtime *region);
85
void pushNoLock(MM_EnvironmentBase *env, MM_HeapRegionDescriptorRealtime *region);
86
MM_HeapRegionDescriptorRealtime *pop(MM_EnvironmentBase *env);
87
void pushLocal(MM_EnvironmentBase *env, MM_HeapRegionDescriptorRealtime *region, MM_OverflowType type);
88
void flushLocal(MM_EnvironmentBase *env, MM_OverflowType type);
89
};
90
91
#endif /* INCREMENTALOVERFLOW_HPP_ */
92
93