Check whether the current or previous frame is a Ruby frame in
call_trace_func before attempting to create a binding for the frame.
Fixes [Bug #18487]
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Current behavior - caches depend on a global counter. All constant mutations cause caches to be invalidated.
```ruby
class A
B = 1
end
def foo
A::B # inline cache depends on global counter
end
foo # populate inline cache
foo # hit inline cache
C = 1 # global counter increments, all caches are invalidated
foo # misses inline cache due to `C = 1`
```
Proposed behavior - caches depend on name components. Only constant mutations with corresponding names will invalidate the cache.
```ruby
class A
B = 1
end
def foo
A::B # inline cache depends constants named "A" and "B"
end
foo # populate inline cache
foo # hit inline cache
C = 1 # caches that depend on the name "C" are invalidated
foo # hits inline cache because IC only depends on "A" and "B"
```
Examples of breaking the new cache:
```ruby
module C
# Breaks `foo` cache because "A" constant is set and the cache in foo depends
# on "A" and "B"
class A; end
end
B = 1
```
We expect the new cache scheme to be invalidated less often because names aren't frequently reused. With the cache being invalidated less, we can rely on its stability more to keep our constant references fast and reduce the need to throw away generated code in YJIT.
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
For the case using this script as a library.
- `ExtLibs#process` reads and processes an extlibs file.
- `ExtLibs#process_under` processes all extlibs files under the
given directory.
- `Extlibs.run` parses `ARGV` and lets an instance process the
directories.
If an exception happens during test `setup` method, the `teardown`
method will still be run for cleaning up, but if some other errors
occurs then, it will hide the original error.
This is happening sometimes in CI where restoring original gem hooks is
failing because the error in `setup` happened before the variable
holding the original hooks was initialized.
This commit moves initialization of `@orig_hooks` to the beginning of
the `setup` method to avoid this issue.
https://github.com/rubygems/rubygems/commit/8524d2b74d
Completely exclude the full bundler folder. The actual Bundler docs are
excluded anyways by ruby-core (by bundler/lib/bundler/.document,
bundler/lib/bundler/man/.document), I guess because bundler docs are not
in RDoc format?
Running RDoc in the repo root before these changes takes about 5 minutes
on my machine, while after these changes takes about 15 seconds.
https://github.com/rubygems/rubygems/commit/8b1802447a
Previously, this would work as expected if the enumerable contained
0 or 1 element, and would raise LocalJumpError otherwise. That
inconsistent behavior is likely to lead to bugs.
Fixes [Bug #18635]
This is hiding a real bundler issue as a "network error". It's more
helpful to get a proper bug report, with stack trace and so on.
So stop re-raising errors when evaluating unmarshaled responses as
network errors, and only raise Marshal errors when the Marshal format is
invalid, not whenever marshalled gemspecs can't be loaded because that
may hide actual client errors, like missing `YAML` constants.
https://github.com/rubygems/rubygems/commit/05ea907e1c
Treats:
#chars
#codepoints
#each_char
#each_codepoint
#each_grapheme_cluster
#grapheme_clusters
Also, corrects a passage in #unicode_normalize that mentioned module UnicodeNormalize, whose doc (:nodoc:, actually) says not to mention it.
This commit implements arrays on Variable Width Allocation. This allows
longer arrays to be embedded (i.e. contents directly follow the object
header) which improves performance through better cache locality.
As @peterzhu2118 and @duerst have pointed out, putting string method's RDoc into doc/ (which allows non-ASCII in examples) makes the "click to toggle source" feature not work for that method.
This PR moves the primary method doc back into string.c, then includes RDoc from doc/string/*.rdoc, and also removes doc/string.rdoc.
The affected methods are:
::new
#bytes
#each_byte
#each_line
#split
The call-seq is in string.c because it works there; it did not work when the call-seq is in doc/string/*.rdoc.
This PR also updates the relevant guidance in doc/documentation_guide.rdoc.
During lazy sweeping, the iclass could be a dead object that has not yet
been swept. However, the chain of superclasses of the iclass could
already have been swept (and become a new object), which would cause a
crash when trying to read the object.