* Removed all Id tags.
[cacao.git] / src / vm / jit / x86_64 / emit.c
index 91d5506813318f6ae9e014a65a77087c6fd40084..44f3742a704166127f9e5f0a97401c5cfbe85e59 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 $
-
 */
 
 #include "config.h"
@@ -353,7 +351,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_ICMP(REG_ITMP3, s2);
                M_BULT(8);
                M_ALD_MEM(s2, EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
@@ -507,6 +505,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.