From ec16f79a4d0aeff319bf52139a0c82de3080d73c Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Wed, 19 Aug 2015 15:04:01 +0100 Subject: ART: Refactor try/catch block info, store exception type This patch replaces HBasicBlock fields storing try/catch info with a single TryCatchInformation data structure, saving memory for the majority of non-try/catch blocks. It also changes builder to store the exception type for catch blocks. Change-Id: Ib3e43f7db247e6915d67c267fc62410420e230c9 --- compiler/optimizing/ssa_builder.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/ssa_builder.cc') diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc index ff2e6ad821..561c3b4964 100644 --- a/compiler/optimizing/ssa_builder.cc +++ b/compiler/optimizing/ssa_builder.cc @@ -567,9 +567,10 @@ void SsaBuilder::VisitInstruction(HInstruction* instruction) { } // If in a try block, propagate values of locals into catch blocks. - if (instruction->GetBlock()->IsInTry() && instruction->CanThrow()) { - HTryBoundary* try_block = instruction->GetBlock()->GetTryEntry(); - for (HExceptionHandlerIterator it(*try_block); !it.Done(); it.Advance()) { + if (instruction->CanThrowIntoCatchBlock()) { + const HTryBoundary& try_entry = + instruction->GetBlock()->GetTryCatchInformation()->GetTryEntry(); + for (HExceptionHandlerIterator it(try_entry); !it.Done(); it.Advance()) { GrowableArray* handler_locals = GetLocalsFor(it.Current()); for (size_t i = 0, e = current_locals_->Size(); i < e; ++i) { HInstruction* local_value = current_locals_->Get(i); -- cgit v1.2.3-59-g8ed1b