From 014df99c9401056862fae741d0d2fc9892de5eba Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 17 Jul 2025 14:12:54 -0700 Subject: ZJIT: Remove obsoleted exit_trampoline (#13943) --- zjit/src/state.rs | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/zjit/src/state.rs b/zjit/src/state.rs index cb68f8a8ef..001b550747 100644 --- a/zjit/src/state.rs +++ b/zjit/src/state.rs @@ -3,8 +3,6 @@ use crate::cruby_methods; use crate::invariants::Invariants; use crate::options::Options; use crate::asm::CodeBlock; -use crate::backend::lir::{asm_comment, Assembler, C_RET_OPND}; -use crate::virtualmem::CodePtr; #[allow(non_upper_case_globals)] #[unsafe(no_mangle)] @@ -31,9 +29,6 @@ pub struct ZJITState { /// Properties of core library methods method_annotations: cruby_methods::Annotations, - - /// Trampoline to propagate a callee's side exit to the caller - exit_trampoline: Option, } /// Private singleton instance of the codegen globals @@ -88,14 +83,8 @@ impl ZJITState { invariants: Invariants::default(), assert_compiles: false, method_annotations: cruby_methods::init(), - exit_trampoline: None, }; unsafe { ZJIT_STATE = Some(zjit_state); } - - // Generate trampolines after initializing ZJITState, which Assembler will use - let cb = ZJITState::get_code_block(); - let exit_trampoline = Self::gen_exit_trampoline(cb).unwrap(); - ZJITState::get_instance().exit_trampoline = Some(exit_trampoline); } /// Return true if zjit_state has been initialized @@ -137,20 +126,6 @@ impl ZJITState { let instance = ZJITState::get_instance(); instance.assert_compiles = true; } - - /// Generate a trampoline to propagate a callee's side exit to the caller - fn gen_exit_trampoline(cb: &mut CodeBlock) -> Option { - let mut asm = Assembler::new(); - asm_comment!(asm, "ZJIT exit trampoline"); - asm.frame_teardown(); - asm.cret(C_RET_OPND); - asm.compile(cb).map(|(start_ptr, _)| start_ptr) - } - - /// Get the trampoline to propagate a callee's side exit to the caller - pub fn get_exit_trampoline() -> CodePtr { - ZJITState::get_instance().exit_trampoline.unwrap() - } } /// Initialize ZJIT, given options allocated by rb_zjit_init_options() -- cgit v1.2.3