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

83755 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 2e6f8554f8 [ruby/date] Remove the unintentional ability to parse `Symbol`
It's been 2 years since ruby/date#49, so it's okay.

https://github.com/ruby/date/commit/435dfec6c8
2024-02-21 16:04:52 +00:00
Kevin Newton 96f21e9dd1 Re-enable test now that dump is all ASCII 2024-02-21 10:58:40 -05:00
Kevin Newton 2b2e61e6f9 [ruby/prism] Only call encoding_changed callback on change
https://github.com/ruby/prism/commit/7d0bea3ce0
2024-02-21 15:47:05 +00:00
Kevin Newton bf680af7b2 [ruby/prism] Remove non-ASCII characters from --dump=parsetree
https://github.com/ruby/prism/commit/6d4cd21e98
2024-02-21 15:22:41 +00:00
Peter Zhu 402690c3b6 Fix incomplete switch statement in imemo_memsize
The switch statement is not exhaustive, meaning the "unreachable"
comment was not correct. This commit fixes it by making the list
exhaustive and adding an rb_bug in the default case.
2024-02-21 10:13:36 -05:00
Nobuyoshi Nakada 01c7e16c0c Separate miniruby from dmyext.c 2024-02-21 23:37:20 +09:00
Samuel Williams 04729fe68d
Fix exception handling in `rb_fiber_scheduler_set`. (#10042) 2024-02-22 00:33:18 +13:00
Samuel Williams 78d9fe6947
Ensure that exiting thread invokes end-of-life behaviour. (#10039) 2024-02-22 00:32:59 +13:00
Yuta Saito fd91354628 [DOC] Comment about logic to care about static/dynamic hetero build
The condition is rarely met in usual cases, so it's worth to note about
the situation and the reason why we care about it.
2024-02-21 19:37:06 +09:00
Nobuyoshi Nakada 6aa5067ab9
Revert rubygems tempdir check
This check was added to check if other tests still remain tempdir, and these tests do on Windows.

* `TestGemCommandsSetupCommand#test_destdir_flag_does_not_try_to_write_to_the_default_gem_home`
* `TestGemInstaller#test_install_build_root_when_gem_home_not_writable_does_not_fallback_to_user_install_inside_build_root`

Also some tests fail due to too long path names.
2024-02-21 10:28:23 +00:00
Yusuke Endoh b1431ce427 Add comments to dmydln.c, dmyenc.c, and dmyext.c
They are used conditionally in miniruby, dynamically-linked ruby, and
statically-linked ruby (--with-static-linked-ext).
I asked @nobu about the conditions. and I leave comments because the
conditions are insanely difficult.
2024-02-21 17:57:48 +09:00
Nobuyoshi Nakada 6ecb14df2c [rubygems/rubygems] Reset `Gem.state_file` along with `Gem.state_home`
As `Gem.state_file` is placed under `Gem.state_home` directory, when
the latter is reset, also the former should be reset.
If left unreset, the file for a previously run test will be re-created
and will not be deleted.

https://github.com/rubygems/rubygems/commit/1378d07afd
2024-02-21 08:14:34 +00:00
Nobuyoshi Nakada 1fa4d15ca7
Add `Test::Unit::TestCase#method_name`
For the compatibility with test-unit gem.
2024-02-21 15:45:53 +09:00
Hiroshi SHIBATA fc1a7a46dc [rubygems/rubygems] Use Hash#compact
https://github.com/rubygems/rubygems/commit/9d4ff6ff30

Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2024-02-21 06:39:37 +00:00
Nobuyoshi Nakada c8fb4f308b [rubygems/rubygems] Skip nil-value keys to make metadata reproducible
Nil-value keys in a mapping end with a space or not depending on
libyaml versions, and result metadata are different per platforms.
This commit makes to skip such keys to make metadata reproducible
accross platforms.

https://github.com/rubygems/rubygems/commit/74b4db8d30
2024-02-21 06:39:36 +00:00
Koichi Sasada d578684989 `rb_thread_lock_native_thread()`
Introduce `rb_thread_lock_native_thread()` to allocate dedicated
native thread to the current Ruby thread for M:N threads.
This C API is similar to Go's `runtime.LockOSThread()`.

Accepted at https://github.com/ruby/dev-meeting-log/blob/master/2023/DevMeeting-2023-08-24.md
(and missed to implement on Ruby 3.3.0)
2024-02-21 15:38:29 +09:00
yui-knk 91cb303531 Remove not used universal parser macros and functions 2024-02-21 13:36:45 +09:00
Hiroshi SHIBATA d0786cde3f [rubygems/rubygems] rake man:build
https://github.com/rubygems/rubygems/commit/e0ef515732
2024-02-21 03:30:23 +00:00
Hiroshi SHIBATA 08753f2037 [rubygems/rubygems] Use https instead of http
https://github.com/rubygems/rubygems/commit/bcbe6f7b7a
2024-02-21 03:30:22 +00:00
Yusuke Endoh a605234bfa NEWS.md: Add a note for [Feature #16495] and [Feature #19117] 2024-02-20 16:17:20 +09:00
John Hawthorn 081ee3d355 Add memory leak test for eval kwargs 2024-02-20 18:55:00 -08:00
John Hawthorn 1c97abaaba De-dup identical callinfo objects
Previously every call to vm_ci_new (when the CI was not packable) would
result in a different callinfo being returned this meant that every
kwarg callsite had its own CI.

When calling, different CIs result in different CCs. These CIs and CCs
both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop
this resulted in a memory leak of both types of object. This also likely
resulted in extra memory used, and extra time searching, in non-eval
cases.

For simplicity in this commit I always allocate a CI object inside
rb_vm_ci_lookup, but ideally we would lazily allocate it only when
needed. I hope to do that as a follow up in the future.
2024-02-20 18:55:00 -08:00
Alan Wu 2a6917b463 Fix string value in hash literal being forced frozen
We should pass `false` for `hash_key` for value nodes. Credits to
`@kddnewton` for noticing and bisecting.
2024-02-20 21:00:54 -05:00
yui-knk 5fb574ae4e `rb_parser_warn_duplicate_keys` doesn't need to take care of NODE_LIT anymore
NODE_LIT is created only for `shareable_constant_value`.
This means hash key node is never NODE_LIT.
2024-02-21 10:57:32 +09:00
Takashi Kokubun ce4142bcb7
YJIT: rb_str_concat_literals is not leaf (#10035) 2024-02-20 17:23:08 -08:00
yui-knk 776dbbba72 Remove hack for ripper.y generation
Before Rearchitect Ripper (89cfc15), parser and ripper used different
semantic value data type for same symbols.
"ext/ripper/tools/preproc.rb" replaced these types when it generated
ripper.y. Starting the line with other than `%token` suppressed
the type replacement.
However, after Rearchitect Ripper, both parser and ripper use
same semantic value data type. Therefore these comments are not needed
anymore.
2024-02-21 09:16:09 +09:00
yui-knk e7ab5d891c Introduce NODE_REGX to manage regexp literal 2024-02-21 08:06:48 +09:00
Peter Zhu 97d4363d3b [DOC] Improve docs for GC.latest_compact_info 2024-02-20 17:39:46 -05:00
Alan Wu 35fdf1a624 YJIT: Remove duplicate test 2024-02-20 16:53:36 -05:00
Alan Wu 8e1090487e YJIT: Fix calling leaf builtins with empty splat and kw_splat
These don't pass anything and just need to be popped off the stack.

https://github.com/ruby/ruby/actions/runs/7977363890/job/21780095289#step:13:104
2024-02-20 16:53:36 -05:00
Takashi Kokubun 9216a2ac43
YJIT: Verify the assumption of leaf C calls (#10002) 2024-02-20 13:42:29 -08:00
Burdette Lamar d4b4b53bc0
[DOC] Fix links in doc (#9970) 2024-02-20 16:10:52 -05:00
Koichi Sasada b3c13de858 skip a test on non-UTF-8 locale
`ruby --parser=prism -W:no-experimental --dump=parsetree -e :hi` prints
non-ASCII char(s) so the following test with non UTF-8 locale fails.

```
$ LANG=C make test-all TESTS='-n /parser/ ruby/rubyoptions' -o encs -o exts
Run options:
  --seed=32323
  "--ruby=./miniruby -I/home/ko1/ruby/src/master/lib -I. -I.ext/common  /home/ko1/ruby/src/master/tool/runruby.rb --extout=.ext  -- --disable-gems"
  --excludes-dir=/home/ko1/ruby/src/master/test/.excludes
  --name=!/memory_leak/
  -n
  /parser/

[1/1] TestRubyOptions#test_parser_flag = 0.04 s
  1) Failure:
TestRubyOptions#test_parser_flag [/home/ko1/ruby/src/master/test/ruby/test_rubyoptions.rb:300]:
pid 135869 exit 0.

1. [1/2] Assertion for "stdout"
   | invalid byte sequence in US-ASCII.

Finished tests in 0.044362s, 22.5416 tests/s, 225.4157 assertions/s.
1 tests, 10 assertions, 1 failures, 0 errors, 0 skips

ruby -v: ruby 3.4.0dev (2024-02-20T17:13:36Z master c0e5de9567) [x86_64-linux]
make: *** [uncommon.mk:945: yes-test-all] Error 1
```

Now simply skip the test if the locale is not UTF-8.
(I'm not familiar with encodings so please fix it if needed)
2024-02-21 03:59:19 +09:00
Jeremy Evans 77c1233f79 Add pushtoarraykwsplat instruction to avoid unnecessary array allocation
This is designed to replace the newarraykwsplat instruction, which is
no longer used in the parse.y compiler after this commit.  This avoids
an unnecessary array allocation in the case where ARGSCAT is followed
by LIST with keyword:

```ruby
a = []
kw = {}
[*a, 1, **kw]
```

Previous Instructions:

```
0000 newarray                               0                         (   1)[Li]
0002 setlocal_WC_0                          a@0
0004 newhash                                0                         (   2)[Li]
0006 setlocal_WC_0                          kw@1
0008 getlocal_WC_0                          a@0                       (   3)[Li]
0010 splatarray                             true
0012 putobject_INT2FIX_1_
0013 putspecialobject                       1
0015 newhash                                0
0017 getlocal_WC_0                          kw@1
0019 opt_send_without_block                 <calldata!mid:core#hash_merge_kwd, argc:2, ARGS_SIMPLE>
0021 newarraykwsplat                        2
0023 concattoarray
0024 leave
```

New Instructions:

```
0000 newarray                               0                         (   1)[Li]
0002 setlocal_WC_0                          a@0
0004 newhash                                0                         (   2)[Li]
0006 setlocal_WC_0                          kw@1
0008 getlocal_WC_0                          a@0                       (   3)[Li]
0010 splatarray                             true
0012 putobject_INT2FIX_1_
0013 pushtoarray                            1
0015 putspecialobject                       1
0017 newhash                                0
0019 getlocal_WC_0                          kw@1
0021 opt_send_without_block                 <calldata!mid:core#hash_merge_kwd, argc:2, ARGS_SIMPLE>
0023 pushtoarraykwsplat
0024 leave
```

pushtoarraykwsplat is designed to be simpler than newarraykwsplat.
It does not take a variable number of arguments from the stack, it
pops the top of the stack, and appends it to the second from the top,
unless the top of the stack is an empty hash.

During this work, I found the ARGSPUSH followed by HASH with keyword
did not compile correctly, as it pushed the generated hash to the
array even if the hash was empty.  This fixes the behavior, to use
pushtoarraykwsplat instead of pushtoarray in that case:

```ruby
a = []
kw = {}
[*a, **kw]

[{}] # Before

[] # After
```

This does not remove the newarraykwsplat instruction, as it is still
referenced in the prism compiler (which should be updated similar
to this), YJIT (only in the bindings, it does not appear to be
implemented), and RJIT (in a couple comments).  After those are
updated, the newarraykwsplat instruction should be removed.
2024-02-20 10:47:44 -08:00
Alan Wu 2e2e3d89af
YJIT: Support `**nil` for cfuncs
Similar to the iseq call support. Fairly straight forward.
2024-02-20 18:29:02 +00:00
Takashi Kokubun c0e5de9567 Fix the version in missing-baseruby 2024-02-20 09:13:36 -08:00
Peter Zhu c184aa8740 Use rb_gc_mark_and_move for imemo 2024-02-20 10:39:30 -05:00
Kevin Newton 20f03100d5 [ruby/prism] Fix eval encoding switching to UTF-8
https://github.com/ruby/prism/commit/24e3ff5d6d
2024-02-20 15:36:35 +00:00
Nobuyoshi Nakada 835fa98a62 Update warning flags before dump 2024-02-20 23:56:07 +09:00
Kevin Newton bcfcdae58e [ruby/prism] Fix windows build checking for _POSIX_MAPPED_FILES
https://github.com/ruby/prism/commit/acf603603f
2024-02-20 14:31:03 +00:00
HASUMI Hitoshi f0a46c6334 [ruby/prism] Include unistd.h before cheching _POSIX_MAPPED_FILES
https://github.com/ruby/prism/commit/84b3c294f0
2024-02-20 14:21:17 +00:00
HASUMI Hitoshi 15b53e901c [ruby/prism] Use `_POSIX_MAPPED_FILES` and `_WIN32` to know if memory map interface is available in the target platform
https://github.com/ruby/prism/commit/88e2ff52d4
2024-02-20 14:21:16 +00:00
Hiroshi SHIBATA c22cb960cf
Use commit with Ruby 3.4 support 2024-02-20 20:52:09 +09:00
Nobuyoshi Nakada 386b956ad8
Remove never used method 2024-02-20 20:14:37 +09:00
Nobuyoshi Nakada e3917fc7da
Remove no longer used methods
`find_object_in_recycled_slot` and `memory_location` have not been
used since commit:b99833baec2e567e38758f4fd017c90c7ce57d75.
2024-02-20 20:14:37 +09:00
yui-knk 7cb8fd7800 Move ripper_validate_object to ripper_init.c.tmpl 2024-02-20 19:19:31 +09:00
Hiroshi SHIBATA fa3d6aafb7 [ruby/uri] Use https instead of http
https://github.com/ruby/uri/commit/ad2591f0d1
2024-02-20 10:13:30 +00:00
yui-knk 474f41880f Suppress unused function warning for UNIVERSAL_PARSER build
Suppress the warning:

```
parse.y:2221:1: warning: unused function 'rb_parser_str_hash' [-Wunused-function]
 2221 | rb_parser_str_hash(rb_parser_string_t *str)
      | ^~~~~~~~~~~~~~~~~~
```
2024-02-20 19:07:40 +09:00
S-H-GAMELINKS fba647087b Remove uneeded Universal Parser properties 2024-02-20 19:02:24 +09:00
yui-knk 2a4b6ed37c Workaround for `Prism::ParseTest#test_filepath` for "unparser/corpus/literal/def.txt"
See the discussion on https://github.com/ruby/ruby/pull/9923
2024-02-20 17:33:58 +09:00