3 ms·
Let me give you a discription of the compiler and then you can tell me if I understand everything correct. You have a interpreter that for every basic block st
by nickik 15y ago
Let me give you a discription of the compiler and then you can tell me if I understand everything correct.
You have a interpreter that for every basic block starts to record a trace. If you walk in to a basic block (or codeblock) the X-time with the same type you compile it for that type and you set a typeguard. Now everytime the interpreter goes trough there again it does a typecheck then either keeps interpreting or jumps into the compiled block. So if you have basic block in a loop you have to typecheck every time you go threw the loop.
- kmavm 15y agoPretty close. Once we've translated to machine code, the interpreter doesn't do type checks; it blindly enters the translation cache for anything that has a translation, and the guards live in the tracelets themselves. The tracelets directly chain to one another in machine code, so they need embedded guards.
- nickik 15y agoI see. Thx for answering all my questions. Good luck with outperfmorming the static compiler :)