diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-08-10 08:59:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 08:59:52 -0700 |
commit | 92cf14b4c5ba4d18140be870bbc5530d1d9e7140 (patch) | |
tree | 623d83ef3c7cf4ff6a1a5077d34e42b5e67593f4 /yjit | |
parent | 5397fc315a1c203cf9978d100db08680dcc0bb57 (diff) |
YJIT: Allow VM_CALL_ARGS_BLOCKARG on invokesuper (#8198)
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/codegen.rs | 18 | ||||
-rw-r--r-- | yjit/src/stats.rs | 3 |
2 files changed, 9 insertions, 12 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index c761212fe7..cfa4241c77 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -7426,10 +7426,6 @@ fn gen_invokesuper_specialized( gen_counter_incr(asm, Counter::invokesuper_kw_splat); return None; } - if ci_flags & VM_CALL_ARGS_BLOCKARG != 0 { - gen_counter_incr(asm, Counter::invokesuper_blockarg); - return None; - } // Ensure we haven't rebound this method onto an incompatible class. // In the interpreter we try to avoid making this check by performing some @@ -7469,13 +7465,15 @@ fn gen_invokesuper_specialized( asm.cmp(ep_me_opnd, me_as_value.into()); asm.jne(Target::side_exit(Counter::guard_invokesuper_me_changed)); - if block.is_none() { - // Guard no block passed + // gen_send_* currently support the first two branches in vm_caller_setup_arg_block: + // * VM_CALL_ARGS_BLOCKARG + // * blockiseq + if ci_flags & VM_CALL_ARGS_BLOCKARG == 0 && block.is_none() { + // TODO: gen_send_* does not support the last branch, GET_BLOCK_HANDLER(). + // For now, we guard no block passed. + // // rb_vm_frame_block_handler(GET_EC()->cfp) == VM_BLOCK_HANDLER_NONE // note, we assume VM_ASSERT(VM_ENV_LOCAL_P(ep)) - // - // TODO: this could properly forward the current block handler, but - // would require changes to gen_send_* asm.comment("guard no block given"); let ep_specval_opnd = Opnd::mem( 64, @@ -7483,7 +7481,7 @@ fn gen_invokesuper_specialized( SIZEOF_VALUE_I32 * VM_ENV_DATA_INDEX_SPECVAL, ); asm.cmp(ep_specval_opnd, VM_BLOCK_HANDLER_NONE.into()); - asm.jne(Target::side_exit(Counter::guard_invokesuper_block_given)); + asm.jne(Target::side_exit(Counter::guard_invokesuper_block_handler)); } // We need to assume that both our current method entry and the super diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index 4f3a4e1f47..007706fee7 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -274,7 +274,6 @@ make_counters! { send_bmethod_ractor, send_bmethod_block_arg, - invokesuper_blockarg, invokesuper_defined_class_mismatch, invokesuper_kw_splat, invokesuper_kwarg, @@ -313,7 +312,7 @@ make_counters! { guard_send_respond_to_mid_mismatch, guard_invokesuper_me_changed, - guard_invokesuper_block_given, + guard_invokesuper_block_handler, guard_invokeblock_tag_changed, guard_invokeblock_iseq_block_changed, |