diff options
author | Dan Bornstein <danfuzz@android.com> | 2011-03-04 10:27:32 -0800 |
---|---|---|
committer | Dan Bornstein <danfuzz@android.com> | 2011-03-04 10:58:16 -0800 |
commit | 9807b4e9412a6ce6863688c84a36ce294028ff04 (patch) | |
tree | ad5f530f1d020cbccd295cbf787e6a641e9a61ae /vm/Exception.h | |
parent | 768ddd4c4af06572872b8338b2b37af2f2239958 (diff) | |
download | android_dalvik-9807b4e9412a6ce6863688c84a36ce294028ff04.tar.gz android_dalvik-9807b4e9412a6ce6863688c84a36ce294028ff04.tar.bz2 android_dalvik-9807b4e9412a6ce6863688c84a36ce294028ff04.zip |
Clean out now-unused exception code.
We hereby wish a fond farewell to the throw functions that took
a string name for the exception.
Bug: 3500987
Change-Id: I869ddc2b4e45d3122859249d4010e452d790fa1f
Diffstat (limited to 'vm/Exception.h')
-rw-r--r-- | vm/Exception.h | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/vm/Exception.h b/vm/Exception.h index ccab18cb2..d447591fe 100644 --- a/vm/Exception.h +++ b/vm/Exception.h @@ -21,37 +21,22 @@ #define _DALVIK_EXCEPTION /* - * Throw an exception in the current thread, by class descriptor. - */ -void dvmThrowChainedException(const char* exceptionDescriptor, const char* msg, - Object* cause); -INLINE void dvmThrowException(const char* exceptionDescriptor, - const char* msg) -{ - dvmThrowChainedException(exceptionDescriptor, msg, NULL); -} - -/* - * Like dvmThrowException, but takes printf-style args for the message. - */ -void dvmThrowExceptionFmtV(const char* exceptionDescriptor, const char* fmt, - va_list args); -void dvmThrowExceptionFmt(const char* exceptionDescriptor, const char* fmt, ...) -#if defined(__GNUC__) - __attribute__ ((format(printf, 2, 3))) -#endif - ; -INLINE void dvmThrowExceptionFmt(const char* exceptionDescriptor, - const char* fmt, ...) -{ - va_list args; - va_start(args, fmt); - dvmThrowExceptionFmtV(exceptionDescriptor, fmt, args); - va_end(args); -} - -/* - * Throw an exception in the current thread, by class object. + * Create a Throwable and throw an exception in the current thread (where + * "throwing" just means "set the thread's exception pointer"). + * + * "msg" and/or "cause" may be NULL. + * + * If we have a bad exception hierarchy -- something in Throwable.<init> + * is missing -- then every attempt to throw an exception will result + * in another exception. Exceptions are generally allowed to "chain" + * to other exceptions, so it's hard to auto-detect this problem. It can + * only happen if the system classes are broken, so it's probably not + * worth spending cycles to detect it. + * + * We do have one case to worry about: if the classpath is completely + * wrong, we'll go into a death spin during startup because we can't find + * the initial class and then we can't find NoClassDefFoundError. We have + * to handle this case. */ void dvmThrowChainedExceptionByClass(ClassObject* exceptionClass, const char* msg, Object* cause); @@ -62,8 +47,7 @@ INLINE void dvmThrowExceptionByClass(ClassObject* exceptionClass, } /* - * Like dvmThrowExceptionFmt, but takes an exception class object instead - * of a descriptor string. + * Like dvmThrowExceptionByClass, but takes printf-style args for the message. */ void dvmThrowExceptionFmtByClassV(ClassObject* exceptionClass, const char* fmt, va_list args); @@ -83,15 +67,16 @@ INLINE void dvmThrowExceptionFmtByClass(ClassObject* exceptionClass, } /* - * Like dvmThrowChainedException, but take a class object instead of a name - * and turn the given message into the human-readable form for a descriptor. + * Like dvmThrowChainedExceptionByClass, but take a class object + * instead of a name and turn the given message into the + * human-readable form for a descriptor. */ void dvmThrowChainedExceptionByClassWithClassMessage( ClassObject* exceptionClass, const char* messageDescriptor, Object* cause); /* - * Like dvmThrowException, but take a class object instead of a name + * Like dvmThrowExceptionByClass, but take a class object instead of a name * and turn the given message into the human-readable form for a descriptor. */ INLINE void dvmThrowExceptionByClassWithClassMessage( |