Skip to content

Commit f4c27d6

Browse files
committed
wip
1 parent d08ebcf commit f4c27d6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

yjit/src/codegen.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,8 @@ fn gen_get_ep(asm: &mut Assembler, level: u32) -> Opnd {
24482448
/// EP returned may not be `VM_ENV_FLAG_LOCAL`. Practically, ISeqs that don't
24492449
/// meet this condition, such as `ISEQ_TYPE_TOP`, also don't need to use this operation.
24502450
fn gen_get_lep(jit: &JITState, asm: &mut Assembler) -> Opnd {
2451+
assert_eq!(ISEQ_TYPE_METHOD, unsafe { rb_get_iseq_body_type(rb_get_iseq_body_local_iseq(jit.iseq)) });
2452+
24512453
// GET_LEP() chases the parent environment pointer to reach the local environment. Inside
24522454
// a descendant of ISEQ_TYPE_METHOD, it chases the same number of times as chasing
24532455
// the parent iseq pointer to reach the local iseq. See get_lvar_level() in compile.c
@@ -9904,6 +9906,12 @@ fn gen_invokesuper_specialized(
99049906
return None;
99059907
}
99069908

9909+
let local_iseq = unsafe { rb_get_iseq_body_local_iseq(jit.iseq) };
9910+
if matches!(block, BlockHandler::LEPSpecVal) && unsafe { rb_get_iseq_body_type(local_iseq) } != ISEQ_TYPE_METHOD {
9911+
gen_counter_incr(jit, asm, Counter::invokesuper_find_block_handler_from_block);
9912+
return None;
9913+
}
9914+
99079915
// FIXME: We should track and invalidate this block when this cme is invalidated
99089916
let current_defined_class = unsafe { (*me).defined_class };
99099917
let mid = unsafe { get_def_original_id((*me).def) };

yjit/src/stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ make_counters! {
398398

399399
invokesuper_defined_class_mismatch,
400400
invokesuper_forwarding,
401+
invokesuper_find_block_handler_from_block,
401402
invokesuper_kw_splat,
402403
invokesuper_kwarg,
403404
invokesuper_megamorphic,

0 commit comments

Comments
 (0)