Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/compile/AOTClassInfo.hpp
6000 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 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 TR_AOTCLASSINFO_INCL
24
#define TR_AOTCLASSINFO_INCL
25
26
#include "env/FrontEnd.hpp"
27
#include "runtime/J9Runtime.hpp"
28
#include "env/jittypes.h"
29
#include "env/VMJ9.h"
30
31
class AOTCacheClassChainRecord;
32
33
34
// AOTClassInfo is a structure used to record assumptions on classes made by the
35
// current compilation. There are two types of validations: ones based on a
36
// constant pool entry, and ones that are not (could be recognized method where
37
// we don't have the cp info or could be based on profile data)
38
//
39
// TR_ValidateClass, TR_ValidateStaticField, TR_ValidateInstanceField are all
40
// based on a constant pool entry
41
//
42
// TR_ValidateArbitraryClass is not based on a constant pool entry
43
//
44
// First class of validation has _cpIndex >= 0, second class has _cpIndex == -1
45
//
46
47
namespace TR
48
{
49
50
class AOTClassInfo
51
{
52
public:
53
54
TR_ALLOC(TR_Memory::AOTClassInfo)
55
56
AOTClassInfo(
57
TR_FrontEnd *fe,
58
TR_OpaqueClassBlock *clazz,
59
void *classChain,
60
TR_OpaqueMethodBlock *method,
61
uint32_t cpIndex,
62
TR_ExternalRelocationTargetKind reloKind,
63
const AOTCacheClassChainRecord *aotCacheClassChainRecord = NULL
64
) :
65
_clazz(clazz),
66
_classChain(classChain),
67
_method(method),
68
_constantPool((void *) ((TR_J9VMBase *)fe)->getConstantPoolFromMethod(method)),
69
_cpIndex(cpIndex),
70
_reloKind(reloKind)
71
{
72
#if defined(J9VM_OPT_JITSERVER)
73
TR_ASSERT(!aotCacheClassChainRecord || (fe->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER),
74
"Must always be NULL at JIT client");
75
_aotCacheClassChainRecord = aotCacheClassChainRecord;
76
#endif /* defined(J9VM_OPT_JITSERVER) */
77
}
78
79
#if defined(J9VM_OPT_JITSERVER)
80
const AOTCacheClassChainRecord *getAOTCacheClassChainRecord() { return _aotCacheClassChainRecord; }
81
#else /* defined(J9VM_OPT_JITSERVER) */
82
const AOTCacheClassChainRecord *getAOTCacheClassChainRecord() { return NULL; }
83
#endif /* defined(J9VM_OPT_JITSERVER) */
84
85
TR_ExternalRelocationTargetKind _reloKind; // identifies validation needed (instance field, static field, class, arbitrary class)
86
uint32_t _cpIndex; // cpindex identifying the cp entry if known otherwise -1
87
TR_OpaqueMethodBlock *_method; // inlined method owning the cp entry or to which assumption is attached
88
// _method must be compiled method or some method in the inlined site table
89
void *_constantPool; // constant pool owning the cp entry, initialized based on _method
90
TR_OpaqueClassBlock *_clazz; // class on which assumption is formed
91
void *_classChain; // class chain for clazz: captures the assumption
92
// == NULL for TR_ValidateStaticField validations
93
#if defined(J9VM_OPT_JITSERVER)
94
const AOTCacheClassChainRecord *_aotCacheClassChainRecord; // NULL at JITServer if compiled method won't be cached
95
// Always NULL at JIT client
96
#endif /* defined(J9VM_OPT_JITSERVER) */
97
};
98
99
}
100
101
#endif
102
103