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

81496 Коммитов

Автор SHA1 Сообщение Дата
Misaki Shioi 5baa2b9650 Make test-bundled-gems success 2023-11-30 13:27:19 +09:00
Misaki Shioi f982931719 Fix failing spec 2023-11-30 13:27:19 +09:00
Misaki Shioi 5f62b1d00c Rename rsock_raise_socket_error to rsock_raise_resolution_error
Again, rsock_raise_socket_error is called only when getaddrinfo and getaddrname fail
2023-11-30 13:27:19 +09:00
Misaki Shioi 52f6de4196 Replace SocketError with Socket::ResolutionError in rsock_raise_socket_error
rsock_raise_socket_error is called only when getaddrinfo and getaddrname fail
2023-11-30 13:27:19 +09:00
Misaki Shioi e9050270d7 Add Socket::ResolutionError & Socket::ResolutionError#error_code
Socket::ResolutionError#error_code returns Socket::EAI_XXX
2023-11-30 13:27:19 +09:00
Peter Zhu db7f3064a8 Implement proc_entry on VWA 2023-11-29 22:51:13 -05:00
Peter Zhu 40e67cb20e Implement Write Barriers on proc_entry 2023-11-29 22:51:13 -05:00
Peter Zhu 705a3c69d7 Add RUBY_TYPED_FREE_IMMEDIATELY flag to proc_entry 2023-11-29 22:51:13 -05:00
Samuel Giddins 62e2e1da92 [rubygems/rubygems] Allow auto-install to install missing git gems
Currently, auto-install with git gems fails, when
it would succeed with a rubygems-source gem

Fix the issue by doing the same fallback for git errors as we do for
missing gems, the git errors should only bubble up in these cases when
the gem is not installed, meaning we want to go through the install flow
(and any persistent errors will be raised through there)

https://github.com/rubygems/rubygems/commit/e25a339f7a
2023-11-30 03:41:15 +00:00
Hiroshi SHIBATA f2bb539459
Manually sync with https://github.com/ruby/open3/pull/22 and related PRs 2023-11-30 12:21:25 +09:00
Kevin Newton 7174c62f6b [prism] Remove escaping C source files 2023-11-30 12:11:19 +09:00
Peter Zhu 3d908a41ab Guard match from GC in String#gsub
We need to guard match from GC because otherwise it could end up being
reclaimed or moved in compaction.
2023-11-29 19:21:40 -05:00
Maxime Chevalier-Boisvert 8d1138c1cf
YJIT: edit `yjit.md` and bring it up to date (#9068)
Also make various minor edits to improve readability.
2023-11-29 18:09:55 -05:00
Peter Zhu 128837e4a2 Support RUNRUBY_USE_RR for rr debugger 2023-11-29 17:54:58 -05:00
Peter Zhu aee275165b debugger can never be nil 2023-11-29 17:54:58 -05:00
Samuel Giddins 2927c28095 [rubygems/rubygems] Avoid re-compiling static regexp in a loop
Pathname::SEPARATOR_PAT is a constant and can safely be interpolated once, avoiding creating a new regexp object on every iteration

https://github.com/rubygems/rubygems/commit/75d9c0f1e4
2023-11-29 21:28:46 +00:00
Jemma Issroff 8234763816 [PRISM] Compile empty array as newarray 0
Prior to this commit, we were compiling an empty array as a
duparray of [] which meant we were allocating a new value
unnecessarily. With this commit, we emit a newarray with size 0
instead.
2023-11-29 16:20:30 -05:00
Jemma Issroff 853fd44745 [PRISM] Implement CallNodes with splat followed by args 2023-11-29 16:19:14 -05:00
Jemma Issroff 2233204cc1 [PRISM] Account for ImplicitRestNode
Prism introduced a new ImplicitRestNode. This adds tests for the
ImplicitRestNode cases, and changes one assert which is no longer
accurate.
2023-11-29 16:14:28 -05:00
Jemma Issroff 53841941f0 [PRISM] Fix EnsureNode, pass depth to get locals
This commit fixes a bug with locals in ensure nodes by setting
the local tables correctly. It also changes accessing locals to
look at local tables in parent scopes, and account for this
correctly on depths of get or setlocals.
2023-11-29 16:00:00 -05:00
Peter Zhu 6ebcf25de2 GC guard catch_table_ary in iseq_set_exception_table
The function iseq_set_exception_table allocates memory which can cause
a GC compaction to run. Since catch_table_ary is not on the stack, it
can be moved, which would make tptr incorrect.
2023-11-29 12:30:12 -05:00
Kevin Newton 14761edbf6 [prism] Add MacJapanese encodings to common.mk 2023-11-29 12:08:15 -05:00
Matt Boldt 9fc40d2b26 [ruby/prism] Add MacJapanese encoding
MacJapanese (also aliased as MacJapan) is a modified Shift_JIS
encoding, but is implemented identically in Ruby

https://github.com/ruby/prism/commit/9e0a097699
2023-11-29 12:08:15 -05:00
tomoya ishida 86d9a6dcb6 [ruby/irb] Use gem repl_type_completor, remove type_completion
implementation
(https://github.com/ruby/irb/pull/772)

https://github.com/ruby/irb/commit/a4868a5373
2023-11-29 16:30:13 +00:00
Kevin Newton b549722eef [prism] Add pm_cp950 to make targets 2023-11-29 11:15:50 -05:00
Dhaval 9fada99cb2 [ruby/prism] added CP950 encoding
https://github.com/ruby/prism/commit/9c2d1cf4ba
2023-11-29 11:15:50 -05:00
Peter Zhu 57cb47bfe2 Assert that the left and right nodes are correct 2023-11-29 10:30:00 -05:00
Jemma Issroff b632732bcf [ruby/prism] Fixed comment on pm_parser_numbered_parameters_set
https://github.com/ruby/prism/commit/ceae5727b8
2023-11-29 15:24:41 +00:00
Peter Zhu 38e6442f8c Add missing assertion in test_use_all_shapes_then_freeze 2023-11-29 08:59:53 -05:00
Jean Boussier 2af82e2316 [ruby/prism] Convert start line to signed integers
Ruby allows for 0 or negative line start, this is often used
with `eval` calls to get a correct offset when prefixing a snippet.

e.g.

```ruby
caller = caller_locations(1, 1).first
class_eval <<~RUBY, caller.path, caller.line - 2
  # frozen_string_literal: true
  def some_method
    #{caller_provided_code_snippet}
  end
RUBY
```

https://github.com/ruby/prism/commit/0d14ed1452
2023-11-29 13:56:19 +00:00
Jean Boussier 2653404840 [ruby/prism] Rename varint as varuint
Line numbers may be negative, so we need to introduce signed varint,
so renaming unsigned ones first avoid confusion.

https://github.com/ruby/prism/commit/90d862361e
2023-11-29 13:56:18 +00:00
Nobuyoshi Nakada 8e93bf8e1f
[Bug #17037] Improve accuracy of division near precision limits
When dividing near the precision limit of `double`, use Bignum
division to get rid of rounding errors.
2023-11-29 20:16:36 +09:00
Nobuyoshi Nakada 79eb75a8dd
[Bug #20025] Check if upper/lower before fallback to case-folding 2023-11-29 14:40:21 +09:00
Michael Go bd2b6b702c [rubygems/rubygems] update Magnus library in Rust extension gem template
https://github.com/rubygems/rubygems/commit/46f09800da
2023-11-29 02:21:38 +00:00
TSUYUSATO Kitsune a908cef53f [ruby/prism] Reject class/module defs in method params/rescue/ensure/else
Fix https://github.com/ruby/prism/pull/1936

https://github.com/ruby/prism/commit/232e77a003
2023-11-29 02:03:06 +00:00
Alan Wu fcabe2df39
Remove written-but-never-read `me->def.body.refined.owner`
This also removes aliasing rule violations; the anonymous structs were
distinct types from `rb_method_refined_t`.
2023-11-29 01:41:40 +00:00
Tema Bolshakov bed014e374 Do not call the inplicit convercion spec on older ruby versions 2023-11-29 09:39:15 +09:00
Tema Bolshakov 9c900771da Fix Array#rassoc spec 2023-11-29 09:39:15 +09:00
Tema Bolshakov e4a11a1283 Array#rassoc should try to convert to array implicitly. Fixes #20003 2023-11-29 09:39:15 +09:00
Peter Zhu 10f44dfeff Fix Ractor sharing for too complex Objects 2023-11-28 17:43:22 -05:00
Peter Zhu 6eb5a9cf8f Fix Ractor sharing for too complex generic ivars 2023-11-28 17:43:22 -05:00
Kevin Newton 4938390177 [ruby/prism] Implicit rest nodes
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }`
because of arity checks. This PR introduces a new node to handle
that, `ImplicitRestNode`, which goes in the `rest` slot of parameter
nodes instead of `RestParameterNode` instances.

This is also used in a couple of other places, namely:

* pattern matching: `foo in [bar,]`
* multi target: `for foo, in bar do end`
* multi write: `foo, = bar`

Now the only splat nodes with a `NULL` value are when you're
forwarding, as in: `def foo(*) = bar(*)`.

https://github.com/ruby/prism/commit/dba2a3b652
2023-11-28 22:33:50 +00:00
Maxime Chevalier-Boisvert ea3e17e430
YJIT: fix bug in top cfunc logging in `--yjit-stats` (#9056)
YJIT: correctly handle case where there are no cfunc calls

Fix bug in top cfunc logging in `--yjit-stats`
2023-11-28 22:27:11 +00:00
Jemma Issroff a9c07cbd21 [PRISM] Don't calculate params size based on locals
Prior to this commit, we were conflating the size of the locals
list with the number of parameters. This commit distinguishes
the two, and fixes a related bug which would occur if we set a local
that was not a parameter
2023-11-28 17:01:34 -05:00
Jemma Issroff 04cbcd37b1 [ruby/prism] Add numbered_parameters field to BlockNode and LambdaNode
We are aware at parse time how many numbered parameters we have
on a BlockNode or LambdaNode, but prior to this commit, did not
store that information anywhere in its own right.

The numbered parameters were stored as locals, but this does not
distinguish them from other locals that have been set, for example
in `a { b = 1; _1 }` there is nothing on the AST that distinguishes
b from _1.

Consumers such as the compiler need to know information about how
many numbered parameters exist to set up their own tables around
parameters. Since we have this information at parse time, we should
compute it here, instead of deferring the work later on.

https://github.com/ruby/prism/commit/bf4a1e124d
2023-11-28 21:08:46 +00:00
Maxime Chevalier-Boisvert 6310522a9a
YJIT: reduce default exec-mem-size to 64MiB (#9054) 2023-11-28 20:04:33 +00:00
Jean Boussier 982641939c Further fix the GVL instrumentation API
Followup: https://github.com/ruby/ruby/pull/9029

[Bug #20019]

Some events still weren't triggered from the right place.

The test suite was also improved a bit more.
2023-11-28 20:06:55 +01:00
Jemma Issroff 7bd172744f [PRISM] Implement more compilation of SplatNodes
There was a bug with the rest argument in SplatNodes, this commit
fixes it, and adds more tests illustrating the behavior of
SplatNodes
2023-11-28 14:03:57 -05:00
Jemma Issroff 2760f23774 [PRISM] Compile YieldNode with different arguments 2023-11-28 14:02:53 -05:00
Peter Zhu cb70994b0e Assert node inserted into red-black tree exists 2023-11-28 13:37:38 -05:00