Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/compiler/x/codegen/MonitorSnippet.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 X86MONITORSNIPPET_INCL
24
#define X86MONITORSNIPPET_INCL
25
26
// Format of the monitor slot for tasuki locks is:
27
// Bit 0: Fat lock bit
28
// Bit 1: Reserved for FLC bit
29
// Bits 2-7: Nesting count
30
// Bits 8-31: Thread pointer or fat monitor id
31
//
32
#define INC_DEC_VALUE OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT
33
#define NON_INC_DEC_MASK ((~OBJECT_HEADER_LOCK_BITS_MASK) | OBJECT_HEADER_LOCK_INFLATED | OBJECT_HEADER_LOCK_FLC | OBJECT_HEADER_LOCK_RESERVED | OBJECT_HEADER_LOCK_LEARNING)
34
#define NON_INC_DEC_FLC_MASK ((~OBJECT_HEADER_LOCK_BITS_MASK) | OBJECT_HEADER_LOCK_INFLATED)
35
#define THREAD_PTR_MASK (~OBJECT_HEADER_LOCK_BITS_MASK)
36
#define MAX_INL_INC_DEC_MASK ((~OBJECT_HEADER_LOCK_BITS_MASK) | OBJECT_HEADER_LOCK_INFLATED | OBJECT_HEADER_LOCK_FLC | OBJECT_HEADER_LOCK_RESERVED | OBJECT_HEADER_LOCK_LEARNING | OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)
37
#define FLC_BIT OBJECT_HEADER_LOCK_FLC
38
#define RES_BIT OBJECT_HEADER_LOCK_RESERVED
39
#define RES_BIT_POSITION 2
40
#define REC_BIT OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT
41
#define FLAGS_MASK (OBJECT_HEADER_LOCK_INFLATED | OBJECT_HEADER_LOCK_FLC | OBJECT_HEADER_LOCK_RESERVED | OBJECT_HEADER_LOCK_LEARNING)
42
#define REC_MASK OBJECT_HEADER_LOCK_RECURSION_MASK
43
44
static_assert(RES_BIT == (1 << RES_BIT_POSITION), "RES_BIT_POSITION mismatch");
45
46
#endif
47
48