Skip to content

ZJIT: Remove obsoleted exit_trampoline #13943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions zjit/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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<CodePtr>,
}

/// Private singleton instance of the codegen globals
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<CodePtr> {
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()
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy