Граф коммитов

79464 Коммитов

Автор SHA1 Сообщение Дата
Samuel Williams be21a056d2
Try default `gcc` 9.4.0 to see if it exhibits the same compiler bugs. (#8394)
* Revert "Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)"

This reverts commit 5184b40dd4.

* .travis.yml: Try default gcc 9.4.0 instead of gcc-10 in ppc64le and s390x.

Use gcc 9.4.0 instead of gcc-10 to avoid the current failures by a possible GCC
10 compiler bug in the Travis ppc64le and s390x cases. And it also aligns with
RubyCI Ubuntu ppc64le and s390x where the default gcc is used.

---------

Co-authored-by: Jun Aruga <jaruga@ruby-lang.org>
2023-09-08 20:44:46 +12:00
dependabot[bot] 15fd897629 Bump actions/cache from 3.3.1 to 3.3.2
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...704facf57e)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 12:26:50 +09:00
Nobuyoshi Nakada b6df6f911c
Continue even if addr or rnglists headers not found
Fix up commit 31d1226, "Avoid aborting inside addr2line.c".
Source code informations did not appear in C level backtrace since
that change.
2023-09-08 12:22:55 +09:00
Ian Candy 78233e8352
Add `String#getbyte` YJIT implementation (#8397)
* Add getbyte JIT implementation

Adds an implementation for String#getbyte for YJIT, along with a
bootstrap test. This should be helpful for pure Ruby implementations
and to avoid unneeded allocations.

Co-authored-by: John Hawthorn <jhawthorn@github.com>

* Skip the getbyte test for RJIT for now

---------

Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-09-07 23:15:24 -04:00
Takashi Kokubun 89edce4321
YJIT: Decrease IVAR_MAX_DEPTH to 8 (#8398) 2023-09-07 23:15:08 -04:00
John Hawthorn 094f336a27 GC: Only force alloc slowpath for NEWOBJ hook
Previously, configuring any GC event hook would cause all allocations to
go through the newobj slowpath. We should only need to do that when the
newobj specifically is subscribed to.

This renames flags.has_hook to flags.has_newobj_hook, to make this new
usage clear. newobj_of0 was the only place which previously checked this
flag.
2023-09-07 13:51:56 -07:00
Matthew Draper aed5215104 Optimize handle_interrupt(Exception => ..) as a common case
When interrupt behavior is configured for all possible exceptions using
'Exception', there's no need to iterate the pending exception's
ancestors for hash lookups.

More significantly, by storing the catch-all timing symbol directly in
the mask stack, we can skip allocating the hash we would otherwise need.
2023-09-07 13:51:15 -07:00
Matthew Draper ed712e0e9d Skip allocation if handle_interrupt arg is already usable
If the supplied hash is already frozen and compare-by-identity, we can
use it directly (still checking its contents are valid symbols), without
making a new copy.
2023-09-07 13:51:15 -07:00
Takashi Kokubun fcdedf7f47
YJIT: Decrease SEND_MAX_DEPTH to 5 (#8390) 2023-09-07 14:22:34 -04:00
Mike Dalessio 60a52caf87 [ruby/yarp] Avoid an extra "stop" parameter to yp_strspn_whitespace_newlines
and use yp_strspn_inline_whitespace instead.

Partially reverts implementation details from #1152

https://github.com/ruby/yarp/commit/c8f9f4cfde
2023-09-07 18:13:51 +00:00
Takashi Kokubun 5b5ae3d9e0
Rewrite Integer#times in Ruby (#8388) 2023-09-07 10:57:52 -07:00
Mike Dalessio 4efcaf956e [ruby/yarp] Extract error messages into diagnostic.c and use canonical message IDs
The parser now passes around `yp_diagnostic_id_t` for diagnostic
messages instead of character strings, and we rely on the function
`diagnostic_message()` to resolve that to a string.

In addition, many messages were edited so that the parser expresses
coordinate ideas in similar form [1] using consistent voice and
typographic conventions.

Closes https://github.com/ruby/yarp/pull/1379, and makes progress on #941.

  [1] Strunk & White rule 19

https://github.com/ruby/yarp/commit/0b6dd85bf1
2023-09-07 16:36:56 +00:00
Jean Boussier 2d37b44603 Document that thread event hooks are called without the GVL
Except for the `RESUMED` event.
2023-09-07 18:31:16 +02:00
Jemma Issroff 7adc38b895
[YARP] Miscellaneous small bug fixes (#8387) 2023-09-07 10:59:51 -04:00
Nathan Froyd 630e49010c [ruby/yarp] remove now-redundant `YP_TOKEN_NOT_PROVIDED_VALUE`
https://github.com/ruby/yarp/commit/8f9a3c2345
2023-09-07 14:02:40 +00:00
Nathan Froyd 44b52c5416 [ruby/yarp] use `YP_LOCATION_*_VALUE` macros more consistently
https://github.com/ruby/yarp/commit/bcad93e2fc
2023-09-07 14:02:40 +00:00
Kevin Newton 194584f202 [ruby/yarp] Introduce owned constants
Before this commit, constants in the constant pool were assumed to
be slices of the source string. This works in _almost_ all cases.

There are times, however, when a string needs to be synthesized.
This can occur when passing in locals that need to be scoped through
eval, or when generating method names like `foo=`.

After this commit, there is a single bit `owned` boolean on
constants in the pool that indicates whether or not it is a slice
of the source string. If it is not, it is assumed to be allocated
memory that should be freed by the constant pool when the constant
pool is freed.

When serializing, the most significant bit in the location of the
contents of the constant indicates whether or not it is owned.
When it is, instead of 4 bytes for the source offset and 4 bytes
for the length it is instead 4 bytes for the buffer offset and 4
bytes the length. The contents of the owned constants are embedded
into the buffer after the constant pool itself.

https://github.com/ruby/yarp/commit/461c047365
2023-09-07 14:01:21 +00:00
Aaron Patterson 0adca625ee
Remove function call for String#bytesize (#8389)
* Remove function call for String#bytesize

String size is stored in a consistent location, so we can eliminate the
function call.

* Update yjit/src/codegen.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-09-07 09:54:05 -04:00
Kevin Newton 0c8928721e
[YARP] Use the correct field for the name on classes and modules 2023-09-07 09:10:50 -04:00
Kevin Newton 14970cfc8d [ruby/yarp] Constants and def nodes
https://github.com/ruby/yarp/commit/6b2421ce1b
2023-09-07 12:42:02 +00:00
Kevin Newton 9343ef2504 [ruby/yarp] Constants on rest parameter nodes
https://github.com/ruby/yarp/commit/a6fdb8aae9
2023-09-07 12:42:02 +00:00
Kevin Newton 3f78eec44a [ruby/yarp] Constants on keyword rest parameters
https://github.com/ruby/yarp/commit/5e1a8fbc54
2023-09-07 12:42:01 +00:00
Kevin Newton 9e21b33ece [ruby/yarp] Constants on keyword parameters
https://github.com/ruby/yarp/commit/d2d4f25a23
2023-09-07 12:42:00 +00:00
Kevin Newton e2a0f25888 [ruby/yarp] Remove name constant from classes/modules
https://github.com/ruby/yarp/commit/26105f0b58
2023-09-07 12:41:45 +00:00
Samuel Williams 5184b40dd4
Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)
We found some tests were hanging in `do_mutex_lock`, specifically the
fiber scheduler autoload test. After much investigation, it may be a code
generation bug. Because we didn't change the code, but only extracted it
into a separate function, and it appears to fix the problem.
2023-09-08 00:32:54 +12:00
git 009e0a3f9e Update bundled gems list at 2023-09-07 2023-09-07 06:59:55 +00:00
Nobuyoshi Nakada bd046764e3
[Bug #19549] Check for variables to be interpolated 2023-09-07 13:41:13 +09:00
Samuel Williams 05aaff2191
Reduce number of iterations in `TestFiberScheduler#test_autoload`. (#8391)
`ppc64le` appears to be struggling with this test due to timeout. Let's see
if reducing the number of iterations can help improve the test performance.
2023-09-07 13:53:51 +12:00
Nobuyoshi Nakada ac65fc833d
[DOC] Fix up Process::Status#>> 2023-09-07 10:05:10 +09:00
Martin Emde 89cb95679d [rubygems/rubygems] Reduce excess index creation and merging
When @allow_cached is true, @allow_local is always true,
therefore, the #installed_specs will always be merged after #cached_specs
is called. This makes starting with installed_specs.dup redundant.

When #cached_specs is called because @allow_remote is true and
@allow_cached is false, then installed_specs will be added after
cached_specs based on @allow_local.

We never need to add installed_specs here, so don't.

https://github.com/rubygems/rubygems/commit/49b38f9750
2023-09-07 00:33:29 +00:00
Martin Emde 86b93f7481 [rubygems/rubygems] Improve efficiency of Index#use and #search_all
Rename Index#use(override = true) to #merge!

Rename Index @all_specs to @duplicates, it is not actually all specs.
@duplicates only holds specs that would have been overridden during a call to
Index#use or Index#merge!

Reduced dupes in @duplicates by not double adding the new spec to the
index and the @duplicates during #merge!

Reduce Array creation by using specialized methods when the one result
or no results are needed from the search.

https://github.com/rubygems/rubygems/commit/47e91125db
2023-09-07 00:33:28 +00:00
Martin Emde af1bedbbd9 [rubygems/rubygems] Source::Rubygems#fetch_names is only called with override = false
https://github.com/rubygems/rubygems/commit/790202691d
2023-09-07 00:33:28 +00:00
Burdette Lamar 54274b8c65
[DOC] Rdoc for Process::Status (#8386) 2023-09-06 18:26:11 -04:00
Vinicius Stock acd626a583 [ruby/yarp] Consider source encoding for `slice`
https://github.com/ruby/yarp/commit/8f59fc27cd

Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2023-09-06 19:50:21 +00:00
Alan Wu f1422e4cec YJIT: Different comment when only setting ec->cfp [ci skip] 2023-09-06 15:32:36 -04:00
Andy Waite fdf7aad902 [ruby/yarp] Fix `Location#end_column`
https://github.com/ruby/yarp/commit/00e4711026
2023-09-06 18:37:41 +00:00
Peter Zhu 12102d101a Fix crash in WeakMap during compaction
WeakMap can crash during compaction because the st_insert could allocate
memory.
2023-09-06 14:20:23 -04:00
Kevin Newton 746eede412 [ruby/yarp] Constant on block parameter node
https://github.com/ruby/yarp/commit/2cd9a67150
2023-09-06 18:18:10 +00:00
Peter Zhu 08929b344d Try to fix flaky test_warmup_frees_pages
This test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2750]:
<202> expected but was
<203>.
```
2023-09-06 13:31:50 -04:00
Takashi Kokubun a334077b7b
YJIT: Make compiled_* stats available by default (#8379)
* YJIT: Make compiled_* stats available by default

* Update comment about default counters [ci skip]

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2023-09-06 09:29:33 -07:00
Kevin Newton dee383b262 [ruby/yarp] Constants on classes and modules
(https://github.com/ruby/yarp/pull/1409)

https://github.com/ruby/yarp/commit/0a11ec579f
2023-09-06 16:19:43 +00:00
Jemma Issroff 1d4d9a016a
[YARP] ClassNode and ModuleNode use name_constant (#8384) 2023-09-06 12:19:23 -04:00
Peter Zhu b3b57f70cc Fix missing write barrier in iseq instruction list
There's a missing write barrier for operands in the iseq instruction
list, which can cause crashes.

It can be reproduced when Ruby is compiled with `-DRUBY_DEBUG_ENV=1`.
Using the following command:

```
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0 RUBY_DEBUG=gc_stress ruby -w --disable=gems -Itool/lib -W0 test.rb
```

The following script crashes:

```
require "test/unit"
```
2023-09-06 11:18:50 -04:00
Kevin Newton a52ac350cc [ruby/yarp] Fix assert_raises in YARP
https://github.com/ruby/yarp/commit/8f8f3530aa
2023-09-06 14:30:55 +00:00
Jemma Issroff ae41bdac1e
[YARP] Use constant_id lookups where possible (#8374)
This commit extracts a `yp_constant_id_lookup` method and uses yp_constant_id_lookup where possible
2023-09-06 10:28:29 -04:00
Kevin Newton 5537169ef0 [ruby/yarp] Temporarily add name_constant to replace name on ClassNode/ModuleNode
https://github.com/ruby/yarp/commit/8f87686e9c
2023-09-06 14:20:13 +00:00
Kevin Newton dae6a0a295 [ruby/yarp] Introduce YARP::Pattern
https://github.com/ruby/yarp/commit/2a12e9637b
2023-09-06 14:19:58 +00:00
Kevin Newton 4c9a036606 [ruby/yarp] Add constants and constants
https://github.com/ruby/yarp/commit/d7eaa89bc3
2023-09-06 13:00:23 +00:00
Peter Zhu 6778d2c582 Support freeing the lowest memory address page
This should help fix the following flaky test:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2751]:
<0> expected but was
<1>.
```
2023-09-06 08:43:14 -04:00
Benoit Daloze 6408da70b0 [ruby/yarp] Add deprecated aliases of the form YP_NODE_<name>_NODE
https://github.com/ruby/yarp/commit/ae1f45ff52
2023-09-06 12:30:36 +00:00