]> gitweb.factorcode.org Git - factor.git/commitdiff
fixed vm ptr passing to box_small_struct
authorPhil Dawes <phil@phildawes.net>
Thu, 27 Aug 2009 18:55:25 +0000 (19:55 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:20:50 +0000 (08:20 +0100)
basis/cpu/x86/64/64.factor

index 498a502fcac63ab487fe80b9e9cbd008d4f2361b..4bdabe30be13b56d5f40a97428d0a34bc037c722 100644 (file)
@@ -74,10 +74,22 @@ M: x86.64 %prepare-unbox ( -- )
     param-reg-1 R14 [] MOV
     R14 cell SUB ;
 
+M: x86.64 %vm-invoke-1st-arg ( function -- )
+    param-reg-1 0 MOV rc-absolute-cell rt-vm rel-fixup
+    f %alien-invoke ;
+
 : %vm-invoke-2nd-arg ( function -- )
     param-reg-2 0 MOV rc-absolute-cell rt-vm rel-fixup
     f %alien-invoke ;
 
+M: x86.64 %vm-invoke-3rd-arg ( function -- )
+    param-reg-3 0 MOV rc-absolute-cell rt-vm rel-fixup
+    f %alien-invoke ;
+
+: %vm-invoke-4th-arg ( function -- )
+    int-regs param-regs fourth 0 MOV rc-absolute-cell rt-vm rel-fixup
+    f %alien-invoke ;
+
 
 M:: x86.64 %unbox ( n rep func -- )
     ! Call the unboxer
@@ -153,7 +165,7 @@ M: x86.64 %box-small-struct ( c-type -- )
         [ param-reg-3 swap heap-size MOV ] bi
         param-reg-1 0 box-struct-field@ MOV
         param-reg-2 1 box-struct-field@ MOV
-        "box_small_struct" f %alien-invoke
+        "box_small_struct" %vm-invoke-4th-arg
     ] with-return-regs ;
 
 : struct-return@ ( n -- operand )
@@ -180,14 +192,6 @@ M: x86.64 %alien-invoke
     rc-absolute-cell rel-dlsym
     R11 CALL ;
 
-M: x86.64 %vm-invoke-1st-arg ( function -- )
-    param-reg-1 0 MOV rc-absolute-cell rt-vm rel-fixup
-    f %alien-invoke ;
-
-
-M: x86.64 %vm-invoke-3rd-arg ( function -- )
-    param-reg-3 0 MOV rc-absolute-cell rt-vm rel-fixup
-    f %alien-invoke ;
 
 M: x86.64 %prepare-alien-indirect ( -- )
     "unbox_alien" f %alien-invoke