Skip to content

Releases: oracle/truffleruby

TruffleRuby 23.1.0

19 Sep 12:12
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
More information is available on the website: http://www.graalvm.org/ruby/
TruffleRuby comes in two standalone modes, native and jvm, for both Oracle GraalVM and Community Edition.
See the documentation for which release asset corresponds to what.

Changelog

New features:

  • Updated to Ruby 3.2.2 (#3039, @eregon, @andrykonchin).
  • TruffleRuby Native on Oracle GraalVM on Linux now uses the G1 garbage collector which is much faster (@eregon).

Bug fixes:

  • Fix Dir.glob returning blank string entry with leading **/ in glob and base: argument (@rwstauner).
  • Fix class lookup after an object's class has been replaced by IO#reopen (@itarato, @nirvdrum, @eregon).
  • Fix Marshal.load and raise ArgumentError when dump is broken and is too short (#3108, @andrykonchin).
  • Fix super method lookup for unbounded attached methods (#3131, @itarato).
  • Fix Module#define_method(name, Method) to respect module_function visibility (#3181, @andrykonchin).
  • Fix stack overflow with Kernel.require and zeitwerk (#3224, @eregon).
  • Reimplement IO.select with poll(2) to support file descriptors >= 1024 (#3201, @eregon).

Compatibility:

  • Fix Hash#shift when Hash is empty but has initial default value or initial default proc (#3039, @itarato).
  • Make Array#shuffle produce the same results as CRuby (@rwstauner).
  • Add Process.argv0 method (@andrykonchin).
  • Add support for array pattern matching. This is opt-in via --pattern-matching since pattern matching is not fully supported yet. (#2683, @razetime).
  • Fix Array#[] with ArithmeticSequence argument when step is negative (#3039, @itarato).
  • Fix Range#size and return nil for beginningless Range when end isn't Numeric (#3039, @rwstauner).
  • Alias String#-@ to String#dedup (#3039, @itarato).
  • Fix Pathname#relative_path_from to convert string arguments to Pathname objects (@rwstauner).
  • Add String#bytesplice (#3039, @itarato).
  • Add String#byteindex and String#byterindex (#3039, @itarato).
  • Add implementations of rb_proc_call_with_block, rb_proc_call_kw, rb_proc_call_with_block_kw and rb_funcall_with_block_kw (#3068, @andrykonchin).
  • Add optional timeout argument to Thread::Queue#pop (#3039, @itarato).
  • Add optional timeout argument to Thread::SizedsQueue#pop (#3039, @itarato).
  • Handle long long and aliases in Fiddle (#3128, @eregon).
  • Add Module#refinements (#3039, @itarato).
  • Add Refinement#refined_class (#3039, @itarato).
  • Add rb_hash_new_capa function (#3039, @itarato).
  • Fix Encoding::Converter#primitive_convert and raise FrozenError when a destination buffer argument is frozen (@andrykonchin).
  • Add Module#undefined_instance_methods (#3039, @itarato).
  • Add Thread.each_caller_location (#3039, @itarato).
  • Add timeout argument to Thread::SizedQueue#push (#3039, @itarato).
  • Add rb_syserr_new function (@rwstauner).
  • Add Enumerator#product (#3039, @itarato).
  • Add Module#const_added (#3039, @itarato).
  • Show the pointer size information (if available) in FFI::Pointer#inspect (@nirvdrum).
  • Implement performance warnings (Warning[:performance]) like in CRuby 3.3 (@eregon).
  • The output of Marshal.dump is now compatible with CRuby for Rational and Complex instances (#3228, @eregon).

Performance:

  • Improve Truffle::FeatureLoader.loaded_feature_path by removing expensive string ops from a loop. Speeds up feature lookup time (#3010, @itarato).
  • Improve String#-@ performance by reducing unnecessary data copying and supporting substring lookups (@nirvdrum)
  • Specialize Array#<< and related methods appending elements per call site to have a single array storage strategy in the inline cache for most cases (@eregon).

Changes:

  • gu install $LANGUAGE is replaced by truffleruby-polyglot-get $LANGUAGE, available in the TruffleRuby JVM standalone (@eregon).
  • The TruffleRuby ScriptEngine implementation is removed in favor of the generic ScriptEngine in GraalVM docs (@eregon).

Memory Footprint:

  • Replaced RubyLibrary with FreezeNode and IsFrozenNode (@horakivo).
  • Address many truffle-sharing warnings (@horakivo).
  • Address many truffle-inlining warnings (@horakivo).

TruffleRuby - GraalVM Community 23.0.1

25 Jul 13:02
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

  • Build based on latest GraalVM JDK release (23.0.1)

TruffleRuby - GraalVM Community 23.0.0

13 Jun 15:03
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • Updated to Ruby 3.1.3 (#2733, @andrykonchin, @eregon).
  • foreign_object.is_a?(foreign_meta_object) is now supported (@eregon).
  • Foreign big integers are now supported and work with all Numeric operators (@eregon).

Bug fixes:

  • Ensure every parse node has a source section and fix the source section for ensure (#2758, @eregon).
  • Fix spawn(..., fd => fd) on macOS, it did not work due to a macOS bug (@eregon).
  • Fix rb_gc_register_address()/rb_global_variable() to read the latest value (#2721, #2734, #2720, @eregon).
  • Synchronize concurrent writes to the same StringIO (@eregon).
  • Fix StringIO#write(str) when str is of an incompatible encoding and position < buffer size (#2770, @eregon).
  • Fix rb_thread_fd_select() to correctly initialize fdset copies and handle the timeout (@eregon).
  • Fix TracePoint#inspect when it's called outside of a callback (@andrykonchin).
  • Fix Signal.trap when signal argument is not supported (#2774, @andrykonchin).
  • Fix Dir.mkdir and convert permissions argument to Integer (#2781, @andrykonchin).
  • Fix String#dump and use \u{xxxx} notation (with curly brackets) for characters that don't fit in \uxxxx (#2794, @andrykonchin).
  • Fix Marshal.dump when big Integer (that cannot be expressed with 4 bytes) is serialized (#2790, @andrykonchin).
  • Fix Array#pack and accept Numeric values when Float is expected (#2815, @andrykonchin).
  • Fix \P{} matching in regular expressions (#2798, @andrykonchin).
  • Fix constants lookup when BasicObject#instance_eval method is called with a String (#2810, @andrykonchin).
  • Don't trigger the method_added event when changing a method's visibility or calling module_function (@paracycle, @nirvdrum).
  • Fix rb_time_timespec_new function to not call Time.at method directly (@andrykonchin).
  • Fix StringIO#write to transcode strings with encodings that don't match the StringIO's external_encoding. (#2839, @flavorjones)
  • Fix processing of proc rest arguments located at the beginning if there are no actual arguments (#2921, @andrykonchin).
  • Fix Monitor#exit to raise ThreadError when monitor not owned by the current thread (#2922, @andrykonchin).
  • Fix MatchData#[] to support negative length argument (#2929, @andrykonchin).
  • Fix IO line reading calls when using a multi-byte delimiter (IO#{each,gets,readline,readlines,etc.}) (#2961, @vinistock, @nirvdrum).
  • Fix the exception type raised when type coercion raises a NoMethodError (#2903, @paracycle, @nirvdrum).
  • Fix Method and Proc #parameters method to return _ parameter name without synthetic suffix when there are multiple _ parameters (@paracycle).
  • Fixed errors in IRB when attempting to navigate beyond bounds in singleline mode (@rwstauner).
  • Fix Dir.glob returning blank string entry with leading **/ in glob and base: argument (@rwstauner).

Compatibility:

  • Fix MatchData#[] when passed unbounded Range (#2755, @andrykonchin).
  • Updated rb_define_class, rb_define_class_under, and rb_define_class_id_under to allow class names that aren't valid in Ruby (#2739, @nirvdrum).
  • Fixed rb_gv_get so that it no longer implicitly creates global variables (#2748, @nirvdrum).
  • Added implementations of rb_gvar_val_getter and rb_define_virtual_variable (#2750, @nirvdrum).
  • Implement rb_warning_category_enabled_p to support the syntax_tree gem (#2764, @andrykonchin).
  • Fix desctructuring of a single block argument that implements #to_ary dynamically (#2719, @andrykonchin).
  • Fix Kernel#Complex and raise exception when an argument is formatted incorrectly (#2765, @andrykonchin).
  • Add #public?, #private? and #protected? methods for Method and UnboundMethod classes (@andrykonchin).
  • Add optional argument to Thread::Queue.new (@andrykonchin).
  • Support a module as the second argument of Kernel#load (@andrykonchin).
  • Improve argument validation in Struct#valies_at - raise IndexError or RangeError when arguments are out of range (#2773, @andrykonchin).
  • Fix MatchData#values_at and handling indices that are out of range (#2783, @andrykonchin).
  • Add support for %-z (UTC for unknown local time offset, RFC 3339) to Time#strftime (@andrykonchin).
  • Add support for UTC and A-Z utc offset values, as well as +/-HH, +/-HHMM, +/-HHMMSS (without :) (@andrykonchin).
  • Treat time with UTC, Z and -00:00 utc offset as UTC time (@andrykonchin).
  • Raise FrozenError when Time#localtime, Time#utc and Time#gmtime is called on a frozen time object (@andrykonchin).
  • Validate a microseconds argument used to create a time object (@andrykonchin).
  • Support accessing dmark and dfree fields for RData (#2771, @eregon).
  • Implement rb_enc_nth() (#2771, @eregon).
  • Support offset keyword argument for String#unpack and String#unpack1 (@andrykonchin).
  • Fix Process.detach and cast pid argument to Integer (#2782, @andrykonchin).
  • rb_to_id() should create a static ID, used by RMagick (@eregon).
  • Resolve the current user home even when $HOME is not set (#2784, @eregon)
  • Fix IO#lineno= and convert argument to Integer more strictly (#2786, @andrykonchin).
  • Fix argument implicit convertion in IO#pos= and IO#seek methods (#2787, @andrykonchin).
  • Warn about unknown directive passed to Array#pack in verbose mode (#2791, @andrykonchin).
  • Added constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Fix StringIO.new to accept keyword arguments (#2793, @andrykonchin).
  • Process#spawn should call #to_io on non-IO file descriptor objects (#2809, @jcouball).
  • Add constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Add Class#subclasses method (#2733, @andrykonchin).
  • Implement Coverage.running? method (@andrykonchin).
  • Fix arguments implicit type conversion for Enumerable#zip and Array#zip (#2788, @andrykonchin).
  • Fix Array#unshift to not depend on Array#[]= and allow overriding #[]= in a subclass (#2772, @andrykonchin).
  • Fix syntactic check for void value expression (#2821, @eregon).
  • Fix Range#step with no block and non-Numeric values (#2824, @eregon).
  • Fix execution order of END blocks and at_exit callbacks (#2818, @andrykonchin).
  • Fix String#casecmp? for empty strings of different encodings (#2826, @eregon).
  • Implement Enumerable#compact and Enumerator::Lazy#compact (#2733, @andrykonchin).
  • Implement Array#intersect? (#2831, @nirvdrum).
  • Record the source location in the constant for the module/class keywords (#2833, @eregon).
  • Fix File.open and support flags option (#2820, @andrykonchin).
  • Support writing to RData.dfree for native extensions (#2830, #2732, #2165, @eregon).
  • Fix IO#write and support multiple arguments with different encodings (#2829, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, andrykonchin, @eregon).
  • Fix EncodingError exception message when Symbol has invalid encoding (#2850, @andrykonchin).
  • Raise EncodingError at parse time when Hash literal contains a Symbol key with invalid encoding (#2848, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, @andrykonchin, @eregon).
  • Fix Array methods select! and keep_if and handle a case when exception is raised in a passed block properly (@andrykonchin).
  • Fix Enumerable methods each_cons and each_slice to return receiver (#2733, @horakivo)
  • Module methods #private, #public, #protected, #module_function now returns their arguments like in CRuby 3.1 (#2733, @horakivo)
  • Kernel#exit!, killing Fibers and internal errors do not run code in ensure clauses anymore, the same as CRuby (@eregon).
  • Implement UnboundMethod#original_name (@paracycle, @nirvdrum).
  • Implement Thread#native_thread_id method (#2733, @horakivo).
  • Modify Struct#{inspect,to_s} to match MRI when the struct is nested inside of an anonymous class or module (@st0012, @nirvdrum).
  • Fiber.current and Fiber#transfer are available without require 'fiber' like in CRuby 3.1 (#2733, @eregon).
  • Add freeze keyword argument to Marshal.load (#2733, @andrykonchin).
  • Add Integer.try_convert (#2733, @moste00, @eregon).
  • Support optional :in keyword argument for Time.now and Time.new (#2733, @andrykonchin).
  • Add optional Hash argument to Enumerable#tally (#2733, @andrykonchin).
  • Update $LOAD_PATH.resolve_feature_path to return nil instead of raising LoadError when feature isn't found (#2733, @andrykonchin).
  • Add objspace/trace file (#2733, @andrykonchin).
  • Add Process._fork (#2733, @horakivo).
  • Update to JCodings 1.0.58 and Joni 2.1.44 (@eregon).
  • Add MatchData#match and MatchData#match_length (#2733, @horakivo).
  • Add StructClass#keyword_init? method (#2377, @moste00).
  • Support optional level argument for File.dirname method (#2733, @moste00).
  • Add Thread::Backtrace.limit method (#2733, @andrykonchin).
  • Deprecate rb_gc_force_recycle and make it a no-op function (#2733, @moste00).
  • Add Refinement#import_methods method and add deprecation warning for Refinement#include and Refinement#prepend (#2733, @horakivo).
  • Upgrading UNICODE version to 13.0.0 and EMOJI version to 13.1 (#2733, @horakivo).
  • Add rb_io_maybe_wait_readable, `...
Read more

TruffleRuby - GraalVM Community 23.0.0-preview1

28 Apr 12:51
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • Updated to Ruby 3.1.3 (#2733, @andrykonchin, @eregon).
  • foreign_object.is_a?(foreign_meta_object) is now supported (@eregon).
  • Foreign big integers are now supported and work with all Numeric operators (@eregon).

Bug fixes:

  • Ensure every parse node has a source section and fix the source section for ensure (#2758, @eregon).
  • Fix spawn(..., fd => fd) on macOS, it did not work due to a macOS bug (@eregon).
  • Fix rb_gc_register_address()/rb_global_variable() to read the latest value (#2721, #2734, #2720, @eregon).
  • Synchronize concurrent writes to the same StringIO (@eregon).
  • Fix StringIO#write(str) when str is of an incompatible encoding and position < buffer size (#2770, @eregon).
  • Fix rb_thread_fd_select() to correctly initialize fdset copies and handle the timeout (@eregon).
  • Fix TracePoint#inspect when it's called outside of a callback (@andrykonchin).
  • Fix Signal.trap when signal argument is not supported (#2774, @andrykonchin).
  • Fix Dir.mkdir and convert permissions argument to Integer (#2781, @andrykonchin).
  • Fix String#dump and use \u{xxxx} notation (with curly brackets) for characters that don't fit in \uxxxx (#2794, @andrykonchin).
  • Fix Marshal.dump when big Integer (that cannot be expressed with 4 bytes) is serialized (#2790, @andrykonchin).
  • Fix Array#pack and accept Numeric values when Float is expected (#2815, @andrykonchin).
  • Fix \P{} matching in regular expressions (#2798, @andrykonchin).
  • Fix constants lookup when BasicObject#instance_eval method is called with a String (#2810, @andrykonchin).
  • Don't trigger the method_added event when changing a method's visibility or calling module_function (@paracycle, @nirvdrum).
  • Fix rb_time_timespec_new function to not call Time.at method directly (@andrykonchin).
  • Fix StringIO#write to transcode strings with encodings that don't match the StringIO's external_encoding. (#2839, @flavorjones)
  • Fix processing of proc rest arguments located at the beginning if there are no actual arguments (#2921, @andrykonchin).
  • Fix Monitor#exit to raise ThreadError when monitor not owned by the current thread (#2922, @andrykonchin).
  • Fix MatchData#[] to support negative length argument (#2929, @andrykonchin).
  • Fix IO line reading calls when using a multi-byte delimiter (IO#{each,gets,readline,readlines,etc.}) (#2961, @vinistock, @nirvdrum).
  • Fix the exception type raised when type coercion raises a NoMethodError (#2903, @paracycle, @nirvdrum).
  • Fix Method and Proc #parameters method to return _ parameter name without synthetic suffix when there are multiple _ parameters (@paracycle).
  • Fixed errors in IRB when attempting to navigate beyond bounds in singleline mode (@rwstauner).

Compatibility:

  • Fix MatchData#[] when passed unbounded Range (#2755, @andrykonchin).
  • Updated rb_define_class, rb_define_class_under, and rb_define_class_id_under to allow class names that aren't valid in Ruby (#2739, @nirvdrum).
  • Fixed rb_gv_get so that it no longer implicitly creates global variables (#2748, @nirvdrum).
  • Added implementations of rb_gvar_val_getter and rb_define_virtual_variable (#2750, @nirvdrum).
  • Implement rb_warning_category_enabled_p to support the syntax_tree gem (#2764, @andrykonchin).
  • Fix desctructuring of a single block argument that implements #to_ary dynamically (#2719, @andrykonchin).
  • Fix Kernel#Complex and raise exception when an argument is formatted incorrectly (#2765, @andrykonchin).
  • Add #public?, #private? and #protected? methods for Method and UnboundMethod classes (@andrykonchin).
  • Add optional argument to Thread::Queue.new (@andrykonchin).
  • Support a module as the second argument of Kernel#load (@andrykonchin).
  • Improve argument validation in Struct#valies_at - raise IndexError or RangeError when arguments are out of range (#2773, @andrykonchin).
  • Fix MatchData#values_at and handling indices that are out of range (#2783, @andrykonchin).
  • Add support for %-z (UTC for unknown local time offset, RFC 3339) to Time#strftime (@andrykonchin).
  • Add support for UTC and A-Z utc offset values, as well as +/-HH, +/-HHMM, +/-HHMMSS (without :) (@andrykonchin).
  • Treat time with UTC, Z and -00:00 utc offset as UTC time (@andrykonchin).
  • Raise FrozenError when Time#localtime, Time#utc and Time#gmtime is called on a frozen time object (@andrykonchin).
  • Validate a microseconds argument used to create a time object (@andrykonchin).
  • Support accessing dmark and dfree fields for RData (#2771, @eregon).
  • Implement rb_enc_nth() (#2771, @eregon).
  • Support offset keyword argument for String#unpack and String#unpack1 (@andrykonchin).
  • Fix Process.detach and cast pid argument to Integer (#2782, @andrykonchin).
  • rb_to_id() should create a static ID, used by RMagick (@eregon).
  • Resolve the current user home even when $HOME is not set (#2784, @eregon)
  • Fix IO#lineno= and convert argument to Integer more strictly (#2786, @andrykonchin).
  • Fix argument implicit convertion in IO#pos= and IO#seek methods (#2787, @andrykonchin).
  • Warn about unknown directive passed to Array#pack in verbose mode (#2791, @andrykonchin).
  • Added constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Fix StringIO.new to accept keyword arguments (#2793, @andrykonchin).
  • Process#spawn should call #to_io on non-IO file descriptor objects (#2809, @jcouball).
  • Add constants IO::SEEK_DATE and IO::SEEK_HOLE (#2792, @andrykonchin).
  • Add Class#subclasses method (#2733, @andrykonchin).
  • Implement Coverage.running? method (@andrykonchin).
  • Fix arguments implicit type conversion for Enumerable#zip and Array#zip (#2788, @andrykonchin).
  • Fix Array#unshift to not depend on Array#[]= and allow overriding #[]= in a subclass (#2772, @andrykonchin).
  • Fix syntactic check for void value expression (#2821, @eregon).
  • Fix Range#step with no block and non-Numeric values (#2824, @eregon).
  • Fix execution order of END blocks and at_exit callbacks (#2818, @andrykonchin).
  • Fix String#casecmp? for empty strings of different encodings (#2826, @eregon).
  • Implement Enumerable#compact and Enumerator::Lazy#compact (#2733, @andrykonchin).
  • Implement Array#intersect? (#2831, @nirvdrum).
  • Record the source location in the constant for the module/class keywords (#2833, @eregon).
  • Fix File.open and support flags option (#2820, @andrykonchin).
  • Support writing to RData.dfree for native extensions (#2830, #2732, #2165, @eregon).
  • Fix IO#write and support multiple arguments with different encodings (#2829, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, andrykonchin, @eregon).
  • Fix EncodingError exception message when Symbol has invalid encoding (#2850, @andrykonchin).
  • Raise EncodingError at parse time when Hash literal contains a Symbol key with invalid encoding (#2848, @andrykonchin).
  • Fix Array methods reject, reject!, inject, map, select, each_index and handle a case when array is modified by a passed block like CRuby does (#2822, @andrykonchin, @eregon).
  • Fix Array methods select! and keep_if and handle a case when exception is raised in a passed block properly (@andrykonchin).
  • Fix Enumerable methods each_cons and each_slice to return receiver (#2733, @horakivo)
  • Module methods #private, #public, #protected, #module_function now returns their arguments like in CRuby 3.1 (#2733, @horakivo)
  • Kernel#exit!, killing Fibers and internal errors do not run code in ensure clauses anymore, the same as CRuby (@eregon).
  • Implement UnboundMethod#original_name (@paracycle, @nirvdrum).
  • Implement Thread#native_thread_id method (#2733, @horakivo).
  • Modify Struct#{inspect,to_s} to match MRI when the struct is nested inside of an anonymous class or module (@st0012, @nirvdrum).
  • Fiber.current and Fiber#transfer are available without require 'fiber' like in CRuby 3.1 (#2733, @eregon).
  • Add freeze keyword argument to Marshal.load (#2733, @andrykonchin).
  • Add Integer.try_convert (#2733, @moste00, @eregon).
  • Support optional :in keyword argument for Time.now and Time.new (#2733, @andrykonchin).
  • Add optional Hash argument to Enumerable#tally (#2733, @andrykonchin).
  • Update $LOAD_PATH.resolve_feature_path to return nil instead of raising LoadError when feature isn't found (#2733, @andrykonchin).
  • Add objspace/trace file (#2733, @andrykonchin).
  • Add Process._fork (#2733, @horakivo).
  • Update to JCodings 1.0.58 and Joni 2.1.44 (@eregon).
  • Add MatchData#match and MatchData#match_length (#2733, @horakivo).
  • Add StructClass#keyword_init? method (#2377, @moste00).
  • Support optional level argument for File.dirname method (#2733, @moste00).
  • Add Thread::Backtrace.limit method (#2733, @andrykonchin).
  • Deprecate rb_gc_force_recycle and make it a no-op function (#2733, @moste00).
  • Add Refinement#import_methods method and add deprecation warning for Refinement#include and Refinement#prepend (#2733, @horakivo).
  • Upgrading UNICODE version to 13.0.0 and EMOJI version to 13.1 (#2733, @horakivo).
  • Add rb_io_maybe_wait_readable, rb_io_maybe_wait_writable and rb_io_maybe_wait functions (#2733, @andrykonchin).
  • StringIO#set_encoding should coerce the argument to an Encoding (#2954, @eregon).
  • Implement ch...
Read more

TruffleRuby - GraalVM Community Edition 22.3.1

24 Jan 15:53
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

Bug fixes:

  • Fix rb_thread_fd_select() to correctly initialize fdset copies and handle the timeout (@eregon).
  • Fix Marshal.dump when big Integer (that cannot be expressed with 4 bytes) is serialized (#2790, @andrykonchin).

TruffleRuby - GraalVM Community Edition 22.3.0

25 Oct 11:02
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • Foreign strings now have all methods of Ruby String. They are treated as #frozen? UTF-8 Ruby Strings (@eregon).
  • Add Java.add_to_classpath method to add jar paths at runtime (#2693, @bjfish).
  • Add support for Ruby 3.1's Hash shorthand/punning syntax (@nirvdrum).
  • Add support for Ruby 3.1's anonymous block forwarding syntax (@nirvdrum).
  • Added the following keyword arguments to Polyglot::InnerContext.new: languages, language_options, inherit_all_access, code_sharing (@eregon).

Bug fixes:

  • Fix StringIO to set position correctly after reading multi-byte characters (#2207, @aardvark179).
  • Update Process methods to use module_function (@bjfish).
  • Fix File::Stat's #executable? and #executable_real? predicates that unconditionally returned true for a superuser (#2690, @andrykonchin).
  • The strip option --keep-section=.llvmbc is not supported on macOS (#2697, @eregon).
  • Disallow the marshaling of polyglot exceptions since we can't properly reconstruct them (@nirvdrum).
  • Fix String#split missing a value in its return array when called with a pattern of " " and a limit value > 0 on a string with trailing whitespace where the limit hasn't been met (@nirvdrum).
  • Fix Kernel#sleep and Mutex#sleep for durations smaller than 1 millisecond (#2716, @eregon).
  • Fix IO#{wait,wait_readable,wait_writable} with a timeout > INT_MAX seconds (@eregon).
  • Use the compatible encoding for String#{sub,gsub,index,rindex} (#2749, @eregon).

Compatibility:

  • Fix Array#fill to raise TypeError instead of ArgumentError when the length argument is not numeric (#2652, @andrykonchin).
  • Warn when a global variable is not initialized (#2595, @andrykonchin).
  • Fix escaping of / by Regexp#source (#2569, @andrykonchin).
  • Range literals of integers are now created at parse time like in CRuby (#2622, @aardvark179).
  • Fix IO.pipe - allow overriding IO.new that is used to create new pipes (#2692, @andrykonchin).
  • Fix exception message when there are missing or extra keyword arguments - it contains all the missing/extra keywords now (#1522, @andrykonchin).
  • Always terminate native strings with enough \0 bytes (#2704, @eregon).
  • Support #dup and #clone on foreign strings (@eregon).
  • Fix Regexp.new to coerce non-String arguments (#2705, @andrykonchin).
  • Fix Kernel#sprintf formatting for %c when used non-ASCII encoding (#2369, @andrykonchin).
  • Fix Kernel#sprintf argument casting for %c (@andrykonchin).
  • Implement the rb_enc_strlen function for use by native extensions (@nirvdrum).
  • Match tag values used by rb_protect and rb_jump_tag for the tk gem (#2556, @aardvark179).
  • Implement rb_eval_cmd_kw to support the tk gem (#2556, @aardvark179).
  • Fix rb_class2name to call inspect on anonymous classes like in CRuby (#2701, @aardvark179).
  • Implement rb_ivar_foreach to iterate over instance and class variables like in CRuby (#2701, @aardvark179).
  • Fix the absolute path of the main script after chdir (#2709, @eregon).
  • Fix exception for Fiddle::Handle.new with a missing library (#2714, @eregon).
  • Fix arguments implicit type conversion for BasicObject#instance_eval, Module#class_eval, Module#module_eval, Module#define_method (@andrykonchin).
  • Raise ArgumentError unconditionally when Proc.new is called without a block argument (@andrykonchin).
  • Fix UnboundMethod#hash to not depend on a module it was retrieved from (#2728, @andrykonchin).

Performance:

  • Replace a call of -"string" with frozen string literal at parse time (@andrykonchin).
  • Report polymorphism inside Hash#[] to recover performance (@aardvark179).
  • Improved interpreter performance by optimizing for better host inlining (@eregon).
  • Use poll instead of select for simple IO waiting to reduce overheads (#1584, @aardvark179).
  • TruffleString is now used to represent Ruby Strings which is faster can be shared with no overhead between languages (see details) (#2663, @eregon, @nirvdrum, @wildmaples, @andrykonchin).

Changes:

  • No more conversion between Java Strings and Ruby Strings at the interop boundary (@eregon).
  • Removed Truffle::Interop.{import_without_conversion,export_without_conversion} (use Polyglot.{import,export} instead).
  • Removed Truffle::Interop.members_without_conversion (use Truffle::Interop.members instead).
  • Refactored internals of rb_sprintf to simplify handling of VALUEs in common cases (@aardvark179).
  • Refactored sharing of array objects between threads using new SharedArrayStorage (@aardvark179).

Security:

  • The native access permission is now properly checked before any native pointer (e.g. Truffle::FFI::Pointer) is created (@eregon).

TruffleRuby - GraalVM Community Edition 22.2.0

26 Jul 11:30
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

Bug fixes:

  • Fix rb_id2name to ensure the native string will have the same lifetime as the id (#2630, @aardvark179).
  • Fix MatchData#[] exception when passing a length argument larger than the number of match values (#2636, @nirvdrum).
  • Fix MatchData#[] exception when supplying a large negative index along with a length argument (@nirvdrum).
  • Fix capacity computation for huge Hash (#2635, @eregon).
  • Fix aliased methods to return the correct owner when method is from a superclass (@bjfish).
  • Fix String#[Regexp, Integer] when the capture group exists but is not matched (@eregon).
  • Fix File.open mode string parsing when binary option is the third character (@bjfish).
  • Fix rb_scan_args_kw macro to avoid shadowing variables (#2649, @aardvark179).
  • Fix String#unpack("Z") to not advance after the null byte, like CRuby (#2659, @aardvark179).
  • Fix Float#round to avoid losing precision during the rounding process (@aardvark179).
  • Fix String#insert to not call a subclassed string method (@bjfish).
  • Fix rb_obj_call_init to pass any block argument to the initialize method (#2675, @aardvark179).
  • Fix issue with feature loading not detecting a previously loaded feature (#2677, @bjfish).
  • Fix /#{...}/o to evaluate only once per context when splitting happens (@eregon).
  • Fix Kernel#sprintf formatting of floats to be like CRuby (@aardvark179).
  • Fix Process.egid= to accept Strings (#2615, @ngtban)
  • Fix optional assignment to only evaluate index arguments once (#2658, @aardvark179).

Compatibility:

  • Updated to Ruby 3.0.3. The 3 CVEs did not affect TruffleRuby, this is to bring the stdlib and gem updates (@eregon).
  • Fix Marshal.dump to raise an error when an object has singleton methods (@bjfish).
  • Exception#full_message now defaults the order to :top like CRuby 3+ (@eregon).
  • Fix Process.wait2 to return nil when the WNOHANG flag is given and the child process is still running (@bjfish).
  • Disable most nokogiri C extension patches when system libraries are not being used (#2693, @aardvark179).
  • Implement rb_gc_mark_maybe and rb_global_variable to ensure VALUE stay live in C extensions (@aardvark179).
  • Implement rb_imemo_tmpbuf allocation for ripper (@aardvark179).
  • Implement inherit argument for Module#class_variables (#2653, @bjfish).
  • Fix Float#/ when dividing by Rational (@bjfish).
  • Process.euid= should accept String (#2615, @ngtban).
  • Fix instance_variable_get and instance_variable_set for immutable objects (@bjfish).
  • Thread#raise(exc, message) now calls exc.exception in the target thread like CRuby (@eregon).
  • Define Process::{CLOCK_BOOTTIME,CLOCK_BOOTTIME_ALARM,CLOCK_REALTIME_ALARM} (#1480, @eregon).
  • Improve support of :chomp keyword argument in IO and StringIO methods (#2650, @andrykonchin).
  • Implement specializations for immutable ruby objects for ObjectSpace methods (@bjfish).
  • Use $PAGER for --help and --help*, similar to CRuby (#2542, @Strech).
  • Ensure all headers are warnings-free (#2662, @eregon).
  • All IO instances should have T_FILE as their rb_type(), not only File instances (#2662, @eregon).
  • Make rb_fd_select retry on EINTR (#1584, @aardvark179).

Performance:

  • Reimplement Float#to_s for better performance (#1584, @aardvark179).
  • Improve reference processing by making C object free functions and other finalizers more lightweight (@aardvark179).
  • Improve performance of RSTRING_PTR for interned strings (@aardvark179).
  • Cache constant argument formats used with rb_scan_args_kw (@aardvark179).

Changes:

  • -Werror=implicit-function-declaration is now used for compiling C extensions to fail more clearly and earlier if a function is missing, like CRuby 3.2 (#2618, @eregon).
  • Disable thread pool for Fibers as it causes correctness issues (#2551, @eregon).

TruffleRuby - GraalVM Community Edition 22.1.0

26 Apr 10:34
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • Foreign exceptions are now fully integrated and have most methods of Exception (@eregon).
  • Foreign exceptions can now be rescued with rescue Polyglot::ForeignException or rescue foreign_meta_object (#2544, @eregon).

Bug fixes:

  • Guard against unterminated ranges in file matching patterns (#2556, @aardvark179).
  • Fixed rb_proc_new to return a proc that will pass all required arguments to C (#2556, @aardvark179).
  • Fixed String#split to return empty array when splitting all whitespace on whitespace (#2565, @bjfish).
  • Raise RangeError for Time.at(bignum) (#2580, @eregon).
  • Fix Integer#{<<,>>} with RHS bignum and long (@eregon).
  • Fix a resource leak from allocators defined in C extensions (@aardvark179).
  • SIGINT/Interrupt/Ctrl+C now shows the backtrace and exits as signaled, like CRuby (@eregon).
  • Update patch feature finding to prefer the longest matching load path (#2605, @bjfish).
  • Fix Hash#{to_s,inspect} for keys whose #inspect return a frozen String (#2613, @eregon).
  • Fix Array#pack with x* to not output null characters (#2614, @bjfish).
  • Fix Random#rand not returning random floats when given float ranges (#2612, @bjfish).
  • Fix Array#sample for [] when called without n and a Random is given (#2612, @bjfish).
  • Fix Module#const_get to raise a NameError when nested modules do not exist (#2610, @bjfish).
  • Ensure native VALUEs returned from C are unwrapped before the objects can be collected (@aardvark179).
  • Fix Enumerator::Lazy#with_index to start with new index for multiple enumerations (@bjfish).
  • Fix rb_id2name to ensure the native string will have the same lifetime as the id (#2630, @aardvark179).
  • Fix MatchData#[] exception when passing a length argument larger than the number of match values (#2636, @nirvdrum).
  • Fix MatchData#[] exception when supplying a large negative index along with a length argument (@nirvdrum).
  • Fix Integer#fdiv and Rational#to_f for large Integer values (#2631, @bjfish).

Compatibility:

  • Implement full Ruby 3 keyword arguments semantics (#2453, @eregon, @chrisseaton).
  • Implement ruby_native_thread_p for compatibility (#2556, @aardvark179).
  • Add rb_argv0 for the tk gem. (#2556, @aardvark179).
  • Implement more correct conversion of array elements by Array#pack(#2503, #2504, @aardvark179).
  • Implement Pathname#{empty?, glob} (#2559, @bjfish)
  • Fixed Rational('') to raise error like MRI (#2566, @aardvark179).
  • Freeze instances of Range but not subclasses, like CRuby (#2570, @MattAlp).
  • When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. (#2532, @gogainda).
  • Use #to_a for converting list in rescue *list (#2572, @eregon).
  • Implement 'rb_str_buf_append' (@bjfish).
  • Add patch for digest so that TruffleRuby implementation is not overridden (@bjfish).
  • Handle encoding conversion errors when reading directory entries (@aardvark179).
  • Follow symlinks when processing */ directory glob patterns. (#2589, @aardvark179).
  • Set @gem_prelude_index variable on the default load paths (#2586 , @bjfish)
  • Do not call IO#flush dynamically from IO#close (#2594, @gogainda).
  • Implement rb_str_new_static for C extensions that use it (@aardvark179).
  • Rewrote ArrayEachIteratorNode and re-introduced each specs for MRI parity when mutating arrays whilst iterating, rather than crashing (#2587, @MattAlp)
  • Update String#rindex to only accept Regexp or objects convertable to String as the first parameter (#2608, @bjfish).
  • Update String#<< to require one argument (#2609, @bjfish).
  • Update String#split to raise TypeError when false is given (#2606, @bjfish).
  • Update String#lstrip! to remove leading null characters (#2607, @bjfish).
  • Update File.utime to return the number of file names in the arguments (#2616, @bjfish).
  • Update Dir.foreach to accept an encoding parameter (#2627, @bjfish).
  • Update IO.readlines to ignore negative limit parameters (#2625 , @bjfish).
  • Update Math.sqrt to raise a Math::DomainError for negative numbers (#2621, @bjfish).
  • Update Enumerable#inject to raise an ArgumentError if no block or symbol are given (#2626, @bjfish).
  • Fix Marshal.dump to raise an error when an object has singleton methods (@bjfish).

Performance:

  • Increase dispatch limit for string library to handle mutable, immutable and non-strings (@aardvark179)
  • Switch to Arrays.mismatch() in string comparison for better performance (@aardvark179).
  • Removed extra array allocations for method calls in the interpreter to improve warmup performance (@aardvark179).
  • Optimize Dir[] by sorting entries as they are found and grouping syscalls (#2092, @aardvark179).
  • Reduce memory footprint by tracking VALUEs created during C extension init separately (@aardvark179).
  • Rewrote ArrayEachIteratorNode to optimize performance for a constant-sized array and reduce specializations to 1 general case (#2587, @MattAlp)
  • Reduce conversion of VALUEs to native handle during common operations in C extensions (@aardvark179).
  • Improved performance of regex boolean matches (e.g., Regexp#match?) by avoiding match data allocation in TRegex (#2588, @nirvdrum).
  • Remove overhead when getting using RDATA_PTR (@aardvark179).
  • Additional copy operations have been reduced when performing IO (#2536, @aardvark179).

Changes:

  • Foreign exceptions are no longer translated to RuntimeError but instead remain as foreign exceptions, see the documentation for how to rescue them (@eregon).

TruffleRuby - GraalVM Community Edition 22.0.0.2

25 Jan 14:29
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu utility.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

Bug fixes:

  • Fix File.utime to use nanoseconds (#2448, @bjfish).
  • Capture the intercepted feature path during patching to reuse during patch require (#2441, @bjfish).
  • Update Module#constants to filter invalid constant identifiers (#2452, @bjfish).
  • Fixed -0.0 <=> 0.0 and -0.0 <=> 0 to return 0 like on CRuby (#1391, @eregon).
  • Fixed Range#step to return correct class with begin-less range (@ccocchi, #2516).
  • Fixed exception creation when an Errno is sub-classed (@bjfish, #2521).
  • Fixed String#[]= to use the negotiated encoding (@bjfish, #2545).

Compatibility:

  • Implement rb_sprintf in our format compiler to provide consistent formatting across C standard libraries (@eregon).
  • Update defined? to return frozen strings (#2450, @bjfish).
  • Use compensated summation for {Array,Enumerable}#sum when floating point values are included (@eregon).
  • Module#attr_* methods now return an array of method names (#2498, @gogainda).
  • Fixed Socket#(local|remote)_address to retrieve family and type from the file descriptor (#2444, @larskanis).
  • Add Thread.ignore_deadlock accessor (#2453, @bjfish).
  • Allow Hash#transform_keys to take a hash argument (@ccocchi, #2464).
  • Add Enumerable#grep{_v} optimization for Regexp (#2453, @bjfish).
  • Update IO#write to accept multiple arguments (#2501, @bjfish).
  • Do not warn when uninitialized instance variable is accessed (#2502, @andrykonchin).
  • Remove TRUE, FALSE, and NIL constants like CRuby 3.0 (#2505, @andrykonchin).
  • Symbol#to_proc now returns a lambda like in Ruby 3 (#2508, @andrykonchin).
  • Kernel#lambda now warns if called without a literal block (#2500, @andrykonchin).
  • Implement Hash#except (#2463, @wildmaples).
  • Remove special $SAFE global and related C API methods (#2453, @bjfish).
  • Assigning to a numbered parameter raises SyntaxError (#2506, @andrykonchin).
  • Implement --backtrace-limit option (#2453, @bjfish).
  • Update String methods to return String instances when called on a subclass (#2453, @bjfish).
  • Update String#encode to support the :fallback option (#1391, @aardvark179).
  • Module#alias_method now returns the defined alias as a symbol(#2499, @gogainda).
  • Implement Symbol#name (#2453, @bjfish).
  • Update Module#{public, protected, private, public_class_method, private_class_method} and top-level private and public methods to accept single array argument with a list of method names (#2453, @bjfish).
  • Constants deprecated by Module#deprecate_constant only warn if Warning[:deprecated] is true (@eregon).
  • All Array methods now return Array instances and not subclasses (#2510, @Strech).
  • Integer#zero? overrides Numeric#zero? for optimization (#2453, @bjfish).
  • Default Kernel#eval source file and line to (eval):1 like CRuby 3 (#2453, @aardvark179).
  • Add GC.auto_compact accessors for compatibility (#2453, @bjfish).
  • Update accessing a class variable from the top-level scope to be a RuntimeError (#2453, @bjfish).
  • Update interpolated strings to not be frozen (#2453, @bjfish).
  • Add WERRORFLAG to RbConfig (#2519, @bjfish).
  • Update MatchData methods to return String instances when called on a subclass (#2453, @bjfish).
  • Implement Proc#{==,eql?} (#2453, @bjfish).
  • Implement all StringScanner methods (#2520, @eregon).
  • Handle Kernel#clone(freeze: true) (#2512, @andrykonchin).
  • Relax Fiber#transfer limitations (#2453, @bjfish).
  • Implement Fiber#blocking? like CRuby 3 (#2453, @aardvark179).
  • Sort by default for Dir.{glob,[]} and add sort: keyword argument (#2523, @Strech).
  • Implement rb_str_locktmp and rb_str_unlocktmp (#2524, @bjfish).
  • Update Kernel#instance_variables to return insertion order (@bjfish).
  • Fixed rb_path2class() to not error for a module (#2511, @eregon).
  • Update Kernel#print to print $_ when no arguments are given (#2531, @bjfish).
  • Add category kwarg to Kernel.warn and Warning.warn (#2533, @Strech).
  • Implement GC.{measure_total_time, total_time} and update GC.stat to update provided hash (#2535, @bjfish).
  • Implement Array#slice with ArithmeticSequence (#2526, @ccocchi).
  • Update Hash#each to consistently yield a 2-element array (#2453, @bjfish).
  • Remove Hash#{store, index} methods for compatibility (#2546, @bjfish).
  • Implement more correct conversion of array elements by Array#pack (#2503, #2504, @aardvark179).
  • Update String#split to raise a RangeError when limit is larger than int (@bjfish).

Performance:

  • Regexp objects are now interned in a similar way to symbols (@aardvark179).
  • Improve performance of regexps using POSIX bracket expressions (e.g., [[:lower:]]) matching against ASCII-only strings (#2447, @nirvdrum).
  • String#sub, sub!, gsub, and gsub! have been refactored for better performance (@aardvark179).
  • Don't allocate a MatchData object when Regexp#match? or String#match? is used (#2509, @nirvdrum).
  • Add ENV.except (#2507, @Strech).
  • Fully inline the Integer#+ and Integer#- logic for interpreter speed (#2518, @smarr).
  • Remove unnecessary work in negotiating the encoding to use in a Regexp match (#2522, @nirvdrum).
  • Add new fast paths for encoding negotiation between strings with different encodings, but which match common default cases (#2522, @nirvdrum).
  • Reduce footprint by removing unnecessary nodes for accessing the FrameOnStackMarker (#2530, @smarr).

Changes:

  • TruffleRuby now requires Java 11+ and no longer supports Java 8 (@eregon).

TruffleRuby - GraalVM Community Edition 21.3.0

19 Oct 14:21
Compare
Choose a tag to compare

TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby 2.7.3, MRI.

The Ruby support is not available in GraalVM by default and should be installed: gu install ruby.
More information is available on the website: http://www.graalvm.org/ruby/

Changelog

New features:

  • TRegex is now used by default, which provides large speedups for matching regular expressions (@jirkamarsik).
  • Add Polyglot.languages to expose the list of available languages.
  • Add Polyglot::InnerContext to eval code in any available language in an inner isolated context (#2169, @eregon).
  • Foreign objects now have a dynamically-generated class based on their interop traits like ForeignArray and are better integrated with Ruby objects (#2149, @eregon and @rbotafogo).
  • Foreign arrays now have all methods of Ruby Enumerable and many methods of Array (#2149, @eregon and @rbotafogo).
  • Foreign hashes now have all methods of Ruby Enumerable and many methods of Hash (#2149).
  • Foreign iterables (InteropLibrary#hasIterator) now have all methods of Ruby Enumerable (#2149).
  • Foreign objects now implement #instance_variables (readable non-invocable members) and #methods (invocable members + Ruby methods).

Bug fixes:

  • Fix Marshal.load of multiple Symbols with an explicit encoding (#1624).
  • Fix rb_str_modify_expand to preserve existing bytes (#2392, @bjfish).
  • Fix String#scrub when replacement is frozen (#2398, @LillianZ).
  • Fix Dir.mkdir error handling for Pathname paths (#2397).
  • BasicSocket#*_nonblock(exception: false) now only return :wait_readable/:wait_writable for EAGAIN/EWOULDBLOCK like MRI (#2400).
  • Fix issue with strspn used in the date C extension compiled as a macro on older glibc and then missing the __strspn_c1 symbol on newer glibc (#2406).
  • Fix constant lookup when loading the same file multiple times (#2408).
  • Fix handling of break, next and redo in define_method(name, &block) methods (#2418).
  • Fix handling of incompatible types in Float#<=> (#2432, @chrisseaton).
  • Fix issue with escaping curly braces for Dir.glob (#2425).
  • Fix base64 decoding issue with missing output (#2435).
  • Fix StringIO#ungetbyte to treat a byte as a byte, not a code point (#2436, @aardvark179).
  • Fix defined?(yield) when used inside a block (#2446).
  • Fix a couple issues related to native memory allocation and release.
  • Capture the intercepted feature path during patching to reuse during patch require (#2441).

Compatibility:

  • Implement Process::Status.wait (#2378).
  • Update rb_str_modify and rb_str_modify_expand to raise a FrozenError when given a frozen string (#2392).
  • Implement rb_fiber_* functions (#2402).
  • Implement rb_str_vcatf.
  • Add support for tracing allocations from C functions (#2403, @chrisseaton).
  • Implement rb_str_catf.
  • Search the executable in the passed env PATH for subprocesses (#2419).
  • Accept a string as the pattern argument to StringScanner#scan and StringScanner#check (#2423).

Performance:

  • Moved most of MonitorMixin to primitives to deal with interrupts more efficiently (#2375).
  • Improved the performance of rb_enc_from_index by adding cached lookups (#2379, @nirvdrum).
  • Improved the performance of many MatchData operations (#2384, @nirvdrum).
  • Significantly improved performance of TRegex calls by allowing Truffle splitting (#2389, @nirvdrum).
  • Improved String#gsub performance by adding a fast path for the string_byte_index primitive (#2380, @nirvdrum).
  • Improved String#index performance by adding a fast path for the string_character_index primitive (#2383, @LillianZ).
  • Optimized conversion of strings to integers if the string contained a numeric value (#2401, @nirvdrum).
  • Use Truffle's ContextThreadLocal to speedup access to thread-local data.
  • Provide a new fast path for rb_backref* and rb_lastline*functions from C extensions.

Changes:

  • foreign_object.class on foreign objects is no longer special and uses Kernel#class (it used to return the java.lang.Class object for a Java type or getMetaObject(), but that is too incompatible with Ruby code).
  • Java.import name imports a Java class in the enclosing module instead of always as a top-level constant.
  • foreign_object.keys no longer returns members, use foreign_object.instance_variables or foreign_object.methods instead.
  • foreign_object.respond_to?(:class) is now always true (before it was only for Java classes), since the method is always defined.

Security: