ART: Reduce overhead of mterp OSR checking

Once mterp's branch profiling identifies a method hot enough
to try on-stack replacement, a request is made to the JIT to compile
the method for OSR.  Mterp then enters a mode in which it checks
for completion of the compilation in order to initiate the OSR.
Currently, this completion check happens on every branch. In
situations in which the JIT is backlogged and it takes awhile for the
compilation to complete, the overhead of doing these checks is noticable.

This change moves from a "check on every branch" model to a "check
on every Nth branch" model.  We start with N=100, which should still
yield responsive OSR but dramatically reduce the checking overhead.

Bug: 32090348
Test: m test-art-host
Test: m test-art-target (Nexus 5x)
Change-Id: I97442723397bb242163dc18bd4444977bcd469fa
6 files changed