Skip to content

Commit

Permalink
temp commit - review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjtuttle committed Nov 30, 2023
1 parent 82ff59a commit a4b6106
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion compiler/codegen/CodeGenPrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/Inliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
const char *s = TR::Compiler->cls.classNameToSignature(_interfaceMethod->classNameChars(), len, _comp, stackAlloc);
TR_OpaqueClassBlock *result = _comp->fe()->getClassFromSignature(s, len, _callerResolvedMethod, true);

return result;
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/LocalOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/LoopVersioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2904,7 +2904,7 @@ bool TR_LoopVersioner::checkProfiledGuardSuitability(TR_ScratchList<TR::Block> *
TR::MethodSymbol *method = callSymRef->getSymbol()->castToMethodSymbol();
TR_ResolvedMethod *owningMethod = callSymRef->getOwningMethod(comp);
int32_t len = method->getMethod()->classNameLength();
char *s = TR::Compiler->cls.classNameToSignature(method->getMethod()->classNameChars(), len, comp);
const char *s = TR::Compiler->cls.classNameToSignature(method->getMethod()->classNameChars(), len, comp);
TR_OpaqueClassBlock *classOfMethod = comp->fe()->getClassFromSignature(s, len, owningMethod, true);
traceMsg(comp, "Found profiled gaurd %p is on interface %s\n", guardNode, TR::Compiler->cls.classNameChars(comp, classOfMethod, len));
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/optimizer/VPConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
4 changes: 2 additions & 2 deletions compiler/optimizer/ValuePropagationCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions compiler/p/codegen/PPCTableOfConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/ras/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion compiler/ras/Tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a4b6106

Please sign in to comment.