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
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h
index cf548ad..a5f5c49 100644
--- a/runtime/art_method-inl.h
+++ b/runtime/art_method-inl.h
@@ -225,8 +225,7 @@
}
case kSuper:
// Constructors and static methods are called with invoke-direct.
- // Interface methods cannot be invoked with invoke-super.
- return IsConstructor() || IsStatic() || GetDeclaringClass()->IsInterface();
+ return IsConstructor() || IsStatic();
case kInterface: {
mirror::Class* methods_class = GetDeclaringClass();
return IsDirect() || !(methods_class->IsInterface() || methods_class->IsObjectClass());