[前][次][番号順一覧][スレッド一覧]

ruby-changes:52475

From: k0kubun <ko1@a...>
Date: Tue, 11 Sep 2018 22:48:07 +0900 (JST)
Subject: [ruby-changes:52475] k0kubun:r64684 (trunk): _mjit_compile_insn.erb: prefer insn.always_leaf?

k0kubun	2018-09-11 22:48:00 +0900 (Tue, 11 Sep 2018)

  New Revision: 64684

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64684

  Log:
    _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

  Modified files:
    trunk/tool/ruby_vm/views/_mjit_compile_insn.erb
Index: tool/ruby_vm/views/_mjit_compile_insn.erb
===================================================================
--- tool/ruby_vm/views/_mjit_compile_insn.erb	(revision 64683)
+++ tool/ruby_vm/views/_mjit_compile_insn.erb	(revision 64684)
@@ -5,14 +5,6 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L5
 % # granted, to either  redistribute and/or modify this file,  provided that the
 % # conditions mentioned  in the  file COPYING  are met.   Consult the  file for
 % # details.
-%
-% trace_enablable_insns = [
-%   'opt_send_without_block',
-%   'send',
-%   'invokeblock',
-%   'invokesuper',
-% ]
-%
     fprintf(f, "{\n");
     {
 % # compiler: Prepare operands which may be used by `insn.call_attribute`
@@ -67,7 +59,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn.erb#L59
 % end
 %
 % # 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, "        reg_cfp->sp = (VALUE *)reg_cfp->bp + %d;\n", b->stack_size + (int)<%= insn.call_attribute('sp_inc') %> + 1);
         if (!body->catch_except_p) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]