diff --git a/compiler/codegen/CodeGenPrep.cpp b/compiler/codegen/CodeGenPrep.cpp index 444721df67d..5be23312363 100644 --- a/compiler/codegen/CodeGenPrep.cpp +++ b/compiler/codegen/CodeGenPrep.cpp @@ -806,7 +806,7 @@ OMR::CodeGenerator::insertDebugCounters() else { int32_t length; - char *className = TR::Compiler->cls.classNameChars(self()->comp(), (TR_OpaqueClassBlock*)classChild->getSymbol()->castToStaticSymbol()->getStaticAddress(), length); + const char *className = TR::Compiler->cls.classNameChars(self()->comp(), (TR_OpaqueClassBlock*)classChild->getSymbol()->castToStaticSymbol()->getStaticAddress(), length); TR::DebugCounter::prependDebugCounter(self()->comp(), TR::DebugCounter::debugCounterName(self()->comp(), "allocations/%s/(%.*s)", opName, length, className ), tt); diff --git a/compiler/codegen/OMRCodeGenPhase.cpp b/compiler/codegen/OMRCodeGenPhase.cpp index 6d266ecf1d0..8bf2997ba2d 100644 --- a/compiler/codegen/OMRCodeGenPhase.cpp +++ b/compiler/codegen/OMRCodeGenPhase.cpp @@ -214,11 +214,11 @@ OMR::CodeGenPhase::performProcessRelocationsPhase(TR::CodeGenerator * cg, TR::Co { if (cg->comp()->target().is64Bit()) { - setDllSlip((char*)cg->getCodeStart(), (char*)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL64", comp); + setDllSlip((const char *)cg->getCodeStart(), (const char *)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL64", comp); } else { - setDllSlip((char*)cg->getCodeStart(), (char*)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL31", comp); + setDllSlip((const char *)cg->getCodeStart(), (const char *)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL31", comp); } } diff --git a/compiler/env/FEBase.cpp b/compiler/env/FEBase.cpp index 9fb9fd6c545..a2a45a18ac3 100644 --- a/compiler/env/FEBase.cpp +++ b/compiler/env/FEBase.cpp @@ -136,7 +136,7 @@ TR::OptionTable OMR::Options::_feOptions[] = // S390 specific fucntion - FIXME: make this only be a problem when HOST is s390. Also, use a better // name for this -void setDllSlip(char*CodeStart,char*CodeEnd,char*dllName, TR::Compilation *comp) { TR_UNIMPLEMENTED(); } +void setDllSlip(const char *CodeStart, const char *CodeEnd, const char *dllName, TR::Compilation *comp) { TR_UNIMPLEMENTED(); } // runtime assumptions #ifdef J9_PROJECT_SPECIFIC @@ -146,7 +146,7 @@ void TR::PatchNOPedGuardSite::compensate(TR_FrontEnd *fe, bool isSMP, uint8_t *l void TR_PersistentClassInfo::removeASubClass(TR_PersistentClassInfo *) { TR_UNIMPLEMENTED(); } bool isOrderedPair(uint8_t recordType) { TR_UNIMPLEMENTED(); return false; } void OMR::RuntimeAssumption::addToRAT(TR_PersistentMemory * persistentMemory, TR_RuntimeAssumptionKind kind, TR_FrontEnd *fe, OMR::RuntimeAssumption** sentinel) { TR_UNIMPLEMENTED(); } -void OMR::RuntimeAssumption::dumpInfo(char *subclassName) { TR_UNIMPLEMENTED(); } +void OMR::RuntimeAssumption::dumpInfo(const char *subclassName) { TR_UNIMPLEMENTED(); } void TR_PatchJNICallSite::compensate(TR_FrontEnd*, bool, void *) { TR_UNIMPLEMENTED(); } void TR_PreXRecompile::compensate(TR_FrontEnd*, bool, void *) { TR_UNIMPLEMENTED(); } TR_PatchNOPedGuardSiteOnClassPreInitialize *TR_PatchNOPedGuardSiteOnClassPreInitialize::make(TR_FrontEnd *fe, TR_PersistentMemory *, char*, unsigned int, unsigned char*, unsigned char*, OMR::RuntimeAssumption**) { TR_UNIMPLEMENTED(); return 0; } diff --git a/compiler/env/FrontEnd.cpp b/compiler/env/FrontEnd.cpp index f16737f4561..a30bd18ac30 100644 --- a/compiler/env/FrontEnd.cpp +++ b/compiler/env/FrontEnd.cpp @@ -158,7 +158,7 @@ TR_FrontEnd::getFormattedName( TR_OpaqueMethodBlock* -TR_FrontEnd::getMethodFromName(char * className, char *methodName, char *signature) +TR_FrontEnd::getMethodFromName(const char *className, const char *methodName, const char *signature) { TR_UNIMPLEMENTED(); return 0; diff --git a/compiler/env/FrontEnd.hpp b/compiler/env/FrontEnd.hpp index f4d298c5590..1c2731a82ef 100644 --- a/compiler/env/FrontEnd.hpp +++ b/compiler/env/FrontEnd.hpp @@ -112,7 +112,7 @@ class TR_FrontEnd : private TR::Uncopyable virtual TR_ResolvedMethod * createResolvedMethod(TR_Memory *, TR_OpaqueMethodBlock *, TR_ResolvedMethod * = 0, TR_OpaqueClassBlock * = 0); virtual OMR::MethodMetaDataPOD *createMethodMetaData(TR::Compilation *comp) { return NULL; } - virtual TR_OpaqueMethodBlock * getMethodFromName(char * className, char *methodName, char *signature); + virtual TR_OpaqueMethodBlock * getMethodFromName(const char *className, const char *methodName, const char *signature); virtual uint32_t offsetOfIsOverriddenBit(); // Needs VMThread diff --git a/compiler/env/OMRClassEnv.cpp b/compiler/env/OMRClassEnv.cpp index 3ec185b1e07..e9a898da381 100644 --- a/compiler/env/OMRClassEnv.cpp +++ b/compiler/env/OMRClassEnv.cpp @@ -33,23 +33,23 @@ OMR::ClassEnv::self() return static_cast(this); } -char * -OMR::ClassEnv::classNameChars(TR::Compilation *comp, TR::SymbolReference *symRef, int32_t & len) +const char * +OMR::ClassEnv::classNameChars(TR::Compilation *comp, TR::SymbolReference *symRef, int32_t &len) { - char *name = ""; + const char *name = ""; len = static_cast(strlen(name)); return name; } uintptr_t -OMR::ClassEnv::getArrayElementWidthInBytes(TR::Compilation *comp, TR_OpaqueClassBlock* arrayClass) +OMR::ClassEnv::getArrayElementWidthInBytes(TR::Compilation *comp, TR_OpaqueClassBlock *arrayClass) { TR_UNIMPLEMENTED(); return 0; } intptr_t -OMR::ClassEnv::getVFTEntry(TR::Compilation *comp, TR_OpaqueClassBlock* clazz, int32_t offset) +OMR::ClassEnv::getVFTEntry(TR::Compilation *comp, TR_OpaqueClassBlock *clazz, int32_t offset) { // There is no project-agnostic way to determine whether or not offset is a // valid VFT offset for clazz, so return 0 to be safe. If offset were valid, diff --git a/compiler/env/OMRClassEnv.hpp b/compiler/env/OMRClassEnv.hpp index 75f54e2b9eb..a6d1937c76c 100644 --- a/compiler/env/OMRClassEnv.hpp +++ b/compiler/env/OMRClassEnv.hpp @@ -156,8 +156,8 @@ class OMR_EXTENSIBLE ClassEnv int32_t flagValueForArrayCheck(TR::Compilation *comp) { return 0; } int32_t flagValueForFinalizerCheck(TR::Compilation *comp) { return 0; } - char *classNameChars(TR::Compilation *, TR::SymbolReference *symRef, int32_t & length); - char *classNameChars(TR::Compilation *, TR_OpaqueClassBlock * clazz, int32_t & length) { return NULL; } + const char *classNameChars(TR::Compilation *, TR::SymbolReference *symRef, int32_t &length); + const char *classNameChars(TR::Compilation *, TR_OpaqueClassBlock *clazz, int32_t &length) { return NULL; } char *classSignature_DEPRECATED(TR::Compilation *comp, TR_OpaqueClassBlock * clazz, int32_t & length, TR_Memory *) { return NULL; } char *classSignature(TR::Compilation *comp, TR_OpaqueClassBlock * clazz, TR_Memory *) { return NULL; } diff --git a/compiler/optimizer/Inliner.cpp b/compiler/optimizer/Inliner.cpp index d453a6cc6f9..11556845a81 100644 --- a/compiler/optimizer/Inliner.cpp +++ b/compiler/optimizer/Inliner.cpp @@ -5729,7 +5729,7 @@ TR_CallSite::calleeClass() TR::StackMemoryRegion stackMemoryRegion(*_comp->trMemory()); int32_t len = _interfaceMethod->classNameLength(); - char * s = TR::Compiler->cls.classNameToSignature(_interfaceMethod->classNameChars(), len, _comp, stackAlloc); + char *s = TR::Compiler->cls.classNameToSignature(_interfaceMethod->classNameChars(), len, _comp, stackAlloc); TR_OpaqueClassBlock *result = _comp->fe()->getClassFromSignature(s, len, _callerResolvedMethod, true); return result; diff --git a/compiler/optimizer/LocalOpts.cpp b/compiler/optimizer/LocalOpts.cpp index 635142c21f5..fcc1e36f14e 100644 --- a/compiler/optimizer/LocalOpts.cpp +++ b/compiler/optimizer/LocalOpts.cpp @@ -8680,7 +8680,7 @@ TR_ColdBlockMarker::hasNotYetRun(TR::Node *node) node->getOpCodeValue() == TR::loadaddr) { int32_t len; - char *name = TR::Compiler->cls.classNameChars(comp(), node->getSymbolReference(), len); + const char *name = TR::Compiler->cls.classNameChars(comp(), node->getSymbolReference(), len); if (name) { TR::HeuristicRegion heuristicRegion(comp()); diff --git a/compiler/optimizer/VPConstraint.cpp b/compiler/optimizer/VPConstraint.cpp index 3698c5ad963..a3e5229eafb 100644 --- a/compiler/optimizer/VPConstraint.cpp +++ b/compiler/optimizer/VPConstraint.cpp @@ -1247,7 +1247,7 @@ TR::VPClassType *TR::VPClassType::create(OMR::ValuePropagation *vp, TR::SymbolRe } int32_t len; - char *name = TR::Compiler->cls.classNameChars(vp->comp(), symRef, len); + const char *name = TR::Compiler->cls.classNameChars(vp->comp(), symRef, len); TR_ASSERT(name, "can't get class name from symbol reference"); char *sig = TR::Compiler->cls.classNameToSignature(name, len, vp->comp()); //return TR::VPUnresolvedClass::create(vp, sig, len, symRef->getOwningMethod(vp->comp())); diff --git a/compiler/optimizer/ValuePropagationCommon.cpp b/compiler/optimizer/ValuePropagationCommon.cpp index 3edf3e9a9fb..e8ed7ca9463 100644 --- a/compiler/optimizer/ValuePropagationCommon.cpp +++ b/compiler/optimizer/ValuePropagationCommon.cpp @@ -3908,7 +3908,7 @@ void OMR::ValuePropagation::transformObjectCloneCall(TR::TreeTop *callTree, OMR: TR::DebugCounter::prependDebugCounter(comp(), TR::DebugCounter::debugCounterName(comp(), "inlineClone.location/object/(%s)", comp()->signature()), callTree); int32_t classNameLength; - char *className = TR::Compiler->cls.classNameChars(comp(), j9class, classNameLength); + const char *className = TR::Compiler->cls.classNameChars(comp(), j9class, classNameLength); TR::DebugCounter::prependDebugCounter(comp(), TR::DebugCounter::debugCounterName(comp(), "inlineClone.type/(%s)/(%s)/%s", className, comp()->signature(), comp()->getHotnessName(comp()->getMethodHotness())), callTree); // Preserve children for callNode @@ -4031,7 +4031,7 @@ void OMR::ValuePropagation::transformArrayCloneCall(TR::TreeTop *callTree, OMR:: TR::DebugCounter::prependDebugCounter(comp(), TR::DebugCounter::debugCounterName(comp(), "inlineClone.location/array/(%s)", comp()->signature()), callTree); int32_t classNameLength; - char *className = TR::Compiler->cls.classNameChars(comp(), j9arrayClass, classNameLength); + const char *className = TR::Compiler->cls.classNameChars(comp(), j9arrayClass, classNameLength); TR::DebugCounter::prependDebugCounter(comp(), TR::DebugCounter::debugCounterName(comp(), "inlineClone.type/(%s)/(%s)/%s", className, comp()->signature(), comp()->getHotnessName(comp()->getMethodHotness())), callTree); TR::Node *lenNode = TR::Node::create(callNode, TR::arraylength, 1, objNode); // Preserve children for callNode diff --git a/compiler/p/codegen/PPCTableOfConstants.cpp b/compiler/p/codegen/PPCTableOfConstants.cpp index c280ecf634a..81798c04773 100644 --- a/compiler/p/codegen/PPCTableOfConstants.cpp +++ b/compiler/p/codegen/PPCTableOfConstants.cpp @@ -525,7 +525,7 @@ int32_t TR_PPCTableOfConstants::lookUp(TR::SymbolReference *symRef, TR::CodeGene if (sym->isClassObject()) { - int8_t *className; + const char *className; if (sym->addressIsCPIndexOfStatic()) { struct TR_tocHashEntry st2cEntry; @@ -541,16 +541,16 @@ int32_t TR_PPCTableOfConstants::lookUp(TR::SymbolReference *symRef, TR::CodeGene } else { - className = (int8_t *)TR::Compiler->cls.classNameChars(comp, symRef, nlen); + className = TR::Compiler->cls.classNameChars(comp, symRef, nlen); } - TR_ASSERT(className!=NULL, "Class object name is expected"); + TR_ASSERT(className != NULL, "Class object name is expected"); if (nlen >= 1024) { name = (int8_t *)cg->trMemory()->allocateHeapMemory(nlen+1); } - strncpy((char *)name, (char *)className, nlen); + strncpy((char *)name, className, nlen); name[nlen] = 0; } else diff --git a/compiler/ras/Debug.cpp b/compiler/ras/Debug.cpp index 891be089d15..f81aaad23fd 100644 --- a/compiler/ras/Debug.cpp +++ b/compiler/ras/Debug.cpp @@ -1915,7 +1915,7 @@ TR_Debug::getStaticName(TR::SymbolReference * symRef) if (!sym->addressIsCPIndexOfStatic() && staticAddress) { int32_t len; - char * name = TR::Compiler->cls.classNameChars(comp(), symRef, len); + const char *name = TR::Compiler->cls.classNameChars(comp(), symRef, len); if (name) { char * s = (char *)_comp->trMemory()->allocateHeapMemory(len+1); @@ -3624,7 +3624,7 @@ TR_Debug::dump(TR::FILE *pOutFile, TR_CHTable * chTable) TR_OpaqueClassBlock * clazz = chTable->_classes->element(i); int32_t len; - char *sig = TR::Compiler->cls.classNameChars(comp(), clazz, len); + const char *sig = TR::Compiler->cls.classNameChars(comp(), clazz, len); if (len>255) len = 255; strncpy(buf, sig, len); diff --git a/compiler/ras/Tree.cpp b/compiler/ras/Tree.cpp index e7a4273187d..05712e207d2 100644 --- a/compiler/ras/Tree.cpp +++ b/compiler/ras/Tree.cpp @@ -250,7 +250,7 @@ TR_Debug::printLoadConst(TR::Node *node, TR_PrettyPrinterString& output) if (node->isClassPointerConstant()) { TR_OpaqueClassBlock *clazz = (TR_OpaqueClassBlock*)node->getAddress(); - int32_t len; char *sig = TR::Compiler->cls.classNameChars(_comp, clazz, len); + int32_t len; const char *sig = TR::Compiler->cls.classNameChars(_comp, clazz, len); if (clazz) { if (TR::Compiler->cls.isInterfaceClass(_comp, clazz)) diff --git a/compiler/runtime/Runtime.hpp b/compiler/runtime/Runtime.hpp index 2b875327508..4dd85162a4d 100644 --- a/compiler/runtime/Runtime.hpp +++ b/compiler/runtime/Runtime.hpp @@ -41,7 +41,7 @@ void s390zLinux64CodeCacheParameters(int32_t *, void **, int32_t *, int32_t*); uint32_t getPPCCacheLineSize(); -extern void setDllSlip(char* codeStart,char* codeEnd,char* dllName, TR::Compilation *); +extern void setDllSlip(const char *codeStart, const char *codeEnd, const char *dllName, TR::Compilation *); void initializeJitRuntimeHelperTable(char jvmpi);