5 ms·
Copy and patch is a variant of QEMU's original "dyngen" backend by Fabrice Bellard[1][2], with more help from the compiler to avoid the maintainability issues t
by bonzini 3y ago
Copy and patch is a variant of QEMU's original "dyngen" backend by Fabrice Bellard[1][2], with more help from the compiler to avoid the maintainability issues that ultimately led QEMU to use a custom code generator.
[1] https://www.usenix.org/legacy/event/usenix05/tech/freenix/full_papers/bellard/bellard.pdf https://www.usenix.org/legacy/event/usenix05/tech/freenix/fu...
[2] https://review.gerrithub.io/plugins/gitiles/spdk/qemu/+/5a246934eb737c242e28995641c9ebf80477b0b7/dyngen.c https://review.gerrithub.io/plugins/gitiles/spdk/qemu/+/5a24...
- monocasa 3y agoWhich itself is how I understand the compilation step of quaject code in the synthesis kernel to have worked. Ie. do constant propagation and dead code elimination on the input format, and use a simple template driven backend to dump out native machine code. In fact I wouldn't be surprised if the earliest compilers were template based, as that's about the only implementation that would fit in a RAM as a compiler pass.
- twbarr 3y agoUltimately, most good ideas were first implemented by Fabrice Bellard.
- KRAKRISMOTT 3y agoCopy and patch goes all the way back to Grace Hopper's original compiler implementation
- lifthrasiir 3y agoThey were called "template-based" JIT and copy-and-patch approach is not new in this regard. The novel idea of copy-and-patch JIT was an automatic code generation via relocatable objects. (By the way, QEMU is indeed cited as an inspiration for copy-and-patch JIT.)
- darknavi 3y agoI am happy to see him working on QuickJS in the last month or so. It could really use some ES2023 love!
- fuzztester 3y agoHeard of him; he's done a lot of stuff. So is he the Bourbaki of software? https://en.m.wikipedia.org/wiki/Nicolas_Bourbaki https://en.m.wikipedia.org/wiki/Nicolas_Bourbaki
- vanderZwan 3y agoWhile I'm sure some people theorize that Fabrice Bellard is actually a pseudonym of a collective of 10x programmers, he is as far as I know just one person.
- fuzztester 3y agoHe he, I forgot to add a wink at the end of my question above.