pub struct Proto {
pub stack_size: u32,
pub param_count: u32,
pub code: Vec<Instruction>,
pub consts: Vec<Const>,
pub const_map: HashMap<Const, u32>,
pub local_vars: Vec<LocalVal>,
pub up_vars: Vec<UpVal>,
pub protos: Vec<Proto>,
}
Fields§
§stack_size: u32
§param_count: u32
§code: Vec<Instruction>
§consts: Vec<Const>
§const_map: HashMap<Const, u32>
§local_vars: Vec<LocalVal>
§up_vars: Vec<UpVal>
§protos: Vec<Proto>
Implementations§
Source§impl Proto
impl Proto
pub fn new() -> Proto
pub fn open(&mut self)
pub fn close(&mut self)
pub fn code_return(&mut self, first: u32, nret: u32) -> usize
pub fn code_nil(&mut self, start_reg: u32, n: u32) -> usize
pub fn code_bool(&mut self, reg: u32, v: bool, pc: u32) -> usize
pub fn code_const(&mut self, reg_index: u32, const_index: u32) -> usize
pub fn code_move(&mut self, reg: u32, src: u32) -> usize
pub fn code_bin_op( &mut self, op: BinOp, target: u32, left: u32, right: u32, ) -> usize
pub fn code_comp(&mut self, op: BinOp, left: u32, right: u32) -> usize
pub fn code_un_op(&mut self, op: UnOp, target: u32, src: u32) -> usize
pub fn code_jmp(&mut self, offset: i32, upvars: u32) -> usize
pub fn fix_cond_jump_pos( &mut self, true_pos: usize, false_pos: usize, pc: usize, )
pub fn fix_jump_pos(&mut self, pos: usize, pc: usize)
pub fn code_test_set(&mut self, set: u32, test: u32, to_test: u32)
pub fn add_local_var(&mut self, name: &str)
pub fn get_local_var(&self, name: &str) -> Option<u32>
pub fn add_const(&mut self, k: Const) -> u32
pub fn save(&mut self, target: u32) -> usize
pub fn get_instruction(&mut self, index: usize) -> &mut Instruction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Proto
impl RefUnwindSafe for Proto
impl Send for Proto
impl Sync for Proto
impl Unpin for Proto
impl UnwindSafe for Proto
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