@@ -736,7 +736,7 @@ fn gen_ccall_with_frame(
736736 } ) ;
737737
738738 asm_comment ! ( asm, "switch to new SP register" ) ;
739- let sp_offset = ( caller_stack_size + VM_ENV_DATA_SIZE . as_usize ( ) ) * SIZEOF_VALUE ;
739+ let sp_offset = ( caller_stack_size + VM_ENV_DATA_SIZE . to_usize ( ) ) * SIZEOF_VALUE ;
740740 let new_sp = asm. add ( SP , sp_offset. into ( ) ) ;
741741 asm. mov ( SP , new_sp) ;
742742
@@ -792,7 +792,7 @@ fn gen_ccall_variadic(
792792 } ) ;
793793
794794 asm_comment ! ( asm, "switch to new SP register" ) ;
795- let sp_offset = ( state. stack ( ) . len ( ) - args. len ( ) + VM_ENV_DATA_SIZE . as_usize ( ) ) * SIZEOF_VALUE ;
795+ let sp_offset = ( state. stack ( ) . len ( ) - args. len ( ) + VM_ENV_DATA_SIZE . to_usize ( ) ) * SIZEOF_VALUE ;
796796 let new_sp = asm. add ( SP , sp_offset. into ( ) ) ;
797797 asm. mov ( SP , new_sp) ;
798798
@@ -975,7 +975,7 @@ fn gen_load_ivar_embedded(asm: &mut Assembler, self_val: Opnd, id: ID, index: u1
975975 // See ROBJECT_FIELDS() from include/ruby/internal/core/robject.h
976976
977977 asm_comment ! ( asm, "Load embedded ivar id={} index={}" , id. contents_lossy( ) , index) ;
978- let offs = ROBJECT_OFFSET_AS_ARY as i32 + ( SIZEOF_VALUE * index. as_usize ( ) ) as i32 ;
978+ let offs = ROBJECT_OFFSET_AS_ARY as i32 + ( SIZEOF_VALUE * index. to_usize ( ) ) as i32 ;
979979 let self_val = asm. load ( self_val) ;
980980 let ivar_opnd = Opnd :: mem ( 64 , self_val, offs) ;
981981 asm. load ( ivar_opnd)
@@ -990,7 +990,7 @@ fn gen_load_ivar_extended(asm: &mut Assembler, self_val: Opnd, id: ID, index: u1
990990 let tbl_opnd = asm. load ( Opnd :: mem ( 64 , self_val, ROBJECT_OFFSET_AS_HEAP_FIELDS as i32 ) ) ;
991991
992992 // Read the ivar from the extended table
993- let ivar_opnd = Opnd :: mem ( 64 , tbl_opnd, ( SIZEOF_VALUE * index. as_usize ( ) ) as i32 ) ;
993+ let ivar_opnd = Opnd :: mem ( 64 , tbl_opnd, ( SIZEOF_VALUE * index. to_usize ( ) ) as i32 ) ;
994994 asm. load ( ivar_opnd)
995995}
996996
@@ -1174,8 +1174,8 @@ fn gen_send_without_block_direct(
11741174) -> lir:: Opnd {
11751175 gen_incr_counter ( asm, Counter :: iseq_optimized_send_count) ;
11761176
1177- let local_size = unsafe { get_iseq_body_local_table_size ( iseq) } . as_usize ( ) ;
1178- let stack_growth = state. stack_size ( ) + local_size + unsafe { get_iseq_body_stack_max ( iseq) } . as_usize ( ) ;
1177+ let local_size = unsafe { get_iseq_body_local_table_size ( iseq) } . to_usize ( ) ;
1178+ let stack_growth = state. stack_size ( ) + local_size + unsafe { get_iseq_body_stack_max ( iseq) } . to_usize ( ) ;
11791179 gen_stack_overflow_check ( jit, asm, state, stack_growth) ;
11801180
11811181 // Save cfp->pc and cfp->sp for the caller frame
@@ -1211,7 +1211,7 @@ fn gen_send_without_block_direct(
12111211 } ) ;
12121212
12131213 asm_comment ! ( asm, "switch to new SP register" ) ;
1214- let sp_offset = ( state. stack ( ) . len ( ) + local_size - args. len ( ) + VM_ENV_DATA_SIZE . as_usize ( ) ) * SIZEOF_VALUE ;
1214+ let sp_offset = ( state. stack ( ) . len ( ) + local_size - args. len ( ) + VM_ENV_DATA_SIZE . to_usize ( ) ) * SIZEOF_VALUE ;
12151215 let new_sp = asm. add ( SP , sp_offset. into ( ) ) ;
12161216 asm. mov ( SP , new_sp) ;
12171217
@@ -1889,7 +1889,7 @@ fn param_opnd(idx: usize) -> Opnd {
18891889/// Inverse of ep_offset_to_local_idx(). See ep_offset_to_local_idx() for details.
18901890pub fn local_idx_to_ep_offset ( iseq : IseqPtr , local_idx : usize ) -> i32 {
18911891 let local_size = unsafe { get_iseq_body_local_table_size ( iseq) } ;
1892- local_size_and_idx_to_ep_offset ( local_size. as_usize ( ) , local_idx)
1892+ local_size_and_idx_to_ep_offset ( local_size. to_usize ( ) , local_idx)
18931893}
18941894
18951895/// Convert the number of locals and a local index to an offset from the EP
@@ -2005,8 +2005,8 @@ c_callable! {
20052005 rb_set_cfp_sp( cfp, sp) ;
20062006
20072007 // Fill nils to uninitialized (non-argument) locals
2008- let local_size = get_iseq_body_local_table_size( iseq) . as_usize ( ) ;
2009- let num_params = get_iseq_body_param_size( iseq) . as_usize ( ) ;
2008+ let local_size = get_iseq_body_local_table_size( iseq) . to_usize ( ) ;
2009+ let num_params = get_iseq_body_param_size( iseq) . to_usize ( ) ;
20102010 let base = sp. offset( -local_size_and_idx_to_bp_offset( local_size, num_params) as isize ) ;
20112011 slice:: from_raw_parts_mut( base, local_size - num_params) . fill( Qnil ) ;
20122012 }
0 commit comments