From 8610fa5e488d93fd55b5c8fe628faae4408816c8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 25 Sep 2009 21:47:05 -0500 Subject: [PATCH] cpu: cleanups --- basis/cpu/ppc/ppc.factor | 2 +- basis/cpu/x86/32/32.factor | 10 +++++----- basis/cpu/x86/64/64.factor | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index eabac51db5..bcd52206a0 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -510,7 +510,7 @@ M:: ppc %save-gc-root ( gc-root register -- ) M:: ppc %load-gc-root ( gc-root register -- ) register 1 gc-root gc-root@ LWZ ; -M:: ppc %call-gc ( gc-root-count -- ) +M:: ppc %call-gc ( gc-root-count temp -- ) 3 1 gc-root-base local@ ADDI gc-root-count 4 LI "inline_gc" f %alien-invoke ; diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index 84294b4912..5f6c0d4696 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -314,15 +314,15 @@ M: x86.32 %callback-return ( n -- ) [ drop 0 ] } cond RET ; -M:: x86.32 %call-gc ( gc-root-count temp1 -- ) - ! USE: prettyprint "PHIL" pprint temp1 pprint temp2 pprint - temp1 gc-root-base param@ LEA +M:: x86.32 %call-gc ( gc-root-count temp -- ) + temp gc-root-base param@ LEA 12 [ - 0 PUSH rc-absolute-cell rt-vm rel-fixup ! push the vm ptr as an argument + ! Pass the VM ptr as the third parameter + 0 PUSH rc-absolute-cell rt-vm rel-fixup ! Pass number of roots as second parameter gc-root-count PUSH ! Pass pointer to start of GC roots as first parameter - temp1 PUSH + temp 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 dfe537baa3..562563039e 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -235,12 +235,12 @@ 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 temp1 -- ) +M:: x86.64 %call-gc ( gc-root-count temp -- ) ! 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 + ! Pass VM ptr as third parameter param-reg-3 %mov-vm-ptr ! Call GC "inline_gc" f %alien-invoke ;