Path: blob/master/runtime/compiler/aarch64/codegen/J9ARM64Snippet.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2019, 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 J9ARM64SNIPPET_INCL23#define J9ARM64SNIPPET_INCL2425#include "codegen/Snippet.hpp"26#include "codegen/ARM64HelperCallSnippet.hpp"27#include "j9cfg.h"2829#define LOCK_INC_DEC_VALUE OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT3031namespace TR {3233class ARM64MonitorEnterSnippet : public TR::ARM64HelperCallSnippet34{35TR::LabelSymbol *_incLabel;3637public:3839/**40* @brief Constructor41*/42ARM64MonitorEnterSnippet(TR::CodeGenerator *codeGen,43TR::Node *monitorNode,44TR::LabelSymbol *incLabel,45TR::LabelSymbol *callLabel,46TR::LabelSymbol *restartLabel);4748/**49* @brief Answers the Snippet kind50* @return Snippet kind51*/52virtual Kind getKind() { return IsMonitorEnter; }5354/**55* @brief Emits the Snippet body56* @return instruction cursor57*/58virtual uint8_t *emitSnippetBody();5960/**61* @brief Prints the Snippet62*/63virtual void print(TR::FILE *, TR_Debug *);6465/**66* @brief Answers the Snippet length67* @return Snippet length68*/69virtual uint32_t getLength(int32_t estimatedSnippetStart);7071/**72* @brief Sets estimated binary location73* @return estimated binary location74*/75virtual int32_t setEstimatedCodeLocation(int32_t p);7677/**78* @brief Answers the incLabel79* @return incLabel80*/81TR::LabelSymbol *getIncLabel() { return _incLabel; };82};8384class ARM64MonitorExitSnippet : public TR::ARM64HelperCallSnippet85{86TR::LabelSymbol *_decLabel;8788public:8990/**91* @brief Constructor92*/93ARM64MonitorExitSnippet(TR::CodeGenerator *codeGen,94TR::Node *monitorNode,95TR::LabelSymbol *decLabel,96TR::LabelSymbol *callLabel,97TR::LabelSymbol *restartLabel);9899/**100* @brief Answers the Snippet kind101* @return Snippet kind102*/103virtual Kind getKind() { return IsMonitorExit; }104105/**106* @brief Emits the Snippet body107* @return instruction cursor108*/109virtual uint8_t *emitSnippetBody();110111/**112* @brief Prints the Snippet113*/114virtual void print(TR::FILE *, TR_Debug *);115116/**117* @brief Answers the Snippet length118* @return Snippet length119*/120virtual uint32_t getLength(int32_t estimatedSnippetStart);121122/**123* @brief Sets estimated binary location124* @return estimated binary location125*/126virtual int32_t setEstimatedCodeLocation(int32_t p);127128/**129* @brief Answers the decLabel130* @return decLabel131*/132TR::LabelSymbol *getDecLabel() { return _decLabel; }133};134}135136#endif137138139