[ data-values>> save-data-regs ]
[ [ tagged-values>> ] [ temp1>> ] bi save-gc-roots ]
[ [ temp1>> ] [ temp2>> ] bi t %save-context ]
- [ tagged-values>> length %call-gc ]
+ [ [ tagged-values>> length ] [ temp1>> ] bi %call-gc ]
[ [ tagged-values>> ] [ temp1>> ] bi load-gc-roots ]
[ data-values>> load-data-regs ]
} cleave
HOOK: %check-nursery cpu ( label temp1 temp2 -- )
HOOK: %save-gc-root cpu ( gc-root register -- )
HOOK: %load-gc-root cpu ( gc-root register -- )
-HOOK: %call-gc cpu ( gc-root-count -- )
+HOOK: %call-gc cpu ( gc-root-count temp1 -- )
HOOK: %prologue cpu ( n -- )
HOOK: %epilogue cpu ( n -- )
[ drop 0 ]
} cond RET ;
-M:: x86.32 %call-gc ( gc-root-count -- )
- EAX gc-root-base param@ LEA
+M:: x86.32 %call-gc ( gc-root-count temp1 -- )
+ ! USE: prettyprint "PHIL" pprint temp1 pprint temp2 pprint
+ temp1 gc-root-base param@ LEA
12 [
- push-vm-ptr
+ 0 PUSH rc-absolute-cell rt-vm rel-fixup ! push the vm ptr as an argument
! Pass number of roots as second parameter
- temp-reg gc-root-count MOV
- temp-reg PUSH
+ gc-root-count PUSH
! Pass pointer to start of GC roots as first parameter
- EAX PUSH
+ temp1 PUSH
! Call GC
"inline_gc" f %alien-invoke
] with-aligned-stack ;
func f %alien-invoke
dst float-function-return ;
-M:: x86.64 %call-gc ( gc-root-count -- )
+M:: x86.64 %call-gc ( gc-root-count temp1 -- )
! Pass pointer to start of GC roots as first parameter
param-reg-1 gc-root-base param@ LEA
! Pass number of roots as second parameter