luaur-code-gen 0.1.0

Native (A64/X64) code generation for Luau (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
impl crate::records::const_prop_state::ConstPropState {
    pub fn invalidate_registers_from(&mut self, first_reg: i32) {
        for i in first_reg..=self.max_reg {
            let idx = i as usize;
            // Avoid borrowing `self` (and `self.regs[idx]`) mutably more than once:
            // - take a raw pointer to the register slot
            // - perform the invalidation call using the raw pointer as a mutable ref
            let reg_ptr: *mut crate::records::register_info::RegisterInfo = &mut self.regs[idx];
            unsafe {
                self.invalidate_register_info_bool_bool(&mut *reg_ptr, true, true);
            }
        }
    }
}