pub struct InstructionBuilder {
pub instructions: Vec<BinaryInstruction>,
pub comments: Vec<String>,
}Fields§
§instructions: Vec<BinaryInstruction>§comments: Vec<String>Implementations§
Source§impl InstructionBuilder
impl InstructionBuilder
pub const fn new() -> Self
pub fn position(&self) -> InstructionPosition
pub fn add_jmp_if_equal_placeholder(&mut self, comment: &str) -> PatchPosition
pub fn add_jmp_if_not_equal_placeholder( &mut self, comment: &str, ) -> PatchPosition
pub fn add_vec_iter_next_placeholder( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, comment: &str, ) -> PatchPosition
pub fn add_vec_iter_next_pair_placeholder( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, closure_variable_b: FrameMemoryAddress, comment: &str, ) -> PatchPosition
pub fn add_eq_u8_immediate( &mut self, source_addr: FrameMemoryAddress, immediate: u8, comment: &str, )
pub fn add_eq_32( &mut self, addr_a: FrameMemoryAddress, addr_b: FrameMemoryAddress, comment: &str, )
pub fn add_call_placeholder(&mut self, comment: &str) -> PatchPosition
pub fn add_jump_placeholder(&mut self, comment: &str) -> PatchPosition
pub fn add_enter(&mut self, size: FrameMemorySize, comment: &str)
pub fn add_mov( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, size: MemorySize, comment: &str, )
pub fn add_movlp( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, size: MemorySize, comment: &str, )
pub fn add_ret(&mut self, comment: &str)
pub fn add_hlt(&mut self, comment: &str)
pub fn add_call(&mut self, function_ip: &InstructionPosition, comment: &str)
pub fn add_host_call( &mut self, host_function_id: u16, arguments_size: MemorySize, comment: &str, )
Sourcepub fn patch_jump(
&mut self,
patch_position: PatchPosition,
target_position: &InstructionPosition,
)
pub fn patch_jump( &mut self, patch_position: PatchPosition, target_position: &InstructionPosition, )
§Panics
pub fn patch_jump_here(&mut self, jump_position: PatchPosition)
Sourcepub fn patch_call(
&mut self,
patch_position: PatchPosition,
ip: &InstructionPosition,
)
pub fn patch_call( &mut self, patch_position: PatchPosition, ip: &InstructionPosition, )
§Panics
pub fn add_jmp(&mut self, ip: InstructionPosition, comment: &str)
pub fn add_map_iter_init( &mut self, iterator_target: FrameMemoryAddress, pointer_to_map: FrameMemoryAddressIndirectPointer, comment: &str, )
pub fn add_map_iter_next( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )
pub fn add_map_iter_next_pair( &mut self, iterator_target: FrameMemoryAddress, closure_variable_key: FrameMemoryAddress, closure_variable_value: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )
pub fn add_string_from_constant_slice( &mut self, target_string: FrameMemoryAddress, constant_addr: ConstantMemoryAddress, byte_count: MemorySize, comment: &str, )
pub fn add_string_append( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_string_len( &mut self, len_target: FrameMemoryAddress, indirect: FrameMemoryAddressIndirectPointer, comment: &str, )
pub fn add_vec_from_slice( &mut self, target: FrameMemoryAddress, source_slice: FrameMemoryAddress, element_size: MemorySize, element_count: CountU16, comment: &str, )
pub fn add_vec_iter_init( &mut self, iterator_target: FrameMemoryAddress, pointer_to_vec: FrameMemoryAddressIndirectPointer, comment: &str, )
pub fn add_vec_iter_next( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )
pub fn add_vec_iter_next_pair( &mut self, iterator_target: FrameMemoryAddress, closure_variable_key: FrameMemoryAddress, closure_variable_value: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )
pub fn add_ld32( &mut self, dst_offset: FrameMemoryAddress, value: i32, comment: &str, )
pub fn add_ld_constant( &mut self, target_addr: FrameMemoryAddress, constant_addr: ConstantMemoryAddress, size: MemorySize, comment: &str, )
pub fn add_ld8( &mut self, dst_offset: FrameMemoryAddress, value: u8, comment: &str, )
pub fn add_add_i32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_add_f32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_mul_i32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_neg_i32( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, comment: &str, )
pub fn add_neg_f32( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, comment: &str, )
pub fn add_jmp_if( &mut self, condition_offset: FrameMemoryAddress, jmp_target: &InstructionPosition, comment: &str, )
pub fn add_jmp_if_not( &mut self, condition_offset: MemoryAddress, jmp_target: InstructionPosition, comment: &str, )
pub fn add_lt_i32( &mut self, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_gt_i32( &mut self, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )
pub fn add_tst8(&mut self, addr: FrameMemoryAddress, comment: &str)
pub fn add_map_new_from_slice( &mut self, map_target_addr: FrameMemoryAddress, slice_source_addr: FrameMemoryAddress, key_size: MemorySize, value_size: MemorySize, count: CountU16, comment: &str, )
pub fn add_map_remove( &mut self, map_target_addr: FrameMemoryAddress, key_addr: FrameMemoryAddress, comment: &str, )
pub fn add_ld_u16(&mut self, dest: FrameMemoryAddress, data: u16, comment: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InstructionBuilder
impl RefUnwindSafe for InstructionBuilder
impl Send for InstructionBuilder
impl Sync for InstructionBuilder
impl Unpin for InstructionBuilder
impl UnwindSafe for InstructionBuilder
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