News for hackers. Stuff that matters.
Re:Writing a minimal x86-64 JIT compiler in C++, Part 2 by userbinator on Sunday January 14, 2018 @11:42AM (#16144931)
This is what I'd consider a "minimal x86 JIT": https://news.ycombinator.com/item?id=8746054 ;-)

It's interesting to note that JIT compilation is, for restricted inputs, not much different than self-modifying code. I've used the latter technique several times over the years to get impressive performance boosts, and it doesn't even have to be all that complex --- turning variables into constants and embedding them into immediates in instructions provides the best speedup, especially in tight loops, since it saves a register and/or memory access. Think of a video or image codec --- things like frame sizes, bit depth options, etc. don't change throughout the stream, so "JIT'ing" them with SMC really helps.

There are no comments on this comment yet.