Bug 168264
Summary: | WebAssembly: make code position independent | ||
---|---|---|---|
Product: | WebKit | Reporter: | JF Bastien <jfbastien> |
Component: | JavaScriptCore | Assignee: | Saam Barati <saam> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | fpizlo, ggaren, jfbastien, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 169611, 169773, 170207, 170210, 170261, 170312, 170488, 170573, 170632 | ||
Bug Blocks: | 166480, 166481 |
JF Bastien
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
JF Bastien
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
<rdar://problem/31335594>
Saam Barati
This is done as of:
https://trac.webkit.org/changeset/215353/webkit