Skip to main content

luaur_code_gen/methods/
function_bytecode_summary_inc_count.rs

1use crate::records::function_bytecode_summary::FunctionBytecodeSummary;
2
3macro_rules! CODEGEN_ASSERT {
4    ($expr:expr) => {
5        assert!($expr);
6    };
7}
8
9impl FunctionBytecodeSummary {
10    pub fn inc_count(&mut self, nesting: u32, op: u8) {
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] += 1;
14    }
15}