ruby-changes:68955
From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:19:26 +0900 (JST)
Subject: [ruby-changes:68955] 6883aeda77 (master): Add a macro for tweaking default call threshold
https://git.ruby-lang.org/ruby.git/commit/?id=6883aeda77 From 6883aeda77c09c4982080f968491eacbc43a47e1 Mon Sep 17 00:00:00 2001 From: Alan Wu <XrXr@u...> Date: Wed, 23 Jun 2021 21:19:10 -0400 Subject: Add a macro for tweaking default call threshold For use in development for writing `test.rb` and running with `make run`. --- yjit_iface.c | 2 +- yjit_iface.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/yjit_iface.c b/yjit_iface.c index e8f268e48c..ba3e5bbb83 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -1098,7 +1098,7 @@ rb_yjit_init(struct rb_yjit_options *options) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1098 rb_yjit_opts.exec_mem_size = 256; } if (rb_yjit_opts.call_threshold < 1) { - rb_yjit_opts.call_threshold = 10; + rb_yjit_opts.call_threshold = YJIT_DEFAULT_CALL_THRESHOLD; } if (rb_yjit_opts.max_versions < 1) { rb_yjit_opts.max_versions = 4; diff --git a/yjit_iface.h b/yjit_iface.h index c1f28a5e65..f0980eaf3f 100644 --- a/yjit_iface.h +++ b/yjit_iface.h @@ -11,6 +11,10 @@ https://github.com/ruby/ruby/blob/trunk/yjit_iface.h#L11 #include "vm_core.h" #include "yjit_core.h" +#ifndef YJIT_DEFAULT_CALL_THRESHOLD +# define YJIT_DEFAULT_CALL_THRESHOLD 10 +#endif + #if RUBY_DEBUG #define YJIT_DECLARE_COUNTERS(...) struct rb_yjit_runtime_counters { \ @@ -112,4 +116,4 @@ const VALUE *rb_yjit_count_side_exit_op(const VALUE *exit_pc); https://github.com/ruby/ruby/blob/trunk/yjit_iface.h#L116 void yjit_unlink_method_lookup_dependency(block_t *block); void yjit_block_assumptions_free(block_t *block); -#endif // #ifndef YJIT_IFACE_ +#endif // #ifndef YJIT_IFACE_H -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/