]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix bug in c_to_factor
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 26 Dec 2009 02:24:46 +0000 (15:24 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 26 Dec 2009 02:24:46 +0000 (15:24 +1300)
basis/cpu/x86/32/32.factor
basis/cpu/x86/32/bootstrap.factor
vm/cpu-x86.32.S

index f904f7c3fbb08ddf9f101a7e2f38889bdea5fe97..70c7b9d513cc35a7a6ae925762e65b7771a098b8 100644 (file)
@@ -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
index 0b7a1fad5cdd694089d22f0293e8250956d9ae0d..bb289851ea2f888ee636f63c8ba135b0f49764d6 100644 (file)
@@ -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
index ad9f699ededce2ccffe882856030ef76441d443b..04df3db89da71ec02492e5f279ccded30683f9fb 100644 (file)
@@ -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 */