* YJIT: limit size of call count stats dict
Someone reported that logs were getting bloated because the
ISEQ and C call count dicts were huge, since they include all
of the call sites. I wrote code on the Rust size to limit the
size of the dict to avoid this problem. The size limit is
hardcoded at 20, but I figure this is probably fine?
* Fix bug reported by Kokubun.
Previously, ensure ISEQs took their first line number from the
line number coming from the AST. However, if this is coming from
an empty `begin`..`end` inside of a method, this can be all of the
way back to the method declaration. Instead, this commit changes
it to be the first line number of the ensure block itself.
The first_lineno field is only accessible through manual ISEQ
compilation or through tracepoint. Either way, this will be more
accurate for targeting going forward.
[Feature #20507]
This was missed from the initial commit.
```
../../.././include/ruby/internal/value_type.h:446:27: error: implicit conversion changes signedness: 'enum ruby_value_type' to 'int' [-Werror,-Wsign-conversion]
rb_unexpected_type(v, t);
~~~~~~~~~~~~~~~~~~ ^
```
Under compilers with WERRORFLAG, MakeMakefile.try_compile treats
warnings as errors, so we can use append_cflags to test whether the
public header files emit warnings with certain flags turned on.
[Regression test for feature #20507]
With embedded strings we often have some space left in the slot, which
we can use to store the string Hash code.
It's probably only worth it for string literals, as they are the ones
likely to be used as hash keys.
We chose to store the Hash code right after the string terminator as to
make it easy/fast to compute, and not require one more union in RString.
```
compare-ruby: ruby 3.4.0dev (2024-04-22T06:32:21Z main f77618c1fa) [arm64-darwin23]
built-ruby: ruby 3.4.0dev (2024-04-22T10:13:03Z interned-string-ha.. 8a1a32331b) [arm64-darwin23]
last_commit=Precompute embedded string literals hash code
| |compare-ruby|built-ruby|
|:-----------|-----------:|---------:|
|symbol | 39.275M| 39.753M|
| | -| 1.01x|
|dyn_symbol | 37.348M| 37.704M|
| | -| 1.01x|
|small_lit | 29.514M| 33.948M|
| | -| 1.15x|
|frozen_lit | 27.180M| 33.056M|
| | -| 1.22x|
|iseq_lit | 27.391M| 32.242M|
| | -| 1.18x|
```
Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
They were initially made frozen to avoid false positives for cases such
as:
str = str.dup if str.frozen?
But this may cause bugs and is generally confusing for users.
[Feature #20205]
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
This test randomly fails due to the bug reported in [Bug #20314], where
the two timeouts are too close so that they can expire at the same time.
As a workaround, this change increases the time difference between
timeouts. This will reduce the probability of simultaneous expirations
and lower flakiness.
(https://github.com/ruby/reline/pull/707)
* Implement the redo command
* Commented out a test that does not pass
* Changed key assignment for redo from "\C-[" to "\C-g"
* Changed redo key assignment from `\C-g` to `\M-\C-_`
* Revert the first implemantation
* Implemented redo by sharing `@past_lines` between undo and redo
* Fixed the index of past_lines that is updated when the cursor is moved
* Fixed deletion of the redo history in regular input
* Renamed variables: past_lines -> input_lines
* Rename @position to @input_lines_position
* Deleted unused variables: `@old_byte_pointer` and `@old_line_index`
https://github.com/ruby/reline/commit/0b2d9fab5f
Since #10209 we've been noticing that on macos after running `make
clean` the `coroutine/arm64/Context.S` file is missing, causing
subsequent make calls to fail because `Context.S` is needed to build
`Context.o`.
The reason this is happening is because macos is case-insensitive so the
`.s` looks for `coroutine/arm64/Context.s` and finds
`coroutine/arm64/Context.s`. This does not happen on linux because the
filesystem is case sensitive.
I attempted to use `find` because it is case sensitive regardless of
filesystem, but it was a lot slower than `rm` since we can't pass
multiple file names the same way to `find`.
Reverting this small part of #10209 fixes the issue for macos and it
wasn't clear that those changes were strictly necessary for the rest of
the PR.
We changed the original code to use `rm` instead of `delete` because it
is not standarized on POSIX.
Since `IO.new` accepts one or two positional arguments except for the
optional hash argument, exclude the optional hash argument from the
check for delegation to `IO.new`.