<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/tool/ruby_vm, branch ruby_3_0</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 87c546b5fa97e6e226cce4daf417617a1143f642,7a3322a0fd660d676f1918bd7c4a37676b44e1c2:</title>
<updated>2021-04-29T08:49:55+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-04-29T08:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cc4e602634e894c831a4103a5803a3de566c1856'/>
<id>cc4e602634e894c831a4103a5803a3de566c1856</id>
<content type='text'>
	Avoid using inconsistent coding style

	Other `_mjit_compile_*.erb` files don't use goto. These files'd better
	be consistent for readability.
	---
	 tool/ruby_vm/views/_mjit_compile_getinlinecache.erb | 14 +++-----------
	 1 file changed, 3 insertions(+), 11 deletions(-)

	Fix broken JIT of getinlinecache

	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.
	---
	 test/ruby/test_jit.rb                              | 12 +++++++++++
	 .../ruby_vm/views/_mjit_compile_getinlinecache.erb |  2 +-
	 vm_insnhelper.c                                    | 25 ++++++++++++++--------
	 3 files changed, 29 insertions(+), 10 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Avoid using inconsistent coding style

	Other `_mjit_compile_*.erb` files don't use goto. These files'd better
	be consistent for readability.
	---
	 tool/ruby_vm/views/_mjit_compile_getinlinecache.erb | 14 +++-----------
	 1 file changed, 3 insertions(+), 11 deletions(-)

	Fix broken JIT of getinlinecache

	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.
	---
	 test/ruby/test_jit.rb                              | 12 +++++++++++
	 .../ruby_vm/views/_mjit_compile_getinlinecache.erb |  2 +-
	 vm_insnhelper.c                                    | 25 ++++++++++++++--------
	 3 files changed, 29 insertions(+), 10 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid re-entering opt_invokebuiltin_delegate_leave</title>
<updated>2021-01-13T08:07:56+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2021-01-11T07:40:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=303533d23c5f566c0277c86c83f826c5e52f0c1a'/>
<id>303533d23c5f566c0277c86c83f826c5e52f0c1a</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>enable constant cache on ractors</title>
<updated>2021-01-13T08:06:16+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2021-01-04T09:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b93e16dc0f45069d4a5fcce20d5c4437e151f0a8'/>
<id>b93e16dc0f45069d4a5fcce20d5c4437e151f0a8</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip checking ROBJECT_EMBED</title>
<updated>2020-12-23T07:50:43+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-23T07:38:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=81a8d1cf09d59f0d69143d7896545f849f580a4e'/>
<id>81a8d1cf09d59f0d69143d7896545f849f580a4e</id>
<content type='text'>
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
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer stdbool in vm_exec</title>
<updated>2020-12-22T05:16:39+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-22T05:16:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=692af8e8f8b5f9965450d8f2577f435feaa6f80d'/>
<id>692af8e8f8b5f9965450d8f2577f435feaa6f80d</id>
<content type='text'>
Make the code a bit modern and consistent with some other places.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the code a bit modern and consistent with some other places.
</pre>
</div>
</content>
</entry>
<entry>
<title>Check mjit_call_p only when interrupted</title>
<updated>2020-12-20T05:38:14+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-20T05:35:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7d0144e055fdbd7110cf84275b9e145550b77fd3'/>
<id>7d0144e055fdbd7110cf84275b9e145550b77fd3</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Prefer RB_OBJ_FROZEN_RAW</title>
<updated>2020-12-19T08:34:33+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-19T08:33:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5611066e03fe73bdbb08cc46f79530c69975cf17'/>
<id>5611066e03fe73bdbb08cc46f79530c69975cf17</id>
<content type='text'>
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
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Lazily move PC with RUBY_VM_CHECK_INTS</title>
<updated>2020-12-17T07:06:28+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-17T06:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5d74894f2bc4a3a18aec952d946ead3d784cb4b4'/>
<id>5d74894f2bc4a3a18aec952d946ead3d784cb4b4</id>
<content type='text'>
```
$ 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
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
$ 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
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Ignore catch_except_p for PC motion</title>
<updated>2020-12-17T06:17:46+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-17T06:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3b4d698e0b5a79b63b05ae0c79d282a9049225e4'/>
<id>3b4d698e0b5a79b63b05ae0c79d282a9049225e4</id>
<content type='text'>
We probably don't need to move it when an insn is leaf...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We probably don't need to move it when an insn is leaf...
</pre>
</div>
</content>
</entry>
<entry>
<title>Inline getconstant on JIT (#3906)</title>
<updated>2020-12-16T14:24:07+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-12-16T14:24:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=53babf35ef5b643774636550ea23851e2607e076'/>
<id>53babf35ef5b643774636550ea23851e2607e076</id>
<content type='text'>
* Inline getconstant on JIT

* Support USE_MJIT=0</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Inline getconstant on JIT

* Support USE_MJIT=0</pre>
</div>
</content>
</entry>
</feed>
