@@ -3,8 +3,6 @@ use crate::cruby_methods;
33use crate :: invariants:: Invariants ;
44use crate :: options:: Options ;
55use crate :: asm:: CodeBlock ;
6- use crate :: backend:: lir:: { asm_comment, Assembler , C_RET_OPND } ;
7- use crate :: virtualmem:: CodePtr ;
86
97#[ allow( non_upper_case_globals) ]
108#[ unsafe( no_mangle) ]
@@ -31,9 +29,6 @@ pub struct ZJITState {
3129
3230 /// Properties of core library methods
3331 method_annotations : cruby_methods:: Annotations ,
34-
35- /// Trampoline to propagate a callee's side exit to the caller
36- exit_trampoline : Option < CodePtr > ,
3732}
3833
3934/// Private singleton instance of the codegen globals
@@ -88,14 +83,8 @@ impl ZJITState {
8883 invariants : Invariants :: default ( ) ,
8984 assert_compiles : false ,
9085 method_annotations : cruby_methods:: init ( ) ,
91- exit_trampoline : None ,
9286 } ;
9387 unsafe { ZJIT_STATE = Some ( zjit_state) ; }
94-
95- // Generate trampolines after initializing ZJITState, which Assembler will use
96- let cb = ZJITState :: get_code_block ( ) ;
97- let exit_trampoline = Self :: gen_exit_trampoline ( cb) . unwrap ( ) ;
98- ZJITState :: get_instance ( ) . exit_trampoline = Some ( exit_trampoline) ;
9988 }
10089
10190 /// Return true if zjit_state has been initialized
@@ -137,20 +126,6 @@ impl ZJITState {
137126 let instance = ZJITState :: get_instance ( ) ;
138127 instance. assert_compiles = true ;
139128 }
140-
141- /// Generate a trampoline to propagate a callee's side exit to the caller
142- fn gen_exit_trampoline ( cb : & mut CodeBlock ) -> Option < CodePtr > {
143- let mut asm = Assembler :: new ( ) ;
144- asm_comment ! ( asm, "ZJIT exit trampoline" ) ;
145- asm. frame_teardown ( ) ;
146- asm. cret ( C_RET_OPND ) ;
147- asm. compile ( cb) . map ( |( start_ptr, _) | start_ptr)
148- }
149-
150- /// Get the trampoline to propagate a callee's side exit to the caller
151- pub fn get_exit_trampoline ( ) -> CodePtr {
152- ZJITState :: get_instance ( ) . exit_trampoline . unwrap ( )
153- }
154129}
155130
156131/// Initialize ZJIT, given options allocated by rb_zjit_init_options()
0 commit comments