Off by default. Activate by building buzz with -Djit
Compiles a function when it makes up jit_prof_threshold% of total function calls, or always if buzz is built with -Djit_debug
Will compile any function called by the function being compiled
Will ignore functions using fibers or called in a fiber context: we could use LLVM coroutines but that does not solve how this would interact with the VM (for example if a non-compiled function called a compiled function in a fiber)
Compiling hot code might be slower than just running it
We could estimate the trade off and compile only when it seems beneficial, but that would certainly exclude compilation for a lot of smaller use cases where the compiled code would have made a difference
Alternatives:
DynASM: since it uses the C preprocessor, means we would need to write some C around it
LLVM JIT
By function for now. Once it works and proves to be fast enough, see if we can JIT loops and such.