| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* YJIT: Rest and block_arg support
* Update bootstraptest/test_yjit.rb
---------
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
|
| |
|
|
|
|
|
| |
For now, the old function still exists as `old_rp`, in order to debug
issues with this command.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using rb_data_type_struct to wrap a C struct, that C struct can
contain VALUE references to other Ruby objects.
If this is the case then one must also define dmark and optionally
dcompact callbacks in order to allow these objects to be correctly
handled by the GC. This is suboptimal as it requires GC related logic to
be implemented by extension developers. This can be a cause of subtle
bugs when references are not marked of updated correctly inside these
callbacks.
This commit provides an alternative approach, useful in the simple case
where the C struct contains VALUE members (ie. there isn't any
conditional logic, or data structure manipulation required to traverse
these references).
In this case references can be defined using a declarative syntax
as a list of edges (or, pointers to references).
A flag can be set on the rb_data_type_struct to notify the GC that
declarative references are being used, and a list of those references
can be assigned to the dmark pointer instead of a function callback, on
the rb_data_type_struct.
Macros are also provided for simple declaration of the reference list,
and building edges.
To avoid having to also find space in the struct to define a length for
the references list, I've chosed to always terminate the references list
with RUBY_REF_END - defined as UINTPTR_MAX. My assumption is that no
single struct will ever be large enough that UINTPTR_MAX is actually a
valid reference.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Bug #19531]
```ruby
wmap[1] = "A"
wmap[1] = "B"
```
In the example above, we need to remove the `"A" => 1` inverse reference
so that when `"A"` is GCed the `1` key isn't deleted.
|
|
|
|
|
|
|
|
| |
* Use an `Enumerable` as factors, instead of three arguments.
* Include `assert_operator` time in rehearsal time.
* Round up max expected time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Rc` and `RefCell` both incur runtime space costs.
In addition, `RefCell` has given us some headaches with the
non obvious borrow panics it likes to throw out. The latest
one started with 7fd53eeb46db261bbc20025cdab70096245a5cbe
and is yet to be resolved.
Since we already rely on the GC to properly reclaim memory for `Block`
and `Branch`, we might as well stop paying the overhead of `Rc` and
`RefCell`. The `RefCell` panics go away with this change, too.
On 25 iterations of `railsbench` with a stats build I got
`yjit_alloc_size: 8,386,129 => 7,348,637`, with the new memory size 87.6%
of the status quo. This makes the metadata and machine code size roughly
line up one-to-one.
The general idea here is to use `&` shared references with
[interior mutability][1] with `Cell`, which doesn't take any extra
space. The `noalias` requirement that `&mut` imposes is way too hard to
meet and verify. Imagine replacing places where we would've gotten
`BorrowError` from `RefCell` with Rust/LLVM miscompiling us due to aliasing
violations. With shared references, we don't have to think about subtle
cases like the GC _sometimes_ calling the mark callback while codegen
has an aliasing reference in a stack frame below. We mostly only need to
worry about liveness, with which the GC already helps.
There is now a clean split between blocks and branches that are not yet
fully constructed and ones that are "in-service", so to speak. Working
with `PendingBranch` and `JITState` don't really involve `unsafe` stuff.
This change allows `Branch` and `Block` to not have as many optional
fields as many of them are only optional during compilation. Fields that
change post-compilation are wrapped in `Cell` to facilitate mutation
through shared references.
I do some `unsafe` dances here. I've included just a couple tests to run
with Miri (`cargo +nightly miri test miri`). We can add more Miri tests
if desired.
[1]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
|
| |
|
|
|
|
|
|
|
|
| |
* undefine Kernel#irb_original_require in without_rdoc method
* Don't rescue all LoadErrors/NameErrors in test_rendering.rb, just
the one for require 'yamatanooroti'
https://github.com/ruby/irb/commit/52b79806ea
|
|
|
|
|
| |
If the flag FL_FINALIZE is set, then it's guaranteed to be in the
finalizer_table, so we can directly assume that without checking.
|
|
|
|
|
| |
Early total_exits condition.
Replace Array#sort_by/first(how_many) with Array#max_by(how_many).
Replace Array#map/max with Array#max_by, match print_counters style for longest_name_length.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unrelated git sources directly
Since Bundler 2.4, we will try to checkout any branch specified in the
Gemfile, while until Bundler 2.3 we would directly checkout the locked
revision.
This should not make any difference in most situations, but in some edge
cases, like if the branch specified in the `Gemfile` has been renamed,
but the locked revision still exist, it causes an error now while before
it would update the lockfile without issues.
I debated which behavior was best, since I was not sure. But my
conclusion is that if the situation does not require expiring the
lockfile source in favor of the Gemfile source, we should use the locked
revision directly and proceed happily. So I restored Bundler 2.3
behavior.
I think this is consistent with how yanked gems are handled, for example.
Of course, if explicitly updating the git source itself, or all gems, we
will still get any errors like missing branches related to the git source.
|
|
|
|
|
|
|
|
| |
This was working fine for direct dependencies using
`force_ruby_platform` explicitly through Gemfile, but not for indirect
dependencies. In general, indirect dependencies do not have this
property set, but in truffleruby this is different and the default value
is to have it set.
|
|
|
|
|
|
|
|
|
| |
This should be a very rare edge case, however, it does happen when using
a .dev version of Bundler because in that case, that's the only version
that the resolver considers, and it should not be ignored.
We could've special cased this specifically for Bundler, but I think it
does make sense for every gem.
|
|
|
|
|
| |
Just like gem sources, a "style-only" change, like adding a trailing
slash, should not expire them.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/97f062be05
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/aa058ff6b8
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/b595d3cf0f
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/3e4f5dc008
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/01c2b5542f
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/97e0af2518
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/02d8147243
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/965fc82cfd
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/184c03270c
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/64f437a428
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/80b57da926
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/b490379eab
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/ae3bdc0e85
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/2b056b25c3
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/c766a65885
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/dae8fc70a4
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/7c1168c623
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/04227104ac
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/295691d4dc
|
|
|
|
| |
https://github.com/rubygems/rubygems/commit/23ce9793e5
|