From 67bd8fb36b56858cb35aa05c5279b6f281954935 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 11 Sep 2018 12:53:52 +0000 Subject: _mjit_compile_pc_and_sp.erb: skip moving pc when catch_except_p is false and insn.always_leaf? is true (never makes arbitrary method call in the insn). On Optcarrot, unfortunately this didn't have measureable performance impact. But still this is a good direction since it becomes much faster when marking all insns as always leaf. bare_instructions.rb: add `#always_leaf?` that indicates the insn can always be considered as leaf. Using dynamic leaf for JIT would be hard since it requires to discard outdated code somehow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/ruby_vm/models/bare_instructions.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tool/ruby_vm/models') diff --git a/tool/ruby_vm/models/bare_instructions.rb b/tool/ruby_vm/models/bare_instructions.rb index 5c27af3a38..740949c752 100755 --- a/tool/ruby_vm/models/bare_instructions.rb +++ b/tool/ruby_vm/models/bare_instructions.rb @@ -105,6 +105,10 @@ class RubyVM::BareInstructions /\b(false|0)\b/ !~ @attrs['handles_sp'].expr.expr end + def always_leaf? + @attrs['leaf'].expr.expr == 'true;' + end + def complicated_return_values? @sig[:ret].any? {|i| i == '...' } end -- cgit v1.2.1