Path: blob/master/runtime/compiler/il/J9StaticSymbol_inlines.hpp
6000 views
/*******************************************************************************1* Copyright (c) 2017, 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*******************************************************************************/21222324#ifndef J9_STATICSYMBOL_INLINES_INCL25#define J9_STATICSYMBOL_INLINES_INCL2627/**28* If OMRStaticInlines gets created, be sure to include here29*/3031#include <stddef.h>32#include "env/TRMemory.hpp"33#include "il/J9StaticSymbol.hpp"34#include "il/LabelSymbol.hpp"35#include "il/Symbol.hpp"363738inline void39J9::StaticSymbol::makeMethodTypeTableEntry(int32_t methodTypeIndex)40{41TR_ASSERT(self()->getDataType() == TR::Address, "MethodTypeTableEntries have historically had TR::Address as data type");42_methodTypeIndex = methodTypeIndex;43self()->setMethodTypeTableEntry();44}4546inline void47J9::StaticSymbol::makeCallSiteTableEntry(int32_t callSiteIndex)48{49TR_ASSERT(self()->getDataType() == TR::Address, "CallSiteTableEntries have historically had TR::Address as data type");50_callSiteIndex = callSiteIndex;51self()->setCallSiteTableEntry();52}535455inline int32_t56J9::StaticSymbol::getCallSiteIndex()57{58TR_ASSERT(self()->isCallSiteTableEntry(), "Must have called makeCallSiteTableEntry to have a valid callSiteIndex!");59return _callSiteIndex;60}6162inline void63J9::StaticSymbol::makeConstantDynamic(char * classSignature, int32_t classSignatureLength, bool isPrimitive)64{65TR_ASSERT(self()->getDataType() == TR::Address, "ConstantDynamic should have TR::Address as data type");66_classSignature = classSignature;67_classSignatureLength = classSignatureLength;68_isPrimitive = isPrimitive;69}7071inline char *72J9::StaticSymbol::getConstantDynamicClassSignature(int32_t & classSignatureLength)73{74classSignatureLength = _classSignatureLength;75return _classSignature;76}7778inline bool79J9::StaticSymbol::isConstantDynamicPrimitive()80{81return _isPrimitive;82}8384inline TR::Symbol::RecognizedField85J9::StaticSymbol::getRecognizedField()86{87if (self()->isRecognizedStatic())88return _recognizedField;89else90return TR::Symbol::UnknownField;91}929394inline int32_t95J9::StaticSymbol::getMethodTypeIndex()96{97TR_ASSERT(self()->isMethodTypeTableEntry(), "Must have called makeMethodTypeTableEntry() to have a valid MethodTypeIndex()");98return _methodTypeIndex;99}100101#endif102103104