Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/x/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_X86_CODEGENERATOR_INCL
24
#define J9_X86_CODEGENERATOR_INCL
25
26
#include "compiler/codegen/J9CodeGenerator.hpp"
27
28
namespace TR { class Recompilation; }
29
30
namespace J9
31
{
32
33
namespace X86
34
{
35
36
class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator
37
{
38
39
protected:
40
41
CodeGenerator(TR::Compilation *comp);
42
43
public:
44
45
void initialize();
46
47
TR::Recompilation *allocateRecompilationInfo();
48
49
void beginInstructionSelection();
50
51
void endInstructionSelection();
52
53
TR::Instruction *generateSwitchToInterpreterPrePrologue(
54
TR::Instruction *prev,
55
uint8_t alignment,
56
uint8_t alignmentMargin);
57
58
// Stack frame padding
59
int32_t getStackFramePaddingSizeInBytes() {return _stackFramePaddingSizeInBytes;}
60
int32_t setStackFramePaddingSizeInBytes(int32_t s) {return (_stackFramePaddingSizeInBytes = s);}
61
int32_t _stackFramePaddingSizeInBytes;
62
63
bool nopsAlsoProcessedByRelocations();
64
65
#ifdef J9VM_OPT_JAVA_CRYPTO_ACCELERATION
66
bool inlineCryptoMethod(TR::Node *node, TR::Register *&resultReg);
67
#endif
68
69
bool enableAESInHardwareTransformations();
70
71
bool suppressInliningOfRecognizedMethod(TR::RecognizedMethod method);
72
73
/** \brief
74
* Determines whether the code generator supports inlining of java/lang/Class.isAssignableFrom
75
*/
76
bool supportsInliningOfIsAssignableFrom();
77
78
/*
79
* \brief Reserve space in the code cache for a specified number of trampolines.
80
* This is useful for inline caches where the methods are not yet known at
81
* compile-time but for which trampolines may be required for compiled
82
* bodies in the future.
83
*
84
* \param[in] numTrampolines : number of trampolines to reserve
85
*
86
* \return : none
87
*/
88
void reserveNTrampolines(int32_t numTrampolines);
89
90
/**
91
* \brief Determines whether the code generator supports stack allocations
92
*/
93
bool supportsStackAllocations() { return true; }
94
/** \brief
95
* Determines whether to insert instructions to check DF flag and break on DF set
96
*/
97
bool canEmitBreakOnDFSet();
98
99
// See J9::CodeGenerator::guaranteesResolvedDirectDispatchForSVM
100
bool guaranteesResolvedDirectDispatchForSVM() { return true; }
101
102
// See J9::CodeGenerator::guaranteesResolvedVirtualDispatchForSVM
103
bool guaranteesResolvedVirtualDispatchForSVM() { return true; }
104
};
105
106
}
107
108
}
109
110
#endif
111
112