diff --git a/basis/compiler/codegen/codegen.factor b/basis/compiler/codegen/codegen.factor index 150e65db3f..b2c1eed819 100755 --- a/basis/compiler/codegen/codegen.factor +++ b/basis/compiler/codegen/codegen.factor @@ -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 diff --git a/basis/cpu/architecture/architecture.factor b/basis/cpu/architecture/architecture.factor index 3c5abf668a..066c445366 100644 --- a/basis/cpu/architecture/architecture.factor +++ b/basis/cpu/architecture/architecture.factor @@ -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 -- ) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index a687c9d6b0..a2b089d90e 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -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 ; diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index cf90a47c0f..e7ce0282af 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -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