Module Fang_x64.Spilling

val preserve : box -> graph -> graph

preserve b g is g amended so that b's value after the amended graph is executed is always equal to its value beforehand, even if its value changes internally.

type handler
val handler : box iter -> handler

handler bs is a handler for the spilled registers bs.

val stack_size_increase : handler -> int

stack_size_increase h is the amount that the stack needs to grow to accomodate the spilled registers handled by h.

val was_spilled : box -> handler -> bool

was_spilled b h is true if b is a spilled register handled by h.

val save : stack_size:int -> box -> handler -> asm

save ~stack_size b h is an assembly instruction for saving b to the stack given a stack with total size stack_size (in byte).

val restore : stack_size:int -> box -> handler -> asm

restore ~stack_size b h is an assembly instruction for restoring b's value from the stack given a stack with total size stack_size (in byte).