diff options
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index af8bf464da..5c85d14967 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -4903,6 +4903,22 @@ vm_trace_hook(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VAL } } +// Return true if given cc has cfunc which is NOT handled by opt_send_without_block. +bool +rb_vm_opt_cfunc_p(CALL_CACHE cc, int insn) +{ + switch (insn) { + case BIN(opt_eq): + return check_cfunc(vm_cc_cme(cc), rb_obj_equal); + case BIN(opt_nil_p): + return check_cfunc(vm_cc_cme(cc), rb_false); + case BIN(opt_not): + return check_cfunc(vm_cc_cme(cc), rb_obj_not); + default: + return false; + } +} + #define VM_TRACE_HOOK(target_event, val) do { \ if ((pc_events & (target_event)) & enabled_flags) { \ vm_trace_hook(ec, reg_cfp, pc, pc_events, (target_event), global_hooks, local_hooks, (val)); \ |