Skip to content

Commit

Permalink
Merge pull request eclipse-omr#2102 from 0xdaryl/omr_notyetrun
Browse files Browse the repository at this point in the history
Relocate notYetRunMeansCold to OpenJ9
  • Loading branch information
vijaysun-omr authored Dec 12, 2017
2 parents 413e7cd + 3e07ca5 commit ae50b6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 56 deletions.
58 changes: 3 additions & 55 deletions compiler/compile/OMRCompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2081,62 +2081,10 @@ void OMR::Compilation::registerResolvedMethodSymbolReference(TR::SymbolReference
}


bool OMR::Compilation::notYetRunMeansCold()
bool
OMR::Compilation::notYetRunMeansCold()
{
if (_optimizer && !((TR::Optimizer*)_optimizer)->isIlGenOpt())
return false;

TR_ResolvedMethod *currentMethod = self()->getJittedMethodSymbol()->getResolvedMethod();

intptrj_t initialCount = currentMethod->hasBackwardBranches() ?
self()->getOptions()->getInitialBCount() :
self()->getOptions()->getInitialCount();

if (currentMethod->convertToMethod()->isBigDecimalMethod() ||
currentMethod->convertToMethod()->isBigDecimalConvertersMethod())
initialCount = 0;

#ifdef J9_PROJECT_SPECIFIC
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;
}
}
#endif

if (
self()->isDLT()
|| (initialCount < TR_UNRESOLVED_IMPLIES_COLD_COUNT)
|| ((self()->getOption(TR_UnresolvedAreNotColdAtCold) && self()->getMethodHotness() == cold) || self()->getMethodHotness() < cold)
|| currentMethod->convertToMethod()->isArchetypeSpecimen()
|| ( self()->getCurrentMethod()
&& self()->getCurrentMethod()->convertToMethod()->isArchetypeSpecimen())
)
return false;
else
return true;
return false;
}


Expand Down
10 changes: 9 additions & 1 deletion compiler/compile/OMRCompilation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,15 @@ class OMR_EXTENSIBLE Compilation
// To TransformUtil
void setStartTree(TR::TreeTop * tt);


/**
* \brief
* Answers whether the fact that a method has not been executed yet implies
* that the method is cold.
*
* \return
* true if the fact that a method has not been executed implies it is cold;
* false otherwise
*/
bool notYetRunMeansCold();

TR::Region &aliasRegion();
Expand Down

0 comments on commit ae50b6e

Please sign in to comment.