In principle, we have a DTrace probe in yjit.c, so yjit.o should be
in DTRACE_DEPENDENT_OBJS for DTRACE_REBUILD=yes builds. This commit
adds to the list.
In practice DTRACE_REBUILD=yes implies the system has a Solaris-like
DTrace and YJIT doesn't support those systems. YJIT_OBJ expands to
nothing, and yjit.c isn't compiled.
I tested on OmniOS v11 r151034m with:
$ ../src/configure --with-out-ext=psych MAKE=gmake AR=ar debugflags=-g
$ gmake -j
It builds before and after this change.
[Bug #18480]
Reduce duplicate replacements so that reflect macros in command lines
consitently. So that reflect macros in command lines. Others than
`nmake` have no problems with nested expansions.
Previously, we relied on shell word splitting, which leads
to passing the wrong arguments when there are white spaces
in the path.
Avoiding command substitution also makes this script more
likely to work under Solaris 10, where `/bin/sh` is not
POSIX compliant [1]. (Thanks you, `@znz` for fixing the syntax
error in 4210ae2158 though!)
The hack from c466f270b8
doesn't actually work so this commit reverts it. The shell
still needs to parse through all of the code, maybe because
make doesn't in fact send newlines to the shell.
By the way, we also use the `-exec` option in the `ext/distclean` task.
[1]: https://docs.oracle.com/cd/E26505_01/html/816-5165/sh-1.html
The shell in Solaris 10 has trouble understanding the syntax I used in
YJIT's library merging script.
This commit reduces the code the shell needs to parse before exiting on
non-YJIT builds to hopefully fix the error on Solaris.
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:
1fd9573d8b
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
Previously, `make test-spec` was not printing the description with +YJIT
even when YJIT was indeed enabled. It was confusing on CI. `fake.rb` was
changing the `RUBY_DESCRIPTION` constant incorrectly.
I suppose `make test-spec` mostly needs the `mkmf` faking and not the
faking of `RUBY_.*` constants, so maybe there is an opportunity to simplify
in the future.
This is another attempt to fix out-of-src build with
--with-static-linked-ext. The first attempt was
4f1888bda70981d9f5b1bf55ab692e0ce18e79f4 but reverted because it broke
out-of-src build from pre-generated sources via `make dist`.
This patch fixes the second trans C source gen, mentioned in the
previous commit message, by passing MINIRUBY as well as when invoking
from common.mk
* Rename --jit to --mjit
[Feature #18349]
* Fix a few more --jit references
* Fix MJIT Actions
* More s/jit/mjit/ and re-introduce --disable-jit
* Update NEWS.md
* Fix test_bug_reporter_add
This prevents file-static functions/variables be listed in the CAPI
documents. An entity shall be placed inside of a file that contains
`@file` doxygen comment, in order for it to be documented. [ci skip]
I often feel that C API documents are lacked in C source codes,
especially for static functions. I propose to turn EXTRACT_STATIC = YES
flag of Doxygen to YES, and write document comments for static functions
as much as possible.
* template/Doxyfile.tmpl: EXTRACT_STATIC: YES [Bugs #14037]
I guess we don't want documents for C API of extension libraries? They
are never intended to provide C APIs anyways.
We could revisit this decision later. [ci skip]
Didn't question the current settings. This changeset just re-applied
`doxygen -g` against:
doxygen 1.9.0 (1e72202d8fa0e9d2b3f2a29c88ec4f5790a0a4e2)
[ci skip]
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.
[Feature #17490]
`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`.
Performance is probably improved?
$ benchmark-driver -v --rbenv 'before --jit;after --jit' --repeat-count=12 --alternate --output=all benchmark.yml
before --jit: ruby 3.0.0dev (2020-11-27T04:37:47Z master 69e77e81dc) +JIT [x86_64-linux]
after --jit: ruby 3.0.0dev (2020-11-27T05:28:19Z master df6b05c6dd) +JIT [x86_64-linux]
last_commit=Set VM_FRAME_FLAG_FINISH at once
Calculating -------------------------------------
before --jit after --jit
Optcarrot Lan_Master.nes 80.89292998533379 82.19497327502751 fps
80.93130641142331 85.13943315260148
81.06214830270119 87.43757879797808
82.29172808453910 87.89942441487113
84.61206450455929 87.91309779491075
85.44545883567997 87.98026086648694
86.02923132404449 88.03081060383973
86.07411817365879 88.14650206137341
86.34348799602836 88.32791633649961
87.90257338977324 88.57599644892220
88.58006509876580 88.67426384743277
89.26611118140011 88.81669430874207
This should have no bad impact on VM because this function is ALWAYS_INLINE.