refactor: use GAT in enum Ir

This commit is contained in:
2026-05-01 20:18:00 +08:00
parent 6659b22dce
commit 47b1344ebe
7 changed files with 331 additions and 214 deletions
+9 -5
View File
@@ -79,19 +79,23 @@ impl<'a, Ctx: DisassemblerContext> Disassembler<'a, Ctx> {
#[inline(always)]
fn read_operand_data(&mut self) {
use OperandType::*;
let tag = self.read_u8();
let ty = OperandType::try_from_primitive(tag).expect("invalid operand type");
match ty {
OperandType::Const => {
Const => {
self.read_u32();
}
OperandType::Local => {
BigInt => {
self.read_i64();
}
Local => {
self.read_u8();
self.read_u32();
}
OperandType::Builtins => {}
OperandType::BigInt => {
self.read_i64();
Builtins => {}
ReplBinding | ScopedImportBinding | WithLookup => {
self.read_u32();
}
}
}