OSDN Git Service

Fix JIT crash due to unverified dead code
authorCalin Juravle <calin@google.com>
Fri, 28 Oct 2016 19:09:56 +0000 (20:09 +0100)
committerCalin Juravle <calin@google.com>
Mon, 19 Dec 2016 15:36:41 +0000 (15:36 +0000)
commit132eb43396bdb0b9bdacf069289f019d85d358fc
tree097ad8979e90555fd46e49eda32fe4b0c579acfd
parent71464a10a434e5b8aac75998d08b2cdcbce57bab
Fix JIT crash due to unverified dead code

The JIT compiler assumes that it only gets completely verified code. To
work around potential unverified dead code it uses kAccDontBotherCompile
flag set during runtime verification. However, if a class is verified
during a prior dex2oat the flag is not persisted and JIT happily things
that everything is ok.

The simplest fix is to mark classes with potential unverified dex code
as verify at runtime. We only do this for apps and assume that
everything in the boot image is well formed.

Test: m test-art-host-706-jit-skip-compilation
Bug: 31000839

Change-Id: Ib73de1888581bb7202474cfd7aca70af4cc2cc00
runtime/verifier/method_verifier.cc
test/706-jit-skip-compilation/expected.txt [new file with mode: 0644]
test/706-jit-skip-compilation/info.txt [new file with mode: 0644]
test/706-jit-skip-compilation/run [new file with mode: 0644]
test/706-jit-skip-compilation/smali/errclass.smali [new file with mode: 0644]
test/706-jit-skip-compilation/src/Main.java [new file with mode: 0644]
test/common/runtime_state.cc
test/etc/run-test-jar