Path: blob/master/runtime/compiler/aarch64/codegen/ARM64AOTRelocation.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2019, 2019 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 ARM64AOTRELOCATION_INCL23#define ARM64AOTRELOCATION_INCL2425#include <stdint.h>26#include "codegen/Relocation.hpp"2728namespace TR { class CodeGenerator; }29namespace TR { class Instruction; }3031namespace TR {3233class ARM64Relocation34{35public:36TR_ALLOC(TR_Memory::ARM64Relocation)3738/**39* @brief Constructor40*/41ARM64Relocation(TR::Instruction *src,42uint8_t *trg,43TR_ExternalRelocationTargetKind k):44_srcInstruction(src), _relTarget(trg), _kind(k)45{}4647/**48* @brief Answers source instruction49* @return source instruction50*/51TR::Instruction *getSourceInstruction() { return _srcInstruction; }52/**53* @brief Sets source instruction54* @param[in] i : source instruction55*/56void setSourceInstruction(TR::Instruction *i) { _srcInstruction = i; }5758/**59* @brief Answers relocation target60* @return relocation target61*/62uint8_t *getRelocationTarget() { return _relTarget; }63/**64* @brief Sets relocation target65* @param[in] t : relocation target66*/67void setRelocationTarget(uint8_t *t) { _relTarget = t; }6869/**70* @brief Answers relocation target kind71* @return relocation target kind72*/73TR_ExternalRelocationTargetKind getKind() { return _kind; }74/**75* @brief Sets relocation target kind76* @param[in] k : relocation target kind77*/78void setKind(TR_ExternalRelocationTargetKind k) { _kind = k; }7980/**81* @brief Maps relocation82* @param[in] cg : CodeGenerator83*/84virtual void mapRelocation(TR::CodeGenerator *cg) = 0;8586private:87TR::Instruction *_srcInstruction;88uint8_t *_relTarget;89TR_ExternalRelocationTargetKind _kind;90};9192} // TR9394#endif959697