Refactor jit_func_t and jit_exec

I closed https://github.com/ruby/ruby/pull/7543, but part of the diff
seems useful regardless, so I extracted it.
This commit is contained in:
Takashi Kokubun 2023-03-16 10:41:12 -07:00
parent a8e7fee801
commit 9947574b9c
5 changed files with 18 additions and 33 deletions

View file

@ -174,6 +174,14 @@ default: \
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
#endif
#define JIT_EXEC(ec, val) do { \
rb_jit_func_t func; \
if (val == Qundef && (func = jit_compile(ec))) { \
val = func(ec, ec->cfp); \
if (ec->tag->state) THROW_EXCEPTION(val); \
} \
} while (0)
#define SCREG(r) (reg_##r)
#define VM_DEBUG_STACKOVERFLOW 0