Remove unnecessary exception and suspend checks.

1. Post exception check, when 2 consecutive branches are return and exception
unwind, respectively, merge these 2 branches as the caller doesn't care
the return value when an exception is pending..

2. If the method is leaf, we can elide the suspend check.

3. Also, move suspend checks to be before pushing shadow frame for the sake of "1"
and for reducing code size (Multiple returns).

Change-Id: I18f38f97f4e7714eadab4a1d6a568aa6e2c982ae
diff --git a/src/dex_instruction.h b/src/dex_instruction.h
index b33b001..442ea79 100644
--- a/src/dex_instruction.h
+++ b/src/dex_instruction.h
@@ -117,7 +117,7 @@
     kThrow    = 0x08,  // could cause an exception to be thrown
     kReturn   = 0x10,  // returns, no additional statements
     kInvoke   = 0x20,  // a flavor of invoke
-    // TODO: kUnconditional
+    kUnconditional = 0x40, // unconditional branch
   };
 
   enum VerifyFlag {
@@ -187,6 +187,11 @@
     return (kInstructionFlags[Opcode()] & kBranch) != 0;
   }
 
+  // Returns true if this instruction is a unconditional branch.
+  bool IsUnconditional() const {
+    return (kInstructionFlags[Opcode()] & kUnconditional) != 0;
+  }
+
   // Returns true if this instruction is a switch.
   bool IsSwitch() const {
     return (kInstructionFlags[Opcode()] & kSwitch) != 0;