pub struct JitFunction<M> {
pub public_values_stream: Vec<u8>,
pub memory: M,
pub hints: Vec<(u64, Vec<u8>)>,
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).
memory: MMemory structure,
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.
pc: u64§registers: [u64; 32]§clk: u64§global_clk: u64§exit_code: u32§debug_sender: Option<SyncSender<Option<State>>>Implementations§
Source§impl<M: JitMemory> JitFunction<M>
impl<M: JitMemory> JitFunction<M>
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, trace_buf_ptr: *mut u8)
pub unsafe fn call(&mut self, trace_buf_ptr: *mut u8)
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.
Source§impl<M: JitResetableMemory> JitFunction<M>
impl<M: JitResetableMemory> JitFunction<M>
Trait Implementations§
impl<M: Send> Send for JitFunction<M>
Auto Trait Implementations§
impl<M> Freeze for JitFunction<M>where
M: Freeze,
impl<M> RefUnwindSafe for JitFunction<M>where
M: RefUnwindSafe,
impl<M> !Sync for JitFunction<M>
impl<M> Unpin for JitFunction<M>where
M: Unpin,
impl<M> UnsafeUnpin for JitFunction<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for JitFunction<M>where
M: UnwindSafe,
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