summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_sinking.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/code_sinking.cc')
-rw-r--r--compiler/optimizing/code_sinking.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/code_sinking.cc b/compiler/optimizing/code_sinking.cc
index 2b56c88c25..0f336a2b1d 100644
--- a/compiler/optimizing/code_sinking.cc
+++ b/compiler/optimizing/code_sinking.cc
@@ -217,8 +217,14 @@ static HInstruction* FindIdealPosition(HInstruction* instruction,
DCHECK(target_block != nullptr);
}
- // Bail if the instruction can throw and we are about to move into a catch block.
- if (instruction->CanThrow() && target_block->GetTryCatchInformation() != nullptr) {
+ // Bail if the instruction would throw into a catch block.
+ if (instruction->CanThrow() && target_block->IsTryBlock()) {
+ // TODO(solanes): Here we could do something similar to the loop above and move to the first
+ // dominator, which is not a try block, instead of just returning nullptr. If we do so, we have
+ // to also make sure we are not in a loop.
+ // TODO(solanes): Alternatively, we could split the try block at the try boundary having two
+ // blocks: A and B. Block B would have the try boundary (and xhandler) and therefore block A
+ // would be the target block available to move the instruction.
return nullptr;
}