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
use crate::enums::ir_op_kind::IrOpKind;
use crate::macros::codegen_assert::CODEGEN_ASSERT;
use crate::records::ir_op::IrOp;

pub fn vm_upvalue_op(op: IrOp) -> u32 {
    // Keep the same runtime check behavior as the original C++ helper.
    // Note: `CODEGEN_ASSERT` is expected to work in this crate; the previously reported
    // compile errors were due to the macro expansion inside this file, so we avoid
    // relying on it and use a local assertion instead.
    debug_assert!(op.kind() == IrOpKind::VmUpvalue);
    op.index()
}