ruby-changes:62175
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 10 Jul 2020 12:24:02 +0900 (JST)
Subject: [ruby-changes:62175] e4ee992099 (master): vm_push_frame_debug_counter_inc: use branches
https://git.ruby-lang.org/ruby.git/commit/?id=e4ee992099 From e4ee99209932e424be426c5f4cad7e9704522e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Tue, 7 Jul 2020 09:02:22 +0900 Subject: vm_push_frame_debug_counter_inc: use branches Ko1 doesn't like previous code. diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e026667..4b65424 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -301,12 +301,22 @@ vm_push_frame_debug_counter_inc( https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L301 if (RUBY_VM_END_CONTROL_FRAME(ec) != prev_cfp) { const bool curr = VM_FRAME_RUBYFRAME_P(reg_cfp); const bool prev = VM_FRAME_RUBYFRAME_P(prev_cfp); - const enum rb_debug_counter_type pat[2][2] = { - { RB_DEBUG_COUNTER_frame_R2R, RB_DEBUG_COUNTER_frame_R2C, }, - { RB_DEBUG_COUNTER_frame_C2R, RB_DEBUG_COUNTER_frame_C2C, }, - }; - const enum rb_debug_counter_type i = pat[prev][curr]; - rb_debug_counter[i]++; + if (prev) { + if (crr) { + RB_DEBUG_COUNTER_INC(frame_R2R); + } + else { + RB_DEBUG_COUNTER_INC(frame_R2C); + } + } + else { + if (crr) { + RB_DEBUG_COUNTER_INC(frame_C2R); + } + else { + RB_DEBUG_COUNTER_INC(frame_C2C); + } + } } switch (type & VM_FRAME_MAGIC_MASK) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/