1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

_mjit_compile_insn.erb: prefer insn.always_leaf?

rather than `trace_enablable_insns` which is hard to maintain.

This would make performance bad because new branches for tracepoint will
be added.

Optcarrot before:
fps: 56.885371547337655
fps: 60.02493636060194
fps: 63.051028327122076
fps: 63.78463316242535
fps: 64.20391937940403
fps: 64.55990344731123
fps: 64.56771099162921
fps: 64.95991277629723
fps: 65.15120708973232
fps: 65.90558702393933
fps: 66.29579283026303

Optcarrot after:
fps: 52.7647027470875
fps: 53.67404855529564
fps: 58.40514319229468
fps: 60.90736996487708
fps: 62.83487236283472
fps: 63.01386139447994
fps: 63.42395443471596
fps: 63.78328559878602
fps: 64.58432081229746
fps: 64.78720429848532
fps: 65.48720618907552

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-09-11 13:48:00 +00:00
parent 67bd8fb36b
commit 10ff0a2bbe

View file

@ -5,14 +5,6 @@
% # granted, to either redistribute and/or modify this file, provided that the % # granted, to either redistribute and/or modify this file, provided that the
% # conditions mentioned in the file COPYING are met. Consult the file for % # conditions mentioned in the file COPYING are met. Consult the file for
% # details. % # details.
%
% trace_enablable_insns = [
% 'opt_send_without_block',
% 'send',
% 'invokeblock',
% 'invokesuper',
% ]
%
fprintf(f, "{\n"); fprintf(f, "{\n");
{ {
% # compiler: Prepare operands which may be used by `insn.call_attribute` % # compiler: Prepare operands which may be used by `insn.call_attribute`
@ -67,7 +59,7 @@
% end % end
% %
% # JIT: We should evaluate ISeq modified for TracePoint if it's enabled. Note: This is slow. % # JIT: We should evaluate ISeq modified for TracePoint if it's enabled. Note: This is slow.
% if trace_enablable_insns.include?(insn.name) % unless insn.always_leaf?
fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n"); fprintf(f, " if (UNLIKELY(ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS)) {\n");
fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1); fprintf(f, " reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
if (!body->catch_except_p) { if (!body->catch_except_p) {