зеркало из https://github.com/github/ruby.git
f90549cd38
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
|
||
---|---|---|
.. | ||
pending.rb | ||
runner.rb | ||
test_attr.rb | ||
test_autoload.rb | ||
test_block.rb | ||
test_class.rb | ||
test_constant_cache.rb | ||
test_env.rb | ||
test_eval.rb | ||
test_exception.rb | ||
test_fiber.rb | ||
test_finalizer.rb | ||
test_flip.rb | ||
test_flow.rb | ||
test_fork.rb | ||
test_gc.rb | ||
test_insns.rb | ||
test_io.rb | ||
test_jump.rb | ||
test_literal.rb | ||
test_literal_suffix.rb | ||
test_load.rb | ||
test_marshal.rb | ||
test_massign.rb | ||
test_method.rb | ||
test_objectspace.rb | ||
test_proc.rb | ||
test_ractor.rb | ||
test_string.rb | ||
test_struct.rb | ||
test_syntax.rb | ||
test_thread.rb | ||
test_yjit.rb | ||
test_yjit_30k_ifelse.rb | ||
test_yjit_30k_methods.rb | ||
test_yjit_rust_port.rb |