Make sure service workers use a ScriptSourceCode backed by file-mapped memory whenever possible. This saves dirty memory in the WebProcess.
Created attachment 424969 [details]
Needs polish but with this patch, warm memory usage on my service worker test case with ~200MB of scripts, the WebContent memory usage goes from 231MB to ~23MB.
The patch does not take care of the cold case yet.
Created attachment 425039 [details]
Created attachment 425046 [details]
The patch should now work in both the warm and cold cases. However, I am waiting for the dependency patch to land before I rebase & clean it up.
Created attachment 425055 [details]
Created attachment 425063 [details]
Created attachment 425071 [details]
Comment on attachment 425071 [details]
Committed r275465: <https://commits.webkit.org/r275465>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 425071 [details].