OSDN Git Service

ART: Fix Quick/Optimizing suspend check assumption mismatch.
authorVladimir Marko <vmarko@google.com>
Wed, 22 Jul 2015 16:50:37 +0000 (17:50 +0100)
committerVladimir Marko <vmarko@google.com>
Thu, 23 Jul 2015 16:07:47 +0000 (17:07 +0100)
commitd29e8487ff1774b6eb5f0e18d854415c1ee8f6b0
tree827ee7fedc275eb6801fcf200a36c06159e9f829
parente6e38ce021ef5e0d326d76172307c000e0e6fab3
ART: Fix Quick/Optimizing suspend check assumption mismatch.

Quick's SuspendCheckElimination (SCE) expects that every
method contains a suspend check and it eliminates suspend
checks in loops containing an invoke. Optimizing eliminates
the suspend check from leaf methods, so the combination of
a Quick-compiled loop calling an Optimizing-compiled leaf
method can lead to missing suspend checks and potentially
leading to ANRs.

Enable Quick's kLeafOptimization flag to remove suspend
checks from leaf methods and disable Quick's SCE. This
aligns the suspend check placement for the two backends
and avoids the broken combination.

Currently, all methods containing a try-catch are compiled
with Quick, so it's relatively easy to create a regression
test. However, this test will not be valid when Optimizing
starts supporting try-catch.

Bug: 22657404
Change-Id: I3bc40bf3f5c1e7d18704d1547b139e939950b770
compiler/dex/mir_graph.h
compiler/dex/mir_optimization.cc
compiler/dex/mir_optimization_test.cc
test/109-suspend-check/src/Main.java