Struct InstructionBuilder

Source
pub struct InstructionBuilder {
    pub instructions: Vec<BinaryInstruction>,
    pub comments: Vec<String>,
}

Fields§

§instructions: Vec<BinaryInstruction>§comments: Vec<String>

Implementations§

Source§

impl InstructionBuilder

Source

pub const fn new() -> Self

Source

pub fn position(&self) -> InstructionPosition

Source

pub fn add_jmp_if_equal_placeholder(&mut self, comment: &str) -> PatchPosition

Source

pub fn add_jmp_if_not_equal_placeholder( &mut self, comment: &str, ) -> PatchPosition

Source

pub fn add_vec_iter_next_placeholder( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, comment: &str, ) -> PatchPosition

Source

pub fn add_vec_iter_next_pair_placeholder( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, closure_variable_b: FrameMemoryAddress, comment: &str, ) -> PatchPosition

Source

pub fn add_eq_u8_immediate( &mut self, source_addr: FrameMemoryAddress, immediate: u8, comment: &str, )

Source

pub fn add_eq_32( &mut self, addr_a: FrameMemoryAddress, addr_b: FrameMemoryAddress, comment: &str, )

Source

pub fn add_call_placeholder(&mut self, comment: &str) -> PatchPosition

Source

pub fn add_jump_placeholder(&mut self, comment: &str) -> PatchPosition

Source

pub fn add_enter(&mut self, size: FrameMemorySize, comment: &str)

Source

pub fn add_mov( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, size: MemorySize, comment: &str, )

Source

pub fn add_movlp( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, size: MemorySize, comment: &str, )

Source

pub fn add_ret(&mut self, comment: &str)

Source

pub fn add_hlt(&mut self, comment: &str)

Source

pub fn add_call(&mut self, function_ip: &InstructionPosition, comment: &str)

Source

pub fn add_host_call( &mut self, host_function_id: u16, arguments_size: MemorySize, comment: &str, )

Source

pub fn patch_jump( &mut self, patch_position: PatchPosition, target_position: &InstructionPosition, )

§Panics
Source

pub fn patch_jump_here(&mut self, jump_position: PatchPosition)

Source

pub fn patch_call( &mut self, patch_position: PatchPosition, ip: &InstructionPosition, )

§Panics
Source

pub fn add_jmp(&mut self, ip: InstructionPosition, comment: &str)

Source

pub fn add_map_iter_init( &mut self, iterator_target: FrameMemoryAddress, pointer_to_map: FrameMemoryAddressIndirectPointer, comment: &str, )

Source

pub fn add_map_iter_next( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )

Source

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, )

Source

pub fn add_string_from_constant_slice( &mut self, target_string: FrameMemoryAddress, constant_addr: ConstantMemoryAddress, byte_count: MemorySize, comment: &str, )

Source

pub fn add_string_append( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_string_len( &mut self, len_target: FrameMemoryAddress, indirect: FrameMemoryAddressIndirectPointer, comment: &str, )

Source

pub fn add_vec_from_slice( &mut self, target: FrameMemoryAddress, source_slice: FrameMemoryAddress, element_size: MemorySize, element_count: CountU16, comment: &str, )

Source

pub fn add_vec_iter_init( &mut self, iterator_target: FrameMemoryAddress, pointer_to_vec: FrameMemoryAddressIndirectPointer, comment: &str, )

Source

pub fn add_vec_iter_next( &mut self, iterator_target: FrameMemoryAddress, closure_variable: FrameMemoryAddress, instruction_position: InstructionPosition, comment: &str, )

Source

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, )

Source

pub fn add_ld32( &mut self, dst_offset: FrameMemoryAddress, value: i32, comment: &str, )

Source

pub fn add_ld_constant( &mut self, target_addr: FrameMemoryAddress, constant_addr: ConstantMemoryAddress, size: MemorySize, comment: &str, )

Source

pub fn add_ld8( &mut self, dst_offset: FrameMemoryAddress, value: u8, comment: &str, )

Source

pub fn add_add_i32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_add_f32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_mul_i32( &mut self, dst_offset: FrameMemoryAddress, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_neg_i32( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, comment: &str, )

Source

pub fn add_neg_f32( &mut self, target: FrameMemoryAddress, source: FrameMemoryAddress, comment: &str, )

Source

pub fn add_jmp_if( &mut self, condition_offset: FrameMemoryAddress, jmp_target: &InstructionPosition, comment: &str, )

Source

pub fn add_jmp_if_not( &mut self, condition_offset: MemoryAddress, jmp_target: InstructionPosition, comment: &str, )

Source

pub fn add_lt_i32( &mut self, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_gt_i32( &mut self, lhs_offset: FrameMemoryAddress, rhs_offset: FrameMemoryAddress, comment: &str, )

Source

pub fn add_tst8(&mut self, addr: FrameMemoryAddress, comment: &str)

Source

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, )

Source

pub fn add_map_remove( &mut self, map_target_addr: FrameMemoryAddress, key_addr: FrameMemoryAddress, comment: &str, )

Source

pub fn add_ld_u16(&mut self, dest: FrameMemoryAddress, data: u16, comment: &str)

Trait Implementations§

Source§

impl Default for InstructionBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.