diff --git a/runtime/compiler/codegen/CodeGenGPU.cpp b/runtime/compiler/codegen/CodeGenGPU.cpp index 4eb02c8e373..18a93453b43 100644 --- a/runtime/compiler/codegen/CodeGenGPU.cpp +++ b/runtime/compiler/codegen/CodeGenGPU.cpp @@ -2082,7 +2082,7 @@ J9::CodeGenerator::findExtraParms( "can only access a field of this object\n"); // TODO: handle duplicate names from different classes - TR_SharedMemoryField field = sharedMemory->find(TR::comp(), node->getSymbolReference()); + TR_SharedMemoryField field = sharedMemory->find(self()->comp(), node->getSymbolReference()); if (field.getSize() == 0) numExtraParms++; @@ -2296,13 +2296,13 @@ J9::CodeGenerator::dumpNVVMIR( ir.print("\ndefine %s @test%d(", getTypeName(_gpuReturnType), gpuPtxCount); - CS2::ArrayOf gpuParameterMap(TR::comp()->allocator()); + CS2::ArrayOf gpuParameterMap(self()->comp()->allocator()); CS2::ArrayOf::Cursor ait(_gpuSymbolMap); for (ait.SetToFirst(); ait.Valid(); ait.SetToNext()) { if (!ait->_hostSymRef) continue; - traceMsg(TR::comp(), "hostSymRef #%d parmSlot %d\n", (int)ait, ait->_parmSlot); + traceMsg(self()->comp(), "hostSymRef #%d parmSlot %d\n", (int)ait, ait->_parmSlot); if (ait->_parmSlot != -1) { diff --git a/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp b/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp index a032f902978..1114f24ea3f 100644 --- a/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp +++ b/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp @@ -1413,7 +1413,7 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal uint8_t * J9::AheadOfTimeCompile::dumpRelocationHeaderData(uint8_t *cursor, bool isVerbose) { - TR::Compilation *comp = TR::comp(); + TR::Compilation *comp = self()->comp(); TR_RelocationRuntime *reloRuntime = comp->reloRuntime(); TR_RelocationTarget *reloTarget = reloRuntime->reloTarget(); diff --git a/runtime/compiler/optimizer/J9ValuePropagation.cpp b/runtime/compiler/optimizer/J9ValuePropagation.cpp index ede01a33826..b2e1170d9ee 100644 --- a/runtime/compiler/optimizer/J9ValuePropagation.cpp +++ b/runtime/compiler/optimizer/J9ValuePropagation.cpp @@ -696,7 +696,6 @@ J9::ValuePropagation::isValue(TR::VPConstraint *constraint, TR_OpaqueClassBlock return type->isFixedClass() ? TR_no : TR_maybe; } - TR::Compilation *comp = TR::comp(); clazz = type->getClass(); // No need to check array class type because array classes should be marked as having identity. @@ -707,7 +706,7 @@ J9::ValuePropagation::isValue(TR::VPConstraint *constraint, TR_OpaqueClassBlock // Is the type either an abstract class or an interface (i.e., not a // concrete class)? If so, it might be a value type. - if (!TR::Compiler->cls.isConcreteClass(comp, clazz)) + if (!TR::Compiler->cls.isConcreteClass(comp(), clazz)) { return TR_maybe; } diff --git a/runtime/compiler/optimizer/JProfilingValue.cpp b/runtime/compiler/optimizer/JProfilingValue.cpp index 286496cf982..45d6e19c20b 100644 --- a/runtime/compiler/optimizer/JProfilingValue.cpp +++ b/runtime/compiler/optimizer/JProfilingValue.cpp @@ -940,9 +940,9 @@ TR_JProfilingValue::incrementMemory(TR::Compilation *comp, TR::DataType counterT * \param value Value to store in const. */ TR::Node * -TR_JProfilingValue::systemConst(TR::Node *example, uint64_t value) +TR_JProfilingValue::systemConst(TR::Compilation *comp, TR::Node *example, uint64_t value) { - TR::ILOpCodes constOp = TR::comp()->target().is64Bit() ? TR::lconst : TR::iconst; + TR::ILOpCodes constOp = comp->target().is64Bit() ? TR::lconst : TR::iconst; return TR::Node::create(example, constOp, 0, value); } diff --git a/runtime/compiler/optimizer/JProfilingValue.hpp b/runtime/compiler/optimizer/JProfilingValue.hpp index 0a4355bf6f7..46f0d08a8a3 100644 --- a/runtime/compiler/optimizer/JProfilingValue.hpp +++ b/runtime/compiler/optimizer/JProfilingValue.hpp @@ -56,18 +56,18 @@ class TR_JProfilingValue : public TR::Optimization void cleanUpAndAddProfilingCandidates(); /** * Examines node to identify profiling candidate and add place holder calls for profiling it. - * This routine checks node and it's children for mainly two type of nodes. + * This routine checks node and it's children for mainly two type of nodes. * 1. Virtual Call * 2. instanceOf/checkcast/checkcastAndNULLCHK * In these case, it adds placeholder call to profiler the VFT Pointer. - * + * * @param node to examine for profiling candidate * @param cursor A TreeTop Pointer containing the node * @param alreadyProfiledValues A BitVector containing information about already profiled nodes in Extended Basic Blocks * @param checklist A Node checklist to make sure while recursively examining node, we do not examine node multiple times. */ void performOnNode(TR::Node *node, TR::TreeTop *cursor, TR_BitVector *alreadyProfiledValues, TR::NodeChecklist *checklist); - + static bool addProfilingTrees( TR::Compilation *comp, TR::TreeTop *insertionPoint, @@ -76,7 +76,7 @@ class TR_JProfilingValue : public TR::Optimization bool addNullCheck = false, bool extendBlocks = true, bool trace = false); - + private: static TR::Node *computeHash(TR::Compilation *comp, TR_AbstractHashTableProfilerInfo *table, TR::Node *value, TR::Node *baseAddr); @@ -94,7 +94,7 @@ class TR_JProfilingValue : public TR::Optimization static TR::Node *incrementMemory(TR::Compilation *comp, TR::DataType counterType, TR::Node *address); static TR::Node *copyGlRegDeps(TR::Compilation *comp, TR::Node *origGlRegDeps); static TR::Node *effectiveAddress(TR::DataType dataType, TR::Node *base, TR::Node *index = NULL, TR::Node *offset = NULL); - static TR::Node *systemConst(TR::Node *example, uint64_t value); + static TR::Node *systemConst(TR::Compilation *comp, TR::Node *example, uint64_t value); static TR::Node *convertType(TR::Node *index, TR::DataType dataType, bool zeroExtend = true); }; diff --git a/runtime/compiler/x/codegen/J9TreeEvaluator.cpp b/runtime/compiler/x/codegen/J9TreeEvaluator.cpp index d26ae4b9b9f..53834c9b505 100644 --- a/runtime/compiler/x/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/x/codegen/J9TreeEvaluator.cpp @@ -2738,9 +2738,8 @@ TR::Register *J9::X86::TreeEvaluator::ZEROCHKEvaluator(TR::Node *node, TR::CodeG } -bool isConditionCodeSetForCompare(TR::Node *node, bool *jumpOnOppositeCondition) +bool isConditionCodeSetForCompare(TR::Node *node, bool *jumpOnOppositeCondition, TR::Compilation *comp) { - TR::Compilation *comp = TR::comp(); // Disable. Need to re-think how we handle overflow cases. // static char *disableNoCompareEFlags = feGetEnv("TR_disableNoCompareEFlags"); @@ -2870,7 +2869,7 @@ TR::Register *J9::X86::TreeEvaluator::BNDCHKEvaluator(TR::Node *node, TR::CodeGe } else { - if (!isConditionCodeSetForCompare(node, &jumpOnOppositeCondition)) + if (!isConditionCodeSetForCompare(node, &jumpOnOppositeCondition, cg->comp())) { node->swapChildren(); TR::TreeEvaluator::compareIntegersForOrder(node, cg); @@ -2883,7 +2882,7 @@ TR::Register *J9::X86::TreeEvaluator::BNDCHKEvaluator(TR::Node *node, TR::CodeGe } else { - if (!isConditionCodeSetForCompare(node, &jumpOnOppositeCondition)) + if (!isConditionCodeSetForCompare(node, &jumpOnOppositeCondition, cg->comp())) { TR::TreeEvaluator::compareIntegersForOrder(node, cg); instr = generateLabelInstruction(TR::InstOpCode::JBE4, node, boundCheckFailureLabel, cg); diff --git a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp index 2af9369469f..86c68cb35c1 100644 --- a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp @@ -10453,7 +10453,7 @@ genHeapAlloc(TR::Node * node, TR::Instruction *& iCursor, bool isVariableLen, TR TR::Register * addressReg = srm->findOrCreateScratchRegister(); iCursor = generateRRInstruction(cg, TR::InstOpCode::getLoadRegOpCode(), node, addressReg, resReg, iCursor); - if (TR::comp()->target().is64Bit()) + if (comp->target().is64Bit()) { iCursor = generateRSInstruction(cg, TR::InstOpCode::SRAG, node, loopIterRegsiter, lengthReg, 8, iCursor); } @@ -14853,4 +14853,4 @@ J9::Z::TreeEvaluator::inlineOnSpinWait(TR::Node *node, TR::CodeGenerator *cg) // Check omr/include_core/AtomicSupport.hpp for the JNI implementation. TR::Instruction* cursor = new (cg->trHeapMemory()) TR::S390NOPInstruction(TR::InstOpCode::NOP, 2, node, cg); return NULL; - } \ No newline at end of file + }