]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.codegen passes temp reg to %call-gc
authorPhil Dawes <phil@phildawes.net>
Fri, 25 Sep 2009 17:48:13 +0000 (18:48 +0100)
committerPhil Dawes <phil@phildawes.net>
Fri, 25 Sep 2009 17:48:13 +0000 (18:48 +0100)
basis/compiler/codegen/codegen.factor
basis/cpu/architecture/architecture.factor
basis/cpu/x86/32/32.factor
basis/cpu/x86/64/64.factor

index 150e65db3f87d130b1833dce2429ba91f35b6679..b2c1eed8193790c25d918b757b8ee9cc3ba13703 100755 (executable)
@@ -271,7 +271,7 @@ M: _gc generate-insn
         [ data-values>> save-data-regs ]
         [ [ tagged-values>> ] [ temp1>> ] bi save-gc-roots ]
         [ [ temp1>> ] [ temp2>> ] bi t %save-context ]
-        [ tagged-values>> length %call-gc ]
+        [ [ tagged-values>> length ] [ temp1>> ] bi %call-gc ]
         [ [ tagged-values>> ] [ temp1>> ] bi load-gc-roots ]
         [ data-values>> load-data-regs ]
     } cleave
index 3c5abf668aaa63edd6922f983cf0da5f2d42173d..066c44536651ad65449d046a97e547edad53ed80 100644 (file)
@@ -296,7 +296,7 @@ HOOK: %write-barrier cpu ( src card# table -- )
 HOOK: %check-nursery cpu ( label temp1 temp2 -- )
 HOOK: %save-gc-root cpu ( gc-root register -- )
 HOOK: %load-gc-root cpu ( gc-root register -- )
-HOOK: %call-gc cpu ( gc-root-count -- )
+HOOK: %call-gc cpu ( gc-root-count temp1 -- )
 
 HOOK: %prologue cpu ( n -- )
 HOOK: %epilogue cpu ( n -- )
index a687c9d6b02cccd86d4743330502f76d652c00c0..a2b089d90e9b8d9f510e179bad68fd0604ca634f 100755 (executable)
@@ -311,15 +311,15 @@ M: x86.32 %callback-return ( n -- )
         [ drop 0 ]
     } cond RET ;
 
-M:: x86.32 %call-gc ( gc-root-count -- )
-    EAX gc-root-base param@ LEA
+M:: x86.32 %call-gc ( gc-root-count temp1 -- )
+    ! USE: prettyprint "PHIL" pprint temp1 pprint temp2 pprint
+    temp1 gc-root-base param@ LEA
     12 [
-        push-vm-ptr
+        0 PUSH rc-absolute-cell rt-vm rel-fixup ! push the vm ptr as an argument
         ! Pass number of roots as second parameter
-        temp-reg gc-root-count MOV
-        temp-reg PUSH 
+        gc-root-count PUSH 
         ! Pass pointer to start of GC roots as first parameter
-        EAX PUSH 
+        temp1 PUSH 
         ! Call GC
         "inline_gc" f %alien-invoke
     ] with-aligned-stack ;
index cf90a47c0fb316465e58adbb9f705f5f44b928bd..e7ce0282af3ab43545f524116177bbdf3b9cd585 100644 (file)
@@ -233,7 +233,7 @@ 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 -- )
+M:: x86.64 %call-gc ( gc-root-count temp1 -- )
     ! 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