From 343b9d9e103e281a4c4c337edb83d23473e28bcc Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Tue, 6 Dec 2022 18:13:10 +0000 Subject: Allow inlining invokes that contain try catches into catch blocks Since catch blocks are never considered try blocks, we can guarantee that its invokes are not inside a TryBoundary (which is the blocker for enabling inlining of try catch invokes inside try blocks). Bug: 227283224 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I747e2e8c2515e36041ad3966ca6a6388ef7d91df --- compiler/optimizing/nodes.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 4a0ec93663..270bb4fb86 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -2740,8 +2740,8 @@ void HGraph::UpdateLoopAndTryInformationOfNewBlock(HBasicBlock* block, } } - DCHECK_IMPLIES(has_more_specific_try_catch_info, reference->GetTryCatchInformation() == nullptr) - << "We don't allow to inline try catches inside of other try catches."; + DCHECK_IMPLIES(has_more_specific_try_catch_info, !reference->IsTryBlock()) + << "We don't allow to inline try catches inside of other try blocks."; // Update the TryCatchInformation, if we are not inlining a try catch. if (!has_more_specific_try_catch_info) { @@ -2832,6 +2832,7 @@ HInstruction* HGraph::InlineInto(HGraph* outer_graph, HInvoke* invoke) { HBasicBlock* first = entry_block_->GetSuccessors()[0]; DCHECK(!first->IsInLoop()); + DCHECK(first->GetTryCatchInformation() == nullptr); at->MergeWithInlined(first); exit_block_->ReplaceWith(to); -- cgit v1.2.3-59-g8ed1b