Path: blob/master/runtime/compiler/p/codegen/PPCJNILinkage.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 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 PPC_JNILINKAGE_INCL23#define PPC_JNILINKAGE_INCL2425#include "codegen/PPCPrivateLinkage.hpp"2627#include "codegen/Linkage.hpp"28#include "infra/Assert.hpp"2930extern "C"31{32unsigned int crc32_oneByte(unsigned int crc, unsigned int b);33unsigned int crc32_no_vpmsum(unsigned int crc, unsigned char *p, unsigned long len);34unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p, unsigned long len);35}3637class TR_BitVector;38namespace TR { class AutomaticSymbol; }39namespace TR { class CodeGenerator; }40namespace TR { class MemoryReference; }41namespace TR { class Node; }42namespace TR { class ParameterSymbol; }43namespace TR { class RegisterDependencyConditions; }44namespace TR { class ResolvedMethodSymbol; }4546namespace J947{4849namespace Power50{5152class JNILinkage : public PrivateLinkage53{54protected:55TR::PPCLinkageProperties _properties;5657public:58JNILinkage(TR::CodeGenerator *cg);5960void releaseVMAccess(TR::Node* callNode, TR::RegisterDependencyConditions* deps, TR::RealRegister* metaReg, TR::Register* zeroReg, TR::Register* tempReg1, TR::Register* tempReg2);61void acquireVMAccess(TR::Node* callNode, TR::RegisterDependencyConditions* deps, TR::RealRegister* metaReg, TR::Register* tempReg0, TR::Register* tempReg1, TR::Register* tempReg2);62#ifdef J9VM_INTERP_ATOMIC_FREE_JNI63void releaseVMAccessAtomicFree(TR::Node* callNode, TR::RegisterDependencyConditions* deps, TR::RealRegister* metaReg, TR::Register* cr0Reg, TR::Register* tempReg1, TR::Register* tempReg2);64void acquireVMAccessAtomicFree(TR::Node* callNode, TR::RegisterDependencyConditions* deps, TR::RealRegister* metaReg, TR::Register* cr0Reg, TR::Register* tempReg1, TR::Register* tempReg2);65#endif /* J9VM_INTERP_ATOMIC_FREE_JNI */6667virtual int32_t buildJNIArgs(TR::Node *callNode,68TR::RegisterDependencyConditions *dependencies,69const TR::PPCLinkageProperties &properties,70bool isFastJNI = true,71bool passReceiver = true,72bool implicitEnvArg = true);7374TR::Register *pushJNIReferenceArg(TR::Node *child);7576virtual TR::Register *buildDirectDispatch(TR::Node *callNode);77virtual int32_t buildArgs( TR::Node *callNode,78TR::RegisterDependencyConditions *dependencies,79const TR::PPCLinkageProperties &properties);8081virtual TR::Register *buildIndirectDispatch(TR::Node *callNode);82virtual void buildVirtualDispatch( TR::Node *callNode,83TR::RegisterDependencyConditions *dependencies,84uint32_t sizeOfArguments);8586virtual const TR::PPCLinkageProperties& getProperties();87};8889}9091}9293#endif //PPC_JNILINKAGE_INCL949596