diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index f904f7c3fb..70c7b9d513 100644 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -215,7 +215,8 @@ M:: x86.32 %unbox-large-struct ( n c-type -- ) "to_value_struct" f %alien-invoke ; M: x86.32 %nest-stacks ( -- ) - ! Save current frame. See comment in vm/contexts.hpp + ! Save current frame to ctx->magic_frame. + ! See comment in vm/contexts.hpp. EAX stack-reg stack-frame get total-size>> 3 cells - [+] LEA 4 save-vm-ptr 0 stack@ EAX MOV diff --git a/basis/cpu/x86/32/bootstrap.factor b/basis/cpu/x86/32/bootstrap.factor index 0b7a1fad5c..bb289851ea 100644 --- a/basis/cpu/x86/32/bootstrap.factor +++ b/basis/cpu/x86/32/bootstrap.factor @@ -73,23 +73,8 @@ IN: bootstrap.x86 ! load VM pointer EDX 0 MOV 0 rc-absolute-cell jit-vm ] -[ - - ! pass quotation - ESP [] EAX MOV - ! pass VM pointer - ESP 4 [+] EDX MOV - ! call XT - EAX quot-xt-offset [+] CALL -] -[ - ! pass quotation - ESP 4 [+] EAX MOV - ! pass VM pointer - ESP 8 [+] EDX MOV - ! jump to XT - EAX quot-xt-offset [+] JMP -] +[ EAX quot-xt-offset [+] CALL ] +[ EAX quot-xt-offset [+] JMP ] \ (call) define-sub-primitive* ! Inline cache miss entry points diff --git a/vm/cpu-x86.32.S b/vm/cpu-x86.32.S index ad9f699ede..04df3db89d 100644 --- a/vm/cpu-x86.32.S +++ b/vm/cpu-x86.32.S @@ -40,12 +40,12 @@ DEF(void,c_to_factor,(cell quot, void *vm)): lea -4(%esp),%ebx mov %ebx,4(%ecx) - /* Call quot-xt. Parameters are already on the stack */ + /* Call quot-xt */ call *QUOT_XT_OFFSET(%eax) /* Tear down stack frame for the call to the boot quotation */ - pop %edx pop %eax + pop %edx add $4,%esp /* Undo stack alignment */ @@ -120,18 +120,10 @@ DEF(void,throw_impl,(cell quot, void *new_stack, void *vm)): /* load retainstack */ mov 12(%ecx),RS_REG - /* pass arguments to error handler */ - mov %eax,4(%esp) - mov %edx,8(%esp) - /* call the error handler */ jmp *QUOT_XT_OFFSET(%eax) DEF(void,lazy_jit_compile_impl,(cell quot, void *vm)): - /* load arguments */ - mov 4(%esp),%eax - mov 8(%esp),%edx - /* load context */ mov (%edx),%ecx /* save datastack */