3 ms·
I would be surprised if block versioning didn't eliminate more type tests (counting dynamically) than a conservative analysis that takes the program graph as-is
by gsg 12y ago
I would be surprised if block versioning didn't eliminate more type tests (counting dynamically) than a conservative analysis that takes the program graph as-is. Code duplication inherently provides more opportunities to specialise, which is why there are so many flavours of it - tail duplication, tracing, inlining, and to a lesser extent loop unswitching all take advantage of the basic trick of copy-and-specialise in various ways.
This basic block scheme seems like a interesting new copy-and-specialise technique for a dynamic compiler. I wonder if there aren't code size explosion problems, though.
- Veedrac 12y ago> I wonder if there aren't code size explosion problems, though. The paper (http://arxiv.org/abs/1411.0352 http://arxiv.org/abs/1411.0352) covers this on page 8. You're likely looking at tiny code-size increases overall.
- tachyonbeam 12y agoAuthor here: the code increases are small indeed. Most blocks only have one version, so the size increases are negligible in most cases, sometimes there is no increase at all. We also have a simple mechanism to completely prevent pathological explosions, which is to say that any given block can't have more than some number K versions.