From 7d670ead3008284822dea0e4c62ec7f2d12a2aec Mon Sep 17 00:00:00 2001 From: Max Bernstein Date: Thu, 28 Aug 2025 10:20:15 -0700 Subject: ZJIT: Disable profiling in compile_iseq (#14385) This catches both the interpreter-JIT and JIT-JIT cases. Fixes https://github.com/Shopify/ruby/issues/719 --- zjit.c | 3 --- zjit/src/codegen.rs | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zjit.c b/zjit.c index d4798ef860..311bc1fe80 100644 --- a/zjit.c +++ b/zjit.c @@ -165,9 +165,6 @@ rb_zjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit RB_VM_LOCKING() { rb_vm_barrier(); - // Convert ZJIT instructions back to bare instructions - rb_zjit_profile_disable(iseq); - // Compile a block version starting at the current instruction uint8_t *rb_zjit_iseq_gen_entry_point(const rb_iseq_t *iseq, rb_execution_context_t *ec); // defined in Rust uintptr_t code_ptr = (uintptr_t)rb_zjit_iseq_gen_entry_point(iseq, ec); diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs index 189741b07c..023498e3be 100644 --- a/zjit/src/codegen.rs +++ b/zjit/src/codegen.rs @@ -1398,6 +1398,9 @@ pub fn local_size_and_idx_to_bp_offset(local_size: usize, local_idx: usize) -> i /// Convert ISEQ into High-level IR fn compile_iseq(iseq: IseqPtr) -> Option { + // Convert ZJIT instructions back to bare instructions + unsafe { crate::cruby::rb_zjit_profile_disable(iseq) }; + // Reject ISEQs with very large temp stacks. // We cannot encode too large offsets to access locals in arm64. let stack_max = unsafe { rb_get_iseq_body_stack_max(iseq) }; -- cgit v1.2.3