summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-06-15 10:19:33 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2022-06-15 10:52:37 -0700
commit23459e4dbb736b28873a85637d141f77167cacee (patch)
tree442e34d267d5a1d3d6930073c0cda417a0cfc93d /mjit.c
parent1162523bae926cfa6128043b635e28c14b732754 (diff)
Move RubyVM::MJIT to builtin Ruby
just less C code to maintain
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mjit.c b/mjit.c
index 93e3d823e4..2e471146b8 100644
--- a/mjit.c
+++ b/mjit.c
@@ -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