If the revision of bundled gems is specified for ruby master (and
`git` is usable), checkout that revision and build a snapshot gem, and
use it for `test-spec` instead of the downloaded release version.
To prevent the following strange error, prepare IDs at first.
```
<internal:ractor>:596:in 'Ractor#monitor': symbol :exited is already registered with 98610c (fatal)
from <internal:ractor>:550:in 'Ractor#join'
from <internal:ractor>:574:in 'Ractor#value'
from bootstraptest.test_ractor.rb_2013_1309.rb:12:in '<main>'
```
BTW, the error should be fixed on ID management system.
This commit allows building YJIT and ZJIT simultaneously, a "combo
build". Previously, `./configure --enable-yjit --enable-zjit` failed. At
runtime, though, only one of the two can be enabled at a time.
Add a root Cargo workspace that contains both the yjit and zjit crate.
The common Rust build integration mechanisms are factored out into
defs/jit.mk.
Combo YJIT+ZJIT dev builds are supported; if either JIT uses
`--enable-*=dev`, both of them are built in dev mode.
The combo build requires Cargo, but building one JIT at a time with only
rustc in release build remains supported.
* Since it does not work when using some configure options such as:
.../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
as the CI does.
* It also duplicates the logic of spec/ruby/optional/capi/spec_helper.rb incorrectly.
ruby/spec maintainers have no experience and no interest in dealing with these complicated CRuby build system issues.
We asked help on the CRuby Slack and nobody helped so far.
* But it doesn't work because there is no .ext/include/ruby/digest.h
when using .../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
as the CI does.
* Add opt_duparray_send insn to skip the allocation on `#include?`
If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.
This adds a BOP for include? and tracks redefinition for it on Array.
Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
* YJIT: Implement opt_duparray_send include_p
Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
* Update opt_newarray_send to support simple forms of include?(arg)
Similar to opt_duparray_send but for non-static arrays.
* YJIT: Implement opt_newarray_send include_p
---------
Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
Not to build the rubyspec-capiext extension libraries again on the
next build after the build all extensions get built, ensure these
extensions are up to date when recursively building from exts.mk.
By replacing `ALLOBJS` suffix with intermediate file suffixes instead
of roughly removing by wildcards. Made `cleanlibs` append `.dSYM`
suffix for each word in `TARGET_SO`, not the end of the entire list.
When I shared srcdir as read-only in lima-vm,
`make install` causes following error:
```
Update rbs to 33813a60752624d58dfe5ae770b39bfaf29fbaf1
error: cannot open .git/FETCH_HEAD: Read-only file system
```
I cannot find any ignore option for `git checkout --detach`
when already checked out. So I add `if`.
This commit introduces a new instruction `opt_newarray_send` which is
used when there is an array literal followed by either the `hash`,
`min`, or `max` method.
```
[a, b, c].hash
```
Will emit an `opt_newarray_send` instruction. This instruction falls
back to a method call if the "interested" method has been monkey
patched.
Here are some examples of the instructions generated:
```
$ ./miniruby --dump=insns -e '[@a, @b].max'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable :@a, <is:0> ( 1)[Li]
0003 getinstancevariable :@b, <is:1>
0006 opt_newarray_send 2, :max
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].min'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable :@a, <is:0> ( 1)[Li]
0003 getinstancevariable :@b, <is:1>
0006 opt_newarray_send 2, :min
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].hash'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
0000 getinstancevariable :@a, <is:0> ( 1)[Li]
0003 getinstancevariable :@b, <is:1>
0006 opt_newarray_send 2, :hash
0009 leave
```
[Feature #18897] [ruby-core:109147]
Co-authored-by: John Hawthorn <jhawthorn@github.com>