summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-06-11 11:17:49 +0100
committer David Brazdil <dbrazdil@google.com> 2015-06-25 16:58:08 +0100
commit0b5c7d1994b76090afcc825e737f2b8c546da2f8 (patch)
tree057eddf8830b1991f02af3c3ce1b63dee90dd2ad /compiler/optimizing/code_generator.cc
parent1dd3136d9f6b1c7d551897a2d96c8314e40f7324 (diff)
ART: Implement try/catch blocks in Builder
This patch enables the GraphBuilder to generate blocks and edges which represent the exceptional control flow when try/catch blocks are present in the code. Actual compilation is still delegated to Quick and Baseline ignores the additional code. To represent the relationship between try and catch blocks, Builder splits the edges which enter/exit a try block and links the newly created blocks to the corresponding exception handlers. This layout will later enable the SsaBuilder to correctly infer the dominators of the catch blocks and to produce the appropriate reverse post ordering. It will not, however, allow for building the complete SSA form of the catch blocks and consequently optimizing such blocks. To this end, a new TryBoundary control-flow instruction is introduced. Codegen treats it the same as a Goto but it allows for additional successors (the handlers). Change-Id: I415b985596d5bebb7b1bb358a46e08b7b04bb53a
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index cd10935806..4607ebe548 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -146,7 +146,7 @@ bool CodeGenerator::GoesToNextBlock(HBasicBlock* current, HBasicBlock* next) con
HBasicBlock* CodeGenerator::GetNextBlockToEmit() const {
for (size_t i = current_block_index_ + 1; i < block_order_->Size(); ++i) {
HBasicBlock* block = block_order_->Get(i);
- if (!block->IsSingleGoto()) {
+ if (!block->IsSingleJump()) {
return block;
}
}
@@ -154,7 +154,7 @@ HBasicBlock* CodeGenerator::GetNextBlockToEmit() const {
}
HBasicBlock* CodeGenerator::FirstNonEmptyBlock(HBasicBlock* block) const {
- while (block->IsSingleGoto()) {
+ while (block->IsSingleJump()) {
block = block->GetSuccessors().Get(0);
}
return block;
@@ -214,7 +214,7 @@ void CodeGenerator::CompileInternal(CodeAllocator* allocator, bool is_baseline)
// Don't generate code for an empty block. Its predecessors will branch to its successor
// directly. Also, the label of that block will not be emitted, so this helps catch
// errors where we reference that label.
- if (block->IsSingleGoto()) continue;
+ if (block->IsSingleJump()) continue;
Bind(block);
for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) {
HInstruction* current = it.Current();