     ]
     jit-conditional* ;
 
-[ [ ADDO. ] "overflow_fixnum_add" jit-overflow ] \ fixnum+ define-sub-primitive
-
-[ [ SUBFO. ] "overflow_fixnum_subtract" jit-overflow ] \ fixnum- define-sub-primitive
-
-[
-    ds-reg ds-reg cell-size SUBI
-    jit-save-context
-    3 ds-reg 0 jit-load-cell
-    3 3 jit-shift-tag-bits
-    4 ds-reg cell-size jit-load-cell
-    0 0 LI
-    0 MTXER
-    6 3 4 jit-multiply-low-ov-rc
-    6 ds-reg 0 jit-save-cell
-    [ 0 swap BNS ]
-    [
-        4 4 jit-shift-tag-bits
-        5 vm-reg MR
-        "overflow_fixnum_multiply" jit-call
-    ]
-    jit-conditional*
-] \ fixnum* define-sub-primitive
-
 ! Contexts
 :: jit-switch-context ( reg -- )
     7 0 LI

    4 MTCTR BCTR
] JIT-EXECUTE jit-define

! Special primitives
[
    frame-reg 3 MR

    3 vm-reg MR
    "begin_callback" jit-call

    jit-load-context
    jit-restore-context

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

    jit-save-context

    3 vm-reg MR
    "end_callback" jit-call
] \ c-to-factor define-sub-primitive

[
    ! Unwind stack frames
    1 4 MR

    ! Load VM pointer into vm-reg, since we're entering from
    ! C code
    vm-reg jit-load-vm

    ! Load ds and rs registers
    jit-load-context
    jit-restore-context

    ! We have changed the stack; load return address again
    0 1 lr-save jit-load-cell
    0 MTLR

    ! Call quotation
    jit-jump-quot
] \ unwind-native-frames define-sub-primitive

[
    7 0 LI
    7 1 lr-save jit-save-cell

    ! Load callstack object
    6 ds-reg 0 jit-load-cell
    ds-reg ds-reg cell-size SUBI
    ! Get ctx->callstack_bottom
    jit-load-context
    3 ctx-reg context-callstack-bottom-offset jit-load-cell
    ! Get top of callstack object -- 'src' for memcpy
    4 6 callstack-top-offset ADDI
    ! Get callstack length, in bytes --- 'len' for memcpy
    7 callstack-length-offset LI
    5 6 7 jit-load-cell-x
    5 5 jit-shift-tag-bits
    ! Compute new stack pointer -- 'dst' for memcpy
    3 3 5 SUB
    ! Install new stack pointer
    1 3 MR
    ! Call memcpy; arguments are now in the correct registers
    1 1 -16 cell-size * jit-save-cell-update
    "factor_memcpy" jit-call
    1 1 0 jit-load-cell
    ! Return with new callstack
    0 1 lr-save jit-load-cell
    0 MTLR
    BLR
] \ set-callstack define-sub-primitive

[
    jit-save-context
    4 vm-reg MR

    jit-save-context
    3 jit-switch-context
    jit-push-param ;

: jit-pop-quot-and-param ( -- )
    3 ds-reg 0 jit-load-cell
