* Removed all Id tags.
[cacao.git] / src / vm / jit / i386 / emit.c
index 9c4d2d6e1f99f6309bebf0e2e07f0a4275234305..9e1f42d14c8023b5082404f089dd73a085f84c95 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 8211 2007-07-18 19:52:23Z michi $
-
 */
 
 
@@ -425,7 +423,7 @@ void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
 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_CMP(REG_ITMP3, s2);
         M_BB(6);
                M_ALD_MEM(s2, EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
@@ -576,6 +574,27 @@ void emit_patcher_stubs(jitdata *jd)
 }
 
 
+/* emit_trap *******************************************************************
+
+   Emit a trap instruction and return the original machine code.
+
+*******************************************************************************/
+
+uint32_t emit_trap(codegendata *cd)
+{
+       uint32_t mcode;
+
+       /* Get machine code which is patched back in later. The
+          trap is 1 instruction word long. */
+
+       mcode = *((uint32_t *) cd->mcodeptr);
+
+       M_NOP;
+
+       return mcode;
+}
+
+
 /* emit_verbosecall_enter ******************************************************
 
    Generates the code for the call trace.