4 ms·
Right but that's how VM's like CRuby do it. Dispatch looks like: goto *(void const *) *virtual_pc_in_register; That gets translated to an indirect jump. The
by jashmatthews 6y ago
Right but that's how VM's like CRuby do it. Dispatch looks like:
goto *(void const *) *virtual_pc_in_register;
That gets translated to an indirect jump. There's no lookup in a dispatch table but that's still an indirect branch.
This is actually marginally better than LuaJIT which does jump * (dispatch_table + *virtual_pc_in_register) but LuaJIT does this so it can swap the dispatch tables to switch to trace recording.