by jfmc · 4y ago · 0 comments
I'm asking that because despite all the hype, wasm binaries are still 32-bit (at least in browsers), while 32-bit OS are being deprecated. 64-bit pointers are really good for some applications, with no performance degradation at all.
Does Wasm 2.0 support branch instructions needed for irreducible control flows? (without the relooper hack)
That probably won't be the case with wasm64 unfortunately. A hidden advantage of wasm using a 32 bit address space while primarily targeting 64 bit platforms is that runtimes can get free implicit bounds checking by carving out a 4GB block of virtual memory for each wasm instance, so out-of-bounds accesses are trapped by the hardware.
That trick won't work for wasm64, so runtimes will have to go back to inserting explicit bounds checks at every memory access, and it'll be a tradeoff where in exchange for being able to access more memory everything will run a bit slower.
The only advantage of 64 bit pointers is that you can have a bigger address space than 4GB.
Although an abstract machine could have metadata with each pointer that isn’t part of the official bit size, I suppose.
PNaCL also had a lot of limitations though I don’t remember what they actually were.
[1] https://www.w3.org/TR/wasm-core-2/syntax/instructions.html#m...
I fear they will run out of gas before the interesting features there are completed...