OSDN Git Service

Round three of exception cleanup.
authorDan Bornstein <danfuzz@android.com>
Thu, 24 Feb 2011 18:32:47 +0000 (10:32 -0800)
committerDan Bornstein <danfuzz@android.com>
Thu, 24 Feb 2011 18:32:47 +0000 (10:32 -0800)
I expanded AIOOBE since it was the odd one out, migrated the wrappers
in Exception.h to the end of the file where they're less disruptive,
and tweaked a couple other throws in the main vm code.

Change-Id: Iae11fda2c47989ce7579483df226124ffeb2ac84

24 files changed:
vm/Exception.c
vm/Exception.h
vm/Jni.c
vm/interp/Interp.c
vm/mterp/armv5te/footer.S
vm/mterp/c/OP_APUT_OBJECT.c
vm/mterp/c/opcommon.c
vm/mterp/out/InterpAsm-armv5te-vfp.S
vm/mterp/out/InterpAsm-armv5te.S
vm/mterp/out/InterpAsm-armv7-a-neon.S
vm/mterp/out/InterpAsm-armv7-a.S
vm/mterp/out/InterpAsm-x86.S
vm/mterp/out/InterpC-allstubs.c
vm/mterp/out/InterpC-armv5te-vfp.c
vm/mterp/out/InterpC-armv5te.c
vm/mterp/out/InterpC-armv7-a-neon.c
vm/mterp/out/InterpC-armv7-a.c
vm/mterp/out/InterpC-portdbg.c
vm/mterp/out/InterpC-portstd.c
vm/mterp/out/InterpC-x86-atom.c
vm/mterp/out/InterpC-x86.c
vm/mterp/x86-atom/TODO.txt
vm/mterp/x86/footer.S
vm/native/dalvik_system_DexFile.c

index f74072b..2e93242 100644 (file)
@@ -1354,12 +1354,6 @@ void dvmLogExceptionStackTrace(void)
     }
 }
 
-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);
 }
@@ -1368,6 +1362,12 @@ void dvmThrowArithmeticException(const char* 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)
 {
@@ -1493,6 +1493,10 @@ void dvmThrowRuntimeException(const char* msg) {
     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);
 }
index e2ee77f..ff86cd5 100644 (file)
@@ -36,10 +36,169 @@ INLINE void dvmThrowException(const char* exceptionDescriptor,
 }
 
 /*
- * 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
@@ -54,6 +213,12 @@ void dvmThrowAbstractMethodError(const char* msg);
 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.
  */
@@ -211,6 +376,12 @@ void dvmThrowOutOfMemoryError(const char* msg);
 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.
  */
@@ -234,169 +405,4 @@ void dvmThrowUnsupportedOperationException(const char* msg);
  */
 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*/
index ae9f514..18baa08 100644 (file)
--- a/vm/Jni.c
+++ b/vm/Jni.c
@@ -3085,9 +3085,7 @@ bail:
 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;
index 57900e5..1d71a67 100644 (file)
@@ -940,7 +940,7 @@ bool dvmInterpHandleFillArrayData(ArrayObject* arrayObj, const u2* arrayData)
     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);
index 50fbda6..300c45c 100644 (file)
@@ -998,7 +998,7 @@ common_errArrayIndex:
     EXPORT_PC()
     mov     r0, r1
     mov     r1, r3
-    bl      dvmThrowAIOOBE
+    bl      dvmThrowArrayIndexOutOfBoundsException
     b       common_exceptionThrown
 
 /*
index 136d0aa..f4c3326 100644 (file)
@@ -13,7 +13,8 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
         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);
index 562c039..7ee07b3 100644 (file)
@@ -452,7 +452,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -476,7 +477,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index affb807..9f144cf 100644 (file)
@@ -14158,7 +14158,7 @@ common_errArrayIndex:
     EXPORT_PC()
     mov     r0, r1
     mov     r1, r3
-    bl      dvmThrowAIOOBE
+    bl      dvmThrowArrayIndexOutOfBoundsException
     b       common_exceptionThrown
 
 /*
index b318c87..783a1de 100644 (file)
@@ -14616,7 +14616,7 @@ common_errArrayIndex:
     EXPORT_PC()
     mov     r0, r1
     mov     r1, r3
-    bl      dvmThrowAIOOBE
+    bl      dvmThrowArrayIndexOutOfBoundsException
     b       common_exceptionThrown
 
 /*
index 7a6e19c..6fe0282 100644 (file)
@@ -14096,7 +14096,7 @@ common_errArrayIndex:
     EXPORT_PC()
     mov     r0, r1
     mov     r1, r3
-    bl      dvmThrowAIOOBE
+    bl      dvmThrowArrayIndexOutOfBoundsException
     b       common_exceptionThrown
 
 /*
index ad25794..dd7171e 100644 (file)
@@ -14096,7 +14096,7 @@ common_errArrayIndex:
     EXPORT_PC()
     mov     r0, r1
     mov     r1, r3
-    bl      dvmThrowAIOOBE
+    bl      dvmThrowArrayIndexOutOfBoundsException
     b       common_exceptionThrown
 
 /*
index efb8be8..9a8f588 100644 (file)
@@ -13851,7 +13851,7 @@ common_errArrayIndex:
     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
 
 /*
index 14629ff..87293e0 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
@@ -2166,7 +2168,8 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
         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);
index 6c55d85..bd8e838 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index 4c23e4f..c6123e5 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index 95176c7..45c3135 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index d2e7e35..2fc1313 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index a022859..198de61 100644 (file)
@@ -987,7 +987,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1011,7 +1012,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
@@ -2529,7 +2531,8 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
         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);
index eb65560..6b61644 100644 (file)
@@ -978,7 +978,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1002,7 +1003,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
@@ -2279,7 +2281,8 @@ HANDLE_OPCODE(OP_APUT_OBJECT /*vAA, vBB, vCC*/)
         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);
index 94c5eb9..47ae3ca 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index f1a0ca7..c12b262 100644 (file)
@@ -995,7 +995,8 @@ GOTO_TARGET_DECL(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,                                        \
@@ -1019,7 +1020,8 @@ GOTO_TARGET_DECL(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();                                         \
         }                                                                   \
         ILOGV("+ APUT[%d]=0x%08x", GET_REGISTER(vsrc2), GET_REGISTER(vdst));\
index 4d06bb3..533894c 100644 (file)
@@ -17,7 +17,8 @@ Items requiring attention:
 
 (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.
 
index 87ed7cd..e1e8404 100644 (file)
@@ -616,7 +616,7 @@ common_errArrayIndex:
     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
 
 /*
index cee7d17..af7eb89 100644 (file)
@@ -513,7 +513,7 @@ static void Dalvik_dalvik_system_DexFile_isDexOptNeeded(const u4* args,
         result = true;
         break;
     case DEX_CACHE_STALE_ODEX:
-        dvmThrowException("Ldalvik/system/StaleDexCacheError;", name);
+        dvmThrowStaleDexCacheError(name);
         result = -1;
         break;
     }