diff options
Diffstat (limited to 'runtime/common_throws.cc')
-rw-r--r-- | runtime/common_throws.cc | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc index dd832df373..24d16c4c97 100644 --- a/runtime/common_throws.cc +++ b/runtime/common_throws.cc @@ -33,7 +33,7 @@ namespace art { -static void AddReferrerLocation(std::ostream& os, const mirror::Class* referrer) +static void AddReferrerLocation(std::ostream& os, mirror::Class* referrer) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { if (referrer != NULL) { ClassHelper kh(referrer); @@ -46,7 +46,7 @@ static void AddReferrerLocation(std::ostream& os, const mirror::Class* referrer) } static void ThrowException(const ThrowLocation* throw_location, const char* exception_descriptor, - const mirror::Class* referrer, const char* fmt, va_list* args = NULL) + mirror::Class* referrer, const char* fmt, va_list* args = NULL) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { std::ostringstream msg; if (args != NULL) { @@ -68,7 +68,7 @@ static void ThrowException(const ThrowLocation* throw_location, const char* exce // AbstractMethodError -void ThrowAbstractMethodError(const mirror::ArtMethod* method) { +void ThrowAbstractMethodError(mirror::ArtMethod* method) { ThrowException(NULL, "Ljava/lang/AbstractMethodError;", NULL, StringPrintf("abstract method \"%s\"", PrettyMethod(method).c_str()).c_str()); @@ -89,8 +89,7 @@ void ThrowArrayIndexOutOfBoundsException(int index, int length) { // ArrayStoreException -void ThrowArrayStoreException(const mirror::Class* element_class, - const mirror::Class* array_class) { +void ThrowArrayStoreException(mirror::Class* element_class, mirror::Class* array_class) { ThrowException(NULL, "Ljava/lang/ArrayStoreException;", NULL, StringPrintf("%s cannot be stored in an array of type %s", PrettyDescriptor(element_class).c_str(), @@ -99,7 +98,7 @@ void ThrowArrayStoreException(const mirror::Class* element_class, // ClassCastException -void ThrowClassCastException(const mirror::Class* dest_type, const mirror::Class* src_type) { +void ThrowClassCastException(mirror::Class* dest_type, mirror::Class* src_type) { ThrowException(NULL, "Ljava/lang/ClassCastException;", NULL, StringPrintf("%s cannot be cast to %s", PrettyDescriptor(src_type).c_str(), @@ -120,7 +119,7 @@ void ThrowClassCircularityError(mirror::Class* c) { // ClassFormatError -void ThrowClassFormatError(const mirror::Class* referrer, const char* fmt, ...) { +void ThrowClassFormatError(mirror::Class* referrer, const char* fmt, ...) { va_list args; va_start(args, fmt); ThrowException(NULL, "Ljava/lang/ClassFormatError;", referrer, fmt, &args); @@ -136,7 +135,7 @@ void ThrowIllegalAccessErrorClass(mirror::Class* referrer, mirror::Class* access } void ThrowIllegalAccessErrorClassForMethodDispatch(mirror::Class* referrer, mirror::Class* accessed, - const mirror::ArtMethod* called, + mirror::ArtMethod* called, InvokeType type) { std::ostringstream msg; msg << "Illegal class access ('" << PrettyDescriptor(referrer) << "' attempting to access '" @@ -159,7 +158,7 @@ void ThrowIllegalAccessErrorField(mirror::Class* referrer, mirror::ArtField* acc ThrowException(NULL, "Ljava/lang/IllegalAccessError;", referrer, msg.str().c_str()); } -void ThrowIllegalAccessErrorFinalField(const mirror::ArtMethod* referrer, +void ThrowIllegalAccessErrorFinalField(mirror::ArtMethod* referrer, mirror::ArtField* accessed) { std::ostringstream msg; msg << "Final field '" << PrettyField(accessed, false) << "' cannot be written to by method '" @@ -187,7 +186,7 @@ void ThrowIllegalArgumentException(const ThrowLocation* throw_location, const ch void ThrowIncompatibleClassChangeError(InvokeType expected_type, InvokeType found_type, mirror::ArtMethod* method, - const mirror::ArtMethod* referrer) { + mirror::ArtMethod* referrer) { std::ostringstream msg; msg << "The method '" << PrettyMethod(method) << "' was expected to be of type " << expected_type << " but instead was found to be of type " << found_type; @@ -196,9 +195,9 @@ void ThrowIncompatibleClassChangeError(InvokeType expected_type, InvokeType foun msg.str().c_str()); } -void ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch(const mirror::ArtMethod* interface_method, +void ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch(mirror::ArtMethod* interface_method, mirror::Object* this_object, - const mirror::ArtMethod* referrer) { + mirror::ArtMethod* referrer) { // Referrer is calling interface_method on this_object, however, the interface_method isn't // implemented by this_object. CHECK(this_object != NULL); @@ -212,8 +211,8 @@ void ThrowIncompatibleClassChangeErrorClassForInterfaceDispatch(const mirror::Ar msg.str().c_str()); } -void ThrowIncompatibleClassChangeErrorField(const mirror::ArtField* resolved_field, bool is_static, - const mirror::ArtMethod* referrer) { +void ThrowIncompatibleClassChangeErrorField(mirror::ArtField* resolved_field, bool is_static, + mirror::ArtMethod* referrer) { std::ostringstream msg; msg << "Expected '" << PrettyField(resolved_field) << "' to be a " << (is_static ? "static" : "instance") << " field" << " rather than a " @@ -222,7 +221,7 @@ void ThrowIncompatibleClassChangeErrorField(const mirror::ArtField* resolved_fie msg.str().c_str()); } -void ThrowIncompatibleClassChangeError(const mirror::Class* referrer, const char* fmt, ...) { +void ThrowIncompatibleClassChangeError(mirror::Class* referrer, const char* fmt, ...) { va_list args; va_start(args, fmt); ThrowException(NULL, "Ljava/lang/IncompatibleClassChangeError;", referrer, fmt, &args); @@ -240,7 +239,7 @@ void ThrowIOException(const char* fmt, ...) { // LinkageError -void ThrowLinkageError(const mirror::Class* referrer, const char* fmt, ...) { +void ThrowLinkageError(mirror::Class* referrer, const char* fmt, ...) { va_list args; va_start(args, fmt); ThrowException(NULL, "Ljava/lang/LinkageError;", referrer, fmt, &args); @@ -486,7 +485,7 @@ void ThrowRuntimeException(const char* fmt, ...) { // VerifyError -void ThrowVerifyError(const mirror::Class* referrer, const char* fmt, ...) { +void ThrowVerifyError(mirror::Class* referrer, const char* fmt, ...) { va_list args; va_start(args, fmt); ThrowException(NULL, "Ljava/lang/VerifyError;", referrer, fmt, &args); |