* src/vm/jit/sparc64/md-abi.c (md_param_alloc_native): Fixed pending issue from
[cacao.git] / src / vm / jit / sparc64 / emit.c
index c89716dc8af31048baf085f1ba4313da2e014ccd..9ce83232d23af68a87c6e7cf1eedc0b6b032a587 100644 (file)
@@ -123,7 +123,7 @@ void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d)
                COUNT_WRITE_SPILLS(dst)
 
                disp = JITSTACK + dst->vv.regoff;
-                       
+       
                switch(dst->type)
                {
                case TYPE_INT:
@@ -552,6 +552,27 @@ void emit_exception_check(codegendata *cd, instruction *iptr)
 }
 
 
+/* 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 = *((u4 *) cd->mcodeptr);
+
+       M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_PATCHER);
+
+       return mcode;
+}
+
+
 /* emit_patcher_stubs **********************************************************
 
    Generates the code for the patcher stubs.