-
-
Notifications
You must be signed in to change notification settings - Fork 932
Description
This is based on #7015 and includes only the items that we did not finish in time for 9.4.0.
Language changes
-
Multiple assignment evaluation order consistency #7440 Multiple assignment evaluation order has been made consistent with single assignment evaluation order. With single assignment, Ruby uses a left-to-right evaluation order. With this code:
-
Non main-Ractors can get instance variables (ivars) of classes/modules
if ivars refer to shareable objects.
[Feature #17592]
Core classes updates
-
TracePoint
- TracePoint.allow_reentry is added to allow reenter while TracePoint
callback.
[Feature #15912]
- TracePoint.allow_reentry is added to allow reenter while TracePoint
-
Fiber Scheduler
-
Add support for
Addrinfo.getaddrinfo
usingaddress_resolve
hook.
[Feature #17370] -
Introduce non-blocking
Timeout.timeout
usingtimeout_after
hook.
[Feature #17470] -
Introduce new scheduler hooks
io_read
andio_write
along with a
low levelIO::Buffer
for zero-copy read/write. [Feature #18020] -
IO hooks
io_wait
,io_read
,io_write
, receive the original IO object
where possible. [Bug #18003] -
Make
Monitor
fiber-safe. [Bug #17827] -
Replace copy coroutine with pthread implementation. [Feature #18015]
-
Stdlib updates
- Default gems still not supported in JRuby
- bigdecimal 3.1.1 (Allow installation on JRuby ruby/bigdecimal#169)
- date 3.2.2 (JRuby support ruby/date#48)
- etc 1.3.0 (JRuby support ruby/etc#19)
- fcntl 1.0.1 (JRuby support ruby/fcntl#9)
- fiddle 1.1.0 (JRuby support ruby/fiddle#104)
- nkf 0.1.1 (Partial implementation in JRuby, unsure whether this is important)
- openssl 3.0.0 (jruby-openssl migration ruby/openssl#20 (comment))
- pathname 0.2.0 (JRuby support ruby/pathname#17)
- readline 0.0.3 (JRuby support ruby/readline#5)
- readline-ext 0.1.4 (will be solved along with readline)
- resolv 0.2.1 (JRuby support ruby/resolv#19)
- securerandom 0.1.1 (JRuby support ruby/securerandom#9)
- set 1.0.2 (JRuby support ruby/set#21)
- tempfile 0.1.2 (JRuby support ruby/tempfile#7)
- time 0.2.0 (Depends on date)
- tmpdir 0.1.2 (JRuby support ruby/tmpdir#13)
- zlib 2.1.1 (JRuby support ruby/zlib#38)
- The following bundled gems are updated.
- rbs 2.0.0 (Depends on many internals of CRuby)
- typeprof 0.21.1 (Depends on many internals of CRuby)
- The following default gems are now bundled gems.
- debug 1.4.0 (Depends on many internals of CRuby in newer versions)
- The following non-updated gems are not yet installable on JRuby.
- gdbm 2.1.0
- io-nonblock (JRuby support ruby/io-nonblock#4)
- syslog 0.1.0 (JRuby support ruby/syslog#1)
- win32ole 1.8.8 (JRuby support ruby/win32ole#12)
Stdlib compatibility issues
-
lib/debug.rb
is replaced withdebug.gem
Implementation improvements
These do not apply directly to JRuby, but we should check if we have equivalent optimizations in place.
-
Inline cache mechanism is introduced for reading class variables.
[Feature #17763] -
instance_eval
andinstance_exec
now only allocate a singleton class when
required, avoiding extra objects and improving performance. [GH-5146] -
The performance of
Struct
accessors is improved. [GH-5131] -
mandatory_only?
builtin special form to improve performance on
builtin methods. [GH-5112] -
Experimental feature Variable Width Allocation in the garbage collector.
This feature is turned off by default and can be enabled by compiling Ruby
with flagUSE_RVARGC=1
set. [Feature #18045] [Feature #18239]
Debugger
-
A new debugger debug.gem is bundled.
debug.gem is a fast debugger implementation, and it provides many features
like remote debugging, colorful REPL, IDE (VSCode) integration, and more.
It replaceslib/debug.rb
standard library. -
rdbg
command is also installed intobin/
directory to start and control
debugging execution.
Miscellaneous changes
-
lib/objspace/trace.rb is added, which is a tool for tracing the object
allocation. Just by requiring this file, tracing is started immediately.
Just byKernel#p
, you can investigate where an object was created.
Note that just requiring this file brings a large performance overhead.
This is only for debugging purposes. Do not use this in production.
[Feature #17762] -
Now exceptions raised in finalizers will be printed to
STDERR
, unless
$VERBOSE
isnil
. [Feature #17798] -
ruby -run -e httpd
displays URLs to access. [Feature #17847] -
Add
ruby -run -e colorize
to colorize Ruby code using
IRB::Color.colorize_code
.