Age | Commit message (Collapse) | Author |
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4391
|
|
* It evaluated to 0 before, revealed by -Wundef
* See [Feature #17752]
Co-authored-by: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/4428
|
|
to make imemo_ast WB-protected again. Only the test is kept.
Notes:
Merged: https://github.com/ruby/ruby/pull/4419
|
|
Previously imemo_ast was handled as WB-protected which caused a segfault
of the following code:
# shareable_constant_value: literal
M0 = {}
M1 = {}
...
M100000 = {}
My analysis is here: `shareable_constant_value: literal` creates many
Hash instances during parsing, and add them to node_buffer of imemo_ast.
However, the contents are missed because imemo_ast is incorrectly
WB-protected.
This changeset makes imemo_ast as WB-unprotected.
Notes:
Merged: https://github.com/ruby/ruby/pull/4416
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4414
|
|
As it is an independent feature from `clz`, `ctz` and `popcount`,
it might be unavailable even if the latters are built in.
Notes:
Merged: https://github.com/ruby/ruby/pull/4372
|
|
If called with an autoloaded encoding that was not yet
initialized, `rb_enc_interned_str` would crash with
a NULL pointer exception.
See: https://github.com/ruby/ruby/pull/4119#issuecomment-800189841
Notes:
Merged: https://github.com/ruby/ruby/pull/4290
|
|
Instead of rather euphemistic struct cast, just reomve the const
qualifier and assign directly. According to ISO/IEC 9899:2018 section
6.5 paragraph 7, `VALUE` and `const VALUE` are allowed to alias (but two
distinct structs are not, even when their structures are the same).
[Bug #17540]
Notes:
Merged: https://github.com/ruby/ruby/pull/4232
|
|
|
|
* Rename `rb_scheduler` to `rb_fiber_scheduler`.
* Use public interface if available.
* Use `rb_check_funcall` where possible.
* Don't use `unblock` unless the fiber was non-blocking.
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4124
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4124
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4124
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4124
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4135
|
|
This reverts commit fac2498e0299f13dffe4f09a7dd7657fb49bf643 for
now, due to [Bug #17509], the breakage in the case `super` is
called in `respond_to?`.
Notes:
Merged: https://github.com/ruby/ruby/pull/4057
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4053
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4037
|
|
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.
This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]
Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.
`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/4022
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4023
Merged-By: nobu <nobu@ruby-lang.org>
|
|
This avoids recursive checks when the `hash` method of an object
isn't specialized.
Notes:
Merged-By: nurse <naruse@airemix.jp>
|
|
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' benchmark/mjit_integer.yml --filter '(comp|uminus)'
before --jit: ruby 3.0.0dev (2020-12-23T05:41:44Z master 0dd4896175) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-12-23T06:25:41Z master 8887d78992) +JIT [x86_64-linux]
last_commit=Allow inlining Integer#-@ and #~
Calculating -------------------------------------
before --jit after --jit
mjit_comp(1) 44.006M 70.417M i/s - 40.000M times in 0.908967s 0.568042s
mjit_uminus(1) 44.333M 68.422M i/s - 40.000M times in 0.902255s 0.584603s
Comparison:
mjit_comp(1)
after --jit: 70417331.4 i/s
before --jit: 44005980.4 i/s - 1.60x slower
mjit_uminus(1)
after --jit: 68422468.8 i/s
before --jit: 44333371.0 i/s - 1.54x slower
```
|
|
Make the code a bit modern and consistent with some other places.
|
|
Since we decided to only allowing specific warning categories,
there is no reason to have an API that accepts a general string,
as it is more error-prone. Switch to only allowing the specific
warning categories.
As rb_category_warn{,ing} are public API, this requires making
rb_warning_category_t public API as well.
Notes:
Merged: https://github.com/ruby/ruby/pull/3917
|
|
* make rb_init_iv_list() simple
* introduce vm_setivar_slowpath() for cache miss cases
../clean/miniruby is 647ee6f091.
Calculating -------------------------------------
./miniruby ../clean/miniruby ../ruby_2_7/miniruby
vm_ivar_init 7.388M 6.814M 5.771M i/s - 30.000M times in 4.060420s 4.402534s 5.198781s
vm_ivar_init_subclass 2.158M 2.147M 1.974M i/s - 3.000M times in 1.390328s 1.397587s 1.519951s
vm_ivar_set 128.607M 97.931M 140.668M i/s - 30.000M times in 0.233269s 0.306338s 0.213268s
vm_ivar 144.315M 151.722M 117.734M i/s - 30.000M times in 0.207879s 0.197730s 0.254811s
Comparison:
vm_ivar_init
./miniruby: 7388398.8 i/s
../clean/miniruby: 6814257.1 i/s - 1.08x slower
../ruby_2_7/miniruby: 5770583.9 i/s - 1.28x slower
vm_ivar_init_subclass
./miniruby: 2157763.6 i/s
../clean/miniruby: 2146557.0 i/s - 1.01x slower
../ruby_2_7/miniruby: 1973747.9 i/s - 1.09x slower
vm_ivar_set
../ruby_2_7/miniruby: 140668063.8 i/s
./miniruby: 128606912.1 i/s - 1.09x slower
../clean/miniruby: 97931027.8 i/s - 1.44x slower
vm_ivar
../clean/miniruby: 151722121.9 i/s
./miniruby: 144314526.5 i/s - 1.05x slower
../ruby_2_7/miniruby: 117734305.5 i/s - 1.29x slower
Notes:
Merged: https://github.com/ruby/ruby/pull/3912
|
|
`cd` is passed to method call functions to method invocation
functions, but `cd` can be manipulated by other ractors simultaneously
so it contains thread-safety issue.
To solve this issue, this patch stores `ci` and found `cc` to `calling`
and stops to pass `cd`.
Notes:
Merged: https://github.com/ruby/ruby/pull/3903
|
|
Since UNALIGNED_MEMBER_ACCESS assigns to an intermediate variable,
it can cause unused-value warnings.
|
|
sequences (#3870)
[Bug #17218]
[ruby-core:100312]
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3853
|
|
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
Notes:
Merged: https://github.com/ruby/ruby/pull/3842
|
|
NEWOBJ with current ec.
Notes:
Merged: https://github.com/ruby/ruby/pull/3842
|
|
Fix a typo: "nevative" => "negative" in `rb_fix_plus_fix`.
Notes:
Merged: https://github.com/ruby/ruby/pull/3834
|
|
Same as 8247b8edde, should not use rb_str_modify() here.
https://bugs.ruby-lang.org/issues/17343#change-88858
Notes:
Merged: https://github.com/ruby/ruby/pull/3833
|
|
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]
A test is quoted from https://github.com/ruby/ruby/pull/3817
Notes:
Merged: https://github.com/ruby/ruby/pull/3831
|
|
Sorry, I forgot to delete this at 55866565c24765a1722e2c415a6776f3f77e89d0.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3777
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3741
|
|
When the inline cache is written, the iv table will contain an entry for
the instance variable. If we get an inline cache hit, then we know the
iv table must contain a value for the index written to the inline cache.
If the index in the inline cache is larger than the list on the object,
but *smaller* than the iv index table on the class, then we can just
eagerly allocate the iv list to be the same size as the iv index table.
This avoids duplicate work of checking frozen as well as looking up the
index for the particular instance variable name.
Notes:
Merged: https://github.com/ruby/ruby/pull/3740
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3742
|
|
* `GC.auto_compact=`, `GC.auto_compact` can be used to control when
compaction runs. Setting `auto_compact=` to true will cause
compaction to occurr duing major collections. At the moment,
compaction adds significant overhead to major collections, so please
test first!
[Feature #17176]
|
|
Introduce new method Ractor.make_shareable(obj) which tries to make
obj shareable object. Protocol is here.
(1) If obj is shareable, it is shareable.
(2) If obj is not a shareable object and if obj can be shareable
object if it is frozen, then freeze obj. If obj has reachable
objects (rs), do rs.each{|o| Ractor.make_shareable(o)}
recursively (recursion is not Ruby-level, but C-level).
(3) Otherwise, raise Ractor::Error. Now T_DATA is not a shareable
object even if the object is frozen.
If the method finished without error, given obj is marked as
a sharable object.
To allow makng a shareable frozen T_DATA object, then set
`RUBY_TYPED_FROZEN_SHAREABLE` as type->flags. On default,
this flag is not set. It means user defined T_DATA objects are
not allowed to become shareable objects when it is frozen.
You can make any object shareable by setting FL_SHAREABLE flag,
so if you know that the T_DATA object is shareable (== thread-safe),
set this flag, at creation time for example. `Ractor` object is one
example, which is not a frozen, but a shareable object.
Notes:
Merged: https://github.com/ruby/ruby/pull/3678
|
|
* Support ArithmeticSequence in Array#slice
* Extract rb_range_component_beg_len
* Use rb_range_values to check Range object
* Fix ary_make_partial_step
* Fix for negative step cases
* range.c: Describe the role of err argument in rb_range_component_beg_len
* Raise a RangeError when an arithmetic sequence refers the outside of an array
[Feature #16812]
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
|
|
iv_index_tbl manages instance variable indexes (ID -> index).
This data structure should be synchronized with other ractors
so introduce some VM locks.
This patch also introduced atomic ivar cache used by
set/getinlinecache instructions. To make updating ivar cache (IVC),
we changed iv_index_tbl data structure to manage (ID -> entry)
and an entry points serial and index. IVC points to this entry so
that cache update becomes atomically.
Notes:
Merged: https://github.com/ruby/ruby/pull/3662
|
|
|
|
And `-w` option turns it on.
Notes:
Merged: https://github.com/ruby/ruby/pull/3481
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3558
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3557
|
|
* Move #kernel_sleep next to #block as it is similar
|
|
* Enables Mutex to be used as synchronization between multiple Fibers
of the same Thread.
* With a Fiber scheduler we can yield to another Fiber on contended
Mutex#lock instead of blocking the entire thread.
* This also makes the behavior of Mutex consistent across CRuby, JRuby and TruffleRuby.
* [Feature #16792]
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|