Clean up remaining NSPR code
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(2 files, 1 obsolete file)
A few things:
- PosixNSPR files have unused functions.
- These days NSPR is only used for JS::DeserializeWasmModule as far as I can see. We should consider either inlining this code and cutting the NSPR dependency completely or making PosixNSPR a more generic "no NSPR" replacement.
Assignee | ||
Comment 1•6 years ago
|
||
Oh there's also the PR_LoadLibraryWithFlags
in shell/js.cpp
...
Assignee | ||
Comment 2•6 years ago
|
||
Steve, can we always use dlopen or something in the JS shell instead of PR_LoadLibraryWithFlags? How much do we care about Windows support for this feature? It seems silly to depend on NSPR just for this :)
Assignee | ||
Comment 3•6 years ago
•
|
||
The NSPR functions we care about for Wasm:
- PR_GetOpenFileInfo to get the file size.
- PR_CreateFileMap
- PR_MemMap
- PR_MemUnmap
- PR_CloseFileMap
Luke, how do you feel about adding our own version of this in js/src/util/? None of these look that complicated and it lets us avoid the NSPR spaghetti code. I don't know if we can get a native file descriptor out of PRFileDesc though... A simpler alternative may be to move MapFile into Gecko. WDYT?
Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #3)
A simpler alternative may be to move MapFile into Gecko.
I posted a patch in bug 1556668, it seemed pretty simple.
Assignee | ||
Updated•6 years ago
|
![]() |
||
Comment 5•6 years ago
|
||
Thanks Jan!
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Stand-alone JS builds now default to without-NSPR on all platforms.
Note that the JS shell builds we do in automation pass --enable-nspr-build so they shouldn't be affected by
the JS shell changes.
Depends on D33932
Just checking, these flags will not exactly be removed immediately, they'll just be turned into no-ops? I'd think it's for bisection reasons...
Assignee | ||
Comment 9•6 years ago
|
||
(In reply to Gary Kwong [:gkw] [:nth10sd] from comment #8)
Just checking, these flags will not exactly be removed immediately, they'll just be turned into no-ops? I'd think it's for bisection reasons...
The patch here does remove the posix-nspr-emulation configure flag, but that's already the default on POSIX platforms so you could just leave it out when bisecting.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1528ef3cf76a
https://hg.mozilla.org/mozilla-central/rev/b314f6c6148e
Assignee | ||
Comment 12•6 years ago
|
||
Gary noticed we can't build without NSPR on Windows due to this unused #include
inside #ifdef XP_WIN. This patch fixes the build.
Updated•6 years ago
|
Comment 13•6 years ago
|
||
Comment on attachment 9073120 [details]
Bug 1560432 - Remove unused NSPR header from vm/Time.cpp. r?sfink!
Revision D35494 was moved to bug 1560432. Setting attachment 9073120 [details] to obsolete.
Description
•