* src/vm/builtin.c (builtin_canstore): Throw an ArrayStoreException.
[cacao.git] / src / vm / jit / m68k / emit.c
index dff441f7f67b06197d95447163667ae8463b1725..a97783ad2af975a7f2c670f6be31555fd1b88fa9 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: arch.h 5330 2006-09-05 18:43:12Z edwin $
-
 */
 
 
@@ -737,7 +735,7 @@ void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 r
 void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1, s4 s2)
 {
        if (INSTRUCTION_MUST_CHECK(iptr)) {
-               M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
+               M_ILD(REG_ITMP3, s1, OFFSET(java_array_t, size));
                M_ICMP(s2, REG_ITMP3);
                M_BHI(4);
                M_TRAP_SETREGISTER(s2);
@@ -745,6 +743,24 @@ void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1,
        }
 }
 
+
+/* emit_arraystore_check *******************************************************
+
+   Emit an ArrayStoreException check.
+
+*******************************************************************************/
+
+void emit_arraystore_check(codegendata *cd, instruction *iptr)
+{
+       if (INSTRUCTION_MUST_CHECK(iptr)) {
+               M_ITST(REG_RESULT);
+               M_BNE(2);
+               /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_ARRAYSTORE);*/
+               M_TRAP(EXCEPTION_HARDWARE_ARRAYSTORE);
+       }
+}
+
+
 /* emit_nullpointer_check ******************************************************
 
    Emit a NullPointerException check.