2 ms·
Do you have a specific virtual machine in mind, or are you asking for general approaches to the problem? A simple approach is to only JIT function bodies, and d
by _delirium 16y ago
Do you have a specific virtual machine in mind, or are you asking for general approaches to the problem? A simple approach is to only JIT function bodies, and deal with all function calls at the VM level. Then all function calls within JITted functions call back into the VM, e.g. by being compiled to some variety of _vm_do_function_call(function, params). Actual VMs include a bunch of other optimizations, of course; which ones are possible depends partly on the language's semantics (e.g. can we assume functions are statically defined, or can they be redefined at runtime?).