diff options
| author | 2013-02-07 09:33:02 -0800 | |
|---|---|---|
| committer | 2013-02-07 10:39:53 -0800 | |
| commit | bbdd05378516f11443fce29a0fbff25ad993db23 (patch) | |
| tree | 29b8d389ec032b8d09d82ec801909a6535f665c4 /src/compiler/frontend.cc | |
| parent | 8dbb708c7dc05c786329eb5c3fff3194ab6472ac (diff) | |
[Portable Compiler] Rework return block marking.
Move the detection of blocks that contain a return from the
GBC emit pass up to Dex parsing. This allows logic that detects
backward branches that go to method return to skip suspend checks.
Change-Id: I2a606b49850235b59c5faf237a08729e98220f4d
Diffstat (limited to 'src/compiler/frontend.cc')
| -rw-r--r-- | src/compiler/frontend.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/frontend.cc b/src/compiler/frontend.cc index 44baea28fa..9afd18e4d9 100644 --- a/src/compiler/frontend.cc +++ b/src/compiler/frontend.cc @@ -148,6 +148,10 @@ static BasicBlock *SplitBlock(CompilationUnit* cu, unsigned int 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 */ + bottom_block->terminated_by_return = orig_block->terminated_by_return; + orig_block->terminated_by_return = false; + /* Add it to the quick lookup cache */ cu->block_map.Put(bottom_block->start_offset, bottom_block); @@ -972,6 +976,7 @@ static CompiledMethod* CompileMethod(Compiler& compiler, cur_block = ProcessCanBranch(cu.get(), cur_block, insn, cur_offset, width, flags, code_ptr, code_end); } else if (flags & Instruction::kReturn) { + cur_block->terminated_by_return = true; cur_block->fall_through = exit_block; InsertGrowableList(cu.get(), exit_block->predecessors, reinterpret_cast<uintptr_t>(cur_block)); |