From bbdd05378516f11443fce29a0fbff25ad993db23 Mon Sep 17 00:00:00 2001 From: buzbee Date: Thu, 7 Feb 2013 09:33:02 -0800 Subject: [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 --- src/compiler/codegen/mir_to_gbc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/compiler/codegen') diff --git a/src/compiler/codegen/mir_to_gbc.cc b/src/compiler/codegen/mir_to_gbc.cc index 79ac242e74..a2c2bbcca6 100644 --- a/src/compiler/codegen/mir_to_gbc.cc +++ b/src/compiler/codegen/mir_to_gbc.cc @@ -1018,7 +1018,7 @@ static bool ConvertMIRNode(CompilationUnit* cu, MIR* mir, BasicBlock* bb, } EmitPopShadowFrame(cu); cu->irb->CreateRet(GetLLVMValue(cu, rl_src[0].orig_sreg)); - bb->has_return = true; + DCHECK(bb->terminated_by_return); } break; @@ -1028,7 +1028,7 @@ static bool ConvertMIRNode(CompilationUnit* cu, MIR* mir, BasicBlock* bb, } EmitPopShadowFrame(cu); cu->irb->CreateRetVoid(); - bb->has_return = true; + DCHECK(bb->terminated_by_return); } break; @@ -1916,7 +1916,7 @@ static bool BlockBitcodeConversion(CompilationUnit* cu, BasicBlock* bb) if (bb->block_type == kEntryBlock) { cu->entryTarget_bb = GetLLVMBlock(cu, bb->fall_through->id); - } else if ((bb->fall_through != NULL) && !bb->has_return) { + } else if ((bb->fall_through != NULL) && !bb->terminated_by_return) { cu->irb->CreateBr(GetLLVMBlock(cu, bb->fall_through->id)); } -- cgit v1.2.3-59-g8ed1b