

Basic Block Versioning: A Clearer Picture - jwmerrill
http://pointersgonewild.com/2015/02/08/my-thesis-a-clearer-picture/

======
gsg
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
> 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
Author 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.

------
zellyn
Does anyone else think this would be a fantastic fit for Servo? Seems like a
straightforward approach that performs extremely well.

~~~
ris
What on earth does Servo have to do with this? Servo is a web layout engine.

~~~
zellyn
Sorry, you're correct: I was using "Servo" as shorthand for "a future pure-
rust browser".

Right now, they're emphatically not rewriting all the browser dependencies in
Rust, but I can't imagine them resisting doing so for ever :-)

