RESOLVED FIXED 168264
WebAssembly: make code position independent
https://bugs.webkit.org/show_bug.cgi?id=168264
Summary WebAssembly: make code position independent
JF Bastien
Reported 2017-02-13 16:14:09 PST
We'll want to be able to save a WebAssembly.Module's code in IndexDB (#166481) and postMessage (#166480) the WebAssembly.Module cheaply to other workers without having to patch pointers and duplicate physical pages used for code. This allows us to instantiate the same module waaayyy better. Right now our implementation has some pointers baked in: &VM.topInstance, and functions for back traces. We'll want to do away with this. The easiest and fastest thing is probably to store the topInstance in a TLS slot, and then change it when entering js->wasm, doing wasm->wasm calls, and when in a worker (nothing to do here really, it's the same mechanism).
Attachments
JF Bastien
Comment 1 2017-03-13 13:59:17 PDT
There's also code in the trap handling which needs to be updated. It has ([codebegin, codeend) + VM) structures, and the signal handlers have thunks.
Radar WebKit Bug Importer
Comment 2 2017-03-29 17:23:38 PDT
Saam Barati
Comment 3 2017-04-13 19:12:02 PDT
Note You need to log in before you can comment on or make changes to this bug.