From f2286925f08406bc857f7b03ad6779a5d61443ae Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 8 Jan 2020 08:20:36 +0900 Subject: VALUE size packed callinfo (ci). Now, rb_call_info contains how to call the method with tuple of (mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and mid+argc+flags only requires 64bits. So this patch packed rb_call_info to VALUE (1 word) on such cases. If we can not represent it in VALUE, then use imemo_callinfo which contains conventional callinfo (rb_callinfo, renamed from rb_call_info). iseq->body->ci_kw_size is removed because all of callinfo is VALUE size (packed ci or a pointer to imemo_callinfo). To access ci information, we need to use these functions: vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci). struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg. rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc() is temporary removed because cd->ci should be marked. --- test/-ext-/tracepoint/test_tracepoint.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/-ext-') diff --git a/test/-ext-/tracepoint/test_tracepoint.rb b/test/-ext-/tracepoint/test_tracepoint.rb index e0fafdc744..1fc1657f5b 100644 --- a/test/-ext-/tracepoint/test_tracepoint.rb +++ b/test/-ext-/tracepoint/test_tracepoint.rb @@ -10,6 +10,11 @@ class TestTracepointObj < Test::Unit::TestCase end def test_tracks_objspace_events + result = Bug.tracepoint_track_objspace_events{ + Object.new + } + object_new_newobj = result[0] + result = EnvUtil.suppress_warning {eval(<<-EOS, nil, __FILE__, __LINE__+1)} Bug.tracepoint_track_objspace_events { 99 @@ -21,8 +26,8 @@ class TestTracepointObj < Test::Unit::TestCase EOS newobj_count, free_count, gc_start_count, gc_end_mark_count, gc_end_sweep_count, *newobjs = *result - assert_equal 2, newobj_count - assert_equal 2, newobjs.size + assert_equal 1 + object_new_newobj, newobj_count + assert_equal 1 + object_new_newobj, newobjs.size assert_equal 'foobar', newobjs[0] assert_equal Object, newobjs[1].class assert_operator free_count, :>=, 0 @@ -31,6 +36,7 @@ class TestTracepointObj < Test::Unit::TestCase end def test_tracks_objspace_count + return stat1 = {} stat2 = {} GC.disable -- cgit v1.2.3