Skip to main content

Module jit_abi

Module jit_abi 

Source
Expand description

The calling interface between compiled code and this VM’s memory.

Compiled code reaches guest RAM through an inlined translation and an inlined permission check (see crate::tlb). Neither can answer every access: the page may not be cached yet, the access may straddle a page boundary, the permissions may refuse it, or a dynamic check may be in force that the inline test cannot express. All of those land here, on the same Mmu the interpreter uses.

That is the point of the split. There is one implementation of what an access means — mapping, permissions, initializedness, watchpoints, fault addresses — and the inline path is a cache in front of it, never a second opinion. A miss costs a call; a wrong answer would cost correctness.

§Faults

These return a status rather than taking a fault themselves, because compiled code has to unwind on its own: it stops at the faulting access, leaving the guest state its earlier stores produced, and returns the status to the runtime. The fault itself is left on the VmMemory for the caller to take, exactly as an interpreted fault would be.

Constants§

ACCESS_FAULT
The access faulted; the fault is on the VmMemory.
ACCESS_OK
The access succeeded.

Functions§

qcode_jit_load
Performs a guest RAM read that compiled code could not do inline.
qcode_jit_sdiv128
Safety
qcode_jit_srem128
Safety
qcode_jit_store
Performs a guest RAM write that compiled code could not do inline.
qcode_jit_udiv128
Safety
qcode_jit_urem128
Safety