@@ -1027,9 +1027,9 @@ pub enum Insn {
10271027 /// Side-exit if val is not the expected Const.
10281028 GuardBitEquals { val : InsnId , expected : Const , reason : SideExitReason , state : InsnId } ,
10291029 /// Side-exit if (val & mask) == 0
1030- GuardAnyBitSet { val : InsnId , mask : Const , reason : SideExitReason , state : InsnId } ,
1030+ GuardAnyBitSet { val : InsnId , mask : Const , mask_name : Option < ID > , reason : SideExitReason , state : InsnId } ,
10311031 /// Side-exit if (val & mask) != 0
1032- GuardNoBitsSet { val : InsnId , mask : Const , reason : SideExitReason , state : InsnId } ,
1032+ GuardNoBitsSet { val : InsnId , mask : Const , mask_name : Option < ID > , reason : SideExitReason , state : InsnId } ,
10331033 /// Side-exit if left is not greater than or equal to right (both operands are C long).
10341034 GuardGreaterEq { left : InsnId , right : InsnId , state : InsnId } ,
10351035 /// Side-exit if left is not less than right (both operands are C long).
@@ -1550,7 +1550,9 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
15501550 Insn :: HasType { val, expected, .. } => { write ! ( f, "HasType {val}, {}" , expected. print( self . ptr_map) ) } ,
15511551 Insn :: GuardTypeNot { val, guard_type, .. } => { write ! ( f, "GuardTypeNot {val}, {}" , guard_type. print( self . ptr_map) ) } ,
15521552 Insn :: GuardBitEquals { val, expected, .. } => { write ! ( f, "GuardBitEquals {val}, {}" , expected. print( self . ptr_map) ) } ,
1553+ Insn :: GuardAnyBitSet { val, mask, mask_name : Some ( name) , .. } => { write ! ( f, "GuardAnyBitSet {val}, {name}={}" , mask. print( self . ptr_map) ) } ,
15531554 Insn :: GuardAnyBitSet { val, mask, .. } => { write ! ( f, "GuardAnyBitSet {val}, {}" , mask. print( self . ptr_map) ) } ,
1555+ Insn :: GuardNoBitsSet { val, mask, mask_name : Some ( name) , .. } => { write ! ( f, "GuardNoBitsSet {val}, {name}={}" , mask. print( self . ptr_map) ) } ,
15541556 Insn :: GuardNoBitsSet { val, mask, .. } => { write ! ( f, "GuardNoBitsSet {val}, {}" , mask. print( self . ptr_map) ) } ,
15551557 Insn :: GuardLess { left, right, .. } => write ! ( f, "GuardLess {left}, {right}" ) ,
15561558 Insn :: GuardGreaterEq { left, right, .. } => write ! ( f, "GuardGreaterEq {left}, {right}" ) ,
@@ -2236,8 +2238,8 @@ impl Function {
22362238 & GuardType { val, guard_type, state } => GuardType { val : find ! ( val) , guard_type, state } ,
22372239 & GuardTypeNot { val, guard_type, state } => GuardTypeNot { val : find ! ( val) , guard_type, state } ,
22382240 & GuardBitEquals { val, expected, reason, state } => GuardBitEquals { val : find ! ( val) , expected, reason, state } ,
2239- & GuardAnyBitSet { val, mask, reason, state } => GuardAnyBitSet { val : find ! ( val) , mask, reason, state } ,
2240- & GuardNoBitsSet { val, mask, reason, state } => GuardNoBitsSet { val : find ! ( val) , mask, reason, state } ,
2241+ & GuardAnyBitSet { val, mask, mask_name , reason, state } => GuardAnyBitSet { val : find ! ( val) , mask, mask_name , reason, state } ,
2242+ & GuardNoBitsSet { val, mask, mask_name , reason, state } => GuardNoBitsSet { val : find ! ( val) , mask, mask_name , reason, state } ,
22412243 & GuardGreaterEq { left, right, state } => GuardGreaterEq { left : find ! ( left) , right : find ! ( right) , state } ,
22422244 & GuardLess { left, right, state } => GuardLess { left : find ! ( left) , right : find ! ( right) , state } ,
22432245 & IsBlockGiven { lep } => IsBlockGiven { lep : find ! ( lep) } ,
@@ -3004,12 +3006,12 @@ impl Function {
30043006
30053007 pub fn guard_not_frozen ( & mut self , block : BlockId , recv : InsnId , state : InsnId ) {
30063008 let flags = self . load_rbasic_flags ( block, recv) ;
3007- self . push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( RUBY_FL_FREEZE as u64 ) , reason : SideExitReason :: GuardNotFrozen , state } ) ;
3009+ self . push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( RUBY_FL_FREEZE as u64 ) , mask_name : Some ( ID ! ( RUBY_FL_FREEZE ) ) , reason : SideExitReason :: GuardNotFrozen , state } ) ;
30083010 }
30093011
30103012 pub fn guard_not_shared ( & mut self , block : BlockId , recv : InsnId , state : InsnId ) {
30113013 let flags = self . load_rbasic_flags ( block, recv) ;
3012- self . push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( RUBY_ELTS_SHARED as u64 ) , reason : SideExitReason :: GuardNotShared , state } ) ;
3014+ self . push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( RUBY_ELTS_SHARED as u64 ) , mask_name : Some ( ID ! ( RUBY_ELTS_SHARED ) ) , reason : SideExitReason :: GuardNotShared , state } ) ;
30133015 }
30143016
30153017 /// Rewrite eligible Send/SendWithoutBlock opcodes into SendDirect
@@ -6794,7 +6796,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
67946796
67956797 let ep = fun. push_insn ( block, Insn :: GetEP { level } ) ;
67966798 let flags = fun. push_insn ( block, Insn :: LoadField { recv : ep, id : ID ! ( _env_data_index_flags) , offset : SIZEOF_VALUE_I32 * ( VM_ENV_DATA_INDEX_FLAGS as i32 ) , return_type : types:: CInt64 } ) ;
6797- fun. push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM . into ( ) ) , reason : SideExitReason :: BlockParamProxyModified , state : exit_id } ) ;
6799+ fun. push_insn ( block, Insn :: GuardNoBitsSet { val : flags, mask : Const :: CUInt64 ( VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM . into ( ) ) , mask_name : Some ( ID ! ( VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM ) ) , reason : SideExitReason :: BlockParamProxyModified , state : exit_id } ) ;
67986800
67996801 let block_handler = fun. push_insn ( block, Insn :: LoadField { recv : ep, id : ID ! ( _env_data_index_specval) , offset : SIZEOF_VALUE_I32 * VM_ENV_DATA_INDEX_SPECVAL , return_type : types:: CInt64 } ) ;
68006802
@@ -6812,7 +6814,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
68126814 const _: ( ) = assert ! ( RUBY_SYMBOL_FLAG & 1 == 0 , "guard below rejects symbol block handlers" ) ;
68136815
68146816 // Bail out if the block handler is neither ISEQ nor ifunc
6815- fun. push_insn ( block, Insn :: GuardAnyBitSet { val : block_handler, mask : Const :: CUInt64 ( 0x1 ) , reason : SideExitReason :: BlockParamProxyNotIseqOrIfunc , state : exit_id } ) ;
6817+ fun. push_insn ( block, Insn :: GuardAnyBitSet { val : block_handler, mask : Const :: CUInt64 ( 0x1 ) , mask_name : None , reason : SideExitReason :: BlockParamProxyNotIseqOrIfunc , state : exit_id } ) ;
68166818 // TODO(Shopify/ruby#753): GC root, so we should be able to avoid unnecessary GC tracing
68176819 state. stack_push ( fun. push_insn ( block, Insn :: Const { val : Const :: Value ( unsafe { rb_block_param_proxy } ) } ) ) ;
68186820 }
0 commit comments