Skip to content

Commit

Permalink
Merge pull request #45 from cathyzhyi/v0.18.0-release
Browse files Browse the repository at this point in the history
Remove redundant parm to avoid incorrect usage
  • Loading branch information
pshipton authored Jan 8, 2020
2 parents 2cb0f75 + ff066de commit 7a1b023
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions compiler/compile/OMRCompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,12 +1028,12 @@ int32_t OMR::Compilation::compile()

if (_ilGenSuccess)
{
_methodSymbol->detectInternalCycles(_methodSymbol->getFlowGraph(), self());
_methodSymbol->detectInternalCycles();

//detect catch blocks that could have normal predecessors
//if so, fail the compile
//
if (_methodSymbol->catchBlocksHaveRealPredecessors(_methodSymbol->getFlowGraph(), self()))
if (_methodSymbol->catchBlocksHaveRealPredecessors())
{
self()->failCompilation<TR::CompilationException>("Catch blocks have real predecessors");
}
Expand Down
14 changes: 8 additions & 6 deletions compiler/il/OMRResolvedMethodSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ OMR::ResolvedMethodSymbol::genIL(TR_FrontEnd * fe, TR::Compilation * comp, TR::S
{
if (!comp->isPeekingMethod())
{
if (self()->catchBlocksHaveRealPredecessors(comp->getFlowGraph(), comp))
if (self()->catchBlocksHaveRealPredecessors())
{
comp->failCompilation<TR::CompilationException>("Catch blocks have real predecessors");
}
Expand All @@ -1235,7 +1235,7 @@ OMR::ResolvedMethodSymbol::genIL(TR_FrontEnd * fe, TR::Compilation * comp, TR::S
previousOptimizer = comp->getOptimizer();
comp->setOptimizer(optimizer);

self()->detectInternalCycles(comp->getFlowGraph(), comp);
self()->detectInternalCycles();

if (doOSR)
{
Expand Down Expand Up @@ -2081,8 +2081,10 @@ OMR::ResolvedMethodSymbol::setFirstTreeTop(TR::TreeTop * tt)
}

bool
OMR::ResolvedMethodSymbol::detectInternalCycles(TR::CFG *cfg, TR::Compilation *comp)
OMR::ResolvedMethodSymbol::detectInternalCycles()
{
TR::CFG *cfg = self()->getFlowGraph();
TR::Compilation *comp = self()->comp();
if (cfg)
{
int32_t numNodesInCFG = 0;
Expand Down Expand Up @@ -2196,16 +2198,16 @@ OMR::ResolvedMethodSymbol::detectInternalCycles(TR::CFG *cfg, TR::Compilation *c
}

bool
OMR::ResolvedMethodSymbol::catchBlocksHaveRealPredecessors(TR::CFG *cfg, TR::Compilation *comp)
OMR::ResolvedMethodSymbol::catchBlocksHaveRealPredecessors()
{
for (TR::CFGNode *node = cfg->getFirstNode(); node; node = node->getNext())
for (TR::CFGNode *node = self()->getFlowGraph()->getFirstNode(); node; node = node->getNext())
{
if (!node->getExceptionPredecessors().empty())
{
//catch block
if (!node->getPredecessors().empty())
{
dumpOptDetails(comp, "detected catch block_%d with real predecessors\n", node->getNumber());
dumpOptDetails(self()->comp(), "detected catch block_%d with real predecessors\n", node->getNumber());
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/il/OMRResolvedMethodSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ class OMR_EXTENSIBLE ResolvedMethodSymbol : public TR::MethodSymbol
bool hasSnapshots() { return _properties.testAny(HasSnapshots); }
void setHasSnapshots(bool v=true) { _properties.set(HasSnapshots,v); }

bool detectInternalCycles(TR::CFG *cfg, TR::Compilation *comp);
bool catchBlocksHaveRealPredecessors(TR::CFG *cfg, TR::Compilation *comp);
bool detectInternalCycles();
bool catchBlocksHaveRealPredecessors();

void setCannotAttemptOSR(int32_t n);
bool cannotAttemptOSRAt(TR_ByteCodeInfo &bci, TR::Block *blockToOSRAt, TR::Compilation *comp);
Expand Down

0 comments on commit 7a1b023

Please sign in to comment.