OSDN Git Service

Fix JIT crash due to unverified dead code
authorCalin Juravle <calin@google.com>
Tue, 20 Dec 2016 14:36:59 +0000 (14:36 +0000)
committerCalin Juravle <calin@google.com>
Tue, 20 Dec 2016 16:15:24 +0000 (16:15 +0000)
commit857f058d4b7bd07c5c99eda416ad91516a10b4da
treeaafff6fc7ac9578955661366e779c858945ae71c
parent0966558b075b9b454e1a7864306eb206bf0c0094
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
Bug: 31000839
Change-Id: I092d2e9553cd1c577036d78e8563a7a39d6cb7b9
compiler/image_test.cc
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