OSDN Git Service

ART: Simple structural class check
authorAndreas Gampe <agampe@google.com>
Fri, 7 Nov 2014 00:52:58 +0000 (16:52 -0800)
committerAndreas Gampe <agampe@google.com>
Thu, 15 Jan 2015 00:07:43 +0000 (16:07 -0800)
commitfd9eb3923dcf417afcf5ed4ebb13867fd10f2de3
tree8b44d56da6cd06372d962396fa905d3dedaf3907
parent4db3aeb88001367a032df33e5801c9add6a14b06
ART: Simple structural class check

Adds a simple check to class-loading when the embedded dex file in
an oat file and the dex file on the class path where we found the
class do not match.

We require that the number of methods and fields do not change, as
that will almost certainly mean that quickened and other compiled
offsets are wrong now. This is a reasonably lightweight change, but
we should investigate a full comparison including name and type of
members.

Bug: 17937814
Bug: 18708951

(cherry picked from commit 15a33b3f88546bce85dcb9d28caf200da51154d7)

Change-Id: Icb9638bebd369ab23822817f4a97c8dd8625fea5
12 files changed:
runtime/class_linker.cc
runtime/dex_file.cc
runtime/dex_file.h
runtime/oat_file.cc
test/131-structural-change/build [new file with mode: 0755]
test/131-structural-change/expected.txt [new file with mode: 0644]
test/131-structural-change/info.txt [new file with mode: 0644]
test/131-structural-change/run [new file with mode: 0755]
test/131-structural-change/src-ex/A.java [new file with mode: 0644]
test/131-structural-change/src-ex/B.java [new file with mode: 0644]
test/131-structural-change/src/A.java [new file with mode: 0644]
test/131-structural-change/src/Main.java [new file with mode: 0644]