mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Implement --zjit-call-threshold
As a preparation for introducing a profiling layer, we need to be able to raise the threshold to run a few cycles for profiling.
This commit is contained in:
parent
06d875b979
commit
53bee25068
Notes:
git
2025-04-18 13:48:36 +00:00
4 changed files with 16 additions and 3 deletions
3
vm.c
3
vm.c
|
@ -437,9 +437,10 @@ jit_compile(rb_execution_context_t *ec)
|
|||
// Increment the ISEQ's call counter and trigger JIT compilation if not compiled
|
||||
#if USE_ZJIT
|
||||
extern bool rb_zjit_enabled_p;
|
||||
extern uint64_t rb_zjit_call_threshold;
|
||||
if (body->jit_entry == NULL && rb_zjit_enabled_p) {
|
||||
body->jit_entry_calls++;
|
||||
if (body->jit_entry_calls == 1) {
|
||||
if (body->jit_entry_calls == rb_zjit_call_threshold) {
|
||||
extern void rb_zjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception);
|
||||
rb_zjit_compile_iseq(iseq, ec, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue