OSDN Git Service

ART: Reduce overhead of mterp OSR checking
authorbuzbee <buzbee@google.com>
Wed, 1 Feb 2017 17:08:31 +0000 (09:08 -0800)
committerbuzbee <buzbee@google.com>
Wed, 1 Feb 2017 17:08:31 +0000 (09:08 -0800)
commit42a09cb0c6aee5de92eb4cdf6d34646dcd247840
tree32a06b1cdc48cd1eeb4f6f0ba232935c5393f899
parentfbf47ea64a9f797a82030e919fa4f085c9eb5b28
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
runtime/interpreter/mterp/mips64/bincmp.S
runtime/interpreter/mterp/mips64/op_packed_switch.S
runtime/interpreter/mterp/mterp.cc
runtime/interpreter/mterp/out/mterp_mips64.S
runtime/jit/jit.h
tools/cpp-define-generator/constant_jit.def