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

77527 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 165ef42b3c
* append newline at EOF. [ci skip] 2023-04-17 22:34:20 +09:00
Jean Boussier f3979aec76 Add spec for `Warning[:performance]`
[Feature #19538]
2023-04-17 10:29:46 +02:00
Peter Zhu a0d1069e03 Make classes embedded on 32 bit
Classes are now exactly 80 bytes when embedded, which perfectly fits the
3rd size pool on 32 bit systems.
2023-04-16 11:06:31 -04:00
Peter Zhu 24b137336b Move shape ID to flags for classes on 32 bit
Moves shape ID to FL_USER4 to FL_USER19 for the shape ID on 32 bit
systems. This makes the rb_classext_struct smaller so that it can be
embedded.
2023-04-16 11:06:31 -04:00
Peter Zhu d7bb7e70cc Change RMODULE_ALLOCATED_BUT_NOT_INITIALIZED
RCLASS_CLONED no longer uses FL_USER1, so we can make
RMODULE_ALLOCATED_BUT_NOT_INITIALIZED use FL_USER1.
2023-04-16 11:06:31 -04:00
Peter Zhu ad3d4e87d7 Move RCLASS_CLONED to rb_classext_struct
This commit moves RCLASS_CLONED from the flags to the
rb_classext_struct. This frees the FL_USER1 bit.
2023-04-16 11:06:31 -04:00
Nobuyoshi Nakada fac814c2dc
Fix `PLATFORM_GET_INC`
On platforms where unaligned word access is not allowed, and if
`sizeof(val)` and `sizeof(type)` differ:

- `val` > `type`, `val` will be a garbage.
- `val` < `type`, outside `val` will be clobbered.
2023-04-16 17:45:27 +09:00
Koichi Sasada 29e01c6f5f skip if `DidYouMean.formatter=` is not defined
ruby/test_default_gems.rb can define empty `DidYouMean` module
because of the following line (second require) in the
`lib/did_you_mean/did_you_mean.gemspec`:

```ruby
begin
  require_relative "lib/did_you_mean/version"
rescue LoadError # Fallback to load version file in ruby core repository
  require_relative "version"
end
```

It defines only `::DidYouMean::VERSION`.

However, in the `test/ruby/test_patten_matching.rb` assumes that
if `defined?(DidYouMean)` is true, then there is a method `DidYouMean.formatter=`
and this assumption fails all tests in `test/ruby/test_patten_matching.rb` if
there is only a `::DidYouMean::VERSION`.

To reproduce the failures, we need to repeat the following command:

`make test-all TESTS='-v ruby/test_default_gems.rb ruby/pattern_matching'`

(because the ruby/test_default_gems.rb should be run before the ruby/pattern_matching`)

This patch introduces more strict gurds.
2023-04-16 09:26:56 +09:00
Jean Boussier 52449b5b75 Implement ObjectSpace::WeakMap#delete and ObjectSpace::WeakKeyMap#delete
[Feature #19561]

It's useful to be able to remove references from weak maps.
2023-04-15 16:29:46 +02:00
Benoit Daloze 4dc2e5a850
Fix packed_data.rdoc 2023-04-15 16:09:04 +02:00
tomoya ishida 19aa30d5d5 [ruby/reline] Change Reline.add_dialog_proc(name, nil) to properly
remove dialog_proc
(https://github.com/ruby/reline/pull/532)

https://github.com/ruby/reline/commit/43283b2f37
2023-04-15 09:32:05 +00:00
Nobuyoshi Nakada 34f484d233
fake.rb should depend on revision.h [ci skip] 2023-04-15 12:44:08 +09:00
Nobuyoshi Nakada 607cd24128
Adjust function style [ci skip] 2023-04-15 11:50:54 +09:00
Nobuyoshi Nakada 5944a31614
[DOC] Update sample callback of `rb_objspace_each_objects`
* refine liveness check
* fix missing closing brace
2023-04-15 11:48:11 +09:00
git 9a1c737dee * append newline at EOF. [ci skip] 2023-04-15 00:10:49 +00:00
Jean Boussier a1db5ecd93 Add specs for ObjectSpace::WeakKeyMap
[Feature #18498]
2023-04-15 02:10:38 +02:00
Takashi Kokubun 45c6b58768
YJIT: Add a counter to all side exits (#7720) 2023-04-14 19:49:44 -04:00
Alan Wu 87c7de55e0 RJIT: Skip a YJIT test
Despite applying a fix to RJIT similar to the YJIT fix, this test still
crashes RJIT.
2023-04-14 18:01:14 -04:00
Alan Wu 0b95cbcbde YJIT: Remove duplicate `asm.spill_temps()`
`jit_prepare_routine_call()` calls it, and there is another call above on line 2302.

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-04-14 18:01:14 -04:00
Alan Wu 31e67a476f YJIT: Fix false object collection when setting ivar
Previously, setinstancevariable could generate code that calls
`rb_ensure_iv_list_size()` without first updating `cfp->sp`. This means
in the event that a GC start from within said routine the top few
objects would not be marked, causing them to be falsly collected.

Call `jit_prepare_routine_call()` first.

[Bug #19601]
2023-04-14 18:01:14 -04:00
Takashi Kokubun 4501fb8b46
YJIT: Introduce Target::SideExit (#7712)
* YJIT: Introduce Target::SideExit

* YJIT: Obviate Insn::SideExitContext

* YJIT: Avoid cloning a Context for each insn
2023-04-14 17:00:10 -04:00
Jimmy Miller d83e59e6b8
YJIT: Change to Option<CodegenStatus> (#7717) 2023-04-14 14:21:29 -04:00
Jean Boussier 6c1b604e29 Revert "Add specs for ObjectSpace::WeakKeyMap"
This reverts commit fce8f9f24e.
2023-04-14 10:07:33 +02:00
Jean Boussier fce8f9f24e Add specs for ObjectSpace::WeakKeyMap
[Feature #18498]
2023-04-14 09:57:04 +02:00
Jean Boussier 6a5c355e4e Add RB_WARN_CATEGORY_DEFAULT_BITS
Followup: ac123f167a

RB_WARN_CATEGORY_ALL_BITS is exposed in a public header, so it
makes sense for it to be updated to contain all valid bits.

Instead we introduce RB_WARN_CATEGORY_DEFAULT_BITS to list the
categories that are enabled by default.
2023-04-14 09:46:10 +02:00
git 07428e7277 Update default gems list at 67743d5823 [ci skip] 2023-04-14 06:39:44 +00:00
Sutou Kouhei 67743d5823 [ruby/stringio] Development of 3.0.7 started.
https://github.com/ruby/stringio/commit/5d39880f70
2023-04-14 06:38:51 +00:00
Nobuyoshi Nakada eab1f1ef18
Avoid diffutils 3.8 bug#61193 [ci skip] 2023-04-14 13:51:59 +09:00
Hiroshi SHIBATA 3733ee835b [ruby/readline-ext] Expose Readline::GEM_VERSION
https://github.com/ruby/readline-ext/commit/70aa84b80e
2023-04-14 03:43:46 +00:00
Hiroshi SHIBATA 283c190374 [ruby/nkf] Expose NKF::GEM_VERSION
https://github.com/ruby/nkf/commit/0d0fb3a162
2023-04-14 03:43:17 +00:00
Hiroshi SHIBATA 8a06f1a69f [ruby/pathname] Expose Pathname::VERSION
https://github.com/ruby/pathname/commit/2b0b1a82ee
2023-04-14 12:42:36 +09:00
dependabot[bot] 389ea0ae4c Bump actions/checkout from 3.5.0 to 3.5.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8f4b7f8486...8e5e7e5ab8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-14 12:39:49 +09:00
Jeremy Evans 1f115f141d Speed up rebuilding the loaded feature index
Rebuilding the loaded feature index slowed down with the bug fix
for #17885 in 79a4484a07.  The
slowdown was extreme if realpath emulation was used, but even when
not emulated, it could be about 10x slower.

This adds loaded_features_realpath_map to rb_vm_struct. This is a
hidden hash mapping loaded feature paths to realpaths. When
rebuilding the loaded feature index, look at this hash to get
cached realpath values, and skip calling rb_check_realpath if a
cached value is found.

Fixes [Bug #19246]
2023-04-13 20:22:36 -07:00
Hiroshi SHIBATA 6beb755d81 [ruby/prettyprint] Expose PrettyPrint::VERSION
https://github.com/ruby/prettyprint/commit/c6f3947e96
2023-04-14 01:52:08 +00:00
Hiroshi SHIBATA 3f8756484f [ruby/pp] Expose PP::VERSION
https://github.com/ruby/pp/commit/3d0e65e79f
2023-04-14 01:49:51 +00:00
Hiroshi SHIBATA 652f273308 [ruby/resolv] Expose Resolv::VERSION
https://github.com/ruby/resolv/commit/6ab2385e89
2023-04-14 01:46:38 +00:00
Hiroshi SHIBATA ebe620def6 [ruby/securerandom] Expose SecureRandom::VERSION
https://github.com/ruby/securerandom/commit/2e6434331d
2023-04-14 01:43:47 +00:00
Nobuyoshi Nakada 60f22ebf86 [Bug #19533] Add spec of infinite range inclusion 2023-04-14 10:22:09 +09:00
Nobuyoshi Nakada fb17c833f5 [Bug #19533] Fix infinite range inclusion with numeric value 2023-04-14 10:22:09 +09:00
Nobuyoshi Nakada 1a149aab77 Extract range type check functions 2023-04-14 10:22:09 +09:00
Takashi Kokubun 8286eed20b Allow testing a different version 2023-04-13 17:53:41 -07:00
Jimmy Miller 08413f982c
YJIT: Add support for rest with option and splat args (#7698) 2023-04-13 16:21:02 -07:00
Peter Zhu f7d41b9d7b Fix compiler warning with compiling on 32 bit
Fixes this compiler warning:

    vsnprintf.c:1074:43: warning: 'uqval' may be used uninitialized in this function [-Wmaybe-uninitialized]
2023-04-13 16:44:01 -04:00
John Hawthorn acc5c74648
YJIT: Fix edge and total counts in exit_locations (#7702)
The stackprof-format raw samples are suffixed with a count (ie. how many
times did the previously recorded side-exit repeat). Previously we were
correctly using this value to increment the :samples count, but not the
:total_samples count or edges.

This made the stackprof aggregate results incorrect (though any
flamegraphs generated should have been correct, since those only rely on
raw samples).
2023-04-13 14:37:37 -04:00
Takashi Kokubun bbe69fba59
YJIT: Use an enum to represent counters (#7701) 2023-04-13 13:54:09 -04:00
Takashi Kokubun 2fcd3ea6d8
YJIT: Move stack_opnd from Context to Assembler (#7700) 2023-04-13 12:20:29 -04:00
Alan Wu 847813ab13
[DOC] common.mk deals with various `make` varieties 2023-04-13 11:02:09 -04:00
Jean Boussier ac123f167a Emit a performance warning when a class reached max variations
[Feature #19538]

This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
2023-04-13 16:36:17 +02:00
Adam Hess 854baee2c9
YJIT: Add a sampling option to exit tracing (#7693)
Add a sampling option to trace exits

Running YJIT with trace exits enabled can make very large metrics files.
This allows us to configure a sample rate to make tracing exits possible
on larger tests. This also updates the documented YJIT options.

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: John Hawthorn <john@hawthorn.email>
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2023-04-13 10:07:07 -04:00
Peter Zhu 02a7e12b80 Ensure throw data is not set as cause
[Bug #19593]

rb_ec_setup_exception did not check if errinfo is a throw_data. This can
cause crashes in code since it is assumed that id_cause is an object.

We saw a crash in show_cause due to id_cause of errinfo being a
throw_data. It crashes on rb_obj_is_kind_of since it cannot be called on
T_IMEMO objects.

Unfortunately, we couldn't find a reproduction script, however we
debugged the core dump and rb_ec_setup_exception is the only place where
id_cause is assigned from errinfo without checking if it is a
throw_data.

```
0x0000556c5708e6dd in sigsegv (sig=11, info=0x7f301befa3f0, ctx=0x7f301befa2c0) at signal.c:964
0x00007f301d046420 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
class_search_class_ancestor (c=139844586301760, cl=<optimized out>) at object.c:810
rb_obj_is_kind_of (obj=obj@entry=139839221734880, c=139844586301760) at object.c:861
0x0000556c56f2f00f in show_cause
    (errinfo=errinfo@entry=139838840645160, str=str@entry=139839221730520, opt=139839221730480, highlight=0, reverse=reverse@entry=0, backtrace_limit=backtrace_limit@entry=-1, shown_causes=0x7ffe9d1a2d68) at ./include/ruby/internal/special_consts.h:175
```

Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-04-13 08:38:35 -04:00