<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/internal, branch ruby_3_1</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Backport cvar clone bug fix for 19379 to 3.1 (#7889)</title>
<updated>2023-07-25T11:05:27+00:00</updated>
<author>
<name>Eileen M. Uchitelle</name>
<email>eileencodes@users.noreply.github.com</email>
</author>
<published>2023-07-25T11:05:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cba152ff1f69fad98f4c67747dcf763407cd1883'/>
<id>cba152ff1f69fad98f4c67747dcf763407cd1883</id>
<content type='text'>
* Copy cvar table on clone

When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

* Fix cvar caching when class is cloned

The class variable cache that was added in
https://github.com/ruby/ruby/pull/4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

* Add missing write barrier

We were missing the write barrier for class_value to cref. This should
fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

---------

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Copy cvar table on clone

When a class with a class variable is cloned we need to also copy the
cvar cache table from the original table to the clone. I found this bug
while working on fixing [Bug #19379]. While this does not fix that bug
directly it is still a required change to fix another bug revealed by
the fix in https://github.com/ruby/ruby/pull/7265

This needs to be backported to 3.2.x and 3.1.x.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

* Fix cvar caching when class is cloned

The class variable cache that was added in
https://github.com/ruby/ruby/pull/4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

* Add missing write barrier

We were missing the write barrier for class_value to cref. This should
fix the segv we were seeing in http://ci.rvm.jp/logfiles/brlog.trunk-gc-asserts.20230601-165052

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;

---------

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 8ce2fb9bbbaea14737c84385b1573f743a30f773,3a0f6ce1d31eefd8af01b50f3632a64d64e8f8c1: [Backport #19415]</title>
<updated>2023-03-21T06:32:44+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-03-21T06:32:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=26b3f0b6a9489860e1d312369d784495b080daa3'/>
<id>26b3f0b6a9489860e1d312369d784495b080daa3</id>
<content type='text'>
	Only emit circular dependency warning for owned thread shields [Bug
	 #19415]

	If multiple threads attemps to load the same file concurrently
	it's not a circular dependency issue.

	So we check that the existing ThreadShield is owner by the current
	fiber before warning about circular dependencies.
	---
	 internal/thread.h                                     |  1 +
	 load.c                                                |  3 ++-
	 spec/ruby/core/kernel/shared/require.rb               | 11 +++++++++++
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb |  4 ++++
	 test/ruby/test_require.rb                             |  3 ---
	 thread.c                                              | 11 +++++++++++
	 6 files changed, 29 insertions(+), 4 deletions(-)
	 create mode 100644 spec/ruby/fixtures/code/concurrent_require_fixture.rb

	Use Thread.pass until thread.stop? to wait for thread to block

	[Bug #19415]

	It should be more reliable
	---
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Only emit circular dependency warning for owned thread shields [Bug
	 #19415]

	If multiple threads attemps to load the same file concurrently
	it's not a circular dependency issue.

	So we check that the existing ThreadShield is owner by the current
	fiber before warning about circular dependencies.
	---
	 internal/thread.h                                     |  1 +
	 load.c                                                |  3 ++-
	 spec/ruby/core/kernel/shared/require.rb               | 11 +++++++++++
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb |  4 ++++
	 test/ruby/test_require.rb                             |  3 ---
	 thread.c                                              | 11 +++++++++++
	 6 files changed, 29 insertions(+), 4 deletions(-)
	 create mode 100644 spec/ruby/fixtures/code/concurrent_require_fixture.rb

	Use Thread.pass until thread.stop? to wait for thread to block

	[Bug #19415]

	It should be more reliable
	---
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Make RubyVM::AbstractSyntaxTree.of raise for backtrace location in eval</title>
<updated>2021-12-18T18:51:37+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2021-12-18T18:40:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=acac2b8128980b97c64b4d057acdf2ceffb0b981'/>
<id>acac2b8128980b97c64b4d057acdf2ceffb0b981</id>
<content type='text'>
This check is needed to fix a bug of error_highlight when NameError
occurred in eval'ed code.
https://github.com/ruby/error_highlight/pull/16

The same check for proc/method has been already introduced since
64ac984129a7a4645efe5ac57c168ef880b479b2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This check is needed to fix a bug of error_highlight when NameError
occurred in eval'ed code.
https://github.com/ruby/error_highlight/pull/16

The same check for proc/method has been already introduced since
64ac984129a7a4645efe5ac57c168ef880b479b2.
</pre>
</div>
</content>
</entry>
<entry>
<title>Speed up Ractors for Variable Width Allocation</title>
<updated>2021-11-23T15:51:27+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2021-11-19T19:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9aded89f4071a8afb79326701789241f1da12f82'/>
<id>9aded89f4071a8afb79326701789241f1da12f82</id>
<content type='text'>
This commit adds a Ractor cache for every size pool. Previously, all VWA
allocated objects used the slowpath and locked the VM.

On a micro-benchmark that benchmarks String allocation:

VWA turned off:
  29.196591   0.889709  30.086300 (  9.434059)

VWA before this commit:
  29.279486  41.477869  70.757355 ( 12.527379)

VWA after this commit:
  16.782903   0.557117  17.340020 (  4.255603)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds a Ractor cache for every size pool. Previously, all VWA
allocated objects used the slowpath and locked the VM.

On a micro-benchmark that benchmarks String allocation:

VWA turned off:
  29.196591   0.889709  30.086300 (  9.434059)

VWA before this commit:
  29.279486  41.477869  70.757355 ( 12.527379)

VWA after this commit:
  16.782903   0.557117  17.340020 (  4.255603)
</pre>
</div>
</content>
</entry>
<entry>
<title>Assign temporary ID to anonymous ID [Bug #18250]</title>
<updated>2021-11-23T12:03:19+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-11-22T15:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c14f230b26aa4f8abe9ecf3814cfebbe584d77c9'/>
<id>c14f230b26aa4f8abe9ecf3814cfebbe584d77c9</id>
<content type='text'>
Dumped iseq binary can not have unnamed symbols/IDs, and ID 0 is
stored instead.  As `struct rb_id_table` disallows ID 0, also for
the distinction, re-assign a new temporary ID based on the local
variable table index when loading from the binary, as well as the
parser.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dumped iseq binary can not have unnamed symbols/IDs, and ID 0 is
stored instead.  As `struct rb_id_table` disallows ID 0, also for
the distinction, re-assign a new temporary ID based on the local
variable table index when loading from the binary, as well as the
parser.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make RCLASS_EXT(c)-&gt;subclasses a doubly linked list</title>
<updated>2021-11-22T14:11:04+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2021-11-15T21:09:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b680b632e5b88e4ea550de3f15cf6ef782efeb48'/>
<id>b680b632e5b88e4ea550de3f15cf6ef782efeb48</id>
<content type='text'>
Updating RCLASS_PARENT_SUBCLASSES and RCLASS_MODULE_SUBCLASSES while
compacting can trigger the read barrier. This commit makes
RCLASS_SUBCLASSES a doubly linked list with a dedicated head object so
that we can add and remove entries from the list without having to touch
an object in the Ruby heap
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Updating RCLASS_PARENT_SUBCLASSES and RCLASS_MODULE_SUBCLASSES while
compacting can trigger the read barrier. This commit makes
RCLASS_SUBCLASSES a doubly linked list with a dedicated head object so
that we can add and remove entries from the list without having to touch
an object in the Ruby heap
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove RCLASS(obj)-&gt;ptr when RVARGC is enabled</title>
<updated>2021-11-11T18:47:45+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2021-11-10T21:33:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a9a94540d68b523ecc4e2181e50b320cd5d176f1'/>
<id>a9a94540d68b523ecc4e2181e50b320cd5d176f1</id>
<content type='text'>
With RVARGC we always store the rb_classext_t in the same slot as the
RClass struct that refers to it. So we don't need to store the pointer
or access through the pointer anymore and can switch the RCLASS_EXT
macro to use an offset
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With RVARGC we always store the rb_classext_t in the same slot as the
RClass struct that refers to it. So we don't need to store the pointer
or access through the pointer anymore and can switch the RCLASS_EXT
macro to use an offset
</pre>
</div>
</content>
</entry>
<entry>
<title>gc.h: move rb_objspace_garbage_object_p to internal/gc.h</title>
<updated>2021-11-10T01:08:30+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2021-11-09T15:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e8086e275b9a4896ac57dfeac9b22cbc2741d6d1'/>
<id>e8086e275b9a4896ac57dfeac9b22cbc2741d6d1</id>
<content type='text'>
... to allow class.c to use the function
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... to allow class.c to use the function
</pre>
</div>
</content>
</entry>
<entry>
<title>Embed bare `double` if `sizeof(double) == sizeof(VALUE)`</title>
<updated>2021-10-26T17:05:06+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-10-26T15:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=26353c75a94469bad7a0e6a6aa81d968e64952d5'/>
<id>26353c75a94469bad7a0e6a6aa81d968e64952d5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Align `RFloat` at VALUE boundary</title>
<updated>2021-10-26T17:05:06+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-10-26T14:39:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e3a783b14191fef175c9a59996afdc744c8edc4c'/>
<id>e3a783b14191fef175c9a59996afdc744c8edc4c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
