diff options
author | Aaron Patterson <[email protected]> | 2025-04-07 15:28:53 -0700 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2025-04-25 13:46:05 -0700 |
commit | ec3b48d3da437e3358f4b7ae1ae007741f4ccd7b (patch) | |
tree | 05e9e6b5c70441e3066e632ac3b5d5d3cc74dfd2 | |
parent | f15d85f0864a68944d769c353e88543ce5775b31 (diff) |
Deopt if iseq trace events are enabled
-rw-r--r-- | insns.def | 2 | ||||
-rw-r--r-- | test/ruby/test_settracefunc.rb | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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; diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index fac6dd8185..55c07abbea 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -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{ |