Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to start JIT-ting (indutny.com)
92 points by luu on March 12, 2015 | hide | past | favorite | 5 comments


I had a lot of fun recently getting my feet wet with JIT using GNU lightning. I highly recommend to check it out because it's quite small and doesn't require an industrial strength toolchain like LLVM. All you need to get started is on one page: http://www.gnu.org/software/lightning/manual/lightning.html

In case you're curious, I built a working LISP compiler from it, but will have to refactor it soon; it has central flaws in handling (un)boxing. Anyway: https://github.com/mntmn/bomberjacket/blob/master/sledge/com...


On the other hand, it uses lots of macro magic and can break at some points. Also the amount of registers is restricted by 32 bit x86.


It would be nice to have a reference on how to create a JIT compiler. I seems like there really any system surveys of the subject equivalent to the "Dragon Book" for regular compilers.


I'm taking a look to asmJIT (https://github.com/kobalicek/asmjit) , to implement a CPU core JIT emulator for Trillek (https://github.com/trillek-team/trillek-vcomputer-module). But always I find that there is a lack of information of how handle self-rewriting code on a JIT emulator.

Actually I have some ideas using a mix buckets + interval tree to track used/dirty blocks...


I think QEMU is using used/dirty blocks in some way to handle this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: