aboutsummaryrefslogtreecommitdiff
path: root/include/listops.s
diff options
context:
space:
mode:
Diffstat (limited to 'include/listops.s')
-rw-r--r--include/listops.s22
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