summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dex/mir_graph.cc10
-rw-r--r--compiler/dex/mir_optimization.cc7
2 files changed, 14 insertions, 3 deletions
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 6aee56373c..dee1361a50 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -172,10 +172,18 @@ BasicBlock* MIRGraph::SplitBlock(DexOffset code_offset,
bottom_block->first_mir_insn = insn;
bottom_block->last_mir_insn = orig_block->last_mir_insn;
- /* If this block was terminated by a return, the flag needs to go with the bottom block */
+ /* If this block was terminated by a return, conditional branch or throw,
+ * the flag needs to go with the bottom block
+ */
bottom_block->terminated_by_return = orig_block->terminated_by_return;
orig_block->terminated_by_return = false;
+ bottom_block->conditional_branch = orig_block->conditional_branch;
+ orig_block->conditional_branch = false;
+
+ bottom_block->explicit_throw = orig_block->explicit_throw;
+ orig_block->explicit_throw = false;
+
/* Handle the taken path */
bottom_block->taken = orig_block->taken;
if (bottom_block->taken != NullBasicBlockId) {
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 23ceb56d66..c7dd85c9c2 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -692,10 +692,13 @@ void MIRGraph::CombineBlocks(struct BasicBlock* bb) {
// Include the rest of the instructions
bb->last_mir_insn = bb_next->last_mir_insn;
/*
- * If lower-half of pair of blocks to combine contained a return, move the flag
- * to the newly combined block.
+ * If lower-half of pair of blocks to combine contained
+ * a return or a conditional branch or an explicit throw,
+ * move the flag to the newly combined block.
*/
bb->terminated_by_return = bb_next->terminated_by_return;
+ bb->conditional_branch = bb_next->conditional_branch;
+ bb->explicit_throw = bb_next->explicit_throw;
/*
* NOTE: we aren't updating all dataflow info here. Should either make sure this pass