Skip to main content

luaur_bytecode/methods/
call_inliner_map_inst_op.rs

1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_op::BcOp;
3use crate::records::call_inliner::CallInliner;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5
6impl<'a> CallInliner<'a> {
7    pub(crate) fn map_inst_op(&mut self, target_inst: BcOp) -> BcOp {
8        LUAU_ASSERT!(target_inst.kind == BcOpKind::Inst);
9        BcOp::bc_op_bc_op_kind_u32(
10            BcOpKind::Inst,
11            self.caller_inst_size_before_inline + target_inst.index,
12        )
13    }
14}