Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH

The correct technique now is "Token Threading".
However, the new name was chosen because it was felt that if a different technique was added in the future, there would be no need to replace it.
This commit is contained in:
dearblue
2023-01-05 21:50:17 +09:00
parent db11e07497
commit f6c9191cd0
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -247,6 +247,6 @@ largest value of required alignment.
- Make it available `Symbol.all_symbols` in `mrbgems/mruby-symbol-ext`
- Increase heap memory usage.
`MRB_NO_DIRECT_THREADING`
`MRB_USE_VM_SWITCH_DISPATCH`
- Turn off direct threading optimization in VM loop
- Turn on switch dispatch in VM loop
+2 -2
View File
@@ -176,8 +176,8 @@
#if defined(DISABLE_STDIO) || defined(MRB_DISABLE_STDIO)
# define MRB_NO_STDIO
#endif
#ifdef MRB_DISABLE_DIRECT_THREADING
# define MRB_NO_DIRECT_THREADING
#if defined(MRB_DISABLE_DIRECT_THREADING) || defined(MRB_NO_DIRECT_THREADING)
# define MRB_USE_VM_SWITCH_DISPATCH
#endif
#if defined(ENABLE_DEBUG) || defined(MRB_ENABLE_DEBUG_HOOK)
# define MRB_USE_DEBUG_HOOK
+6 -6
View File
@@ -1251,13 +1251,13 @@ prepare_tagged_break(mrb_state *mrb, uint32_t tag, const struct RProc *proc, mrb
#define BYTECODE_DECODER(x) (x)
#endif
#ifndef MRB_NO_DIRECT_THREADING
#if defined __GNUC__ || defined __clang__ || defined __INTEL_COMPILER
#define DIRECT_THREADED
#ifndef MRB_USE_VM_SWITCH_DISPATCH
#if !defined __GNUC__ && !defined __clang__ && !defined __INTEL_COMPILER
#define MRB_USE_VM_SWITCH_DISPATCH
#endif
#endif /* ifndef MRB_NO_DIRECT_THREADING */
#endif /* ifndef MRB_USE_VM_SWITCH_DISPATCH */
#ifndef DIRECT_THREADED
#ifdef MRB_USE_VM_SWITCH_DISPATCH
#define INIT_DISPATCH for (;;) { insn = BYTECODE_DECODER(*pc); CODE_FETCH_HOOK(mrb, irep, pc, regs); switch (insn) {
#define CASE(insn,ops) case insn: pc++; FETCH_ ## ops (); mrb->c->ci->pc = pc; L_ ## insn ## _BODY:
@@ -1364,7 +1364,7 @@ mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc)
mrb_sym mid;
const struct mrb_irep_catch_handler *ch;
#ifdef DIRECT_THREADED
#ifndef MRB_USE_VM_SWITCH_DISPATCH
static const void * const optable[] = {
#define OPCODE(x,_) &&L_OP_ ## x,
#include "mruby/ops.h"