@@ -538,12 +538,8 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
538538 & Insn :: GuardBitEquals { val, expected, reason, state } => gen_guard_bit_equals ( jit, asm, opnd ! ( val) , expected, reason, & function. frame_state ( state) ) ,
539539 & Insn :: GuardAnyBitSet { val, mask, reason, state } => gen_guard_any_bit_set ( jit, asm, opnd ! ( val) , mask, reason, & function. frame_state ( state) ) ,
540540 & Insn :: GuardNoBitsSet { val, mask, reason, state } => gen_guard_no_bits_set ( jit, asm, opnd ! ( val) , mask, reason, & function. frame_state ( state) ) ,
541- Insn :: GuardNotFrozen { recv, state } => gen_guard_not_frozen ( jit, asm, opnd ! ( recv) , & function. frame_state ( * state) ) ,
542- Insn :: GuardNotShared { recv, state } => gen_guard_not_shared ( jit, asm, opnd ! ( recv) , & function. frame_state ( * state) ) ,
543541 & Insn :: GuardLess { left, right, state } => gen_guard_less ( jit, asm, opnd ! ( left) , opnd ! ( right) , & function. frame_state ( state) ) ,
544542 & Insn :: GuardGreaterEq { left, right, state } => gen_guard_greater_eq ( jit, asm, opnd ! ( left) , opnd ! ( right) , & function. frame_state ( state) ) ,
545- & Insn :: GuardSuperMethodEntry { lep, cme, state } => no_output ! ( gen_guard_super_method_entry( jit, asm, opnd!( lep) , cme, & function. frame_state( state) ) ) ,
546- Insn :: GetBlockHandler { lep } => gen_get_block_handler ( asm, opnd ! ( lep) ) ,
547543 Insn :: PatchPoint { invariant, state } => no_output ! ( gen_patch_point( jit, asm, invariant, & function. frame_state( * state) ) ) ,
548544 Insn :: CCall { cfunc, recv, args, name, return_type : _, elidable : _ } => gen_ccall ( asm, * cfunc, * name, opnd ! ( recv) , opnds ! ( args) ) ,
549545 // Give up CCallWithFrame for 7+ args since asm.ccall() supports at most 6 args (recv + args).
@@ -585,7 +581,6 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
585581 & Insn :: ToArray { val, state } => { gen_to_array ( jit, asm, opnd ! ( val) , & function. frame_state ( state) ) } ,
586582 & Insn :: DefinedIvar { self_val, id, pushval, .. } => { gen_defined_ivar ( asm, opnd ! ( self_val) , id, pushval) } ,
587583 & Insn :: ArrayExtend { left, right, state } => { no_output ! ( gen_array_extend( jit, asm, opnd!( left) , opnd!( right) , & function. frame_state( state) ) ) } ,
588- & Insn :: GuardShape { val, shape, state } => gen_guard_shape ( jit, asm, opnd ! ( val) , shape, & function. frame_state ( state) ) ,
589584 Insn :: LoadPC => gen_load_pc ( asm) ,
590585 Insn :: LoadEC => gen_load_ec ( ) ,
591586 & Insn :: GetEP { level } => gen_get_ep ( asm, level) ,
@@ -795,25 +790,6 @@ fn gen_getblockparam(jit: &mut JITState, asm: &mut Assembler, ep_offset: u32, le
795790 asm. load ( Opnd :: mem ( VALUE_BITS , ep, offset) )
796791}
797792
798- fn gen_guard_not_frozen ( jit : & JITState , asm : & mut Assembler , recv : Opnd , state : & FrameState ) -> Opnd {
799- let recv = asm. load ( recv) ;
800- // It's a heap object, so check the frozen flag
801- let flags = asm. load ( Opnd :: mem ( 64 , recv, RUBY_OFFSET_RBASIC_FLAGS ) ) ;
802- asm. test ( flags, ( RUBY_FL_FREEZE as u64 ) . into ( ) ) ;
803- // Side-exit if frozen
804- asm. jnz ( side_exit ( jit, state, GuardNotFrozen ) ) ;
805- recv
806- }
807-
808- fn gen_guard_not_shared ( jit : & JITState , asm : & mut Assembler , recv : Opnd , state : & FrameState ) -> Opnd {
809- let recv = asm. load ( recv) ;
810- // It's a heap object, so check the shared flag
811- let flags = asm. load ( Opnd :: mem ( VALUE_BITS , recv, RUBY_OFFSET_RBASIC_FLAGS ) ) ;
812- asm. test ( flags, ( RUBY_ELTS_SHARED as u64 ) . into ( ) ) ;
813- asm. jnz ( side_exit ( jit, state, SideExitReason :: GuardNotShared ) ) ;
814- recv
815- }
816-
817793fn gen_guard_less ( jit : & JITState , asm : & mut Assembler , left : Opnd , right : Opnd , state : & FrameState ) -> Opnd {
818794 asm. cmp ( left, right) ;
819795 asm. jge ( side_exit ( jit, state, SideExitReason :: GuardLess ) ) ;
@@ -826,28 +802,6 @@ fn gen_guard_greater_eq(jit: &JITState, asm: &mut Assembler, left: Opnd, right:
826802 left
827803}
828804
829- /// Guard that the method entry at ep[VM_ENV_DATA_INDEX_ME_CREF] matches the expected CME.
830- /// This ensures we're calling super from the expected method context.
831- fn gen_guard_super_method_entry (
832- jit : & JITState ,
833- asm : & mut Assembler ,
834- lep : Opnd ,
835- cme : * const rb_callable_method_entry_t ,
836- state : & FrameState ,
837- ) {
838- asm_comment ! ( asm, "guard super method entry" ) ;
839- let ep_me_opnd = Opnd :: mem ( 64 , lep, SIZEOF_VALUE_I32 * VM_ENV_DATA_INDEX_ME_CREF ) ;
840- let ep_me = asm. load ( ep_me_opnd) ;
841- asm. cmp ( ep_me, Opnd :: UImm ( cme as u64 ) ) ;
842- asm. jne ( side_exit ( jit, state, SideExitReason :: GuardSuperMethodEntry ) ) ;
843- }
844-
845- /// Get the block handler from ep[VM_ENV_DATA_INDEX_SPECVAL] at the local EP (LEP).
846- fn gen_get_block_handler ( asm : & mut Assembler , lep : Opnd ) -> Opnd {
847- asm_comment ! ( asm, "get block handler from LEP" ) ;
848- asm. load ( Opnd :: mem ( 64 , lep, SIZEOF_VALUE_I32 * VM_ENV_DATA_INDEX_SPECVAL ) )
849- }
850-
851805fn gen_get_constant_path ( jit : & JITState , asm : & mut Assembler , ic : * const iseq_inline_constant_cache , state : & FrameState ) -> Opnd {
852806 unsafe extern "C" {
853807 fn rb_vm_opt_getconstant_path ( ec : EcPtr , cfp : CfpPtr , ic : * const iseq_inline_constant_cache ) -> VALUE ;
@@ -1243,16 +1197,6 @@ fn gen_array_extend(jit: &mut JITState, asm: &mut Assembler, left: Opnd, right:
12431197 asm_ccall ! ( asm, rb_ary_concat, left, right) ;
12441198}
12451199
1246- fn gen_guard_shape ( jit : & mut JITState , asm : & mut Assembler , val : Opnd , shape : ShapeId , state : & FrameState ) -> Opnd {
1247- gen_incr_counter ( asm, Counter :: guard_shape_count) ;
1248- let shape_id_offset = unsafe { rb_shape_id_offset ( ) } ;
1249- let val = asm. load ( val) ;
1250- let shape_opnd = Opnd :: mem ( SHAPE_ID_NUM_BITS as u8 , val, shape_id_offset) ;
1251- asm. cmp ( shape_opnd, Opnd :: UImm ( shape. 0 as u64 ) ) ;
1252- asm. jne ( side_exit ( jit, state, SideExitReason :: GuardShape ( shape) ) ) ;
1253- val
1254- }
1255-
12561200fn gen_load_pc ( asm : & mut Assembler ) -> Opnd {
12571201 asm. load ( Opnd :: mem ( 64 , CFP , RUBY_OFFSET_CFP_PC ) )
12581202}
0 commit comments