pub struct JitFunction {
pub public_values_stream: Vec<u8>,
pub hints: Vec<(u64, Vec<u8>)>,
pub memory: MmapMut,
pub pc: u64,
pub registers: [u64; 32],
pub clk: u64,
pub global_clk: u64,
pub exit_code: u32,
pub debug_sender: Option<SyncSender<Option<State>>>,
/* private fields */
}Expand description
A type representing a JIT compiled function.
The underlying function should be of the form [fn(*mut JitContext)].
Fields§
§public_values_stream: Vec<u8>A stream of public values from the program (global to entire program).
hints: Vec<(u64, Vec<u8>)>During execution, the hints are read by the program, and we store them here. This is effectively a mapping from start address to the value of the hint.
memory: MmapMutThe JIT function may stop “in the middle” of an program, we want to be able to resume it, so this is the information needed to do so.
pc: u64§registers: [u64; 32]§clk: u64§global_clk: u64§exit_code: u32§debug_sender: Option<SyncSender<Option<State>>>Implementations§
Source§impl JitFunction
impl JitFunction
Sourcepub fn push_input(&mut self, input: Vec<u8>)
pub fn push_input(&mut self, input: Vec<u8>)
Sourcepub fn set_input_buffer(&mut self, input: VecDeque<Vec<u8>>)
pub fn set_input_buffer(&mut self, input: VecDeque<Vec<u8>>)
Sourcepub unsafe fn call(&mut self) -> Option<TraceChunkRaw>
pub unsafe fn call(&mut self) -> Option<TraceChunkRaw>
Call the function, returning the trace buffer, starting at the starting PC of the program.
If the PC is 0, then the program has completed and we return None.
§SAFETY
Relies on the builder to emit valid assembly and that the pointer is valid for the duration of the function call.
Trait Implementations§
impl Send for JitFunction
Auto Trait Implementations§
impl Freeze for JitFunction
impl RefUnwindSafe for JitFunction
impl !Sync for JitFunction
impl Unpin for JitFunction
impl UnsafeUnpin for JitFunction
impl UnwindSafe for JitFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more