75261 Commits

Author SHA1 Message Date
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
Jemma Issroff
c1ab6ddc9a Transition complex objects to "too complex" shape
When an object becomes "too complex" (in other words it has too many
variations in the shape tree), we transition it to use a "too complex"
shape and use a hash for storing instance variables.

Without this patch, there were rare cases where shape tree growth could
"explode" and cause performance degradation on what would otherwise have
been cached fast paths.

This patch puts a limit on shape tree growth, and gracefully degrades in
the rare case where there could be a factorial growth in the shape tree.

For example:

```ruby
class NG; end

HUGE_NUMBER.times do
  NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1)
end
```

We consider objects to be "too complex" when the object's class has more
than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and
the object introduces a new variation (a new leaf node) associated with
that class.

For example, new variations on instances of the following class would be
considered "too complex" because those instances create more than 8
leaves in the shape tree:

```ruby
class Foo; end
9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) }
```

However, the following class is *not* too complex because it only has
one leaf in the shape tree:

```ruby
class Foo
  def initialize
    @a = @b = @c = @d = @e = @f = @g = @h = @i = nil
  end
end
9.times { Foo.new }
``

This case is rare, so we don't expect this change to impact performance
of most applications, but it needs to be handled.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-12-15 10:06:04 -08:00
Jemma Issroff
a3d552aedd Add variation_count on classes
Count how many "variations" each class creates. A "variation" is a a
unique ordering of instance variables on a particular class. This can
also be thought of as a branch in the shape tree.

For example, the following Foo class will have 2 variations:

```ruby
class Foo ; end

Foo.new.instance_variable_set(:@a, 1) # case 1: creates one variation
Foo.new.instance_variable_set(:@b, 1) # case 2: creates another variation

foo = Foo.new
foo.instance_variable_set(:@a, 1) # does not create a new variation
foo.instance_variable_set(:@b, 1) # does not create a new variation (a continuation of the variation in case 1)
```

We will use this number to limit the amount of shapes that a class can
create and fallback to using a hash iv lookup.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2022-12-15 10:06:04 -08:00
Peter Zhu
f50aa19da6 Revert "Fix Object Movement allocation in GC"
This reverts commit 9c54466e299aa91af225bc2d92a3d7755730948f.

We're seeing crashes in Shopify CI after this commit.
2022-12-15 12:00:30 -05:00
Matt Valentine-House
9c54466e29 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 09:04:30 -05:00
git
723cca6d82 Update bundled gems list at e3ed6c07832edf2a95bae3bdd908cc [ci skip] 2022-12-15 13:20:17 +00:00
Kazuhiro NISHIYAMA
e3ed6c0783
Update bundled_gems 2022-12-15 22:18:52 +09:00
Hiroshi SHIBATA
49b0f3b024 Merge RubyGems/Bundler master
Pick from 084f7d1f21
2022-12-15 19:06:40 +09:00
Shugo Maeda
2581de112c Disallow mixed usage of ... and */**
[Feature #19134]
2022-12-15 18:56:24 +09:00
Nobuyoshi Nakada
613fca0148 [Bug #19189] Fallback to the default "pkg-config" 2022-12-15 11:00:42 +09:00
Samuel Williams
d20bd06a97
Remove require 'io/wait' where it's no longer necessary. (#6932)
* Remove `require 'io/wait'` as it's part of core now.

* Update ruby specs using version gates.

* Add note about why it's conditional.
2022-12-15 11:37:01 +13:00
Burdette Lamar
55f56eb66e [ruby/net-http] [DOC] New doc for responses classes
(https://github.com/ruby/net-http/pull/91)

https://github.com/ruby/net-http/commit/d394404402
2022-12-14 22:13:28 +00:00
Burdette Lamar
d2b87456f0 [ruby/net-http] [DOC] Correct formatting in header.rb
(https://github.com/ruby/net-http/pull/90)

https://github.com/ruby/net-http/commit/d9d829ca53
2022-12-14 21:34:12 +00:00
Alan Wu
693c01d509 YJIT: Remove duplicate call to jit_prepare_routine_call()
It's idempotent.
2022-12-14 16:17:46 -05:00
Peter Zhu
7a63114f8e Remove dead code in get_next_shape_internal
If the rb_id_table_lookup fails, then res is not updated so it cannot be
any value other than null.
2022-12-14 13:21:46 -05:00
Nobuyoshi Nakada
71dd8b3caa
socket.rb - simplify check for the method 2022-12-15 00:27:47 +09:00
NARUSE, Yui
9eb19a02ae Add more comments why CRuby uses __pioinfo 2022-12-15 00:14:00 +09:00
Jean Boussier
1df6d0e578 objspace_dump.c: don't dump class of T_IMEMO
They don't actually have a class.
2022-12-14 15:53:41 +01:00
Peter Zhu
cca54c8b1b [ci skip] Add entry to NEWS.md about VWA 2022-12-14 08:56:19 -05:00
Burdette Lamar
3e5f8b2af3 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/89)

https://github.com/ruby/net-http/commit/86b84eb307
2022-12-14 13:55:06 +00:00