Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/z/codegen/S390AOTRelocation.hpp
6004 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 J9AOTRELOCATION_INCL
24
#define J9AOTRELOCATION_INCL
25
26
#include "codegen/Relocation.hpp"
27
28
#include "codegen/Instruction.hpp"
29
#include "runtime/Runtime.hpp"
30
31
namespace TR { class CodeGenerator; }
32
namespace TR { class Instruction; }
33
namespace TR { class LabelSymbol; }
34
35
namespace TR {
36
37
class S390Relocation
38
{
39
public:
40
TR_ALLOC(TR_Memory::S390Relocation)
41
42
S390Relocation(TR::Instruction *src,
43
uint8_t *trg,
44
TR_ExternalRelocationTargetKind k):
45
_srcInstruction(src), _relTarget(trg), _kind(k)
46
{}
47
48
TR::Instruction *getSourceInstruction() {return _srcInstruction;}
49
void setSourceInstruction(TR::Instruction *i) {_srcInstruction = i;}
50
51
uint8_t *getRelocationTarget() {return _relTarget;}
52
void setRelocationTarget(uint8_t *t) {_relTarget = t;}
53
54
TR_ExternalRelocationTargetKind getKind() {return _kind;}
55
void setKind(TR_ExternalRelocationTargetKind k) {_kind = k;}
56
57
virtual void mapRelocation(TR::CodeGenerator *cg) = 0;
58
59
private:
60
TR::Instruction *_srcInstruction;
61
uint8_t *_relTarget;
62
TR_ExternalRelocationTargetKind _kind;
63
};
64
65
class S390PairedRelocation: public TR::S390Relocation
66
{
67
public:
68
S390PairedRelocation(TR::Instruction *src1,
69
TR::Instruction *src2,
70
uint8_t *trg,
71
TR_ExternalRelocationTargetKind k) :
72
TR::S390Relocation(src1, trg, k), _src2Instruction(src2)
73
{}
74
75
TR::Instruction *getSource2Instruction() {return _src2Instruction;}
76
void setSource2Instruction(TR::Instruction *src) {_src2Instruction = src;}
77
78
virtual void mapRelocation(TR::CodeGenerator *cg);
79
80
private:
81
TR::Instruction *_src2Instruction;
82
};
83
84
class S390EncodingRelocation
85
{
86
public:
87
TR_ALLOC(TR_Memory::S390EncodingRelocation)
88
S390EncodingRelocation(TR_ExternalRelocationTargetKind rt,
89
TR::SymbolReference *sr,
90
uintptr_t inlinedSiteIndex = -1)
91
: _reloType(rt),
92
_symbolReference(sr),
93
_inlinedSiteIndex(inlinedSiteIndex) {}
94
95
TR_ExternalRelocationTargetKind _reloType;
96
TR::SymbolReference* _symbolReference;
97
uintptr_t _inlinedSiteIndex;
98
99
TR::SymbolReference* getSymbolReference() { return _symbolReference;}
100
TR::SymbolReference* setSymbolReference(TR::SymbolReference* sr)
101
{
102
return _symbolReference = sr;
103
}
104
105
TR_ExternalRelocationTargetKind getReloType() { return _reloType;}
106
TR_ExternalRelocationTargetKind setReloType(TR_ExternalRelocationTargetKind rt)
107
{
108
return _reloType = rt;
109
}
110
111
uintptr_t getInlinedSiteIndex() { return _inlinedSiteIndex;}
112
uintptr_t setInlinedSiteIndex(uintptr_t index)
113
{
114
return _inlinedSiteIndex = index;
115
}
116
117
virtual void addRelocation(TR::CodeGenerator *codeGen, uint8_t *cursor, char* file, uintptr_t line, TR::Node* node);
118
};
119
120
}
121
122
#endif
123
124