From 705ad49f353d3f90d8b63625aca2c2035bacdbef Mon Sep 17 00:00:00 2001 From: Alex Light Date: Mon, 21 Sep 2015 11:36:30 -0700 Subject: Support directly invoking interface default methods With the Java 8 Language one is allowed to directly call default interface methods of interfaces one (directly) implements through the use of the super keyword. We support this behavior through the invoke-super opcode with the target being an interface. We add 3 tests for this behavior. Currently only supports slow-path interpreter. Invoke-super is currently extremely slow. Bug: 24618811 Change-Id: I7e06e17326f7dbae0116bd7dfefca151f0092bd2 --- runtime/mirror/class.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'runtime/mirror/class.h') diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index ce879ba2ee..a9e6f06725 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -848,6 +848,11 @@ class MANAGED Class FINAL : public Object { ArtMethod* FindVirtualMethodForSuper(ArtMethod* method, size_t pointer_size) SHARED_REQUIRES(Locks::mutator_lock_); + // Given a method from some implementor of this interface, return the specific implementation + // method for this class. + ArtMethod* FindVirtualMethodForInterfaceSuper(ArtMethod* method, size_t pointer_size) + SHARED_REQUIRES(Locks::mutator_lock_); + // Given a method implemented by this class, but potentially from a // super class or interface, return the specific implementation // method for this class. @@ -1058,7 +1063,7 @@ class MANAGED Class FINAL : public Object { SHARED_REQUIRES(Locks::mutator_lock_); pid_t GetClinitThreadId() SHARED_REQUIRES(Locks::mutator_lock_) { - DCHECK(IsIdxLoaded() || IsErroneous()); + DCHECK(IsIdxLoaded() || IsErroneous()) << PrettyClass(this); return GetField32(OFFSET_OF_OBJECT_MEMBER(Class, clinit_thread_id_)); } -- cgit v1.2.3-59-g8ed1b