@@ -802,7 +802,7 @@ pub enum Insn {
802802 GetConstantPath { ic : * const iseq_inline_constant_cache , state : InsnId } ,
803803 /// Kernel#block_given? but without pushing a frame. Similar to [`Insn::Defined`] with
804804 /// `DEFINED_YIELD`
805- IsBlockGiven ,
805+ IsBlockGiven { lep : InsnId } ,
806806 /// Test the bit at index of val, a Fixnum.
807807 /// Return Qtrue if the bit is set, else Qfalse.
808808 FixnumBitCheck { val : InsnId , index : u8 } ,
@@ -1519,7 +1519,7 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
15191519 Insn :: GetBlockHandler { lep } => write ! ( f, "GetBlockHandler {lep}" ) ,
15201520 Insn :: PatchPoint { invariant, .. } => { write ! ( f, "PatchPoint {}" , invariant. print( self . ptr_map) ) } ,
15211521 Insn :: GetConstantPath { ic, .. } => { write ! ( f, "GetConstantPath {:p}" , self . ptr_map. map_ptr( ic) ) } ,
1522- Insn :: IsBlockGiven => { write ! ( f, "IsBlockGiven" ) } ,
1522+ Insn :: IsBlockGiven { lep } => { write ! ( f, "IsBlockGiven {lep} " ) } ,
15231523 Insn :: FixnumBitCheck { val, index} => { write ! ( f, "FixnumBitCheck {val}, {index}" ) } ,
15241524 Insn :: CCall { cfunc, recv, args, name, return_type : _, elidable : _ } => {
15251525 write ! ( f, "CCall {recv}, :{}@{:p}" , name. contents_lossy( ) , self . ptr_map. map_ptr( cfunc) ) ?;
@@ -1975,6 +1975,10 @@ impl Function {
19751975 }
19761976 }
19771977
1978+ pub fn iseq ( & self ) -> * const rb_iseq_t {
1979+ self . iseq
1980+ }
1981+
19781982 // Add an instruction to the function without adding it to any block
19791983 fn new_insn ( & mut self , insn : Insn ) -> InsnId {
19801984 let id = InsnId ( self . insns . len ( ) ) ;
@@ -2125,7 +2129,6 @@ impl Function {
21252129 result@( Const { ..}
21262130 | Param
21272131 | GetConstantPath { ..}
2128- | IsBlockGiven
21292132 | PatchPoint { ..}
21302133 | PutSpecialObject { ..}
21312134 | GetGlobal { ..}
@@ -2182,6 +2185,7 @@ impl Function {
21822185 & GuardLess { left, right, state } => GuardLess { left : find ! ( left) , right : find ! ( right) , state } ,
21832186 & GuardSuperMethodEntry { lep, cme, state } => GuardSuperMethodEntry { lep : find ! ( lep) , cme, state } ,
21842187 & GetBlockHandler { lep } => GetBlockHandler { lep : find ! ( lep) } ,
2188+ & IsBlockGiven { lep } => IsBlockGiven { lep : find ! ( lep) } ,
21852189 & FixnumAdd { left, right, state } => FixnumAdd { left : find ! ( left) , right : find ! ( right) , state } ,
21862190 & FixnumSub { left, right, state } => FixnumSub { left : find ! ( left) , right : find ! ( right) , state } ,
21872191 & FixnumMult { left, right, state } => FixnumMult { left : find ! ( left) , right : find ! ( right) , state } ,
@@ -2453,7 +2457,7 @@ impl Function {
24532457 Insn :: Defined { pushval, .. } => Type :: from_value ( * pushval) . union ( types:: NilClass ) ,
24542458 Insn :: DefinedIvar { pushval, .. } => Type :: from_value ( * pushval) . union ( types:: NilClass ) ,
24552459 Insn :: GetConstantPath { .. } => types:: BasicObject ,
2456- Insn :: IsBlockGiven => types:: BoolExact ,
2460+ Insn :: IsBlockGiven { .. } => types:: BoolExact ,
24572461 Insn :: FixnumBitCheck { .. } => types:: BoolExact ,
24582462 Insn :: ArrayMax { .. } => types:: BasicObject ,
24592463 Insn :: ArrayInclude { .. } => types:: BoolExact ,
@@ -4374,11 +4378,11 @@ impl Function {
43744378 | & Insn :: LoadSelf
43754379 | & Insn :: GetLocal { .. }
43764380 | & Insn :: PutSpecialObject { .. }
4377- | & Insn :: IsBlockGiven
43784381 | & Insn :: IncrCounter ( _)
43794382 | & Insn :: IncrCounterPtr { .. } =>
43804383 { }
4381- & Insn :: GetBlockHandler { lep } => {
4384+ & Insn :: GetBlockHandler { lep }
4385+ | & Insn :: IsBlockGiven { lep } => {
43824386 worklist. push_back ( lep) ;
43834387 }
43844388 & Insn :: PatchPoint { state, .. }
@@ -5114,7 +5118,7 @@ impl Function {
51145118 | Insn :: PutSpecialObject { .. }
51155119 | Insn :: LoadField { .. }
51165120 | Insn :: GetConstantPath { .. }
5117- | Insn :: IsBlockGiven
5121+ | Insn :: IsBlockGiven { .. }
51185122 | Insn :: GetGlobal { .. }
51195123 | Insn :: LoadPC
51205124 | Insn :: LoadEC
0 commit comments