diff options
author | Takashi Kokubun <[email protected]> | 2021-01-04 00:16:40 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2021-01-04 00:24:02 -0800 |
commit | 095972e79959966d1177275fab3cf2e6512f6dd3 (patch) | |
tree | a386aadc53bf972ccbbb8ce3bd4eba75a65bd2b2 /mjit.c | |
parent | 758ac834a2e31888b45d88f3382de614751a0501 (diff) |
Skip mjit_wait if iseq is not a target
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -263,12 +263,26 @@ create_unit(const rb_iseq_t *iseq) iseq->body->jit_unit = unit; } +// Return true if given ISeq body should be compiled by MJIT +static inline int +mjit_target_iseq_p(struct rb_iseq_constant_body *body) +{ + return (body->type == ISEQ_TYPE_METHOD || body->type == ISEQ_TYPE_BLOCK) + && !body->builtin_inline_p + && body->iseq_size < JIT_ISEQ_SIZE_THRESHOLD; +} + static void mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_info *compile_info) { if (!mjit_enabled || pch_status == PCH_FAILED) return; + if (!mjit_target_iseq_p(iseq->body)) { + iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // skip mjit_wait + return; + } + RB_DEBUG_COUNTER_INC(mjit_add_iseq_to_process); iseq->body->jit_func = (mjit_func_t)NOT_READY_JIT_ISEQ_FUNC; create_unit(iseq); |