diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-04-06 01:49:05 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-04-06 01:55:18 -0700 |
commit | 3194cd36e284bc761b378cbe065538c8d94da8df (patch) | |
tree | b8ca4dae27245482ca56179edf30a994fdbc8fa1 /tool/ruby_vm | |
parent | 928bb17770ca0648d4098a7c941e4cc4ec22e004 (diff) | |
download | ruby-3194cd36e284bc761b378cbe065538c8d94da8df.tar.gz |
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.
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_insn.erb | 1 | ||||
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb | 3 | ||||
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_insn.erb b/tool/ruby_vm/views/_mjit_compile_insn.erb index fe545e691d..e688f0853e 100644 --- a/tool/ruby_vm/views/_mjit_compile_insn.erb +++ b/tool/ruby_vm/views/_mjit_compile_insn.erb @@ -7,7 +7,6 @@ % # 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 545b9f72f5..683dce93bb 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 @@ % # 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 9104648e72..a5db6e7f44 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -8,7 +8,6 @@ % % # 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 %>]; |