ZJIT: Support invalidating method redefinition
This commit adds support for the MethodRedefined invariant to be invalidated
when a method is redefined.
Changes:
- Added CME pointer to the MethodRedefined invariant in HIR
- Updated all places where MethodRedefined invariants are created to
include the CME pointer
- Added handling for MethodRedefined invariants in gen_patch_point to
call track_cme_assumption, which registers the patch point for
invalidation when rb_zjit_cme_invalidate is called
This ensures that when a method is redefined, all JIT code that
depends on that method will be properly invalidated.
Use `fixnum_from_isize` instead of `fixnum_from_usize` in
`fold_fixnum_bop` to properly handle negative values. Casting negative
`i64` to `usize` produces large unsigned values that exceed `RUBY_FIXNUM_MAX`.
Previously, endless method definitions like `x = def f = p 1` would fail
to parse because command calls (method calls without parentheses) were
only accepted when the surrounding binding power was less than
`PM_BINDING_POWER_COMPOSITION` (8). In assignment contexts with binding
power 18, this condition was false, causing parse errors.
This fix ensures command calls are always accepted in endless method
bodies by passing `true` for `accepts_command_call`, making the method
body parse consistently regardless of where the method is defined.
70413ed4dd
* [Feature #21347] Add `open_timeout` as an overall timeout option for `TCPSocket.new`
With this change, `TCPSocket.new` now accepts the `open_timeout` option.
This option raises an exception if the specified number of seconds has elapsed since the start of the method call,
even if the operation is still in the middle of name resolution or connection attempts.
The addition of this option follows the same intent as the previously merged change to `Socket.tcp`.
[Feature #21347](https://bugs.ruby-lang.org/issues/21347)
https://github.com/ruby/ruby/pull/13368
* Tidy up: Extract rsock_raise_user_specified_timeout()
* Added a note to the documentation of `Socket.tcp`
* Fix `rsock_init_inetsock` for `FAST_FALLBACK_INIT_INETSOCK_IMPL`
See: 58bc97628c
getpwnam(3) says the same thing. I got ENOENT in my Linux environment.
1) Failure:
TestProcess#test_uid_from_name [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:1685]:
Exception(ArgumentError) with message matches to /\u{4e0d 5b58 5728}/.
[ArgumentError] exception expected, not #<Errno::ENOENT: No such file or directory - getpwnam_r>.
When arithmetic expressions like `-1**2` are used in pattern matching contexts,
Ruby crashes with "Unexpected node type in pattern matching expression: PM_CALL_NODE".
This happens because the Prism parser creates `PM_CALL_NODE` for arithmetic operations,
but Ruby's pattern matching compiler doesn't handle call nodes.
This fix adds validation to reject `PM_CALL_NODE` in pattern contexts with a proper
syntax error.
365049a767
* ZJIT: Add test exclusions for ZJIT
* ZJIT: Update test targets and documentation
- Rename `zjit-test-all` to `zjit-check`
- Add `zjit-test-all` target to zjit.mk to run all Ruby tests with ZJIT enabled
excluding known failing tests
- Update documentation and CI workflow to reflect the new targets
RubyGems generated binstubs still provide support for this ancient
version. This makes no sense since we prevent downgrades to such old
versions.
089cdc3b77
ASN.1 UTCTime uses two-digit years. While X.680 does not specify how to
map them as far as I can tell, X.509/PKIX uses this type to represent
dates between year 1950-2049.
OpenSSL::ASN1.decode has used 1969-2068 since the initial
implementation. Given that ASN1::UTCTime#to_der relies on OpenSSL
ASN1_UTCTIME type, which assumes the 1950-2049 range, this was likely
unintentional.
Use the range 1950-2049 consistently, and fix decoding of X.509
certificates with dates in 1950-1968.
b8b38e1438
Use just `self` instead of `self.class`, in `URI::Generic.build`.
Since this is a class method, `self.class` is always `Class` even in
inherited sub classes, and does not have `#component` method.
6f44d3d40e
... to conform to UTS 18 as mentioned in https://bugs.ruby-lang.org/issues/19417#note-3https://unicode.org/reports/tr18/#word states word should match join_control chars.
It currently does not:
```ruby
[*0x0..0xD799, *0xE000..0x10FFFF].map { |n| n.chr 'utf-8' } => all_chars
all_chars.grep(/\p{join_control}/) => jc
jc.count # => 2
jc.grep(/\p{word}/).count # => 0
```