Path: blob/master/runtime/compiler/z/codegen/J9S390Snippet.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 2016 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 J9S390SNIPPET_INCL23#define J9S390SNIPPET_INCL2425#include "codegen/Snippet.hpp"26#include "z/codegen/S390HelperCallSnippet.hpp"27#include "codegen/CodeGenerator.hpp"28#include "env/IO.hpp"2930#define LOCK_INC_DEC_VALUE OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT31#define LOCK_THREAD_PTR_MASK (~OBJECT_HEADER_LOCK_BITS_MASK)32#define LOCK_THREAD_PTR_AND_UPPER_COUNT_BIT_MASK (LOCK_THREAD_PTR_MASK | OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)33#define LOCK_FIRST_RECURSION_BIT_NUMBER leadingZeroes(OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT)34#define LOCK_LAST_RECURSION_BIT_NUMBER leadingZeroes(OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)35#define LOCK_OWNING_NON_INFLATED_COMPLEMENT (OBJECT_HEADER_LOCK_BITS_MASK & ~OBJECT_HEADER_LOCK_INFLATED)36#define LOCK_RESERVATION_BIT OBJECT_HEADER_LOCK_RESERVED37#define LOCK_RES_PRIMITIVE_ENTER_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK | OBJECT_HEADER_LOCK_FLC)38#define LOCK_RES_PRIMITIVE_EXIT_MASK (OBJECT_HEADER_LOCK_BITS_MASK & ~OBJECT_HEADER_LOCK_RECURSION_MASK)39#define LOCK_RES_NON_PRIMITIVE_ENTER_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)40#define LOCK_RES_NON_PRIMITIVE_EXIT_MASK (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT)41#define LOCK_RES_OWNING_COMPLEMENT (OBJECT_HEADER_LOCK_RECURSION_MASK | OBJECT_HEADER_LOCK_FLC)42#define LOCK_RES_PRESERVE_ENTER_COMPLEMENT (OBJECT_HEADER_LOCK_RECURSION_MASK & ~OBJECT_HEADER_LOCK_LAST_RECURSION_BIT)43#define LOCK_RES_CONTENDED_VALUE (OBJECT_HEADER_LOCK_FIRST_RECURSION_BIT|OBJECT_HEADER_LOCK_RESERVED|OBJECT_HEADER_LOCK_FLC)4445namespace TR {4647class S390HeapAllocSnippet : public TR::Snippet48{49TR::LabelSymbol *_restartLabel;50TR::SymbolReference *_destination;51uint16_t _length;52bool _isLongBranch;535455public:5657S390HeapAllocSnippet(TR::CodeGenerator *codeGen,58TR::Node *node,59TR::LabelSymbol *callLabel,60TR::SymbolReference *destination,61TR::LabelSymbol *restartLabel);626364virtual Kind getKind() { return IsHeapAlloc; }6566virtual uint8_t *emitSnippetBody();6768virtual uint32_t getLength(int32_t estimatedSnippetStart);6970virtual void print(TR::FILE *, TR_Debug *debug);7172TR::LabelSymbol *getRestartLabel() { return _restartLabel; }73TR::SymbolReference *getDestination() {return _destination;}7475bool isLongBranch() {return _isLongBranch;}76void setIsLongBranch(bool b) {_isLongBranch = b;}7778uint32_t getMyLength() {return _length;}79void setMyLength(uint32_t l) {_length = (uint16_t)l;}80};8182}8384#endif858687