Skip to content

Commit

Permalink
disable inlining of countPositives unless its caller is hasNegatives
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjtuttle committed Feb 12, 2025
1 parent 2956a35 commit 233cf24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions runtime/compiler/optimizer/InlinerTempForJ9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5980,6 +5980,18 @@ TR_InlinerFailureReason
return Recognized_Callee;
}

if (rm == TR::java_lang_StringCoding_countPositives)
{
if (callsite->_callerResolvedMethod->getRecognizedMethod() == TR::java_lang_StringCoding_hasNegatives)
{
return InlineableTarget;
}
else
{
return DontInline_Callee;
}
}

return InlineableTarget;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/x/codegen/J9CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ J9::X86::CodeGenerator::initialize()
{
cg->setSupportsInlineStringCodingCountPositives();
}
#endif
#endif /* JAVA_SPEC_VERSION < 19 */

static bool disableInlineVectorizedMismatch = feGetEnv("TR_disableInlineVectorizedMismatch") != NULL;
if (cg->getSupportsArrayCmpLen() &&
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/x/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12597,7 +12597,7 @@ J9::X86::TreeEvaluator::directCallEvaluator(TR::Node *node, TR::CodeGenerator *c
}
}
break;
#endif
#endif /* JAVA_SPEC_VERSION < 19 */
case TR::java_nio_Bits_keepAlive:
case TR::java_lang_ref_Reference_reachabilityFence:
{
Expand Down

0 comments on commit 233cf24

Please sign in to comment.