Commit graph

88809 commits

Author SHA1 Message Date
Randy Stauner
1dd40ec18a
Optimize instructions when creating an array just to call include? (#12123)
* Add opt_duparray_send insn to skip the allocation on `#include?`

If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.

This adds a BOP for include? and tracks redefinition for it on Array.

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* YJIT: Implement opt_duparray_send include_p

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* Update opt_newarray_send to support simple forms of include?(arg)

Similar to opt_duparray_send but for non-static arrays.

* YJIT: Implement opt_newarray_send include_p

---------

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
2024-11-26 14:31:08 -05:00
tomoya ishida
c1dcd1d496 [ruby/reline] KeyStroke handles multibyte character
(https://github.com/ruby/reline/pull/713)

5a8da85f2b
2024-11-26 17:58:43 +00:00
tomoya ishida
def684508c [ruby/irb] Fix indentation of xstring literal
(https://github.com/ruby/irb/pull/1038)

Fixes indent calculation of this input
```
if false
p `ls`
end
```

4217a46f5d
2024-11-26 17:50:30 +00:00
Matt Valentine-House
c192d688d1 Add Modular GC and MMTk to NEWS 2024-11-26 11:59:33 +00:00
Jean Boussier
796d315958 Add NEWS.md entry about Hash.new(capacity:)
[Feature #19236]

Ref: https://github.com/ruby/ruby/pull/10357
2024-11-26 11:46:16 +01:00
Raed Rizqie
ffbfec394a [MinGW] - Fix NET_LUID check 2024-11-26 19:36:04 +09:00
Nobuyoshi Nakada
ad28f3a779 Remove Kernel.with_yjit class method 2024-11-26 19:25:25 +09:00
Nobuyoshi Nakada
9508cf86de Clear shared_gc directory 2024-11-26 19:06:21 +09:00
Nobuyoshi Nakada
d057503252 Use extmk.rb to configure shared GC
Since mkmf.rb is for extension libraries after installation, it cannot
work alone in build directory and needs to run from extmk.rb.
2024-11-26 19:06:21 +09:00
Nobuyoshi Nakada
9a5f6a45c6 Fix up gc/extconf_base.rb
- Add flags to appropriate variables.

- Use `append_cflags` to append a flag safely, instead of appending
  blindly.
2024-11-26 19:06:21 +09:00
Nobuyoshi Nakada
c5d31cb96b Shell dependent command should be in Makefile.in
As common.mk is used by nmake.exe, the commands there need to be
accepted also by cmd.exe.
2024-11-26 19:06:21 +09:00
Yusuke Endoh
16d98dc3c1 [ruby/uri] Suppress deprecate warning of test class (retry)
(https://github.com/ruby/uri/pull/140)

A follow-up to bd2e4be9d0

Also, leave a comment that the use of `URI::REGEXP` is intentional

bdf765e44a
2024-11-26 10:02:58 +00:00
Hiroshi SHIBATA
5471f284d2 Skip failing rbs tests with latest HEAD of ruby/json
```
NoMethodError: undefined method 'flush' for an instance of JsonWrite
```
2024-11-26 15:11:05 +09:00
David Rodríguez
2b91a56d40 [rubygems/rubygems] Remove no longer necessary code
9ea1539b08
2024-11-26 15:11:05 +09:00
David Rodríguez
10de74b75b [rubygems/rubygems] Avoid needing a second pass to ignore unlocked gems
When converging locked specifications to select the ones that should be
preserved while resolving, we can avoid having to do a second pass to
ignore the ones that have been explicitly unlocked.

411742703e
2024-11-26 15:11:05 +09:00
David Rodríguez
44ad2e3f38 [rubygems/rubygems] Allow some materialized specs to be missing
As long as some spec in the materialization is complete.

9a673b0bbb
2024-11-26 15:11:05 +09:00
David Rodríguez
36fb7994fe [rubygems/rubygems] Deprecate check parameter to Bundler::SpecSet#for
3041b3d784
2024-11-26 15:11:05 +09:00
David Rodríguez
c76b1ea2a6 [rubygems/rubygems] Keep track of materializations in the original resolve
This gives more flexibility to allow further improvements.

f11a890f5e
2024-11-26 15:11:05 +09:00
David Rodríguez
e15921c694 [rubygems/rubygems] Create LazySpecifications directly with most_specific_locked_platform
So there's no need to pass it around in so many places.

784ab7481b
2024-11-26 15:11:05 +09:00
David Rodríguez
963f98a94f [rubygems/rubygems] Enable Performance/MapCompact cop
0c3a65871a
2024-11-26 15:11:05 +09:00
David Rodríguez
4addaaf4df [rubygems/rubygems] More aggressive Performance/FlatMap cop configuration
d8d68cc00e
2024-11-26 15:11:05 +09:00
David Rodríguez
11e522b913 [rubygems/rubygems] Fix installs of subdependencies of unlocked dependencies to be conservative
When converging specification to pass the set of versions that should be
preserved from the lockfile during resolution, we should make sure all
top level gems are considered, and only exclude those gems themselves
(and not their dependencies) if their locked versions happen to not be
satisfied by an edited Gemfile.

ed2f1b7b88
2024-11-26 15:11:05 +09:00
David Rodríguez
dd400ba630 [rubygems/rubygems] Filter out gems to unlock inside converge_specs
d0f789970f
2024-11-26 15:11:05 +09:00
David Rodríguez
91995d0ad1 [rubygems/rubygems] Remove unnecessary verbose parameter
For consistency with other specs.

a5b2449896
2024-11-26 15:11:05 +09:00
David Rodríguez
d63eeafe69 [rubygems/rubygems] Remove unnecessary let and nesting
c519830d4d
2024-11-26 15:11:05 +09:00
David Rodríguez
6386d49f9e [rubygems/rubygems] Fix development dependencies considered unnecessarily sometimes
When used with `LazySpecification` objects, `SpecSet#for` was
incorrectly considering development dependencies. This did not cause any
issues because all usages of this method with `LazySpecification`'s are
not strict, meaning the pass `check = false` and ignore incomplete
specifications. But it was still doing more work than necessary because
development dependencies were still added to the `deps` array for
processing and then ignored because of not being found in the spec set.

Same when converging path specifications and replacing their dependencies.

6afca8a95f
2024-11-26 15:11:05 +09:00
David Rodríguez
7c93460331 [rubygems/rubygems] Simplify more
a2bb68a29b
2024-11-26 15:11:05 +09:00
David Rodríguez
d6a0e575c9 [rubygems/rubygems] Don't bother sorting if there's a single element
6dc64f9851
2024-11-26 15:11:05 +09:00
David Rodríguez
83ce2351ff [rubygems/rubygems] Remove no longer necessary code
e1caeecdf8
2024-11-26 15:11:05 +09:00
David Rodríguez
631908d9a8 [rubygems/rubygems] Use platform local variable
6a6041d073
2024-11-26 15:11:05 +09:00
David Rodríguez
6916999fed [rubygems/rubygems] This is about locked_platforms
df2c9eb52f
2024-11-26 15:11:05 +09:00
David Rodríguez
7b66aee0b7 [rubygems/rubygems] Set instance variables in consistent order
c382b606bd
2024-11-26 15:11:05 +09:00
Jean Boussier
693a793521 JSON::GeneratorError expose invalid object
Fix: https://github.com/ruby/json/issues/710

Makes it easier to debug why a given tree of objects can't
be dumped as JSON.

Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
2024-11-26 15:11:05 +09:00
Jean Boussier
6805e88935 [ruby/json] Stop using rb_gc_mark_locations
It's using `rb_gc_mark_maybe` under the hood, which isn't what
we need.

e10d0bffcd
2024-11-26 15:11:05 +09:00
Jean Boussier
ee0de3fd4e [ruby/json] JSON.dump: write directly into the provided IO
Ref: https://github.com/ruby/json/issues/524

Rather than to buffer everything in memory.

Unfortunately Ruby doesn't provide an API to write into
and IO without first allocating a string, which is a bit
wasteful.

f017af6c0a
2024-11-26 15:11:05 +09:00
Jeremy Evans
519701657f Update NEWS.md for Bug #20620 2024-11-25 21:00:59 -08:00
Nobuyoshi Nakada
aa5b1d8df9
[Feature #20293] Add Warning.categories to NEWS 2024-11-26 13:09:24 +09:00
Hiroshi SHIBATA
8655b9f7c6 [ruby/uri] Suppress deprecate warning of test class and use EnvUtil.suppress_warning.
bd2e4be9d0
2024-11-26 03:32:01 +00:00
Hiroshi SHIBATA
1d9dc4c504 [ruby/uri] Revert "Prevent a warning: URI::REGEXP is obsolete
(https://github.com/ruby/uri/pull/138)"

This reverts commit c00726a20a.

22f5a7a790
2024-11-26 03:32:01 +00:00
Yusuke Endoh
22c1ba9409 NEWS.md: Fix a typo 2024-11-26 12:12:59 +09:00
Yusuke Endoh
92cf8a5705 Add NEWS entries temporarily
https://bugs.ruby-lang.org/issues/20108
https://bugs.ruby-lang.org/issues/20564
https://bugs.ruby-lang.org/issues/20705
https://bugs.ruby-lang.org/issues/20782
https://bugs.ruby-lang.org/issues/20811
2024-11-26 12:10:03 +09:00
Yusuke Endoh
c60cac50f4 NEWS.md: sort the entries alphabetically 2024-11-26 12:08:55 +09:00
Nobuyoshi Nakada
6b4f8945d6 Many of Oniguruma functions need valid encoding strings 2024-11-26 11:46:34 +09:00
Nobuyoshi Nakada
02b70256b5 Check negative integer underflow 2024-11-26 11:46:34 +09:00
Hiroshi SHIBATA
c08e1f336c [ruby/resolv] Omit Windows and MinGW platforms with with_udp_and_tcp
3351165599

```
  => 705:     with_udp_and_tcp('127.0.0.1', 0) do |u1, t1|
     706:       with_udp_and_tcp('127.0.0.1', 0) do |u2,t2|
     707:         u2.close # XXX: u2 UDP socket is not used, but using #with_udp_and_tcp to enable Windows EACCES workaround
     708:         _, server1_port, _, server1_address = u1.addr
Error: Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 55685
```

3346106852

```
    1) Error:
  TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback:
  Errno::EACCES: Permission denied - bind(2) for "127.0.0.1" port 50676
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer#initialize'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TCPServer.new'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:78:in 'TestResolvDNS#with_udp_and_tcp'
      D:/a/ruby/ruby/src/test/resolv/test_dns.rb:705:in 'TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback'
```

05765df178
2024-11-26 02:44:00 +00:00
Shugo Maeda
4e59ae6e27
Add news about MatchData#bytebegin and MatchData#byteend 2024-11-26 11:13:59 +09:00
Maximillian Polhill
56fbf64a53 Fix vm_objtostring optimization for Symbol
Co-authored-by: John Hawthorn <john@hawthorn.email>
2024-11-25 17:29:58 -08:00
Hiroshi SHIBATA
36f67f6bbb [ruby/resolv] _1 is not provided in Ruby 2.5
83f18e2a49
2024-11-26 00:28:06 +00:00
Mike Linksvayer
7be0d50514 [ruby/logger] include license texts in gem
1a64cb552f
2024-11-25 22:31:44 +00:00
Stan Lo
544d684412 Use footnote links instead 2024-11-25 15:38:20 -05:00