diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-06-15 10:19:33 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-06-15 10:52:37 -0700 |
commit | 23459e4dbb736b28873a85637d141f77167cacee (patch) | |
tree | 442e34d267d5a1d3d6930073c0cda417a0cfc93d /mjit.c | |
parent | 1162523bae926cfa6128043b635e28c14b732754 (diff) |
Move RubyVM::MJIT to builtin Ruby
just less C code to maintain
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -375,10 +375,12 @@ mjit_notify_waitpid(int status) // Return true if given ISeq body should be compiled by MJIT static inline int -mjit_target_iseq_p(struct rb_iseq_constant_body *body) +mjit_target_iseq_p(const rb_iseq_t *iseq) { + struct rb_iseq_constant_body *body = ISEQ_BODY(iseq); return (body->type == ISEQ_TYPE_METHOD || body->type == ISEQ_TYPE_BLOCK) - && !body->builtin_inline_p; + && !body->builtin_inline_p + && strcmp("<internal:mjit>", RSTRING_PTR(rb_iseq_path(iseq))); } // If recompile_p is true, the call is initiated by mjit_recompile. @@ -389,7 +391,7 @@ mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_inf // TODO: Support non-main Ractors if (!mjit_enabled || pch_status == PCH_FAILED || !rb_ractor_main_p()) return; - if (!mjit_target_iseq_p(ISEQ_BODY(iseq))) { + if (!mjit_target_iseq_p(iseq)) { ISEQ_BODY(iseq)->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // skip mjit_wait return; } @@ -1104,4 +1106,6 @@ mjit_mark_cc_entries(const struct rb_iseq_constant_body *const body) } } +#include "mjit.rbinc" + #endif // USE_MJIT |