Deopt if iseq trace events are enabled

This commit is contained in:
Aaron Patterson 2025-04-07 15:28:53 -07:00 committed by Aaron Patterson
parent f15d85f086
commit ec3b48d3da
2 changed files with 2 additions and 2 deletions

View File

@ -916,7 +916,7 @@ opt_new
VALUE argc = vm_ci_argc(cd->ci);
VALUE val = TOPN(argc);
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw)) {
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw) && !(ruby_vm_event_flags & ISEQ_TRACE_EVENTS)) {
RB_DEBUG_COUNTER_INC(opt_new_hit);
val = rb_obj_alloc(val);
TOPN(argc) = val;

View File

@ -1999,7 +1999,7 @@ CODE
TracePoint.new(:c_call, &capture_events).enable{
c.new
}
assert_equal [:c_call, :itself, :initialize], events[0]
assert_equal [:c_call, :itself, :initialize], events[1]
events.clear
o = Class.new{