Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/arm/codegen/J9ARMSnippet.hpp
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2000, 2016 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 J9ARMSNIPPET_INCL
24
#define J9ARMSNIPPET_INCL
25
26
#include "codegen/Snippet.hpp"
27
#include "j9cfg.h"
28
#include "codegen/ARMHelperCallSnippet.hpp"
29
#include "env/IO.hpp"
30
31
#define LOCK_INC_DEC_VALUE OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT
32
#define LOCK_THREAD_PTR_MASK (~OBJECT_HEADER_LOCK_BITS_MASK)
33
#define LOCK_THREAD_PTR_AND_UPPER_COUNT_BIT_MASK (LOCK_THREAD_PTR_MASK | OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)
34
#define LOCK_OWNING_NON_INFLATED_COMPLEMENT (OBJECT_HEADER_LOCK_BITS_MASK & ~OBJECT_HEADER_LOCK_INFLATED)
35
#define LOCK_RESERVATION_BIT OBJECT_HEADER_LOCK_RESERVED
36
#define LOCK_RES_PRIMITIVE_ENTER_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK | OBJECT_HEADER_LOCK_FLC)
37
#define LOCK_RES_PRIMITIVE_EXIT_MASK (OBJECT_HEADER_LOCK_BITS_MASK & ~OBJECT_HEADER_LOCK_RECURSION_MASK)
38
#define LOCK_RES_NON_PRIMITIVE_ENTER_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)
39
#define LOCK_RES_NON_PRIMITIVE_EXIT_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT)
40
#define LOCK_RES_OWNING_COMPLEMENT (OBJECT_HEADER_LOCK_RECURSION_MASK | OBJECT_HEADER_LOCK_FLC)
41
#define LOCK_RES_PRESERVE_ENTER_COMPLEMENT (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)
42
#define LOCK_RES_CONTENDED_VALUE (OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT|OBJECT_HEADER_LOCK_RESERVED|OBJECT_HEADER_LOCK_FLC)
43
44
namespace TR {
45
46
class ARMMonitorEnterSnippet : public TR::ARMHelperCallSnippet
47
{
48
TR::LabelSymbol *_incLabel;
49
int32_t _lwOffset;
50
//bool _isReservationPreserving;
51
52
public:
53
54
ARMMonitorEnterSnippet(TR::CodeGenerator *codeGen,
55
TR::Node *monitorNode,
56
int32_t lwOffset,
57
//bool isPreserving,
58
TR::LabelSymbol *incLabel,
59
TR::LabelSymbol *callLabel,
60
TR::LabelSymbol *restartLabel);
61
62
virtual Kind getKind() { return IsMonitorEnter; }
63
64
virtual uint8_t *emitSnippetBody();
65
virtual void print(TR::FILE *, TR_Debug *);
66
virtual uint32_t getLength(int32_t estimatedSnippetStart);
67
68
virtual int32_t setEstimatedCodeLocation(int32_t p);
69
70
TR::LabelSymbol * getIncLabel() { return _incLabel; };
71
int32_t getLockWordOffset() { return _lwOffset; }
72
//bool isReservationPreserving() { return _isReservationPreserving; }
73
};
74
75
class ARMMonitorExitSnippet : public TR::ARMHelperCallSnippet
76
{
77
TR::LabelSymbol *_decLabel;
78
//TR::LabelSymbol *_restoreAndCallLabel;
79
int32_t _lwOffset;
80
//bool _isReservationPreserving;
81
//bool _isReadOnly;
82
83
public:
84
85
ARMMonitorExitSnippet(TR::CodeGenerator *codeGen,
86
TR::Node *monitorNode,
87
int32_t lwOffset,
88
//bool flag,
89
//bool isPreserving,
90
TR::LabelSymbol *decLabel,
91
//TR::LabelSymbol *restoreAndCallLabel,
92
TR::LabelSymbol *callLabel,
93
TR::LabelSymbol *restartLabel);
94
95
virtual Kind getKind() { return IsMonitorExit; }
96
97
virtual uint8_t *emitSnippetBody();
98
virtual void print(TR::FILE *, TR_Debug *);
99
virtual uint32_t getLength(int32_t estimatedSnippetStart);
100
101
virtual int32_t setEstimatedCodeLocation(int32_t p);
102
103
TR::LabelSymbol * getDecLabel() { return _decLabel; }
104
//TR::LabelSymbol * getRestoreAndCallLabel() { return _restoreAndCallLabel; }
105
int32_t getLockWordOffset() { return _lwOffset; }
106
//bool isReservationPreserving() { return _isReservationPreserving; }
107
};
108
109
}
110
111
#endif
112
113
114