refactor: split VmContext
This commit is contained in:
@@ -3,7 +3,7 @@ use fix_common::StringId;
|
||||
use num_enum::TryFromPrimitive;
|
||||
use string_interner::Symbol as _;
|
||||
|
||||
use crate::OperandData;
|
||||
use crate::{OperandData, VmRuntimeCtx};
|
||||
|
||||
pub(crate) struct BytecodeReader<'a> {
|
||||
bytecode: &'a [u8],
|
||||
@@ -94,7 +94,7 @@ impl<'a> BytecodeReader<'a> {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn read_operand_data<C: crate::VmContext>(&mut self, ctx: &C) -> OperandData {
|
||||
pub(crate) fn read_operand_data<C: VmRuntimeCtx>(&mut self, ctx: &C) -> OperandData {
|
||||
let tag = self.read_u8();
|
||||
let Ok(ty) = OperandType::try_from_primitive(tag)
|
||||
.map_err(|err| panic!("unknown operand tag: {:#04x}", err.number));
|
||||
@@ -117,10 +117,7 @@ impl<'a> BytecodeReader<'a> {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub(crate) fn read_attr_key_data<C: crate::VmContext>(
|
||||
&mut self,
|
||||
ctx: &C,
|
||||
) -> crate::AttrKeyData {
|
||||
pub(crate) fn read_attr_key_data<C: VmRuntimeCtx>(&mut self, ctx: &C) -> crate::AttrKeyData {
|
||||
use fix_codegen::AttrKeyType;
|
||||
let tag = self.read_u8();
|
||||
let ty = AttrKeyType::try_from_primitive(tag)
|
||||
|
||||
Reference in New Issue
Block a user