made inline_gc a VM_C_API function
parent
b85616fa61
commit
4552e02624
|
@ -311,6 +311,19 @@ M: x86.32 %callback-return ( n -- )
|
||||||
[ drop 0 ]
|
[ drop 0 ]
|
||||||
} cond RET ;
|
} cond RET ;
|
||||||
|
|
||||||
|
M:: x86.32 %call-gc ( gc-root-count -- )
|
||||||
|
EAX gc-root-base param@ LEA
|
||||||
|
12 [
|
||||||
|
push-vm-ptr
|
||||||
|
! Pass number of roots as second parameter
|
||||||
|
temp-reg gc-root-count MOV
|
||||||
|
temp-reg PUSH
|
||||||
|
! Pass pointer to start of GC roots as first parameter
|
||||||
|
EAX PUSH
|
||||||
|
! Call GC
|
||||||
|
"inline_gc" f %alien-invoke
|
||||||
|
] with-aligned-stack ;
|
||||||
|
|
||||||
M: x86.32 dummy-stack-params? f ;
|
M: x86.32 dummy-stack-params? f ;
|
||||||
|
|
||||||
M: x86.32 dummy-int-params? f ;
|
M: x86.32 dummy-int-params? f ;
|
||||||
|
|
|
@ -233,6 +233,16 @@ M:: x86.64 %binary-float-function ( dst src1 src2 func -- )
|
||||||
func f %alien-invoke
|
func f %alien-invoke
|
||||||
dst float-function-return ;
|
dst float-function-return ;
|
||||||
|
|
||||||
|
M:: x86.64 %call-gc ( gc-root-count -- )
|
||||||
|
! 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
|
||||||
|
param-reg-2 gc-root-count MOV
|
||||||
|
! Pass vm as third parameter
|
||||||
|
param-reg-3 0 MOV rc-absolute-cell rt-vm rel-fixup
|
||||||
|
! Call GC
|
||||||
|
"inline_gc" f %alien-invoke ;
|
||||||
|
|
||||||
! The result of reading 4 bytes from memory is a fixnum on
|
! The result of reading 4 bytes from memory is a fixnum on
|
||||||
! x86-64.
|
! x86-64.
|
||||||
enable-alien-4-intrinsics
|
enable-alien-4-intrinsics
|
||||||
|
|
|
@ -828,16 +828,6 @@ M: x86 %save-gc-root ( gc-root register -- ) [ gc-root@ ] dip MOV ;
|
||||||
|
|
||||||
M: x86 %load-gc-root ( gc-root register -- ) swap gc-root@ MOV ;
|
M: x86 %load-gc-root ( gc-root register -- ) swap gc-root@ MOV ;
|
||||||
|
|
||||||
M:: x86 %call-gc ( gc-root-count -- )
|
|
||||||
! 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
|
|
||||||
param-reg-2 gc-root-count MOV
|
|
||||||
! Pass vm as third argument
|
|
||||||
param-reg-3 0 MOV rc-absolute-cell rt-vm rel-fixup
|
|
||||||
! Call GC
|
|
||||||
"inline_gc" f %alien-invoke ;
|
|
||||||
|
|
||||||
M: x86 %alien-global ( dst symbol library -- )
|
M: x86 %alien-global ( dst symbol library -- )
|
||||||
[ 0 MOV ] 2dip rc-absolute-cell rel-dlsym ;
|
[ 0 MOV ] 2dip rc-absolute-cell rel-dlsym ;
|
||||||
|
|
||||||
|
|
|
@ -681,7 +681,7 @@ void factor_vm::inline_gc(cell *gc_roots_base, cell gc_roots_size)
|
||||||
gc_locals.pop_back();
|
gc_locals.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
VM_ASM_API_OVERFLOW void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm)
|
VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm)
|
||||||
{
|
{
|
||||||
ASSERTVM();
|
ASSERTVM();
|
||||||
VM_PTR->inline_gc(gc_roots_base,gc_roots_size);
|
VM_PTR->inline_gc(gc_roots_base,gc_roots_size);
|
||||||
|
|
|
@ -20,6 +20,6 @@ PRIMITIVE(gc_stats);
|
||||||
PRIMITIVE(clear_gc_stats);
|
PRIMITIVE(clear_gc_stats);
|
||||||
PRIMITIVE(become);
|
PRIMITIVE(become);
|
||||||
struct factor_vm;
|
struct factor_vm;
|
||||||
VM_ASM_API_OVERFLOW void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm);
|
VM_C_API void inline_gc(cell *gc_roots_base, cell gc_roots_size, factor_vm *myvm);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue