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

ruby-changes:60670

From: Takashi <ko1@a...>
Date: Mon, 6 Apr 2020 17:55:50 +0900 (JST)
Subject: [ruby-changes:60670] 3194cd36e2 (master): Delay definition of pc_moved_p

https://git.ruby-lang.org/ruby.git/commit/?id=3194cd36e2

From 3194cd36e284bc761b378cbe065538c8d94da8df Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 6 Apr 2020 01:49:05 -0700
Subject: Delay definition of pc_moved_p

to unify the duplicated declarations and to make sure it's not used
until set properly.

Also changed it from legacy TRUE/FALSE to stdbool.

diff --git a/tool/ruby_vm/views/_mjit_compile_insn.erb b/tool/ruby_vm/views/_mjit_compile_insn.erb
index fe545e6..e688f08 100644
--- a/tool/ruby_vm/views/_mjit_compile_insn.erb
+++ b/tool/ruby_vm/views/_mjit_compile_insn.erb
@@ -7,7 +7,6 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L7
 % # details.
     fprintf(f, "{\n");
     {
-        MAYBE_UNUSED(int pc_moved_p) = FALSE;
 % # compiler: Prepare operands which may be used by `insn.call_attribute`
 % insn.opes.each_with_index do |ope, i|
         MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
diff --git a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
index 545b9f7..683dce9 100644
--- a/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
+++ b/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
@@ -6,9 +6,10 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb#L6
 % # details.
 %
 % # JIT: Move pc for catch table on catch_except_p, and for #caller_locations and rb_profile_frames on !insn.always_leaf?
+        MAYBE_UNUSED(bool pc_moved_p) = false;
         if (body->catch_except_p || <%= insn.always_leaf? ? 'FALSE' : 'TRUE' %>) {
             fprintf(f, "    reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
-            pc_moved_p = TRUE;
+            pc_moved_p = true;
         }
 %
 % # JIT: move sp to use or preserve stack variables
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 9104648..a5db6e7 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -8,7 +8,6 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_send.erb#L8
 %
 % # Optimized case of send / opt_send_without_block instructions.
 {
-    MAYBE_UNUSED(int pc_moved_p) = FALSE;
 % # compiler: Prepare operands which may be used by `insn.call_attribute`
 % insn.opes.each_with_index do |ope, i|
     MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>];
-- 
cgit v0.10.2


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

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