Skip to content

Commit

Permalink
Merge pull request #4669 from r30shah/PureFunctionWL
Browse files Browse the repository at this point in the history
Consider callee type in exceptionRaised query
  • Loading branch information
vijaysun-omr authored Jan 24, 2020
2 parents 7f70fe9 + b3c40ab commit 4926bd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions compiler/compile/OMRCompilation.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -666,7 +666,8 @@ bool OMR::Compilation::isPotentialOSRPoint(TR::Node *node, TR::Node **osrPointNo
potentialOSRPoint = true;
}
else if (callSymRef->getReferenceNumber() >=
self()->getSymRefTab()->getNonhelperIndex(self()->getSymRefTab()->getLastCommonNonhelperSymbol()))
self()->getSymRefTab()->getNonhelperIndex(self()->getSymRefTab()->getLastCommonNonhelperSymbol())
&& !((TR::MethodSymbol*)(callSymRef->getSymbol()))->functionCallDoesNotYieldOSR())
{
potentialOSRPoint = (disableGuardedCallOSR == NULL);
}
Expand Down
3 changes: 2 additions & 1 deletion compiler/il/OMRMethodSymbol.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -194,6 +194,7 @@ class OMR_EXTENSIBLE MethodSymbol : public TR::Symbol
bool safeToSkipZeroInitializationOnNewarrays() { return false; }
bool safeToSkipChecksOnArrayCopies() { return false; }

bool functionCallDoesNotYieldOSR() { return false; }
bool isPureFunction() { return false; }

protected:
Expand Down
8 changes: 4 additions & 4 deletions compiler/il/OMRNode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -3679,9 +3679,9 @@ OMR::Node::exceptionsRaised()
default:
if (node->getOpCode().isCall() && !node->isOSRFearPointHelperCall())
{
possibleExceptions |= TR::Block::CanCatchOSR;
if (node->getSymbolReference()->canGCandExcept()
)
if (!((TR::MethodSymbol*)node->getSymbolReference()->getSymbol())->functionCallDoesNotYieldOSR())
possibleExceptions |= TR::Block::CanCatchOSR;
if (!node->isPureCall() && node->getSymbolReference()->canGCandExcept())
possibleExceptions |= TR::Block::CanCatchUserThrows;
}
break;
Expand Down

0 comments on commit 4926bd4

Please sign in to comment.