[前][次][番号順一覧][スレッド一覧]

ruby-changes:62802

From: Alan <ko1@a...>
Date: Wed, 2 Sep 2020 11:02:49 +0900 (JST)
Subject: [ruby-changes:62802] 4c3f0597de (master): Remove the pc argument of vm_trace()

https://git.ruby-lang.org/ruby.git/commit/?id=4c3f0597de

From 4c3f0597de99103374012522beecadeaa9e25eed Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Mon, 31 Aug 2020 22:48:34 -0400
Subject: Remove the pc argument of vm_trace()

This makes the binary 272 bytes smaller on -O3 GCC 10.2.0.

diff --git a/tool/ruby_vm/views/_trace_instruction.erb b/tool/ruby_vm/views/_trace_instruction.erb
index be2b091..d604e03 100644
--- a/tool/ruby_vm/views/_trace_instruction.erb
+++ b/tool/ruby_vm/views/_trace_instruction.erb
@@ -10,7 +10,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_trace_instruction.erb#L10
 /* insn <%= insn.pretty_name %> */
 INSN_ENTRY(<%= insn.name %>)
 {
-    vm_trace(ec, GET_CFP(), GET_PC());
+    vm_trace(ec, GET_CFP());
     DISPATCH_ORIGINAL_INSN(<%= insn.jump_destination %>);
     END_INSN(<%= insn.name %>);
 }
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index f1c293a..9dcd75c 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -4902,7 +4902,7 @@ vm_opt_regexpmatch2(VALUE recv, VALUE obj) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4902
 
 rb_event_flag_t rb_iseq_event_flags(const rb_iseq_t *iseq, size_t pos);
 
-NOINLINE(static void vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *pc));
+NOINLINE(static void vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp));
 
 static inline void
 vm_trace_hook(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *pc,
@@ -4955,8 +4955,9 @@ rb_vm_opt_cfunc_p(CALL_CACHE cc, int insn) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L4955
 } while (0)
 
 static void
-vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *pc)
+vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)
 {
+    const VALUE *pc = reg_cfp->pc;
     rb_event_flag_t enabled_flags = ruby_vm_event_flags & ISEQ_TRACE_EVENTS;
 
     if (enabled_flags == 0 && ruby_vm_event_local_num == 0) {
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]