From b618adebbc19e50d7b1aa2f11b84341beb3c64dc Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Wed, 29 Jul 2015 10:31:29 +0100 Subject: ART: Store and check exceptional predecessors Future CL on register allocation for try/catch will require the knowledge of instructions which throw into a catch block. This patch stores that information with the basic block and verifies it in the graph checker. More checks on try catch also added to the graph checker and an order of exception handlers is enforced in TryBoundary successors. Change-Id: I3034c610791ea51d96724bcca97f49ec6ecf2af3 --- compiler/optimizing/ssa_builder.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/ssa_builder.cc') diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc index ff2e6ad821..2c34e4dd03 100644 --- a/compiler/optimizing/ssa_builder.cc +++ b/compiler/optimizing/ssa_builder.cc @@ -570,7 +570,9 @@ void SsaBuilder::VisitInstruction(HInstruction* instruction) { if (instruction->GetBlock()->IsInTry() && instruction->CanThrow()) { HTryBoundary* try_block = instruction->GetBlock()->GetTryEntry(); for (HExceptionHandlerIterator it(*try_block); !it.Done(); it.Advance()) { - GrowableArray* handler_locals = GetLocalsFor(it.Current()); + HBasicBlock* handler = it.Current(); + handler->AddExceptionalPredecessor(instruction); + GrowableArray* handler_locals = GetLocalsFor(handler); for (size_t i = 0, e = current_locals_->Size(); i < e; ++i) { HInstruction* local_value = current_locals_->Get(i); if (local_value != nullptr) { -- cgit v1.2.3-59-g8ed1b