summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2018-01-16 20:20:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-01-16 20:20:16 +0000
commit66bed3b033a2864e7488b93ab1766985e416b552 (patch)
tree793f93ebdcf12406c9fb1cf3d0d6f024cdf0ca9b /compiler/optimizing/graph_checker.cc
parent0e1592341e0ff3eaceb7cdb913a5c30e9fab48a8 (diff)
parenta8b8e9b12a9740d71cff2fa65d47825b74f72c37 (diff)
Merge "Improve code sinking near "always throwing" method calls"
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index b1ac027a68..c88baa8610 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -31,7 +31,15 @@ namespace art {
using android::base::StringPrintf;
static bool IsAllowedToJumpToExitBlock(HInstruction* instruction) {
- return instruction->IsThrow() || instruction->IsReturn() || instruction->IsReturnVoid();
+ // Anything that returns is allowed to jump into the exit block.
+ if (instruction->IsReturn() || instruction->IsReturnVoid()) {
+ return true;
+ }
+ // Anything that always throws is allowed to jump into the exit block.
+ if (instruction->IsGoto() && instruction->GetPrevious() != nullptr) {
+ instruction = instruction->GetPrevious();
+ }
+ return instruction->AlwaysThrows();
}
static bool IsExitTryBoundaryIntoExitBlock(HBasicBlock* block) {