OSDN Git Service

Optimizing: Do not insert suspend checks on back-edges.
authorVladimir Marko <vmarko@google.com>
Wed, 23 Mar 2016 16:01:47 +0000 (16:01 +0000)
committerVladimir Marko <vmarko@google.com>
Wed, 23 Mar 2016 19:17:51 +0000 (19:17 +0000)
commitd96a246e5b103bfc167acaa6315bd8abca9de493
tree3e99f24bc30d53bc9cfc9fb1e0f3dc92c0ce1daf
parent3920099f578fd8015777bc3c1c7392a08b1e08e7
Optimizing: Do not insert suspend checks on back-edges.

Rely on HGraph::SimplifyLoop() to insert suspend checks.

CodeGenerator's CheckLoopEntriesCanBeUsedForOsr() checks the
dex pcs of suspend checks against branch targets to verify
that we always have an appropriate point for OSR transition.
However, the HSuspendChecks that were added by HGraphBuilder
to support the recently removed "baseline" interfered with
this in a specific case, namely an infinite loop where the
back-branch jumps to a nop. In that case, the HSuspendCheck
added by HGraphBuilder had a dex pc different from the block
and the branch target but its presence would stop the
HGraph::SimplifyLoop() from adding a new HSuspendCheck with
the correct dex pc.

Bug: 27623547
Change-Id: I83566a260210bc05aea0c44509a39bb490aa7003
compiler/optimizing/builder.cc
compiler/optimizing/builder.h
compiler/optimizing/constant_folding_test.cc
compiler/optimizing/dead_code_elimination_test.cc
compiler/optimizing/instruction_simplifier.cc
compiler/optimizing/pretty_printer_test.cc
test/590-infinite-loop-with-nop/expected.txt [new file with mode: 0644]
test/590-infinite-loop-with-nop/info.txt [new file with mode: 0644]
test/590-infinite-loop-with-nop/smali/TestCase.smali [new file with mode: 0644]
test/590-infinite-loop-with-nop/src/Main.java [new file with mode: 0644]