vm pointer passed to nest_stacks and unnest_stacks (win32)

db4
Phil Dawes 2009-08-23 20:04:05 +01:00
parent cdb6304fef
commit 005549ba43
4 changed files with 9 additions and 9 deletions

View File

@ -437,7 +437,7 @@ M: ##alien-indirect generate-insn
! Generate code for boxing input parameters in a callback. ! Generate code for boxing input parameters in a callback.
[ [
dup \ %save-param-reg move-parameters dup \ %save-param-reg move-parameters
"nest_stacks" f %alien-invoke "nest_stacks" %vm-invoke
box-parameters box-parameters
] with-param-regs ; ] with-param-regs ;
@ -475,7 +475,7 @@ TUPLE: callback-context ;
[ callback-context new do-callback ] % [ callback-context new do-callback ] %
] [ ] make ; ] [ ] make ;
: %unnest-stacks ( -- ) "unnest_stacks" f %alien-invoke ; : %unnest-stacks ( -- ) "unnest_stacks" %vm-invoke ;
M: ##callback-return generate-insn M: ##callback-return generate-insn
#! All the extra book-keeping for %unwind is only for x86. #! All the extra book-keeping for %unwind is only for x86.

View File

@ -257,13 +257,13 @@ M: x86.32 %callback-value ( ctype -- )
ESP 12 SUB ESP 12 SUB
! Save top of data stack in non-volatile register ! Save top of data stack in non-volatile register
%prepare-unbox %prepare-unbox
push-vm-ptr
EAX PUSH EAX PUSH
push-vm-ptr
! Restore data/call/retain stacks ! Restore data/call/retain stacks
"unnest_stacks" f %alien-invoke "unnest_stacks" f %alien-invoke
! Place top of data stack in EAX ! Place top of data stack in EAX
EAX POP
temp-reg POP temp-reg POP
EAX POP
! Restore C stack ! Restore C stack
ESP 12 ADD ESP 12 ADD
! Unbox EAX ! Unbox EAX

View File

@ -615,7 +615,7 @@ M:: x86 %call-gc ( gc-root-count -- )
! Pass number of roots as second parameter ! Pass number of roots as second parameter
param-reg-2 gc-root-count MOV param-reg-2 gc-root-count MOV
! Call GC ! Call GC
"inline_gc" %vm-invoke ; "inline_gc" %vm-invoke ; ! (PHIL) TODO: vm-invoke won't work with ppc or x86.64. need %vm-invoke-3rd
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 ;

View File

@ -92,8 +92,8 @@ void factorvm::nest_stacks()
void nest_stacks(factorvm *myvm) void nest_stacks(factorvm *myvm)
{ {
printf("PHIL nest_stacks %d %d\n",vm,myvm);fflush(stdout); ASSERTVM();
return vm->nest_stacks(); return VM_PTR->nest_stacks();
} }
/* called when leaving a compiled callback */ /* called when leaving a compiled callback */
@ -113,8 +113,8 @@ void factorvm::unnest_stacks()
void unnest_stacks(factorvm *myvm) void unnest_stacks(factorvm *myvm)
{ {
printf("PHIL unnest_stacks %d %d\n",vm,myvm);fflush(stdout); ASSERTVM();
return vm->unnest_stacks(); return VM_PTR->unnest_stacks();
} }
/* called on startup */ /* called on startup */