diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-08-16 20:28:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-16 20:28:33 -0700 |
| commit | e210b899dc803607bef1b395ace02dc9f96554ea (patch) | |
| tree | b0894c7fdeda458d06eb69fef9593edb360de1b7 /tool/ruby_vm | |
| parent | 5bb946228550c7f171c27725860b153a675404f3 (diff) | |
Move the PC regardless of the leaf flag (#8232)
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'tool/ruby_vm')
| -rw-r--r-- | tool/ruby_vm/views/_insn_entry.erb | 5 | ||||
| -rw-r--r-- | tool/ruby_vm/views/_leaf_helpers.erb | 25 |
2 files changed, 2 insertions, 28 deletions
diff --git a/tool/ruby_vm/views/_insn_entry.erb b/tool/ruby_vm/views/_insn_entry.erb index 32070c5f34..6ec33461c4 100644 --- a/tool/ruby_vm/views/_insn_entry.erb +++ b/tool/ruby_vm/views/_insn_entry.erb @@ -24,7 +24,7 @@ INSN_ENTRY(<%= insn.name %>) <%= ope[:decl] %> = (<%= ope[:type] %>)GET_OPERAND(<%= i + 1 %>); % end # define INSN_ATTR(x) <%= insn.call_attribute(' ## x ## ') %> - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); % insn.pops.reverse_each.with_index.reverse_each do |pop, i| <%= pop[:decl] %> = <%= insn.cast_from_VALUE pop, "TOPN(#{i})"%>; % end @@ -35,7 +35,7 @@ INSN_ENTRY(<%= insn.name %>) % end /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); % if insn.handles_sp? POPN(INSN_ATTR(popn)); % end @@ -68,7 +68,6 @@ INSN_ENTRY(<%= insn.name %>) VM_ASSERT(!RB_TYPE_P(TOPN(<%= i %>), T_MOVED)); % end % end - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ diff --git a/tool/ruby_vm/views/_leaf_helpers.erb b/tool/ruby_vm/views/_leaf_helpers.erb index ac35df64f4..f740107a0a 100644 --- a/tool/ruby_vm/views/_leaf_helpers.erb +++ b/tool/ruby_vm/views/_leaf_helpers.erb @@ -10,31 +10,6 @@ #include "iseq.h" -extern const bool rb_vm_insn_leaf_p[]; - -#ifdef RUBY_VM_INSNS_INFO -const bool rb_vm_insn_leaf_p[] = { -% RubyVM::Instructions.each_slice(20) do |insns| - <%= insns.map do |insn| - if insn.is_a?(RubyVM::BareInstructions) - insn.always_leaf? ? '1' : '0' - else - '0' - end - end.join(', ') - %>, -% end -}; -#endif - -CONSTFUNC(MAYBE_UNUSED(static bool insn_leaf_p(VALUE insn))); - -bool -insn_leaf_p(VALUE insn) -{ - return rb_vm_insn_leaf_p[insn]; -} - // This is used to tell RJIT that this insn would be leaf if CHECK_INTS didn't exist. // It should be used only when RUBY_VM_CHECK_INTS is directly written in insns.def. static bool leafness_of_check_ints = false; |
