Path: blob/master/runtime/compiler/x/codegen/J9CodeGenerator.hpp
6004 views
/*******************************************************************************1* Copyright (c) 2000, 2022 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_X86_CODEGENERATOR_INCL23#define J9_X86_CODEGENERATOR_INCL2425#include "compiler/codegen/J9CodeGenerator.hpp"2627namespace TR { class Recompilation; }2829namespace J930{3132namespace X8633{3435class OMR_EXTENSIBLE CodeGenerator : public J9::CodeGenerator36{3738protected:3940CodeGenerator(TR::Compilation *comp);4142public:4344void initialize();4546TR::Recompilation *allocateRecompilationInfo();4748void beginInstructionSelection();4950void endInstructionSelection();5152TR::Instruction *generateSwitchToInterpreterPrePrologue(53TR::Instruction *prev,54uint8_t alignment,55uint8_t alignmentMargin);5657// Stack frame padding58int32_t getStackFramePaddingSizeInBytes() {return _stackFramePaddingSizeInBytes;}59int32_t setStackFramePaddingSizeInBytes(int32_t s) {return (_stackFramePaddingSizeInBytes = s);}60int32_t _stackFramePaddingSizeInBytes;6162bool nopsAlsoProcessedByRelocations();6364#ifdef J9VM_OPT_JAVA_CRYPTO_ACCELERATION65bool inlineCryptoMethod(TR::Node *node, TR::Register *&resultReg);66#endif6768bool enableAESInHardwareTransformations();6970bool suppressInliningOfRecognizedMethod(TR::RecognizedMethod method);7172/** \brief73* Determines whether the code generator supports inlining of java/lang/Class.isAssignableFrom74*/75bool supportsInliningOfIsAssignableFrom();7677/*78* \brief Reserve space in the code cache for a specified number of trampolines.79* This is useful for inline caches where the methods are not yet known at80* compile-time but for which trampolines may be required for compiled81* bodies in the future.82*83* \param[in] numTrampolines : number of trampolines to reserve84*85* \return : none86*/87void reserveNTrampolines(int32_t numTrampolines);8889/**90* \brief Determines whether the code generator supports stack allocations91*/92bool supportsStackAllocations() { return true; }93/** \brief94* Determines whether to insert instructions to check DF flag and break on DF set95*/96bool canEmitBreakOnDFSet();9798// See J9::CodeGenerator::guaranteesResolvedDirectDispatchForSVM99bool guaranteesResolvedDirectDispatchForSVM() { return true; }100101// See J9::CodeGenerator::guaranteesResolvedVirtualDispatchForSVM102bool guaranteesResolvedVirtualDispatchForSVM() { return true; }103};104105}106107}108109#endif110111112