Path: blob/master/runtime/compiler/il/J9SymbolReference.hpp
6000 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 J9_SYMBOLREFERENCE_INCL23#define J9_SYMBOLREFERENCE_INCL2425/*26* The following #define and typedef must appear before any #includes in this file27*/28#ifndef J9_SYMBOLREFERENCE_CONNECTOR29#define J9_SYMBOLREFERENCE_CONNECTOR30namespace J9 { class SymbolReference; }31namespace J9 { typedef J9::SymbolReference SymbolReferenceConnector; }32#endif3334#include "il/OMRSymbolReference.hpp"3536#include <stdint.h>37#include "compile/SymbolReferenceTable.hpp"38#include "env/KnownObjectTable.hpp"39#include "env/jittypes.h"40#include "infra/Annotations.hpp"4142class mcount_t;43namespace TR { class Symbol; }4445namespace J946{4748class OMR_EXTENSIBLE SymbolReference : public OMR::SymbolReferenceConnector49{5051public:5253SymbolReference(TR::SymbolReferenceTable * symRefTab) :54OMR::SymbolReferenceConnector(symRefTab) {}5556SymbolReference(TR::SymbolReferenceTable * symRefTab,57TR::Symbol * symbol,58intptr_t offset = 0) :59OMR::SymbolReferenceConnector(symRefTab,60symbol,61offset) {}6263SymbolReference(TR::SymbolReferenceTable * symRefTab,64int32_t refNumber,65TR::Symbol *ps,66intptr_t offset = 0) :67OMR::SymbolReferenceConnector(symRefTab,68refNumber,69ps,70offset) {}7172SymbolReference(TR::SymbolReferenceTable *symRefTab,73TR::SymbolReferenceTable::CommonNonhelperSymbol number,74TR::Symbol *ps,75intptr_t offset = 0) :76OMR::SymbolReferenceConnector(symRefTab,77number,78ps,79offset) {}8081SymbolReference(TR::SymbolReferenceTable *symRefTab,82TR::Symbol *sym,83mcount_t owningMethodIndex,84int32_t cpIndex,85int32_t unresolvedIndex = 0,86TR::KnownObjectTable::Index knownObjectIndex = TR::KnownObjectTable::UNKNOWN);8788SymbolReference(TR::SymbolReferenceTable *symRefTab,89TR::SymbolReference& sr,90intptr_t offset,91TR::KnownObjectTable::Index knownObjectIndex = TR::KnownObjectTable::UNKNOWN) :92OMR::SymbolReferenceConnector(symRefTab,93sr,94offset,95knownObjectIndex) {}9697uint32_t getCPIndexForVM();9899bool isClassArray(TR::Compilation * c);100bool isClassFinal(TR::Compilation * c);101bool isClassAbstract(TR::Compilation * c);102bool isClassInterface(TR::Compilation * c);103104bool isNonArrayFinal(TR::Compilation * c);105int32_t classDepth(TR::Compilation * c);106107/**108* Return the signature of the symbol's type if applicable. Note, the109* signature's storage may have been created on the stack!110*/111const char *getTypeSignature(int32_t & len, TR_AllocationKind = stackAlloc, bool *isFixed = NULL);112113protected:114115SymbolReference(TR::SymbolReferenceTable * symRefTab,116TR::Symbol * symbol,117intptr_t offset,118const char * name) :119OMR::SymbolReferenceConnector(symRefTab,120symbol,121offset,122name) {}123124};125126127char * prependNumParensToSig(const char *, int32_t & len, int32_t, TR_AllocationKind = stackAlloc);128129}130131#endif132133134