pub struct BytecodeBuilder<'src> { /* private fields */ }Implementations§
Source§impl<'src> BytecodeBuilder<'src>
impl<'src> BytecodeBuilder<'src>
pub fn set_dump_flags(&mut self, flags: BytecodeDumpFlags)
pub fn set_dump_source(&mut self, source: impl AsRef<[u8]>)
pub fn needs_debug_remarks(&self) -> bool
pub fn add_debug_remark(&mut self, text: impl AsRef<[u8]>)
pub fn dump_function(&self, id: usize) -> BString
pub fn dump_everything(&self) -> BString
pub fn dump_source_remarks(&self) -> BString
pub fn dump_type_info(&self) -> BString
pub fn annotate_instruction( &self, result: &mut BString, function_id: u32, instruction_pc: u32, )
Source§impl<'src> BytecodeBuilder<'src>
impl<'src> BytecodeBuilder<'src>
pub fn emit_abc(&mut self, opcode: Opcode, a: u8, b: u8, c: u8)
pub fn set_debug_function_name( &mut self, name: impl Into<BytecodeStringRef<'src>>, )
pub fn set_debug_function_line_defined(&mut self, line: i32)
pub fn add_flags(&mut self, flags: u8)
pub fn push_open_debug_local( &mut self, name: impl Into<BytecodeStringRef<'src>>, register: Register, )
pub fn push_debug_local( &mut self, name: impl Into<BytecodeStringRef<'src>>, register: Register, start_pc: u32, end_pc: u32, )
pub fn close_debug_locals_from(&mut self, register: Register)
pub fn push_debug_upvalue(&mut self, name: impl Into<BytecodeStringRef<'src>>)
pub fn emit_ad(&mut self, opcode: Opcode, a: u8, d: i16)
pub fn emit_e(&mut self, opcode: Opcode, e: i32)
pub fn set_debug_line(&mut self, line: usize)
pub fn current_line(&self) -> i32
pub fn restore_line(&mut self, line: i32)
pub fn emit_aux(&mut self, aux: InstructionWord)
pub fn undo_emit(&mut self, opcode: Opcode)
pub fn emit_label(&mut self) -> usize
pub fn patch_jump_d(&mut self, jump_label: usize, target_label: usize) -> bool
pub fn patch_jump_e(&mut self, jump_label: usize, target_label: usize) -> bool
pub fn patch_skip_c(&mut self, jump_label: usize, target_label: usize) -> bool
pub fn patch_aux(&mut self, target_aux: usize, value: i32)
pub fn fold_jumps(&mut self)
pub fn expand_jumps(&mut self)
pub fn get_instruction_count(&self) -> usize
pub fn get_total_instruction_count(&self) -> usize
pub fn get_debug_pc(&self) -> u32
Source§impl<'src> BytecodeBuilder<'src>
impl<'src> BytecodeBuilder<'src>
pub fn add_constant_nil(&mut self) -> ConstantIndex
pub fn add_constant_boolean(&mut self, value: bool) -> ConstantIndex
pub fn add_constant_number(&mut self, value: f64) -> ConstantIndex
pub fn add_constant_integer(&mut self, value: i64) -> ConstantIndex
pub fn add_constant_string( &mut self, value: impl Into<BytecodeStringRef<'src>>, ) -> ConstantIndex
pub fn add_import(&mut self, import_id: BytecodeImportId) -> ConstantIndex
pub fn add_constant_closure(&mut self, function_id: u32) -> ConstantIndex
pub fn add_constant_table(&mut self, shape: &TableShape) -> ConstantIndex
pub fn add_constant_vector( &mut self, x: f32, y: f32, z: f32, w: f32, ) -> ConstantIndex
pub fn add_constant_vector_double( &mut self, x: f64, y: f64, z: f64, w: f64, ) -> ConstantIndex
pub fn add_class_shape(&mut self, shape: BytecodeClass) -> ConstantIndex
pub fn add_fb_slot(&mut self, ty: BytecodeFeedbackType) -> u32
pub fn set_function_type_info(&mut self, value: Vec<u8>)
pub fn push_local_type_info( &mut self, ty: u8, register: Register, start_pc: u32, end_pc: u32, )
pub fn push_upvalue_type_info(&mut self, ty: u8)
pub fn add_userdata_type(&mut self, name: impl Into<BytecodeString>) -> u32
pub fn use_userdata_type(&mut self, index: u32)
pub fn finalize(&mut self)
pub fn get_bytecode(&self) -> &[u8] ⓘ
Sourcepub fn get_error(message: impl AsRef<[u8]>) -> Vec<u8> ⓘ
pub fn get_error(message: impl AsRef<[u8]>) -> Vec<u8> ⓘ
Encodes a compiler diagnostic as a bytecode blob that the VM loader can report using the requested chunk name.
pub fn get_string_table(&self) -> BytecodeStringTable<'_>
pub fn get_function_data(&self, id: usize) -> Vec<u8> ⓘ
pub fn get_string_hash(key: impl AsRef<[u8]>) -> u32
Source§impl<'src> BytecodeBuilder<'src>
impl<'src> BytecodeBuilder<'src>
pub fn new() -> Self
pub fn with_encoder(encoder: impl BytecodeEncoder + 'static) -> Self
pub fn begin_function(&mut self, num_params: u8, is_vararg: bool) -> usize
pub fn function_count(&self) -> usize
pub fn clear_string_table(&mut self)
pub fn end_function( &mut self, max_stack_size: u8, upvalue_count: u8, flags: u8, cost: u64, ) -> usize
pub fn add_child_function(&mut self, id: u32) -> Option<i16>
pub fn set_main_function(&mut self, id: usize)
Trait Implementations§
Auto Trait Implementations§
impl<'src> !RefUnwindSafe for BytecodeBuilder<'src>
impl<'src> !Send for BytecodeBuilder<'src>
impl<'src> !Sync for BytecodeBuilder<'src>
impl<'src> !UnwindSafe for BytecodeBuilder<'src>
impl<'src> Freeze for BytecodeBuilder<'src>
impl<'src> Unpin for BytecodeBuilder<'src>
impl<'src> UnsafeUnpin for BytecodeBuilder<'src>
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