We set the block address as soon as we make the block, so there is no
point in making it `Option<CodePtr>`. No memory saving, unfortunately,
as `mem::size_of::<Block>() = 176` before and after this change. Still
a simplification for the logic, though.
They are needed very often but it's hard to remember. I thought it'd be
useful to just copy that to /.vscode and edit that.
Usage:
cp -r misc/.vscode .vscode
Don't symlink it because you'd edit it but not want to commit it.
Because `optflags` is pasted into the invocation line after `CC`, we were
building with -O1 unintentionally. You can see this in the configuration
summary: https://github.com/ruby/ruby/actions/runs/3933391169/jobs/6727044423#step:9:753
The check actually fails with -O2. To make it pass, upstream suggest
that we use the annocheck GCC plugin. Since it requires building from
source as the debian package for it isn't ready yet, punt on it for now
and use `--skip-gaps`.
Co-authored-by: Jun Aruga <jaruga@redhat.com>
TarReader is used as an IO object, but doesn't behave the same as other
implementations. These fixes make `read` and `readpartial` conform to the
interface of StringIO and File.
https://github.com/rubygems/rubygems/commit/bba32d7217
Added more tests for some of the other behavior as well.
Tests were missing for readpartial with a buffer, and reading
remaining bytes after a partial read, using StringIO as reference.
https://github.com/rubygems/rubygems/commit/d600a657b1
Previously, with Code GC, YJIT panicked while trying to emit a B.cond
instruction with an offset that is not encodable in 19 bits. This only
happens when the code in an assembler instance straddles two pages.
To fix this, when we detect that a jump to a label can land on a
different page, we switch to a fresh new page and regenerate all the
code in the assembler there. We still assume that no one assembler has
so much code that it wouldn't fit inside a fresh new page.
[Bug #19385]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Sharing an array will cause it to be WB unprotected due to the use
of `RARRAY_PTR`. We don't need to WB unprotect the array because we're
not writing to the buffer of the array.
The following script demonstrates this issue:
```
ary = [1] * 1000
shared = ary[10..20]
puts ObjectSpace.dump(ary)
```
* use correct svar
Without this patch, svar location is used "nearest Ruby frame".
It is almost correct but it doesn't correct when the `each` method
is written in Ruby.
```ruby
class C
include Enumerable
def each
%w(bar baz).each{|e| yield e}
end
end
C.new.grep(/(b.)/){|e| p [$1, e]}
```
This patch fix this issue by traversing ifunc's cfp.
Note that if cfp doesn't specify this Thread's cfp stack, reserved
svar location (`ec->root_svar`) is used.
* make yjit-bindgen
---------
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
There's a memory leak in ObjectSpace::WeakMap due to not freeing
the `struct weakmap`. It can be seen in the following script:
```
100.times do
10000.times do
ObjectSpace::WeakMap.new
end
# Output the Resident Set Size (memory usage, in KB) of the current Ruby process
puts `ps -o rss= -p #{$$}`
end
```