* Removed all Id tags.
[cacao.git] / src / vm / jit / sparc64 / emit.c
index 118eaad400a65c64a76dea013a89a03ad0625ebf..dc89473eab6eb8d8837f1a5836ac5bfc1d075de1 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: emit.c 4398 2006-01-31 23:43:08Z twisti $
-
 */
 
 
@@ -123,7 +121,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:
@@ -477,7 +475,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(s2, REG_ITMP3);
                M_XBULT(3);
                M_NOP;
@@ -552,6 +550,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.
@@ -682,18 +701,6 @@ void emit_patcher_stubs(jitdata *jd)
 }
 
 
-/* emit_replacement_stubs ******************************************************
-
-   Generates the code for the replacement stubs.
-
-*******************************************************************************/
-
-#if defined(ENABLE_REPLACEMENT)
-void emit_replacement_stubs(jitdata *jd)
-{
-}
-#endif /* defined(ENABLE_REPLACEMENT) */
-
 /* emit_verbosecall_enter ******************************************************
 
    Generates the code for the call trace.