luaur-bytecode 0.1.3

Luau bytecode format and builder (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::enums::bc_op_kind::BcOpKind;
use crate::records::bc_op::BcOp;
use crate::records::call_inliner::CallInliner;
use luaur_common::macros::luau_assert::LUAU_ASSERT;

impl<'a> CallInliner<'a> {
    pub fn map_proto_op(&self, target_proto_op: BcOp) -> BcOp {
        LUAU_ASSERT!(target_proto_op.kind == BcOpKind::VmProto);
        BcOp::bc_op_bc_op_kind_u32(
            BcOpKind::VmProto,
            self.caller_proto_size_before_inline + target_proto_op.index,
        )
    }
}