OSDN Git Service

ART: Check invoke-interface earlier in verifier
authorAndreas Gampe <agampe@google.com>
Fri, 4 Dec 2015 01:27:32 +0000 (17:27 -0800)
committerAndreas Gampe <agampe@google.com>
Tue, 8 Dec 2015 16:50:12 +0000 (08:50 -0800)
commitdae24142127c64551142a50423085aabdb0a6060
tree35c06bc37e2dd2caad4fef1fba4de16a12aad6f9
parentef45113d01c16102538a8848d6979e772dad6225
ART: Check invoke-interface earlier in verifier

Invoke-interface should only be called on an interface method.
Move the check earlier, as otherwise we'll try to resolve and
potentially inject a method into the dex cache.

Also templatize ResolveMethod with a version always checking
the invoke type, and on a cache miss check whether type target
type is an interface when an interface invoke type was given.

Bug: 21869691
Change-Id: Ica27158f675b5aa223d9229248189612f4706832
17 files changed:
compiler/driver/compiler_driver-inl.h
compiler/driver/compiler_driver.cc
compiler/oat_writer.cc
compiler/optimizing/builder.cc
compiler/optimizing/reference_type_propagation.cc
runtime/class_linker-inl.h
runtime/class_linker.cc
runtime/class_linker.h
runtime/entrypoints/entrypoint_utils-inl.h
runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
runtime/verifier/method_verifier.cc
test/800-smali/expected.txt
test/800-smali/smali/b_21869691A.smali [new file with mode: 0644]
test/800-smali/smali/b_21869691B.smali [new file with mode: 0644]
test/800-smali/smali/b_21869691C.smali [new file with mode: 0644]
test/800-smali/smali/b_21869691I.smali [new file with mode: 0644]
test/800-smali/src/Main.java