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.
Predefined macros are practices not very well recommended, but can be
better than having no documents at all. Without those predefined
macros, Doxygen confused for instace PUREFUNC(int foo()) to be a
declaration of PUREFUNC, not foo.
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
prelude.c is an automatically generated file by template/prelude.c.tmpl.
However it does not contain any required functions. So remove it from
dependency.
Also miniprelude.c is included by mini_builtin.c and does not need
to make miniprelude.o.
The script in prelude.rb was embed in MRI to load it (eval this
script at everyboot).
This commit change the loading process of prelude.rb. MRI doesn't
eval a script, but load from compiled binary with builtin feature.
So that Init_prelude() does not load `prelude.rb` now.
FreeBSD make works differently with `-j` option.
> -j max_jobs
> Specify the maximum number of jobs that `make` may have running
> at any one time. The value is saved in `.MAKE.JOBS.` Turns
> compatibility mode off, unless the `B` flag is also specified.
> When compatibility mode is off, all commands associated with a
> target are executed in a single shell invocation as opposed to
> the traditional one shell invocation per line. This can break
> traditional scripts which change directories on each command
> invocation and then expect to start with a fresh environment on
> the next line. It is more efficient to correct the scripts
> rather than turn backwards compatibility on.
Stop using exit, cd, exec in middle of commands.
Instead of reading from the files by the full-path at runtime. As
rbinc files need to be included in distributed tarballs, the
full-paths at the packaging are unavailable at compilation times.
Compilation of extension libraries written in C++ are reportedly
broken due to https://github.com/ruby/ruby/pull/2404
The root cause of this issue was that the definition of ANYARGS
differ between C and C++, and that of C++ is incompatible with the
updated ones.
We are using the incompatibility against itself. In C++ two distinct
function prototypes can be overloaded. We provide the old, ANYARGSed
prototypes in addition to the current granular ones; and let the
older ones warn about types.
* template/unicode_norm_gen.tmpl: Change formatting of output to produce only a
single item (or range) for each line to make future diffs shorter and easier
to understand and check.
* lib/unicode_normalize/tables.rb: output of the above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* To be able to run spec/ruby/command_line/dash_encoding_spec.rb
with the in-repo build.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We see several occurrence of "diagnostic push/pop" so why not
make them macros. Tested on GCC8 / Clang 6.
Note that ruby.h is intentionally left untouched because we don't
want to introduce new public macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/fake.rb.in: switch RUBY_DESCRIPTION at runtime
depending on the MJIT status.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e