Fully remove asm.js caching
Categories
(Core :: JavaScript: WebAssembly, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: luke, Assigned: luke)
References
Details
Attachments
(5 files, 1 obsolete file)
|
121.98 KB,
patch
|
tt
:
feedback+
|
Details | Diff | Splinter Review |
|
16.55 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
|
29.00 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
|
12.58 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
asm.js caching was making undue work for the parser utf-8 changes (bug 1516697 comment 14), so, since asm.js caching is going away before too long anyway, I r+'d turning it off for good.
This bug is about sweeping all the now-dead remains in SpiderMonkey and Gecko.
| Assignee | ||
Comment 1•7 years ago
|
||
Unlike bug 1469395, where we can't simply wipe out wasm IDB entries, I think we can simply wipe out 'asmjs' subdirs when we see them. I wasn't sure quite what the right cut point was in dom/quota, so I tried to pick one that would be noisy if we missed a spot.
30 files changed, 35 insertions(+), 2866 deletions(-)
Comment 2•7 years ago
|
||
| Assignee | ||
Comment 3•7 years ago
|
||
Oops, I forgot to include one local change in the last patch.
| Assignee | ||
Comment 4•7 years ago
|
||
nestedShell() can also go.
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
| Assignee | ||
Comment 7•7 years ago
|
||
I like the sound of your solution! By any chance, while we're cleaning house, could that same upgrade also fix bug 1469395 (by simply blowing away origins that contain wasm-in-IDB)? Then it'll be as if asm.js/wasm had never intruded into dom/quota or dom/indexedb :)
| Assignee | ||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #7)
I like the sound of your solution! By any chance, while we're cleaning house, could that same upgrade also fix bug 1469395 (by simply blowing away origins that contain wasm-in-IDB)? Then it'll be as if asm.js/wasm had never intruded into dom/quota or dom/indexedb :)
I'd say doing that in the indexedDB upgrades for its database.
It's the same concept but there is a small difference since bug 1469395 needs to access databases to see if there is a wasm in indexedDB or not. So, I guess it's better to have a lazy checking in the upgrades for the indexedDB origins itself. So that it won't block a lot of time by opening every database during a QuotaManager upgrade.
For more information, QuotaManager upgrade will block the process of initializing origins until it finishes so that we don't want to do something really long if it's possible.
The lazy checking I mentioned is that only blowing stuff until the first accessing the database for indexedDB of that origin. And, we check and blow the wasm for indexedDB only for the first time (since it's an upgrade for indexedDB database).
| Assignee | ||
Comment 9•7 years ago
|
||
Independent of the dom/asmjscache changes, we can still remove the JS API hooks which enables landing the rm-nested-shell patch.
Comment 10•7 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #6)
Andrew, do you think it's possible to add the remove asmjs logic in
QuotaManager in bug 1423917? If it might create tons of underlying issues
(e.g. if either one has problem, we need to back out two of them), then I
reckon maybe we can add another minor upgrade here.
It seems like we could do the removal as part of that upgrade, yes. It doesn't seem high-risk, but we would want some test coverage. Thankfully, I think you've already created an excellent bunch of test/test infra for this! :)
Comment 11•7 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #7)
I like the sound of your solution! By any chance, while we're cleaning house, could that same upgrade also fix bug 1469395 (by simply blowing away origins that contain wasm-in-IDB)? Then it'll be as if asm.js/wasm had never intruded into dom/quota or dom/indexedb :)
But to be clear re:WASM-in-IDB cleanup, I do not think we want to do that as part of bug 1423917.
Updated•7 years ago
|
| Assignee | ||
Comment 12•7 years ago
|
||
After bug 1423917 lands, what should be the plan in this bug for full removal of dom/asmjscache?
Comment 13•7 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #12)
After bug 1423917 lands, what should be the plan in this bug for full removal of dom/asmjscache?
The attachment 9042200 [details] [diff] [review] should be modified a little bit (removing the part for deleting asmjs directory). I am going to put my comment on it so that it'd be much more clear.
Comment 14•7 years ago
|
||
| Assignee | ||
Comment 15•7 years ago
|
||
Ok, thanks! I'll wait for P9 to land and then rebase this patch.
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
| bugherder | ||
Comment 19•7 years ago
|
||
| Assignee | ||
Comment 20•7 years ago
|
||
I noticed another little bit of simplification in AsmJS.cpp that lets us avoid this optional route whereby the LinkData can be extracted along with the Module (but only if !debugging). The other use of this path (shell serialization) can be modified to use the OptimizedEncodingListener, which actually (slightly) increases its testing coverage.
Some of the other stylistic changes are due to clang-format, not me. I guess we don't have automatic hooks yet so I'm just the first to touch these files with clang-format.
Comment 21•7 years ago
|
||
| bugherder | ||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 24•7 years ago
•
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #22)
- DebugOnly<bool> called = false;
nit: DebugOnly is not 0 bytes in non-debug builds, so we use #ifdef DEBUG
for class members.
You're right in general but given that this is a shell testing function and that it's a MOZ_STACK_CLASS (and thus may be SRA'd anyhow), it didn't seem worth the visual ugliness to me.
So we might need something like:
compileArgs->ionEnabled = IonCanCompile();
#ifdef ENABLE_WASM_CRANELIFT
compileArgs->craneliftEnabled = !IonCanCompile() && CraneliftCanCompile();
// prefer Ion over Cranelift by default.
#endif
Since IonCanCompile() will always be true when CraneliftCanCompile() is true, I think adding this code won't help. I think the real fix is to propagate the --wasm-ion / --wasm-cranelift flags from parent to child so that WasmCompileAndSerialize() in the child can use these flags to pick the right compiler. I think that would be a follow-up, though, when we want to start testing cranelift serialization.
This is correct because even an empty module would have e.g. length headers
for serialized vectors, so the serialized byte vector is never empty, right?
Yep!
Comment 25•7 years ago
|
||
Comment 26•7 years ago
|
||
Comment 27•7 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 28•7 years ago
|
||
| Assignee | ||
Comment 29•7 years ago
|
||
IIUC, the prerequisite bits in bug 1423917 have landed so we can now go ahead with removing the whole dom/asmjscache?
| Assignee | ||
Updated•7 years ago
|
Comment 30•7 years ago
|
||
Comment 31•7 years ago
|
||
| bugherder | ||
Description
•