summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2025-02-06 15:12:21 -0500
committerTakashi Kokubun <takashikkbn@gmail.com>2025-04-18 21:52:56 +0900
commit34becd4017e2eb5f5f0e9be93cb85a4495892f7f (patch)
treec5d63a4a1db85f8398e775baf2a984131a282cd5
parent14a4edaea61a49da0c93ce53d76bbecba2df7448 (diff)
Add CCall insn
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
-rw-r--r--zjit/src/ir.rs23
1 files changed, 15 insertions, 8 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs
index 0d349350d2..bd7e3c857b 100644
--- a/zjit/src/ir.rs
+++ b/zjit/src/ir.rs
@@ -37,22 +37,29 @@ enum Insn {
//SetIvar {},
//GetIvar {},
- // Send with dynamic dispatch
- // Ignoring keyword arguments etc for now
- Send { self_val: Opnd, args: Vec<Opnd> },
+ // Operators
+ Add { v0: Opnd, v1: Opnd },
- // Control flow instructions
- Return { val: Opnd },
+ // Comparison operators
+ Lt { v0: Opnd, v1: Opnd },
// Unconditional jump
Jump(BranchEdge),
- // Operators
- Add { v0: Opnd, v1: Opnd },
-
// 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 },
}
#[derive(Default, Debug, PartialEq)]