• M
    Reduce wasm table vmem usage · 243b1b6a
    Matt Witherspoon 提交于
    Previously, a 68GB virtual memory map was created per wasm (contract) instance. This eats up the virtual memory space exceptionally quick.
    
    Now, only allocate 12KB per wasm/contract instance. This is enough for 1024 table elements which is hopefully plenty. The side effect is that every indirect function call now has an additional runtime check on its value (checking if it is less than 1024). This seems like an acceptable tradeoff.
    
    Also I have removed the 4GB alignment for the table and replaced it with 4KB. I wasn’t finding any benefit to that 4GB alignment. The generated x86_64 code was simply in the form of *8(%base, %index) so I probably don’t even need 4KB.
    243b1b6a
wasm_tests.cpp 30.7 KB