Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_glue_java/CompactSchemeFixupObject.hpp
5985 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
#ifndef COMPACTSCHEMEOBJECTFIXUP_HPP_
24
#define COMPACTSCHEMEOBJECTFIXUP_HPP_
25
26
#include "j9cfg.h"
27
#include "objectdescription.h"
28
29
#include "CompactScheme.hpp"
30
#include "GCExtensions.hpp"
31
32
class MM_CompactSchemeFixupObject {
33
public:
34
protected:
35
private:
36
OMR_VM *_omrVM;
37
MM_GCExtensions *_extensions;
38
MM_CompactScheme *_compactScheme;
39
public:
40
41
/**
42
* Perform fixup for a single object
43
* @param env[in] the current thread
44
* @param objectPtr pointer to object for fixup
45
*/
46
void fixupObject(MM_EnvironmentStandard *env, omrobjectptr_t objectPtr);
47
48
static void verifyForwardingPtr(omrobjectptr_t objectPtr, omrobjectptr_t forwardingPtr);
49
50
MM_CompactSchemeFixupObject(MM_EnvironmentBase* env, MM_CompactScheme *compactScheme) :
51
_omrVM(env->getOmrVM()),
52
_extensions(MM_GCExtensions::getExtensions(env)),
53
_compactScheme(compactScheme)
54
{}
55
56
protected:
57
private:
58
/**
59
* Perform fixup for a mixed object
60
* @param objectPtr pointer to object for fixup
61
*/
62
void fixupMixedObject(omrobjectptr_t objectPtr);
63
64
/**
65
* Perform fixup for an array object
66
* @param objectPtr pointer to object for fixup
67
*/
68
void fixupArrayObject(omrobjectptr_t objectPtr);
69
70
/**
71
* Perform fixup for a flattened array object
72
* @param objectPtr pointer to object for fixup
73
*/
74
void fixupFlattenedArrayObject(omrobjectptr_t objectPtr);
75
76
/**
77
* Called whenever a ownable synchronizer object is fixed up during compact. Places the object on the thread-specific buffer of gc work thread.
78
* @param env -- current thread environment
79
* @param object -- The object of type or subclass of java.util.concurrent.locks.AbstractOwnableSynchronizer.
80
*/
81
MMINLINE void addOwnableSynchronizerObjectInList(MM_EnvironmentBase *env, omrobjectptr_t objectPtr);
82
};
83
84
#endif /* COMPACTSCHEMEOBJECTFIXUP_HPP_ */
85
86