Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/p/codegen/J9CodeGenerator.hpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2022 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_POWER_CODEGENERATOR_INCL
24
#define J9_POWER_CODEGENERATOR_INCL
25
26
/*
27
* The following #define and typedef must appear before any #includes in this file
28
*/
29
#ifndef J9_CODEGENERATOR_CONNECTOR
30
#define J9_CODEGENERATOR_CONNECTOR
31
namespace J9 { namespace Power { class CodeGenerator; } }
32
namespace J9 { typedef J9::Power::CodeGenerator CodeGeneratorConnector; }
33
#else
34
#error J9::Power::CodeGenerator expected to be a primary connector, but a J9 connector is already defined
35
#endif
36
37
#include "j9cfg.h"
38
#include "compiler/codegen/J9CodeGenerator.hpp"
39
40
#include <stdint.h>
41
#include "codegen/LinkageConventionsEnum.hpp"
42
#include "env/jittypes.h"
43
44
namespace TR { class Recompilation; }
45
46
extern TR::Instruction *loadAddressRAM32(TR::CodeGenerator *cg,
47
TR::Node * node,
48
int32_t value,
49
TR::Register *trgReg);
50
51
extern TR::Instruction *loadAddressRAM(TR::CodeGenerator *cg,
52
TR::Node *node,
53
intptr_t value,
54
TR::Register *targetRegister);
55
56
extern TR::Instruction *loadAddressJNI32(TR::CodeGenerator *cg,
57
TR::Node * node,
58
int32_t value,
59
TR::Register *trgReg);
60
61
extern TR::Instruction *loadAddressJNI(TR::CodeGenerator *cg,
62
TR::Node *node,
63
intptr_t value,
64
TR::Register *targetRegister);
65
66
namespace J9
67
{
68
69
namespace Power
70
{
71
72
class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator
73
{
74
75
protected:
76
77
CodeGenerator(TR::Compilation *comp);
78
79
public:
80
81
void initialize();
82
83
TR::Recompilation *allocateRecompilationInfo();
84
85
TR::Linkage *createLinkage(TR_LinkageConventions lc);
86
87
void generateBinaryEncodingPrologue(TR_PPCBinaryEncodingData *data);
88
89
void lowerTreeIfNeeded(TR::Node *node, int32_t childNumber, TR::Node *parent, TR::TreeTop *tt);
90
91
bool inlineDirectCall(TR::Node *node, TR::Register *&resultReg);
92
93
TR::Linkage *deriveCallingLinkage(TR::Node *node, bool isIndirect);
94
95
bool suppressInliningOfRecognizedMethod(TR::RecognizedMethod method);
96
97
bool enableAESInHardwareTransformations();
98
99
void insertPrefetchIfNecessary(TR::Node *node, TR::Register *targetRegister);
100
101
int32_t getInternalPtrMapBit() { return 18;}
102
103
bool canEmitDataForExternallyRelocatableInstructions();
104
105
#ifdef J9VM_OPT_JAVA_CRYPTO_ACCELERATION
106
bool suppressInliningOfCryptoMethod(TR::RecognizedMethod method);
107
bool inlineCryptoMethod(TR::Node *node, TR::Register *&resultReg);
108
#endif
109
110
/**
111
* \brief Determines whether the code generator supports stack allocations
112
*/
113
bool supportsStackAllocations() { return true; }
114
115
// See J9::CodeGenerator::guaranteesResolvedDirectDispatchForSVM
116
bool guaranteesResolvedDirectDispatchForSVM() { return true; }
117
};
118
119
}
120
121
}
122
123
#endif
124
125