Skip to content

Commit

Permalink
Fix supportsIntrinsicCaseConversion in ilgen
Browse files Browse the repository at this point in the history
The call node generated was not cleaned up from the oprand stack when
loading const instead. Besides, the code for handling this recognized
method can be moved up to avoid applying the redundant logic for a
general call.

Signed-off-by: Yi Zhang <yizhang@ca.ibm.com>
  • Loading branch information
Yi Zhang committed Sep 7, 2018
1 parent 16e3d41 commit 9964c14
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions runtime/compiler/ilgen/Walker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4643,13 +4643,6 @@ TR_J9ByteCodeIlGenerator::genInvoke(TR::SymbolReference * symRef, TR::Node *indi
*/


TR::Node * savedNode = NULL;
if (_stack->topIndex() > 0)
{
savedNode = _stack->element(_stack->topIndex());
}

#define DAA_PRINT(a) \
case a: \
traceMsg(comp(), "DAA Method found: %s\n", #a); \
Expand Down Expand Up @@ -4955,7 +4948,12 @@ break
return NULL;
}

int32_t constToLoad = 0;
if (symbol->getRecognizedMethod() == TR::com_ibm_jit_JITHelpers_supportsIntrinsicCaseConversion)
{
pop(); //pop the receiver since it's not used
loadConstant(TR::iconst, cg()->getSupportsInlineStringCaseConversion() ? 1 : 0);
return NULL;
}

if (!isStatic && _classInfo && !symRef->isUnresolved())
{
Expand Down Expand Up @@ -5064,17 +5062,6 @@ break
}
}

if(symbol->getRecognizedMethod() == TR::com_ibm_jit_JITHelpers_supportsIntrinsicCaseConversion)
{
if (cg()->getSupportsInlineStringCaseConversion())
constToLoad = 1;
else
constToLoad = 0; // should already be 0 but just incase..

loadConstant(TR::iconst, constToLoad);
return NULL;
}

if (cg()->getSupportsInlineStringCaseConversion() &&
(symbol->getRecognizedMethod() == TR::com_ibm_jit_JITHelpers_toUpperIntrinsicLatin1 ||
symbol->getRecognizedMethod() == TR::com_ibm_jit_JITHelpers_toLowerIntrinsicLatin1 ||
Expand Down

0 comments on commit 9964c14

Please sign in to comment.