Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/il/J9SymbolReference.hpp
6000 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2020 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 J9_SYMBOLREFERENCE_INCL
24
#define J9_SYMBOLREFERENCE_INCL
25
26
/*
27
* The following #define and typedef must appear before any #includes in this file
28
*/
29
#ifndef J9_SYMBOLREFERENCE_CONNECTOR
30
#define J9_SYMBOLREFERENCE_CONNECTOR
31
namespace J9 { class SymbolReference; }
32
namespace J9 { typedef J9::SymbolReference SymbolReferenceConnector; }
33
#endif
34
35
#include "il/OMRSymbolReference.hpp"
36
37
#include <stdint.h>
38
#include "compile/SymbolReferenceTable.hpp"
39
#include "env/KnownObjectTable.hpp"
40
#include "env/jittypes.h"
41
#include "infra/Annotations.hpp"
42
43
class mcount_t;
44
namespace TR { class Symbol; }
45
46
namespace J9
47
{
48
49
class OMR_EXTENSIBLE SymbolReference : public OMR::SymbolReferenceConnector
50
{
51
52
public:
53
54
SymbolReference(TR::SymbolReferenceTable * symRefTab) :
55
OMR::SymbolReferenceConnector(symRefTab) {}
56
57
SymbolReference(TR::SymbolReferenceTable * symRefTab,
58
TR::Symbol * symbol,
59
intptr_t offset = 0) :
60
OMR::SymbolReferenceConnector(symRefTab,
61
symbol,
62
offset) {}
63
64
SymbolReference(TR::SymbolReferenceTable * symRefTab,
65
int32_t refNumber,
66
TR::Symbol *ps,
67
intptr_t offset = 0) :
68
OMR::SymbolReferenceConnector(symRefTab,
69
refNumber,
70
ps,
71
offset) {}
72
73
SymbolReference(TR::SymbolReferenceTable *symRefTab,
74
TR::SymbolReferenceTable::CommonNonhelperSymbol number,
75
TR::Symbol *ps,
76
intptr_t offset = 0) :
77
OMR::SymbolReferenceConnector(symRefTab,
78
number,
79
ps,
80
offset) {}
81
82
SymbolReference(TR::SymbolReferenceTable *symRefTab,
83
TR::Symbol *sym,
84
mcount_t owningMethodIndex,
85
int32_t cpIndex,
86
int32_t unresolvedIndex = 0,
87
TR::KnownObjectTable::Index knownObjectIndex = TR::KnownObjectTable::UNKNOWN);
88
89
SymbolReference(TR::SymbolReferenceTable *symRefTab,
90
TR::SymbolReference& sr,
91
intptr_t offset,
92
TR::KnownObjectTable::Index knownObjectIndex = TR::KnownObjectTable::UNKNOWN) :
93
OMR::SymbolReferenceConnector(symRefTab,
94
sr,
95
offset,
96
knownObjectIndex) {}
97
98
uint32_t getCPIndexForVM();
99
100
bool isClassArray(TR::Compilation * c);
101
bool isClassFinal(TR::Compilation * c);
102
bool isClassAbstract(TR::Compilation * c);
103
bool isClassInterface(TR::Compilation * c);
104
105
bool isNonArrayFinal(TR::Compilation * c);
106
int32_t classDepth(TR::Compilation * c);
107
108
/**
109
* Return the signature of the symbol's type if applicable. Note, the
110
* signature's storage may have been created on the stack!
111
*/
112
const char *getTypeSignature(int32_t & len, TR_AllocationKind = stackAlloc, bool *isFixed = NULL);
113
114
protected:
115
116
SymbolReference(TR::SymbolReferenceTable * symRefTab,
117
TR::Symbol * symbol,
118
intptr_t offset,
119
const char * name) :
120
OMR::SymbolReferenceConnector(symRefTab,
121
symbol,
122
offset,
123
name) {}
124
125
};
126
127
128
char * prependNumParensToSig(const char *, int32_t & len, int32_t, TR_AllocationKind = stackAlloc);
129
130
}
131
132
#endif
133
134