8383#![ allow( non_upper_case_globals) ]
8484#![ allow( clippy:: upper_case_acronyms) ]
8585
86- // Some of this code may not be used yet
87- #![ allow( dead_code) ]
88- #![ allow( unused_macros) ]
89- #![ allow( unused_imports) ]
90-
9186use std:: convert:: From ;
9287use std:: ffi:: { c_void, CString , CStr } ;
9388use std:: fmt:: { Debug , Display , Formatter } ;
@@ -120,7 +115,6 @@ pub use autogened::*;
120115// These are functions we expose from C files, not in any header.
121116// Parsing it would result in a lot of duplicate definitions.
122117// Use bindgen for functions that are defined in headers or in zjit.c.
123- #[ cfg_attr( test, allow( unused) ) ] // We don't link against C code when testing
124118unsafe extern "C" {
125119 pub fn rb_check_overloaded_cme (
126120 me : * const rb_callable_method_entry_t ,
@@ -181,10 +175,7 @@ pub use rb_get_ec_cfp as get_ec_cfp;
181175pub use rb_get_cfp_iseq as get_cfp_iseq;
182176pub use rb_get_cfp_pc as get_cfp_pc;
183177pub use rb_get_cfp_sp as get_cfp_sp;
184- pub use rb_get_cfp_self as get_cfp_self;
185- pub use rb_get_cfp_ep as get_cfp_ep;
186178pub use rb_get_cfp_ep_level as get_cfp_ep_level;
187- pub use rb_vm_base_ptr as get_cfp_bp;
188179pub use rb_get_cme_def_type as get_cme_def_type;
189180pub use rb_get_cme_def_body_attr_id as get_cme_def_body_attr_id;
190181pub use rb_get_cme_def_body_optimized_type as get_cme_def_body_optimized_type;
@@ -196,26 +187,20 @@ pub use rb_get_mct_argc as get_mct_argc;
196187pub use rb_get_mct_func as get_mct_func;
197188pub use rb_get_def_iseq_ptr as get_def_iseq_ptr;
198189pub use rb_iseq_encoded_size as get_iseq_encoded_size;
199- pub use rb_get_iseq_body_local_iseq as get_iseq_body_local_iseq;
200190pub use rb_get_iseq_body_iseq_encoded as get_iseq_body_iseq_encoded;
201191pub use rb_get_iseq_body_stack_max as get_iseq_body_stack_max;
202192pub use rb_get_iseq_body_type as get_iseq_body_type;
203193pub use rb_get_iseq_body_local_table_size as get_iseq_body_local_table_size;
204194pub use rb_get_cikw_keyword_len as get_cikw_keyword_len;
205195pub use rb_get_cikw_keywords_idx as get_cikw_keywords_idx;
206196pub use rb_get_call_data_ci as get_call_data_ci;
207- pub use rb_FL_TEST as FL_TEST ;
208197pub use rb_FL_TEST_RAW as FL_TEST_RAW ;
209198pub use rb_RB_TYPE_P as RB_TYPE_P ;
210- pub use rb_BASIC_OP_UNREDEFINED_P as BASIC_OP_UNREDEFINED_P ;
211199pub use rb_vm_ci_argc as vm_ci_argc;
212200pub use rb_vm_ci_mid as vm_ci_mid;
213201pub use rb_vm_ci_flag as vm_ci_flag;
214- pub use rb_vm_ci_kwarg as vm_ci_kwarg;
215202pub use rb_METHOD_ENTRY_VISI as METHOD_ENTRY_VISI ;
216203pub use rb_RCLASS_ORIGIN as RCLASS_ORIGIN ;
217- pub use rb_vm_get_special_object as vm_get_special_object;
218- pub use rb_jit_fix_div_fix as rb_fix_div_fix;
219204pub use rb_jit_fix_mod_fix as rb_fix_mod_fix;
220205
221206/// Helper so we can get a Rust string for insn_name()
@@ -757,7 +742,6 @@ pub trait IseqAccess {
757742impl IseqAccess for IseqPtr {
758743 /// Get a description of the ISEQ's signature. Analogous to `ISEQ_BODY(iseq)->param` in C.
759744 unsafe fn params < ' a > ( self ) -> & ' a IseqParameters {
760- use crate :: cast:: IntoUsize ;
761745 unsafe { & * ( ( * self ) . body . byte_add ( ISEQ_BODY_OFFSET_PARAM . to_usize ( ) ) as * const IseqParameters ) }
762746 }
763747}
@@ -1006,17 +990,6 @@ macro_rules! src_loc {
1006990
1007991pub ( crate ) use src_loc;
1008992
1009- /// Run GC write barrier. Required after making a new edge in the object reference
1010- /// graph from `old` to `young`.
1011- macro_rules! obj_written {
1012- ( $old: expr, $young: expr) => {
1013- let ( old, young) : ( VALUE , VALUE ) = ( $old, $young) ;
1014- let src_loc = $crate:: cruby:: src_loc!( ) ;
1015- unsafe { rb_yjit_obj_written( old, young, src_loc. file. as_ptr( ) , src_loc. line) } ;
1016- } ;
1017- }
1018- pub ( crate ) use obj_written;
1019-
1020993/// Acquire the VM lock, make sure all other Ruby threads are asleep then run
1021994/// some code while holding the lock. Returns whatever `func` returns.
1022995/// Use with [src_loc!].
0 commit comments