]> gitweb.factorcode.org Git - factor.git/commitdiff
made inline_gc a VM_C_API function
authorPhil Dawes <phil@phildawes.net>
Fri, 25 Sep 2009 17:29:07 +0000 (18:29 +0100)
committerPhil Dawes <phil@phildawes.net>
Fri, 25 Sep 2009 17:29:07 +0000 (18:29 +0100)
basis/cpu/x86/32/32.factor
basis/cpu/x86/64/64.factor
basis/cpu/x86/x86.factor
vm/data_gc.cpp
vm/data_gc.hpp

index 34d508fcf2677635e3451941ee0a5d044a94acdf..a687c9d6b02cccd86d4743330502f76d652c00c0 100755 (executable)
@@ -311,6 +311,19 @@ M: x86.32 %callback-return ( n -- )
         [ drop 0 ]
     } 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-int-params? f ;
index 8363f7a18b1e2a2e028d9bafd66b39f487199004..cf90a47c0fb316465e58adbb9f705f5f44b928bd 100644 (file)
@@ -233,6 +233,16 @@ M:: x86.64 %binary-float-function ( dst src1 src2 func -- )
     func f %alien-invoke
     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
 ! x86-64.
 enable-alien-4-intrinsics
index 25dca527f600732b756b2bcbade9dd8b58ba7bf7..1d3125d997d33549e1ac495697c555be5a3a77a3 100644 (file)
@@ -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 %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 -- )
     [ 0 MOV ] 2dip rc-absolute-cell rel-dlsym ;    
 
index 590000611a5907cb76d5ec16d805a7544bd4dd4d..0c0b995732f469b49433ce3329d8f95654eb124c 100755 (executable)
@@ -681,7 +681,7 @@ void factor_vm::inline_gc(cell *gc_roots_base, cell gc_roots_size)
                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();
        VM_PTR->inline_gc(gc_roots_base,gc_roots_size);
index 4ef89c23272f8e4bcd6f0ba338ea481b88c52352..87c66f2433ee286e6526ac57fd4d6b2725728478 100755 (executable)
@@ -20,6 +20,6 @@ PRIMITIVE(gc_stats);
 PRIMITIVE(clear_gc_stats);
 PRIMITIVE(become);
 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);
 
 }