Exception cleanup in the assembly interpreters
Removed the last of the "exception as strings" calls from the
assembly interpreters, replacing them with the helper functions.
Change-Id: I4c44cde348ed7d2ea99f908bc22166afeb5e3d37
diff --git a/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY.S b/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY.S
index 41a62a2..8c79cc1 100644
--- a/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY.S
+++ b/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY.S
@@ -95,14 +95,11 @@
* mode of filled-new-array.
*/
.L${opcode}_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!$isrange) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
diff --git a/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY_JUMBO.S b/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY_JUMBO.S
index 0c43cc8..a3f1695 100644
--- a/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY_JUMBO.S
+++ b/vm/mterp/armv5te/OP_FILLED_NEW_ARRAY_JUMBO.S
@@ -72,7 +72,6 @@
* mode of filled-new-array.
*/
.L${opcode}_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
diff --git a/vm/mterp/armv5te/OP_NEW_INSTANCE.S b/vm/mterp/armv5te/OP_NEW_INSTANCE.S
index cb9ce68..ce1f0c8 100644
--- a/vm/mterp/armv5te/OP_NEW_INSTANCE.S
+++ b/vm/mterp/armv5te/OP_NEW_INSTANCE.S
@@ -63,6 +63,3 @@
cmp r0, #0 @ got null?
bne .L${opcode}_resolved @ no, continue
b common_exceptionThrown @ yes, handle exception
-
-.LstrInstantiationErrorPtr:
- .word .LstrInstantiationError
diff --git a/vm/mterp/armv5te/footer.S b/vm/mterp/armv5te/footer.S
index 3bfc15f..0c6b0f4 100644
--- a/vm/mterp/armv5te/footer.S
+++ b/vm/mterp/armv5te/footer.S
@@ -1006,9 +1006,8 @@
*/
common_errDivideByZero:
EXPORT_PC()
- ldr r0, strArithmeticException
- ldr r1, strDivideByZero
- bl dvmThrowException
+ ldr r0, strDivideByZero
+ bl dvmThrowArithmeticException
b common_exceptionThrown
/*
@@ -1023,12 +1022,12 @@
/*
* Invocation of a non-existent method.
+ * On entry: method name in r1
*/
common_errNoSuchMethod:
EXPORT_PC()
- ldr r0, strNoSuchMethodError
- mov r1, #0
- bl dvmThrowException
+ mov r0, r1
+ bl dvmThrowNoSuchMethodError
b common_exceptionThrown
/*
@@ -1038,9 +1037,8 @@
*/
common_errNullObject:
EXPORT_PC()
- ldr r0, strNullPointerException
- mov r1, #0
- bl dvmThrowException
+ mov r0, #0
+ bl dvmThrowNullPointerException
b common_exceptionThrown
/*
@@ -1176,15 +1174,8 @@
* String references, must be close to the code that uses them.
*/
.align 2
-strArithmeticException:
- .word .LstrArithmeticException
strDivideByZero:
.word .LstrDivideByZero
-strNoSuchMethodError:
- .word .LstrNoSuchMethodError
-strNullPointerException:
- .word .LstrNullPointerException
-
strLogTag:
.word .LstrLogTag
strExceptionNotCaughtLocally:
@@ -1212,21 +1203,10 @@
.LstrBadEntryPoint:
.asciz "Bad entry point %d\n"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
-.LstrDivideByZero:
- .asciz "divide by zero"
.LstrFilledNewArrayNotImpl:
.asciz "filled-new-array only implemented for objects and 'int'"
-.LstrInternalError:
- .asciz "Ljava/lang/InternalError;"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-
+.LstrDivideByZero:
+ .asciz "divide by zero"
.LstrLogTag:
.asciz "mterp"
.LstrExceptionNotCaughtLocally:
diff --git a/vm/mterp/armv5te/header.S b/vm/mterp/armv5te/header.S
index 3d755a2..d40cab5 100644
--- a/vm/mterp/armv5te/header.S
+++ b/vm/mterp/armv5te/header.S
@@ -82,7 +82,7 @@
/*
* "export" the PC to the stack frame, f/b/o future exception objects. Must
- * be done *before* something calls dvmThrowException.
+ * be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
diff --git a/vm/mterp/c/header.c b/vm/mterp/c/header.c
index bd86362..4f2cabe 100644
--- a/vm/mterp/c/header.c
+++ b/vm/mterp/c/header.c
@@ -310,10 +310,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpAsm-armv5te-vfp.S b/vm/mterp/out/InterpAsm-armv5te-vfp.S
index cb2c4ae..12e31a4 100644
--- a/vm/mterp/out/InterpAsm-armv5te-vfp.S
+++ b/vm/mterp/out/InterpAsm-armv5te-vfp.S
@@ -89,7 +89,7 @@
/*
* "export" the PC to the stack frame, f/b/o future exception objects. Must
- * be done *before* something calls dvmThrowException.
+ * be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
@@ -10784,9 +10784,6 @@
bne .LOP_NEW_INSTANCE_resolved @ no, continue
b common_exceptionThrown @ yes, handle exception
-.LstrInstantiationErrorPtr:
- .word .LstrInstantiationError
-
/* continuation for OP_NEW_ARRAY */
@@ -10898,16 +10895,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!0) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
@@ -10982,16 +10976,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!1) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_CMPL_FLOAT */
@@ -12442,9 +12433,8 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_JUMBO_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
/* continuation for OP_IGET_JUMBO */
@@ -21338,9 +21328,8 @@
*/
common_errDivideByZero:
EXPORT_PC()
- ldr r0, strArithmeticException
- ldr r1, strDivideByZero
- bl dvmThrowException
+ ldr r0, strDivideByZero
+ bl dvmThrowArithmeticException
b common_exceptionThrown
/*
@@ -21355,12 +21344,12 @@
/*
* Invocation of a non-existent method.
+ * On entry: method name in r1
*/
common_errNoSuchMethod:
EXPORT_PC()
- ldr r0, strNoSuchMethodError
- mov r1, #0
- bl dvmThrowException
+ mov r0, r1
+ bl dvmThrowNoSuchMethodError
b common_exceptionThrown
/*
@@ -21370,9 +21359,8 @@
*/
common_errNullObject:
EXPORT_PC()
- ldr r0, strNullPointerException
- mov r1, #0
- bl dvmThrowException
+ mov r0, #0
+ bl dvmThrowNullPointerException
b common_exceptionThrown
/*
@@ -21508,15 +21496,8 @@
* String references, must be close to the code that uses them.
*/
.align 2
-strArithmeticException:
- .word .LstrArithmeticException
strDivideByZero:
.word .LstrDivideByZero
-strNoSuchMethodError:
- .word .LstrNoSuchMethodError
-strNullPointerException:
- .word .LstrNullPointerException
-
strLogTag:
.word .LstrLogTag
strExceptionNotCaughtLocally:
@@ -21544,21 +21525,10 @@
.LstrBadEntryPoint:
.asciz "Bad entry point %d\n"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
-.LstrDivideByZero:
- .asciz "divide by zero"
.LstrFilledNewArrayNotImpl:
.asciz "filled-new-array only implemented for objects and 'int'"
-.LstrInternalError:
- .asciz "Ljava/lang/InternalError;"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-
+.LstrDivideByZero:
+ .asciz "divide by zero"
.LstrLogTag:
.asciz "mterp"
.LstrExceptionNotCaughtLocally:
diff --git a/vm/mterp/out/InterpAsm-armv5te.S b/vm/mterp/out/InterpAsm-armv5te.S
index 90d8932..a36a75a 100644
--- a/vm/mterp/out/InterpAsm-armv5te.S
+++ b/vm/mterp/out/InterpAsm-armv5te.S
@@ -89,7 +89,7 @@
/*
* "export" the PC to the stack frame, f/b/o future exception objects. Must
- * be done *before* something calls dvmThrowException.
+ * be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
@@ -11106,9 +11106,6 @@
bne .LOP_NEW_INSTANCE_resolved @ no, continue
b common_exceptionThrown @ yes, handle exception
-.LstrInstantiationErrorPtr:
- .word .LstrInstantiationError
-
/* continuation for OP_NEW_ARRAY */
@@ -11220,16 +11217,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!0) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
@@ -11304,16 +11298,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!1) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_CMPL_FLOAT */
@@ -12900,9 +12891,8 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_JUMBO_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
/* continuation for OP_IGET_JUMBO */
@@ -21796,9 +21786,8 @@
*/
common_errDivideByZero:
EXPORT_PC()
- ldr r0, strArithmeticException
- ldr r1, strDivideByZero
- bl dvmThrowException
+ ldr r0, strDivideByZero
+ bl dvmThrowArithmeticException
b common_exceptionThrown
/*
@@ -21813,12 +21802,12 @@
/*
* Invocation of a non-existent method.
+ * On entry: method name in r1
*/
common_errNoSuchMethod:
EXPORT_PC()
- ldr r0, strNoSuchMethodError
- mov r1, #0
- bl dvmThrowException
+ mov r0, r1
+ bl dvmThrowNoSuchMethodError
b common_exceptionThrown
/*
@@ -21828,9 +21817,8 @@
*/
common_errNullObject:
EXPORT_PC()
- ldr r0, strNullPointerException
- mov r1, #0
- bl dvmThrowException
+ mov r0, #0
+ bl dvmThrowNullPointerException
b common_exceptionThrown
/*
@@ -21966,15 +21954,8 @@
* String references, must be close to the code that uses them.
*/
.align 2
-strArithmeticException:
- .word .LstrArithmeticException
strDivideByZero:
.word .LstrDivideByZero
-strNoSuchMethodError:
- .word .LstrNoSuchMethodError
-strNullPointerException:
- .word .LstrNullPointerException
-
strLogTag:
.word .LstrLogTag
strExceptionNotCaughtLocally:
@@ -22002,21 +21983,10 @@
.LstrBadEntryPoint:
.asciz "Bad entry point %d\n"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
-.LstrDivideByZero:
- .asciz "divide by zero"
.LstrFilledNewArrayNotImpl:
.asciz "filled-new-array only implemented for objects and 'int'"
-.LstrInternalError:
- .asciz "Ljava/lang/InternalError;"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-
+.LstrDivideByZero:
+ .asciz "divide by zero"
.LstrLogTag:
.asciz "mterp"
.LstrExceptionNotCaughtLocally:
diff --git a/vm/mterp/out/InterpAsm-armv7-a-neon.S b/vm/mterp/out/InterpAsm-armv7-a-neon.S
index 0f69049..4ef5d0d 100644
--- a/vm/mterp/out/InterpAsm-armv7-a-neon.S
+++ b/vm/mterp/out/InterpAsm-armv7-a-neon.S
@@ -89,7 +89,7 @@
/*
* "export" the PC to the stack frame, f/b/o future exception objects. Must
- * be done *before* something calls dvmThrowException.
+ * be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
@@ -10738,9 +10738,6 @@
bne .LOP_NEW_INSTANCE_resolved @ no, continue
b common_exceptionThrown @ yes, handle exception
-.LstrInstantiationErrorPtr:
- .word .LstrInstantiationError
-
/* continuation for OP_NEW_ARRAY */
@@ -10852,16 +10849,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!0) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
@@ -10936,16 +10930,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!1) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_CMPL_FLOAT */
@@ -12380,9 +12371,8 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_JUMBO_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
/* continuation for OP_IGET_JUMBO */
@@ -21276,9 +21266,8 @@
*/
common_errDivideByZero:
EXPORT_PC()
- ldr r0, strArithmeticException
- ldr r1, strDivideByZero
- bl dvmThrowException
+ ldr r0, strDivideByZero
+ bl dvmThrowArithmeticException
b common_exceptionThrown
/*
@@ -21293,12 +21282,12 @@
/*
* Invocation of a non-existent method.
+ * On entry: method name in r1
*/
common_errNoSuchMethod:
EXPORT_PC()
- ldr r0, strNoSuchMethodError
- mov r1, #0
- bl dvmThrowException
+ mov r0, r1
+ bl dvmThrowNoSuchMethodError
b common_exceptionThrown
/*
@@ -21308,9 +21297,8 @@
*/
common_errNullObject:
EXPORT_PC()
- ldr r0, strNullPointerException
- mov r1, #0
- bl dvmThrowException
+ mov r0, #0
+ bl dvmThrowNullPointerException
b common_exceptionThrown
/*
@@ -21446,15 +21434,8 @@
* String references, must be close to the code that uses them.
*/
.align 2
-strArithmeticException:
- .word .LstrArithmeticException
strDivideByZero:
.word .LstrDivideByZero
-strNoSuchMethodError:
- .word .LstrNoSuchMethodError
-strNullPointerException:
- .word .LstrNullPointerException
-
strLogTag:
.word .LstrLogTag
strExceptionNotCaughtLocally:
@@ -21482,21 +21463,10 @@
.LstrBadEntryPoint:
.asciz "Bad entry point %d\n"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
-.LstrDivideByZero:
- .asciz "divide by zero"
.LstrFilledNewArrayNotImpl:
.asciz "filled-new-array only implemented for objects and 'int'"
-.LstrInternalError:
- .asciz "Ljava/lang/InternalError;"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-
+.LstrDivideByZero:
+ .asciz "divide by zero"
.LstrLogTag:
.asciz "mterp"
.LstrExceptionNotCaughtLocally:
diff --git a/vm/mterp/out/InterpAsm-armv7-a.S b/vm/mterp/out/InterpAsm-armv7-a.S
index fd218ea..c1a790b 100644
--- a/vm/mterp/out/InterpAsm-armv7-a.S
+++ b/vm/mterp/out/InterpAsm-armv7-a.S
@@ -89,7 +89,7 @@
/*
* "export" the PC to the stack frame, f/b/o future exception objects. Must
- * be done *before* something calls dvmThrowException.
+ * be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
@@ -10738,9 +10738,6 @@
bne .LOP_NEW_INSTANCE_resolved @ no, continue
b common_exceptionThrown @ yes, handle exception
-.LstrInstantiationErrorPtr:
- .word .LstrInstantiationError
-
/* continuation for OP_NEW_ARRAY */
@@ -10852,16 +10849,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!0) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
@@ -10936,16 +10930,13 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
.if (!1) @ define in one or the other, not both
.L_strFilledNewArrayNotImpl:
.word .LstrFilledNewArrayNotImpl
-.L_strInternalError:
- .word .LstrInternalError
.endif
/* continuation for OP_CMPL_FLOAT */
@@ -12380,9 +12371,8 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_JUMBO_notimpl:
- ldr r0, .L_strInternalError
- ldr r1, .L_strFilledNewArrayNotImpl
- bl dvmThrowException
+ ldr r0, .L_strFilledNewArrayNotImpl
+ bl dvmThrowInternalError
b common_exceptionThrown
/* continuation for OP_IGET_JUMBO */
@@ -21276,9 +21266,8 @@
*/
common_errDivideByZero:
EXPORT_PC()
- ldr r0, strArithmeticException
- ldr r1, strDivideByZero
- bl dvmThrowException
+ ldr r0, strDivideByZero
+ bl dvmThrowArithmeticException
b common_exceptionThrown
/*
@@ -21293,12 +21282,12 @@
/*
* Invocation of a non-existent method.
+ * On entry: method name in r1
*/
common_errNoSuchMethod:
EXPORT_PC()
- ldr r0, strNoSuchMethodError
- mov r1, #0
- bl dvmThrowException
+ mov r0, r1
+ bl dvmThrowNoSuchMethodError
b common_exceptionThrown
/*
@@ -21308,9 +21297,8 @@
*/
common_errNullObject:
EXPORT_PC()
- ldr r0, strNullPointerException
- mov r1, #0
- bl dvmThrowException
+ mov r0, #0
+ bl dvmThrowNullPointerException
b common_exceptionThrown
/*
@@ -21446,15 +21434,8 @@
* String references, must be close to the code that uses them.
*/
.align 2
-strArithmeticException:
- .word .LstrArithmeticException
strDivideByZero:
.word .LstrDivideByZero
-strNoSuchMethodError:
- .word .LstrNoSuchMethodError
-strNullPointerException:
- .word .LstrNullPointerException
-
strLogTag:
.word .LstrLogTag
strExceptionNotCaughtLocally:
@@ -21482,21 +21463,10 @@
.LstrBadEntryPoint:
.asciz "Bad entry point %d\n"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
-.LstrDivideByZero:
- .asciz "divide by zero"
.LstrFilledNewArrayNotImpl:
.asciz "filled-new-array only implemented for objects and 'int'"
-.LstrInternalError:
- .asciz "Ljava/lang/InternalError;"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-
+.LstrDivideByZero:
+ .asciz "divide by zero"
.LstrLogTag:
.asciz "mterp"
.LstrExceptionNotCaughtLocally:
diff --git a/vm/mterp/out/InterpAsm-x86.S b/vm/mterp/out/InterpAsm-x86.S
index 4f7a2f5..6698447 100644
--- a/vm/mterp/out/InterpAsm-x86.S
+++ b/vm/mterp/out/InterpAsm-x86.S
@@ -147,7 +147,7 @@
/*
* "export" the PC to the interpreted stack frame, f/b/o future exception
- * objects. Must * be done *before* something calls dvmThrowException.
+ * objects. Must be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)
@@ -1028,11 +1028,7 @@
cmpb $CLASS_INITIALIZED,offClassObject_status(%ecx)
jne .LOP_NEW_INSTANCE_needinit
.LOP_NEW_INSTANCE_initialized: # on entry, ecx<- class
- /* TODO: remove test for interface/abstract, now done in verifier */
- testl $(ACC_INTERFACE|ACC_ABSTRACT),offClassObject_accessFlags(%ecx)
movl $ALLOC_DONT_TRACK,OUT_ARG1(%esp)
- jne .LOP_NEW_INSTANCE_abstract
-.LOP_NEW_INSTANCE_finish: # ecx=class
movl %ecx,OUT_ARG0(%esp)
call dvmAllocObject # eax<- new object
FETCH_INST_OPCODE 2 %ecx
@@ -1075,20 +1071,6 @@
jne .LOP_NEW_INSTANCE_resolved # good to go
jmp common_exceptionThrown # no, handle exception
- /*
- * TODO: remove this
- * We can't instantiate an abstract class or interface, so throw an
- * InstantiationError with the class descriptor as the message.
- *
- * ecx holds class object
- */
-.LOP_NEW_INSTANCE_abstract:
- movl offClassObject_descriptor(%ecx),%eax
- movl $.LstrInstantiationError,OUT_ARG0(%esp)
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowExceptionWithClassMessage
- jmp common_exceptionThrown
-
/* ------------------------------ */
.L_OP_NEW_ARRAY: /* 0x23 */
/* File: x86/OP_NEW_ARRAY.S */
@@ -1279,11 +1261,9 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
- movl $.LstrInternalErrorA,%eax
- movl %eax,OUT_ARG0(%esp)
movl $.LstrFilledNewArrayNotImplA,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowInternalError
jmp common_exceptionThrown
/* ------------------------------ */
@@ -1412,11 +1392,9 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
- movl $.LstrInternalErrorA,%eax
- movl %eax,OUT_ARG0(%esp)
movl $.LstrFilledNewArrayNotImplA,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowInternalError
jmp common_exceptionThrown
@@ -4003,7 +3981,6 @@
*/
.LOP_INVOKE_SUPER_nsm:
movl offMethod_name(%ecx),%eax
- mov %eax,OUT_ARG1(%esp)
jmp common_errNoSuchMethod
/* ------------------------------ */
@@ -4246,7 +4223,6 @@
*/
.LOP_INVOKE_SUPER_RANGE_nsm:
movl offMethod_name(%ecx),%eax
- mov %eax,OUT_ARG1(%esp)
jmp common_errNoSuchMethod
@@ -8187,11 +8163,7 @@
cmpb $CLASS_INITIALIZED,offClassObject_status(%ecx)
jne .LOP_NEW_INSTANCE_JUMBO_needinit
.LOP_NEW_INSTANCE_JUMBO_initialized: # on entry, ecx<- class
- /* TODO: remove test for interface/abstract, now done in verifier */
- testl $(ACC_INTERFACE|ACC_ABSTRACT),offClassObject_accessFlags(%ecx)
movl $ALLOC_DONT_TRACK,OUT_ARG1(%esp)
- jne .LOP_NEW_INSTANCE_JUMBO_abstract
-.LOP_NEW_INSTANCE_JUMBO_finish: # ecx=class
movl %ecx,OUT_ARG0(%esp)
call dvmAllocObject # eax<- new object
UNSPILL(rIBASE)
@@ -8234,20 +8206,6 @@
jne .LOP_NEW_INSTANCE_JUMBO_resolved # good to go
jmp common_exceptionThrown # no, handle exception
- /*
- * TODO: remove this
- * We can't instantiate an abstract class or interface, so throw an
- * InstantiationError with the class descriptor as the message.
- *
- * ecx holds class object
- */
-.LOP_NEW_INSTANCE_JUMBO_abstract:
- movl offClassObject_descriptor(%ecx),%eax
- movl $.LstrInstantiationError,OUT_ARG0(%esp)
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowExceptionWithClassMessage
- jmp common_exceptionThrown
-
/* ------------------------------ */
.L_OP_NEW_ARRAY_JUMBO: /* 0x104 */
/* File: x86/OP_NEW_ARRAY_JUMBO.S */
@@ -8408,11 +8366,9 @@
* mode of filled-new-array.
*/
.LOP_FILLED_NEW_ARRAY_JUMBO_notimpl:
- movl $.LstrInternalErrorA,%eax
- movl %eax,OUT_ARG0(%esp)
movl $.LstrFilledNewArrayNotImplA,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowInternalError
jmp common_exceptionThrown
/* ------------------------------ */
@@ -9846,7 +9802,6 @@
*/
.LOP_INVOKE_SUPER_JUMBO_nsm:
movl offMethod_name(%ecx),%eax
- mov %eax,OUT_ARG1(%esp)
jmp common_errNoSuchMethod
/* ------------------------------ */
@@ -21916,11 +21871,9 @@
*/
common_errDivideByZero:
EXPORT_PC
- movl $.LstrArithmeticException,%eax
- movl %eax,OUT_ARG0(%esp)
movl $.LstrDivideByZero,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowArithmeticException
jmp common_exceptionThrown
/*
@@ -21935,15 +21888,13 @@
/*
* Attempt to allocate an array with a negative size.
+ * On entry, method name in eax
*/
common_errNoSuchMethod:
EXPORT_PC
- movl $.LstrNoSuchMethodError,%eax
movl %eax,OUT_ARG0(%esp)
- xorl %eax,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ call dvmThrowNoSuchMethodError
jmp common_exceptionThrown
/*
@@ -21952,11 +21903,9 @@
*/
common_errNullObject:
EXPORT_PC
- movl $.LstrNullPointerException,%eax
- movl %eax,OUT_ARG0(%esp)
xorl %eax,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowNullPointerException
jmp common_exceptionThrown
/*
@@ -22000,18 +21949,8 @@
*/
.section .rodata
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
.LstrDivideByZero:
.asciz "divide by zero"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrInternalErrorA:
- .asciz "Ljava/lang/InternalError;"
.LstrFilledNewArrayNotImplA:
.asciz "filled-new-array only implemented for 'int'"
diff --git a/vm/mterp/out/InterpC-allstubs.c b/vm/mterp/out/InterpC-allstubs.c
index 248f37e..6dc0fac 100644
--- a/vm/mterp/out/InterpC-allstubs.c
+++ b/vm/mterp/out/InterpC-allstubs.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-armv5te-vfp.c b/vm/mterp/out/InterpC-armv5te-vfp.c
index bd8e838..0e13835 100644
--- a/vm/mterp/out/InterpC-armv5te-vfp.c
+++ b/vm/mterp/out/InterpC-armv5te-vfp.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-armv5te.c b/vm/mterp/out/InterpC-armv5te.c
index c6123e5..5847600 100644
--- a/vm/mterp/out/InterpC-armv5te.c
+++ b/vm/mterp/out/InterpC-armv5te.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-armv7-a-neon.c b/vm/mterp/out/InterpC-armv7-a-neon.c
index 45c3135..0e87b82 100644
--- a/vm/mterp/out/InterpC-armv7-a-neon.c
+++ b/vm/mterp/out/InterpC-armv7-a-neon.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-armv7-a.c b/vm/mterp/out/InterpC-armv7-a.c
index 2fc1313..92aeff1 100644
--- a/vm/mterp/out/InterpC-armv7-a.c
+++ b/vm/mterp/out/InterpC-armv7-a.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-portdbg.c b/vm/mterp/out/InterpC-portdbg.c
index e002973..0a644e6 100644
--- a/vm/mterp/out/InterpC-portdbg.c
+++ b/vm/mterp/out/InterpC-portdbg.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-portstd.c b/vm/mterp/out/InterpC-portstd.c
index 94f182e..4c5c2cc 100644
--- a/vm/mterp/out/InterpC-portstd.c
+++ b/vm/mterp/out/InterpC-portstd.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-x86-atom.c b/vm/mterp/out/InterpC-x86-atom.c
index 47ae3ca..edaac5a 100644
--- a/vm/mterp/out/InterpC-x86-atom.c
+++ b/vm/mterp/out/InterpC-x86-atom.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/out/InterpC-x86.c b/vm/mterp/out/InterpC-x86.c
index c12b262..ce8d580 100644
--- a/vm/mterp/out/InterpC-x86.c
+++ b/vm/mterp/out/InterpC-x86.c
@@ -317,10 +317,10 @@
/*
* The current PC must be available to Throwable constructors, e.g.
- * those created by dvmThrowException(), so that the exception stack
- * trace can be generated correctly. If we don't do this, the offset
- * within the current method won't be shown correctly. See the notes
- * in Exception.c.
+ * those created by the various exception throw routines, so that the
+ * exception stack trace can be generated correctly. If we don't do this,
+ * the offset within the current method won't be shown correctly. See the
+ * notes in Exception.c.
*
* This is also used to determine the address for precise GC.
*
diff --git a/vm/mterp/x86-atom/TODO.txt b/vm/mterp/x86-atom/TODO.txt
index 0da4d71..1c0acc8 100644
--- a/vm/mterp/x86-atom/TODO.txt
+++ b/vm/mterp/x86-atom/TODO.txt
@@ -24,6 +24,7 @@
(md) Use dvmThrowClassCastException(actual, desired) for class cast errors.
(md) Use dvmThrowArrayStoreException(actual, desired) for array store errors.
(md) Use dvmThrowNegativeArraySizeException(len) forarray alloc errors
+(md) Replace any remaining use of dvmThrowException with proper helper function
(lo) Implement OP_BREAKPOINT
(lo) Implement OP_EXECUTE_INLINE_RANGE
diff --git a/vm/mterp/x86/OP_FILLED_NEW_ARRAY.S b/vm/mterp/x86/OP_FILLED_NEW_ARRAY.S
index 91a26b8..dde53aa 100644
--- a/vm/mterp/x86/OP_FILLED_NEW_ARRAY.S
+++ b/vm/mterp/x86/OP_FILLED_NEW_ARRAY.S
@@ -123,9 +123,7 @@
* mode of filled-new-array.
*/
.L${opcode}_notimpl:
- movl $$.LstrInternalErrorA,%eax
- movl %eax,OUT_ARG0(%esp)
movl $$.LstrFilledNewArrayNotImplA,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowInternalError
jmp common_exceptionThrown
diff --git a/vm/mterp/x86/OP_FILLED_NEW_ARRAY_JUMBO.S b/vm/mterp/x86/OP_FILLED_NEW_ARRAY_JUMBO.S
index 1a285f1..80f2b38 100644
--- a/vm/mterp/x86/OP_FILLED_NEW_ARRAY_JUMBO.S
+++ b/vm/mterp/x86/OP_FILLED_NEW_ARRAY_JUMBO.S
@@ -94,9 +94,7 @@
* mode of filled-new-array.
*/
.L${opcode}_notimpl:
- movl $$.LstrInternalErrorA,%eax
- movl %eax,OUT_ARG0(%esp)
movl $$.LstrFilledNewArrayNotImplA,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowInternalError
jmp common_exceptionThrown
diff --git a/vm/mterp/x86/OP_INVOKE_SUPER.S b/vm/mterp/x86/OP_INVOKE_SUPER.S
index c8ca2e1..ecee028 100644
--- a/vm/mterp/x86/OP_INVOKE_SUPER.S
+++ b/vm/mterp/x86/OP_INVOKE_SUPER.S
@@ -63,5 +63,4 @@
*/
.L${opcode}_nsm:
movl offMethod_name(%ecx),%eax
- mov %eax,OUT_ARG1(%esp)
jmp common_errNoSuchMethod
diff --git a/vm/mterp/x86/OP_INVOKE_SUPER_JUMBO.S b/vm/mterp/x86/OP_INVOKE_SUPER_JUMBO.S
index b090963..d98e14d 100644
--- a/vm/mterp/x86/OP_INVOKE_SUPER_JUMBO.S
+++ b/vm/mterp/x86/OP_INVOKE_SUPER_JUMBO.S
@@ -56,5 +56,4 @@
*/
.L${opcode}_nsm:
movl offMethod_name(%ecx),%eax
- mov %eax,OUT_ARG1(%esp)
jmp common_errNoSuchMethod
diff --git a/vm/mterp/x86/OP_NEW_INSTANCE.S b/vm/mterp/x86/OP_NEW_INSTANCE.S
index 00a178b..3e268c4 100644
--- a/vm/mterp/x86/OP_NEW_INSTANCE.S
+++ b/vm/mterp/x86/OP_NEW_INSTANCE.S
@@ -23,11 +23,7 @@
cmpb $$CLASS_INITIALIZED,offClassObject_status(%ecx)
jne .L${opcode}_needinit
.L${opcode}_initialized: # on entry, ecx<- class
- /* TODO: remove test for interface/abstract, now done in verifier */
- testl $$(ACC_INTERFACE|ACC_ABSTRACT),offClassObject_accessFlags(%ecx)
movl $$ALLOC_DONT_TRACK,OUT_ARG1(%esp)
- jne .L${opcode}_abstract
-.L${opcode}_finish: # ecx=class
movl %ecx,OUT_ARG0(%esp)
call dvmAllocObject # eax<- new object
FETCH_INST_OPCODE 2 %ecx
@@ -69,17 +65,3 @@
testl %ecx,%ecx # success?
jne .L${opcode}_resolved # good to go
jmp common_exceptionThrown # no, handle exception
-
- /*
- * TODO: remove this
- * We can't instantiate an abstract class or interface, so throw an
- * InstantiationError with the class descriptor as the message.
- *
- * ecx holds class object
- */
-.L${opcode}_abstract:
- movl offClassObject_descriptor(%ecx),%eax
- movl $$.LstrInstantiationError,OUT_ARG0(%esp)
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowExceptionWithClassMessage
- jmp common_exceptionThrown
diff --git a/vm/mterp/x86/OP_NEW_INSTANCE_JUMBO.S b/vm/mterp/x86/OP_NEW_INSTANCE_JUMBO.S
index 96ae85f..aebb2d0 100644
--- a/vm/mterp/x86/OP_NEW_INSTANCE_JUMBO.S
+++ b/vm/mterp/x86/OP_NEW_INSTANCE_JUMBO.S
@@ -23,11 +23,7 @@
cmpb $$CLASS_INITIALIZED,offClassObject_status(%ecx)
jne .L${opcode}_needinit
.L${opcode}_initialized: # on entry, ecx<- class
- /* TODO: remove test for interface/abstract, now done in verifier */
- testl $$(ACC_INTERFACE|ACC_ABSTRACT),offClassObject_accessFlags(%ecx)
movl $$ALLOC_DONT_TRACK,OUT_ARG1(%esp)
- jne .L${opcode}_abstract
-.L${opcode}_finish: # ecx=class
movl %ecx,OUT_ARG0(%esp)
call dvmAllocObject # eax<- new object
UNSPILL(rIBASE)
@@ -69,17 +65,3 @@
testl %ecx,%ecx # success?
jne .L${opcode}_resolved # good to go
jmp common_exceptionThrown # no, handle exception
-
- /*
- * TODO: remove this
- * We can't instantiate an abstract class or interface, so throw an
- * InstantiationError with the class descriptor as the message.
- *
- * ecx holds class object
- */
-.L${opcode}_abstract:
- movl offClassObject_descriptor(%ecx),%eax
- movl $$.LstrInstantiationError,OUT_ARG0(%esp)
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowExceptionWithClassMessage
- jmp common_exceptionThrown
diff --git a/vm/mterp/x86/footer.S b/vm/mterp/x86/footer.S
index 54dcbb4..a185096 100644
--- a/vm/mterp/x86/footer.S
+++ b/vm/mterp/x86/footer.S
@@ -577,11 +577,9 @@
*/
common_errDivideByZero:
EXPORT_PC
- movl $$.LstrArithmeticException,%eax
- movl %eax,OUT_ARG0(%esp)
movl $$.LstrDivideByZero,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowArithmeticException
jmp common_exceptionThrown
/*
@@ -596,15 +594,13 @@
/*
* Attempt to allocate an array with a negative size.
+ * On entry, method name in eax
*/
common_errNoSuchMethod:
EXPORT_PC
- movl $$.LstrNoSuchMethodError,%eax
movl %eax,OUT_ARG0(%esp)
- xorl %eax,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ call dvmThrowNoSuchMethodError
jmp common_exceptionThrown
/*
@@ -613,11 +609,9 @@
*/
common_errNullObject:
EXPORT_PC
- movl $$.LstrNullPointerException,%eax
- movl %eax,OUT_ARG0(%esp)
xorl %eax,%eax
- movl %eax,OUT_ARG1(%esp)
- call dvmThrowException
+ movl %eax,OUT_ARG0(%esp)
+ call dvmThrowNullPointerException
jmp common_exceptionThrown
/*
@@ -661,17 +655,7 @@
*/
.section .rodata
-.LstrNullPointerException:
- .asciz "Ljava/lang/NullPointerException;"
-.LstrArithmeticException:
- .asciz "Ljava/lang/ArithmeticException;"
.LstrDivideByZero:
.asciz "divide by zero"
-.LstrInstantiationError:
- .asciz "Ljava/lang/InstantiationError;"
-.LstrNoSuchMethodError:
- .asciz "Ljava/lang/NoSuchMethodError;"
-.LstrInternalErrorA:
- .asciz "Ljava/lang/InternalError;"
.LstrFilledNewArrayNotImplA:
.asciz "filled-new-array only implemented for 'int'"
diff --git a/vm/mterp/x86/header.S b/vm/mterp/x86/header.S
index 68b9441..0dd35b5 100644
--- a/vm/mterp/x86/header.S
+++ b/vm/mterp/x86/header.S
@@ -140,7 +140,7 @@
/*
* "export" the PC to the interpreted stack frame, f/b/o future exception
- * objects. Must * be done *before* something calls dvmThrowException.
+ * objects. Must be done *before* something throws.
*
* In C this is "SAVEAREA_FROM_FP(fp)->xtra.currentPc = pc", i.e.
* fp - sizeof(StackSaveArea) + offsetof(SaveArea, xtra.currentPc)