This commit is contained in:
Nilton Constantino
2026-01-29 17:00:27 +00:00
parent c34166435f
commit fe00eda925
11 changed files with 140 additions and 125 deletions
@@ -71,9 +71,13 @@ pub fn lower_function(core_func: &ir_core::Function) -> Result<ir_vm::Function>
ir_core::Instr::And => ir_vm::InstrKind::And,
ir_core::Instr::Or => ir_vm::InstrKind::Or,
ir_core::Instr::Not => ir_vm::InstrKind::Not,
ir_core::Instr::Alloc => ir_vm::InstrKind::Alloc,
ir_core::Instr::ReadGate => ir_vm::InstrKind::LoadRef(0),
ir_core::Instr::WriteGate => ir_vm::InstrKind::StoreRef(0),
ir_core::Instr::Alloc { .. } => ir_vm::InstrKind::Alloc,
ir_core::Instr::BeginPeek { .. } |
ir_core::Instr::BeginBorrow { .. } |
ir_core::Instr::BeginMutate { .. } => ir_vm::InstrKind::LoadRef(0),
ir_core::Instr::EndPeek |
ir_core::Instr::EndBorrow |
ir_core::Instr::EndMutate => ir_vm::InstrKind::Nop,
ir_core::Instr::Free => ir_vm::InstrKind::Nop,
};
vm_func.body.push(ir_vm::Instruction::new(kind, None));