Move x86 alien-indirect
parent
4ead056557
commit
2e59e8b488
|
@ -39,16 +39,6 @@ kernel-internals math memory namespaces words ;
|
||||||
f %alien-invoke
|
f %alien-invoke
|
||||||
drop-return-reg ;
|
drop-return-reg ;
|
||||||
|
|
||||||
: alien-temp ( quot -- )
|
|
||||||
0 [] swap call "alien_temp" f rel-absolute rel-dlsym ;
|
|
||||||
|
|
||||||
: %prepare-alien-indirect ( -- )
|
|
||||||
"unbox_alien" f %alien-invoke
|
|
||||||
[ EAX MOV ] alien-temp ;
|
|
||||||
|
|
||||||
: %alien-indirect ( -- )
|
|
||||||
[ CALL ] alien-temp ;
|
|
||||||
|
|
||||||
: %alien-callback ( quot -- )
|
: %alien-callback ( quot -- )
|
||||||
0 <int-vreg> load-literal
|
0 <int-vreg> load-literal
|
||||||
EAX PUSH
|
EAX PUSH
|
||||||
|
|
|
@ -28,6 +28,16 @@ M: cs-loc v>operand cs-loc-n cs-reg reg-stack ;
|
||||||
|
|
||||||
: %alien-invoke ( symbol dll -- ) (CALL) rel-dlsym ;
|
: %alien-invoke ( symbol dll -- ) (CALL) rel-dlsym ;
|
||||||
|
|
||||||
|
: alien-temp ( quot -- )
|
||||||
|
0 [] swap call "alien_temp" f rel-absolute rel-dlsym ;
|
||||||
|
|
||||||
|
: %prepare-alien-indirect ( -- )
|
||||||
|
"unbox_alien" f %alien-invoke
|
||||||
|
[ EAX MOV ] alien-temp ;
|
||||||
|
|
||||||
|
: %alien-indirect ( -- )
|
||||||
|
[ CALL ] alien-temp ;
|
||||||
|
|
||||||
: with-aligned-stack ( n quot -- )
|
: with-aligned-stack ( n quot -- )
|
||||||
#! On Linux, there is no requirement to align stack frames,
|
#! On Linux, there is no requirement to align stack frames,
|
||||||
#! so this is mostly a no-op.
|
#! so this is mostly a no-op.
|
||||||
|
|
Loading…
Reference in New Issue