Path: blob/master/runtime/compiler/x/codegen/MonitorSnippet.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 2020 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*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-exception20*******************************************************************************/2122#ifndef X86MONITORSNIPPET_INCL23#define X86MONITORSNIPPET_INCL2425// Format of the monitor slot for tasuki locks is:26// Bit 0: Fat lock bit27// Bit 1: Reserved for FLC bit28// Bits 2-7: Nesting count29// Bits 8-31: Thread pointer or fat monitor id30//31#define INC_DEC_VALUE OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT32#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)33#define NON_INC_DEC_FLC_MASK ((~OBJECT_HEADER_LOCK_BITS_MASK) | OBJECT_HEADER_LOCK_INFLATED)34#define THREAD_PTR_MASK (~OBJECT_HEADER_LOCK_BITS_MASK)35#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)36#define FLC_BIT OBJECT_HEADER_LOCK_FLC37#define RES_BIT OBJECT_HEADER_LOCK_RESERVED38#define RES_BIT_POSITION 239#define REC_BIT OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT40#define FLAGS_MASK (OBJECT_HEADER_LOCK_INFLATED | OBJECT_HEADER_LOCK_FLC | OBJECT_HEADER_LOCK_RESERVED | OBJECT_HEADER_LOCK_LEARNING)41#define REC_MASK OBJECT_HEADER_LOCK_RECURSION_MASK4243static_assert(RES_BIT == (1 << RES_BIT_POSITION), "RES_BIT_POSITION mismatch");4445#endif464748