* src/vm/jit/x86_64/asmpart.S (asm_abstractmethoderror): Keep stack aligned.
[cacao.git] / src / vm / jit / x86_64 / asmpart.S
index 8e5429847a68e936f9029e53c07d3c543bafce65..bfeb1e0fe8f44a5a13750c4689f357f194b87d43 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/x86_64/asmpart.S - Java-C interface functions for x86_64
 
-   Copyright (C) 1996-2005, 2006, 2007, 2008 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2012
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -58,9 +56,6 @@
        .globl asm_builtin_d2i
        .globl asm_builtin_d2l
 
-       .globl asm_compare_and_swap
-       .globl asm_memory_barrier
-
 
 /********************* function asm_calljavafunction ***************************
 *                                                                              *
@@ -319,12 +314,14 @@ noflt:
 *******************************************************************************/
 
 asm_abstractmethoderror:
+       sub     $8,sp                       /* keep stack aligned                 */
        mov     sp,a0                       /* pass java sp                       */
-       add     $1*8,a0
-       mov     0*8(sp),a1                  /* pass exception address             */
+       add     $2*8,a0
+       mov     1*8(sp),a1                  /* pass exception address             */
        sub     $3,a1
        call    exceptions_asm_new_abstractmethoderror@PLT
                                            /* exception pointer is return value  */
+       pop     xpc                         /* dummy pop                          */
        pop     xpc                         /* get exception address              */
        sub     $3,xpc                      /* exception address is ra - 3        */
        jmp     L_asm_handle_exception
@@ -392,30 +389,6 @@ asm_builtin_d2l:
        ret
 
 
-/* asm_compare_and_swap ********************************************************
-
-   Does an atomic compare and swap.  Required for the lock
-   implementation.
-
-*******************************************************************************/
-
-asm_compare_and_swap:
-       mov     a1,v0                       /* v0 is %rax                         */
-       lock cmpxchg a2,(a0)
-       ret
-
-
-/* asm_memory_barrier **********************************************************
-
-   A memory barrier for the Java Memory Model.
-
-*******************************************************************************/
-
-asm_memory_barrier:
-       mfence
-       ret
-
-
 /* disable exec-stacks ********************************************************/
 
 #if defined(__linux__) && defined(__ELF__)