8000 Deopt if iseq trace events are enabled · ruby/ruby@ce8b928 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce8b928

Browse files
committed
Deopt if iseq trace events are enabled
1 parent cb2cd74 commit ce8b928

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

insns.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ opt_new
915915
VALUE argc = vm_ci_argc(cd->ci);
916916
VALUE val = TOPN(argc);
917917

918-
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw)) {
918+
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw) && !(ruby_vm_event_flags & ISEQ_TRACE_EVENTS)) {
919919
RB_DEBUG_COUNTER_INC(opt_new_hit);
920920
val = rb_obj_alloc(val);
921921
TOPN(argc) = val;

test/ruby/test_settracefunc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,7 @@ def m
19991999
TracePoint.new(:c_call, &capture_events).enable{
20002000
c.new
20012001
}
2002-
assert_equal [:c_call, :itself, :initialize], events[0]
2002+
assert_equal [:c_call, :itself, :initialize], events[1]
20032003
events.clear
20042004

20052005
o = Class.new{

0 commit comments

Comments
 (0)
0