pub struct Compiler {Show 40 fields
pub bytecode: *mut BytecodeBuilder,
pub options: CompileOptions,
pub functions: DenseHashMap<*mut AstExprFunction, Function>,
pub locals: DenseHashMap<*mut AstLocal, Local>,
pub globals: DenseHashMap<AstName, Global>,
pub variables: DenseHashMap<*mut AstLocal, Variable>,
pub constants: DenseHashMap<*mut AstExpr, Constant>,
pub locstants: DenseHashMap<*mut AstLocal, Constant>,
pub table_constants: DenseHashMap<*mut AstLocal, TableConstantKind>,
pub table_shapes: DenseHashMap<*mut AstExprTable, TableShape>,
pub builtins: DenseHashMap<*mut AstExprCall, i32>,
pub userdata_types: DenseHashMap<AstName, u8>,
pub function_types: DenseHashMap<*mut AstExprFunction, String>,
pub local_types: DenseHashMap<*mut AstLocal, LuauBytecodeType>,
pub expr_types: DenseHashMap<*mut AstExpr, LuauBytecodeType>,
pub inline_builtins: DenseHashMap<*mut AstExprCall, i32>,
pub inline_builtins_backup: DenseHashMap<*mut AstExprCall, i32>,
pub expr_changes: Vec<ExprConstantChange>,
pub local_changes: Vec<LocalConstantChange>,
pub builtin_types: BuiltinAstTypes,
pub names: *mut AstNameTable,
pub export_table_local: AstLocal,
pub builtins_fold: *const DenseHashMap<*mut AstExprCall, i32>,
pub builtins_fold_library_k: bool,
pub reg_top: u32,
pub stack_size: u32,
pub arg_count: usize,
pub has_loops: bool,
pub current_function: *mut AstExprFunction,
pub block_depth: usize,
pub getfenv_used: bool,
pub setfenv_used: bool,
pub local_stack: Vec<*mut AstLocal>,
pub upvals: Vec<*mut AstLocal>,
pub loop_jumps: Vec<LoopJump>,
pub loops: Vec<Loop>,
pub inline_frames: Vec<InlineFrame>,
pub captures: Vec<Capture>,
pub exported_locals: Vec<*mut AstLocal>,
pub exported_classes: Vec<(AstName, u8)>,
}Fields§
§bytecode: *mut BytecodeBuilder§options: CompileOptions§functions: DenseHashMap<*mut AstExprFunction, Function>§locals: DenseHashMap<*mut AstLocal, Local>§globals: DenseHashMap<AstName, Global>§variables: DenseHashMap<*mut AstLocal, Variable>§constants: DenseHashMap<*mut AstExpr, Constant>§locstants: DenseHashMap<*mut AstLocal, Constant>§table_constants: DenseHashMap<*mut AstLocal, TableConstantKind>§table_shapes: DenseHashMap<*mut AstExprTable, TableShape>§builtins: DenseHashMap<*mut AstExprCall, i32>§userdata_types: DenseHashMap<AstName, u8>§function_types: DenseHashMap<*mut AstExprFunction, String>§local_types: DenseHashMap<*mut AstLocal, LuauBytecodeType>§expr_types: DenseHashMap<*mut AstExpr, LuauBytecodeType>§inline_builtins: DenseHashMap<*mut AstExprCall, i32>§inline_builtins_backup: DenseHashMap<*mut AstExprCall, i32>§expr_changes: Vec<ExprConstantChange>§local_changes: Vec<LocalConstantChange>§builtin_types: BuiltinAstTypes§names: *mut AstNameTable§export_table_local: AstLocal§builtins_fold: *const DenseHashMap<*mut AstExprCall, i32>§builtins_fold_library_k: bool§reg_top: u32§stack_size: u32§arg_count: usize§has_loops: bool§current_function: *mut AstExprFunction§block_depth: usize§getfenv_used: bool§setfenv_used: bool§local_stack: Vec<*mut AstLocal>§upvals: Vec<*mut AstLocal>§loop_jumps: Vec<LoopJump>§loops: Vec<Loop>§inline_frames: Vec<InlineFrame>§captures: Vec<Capture>§exported_locals: Vec<*mut AstLocal>§exported_classes: Vec<(AstName, u8)>Implementations§
Source§impl Compiler
impl Compiler
pub fn are_locals_redundant(&mut self, stat: *mut AstStatLocal) -> bool
Source§impl Compiler
impl Compiler
pub fn can_import(&self, expr: *mut AstExprGlobal) -> bool
Source§impl Compiler
impl Compiler
pub fn can_import_chain(&self, expr: *mut AstExprGlobal) -> bool
Source§impl Compiler
impl Compiler
pub fn check_exported_local( &mut self, local: *mut AstLocal, location: &Location, )
Source§impl Compiler
impl Compiler
pub fn compile_class_declaration(&mut self, decl: *mut AstStatClass)
Source§impl Compiler
impl Compiler
pub fn compile_compare_jump( &mut self, expr: *mut AstExprBinary, not_: bool, ) -> usize
Source§impl Compiler
impl Compiler
pub fn compile_export_table(&mut self)
Source§impl Compiler
impl Compiler
pub fn compile_expr_and_or( &mut self, expr: *mut AstExprBinary, target: u8, target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_binary( &mut self, expr: *mut AstExprBinary, target: u8, _target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_call( &mut self, expr: *mut AstExprCall, target: u8, target_count: u8, target_top: bool, mult_ret: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_function(&mut self, expr: *mut AstExprFunction, target: u8)
Source§impl Compiler
impl Compiler
pub fn compile_expr_if_else( &mut self, expr: *mut AstExprIfElse, target: u8, target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_index_expr( &mut self, expr: *mut AstExprIndexExpr, target: u8, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_index_name( &mut self, expr: *mut AstExprIndexName, target: u8, target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_interp_string( &mut self, expr: *mut AstExprInterpString, target: u8, target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_select_vararg( &mut self, expr: *mut AstExprCall, target: u8, target_count: u8, target_top: bool, mult_ret: bool, regs: u8, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_table( &mut self, expr: *mut AstExprTable, target: u8, target_temp: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_unary(&mut self, expr: *mut AstExprUnary, target: u8)
Source§impl Compiler
impl Compiler
pub fn compile_expr_varargs( &mut self, expr: *mut AstExprVarargs, target: u8, target_count: u8, mult_ret: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_function( &mut self, func: *mut AstExprFunction, protoflags: &mut u8, ) -> u32
Source§impl Compiler
impl Compiler
pub fn compile_inline_return( &mut self, stat: *mut AstStatReturn, _fallthrough: bool, )
Source§impl Compiler
impl Compiler
pub fn compile_inlined_call( &mut self, expr: *mut AstExprCall, func: *mut AstExprFunction, target: u8, target_count: u8, )
Source§impl Compiler
impl Compiler
pub fn compile_stat_assign(&mut self, stat: *mut AstStatAssign)
Source§impl Compiler
impl Compiler
pub fn compile_stat_compound_assign(&mut self, stat: *mut AstStatCompoundAssign)
Source§impl Compiler
impl Compiler
pub fn compile_stat_for(&mut self, stat: *mut AstStatFor)
Source§impl Compiler
impl Compiler
pub fn compile_stat_for_in(&mut self, stat: *mut AstStatForIn)
Source§impl Compiler
impl Compiler
pub fn compile_stat_function(&mut self, stat: *mut AstStatFunction)
Source§impl Compiler
impl Compiler
pub fn compile_stat_local(&mut self, stat: *mut AstStatLocal)
Source§impl Compiler
impl Compiler
pub fn compile_stat_repeat(&mut self, stat: *mut AstStatRepeat)
Source§impl Compiler
impl Compiler
pub fn compile_stat_return(&mut self, stat: *mut AstStatReturn)
Source§impl Compiler
impl Compiler
pub fn compile_stat_while(&mut self, stat: *mut AstStatWhile)
Source§impl Compiler
impl Compiler
pub fn compile_unrolled_for( &mut self, stat: *mut AstStatFor, trip_count: i32, from: f64, step: f64, )
Source§impl Compiler
impl Compiler
pub fn compiler( bytecode: &mut BytecodeBuilder, options: &CompileOptions, names: &mut AstNameTable, ) -> Compiler
Source§impl Compiler
impl Compiler
pub fn const_upvalue_visitor_const_upvalue_visitor( &mut self, ) -> ConstUpvalueVisitor
Source§impl Compiler
impl Compiler
pub fn cost_model_inlined_call( &mut self, expr: *mut AstExprCall, func: *mut AstExprFunction, ) -> u64
Source§impl Compiler
impl Compiler
pub fn extract_stat_continue( &mut self, block: *mut AstStatBlock, ) -> *mut AstStatContinue
Source§impl Compiler
impl Compiler
pub fn gather_const_upvals(&mut self, func: *mut AstExprFunction)
Source§impl Compiler
impl Compiler
pub fn get_binary_op_arith( &mut self, op: AstExprBinaryOp, k: bool, ) -> LuauOpcode
Source§impl Compiler
impl Compiler
pub fn get_expr_local(&mut self, node: *mut AstExpr) -> *mut AstExprLocal
Source§impl Compiler
impl Compiler
pub fn get_function_expr(&mut self, node: *mut AstExpr) -> *mut AstExprFunction
Source§impl Compiler
impl Compiler
pub fn get_jump_op_compare( &mut self, op: AstExprBinaryOp, not_: bool, ) -> LuauOpcode
Source§impl Compiler
impl Compiler
pub fn get_unary_op(&mut self, op: AstExprUnaryOp) -> LuauOpcode
Source§impl Compiler
impl Compiler
pub fn hint_temporary_expr_reg_type( &mut self, expr: *mut AstExpr, reg: i32, expected_type: LuauBytecodeType, inst_length: i32, )
Source§impl Compiler
impl Compiler
pub fn hint_temporary_reg_type( &mut self, expr: *mut AstExpr, reg: i32, expected_type: LuauBytecodeType, inst_length: i32, )
Source§impl Compiler
impl Compiler
pub fn resolve_assign_conflicts( &mut self, stat: *mut AstStat, vars: &mut Vec<Assignment>, values: &AstArray<*mut AstExpr>, )
Source§impl Compiler
impl Compiler
pub fn return_visitor_return_visitor(&mut self) -> ReturnVisitor
Source§impl Compiler
impl Compiler
pub fn try_compile_inlined_call( &mut self, expr: *mut AstExprCall, func: *mut AstExprFunction, target: u8, target_count: u8, mult_ret: bool, threshold_base: i32, threshold_max_boost: i32, depth_limit: i32, ) -> bool
Source§impl Compiler
impl Compiler
pub fn try_compile_unrolled_for( &mut self, stat: *mut AstStatFor, threshold_base: i32, threshold_max_boost: i32, ) -> bool
Source§impl Compiler
impl Compiler
pub fn try_index_constant_table( &mut self, expr: *mut AstExprIndexName, ) -> *mut AstExpr
Source§impl Compiler
impl Compiler
pub fn undefined_local_visitor_undefined_local_visitor( &mut self, ) -> UndefinedLocalVisitor
Source§impl Compiler
impl Compiler
pub fn validate_continue_until( &mut self, cont: *mut AstStat, condition: *mut AstExpr, body: *mut AstStatBlock, start: usize, )
Source§impl Compiler
impl Compiler
pub fn compile_expr_global(&mut self, expr: *mut AstExprGlobal, target: u8)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Compiler
impl !Send for Compiler
impl !Sync for Compiler
impl !UnwindSafe for Compiler
impl Freeze for Compiler
impl Unpin for Compiler
impl UnsafeUnpin for Compiler
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