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.
DynASM is an interesting tool (it's used in LuaJIT). I used it to test integer overflow overhead [1] (mainly because I could specify different expression lengths and test `INTO` vs. `JO`).
I'm still perfectly satisfied to remove anything like that from my system. There's even ebuilds out there to install full-featured web browsers without including JIT.
6 comments
[ 3.3 ms ] story [ 20.1 ms ] threadIt'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.
[1] http://boston.conman.org/2015/09/05.2 http://boston.conman.org/2015/09/07.1
I'm still perfectly satisfied to remove anything like that from my system. There's even ebuilds out there to install full-featured web browsers without including JIT.