diff options
author | Takashi Kokubun <[email protected]> | 2025-03-03 13:46:53 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:59 +0900 |
commit | 0a543daf15e995ad12b0884bf89ea89b6b480dd2 () | |
tree | 8cadafeccd9da51ea8c11014c3b2ab8701848387 /vm.c | |
parent | 30db473389ca5bb6c68bec72de49330a72a2541c (diff) |
Add zjit_* instructions to profile the interpreter (https://.com/Shopify/zjit/pull/16)
* Add zjit_* instructions to profile the interpreter * Rename FixnumPlus to FixnumAdd * Update a comment about Invalidate * Rename Guard to GuardType * Rename Invalidate to Point * Drop unneeded debug!() * Plan on profiling the types * Use the output of GuardType as type refined outputs
Notes: Merged: https://.com/ruby/ruby/pull/13131
-rw-r--r-- | vm.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -44,6 +44,8 @@ #include "ractor_core.h" #include "vm_sync.h" #include "shape.h" #include "builtin.h" @@ -434,18 +436,26 @@ jit_compile(rb_execution_context_t *ec) const rb_iseq_t *iseq = ec->cfp->iseq; struct rb_iseq_constant_body *body = ISEQ_BODY(iseq); - // 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 == 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); } } #elif USE_YJIT if (body->jit_entry == NULL && rb_yjit_enabled_p) { body->jit_entry_calls++; if (rb_yjit_threshold_hit(iseq, body->jit_entry_calls)) { |