summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2025-04-04 07:39:32 -0700
committerTakashi Kokubun <[email protected]>2025-04-18 21:53:01 +0900
commit2915806820f6fd0686a8a2c4484c961266dcc817 ()
tree6ac2481f350a3bdef60dff0768df89a32c6eeff3 /vm.c
parent31106afdce97313d3598457f1f5b422a04c4af86 (diff)
Add --zjit-num-profiles option (https://.com/Shopify/zjit/pull/98)
* Add --zjit-profile-interval option * Fix min to max * Avoid rewriting instructions for --zjit-call-threshold=1 * Rename the option to --zjit-num-profiles
Notes: Merged: https://.com/ruby/ruby/pull/13131
-rw-r--r--vm.c9
1 files changed, 3 insertions, 6 deletions
@@ -437,15 +437,12 @@ jit_compile(rb_execution_context_t *ec)
struct rb_iseq_constant_body *body = ISEQ_BODY(iseq);
#if USE_ZJIT
-// Number of calls used to profile a YARV instruction for ZJIT
-#define ZJIT_PROFILE_COUNT 1
-
if (body->jit_entry == NULL && rb_zjit_enabled_p) {
body->jit_entry_calls++;
- // At call-threshold - ZJIT_PROFILE_COUNT, rewrite some of the YARV
- // instructions to zjit_* instructions to profile these instructions.
- if (body->jit_entry_calls + ZJIT_PROFILE_COUNT == rb_zjit_call_threshold) {
rb_zjit_profile_iseq(iseq);
}