summaryrefslogtreecommitdiff
path: root/vm_exec.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-07-24 13:51:46 -0700
committerGitHub <noreply@github.com>2023-07-24 13:51:46 -0700
commitcef60e93e6db859b47c818f745be809feb04ae48 (patch)
tree60ac5fe6f0c41aa72b152656d6ce426b1c708d70 /vm_exec.h
parentc4e893ceb5811f3436f1e16cab769a16469b56b0 (diff)
YJIT: Fallback send instructions to vm_sendish (#8106)
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'vm_exec.h')
-rw-r--r--vm_exec.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/vm_exec.h b/vm_exec.h
index dbfd4e9f44..41c4b74ffc 100644
--- a/vm_exec.h
+++ b/vm_exec.h
@@ -169,10 +169,20 @@ default: \
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
#endif
+// Run the interpreter from the JIT
+#define VM_EXEC(ec, val) do { \
+ if (val == Qundef) { \
+ VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH); \
+ val = vm_exec(ec); \
+ } \
+} while (0)
+
+// Run the JIT from the interpreter
#define JIT_EXEC(ec, val) do { \
rb_jit_func_t func; \
if (val == Qundef && (func = jit_compile(ec))) { \
val = func(ec, ec->cfp); \
+ RESTORE_REGS(); /* fix cfp for tailcall */ \
if (ec->tag->state) THROW_EXCEPTION(val); \
} \
} while (0)