* src/vm/builtin.c (builtin_canstore): Throw an ArrayStoreException.
[cacao.git] / src / vm / jit / alpha / emit.c
index 13515ccda7166e6f20f70291cb505fce201cd478..b6883c8247820a8bbd688f1ca4438946eb2101db 100644 (file)
@@ -349,6 +349,23 @@ 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_BNEZ(REG_RESULT, 1);
+               /* Destination register must not be REG_ZERO, because then no
+                  SIGSEGV is thrown. */
+               M_ALD_INTERN(REG_RESULT, REG_ZERO, EXCEPTION_HARDWARE_ARRAYSTORE);
+       }
+}
+
+
 /* emit_classcast_check ********************************************************
 
    Emit a ClassCastException check.