diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-17 15:09:41 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-17 15:09:41 +0000 |
commit | 6a4bb345dfeff84bcf2541c50a2249fe31f02846 (patch) | |
tree | e7ce21fa9a1858360094f55bff84f95a77da0947 /tool/ruby_vm/views/_mjit_compile_send.erb | |
parent | e749134f0a38fca202aacc0ff65db882646749c2 (diff) |
mjit_compile.c: resurrect local variable stack
This optimization was reverted on r63863, but this commit resurrects the
optimization to skip some sp motions on JIT execution.
tool/ruby_vm/views/_mjit_compile_insn_body.erb: ditto
tool/ruby_vm/views/_mjit_compile_insn.erb: ditto
insns.def: resurrect handles_frame as handles_stack, which was deleted
on r63763.
tool/ruby_vm/models/bare_instructions.rb: ditto
vm_insnhelper.c: prevent moving sp outside insns.def to allow modifying
it by JIT.
* Optcarrot benchmark
$ benchmark-driver benchmark.yml --rbenv 'before --jit;after --jit' --repeat-count 12 -v
before --jit: ruby 2.6.0dev (2018-07-17 trunk 63987) +JIT [x86_64-linux]
after --jit: ruby 2.6.0dev (2018-07-17 local-stack 63987) +JIT [x86_64-linux]
last_commit=mjit_compile.c: resurrect local variable stack
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 70.518 72.144 fps
Comparison:
Optcarrot Lan_Master.nes
after --jit: 72.1 fps
before --jit: 70.5 fps - 1.02x slower
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm/views/_mjit_compile_send.erb')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index 6944903821..5fd5a403fd 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -24,6 +24,11 @@ int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */ fprintf(f, "{\n"); +% # JIT: Declare stack_size to be used in some macro of _mjit_compile_insn_body.erb + if (status->local_stack_p) { + /* TODO: can we use some functions to calculate this? */ + fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size - <%= insn.pops.size %> - ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0)); + } % # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things. <%= render 'mjit_compile_send_guard' -%> |