OSDN Git Service

Suspend check reworking (ready for rewiew)
authorbuzbee <buzbee@google.com>
Wed, 21 Sep 2011 23:03:19 +0000 (16:03 -0700)
committerbuzbee <buzbee@google.com>
Thu, 22 Sep 2011 03:03:23 +0000 (20:03 -0700)
commitc1f45048b90a85018c6b063c31bc088dc3dd993d
treefe2a976af407f8a77828306e9000837009150480
parentae7cbf45460b472dbd159ab565d55b2880703abb
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
13 files changed:
src/asm_support.h
src/compiler/CompilerIR.h
src/compiler/Frontend.cc
src/compiler/codegen/arm/ArchUtility.cc
src/compiler/codegen/arm/ArmLIR.h
src/compiler/codegen/arm/MethodCodegenDriver.cc
src/compiler/codegen/arm/Thumb2/Factory.cc
src/compiler/codegen/arm/Thumb2/Gen.cc
src/jni_internal_arm.cc
src/runtime_support.S
src/runtime_support.h
src/thread.cc
src/thread.h