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

79475 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton f4443f3b1c [ruby/yarp] Increment version
https://github.com/ruby/yarp/commit/2b41ceb754
2023-09-08 19:50:47 +00:00
Kevin Newton c0f162caab [ruby/yarp] Template out a comment_targets method
https://github.com/ruby/yarp/commit/a94af7c4c8
2023-09-08 19:38:17 +00:00
Kevin Newton 5d73c0f3df [ruby/yarp] Move parse result mutations into their own files
https://github.com/ruby/yarp/commit/3be8272fa2
2023-09-08 19:38:17 +00:00
Jemma Issroff 7fc4db35ee
[YARP] Implement compilation for RationalNodes, fix other num types (#8404) 2023-09-08 15:33:51 -04:00
Vinicius Stock 6050b5a4e8 [ruby/yarp] Add ParseResult#attach_comments! to tie comments to their locations
https://github.com/ruby/yarp/commit/ddc699156f

Co-authored-by: Kevin Newton <kddnewton@users.noreply.github.com>
2023-09-08 18:10:26 +00:00
Matt Valentine-House 7f53da94fb Fix weak_references count test
This test creates a lot of Objects held in an array, and a set of weak
references to them using WeakMap. It then clears the array and frees it
and asserts that all the weak references to it are also gone.

This test is failing because one of the dummy objects in our weakmap is
ending up on the stack, and so is being marked, even though we thought
that we'd removed the only reference to it.

This behaviour has changed since this commit:

5b5ae3d9e0

which rewrites `Integer#times` from C into Ruby. This change is somehow
causing the last object we append to our array to consistently end up on
the stack during GC.

This commit fixes the specific weakmap test by using an enumerator and
each, instead of `Integer#times`, and thus avoids having our last object
created end up on the stack.
2023-09-08 17:45:00 +01:00
Alan Wu 60ef156b14 [DOC] Kernel#{proc,lambda} don't issue warnings anymore
They've been raising since 3.0.0.
2023-09-08 12:33:58 -04:00
Jemma Issroff af5df9ee5e
[YARP] Implement compilation for Regex / InterpolatedRegex (#8396) 2023-09-08 12:09:30 -04:00
Jemma Issroff 8807b0dc96
[YARP] Implement compilation for InterpolatedXStringNode (#8395)
* [YARP] Implemented compilation for InterpolatedXStringNode

* Extract common function for interpolated nodes
2023-09-08 10:40:07 -04:00
Kevin Newton c7d61181d0 [ruby/yarp] Flatten multitarget into multiwrite
https://github.com/ruby/yarp/commit/1021dac372
2023-09-08 13:40:28 +00:00
Kevin Newton f39b576e76 [ruby/yarp] Multi target nodes
https://github.com/ruby/yarp/commit/fa53fe88e4
2023-09-08 13:40:28 +00:00
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