# HG changeset patch # User kshalle # Date 1323182614 28800 # Node ID 90f38dca4132c0ec94c39703d4c16d3e01576842 # Parent 07fd95a5cd31a9fd99d2912bc675053eba97775a no idea what doing! diff -r 07fd95a5cd31 -r 90f38dca4132 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Tue Dec 06 06:43:34 2011 -0800 @@ -0,0 +1,3 @@ +syntax: glob + +*.o diff -r 07fd95a5cd31 -r 90f38dca4132 SSR.s --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SSR.s Tue Dec 06 06:43:34 2011 -0800 @@ -0,0 +1,21 @@ + +//Assembly code takes the return addr off the stack and saves +// into the singleton. The first field in the singleton is the +// "endInstrAddr" field, and the return addr is at 0x4(%ebp) +.globl asm_save_ret_to_singleton +asm_save_ret_to_singleton: + movq 0x8(%rbp), %rax #get ret address, ebp is the same as in the calling function + movq %rax, (%rdi) #write ret addr to endInstrAddr field + ret + + +//Assembly code changes the return addr on the stack to the one +// saved into the singleton by the end-singleton-fn +//The stack's return addr is at 0x4(%%ebp) +.globl asm_write_ret_from_singleton +asm_write_ret_from_singleton: + movq (%rdi), %rax #get endInstrAddr field + movq %rax, 0x8(%rbp) #write return addr to the stack of the caller + ret + +