     param-reg-1 R14 [] MOV
     R14 cell SUB ;
 
-: %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 ;
-
-: %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 ;
-
+: %mov-vm-ptr ( reg -- )
+    0 MOV rc-absolute-cell rt-vm rel-fixup ;
 
 M:: x86.64 %unbox ( n rep func -- )
+    param-reg-2 %mov-vm-ptr
     ! Call the unboxer
-    func %vm-invoke-2nd-arg
+    func f %alien-invoke
     ! Store the return value on the C stack if this is an
     ! alien-invoke, otherwise leave it the return register if
     ! this is the end of alien-callback

        { float-regs [ float-regs get pop swap MOVSD ] }
    } case ;


M: x86.64 %unbox-small-struct ( c-type -- )
    ! Alien must be in param-reg-1.
    "alien_offset" %vm-invoke-2nd-arg
    ! Move alien_offset() return value to R11 so that we don't
    ! clobber it.
    R11 RAX MOV

    "unnest_stacks" f %alien-invoke ;

M: x86.64 %prepare-alien-indirect ( -- )
    param-reg-1 %mov-vm-ptr
    "unbox_alien" f %alien-invoke
    RBP RAX MOV ;

M: x86.64 %alien-indirect ( -- )
