OSDN Git Service

Refactor annotation code for obsolete methods.
authorAlex Light <allight@google.com>
Fri, 10 Mar 2017 21:09:57 +0000 (13:09 -0800)
committerAlex Light <allight@google.com>
Tue, 14 Mar 2017 17:18:12 +0000 (10:18 -0700)
commit672a0b75c91af44749b1e946684e6a65a884d778
tree7ae1c2fd5b9e2e7d155d9427848000d381e138d0
parent01ea2aa05d6889b4ec08679606d3cdf36b302a8f
Refactor annotation code for obsolete methods.

Reading annotations on obsolete ArtMethod* objects would cause
problems due to reading from the wrong dex file. We refactored that
code so now it always uses the correct dex file when reading
annotations. This was rarely a problem since obsolete ArtMethods are
only ever exposed to the runtime itself which rarely reads
annotations.

We also add a test for redefining Object.class. This is one of the
small number of classes where the runtime will read it's annotations
off of obsolete methods.

Bug: 31455788
Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I5f1c58464b89a7a9198a7b26b015b102a7dc9c2f
14 files changed:
runtime/art_method-inl.h
runtime/art_method.cc
runtime/art_method.h
runtime/dex_file_annotations.cc
test/980-redefine-object/expected.txt [new file with mode: 0644]
test/980-redefine-object/info.txt [new file with mode: 0644]
test/980-redefine-object/redefine_object.cc [new file with mode: 0644]
test/980-redefine-object/run [new file with mode: 0755]
test/980-redefine-object/src-ex/TestWatcher.java [new file with mode: 0644]
test/980-redefine-object/src/Main.java [new file with mode: 0644]
test/980-redefine-object/src/Transform.java [new file with mode: 0644]
test/Android.bp
test/ti-agent/common_helper.cc
test/ti-agent/common_helper.h