summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2023-03-10 01:30:30 +0900
committerKoichi Sasada <[email protected]>2023-03-23 14:03:12 +0900
commitc9fd81b860b5ec193ba57c73c740955937452497 ()
tree37d7f0ac40f0122c222b1dc952ef0f0907440b0a /vm_trace.c
parente5a5e43c36443e06756aba6de95c94b41b910a82 (diff)
`vm_call_single_noarg_inline_builtin`
If the iseq only contains `opt_invokebuiltin_delegate_leave` insn and the builtin-function (bf) is inline-able, the caller doesn't need to build a method frame. `vm_call_single_noarg_inline_builtin` is fast path for such cases.
Notes: Merged: https://.com/ruby/ruby/pull/7486
-rw-r--r--vm_trace.c10
1 files changed, 10 insertions, 0 deletions
@@ -93,6 +93,7 @@ rb_hook_list_free(rb_hook_list_t *hooks)
/* ruby_vm_event_flags management */
void rb_clear_attr_ccs(void);
static void
update_global_event_hook(rb_event_flag_t prev_events, rb_event_flag_t new_events)
@@ -102,6 +103,8 @@ update_global_event_hook(rb_event_flag_t prev_events, rb_event_flag_t new_events
bool first_time_iseq_events_p = new_iseq_events & ~enabled_iseq_events;
bool enable_c_call = (prev_events & RUBY_EVENT_C_CALL) == 0 && (new_events & RUBY_EVENT_C_CALL);
bool enable_c_return = (prev_events & RUBY_EVENT_C_RETURN) == 0 && (new_events & RUBY_EVENT_C_RETURN);
// Modify ISEQs or CCs to enable tracing
if (first_time_iseq_events_p) {
@@ -112,6 +115,9 @@ update_global_event_hook(rb_event_flag_t prev_events, rb_event_flag_t new_events
else if (enable_c_call || enable_c_return) {
rb_clear_attr_ccs();
}
ruby_vm_event_flags = new_events;
ruby_vm_event_enabled_global_flags |= new_events;
@@ -1258,6 +1264,10 @@ rb_tracepoint_enable_for_target(VALUE tpval, VALUE target, VALUE target_line)
n += rb_iseq_add_local_tracepoint_recursively(iseq, tp->events, tpval, line, target_bmethod);
rb_hash_aset(tp->local_target_set, (VALUE)iseq, Qtrue);
if (n == 0) {
rb_raise(rb_eArgError, "can not enable any hooks");