Skip to content

Commit

Permalink
Fix string literal conversion warnings in runtime/compiler/compile
Browse files Browse the repository at this point in the history
Fix string literal conversion warnings in runtime/compiler/compile

Signed-off-by: Dylan Tuttle <[email protected]>
  • Loading branch information
dylanjtuttle committed Nov 22, 2023
1 parent bf43aec commit c748ee3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
56 changes: 28 additions & 28 deletions runtime/compiler/compile/J9Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ J9::Compilation::isConverterMethod(TR::RecognizedMethod rm)
case TR::sun_nio_cs_UTF_16_Encoder_encodeUTF16Little:
return true;
default:
return false;
return false;
}

return false;
Expand Down Expand Up @@ -1526,33 +1526,33 @@ J9::Compilation::notYetRunMeansCold()
self()->getOptions()->getInitialBCount() :
self()->getOptions()->getInitialCount();

switch (currentMethod->getRecognizedMethod())
{
case TR::com_ibm_jit_DecimalFormatHelper_formatAsDouble:
case TR::com_ibm_jit_DecimalFormatHelper_formatAsFloat:
initialCount = 0;
break;
default:
break;
}

if (currentMethod->containingClass() == self()->getStringClassPointer())
{
if (currentMethod->isConstructor())
{
char *sig = currentMethod->signatureChars();
if (!strncmp(sig, "([CIIII)", 8) ||
!strncmp(sig, "([CIICII)", 9) ||
!strncmp(sig, "(II[C)", 6))
initialCount = 0;
}
else
{
char *sig = "isRepeatedCharCacheHit";
if (strncmp(currentMethod->nameChars(), sig, strlen(sig)) == 0)
initialCount = 0;
}
}
switch (currentMethod->getRecognizedMethod())
{
case TR::com_ibm_jit_DecimalFormatHelper_formatAsDouble:
case TR::com_ibm_jit_DecimalFormatHelper_formatAsFloat:
initialCount = 0;
break;
default:
break;
}

if (currentMethod->containingClass() == self()->getStringClassPointer())
{
if (currentMethod->isConstructor())
{
const char *sig = currentMethod->signatureChars();
if (!strncmp(sig, "([CIIII)", 8) ||
!strncmp(sig, "([CIICII)", 9) ||
!strncmp(sig, "(II[C)", 6))
initialCount = 0;
}
else
{
const char *sig = "isRepeatedCharCacheHit";
if (strncmp(currentMethod->nameChars(), sig, strlen(sig)) == 0)
initialCount = 0;
}
}

if (
self()->isDLT()
Expand Down
9 changes: 8 additions & 1 deletion runtime/compiler/compile/J9SymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,14 @@ J9::SymbolReferenceTable::findOrCreateJavaLangReferenceReferentShadowSymbol(
// Right now it only works for private fields or fields that are guaranteed to be accessed only from one class
// because searchRecognizedField only does a name comparison, t does not work if the field is accessed from a subclass of the expected one
TR::SymbolReference *
J9::SymbolReferenceTable::findOrFabricateShadowSymbol(TR::ResolvedMethodSymbol * owningMethodSymbol, TR::Symbol::RecognizedField recognizedField, TR::DataType type, uint32_t offset, bool isVolatile, bool isPrivate, bool isFinal, char* name)
J9::SymbolReferenceTable::findOrFabricateShadowSymbol(TR::ResolvedMethodSymbol *owningMethodSymbol,
TR::Symbol::RecognizedField recognizedField,
TR::DataType type,
uint32_t offset,
bool isVolatile,
bool isPrivate,
bool isFinal,
const char *name)
{
TR_ResolvedMethod * owningMethod = owningMethodSymbol->getResolvedMethod();

Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/compile/J9SymbolReferenceTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ class SymbolReferenceTable : public OMR::SymbolReferenceTableConnector
//
TR::SymbolReference * findOrCreateDispatchJ9MethodSymbolRef();

TR::SymbolReference * findOrCreateShadowSymbol(TR::ResolvedMethodSymbol * owningMethodSymbol, int32_t cpIndex, bool isStore);
TR::SymbolReference * findOrFabricateShadowSymbol(TR::ResolvedMethodSymbol * owningMethodSymbol, TR::Symbol::RecognizedField recognizedField, TR::DataType type, uint32_t offset, bool isVolatile, bool isPrivate, bool isFinal, char* name = NULL);
TR::SymbolReference * findOrCreateShadowSymbol(TR::ResolvedMethodSymbol *owningMethodSymbol, int32_t cpIndex, bool isStore);
TR::SymbolReference * findOrFabricateShadowSymbol(TR::ResolvedMethodSymbol *owningMethodSymbol, TR::Symbol::RecognizedField recognizedField, TR::DataType type, uint32_t offset, bool isVolatile, bool isPrivate, bool isFinal, const char *name = NULL);

/** \brief
* Returns a symbol reference for an entity not present in the constant pool.
Expand Down

0 comments on commit c748ee3

Please sign in to comment.