-
-
Notifications
You must be signed in to change notification settings - Fork 91
Fix TrapTightener #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Fix TrapTightener #1251
Conversation
for (Stmt stmt : builder.getStmts()) { | ||
Map<ClassType, Stmt> exceptionalMap = blockGraph.exceptionalSuccessors(stmt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is slower than before
mutatedBlocks.stream().forEach(block -> blockGraph.tryMergeIntoSurroundingBlocks(block)); | ||
|
||
// FIXME: check if there are traphandlers that have no predecessor | ||
|
||
// delete the unused traps | ||
UnreachableCodeEliminator codeEliminator = new UnreachableCodeEliminator(); | ||
codeEliminator.interceptBody(builder, view); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets refactor this into a method / simplify
blockGraph.splitAndExcludeStmtFromBlock(stmt, block); | ||
for (ClassType classType : entry.getValue()) { | ||
graph.removeExceptionalEdge(entry.getKey(), classType); | ||
MutableBasicBlock blockWithUnthrowableException = | ||
(MutableBasicBlock) blockGraph.getBlockOf(entry.getKey()); | ||
blockWithUnthrowableException.removeExceptionalSuccessorBlock(classType); | ||
mutatedBlocks.add(blockWithUnthrowableException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like functionality that should only be done in mutablestmtgraph
if (!monitored.containsKey(currStmt)) { | ||
monitored.put(currStmt, new HashSet<>()); | ||
} | ||
hasChanged = monitored.get(currStmt).add(monitoredValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
performance: reuse get() ---> != null
if (monitored.containsKey(pred)) { | ||
for (Value value : monitored.get(pred)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
monitored.put(currStmt, new HashSet<>()); | ||
} | ||
hasChanged = monitored.get(currStmt).add(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Uh oh!
There was an error while loading. Please reload this page.