From 4444025d16ae1a586eee6a0ac9bdd09e33833f3c Mon Sep 17 00:00:00 2001 From: k0kubun Date: Mon, 25 Jun 2018 14:15:26 +0000 Subject: [PATCH] mjit_compile.inc.erb: drop unnecessary variable It never becomes `dispatched: true` with the current code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/views/_mjit_compile_insn.erb | 10 ++-------- tool/ruby_vm/views/mjit_compile.inc.erb | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tool/ruby_vm/views/_mjit_compile_insn.erb b/tool/ruby_vm/views/_mjit_compile_insn.erb index b3c663441d..e0955687cc 100644 --- a/tool/ruby_vm/views/_mjit_compile_insn.erb +++ b/tool/ruby_vm/views/_mjit_compile_insn.erb @@ -26,9 +26,7 @@ } % % # JIT: Declare variables for operands, popped values and return values -% ret_decls = insn.rets.map { |r| "MAYBE_UNUSED(#{r.fetch(:type)}) #{r.fetch(:name)}"} # TODO: fix #declarations to return Hash... % insn.declarations.each do |decl| -% next if dispatched && ret_decls.include?(decl) # return value should be propagated to dispatcher. TODO: assert it's the same as dispatcher fprintf(f, " <%= decl %>;\n"); % end @@ -63,11 +61,9 @@ <%= render 'mjit_compile_insn_body', locals: { insn: insn } -%> % % # JIT: Set return values -% unless dispatched -% insn.rets.reverse_each.with_index do |ret, i| -% # TOPN(n) = ... +% insn.rets.reverse_each.with_index do |ret, i| +% # TOPN(n) = ... fprintf(f, " stack[%d] = <%= ret.fetch(:name) %>;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> - <%= i + 1 %>); -% end % end % % # JIT: We should evaluate ISeq modified for TracePoint if it's enabled. Note: This is slow. @@ -82,9 +78,7 @@ % end % % # compiler: Move JIT compiler's internal stack pointer -% unless dispatched b->stack_size += <%= insn.call_attribute('sp_inc') %>; -% end } fprintf(f, "}\n"); % diff --git a/tool/ruby_vm/views/mjit_compile.inc.erb b/tool/ruby_vm/views/mjit_compile.inc.erb index 9b74cebee1..ee29693894 100644 --- a/tool/ruby_vm/views/mjit_compile.inc.erb +++ b/tool/ruby_vm/views/mjit_compile.inc.erb @@ -61,7 +61,7 @@ switch (insn) { % end % % # Main insn implementation generated by insns.def -<%= render 'mjit_compile_insn', locals: { insn: insn, dispatched: false } -%> +<%= render 'mjit_compile_insn', locals: { insn: insn } -%> break; % end %