Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/aarch64/codegen/J9InstructionDelegate.hpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2019, 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 http://eclipse.org/legal/epl-2.0
7
* or the Apache License, Version 2.0 which accompanies this distribution
8
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following Secondary
11
* Licenses when the conditions for such availability set forth in the
12
* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
13
* version 2 with the GNU Classpath Exception [1] and GNU General Public
14
* License, version 2 with the OpenJDK Assembly Exception [2].
15
*
16
* [1] https://www.gnu.org/software/classpath/license.html
17
* [2] http://openjdk.java.net/legal/assembly-exception.html
18
*
19
* 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
20
*******************************************************************************/
21
22
#ifndef J9_ARM64_INSTRUCTIONDELEGATE_INCL
23
#define J9_ARM64_INSTRUCTIONDELEGATE_INCL
24
25
/*
26
* The following #define and typedef must appear before any #includes in this file
27
*/
28
#ifndef J9_INSTRUCTIONDELEGATE_CONNECTOR
29
#define J9_INSTRUCTIONDELEGATE_CONNECTOR
30
namespace J9 { namespace ARM64 { class InstructionDelegate; } }
31
namespace J9 { typedef J9::ARM64::InstructionDelegate InstructionDelegateConnector; }
32
#else
33
#error J9::ARM64::InstructionDelegate expected to be a primary connector, but a J9 connector is already defined
34
#endif
35
36
#include "compiler/codegen/J9InstructionDelegate.hpp"
37
#include "infra/Annotations.hpp"
38
39
namespace TR { class ARM64ImmSymInstruction; }
40
namespace TR { class ARM64Trg1MemInstruction; }
41
namespace TR { class ARM64MemInstruction; }
42
43
namespace J9
44
{
45
46
namespace ARM64
47
{
48
49
class OMR_EXTENSIBLE InstructionDelegate : public J9::InstructionDelegate
50
{
51
protected:
52
53
InstructionDelegate() {}
54
55
public:
56
57
/**
58
* @brief Sets the return address to CallSnippet for Label target
59
* @param[in] cg : CodeGenerator
60
* @param[in] ins : instruction associated with CallSnippet
61
* @param[in] cursor : instruction cursor
62
*/
63
static void encodeBranchToLabel(TR::CodeGenerator *cg, TR::ARM64ImmSymInstruction *ins, uint8_t *cursor);
64
65
/**
66
* @brief Determines if this instruction will throw an implicit null pointer exception and sets appropriate flags
67
* @param[in] cg : CodeGenerator
68
* @param[in] instr : instruction with memory reference
69
*/
70
static void setupImplicitNullPointerException(TR::CodeGenerator *cg, TR::ARM64Trg1MemInstruction *instr);
71
72
/**
73
* @brief Determines if this instruction will throw an implicit null pointer exception and sets appropriate flags
74
* @param[in] cg : CodeGenerator
75
* @param[in] instr : instruction with memory reference
76
*/
77
static void setupImplicitNullPointerException(TR::CodeGenerator *cg, TR::ARM64MemInstruction *instr);
78
79
};
80
81
}
82
83
}
84
85
#endif
86
87