Merged trunk and subtype.
[cacao.git] / src / vm / jit / x86_64 / asmpart.S
index 8e5429847a68e936f9029e53c07d3c543bafce65..5807491ecbac01e65242b9c65be0c10615d4faaa 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-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -58,8 +56,7 @@
        .globl asm_builtin_d2i
        .globl asm_builtin_d2l
 
-       .globl asm_compare_and_swap
-       .globl asm_memory_barrier
+       .globl asm_get_cycle_count
 
 
 /********************* function asm_calljavafunction ***************************
@@ -392,27 +389,17 @@ asm_builtin_d2l:
        ret
 
 
-/* asm_compare_and_swap ********************************************************
+/* asm_get_cycle_count *********************************************************
 
-   Does an atomic compare and swap.  Required for the lock
-   implementation.
+   Get the current time-stamp counter from the CPU.
 
 *******************************************************************************/
 
-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
+asm_get_cycle_count:
+       rdtsc
+       shl $0x20, %rdx
+       mov %eax, %eax
+       or %rdx, %rax
        ret