Skip to content

Commit 7d670ea

Browse files
authored
ZJIT: Disable profiling in compile_iseq (ruby#14385)
This catches both the interpreter-JIT and JIT-JIT cases. Fixes #719
1 parent 8521725 commit 7d670ea

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

zjit.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ rb_zjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit
165165
RB_VM_LOCKING() {
166166
rb_vm_barrier();
167167

168-
// Convert ZJIT instructions back to bare instructions
169-
rb_zjit_profile_disable(iseq);
170-
171168
// Compile a block version starting at the current instruction
172169
uint8_t *rb_zjit_iseq_gen_entry_point(const rb_iseq_t *iseq, rb_execution_context_t *ec); // defined in Rust
173170
uintptr_t code_ptr = (uintptr_t)rb_zjit_iseq_gen_entry_point(iseq, ec);

zjit/src/codegen.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,9 @@ pub fn local_size_and_idx_to_bp_offset(local_size: usize, local_idx: usize) -> i
13981398

13991399
/// Convert ISEQ into High-level IR
14001400
fn compile_iseq(iseq: IseqPtr) -> Option<Function> {
1401+
// Convert ZJIT instructions back to bare instructions
1402+
unsafe { crate::cruby::rb_zjit_profile_disable(iseq) };
1403+
14011404
// Reject ISEQs with very large temp stacks.
14021405
// We cannot encode too large offsets to access locals in arm64.
14031406
let stack_max = unsafe { rb_get_iseq_body_stack_max(iseq) };

0 commit comments

Comments
 (0)