}
}
-void dvmThrowAIOOBE(int index, int length)
-{
- dvmThrowExceptionFmt("Ljava/lang/ArrayIndexOutOfBoundsException;",
- "index=%d length=%d", index, length);
-}
-
void dvmThrowAbstractMethodError(const char* msg) {
dvmThrowException("Ljava/lang/AbstractMethodError;", msg);
}
dvmThrowException("Ljava/lang/ArithmeticException;", msg);
}
+void dvmThrowArrayIndexOutOfBoundsException(int index, int length)
+{
+ dvmThrowExceptionFmt("Ljava/lang/ArrayIndexOutOfBoundsException;",
+ "index=%d length=%d", index, length);
+}
+
static void dvmThrowTypeError(const char* exceptionClassName, const char* fmt,
ClassObject* actual, ClassObject* desired)
{
dvmThrowException("Ljava/lang/RuntimeException;", msg);
}
+void dvmThrowStaleDexCacheError(const char* msg) {
+ dvmThrowException("Ldalvik/system/StaleDexCacheError;", msg);
+}
+
void dvmThrowStringIndexOutOfBoundsException(const char* msg) {
dvmThrowException("Ljava/lang/StringIndexOutOfBoundsException;", msg);
}
}
/*
- * Throw an ArrayIndexOutOfBoundsException in the current thread, using the given
- * index and array length in the detail message.
+ * Like dvmThrowChainedException, 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.
+ */
+void dvmThrowChainedExceptionByClass(ClassObject* exceptionClass,
+ const char* msg, Object* cause);
+INLINE void dvmThrowExceptionByClass(ClassObject* exceptionClass,
+ const char* msg)
+{
+ dvmThrowChainedExceptionByClass(exceptionClass, msg, NULL);
+}
+
+/*
+ * Throw the named exception using the human-readable form of the class
+ * descriptor as the exception message, and with the specified cause.
+ */
+void dvmThrowChainedExceptionWithClassMessage(const char* exceptionDescriptor,
+ const char* messageDescriptor, Object* cause);
+INLINE void dvmThrowExceptionWithClassMessage(const char* exceptionDescriptor,
+ const char* messageDescriptor)
+{
+ dvmThrowChainedExceptionWithClassMessage(exceptionDescriptor,
+ messageDescriptor, NULL);
+}
+
+/*
+ * Like dvmThrowException, but take a class object instead of a name
+ * and turn the given message into the human-readable form for a descriptor.
+ */
+void dvmThrowExceptionByClassWithClassMessage(ClassObject* exceptionClass,
+ const char* messageDescriptor);
+
+/*
+ * Return the exception being thrown in the current thread, or NULL if
+ * no exception is pending.
+ */
+INLINE Object* dvmGetException(Thread* self) {
+ return self->exception;
+}
+
+/*
+ * Set the exception being thrown in the current thread.
+ */
+INLINE void dvmSetException(Thread* self, Object* exception)
+{
+ assert(exception != NULL);
+ self->exception = exception;
+}
+
+/*
+ * Clear the pending exception.
+ *
+ * (We use this rather than "set(null)" because we may need to have special
+ * fixups here for StackOverflowError stuff. Calling "clear" in the code
+ * makes it obvious.)
*/
-void dvmThrowAIOOBE(int index, int length);
+INLINE void dvmClearException(Thread* self) {
+ self->exception = NULL;
+}
+
+/*
+ * Clear the pending exception. Used by the optimization and verification
+ * code, which has to run with "initializing" set to avoid going into a
+ * death-spin if the "class not found" exception can't be found.
+ */
+void dvmClearOptException(Thread* self);
+
+/*
+ * Returns "true" if an exception is pending. Use this if you have a
+ * "self" pointer.
+ */
+INLINE bool dvmCheckException(Thread* self) {
+ return (self->exception != NULL);
+}
+
+/*
+ * Returns "true" if this is a "checked" exception, i.e. it's a subclass
+ * of Throwable (assumed) but not a subclass of RuntimeException or Error.
+ */
+bool dvmIsCheckedException(const Object* exception);
+
+/*
+ * Wrap the now-pending exception in a different exception.
+ *
+ * If something fails, an (unchecked) exception related to that failure
+ * will be pending instead.
+ */
+void dvmWrapException(const char* newExcepStr);
+
+/*
+ * Get the "cause" field from an exception.
+ *
+ * Returns NULL if the field is null or uninitialized.
+ */
+Object* dvmGetExceptionCause(const Object* exception);
+
+/*
+ * Print the exception stack trace on stderr. Calls the exception's
+ * print function.
+ */
+void dvmPrintExceptionStackTrace(void);
+
+/*
+ * Print the exception stack trace to the log file. The exception stack
+ * trace is computed within the VM.
+ */
+void dvmLogExceptionStackTrace(void);
+
+/*
+ * Search for a catch block that matches "exception".
+ *
+ * "*newFrame" gets a copy of the new frame pointer.
+ *
+ * If "doUnroll" is set, we unroll "thread"s stack as we go (and update
+ * self->curFrame with the same value as in *newFrame).
+ *
+ * Returns the offset to the catch code on success, or -1 if we couldn't
+ * find a catcher.
+ */
+int dvmFindCatchBlock(Thread* self, int relPc, Object* exception,
+ bool doUnroll, void** newFrame);
+
+/*
+ * Support for saving exception stack traces and converting them to
+ * usable form. Use the "FillIn" function to generate a compact array
+ * that represents the stack frames, then "GetStackTrace" to convert it
+ * to an array of StackTraceElement objects.
+ *
+ * Don't call the "Internal" form of the function directly.
+ */
+void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, int* pCount);
+/* return an [I for use by interpreted code */
+INLINE Object* dvmFillInStackTrace(Thread* thread) {
+ return (Object*) dvmFillInStackTraceInternal(thread, true, NULL);
+}
+ArrayObject* dvmGetStackTrace(const Object* stackState);
+/* return an int* and array count; caller must free() the return value */
+INLINE int* dvmFillInStackTraceRaw(Thread* thread, int* pCount) {
+ return (int*) dvmFillInStackTraceInternal(thread, false, pCount);
+}
+ArrayObject* dvmGetStackTraceRaw(const int* intVals, int stackDepth);
+
+/*
+ * Print a formatted version of a raw stack trace to the log file.
+ */
+void dvmLogRawStackTrace(const int* intVals, int stackDepth);
/**
* Throw an AbstractMethodError in the current thread, with the given detail
void dvmThrowArithmeticException(const char* msg);
/*
+ * Throw an ArrayIndexOutOfBoundsException in the current thread,
+ * using the given index and array length in the detail message.
+ */
+void dvmThrowArrayIndexOutOfBoundsException(int index, int length);
+
+/*
* Throw an ArrayStoreException in the current thread, using the given classes'
* names in the detail message.
*/
void dvmThrowRuntimeException(const char* msg);
/**
+ * Throw a StaleDexCacheError in the current thread, with
+ * the given detail message.
+ */
+void dvmThrowStaleDexCacheError(const char* msg);
+
+/**
* Throw a StringIndexOutOfBoundsException in the current thread, with
* the given detail message.
*/
*/
void dvmThrowVirtualMachineError(const char* msg);
-/*
- * Like dvmThrowChainedException, 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.
- */
-void dvmThrowChainedExceptionByClass(ClassObject* exceptionClass,
- const char* msg, Object* cause);
-INLINE void dvmThrowExceptionByClass(ClassObject* exceptionClass,
- const char* msg)
-{
- dvmThrowChainedExceptionByClass(exceptionClass, msg, NULL);
-}
-
-/*
- * Throw the named exception using the human-readable form of the class
- * descriptor as the exception message, and with the specified cause.
- */
-void dvmThrowChainedExceptionWithClassMessage(const char* exceptionDescriptor,
- const char* messageDescriptor, Object* cause);
-INLINE void dvmThrowExceptionWithClassMessage(const char* exceptionDescriptor,
- const char* messageDescriptor)
-{
- dvmThrowChainedExceptionWithClassMessage(exceptionDescriptor,
- messageDescriptor, NULL);
-}
-
-/*
- * Like dvmThrowException, but take a class object instead of a name
- * and turn the given message into the human-readable form for a descriptor.
- */
-void dvmThrowExceptionByClassWithClassMessage(ClassObject* exceptionClass,
- const char* messageDescriptor);
-
-/*
- * Return the exception being thrown in the current thread, or NULL if
- * no exception is pending.
- */
-INLINE Object* dvmGetException(Thread* self) {
- return self->exception;
-}
-
-/*
- * Set the exception being thrown in the current thread.
- */
-INLINE void dvmSetException(Thread* self, Object* exception)
-{
- assert(exception != NULL);
- self->exception = exception;
-}
-
-/*
- * Clear the pending exception.
- *
- * (We use this rather than "set(null)" because we may need to have special
- * fixups here for StackOverflowError stuff. Calling "clear" in the code
- * makes it obvious.)
- */
-INLINE void dvmClearException(Thread* self) {
- self->exception = NULL;
-}
-
-/*
- * Clear the pending exception. Used by the optimization and verification
- * code, which has to run with "initializing" set to avoid going into a
- * death-spin if the "class not found" exception can't be found.
- */
-void dvmClearOptException(Thread* self);
-
-/*
- * Returns "true" if an exception is pending. Use this if you have a
- * "self" pointer.
- */
-INLINE bool dvmCheckException(Thread* self) {
- return (self->exception != NULL);
-}
-
-/*
- * Returns "true" if this is a "checked" exception, i.e. it's a subclass
- * of Throwable (assumed) but not a subclass of RuntimeException or Error.
- */
-bool dvmIsCheckedException(const Object* exception);
-
-/*
- * Wrap the now-pending exception in a different exception.
- *
- * If something fails, an (unchecked) exception related to that failure
- * will be pending instead.
- */
-void dvmWrapException(const char* newExcepStr);
-
-/*
- * Get the "cause" field from an exception.
- *
- * Returns NULL if the field is null or uninitialized.
- */
-Object* dvmGetExceptionCause(const Object* exception);
-
-/*
- * Print the exception stack trace on stderr. Calls the exception's
- * print function.
- */
-void dvmPrintExceptionStackTrace(void);
-
-/*
- * Print the exception stack trace to the log file. The exception stack
- * trace is computed within the VM.
- */
-void dvmLogExceptionStackTrace(void);
-
-/*
- * Search for a catch block that matches "exception".
- *
- * "*newFrame" gets a copy of the new frame pointer.
- *
- * If "doUnroll" is set, we unroll "thread"s stack as we go (and update
- * self->curFrame with the same value as in *newFrame).
- *
- * Returns the offset to the catch code on success, or -1 if we couldn't
- * find a catcher.
- */
-int dvmFindCatchBlock(Thread* self, int relPc, Object* exception,
- bool doUnroll, void** newFrame);
-
-/*
- * Support for saving exception stack traces and converting them to
- * usable form. Use the "FillIn" function to generate a compact array
- * that represents the stack frames, then "GetStackTrace" to convert it
- * to an array of StackTraceElement objects.
- *
- * Don't call the "Internal" form of the function directly.
- */
-void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, int* pCount);
-/* return an [I for use by interpreted code */
-INLINE Object* dvmFillInStackTrace(Thread* thread) {
- return (Object*) dvmFillInStackTraceInternal(thread, true, NULL);
-}
-ArrayObject* dvmGetStackTrace(const Object* stackState);
-/* return an int* and array count; caller must free() the return value */
-INLINE int* dvmFillInStackTraceRaw(Thread* thread, int* pCount) {
- return (int*) dvmFillInStackTraceInternal(thread, false, pCount);
-}
-ArrayObject* dvmGetStackTraceRaw(const int* intVals, int stackDepth);
-
-/*
- * Print a formatted version of a raw stack trace to the log file.
- */
-void dvmLogRawStackTrace(const int* intVals, int stackDepth);
-
#endif /*_DALVIK_EXCEPTION*/
static bool checkArrayElementBounds(ArrayObject* arrayObj, jsize index) {
assert(arrayObj != NULL);
if (index < 0 || index >= (int) arrayObj->length) {
- dvmThrowExceptionFmt("Ljava/lang/ArrayIndexOutOfBoundsException;",
- "%s index=%d length=%d", arrayObj->obj.clazz->descriptor, index,
- arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(index, arrayObj->length);
return false;
}
return true;
size = arrayData[2] | (((u4)arrayData[3]) << 16);
if (size > arrayObj->length) {
- dvmThrowAIOOBE(size, arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(size, arrayObj->length);
return false;
}
copySwappedArrayData(arrayObj->contents, &arrayData[4], size, width);
EXPORT_PC()
mov r0, r1
mov r1, r3
- bl dvmThrowAIOOBE
+ bl dvmThrowArrayIndexOutOfBoundsException
b common_exceptionThrown
/*
if (!checkForNull((Object*) arrayObj))
GOTO_exceptionThrown();
if (GET_REGISTER(vsrc2) >= arrayObj->length) {
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(
+ GET_REGISTER(vsrc2), arrayObj->length);
GOTO_exceptionThrown();
}
obj = (Object*) GET_REGISTER(vdst);
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
EXPORT_PC()
mov r0, r1
mov r1, r3
- bl dvmThrowAIOOBE
+ bl dvmThrowArrayIndexOutOfBoundsException
b common_exceptionThrown
/*
EXPORT_PC()
mov r0, r1
mov r1, r3
- bl dvmThrowAIOOBE
+ bl dvmThrowArrayIndexOutOfBoundsException
b common_exceptionThrown
/*
EXPORT_PC()
mov r0, r1
mov r1, r3
- bl dvmThrowAIOOBE
+ bl dvmThrowArrayIndexOutOfBoundsException
b common_exceptionThrown
/*
EXPORT_PC()
mov r0, r1
mov r1, r3
- bl dvmThrowAIOOBE
+ bl dvmThrowArrayIndexOutOfBoundsException
b common_exceptionThrown
/*
movl offArrayObject_length(%eax), %eax
movl %ecx,OUT_ARG0(%esp)
movl %eax,OUT_ARG1(%esp)
- call dvmThrowAIOOBE # dvmThrowAIOO(index, length)
+ call dvmThrowArrayIndexOutOfBoundsException # args (index, length)
jmp common_exceptionThrown
/*
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj))
GOTO_exceptionThrown();
if (GET_REGISTER(vsrc2) >= arrayObj->length) {
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(
+ GET_REGISTER(vsrc2), arrayObj->length);
GOTO_exceptionThrown();
}
obj = (Object*) GET_REGISTER(vdst);
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj))
GOTO_exceptionThrown();
if (GET_REGISTER(vsrc2) >= arrayObj->length) {
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(
+ GET_REGISTER(vsrc2), arrayObj->length);
GOTO_exceptionThrown();
}
obj = (Object*) GET_REGISTER(vdst);
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj))
GOTO_exceptionThrown();
if (GET_REGISTER(vsrc2) >= arrayObj->length) {
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length);
+ dvmThrowArrayIndexOutOfBoundsException(
+ GET_REGISTER(vsrc2), arrayObj->length);
GOTO_exceptionThrown();
}
obj = (Object*) GET_REGISTER(vdst);
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
SET_REGISTER##_regsize(vdst, \
if (!checkForNull((Object*) arrayObj)) \
GOTO_exceptionThrown(); \
if (GET_REGISTER(vsrc2) >= arrayObj->length) { \
- dvmThrowAIOOBE(GET_REGISTER(vsrc2), arrayObj->length); \
+ dvmThrowArrayIndexOutOfBoundsException( \
+ GET_REGISTER(vsrc2), arrayObj->length); \
GOTO_exceptionThrown(); \
} \
ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
(md) Correct OP_MONITOR_EXIT (need to adjust PC before throw)
(md) OP_THROW needs to export the PC
-(md) Use dvmThrowAIOOBE(index, length) for array bounds errors.
+(md) Use dvmThrowArrayIndexOutOfBoundsException(index, length) for
+ array bounds errors.
(md) Use dvmThrowClassCastException(actual, desired) for class cast errors.
(md) Use dvmThrowArrayStoreException(actual, desired) for array store errors.
movl offArrayObject_length(%eax), %eax
movl %ecx,OUT_ARG0(%esp)
movl %eax,OUT_ARG1(%esp)
- call dvmThrowAIOOBE # dvmThrowAIOO(index, length)
+ call dvmThrowArrayIndexOutOfBoundsException # args (index, length)
jmp common_exceptionThrown
/*
result = true;
break;
case DEX_CACHE_STALE_ODEX:
- dvmThrowException("Ldalvik/system/StaleDexCacheError;", name);
+ dvmThrowStaleDexCacheError(name);
result = -1;
break;
}