75280 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
49dc424ff3 [ruby/date] Remove extz_pats table
https://github.com/ruby/date/commit/945e26e243
2022-12-18 02:58:49 +00:00
Nobuyoshi Nakada
70c905963e [ruby/date] Remove merid_names table
https://github.com/ruby/date/commit/7fe2bd5f94
2022-12-18 02:58:48 +00:00
Nobuyoshi Nakada
6efeaabef0 [ruby/date] Match abbreviated day and month names with head of full names
https://github.com/ruby/date/commit/a45f8f03c9
2022-12-18 02:58:47 +00:00
John Hawthorn
ea3d3c4552 Use FL_TEST_RAW in rb_hash_default_value
We should always have a T_HASH here, so we can use FL_TEST_RAW to avoid
checking whether we may have an immediate value.

I expect this to be a very small performance improvement (perf stat
./miniruby benchmark/hash_aref_miss.rb shows a ~1% improvement). It also
removes 9 instructions from rb_hash_default_value on x86_64.
2022-12-17 14:51:49 -08:00
John Hawthorn
fbaa5db44a Use a BOP for Hash#default
On a hash miss we need to call default if it is redefined in order to
return the default value to be used. Previously we checked this with
rb_method_basic_definition_p, which avoids the method call but requires
a method lookup.

This commit replaces the previous check with BASIC_OP_UNREDEFINED_P and
a new BOP_DEFAULT. We still need to fall back to
rb_method_basic_definition_p when called on a subclasss of hash.

    |                |compare-ruby|built-ruby|
    |:---------------|-----------:|---------:|
    |hash_aref_miss  |       2.692|     3.531|
    |                |           -|     1.31x|

Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Co-authored-by: "Ian C. Anderson" <ian@iancanderson.com>
Co-authored-by: Jack McCracken <me@jackmc.xyz>
2022-12-17 14:51:49 -08:00
Mau Magnaguagno
632beec01f
MJIT: Refactor BitField dereference byte and bitmask (#6955)
Prefer Array#unpack1 and Enumerable#sum.
I think the bitmask formula ``2 ** @width - 1`` would be clearer, but not faster for such small integers.
2022-12-17 13:06:50 -08:00
Peter Zhu
6e3bc67103 Hard crash when allocating in GC when RUBY_DEBUG
Not all builds have RGENGC_CHECK_MODE set, so it should also crash when
RUBY_DEBUG is set.
2022-12-17 09:18:54 -05:00
Peter Zhu
965f4259db Move check for GC to xmalloc and xcalloc
Moves the check earlier to before we actually perform the allocation.
2022-12-17 09:16:26 -05:00
Samuel Williams
9da5a7e79d
Add tests for Queue#pop with fiber scheduler. (#6953) 2022-12-17 20:43:21 +13:00
Jemma Issroff
297df92407 Clean up Ruby Shape API
Make printing shapes better, use a struct instead of specific methods
for each field on a shape.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-12-16 13:27:45 -05:00
Peter Zhu
2ccf6e5394 Don't allow allocating memory during GC
Allocating memory (xmalloc and xrealloc) during GC could cause GC to
trigger, which would crash with `[BUG] during_gc != 0`. This is an
intermittent bug which could be hard to debug.

This commit changes it so that any memory allocation during GC will
emit a warning. When debug flags are enabled it will also cause a crash.
2022-12-16 10:01:53 -05:00
Nobuyoshi Nakada
3d2eb7c9a6 [Feature #18033] [DOC] Add NEWS 2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
3e49d62bc1 [Feature #18033] Parse more strictly conformant with ISO-8601
* 4-digits or more is required as year
* Minutes and seconds parts are not ommittable
2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
635fc5f7fc [Feature #18033] Make more conformant with C standard 2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
9515179d74 [Feature #18033] Add precision: option
Which limits the precision of subsecond. Defaulted to 9, that
means nanosecond.
2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
67c589afa0 [Feature #18033] More strict checks 2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
0a2f300a8a [Feature #18033] Name a magic number 2022-12-16 22:52:59 +09:00
Nobuyoshi Nakada
8c272f4481 [Feature #18033] Make Time.new parse time strings
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
2022-12-16 22:52:59 +09:00
Yusuke Endoh
ee7a338d2b Unconditionally warn "unknown pack/unpack directive"
[Bug #19150]
2022-12-16 12:15:50 +01:00
Yusuke Endoh
b9ea83fc1c Update NEWS.md
Regexp optimization and Wasm support are added.
2022-12-16 02:21:50 +09:00
Hiroshi SHIBATA
f2690be746
Removed temporary workaround for syntax_suggest tags 2022-12-16 15:48:00 +09:00
git
850661dd6d Update default gems list at 11f3bef260258c4c8a05ea35ab3bf8 [ci skip] 2022-12-16 06:36:43 +00:00
Hiroshi SHIBATA
11f3bef260 [ruby/date] Bump version to 3.3.2
https://github.com/ruby/date/commit/7afd9d4615
2022-12-16 06:36:03 +00:00
git
5983df93d4 Update default gems list at 2cd22f9abd2e759a94452b54408a68 [ci skip] 2022-12-16 06:35:45 +00:00
Hiroshi SHIBATA
2cd22f9abd [ruby/logger] Bump version to 1.5.3
https://github.com/ruby/logger/commit/4e8d9e27fd
2022-12-16 06:34:47 +00:00
Hiroshi SHIBATA
5e5f3f6bd1
Followed up ad18d1297ed82aa9c38375532b0b709131cf1ae7 with tool/update-deps --fix 2022-12-16 13:59:04 +09:00
Akinori MUSHA
ad18d1297e Reject keyword arguments given to Enumerator::Product.new
The use of keyword arguments should be reserved for future extension.
2022-12-16 13:32:13 +09:00
git
29cb767a1c Update default gems list at d95ee114621c3cd34b4a34233888bb [ci skip] 2022-12-16 03:53:18 +00:00
Hiroshi SHIBATA
d95ee11462 [ruby/io-console] Bump version to 0.6.0
https://github.com/ruby/io-console/commit/441528e3eb
2022-12-16 03:45:11 +00:00
git
bb78445695 Update default gems list at 7e26ff7dc008ce14e34b43b8ee04a7 [ci skip] 2022-12-16 02:37:02 +00:00
Hiroshi SHIBATA
7e26ff7dc0 [ruby/io-wait] Bump version to 0.3.0
https://github.com/ruby/io-wait/commit/940ba319d3
2022-12-16 02:36:21 +00:00
Koichi Sasada
dbf77d420d surpress warning
now `enc_table->list` is not a pointer.
2022-12-16 11:12:37 +09:00
Hiroshi SHIBATA
d6624db926 [ruby/irb] Prefer to use File.open instead of Kernel.open
https://github.com/ruby/irb/commit/ed9e435a6b
2022-12-16 01:10:46 +00:00
Koichi Sasada
ae19ac5b5b fixed encoding table
This reduces global lock acquiring for reading.
https://bugs.ruby-lang.org/issues/18949
2022-12-16 10:04:37 +09:00
Hiroshi SHIBATA
15b60bb1a4
Mentioned https://bugs.ruby-lang.org/issues/17767 on NEWS.md 2022-12-16 09:13:35 +09:00
Takashi Kokubun
5ca46399f1
Add NEWS entries about CGI and ERB [ci skip] 2022-12-15 16:02:27 -08:00
Alan Wu
14158f1f8c
YJIT: Fix obj.send(:call)
All the method call types need to handle argument shifting in case they're
called by `.send`, and we weren't handling that in `OPTIMIZED_METHOD_TYPE_CALL`.

Lack of shifting caused the stack size assertion in gen_leave() to fail.

Discovered by Rails CI: https://buildkite.com/rails/rails/builds/91705#018516c4-f8f8-469e-bc2d-ddeb25ca8317/1920-2067
Diagnosed with help from `@eileencodes` and `@k0kubun`.
2022-12-15 18:10:28 -05:00
Jemma Issroff
e9ba3042e1 Indicate if a shape is too_complex in ObjectSpace#dump 2022-12-15 13:41:47 -08:00
Peter Zhu
c505448cdb Move definition of SIZE_POOL_COUNT back to gc.h
SIZE_POOL_COUNT is a GC macro, it should belong in gc.h and not shape.h.
SIZE_POOL_COUNT doesn't depend on shape.h so we can have shape.h depend
on gc.h.

Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2022-12-15 16:33:46 -05:00
BurdetteLamar
d5eafaed81 [ruby/net-http] Enhanced RDoc for Net::HTTP
https://github.com/ruby/net-http/commit/da626e4e42
2022-12-15 21:33:19 +00:00
Takashi Kokubun
4872e8ef14
Improve Struct NEWS [ci skip]
I meant to commit diff, but it was left uncommitted locally.
2022-12-15 13:06:29 -08:00
Peter Zhu
5e81cf8fd0 Refactor to only attempt to move movable objects
Moves check for gc_is_moveable_obj from try_move to gc_compact_plane.

Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
2022-12-15 15:27:38 -05:00
Matt Valentine-House
bfc66e07b7 Fix Object Movement allocation in GC
When moving Objects between size pools we have to assign a new shape.

This happened during updating references - we tried to create a new shape
tree that mirrored the existing tree, but based on the root shape of the
new size pool.

This causes allocations to happen if the new tree doesn't already exist,
potentially triggering a GC, during GC.

This commit changes object movement to look for a pre-existing new tree
during object movement, and if that tree does not exist, we don't move
the object to the new pool.

This allows us to remove the shape allocation from update references.

Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2022-12-15 15:27:38 -05:00
Alan Wu
5fa608ed79
YJIT: Fix code GC freeing stubs with a trampoline (#6937)
Stubs we generate for invalidation don't necessarily co-locate with the
code that jump to the stub. Since we rely on co-location to keep stubs
alive as they are in the outlined code block, it used to be possible for
code GC inside branch_stub_hit() to free the stub that's its direct
caller, leading us to return to freed code after.

Stubs used to look like:

```
mov arg0, branch_ptr
mov arg1, target_idx
mov arg2, ec
call branch_stub_hit
jmp return_reg
```

Since the call and the jump after the call is the same for all stubs, we
can extract them and use a static trampoline for them. That makes
branch_stub_hit() always return to static code. Stubs now look like:

```
mov arg0, branch_ptr
mov arg1, target_idx
jmp trampoline
```

Where the trampoline is:

```
mov arg2, ec
call branch_stub_hit
jmp return_reg
```

Code GC can now free stubs without problems since we'll always return
to the trampoline, which we generate once on boot and lives forever.

This might save a small bit of memory due to factoring out the static
part of stubs, but it's probably minor.

[Bug #19234]

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2022-12-15 15:10:14 -05:00
Takashi Kokubun
53db8fb450
Add Struct examples to NEWS [ci skip] 2022-12-15 11:54:12 -08:00
Takashi Kokubun
2ae0e27a69
Add Data.define examples to NEWS [ci skip] 2022-12-15 11:49:59 -08:00
Jemma Issroff
c0b14e128f Update NEWS.md to include shapes and gc bitmap marking 2022-12-15 11:46:55 -08:00
Takashi Kokubun
8b0e44214c
Fix missing variables
It was a bad copy-paste.
2022-12-15 10:45:41 -08:00
Takashi Kokubun
e25beac145
Enable Slack notifications on more Actions
auto_request_review, codeql-analysis, scorecards don't have it either,
but those are intentional.
2022-12-15 10:43:21 -08:00
Takashi Kokubun
ef008d8946
Partially revert "Update bundled_gems"
This reverts the net-imap upgrade of commit e3ed6c07832edf2a95bae3bdd908cc3f5b65eebe.
net-imap tests of test-bundled-gems seem to be broken
https://github.com/ruby/ruby/actions/runs/3704473689/jobs/6277145052.
2022-12-15 10:08:11 -08:00