diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-14 09:24:43 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-14 09:24:43 +0000 |
commit | f89fe59db4bf1768d5f6480d15b67f8ebc24d5b9 (patch) | |
tree | 9aee8145c84fbb94733eef282c8942f8c714ba43 /mjit_compile.c | |
parent | 7bf86ecd702ed5142b07abbf544ce1f26d3e88ad (diff) | |
download | bundler-f89fe59db4bf1768d5f6480d15b67f8ebc24d5b9.tar.gz |
_mjit_compile_getivar.erb: optimize IC-hit getivar
by inlining index (and serial to invalidate that) and simplifying the
branch by using JIT cancellation.
mjit_compile.inc.erb: use the above file
mjit_compile.c: copy USE_IC_FOR_IVAR definition. will move this to
another shared file later.
common.mk: add new dependency
test/ruby/test_jit.rb: cover this case
=== Optcarrot benchmark ===
```
$ benchmark-driver benchmark.yml --rbenv '2.0.0::2.0.0-p648;before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24
2.0.0: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
before: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux]
before+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux]
after: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux]
last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar
after+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux]
last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar
Calculating -------------------------------------
2.0.0 before before+JIT after after+JIT
Optcarrot Lan_Master.nes 36.065 53.896 71.565 53.856 84.747 fps
Comparison:
Optcarrot Lan_Master.nes
after+JIT: 84.7 fps
before+JIT: 71.6 fps - 1.18x slower
before: 53.9 fps - 1.57x slower
after: 53.9 fps - 1.57x slower
2.0.0: 36.1 fps - 2.35x slower
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_compile.c')
-rw-r--r-- | mjit_compile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mjit_compile.c b/mjit_compile.c index b2ece0eb77..89d1a96a10 100644 --- a/mjit_compile.c +++ b/mjit_compile.c @@ -108,6 +108,11 @@ comment_id(FILE *f, ID id) #endif } +/* TODO: share this with vm_insnhelper.c */ +#ifndef USE_IC_FOR_IVAR +#define USE_IC_FOR_IVAR 1 +#endif + static void compile_insns(FILE *f, const struct rb_iseq_constant_body *body, unsigned int stack_size, unsigned int pos, struct compile_status *status); |