summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/yjit.yml15
-rw-r--r--README.md4
-rw-r--r--ruby.c4
-rw-r--r--yjit.h2
-rw-r--r--yjit_core.c4
-rw-r--r--yjit_iface.c4
6 files changed, 20 insertions, 13 deletions
diff --git a/.github/workflows/yjit.yml b/.github/workflows/yjit.yml
index b758724de2..6263e7c533 100644
--- a/.github/workflows/yjit.yml
+++ b/.github/workflows/yjit.yml
@@ -1,16 +1,23 @@
-name: YJIT threshold one
+name: YJIT options
on: [push, pull_request]
jobs:
make:
strategy:
matrix:
- test_task: [ "check" ] # to make job names consistent
+ # To make job names consistent
+ test_task: [ "check" ]
+ # Run with multiple thresholds and params to surface more bugs
+ yjit_opts: [
+ "--yjit-call-threshold=1 --yjit-max-versions=1",
+ "--yjit-call-threshold=1",
+ "--yjit-call-threshold=2"
+ ]
fail-fast: false
runs-on: ubuntu-latest
env:
TESTOPTS: '-q --tty=no'
- RUN_OPTS: '--disable-gems --yjit-call-threshold=1'
- GITPULLOPTIONS: --no-tags origin ${{github.ref}}
+ RUN_OPTS: '--disable-gems ${{ matrix.yjit_opts }}'
+ GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
steps:
- run: mkdir build
working-directory:
diff --git a/README.md b/README.md
index 705864f82e..2995999911 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ YJIT supports all command-line options supported by upstream CRuby, but also add
- `--yjit-stats`: produce statistics after the execution of a program (must compile with `cppflags=-DRUBY_DEBUG` to use this)
- `--yjit-exec-mem-size=N`: size of the executable memory block to allocate (default 256 MiB)
- `--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function (default 2)
-- `--yjit-version-limit=N`: maximum number of versions to generate per basic block (default 4)
+- `--yjit-max-versions=N`: maximum number of versions to generate per basic block (default 4)
- `--yjit-greedy-versioning`: greedy versioning mode (disabled by default, may increase code size)
### Benchmarking
@@ -125,7 +125,7 @@ We welcome open source contributors. You should feel free to open new issues to
Suggestions on how to make this readme file more helpful for new contributors are most welcome.
Bug fixes and bug reports are very valuable to us. If you find a bug in YJIT, it's very possible be that nobody has reported it before,
-or that we don't have a good reproduction for it, so please open an issue and provide as much information as you can about your configuration and a description of how you encountered the problem. List the commands you used to run YJIT so that we can easily reproduce the issue on our end and investigate it. If you are able to produce a small program reproducing the error to help us track it down, that is very much appreciated as well.
+or that we don't have a good reproduction for it, so please open an issue and provide as much information as you can about your configuration and a description of how you encountered the problem. List the commands you used to run YJIT so that we can easily reproduce the issue on our end and investigate it. If you are able to produce a small program reproducing the error to help us track it down, that is very much appreciated as well.
If you would like to contribute a large patch to YJIT, we suggest opening an issue or a discussion on this repository so that
we can have an active discussion. A common problem is that sometimes people submit large pull requests to open source projects
diff --git a/ruby.c b/ruby.c
index c7bc2ad7a8..8440969650 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1042,8 +1042,8 @@ setup_yjit_options(const char *s, struct rb_yjit_options *yjit_opt)
else if (opt_match_arg(s, l, "call-threshold")) {
yjit_opt->call_threshold = atoi(s + 1);
}
- else if (opt_match_arg(s, l, "version-limit")) {
- yjit_opt->version_limit = atoi(s + 1);
+ else if (opt_match_arg(s, l, "max-versions")) {
+ yjit_opt->max_versions = atoi(s + 1);
}
else if (opt_match_noarg(s, l, "greedy-versioning")) {
yjit_opt->greedy_versioning = true;
diff --git a/yjit.h b/yjit.h
index 1969ced260..cb41e76ecf 100644
--- a/yjit.h
+++ b/yjit.h
@@ -45,7 +45,7 @@ struct rb_yjit_options {
// Maximum number of versions per block
// 1 means always create generic versions
- unsigned version_limit;
+ unsigned max_versions;
// Capture and print out stats
bool gen_stats;
diff --git a/yjit_core.c b/yjit_core.c
index 6a5bff4171..e90347237f 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -421,7 +421,7 @@ block_t* find_block_version(blockid_t blockid, const ctx_t* ctx)
if (rb_yjit_opts.greedy_versioning)
{
// If we're below the version limit, don't settle for an imperfect match
- if ((uint32_t)rb_darray_size(versions) + 1 < rb_yjit_opts.version_limit && best_diff > 0) {
+ if ((uint32_t)rb_darray_size(versions) + 1 < rb_yjit_opts.max_versions && best_diff > 0) {
return NULL;
}
}
@@ -438,7 +438,7 @@ void limit_block_versions(blockid_t blockid, ctx_t* ctx)
return;
// If this block version we're about to add will hit the version limit
- if (get_num_versions(blockid) + 1 >= rb_yjit_opts.version_limit)
+ if (get_num_versions(blockid) + 1 >= rb_yjit_opts.max_versions)
{
// Produce a generic context that stores no type information,
// but still respects the stack_size and sp_offset constraints
diff --git a/yjit_iface.c b/yjit_iface.c
index 754a2d6529..e8f268e48c 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -1100,8 +1100,8 @@ rb_yjit_init(struct rb_yjit_options *options)
if (rb_yjit_opts.call_threshold < 1) {
rb_yjit_opts.call_threshold = 10;
}
- if (rb_yjit_opts.version_limit < 1) {
- rb_yjit_opts.version_limit = 4;
+ if (rb_yjit_opts.max_versions < 1) {
+ rb_yjit_opts.max_versions = 4;
}
blocks_assuming_stable_global_constant_state = st_init_numtable();