Skip to main content

luaur_code_gen/methods/
function_bytecode_summary_get_count.rs

1macro_rules! CODEGEN_ASSERT {
2    ($expr:expr) => {
3        assert!($expr);
4    };
5}
6
7use crate::records::function_bytecode_summary::FunctionBytecodeSummary;
8
9impl FunctionBytecodeSummary {
10    pub fn get_count(&self, nesting: u32, op: u8) -> u32 {
11        CODEGEN_ASSERT!(nesting <= self.get_nesting_limit());
12        CODEGEN_ASSERT!((op as u32) < self.get_op_limit());
13        self.counts[nesting as usize][op as usize]
14    }
15}