     0 vm-reg LOAD32 0 rc-absolute-ppc-2/2 jit-vm
 
     ! Load ds and rs registers
+    jit-load-context
     jit-restore-context
 
     ! We have changed the stack; load return address again

: jit-pop-context-and-param ( -- )
    3 ds-reg 0 LWZ
    3 3 alien-offset LWZ
    4 ds-reg -8 LWZ
    ds-reg ds-reg 16 SUBI ;

: jit-push-param ( -- )
    ds-reg ds-reg 8 ADDI
    4 ds-reg 0 STW ;

: jit-set-context ( -- )
    jit-pop-context-and-param
    4 jit-switch-context
    jit-push-param ;

[ jit-set-context ] \ (set-context) define-sub-primitive

: jit-pop-quot-and-param ( -- )
    3 ds-reg 0 LWZ
    4 ds-reg -8 LWZ
    ds-reg ds-reg 16 SUBI ;

: jit-start-context ( -- )
    ! Create the new context in return-reg
    3 vm-reg MR
    "new_context" jit-call

    jit-pop-quot-and-param

    3 jit-switch-context

    jit-push-param


    3 vm-reg MR
    "begin_callback" jit-call

    jit-load-context
    jit-restore-context

    ! Call quotation
    3 nv-reg MR
    jit-call-quot

    jit-save-context
