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
15
macro_rules! CODEGEN_ASSERT {
    ($expr:expr) => {
        assert!($expr);
    };
}

use crate::records::function_bytecode_summary::FunctionBytecodeSummary;

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