Path: blob/master/runtime/compiler/p/codegen/J9TreeEvaluator.hpp
6004 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_PPC_TREE_EVALUATOR_INCL23#define J9_PPC_TREE_EVALUATOR_INCL2425/*26* The following #define and typedef must appear before any #includes in this file27*/28#ifndef J9_TREE_EVALUATOR_CONNECTOR29#define J9_TREE_EVALUATOR_CONNECTOR30namespace J9 { namespace Power { class TreeEvaluator; } }31namespace J9 { typedef J9::Power::TreeEvaluator TreeEvaluatorConnector; }32#else33#error J9::Power::TreeEvaluator expected to be a primary connector, but a J9 connector is already defined34#endif353637#include "compiler/codegen/J9TreeEvaluator.hpp" // include parent38#include "codegen/Snippet.hpp"3940namespace J941{4243namespace Power44{4546class OMR_EXTENSIBLE TreeEvaluator: public J9::TreeEvaluator47{48public:4950static TR::Register *fwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);51static TR::Register *fwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);52static TR::Register *awrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);53static TR::Register *awrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);54static TR::Register *dwrtbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);55static TR::Register *dwrtbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);56static TR::Register *monentEvaluator(TR::Node *node, TR::CodeGenerator *cg);57static TR::Register *monexitEvaluator(TR::Node *node, TR::CodeGenerator *cg);58static TR::Register *asynccheckEvaluator(TR::Node *node, TR::CodeGenerator *cg);59static TR::Register *instanceofEvaluator(TR::Node *node, TR::CodeGenerator *cg);60static TR::Register *checkcastEvaluator(TR::Node *node, TR::CodeGenerator *cg);61static TR::Register *checkcastAndNULLCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);62static TR::Register *newObjectEvaluator(TR::Node *node, TR::CodeGenerator *cg);63static TR::Register *newArrayEvaluator(TR::Node *node, TR::CodeGenerator *cg);64static TR::Register *anewArrayEvaluator(TR::Node *node, TR::CodeGenerator *cg);65static TR::Register *multianewArrayEvaluator(TR::Node *node, TR::CodeGenerator *cg);66static TR::Register *arraylengthEvaluator(TR::Node *node, TR::CodeGenerator *cg);67static TR::Register *DIVCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);68static TR::Register *BNDCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);69static TR::Register *ArrayCopyBNDCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);70static TR::Register *BNDCHKwithSpineCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);71static TR::Register *ArrayStoreCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);72static TR::Register *ArrayCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);73static TR::Register *conditionalHelperEvaluator(TR::Node *node, TR::CodeGenerator *cg);74static TR::Register *flushEvaluator(TR::Node *node, TR::CodeGenerator *cg);75static TR::Register *directCallEvaluator(TR::Node *node, TR::CodeGenerator *cg);7677static TR::Register *VMcheckcastEvaluator2(TR::Node *node, TR::CodeGenerator *cg);78static TR::Register *VMcheckcastEvaluator(TR::Node *node, TR::CodeGenerator *cg);79static TR::Register *VMinstanceOfEvaluator2(TR::Node *node, TR::CodeGenerator *cg);80static TR::Register *VMinstanceOfEvaluator(TR::Node *node, TR::CodeGenerator *cg);81static TR::Register *tstartEvaluator(TR::Node *node, TR::CodeGenerator *cg);82static TR::Register *tfinishEvaluator(TR::Node *node, TR::CodeGenerator *cg);83static TR::Register *tabortEvaluator(TR::Node *node, TR::CodeGenerator *cg);84static TR::Register *arraycopyEvaluator(TR::Node *node, TR::CodeGenerator *cg);85static TR::Register *irdbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);86static TR::Register *irdbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);87static TR::Register *ardbarEvaluator(TR::Node *node, TR::CodeGenerator *cg);88static TR::Register *ardbariEvaluator(TR::Node *node, TR::CodeGenerator *cg);8990static void generateCheckForValueMonitorEnterOrExit(TR::Node *node, TR::LabelSymbol *helperCallLabel, TR::Register *objReg, TR::Register *objectClassReg, TR::Register *temp1Reg, TR::Register *temp2Reg, TR::Register *condReg, TR::CodeGenerator *cg, int32_t classFlag);91static void restoreTOCRegister(TR::Node *node, TR::CodeGenerator *cg, TR::RegisterDependencyConditions *dependencies);92static void buildArgsProcessFEDependencies(TR::Node *node, TR::CodeGenerator *cg, TR::RegisterDependencyConditions *dependencies);93static TR::Register *retrieveTOCRegister(TR::Node *node, TR::CodeGenerator *cg, TR::RegisterDependencyConditions *dependencies);94static TR::Register *VMifInstanceOfEvaluator(TR::Node *node, TR::CodeGenerator *cg);95static TR::Register *ifInstanceOfEvaluator(TR::Node *node, TR::CodeGenerator *cg);96static void genArrayCopyWithArrayStoreCHK(TR::Node *node, TR::CodeGenerator *cg);97static void genWrtbarForArrayCopy(TR::Node *node, TR::Register *srcObjReg, TR::Register *dstObjReg, TR::CodeGenerator *cg);98static TR::Instruction *generateVFTMaskInstruction(TR::CodeGenerator *cg, TR::Node *node, TR::Register *dstReg, TR::Register *srcReg, TR::Instruction *preced=0);99static TR::Instruction *generateVFTMaskInstruction(TR::CodeGenerator *cg, TR::Node *node, TR::Register *reg, TR::Instruction *preced=0);100static TR::Register *VMgenCoreInstanceofEvaluator(TR::Node * node, TR::CodeGenerator * cg, bool isVMifInstanceOf, int32_t depIndex, int32_t numDep, TR::Node *depNode, bool needResult, bool needHelperCall, bool testEqualClass, bool testCache, bool testCastClassIsSuper, TR::LabelSymbol *doneLabel, TR::LabelSymbol *res0Label, TR::LabelSymbol *res1Label, bool branchOn1);101static TR::Register *VMmonentEvaluator(TR::Node *node, TR::CodeGenerator *cg);102static TR::Register *VMmonexitEvaluator(TR::Node *node, TR::CodeGenerator *cg);103static TR::Register *VMnewEvaluator(TR::Node *node, TR::CodeGenerator *cg);104static TR::Register *VMarrayCheckEvaluator(TR::Node *node, TR::CodeGenerator *cg);105106/*107* Generate instructions for static/instance field access report.108* @param dataSnippetRegister: Optional, can be used to pass the address of the snippet inside the register.109*/110static void generateTestAndReportFieldWatchInstructions(TR::CodeGenerator *cg, TR::Node *node, TR::Snippet *dataSnippet, bool isWrite, TR::Register *sideEffectRegister, TR::Register *valueReg, TR::Register *dataSnippetRegister);111/*112* Generates instructions to fill in the J9JITWatchedStaticFieldData.fieldAddress, J9JITWatchedStaticFieldData.fieldClass for static fields,113* and J9JITWatchedInstanceFieldData.offset for instance fields at runtime. Used for fieldwatch support.114* @param dataSnippetRegister: Optional, can be used to pass the address of the snippet inside the register.115*/116static void generateFillInDataBlockSequenceForUnresolvedField (TR::CodeGenerator *cg, TR::Node *node, TR::Snippet *dataSnippet, bool isWrite, TR::Register *sideEffectRegister, TR::Register *dataSnippetRegister);117static TR::Snippet * getFieldWatchInstanceSnippet(TR::CodeGenerator *cg, TR::Node *node, J9Method *m, UDATA loc, UDATA os);118static TR::Snippet * getFieldWatchStaticSnippet(TR::CodeGenerator *cg, TR::Node *node, J9Method *m, UDATA loc, void *fieldAddress, J9Class *fieldClass);119120static TR::Register *NULLCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);121static TR::Register *resolveAndNULLCHKEvaluator(TR::Node *node, TR::CodeGenerator *cg);122static TR::Register *evaluateNULLCHKWithPossibleResolve(TR::Node *node, bool needResolution, TR::CodeGenerator *cg);123};124}125126}127128#endif129130131