TruffleRuby - GraalVM Community Edition 20.0.0
·
13141 commits
to master
since this release
TruffleRuby is a high-performance implementation of the Ruby programming language 2.6.5. More information is available on the GraalVM website. Changes in 20.0.0 (from the project changelog):
New features:
- Enable and document
--coverage
option (#1840, @chrisseaton). - Update the internal LLVM toolchain to LLVM 9 and reduce its download size.
- Updated to Ruby 2.6.5 (#1749, @eregon).
- Automatically set
PKG_CONFIG_PATH
as needed for compiling OpenSSL on macOS (#1830).
Bug fixes:
- Fix
Tempfile#{size,length}
when the IO is not flushed (#1765, @rafaelfranca). - Dump and load instance variables in subclasses of
Exception
(#1766, @rafaelfranca). - Fix
Date._iso8601
andDate._rfc3339
when the string is an invalid date (#1773, @rafaelfranca). - Fail earlier for bad handle unwrapping (#1777, @chrisseaton).
- Match out of range
ArgumentError
message with MRI (#1774, @rafaelfranca) - Raise
Encoding::CompatibilityError
with incompatible encodings onRegexp
(#1775, @rafaelfranca). - Fixed interactions between attributes and instance variables in
Struct
(#1776, @chrisseaton). - Coercion fixes for
TCPServer.new
(#1780, @XrXr) - Fix
Float#<=>
not callingcoerce
whenother
argument responds to it (#1783, @XrXr). - Do not warn / crash when requiring a file that sets and trigger autoload on itself (#1779, @XrXr).
- Strip trailing whitespaces when creating a
BigDecimal
with aString
(#1796, @XrXr). - Default
close_others
inProcess.exec
tofalse
like Ruby 2.6 (#1798, @XrXr). - Don't clone methods when setting method to the same visibility (#1794, @XrXr).
BigDecimal()
deal with large rationals precisely (#1797, @XrXr).- Make it possible to call
instance_exec
withrb_block_call
(#1802, @XrXr). - Check for duplicate members in
Struct.new
(#1803, @XrXr). Process::Status#to_i
return rawwaitpid(2)
status (#1800, @XrXr).Process#exec
: set close-on-exec to false for fd redirection (#1805, @XrXr, @rafaelfranca).- Building C extensions should now work with frozen string literals (#1786, @aardvark179).
- Keep the Truffle working directory in sync with the native working directory.
- Rename
to_native
topolyglot_to_native
to matchpolyglot_pointer?
andpolyglot_address
methods. - Fixed missing partial evaluation boundary in
Array#{sort,sort!}
(#1727). - Fixed the class of
self
and the wrappingModule
forKernel#load(path, wrap=true)
(#1739). - Fixed missing polyglot type declaration for
RSTRING_PTR
to help with native/managed interop. - Fixed
Module#to_s
andModule#inspect
to not return an extra#<Class:
for singleton classes. - Arrays backed by native storage now allocate the correct amount of memory (#1828).
- Fixed issue in
ConditionVariable#wait
that could lose aConditionVariable#signal
. - Do not expose TruffleRuby-specific method
Array#swap
(#1816, @pitr-ch) - Fixed
#inspect
on broken UTF-8 sequences (#1842, @chrisseaton). Truffle::Interop.keys
should report methods ofString
andSymbol
(#1817)Kernel#sprintf
encoding validity has been fixed (#1852, @XrXr).- Fixed
ArrayIndexOutOfBoundsException
inFile.fnmatch
(#1845, @bjfish). - Make
String#concat
work with no or multiple arguments (#1519, @norswap). - Make
Array#concat
work with no or multiple arguments (#1519, @norswap). - Coerce
BigDecimal(arg)
usingto_str
(#1826). - Fixed
NameError#dup
,NoMethodError#dup
, andSystemCallError#dup
to copy internal fields. - Make
Enumerable#chunk
work without a block (#1518). - Fixed issue with
SystemCallError.new
setting a backtrace too early. - Fixed
BigDecimal#to_s
formatting issue (#1711). - Run
END
keyword block only once at exit. - Implement
Numeric#clone
to returnself
. - Fixed
Symbol#to_proc
to create aProc
withnil
source_location
(#1663). - Make
GC.start
work with keyword arguments. - Fixed
Kernel#clone
fornil
,true
,false
,Integer
, andSymbol
. - Make top-level methods available in
Context#getBindings()
(#1838). - Made
Kernel#caller_locations
accept a range argument, and returnnil
when appropriate. - Made
rb_respond_to
work with primitives (#1869, @chrisseaton). - Fixed issue with missing backtrace for
rescue $ERROR_INFO
(#1660). - Fixed
Struct#hash
forkeyword_init: true
Struct
. - Fixed
String#{upcase!,downcase!,swapcase!}(:ascii)
for non-ASCII-compatible encodings like UTF-16. - Fixed
String#capitalize!
for strings that weren't full ASCII. - Fixed enumeration issue in
ENV.{select, filter}
. - Fixed
Complex
andRational
should be frozen after initializing. - Fixed
printf
should raise error when not enough arguments for positional argument. - Removed "shadowing outer local variable" warning.
- Fixed parameter conversion to
String
in ENV methods. - Fixed deprecation warning when
ENV.index
is called. - Fixed issue with
ENV.each_key
. - Fixed
ENV.replace
implementation. - Fixed
ENV.udpate
implementation. - Fixed argument handling in
Kernel.printf
. - Fixed character length after conversion to binary from a non-US-ASCII String.
- Fixed issue with installing latest bundler (#1880).
- Fixed type conversion for
Numeric#step
step
parameter. - Fixed
Kernel#Integer
conversion. - Fixed
IO.try_convert
parameter conversion. - Fixed linking of always-inline C API functions with
-std=gnu90
(#1837, #1879). - Avoid race conditions during
gem install
by using a single download thread. RSTRING_PTR()
now always returns a native pointer, resolving two bugsmemcpy
ing to (#1822) and from (#1772) Ruby Strings.- Do not use gems precompiled for MRI on TruffleRuby (#1837).
Compatibility:
- Implemented
String#start_with?(Regexp)
(#1771, @dimameshcharakou). - Various improvements to
SignalException
and signal handling (#1790, @XrXr). - Implemented
rb_utf8_str_new
,rb_utf8_str_new_cstr
,rb_utf8_str_new_static
(#1788, @chrisseaton). - Implemented the
unit
argument ofTime.at
(#1791, @XrXr). - Implemented
keyword_init: true
forStruct.new
(#1789, @XrXr). - Implemented
MatchData#dup
(#1792, @XrXr). - Implemented a native storage strategy for
Array
to allow better C extension compatibility. - Implemented
rb_check_symbol_cstr
(#1814). - Implemented
rb_hash_start
(#1841, @XrXr). - JCodings has been updated from 1.0.42 to 1.0.45.
- Joni has been updated from 2.1.25 to 2.1.30.
- Implemented
Method#<<
andMethod#>>
(#1821). - The
.bundle
file extension is now used for C extensions on macOS (#1819, #1837). - Implemented
Comparable#clamp
(#1517). - Implemented
rb_gc_register_mark_object
andrb_enc_str_asciionly_p
(#1856, @chrisseaton). - Implemented
rb_io_set_nonblock
(#1741). - Include the major kernel version in
RUBY_PLATFORM
on macOS like MRI (#1860, @eightbitraptor). - Implemented
Enumerator::Chain
,Enumerator#+
, andEnumerable#chain
(#1859, #1858). - Implemented
Thread#backtrace_locations
andException#backtrace_locations
(#1556). - Implemented
rb_module_new
,rb_define_class_id
,rb_define_module_id
, (#1876, @XrXr, @chrisseaton). - Implemented
-n
CLI option (#1532). - Cache the
Symbol
of method names in call nodes only when needed (#1872). - Implemented
rb_get_alloc_func
and related functions (#1874, @XrXr). - Implemented
rb_module_new
,rb_define_class_id
,rb_define_module_id
, (#1876, @chrisseaton). - Implemented
ENV.slice
. - Support for the Darkfish theme for RDoc generation has been added back.
- Implemented
Kernel#system
exception: true
option. - Implemented
Random.bytes
. - Implemented
Random.random_number
. - Added the ability to parse endless ranges.
- Made
Range#to_a
compatible with endless ranges. - Made
Array#[]
andArray#[]=
compatible with endless ranges.
Performance:
- Use a smaller limit for identity-based inline caches to improve warmup by avoiding too many deoptimizations.
long[]
array storage now correctly declare that they acceptint
values, reducing deoptimisations and promotions toObject[]
storage.- Enable inline caching of
Symbol
conversion forrb_iv_get
andrb_iv_set
. rb_type
information is now cached on classes as a hidden variable to improve performance.- Change to using thread local buffers for socket calls to reduce allocations.
- Refactor
IO.select
to reduce copying and optimisation boundaries. - Refactor various
String
andRope
nodes to avoid Truffle performance warnings. - Reading caller frames should now work in more cases without deoptimisation.