72275 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
2c19086323
Suppress code unused unless GC_CAN_COMPILE_COMPACTION 2022-06-17 10:47:16 +09:00
Alan Wu
e46292197f Fix spec version guard
Follow up for 278fefb96294adf9d27a78f919c714a31b65ef58
2022-06-16 16:34:14 -04:00
John Hawthorn
ae163cae6b Allow calling protected methods from refinements
Previously protected methods on refinements could never be called
because they were seen as being "defined" on the hidden refinement
ICLASS.

This commit updates calling refined protected methods so that they are
considered to be defined on the original class (the one being refined).

This ended up using the same behaviour that was used to check whether a
call to super was allowed, so I extracted that into a method.

[Bug #18806]
2022-06-16 13:24:48 -07:00
Nobuyoshi Nakada
cd5cafa4a3 Respect the encoding of the source [Bug #18827]
Do not override the input string encoding at the time of preparation,
the source encoding is not determined from the input yet.
2022-06-17 01:48:52 +09:00
Nobuyoshi Nakada
278fefb962 ENV.merge! support multile arguments [Feature #18279] 2022-06-17 01:22:24 +09:00
Jemma Issroff
51835135a0 Added tests for setting ivars on frozen objs 2022-06-16 08:48:08 -07:00
Jemma Issroff
c49fde351f Adding more clone tests, and adding dup tests 2022-06-16 08:48:08 -07:00
git
cfe9c24db4 * 2022-06-17 [ci skip] 2022-06-17 00:47:33 +09:00
Jemma Issroff
af425b6d66 Added vm_ivar benchmark for initializing an embedded obj 2022-06-16 08:47:19 -07:00
Burdette Lamar
0ab2bca11c [ruby/fileutils] [DOC] Small tweaks (https://github.com/ruby/fileutils/pull/89)
https://github.com/ruby/fileutils/commit/13ab96439b
2022-06-16 23:56:37 +09:00
Shishir Joshi
c310691dd8 [ruby/net-http] Make Net::HTTPHeader#content_range return nil on non-byte units
* Returning nil from the `content_range` method instead of raising an
  error when the unit in the content-range header is not "bytes".

Fix https://bugs.ruby-lang.org/issues/11450

https://github.com/ruby/net-http/commit/0b5030dd86

Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-16 23:35:27 +09:00
Peter Zhu
79eaaf2d0b Include runtime checks for compaction support
Commit 0c36ba53192c5a0d245c9b626e4346a32d7d144e changed GC compaction
methods to not be implemented when not supported. However, that commit
only does compile time checks (which currently only checks for WASM),
but there are additional compaction support checks during run time.

This commit changes it so that GC compaction methods aren't defined
during run time if the platform does not support GC compaction.

[Bug #18829]
2022-06-16 10:18:46 -04:00
Peter Zhu
52d42e7023 Rename GC_COMPACTION_SUPPORTED
Naming this macro GC_COMPACTION_SUPPORTED is misleading because it
only checks whether compaction is supported at compile time.

[Bug #18829]
2022-06-16 10:18:46 -04:00
Nobuyoshi Nakada
2223eb082a
Revert "HTTPHeader.content_range throws error on non-byte units"
This reverts commit 63546bfc1581d4abec2a0d846106a1c0afc0efa9.
2022-06-16 22:10:59 +09:00
Nobuyoshi Nakada
1cc64a5514 [ruby/racc] Fix flag to Regexp.new
Probably intended to pass encoding "none".

https://github.com/ruby/racc/commit/65cd26efd8
2022-06-16 21:43:53 +09:00
Alan Wu
714a4942fd
Remove unused and accidentally public rb_str_shared_root_p()
This function was added to a public header in [1] probably
unintentionally since it's not used anywhere, exposes implementation
details, and isn't related to the goals of that pull request.

[1]: 56cc3e99b6b9ec004255280337f6b8353f5e5b06
2022-06-16 07:20:20 -04:00
Shishir Joshi
63546bfc15
HTTPHeader.content_range throws error on non-byte units
* Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value
* Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes
* Modified initialize_http_header to match trunk

fix [Bug #11450]
fix https://github.com/ruby/ruby/pull/1018
2022-06-16 20:16:47 +09:00
Takashi Kokubun
8ef312fc5b
MJIT: Consider compaction on CC failure 2022-06-16 00:47:16 -07:00
Takashi Kokubun
30ca4a8263
MJIT: Remove free_compiling_iseqs from mswin 2022-06-15 22:10:54 -07:00
Takashi Kokubun
b5079794fd
MJIT: Handle compaction units on stop_worker 2022-06-15 22:09:38 -07:00
Takashi Kokubun
66f0ce34f1
MJIT: Get rid of obsoleted compiling_iseqs 2022-06-15 21:58:00 -07:00
Takashi Kokubun
1ffc6c43f6
MJIT: Deal with mjit_free_iseq on mjit_notify_waitpid 2022-06-15 21:32:30 -07:00
Takashi Kokubun
332985c178
MJIT: Fix test_jit_failure for mswin 2022-06-15 17:18:19 -07:00
Takashi Kokubun
15a6dd56e0
MJIT: Handle C compiler failures 2022-06-15 16:50:47 -07:00
John Hawthorn
17d260a87f Restore rb_exec_recursive_outer
This was a public method, so we should probably keep it.
2022-06-15 16:07:29 -07:00
Takashi Kokubun
5310147bb8
MJIT: Handle JIT failure properly 2022-06-15 15:57:30 -07:00
Burdette Lamar
1e8fed2d2a [ruby/fileutils] [DOC] More on paths and lists (https://github.com/ruby/fileutils/pull/88)
https://github.com/ruby/fileutils/commit/ba3ae2430d
2022-06-16 05:56:39 +09:00
Matt Valentine-House
9eabc57584 [ci skip] [lldb] Ensure rbbt has loaded the globals
rb_backtrace relies on the existend of RUBY_T_MASK. This is set up by
the global loading code in lldb_init()

rb_backtrace does not call lldb_init previously, and therefore would
only work if called after another lldb function that _did_ load the
globals.
2022-06-15 13:46:23 -07:00
Matt Valentine-House
acee714ce0 [ci skip] Print the rb_classext_t for a class, using an offset
Now that classes are using VWA, the RCLASS_PTR uses an offset to get the
rb_classext_t object. Doing this all the time in lldb is boring. So
script lldb to do it for us
2022-06-15 10:59:29 -07:00
Takashi Kokubun
a327ce8b07
Remove unused rb_thread_create_mjit_thread
follow up https://github.com/ruby/ruby/pull/6006
2022-06-15 10:57:38 -07:00
Takashi Kokubun
23459e4dbb
Move RubyVM::MJIT to builtin Ruby
just less C code to maintain
2022-06-15 10:52:37 -07:00
Takashi Kokubun
1162523bae
Remove MJIT worker thread (#6006)
[Misc #18830]
2022-06-15 09:40:54 -07:00
git
64fb3279d2 * 2022-06-16 [ci skip] 2022-06-16 01:04:32 +09:00
Jemma Issroff
d154d5d281 Add imemo types to global namespace in lldb helpers 2022-06-15 09:04:11 -07:00
Nobuyoshi Nakada
bb12aa4d15
Remove unnecessary condition
`no_blockarg` is called for non-null `node` only.
2022-06-15 22:17:23 +09:00
David Rodríguez
d417c1ddc5 [rubygems/rubygems] Revert "Support running specs with asdf version manager"
This reverts commit https://github.com/rubygems/rubygems/commit/4b2d09af5bc7.

https://github.com/rubygems/rubygems/commit/90ca7a7163
2022-06-15 21:10:55 +09:00
David Rodríguez
e09bdc11ec [rubygems/rubygems] Support running specs with asdf version manager
The `asdf-ruby` plugin sets `RUBYLIB` to require some code to reshim
after installing gems. This interferes with our specs.

Reset that, but leave any "internal" entries in places, because the
ruby-core test setup also uses RUBYLIB.

https://github.com/rubygems/rubygems/commit/4b2d09af5b
2022-06-15 18:14:21 +09:00
git
daf086c0e1 Update bundled gems list at 2022-06-15 2022-06-15 07:01:39 +00:00
Takashi Kokubun
46706e7808
MJIT: Add a test for Process.waitall handling 2022-06-14 22:42:09 -07:00
Burdette Lamar
788a5e14fa [ruby/fileutils] [DOC] More on cp_r (https://github.com/ruby/fileutils/pull/87)
* More on cp_r

https://github.com/ruby/fileutils/commit/82a2b62578
2022-06-15 05:42:26 +09:00
git
ab10f111c3 * 2022-06-15 [ci skip] 2022-06-15 01:06:06 +09:00
Alan Wu
9357e310fb [ruby/psych] Fix libyaml download failure rescue under miniruby
I tried to build Ruby on a system without libyaml today and realized
that my attempt from <https://github.com/ruby/psych/pull/557> doesn't
fix the error in <https://github.com/ruby/psych/issues/552>. I still got
the same `LoadError` from `digest` which stopped the build.

Since `LoadError` is not a `StandardError`, a plain `rescue` doesn't catch
it. Catch `LoadError` explicitly instead and reduce the scope of the
`begin` block.

I tested this change in a Ruby build on macOS without libyaml installed
and confirmed that `make` continues with a warning instead of aborting:

    *** Following extensions are not compiled:
    psych:
            Could not be configured. It will not be installed.
            ...

This should address <https://bugs.ruby-lang.org/issues/18790>.

https://github.com/ruby/psych/commit/251289ba83
2022-06-15 01:05:51 +09:00
Alan Wu
9f09397bfe
YJIT: On-demand executable memory allocation; faster boot (#5944)
This commit makes YJIT allocate memory for generated code gradually as
needed. Previously, YJIT allocates all the memory it needs on boot in
one go, leading to higher than necessary resident set size (RSS) and
time spent on boot initializing the memory with a large memset().

Users should no longer need to search for a magic number to pass to
`--yjit-exec-mem` since physical memory consumption should now more
accurately reflect the requirement of the workload.

YJIT now reserves a range of addresses on boot. This region start out
with no access permission at all so buggy attempts to jump to the region
crashes like before this change. To get this hardening at finer
granularity than the page size, we fill each page with trapping
instructions when we first allocate physical memory for the page.

Most of the time applications don't need 256 MiB of executable code, so
allocating on-demand ends up doing less total work than before. Case in
point, a simple `ruby --yjit-call-threshold=1 -eitself` takes about
half as long after this change. In terms of memory consumption, here is
a table to give a rough summary of the impact:

    | Peak RSS in MiB | -eitself example | railsbench once |
    | :-------------: | ---------------: | --------------: |
    |     before      |              265 |             377 |
    |      after      |               11 |             143 |
    |     no YJIT     |               10 |             101 |

A new module is introduced to handle allocation bookkeeping.
`CodePtr` is moved into the module since it has a close relationship
with the new `VirtualMemory` struct. This new interface has a slightly
smaller surface than before in that marking a region as writable is no
longer a public operation.
2022-06-14 10:23:13 -04:00
Burdette Lamar
9b9cc8ad34 [ruby/fileutils] [DOC] More on paths and lists (https://github.com/ruby/fileutils/pull/86)
* More on paths and lists

https://github.com/ruby/fileutils/commit/c3d92d34f4
2022-06-14 22:52:22 +09:00
Nobuyoshi Nakada
1a70973f75 ripper: Check if anonymous parameters defined [Bug #18828] 2022-06-14 20:41:41 +09:00
Nobuyoshi Nakada
048f14221c
Add placeholder to let braces match 2022-06-14 10:21:55 +09:00
Matt Valentine-House
56cc3e99b6 Move String RVALUES between pools
And re-embed any strings that can now fit inside the slot they've been
moved to
2022-06-13 10:11:27 -07:00
Takashi Kokubun
f8502a2699
Drop MinGW support of MJIT (#6012)
[Feature #18824]
2022-06-13 09:28:28 -07:00
git
c3ee80ff46 * 2022-06-14 [ci skip] 2022-06-14 00:39:59 +09:00
Burdette Lamar
9a381c240c [ruby/fileutils] [DOC] Clarify path arguments (https://github.com/ruby/fileutils/pull/85)
https://github.com/ruby/fileutils/commit/5f9ef9ddc8
2022-06-14 00:39:44 +09:00