luaur-code-gen 0.1.0

Native (A64/X64) code generation for Luau (Rust).
Documentation
use crate::records::unwind_builder_win::UnwindBuilderWin;

impl UnwindBuilderWin {
    pub fn start_function(&mut self) {
        // End offset is filled in later and everything gets adjusted at the end
        let mut func = crate::records::unwind_function_win::UnwindFunctionWin::default();
        func.begin_offset = 0;
        func.end_offset = 0;
        func.unwind_info_offset =
            unsafe { self.raw_data_pos.offset_from(self.raw_data.as_ptr()) as u32 };
        self.unwind_functions.push(func);

        self.unwind_codes.clear();
        self.unwind_codes.reserve(16);

        self.prolog_size = 0;

        // rax has register index 0, which in Windows unwind info means that frame register is not used
        self.frame_reg = crate::records::register_x_64::RegisterX64::rax;
        self.frame_reg_offset = 0;
    }
}