@@ -1018,7 +1018,7 @@ pub enum Insn {
10181018 /// Used to ensure super calls are made from the expected method context.
10191019 GuardSuperMethodEntry { lep : InsnId , cme : * const rb_callable_method_entry_t , state : InsnId } ,
10201020 /// Get the block handler from ep[VM_ENV_DATA_INDEX_SPECVAL] at the local EP (LEP).
1021- GetBlockHandler ,
1021+ GetBlockHandler { lep : InsnId } ,
10221022
10231023 /// Generate no code (or padding if necessary) and insert a patch point
10241024 /// that can be rewritten to a side exit when the Invariant is broken.
@@ -1516,7 +1516,7 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
15161516 Insn :: GuardLess { left, right, .. } => write ! ( f, "GuardLess {left}, {right}" ) ,
15171517 Insn :: GuardGreaterEq { left, right, .. } => write ! ( f, "GuardGreaterEq {left}, {right}" ) ,
15181518 Insn :: GuardSuperMethodEntry { lep, cme, .. } => write ! ( f, "GuardSuperMethodEntry {lep}, {:p}" , self . ptr_map. map_ptr( cme) ) ,
1519- Insn :: GetBlockHandler => write ! ( f, "GetBlockHandler" ) ,
1519+ 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) ) } ,
15221522 Insn :: IsBlockGiven => { write ! ( f, "IsBlockGiven" ) } ,
@@ -2181,7 +2181,7 @@ impl Function {
21812181 & GuardGreaterEq { left, right, state } => GuardGreaterEq { left : find ! ( left) , right : find ! ( right) , state } ,
21822182 & GuardLess { left, right, state } => GuardLess { left : find ! ( left) , right : find ! ( right) , state } ,
21832183 & GuardSuperMethodEntry { lep, cme, state } => GuardSuperMethodEntry { lep : find ! ( lep) , cme, state } ,
2184- & GetBlockHandler => GetBlockHandler ,
2184+ & GetBlockHandler { lep } => GetBlockHandler { lep : find ! ( lep ) } ,
21852185 & FixnumAdd { left, right, state } => FixnumAdd { left : find ! ( left) , right : find ! ( right) , state } ,
21862186 & FixnumSub { left, right, state } => FixnumSub { left : find ! ( left) , right : find ! ( right) , state } ,
21872187 & FixnumMult { left, right, state } => FixnumMult { left : find ! ( left) , right : find ! ( right) , state } ,
@@ -2476,7 +2476,7 @@ impl Function {
24762476 Insn :: AnyToString { .. } => types:: String ,
24772477 Insn :: GetLocal { rest_param : true , .. } => types:: ArrayExact ,
24782478 Insn :: GetLocal { .. } => types:: BasicObject ,
2479- Insn :: GetBlockHandler => types:: RubyValue ,
2479+ Insn :: GetBlockHandler { .. } => types:: RubyValue ,
24802480 // The type of Snapshot doesn't really matter; it's never materialized. It's used only
24812481 // as a reference for FrameState, which we use to generate side-exit code.
24822482 Insn :: Snapshot { .. } => types:: Any ,
@@ -3429,7 +3429,7 @@ impl Function {
34293429 } ) ;
34303430
34313431 // Guard that no block is being passed (implicit or explicit).
3432- let block_handler = self . push_insn ( block, Insn :: GetBlockHandler ) ;
3432+ let block_handler = self . push_insn ( block, Insn :: GetBlockHandler { lep } ) ;
34333433 self . push_insn ( block, Insn :: GuardBitEquals {
34343434 val : block_handler,
34353435 expected : Const :: Value ( VALUE ( VM_BLOCK_HANDLER_NONE as usize ) ) ,
@@ -4373,12 +4373,14 @@ impl Function {
43734373 | & Insn :: GetLEP
43744374 | & Insn :: LoadSelf
43754375 | & Insn :: GetLocal { .. }
4376- | & Insn :: GetBlockHandler
43774376 | & Insn :: PutSpecialObject { .. }
43784377 | & Insn :: IsBlockGiven
43794378 | & Insn :: IncrCounter ( _)
43804379 | & Insn :: IncrCounterPtr { .. } =>
43814380 { }
4381+ & Insn :: GetBlockHandler { lep } => {
4382+ worklist. push_back ( lep) ;
4383+ }
43824384 & Insn :: PatchPoint { state, .. }
43834385 | & Insn :: CheckInterrupts { state }
43844386 | & Insn :: GetConstantPath { ic : _, state } => {
@@ -5123,7 +5125,7 @@ impl Function {
51235125 | Insn :: EntryPoint { .. }
51245126 | Insn :: GuardBlockParamProxy { .. }
51255127 | Insn :: GuardSuperMethodEntry { .. }
5126- | Insn :: GetBlockHandler
5128+ | Insn :: GetBlockHandler { .. }
51275129 | Insn :: PatchPoint { .. }
51285130 | Insn :: SideExit { .. }
51295131 | Insn :: IncrCounter { .. }
0 commit comments