ruby-changes:51541
From: k0kubun <ko1@a...>
Date: Mon, 25 Jun 2018 23:15:31 +0900 (JST)
Subject: [ruby-changes:51541] k0kubun:r63751 (trunk): mjit_compile.inc.erb: drop unnecessary variable
k0kubun 2018-06-25 23:15:26 +0900 (Mon, 25 Jun 2018) New Revision: 63751 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63751 Log: mjit_compile.inc.erb: drop unnecessary variable It never becomes `dispatched: true` with the current code. Modified files: trunk/tool/ruby_vm/views/_mjit_compile_insn.erb trunk/tool/ruby_vm/views/mjit_compile.inc.erb Index: tool/ruby_vm/views/mjit_compile.inc.erb =================================================================== --- tool/ruby_vm/views/mjit_compile.inc.erb (revision 63750) +++ tool/ruby_vm/views/mjit_compile.inc.erb (revision 63751) @@ -61,7 +61,7 @@ switch (insn) { https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/mjit_compile.inc.erb#L61 % 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 % Index: tool/ruby_vm/views/_mjit_compile_insn.erb =================================================================== --- tool/ruby_vm/views/_mjit_compile_insn.erb (revision 63750) +++ tool/ruby_vm/views/_mjit_compile_insn.erb (revision 63751) @@ -26,9 +26,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L26 } % % # 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 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L61 <%= 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 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L78 % end % % # compiler: Move JIT compiler's internal stack pointer -% unless dispatched b->stack_size += <%= insn.call_attribute('sp_inc') %>; -% end } fprintf(f, "}\n"); % -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/