summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Bernstein <ruby@bernsteinbear.com>2025-09-17 13:05:38 -0400
committerMax Bernstein <tekknolagi@gmail.com>2025-09-17 17:27:35 -0400
commit1b0ca8f1f0ebabd440155ac8c373e7c49ba84df4 (patch)
treeee883fdd0f0c3aaa7a70b7c70b903c0f026714ef
parent88e0ac35a3b6f66074307421b208db62ae5ffe39 (diff)
ZJIT: Rename optimize_direct_sends to type_specialize
-rw-r--r--zjit/src/hir.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 3a7e87293d..6bdfbb9dad 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -1757,7 +1757,8 @@ impl Function {
/// Rewrite SendWithoutBlock opcodes into SendWithoutBlockDirect opcodes if we know the target
/// ISEQ statically. This removes run-time method lookups and opens the door for inlining.
- fn optimize_direct_sends(&mut self) {
+ /// Also try and inline constant caches, specialize object allocations, and more.
+ fn type_specialize(&mut self) {
for block in self.rpo() {
let old_insns = std::mem::take(&mut self.blocks[block.0].insns);
assert!(self.blocks[block.0].insns.is_empty());
@@ -2560,7 +2561,7 @@ impl Function {
/// Run all the optimization passes we have.
pub fn optimize(&mut self) {
// Function is assumed to have types inferred already
- self.optimize_direct_sends();
+ self.type_specialize();
#[cfg(debug_assertions)] self.assert_validates();
self.optimize_getivar();
#[cfg(debug_assertions)] self.assert_validates();