RESOLVED FIXED 222552
Make the data backing generated global AtomString values accessible
https://bugs.webkit.org/show_bug.cgi?id=222552
Summary Make the data backing generated global AtomString values accessible
Chris Lord
Reported 2021-03-01 07:41:56 PST
Taking WebKitFontFamilyNames as the example, there are sometimes generated strings that you may want to use from a Worker. Currently this isn't possible, as these are AtomStrings created on the main thread. It would be helpful if the data behind them was accessible so that Worker instances can make their own copies of them if needed. It would be good to modify the generation so that the data variables that are currently private were publicly accessible.
Attachments
Patch (2.02 KB, patch)
2021-03-01 07:45 PST, Chris Lord
no flags
Patch (2.05 KB, patch)
2021-03-04 00:55 PST, Chris Lord
no flags
Chris Lord
Comment 1 2021-03-01 07:45:33 PST
Darin Adler
Comment 2 2021-03-01 12:19:38 PST
Comment on attachment 421826 [details] Patch Is this going to make the binary bigger? Is the name with the "Data" suffix good enough to use outside the file? The choice of the name was "low stakes" since it was used only within the generated code. Now that it’s visible for use elsewhere in WebKit the name could matter a little more.
Chris Lord
Comment 3 2021-03-01 16:25:20 PST
(In reply to Darin Adler from comment #2) > Comment on attachment 421826 [details] > Patch > > Is this going to make the binary bigger? I wouldn't have thought so, but I'm not confident enough to say that's a definite no - I can test it out tomorrow. > Is the name with the "Data" suffix good enough to use outside the file? The > choice of the name was "low stakes" since it was used only within the > generated code. Now that it’s visible for use elsewhere in WebKit the name > could matter a little more. Assuming that the name alone is enough, I think the Data suffix is good enough, but don't have strong feelings about it. Could always suffix it "StaticString", that would certainly make it pretty clear?
Chris Lord
Comment 4 2021-03-02 02:46:21 PST
So testing a release build of before and after the patch, libwebkit2gtk-4.0.so shrinks by 8 bytes (122674608->122674600) and libWebCoreGTK.a increases by 480 bytes (14609776->14610256). Everything else is unaffected.
Chris Lord
Comment 5 2021-03-04 00:55:19 PST
EWS
Comment 6 2021-03-04 01:39:08 PST
Committed r273880: <https://commits.webkit.org/r273880> All reviewed patches have been landed. Closing bug and clearing flags on attachment 422191 [details].
Radar WebKit Bug Importer
Comment 7 2021-03-04 01:40:44 PST
Note You need to log in before you can comment on or make changes to this bug.