Add CCall insn

This commit is contained in:
Maxime Chevalier-Boisvert 2025-02-06 15:12:21 -05:00 committed by Takashi Kokubun
parent 14a4edaea6
commit 34becd4017
Notes: git 2025-04-18 13:49:37 +00:00

View File

@ -37,22 +37,29 @@ enum Insn {
//SetIvar {},
//GetIvar {},
// Operators
Add { v0: Opnd, v1: Opnd },
// Comparison operators
Lt { v0: Opnd, v1: Opnd },
// Unconditional jump
Jump(BranchEdge),
// Conditional branch instructions
IfTrue { val: Opnd, branch: BranchEdge },
IfFalse { val: Opnd, target: BranchEdge },
// Call a C function
// TODO: should we store the C function name?
CCall { cfun: *const u8, args: Vec<Opnd> },
// Send with dynamic dispatch
// Ignoring keyword arguments etc for now
Send { self_val: Opnd, args: Vec<Opnd> },
// Control flow instructions
Return { val: Opnd },
// Unconditional jump
Jump(BranchEdge),
// Operators
Add { v0: Opnd, v1: Opnd },
// Conditional branch instructions
IfTrue { val: Opnd, branch: BranchEdge },
IfFalse { val: Opnd, target: BranchEdge },
}
#[derive(Default, Debug, PartialEq)]