-
On first look PolkaVM seems to use a static translation approach to me, so I was curious what constraints you have on the original ELF. If I'm wrong and it's a dynamic approach, could you provide a rough overview of the translation strategy? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's a single pass recompiler that translates the whole module when it's instantiated. Here's our toolchain pipeline: Basically the idea is to move as much code and complexity offline into |
Beta Was this translation helpful? Give feedback.
It's a single pass recompiler that translates the whole module when it's instantiated.
Here's our toolchain pipeline:
Basically the idea is to move as much code and complexity offline into
polkavm-linker
. Thepolkavm-linker
is what actually ingests a vanilla RISC-V ELF file and translates it into a form that the VM/recompiler can accept. It supports arbitrary programs as long as no self-modifying code is present and the program doesn't try to inspect its own raw RISC-V machine code nor has any dynamic jumps which depend on the RISC-V machine code offsets being preserved (so 99.9% of programs are compatible).