Suspend check reworking (ready for rewiew)

I hate burning a register, but the cost of suspend checks was just too high
in our current environment.  There are things that can be done in future
releases to avoid the register burn, but for now it's worthwhile.

The general strategy is to reserve r4 as a suspend check counter.
Rather than poll the thread suspendPending counter, we instead simply
decrement the counter register.  When it rolls to zero, we check.  For
now I'm just using the counter scheme on backwards branches - we always
poll on returns (which is already heavyweight enough that the extra cost
isn't especially noticable).

I've also added an optimization hint to the MIR in case we have enough
time to test and enable the existing loop analysis code that omits the
suspend check on smallish counted loops.

Change-Id: I82d8bad5882a4cf2ccff590942e2d1520d58969d
diff --git a/src/runtime_support.S b/src/runtime_support.S
index 24883fc..6522243 100644
--- a/src/runtime_support.S
+++ b/src/runtime_support.S
@@ -159,6 +159,23 @@
     mov     r1, r1, lsr r2              @  r1<- r1 >>> r2
     bx      lr
 
+    .balign 4
+    .global art_test_suspend
+    .extern artCheckSuspendFromCode
+art_test_suspend:
+    /*
+     * Check to see if there's a pending suspend request on our thread.
+     * reset rSUSPEND to SUSPEND_CHECK_INTERVAL.
+     * On entry, rSUSPEND holds the suspend request value
+     * [TUNING: move load of suspend check value into this stub.
+     */
+    cmp    rSUSPEND, #0
+    mov    rSUSPEND, #SUSPEND_CHECK_INTERVAL
+    bxeq   rLR
+    mov    r0, rSELF
+    b      artCheckSuspendFromCode
+
+
 #endif
 
 #if defined(__i386__)