4 ms·
Basic Block Versioning: A Clearer Picture
- zellyn 12y agoDoes anyone else think this would be a fantastic fit for Servo? Seems like a straightforward approach that performs extremely well.
- ris 12y agoWhat on earth does Servo have to do with this? Servo is a web layout engine.
- zellyn 12y agoSorry, 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 :-)
- tachyonbeam 12y agoThey may be able to use a new JavaScript engine if they decide to write a whole browser entirely in rust.
- gsg 12y agoI 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.