ruby-changes:52678
From: ko1 <ko1@a...>
Date: Mon, 1 Oct 2018 15:22:27 +0900 (JST)
Subject: [ruby-changes:52678] ko1:r64890 (trunk): remove old VM profile counters.
ko1 2018-10-01 15:22:20 +0900 (Mon, 01 Oct 2018) New Revision: 64890 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64890 Log: remove old VM profile counters. * vm_insnhelper.c: remove `vm_profile_counter` because it is replaced with debug_counters. Modified files: trunk/vm.c trunk/vm_eval.c trunk/vm_insnhelper.c Index: vm.c =================================================================== --- vm.c (revision 64889) +++ vm.c (revision 64890) @@ -3140,7 +3140,6 @@ Init_VM(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L3140 /* vm_backtrace.c */ Init_vm_backtrace(); - VM_PROFILE_ATEXIT(); } void Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 64889) +++ vm_insnhelper.c (revision 64890) @@ -1859,35 +1859,6 @@ call_cfunc_15(VALUE (*func)(ANYARGS), VA https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1859 return (*func)(recv, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], argv[8], argv[9], argv[10], argv[11], argv[12], argv[13], argv[14]); } -#ifndef VM_PROFILE -#define VM_PROFILE 0 -#endif - -#if VM_PROFILE -enum { - VM_PROFILE_R2C_CALL, - VM_PROFILE_R2C_POPF, - VM_PROFILE_C2C_CALL, - VM_PROFILE_C2C_POPF, - VM_PROFILE_COUNT -}; -static int vm_profile_counter[VM_PROFILE_COUNT]; -#define VM_PROFILE_UP(x) (vm_profile_counter[VM_PROFILE_##x]++) -#define VM_PROFILE_ATEXIT() atexit(vm_profile_show_result) -static void -vm_profile_show_result(void) -{ - fprintf(stderr, "VM Profile results: \n"); - fprintf(stderr, "r->c call: %d\n", vm_profile_counter[VM_PROFILE_R2C_CALL]); - fprintf(stderr, "r->c popf: %d\n", vm_profile_counter[VM_PROFILE_R2C_POPF]); - fprintf(stderr, "c->c call: %d\n", vm_profile_counter[VM_PROFILE_C2C_CALL]); - fprintf(stderr, "c->c popf: %d\n", vm_profile_counter[VM_PROFILE_C2C_POPF]); -} -#else -#define VM_PROFILE_UP(x) -#define VM_PROFILE_ATEXIT() -#endif - static inline int vm_cfp_consistent_p(rb_execution_context_t *ec, const rb_control_frame_t *reg_cfp) { @@ -1954,7 +1925,6 @@ vm_call_cfunc_with_frame(rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1925 if (len >= 0) rb_check_arity(argc, len, len); reg_cfp->sp -= argc + 1; - VM_PROFILE_UP(R2C_CALL); val = (*cfunc->invoker)(cfunc->func, recv, argc, reg_cfp->sp + 1); CHECK_CFP_CONSISTENCY("vm_call_cfunc"); Index: vm_eval.c =================================================================== --- vm_eval.c (revision 64889) +++ vm_eval.c (revision 64890) @@ -83,11 +83,9 @@ vm_call0_cfunc_with_frame(rb_execution_c https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L83 if (len >= 0) rb_check_arity(argc, len, len); - VM_PROFILE_UP(C2C_CALL); val = (*cfunc->invoker)(cfunc->func, recv, argc, argv); CHECK_CFP_CONSISTENCY("vm_call0_cfunc_with_frame"); - VM_PROFILE_UP(C2C_POPF); rb_vm_pop_frame(ec); } EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_RETURN, recv, me->def->original_id, mid, me->owner, val); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/