Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_base/ScavengerForwardedHeader.hpp
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2021 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
#if !defined(SCAVENGERFORWARDEDHEADER_HPP_)
24
#define SCAVENGERFORWARDEDHEADER_HPP_
25
26
#include "j9.h"
27
#include "j9cfg.h"
28
29
/* @ddr_namespace: map_to_type=MM_ScavengerForwardedHeader */
30
31
/* used to distinguish a forwarded object from a class pointer */
32
#define FORWARDED_TAG ((uintptr_t)0x4)
33
/* the grow tag is used by VLHGC and can only be set if the FORWARDED_TAG is already set. It signifies that the object grew a hash field when moving */
34
#define GROW_TAG ((uintptr_t)0x2)
35
/* combine these flags into one mask which should be stripped from the pointer in order to remove all tags */
36
#define ALL_TAGS (FORWARDED_TAG | GROW_TAG)
37
38
/**
39
* Used to construct a linked list of objects on the heap.
40
* This structure provides the ability to restore the object, so
41
* only data which can be restored from the class is destroyed.
42
* Because its fields must line up with J9Object no virtual methods
43
* are permitted.
44
*
45
* @ingroup GC_Base
46
*/
47
class MM_ScavengerForwardedHeader
48
{
49
public:
50
protected:
51
omrobjectptr_t _objectPtr; /**< the object on which to act */
52
uintptr_t _preserved; /**< a backup copy of the header fields which may be modified by this class */
53
#if defined(OMR_GC_COMPRESSED_POINTERS) && defined(OMR_GC_FULL_POINTERS)
54
bool _compressObjectReferences;
55
#endif /* defined(OMR_GC_COMPRESSED_POINTERS) && defined(OMR_GC_FULL_POINTERS) */
56
private:
57
};
58
#endif /* SCAVENGERFORWARDEDHEADER_HPP_ */
59
60