Age | Commit message (Collapse) | Author |
|
Assigning to `leaf` in insns.def would give undesirable results.
|
|
This caused Bus error on 32 bit Solaris
Notes:
Merged: https://github.com/ruby/ruby/pull/5049
|
|
I did a `git diff --stat` against upstream and looked at all the files
that are outside of YJIT to come up with these minor changes.
|
|
Now that we're using the jit function entry point, we don't need the
scraper. Thank you for your service, scraper. ❤️
|
|
Just happened to run across this, so lets fix them
|
|
Lazily compile out a chain of checks for different known classes and
whether `self` embeds its ivars or not.
* Remove trailing whitespaces
* Get proper addresss in Capstone disassembly
* Lowercase address in Capstone disassembly
Capstone uses lowercase for jump targets in generated listings. Let's
match it.
* Use the same successor in getivar guard chains
Cuts down on duplication
* Address reviews
* Fix copypasta error
* Add a comment
|
|
|
|
Renaming uJIT to YJIT. AKA s/ujit/yjit/g.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is just so we can build successfully on -O0 and other cases that
are not supported by the code scraper.
|
|
|
|
Let's see if this works on CI
|
|
|
|
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4633
|
|
This updates the trace instructions to directly dispatch to
opt_send_without_block. So this should cause no slowdown in
non-trace mode.
To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL
and RUBY_EVENT_C_RETURN are added as events to the specialized
instructions.
Fixes [Bug #14870]
Co-authored-by: Takashi Kokubun <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/4739
Merged-By: jeremyevans <[email protected]>
|
|
I'm investigating SEGVs like https://github.com/ruby/ruby/runs/2715166621?check_suite_focus=true.
Because a lot of things are going on on this line, it's hard to identify
the cause, especially because we can't get the core file of the failures.
Therefore I intentionally increased the number of lines for
investigation.
|
|
This version of defined? doesn't seem to be possible to emit anymore.
Notes:
Merged: https://github.com/ruby/ruby/pull/4253
|
|
on interruption.
The cancellation code was originally written for leave insn, but re-entering
opt_invokebuiltin_delegate_leave insn on a cancellation is not safe, because
a builtin function is executed twice.
|
|
e7fc353f04 reverted vm_ic_hit_p's signature change made in 53babf35ef,
which broke JIT compilation of getinlinecache.
To make sure it doesn't happen again, I separated vm_inlined_ic_hit_p to
make the intention clear.
|
|
Other `_mjit_compile_*.erb` files don't use goto. These files'd better
be consistent for readability.
|
|
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.
This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]
Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.
`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/4022
|
|
when we already check ROBJECT_NUMIV(self) is larger than
ROBJECT_EMBED_LEN_MAX at the beginning of the method, because the number
of instance variables for the same object doesn't decrease.
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=4 --alternate --output=all benchmark_3000.yml
before --jit: ruby 3.0.0dev (2020-12-23T06:32:19Z master dbb4f19969) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-23T07:45:42Z master 95e866c098) +JIT [x86_64-linux]
last_commit=Skip checking ROBJECT_EMBED
Calculating -------------------------------------
before --jit after --jit
Optcarrot 3000 frames 102.34091772397872 102.77738408379015 fps
103.37784821624231 105.46530219076179
104.39567016876369 106.43712452152215
105.31782092252713 106.54986150067481
```
|
|
Make the code a bit modern and consistent with some other places.
|
|
for leaf_without_check_ints insns.
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-12-20T05:02:18Z master 02b3555874) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-20T05:36:00Z master 3f58de4eab) +JIT [x86_64-linux]
last_commit=Check mjit_call_p only when interrupted
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 84.50647332260259 85.85057800433144 fps
91.17796644338372 92.09930605656054
91.29346683444497 93.01336611323687
91.50322318568884 93.07234029037433
91.66560903214686 93.22773241529644
91.82315142636172 93.37032901061119
92.15066379608260 93.83701526141679
92.37897097456643 93.86032792681507
92.53049815524908 93.91211970920320
92.78414507914283 94.09109196967890
92.90299756525958 94.40107239595325
93.70279428858790 95.01326369371263
|
|
following the original implementation's change.
RB_TYPE_P(obj, T_OBJECT) is already checked in these places.
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-12-19T08:27:44Z master 52b1716c78) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-19T08:27:44Z master 52b1716c78) +JIT [x86_64-linux]
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 88.04551460097873 84.38303800957766 fps
88.25194345156318 85.31098251408059
88.34143982084871 86.60491582339496
88.63486879856976 88.23675694701865
88.85392212902701 88.23696283371444
89.05739427483194 88.97185459567562
89.08141031147311 90.16373192658857
89.11359420883423 90.61655686444394
89.80323392966130 90.77044959019291
90.58912189625207 90.88534596330966
90.59847996970350 91.34314801302897
90.61180456415137 93.11599164249547
```
|
|
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-12-17T06:17:46Z master 3b4d698e0b) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-17T07:01:48Z master 843abb96f0) +JIT [x86_64-linux]
last_commit=Lazily move PC with RUBY_VM_CHECK_INTS
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 80.29343646660429 83.15779723251525 fps
82.26755637885149 85.50197941326810
83.50682959728820 88.14657804306270
85.01236533133049 88.78201988978667
87.81799334561326 88.94841008936447
87.88228562393064 89.37925215601926
88.06695585889995 89.86143277214475
88.84730834922165 90.00773346420887
90.46317871213088 90.82603371104014
90.96308347148916 91.29797694822179
90.97945938504556 91.31086331868738
91.57127890154500 91.49949184318844
```
|
|
We probably don't need to move it when an insn is leaf...
|
|
* Inline getconstant on JIT
* Support USE_MJIT=0
Notes:
Merged-By: k0kubun <[email protected]>
|
|
and fix inconsistent indentation in mjit_compile.inc.erb
|
|
`cd` is passed to method call functions to method invocation
functions, but `cd` can be manipulated by other ractors simultaneously
so it contains thread-safety issue.
To solve this issue, this patch stores `ci` and found `cc` to `calling`
and stops to pass `cd`.
Notes:
Merged: https://github.com/ruby/ruby/pull/3903
|
|
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T06:41:15Z master 8ce1711c25) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T08:36:02Z master 2c592126b9) +JIT [x86_64-linux]
last_commit=Cache access to reg_cfp->self on JIT
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 82.40522392468650 82.66023870551237 fps
82.67998539899482 83.08660305312587
85.51280693947453 87.09311989553235
86.32925337181406 87.16115255191410
87.35617494926235 87.30699391518075
87.91865339426212 88.47590342996875
88.11573661006648 88.64778616696353
88.16060826662158 88.67015079203991
88.21639244865058 89.19630739497482
88.47241577897603 89.23443637947730
89.37087287229809 89.57052723997015
89.46969964699964 89.97803363889025
```
|
|
This reverts commit 4d2c8edca69884a41d2f843d36023e3decdb9872.
Unfortunately this seems to cause several issues:
https://github.com/ruby/ruby/runs/1462188376?check_suite_focus=true
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3272802
|
|
Performance is probably improved?
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T05:28:19Z master df6b05c6dd) +JIT [x86_64-linux]
last_commit=Set VM_FRAME_FLAG_FINISH at once
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 80.89292998533379 82.19497327502751 fps
80.93130641142331 85.13943315260148
81.06214830270119 87.43757879797808
82.29172808453910 87.89942441487113
84.61206450455929 87.91309779491075
85.44545883567997 87.98026086648694
86.02923132404449 88.03081060383973
86.07411817365879 88.14650206137341
86.34348799602836 88.32791633649961
87.90257338977324 88.57599644892220
88.58006509876580 88.67426384743277
89.26611118140011 88.81669430874207
This should have no bad impact on VM because this function is ALWAYS_INLINE.
|
|
|
|
|
|
|
|
iv_index_tbl manages instance variable indexes (ID -> index).
This data structure should be synchronized with other ractors
so introduce some VM locks.
This patch also introduced atomic ivar cache used by
set/getinlinecache instructions. To make updating ivar cache (IVC),
we changed iv_index_tbl data structure to manage (ID -> entry)
and an entry points serial and index. IVC points to this entry so
that cache update becomes atomically.
Notes:
Merged: https://github.com/ruby/ruby/pull/3662
|
|
generic_ivtbl is a process global table to maintain instance variables
for non T_OBJECT/T_CLASS/... objects. So we need to protect them
for multi-Ractor exection.
Hint: we can make them Ractor local for unshareable objects, but
now it is premature optimization.
Notes:
Merged: https://github.com/ruby/ruby/pull/3655
|
|
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.
[Feature #17100]
This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.
I hope this feature can help programmers from thread-safety issues.
Notes:
Merged: https://github.com/ruby/ruby/pull/3365
|
|
This makes the binary 272 bytes smaller on -O3 GCC 10.2.0.
Notes:
Merged: https://github.com/ruby/ruby/pull/3494
|
|
Do not repeat yourself.
Notes:
Merged: https://github.com/ruby/ruby/pull/3405
|