luaur-code-gen 0.1.3

Native (A64/X64) code generation for Luau (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::records::function_bytecode_summary::FunctionBytecodeSummary;

macro_rules! CODEGEN_ASSERT {
    ($expr:expr) => {
        assert!($expr);
    };
}

impl FunctionBytecodeSummary {
    pub fn inc_count(&mut self, nesting: u32, op: u8) {
        CODEGEN_ASSERT!(nesting <= self.get_nesting_limit());
        CODEGEN_ASSERT!((op as u32) < self.get_op_limit());
        self.counts[nesting as usize][op as usize] += 1;
    }
}