summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-08-19 17:12:48 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-08-19 17:12:48 +0000
commita35d4c9d66b372e7ae1014357c48ddfa6104085b (patch)
tree8f3c9cefb4c9ed12749713ef1f52708ef6d5d455 /compiler/optimizing/nodes.cc
parentf25f4f95863946053cae46e34fd175cc7a6c3ea5 (diff)
parentec16f79a4d0aeff319bf52139a0c82de3080d73c (diff)
Merge "ART: Refactor try/catch block info, store exception type"
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index f2b63ae678..64c680c3fb 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -339,7 +339,10 @@ void HGraph::ComputeTryBlockInformation() {
// been visited already and had its try membership set.
HBasicBlock* first_predecessor = block->GetPredecessors().Get(0);
DCHECK(!block->IsLoopHeader() || !block->GetLoopInformation()->IsBackEdge(*first_predecessor));
- block->SetTryEntry(first_predecessor->ComputeTryEntryOfSuccessors());
+ const HTryBoundary* try_entry = first_predecessor->ComputeTryEntryOfSuccessors();
+ if (try_entry != nullptr) {
+ block->SetTryCatchInformation(new (arena_) TryCatchInformation(*try_entry));
+ }
}
}
@@ -1164,19 +1167,21 @@ HBasicBlock* HBasicBlock::SplitAfter(HInstruction* cursor) {
return new_block;
}
-HTryBoundary* HBasicBlock::ComputeTryEntryOfSuccessors() const {
+const HTryBoundary* HBasicBlock::ComputeTryEntryOfSuccessors() const {
if (EndsWithTryBoundary()) {
HTryBoundary* try_boundary = GetLastInstruction()->AsTryBoundary();
if (try_boundary->IsEntry()) {
- DCHECK(try_entry_ == nullptr);
+ DCHECK(!IsTryBlock());
return try_boundary;
} else {
- DCHECK(try_entry_ != nullptr);
- DCHECK(try_entry_->HasSameExceptionHandlersAs(*try_boundary));
+ DCHECK(IsTryBlock());
+ DCHECK(try_catch_information_->GetTryEntry().HasSameExceptionHandlersAs(*try_boundary));
return nullptr;
}
+ } else if (IsTryBlock()) {
+ return &try_catch_information_->GetTryEntry();
} else {
- return try_entry_;
+ return nullptr;
}
}