diff SSR.s @ 29:e4de34fd220b

merged useless branch test_without_inline
author Merten Sach <msach@mailbox.tu-berlin.de>
date Thu, 22 Sep 2011 12:15:04 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/SSR.s	Thu Sep 22 12:15:04 2011 +0200
     1.3 @@ -0,0 +1,21 @@
     1.4 +
     1.5 +//Assembly code takes the return addr off the stack and saves
     1.6 +// into the singleton.  The first field in the singleton is the
     1.7 +// "endInstrAddr" field, and the return addr is at 0x4(%ebp)
     1.8 +.globl asm_save_ret_to_singleton
     1.9 +asm_save_ret_to_singleton:
    1.10 +    movq 0x8(%rbp),     %rax   #get ret address, ebp is the same as in the calling function
    1.11 +    movq     %rax,     (%rdi) #write ret addr to endInstrAddr field
    1.12 +    ret
    1.13 +
    1.14 +
    1.15 +//Assembly code changes the return addr on the stack to the one
    1.16 +// saved into the singleton by the end-singleton-fn
    1.17 +//The stack's return addr is at 0x4(%%ebp)
    1.18 +.globl asm_write_ret_from_singleton
    1.19 +asm_write_ret_from_singleton:
    1.20 +    movq    (%rdi),    %rax  #get endInstrAddr field
    1.21 +    movq      %rax,    0x8(%rbp) #write return addr to the stack of the caller
    1.22 +    ret
    1.23 +
    1.24 +