Path: blob/master/runtime/gc_base/PacketSlotIterator.hpp
5985 views
/*******************************************************************************1* Copyright (c) 1991, 2014 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122/**23* @file24* @ingroup GC_Base25*/2627#if !defined(PacketSlotIterator_HPP_)28#define PacketSlotIterator_HPP_2930#include "BaseNonVirtual.hpp"31#include "Packet.hpp"3233/**34* @todo Provide class documentation35* @ingroup GC_Base36*/37class MM_PacketSlotIterator: public MM_BaseNonVirtual38{39private:40MM_Packet *_packet; /**< Packet being iterated */41J9Object **_nextSlot; /**< Next slot in the packet to be returned */4243public:44/**45* @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)46*/47J9Object **nextSlot();4849/**50* Resets the split tag for correspondingObject to refer to a zero index which will force mark to completely rescan this array when51* it next sees it.52* Can only be called immediately after a slot containing correspondingObject is returned and allows updating of the corresponding53* array split tag.54* 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)55* or if there was no split tag for this object. An assertion failure will be generated if correspondingObject does not match.56* @param correspondingObject[in] The object which will be sanity checked against the previous returned object to ensure a match57* @param newValue the data to store in the tag slot. It is the caller's responsibility to ensure that this is appropriately tagged.58*/59void resetSplitTagIndexForObject(J9Object *correspondingObject, UDATA newValue);6061/**62* Create a PacketSlotIterator object.63*/64MM_PacketSlotIterator(MM_Packet *packet)65: MM_BaseNonVirtual()66, _packet(packet)67, _nextSlot((J9Object **)packet->_basePtr)68{69_typeId = __FUNCTION__;70}71};72#endif /* PacketSlotIterator_HPP_*/737475