ART: Add verifier support for invoke-polymorphic.
Change-Id: I1e1860cad80db46320c3ef5a9eaceb7529ea68d7
Bug: 30550796,33099829,33191712
Test: make test-art-host
diff --git a/runtime/mirror/method_handle_impl.cc b/runtime/mirror/method_handle_impl.cc
index fdfaaa8..4f1c448 100644
--- a/runtime/mirror/method_handle_impl.cc
+++ b/runtime/mirror/method_handle_impl.cc
@@ -22,6 +22,12 @@
namespace art {
namespace mirror {
+mirror::Class* MethodHandle::StaticClass() {
+ mirror::Class* klass = MethodHandleImpl::StaticClass()->GetSuperClass();
+ DCHECK(klass->DescriptorEquals("Ljava/lang/invoke/MethodHandle;"));
+ return klass;
+}
+
GcRoot<mirror::Class> MethodHandleImpl::static_class_;
void MethodHandleImpl::SetClass(Class* klass) {
diff --git a/runtime/mirror/method_handle_impl.h b/runtime/mirror/method_handle_impl.h
index 9054216..5ea82b5 100644
--- a/runtime/mirror/method_handle_impl.h
+++ b/runtime/mirror/method_handle_impl.h
@@ -57,6 +57,8 @@
return static_cast<MethodHandleKind>(handle_kind);
}
+ static mirror::Class* StaticClass() REQUIRES_SHARED(Locks::mutator_lock_);
+
private:
HeapReference<mirror::MethodType> nominal_type_;
HeapReference<mirror::MethodType> method_type_;