Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_base/PacketSlotIterator.hpp
5985 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2014 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_Base
26
*/
27
28
#if !defined(PacketSlotIterator_HPP_)
29
#define PacketSlotIterator_HPP_
30
31
#include "BaseNonVirtual.hpp"
32
#include "Packet.hpp"
33
34
/**
35
* @todo Provide class documentation
36
* @ingroup GC_Base
37
*/
38
class MM_PacketSlotIterator: public MM_BaseNonVirtual
39
{
40
private:
41
MM_Packet *_packet; /**< Packet being iterated */
42
J9Object **_nextSlot; /**< Next slot in the packet to be returned */
43
44
public:
45
/**
46
* @return The next slot in the packet or NULL if the end of the packet has been reached (no slots pointing at NULL or array split tags will be returned)
47
*/
48
J9Object **nextSlot();
49
50
/**
51
* Resets the split tag for correspondingObject to refer to a zero index which will force mark to completely rescan this array when
52
* it next sees it.
53
* Can only be called immediately after a slot containing correspondingObject is returned and allows updating of the corresponding
54
* array split tag.
55
* Note that this has no effect if the split tag would have been outside of the packet (since that implies that there isn't one)
56
* or if there was no split tag for this object. An assertion failure will be generated if correspondingObject does not match.
57
* @param correspondingObject[in] The object which will be sanity checked against the previous returned object to ensure a match
58
* @param newValue the data to store in the tag slot. It is the caller's responsibility to ensure that this is appropriately tagged.
59
*/
60
void resetSplitTagIndexForObject(J9Object *correspondingObject, UDATA newValue);
61
62
/**
63
* Create a PacketSlotIterator object.
64
*/
65
MM_PacketSlotIterator(MM_Packet *packet)
66
: MM_BaseNonVirtual()
67
, _packet(packet)
68
, _nextSlot((J9Object **)packet->_basePtr)
69
{
70
_typeId = __FUNCTION__;
71
}
72
};
73
#endif /* PacketSlotIterator_HPP_*/
74
75