summaryrefslogtreecommitdiff
path: root/runtime/common_throws.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2016-01-14 18:43:36 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-01-14 18:43:36 +0000
commit7b4199a5fa9f151fbf3af2a34f26d04215a1016c (patch)
tree111493b5fee26087dcc8abc1a1f56a140d549c8d /runtime/common_throws.cc
parent15db4dcfcc17dfe6c41d3c7b26355ccfa2504f4e (diff)
parent705ad49f353d3f90d8b63625aca2c2035bacdbef (diff)
Merge "Support directly invoking interface default methods"
Diffstat (limited to 'runtime/common_throws.cc')
-rw-r--r--runtime/common_throws.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc
index 40e2b1593e..b4208fe054 100644
--- a/runtime/common_throws.cc
+++ b/runtime/common_throws.cc
@@ -86,6 +86,14 @@ void ThrowAbstractMethodError(ArtMethod* method) {
PrettyMethod(method).c_str()).c_str());
}
+void ThrowAbstractMethodError(uint32_t method_idx, const DexFile& dex_file) {
+ ThrowException("Ljava/lang/AbstractMethodError;", /* referrer */ nullptr,
+ StringPrintf("abstract method \"%s\"",
+ PrettyMethod(method_idx,
+ dex_file,
+ /* with_signature */ true).c_str()).c_str());
+}
+
// ArithmeticException
void ThrowArithmeticExceptionDivideByZero() {
@@ -211,6 +219,22 @@ void ThrowIncompatibleClassChangeError(InvokeType expected_type, InvokeType foun
msg.str().c_str());
}
+void ThrowIncompatibleClassChangeErrorClassForInterfaceSuper(ArtMethod* method,
+ mirror::Class* target_class,
+ mirror::Object* this_object,
+ ArtMethod* referrer) {
+ // Referrer is calling interface_method on this_object, however, the interface_method isn't
+ // implemented by this_object.
+ CHECK(this_object != nullptr);
+ std::ostringstream msg;
+ msg << "Class '" << PrettyDescriptor(this_object->GetClass())
+ << "' does not implement interface '" << PrettyDescriptor(target_class) << "' in call to '"
+ << PrettyMethod(method) << "'";
+ ThrowException("Ljava/lang/IncompatibleClassChangeError;",
+ referrer != nullptr ? referrer->GetDeclaringClass() : nullptr,
+ msg.str().c_str());
+}
+
void ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch(ArtMethod* interface_method,
mirror::Object* this_object,
ArtMethod* referrer) {