diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-16 10:41:12 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-16 10:42:17 -0700 |
commit | 9947574b9cad74fbf04fa44d49647c591590c511 (patch) | |
tree | 0a36aa340dc9747c8ef277f96f9712cce8d69b26 /insns.def | |
parent | a8e7fee80129b0ba360c2671582117c8e18a6464 (diff) | |
download | ruby-9947574b9cad74fbf04fa44d49647c591590c511.tar.gz |
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.
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 28 |
1 files changed, 4 insertions, 24 deletions
@@ -813,12 +813,7 @@ send { VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, false); val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - - jit_func_t func; - if (val == Qundef && (func = jit_compile(ec))) { - val = func(ec, ec->cfp); - if (ec->tag->state) THROW_EXCEPTION(val); - } + JIT_EXEC(ec, val); if (val == Qundef) { RESTORE_REGS(); @@ -838,12 +833,7 @@ opt_send_without_block { VALUE bh = VM_BLOCK_HANDLER_NONE; val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method); - - jit_func_t func; - if (val == Qundef && (func = jit_compile(ec))) { - val = func(ec, ec->cfp); - if (ec->tag->state) THROW_EXCEPTION(val); - } + JIT_EXEC(ec, val); if (val == Qundef) { RESTORE_REGS(); @@ -946,12 +936,7 @@ invokesuper { VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true); val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super); - - jit_func_t func; - if (val == Qundef && (func = jit_compile(ec))) { - val = func(ec, ec->cfp); - if (ec->tag->state) THROW_EXCEPTION(val); - } + JIT_EXEC(ec, val); if (val == Qundef) { RESTORE_REGS(); @@ -971,12 +956,7 @@ invokeblock { VALUE bh = VM_BLOCK_HANDLER_NONE; val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_invokeblock); - - jit_func_t func; - if (val == Qundef && (func = jit_compile(ec))) { - val = func(ec, ec->cfp); - if (ec->tag->state) THROW_EXCEPTION(val); - } + JIT_EXEC(ec, val); if (val == Qundef) { RESTORE_REGS(); |