4 ms·
IIUC your first option is what is known as threaded code or threaded interpreter https://en.m.wikipedia.org/wiki/Threaded_code https://en.m.wikipedia.org/wiki/
by felixr 6y ago
IIUC your first option is what is known as threaded code or threaded interpreter
https://en.m.wikipedia.org/wiki/Threaded_code https://en.m.wikipedia.org/wiki/Threaded_code
- deleted 6y ago[deleted]
- jashmatthews 6y agoRight 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.