Commit Graph

6 Commits

Author SHA1 Message Date
bjorn3
3f6a3b5ebe Implement lazy compilation in JIT mode
Lazy compilation has the potential to significantly improve the startup
time of a program. While functions have to be codegened when called, it
is expected that a significant amount of all code is only required when
an error occurs or only when the program is used in certain ways.

The basic approach is to first codegen a shim for each function. This
shim calls the `__cg_clif_jit` function of cg_clif with a pointer to the
`Instance` corresponding to the function for which it is a shim.
`__cg_clif_jit` function then codegens this function and uses the hot
code swapping support of SimpleJIT to redirect future calls to the
function to the real version. Finally it calls the newly codegened
function.
2020-12-25 12:08:21 +01:00
bjorn3
20ffea6b8a Change the way JIT mode is selected 2020-12-25 11:31:33 +01:00
Jakob Hellermann
0f10f2a960 manually fix some shellcheck warnings 2020-11-04 16:14:00 +01:00
Jakob Hellermann
d6a9dfa3d4 run 'shellcheck -f diff $(fd --extension sh) | git apply' 2020-11-04 16:07:42 +01:00
bjorn3
0c34f5aba8 Refactor the build system 2020-11-02 18:17:39 +01:00
bjorn3
cb367602ff Split the actual tests out into scripts/tests.sh 2020-11-01 19:39:44 +01:00