diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-12 15:12:03 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-12 15:12:03 +0200 |
| commit | 6be5a28bb90b391a5842a8ce3dfc7c154100ab68 (patch) | |
| tree | 22e04a263e68d983c6bf5d1fdebd662e66915e96 /include/listops.s | |
| parent | 5184299c7dfddeba4d2d2ba95d390040368f9736 (diff) | |
| download | uskel-6be5a28bb90b391a5842a8ce3dfc7c154100ab68.tar.gz uskel-6be5a28bb90b391a5842a8ce3dfc7c154100ab68.tar.bz2 | |
make a macro for pushing out thunks
Diffstat (limited to 'include/listops.s')
| -rw-r--r-- | include/listops.s | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/include/listops.s b/include/listops.s index eb8f6cf..447c125 100644 --- a/include/listops.s +++ b/include/listops.s @@ -13,28 +13,20 @@ _listops_s_file: mov 020(%rbp), %rcx mov 010(%rcx), %rcx test %rcx, %rcx - jz list_int_index_found #we are taking 0, all happy, return it + jz list_int_index_found # we are taking the head, all happy, return it - #more probably we need to continue, make replacement thunks + # more likely, we need to continue -- make new args thunks sub $1, %rcx - pushq %rcx - pushq $INT_code - mov %rsp, %r11 - - pushq 030(%rsi) # tail - push %r11 - pushq $2 - pushq $list_int_index - mov %rsp, %r11 + thunkto %r11, $INT_code, %rcx # decreased index + thunkto %r11, $list_int_index, $2, %r11, 030(%rsi) # new call on tail primop2_cont_indirect %r11 -list_int_index_not_found: - movq 0, %rax #fault - list_int_index_found: mov 020(%rsi), %rax #head primop2_cont_indirect %rax - + +list_int_index_not_found: + movq 0, %rax #fault (TODO: we should have a better fault) .endif # _listops_s_file |
