summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/object-inl.h6
-rw-r--r--runtime/mirror/object.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h
index 63396d2f59..5ed3db342c 100644
--- a/runtime/mirror/object-inl.h
+++ b/runtime/mirror/object-inl.h
@@ -71,6 +71,12 @@ inline void Object::Wait(Thread* self, int64_t ms, int32_t ns) {
Monitor::Wait(self, this, ms, ns, true, kTimedWaiting);
}
+inline bool Object::VerifierInstanceOf(const Class* klass) const {
+ DCHECK(klass != NULL);
+ DCHECK(GetClass() != NULL);
+ return klass->IsInterface() || InstanceOf(klass);
+}
+
inline bool Object::InstanceOf(const Class* klass) const {
DCHECK(klass != NULL);
DCHECK(GetClass() != NULL);
diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h
index efaa183498..e105525f79 100644
--- a/runtime/mirror/object.h
+++ b/runtime/mirror/object.h
@@ -71,6 +71,11 @@ class MANAGED Object {
void SetClass(Class* new_klass);
+ // The verifier treats all interfaces as java.lang.Object and relies on runtime checks in
+ // invoke-interface to detect incompatible interface types.
+ bool VerifierInstanceOf(const Class* klass) const
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
bool InstanceOf(const Class* klass) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);